@vaadin/component-base 23.2.3 → 23.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/a11y-announcer.js +2 -3
- package/src/active-mixin.js +1 -1
- package/src/dir-mixin.js +14 -10
- package/src/element-mixin.js +1 -1
- package/src/virtualizer-iron-list-adapter.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/component-base",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
43
43
|
"sinon": "^13.0.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "ec895786a271257420f69043ffb8de7088cea22c"
|
|
46
46
|
}
|
package/src/a11y-announcer.js
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
6
|
+
import { animationFrame } from './async.js';
|
|
7
|
+
import { Debouncer } from './debounce.js';
|
|
9
8
|
|
|
10
9
|
const region = document.createElement('div');
|
|
11
10
|
|
package/src/active-mixin.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { addListener } from '@vaadin/component-base/src/gestures.js';
|
|
7
6
|
import { DisabledMixin } from './disabled-mixin.js';
|
|
7
|
+
import { addListener } from './gestures.js';
|
|
8
8
|
import { KeyboardMixin } from './keyboard-mixin.js';
|
|
9
9
|
|
|
10
10
|
/**
|
package/src/dir-mixin.js
CHANGED
|
@@ -9,6 +9,7 @@ import { DirHelper } from './dir-helper.js';
|
|
|
9
9
|
* Array of Vaadin custom element classes that have been subscribed to the dir changes.
|
|
10
10
|
*/
|
|
11
11
|
const directionSubscribers = [];
|
|
12
|
+
|
|
12
13
|
function directionUpdater() {
|
|
13
14
|
const documentDir = getDocumentDir();
|
|
14
15
|
directionSubscribers.forEach((element) => {
|
|
@@ -74,7 +75,7 @@ export const DirMixin = (superClass) =>
|
|
|
74
75
|
connectedCallback() {
|
|
75
76
|
super.connectedCallback();
|
|
76
77
|
|
|
77
|
-
if (!this.hasAttribute('dir')) {
|
|
78
|
+
if (!this.hasAttribute('dir') || this.__restoreSubscription) {
|
|
78
79
|
this.__subscribe();
|
|
79
80
|
alignDirs(this, getDocumentDir(), null);
|
|
80
81
|
}
|
|
@@ -100,15 +101,15 @@ export const DirMixin = (superClass) =>
|
|
|
100
101
|
this.__subscribe();
|
|
101
102
|
alignDirs(this, documentDir, newValue);
|
|
102
103
|
} else if (newDiffValue) {
|
|
103
|
-
this.
|
|
104
|
+
this.__unsubscribe();
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/** @protected */
|
|
108
109
|
disconnectedCallback() {
|
|
109
110
|
super.disconnectedCallback();
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
111
|
+
this.__restoreSubscription = directionSubscribers.includes(this);
|
|
112
|
+
this.__unsubscribe();
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
/** @protected */
|
|
@@ -133,12 +134,15 @@ export const DirMixin = (superClass) =>
|
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
/** @private */
|
|
136
|
-
__subscribe(
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
__subscribe() {
|
|
138
|
+
if (!directionSubscribers.includes(this)) {
|
|
139
|
+
directionSubscribers.push(this);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @private */
|
|
144
|
+
__unsubscribe() {
|
|
145
|
+
if (directionSubscribers.includes(this)) {
|
|
142
146
|
directionSubscribers.splice(directionSubscribers.indexOf(this), 1);
|
|
143
147
|
}
|
|
144
148
|
}
|
package/src/element-mixin.js
CHANGED
|
@@ -349,6 +349,12 @@ export class IronListAdapter {
|
|
|
349
349
|
}
|
|
350
350
|
|
|
351
351
|
this.__previousScrollTop = this._scrollTop;
|
|
352
|
+
|
|
353
|
+
// If the first visible index is not 0 when scrolled to the top,
|
|
354
|
+
// add some scroll offset to enable the user to continue scrolling.
|
|
355
|
+
if (this._scrollTop === 0 && this.firstVisibleIndex !== 0) {
|
|
356
|
+
this._scrollTop = 1;
|
|
357
|
+
}
|
|
352
358
|
}
|
|
353
359
|
|
|
354
360
|
/** @private */
|