@shoper/phoenix_design_system 1.18.42-0 → 1.18.43-0
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/build/cjs/packages/phoenix/src/components/slider/slider.js +11 -50
- package/build/cjs/packages/phoenix/src/components/slider/slider.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/slider/slider.d.ts +0 -3
- package/build/esm/packages/phoenix/src/components/slider/slider.js +11 -50
- package/build/esm/packages/phoenix/src/components/slider/slider.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,6 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.settings = '';
|
|
17
17
|
this.id = '';
|
|
18
|
-
this.isSliderOptimizationFlagEnabled = false;
|
|
19
18
|
this._settings = {
|
|
20
19
|
mountOnConnectedCallback: true,
|
|
21
20
|
type: 'loop',
|
|
@@ -36,35 +35,17 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
36
35
|
if ($focusableSlideChildren.length === 0)
|
|
37
36
|
return;
|
|
38
37
|
let updateFocusability;
|
|
39
|
-
|
|
40
|
-
updateFocusability = action === slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? utilities.UiDomUtils.showFocusableElement : utilities.UiDomUtils.hideFocusableElement;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
updateFocusability = action === slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
44
|
-
}
|
|
38
|
+
updateFocusability = action === slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? utilities.UiDomUtils.showFocusableElement : utilities.UiDomUtils.hideFocusableElement;
|
|
45
39
|
$focusableSlideChildren.forEach(($element) => updateFocusability($element));
|
|
46
40
|
};
|
|
47
41
|
this._scanMutationsForNewFocusableElements = (mutationList) => {
|
|
48
|
-
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
if (!(addedNode instanceof HTMLElement))
|
|
52
|
-
continue;
|
|
53
|
-
if (utilities.UiDomUtils.isFocusable(addedNode))
|
|
54
|
-
this._initializeFocusableElement(addedNode);
|
|
55
|
-
const $focusableChildren = [...addedNode.querySelectorAll(utilities.UiDomUtils.getFocusableSelector())];
|
|
56
|
-
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
for (const mutation of mutationList) {
|
|
62
|
-
if (mutation.type !== 'childList')
|
|
42
|
+
for (const mutation of mutationList) {
|
|
43
|
+
for (const addedNode of mutation.addedNodes) {
|
|
44
|
+
if (!(addedNode instanceof HTMLElement))
|
|
63
45
|
continue;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const $focusableChildren = [
|
|
67
|
-
isFocusable && this._initializeFocusableElement($target);
|
|
46
|
+
if (utilities.UiDomUtils.isFocusable(addedNode))
|
|
47
|
+
this._initializeFocusableElement(addedNode);
|
|
48
|
+
const $focusableChildren = [...addedNode.querySelectorAll(utilities.UiDomUtils.getFocusableSelector())];
|
|
68
49
|
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
69
50
|
}
|
|
70
51
|
}
|
|
@@ -96,22 +77,8 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
96
77
|
}
|
|
97
78
|
this._slider.on('visible', this._showFocusableNodes);
|
|
98
79
|
this._slider.on('hidden', this._hideFocusableNodes);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
const mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
105
|
-
mutationObserver.observe(this, { childList: true, subtree: true, attributes: true });
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
_showFocusableElement($element) {
|
|
109
|
-
$element.setAttribute('tabindex', '0');
|
|
110
|
-
$element.removeAttribute('aria-hidden');
|
|
111
|
-
}
|
|
112
|
-
_hideFocusableElement($element) {
|
|
113
|
-
$element.setAttribute('tabindex', '-1');
|
|
114
|
-
$element.setAttribute('aria-hidden', 'true');
|
|
80
|
+
this._mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
81
|
+
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
115
82
|
}
|
|
116
83
|
getSlider() {
|
|
117
84
|
return this._slider;
|
|
@@ -121,10 +88,8 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
121
88
|
super.disconnectedCallback();
|
|
122
89
|
(_a = this._slider) === null || _a === void 0 ? void 0 : _a.off('visible');
|
|
123
90
|
(_b = this._slider) === null || _b === void 0 ? void 0 : _b.off('hidden');
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this._mutationObserver = null;
|
|
127
|
-
}
|
|
91
|
+
(_c = this._mutationObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
92
|
+
this._mutationObserver = null;
|
|
128
93
|
}
|
|
129
94
|
};
|
|
130
95
|
tslib_es6.__decorate([
|
|
@@ -135,10 +100,6 @@ tslib_es6.__decorate([
|
|
|
135
100
|
decorators.property(),
|
|
136
101
|
tslib_es6.__metadata("design:type", String)
|
|
137
102
|
], exports.HSlider.prototype, "id", void 0);
|
|
138
|
-
tslib_es6.__decorate([
|
|
139
|
-
decorators.property({ attribute: 'is-slider-optimization-flag-enabled' }),
|
|
140
|
-
tslib_es6.__metadata("design:type", Boolean)
|
|
141
|
-
], exports.HSlider.prototype, "isSliderOptimizationFlagEnabled", void 0);
|
|
142
103
|
exports.HSlider = tslib_es6.__decorate([
|
|
143
104
|
phoenix_custom_element.phoenixCustomElement('h-slider')
|
|
144
105
|
], exports.HSlider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA,yBAAyB,gEAAoE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA,yBAAyB,gEAAoE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -3,7 +3,6 @@ import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/pho
|
|
|
3
3
|
export declare class HSlider extends PhoenixLightLitElement {
|
|
4
4
|
settings: string;
|
|
5
5
|
id: string;
|
|
6
|
-
isSliderOptimizationFlagEnabled: boolean;
|
|
7
6
|
get sliderSettings(): ISliderOptions;
|
|
8
7
|
set sliderSettings(newSettingsObject: ISliderOptions);
|
|
9
8
|
private _settings;
|
|
@@ -14,8 +13,6 @@ export declare class HSlider extends PhoenixLightLitElement {
|
|
|
14
13
|
private _showFocusableNodes;
|
|
15
14
|
private _hideFocusableNodes;
|
|
16
15
|
private _handleFocusableNodes;
|
|
17
|
-
private _showFocusableElement;
|
|
18
|
-
private _hideFocusableElement;
|
|
19
16
|
private _scanMutationsForNewFocusableElements;
|
|
20
17
|
private _initializeFocusableElement;
|
|
21
18
|
getSlider(): ISlider | null;
|
|
@@ -11,7 +11,6 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
11
11
|
super(...arguments);
|
|
12
12
|
this.settings = '';
|
|
13
13
|
this.id = '';
|
|
14
|
-
this.isSliderOptimizationFlagEnabled = false;
|
|
15
14
|
this._settings = {
|
|
16
15
|
mountOnConnectedCallback: true,
|
|
17
16
|
type: 'loop',
|
|
@@ -32,35 +31,17 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
32
31
|
if ($focusableSlideChildren.length === 0)
|
|
33
32
|
return;
|
|
34
33
|
let updateFocusability;
|
|
35
|
-
|
|
36
|
-
updateFocusability = action === SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? UiDomUtils.showFocusableElement : UiDomUtils.hideFocusableElement;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
updateFocusability = action === SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
40
|
-
}
|
|
34
|
+
updateFocusability = action === SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? UiDomUtils.showFocusableElement : UiDomUtils.hideFocusableElement;
|
|
41
35
|
$focusableSlideChildren.forEach(($element) => updateFocusability($element));
|
|
42
36
|
};
|
|
43
37
|
this._scanMutationsForNewFocusableElements = (mutationList) => {
|
|
44
|
-
|
|
45
|
-
for (const
|
|
46
|
-
|
|
47
|
-
if (!(addedNode instanceof HTMLElement))
|
|
48
|
-
continue;
|
|
49
|
-
if (UiDomUtils.isFocusable(addedNode))
|
|
50
|
-
this._initializeFocusableElement(addedNode);
|
|
51
|
-
const $focusableChildren = [...addedNode.querySelectorAll(UiDomUtils.getFocusableSelector())];
|
|
52
|
-
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
for (const mutation of mutationList) {
|
|
58
|
-
if (mutation.type !== 'childList')
|
|
38
|
+
for (const mutation of mutationList) {
|
|
39
|
+
for (const addedNode of mutation.addedNodes) {
|
|
40
|
+
if (!(addedNode instanceof HTMLElement))
|
|
59
41
|
continue;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const $focusableChildren = [
|
|
63
|
-
isFocusable && this._initializeFocusableElement($target);
|
|
42
|
+
if (UiDomUtils.isFocusable(addedNode))
|
|
43
|
+
this._initializeFocusableElement(addedNode);
|
|
44
|
+
const $focusableChildren = [...addedNode.querySelectorAll(UiDomUtils.getFocusableSelector())];
|
|
64
45
|
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
65
46
|
}
|
|
66
47
|
}
|
|
@@ -92,22 +73,8 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
92
73
|
}
|
|
93
74
|
this._slider.on('visible', this._showFocusableNodes);
|
|
94
75
|
this._slider.on('hidden', this._hideFocusableNodes);
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
const mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
101
|
-
mutationObserver.observe(this, { childList: true, subtree: true, attributes: true });
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
_showFocusableElement($element) {
|
|
105
|
-
$element.setAttribute('tabindex', '0');
|
|
106
|
-
$element.removeAttribute('aria-hidden');
|
|
107
|
-
}
|
|
108
|
-
_hideFocusableElement($element) {
|
|
109
|
-
$element.setAttribute('tabindex', '-1');
|
|
110
|
-
$element.setAttribute('aria-hidden', 'true');
|
|
76
|
+
this._mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
77
|
+
this._mutationObserver.observe(this, { childList: true, subtree: true });
|
|
111
78
|
}
|
|
112
79
|
getSlider() {
|
|
113
80
|
return this._slider;
|
|
@@ -117,10 +84,8 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
117
84
|
super.disconnectedCallback();
|
|
118
85
|
(_a = this._slider) === null || _a === void 0 ? void 0 : _a.off('visible');
|
|
119
86
|
(_b = this._slider) === null || _b === void 0 ? void 0 : _b.off('hidden');
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this._mutationObserver = null;
|
|
123
|
-
}
|
|
87
|
+
(_c = this._mutationObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
88
|
+
this._mutationObserver = null;
|
|
124
89
|
}
|
|
125
90
|
};
|
|
126
91
|
__decorate([
|
|
@@ -131,10 +96,6 @@ __decorate([
|
|
|
131
96
|
property(),
|
|
132
97
|
__metadata("design:type", String)
|
|
133
98
|
], HSlider.prototype, "id", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
property({ attribute: 'is-slider-optimization-flag-enabled' }),
|
|
136
|
-
__metadata("design:type", Boolean)
|
|
137
|
-
], HSlider.prototype, "isSliderOptimizationFlagEnabled", void 0);
|
|
138
99
|
HSlider = __decorate([
|
|
139
100
|
phoenixCustomElement('h-slider')
|
|
140
101
|
], HSlider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA,uBAAuB,gEAAoE;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA,uBAAuB,gEAAoE;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|