@shoper/phoenix_design_system 1.17.0-0 → 1.17.0-1
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.
|
@@ -36,6 +36,17 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
36
36
|
const updateFocusability = action === slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
37
37
|
$focusableSlideChildren.forEach(($element) => (updateFocusability($element)));
|
|
38
38
|
};
|
|
39
|
+
this._scanMutationsForNewFocusableElements = (mutationList) => {
|
|
40
|
+
for (const mutation of mutationList) {
|
|
41
|
+
if (mutation.type !== "childList")
|
|
42
|
+
continue;
|
|
43
|
+
const $target = mutation.target;
|
|
44
|
+
const isFocusable = utilities.UiDomUtils.isFocusable($target);
|
|
45
|
+
const $focusableChildren = [...$target.querySelectorAll(utilities.UiDomUtils.getFocusableSelector())];
|
|
46
|
+
isFocusable && this._initializeFocusableElement($target);
|
|
47
|
+
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
39
50
|
this._initializeFocusableElement = ($element) => {
|
|
40
51
|
!this._$focusableElements.includes($element) && this._$focusableElements.push($element);
|
|
41
52
|
if ($element.closest('[aria-hidden="true"]')) {
|
|
@@ -74,17 +85,6 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
74
85
|
$element.setAttribute('tabindex', '-1');
|
|
75
86
|
$element.setAttribute('aria-hidden', 'true');
|
|
76
87
|
}
|
|
77
|
-
_scanMutationsForNewFocusableElements(mutationList) {
|
|
78
|
-
for (const mutation of mutationList) {
|
|
79
|
-
if (mutation.type !== "childList")
|
|
80
|
-
continue;
|
|
81
|
-
const $target = mutation.target;
|
|
82
|
-
const isFocusable = utilities.UiDomUtils.isFocusable($target);
|
|
83
|
-
const $focusableChildren = [...$target.querySelectorAll(utilities.UiDomUtils.getFocusableSelector())];
|
|
84
|
-
isFocusable && this._initializeFocusableElement($target);
|
|
85
|
-
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
88
|
getSlider() {
|
|
89
89
|
return this._slider;
|
|
90
90
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { property } from 'lit/decorators';
|
|
3
|
-
import {
|
|
3
|
+
import { UiDomUtils, JsonUtils } from '@dreamcommerce/utilities';
|
|
4
4
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
5
5
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
6
6
|
import { Splide } from '../../../../../external/@splidejs/splide/dist/js/splide.esm.js';
|
|
@@ -32,6 +32,17 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
32
32
|
const updateFocusability = action === SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
33
33
|
$focusableSlideChildren.forEach(($element) => (updateFocusability($element)));
|
|
34
34
|
};
|
|
35
|
+
this._scanMutationsForNewFocusableElements = (mutationList) => {
|
|
36
|
+
for (const mutation of mutationList) {
|
|
37
|
+
if (mutation.type !== "childList")
|
|
38
|
+
continue;
|
|
39
|
+
const $target = mutation.target;
|
|
40
|
+
const isFocusable = UiDomUtils.isFocusable($target);
|
|
41
|
+
const $focusableChildren = [...$target.querySelectorAll(UiDomUtils.getFocusableSelector())];
|
|
42
|
+
isFocusable && this._initializeFocusableElement($target);
|
|
43
|
+
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
35
46
|
this._initializeFocusableElement = ($element) => {
|
|
36
47
|
!this._$focusableElements.includes($element) && this._$focusableElements.push($element);
|
|
37
48
|
if ($element.closest('[aria-hidden="true"]')) {
|
|
@@ -70,17 +81,6 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
70
81
|
$element.setAttribute('tabindex', '-1');
|
|
71
82
|
$element.setAttribute('aria-hidden', 'true');
|
|
72
83
|
}
|
|
73
|
-
_scanMutationsForNewFocusableElements(mutationList) {
|
|
74
|
-
for (const mutation of mutationList) {
|
|
75
|
-
if (mutation.type !== "childList")
|
|
76
|
-
continue;
|
|
77
|
-
const $target = mutation.target;
|
|
78
|
-
const isFocusable = UiDomUtils.isFocusable($target);
|
|
79
|
-
const $focusableChildren = [...$target.querySelectorAll(UiDomUtils.getFocusableSelector())];
|
|
80
|
-
isFocusable && this._initializeFocusableElement($target);
|
|
81
|
-
$focusableChildren.forEach(($child) => this._initializeFocusableElement($child));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
84
|
getSlider() {
|
|
85
85
|
return this._slider;
|
|
86
86
|
}
|