@shoper/phoenix_design_system 1.17.3-1 → 1.17.3-3
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 +1 -23
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/show-more/show_more.js +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +1 -23
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/show-more/show_more.js +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
-
|
|
6
|
+
require('lit');
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
8
8
|
var utilities = require('@dreamcommerce/utilities');
|
|
9
9
|
var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
|
|
@@ -18,7 +18,6 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.multiple = false;
|
|
20
20
|
this.selectedColors = [];
|
|
21
|
-
this.showMoreBtnText = 'Pokaż wszystkie kolory';
|
|
22
21
|
this._setupEvents = () => {
|
|
23
22
|
if (this.getAttribute('role') === 'group') {
|
|
24
23
|
this._setupCheckboxGroupEvents();
|
|
@@ -140,7 +139,6 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
140
139
|
this._$colorSwatchesChildren = [...this.children];
|
|
141
140
|
this._setupEvents();
|
|
142
141
|
this._addCssClasses();
|
|
143
|
-
this.numberOfVisibleColors && this._hideItems(this.numberOfVisibleColors);
|
|
144
142
|
this._showAllItemsEvent();
|
|
145
143
|
this.selectedColors = [...this.querySelectorAll('h-color-item[selected]')];
|
|
146
144
|
this._$colors = [...this.querySelectorAll('h-color-item')];
|
|
@@ -160,13 +158,11 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
160
158
|
}
|
|
161
159
|
_showAllItemsEvent() {
|
|
162
160
|
this.addEventListener(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.showMore, () => {
|
|
163
|
-
var _a;
|
|
164
161
|
if (!this._$colorSwatchesChildren)
|
|
165
162
|
return;
|
|
166
163
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
|
|
167
164
|
$colorSwatchesChild.removeAttribute('hidden');
|
|
168
165
|
});
|
|
169
|
-
(_a = this.querySelector('h-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
170
166
|
});
|
|
171
167
|
}
|
|
172
168
|
_handleChangeToNextColorItem({ target }) {
|
|
@@ -230,33 +226,15 @@ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.
|
|
|
230
226
|
super.disconnectedCallback();
|
|
231
227
|
document.body.removeEventListener('keydown', this._focusOnSelectedColor);
|
|
232
228
|
}
|
|
233
|
-
render() {
|
|
234
|
-
return lit.html `
|
|
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>`
|
|
239
|
-
: lit.nothing}
|
|
240
|
-
</h-show-more>
|
|
241
|
-
`;
|
|
242
|
-
}
|
|
243
229
|
};
|
|
244
230
|
tslib_es6.__decorate([
|
|
245
231
|
decorators.property({ type: Boolean }),
|
|
246
232
|
tslib_es6.__metadata("design:type", Boolean)
|
|
247
233
|
], exports.HColorSwatches.prototype, "multiple", void 0);
|
|
248
|
-
tslib_es6.__decorate([
|
|
249
|
-
decorators.property({ type: Number, attribute: 'number-of-visible-colors' }),
|
|
250
|
-
tslib_es6.__metadata("design:type", Number)
|
|
251
|
-
], exports.HColorSwatches.prototype, "numberOfVisibleColors", void 0);
|
|
252
234
|
tslib_es6.__decorate([
|
|
253
235
|
decorators.property(),
|
|
254
236
|
tslib_es6.__metadata("design:type", Array)
|
|
255
237
|
], exports.HColorSwatches.prototype, "selectedColors", void 0);
|
|
256
|
-
tslib_es6.__decorate([
|
|
257
|
-
decorators.property({ type: String, attribute: 'show-more-btn-text' }),
|
|
258
|
-
tslib_es6.__metadata("design:type", Object)
|
|
259
|
-
], exports.HColorSwatches.prototype, "showMoreBtnText", void 0);
|
|
260
238
|
exports.HColorSwatches = tslib_es6.__decorate([
|
|
261
239
|
phoenix_custom_element.phoenixCustomElement('h-color-swatches')
|
|
262
240
|
], exports.HColorSwatches);
|
|
@@ -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;
|
|
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;"}
|
|
@@ -69,7 +69,7 @@ exports.HShowMore = class HShowMore extends phoenix_light_lit_element.PhoenixLig
|
|
|
69
69
|
}
|
|
70
70
|
_showButton() {
|
|
71
71
|
var _a;
|
|
72
|
-
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.
|
|
72
|
+
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.removeAttribute('hidden');
|
|
73
73
|
}
|
|
74
74
|
_setupListeners() {
|
|
75
75
|
this.addEventListener(show_more_constants.SHOW_MORE_EVENT_NAMES.showMore, this._showMore);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { HColorItem } from "./color_item/color_item";
|
|
2
2
|
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
3
|
-
import { TemplateResult } from 'lit-html';
|
|
4
3
|
export declare class HColorSwatches extends PhoenixLightLitElement {
|
|
5
4
|
multiple: boolean;
|
|
6
|
-
numberOfVisibleColors: number;
|
|
7
5
|
selectedColors: HColorItem[];
|
|
8
|
-
showMoreBtnText: string;
|
|
9
6
|
private _$colors;
|
|
10
7
|
private _$colorSwatchesChildren;
|
|
11
8
|
selectColors($colors: HColorItem[] | HColorItem): void;
|
|
@@ -33,5 +30,4 @@ export declare class HColorSwatches extends PhoenixLightLitElement {
|
|
|
33
30
|
private _removeExistingColorFromArray;
|
|
34
31
|
private _dispatchColorChangeEvent;
|
|
35
32
|
disconnectedCallback(): void;
|
|
36
|
-
protected render(): TemplateResult;
|
|
37
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import
|
|
2
|
+
import 'lit';
|
|
3
3
|
import { property } from 'lit/decorators';
|
|
4
4
|
import { UiDomUtils, ArrayUtils } from '@dreamcommerce/utilities';
|
|
5
5
|
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
|
|
@@ -14,7 +14,6 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.multiple = false;
|
|
16
16
|
this.selectedColors = [];
|
|
17
|
-
this.showMoreBtnText = 'Pokaż wszystkie kolory';
|
|
18
17
|
this._setupEvents = () => {
|
|
19
18
|
if (this.getAttribute('role') === 'group') {
|
|
20
19
|
this._setupCheckboxGroupEvents();
|
|
@@ -136,7 +135,6 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
136
135
|
this._$colorSwatchesChildren = [...this.children];
|
|
137
136
|
this._setupEvents();
|
|
138
137
|
this._addCssClasses();
|
|
139
|
-
this.numberOfVisibleColors && this._hideItems(this.numberOfVisibleColors);
|
|
140
138
|
this._showAllItemsEvent();
|
|
141
139
|
this.selectedColors = [...this.querySelectorAll('h-color-item[selected]')];
|
|
142
140
|
this._$colors = [...this.querySelectorAll('h-color-item')];
|
|
@@ -156,13 +154,11 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
156
154
|
}
|
|
157
155
|
_showAllItemsEvent() {
|
|
158
156
|
this.addEventListener(COLOR_SWATCHES_EVENT_NAMES.showMore, () => {
|
|
159
|
-
var _a;
|
|
160
157
|
if (!this._$colorSwatchesChildren)
|
|
161
158
|
return;
|
|
162
159
|
this._$colorSwatchesChildren.forEach(($colorSwatchesChild) => {
|
|
163
160
|
$colorSwatchesChild.removeAttribute('hidden');
|
|
164
161
|
});
|
|
165
|
-
(_a = this.querySelector('h-show-more')) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', '');
|
|
166
162
|
});
|
|
167
163
|
}
|
|
168
164
|
_handleChangeToNextColorItem({ target }) {
|
|
@@ -226,33 +222,15 @@ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
|
|
|
226
222
|
super.disconnectedCallback();
|
|
227
223
|
document.body.removeEventListener('keydown', this._focusOnSelectedColor);
|
|
228
224
|
}
|
|
229
|
-
render() {
|
|
230
|
-
return html `
|
|
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>`
|
|
235
|
-
: nothing}
|
|
236
|
-
</h-show-more>
|
|
237
|
-
`;
|
|
238
|
-
}
|
|
239
225
|
};
|
|
240
226
|
__decorate([
|
|
241
227
|
property({ type: Boolean }),
|
|
242
228
|
__metadata("design:type", Boolean)
|
|
243
229
|
], HColorSwatches.prototype, "multiple", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
property({ type: Number, attribute: 'number-of-visible-colors' }),
|
|
246
|
-
__metadata("design:type", Number)
|
|
247
|
-
], HColorSwatches.prototype, "numberOfVisibleColors", void 0);
|
|
248
230
|
__decorate([
|
|
249
231
|
property(),
|
|
250
232
|
__metadata("design:type", Array)
|
|
251
233
|
], HColorSwatches.prototype, "selectedColors", void 0);
|
|
252
|
-
__decorate([
|
|
253
|
-
property({ type: String, attribute: 'show-more-btn-text' }),
|
|
254
|
-
__metadata("design:type", Object)
|
|
255
|
-
], HColorSwatches.prototype, "showMoreBtnText", void 0);
|
|
256
234
|
HColorSwatches = __decorate([
|
|
257
235
|
phoenixCustomElement('h-color-swatches')
|
|
258
236
|
], HColorSwatches);
|
|
@@ -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;
|
|
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;"}
|
|
@@ -65,7 +65,7 @@ let HShowMore = class HShowMore extends PhoenixLightLitElement {
|
|
|
65
65
|
}
|
|
66
66
|
_showButton() {
|
|
67
67
|
var _a;
|
|
68
|
-
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.
|
|
68
|
+
(_a = this._$showMoreButton) === null || _a === void 0 ? void 0 : _a.removeAttribute('hidden');
|
|
69
69
|
}
|
|
70
70
|
_setupListeners() {
|
|
71
71
|
this.addEventListener(SHOW_MORE_EVENT_NAMES.showMore, this._showMore);
|