q2-tecton-elements 1.71.1 → 1.71.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-report.json +7 -7
- package/dist/cjs/q2-search.cjs.entry.js +11 -2
- package/dist/cjs/q2-select.cjs.entry.js +5 -2
- package/dist/collection/components/q2-search/q2-search.js +11 -2
- package/dist/collection/components/q2-select/q2-select.js +5 -2
- package/dist/components/q2-search.js +16 -11
- package/dist/components/q2-select2.js +4 -4
- package/dist/esm/q2-search.entry.js +11 -2
- package/dist/esm/q2-select.entry.js +5 -2
- package/dist/q2-tecton-elements/q2-search.entry.js +21 -16
- package/dist/q2-tecton-elements/q2-select.entry.js +4 -4
- package/dist/types/components/q2-search/q2-search.d.ts +1 -0
- package/package.json +3 -3
package/dist/bundle-report.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2026-
|
|
2
|
+
"timestamp": "2026-09-23T17:45:32",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "node",
|
|
5
5
|
"version": "24.10.0"
|
|
@@ -1009,7 +1009,7 @@
|
|
|
1009
1009
|
"index-Cqkz7Bnm.js",
|
|
1010
1010
|
"index-Cps4jSQM.js"
|
|
1011
1011
|
],
|
|
1012
|
-
"originalByteSize":
|
|
1012
|
+
"originalByteSize": 46300
|
|
1013
1013
|
},
|
|
1014
1014
|
{
|
|
1015
1015
|
"key": "q2-section.entry",
|
|
@@ -1231,7 +1231,7 @@
|
|
|
1231
1231
|
"mirror-emit-DUjY_ucm.js",
|
|
1232
1232
|
"action-sheet-DuQ7VZ08.js"
|
|
1233
1233
|
],
|
|
1234
|
-
"originalByteSize":
|
|
1234
|
+
"originalByteSize": 48249
|
|
1235
1235
|
},
|
|
1236
1236
|
{
|
|
1237
1237
|
"key": "q2-tooltip.entry",
|
|
@@ -1870,7 +1870,7 @@
|
|
|
1870
1870
|
"index-Cqkz7Bnm.js",
|
|
1871
1871
|
"index-Cps4jSQM.js"
|
|
1872
1872
|
],
|
|
1873
|
-
"originalByteSize":
|
|
1873
|
+
"originalByteSize": 46300
|
|
1874
1874
|
},
|
|
1875
1875
|
{
|
|
1876
1876
|
"key": "q2-section.entry",
|
|
@@ -2092,7 +2092,7 @@
|
|
|
2092
2092
|
"mirror-emit-DUjY_ucm.js",
|
|
2093
2093
|
"action-sheet-DuQ7VZ08.js"
|
|
2094
2094
|
],
|
|
2095
|
-
"originalByteSize":
|
|
2095
|
+
"originalByteSize": 48249
|
|
2096
2096
|
},
|
|
2097
2097
|
{
|
|
2098
2098
|
"key": "q2-tooltip.entry",
|
|
@@ -2733,7 +2733,7 @@
|
|
|
2733
2733
|
"index-DUaTw_1N.js",
|
|
2734
2734
|
"index-SpDCZABA.js"
|
|
2735
2735
|
],
|
|
2736
|
-
"originalByteSize":
|
|
2736
|
+
"originalByteSize": 46567
|
|
2737
2737
|
},
|
|
2738
2738
|
{
|
|
2739
2739
|
"key": "q2-section.entry",
|
|
@@ -2955,7 +2955,7 @@
|
|
|
2955
2955
|
"mirror-emit-kjeNv83f.js",
|
|
2956
2956
|
"action-sheet-DUBlF_x3.js"
|
|
2957
2957
|
],
|
|
2958
|
-
"originalByteSize":
|
|
2958
|
+
"originalByteSize": 48455
|
|
2959
2959
|
},
|
|
2960
2960
|
{
|
|
2961
2961
|
"key": "q2-tooltip.entry",
|
|
@@ -15,6 +15,7 @@ const Q2Search = class {
|
|
|
15
15
|
// #region Own Properties
|
|
16
16
|
// Viewport edge buffer (px) — popover falls back to input-width when it would otherwise overflow.
|
|
17
17
|
this.displayBuffer = 10;
|
|
18
|
+
this.optionFingerprint = '';
|
|
18
19
|
this.popoverWidthWarned = false;
|
|
19
20
|
// #endregion
|
|
20
21
|
// #region State Properties
|
|
@@ -187,7 +188,7 @@ const Q2Search = class {
|
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
190
|
this.onMutationObserved = () => {
|
|
190
|
-
var _a, _b, _c;
|
|
191
|
+
var _a, _b, _c, _d;
|
|
191
192
|
const root = this.hostElement.shadowRoot;
|
|
192
193
|
if (!root)
|
|
193
194
|
return;
|
|
@@ -212,6 +213,14 @@ const Q2Search = class {
|
|
|
212
213
|
this.checkSelectedOptions();
|
|
213
214
|
if (this.multilineOptions)
|
|
214
215
|
this.applyMultilineOptions();
|
|
216
|
+
// Reset the option list's active index whenever the slotted option set changes so that
|
|
217
|
+
// the next ArrowDown/ArrowUp always starts from the first visible item rather than a
|
|
218
|
+
// stale position left over from a previous, different options list.
|
|
219
|
+
const fingerprint = this.optionElements.map(o => o.value).join('\x00');
|
|
220
|
+
if (fingerprint !== this.optionFingerprint) {
|
|
221
|
+
this.optionFingerprint = fingerprint;
|
|
222
|
+
(_d = this.optionList) === null || _d === void 0 ? void 0 : _d.setActiveElement(undefined);
|
|
223
|
+
}
|
|
215
224
|
};
|
|
216
225
|
this.onOptionListChange = (event) => {
|
|
217
226
|
event.stopPropagation();
|
|
@@ -763,7 +772,7 @@ const Q2Search = class {
|
|
|
763
772
|
return (index.h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: (_a = this.innerInputContainer) !== null && _a !== void 0 ? _a : undefined, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, align: useBlock ? undefined : this.popoverAlignment, block: useBlock }, index.h("div", { class: "popover-content", "data-loading": this.loading ? 'true' : 'false', "aria-busy": this.loading ? 'true' : null }, index.h("div", { class: "popover-top-container", hidden: !this.hasPopoverTop && !(this.multiple && this.showSelectedToggle), tabindex: "-1" }, index.h("slot", { name: "popover-top" }), !this.loading && this.renderMultiSelectHeader()), index.h("q2-option-list", { ref: el => (this.optionList = el), type: "listbox", id: this.optionListId, label: index$1.loc(this.listLabel), multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, showSelected: this.showSelected, customSearch: true, hidden: this.loading, onChange: (e) => e.stopPropagation(), onTctChange: this.onOptionListChange }, index.h("slot", null)), showEmpty && this.renderEmpty(), index.h("div", { class: "popover-bottom-container", hidden: !this.hasPopoverBottom, tabindex: "-1" }, index.h("slot", { name: "popover-bottom" })), this.loading && (index.h("div", { class: "loading-overlay", "aria-hidden": "true" }, index.h("q2-loading", { type: "spinner" }))))));
|
|
764
773
|
}
|
|
765
774
|
render() {
|
|
766
|
-
return (index.h(index.Fragment, { key: '
|
|
775
|
+
return (index.h(index.Fragment, { key: '78ce7b735d59271600debb18ab2f0f5cf315e465' }, index.h("div", { key: 'd3e9a713581842cc62969a0df9556733edf6e378', "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), index.h("click-elsewhere", { key: '6912af1d8f31af8de7c7ffb28786756819c57afc', class: this.wrapperClasses, role: "presentation", onChange: this.onClickElsewhere }, index.h("q2-input", { key: '95a5397765aab6d3279b3d81cc31215f235aefc2', ref: el => (this.inputField = el), class: "q2-search-input", label: (this.label && index$1.loc(this.label)) || '', value: this.searchText, iconLeft: "search", clearable: this.clearable && !this.loading && !!this.searchText, disabled: this.disabled, optional: this.optional, readonly: !!this.readonly, placeholder: this.placeholder ? index$1.loc(this.placeholder) : undefined, hideLabel: this.hideLabel, errors: (Array.isArray(this.errors) && this.errors.length > 0 && this.errors.map(e => index$1.loc(e))) ||
|
|
767
776
|
(this.invalid && ['tecton.element.search.invalid']) ||
|
|
768
777
|
[], ariaExpanded: this.isInputOnlyMode ? undefined : `${this.open}`, ariaControls: this.isInputOnlyMode ? undefined : this.optionListId, ariaHaspopup: this.isInputOnlyMode ? undefined : 'listbox', hideMessages: true, _role: this.isInputOnlyMode ? undefined : 'combobox', onTctInput: this.inputInputHandler, onInput: (e) => e.stopImmediatePropagation(), onChange: (e) => e.stopPropagation(), onTctChange: (e) => e.stopPropagation(), badgeValue: this.badgeValue }, this.renderCustomDisplay()), this.renderOptionsDropdown())));
|
|
769
778
|
}
|
|
@@ -363,6 +363,8 @@ const Q2Select = class {
|
|
|
363
363
|
}
|
|
364
364
|
onClearHandler(event) {
|
|
365
365
|
var _a;
|
|
366
|
+
if (this.readonly || this.disabled)
|
|
367
|
+
return;
|
|
366
368
|
// when multiple & searchable, it should not fire clearValue() if the type is `input` (cleared by key input) which is emitted from q2-input's handleDataInput
|
|
367
369
|
if (this.multiple && this.searchable && ((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.source) === 'input')
|
|
368
370
|
return;
|
|
@@ -807,7 +809,8 @@ const Q2Select = class {
|
|
|
807
809
|
}
|
|
808
810
|
renderSelectField() {
|
|
809
811
|
var _a;
|
|
810
|
-
return (index.h(index.Fragment, null, index.h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), index.h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && index$1.loc(this.label)) || '', value: this.selectedDisplay, clearable: (this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
812
|
+
return (index.h(index.Fragment, null, index.h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), index.h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && index$1.loc(this.label)) || '', value: this.selectedDisplay, clearable: (!this.disabled && this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
813
|
+
undefined, errors: (Array.isArray(this.errors) &&
|
|
811
814
|
this.errors.length > 0 &&
|
|
812
815
|
this.errors.map(error => index$1.loc(error))) ||
|
|
813
816
|
(this.invalid && ['tecton.element.select.invalid']) ||
|
|
@@ -822,7 +825,7 @@ const Q2Select = class {
|
|
|
822
825
|
]), checked: showSelected, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, onKeyDown: this.visibilityToggleKeyDown }), index.h("label", { htmlFor: "selected" }, index$1.loc('tecton.element.select.multiHeader.selected', [selectedOptionsCount]))))));
|
|
823
826
|
}
|
|
824
827
|
render() {
|
|
825
|
-
return (index.h("click-elsewhere", { key: '
|
|
828
|
+
return (index.h("click-elsewhere", { key: 'edb9951db5493781ee1f5da0ed5f6c03aff107e9', class: this.wrapperClasses, role: "presentation", onChange: this.clickedElsewhere }, this.renderSelectField()));
|
|
826
829
|
}
|
|
827
830
|
get hostElement() { return index.getElement(this); }
|
|
828
831
|
static get watchers() { return {
|
|
@@ -14,6 +14,7 @@ export class Q2Search {
|
|
|
14
14
|
// #region Own Properties
|
|
15
15
|
// Viewport edge buffer (px) — popover falls back to input-width when it would otherwise overflow.
|
|
16
16
|
this.displayBuffer = 10;
|
|
17
|
+
this.optionFingerprint = '';
|
|
17
18
|
this.popoverWidthWarned = false;
|
|
18
19
|
// #endregion
|
|
19
20
|
// #region State Properties
|
|
@@ -186,7 +187,7 @@ export class Q2Search {
|
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
189
|
this.onMutationObserved = () => {
|
|
189
|
-
var _a, _b, _c;
|
|
190
|
+
var _a, _b, _c, _d;
|
|
190
191
|
const root = this.hostElement.shadowRoot;
|
|
191
192
|
if (!root)
|
|
192
193
|
return;
|
|
@@ -211,6 +212,14 @@ export class Q2Search {
|
|
|
211
212
|
this.checkSelectedOptions();
|
|
212
213
|
if (this.multilineOptions)
|
|
213
214
|
this.applyMultilineOptions();
|
|
215
|
+
// Reset the option list's active index whenever the slotted option set changes so that
|
|
216
|
+
// the next ArrowDown/ArrowUp always starts from the first visible item rather than a
|
|
217
|
+
// stale position left over from a previous, different options list.
|
|
218
|
+
const fingerprint = this.optionElements.map(o => o.value).join('\x00');
|
|
219
|
+
if (fingerprint !== this.optionFingerprint) {
|
|
220
|
+
this.optionFingerprint = fingerprint;
|
|
221
|
+
(_d = this.optionList) === null || _d === void 0 ? void 0 : _d.setActiveElement(undefined);
|
|
222
|
+
}
|
|
214
223
|
};
|
|
215
224
|
this.onOptionListChange = (event) => {
|
|
216
225
|
event.stopPropagation();
|
|
@@ -762,7 +771,7 @@ export class Q2Search {
|
|
|
762
771
|
return (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: (_a = this.innerInputContainer) !== null && _a !== void 0 ? _a : undefined, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, align: useBlock ? undefined : this.popoverAlignment, block: useBlock }, h("div", { class: "popover-content", "data-loading": this.loading ? 'true' : 'false', "aria-busy": this.loading ? 'true' : null }, h("div", { class: "popover-top-container", hidden: !this.hasPopoverTop && !(this.multiple && this.showSelectedToggle), tabindex: "-1" }, h("slot", { name: "popover-top" }), !this.loading && this.renderMultiSelectHeader()), h("q2-option-list", { ref: el => (this.optionList = el), type: "listbox", id: this.optionListId, label: loc(this.listLabel), multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, showSelected: this.showSelected, customSearch: true, hidden: this.loading, onChange: (e) => e.stopPropagation(), onTctChange: this.onOptionListChange }, h("slot", null)), showEmpty && this.renderEmpty(), h("div", { class: "popover-bottom-container", hidden: !this.hasPopoverBottom, tabindex: "-1" }, h("slot", { name: "popover-bottom" })), this.loading && (h("div", { class: "loading-overlay", "aria-hidden": "true" }, h("q2-loading", { type: "spinner" }))))));
|
|
763
772
|
}
|
|
764
773
|
render() {
|
|
765
|
-
return (h(Fragment, { key: '
|
|
774
|
+
return (h(Fragment, { key: '78ce7b735d59271600debb18ab2f0f5cf315e465' }, h("div", { key: 'd3e9a713581842cc62969a0df9556733edf6e378', "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("click-elsewhere", { key: '6912af1d8f31af8de7c7ffb28786756819c57afc', class: this.wrapperClasses, role: "presentation", onChange: this.onClickElsewhere }, h("q2-input", { key: '95a5397765aab6d3279b3d81cc31215f235aefc2', ref: el => (this.inputField = el), class: "q2-search-input", label: (this.label && loc(this.label)) || '', value: this.searchText, iconLeft: "search", clearable: this.clearable && !this.loading && !!this.searchText, disabled: this.disabled, optional: this.optional, readonly: !!this.readonly, placeholder: this.placeholder ? loc(this.placeholder) : undefined, hideLabel: this.hideLabel, errors: (Array.isArray(this.errors) && this.errors.length > 0 && this.errors.map(e => loc(e))) ||
|
|
766
775
|
(this.invalid && ['tecton.element.search.invalid']) ||
|
|
767
776
|
[], ariaExpanded: this.isInputOnlyMode ? undefined : `${this.open}`, ariaControls: this.isInputOnlyMode ? undefined : this.optionListId, ariaHaspopup: this.isInputOnlyMode ? undefined : 'listbox', hideMessages: true, _role: this.isInputOnlyMode ? undefined : 'combobox', onTctInput: this.inputInputHandler, onInput: (e) => e.stopImmediatePropagation(), onChange: (e) => e.stopPropagation(), onTctChange: (e) => e.stopPropagation(), badgeValue: this.badgeValue }, this.renderCustomDisplay()), this.renderOptionsDropdown())));
|
|
768
777
|
}
|
|
@@ -361,6 +361,8 @@ export class Q2Select {
|
|
|
361
361
|
}
|
|
362
362
|
onClearHandler(event) {
|
|
363
363
|
var _a;
|
|
364
|
+
if (this.readonly || this.disabled)
|
|
365
|
+
return;
|
|
364
366
|
// when multiple & searchable, it should not fire clearValue() if the type is `input` (cleared by key input) which is emitted from q2-input's handleDataInput
|
|
365
367
|
if (this.multiple && this.searchable && ((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.source) === 'input')
|
|
366
368
|
return;
|
|
@@ -812,7 +814,8 @@ export class Q2Select {
|
|
|
812
814
|
}
|
|
813
815
|
renderSelectField() {
|
|
814
816
|
var _a;
|
|
815
|
-
return (h(Fragment, null, h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && loc(this.label)) || '', value: this.selectedDisplay, clearable: (this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
817
|
+
return (h(Fragment, null, h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && loc(this.label)) || '', value: this.selectedDisplay, clearable: (!this.disabled && this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
818
|
+
undefined, errors: (Array.isArray(this.errors) &&
|
|
816
819
|
this.errors.length > 0 &&
|
|
817
820
|
this.errors.map(error => loc(error))) ||
|
|
818
821
|
(this.invalid && ['tecton.element.select.invalid']) ||
|
|
@@ -827,7 +830,7 @@ export class Q2Select {
|
|
|
827
830
|
]), checked: showSelected, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, onKeyDown: this.visibilityToggleKeyDown }), h("label", { htmlFor: "selected" }, loc('tecton.element.select.multiHeader.selected', [selectedOptionsCount]))))));
|
|
828
831
|
}
|
|
829
832
|
render() {
|
|
830
|
-
return (h("click-elsewhere", { key: '
|
|
833
|
+
return (h("click-elsewhere", { key: 'edb9951db5493781ee1f5da0ed5f6c03aff107e9', class: this.wrapperClasses, role: "presentation", onChange: this.clickedElsewhere }, this.renderSelectField()));
|
|
831
834
|
}
|
|
832
835
|
static get is() { return "q2-select"; }
|
|
833
836
|
static get encapsulation() { return "shadow"; }
|
|
@@ -25,7 +25,7 @@ const f = t(class extends e {
|
|
|
25
25
|
this.tctOpen = i(this, "tctOpen", 7),
|
|
26
26
|
// #region Own Properties
|
|
27
27
|
// Viewport edge buffer (px) — popover falls back to input-width when it would otherwise overflow.
|
|
28
|
-
this.displayBuffer = 10, this.popoverWidthWarned = !1,
|
|
28
|
+
this.displayBuffer = 10, this.optionFingerprint = "", this.popoverWidthWarned = !1,
|
|
29
29
|
// #endregion
|
|
30
30
|
// #region State Properties
|
|
31
31
|
this.hasEmptySlot = !1, this.hasOptions = !1, this.hasPopoverBottom = !1, this.hasPopoverTop = !1,
|
|
@@ -158,15 +158,20 @@ const f = t(class extends e {
|
|
|
158
158
|
}, this.onClickElsewhere = t => {
|
|
159
159
|
"click-elsewhere" === t.target.localName && (t.stopPropagation(), "#document-fragment" !== this.hostElement.getRootNode().nodeName && this.closeDropdown());
|
|
160
160
|
}, this.onMutationObserved = () => {
|
|
161
|
-
var t, e, i;
|
|
162
|
-
const
|
|
163
|
-
if (!
|
|
164
|
-
const
|
|
165
|
-
this.hasPopoverTop !==
|
|
166
|
-
this.hasEmptySlot !==
|
|
161
|
+
var t, e, i, s;
|
|
162
|
+
const o = this.hostElement.shadowRoot;
|
|
163
|
+
if (!o) return;
|
|
164
|
+
const n = o.querySelector('slot[name="popover-top"]'), r = o.querySelector('slot[name="popover-bottom"]'), l = o.querySelector('slot[name="empty"]'), a = (null !== (t = null == n ? void 0 : n.assignedNodes().length) && void 0 !== t ? t : 0) > 0, h = (null !== (e = null == r ? void 0 : r.assignedNodes().length) && void 0 !== e ? e : 0) > 0, c = (null !== (i = null == l ? void 0 : l.assignedNodes().length) && void 0 !== i ? i : 0) > 0, d = this.optionElements.length > 0;
|
|
165
|
+
this.hasPopoverTop !== a && (this.hasPopoverTop = a), this.hasPopoverBottom !== h && (this.hasPopoverBottom = h),
|
|
166
|
+
this.hasEmptySlot !== c && (this.hasEmptySlot = c), this.hasOptions !== d && (this.hasOptions = d),
|
|
167
167
|
// If input-only mode just turned on while popover was open, close it.
|
|
168
168
|
this.open && this.isInputOnlyMode && this.closeDropdown(), this.checkSelectedOptions(),
|
|
169
169
|
this.multilineOptions && this.applyMultilineOptions();
|
|
170
|
+
// Reset the option list's active index whenever the slotted option set changes so that
|
|
171
|
+
// the next ArrowDown/ArrowUp always starts from the first visible item rather than a
|
|
172
|
+
// stale position left over from a previous, different options list.
|
|
173
|
+
const p = this.optionElements.map((t => t.value)).join("\0");
|
|
174
|
+
p !== this.optionFingerprint && (this.optionFingerprint = p, null === (s = this.optionList) || void 0 === s || s.setActiveElement(void 0));
|
|
170
175
|
}, this.onOptionListChange = t => {
|
|
171
176
|
t.stopPropagation(), this.handleSelectionChanges(t.detail);
|
|
172
177
|
}, this.onSelectedDisplayMousedown = t => {
|
|
@@ -613,20 +618,20 @@ const f = t(class extends e {
|
|
|
613
618
|
}
|
|
614
619
|
render() {
|
|
615
620
|
return s(o, {
|
|
616
|
-
key: "
|
|
621
|
+
key: "78ce7b735d59271600debb18ab2f0f5cf315e465"
|
|
617
622
|
}, s("div", {
|
|
618
|
-
key: "
|
|
623
|
+
key: "d3e9a713581842cc62969a0df9556733edf6e378",
|
|
619
624
|
"aria-live": "polite",
|
|
620
625
|
"aria-atomic": "true",
|
|
621
626
|
role: "status",
|
|
622
627
|
class: "sr"
|
|
623
628
|
}, this.statusMessage), s("click-elsewhere", {
|
|
624
|
-
key: "
|
|
629
|
+
key: "6912af1d8f31af8de7c7ffb28786756819c57afc",
|
|
625
630
|
class: this.wrapperClasses,
|
|
626
631
|
role: "presentation",
|
|
627
632
|
onChange: this.onClickElsewhere
|
|
628
633
|
}, s("q2-input", {
|
|
629
|
-
key: "
|
|
634
|
+
key: "95a5397765aab6d3279b3d81cc31215f235aefc2",
|
|
630
635
|
ref: t => this.inputField = t,
|
|
631
636
|
class: "q2-search-input",
|
|
632
637
|
label: this.label && h(this.label) || "",
|
|
@@ -228,9 +228,9 @@ const O = t(class extends e {
|
|
|
228
228
|
}
|
|
229
229
|
onClearHandler(t) {
|
|
230
230
|
var e;
|
|
231
|
+
this.readonly || this.disabled || this.multiple && this.searchable && "input" === (null === (e = null == t ? void 0 : t.detail) || void 0 === e ? void 0 : e.source) || this.clearValue();
|
|
231
232
|
// when multiple & searchable, it should not fire clearValue() if the type is `input` (cleared by key input) which is emitted from q2-input's handleDataInput
|
|
232
|
-
|
|
233
|
-
}
|
|
233
|
+
}
|
|
234
234
|
handleSelectedDisplay(t) {
|
|
235
235
|
!this.multiple && this.value && this.value === t.detail.value && (this.inputField.value = t.detail.display);
|
|
236
236
|
}
|
|
@@ -561,7 +561,7 @@ const O = t(class extends e {
|
|
|
561
561
|
class: "q2-select-input",
|
|
562
562
|
label: this.label && n(this.label) || "",
|
|
563
563
|
value: this.selectedDisplay,
|
|
564
|
-
clearable: this.clearable && (!!this.value || !!(null === (t = this.selectedOptions) || void 0 === t ? void 0 : t.length)) || void 0,
|
|
564
|
+
clearable: !this.disabled && this.clearable && (!!this.value || !!(null === (t = this.selectedOptions) || void 0 === t ? void 0 : t.length)) || void 0,
|
|
565
565
|
errors: Array.isArray(this.errors) && this.errors.length > 0 && this.errors.map((t => n(t))) || this.invalid && [ "tecton.element.select.invalid" ] || [],
|
|
566
566
|
disabled: this.disabled,
|
|
567
567
|
optional: this.optional,
|
|
@@ -633,7 +633,7 @@ const O = t(class extends e {
|
|
|
633
633
|
}
|
|
634
634
|
render() {
|
|
635
635
|
return s("click-elsewhere", {
|
|
636
|
-
key: "
|
|
636
|
+
key: "edb9951db5493781ee1f5da0ed5f6c03aff107e9",
|
|
637
637
|
class: this.wrapperClasses,
|
|
638
638
|
role: "presentation",
|
|
639
639
|
onChange: this.clickedElsewhere
|
|
@@ -13,6 +13,7 @@ const Q2Search = class {
|
|
|
13
13
|
// #region Own Properties
|
|
14
14
|
// Viewport edge buffer (px) — popover falls back to input-width when it would otherwise overflow.
|
|
15
15
|
this.displayBuffer = 10;
|
|
16
|
+
this.optionFingerprint = '';
|
|
16
17
|
this.popoverWidthWarned = false;
|
|
17
18
|
// #endregion
|
|
18
19
|
// #region State Properties
|
|
@@ -185,7 +186,7 @@ const Q2Search = class {
|
|
|
185
186
|
}
|
|
186
187
|
};
|
|
187
188
|
this.onMutationObserved = () => {
|
|
188
|
-
var _a, _b, _c;
|
|
189
|
+
var _a, _b, _c, _d;
|
|
189
190
|
const root = this.hostElement.shadowRoot;
|
|
190
191
|
if (!root)
|
|
191
192
|
return;
|
|
@@ -210,6 +211,14 @@ const Q2Search = class {
|
|
|
210
211
|
this.checkSelectedOptions();
|
|
211
212
|
if (this.multilineOptions)
|
|
212
213
|
this.applyMultilineOptions();
|
|
214
|
+
// Reset the option list's active index whenever the slotted option set changes so that
|
|
215
|
+
// the next ArrowDown/ArrowUp always starts from the first visible item rather than a
|
|
216
|
+
// stale position left over from a previous, different options list.
|
|
217
|
+
const fingerprint = this.optionElements.map(o => o.value).join('\x00');
|
|
218
|
+
if (fingerprint !== this.optionFingerprint) {
|
|
219
|
+
this.optionFingerprint = fingerprint;
|
|
220
|
+
(_d = this.optionList) === null || _d === void 0 ? void 0 : _d.setActiveElement(undefined);
|
|
221
|
+
}
|
|
213
222
|
};
|
|
214
223
|
this.onOptionListChange = (event) => {
|
|
215
224
|
event.stopPropagation();
|
|
@@ -761,7 +770,7 @@ const Q2Search = class {
|
|
|
761
770
|
return (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: (_a = this.innerInputContainer) !== null && _a !== void 0 ? _a : undefined, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, align: useBlock ? undefined : this.popoverAlignment, block: useBlock }, h("div", { class: "popover-content", "data-loading": this.loading ? 'true' : 'false', "aria-busy": this.loading ? 'true' : null }, h("div", { class: "popover-top-container", hidden: !this.hasPopoverTop && !(this.multiple && this.showSelectedToggle), tabindex: "-1" }, h("slot", { name: "popover-top" }), !this.loading && this.renderMultiSelectHeader()), h("q2-option-list", { ref: el => (this.optionList = el), type: "listbox", id: this.optionListId, label: loc(this.listLabel), multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, showSelected: this.showSelected, customSearch: true, hidden: this.loading, onChange: (e) => e.stopPropagation(), onTctChange: this.onOptionListChange }, h("slot", null)), showEmpty && this.renderEmpty(), h("div", { class: "popover-bottom-container", hidden: !this.hasPopoverBottom, tabindex: "-1" }, h("slot", { name: "popover-bottom" })), this.loading && (h("div", { class: "loading-overlay", "aria-hidden": "true" }, h("q2-loading", { type: "spinner" }))))));
|
|
762
771
|
}
|
|
763
772
|
render() {
|
|
764
|
-
return (h(Fragment, { key: '
|
|
773
|
+
return (h(Fragment, { key: '78ce7b735d59271600debb18ab2f0f5cf315e465' }, h("div", { key: 'd3e9a713581842cc62969a0df9556733edf6e378', "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("click-elsewhere", { key: '6912af1d8f31af8de7c7ffb28786756819c57afc', class: this.wrapperClasses, role: "presentation", onChange: this.onClickElsewhere }, h("q2-input", { key: '95a5397765aab6d3279b3d81cc31215f235aefc2', ref: el => (this.inputField = el), class: "q2-search-input", label: (this.label && loc(this.label)) || '', value: this.searchText, iconLeft: "search", clearable: this.clearable && !this.loading && !!this.searchText, disabled: this.disabled, optional: this.optional, readonly: !!this.readonly, placeholder: this.placeholder ? loc(this.placeholder) : undefined, hideLabel: this.hideLabel, errors: (Array.isArray(this.errors) && this.errors.length > 0 && this.errors.map(e => loc(e))) ||
|
|
765
774
|
(this.invalid && ['tecton.element.search.invalid']) ||
|
|
766
775
|
[], ariaExpanded: this.isInputOnlyMode ? undefined : `${this.open}`, ariaControls: this.isInputOnlyMode ? undefined : this.optionListId, ariaHaspopup: this.isInputOnlyMode ? undefined : 'listbox', hideMessages: true, _role: this.isInputOnlyMode ? undefined : 'combobox', onTctInput: this.inputInputHandler, onInput: (e) => e.stopImmediatePropagation(), onChange: (e) => e.stopPropagation(), onTctChange: (e) => e.stopPropagation(), badgeValue: this.badgeValue }, this.renderCustomDisplay()), this.renderOptionsDropdown())));
|
|
767
776
|
}
|
|
@@ -361,6 +361,8 @@ const Q2Select = class {
|
|
|
361
361
|
}
|
|
362
362
|
onClearHandler(event) {
|
|
363
363
|
var _a;
|
|
364
|
+
if (this.readonly || this.disabled)
|
|
365
|
+
return;
|
|
364
366
|
// when multiple & searchable, it should not fire clearValue() if the type is `input` (cleared by key input) which is emitted from q2-input's handleDataInput
|
|
365
367
|
if (this.multiple && this.searchable && ((_a = event === null || event === void 0 ? void 0 : event.detail) === null || _a === void 0 ? void 0 : _a.source) === 'input')
|
|
366
368
|
return;
|
|
@@ -805,7 +807,8 @@ const Q2Select = class {
|
|
|
805
807
|
}
|
|
806
808
|
renderSelectField() {
|
|
807
809
|
var _a;
|
|
808
|
-
return (h(Fragment, null, h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && loc(this.label)) || '', value: this.selectedDisplay, clearable: (this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
810
|
+
return (h(Fragment, null, h("div", { "aria-live": "polite", "aria-atomic": "true", role: "status", class: "sr" }, this.statusMessage), h("q2-input", { ref: el => (this.inputField = el), class: "q2-select-input", label: (this.label && loc(this.label)) || '', value: this.selectedDisplay, clearable: (!this.disabled && this.clearable && (!!this.value || !!((_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length))) ||
|
|
811
|
+
undefined, errors: (Array.isArray(this.errors) &&
|
|
809
812
|
this.errors.length > 0 &&
|
|
810
813
|
this.errors.map(error => loc(error))) ||
|
|
811
814
|
(this.invalid && ['tecton.element.select.invalid']) ||
|
|
@@ -820,7 +823,7 @@ const Q2Select = class {
|
|
|
820
823
|
]), checked: showSelected, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, onKeyDown: this.visibilityToggleKeyDown }), h("label", { htmlFor: "selected" }, loc('tecton.element.select.multiHeader.selected', [selectedOptionsCount]))))));
|
|
821
824
|
}
|
|
822
825
|
render() {
|
|
823
|
-
return (h("click-elsewhere", { key: '
|
|
826
|
+
return (h("click-elsewhere", { key: 'edb9951db5493781ee1f5da0ed5f6c03aff107e9', class: this.wrapperClasses, role: "presentation", onChange: this.clickedElsewhere }, this.renderSelectField()));
|
|
824
827
|
}
|
|
825
828
|
get hostElement() { return getElement(this); }
|
|
826
829
|
static get watchers() { return {
|
|
@@ -8,7 +8,7 @@ const h = class {
|
|
|
8
8
|
this.tctInput = i(this, "tctInput", 7), this.tctOpen = i(this, "tctOpen", 7),
|
|
9
9
|
// #region Own Properties
|
|
10
10
|
// Viewport edge buffer (px) — popover falls back to input-width when it would otherwise overflow.
|
|
11
|
-
this.displayBuffer = 10, this.popoverWidthWarned = !1,
|
|
11
|
+
this.displayBuffer = 10, this.optionFingerprint = "", this.popoverWidthWarned = !1,
|
|
12
12
|
// #endregion
|
|
13
13
|
// #region State Properties
|
|
14
14
|
this.hasEmptySlot = !1, this.hasOptions = !1, this.hasPopoverBottom = !1, this.hasPopoverTop = !1,
|
|
@@ -141,15 +141,20 @@ const h = class {
|
|
|
141
141
|
}, this.onClickElsewhere = t => {
|
|
142
142
|
"click-elsewhere" === t.target.localName && (t.stopPropagation(), "#document-fragment" !== this.hostElement.getRootNode().nodeName && this.closeDropdown());
|
|
143
143
|
}, this.onMutationObserved = () => {
|
|
144
|
-
var t, i, e;
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
147
|
-
const
|
|
148
|
-
this.hasPopoverTop !==
|
|
149
|
-
this.hasEmptySlot !==
|
|
144
|
+
var t, i, e, s;
|
|
145
|
+
const o = this.hostElement.shadowRoot;
|
|
146
|
+
if (!o) return;
|
|
147
|
+
const n = o.querySelector('slot[name="popover-top"]'), r = o.querySelector('slot[name="popover-bottom"]'), l = o.querySelector('slot[name="empty"]'), a = (null !== (t = null == n ? void 0 : n.assignedNodes().length) && void 0 !== t ? t : 0) > 0, h = (null !== (i = null == r ? void 0 : r.assignedNodes().length) && void 0 !== i ? i : 0) > 0, c = (null !== (e = null == l ? void 0 : l.assignedNodes().length) && void 0 !== e ? e : 0) > 0, d = this.optionElements.length > 0;
|
|
148
|
+
this.hasPopoverTop !== a && (this.hasPopoverTop = a), this.hasPopoverBottom !== h && (this.hasPopoverBottom = h),
|
|
149
|
+
this.hasEmptySlot !== c && (this.hasEmptySlot = c), this.hasOptions !== d && (this.hasOptions = d),
|
|
150
150
|
// If input-only mode just turned on while popover was open, close it.
|
|
151
151
|
this.open && this.isInputOnlyMode && this.closeDropdown(), this.checkSelectedOptions(),
|
|
152
152
|
this.multilineOptions && this.applyMultilineOptions();
|
|
153
|
+
// Reset the option list's active index whenever the slotted option set changes so that
|
|
154
|
+
// the next ArrowDown/ArrowUp always starts from the first visible item rather than a
|
|
155
|
+
// stale position left over from a previous, different options list.
|
|
156
|
+
const p = this.optionElements.map((t => t.value)).join("\0");
|
|
157
|
+
p !== this.optionFingerprint && (this.optionFingerprint = p, null === (s = this.optionList) || void 0 === s || s.setActiveElement(void 0));
|
|
153
158
|
}, this.onOptionListChange = t => {
|
|
154
159
|
t.stopPropagation(), this.handleSelectionChanges(t.detail);
|
|
155
160
|
}, this.onSelectedDisplayMousedown = t => {
|
|
@@ -404,13 +409,13 @@ const h = class {
|
|
|
404
409
|
if (!a) return this.clearSelectedDisplay();
|
|
405
410
|
const h = a.cloneNode(!0);
|
|
406
411
|
h.querySelectorAll("[hide-on-select]").forEach((t => t.remove()));
|
|
407
|
-
let
|
|
408
|
-
return
|
|
409
|
-
|
|
412
|
+
let c = this.selectedDisplaySlot;
|
|
413
|
+
return c ? (null === (t = c.firstElementChild) || void 0 === t ? void 0 : t.outerHTML) !== h.outerHTML && c.replaceChildren(h) : (c = document.createElement("div"),
|
|
414
|
+
c.slot = "_selected-display",
|
|
410
415
|
// Prevent the non-focusable overlay from blurring the hidden input when clicked.
|
|
411
416
|
// Same pattern used by q2-input's clear button (onMouseDown preventDefault).
|
|
412
|
-
|
|
413
|
-
this.hostElement.appendChild(
|
|
417
|
+
c.addEventListener("mousedown", this.onSelectedDisplayMousedown), c.appendChild(h),
|
|
418
|
+
this.hostElement.appendChild(c)), c;
|
|
414
419
|
}
|
|
415
420
|
checkSelectedOptions() {
|
|
416
421
|
const {multiple: t, selectedOptions: i, value: e} = this;
|
|
@@ -596,20 +601,20 @@ const h = class {
|
|
|
596
601
|
}
|
|
597
602
|
render() {
|
|
598
603
|
return e(s, {
|
|
599
|
-
key: "
|
|
604
|
+
key: "78ce7b735d59271600debb18ab2f0f5cf315e465"
|
|
600
605
|
}, e("div", {
|
|
601
|
-
key: "
|
|
606
|
+
key: "d3e9a713581842cc62969a0df9556733edf6e378",
|
|
602
607
|
"aria-live": "polite",
|
|
603
608
|
"aria-atomic": "true",
|
|
604
609
|
role: "status",
|
|
605
610
|
class: "sr"
|
|
606
611
|
}, this.statusMessage), e("click-elsewhere", {
|
|
607
|
-
key: "
|
|
612
|
+
key: "6912af1d8f31af8de7c7ffb28786756819c57afc",
|
|
608
613
|
class: this.wrapperClasses,
|
|
609
614
|
role: "presentation",
|
|
610
615
|
onChange: this.onClickElsewhere
|
|
611
616
|
}, e("q2-input", {
|
|
612
|
-
key: "
|
|
617
|
+
key: "95a5397765aab6d3279b3d81cc31215f235aefc2",
|
|
613
618
|
ref: t => this.inputField = t,
|
|
614
619
|
class: "q2-search-input",
|
|
615
620
|
label: this.label && a(this.label) || "",
|
|
@@ -212,9 +212,9 @@ const g = class {
|
|
|
212
212
|
}
|
|
213
213
|
onClearHandler(t) {
|
|
214
214
|
var e;
|
|
215
|
+
this.readonly || this.disabled || this.multiple && this.searchable && "input" === (null === (e = null == t ? void 0 : t.detail) || void 0 === e ? void 0 : e.source) || this.clearValue();
|
|
215
216
|
// when multiple & searchable, it should not fire clearValue() if the type is `input` (cleared by key input) which is emitted from q2-input's handleDataInput
|
|
216
|
-
|
|
217
|
-
}
|
|
217
|
+
}
|
|
218
218
|
handleSelectedDisplay(t) {
|
|
219
219
|
!this.multiple && this.value && this.value === t.detail.value && (this.inputField.value = t.detail.display);
|
|
220
220
|
}
|
|
@@ -545,7 +545,7 @@ const g = class {
|
|
|
545
545
|
class: "q2-select-input",
|
|
546
546
|
label: this.label && n(this.label) || "",
|
|
547
547
|
value: this.selectedDisplay,
|
|
548
|
-
clearable: this.clearable && (!!this.value || !!(null === (t = this.selectedOptions) || void 0 === t ? void 0 : t.length)) || void 0,
|
|
548
|
+
clearable: !this.disabled && this.clearable && (!!this.value || !!(null === (t = this.selectedOptions) || void 0 === t ? void 0 : t.length)) || void 0,
|
|
549
549
|
errors: Array.isArray(this.errors) && this.errors.length > 0 && this.errors.map((t => n(t))) || this.invalid && [ "tecton.element.select.invalid" ] || [],
|
|
550
550
|
disabled: this.disabled,
|
|
551
551
|
optional: this.optional,
|
|
@@ -617,7 +617,7 @@ const g = class {
|
|
|
617
617
|
}
|
|
618
618
|
render() {
|
|
619
619
|
return i("click-elsewhere", {
|
|
620
|
-
key: "
|
|
620
|
+
key: "edb9951db5493781ee1f5da0ed5f6c03aff107e9",
|
|
621
621
|
class: this.wrapperClasses,
|
|
622
622
|
role: "presentation",
|
|
623
623
|
onChange: this.clickedElsewhere
|
|
@@ -15,6 +15,7 @@ export declare class Q2Search implements ComponentInterface {
|
|
|
15
15
|
displayBuffer: number;
|
|
16
16
|
inputField?: HTMLQ2InputElement;
|
|
17
17
|
mutationObserver: MutationObserver;
|
|
18
|
+
optionFingerprint: string;
|
|
18
19
|
optionList?: HTMLQ2OptionListElement;
|
|
19
20
|
popoverElement?: HTMLQ2PopoverElement;
|
|
20
21
|
popoverWidthWarned: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "q2-tecton-elements",
|
|
3
|
-
"version": "1.71.
|
|
3
|
+
"version": "1.71.3",
|
|
4
4
|
"description": "Q2 Tecton Custom Elements",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Q2 Tecton Team",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@stencil/core": "~4.43.0",
|
|
66
|
-
"q2-tecton-common": "1.71.
|
|
66
|
+
"q2-tecton-common": "1.71.3",
|
|
67
67
|
"swiper": "^12.1.2"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"rollup-plugin-istanbul": "^5.0.0"
|
|
86
86
|
},
|
|
87
87
|
"packageManager": "pnpm@10.27.0",
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "95ba2af02915cbf9987a0d554efc7f8212ffe135"
|
|
89
89
|
}
|