@vaadin/component-base
Advanced tools
Comparing version
{ | ||
"name": "@vaadin/component-base", | ||
"version": "24.8.0-alpha1", | ||
"version": "24.8.0-alpha10", | ||
"publishConfig": { | ||
@@ -41,8 +41,8 @@ "access": "public" | ||
"devDependencies": { | ||
"@vaadin/chai-plugins": "24.8.0-alpha1", | ||
"@vaadin/test-runner-commands": "24.8.0-alpha1", | ||
"@vaadin/chai-plugins": "24.8.0-alpha10", | ||
"@vaadin/test-runner-commands": "24.8.0-alpha10", | ||
"@vaadin/testing-helpers": "^1.1.0", | ||
"sinon": "^18.0.0" | ||
}, | ||
"gitHead": "dfec8767c5d1c343ae689c93429c3364f4182f76" | ||
"gitHead": "f8c79ffc67eccc3ade226dfe52fbf7d3d46428cf" | ||
} |
@@ -16,3 +16,3 @@ /** | ||
export function defineCustomElement(CustomElement, version = '24.8.0-alpha1') { | ||
export function defineCustomElement(CustomElement, version = '24.8.0-alpha10') { | ||
Object.defineProperty(CustomElement, 'version', { | ||
@@ -19,0 +19,0 @@ get() { |
@@ -9,13 +9,2 @@ /** | ||
/** | ||
* Recursively makes all properties of an i18n object optional. | ||
* | ||
* For internal use only. | ||
*/ | ||
export type PartialI18n<T> = T extends object | ||
? { | ||
[P in keyof T]?: PartialI18n<T[P]>; | ||
} | ||
: T; | ||
/** | ||
* A mixin that allows to set partial I18N properties. | ||
@@ -22,0 +11,0 @@ */ |
@@ -45,2 +45,12 @@ /** | ||
/** @private */ | ||
// Technically declaring a Polymer property is not needed, as we have a | ||
// getter/setter for it below. However, the React components currently | ||
// rely on the Polymer property declaration to detect which properties | ||
// are available on a custom element, so we add a dummy declaration for | ||
// it. | ||
i18n: { | ||
type: Object, | ||
}, | ||
/** @private */ | ||
__effectiveI18n: { | ||
@@ -84,2 +94,5 @@ type: Object, | ||
set i18n(value) { | ||
if (value === this.__customI18n) { | ||
return; | ||
} | ||
this.__customI18n = value; | ||
@@ -86,0 +99,0 @@ this.__effectiveI18n = deepMerge({}, defaultI18n, this.__customI18n); |
@@ -53,3 +53,3 @@ /** | ||
get slotStyles() { | ||
return {}; | ||
return []; | ||
} | ||
@@ -56,0 +56,0 @@ |
@@ -181,2 +181,12 @@ /** | ||
hostConnected() { | ||
// Restore scroll position, which is reset when host is removed from DOM, | ||
// since virtualizer doesn't re-render when adding it to the DOM again. | ||
// If the scroll target isn't visible and its `offsetParent` is `null`, wait | ||
// for the ResizeObserver to handle this case (hiding -> moving -> showing). | ||
if (this.scrollTarget.offsetParent && this.scrollTarget.scrollTop !== this._scrollPosition) { | ||
this.scrollTarget.scrollTop = this._scrollPosition; | ||
} | ||
} | ||
update(startIndex = 0, endIndex = this.size - 1) { | ||
@@ -183,0 +193,0 @@ const updatedElements = []; |
@@ -83,2 +83,11 @@ import { IronListAdapter } from './virtualizer-iron-list-adapter.js'; | ||
} | ||
/** | ||
* Notifies the virtualizer about its host element connected to the DOM. | ||
* | ||
* @method hostConnected | ||
*/ | ||
hostConnected() { | ||
this.__adapter.hostConnected(); | ||
} | ||
} |
226752
0.42%6682
0.29%