@shoper/phoenix_design_system 1.11.11-2 → 1.11.11-21
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_item/color_item.js +21 -29
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +0 -4
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +121 -11
- 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 +0 -2
- package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +89 -267
- package/build/cjs/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -21
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +1 -12
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message.js +9 -47
- package/build/cjs/packages/phoenix/src/components/messages/base_message.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/messages/base_message_constants.js +0 -2
- package/build/cjs/packages/phoenix/src/components/messages/base_message_constants.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +17 -17
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.d.ts +3 -6
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +22 -30
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +1 -4
- package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.d.ts +11 -1
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +124 -14
- 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.js +1 -2
- package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +5 -23
- package/build/esm/packages/phoenix/src/components/form/search/search.js +90 -268
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search_types.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js +0 -5
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/buttons/search_clear.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.d.ts +2 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js +9 -21
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/history/search_history.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js +2 -13
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.d.ts +0 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js +1 -8
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/message/search_message.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_producer_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js +4 -9
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_product_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js +4 -11
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_results.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js +5 -12
- package/build/esm/packages/phoenix/src/components/form/search/subcomponents/results/search_suggestion_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message.d.ts +1 -3
- package/build/esm/packages/phoenix/src/components/messages/base_message.js +11 -49
- package/build/esm/packages/phoenix/src/components/messages/base_message.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js +3 -4
- package/build/esm/packages/phoenix/src/components/messages/base_message_constants.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.js +3 -3
- package/package.json +2 -2
package/build/cjs/packages/phoenix/src/components/form/search/subcomponents/input/search_input.js
CHANGED
|
@@ -12,15 +12,6 @@ exports.HSearchInput = class HSearchInput extends phoenix_light_lit_element.Phoe
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this._isSearchPhraseCleared = false;
|
|
15
|
-
this._setupAttributes = () => {
|
|
16
|
-
var _a, _b, _c, _d, _e, _f;
|
|
17
|
-
(_a = this.input) === null || _a === void 0 ? void 0 : _a.setAttribute('role', 'combobox');
|
|
18
|
-
(_b = this.input) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-autocomplete', 'none');
|
|
19
|
-
(_c = this.input) === null || _c === void 0 ? void 0 : _c.setAttribute('aria-haspopup', 'grid');
|
|
20
|
-
const $searchContentContainer = (_d = this.closest('h-search')) === null || _d === void 0 ? void 0 : _d.querySelector(`.${search_constants.SEARCH_CLASS_NAMES.container}`);
|
|
21
|
-
(_e = this.input) === null || _e === void 0 ? void 0 : _e.setAttribute('aria-controls', ($searchContentContainer === null || $searchContentContainer === void 0 ? void 0 : $searchContentContainer.id) || '');
|
|
22
|
-
(_f = this.input) === null || _f === void 0 ? void 0 : _f.setAttribute('aria-activedescendant', '');
|
|
23
|
-
};
|
|
24
15
|
}
|
|
25
16
|
connectedCallback() {
|
|
26
17
|
super.connectedCallback();
|
|
@@ -30,7 +21,6 @@ exports.HSearchInput = class HSearchInput extends phoenix_light_lit_element.Phoe
|
|
|
30
21
|
}
|
|
31
22
|
this._setupInitialValue();
|
|
32
23
|
this._setupListeners();
|
|
33
|
-
this._setupAttributes();
|
|
34
24
|
}
|
|
35
25
|
_setupInitialValue() {
|
|
36
26
|
const searchQueryRegExp = /\/searchquery\/([^/]{1,})/;
|
|
@@ -59,8 +49,7 @@ exports.HSearchInput = class HSearchInput extends phoenix_light_lit_element.Phoe
|
|
|
59
49
|
this.input.addEventListener('focusin', (ev) => {
|
|
60
50
|
this.emitCustomEvent(search_constants.SEARCH_CUSTOM_EVENT_NAMES.focusin, {
|
|
61
51
|
detail: {
|
|
62
|
-
searchPhrase: ev.target.value
|
|
63
|
-
relatedTarget: ev.relatedTarget
|
|
52
|
+
searchPhrase: ev.target.value
|
|
64
53
|
}
|
|
65
54
|
});
|
|
66
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -7,7 +7,6 @@ var lit = require('lit');
|
|
|
7
7
|
var decorators = require('lit/decorators');
|
|
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
|
-
var v4 = require('../../../../../../../../external/uuid/dist/esm-browser/v4.js');
|
|
11
10
|
var when = require('../../../../../../../../external/lit/external/lit-html/directives/when.js');
|
|
12
11
|
var search_constants = require('../../search_constants.js');
|
|
13
12
|
var isEqual = require('../../../../../../../../external/lodash/isEqual.js');
|
|
@@ -18,7 +17,6 @@ exports.HSearchMessage = class HSearchMessage extends phoenix_light_lit_element.
|
|
|
18
17
|
this.searchPhrase = '';
|
|
19
18
|
this.history = [];
|
|
20
19
|
this.translations = {};
|
|
21
|
-
this._searchButtonId = v4['default']();
|
|
22
20
|
}
|
|
23
21
|
_createEmptyResults() {
|
|
24
22
|
return {
|
|
@@ -51,12 +49,7 @@ exports.HSearchMessage = class HSearchMessage extends phoenix_light_lit_element.
|
|
|
51
49
|
return lit.html `
|
|
52
50
|
${when.when(this._isNoResultsForSearchPhrase(), () => lit.html `<p class="${search_constants.SEARCH_CLASS_NAMES.messageNoResults}">
|
|
53
51
|
${this.searchPhrase} -
|
|
54
|
-
<button
|
|
55
|
-
class="${search_constants.SEARCH_CLASS_NAMES.messageText}"
|
|
56
|
-
@click="${this.handleGoToResults}"
|
|
57
|
-
type="button"
|
|
58
|
-
data-search-item-id="${this._searchButtonId}"
|
|
59
|
-
>
|
|
52
|
+
<button class="${search_constants.SEARCH_CLASS_NAMES.messageText}" @click="${this.handleGoToResults}" type="button">
|
|
60
53
|
${this.translations.searchInStore}
|
|
61
54
|
</button>
|
|
62
55
|
</p>`, () => lit.html `${when.when(this._hasHistoryAndEmptyPhrase(), () => lit.html `<p class="${search_constants.SEARCH_CLASS_NAMES.message} ${search_constants.SEARCH_CLASS_NAMES.messageWithHistory}">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,sBAAsB,oDAAwD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -31,14 +31,13 @@ exports.HSearchProducerContent = class HSearchProducerContent extends phoenix_li
|
|
|
31
31
|
${repeat.repeat(this.producers, (producer, index) => {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
return lit.html `<li
|
|
34
|
-
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${
|
|
34
|
+
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.producers + index ===
|
|
35
35
|
this.activeItemId
|
|
36
36
|
? search_constants.SEARCH_CLASS_NAMES.itemActive
|
|
37
37
|
: ''}"
|
|
38
|
-
data-search-item-id="${this.
|
|
38
|
+
data-search-item-id="${this.initialItemIds.producers + index}"
|
|
39
39
|
aria-label=${this.producerAriaLabel ? `${this.producerAriaLabel} ${producer.name}` : undefined}
|
|
40
40
|
tabindex="0"
|
|
41
|
-
role="option"
|
|
42
41
|
>
|
|
43
42
|
<a
|
|
44
43
|
href="${producer.url}"
|
|
@@ -59,13 +58,9 @@ tslib_es6.__decorate([
|
|
|
59
58
|
tslib_es6.__metadata("design:type", Array)
|
|
60
59
|
], exports.HSearchProducerContent.prototype, "producers", void 0);
|
|
61
60
|
tslib_es6.__decorate([
|
|
62
|
-
decorators.property({ type:
|
|
63
|
-
tslib_es6.__metadata("design:type",
|
|
61
|
+
decorators.property({ type: Number, attribute: 'active-item-id' }),
|
|
62
|
+
tslib_es6.__metadata("design:type", Number)
|
|
64
63
|
], exports.HSearchProducerContent.prototype, "activeItemId", void 0);
|
|
65
|
-
tslib_es6.__decorate([
|
|
66
|
-
decorators.property({ type: String, attribute: 'search-id' }),
|
|
67
|
-
tslib_es6.__metadata("design:type", String)
|
|
68
|
-
], exports.HSearchProducerContent.prototype, "searchId", void 0);
|
|
69
64
|
tslib_es6.__decorate([
|
|
70
65
|
decorators.property({ type: Object, reflect: true }),
|
|
71
66
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -44,14 +44,13 @@ exports.HSearchProductContent = class HSearchProductContent extends phoenix_ligh
|
|
|
44
44
|
${repeat.repeat(this.products, (product, index) => {
|
|
45
45
|
var _a, _b;
|
|
46
46
|
return lit.html ` <li
|
|
47
|
-
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${
|
|
47
|
+
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${this.initialItemIds.products + index ===
|
|
48
48
|
this.activeItemId
|
|
49
49
|
? search_constants.SEARCH_CLASS_NAMES.itemActive
|
|
50
50
|
: ''}"
|
|
51
|
-
data-search-item-id="${this.
|
|
51
|
+
data-search-item-id="${this.initialItemIds.products + index}"
|
|
52
52
|
aria-label=${this.productAriaLabel ? `${this.productAriaLabel} ${product.name}` : undefined}
|
|
53
53
|
tabindex="0"
|
|
54
|
-
role="option"
|
|
55
54
|
>
|
|
56
55
|
<a
|
|
57
56
|
href="${product.url}"
|
|
@@ -100,13 +99,9 @@ tslib_es6.__decorate([
|
|
|
100
99
|
tslib_es6.__metadata("design:type", Object)
|
|
101
100
|
], exports.HSearchProductContent.prototype, "settings", void 0);
|
|
102
101
|
tslib_es6.__decorate([
|
|
103
|
-
decorators.property({ type:
|
|
104
|
-
tslib_es6.__metadata("design:type",
|
|
102
|
+
decorators.property({ type: Number, attribute: 'active-item-id' }),
|
|
103
|
+
tslib_es6.__metadata("design:type", Number)
|
|
105
104
|
], exports.HSearchProductContent.prototype, "activeItemId", void 0);
|
|
106
|
-
tslib_es6.__decorate([
|
|
107
|
-
decorators.property({ type: String, attribute: 'search-id' }),
|
|
108
|
-
tslib_es6.__metadata("design:type", String)
|
|
109
|
-
], exports.HSearchProductContent.prototype, "searchId", void 0);
|
|
110
105
|
tslib_es6.__decorate([
|
|
111
106
|
decorators.property({ type: Object, reflect: true }),
|
|
112
107
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -70,7 +70,6 @@ exports.HSearchResults = class HSearchResults extends phoenix_light_lit_element.
|
|
|
70
70
|
${when.when(((_a = this.results.suggestions) === null || _a === void 0 ? void 0 : _a.length) || ((_b = this.results.categories) === null || _b === void 0 ? void 0 : _b.length), () => lit.html ` <h-search-suggestion-content
|
|
71
71
|
class="${search_constants.SEARCH_CLASS_NAMES.section}"
|
|
72
72
|
active-item-id="${this.activeItemId}"
|
|
73
|
-
search-id="${this.searchId}"
|
|
74
73
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
75
74
|
.translations="${this.translations}"
|
|
76
75
|
locale="${this.locale}"
|
|
@@ -85,7 +84,6 @@ exports.HSearchResults = class HSearchResults extends phoenix_light_lit_element.
|
|
|
85
84
|
.products="${this.results.products}"
|
|
86
85
|
.settings="${this.settings}"
|
|
87
86
|
active-item-id="${this.activeItemId}"
|
|
88
|
-
search-id="${this.searchId}"
|
|
89
87
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
90
88
|
.translations="${this.translations}"
|
|
91
89
|
.productAriaLabel=${this.settings.suggesterProductItemAriaLabel}
|
|
@@ -95,7 +93,7 @@ exports.HSearchResults = class HSearchResults extends phoenix_light_lit_element.
|
|
|
95
93
|
class="${search_constants.SEARCH_CLASS_NAMES.productButton}"
|
|
96
94
|
@click="${this.handleLoadMoreProducts}"
|
|
97
95
|
type="button"
|
|
98
|
-
data-search-item-id="${this.
|
|
96
|
+
data-search-item-id="${this._loadMoreButtonId}"
|
|
99
97
|
>
|
|
100
98
|
${this.translations.loadMore}
|
|
101
99
|
</button>`), () => lit.html `
|
|
@@ -103,7 +101,7 @@ exports.HSearchResults = class HSearchResults extends phoenix_light_lit_element.
|
|
|
103
101
|
class="${search_constants.SEARCH_CLASS_NAMES.productButton}"
|
|
104
102
|
@click="${this.handleGoToProductsFor}"
|
|
105
103
|
type="button"
|
|
106
|
-
data-search-item-id="${this.
|
|
104
|
+
data-search-item-id="${this._goToProductsForButtonId}"
|
|
107
105
|
>
|
|
108
106
|
${this.translations.goToProductsFor}: <strong>${this._getSearchPhrase()}</strong>
|
|
109
107
|
</button>
|
|
@@ -114,7 +112,6 @@ exports.HSearchResults = class HSearchResults extends phoenix_light_lit_element.
|
|
|
114
112
|
class="${search_constants.SEARCH_CLASS_NAMES.section}"
|
|
115
113
|
.producers="${this.results.producers}"
|
|
116
114
|
active-item-id="${this.activeItemId}"
|
|
117
|
-
search-id="${this.searchId}"
|
|
118
115
|
.initialItemIds="${this._getInitialItemsIds()}"
|
|
119
116
|
.translations="${this.translations}"
|
|
120
117
|
search-phrase="${this.searchPhrase}"
|
|
@@ -145,13 +142,9 @@ tslib_es6.__decorate([
|
|
|
145
142
|
tslib_es6.__metadata("design:type", String)
|
|
146
143
|
], exports.HSearchResults.prototype, "locale", void 0);
|
|
147
144
|
tslib_es6.__decorate([
|
|
148
|
-
decorators.property({ type:
|
|
149
|
-
tslib_es6.__metadata("design:type",
|
|
145
|
+
decorators.property({ type: Number, attribute: 'active-item-id' }),
|
|
146
|
+
tslib_es6.__metadata("design:type", Number)
|
|
150
147
|
], exports.HSearchResults.prototype, "activeItemId", void 0);
|
|
151
|
-
tslib_es6.__decorate([
|
|
152
|
-
decorators.property({ type: String, attribute: 'search-id' }),
|
|
153
|
-
tslib_es6.__metadata("design:type", String)
|
|
154
|
-
], exports.HSearchResults.prototype, "searchId", void 0);
|
|
155
148
|
tslib_es6.__decorate([
|
|
156
149
|
decorators.property({ type: Object }),
|
|
157
150
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA,iBAAiB,8DAAkE;AACnF,mBAAmB,2EAAmF;AACtG;AACA,sBAAsB,oDAAwD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA,iBAAiB,8DAAkE;AACnF,mBAAmB,2EAAmF;AACtG;AACA,sBAAsB,oDAAwD;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -107,16 +107,13 @@ exports.HSearchSuggestionContent = class HSearchSuggestionContent extends phoeni
|
|
|
107
107
|
<ul>
|
|
108
108
|
${repeat.repeat(this._suggestionsData, (suggestion, index) => lit.html `<li
|
|
109
109
|
@click=${() => this._handleSuggestion(suggestion.suggestionName, suggestion.type)}
|
|
110
|
-
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${
|
|
110
|
+
class="${search_constants.SEARCH_CLASS_NAMES.item} ${search_constants.SEARCH_CLASS_NAMES.itemHoverable} ${index === this.activeItemId
|
|
111
111
|
? search_constants.SEARCH_CLASS_NAMES.itemActive
|
|
112
112
|
: ''}"
|
|
113
113
|
data-suggested-value="${suggestion.suggestionName}"
|
|
114
|
-
data-search-item-id="${
|
|
115
|
-
aria-label
|
|
116
|
-
`${this.suggestionAriaLabel} ${suggestion.suggestionName || suggestion.categoryName}` :
|
|
117
|
-
''}"
|
|
114
|
+
data-search-item-id="${index}"
|
|
115
|
+
aria-label=${this.suggestionAriaLabel ? `${this.suggestionAriaLabel} ${suggestion.suggestionName}` : undefined}
|
|
118
116
|
tabindex="0"
|
|
119
|
-
role="option"
|
|
120
117
|
>
|
|
121
118
|
${when.when(suggestion.type === search_constants.SUGGESTIONS_TYPE.suggestion, () => lit.html ` <span> ${this._getMatchedPhrase(suggestion.suggestionName)} </span>
|
|
122
119
|
<h-icon
|
|
@@ -139,13 +136,9 @@ exports.HSearchSuggestionContent = class HSearchSuggestionContent extends phoeni
|
|
|
139
136
|
}
|
|
140
137
|
};
|
|
141
138
|
tslib_es6.__decorate([
|
|
142
|
-
decorators.property({ type:
|
|
143
|
-
tslib_es6.__metadata("design:type",
|
|
139
|
+
decorators.property({ type: Number, attribute: 'active-item-id' }),
|
|
140
|
+
tslib_es6.__metadata("design:type", Number)
|
|
144
141
|
], exports.HSearchSuggestionContent.prototype, "activeItemId", void 0);
|
|
145
|
-
tslib_es6.__decorate([
|
|
146
|
-
decorators.property({ type: String, attribute: 'search-id' }),
|
|
147
|
-
tslib_es6.__metadata("design:type", String)
|
|
148
|
-
], exports.HSearchSuggestionContent.prototype, "searchId", void 0);
|
|
149
142
|
tslib_es6.__decorate([
|
|
150
143
|
decorators.property({ type: Object, reflect: true }),
|
|
151
144
|
tslib_es6.__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,qDAAyD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2EAAmF;AACtG;AACA,qBAAqB,6EAAqF;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
|
6
6
|
var decorators = require('lit/decorators');
|
|
7
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
|
-
var keystrokes_controller = require('../../controllers/keystrokes_controller/keystrokes_controller.js');
|
|
10
9
|
var portal_constants = require('../portal/portal_constants.js');
|
|
11
10
|
var click_outside_controller = require('../../controllers/click_outside_controller/click_outside_controller.js');
|
|
12
11
|
var relative_position_controller = require('../../controllers/relative_position_controller/relative_position_controller.js');
|
|
@@ -19,10 +18,12 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
|
19
18
|
this.portalTarget = base_message_constants.DEFAULT_MESSAGE_PORTAL_NAME;
|
|
20
19
|
this.direction = utilities.DIRECTIONS.topCenter;
|
|
21
20
|
this.offset = base_message_constants.DEFAULT_MESSAGE_OFFSET;
|
|
21
|
+
this.tabindex = '0';
|
|
22
22
|
this._setupEventListeners = () => {
|
|
23
23
|
this.addEventListener('mouseenter', this.open);
|
|
24
24
|
this.addEventListener('mouseleave', this.close);
|
|
25
|
-
this.addEventListener('
|
|
25
|
+
this.addEventListener('focusin', this.open);
|
|
26
|
+
this.addEventListener('focusout', this.close);
|
|
26
27
|
};
|
|
27
28
|
this._positionMessage = () => {
|
|
28
29
|
requestAnimationFrame(() => {
|
|
@@ -58,49 +59,11 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
|
58
59
|
});
|
|
59
60
|
}, this._shouldDelayClosing ? base_message_constants.MESSAGE_CLOSE_DELAY_IN_MS : 0);
|
|
60
61
|
};
|
|
61
|
-
this._handleFocusWithinMessage = (ev) => {
|
|
62
|
-
var _a;
|
|
63
|
-
if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.closest(`.${this._messageComponentName}`)) !== this)
|
|
64
|
-
this.close();
|
|
65
|
-
if (!document.activeElement || ev.shiftKey)
|
|
66
|
-
return;
|
|
67
|
-
const $focusableElements = utilities.UiDomUtils.getFocusableElements(this);
|
|
68
|
-
const activeElementIndex = $focusableElements.indexOf(document.activeElement);
|
|
69
|
-
const isLastFocusableChild = activeElementIndex === $focusableElements.length - 1;
|
|
70
|
-
if (!isLastFocusableChild)
|
|
71
|
-
return;
|
|
72
|
-
this.close();
|
|
73
|
-
};
|
|
74
|
-
this._handleReverseTab = () => {
|
|
75
|
-
const $focusableElements = utilities.UiDomUtils.getFocusableElements(document.body);
|
|
76
|
-
const activeElement = document.activeElement;
|
|
77
|
-
const indexOfCurrentlyFocusedElement = $focusableElements.indexOf(activeElement);
|
|
78
|
-
const $previousElement = $focusableElements[indexOfCurrentlyFocusedElement - 1];
|
|
79
|
-
const $previousElementMessageParent = $previousElement === null || $previousElement === void 0 ? void 0 : $previousElement.closest(`h-${this._messageComponentName}`);
|
|
80
|
-
if ($previousElementMessageParent === this)
|
|
81
|
-
return;
|
|
82
|
-
if ($previousElementMessageParent)
|
|
83
|
-
$previousElementMessageParent.open();
|
|
84
|
-
if (this._isBaseMessage(activeElement))
|
|
85
|
-
activeElement.close();
|
|
86
|
-
};
|
|
87
62
|
this._clickOutsideController = new click_outside_controller.ClickOutsideController({
|
|
88
63
|
host: this,
|
|
89
64
|
container: this,
|
|
90
65
|
action: this.close
|
|
91
66
|
});
|
|
92
|
-
new keystrokes_controller.KeystrokesController({
|
|
93
|
-
host: this,
|
|
94
|
-
keys: ['tab'],
|
|
95
|
-
target: this,
|
|
96
|
-
callback: this._handleFocusWithinMessage
|
|
97
|
-
});
|
|
98
|
-
new keystrokes_controller.KeystrokesController({
|
|
99
|
-
host: this,
|
|
100
|
-
keys: [['shift', 'tab']],
|
|
101
|
-
target: document.body,
|
|
102
|
-
callback: this._handleReverseTab
|
|
103
|
-
});
|
|
104
67
|
}
|
|
105
68
|
connectedCallback(messageComponentName = '') {
|
|
106
69
|
super.connectedCallback();
|
|
@@ -116,7 +79,7 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
|
116
79
|
elementToPosition: this._$messageContent,
|
|
117
80
|
offset: this.offset
|
|
118
81
|
});
|
|
119
|
-
this.setAttribute('tabindex',
|
|
82
|
+
this.setAttribute('tabindex', this.tabindex);
|
|
120
83
|
this._setupEventListeners();
|
|
121
84
|
}
|
|
122
85
|
static _appendMessagePortal() {
|
|
@@ -127,11 +90,6 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
|
127
90
|
$portalTarget.setAttribute(portal_constants.PORTAL_TARGET_NAME_PROP, base_message_constants.DEFAULT_MESSAGE_PORTAL_NAME);
|
|
128
91
|
document.body.appendChild($portalTarget);
|
|
129
92
|
}
|
|
130
|
-
_isBaseMessage($element) {
|
|
131
|
-
if (base_message_constants.MESSAGE_ELEMENTS.includes($element.localName))
|
|
132
|
-
return true;
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
93
|
}
|
|
136
94
|
tslib_es6.__decorate([
|
|
137
95
|
decorators.property({ type: Boolean, reflect: true }),
|
|
@@ -148,7 +106,11 @@ tslib_es6.__decorate([
|
|
|
148
106
|
tslib_es6.__decorate([
|
|
149
107
|
decorators.property({ type: String }),
|
|
150
108
|
tslib_es6.__metadata("design:type", Number)
|
|
151
|
-
], BaseMessage.prototype, "offset", void 0);
|
|
109
|
+
], BaseMessage.prototype, "offset", void 0);
|
|
110
|
+
tslib_es6.__decorate([
|
|
111
|
+
decorators.property({ type: String }),
|
|
112
|
+
tslib_es6.__metadata("design:type", String)
|
|
113
|
+
], BaseMessage.prototype, "tabindex", void 0);
|
|
152
114
|
|
|
153
115
|
exports.BaseMessage = BaseMessage;
|
|
154
116
|
//# sourceMappingURL=base_message.js.map
|
|
@@ -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;
|
|
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;"}
|
|
@@ -9,7 +9,6 @@ const DEFAULT_MESSAGE_PORTAL_NAME = 'message-portal';
|
|
|
9
9
|
const MESSAGE_CONTENT_SLOT_NAME = 'message-content';
|
|
10
10
|
const MESSAGE_REMOVED_CLASS_NAME = `removed`;
|
|
11
11
|
const DEFAULT_MESSAGE_OFFSET = 10;
|
|
12
|
-
const MESSAGE_ELEMENTS = [tooltip_constants.TOOLTIP_ELEMENT_NAME, hint_constants.HINT_ELEMENT_NAME];
|
|
13
12
|
const MESSAGE_CONTENT_ELEMENTS = [tooltip_constants.TOOLTIP_CONTENT_ELEMENT_NAME, hint_constants.HINT_CONTENT_ELEMENT_NAME];
|
|
14
13
|
const MESSAGE_SHOW_DELAY_IN_MS = 100;
|
|
15
14
|
const MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = 500;
|
|
@@ -20,7 +19,6 @@ exports.DEFAULT_MESSAGE_PORTAL_NAME = DEFAULT_MESSAGE_PORTAL_NAME;
|
|
|
20
19
|
exports.MESSAGE_CLOSE_DELAY_IN_MS = MESSAGE_CLOSE_DELAY_IN_MS;
|
|
21
20
|
exports.MESSAGE_CONTENT_ELEMENTS = MESSAGE_CONTENT_ELEMENTS;
|
|
22
21
|
exports.MESSAGE_CONTENT_SLOT_NAME = MESSAGE_CONTENT_SLOT_NAME;
|
|
23
|
-
exports.MESSAGE_ELEMENTS = MESSAGE_ELEMENTS;
|
|
24
22
|
exports.MESSAGE_REMOVED_CLASS_NAME = MESSAGE_REMOVED_CLASS_NAME;
|
|
25
23
|
exports.MESSAGE_SHOW_DELAY_IN_MS = MESSAGE_SHOW_DELAY_IN_MS;
|
|
26
24
|
exports.MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS;
|
|
@@ -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;
|
|
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;"}
|
|
@@ -76,8 +76,8 @@ var toggle_button = require('./components/groups/toggle_button_group/toggle_butt
|
|
|
76
76
|
var click_outside_controller_messages = require('./controllers/click_outside_controller/click_outside_controller_messages.js');
|
|
77
77
|
var backdrop = require('./components/backdrop/backdrop.js');
|
|
78
78
|
var color_swatches_control_constants = require('./components/form/color_swatches_control/color_swatches_control_constants.js');
|
|
79
|
-
var color_item = require('./components/color_swatches/color_item/color_item.js');
|
|
80
79
|
var color_swatches = require('./components/color_swatches/color_swatches.js');
|
|
80
|
+
var color_item = require('./components/color_swatches/color_item/color_item.js');
|
|
81
81
|
var color_swatches_control = require('./components/form/color_swatches_control/color_swatches_control.js');
|
|
82
82
|
var show_more = require('./components/color_swatches/show-more/show_more.js');
|
|
83
83
|
var visibility_controller = require('./controllers/visibility_controller/visibility_controller.js');
|
|
@@ -102,11 +102,11 @@ var search_input = require('./components/form/search/subcomponents/input/search_
|
|
|
102
102
|
var search_results = require('./components/form/search/subcomponents/results/search_results.js');
|
|
103
103
|
var search_history_load_more = require('./components/form/search/subcomponents/history/search_history_load_more.js');
|
|
104
104
|
var search_history = require('./components/form/search/subcomponents/history/search_history.js');
|
|
105
|
-
var search_clear = require('./components/form/search/subcomponents/buttons/search_clear.js');
|
|
106
|
-
var search_message = require('./components/form/search/subcomponents/message/search_message.js');
|
|
107
105
|
var search = require('./components/form/search/search.js');
|
|
108
106
|
var search_submit = require('./components/form/search/subcomponents/buttons/search_submit.js');
|
|
107
|
+
var search_clear = require('./components/form/search/subcomponents/buttons/search_clear.js');
|
|
109
108
|
var search_close = require('./components/form/search/subcomponents/buttons/search_close.js');
|
|
109
|
+
var search_message = require('./components/form/search/subcomponents/message/search_message.js');
|
|
110
110
|
var search_history_remove = require('./components/form/search/subcomponents/history/search_history_remove.js');
|
|
111
111
|
var search_history_select = require('./components/form/search/subcomponents/history/search_history_select.js');
|
|
112
112
|
var search_suggestion_content = require('./components/form/search/subcomponents/results/search_suggestion_content.js');
|
|
@@ -464,16 +464,16 @@ Object.defineProperty(exports, 'HBackdrop', {
|
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
exports.COLOR_SWATCHES_CONTROL_EVENT_NAMES = color_swatches_control_constants.COLOR_SWATCHES_CONTROL_EVENT_NAMES;
|
|
467
|
-
Object.defineProperty(exports, '
|
|
467
|
+
Object.defineProperty(exports, 'HColorSwatches', {
|
|
468
468
|
enumerable: true,
|
|
469
469
|
get: function () {
|
|
470
|
-
return
|
|
470
|
+
return color_swatches.HColorSwatches;
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
|
-
Object.defineProperty(exports, '
|
|
473
|
+
Object.defineProperty(exports, 'HColorItem', {
|
|
474
474
|
enumerable: true,
|
|
475
475
|
get: function () {
|
|
476
|
-
return
|
|
476
|
+
return color_item.HColorItem;
|
|
477
477
|
}
|
|
478
478
|
});
|
|
479
479
|
Object.defineProperty(exports, 'HColorSwatchesControl', {
|
|
@@ -610,34 +610,34 @@ Object.defineProperty(exports, 'HSearchHistory', {
|
|
|
610
610
|
return search_history.HSearchHistory;
|
|
611
611
|
}
|
|
612
612
|
});
|
|
613
|
-
Object.defineProperty(exports, '
|
|
613
|
+
Object.defineProperty(exports, 'HSearch', {
|
|
614
614
|
enumerable: true,
|
|
615
615
|
get: function () {
|
|
616
|
-
return
|
|
616
|
+
return search.HSearch;
|
|
617
617
|
}
|
|
618
618
|
});
|
|
619
|
-
Object.defineProperty(exports, '
|
|
619
|
+
Object.defineProperty(exports, 'HSearchSubmit', {
|
|
620
620
|
enumerable: true,
|
|
621
621
|
get: function () {
|
|
622
|
-
return
|
|
622
|
+
return search_submit.HSearchSubmit;
|
|
623
623
|
}
|
|
624
624
|
});
|
|
625
|
-
Object.defineProperty(exports, '
|
|
625
|
+
Object.defineProperty(exports, 'HSearchClear', {
|
|
626
626
|
enumerable: true,
|
|
627
627
|
get: function () {
|
|
628
|
-
return
|
|
628
|
+
return search_clear.HSearchClear;
|
|
629
629
|
}
|
|
630
630
|
});
|
|
631
|
-
Object.defineProperty(exports, '
|
|
631
|
+
Object.defineProperty(exports, 'HSearchClose', {
|
|
632
632
|
enumerable: true,
|
|
633
633
|
get: function () {
|
|
634
|
-
return
|
|
634
|
+
return search_close.HSearchClose;
|
|
635
635
|
}
|
|
636
636
|
});
|
|
637
|
-
Object.defineProperty(exports, '
|
|
637
|
+
Object.defineProperty(exports, 'HSearchMessage', {
|
|
638
638
|
enumerable: true,
|
|
639
639
|
get: function () {
|
|
640
|
-
return
|
|
640
|
+
return search_message.HSearchMessage;
|
|
641
641
|
}
|
|
642
642
|
});
|
|
643
643
|
Object.defineProperty(exports, 'HSearchHistoryRemove', {
|
|
@@ -8,12 +8,9 @@ export declare class HColorItem extends PhoenixLightLitElement {
|
|
|
8
8
|
selected: boolean;
|
|
9
9
|
size?: TColorItemSize;
|
|
10
10
|
unclickable: boolean;
|
|
11
|
-
private
|
|
12
|
-
constructor();
|
|
11
|
+
private _$colorSwatches;
|
|
13
12
|
connectedCallback(): void;
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
private setupEvents;
|
|
13
|
+
private _setupAriaAttributes;
|
|
14
|
+
private _setupClasses;
|
|
17
15
|
private setBgColor;
|
|
18
|
-
private _dispatchClickedEvent;
|
|
19
16
|
}
|
|
@@ -3,47 +3,40 @@ import { property } from 'lit/decorators';
|
|
|
3
3
|
import { ColorUtils } 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
|
-
import {
|
|
7
|
-
import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_CSS_CLASSES, COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item_constants.js';
|
|
6
|
+
import { COLOR_ITEM_CSS_CLASSES } from './color_item_constants.js';
|
|
8
7
|
|
|
9
8
|
let HColorItem = class HColorItem extends PhoenixLightLitElement {
|
|
10
9
|
constructor() {
|
|
11
|
-
super();
|
|
10
|
+
super(...arguments);
|
|
12
11
|
this.disabled = false;
|
|
13
12
|
this.selected = false;
|
|
14
13
|
this.unclickable = false;
|
|
15
|
-
this.
|
|
16
|
-
|
|
14
|
+
this._$colorSwatches = null;
|
|
15
|
+
this._setupAriaAttributes = () => {
|
|
16
|
+
var _a;
|
|
17
|
+
this._$colorSwatches = this.closest('h-color-swatches');
|
|
18
|
+
this.setAttribute('role', ((_a = this._$colorSwatches) === null || _a === void 0 ? void 0 : _a.multiple) ? 'checkbox' : 'radio');
|
|
19
|
+
this.setAttribute('aria-label', this.label ? this.label : this.color);
|
|
20
|
+
};
|
|
21
|
+
this._setupClasses = () => {
|
|
22
|
+
this.classList.add(COLOR_ITEM_CSS_CLASSES.colorItem);
|
|
23
|
+
if (this.size)
|
|
24
|
+
this.classList.add(COLOR_ITEM_CSS_CLASSES[this.size]);
|
|
17
25
|
};
|
|
18
|
-
this._btnController = new BtnController(this, this._dispatchClickedEvent);
|
|
19
26
|
}
|
|
20
27
|
connectedCallback() {
|
|
21
28
|
super.connectedCallback();
|
|
22
|
-
this.
|
|
29
|
+
this._setupAriaAttributes();
|
|
30
|
+
this._setupClasses();
|
|
23
31
|
this.style.backgroundColor = this.setBgColor(this.disabled);
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
if (this.unclickable) {
|
|
33
|
+
this.removeAttribute('tabindex');
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.setAttribute('tabindex', '0');
|
|
37
|
+
}
|
|
28
38
|
if (!this.value)
|
|
29
39
|
this.value = this.color;
|
|
30
|
-
if (this.size)
|
|
31
|
-
this.classList.add(COLOR_ITEM_CSS_CLASSES[this.size]);
|
|
32
|
-
}
|
|
33
|
-
attributeChangedCallback(name, value, newValue) {
|
|
34
|
-
super.attributeChangedCallback(name, value, newValue);
|
|
35
|
-
switch (name) {
|
|
36
|
-
case COLOR_ITEM_SELECTED_ATTRIBUTE: {
|
|
37
|
-
this._syncAriaPressed();
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
_syncAriaPressed() {
|
|
43
|
-
this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
|
|
44
|
-
}
|
|
45
|
-
setupEvents() {
|
|
46
|
-
!this.unclickable && this.addEventListener('click', this._dispatchClickedEvent);
|
|
47
40
|
}
|
|
48
41
|
setBgColor(itemIsDisabled) {
|
|
49
42
|
return itemIsDisabled ? ColorUtils.hexToRgba(this.color, 0.5) : this.color;
|
|
@@ -78,8 +71,7 @@ __decorate([
|
|
|
78
71
|
__metadata("design:type", Boolean)
|
|
79
72
|
], HColorItem.prototype, "unclickable", void 0);
|
|
80
73
|
HColorItem = __decorate([
|
|
81
|
-
phoenixCustomElement('h-color-item')
|
|
82
|
-
__metadata("design:paramtypes", [])
|
|
74
|
+
phoenixCustomElement('h-color-item')
|
|
83
75
|
], HColorItem);
|
|
84
76
|
|
|
85
77
|
export { HColorItem };
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map
CHANGED
|
@@ -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;
|
|
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;"}
|
package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
const colorItemBaseCssClass = 'color-item';
|
|
2
|
-
const COLOR_ITEM_EVENT_NAMES = {
|
|
3
|
-
selected: 'colorItemSelected'
|
|
4
|
-
};
|
|
5
2
|
const COLOR_ITEM_SIZES = {
|
|
6
3
|
s: 's',
|
|
7
4
|
xs: 'xs'
|
|
@@ -13,5 +10,5 @@ const COLOR_ITEM_CSS_CLASSES = {
|
|
|
13
10
|
};
|
|
14
11
|
const COLOR_ITEM_SELECTED_ATTRIBUTE = 'selected';
|
|
15
12
|
|
|
16
|
-
export { COLOR_ITEM_CSS_CLASSES,
|
|
13
|
+
export { COLOR_ITEM_CSS_CLASSES, COLOR_ITEM_SELECTED_ATTRIBUTE, COLOR_ITEM_SIZES };
|
|
17
14
|
//# sourceMappingURL=color_item_constants.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;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|