@vaadin/component-base 24.0.0-alpha7 → 24.0.0-alpha9
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.d.ts +1 -1
- package/src/a11y-announcer.js +1 -1
- package/src/active-mixin.d.ts +1 -1
- package/src/active-mixin.js +1 -1
- package/src/browser-utils.js +7 -7
- package/src/controller-mixin.d.ts +1 -1
- package/src/controller-mixin.js +1 -1
- package/src/delegate-focus-mixin.d.ts +48 -0
- package/src/delegate-focus-mixin.js +228 -0
- package/src/delegate-state-mixin.d.ts +20 -0
- package/src/delegate-state-mixin.js +125 -0
- package/src/dir-mixin.d.ts +1 -5
- package/src/dir-mixin.js +1 -31
- package/src/dir-utils.d.ts +19 -0
- package/src/dir-utils.js +36 -0
- package/src/disabled-mixin.d.ts +1 -1
- package/src/disabled-mixin.js +1 -1
- package/src/dom-utils.d.ts +1 -1
- package/src/dom-utils.js +1 -1
- package/src/element-mixin.d.ts +1 -1
- package/src/element-mixin.js +11 -5
- package/src/focus-mixin.d.ts +1 -1
- package/src/focus-mixin.js +1 -1
- package/src/focus-trap-controller.d.ts +1 -1
- package/src/focus-trap-controller.js +1 -1
- package/src/focus-utils.d.ts +1 -1
- package/src/focus-utils.js +1 -1
- package/src/gestures.js +1 -1
- package/src/iron-list-core.js +32 -12
- package/src/keyboard-direction-mixin.d.ts +1 -1
- package/src/keyboard-direction-mixin.js +1 -1
- package/src/keyboard-mixin.d.ts +1 -1
- package/src/keyboard-mixin.js +1 -1
- package/src/list-mixin.d.ts +1 -1
- package/src/list-mixin.js +5 -6
- package/src/media-query-controller.d.ts +1 -1
- package/src/media-query-controller.js +1 -1
- package/src/overflow-controller.d.ts +1 -1
- package/src/overflow-controller.js +1 -1
- package/src/overlay-class-mixin.d.ts +33 -0
- package/src/overlay-class-mixin.js +79 -0
- package/src/polylit-mixin.d.ts +1 -1
- package/src/polylit-mixin.js +9 -4
- package/src/resize-mixin.d.ts +1 -1
- package/src/resize-mixin.js +1 -1
- package/src/{slot-observe-controller.d.ts → slot-child-observe-controller.d.ts} +2 -2
- package/src/{slot-observe-controller.js → slot-child-observe-controller.js} +2 -2
- package/src/slot-controller.d.ts +1 -1
- package/src/slot-controller.js +1 -1
- package/src/tabindex-mixin.d.ts +1 -1
- package/src/tabindex-mixin.js +1 -1
- package/src/templates.js +1 -1
- package/src/tooltip-controller.d.ts +1 -1
- package/src/tooltip-controller.js +1 -1
- package/src/unique-id-utils.d.ts +1 -1
- package/src/unique-id-utils.js +1 -1
- package/src/virtualizer-iron-list-adapter.js +65 -9
- package/src/dir-helper.d.ts +0 -42
- package/src/dir-helper.js +0 -93
package/src/dom-utils.js
CHANGED
package/src/element-mixin.d.ts
CHANGED
package/src/element-mixin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { setCancelSyntheticClickEvents } from '@polymer/polymer/lib/utils/settings.js';
|
|
@@ -15,14 +15,20 @@ import { DirMixin } from './dir-mixin.js';
|
|
|
15
15
|
// for buttons that are based on `[role=button]` e.g vaadin-button.
|
|
16
16
|
setCancelSyntheticClickEvents(false);
|
|
17
17
|
|
|
18
|
-
window.Vaadin
|
|
18
|
+
if (!window.Vaadin) {
|
|
19
|
+
window.Vaadin = {};
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Array of Vaadin custom element classes that have been finalized.
|
|
22
24
|
*/
|
|
23
|
-
window.Vaadin.registrations
|
|
25
|
+
if (!window.Vaadin.registrations) {
|
|
26
|
+
window.Vaadin.registrations = [];
|
|
27
|
+
}
|
|
24
28
|
|
|
25
|
-
window.Vaadin.developmentModeCallback
|
|
29
|
+
if (!window.Vaadin.developmentModeCallback) {
|
|
30
|
+
window.Vaadin.developmentModeCallback = {};
|
|
31
|
+
}
|
|
26
32
|
|
|
27
33
|
window.Vaadin.developmentModeCallback['vaadin-usage-statistics'] = function () {
|
|
28
34
|
usageStatistics();
|
|
@@ -39,7 +45,7 @@ const registered = new Set();
|
|
|
39
45
|
export const ElementMixin = (superClass) =>
|
|
40
46
|
class VaadinElementMixin extends DirMixin(superClass) {
|
|
41
47
|
static get version() {
|
|
42
|
-
return '24.0.0-
|
|
48
|
+
return '24.0.0-alpha9';
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
/** @protected */
|
package/src/focus-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/focus-mixin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { getFocusableElements, isElementFocused } from './focus-utils.js';
|
package/src/focus-utils.d.ts
CHANGED
package/src/focus-utils.js
CHANGED
package/src/gestures.js
CHANGED
|
@@ -90,7 +90,7 @@ function PASSIVE_TOUCH(eventName) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
// Check for touch-only devices
|
|
93
|
-
const IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);
|
|
93
|
+
const IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u);
|
|
94
94
|
|
|
95
95
|
// Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute
|
|
96
96
|
/** @type {!Object<boolean>} */
|
package/src/iron-list-core.js
CHANGED
|
@@ -10,12 +10,22 @@
|
|
|
10
10
|
import { animationFrame, idlePeriod, microTask } from './async.js';
|
|
11
11
|
import { Debouncer, enqueueDebouncer, flush } from './debounce.js';
|
|
12
12
|
|
|
13
|
-
const IOS = navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/);
|
|
13
|
+
const IOS = navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u);
|
|
14
14
|
const IOS_TOUCH_SCROLLING = IOS && IOS[1] >= 8;
|
|
15
15
|
const DEFAULT_PHYSICAL_COUNT = 3;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* DO NOT EDIT THIS FILE!
|
|
19
|
+
*
|
|
20
|
+
* This file includes the iron-list scrolling engine copied from
|
|
21
|
+
* https://github.com/PolymerElements/iron-list/blob/master/iron-list.js
|
|
22
|
+
*
|
|
23
|
+
* If something in the scrolling engine needs to be changed
|
|
24
|
+
* for the virtualizer's purposes, override a function
|
|
25
|
+
* in virtualizer-iron-list-adapter.js instead of changing it here.
|
|
26
|
+
*
|
|
27
|
+
* This will allow us to keep the iron-list code here as close to
|
|
28
|
+
* the original as possible.
|
|
19
29
|
*/
|
|
20
30
|
export const ironList = {
|
|
21
31
|
/**
|
|
@@ -491,9 +501,12 @@ export const ironList = {
|
|
|
491
501
|
this._physicalIndexForKey = {};
|
|
492
502
|
this._firstVisibleIndexVal = null;
|
|
493
503
|
this._lastVisibleIndexVal = null;
|
|
494
|
-
this.
|
|
495
|
-
|
|
496
|
-
|
|
504
|
+
if (!this._physicalItems) {
|
|
505
|
+
this._physicalItems = [];
|
|
506
|
+
}
|
|
507
|
+
if (!this._physicalSizes) {
|
|
508
|
+
this._physicalSizes = [];
|
|
509
|
+
}
|
|
497
510
|
this._physicalStart = 0;
|
|
498
511
|
if (this._scrollTop > this._scrollOffset) {
|
|
499
512
|
this._resetScrollPosition(0);
|
|
@@ -635,16 +648,21 @@ export const ironList = {
|
|
|
635
648
|
* @param {boolean=} forceUpdate If true, updates the height no matter what.
|
|
636
649
|
*/
|
|
637
650
|
_updateScrollerSize(forceUpdate) {
|
|
638
|
-
|
|
651
|
+
const estScrollHeight =
|
|
639
652
|
this._physicalBottom +
|
|
640
653
|
Math.max(this._virtualCount - this._physicalCount - this._virtualStart, 0) * this._physicalAverage;
|
|
641
654
|
|
|
642
|
-
|
|
643
|
-
|
|
655
|
+
this._estScrollHeight = estScrollHeight;
|
|
656
|
+
|
|
644
657
|
// Amortize height adjustment, so it won't trigger large repaints too often.
|
|
645
|
-
if (
|
|
646
|
-
|
|
647
|
-
this._scrollHeight
|
|
658
|
+
if (
|
|
659
|
+
forceUpdate ||
|
|
660
|
+
this._scrollHeight === 0 ||
|
|
661
|
+
this._scrollPosition >= estScrollHeight - this._physicalSize ||
|
|
662
|
+
Math.abs(estScrollHeight - this._scrollHeight) >= this._viewportHeight
|
|
663
|
+
) {
|
|
664
|
+
this.$.items.style.height = `${estScrollHeight}px`;
|
|
665
|
+
this._scrollHeight = estScrollHeight;
|
|
648
666
|
}
|
|
649
667
|
},
|
|
650
668
|
|
|
@@ -740,7 +758,9 @@ export const ironList = {
|
|
|
740
758
|
},
|
|
741
759
|
|
|
742
760
|
_debounce(name, cb, asyncModule) {
|
|
743
|
-
this._debouncers
|
|
761
|
+
if (!this._debouncers) {
|
|
762
|
+
this._debouncers = {};
|
|
763
|
+
}
|
|
744
764
|
this._debouncers[name] = Debouncer.debounce(this._debouncers[name], asyncModule, cb.bind(this));
|
|
745
765
|
enqueueDebouncer(this._debouncers[name]);
|
|
746
766
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2022 Vaadin Ltd.
|
|
3
|
+
* Copyright (c) 2022 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { isElementFocused, isElementHidden } from './focus-utils.js';
|
package/src/keyboard-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/keyboard-mixin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
|
package/src/list-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/list-mixin.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
7
7
|
import { timeOut } from './async.js';
|
|
8
8
|
import { Debouncer } from './debounce.js';
|
|
9
|
-
import {
|
|
9
|
+
import { getNormalizedScrollLeft, setNormalizedScrollLeft } from './dir-utils.js';
|
|
10
10
|
import { KeyboardDirectionMixin } from './keyboard-direction-mixin.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -213,7 +213,7 @@ export const ListMixin = (superClass) =>
|
|
|
213
213
|
const key = event.key;
|
|
214
214
|
|
|
215
215
|
const currentIdx = this.items.indexOf(this.focused);
|
|
216
|
-
if (/[a-zA-Z0-9]
|
|
216
|
+
if (/[a-zA-Z0-9]/u.test(key) && key.length === 1) {
|
|
217
217
|
const idx = this._searchKey(currentIdx, key);
|
|
218
218
|
if (idx >= 0) {
|
|
219
219
|
this._focus(idx);
|
|
@@ -327,9 +327,8 @@ export const ListMixin = (superClass) =>
|
|
|
327
327
|
this._scrollerElement.scrollTop += pixels;
|
|
328
328
|
} else {
|
|
329
329
|
const dir = this.getAttribute('dir') || 'ltr';
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
DirHelper.setNormalizedScrollLeft(scrollType, dir, this._scrollerElement, scrollLeft);
|
|
330
|
+
const scrollLeft = getNormalizedScrollLeft(this._scrollerElement, dir) + pixels;
|
|
331
|
+
setNormalizedScrollLeft(this._scrollerElement, dir, scrollLeft);
|
|
333
332
|
}
|
|
334
333
|
}
|
|
335
334
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A mixin that forwards CSS class names to the internal overlay element
|
|
10
|
+
* by setting the `overlayClass` property or `overlay-class` attribute.
|
|
11
|
+
*/
|
|
12
|
+
export declare function OverlayClassMixin<T extends Constructor<HTMLElement>>(
|
|
13
|
+
base: T,
|
|
14
|
+
): Constructor<OverlayClassMixinClass> & T;
|
|
15
|
+
|
|
16
|
+
export declare class OverlayClassMixinClass {
|
|
17
|
+
/**
|
|
18
|
+
* A space-delimited list of CSS class names to set on the overlay element.
|
|
19
|
+
* This property does not affect other CSS class names set manually via JS.
|
|
20
|
+
*
|
|
21
|
+
* Note, if the CSS class name was set with this property, clearing it will
|
|
22
|
+
* remove it from the overlay, even if the same class name was also added
|
|
23
|
+
* manually, e.g. by using `classList.add()` in the `renderer` function.
|
|
24
|
+
*
|
|
25
|
+
* @attr {string} overlay-class
|
|
26
|
+
*/
|
|
27
|
+
overlayClass: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* An overlay element on which CSS class names are set.
|
|
31
|
+
*/
|
|
32
|
+
protected _overlayElement: HTMLElement;
|
|
33
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A mixin that forwards CSS class names to the internal overlay element
|
|
9
|
+
* by setting the `overlayClass` property or `overlay-class` attribute.
|
|
10
|
+
*
|
|
11
|
+
* @polymerMixin
|
|
12
|
+
*/
|
|
13
|
+
export const OverlayClassMixin = (superclass) =>
|
|
14
|
+
class OverlayClassMixinClass extends superclass {
|
|
15
|
+
static get properties() {
|
|
16
|
+
return {
|
|
17
|
+
/**
|
|
18
|
+
* A space-delimited list of CSS class names to set on the overlay element.
|
|
19
|
+
* This property does not affect other CSS class names set manually via JS.
|
|
20
|
+
*
|
|
21
|
+
* Note, if the CSS class name was set with this property, clearing it will
|
|
22
|
+
* remove it from the overlay, even if the same class name was also added
|
|
23
|
+
* manually, e.g. by using `classList.add()` in the `renderer` function.
|
|
24
|
+
*
|
|
25
|
+
* @attr {string} overlay-class
|
|
26
|
+
*/
|
|
27
|
+
overlayClass: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* An overlay element on which CSS class names are set.
|
|
33
|
+
*
|
|
34
|
+
* @protected
|
|
35
|
+
*/
|
|
36
|
+
_overlayElement: {
|
|
37
|
+
type: Object,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static get observers() {
|
|
43
|
+
return ['__updateOverlayClassNames(overlayClass, _overlayElement)'];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** @private */
|
|
47
|
+
__updateOverlayClassNames(overlayClass, overlayElement) {
|
|
48
|
+
if (!overlayElement) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Overlay is set but overlayClass is not set
|
|
53
|
+
if (overlayClass === undefined) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const { classList } = overlayElement;
|
|
58
|
+
|
|
59
|
+
if (!this.__initialClasses) {
|
|
60
|
+
this.__initialClasses = new Set(classList);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (Array.isArray(this.__previousClasses)) {
|
|
64
|
+
// Remove old classes that no longer apply
|
|
65
|
+
const classesToRemove = this.__previousClasses.filter((name) => !this.__initialClasses.has(name));
|
|
66
|
+
if (classesToRemove.length > 0) {
|
|
67
|
+
classList.remove(...classesToRemove);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Add new classes based on the overlayClass
|
|
72
|
+
const classesToAdd = typeof overlayClass === 'string' ? overlayClass.split(' ') : [];
|
|
73
|
+
if (classesToAdd.length > 0) {
|
|
74
|
+
classList.add(...classesToAdd);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this.__previousClasses = classesToAdd;
|
|
78
|
+
}
|
|
79
|
+
};
|
package/src/polylit-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/polylit-mixin.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { dedupeMixin } from '@open-wc/dedupe-mixin';
|
|
7
7
|
|
|
8
8
|
const caseMap = {};
|
|
9
9
|
|
|
10
|
-
const CAMEL_TO_DASH = /([A-Z])/
|
|
10
|
+
const CAMEL_TO_DASH = /([A-Z])/gu;
|
|
11
11
|
|
|
12
12
|
function camelToDash(camel) {
|
|
13
|
-
caseMap[camel]
|
|
13
|
+
if (!caseMap[camel]) {
|
|
14
|
+
caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase();
|
|
15
|
+
}
|
|
14
16
|
return caseMap[camel];
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -169,7 +171,10 @@ const PolylitMixinImplementation = (superclass) => {
|
|
|
169
171
|
firstUpdated() {
|
|
170
172
|
super.firstUpdated();
|
|
171
173
|
|
|
172
|
-
this.$
|
|
174
|
+
if (!this.$) {
|
|
175
|
+
this.$ = {};
|
|
176
|
+
}
|
|
177
|
+
|
|
173
178
|
this.shadowRoot.querySelectorAll('[id]').forEach((node) => {
|
|
174
179
|
this.$[node.id] = node;
|
|
175
180
|
});
|
package/src/resize-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/resize-mixin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2022 Vaadin Ltd.
|
|
3
|
+
* Copyright (c) 2022 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { SlotController } from './slot-controller.js';
|
|
@@ -9,7 +9,7 @@ import { SlotController } from './slot-controller.js';
|
|
|
9
9
|
* A controller that observes slotted element mutations, especially ID attribute
|
|
10
10
|
* and the text content, and fires an event to notify host element about those.
|
|
11
11
|
*/
|
|
12
|
-
export class
|
|
12
|
+
export class SlotChildObserveController extends SlotController {
|
|
13
13
|
/**
|
|
14
14
|
* Setup the mutation observer on the node to update ID and notify host.
|
|
15
15
|
* Node doesn't get observed automatically until this method is called.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2022 Vaadin Ltd.
|
|
3
|
+
* Copyright (c) 2022 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { SlotController } from './slot-controller.js';
|
|
@@ -9,7 +9,7 @@ import { SlotController } from './slot-controller.js';
|
|
|
9
9
|
* A controller that observes slotted element mutations, especially ID attribute
|
|
10
10
|
* and the text content, and fires an event to notify host element about those.
|
|
11
11
|
*/
|
|
12
|
-
export class
|
|
12
|
+
export class SlotChildObserveController extends SlotController {
|
|
13
13
|
constructor(host, slot, tagName, config = {}) {
|
|
14
14
|
super(host, slot, tagName, { ...config, useUniqueId: true });
|
|
15
15
|
}
|
package/src/slot-controller.d.ts
CHANGED
package/src/slot-controller.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
|
package/src/tabindex-mixin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2021 -
|
|
3
|
+
* Copyright (c) 2021 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
package/src/tabindex-mixin.js
CHANGED
package/src/templates.js
CHANGED
package/src/unique-id-utils.d.ts
CHANGED