@shoper/phoenix_design_system 1.17.1 → 1.17.3-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/color_swatches/color_swatches.js +8 -6
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +1 -3
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio_control.js +6 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/show-more/show_more.js +98 -0
- package/build/cjs/packages/phoenix/src/components/show-more/show_more.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/show-more/show_more_button.js +29 -0
- package/build/cjs/packages/phoenix/src/components/show-more/show_more_button.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/show-more/show_more_constants.js +15 -0
- package/build/cjs/packages/phoenix/src/components/show-more/show_more_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/components/slider/slider.js +50 -0
- package/build/cjs/packages/phoenix/src/components/slider/slider.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/slider/slider_constants.js +11 -0
- package/build/cjs/packages/phoenix/src/components/slider/slider_constants.js.map +1 -0
- package/build/cjs/packages/phoenix/src/index.js +14 -7
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +9 -7
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +2 -3
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.d.ts +1 -0
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.js +6 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/show-more/show_more.d.ts +18 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more.js +96 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_button.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_button.js +27 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_button.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_constants.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_constants.js +10 -0
- package/build/esm/packages/phoenix/src/components/show-more/show_more_constants.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/slider/slider.d.ts +9 -0
- package/build/esm/packages/phoenix/src/components/slider/slider.js +51 -1
- package/build/esm/packages/phoenix/src/components/slider/slider.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/slider/slider_constants.d.ts +4 -0
- package/build/esm/packages/phoenix/src/components/slider/slider_constants.js +7 -0
- package/build/esm/packages/phoenix/src/components/{color_swatches/show-more/show_more_constants.js.map → slider/slider_constants.js.map} +1 -1
- package/build/esm/packages/phoenix/src/components/slider/slider_types.d.ts +3 -0
- package/build/esm/packages/phoenix/src/components/slider/slider_types.js +2 -0
- package/build/esm/packages/phoenix/src/components/slider/slider_types.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +2 -1
- package/build/esm/packages/phoenix/src/index.js +2 -1
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +4 -4
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js +0 -37
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +0 -8
- package/build/cjs/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.d.ts +0 -9
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js +0 -35
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.js +0 -4
|
@@ -154,7 +154,7 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
154
154
|
return;
|
|
155
155
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild, index) => {
|
|
156
156
|
if (index > numberOfVisibleColors - 1) {
|
|
157
|
-
$colorSwatchesChild.setAttribute(
|
|
157
|
+
$colorSwatchesChild.setAttribute('hidden', '');
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
@@ -164,9 +164,9 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
164
164
|
if (!this._$colorSwatchesChildren)
|
|
165
165
|
return;
|
|
166
166
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
|
|
167
|
-
$colorSwatchesChild.removeAttribute(
|
|
167
|
+
$colorSwatchesChild.removeAttribute('hidden');
|
|
168
168
|
});
|
|
169
|
-
(_a = this.querySelector('h-
|
|
169
|
+
(_a = this.querySelector('h-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
_handleChangeToNextColorItem({ target }) {
|
|
@@ -232,10 +232,12 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
232
232
|
}
|
|
233
233
|
render() {
|
|
234
234
|
return lit.html `
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
<h-show-more count="15" selector="h-color-item">
|
|
236
|
+
${this.getSlot('default')}
|
|
237
|
+
${this._$colors.length > this.numberOfVisibleColors
|
|
238
|
+
? lit.html `<h-show-more-button>${this.showMoreBtnText}</h-show-more-button>`
|
|
238
239
|
: lit.nothing}
|
|
240
|
+
</h-show-more>
|
|
239
241
|
`;
|
|
240
242
|
}
|
|
241
243
|
};
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js
CHANGED
|
@@ -12,11 +12,9 @@ const COLOR_SWATCHES_EVENT_NAMES = {
|
|
|
12
12
|
change: 'change',
|
|
13
13
|
markDisabledItems: 'markDisabledItems',
|
|
14
14
|
showMore: 'showMore'
|
|
15
|
-
};
|
|
16
|
-
const COLOR_SWATCHES_HIDDEN_ATTRIBUTE = 'hidden';
|
|
15
|
+
};
|
|
17
16
|
|
|
18
17
|
exports.COLOR_ITEM_TAG_NAME = COLOR_ITEM_TAG_NAME;
|
|
19
18
|
exports.COLOR_SWATCHES_CSS_CLASSES = COLOR_SWATCHES_CSS_CLASSES;
|
|
20
19
|
exports.COLOR_SWATCHES_EVENT_NAMES = COLOR_SWATCHES_EVENT_NAMES;
|
|
21
|
-
exports.COLOR_SWATCHES_HIDDEN_ATTRIBUTE = COLOR_SWATCHES_HIDDEN_ATTRIBUTE;
|
|
22
20
|
//# sourceMappingURL=color_swatches_constants.js.map
|
package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -41,11 +41,12 @@ exports.HRadioControl = class HRadioControl extends phoenix_light_lit_element.Ph
|
|
|
41
41
|
?readonly="${this.readonly}"
|
|
42
42
|
?hidden="${this.hidden}"
|
|
43
43
|
.checked="${this.checked}"
|
|
44
|
+
aria-label="${ifDefined_js.ifDefined(this.ariaLabel)}"
|
|
44
45
|
aria-describedby="${ifDefined_js.ifDefined(this.ariaDescribedby)}"
|
|
45
46
|
@change="${this._handleChangeEvent}"
|
|
46
47
|
/>
|
|
47
48
|
|
|
48
|
-
<label class="${radio_constants.RADIO_CONTROL_CSS_CLASSES.radioLabel}" for="${ifDefined_js.ifDefined(this.controlId)}"></label>
|
|
49
|
+
<label class="${radio_constants.RADIO_CONTROL_CSS_CLASSES.radioLabel}" for="${ifDefined_js.ifDefined(this.controlId)}" aria-hidden="true"></label>
|
|
49
50
|
`;
|
|
50
51
|
}
|
|
51
52
|
};
|
|
@@ -81,6 +82,10 @@ tslib_es6.__decorate([
|
|
|
81
82
|
decorators.property({ type: String }),
|
|
82
83
|
tslib_es6.__metadata("design:type", String)
|
|
83
84
|
], exports.HRadioControl.prototype, "value", void 0);
|
|
85
|
+
tslib_es6.__decorate([
|
|
86
|
+
decorators.property({ type: String, attribute: 'aria-label' }),
|
|
87
|
+
tslib_es6.__metadata("design:type", String)
|
|
88
|
+
], exports.HRadioControl.prototype, "ariaLabel", void 0);
|
|
84
89
|
tslib_es6.__decorate([
|
|
85
90
|
decorators.property({ type: String, attribute: 'aria-describedby' }),
|
|
86
91
|
tslib_es6.__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var decorators = require('lit/decorators');
|
|
7
|
+
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
8
|
+
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
9
|
+
var global_constants = require('../../global_constants.js');
|
|
10
|
+
var relative_position_controller_constants = require('../../controllers/relative_position_controller/relative_position_controller_constants.js');
|
|
11
|
+
var throttle = require('../../../../../external/lodash/throttle.js');
|
|
12
|
+
var show_more_constants = require('./show_more_constants.js');
|
|
13
|
+
|
|
14
|
+
exports.HShowMore = class HShowMore extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this._$showMoreButton = null;
|
|
18
|
+
this._showMore = () => {
|
|
19
|
+
this._showAllItems();
|
|
20
|
+
this._hideButton();
|
|
21
|
+
this._focusNextItem();
|
|
22
|
+
};
|
|
23
|
+
this._onResize = throttle['default'](() => {
|
|
24
|
+
if (window.innerWidth > global_constants.BREAKPOINTS.xs) {
|
|
25
|
+
this._showAllItems();
|
|
26
|
+
this._hideButton();
|
|
27
|
+
window.removeEventListener('resize', this._onResize);
|
|
28
|
+
}
|
|
29
|
+
}, relative_position_controller_constants.DEFAULT_THROTTLE_WAIT_TIME);
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
super.connectedCallback();
|
|
33
|
+
this._$showMoreButton = this.querySelector('h-show-more-button');
|
|
34
|
+
this._$items = [...this.querySelectorAll(this.selector)];
|
|
35
|
+
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASSES.showMore);
|
|
36
|
+
this._updateComponentVisibility();
|
|
37
|
+
this._setupListeners();
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
super.disconnectedCallback();
|
|
41
|
+
window.removeEventListener('resize', this._onResize);
|
|
42
|
+
}
|
|
43
|
+
_updateComponentVisibility() {
|
|
44
|
+
const hasOverflowItems = this._$items.length > this.count;
|
|
45
|
+
const isMobileView = window.innerWidth <= global_constants.BREAKPOINTS.xs;
|
|
46
|
+
const shouldBeActive = (!this.mobileOnly || isMobileView) && hasOverflowItems;
|
|
47
|
+
if (shouldBeActive) {
|
|
48
|
+
this._hideExcessItems();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this._hideButton();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_hideExcessItems() {
|
|
55
|
+
this._$items.forEach(($item, index) => {
|
|
56
|
+
$item.removeAttribute('hidden');
|
|
57
|
+
if (index >= this.count)
|
|
58
|
+
$item.setAttribute('hidden', '');
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
_showAllItems() {
|
|
62
|
+
this._$items.forEach(($item) => $item.removeAttribute('hidden'));
|
|
63
|
+
}
|
|
64
|
+
_hideButton() {
|
|
65
|
+
var _a;
|
|
66
|
+
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
67
|
+
}
|
|
68
|
+
_setupListeners() {
|
|
69
|
+
this.addEventListener(show_more_constants.SHOW_MORE_EVENT_NAMES.showMore, this._showMore);
|
|
70
|
+
if (this.mobileOnly && window.innerWidth <= global_constants.BREAKPOINTS.xs) {
|
|
71
|
+
window.addEventListener('resize', this._onResize);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
_focusNextItem() {
|
|
75
|
+
const $nextItem = this._$items[this.count];
|
|
76
|
+
if (!$nextItem)
|
|
77
|
+
return;
|
|
78
|
+
if (!$nextItem.getAttribute('tabindex'))
|
|
79
|
+
$nextItem.setAttribute('tabindex', '-1');
|
|
80
|
+
$nextItem.focus();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
tslib_es6.__decorate([
|
|
84
|
+
decorators.property({ type: Number }),
|
|
85
|
+
tslib_es6.__metadata("design:type", Number)
|
|
86
|
+
], exports.HShowMore.prototype, "count", void 0);
|
|
87
|
+
tslib_es6.__decorate([
|
|
88
|
+
decorators.property({ type: String }),
|
|
89
|
+
tslib_es6.__metadata("design:type", String)
|
|
90
|
+
], exports.HShowMore.prototype, "selector", void 0);
|
|
91
|
+
tslib_es6.__decorate([
|
|
92
|
+
decorators.property({ type: Boolean, attribute: 'mobile-only' }),
|
|
93
|
+
tslib_es6.__metadata("design:type", Boolean)
|
|
94
|
+
], exports.HShowMore.prototype, "mobileOnly", void 0);
|
|
95
|
+
exports.HShowMore = tslib_es6.__decorate([
|
|
96
|
+
phoenix_custom_element.phoenixCustomElement('h-show-more')
|
|
97
|
+
], exports.HShowMore);
|
|
98
|
+
//# sourceMappingURL=show_more.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
7
|
+
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
8
|
+
var btn_controller = require('../../controllers/btn_controller/btn_controller.js');
|
|
9
|
+
var show_more_constants = require('./show_more_constants.js');
|
|
10
|
+
|
|
11
|
+
exports.HShowMoreButton = class HShowMoreButton extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this._dispatchClickedEvent = () => {
|
|
15
|
+
this.emitCustomEvent(show_more_constants.SHOW_MORE_EVENT_NAMES.showMore);
|
|
16
|
+
};
|
|
17
|
+
this._btnController = new btn_controller.BtnController(this, this._dispatchClickedEvent);
|
|
18
|
+
}
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
this.addEventListener('click', this._dispatchClickedEvent);
|
|
22
|
+
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASSES.showMoreButton);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.HShowMoreButton = tslib_es6.__decorate([
|
|
26
|
+
phoenix_custom_element.phoenixCustomElement('h-show-more-button'),
|
|
27
|
+
tslib_es6.__metadata("design:paramtypes", [])
|
|
28
|
+
], exports.HShowMoreButton);
|
|
29
|
+
//# sourceMappingURL=show_more_button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const SHOW_MORE_CSS_CLASSES = {
|
|
6
|
+
showMore: 'show-more',
|
|
7
|
+
showMoreButton: 'show-more__button'
|
|
8
|
+
};
|
|
9
|
+
const SHOW_MORE_EVENT_NAMES = {
|
|
10
|
+
showMore: 'showMore'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.SHOW_MORE_CSS_CLASSES = SHOW_MORE_CSS_CLASSES;
|
|
14
|
+
exports.SHOW_MORE_EVENT_NAMES = SHOW_MORE_EVENT_NAMES;
|
|
15
|
+
//# sourceMappingURL=show_more_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -8,6 +8,7 @@ var utilities = require('@dreamcommerce/utilities');
|
|
|
8
8
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
9
9
|
var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
|
|
10
10
|
var splide_esm = require('../../../../../external/@splidejs/splide/dist/js/splide.esm.js');
|
|
11
|
+
var slider_constants = require('./slider_constants.js');
|
|
11
12
|
|
|
12
13
|
exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
13
14
|
constructor() {
|
|
@@ -21,6 +22,37 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
21
22
|
focus: 'center'
|
|
22
23
|
};
|
|
23
24
|
this._slider = null;
|
|
25
|
+
this._$focusableElements = [];
|
|
26
|
+
this._showFocusableNodes = (slideComponent) => {
|
|
27
|
+
this._handleFocusableNodes(slideComponent, slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show);
|
|
28
|
+
};
|
|
29
|
+
this._hideFocusableNodes = (slideComponent) => {
|
|
30
|
+
this._handleFocusableNodes(slideComponent, slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.hide);
|
|
31
|
+
};
|
|
32
|
+
this._handleFocusableNodes = ({ slide }, action) => {
|
|
33
|
+
const $focusableSlideChildren = this._$focusableElements.filter(($focusableElement) => slide.contains($focusableElement));
|
|
34
|
+
if ($focusableSlideChildren.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const updateFocusability = action === slider_constants.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
37
|
+
$focusableSlideChildren.forEach(($element) => (updateFocusability($element)));
|
|
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
|
+
};
|
|
50
|
+
this._initializeFocusableElement = ($element) => {
|
|
51
|
+
!this._$focusableElements.includes($element) && this._$focusableElements.push($element);
|
|
52
|
+
if ($element.closest('[aria-hidden="true"]')) {
|
|
53
|
+
this._hideFocusableElement($element);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
24
56
|
}
|
|
25
57
|
get sliderSettings() {
|
|
26
58
|
return this._settings;
|
|
@@ -40,10 +72,28 @@ exports.HSlider = class HSlider extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
40
72
|
if (this._settings.mountOnConnectedCallback) {
|
|
41
73
|
this._slider.mount();
|
|
42
74
|
}
|
|
75
|
+
this._slider.on('visible', this._showFocusableNodes);
|
|
76
|
+
this._slider.on('hidden', this._hideFocusableNodes);
|
|
77
|
+
const mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
78
|
+
mutationObserver.observe(this, { childList: true, subtree: true, attributes: true });
|
|
79
|
+
}
|
|
80
|
+
_showFocusableElement($element) {
|
|
81
|
+
$element.setAttribute('tabindex', '0');
|
|
82
|
+
$element.removeAttribute('aria-hidden');
|
|
83
|
+
}
|
|
84
|
+
_hideFocusableElement($element) {
|
|
85
|
+
$element.setAttribute('tabindex', '-1');
|
|
86
|
+
$element.setAttribute('aria-hidden', 'true');
|
|
43
87
|
}
|
|
44
88
|
getSlider() {
|
|
45
89
|
return this._slider;
|
|
46
90
|
}
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
super.disconnectedCallback();
|
|
94
|
+
(_a = this._slider) === null || _a === void 0 ? void 0 : _a.off('visible');
|
|
95
|
+
(_b = this._slider) === null || _b === void 0 ? void 0 : _b.off('hidden');
|
|
96
|
+
}
|
|
47
97
|
};
|
|
48
98
|
tslib_es6.__decorate([
|
|
49
99
|
decorators.property({ reflect: true }),
|
|
@@ -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;"}
|
|
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;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS = {
|
|
6
|
+
show: 'show',
|
|
7
|
+
hide: 'hide'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS = SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS;
|
|
11
|
+
//# sourceMappingURL=slider_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -86,7 +86,6 @@ var color_swatches_control_constants = require('./components/form/color_swatches
|
|
|
86
86
|
var color_swatches = require('./components/color_swatches/color_swatches.js');
|
|
87
87
|
var color_item = require('./components/color_swatches/color_item/color_item.js');
|
|
88
88
|
var color_swatches_control = require('./components/form/color_swatches_control/color_swatches_control.js');
|
|
89
|
-
var show_more = require('./components/color_swatches/show-more/show_more.js');
|
|
90
89
|
var visibility_controller = require('./controllers/visibility_controller/visibility_controller.js');
|
|
91
90
|
var slider = require('./components/slider/slider.js');
|
|
92
91
|
var scroller = require('./components/scroller/scroller.js');
|
|
@@ -126,6 +125,8 @@ var toggle = require('./components/toggle/toggle.js');
|
|
|
126
125
|
var toggle_button$1 = require('./components/toggle/toggle_button.js');
|
|
127
126
|
var navigator_share = require('./components/navigator/navigator_share/navigator_share.js');
|
|
128
127
|
var navigator_controller = require('./components/navigator/navigator_controller/navigator_controller.js');
|
|
128
|
+
var show_more_button = require('./components/show-more/show_more_button.js');
|
|
129
|
+
var show_more = require('./components/show-more/show_more.js');
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
|
|
@@ -528,12 +529,6 @@ Object.defineProperty(exports, 'HColorSwatchesControl', {
|
|
|
528
529
|
return color_swatches_control.HColorSwatchesControl;
|
|
529
530
|
}
|
|
530
531
|
});
|
|
531
|
-
Object.defineProperty(exports, 'HColorSwatchesShowMore', {
|
|
532
|
-
enumerable: true,
|
|
533
|
-
get: function () {
|
|
534
|
-
return show_more.HColorSwatchesShowMore;
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
532
|
exports.VisibilityController = visibility_controller.VisibilityController;
|
|
538
533
|
Object.defineProperty(exports, 'HSlider', {
|
|
539
534
|
enumerable: true,
|
|
@@ -755,4 +750,16 @@ Object.defineProperty(exports, 'NavigatorController', {
|
|
|
755
750
|
return navigator_controller.NavigatorController;
|
|
756
751
|
}
|
|
757
752
|
});
|
|
753
|
+
Object.defineProperty(exports, 'HShowMoreButton', {
|
|
754
|
+
enumerable: true,
|
|
755
|
+
get: function () {
|
|
756
|
+
return show_more_button.HShowMoreButton;
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
Object.defineProperty(exports, 'HShowMore', {
|
|
760
|
+
enumerable: true,
|
|
761
|
+
get: function () {
|
|
762
|
+
return show_more.HShowMore;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
758
765
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -6,7 +6,7 @@ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/pho
|
|
|
6
6
|
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
7
7
|
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
8
8
|
import 'lit-html';
|
|
9
|
-
import { COLOR_SWATCHES_EVENT_NAMES, COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES
|
|
9
|
+
import { COLOR_SWATCHES_EVENT_NAMES, COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES } from './color_swatches_constants.js';
|
|
10
10
|
import { COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item/color_item_constants.js';
|
|
11
11
|
|
|
12
12
|
let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
@@ -150,7 +150,7 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
150
150
|
return;
|
|
151
151
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild, index) => {
|
|
152
152
|
if (index > numberOfVisibleColors - 1) {
|
|
153
|
-
$colorSwatchesChild.setAttribute(
|
|
153
|
+
$colorSwatchesChild.setAttribute('hidden', '');
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
@@ -160,9 +160,9 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
160
160
|
if (!this._$colorSwatchesChildren)
|
|
161
161
|
return;
|
|
162
162
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
|
|
163
|
-
$colorSwatchesChild.removeAttribute(
|
|
163
|
+
$colorSwatchesChild.removeAttribute('hidden');
|
|
164
164
|
});
|
|
165
|
-
(_a = this.querySelector('h-
|
|
165
|
+
(_a = this.querySelector('h-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
_handleChangeToNextColorItem({ target }) {
|
|
@@ -228,10 +228,12 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
228
228
|
}
|
|
229
229
|
render() {
|
|
230
230
|
return html `
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
<h-show-more count="15" selector="h-color-item">
|
|
232
|
+
${this.getSlot('default')}
|
|
233
|
+
${this._$colors.length > this.numberOfVisibleColors
|
|
234
|
+
? html `<h-show-more-button>${this.showMoreBtnText}</h-show-more-button>`
|
|
234
235
|
: nothing}
|
|
236
|
+
</h-show-more>
|
|
235
237
|
`;
|
|
236
238
|
}
|
|
237
239
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js
CHANGED
|
@@ -8,8 +8,7 @@ const COLOR_SWATCHES_EVENT_NAMES = {
|
|
|
8
8
|
change: 'change',
|
|
9
9
|
markDisabledItems: 'markDisabledItems',
|
|
10
10
|
showMore: 'showMore'
|
|
11
|
-
};
|
|
12
|
-
const COLOR_SWATCHES_HIDDEN_ATTRIBUTE = 'hidden';
|
|
11
|
+
};
|
|
13
12
|
|
|
14
|
-
export { COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_EVENT_NAMES
|
|
13
|
+
export { COLOR_ITEM_TAG_NAME, COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_EVENT_NAMES };
|
|
15
14
|
//# sourceMappingURL=color_swatches_constants.js.map
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -37,11 +37,12 @@ let HRadioControl = class HRadioControl extends PhoenixLightLitElement {
|
|
|
37
37
|
?readonly="${this.readonly}"
|
|
38
38
|
?hidden="${this.hidden}"
|
|
39
39
|
.checked="${this.checked}"
|
|
40
|
+
aria-label="${ifDefined(this.ariaLabel)}"
|
|
40
41
|
aria-describedby="${ifDefined(this.ariaDescribedby)}"
|
|
41
42
|
@change="${this._handleChangeEvent}"
|
|
42
43
|
/>
|
|
43
44
|
|
|
44
|
-
<label class="${RADIO_CONTROL_CSS_CLASSES.radioLabel}" for="${ifDefined(this.controlId)}"></label>
|
|
45
|
+
<label class="${RADIO_CONTROL_CSS_CLASSES.radioLabel}" for="${ifDefined(this.controlId)}" aria-hidden="true"></label>
|
|
45
46
|
`;
|
|
46
47
|
}
|
|
47
48
|
};
|
|
@@ -77,6 +78,10 @@ __decorate([
|
|
|
77
78
|
property({ type: String }),
|
|
78
79
|
__metadata("design:type", String)
|
|
79
80
|
], HRadioControl.prototype, "value", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
property({ type: String, attribute: 'aria-label' }),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], HRadioControl.prototype, "ariaLabel", void 0);
|
|
80
85
|
__decorate([
|
|
81
86
|
property({ type: String, attribute: 'aria-describedby' }),
|
|
82
87
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HShowMore extends PhoenixLightLitElement {
|
|
3
|
+
count: number;
|
|
4
|
+
selector: string;
|
|
5
|
+
mobileOnly: boolean;
|
|
6
|
+
private _$showMoreButton;
|
|
7
|
+
private _$items;
|
|
8
|
+
connectedCallback(): void;
|
|
9
|
+
disconnectedCallback(): void;
|
|
10
|
+
private _updateComponentVisibility;
|
|
11
|
+
private _hideExcessItems;
|
|
12
|
+
private _showAllItems;
|
|
13
|
+
private _hideButton;
|
|
14
|
+
private _setupListeners;
|
|
15
|
+
private _showMore;
|
|
16
|
+
private _focusNextItem;
|
|
17
|
+
private _onResize;
|
|
18
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { property } from 'lit/decorators';
|
|
3
|
+
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
4
|
+
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
5
|
+
import { BREAKPOINTS } from '../../global_constants.js';
|
|
6
|
+
import { DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
|
|
7
|
+
import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
8
|
+
import { SHOW_MORE_CSS_CLASSES, SHOW_MORE_EVENT_NAMES } from './show_more_constants.js';
|
|
9
|
+
|
|
10
|
+
let HShowMore = class HShowMore extends PhoenixLightLitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this._$showMoreButton = null;
|
|
14
|
+
this._showMore = () => {
|
|
15
|
+
this._showAllItems();
|
|
16
|
+
this._hideButton();
|
|
17
|
+
this._focusNextItem();
|
|
18
|
+
};
|
|
19
|
+
this._onResize = throttle_1(() => {
|
|
20
|
+
if (window.innerWidth > BREAKPOINTS.xs) {
|
|
21
|
+
this._showAllItems();
|
|
22
|
+
this._hideButton();
|
|
23
|
+
window.removeEventListener('resize', this._onResize);
|
|
24
|
+
}
|
|
25
|
+
}, DEFAULT_THROTTLE_WAIT_TIME);
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
this._$showMoreButton = this.querySelector('h-show-more-button');
|
|
30
|
+
this._$items = [...this.querySelectorAll(this.selector)];
|
|
31
|
+
this.classList.add(SHOW_MORE_CSS_CLASSES.showMore);
|
|
32
|
+
this._updateComponentVisibility();
|
|
33
|
+
this._setupListeners();
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
super.disconnectedCallback();
|
|
37
|
+
window.removeEventListener('resize', this._onResize);
|
|
38
|
+
}
|
|
39
|
+
_updateComponentVisibility() {
|
|
40
|
+
const hasOverflowItems = this._$items.length > this.count;
|
|
41
|
+
const isMobileView = window.innerWidth <= BREAKPOINTS.xs;
|
|
42
|
+
const shouldBeActive = (!this.mobileOnly || isMobileView) && hasOverflowItems;
|
|
43
|
+
if (shouldBeActive) {
|
|
44
|
+
this._hideExcessItems();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this._hideButton();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_hideExcessItems() {
|
|
51
|
+
this._$items.forEach(($item, index) => {
|
|
52
|
+
$item.removeAttribute('hidden');
|
|
53
|
+
if (index >= this.count)
|
|
54
|
+
$item.setAttribute('hidden', '');
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_showAllItems() {
|
|
58
|
+
this._$items.forEach(($item) => $item.removeAttribute('hidden'));
|
|
59
|
+
}
|
|
60
|
+
_hideButton() {
|
|
61
|
+
var _a;
|
|
62
|
+
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
63
|
+
}
|
|
64
|
+
_setupListeners() {
|
|
65
|
+
this.addEventListener(SHOW_MORE_EVENT_NAMES.showMore, this._showMore);
|
|
66
|
+
if (this.mobileOnly && window.innerWidth <= BREAKPOINTS.xs) {
|
|
67
|
+
window.addEventListener('resize', this._onResize);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_focusNextItem() {
|
|
71
|
+
const $nextItem = this._$items[this.count];
|
|
72
|
+
if (!$nextItem)
|
|
73
|
+
return;
|
|
74
|
+
if (!$nextItem.getAttribute('tabindex'))
|
|
75
|
+
$nextItem.setAttribute('tabindex', '-1');
|
|
76
|
+
$nextItem.focus();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Number }),
|
|
81
|
+
__metadata("design:type", Number)
|
|
82
|
+
], HShowMore.prototype, "count", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ type: String }),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], HShowMore.prototype, "selector", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Boolean, attribute: 'mobile-only' }),
|
|
89
|
+
__metadata("design:type", Boolean)
|
|
90
|
+
], HShowMore.prototype, "mobileOnly", void 0);
|
|
91
|
+
HShowMore = __decorate([
|
|
92
|
+
phoenixCustomElement('h-show-more')
|
|
93
|
+
], HShowMore);
|
|
94
|
+
|
|
95
|
+
export { HShowMore };
|
|
96
|
+
//# sourceMappingURL=show_more.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HShowMoreButton extends PhoenixLightLitElement {
|
|
3
|
+
private _btnController;
|
|
4
|
+
constructor();
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
private _dispatchClickedEvent;
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
3
|
+
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
4
|
+
import { BtnController } from '../../controllers/btn_controller/btn_controller.js';
|
|
5
|
+
import { SHOW_MORE_EVENT_NAMES, SHOW_MORE_CSS_CLASSES } from './show_more_constants.js';
|
|
6
|
+
|
|
7
|
+
let HShowMoreButton = class HShowMoreButton extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this._dispatchClickedEvent = () => {
|
|
11
|
+
this.emitCustomEvent(SHOW_MORE_EVENT_NAMES.showMore);
|
|
12
|
+
};
|
|
13
|
+
this._btnController = new BtnController(this, this._dispatchClickedEvent);
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
super.connectedCallback();
|
|
17
|
+
this.addEventListener('click', this._dispatchClickedEvent);
|
|
18
|
+
this.classList.add(SHOW_MORE_CSS_CLASSES.showMoreButton);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
HShowMoreButton = __decorate([
|
|
22
|
+
phoenixCustomElement('h-show-more-button'),
|
|
23
|
+
__metadata("design:paramtypes", [])
|
|
24
|
+
], HShowMoreButton);
|
|
25
|
+
|
|
26
|
+
export { HShowMoreButton };
|
|
27
|
+
//# sourceMappingURL=show_more_button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const SHOW_MORE_CSS_CLASSES = {
|
|
2
|
+
showMore: 'show-more',
|
|
3
|
+
showMoreButton: 'show-more__button'
|
|
4
|
+
};
|
|
5
|
+
const SHOW_MORE_EVENT_NAMES = {
|
|
6
|
+
showMore: 'showMore'
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { SHOW_MORE_CSS_CLASSES, SHOW_MORE_EVENT_NAMES };
|
|
10
|
+
//# sourceMappingURL=show_more_constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -7,6 +7,15 @@ export declare class HSlider extends PhoenixLightLitElement {
|
|
|
7
7
|
set sliderSettings(newSettingsObject: ISliderOptions);
|
|
8
8
|
private _settings;
|
|
9
9
|
private _slider;
|
|
10
|
+
private _$focusableElements;
|
|
10
11
|
connectedCallback(): void;
|
|
12
|
+
private _showFocusableNodes;
|
|
13
|
+
private _hideFocusableNodes;
|
|
14
|
+
private _handleFocusableNodes;
|
|
15
|
+
private _showFocusableElement;
|
|
16
|
+
private _hideFocusableElement;
|
|
17
|
+
private _scanMutationsForNewFocusableElements;
|
|
18
|
+
private _initializeFocusableElement;
|
|
11
19
|
getSlider(): ISlider | null;
|
|
20
|
+
disconnectedCallback(): void;
|
|
12
21
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { property } from 'lit/decorators';
|
|
3
|
-
import { JsonUtils } from '@dreamcommerce/utilities';
|
|
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';
|
|
7
|
+
import { SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS } from './slider_constants.js';
|
|
7
8
|
|
|
8
9
|
let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
9
10
|
constructor() {
|
|
@@ -17,6 +18,37 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
17
18
|
focus: 'center'
|
|
18
19
|
};
|
|
19
20
|
this._slider = null;
|
|
21
|
+
this._$focusableElements = [];
|
|
22
|
+
this._showFocusableNodes = (slideComponent) => {
|
|
23
|
+
this._handleFocusableNodes(slideComponent, SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show);
|
|
24
|
+
};
|
|
25
|
+
this._hideFocusableNodes = (slideComponent) => {
|
|
26
|
+
this._handleFocusableNodes(slideComponent, SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.hide);
|
|
27
|
+
};
|
|
28
|
+
this._handleFocusableNodes = ({ slide }, action) => {
|
|
29
|
+
const $focusableSlideChildren = this._$focusableElements.filter(($focusableElement) => slide.contains($focusableElement));
|
|
30
|
+
if ($focusableSlideChildren.length === 0)
|
|
31
|
+
return;
|
|
32
|
+
const updateFocusability = action === SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS.show ? this._showFocusableElement : this._hideFocusableElement;
|
|
33
|
+
$focusableSlideChildren.forEach(($element) => (updateFocusability($element)));
|
|
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
|
+
};
|
|
46
|
+
this._initializeFocusableElement = ($element) => {
|
|
47
|
+
!this._$focusableElements.includes($element) && this._$focusableElements.push($element);
|
|
48
|
+
if ($element.closest('[aria-hidden="true"]')) {
|
|
49
|
+
this._hideFocusableElement($element);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
20
52
|
}
|
|
21
53
|
get sliderSettings() {
|
|
22
54
|
return this._settings;
|
|
@@ -36,10 +68,28 @@ let HSlider = class HSlider extends PhoenixLightLitElement {
|
|
|
36
68
|
if (this._settings.mountOnConnectedCallback) {
|
|
37
69
|
this._slider.mount();
|
|
38
70
|
}
|
|
71
|
+
this._slider.on('visible', this._showFocusableNodes);
|
|
72
|
+
this._slider.on('hidden', this._hideFocusableNodes);
|
|
73
|
+
const mutationObserver = new MutationObserver(this._scanMutationsForNewFocusableElements);
|
|
74
|
+
mutationObserver.observe(this, { childList: true, subtree: true, attributes: true });
|
|
75
|
+
}
|
|
76
|
+
_showFocusableElement($element) {
|
|
77
|
+
$element.setAttribute('tabindex', '0');
|
|
78
|
+
$element.removeAttribute('aria-hidden');
|
|
79
|
+
}
|
|
80
|
+
_hideFocusableElement($element) {
|
|
81
|
+
$element.setAttribute('tabindex', '-1');
|
|
82
|
+
$element.setAttribute('aria-hidden', 'true');
|
|
39
83
|
}
|
|
40
84
|
getSlider() {
|
|
41
85
|
return this._slider;
|
|
42
86
|
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
var _a, _b;
|
|
89
|
+
super.disconnectedCallback();
|
|
90
|
+
(_a = this._slider) === null || _a === void 0 ? void 0 : _a.off('visible');
|
|
91
|
+
(_b = this._slider) === null || _b === void 0 ? void 0 : _b.off('hidden');
|
|
92
|
+
}
|
|
43
93
|
};
|
|
44
94
|
__decorate([
|
|
45
95
|
property({ reflect: true }),
|
|
@@ -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;"}
|
|
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;AACA;AACA;AACA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Options, Splide } from '@splidejs/splide';
|
|
2
|
+
import { SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS } from './slider_constants';
|
|
3
|
+
import { Any } from 'ts-toolbelt';
|
|
2
4
|
export interface ISlider extends Splide {
|
|
3
5
|
}
|
|
4
6
|
export interface ISliderOptions extends Options {
|
|
5
7
|
mountOnConnectedCallback: boolean;
|
|
6
8
|
}
|
|
9
|
+
export declare type THandleNodesOption = typeof SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS[Any.Keys<typeof SLIDER_HANDLE_FOCUSABLE_NODES_OPTIONS>];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider_types.js","sourceRoot":"","sources":["../../../../../../../src/components/slider/slider_types.ts"],"names":[],"mappings":"AAAA,OAAgC,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"slider_types.js","sourceRoot":"","sources":["../../../../../../../src/components/slider/slider_types.ts"],"names":[],"mappings":"AAAA,OAAgC,kBAAkB,CAAC;AACnD,OAAsD,oBAAoB,CAAC;AAC3E,OAAoB,aAAa,CAAC"}
|
|
@@ -91,7 +91,6 @@ export { BACKDROP_EVENTS } from "./components/backdrop/backdrop_constants";
|
|
|
91
91
|
export { HColorSwatchesControl } from './components/form/color_swatches_control/color_swatches_control';
|
|
92
92
|
export { HColorSwatches } from './components/color_swatches/color_swatches';
|
|
93
93
|
export { HColorItem } from './components/color_swatches/color_item/color_item';
|
|
94
|
-
export { HColorSwatchesShowMore } from './components/color_swatches/show-more/show_more';
|
|
95
94
|
export { TColorSwatchesControlChangeEventDetail } from "./components/color_swatches/color_swatches_types";
|
|
96
95
|
export { COLOR_SWATCHES_CONTROL_EVENT_NAMES } from "./components/form/color_swatches_control/color_swatches_control_constants";
|
|
97
96
|
export { VisibilityController } from './controllers/visibility_controller/visibility_controller';
|
|
@@ -140,4 +139,6 @@ export * from './components/toggle/toggle_types';
|
|
|
140
139
|
export * from './components/toggle/toggle_constants';
|
|
141
140
|
export { NavigatorShare } from './components/navigator/navigator_share/navigator_share';
|
|
142
141
|
export { NavigatorController } from './components/navigator/navigator_controller/navigator_controller';
|
|
142
|
+
export { HShowMore } from './components/show-more/show_more';
|
|
143
|
+
export { HShowMoreButton } from './components/show-more/show_more_button';
|
|
143
144
|
export { phoenixCustomElement } from './core/decorators/phoenix_custom_element';
|
|
@@ -82,7 +82,6 @@ export { COLOR_SWATCHES_CONTROL_EVENT_NAMES } from './components/form/color_swat
|
|
|
82
82
|
export { HColorSwatches } from './components/color_swatches/color_swatches.js';
|
|
83
83
|
export { HColorItem } from './components/color_swatches/color_item/color_item.js';
|
|
84
84
|
export { HColorSwatchesControl } from './components/form/color_swatches_control/color_swatches_control.js';
|
|
85
|
-
export { HColorSwatchesShowMore } from './components/color_swatches/show-more/show_more.js';
|
|
86
85
|
export { VisibilityController } from './controllers/visibility_controller/visibility_controller.js';
|
|
87
86
|
export { HSlider } from './components/slider/slider.js';
|
|
88
87
|
export { HScroller } from './components/scroller/scroller.js';
|
|
@@ -122,4 +121,6 @@ export { HToggle } from './components/toggle/toggle.js';
|
|
|
122
121
|
export { HToggleBtn } from './components/toggle/toggle_button.js';
|
|
123
122
|
export { NavigatorShare } from './components/navigator/navigator_share/navigator_share.js';
|
|
124
123
|
export { NavigatorController } from './components/navigator/navigator_controller/navigator_controller.js';
|
|
124
|
+
export { HShowMoreButton } from './components/show-more/show_more_button.js';
|
|
125
|
+
export { HShowMore } from './components/show-more/show_more.js';
|
|
125
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@shoper/phoenix_design_system",
|
|
3
3
|
"packageManager": "yarn@3.2.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "1.17.
|
|
5
|
+
"version": "1.17.3-0",
|
|
6
6
|
"description": "phoenix design system",
|
|
7
7
|
"author": "zefirek",
|
|
8
8
|
"license": "MIT",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@dreamcommerce/utilities": "^1.0.0",
|
|
30
|
-
"@splidejs/splide": "
|
|
31
|
-
"@splidejs/splide-extension-auto-scroll": "
|
|
30
|
+
"@splidejs/splide": "4.0.7",
|
|
31
|
+
"@splidejs/splide-extension-auto-scroll": "0.5.3"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@dreamcommerce/utilities": "^1.20.1-0",
|
|
35
35
|
"@shoper/jest_config": "^0.0.0",
|
|
36
36
|
"@shoper/tsconfig": "^0.0.0",
|
|
37
37
|
"@splidejs/splide": "4.0.7",
|
|
38
|
-
"@splidejs/splide-extension-auto-scroll": "
|
|
38
|
+
"@splidejs/splide-extension-auto-scroll": "0.5.3",
|
|
39
39
|
"@storybook/web-components": "6.5.7",
|
|
40
40
|
"lit": "2.4.0"
|
|
41
41
|
},
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var tslib_es6 = require('../../../../../../external/tslib/tslib.es6.js');
|
|
6
|
-
var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
7
|
-
var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
|
|
8
|
-
var btn_controller = require('../../../controllers/btn_controller/btn_controller.js');
|
|
9
|
-
var color_swatches_constants = require('../color_swatches_constants.js');
|
|
10
|
-
var show_more_constants = require('./show_more_constants.js');
|
|
11
|
-
|
|
12
|
-
exports.HColorSwatchesShowMore = class HColorSwatchesShowMore extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this._dispatchClickedEvent = () => {
|
|
16
|
-
this.emitCustomEvent(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.showMore);
|
|
17
|
-
};
|
|
18
|
-
this._btnController = new btn_controller.BtnController(this, this._dispatchClickedEvent);
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() {
|
|
21
|
-
super.connectedCallback();
|
|
22
|
-
this.setupEvents();
|
|
23
|
-
this._addCssClasses();
|
|
24
|
-
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASS);
|
|
25
|
-
}
|
|
26
|
-
_addCssClasses() {
|
|
27
|
-
this.classList.add(show_more_constants.SHOW_MORE_CSS_CLASS);
|
|
28
|
-
}
|
|
29
|
-
setupEvents() {
|
|
30
|
-
this.addEventListener('click', this._dispatchClickedEvent);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.HColorSwatchesShowMore = tslib_es6.__decorate([
|
|
34
|
-
phoenix_custom_element.phoenixCustomElement('h-color-swatches-show-more'),
|
|
35
|
-
tslib_es6.__metadata("design:paramtypes", [])
|
|
36
|
-
], exports.HColorSwatchesShowMore);
|
|
37
|
-
//# sourceMappingURL=show_more.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
-
export declare class HColorSwatchesShowMore extends PhoenixLightLitElement {
|
|
3
|
-
private _btnController;
|
|
4
|
-
constructor();
|
|
5
|
-
connectedCallback(): void;
|
|
6
|
-
private _addCssClasses;
|
|
7
|
-
private setupEvents;
|
|
8
|
-
private _dispatchClickedEvent;
|
|
9
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
3
|
-
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
4
|
-
import { BtnController } from '../../../controllers/btn_controller/btn_controller.js';
|
|
5
|
-
import { COLOR_SWATCHES_EVENT_NAMES } from '../color_swatches_constants.js';
|
|
6
|
-
import { SHOW_MORE_CSS_CLASS } from './show_more_constants.js';
|
|
7
|
-
|
|
8
|
-
let HColorSwatchesShowMore = class HColorSwatchesShowMore extends PhoenixLightLitElement {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this._dispatchClickedEvent = () => {
|
|
12
|
-
this.emitCustomEvent(COLOR_SWATCHES_EVENT_NAMES.showMore);
|
|
13
|
-
};
|
|
14
|
-
this._btnController = new BtnController(this, this._dispatchClickedEvent);
|
|
15
|
-
}
|
|
16
|
-
connectedCallback() {
|
|
17
|
-
super.connectedCallback();
|
|
18
|
-
this.setupEvents();
|
|
19
|
-
this._addCssClasses();
|
|
20
|
-
this.classList.add(SHOW_MORE_CSS_CLASS);
|
|
21
|
-
}
|
|
22
|
-
_addCssClasses() {
|
|
23
|
-
this.classList.add(SHOW_MORE_CSS_CLASS);
|
|
24
|
-
}
|
|
25
|
-
setupEvents() {
|
|
26
|
-
this.addEventListener('click', this._dispatchClickedEvent);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
HColorSwatchesShowMore = __decorate([
|
|
30
|
-
phoenixCustomElement('h-color-swatches-show-more'),
|
|
31
|
-
__metadata("design:paramtypes", [])
|
|
32
|
-
], HColorSwatchesShowMore);
|
|
33
|
-
|
|
34
|
-
export { HColorSwatchesShowMore };
|
|
35
|
-
//# sourceMappingURL=show_more.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/phoenix/src/components/color_swatches/show-more/show_more_constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const SHOW_MORE_CSS_CLASS = "color-swatches-show-more";
|