@shoper/phoenix_design_system 1.11.11-0 → 1.11.11-10
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/dropdown/dropdown.js +114 -37
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js +0 -5
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +13 -24
- package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/search/search.js +79 -246
- 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 +0 -10
- 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/form/select/select.js +2 -3
- package/build/cjs/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js +13 -2
- package/build/cjs/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js.map +1 -1
- package/build/cjs/packages/phoenix/src/index.js +12 -12
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +13 -4
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +115 -38
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.d.ts +0 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js +0 -5
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.d.ts +1 -2
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +14 -25
- package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/search/search.d.ts +5 -22
- package/build/esm/packages/phoenix/src/components/form/search/search.js +80 -247
- package/build/esm/packages/phoenix/src/components/form/search/search.js.map +1 -1
- 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 +1 -11
- 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/form/select/select.js +2 -3
- package/build/esm/packages/phoenix/src/components/form/select/select.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.d.ts +2 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js +13 -2
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/keystrokes_controller/keystrokes_controller_types.d.ts +1 -0
- package/build/esm/packages/phoenix/src/index.js +2 -2
- package/package.json +2 -2
|
@@ -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;"}
|
|
@@ -233,9 +233,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
233
233
|
select_utils.SelectControlUtils.appendHTMLOption($option, $list, position);
|
|
234
234
|
}
|
|
235
235
|
updateOptionAriaAttribute($option) {
|
|
236
|
-
|
|
237
|
-
? $option.removeAttribute(this.multiple ? 'aria-checked' : 'aria-selected')
|
|
238
|
-
: $option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', 'true');
|
|
236
|
+
$option.setAttribute(this.multiple ? 'aria-checked' : 'aria-selected', String($option.selected));
|
|
239
237
|
}
|
|
240
238
|
_removeHTMLOptions(optionsValues) {
|
|
241
239
|
this._$options = select_utils.SelectControlUtils.removeHTMLOptions(Array.from(this._$options.values()), optionsValues);
|
|
@@ -300,6 +298,7 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
300
298
|
name="${this.controlName}"
|
|
301
299
|
offset=${this.offset}
|
|
302
300
|
content-width="full"
|
|
301
|
+
prevent-focus-trap
|
|
303
302
|
>
|
|
304
303
|
<h-dropdown-toggler name=${this.controlName}> ${this.getSlot(select_constants.SELECT_SLOT_NAMES.toggler)} </h-dropdown-toggler>
|
|
305
304
|
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/controllers/keystrokes_controller/keystrokes_controller.js
CHANGED
|
@@ -7,11 +7,21 @@ require('lit');
|
|
|
7
7
|
|
|
8
8
|
var _KeystrokesController_host, _KeystrokesController_target;
|
|
9
9
|
class KeystrokesController {
|
|
10
|
-
constructor({ host, keys, callback, target }) {
|
|
10
|
+
constructor({ host, keys, callback, target, containerSelectors }) {
|
|
11
11
|
_KeystrokesController_host.set(this, void 0);
|
|
12
12
|
_KeystrokesController_target.set(this, void 0);
|
|
13
13
|
this._buffer = [];
|
|
14
|
-
this._clearBuffer = () => {
|
|
14
|
+
this._clearBuffer = (ev) => {
|
|
15
|
+
if (!this._containerSelectors) {
|
|
16
|
+
this._buffer = [];
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const $newFocusedElement = ev.relatedTarget;
|
|
20
|
+
if ($newFocusedElement) {
|
|
21
|
+
const isNewFocusedElementAChild = !!this._containerSelectors.find((containerSelector) => !!$newFocusedElement.closest(containerSelector));
|
|
22
|
+
if (isNewFocusedElementAChild)
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
15
25
|
this._buffer = [];
|
|
16
26
|
};
|
|
17
27
|
this._saveKey = (ev) => {
|
|
@@ -79,6 +89,7 @@ class KeystrokesController {
|
|
|
79
89
|
tslib_es6.__classPrivateFieldSet(this, _KeystrokesController_target, target, "f");
|
|
80
90
|
this._keys = keys;
|
|
81
91
|
this._callback = callback;
|
|
92
|
+
this._containerSelectors = containerSelectors;
|
|
82
93
|
tslib_es6.__classPrivateFieldGet(this, _KeystrokesController_host, "f").addController(this);
|
|
83
94
|
}
|
|
84
95
|
hostConnected() {
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -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');
|
|
@@ -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', {
|
|
@@ -15,6 +15,8 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
15
15
|
contentWidth: TDropdownContentWidth;
|
|
16
16
|
portalTarget: string;
|
|
17
17
|
mobilePosition: TMobileElementPosition;
|
|
18
|
+
id: string;
|
|
19
|
+
preventFocusTrap: boolean;
|
|
18
20
|
$dropdownToggler: HDropdownToggler | null;
|
|
19
21
|
$dropdownContent: HDropdownContent | null;
|
|
20
22
|
$nestedDropdownContentElements?: HDropdownContent[];
|
|
@@ -40,12 +42,19 @@ export declare class HDropdown extends PhoenixLightLitElement implements IDropdo
|
|
|
40
42
|
private _observeScrollToggling;
|
|
41
43
|
private _toggleScroll;
|
|
42
44
|
private _closeDropdownOnEscape;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
45
|
-
private
|
|
46
|
-
private
|
|
45
|
+
private _keepFocusWithinDropdownForwards;
|
|
46
|
+
private _handleFocusOnNextElementAfterDropdown;
|
|
47
|
+
private _handleFocusFromTogglerForwards;
|
|
48
|
+
private _handleFocusFromSentinelEndForwards;
|
|
49
|
+
private _keepFocusWithinDropdownBackwards;
|
|
50
|
+
private _handleDefaultFocusFromDropdownBackwards;
|
|
51
|
+
private _handleFocusFromTogglerBackwards;
|
|
52
|
+
private _handleFocusFromSentinelStartBackwards;
|
|
53
|
+
private _getTrulyFocusableElements;
|
|
54
|
+
private _isElementTrulyFocusable;
|
|
47
55
|
private _hoverToggle;
|
|
48
56
|
private _isHoveredWithinDropdown;
|
|
57
|
+
private _focusOnFirstContentElement;
|
|
49
58
|
private _setupInitialDropdownProperties;
|
|
50
59
|
isOpened: () => boolean;
|
|
51
60
|
private _positionDropdownContent;
|
|
@@ -6,8 +6,9 @@ import { property } from '@lit/reactive-element/decorators.js';
|
|
|
6
6
|
import { KeystrokesController } from '../../controllers/keystrokes_controller/keystrokes_controller.js';
|
|
7
7
|
import { html } from 'lit-html';
|
|
8
8
|
import { BREAKPOINTS, SCROLLABLE_CLASS_NAME } from '../../global_constants.js';
|
|
9
|
-
import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_CSS_CLASSES, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME,
|
|
9
|
+
import { DEFAULT_DROPDOWN_PORTAL_NAME, DROPDOWN_CONTENT_CSS_CLASSES, DROPDOWN_EVENTS, DROPDOWN_CONTAINER_NAME, DROPDOWN_CONTENT_WIDTH, DROPDOWN_CONTENT_NAME, DROPDOWN_TOGGLER_NAME } from './dropdown_constants.js';
|
|
10
10
|
import { RELATIVE_POSITION_CONTROLLER_EVENTS, DEFAULT_THROTTLE_WAIT_TIME } from '../../controllers/relative_position_controller/relative_position_controller_constants.js';
|
|
11
|
+
import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
|
|
11
12
|
import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
|
|
12
13
|
import { BackdropController } from '../backdrop/controller/backdrop_controller.js';
|
|
13
14
|
import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
|
|
@@ -25,6 +26,8 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
25
26
|
this.transition = 'direction';
|
|
26
27
|
this.offset = 0;
|
|
27
28
|
this.portalTarget = DEFAULT_DROPDOWN_PORTAL_NAME;
|
|
29
|
+
this.id = v4();
|
|
30
|
+
this.preventFocusTrap = false;
|
|
28
31
|
this._backdropController = new BackdropController();
|
|
29
32
|
this._handleClickOutside = async (target) => {
|
|
30
33
|
var _a, _b;
|
|
@@ -41,7 +44,7 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
41
44
|
return;
|
|
42
45
|
}
|
|
43
46
|
await this.show();
|
|
44
|
-
|
|
47
|
+
this._focusOnFirstContentElement();
|
|
45
48
|
};
|
|
46
49
|
this.show = async () => {
|
|
47
50
|
if (this.opened)
|
|
@@ -132,44 +135,32 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
132
135
|
return;
|
|
133
136
|
await this.hide();
|
|
134
137
|
};
|
|
135
|
-
this.
|
|
136
|
-
|
|
137
|
-
if (!this
|
|
138
|
+
this._keepFocusWithinDropdownForwards = (ev) => {
|
|
139
|
+
var _a, _b;
|
|
140
|
+
if (ev.shiftKey === true || !this.$dropdownContent || !this.opened)
|
|
138
141
|
return;
|
|
139
|
-
const $
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this._handleFocusOnNextElement = async (ev) => {
|
|
147
|
-
var _a;
|
|
148
|
-
ev.preventDefault();
|
|
149
|
-
const $focusableElements = UiDomUtils.getFocusableElements(document.body);
|
|
150
|
-
const indexOfDropdownToggler = $focusableElements.indexOf(this.$dropdownToggler);
|
|
151
|
-
const $nextElementToFocus = (_a = $focusableElements[indexOfDropdownToggler + 1]) !== null && _a !== void 0 ? _a : $focusableElements[0];
|
|
152
|
-
await this._hideDropdownsSequentially();
|
|
153
|
-
await this.hide();
|
|
154
|
-
this._focusOnNextElementAfterToggler($nextElementToFocus);
|
|
155
|
-
};
|
|
156
|
-
this._focusOnNextElementAfterToggler = ($elementToFocus) => {
|
|
157
|
-
var _a;
|
|
158
|
-
const isTogglerLastChildOfPreviousDropdown = ($elementToFocus === null || $elementToFocus === void 0 ? void 0 : $elementToFocus.closest(DROPDOWN_CONTENT_NAME)) === this.$dropdownContent;
|
|
159
|
-
if (isTogglerLastChildOfPreviousDropdown) {
|
|
160
|
-
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
142
|
+
const $target = ev.target;
|
|
143
|
+
if (((_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.contains($target)) && this.preventFocusTrap) {
|
|
144
|
+
this._handleFocusOnNextElementAfterDropdown(ev);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if ((_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.contains($target)) {
|
|
148
|
+
this._handleFocusFromTogglerForwards(ev);
|
|
161
149
|
return;
|
|
162
150
|
}
|
|
163
|
-
|
|
151
|
+
this._handleFocusFromSentinelEndForwards(ev, $target);
|
|
164
152
|
};
|
|
165
|
-
this.
|
|
166
|
-
|
|
167
|
-
const $firstFocusableElement = this.$dropdownContent && UiDomUtils.getFocusableElement(this.$dropdownContent);
|
|
168
|
-
if (document.activeElement !== $firstFocusableElement)
|
|
153
|
+
this._keepFocusWithinDropdownBackwards = (ev) => {
|
|
154
|
+
if (!this.opened || !this.$dropdownContent)
|
|
169
155
|
return;
|
|
170
|
-
ev.
|
|
171
|
-
(
|
|
172
|
-
|
|
156
|
+
const $target = ev.target;
|
|
157
|
+
if (this.preventFocusTrap) {
|
|
158
|
+
this._handleDefaultFocusFromDropdownBackwards(ev);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this._handleFocusFromTogglerBackwards(ev, $target);
|
|
162
|
+
this._handleFocusFromSentinelStartBackwards(ev, $target);
|
|
163
|
+
}
|
|
173
164
|
};
|
|
174
165
|
this._hoverToggle = async (ev) => {
|
|
175
166
|
if (window.innerWidth < BREAKPOINTS.xs)
|
|
@@ -181,12 +172,19 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
181
172
|
const isHoveredWithinDropdown = this._isHoveredWithinDropdown(ev.target);
|
|
182
173
|
if (isHoveredWithinDropdown && !this.opened) {
|
|
183
174
|
await this.show();
|
|
184
|
-
|
|
175
|
+
this._focusOnFirstContentElement();
|
|
185
176
|
return;
|
|
186
177
|
}
|
|
187
178
|
if (!isHoveredWithinDropdown && this.opened)
|
|
188
179
|
await this._hideDropdownsSequentially();
|
|
189
180
|
};
|
|
181
|
+
this._focusOnFirstContentElement = () => {
|
|
182
|
+
if (!this.$dropdownContent)
|
|
183
|
+
return;
|
|
184
|
+
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
185
|
+
if ($firstFocusableElement)
|
|
186
|
+
$firstFocusableElement.focus();
|
|
187
|
+
};
|
|
190
188
|
this.isOpened = () => this.opened;
|
|
191
189
|
this._positionDropdownContent = () => {
|
|
192
190
|
if (this.contentWidth === DROPDOWN_CONTENT_WIDTH.full)
|
|
@@ -212,13 +210,14 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
212
210
|
host: this,
|
|
213
211
|
target: document.body,
|
|
214
212
|
keys: ['tab'],
|
|
215
|
-
callback: this.
|
|
213
|
+
callback: this._keepFocusWithinDropdownForwards
|
|
216
214
|
});
|
|
217
215
|
new KeystrokesController({
|
|
218
216
|
host: this,
|
|
219
217
|
target: document.body,
|
|
220
218
|
keys: [['shift', 'tab']],
|
|
221
|
-
callback: this.
|
|
219
|
+
callback: this._keepFocusWithinDropdownBackwards,
|
|
220
|
+
containerSelectors: ['h-dropdown', 'h-dropdown-content']
|
|
222
221
|
});
|
|
223
222
|
}
|
|
224
223
|
async connectedCallback() {
|
|
@@ -294,6 +293,74 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
294
293
|
(_b = this.$dropdownContent) === null || _b === void 0 ? void 0 : _b.classList.add(SCROLLABLE_CLASS_NAME);
|
|
295
294
|
}
|
|
296
295
|
}
|
|
296
|
+
_handleFocusOnNextElementAfterDropdown(ev) {
|
|
297
|
+
ev.preventDefault();
|
|
298
|
+
this.hide();
|
|
299
|
+
UiDomUtils.getNextFocusableElement(this.$dropdownToggler || this).focus();
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
_handleFocusFromTogglerForwards(ev) {
|
|
303
|
+
if (!this.$dropdownContent)
|
|
304
|
+
return;
|
|
305
|
+
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
306
|
+
if (trulyFocusableElements.length === 0)
|
|
307
|
+
return;
|
|
308
|
+
ev.preventDefault();
|
|
309
|
+
trulyFocusableElements[0].focus();
|
|
310
|
+
}
|
|
311
|
+
_handleFocusFromSentinelEndForwards(ev, $target) {
|
|
312
|
+
var _a;
|
|
313
|
+
if (!this.$dropdownContent)
|
|
314
|
+
return;
|
|
315
|
+
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
316
|
+
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
317
|
+
if ($target !== $lastFocusableElement)
|
|
318
|
+
return;
|
|
319
|
+
ev.preventDefault();
|
|
320
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
321
|
+
}
|
|
322
|
+
_handleDefaultFocusFromDropdownBackwards(ev) {
|
|
323
|
+
ev.preventDefault();
|
|
324
|
+
this.hide();
|
|
325
|
+
UiDomUtils.getPreviousFocusableElement(this.$dropdownToggler || this).focus();
|
|
326
|
+
}
|
|
327
|
+
_handleFocusFromTogglerBackwards(ev, $target) {
|
|
328
|
+
var _a;
|
|
329
|
+
if ($target !== this.$dropdownToggler && !((_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.contains($target)) || !this.$dropdownContent)
|
|
330
|
+
return;
|
|
331
|
+
ev.preventDefault();
|
|
332
|
+
const trulyFocusableElements = this._getTrulyFocusableElements(this.$dropdownContent);
|
|
333
|
+
if (trulyFocusableElements.length === 0)
|
|
334
|
+
return;
|
|
335
|
+
const $lastFocusableElement = trulyFocusableElements.slice(-1)[0];
|
|
336
|
+
$lastFocusableElement.focus();
|
|
337
|
+
}
|
|
338
|
+
_handleFocusFromSentinelStartBackwards(ev, $target) {
|
|
339
|
+
var _a;
|
|
340
|
+
if (!this.$dropdownContent)
|
|
341
|
+
return;
|
|
342
|
+
const $firstFocusableElement = this._getTrulyFocusableElements(this.$dropdownContent)[0];
|
|
343
|
+
if ($target !== $firstFocusableElement)
|
|
344
|
+
return;
|
|
345
|
+
ev.preventDefault();
|
|
346
|
+
(_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.focus();
|
|
347
|
+
}
|
|
348
|
+
_getTrulyFocusableElements($container) {
|
|
349
|
+
const focusableElements = UiDomUtils.getFocusableElements($container);
|
|
350
|
+
return focusableElements.filter(($el) => this._isElementTrulyFocusable($el));
|
|
351
|
+
}
|
|
352
|
+
_isElementTrulyFocusable($el) {
|
|
353
|
+
const style = window.getComputedStyle($el);
|
|
354
|
+
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
if ($el.nodeName === 'H-PORTAL')
|
|
358
|
+
return true;
|
|
359
|
+
const $parent = $el.parentElement;
|
|
360
|
+
if (!$parent)
|
|
361
|
+
return true;
|
|
362
|
+
return this._isElementTrulyFocusable($parent);
|
|
363
|
+
}
|
|
297
364
|
_isHoveredWithinDropdown(element) {
|
|
298
365
|
var _a;
|
|
299
366
|
if (element === this)
|
|
@@ -317,6 +384,8 @@ let HDropdown = HDropdown_1 = class HDropdown extends PhoenixLightLitElement {
|
|
|
317
384
|
return;
|
|
318
385
|
if (!this._hasScrollableClassInitially)
|
|
319
386
|
this._hasScrollableClassInitially = this.$dropdownContent.classList.contains(SCROLLABLE_CLASS_NAME);
|
|
387
|
+
if (!this.preventFocusTrap)
|
|
388
|
+
this.$dropdownContent.setAttribute('aria-modal', 'true');
|
|
320
389
|
}
|
|
321
390
|
_getDropdownContentWidth() {
|
|
322
391
|
const isMobileResolution = document.documentElement.clientWidth < BREAKPOINTS.xs;
|
|
@@ -385,6 +454,14 @@ __decorate([
|
|
|
385
454
|
property({ type: String, attribute: 'mobile-position' }),
|
|
386
455
|
__metadata("design:type", String)
|
|
387
456
|
], HDropdown.prototype, "mobilePosition", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
property({ type: String, attribute: 'id', reflect: true }),
|
|
459
|
+
__metadata("design:type", Object)
|
|
460
|
+
], HDropdown.prototype, "id", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
property({ type: Boolean, attribute: 'prevent-focus-trap' }),
|
|
463
|
+
__metadata("design:type", Object)
|
|
464
|
+
], HDropdown.prototype, "preventFocusTrap", void 0);
|
|
388
465
|
HDropdown = HDropdown_1 = __decorate([
|
|
389
466
|
phoenixCustomElement('h-dropdown'),
|
|
390
467
|
__metadata("design:paramtypes", [])
|