You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@vaadin/component-base

Package Overview
Dependencies
Maintainers
12
Versions
568
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/component-base - npm Package Compare versions

Comparing version
25.0.7
to
25.0.8
+4
-4
package.json
{
"name": "@vaadin/component-base",
"version": "25.0.7",
"version": "25.0.8",
"publishConfig": {

@@ -40,8 +40,8 @@ "access": "public"

"devDependencies": {
"@vaadin/chai-plugins": "~25.0.7",
"@vaadin/test-runner-commands": "~25.0.7",
"@vaadin/chai-plugins": "~25.0.8",
"@vaadin/test-runner-commands": "~25.0.8",
"@vaadin/testing-helpers": "^2.0.0",
"sinon": "^21.0.0"
},
"gitHead": "8f3a780477d7dbe30fd473470ede41458e5217b9"
"gitHead": "d49b389a8188b9695abc566d7efa163fe9c1b130"
}

@@ -16,3 +16,3 @@ /**

export function defineCustomElement(CustomElement, version = '25.0.7') {
export function defineCustomElement(CustomElement, version = '25.0.8') {
Object.defineProperty(CustomElement, 'version', {

@@ -19,0 +19,0 @@ get() {

@@ -21,4 +21,2 @@ /**

static version: string;
protected static finalize(): void;
}

@@ -41,5 +41,3 @@ /**

/** @protected */
static finalize() {
super.finalize();
static _ensureRegistrations() {
const { is } = this;

@@ -70,3 +68,5 @@

}
this.constructor._ensureRegistrations();
}
};

@@ -336,2 +336,15 @@ /**

/**
* Adjusts the scroll position to compensate for any offset change of a given index.
* @param {number} index - The index whose scroll offset to restore
* @param {number|undefined} offsetBefore - The scroll offset of the index before the change
* @private
*/
__restoreScrollOffset(index, offsetBefore) {
const offsetAfter = this.__getIndexScrollOffset(index);
if (offsetBefore !== undefined && offsetAfter !== undefined) {
this._scrollTop += offsetBefore - offsetAfter;
}
}
get size() {

@@ -386,6 +399,3 @@ return this.__size;

const fviOffsetAfter = this.__getIndexScrollOffset(fvi);
if (fviOffsetBefore !== undefined && fviOffsetAfter !== undefined) {
this._scrollTop += fviOffsetBefore - fviOffsetAfter;
}
this.__restoreScrollOffset(fvi, fviOffsetBefore);
}

@@ -856,9 +866,19 @@

// Lazily capture scroll state before the first offset change,
// so it can be restored afterwards.
let fvi, fviOffsetBefore;
const captureScrollState = () => {
fvi = this.adjustedFirstVisibleIndex;
fviOffsetBefore = this.__getIndexScrollOffset(fvi);
};
// Near start
if (this._scrollTop === 0) {
this._vidxOffset = 0;
if (oldOffset !== this._vidxOffset) {
if (oldOffset !== 0) {
captureScrollState();
this._vidxOffset = 0;
super.scrollToIndex(0);
}
} else if (this.firstVisibleIndex < threshold && this._vidxOffset > 0) {
captureScrollState();
this._vidxOffset -= Math.min(this._vidxOffset, maxShift);

@@ -870,10 +890,16 @@ super.scrollToIndex(this.firstVisibleIndex + (oldOffset - this._vidxOffset));

if (this._scrollTop >= this._maxScrollTop && this._maxScrollTop > 0) {
this._vidxOffset = maxOffset;
if (oldOffset !== this._vidxOffset) {
if (oldOffset !== maxOffset) {
captureScrollState();
this._vidxOffset = maxOffset;
super.scrollToIndex(this._virtualCount - 1);
}
} else if (this.firstVisibleIndex > this._virtualCount - threshold && this._vidxOffset < maxOffset) {
captureScrollState();
this._vidxOffset += Math.min(maxOffset - this._vidxOffset, maxShift);
super.scrollToIndex(this.firstVisibleIndex - (this._vidxOffset - oldOffset));
}
if (fvi !== undefined) {
this.__restoreScrollOffset(fvi, fviOffsetBefore);
}
}

@@ -880,0 +906,0 @@ }