@cscfi/csc-ui 1.2.1 → 1.2.2
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/cjs/{c-badge_12.cjs.entry.js → c-autocomplete_16.cjs.entry.js} +1174 -52
- package/dist/cjs/c-autocomplete_16.cjs.entry.js.map +1 -0
- package/dist/cjs/{c-checkbox_2.cjs.entry.js → c-checkbox_3.cjs.entry.js} +14 -1
- package/dist/cjs/c-checkbox_3.cjs.entry.js.map +1 -0
- package/dist/cjs/c-csc-logo.cjs.entry.js +23 -0
- package/dist/cjs/c-csc-logo.cjs.entry.js.map +1 -0
- package/dist/cjs/c-main.cjs.entry.js +21 -0
- package/dist/cjs/c-main.cjs.entry.js.map +1 -0
- package/dist/cjs/c-menu_2.cjs.entry.js +2 -23
- package/dist/cjs/c-menu_2.cjs.entry.js.map +1 -1
- package/dist/cjs/c-row.cjs.entry.js +35 -0
- package/dist/cjs/c-row.cjs.entry.js.map +1 -0
- package/dist/cjs/c-toolbar.cjs.entry.js +21 -0
- package/dist/cjs/c-toolbar.cjs.entry.js.map +1 -0
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/getScrollParent-5d488045.js +28 -0
- package/dist/cjs/getScrollParent-5d488045.js.map +1 -0
- package/dist/cjs/index-91ba22ab.js +14 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/c-autocomplete/c-autocomplete.js +27 -3
- package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
- package/dist/collection/components/c-dropdown/c-dropdown.css +6 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js +18 -19
- package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
- package/dist/collection/components/c-menu-items/c-menu-items.js +2 -23
- package/dist/collection/components/c-menu-items/c-menu-items.js.map +1 -1
- package/dist/collection/components/c-select/c-select.js +58 -23
- package/dist/collection/components/c-select/c-select.js.map +1 -1
- package/dist/collection/utils/getScrollParent.js +23 -0
- package/dist/collection/utils/getScrollParent.js.map +1 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/components/c-autocomplete.js +28 -4
- package/dist/components/c-autocomplete.js.map +1 -1
- package/dist/components/c-dropdown2.js +19 -20
- package/dist/components/c-dropdown2.js.map +1 -1
- package/dist/components/c-menu-items2.js +2 -23
- package/dist/components/c-menu-items2.js.map +1 -1
- package/dist/components/c-select.js +59 -24
- package/dist/components/c-select.js.map +1 -1
- package/dist/components/getScrollParent.js +26 -0
- package/dist/components/getScrollParent.js.map +1 -0
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/p-040ed3e2.entry.js +2 -0
- package/dist/csc-ui/p-040ed3e2.entry.js.map +1 -0
- package/dist/csc-ui/{p-bf01d3ef.entry.js → p-1d6c84df.entry.js} +2 -2
- package/dist/csc-ui/p-39df362b.entry.js +2 -0
- package/dist/csc-ui/p-39df362b.entry.js.map +1 -0
- package/dist/csc-ui/{p-27904068.entry.js → p-3bb67f38.entry.js} +2 -2
- package/dist/csc-ui/p-3f0e51ff.js +2 -0
- package/dist/csc-ui/p-3f0e51ff.js.map +1 -0
- package/dist/csc-ui/{p-0569fc3e.entry.js → p-468d9583.entry.js} +2 -2
- package/dist/csc-ui/{p-16098e94.entry.js → p-56b1e1ea.entry.js} +2 -2
- package/dist/csc-ui/p-682782b1.entry.js +2 -0
- package/dist/csc-ui/p-682782b1.entry.js.map +1 -0
- package/dist/csc-ui/{p-958cf6ed.entry.js → p-6e046723.entry.js} +2 -2
- package/dist/csc-ui/p-9c5488fc.entry.js +2 -0
- package/dist/csc-ui/p-9c5488fc.entry.js.map +1 -0
- package/dist/csc-ui/{p-862486aa.entry.js → p-9c80f35e.entry.js} +2 -2
- package/dist/csc-ui/{p-873aa915.entry.js → p-ab62f9b5.entry.js} +2 -2
- package/dist/csc-ui/{p-45641e3d.entry.js → p-ae16b1f4.entry.js} +2 -2
- package/dist/csc-ui/{p-7af82ab9.entry.js → p-b0fa27b6.entry.js} +2 -2
- package/dist/csc-ui/{p-2a622e79.entry.js → p-b83651f8.entry.js} +2 -2
- package/dist/csc-ui/p-b83651f8.entry.js.map +1 -0
- package/dist/csc-ui/{p-64bcde03.entry.js → p-bda722d5.entry.js} +2 -2
- package/dist/csc-ui/{p-47ca0a95.entry.js → p-c8a7a751.entry.js} +2 -2
- package/dist/csc-ui/{p-c291cbe2.entry.js → p-ccef8a49.entry.js} +2 -2
- package/dist/csc-ui/p-ee753bac.entry.js +2 -0
- package/dist/csc-ui/p-ee753bac.entry.js.map +1 -0
- package/dist/csc-ui/{p-5461ca29.js → p-f24b9d97.js} +2 -2
- package/dist/csc-ui/p-fa83a615.entry.js +2 -0
- package/dist/csc-ui/p-fa83a615.entry.js.map +1 -0
- package/dist/esm/c-accordion-item.entry.js +1 -1
- package/dist/esm/c-alert.entry.js +1 -1
- package/dist/esm/{c-badge_12.entry.js → c-autocomplete_16.entry.js} +1168 -50
- package/dist/esm/c-autocomplete_16.entry.js.map +1 -0
- package/dist/esm/{c-checkbox_2.entry.js → c-checkbox_3.entry.js} +15 -3
- package/dist/esm/c-checkbox_3.entry.js.map +1 -0
- package/dist/esm/c-csc-logo.entry.js +19 -0
- package/dist/esm/c-csc-logo.entry.js.map +1 -0
- package/dist/esm/c-data-table.entry.js +1 -1
- package/dist/esm/c-main.entry.js +17 -0
- package/dist/esm/c-main.entry.js.map +1 -0
- package/dist/esm/c-menu_2.entry.js +3 -24
- package/dist/esm/c-menu_2.entry.js.map +1 -1
- package/dist/esm/c-navigation-button.entry.js +1 -1
- package/dist/esm/c-radio-group.entry.js +1 -1
- package/dist/esm/c-row.entry.js +31 -0
- package/dist/esm/c-row.entry.js.map +1 -0
- package/dist/esm/c-side-navigation-item.entry.js +1 -1
- package/dist/esm/c-side-navigation.entry.js +1 -1
- package/dist/esm/c-swiper.entry.js +1 -1
- package/dist/esm/c-tabs.entry.js +1 -1
- package/dist/esm/c-tag.entry.js +1 -1
- package/dist/esm/c-text-field.entry.js +1 -1
- package/dist/esm/c-toast.entry.js +1 -1
- package/dist/esm/c-toolbar.entry.js +17 -0
- package/dist/esm/c-toolbar.entry.js.map +1 -0
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/getScrollParent-f876ad1b.js +26 -0
- package/dist/esm/getScrollParent-f876ad1b.js.map +1 -0
- package/dist/esm/index-47956d53.js +14 -30
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mdi-e92c0e44.js → mdi-8656e74a.js} +2 -2
- package/dist/esm/{mdi-e92c0e44.js.map → mdi-8656e74a.js.map} +1 -1
- package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +1 -0
- package/dist/types/components/c-dropdown/c-dropdown.d.ts +2 -1
- package/dist/types/components/c-menu-items/c-menu-items.d.ts +0 -1
- package/dist/types/components/c-select/c-select.d.ts +3 -0
- package/dist/types/utils/getScrollParent.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/c-autocomplete.cjs.entry.js +0 -251
- package/dist/cjs/c-autocomplete.cjs.entry.js.map +0 -1
- package/dist/cjs/c-badge_12.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-actions.cjs.entry.js +0 -28
- package/dist/cjs/c-card-actions.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-content.cjs.entry.js +0 -21
- package/dist/cjs/c-card-content.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-title.cjs.entry.js +0 -21
- package/dist/cjs/c-card-title.cjs.entry.js.map +0 -1
- package/dist/cjs/c-checkbox_2.cjs.entry.js.map +0 -1
- package/dist/cjs/c-dropdown_2.cjs.entry.js +0 -512
- package/dist/cjs/c-dropdown_2.cjs.entry.js.map +0 -1
- package/dist/cjs/c-message.cjs.entry.js +0 -67
- package/dist/cjs/c-message.cjs.entry.js.map +0 -1
- package/dist/cjs/c-option.cjs.entry.js +0 -25
- package/dist/cjs/c-option.cjs.entry.js.map +0 -1
- package/dist/cjs/c-select.cjs.entry.js +0 -276
- package/dist/cjs/c-select.cjs.entry.js.map +0 -1
- package/dist/csc-ui/p-019c6898.entry.js +0 -2
- package/dist/csc-ui/p-019c6898.entry.js.map +0 -1
- package/dist/csc-ui/p-0666f12d.entry.js +0 -2
- package/dist/csc-ui/p-0666f12d.entry.js.map +0 -1
- package/dist/csc-ui/p-2a622e79.entry.js.map +0 -1
- package/dist/csc-ui/p-4e1d8f5d.entry.js +0 -2
- package/dist/csc-ui/p-4e1d8f5d.entry.js.map +0 -1
- package/dist/csc-ui/p-6c5e538b.entry.js +0 -2
- package/dist/csc-ui/p-6c5e538b.entry.js.map +0 -1
- package/dist/csc-ui/p-bbe8423c.entry.js +0 -2
- package/dist/csc-ui/p-bbe8423c.entry.js.map +0 -1
- package/dist/csc-ui/p-bddd9153.entry.js +0 -2
- package/dist/csc-ui/p-bddd9153.entry.js.map +0 -1
- package/dist/csc-ui/p-d1089126.entry.js +0 -2
- package/dist/csc-ui/p-d1089126.entry.js.map +0 -1
- package/dist/csc-ui/p-d2fc8cb4.entry.js +0 -2
- package/dist/csc-ui/p-d2fc8cb4.entry.js.map +0 -1
- package/dist/csc-ui/p-ec167606.entry.js +0 -2
- package/dist/csc-ui/p-ec167606.entry.js.map +0 -1
- package/dist/csc-ui/p-f148aad1.entry.js +0 -2
- package/dist/csc-ui/p-f148aad1.entry.js.map +0 -1
- package/dist/esm/c-autocomplete.entry.js +0 -247
- package/dist/esm/c-autocomplete.entry.js.map +0 -1
- package/dist/esm/c-badge_12.entry.js.map +0 -1
- package/dist/esm/c-card-actions.entry.js +0 -24
- package/dist/esm/c-card-actions.entry.js.map +0 -1
- package/dist/esm/c-card-content.entry.js +0 -17
- package/dist/esm/c-card-content.entry.js.map +0 -1
- package/dist/esm/c-card-title.entry.js +0 -17
- package/dist/esm/c-card-title.entry.js.map +0 -1
- package/dist/esm/c-checkbox_2.entry.js.map +0 -1
- package/dist/esm/c-dropdown_2.entry.js +0 -507
- package/dist/esm/c-dropdown_2.entry.js.map +0 -1
- package/dist/esm/c-message.entry.js +0 -63
- package/dist/esm/c-message.entry.js.map +0 -1
- package/dist/esm/c-option.entry.js +0 -21
- package/dist/esm/c-option.entry.js.map +0 -1
- package/dist/esm/c-select.entry.js +0 -272
- package/dist/esm/c-select.entry.js.map +0 -1
- /package/dist/csc-ui/{p-bf01d3ef.entry.js.map → p-1d6c84df.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-27904068.entry.js.map → p-3bb67f38.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-0569fc3e.entry.js.map → p-468d9583.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-16098e94.entry.js.map → p-56b1e1ea.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-958cf6ed.entry.js.map → p-6e046723.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-862486aa.entry.js.map → p-9c80f35e.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-873aa915.entry.js.map → p-ab62f9b5.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-45641e3d.entry.js.map → p-ae16b1f4.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-7af82ab9.entry.js.map → p-b0fa27b6.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-64bcde03.entry.js.map → p-bda722d5.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-47ca0a95.entry.js.map → p-c8a7a751.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-c291cbe2.entry.js.map → p-ccef8a49.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-5461ca29.js.map → p-f24b9d97.js.map} +0 -0
|
@@ -17,6 +17,7 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
17
17
|
this.__registerHost();
|
|
18
18
|
this.__attachShadow();
|
|
19
19
|
this.changeValue = createEvent(this, "changeValue", 3);
|
|
20
|
+
this.internals = this.attachInternals();
|
|
20
21
|
this._preventDialogOpen = false;
|
|
21
22
|
this._debounce = null;
|
|
22
23
|
this._lastKeyPressTime = null;
|
|
@@ -50,10 +51,19 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
50
51
|
if (this.optionElements.length && !this.optionElementsExist) {
|
|
51
52
|
this.optionElementsExist = true;
|
|
52
53
|
}
|
|
54
|
+
const selection = Array.from(this.optionElements).find((option) => option.selected);
|
|
55
|
+
if (selection) {
|
|
56
|
+
this.value = this.returnObject
|
|
57
|
+
? { name: selection.name, value: selection.value }
|
|
58
|
+
: selection.value;
|
|
59
|
+
this.changeValue.emit(this.value);
|
|
60
|
+
this.internals.setFormValue(selection.value.toString());
|
|
61
|
+
}
|
|
53
62
|
};
|
|
54
63
|
this._onReset = (event) => {
|
|
55
64
|
event.stopPropagation();
|
|
56
65
|
this.changeValue.emit(null);
|
|
66
|
+
this.internals.setFormValue(null);
|
|
57
67
|
this._selectionElement.classList.remove('c-input-menu__selection--show');
|
|
58
68
|
this._selectionElement.replaceChildren(null);
|
|
59
69
|
this._preventDialogOpen = true;
|
|
@@ -113,10 +123,11 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
113
123
|
['number', 'string'].includes(typeof this.value)) {
|
|
114
124
|
return (_b = (_a = Array.from(this._items)) === null || _a === void 0 ? void 0 : _a.find((item) => item.value === this.value)) === null || _b === void 0 ? void 0 : _b.name;
|
|
115
125
|
}
|
|
116
|
-
return (_d = (_c = this._items) === null || _c === void 0 ? void 0 : _c.find((item) => item.value === this.value.value)) === null || _d === void 0 ? void 0 : _d.name;
|
|
126
|
+
return (_d = (_c = Array.from(this._items)) === null || _c === void 0 ? void 0 : _c.find((item) => item.value === this.value.value)) === null || _d === void 0 ? void 0 : _d.name;
|
|
117
127
|
}
|
|
118
128
|
async reset() {
|
|
119
129
|
this.changeValue.emit(null);
|
|
130
|
+
this.internals.setFormValue(null);
|
|
120
131
|
this._dropdownElement.updateList();
|
|
121
132
|
}
|
|
122
133
|
handleKeyDown(event) {
|
|
@@ -146,21 +157,19 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
146
157
|
}
|
|
147
158
|
if (event.key === 'Tab') {
|
|
148
159
|
this._dropdownElement.close();
|
|
149
|
-
return;
|
|
150
160
|
}
|
|
151
161
|
if (event.key === 'ArrowDown') {
|
|
152
162
|
event.preventDefault();
|
|
153
163
|
if (!this._items.length)
|
|
154
164
|
return;
|
|
155
|
-
if (!this.dropdownVisible
|
|
156
|
-
this.currentIndex = 0;
|
|
165
|
+
if (!this.dropdownVisible) {
|
|
157
166
|
this._dropdownElement.open();
|
|
158
|
-
this._dropdownElement.focusItem(this.currentIndex);
|
|
159
|
-
return;
|
|
160
167
|
}
|
|
161
|
-
this.currentIndex =
|
|
168
|
+
this.currentIndex =
|
|
169
|
+
this.currentIndex === null
|
|
170
|
+
? 0
|
|
171
|
+
: Math.min(this.currentIndex + 1, this._items.length - 1);
|
|
162
172
|
this._dropdownElement.focusItem(this.currentIndex);
|
|
163
|
-
return;
|
|
164
173
|
}
|
|
165
174
|
if (event.key === 'ArrowUp') {
|
|
166
175
|
event.preventDefault();
|
|
@@ -168,13 +177,13 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
168
177
|
this._dropdownElement.close();
|
|
169
178
|
this._inputElement.focus();
|
|
170
179
|
}
|
|
171
|
-
if (!this.dropdownVisible
|
|
172
|
-
this.currentIndex = this._items.length - 1;
|
|
180
|
+
if (!this.dropdownVisible) {
|
|
173
181
|
this._dropdownElement.open();
|
|
174
|
-
this._dropdownElement.focusItem(this.currentIndex);
|
|
175
|
-
return;
|
|
176
182
|
}
|
|
177
|
-
this.currentIndex =
|
|
183
|
+
this.currentIndex =
|
|
184
|
+
this.currentIndex === null
|
|
185
|
+
? this._items.length - 1
|
|
186
|
+
: Math.max(this.currentIndex - 1, 0);
|
|
178
187
|
this._dropdownElement.focusItem(this.currentIndex);
|
|
179
188
|
}
|
|
180
189
|
if (event.key === ' ') {
|
|
@@ -196,27 +205,37 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
196
205
|
onDropdownStateChange(event) {
|
|
197
206
|
const isOpen = event.detail;
|
|
198
207
|
this.dropdownVisible = isOpen;
|
|
199
|
-
if (!isOpen) {
|
|
200
|
-
requestAnimationFrame(() => {
|
|
201
|
-
this.currentIndex = null;
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
208
|
}
|
|
205
209
|
onSelectOption(event) {
|
|
206
210
|
this._dropdownElement.close();
|
|
207
211
|
const { name, value } = event.detail;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (!selection)
|
|
211
|
-
return;
|
|
212
|
+
const selection = this._setCurrentIndex({ name, value });
|
|
213
|
+
if (this.optionElementsExist && this.optionAsSelection && selection) {
|
|
212
214
|
const clone = selection.cloneNode(true);
|
|
213
215
|
this._selectionElement.classList.add('c-input-menu__selection--show');
|
|
214
216
|
this._selectionElement.replaceChildren(clone);
|
|
215
217
|
}
|
|
216
|
-
this.
|
|
218
|
+
this._dropdownElement.updateList();
|
|
219
|
+
this.value = this.returnObject ? event.detail : value;
|
|
220
|
+
this.changeValue.emit(this.value);
|
|
221
|
+
this.internals.setFormValue(value);
|
|
217
222
|
this._preventDialogOpen = true;
|
|
218
223
|
this._inputElement.focus();
|
|
219
224
|
}
|
|
225
|
+
_setCurrentIndex({ value, name }) {
|
|
226
|
+
let selection = null;
|
|
227
|
+
Array.from(this._items).forEach((item, index) => {
|
|
228
|
+
const selected = item.value === value && item.name === name;
|
|
229
|
+
if (this.optionElementsExist) {
|
|
230
|
+
item.selected = selected;
|
|
231
|
+
}
|
|
232
|
+
if (selected) {
|
|
233
|
+
this.currentIndex = index;
|
|
234
|
+
selection = item;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
return selection;
|
|
238
|
+
}
|
|
220
239
|
_updateInput() {
|
|
221
240
|
this._dropdownElement.open();
|
|
222
241
|
this._dropdownElement.updateList();
|
|
@@ -246,6 +265,21 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
246
265
|
'input_' +
|
|
247
266
|
(this.hostId || this.label || this.placeholder).replace(/[^a-zA-Z0-9-_]/g, '');
|
|
248
267
|
}
|
|
268
|
+
componentDidLoad() {
|
|
269
|
+
if (!this.value)
|
|
270
|
+
return;
|
|
271
|
+
const selection = Array.from(this._items).find((item) => {
|
|
272
|
+
if (this.returnObject) {
|
|
273
|
+
return (item.name === this.value.name &&
|
|
274
|
+
item.value === this.value.value);
|
|
275
|
+
}
|
|
276
|
+
return item.value === this.value;
|
|
277
|
+
});
|
|
278
|
+
this._setCurrentIndex({
|
|
279
|
+
name: selection.name,
|
|
280
|
+
value: selection.value.toString(),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
249
283
|
_renderLoader() {
|
|
250
284
|
return h("c-spinner", { color: "var(--_c-autocomplete-active-color)", size: 20 });
|
|
251
285
|
}
|
|
@@ -272,9 +306,10 @@ const CSelect$1 = proxyCustomElement(class CSelect extends HTMLElement {
|
|
|
272
306
|
(!this.value || !this.clearable) &&
|
|
273
307
|
this._renderChevron(), h("slot", { onSlotchange: () => this._onSlotChange() })), h("slot", { name: "post", slot: "post" })))));
|
|
274
308
|
}
|
|
309
|
+
static get formAssociated() { return true; }
|
|
275
310
|
get el() { return this; }
|
|
276
311
|
static get style() { return cSelectCss; }
|
|
277
|
-
}, [
|
|
312
|
+
}, [65, "c-select", {
|
|
278
313
|
"items": [16],
|
|
279
314
|
"value": [8],
|
|
280
315
|
"hostId": [1, "id"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-select.js","mappings":";;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,w3IAAw3I;;MCwB93IA,SAAO;;;;;;IAkIV,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAEjB,sBAAiB,GAAG,IAAI,CAAC;IAEzB,kBAAa,GAAG,EAAE,CAAC;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B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAE3C,YAAM,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,KAAK,GAAQ,EAEnC,WAAK,KAAK,EAAC,kBAAkB,IAC1B,IAAI,CAAC,mBAAmB,EAAE,EAE1B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAEpC,CAAC,IAAI,CAAC,OAAO;MACZ,IAAI,CAAC,KAAK;MACV,IAAI,CAAC,SAAS;MACd,IAAI,CAAC,YAAY,EAAE,EAEpB,CAAC,IAAI,CAAC,OAAO;OACX,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;MAChC,IAAI,CAAC,cAAc,EAAE,EAEvB,YAAM,YAAY,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAAS,CACnD,EAEN,YAAM,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,GAAQ,CAC7B,CACC,CACR,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AArccA,mBAAS,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CSelect"],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n --_c-select-shadow-active-color: var(--c-select-shadow-active-color, var(--_c-select-active-color));\n --_c-select-shadow-background-color: var(--c-select-shadow-background-color, var(--c-white));\n --_c-select-shadow-text-color: var(--c-select-shadow-text-color, var(--_c-select-text-color));\n --_c-select-shadow-placeholder-color: var(--c-select-shadow-placeholder-color, var(--_c-select-placeholder-color));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n --_c-input-shadow-active-color: var(--_c-select-shadow-active-color);\n --_c-input-shadow-background-color: var(--_c-select-shadow-background-color);\n --_c-input-shadow-text-color: var(--_c-select-shadow-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-select-shadow-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport { CSelectItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CSelectItem = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Make the selected value clearable\n */\n @Prop() clearable = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _selectionElement: HTMLDivElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private get _id() {\n return this.hostId || `select_${CSelect._uniqueId}`;\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private get _value() {\n if (!this.value) return '';\n\n if (\n !this.returnObject &&\n !['number', 'string'].includes(typeof this.value)\n ) {\n console.warn(\n `[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`,\n );\n\n return '';\n }\n\n if (\n !this.returnObject &&\n ['number', 'string'].includes(typeof this.value)\n ) {\n return Array.from(this._items)?.find((item) => item.value === this.value)\n ?.name;\n }\n\n return (this._items as CSelectItem[])?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n /**\n * Reset select state\n */\n @Method()\n async reset() {\n this.changeValue.emit(null);\n\n this._dropdownElement.updateList();\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (this.dropdownVisible) return;\n\n if (Date.now() - this._lastKeyPressTime > 3000) {\n this._searchString = event.key;\n } else {\n this._searchString += event.key;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectionIndex = Array.from(this._items).findIndex((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;\n\n if (this.currentIndex !== null) {\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._dropdownElement.close();\n\n return;\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = 0;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.min(\n this.currentIndex + 1,\n this._items.length - 1,\n );\n\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible || this.currentIndex === null) {\n this.currentIndex = this._items.length - 1;\n this._dropdownElement.open();\n this._dropdownElement.focusItem(this.currentIndex);\n\n return;\n }\n\n this.currentIndex = Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n\n if (!isOpen) {\n requestAnimationFrame(() => {\n this.currentIndex = null;\n });\n }\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n if (this.optionElementsExist && this.optionAsSelection) {\n // const selection = this._cOptionElements[item.value.toString()];\n const selection = Array.from(this.optionElements).find(\n (item) => item.value === value && item.name === name,\n );\n\n if (!selection) return;\n\n const clone = selection.cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this.changeValue.emit(this.returnObject ? event.detail : value);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._onReset(event);\n\n this._preventDialogOpen = true;\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n }\n };\n\n private _onSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n };\n\n private _onReset = (event) => {\n event.stopPropagation();\n\n this.changeValue.emit(null);\n\n this._selectionElement.classList.remove('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(null);\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _updateInput() {\n this._dropdownElement.open();\n\n this._dropdownElement.updateList();\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this.statusText = '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} option${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No options available';\n }\n\n const ending = !!this._items.length\n ? ', navigate using the up and down arrows'\n : '';\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n readonly\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this._value}\n name={this.name ?? null}\n onInput={() => this._updateInput()}\n onFocus={() => this._onInputFocus()}\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._onReset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={this._items as NodeListOf<HTMLCOptionElement> & CSelectItem[]}\n parent={this.el}\n type=\"select\"\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onClick={() => this._dropdownElement.open()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading &&\n this.value &&\n this.clearable &&\n this._renderReset()}\n\n {!this.loading &&\n (!this.value || !this.clearable) &&\n this._renderChevron()}\n\n <slot onSlotchange={() => this._onSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"c-select.js","mappings":";;;;;;;;;;;AAAA,MAAM,UAAU,GAAG,w3IAAw3I;;MC0B93IA,SAAO;;;;;;;IAqIV,uBAAkB,GAAG,KAAK,CAAC;IAE3B,cAAS,GAAG,IAAI,CAAC;IAEjB,sBAAiB,GAAG,IAAI,CAAC;IAEzB,kBAAa,GAAG,EAAE,CAAC;IA0MnB,oBAAe,GAAG,CAAC,KAAK;MAC9B,KAAK,CAAC,eAAe,EAAE,CAAC;MAExB,IAAI,IAAI,CAAC,eAAe,EAAE;QACxB,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAE9B,OAAO;OACR;MAED,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;KAC9B,CAAC;IAEM,qBAAgB,GAAG,CACzB,GAAwB,EACxB,KAAoB;MAEpB,KAAK,CAAC,eAAe,EAAE,CAAC;MAExB,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK;QAAE,KAAK,CAAC,cAAc,EAAE,CAAC;MAEhD,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACtC,IAAI,GAAG,KAAK,SAAS,EAAE;UACrB,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;UAE5B,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAErB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAE/B,qBAAqB,CAAC;UACpB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;SAC5B,CAAC,CAAC;OACJ;KACF,CAAC;IAEM,kBAAa,GAAG;MACtB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,UAAU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;;;;;;;;;;;;;;;;;;;;;AAjfcA,mBAAS,GAAG,CAAH,CAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CSelect"],"sources":["src/components/c-select/c-select.scss?tag=c-select&encapsulation=shadow","src/components/c-select/c-select.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-select-active-color: Active select color\n * @prop --c-select-inactive-color: Inactive select color\n * @prop --c-select-background-color: Inactive select background color\n * @prop --c-select-text-color: Select text color\n * @prop --c-select-placeholder-color: Select placeholder color\n * @prop --c-select-option-background-color: Select option background color\n * @prop --c-select-option-background-color-hover: Select option hover background color\n * @prop --c-select-option-text-color: Select option text color\n */\n --_c-select-active-color: var(--c-select-active-color, var(--c-primary-600));\n --_c-select-inactive-color: var(--c-select-inactive-color, var(--c-tertiary-600));\n --_c-select-background-color: var(--c-select-background-color, var(--c-transparent));\n --_c-select-text-color: var(--c-select-text-color, var(--c-text-body));\n --_c-select-placeholder-color: var(--c-select-placeholder-color, var(--c-tertiary-500));\n --_c-select-option-background-color: var(--c-select-option-background-color, var(--c-white));\n --_c-select-option-background-color-hover: var(--c-select-option-background-color-hover, var(--c-primary-100));\n --_c-select-option-text-color: var(--c-select-option-text-color, var(--c-text-body));\n --_c-select-shadow-active-color: var(--c-select-shadow-active-color, var(--_c-select-active-color));\n --_c-select-shadow-background-color: var(--c-select-shadow-background-color, var(--c-white));\n --_c-select-shadow-text-color: var(--c-select-shadow-text-color, var(--_c-select-text-color));\n --_c-select-shadow-placeholder-color: var(--c-select-shadow-placeholder-color, var(--_c-select-placeholder-color));\n\n // private\n --_c-input-active-color: var(--_c-select-active-color);\n --_c-input-inactive-color: var(--_c-select-inactive-color);\n --_c-input-background-color: var(--_c-select-background-color);\n --_c-input-text-color: var(--_c-select-text-color);\n --_c-input-placeholder-color: var(--_c-select-placeholder-color);\n --_c-input-shadow-active-color: var(--_c-select-shadow-active-color);\n --_c-input-shadow-background-color: var(--_c-select-shadow-background-color);\n --_c-input-shadow-text-color: var(--_c-select-shadow-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-select-shadow-placeholder-color);\n}\n\n@import \"../c-input/c-input-menu\";\n","import {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport { CSelectItem } from '../../types';\nimport { mdiChevronDown, mdiClose } from '@mdi/js';\n\n/**\n * @group Form\n * @slot Default slot - Use c-option elements only\n */\n@Component({\n tag: 'c-select',\n styleUrl: 'c-select.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CSelect {\n @Element() el: HTMLCSelectElement;\n\n // eslint-disable-next-line\n @AttachInternals() internals: ElementInternals;\n\n /**\n * Dropdown items\n */\n @Prop() items: CSelectItem[] = [];\n\n /**\n * Selected item\n */\n @Prop() value: string | number | CSelectItem = null;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Make the selected value clearable\n */\n @Prop() clearable = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Element label\n */\n @Prop() label: string;\n\n /**\n * Input field name\n */\n @Prop() name: string;\n\n /**\n * Placeholder text\n */\n @Prop() placeholder = '';\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Show loading state\n */\n @Prop() loading = false;\n\n /**\n * Show required validation\n */\n @Prop() required = false;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Shadow variant\n */\n @Prop() shadow = false;\n\n /**\n * Return object instead of value\n */\n @Prop() returnObject = false;\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * display the option as selection (works only when c-option elements are used)\n */\n @Prop() optionAsSelection: false;\n\n /**\n * Triggered when option is selected\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() optionElements: NodeListOf<HTMLCOptionElement>;\n\n @State() currentIndex: number = null;\n\n @State() dropdownVisible = false;\n\n @State() statusText = '';\n\n @State() optionElementsExist = false;\n\n private static _uniqueId = 0;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n private _inputElement: HTMLInputElement;\n\n private _cInputElement: HTMLCInputElement;\n\n private _selectionElement: HTMLDivElement;\n\n private _inputId: string;\n\n private _preventDialogOpen = false;\n\n private _debounce = null;\n\n private _lastKeyPressTime = null;\n\n private _searchString = '';\n\n private get _id() {\n return this.hostId || `select_${CSelect._uniqueId}`;\n }\n\n private get _items() {\n return this.optionElementsExist ? this.optionElements : this.items;\n }\n\n private get _value() {\n if (!this.value) return '';\n\n if (\n !this.returnObject &&\n !['number', 'string'].includes(typeof this.value)\n ) {\n console.warn(\n `[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`,\n );\n\n return '';\n }\n\n if (\n !this.returnObject &&\n ['number', 'string'].includes(typeof this.value)\n ) {\n return Array.from(this._items)?.find((item) => item.value === this.value)\n ?.name;\n }\n\n return Array.from(this._items as CSelectItem[])?.find(\n (item) => item.value === (this.value as CSelectItem).value,\n )?.name;\n }\n\n /**\n * Reset select state\n */\n @Method()\n async reset() {\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this._dropdownElement.updateList();\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n const alphanumeric = /^[0-9a-zA-Z ]+$/;\n\n if (event.key.match(alphanumeric) && event.key.length === 1) {\n if (this.dropdownVisible) return;\n\n if (Date.now() - this._lastKeyPressTime > 3000) {\n this._searchString = event.key;\n } else {\n this._searchString += event.key;\n }\n\n this._lastKeyPressTime = Date.now();\n\n const selectionIndex = Array.from(this._items).findIndex((i) =>\n i.name.toLowerCase().startsWith(this._searchString),\n );\n\n this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;\n\n if (this.currentIndex !== null) {\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n return;\n }\n\n if (event.key === 'Escape') {\n this._preventDialogOpen = true;\n this._dropdownElement.close();\n this._inputElement.focus();\n\n return;\n }\n\n if (event.key === 'Tab') {\n this._dropdownElement.close();\n }\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n\n if (!this._items.length) return;\n\n if (!this.dropdownVisible) {\n this._dropdownElement.open();\n }\n\n this.currentIndex =\n this.currentIndex === null\n ? 0\n : Math.min(this.currentIndex + 1, this._items.length - 1);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n\n if (this.currentIndex === 0) {\n this._dropdownElement.close();\n this._inputElement.focus();\n }\n\n if (!this.dropdownVisible) {\n this._dropdownElement.open();\n }\n\n this.currentIndex =\n this.currentIndex === null\n ? this._items.length - 1\n : Math.max(this.currentIndex - 1, 0);\n\n this._dropdownElement.focusItem(this.currentIndex);\n }\n\n if (event.key === ' ') {\n event.preventDefault();\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n\n if (this.currentIndex === null) return;\n\n this._dropdownElement.selectItem(this.currentIndex);\n }\n\n if (event.key === 'Home' && this.dropdownVisible) {\n this.currentIndex = 0;\n }\n\n if (event.key === 'End' && this.dropdownVisible) {\n this.currentIndex = this._items.length - 1;\n }\n }\n\n @Listen('dropdownStateChange')\n onDropdownStateChange(event: CustomEvent<boolean>) {\n const isOpen = event.detail;\n\n this.dropdownVisible = isOpen;\n }\n\n @Listen('selectOption')\n onSelectOption(event: CustomEvent<{ name: string; value: string }>) {\n this._dropdownElement.close();\n\n const { name, value } = event.detail;\n\n const selection = this._setCurrentIndex({ name, value });\n\n if (this.optionElementsExist && this.optionAsSelection && selection) {\n const clone = (selection as HTMLCOptionElement).cloneNode(true);\n\n this._selectionElement.classList.add('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(clone);\n }\n\n this._dropdownElement.updateList();\n\n this.value = this.returnObject ? event.detail : value;\n\n this.changeValue.emit(this.value);\n\n this.internals.setFormValue(value);\n\n this._preventDialogOpen = true;\n\n this._inputElement.focus();\n }\n\n private _setCurrentIndex({ value, name }: { value: string; name: string }) {\n let selection: HTMLCOptionElement | CSelectItem | null = null;\n\n Array.from(this._items).forEach((item, index) => {\n const selected = item.value === value && item.name === name;\n\n if (this.optionElementsExist) {\n (item as HTMLCOptionElement).selected = selected;\n }\n\n if (selected) {\n this.currentIndex = index;\n\n selection = item;\n }\n });\n\n return selection;\n }\n\n private _toggleDropdown = (event) => {\n event.stopPropagation();\n\n if (this.dropdownVisible) {\n this._dropdownElement.close();\n\n return;\n }\n\n this._dropdownElement.open();\n };\n\n private _onButtonKeyDown = (\n src: 'chevron' | 'reset',\n event: KeyboardEvent,\n ) => {\n event.stopPropagation();\n\n if (event.key !== 'Tab') event.preventDefault();\n\n if (['Enter', ' '].includes(event.key)) {\n if (src === 'chevron') {\n this._toggleDropdown(event);\n\n return;\n }\n\n this._onReset(event);\n\n this._preventDialogOpen = true;\n\n requestAnimationFrame(() => {\n this._inputElement.focus();\n });\n }\n };\n\n private _onSlotChange = () => {\n this.optionElements = this.el.querySelectorAll('c-option');\n\n if (this.optionElements.length && !this.optionElementsExist) {\n this.optionElementsExist = true;\n }\n\n const selection = Array.from(this.optionElements).find(\n (option) => option.selected,\n );\n\n if (selection) {\n this.value = this.returnObject\n ? { name: selection.name, value: selection.value }\n : selection.value;\n\n this.changeValue.emit(this.value);\n\n this.internals.setFormValue(selection.value.toString());\n }\n };\n\n private _onReset = (event) => {\n event.stopPropagation();\n\n this.changeValue.emit(null);\n\n this.internals.setFormValue(null);\n\n this._selectionElement.classList.remove('c-input-menu__selection--show');\n this._selectionElement.replaceChildren(null);\n\n this._preventDialogOpen = true;\n\n this._cInputElement.reset();\n\n this._inputElement.focus();\n\n this._dropdownElement.updateList();\n };\n\n private _updateInput() {\n this._dropdownElement.open();\n\n this._dropdownElement.updateList();\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this.statusText = '';\n\n if (this.currentIndex === null) {\n this.statusText = this._items.length\n ? `${this._items.length} option${\n this._items.length !== 1 ? 's' : ''\n } available`\n : 'No options available';\n }\n\n const ending = !!this._items.length\n ? ', navigate using the up and down arrows'\n : '';\n\n this._dropdownElement.setStatusText(this.statusText + ending);\n\n this._debounce = null;\n }, 1400);\n }\n\n private _onInputFocus = () => {\n if (!this._preventDialogOpen) {\n this._dropdownElement.open();\n }\n\n this._updateStatusText();\n\n this._preventDialogOpen = false;\n };\n\n componentWillLoad() {\n CSelect._uniqueId += 1;\n\n this._inputId =\n 'input_' +\n (this.hostId || this.label || this.placeholder).replace(\n /[^a-zA-Z0-9-_]/g,\n '',\n );\n }\n\n componentDidLoad() {\n if (!this.value) return;\n\n const selection = Array.from(this._items).find((item) => {\n if (this.returnObject) {\n return (\n item.name === (this.value as CSelectItem).name &&\n item.value === (this.value as CSelectItem).value\n );\n }\n\n return item.value === this.value;\n });\n\n this._setCurrentIndex({\n name: selection.name,\n value: selection.value.toString(),\n });\n }\n\n private _renderLoader() {\n return <c-spinner color=\"var(--_c-autocomplete-active-color)\" size={20} />;\n }\n\n private _renderChevron() {\n const classes = {\n 'c-input-menu__chevron': true,\n 'c-input-menu__chevron--active': this.dropdownVisible,\n };\n\n return (\n <c-icon-button\n size=\"x-small\"\n class={classes}\n text\n onClick={(event) => this._toggleDropdown(event)}\n onKeyDown={(event) => this._onButtonKeyDown('chevron', event)}\n >\n <c-icon path={mdiChevronDown} size={24} />\n </c-icon-button>\n );\n }\n\n private _renderInputElement() {\n return (\n <div class=\"c-input-menu__input\">\n <input\n type=\"text\"\n readonly\n ref={(el) => (this._inputElement = el)}\n aria-expanded={this.dropdownVisible.toString()}\n aria-owns={this._inputId + '-items'}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n class=\"c-input__input\"\n role=\"combobox\"\n value={this._value}\n name={this.name ?? null}\n onInput={() => this._updateInput()}\n onFocus={() => this._onInputFocus()}\n />\n\n <div\n ref={(el) => (this._selectionElement = el)}\n class=\"c-input-menu__selection\"\n />\n </div>\n );\n }\n\n private _renderReset() {\n return (\n <c-icon-button\n aria-label=\"\"\n size=\"x-small\"\n text\n onClick={(event) => this._onReset(event)}\n onKeyDown={(event) => this._onButtonKeyDown('reset', event)}\n >\n <c-icon path={mdiClose} size={20} />\n </c-icon-button>\n );\n }\n\n render() {\n const itemType = this.optionElementsExist ? 'option' : 'item';\n\n return (\n <Host>\n <c-dropdown\n ref={(el) => (this._dropdownElement = el)}\n id={`${this._id}-dropdown`}\n index={this.currentIndex}\n items-per-page={this.itemsPerPage}\n item-type={itemType}\n items={this._items as NodeListOf<HTMLCOptionElement> & CSelectItem[]}\n parent={this.el}\n type=\"select\"\n >\n <c-input\n slot=\"default\"\n ref={(el) => (this._cInputElement = el)}\n active={this.dropdownVisible}\n disabled={this.disabled}\n hide-details={this.hideDetails}\n hint={this.hint}\n id={this.hostId}\n input-id={this._inputId}\n label={this.label}\n name={this.name}\n placeholder={this.placeholder}\n required={this.required}\n shadow={this.shadow}\n valid={this.valid}\n validate={this.validate}\n validate-on-blur={this.validateOnBlur}\n validation={this.validation}\n value={this.value}\n variant=\"select\"\n onClick={() => this._dropdownElement.open()}\n >\n <slot name=\"pre\" slot=\"pre\"></slot>\n\n <div class=\"c-input__content\">\n {this._renderInputElement()}\n\n {this.loading && this._renderLoader()}\n\n {!this.loading &&\n this.value &&\n this.clearable &&\n this._renderReset()}\n\n {!this.loading &&\n (!this.value || !this.clearable) &&\n this._renderChevron()}\n\n <slot onSlotchange={() => this._onSlotChange()}></slot>\n </div>\n\n <slot name=\"post\" slot=\"post\"></slot>\n </c-input>\n </c-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const getScrollParent = (element) => {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
if (!element) {
|
|
4
|
+
resolve(undefined);
|
|
5
|
+
}
|
|
6
|
+
let parent = element.parentNode;
|
|
7
|
+
while (parent) {
|
|
8
|
+
if (parent.shadowRoot === undefined) {
|
|
9
|
+
parent = parent.host;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const { overflow, overflowX } = window.getComputedStyle(parent);
|
|
13
|
+
if (overflowX !== 'scroll' &&
|
|
14
|
+
overflow.split(' ').every((o) => o === 'auto' || o === 'scroll')) {
|
|
15
|
+
resolve(parent);
|
|
16
|
+
}
|
|
17
|
+
parent = parent.parentNode;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
resolve(document.documentElement);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { getScrollParent as g };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=getScrollParent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"getScrollParent.js","mappings":"MAAa,eAAe,GAAG,CAAC,OAAO;EACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO;IACzB,IAAI,CAAC,OAAO,EAAE;MACZ,OAAO,CAAC,SAAS,CAAC,CAAC;KACpB;IAED,IAAI,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAEhC,OAAO,MAAM,EAAE;MACb,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE;QACnC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;OACtB;WAAM;QACL,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAEhE,IACE,SAAS,KAAK,QAAQ;UACtB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,QAAQ,CAAC,EAChE;UACA,OAAO,CAAC,MAAM,CAAC,CAAC;SACjB;QAED,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;OAC5B;KACF;IAED,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;GACnC,CAAC,CAAC;AACL;;;;","names":[],"sources":["src/utils/getScrollParent.ts"],"sourcesContent":["export const getScrollParent = (element): Promise<HTMLElement> => {\n return new Promise((resolve) => {\n if (!element) {\n resolve(undefined);\n }\n\n let parent = element.parentNode;\n\n while (parent) {\n if (parent.shadowRoot === undefined) {\n parent = parent.host;\n } else {\n const { overflow, overflowX } = window.getComputedStyle(parent);\n\n if (\n overflowX !== 'scroll' &&\n overflow.split(' ').every((o) => o === 'auto' || o === 'scroll')\n ) {\n resolve(parent);\n }\n\n parent = parent.parentNode;\n }\n }\n\n resolve(document.documentElement);\n });\n};\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-45641e3d",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-d2fc8cb4",[[1,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}]]],["p-6c5e538b",[[1,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]]]]],["p-c291cbe2",[[1,"c-navigation-button"]]],["p-16098e94",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-27904068",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-862486aa",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-47ca0a95",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-7af82ab9",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-afd4cc03",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-958cf6ed",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-55cbda54",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-0569fc3e",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-d8899493",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-7ea05669",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-64bcde03",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnObject":[4,"return-object"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-0db503fb",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-fb098c2b",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-82a711fb",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-bf01d3ef",[[1,"c-alert",{"type":[1]}]]],["p-bbe8423c",[[1,"c-card-content"]]],["p-bddd9153",[[1,"c-card-title"]]],["p-4f9c92e4",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-1a1e8b4b",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-d26167bc",[[1,"c-list-item-title",{"active":[4]}]]],["p-cc31d9b2",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-baea3193",[[1,"c-login-buttons"]]],["p-88c60ba3",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-ea99cd0e",[[1,"c-login-card-content"]]],["p-98faa11d",[[1,"c-login-card-title"]]],["p-f616d1c4",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-0666f12d",[[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}]]],["p-da6a2275",[[1,"c-option-value"]]],["p-4cf4ffff",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-75798257",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-494a4f19",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-2b5cd791",[[1,"c-side-navigation-title"]]],["p-ba475561",[[1,"c-slider",{"hostId":[1,"id"],"hostName":[1,"name"],"ariaLabel":[1,"aria-label"],"max":[1],"min":[1],"step":[1],"value":[8],"unit":[1],"ticks":[4],"labels":[4],"disableTooltip":[4,"disable-tooltip"],"label":[1],"disabled":[4],"segments":[1],"trackPosition":[32],"tickPositions":[32]},null,{"segments":["onSegmentChange"],"value":["onValueChange"]}]]],["p-ff51bae3",[[1,"c-status",{"type":[1]}]]],["p-075a7c96",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-d76079eb",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-d7ca1f65",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-e6fb98a7",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-8d34efbc",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-aa930d89",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-caa58a64",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-8d5fe14f",[[1,"c-tags"]]],["p-873aa915",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-019c6898",[[1,"c-card-actions",{"align":[1],"justify":[1]}]]],["p-d1089126",[[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-csc-logo",{"width":[2]}],[1,"c-main"],[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}],[1,"c-toolbar"],[1,"c-spacer"],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-4e1d8f5d",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-2a622e79",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-e3bd1f42",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-ec167606",[[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}]]],["p-f148aad1",[[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-ae16b1f4",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-ccef8a49",[[1,"c-navigation-button"]]],["p-56b1e1ea",[[1,"c-side-navigation",{"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]]]],["p-3bb67f38",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-9c80f35e",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8]}]]],["p-c8a7a751",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-b0fa27b6",[[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}]]],["p-afd4cc03",[[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}]]],["p-6e046723",[[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"number":[4],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"messageOptions":[32]}]]],["p-55cbda54",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-468d9583",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-d8899493",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-7ea05669",[[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"statusText":[32]},null,{"validation":["onValidationMessageChange"]}]]],["p-bda722d5",[[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"items":[16],"disabled":[4],"returnObject":[4,"return-object"],"required":[4],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}]]],["p-0db503fb",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-fb098c2b",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-82a711fb",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-1d6c84df",[[1,"c-alert",{"type":[1]}]]],["p-9c5488fc",[[1,"c-csc-logo",{"width":[2]}]]],["p-4f9c92e4",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-1a1e8b4b",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-d26167bc",[[1,"c-list-item-title",{"active":[4]}]]],["p-cc31d9b2",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-baea3193",[[1,"c-login-buttons"]]],["p-88c60ba3",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-ea99cd0e",[[1,"c-login-card-content"]]],["p-98faa11d",[[1,"c-login-card-title"]]],["p-39df362b",[[1,"c-main"]]],["p-f616d1c4",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-da6a2275",[[1,"c-option-value"]]],["p-4cf4ffff",[[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}]]],["p-75798257",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-494a4f19",[[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}]]],["p-fa83a615",[[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}]]],["p-2b5cd791",[[1,"c-side-navigation-title"]]],["p-ba475561",[[1,"c-slider",{"hostId":[1,"id"],"hostName":[1,"name"],"ariaLabel":[1,"aria-label"],"max":[1],"min":[1],"step":[1],"value":[8],"unit":[1],"ticks":[4],"labels":[4],"disableTooltip":[4,"disable-tooltip"],"label":[1],"disabled":[4],"segments":[1],"trackPosition":[32],"tickPositions":[32]},null,{"segments":["onSegmentChange"],"value":["onValueChange"]}]]],["p-ff51bae3",[[1,"c-status",{"type":[1]}]]],["p-075a7c96",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-d76079eb",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-d7ca1f65",[[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}]]],["p-e6fb98a7",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-8d34efbc",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-aa930d89",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-caa58a64",[[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}]]],["p-8d5fe14f",[[1,"c-tags"]]],["p-040ed3e2",[[1,"c-toolbar"]]],["p-ee753bac",[[65,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}],[65,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]]],[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[1,"c-card-content"],[1,"c-card-title"],[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}],[1,"c-card-actions",{"align":[1],"justify":[1]}],[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-ab62f9b5",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]],["p-e3bd1f42",[[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}]]],["p-682782b1",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-b83651f8",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"itemsPerPageOptions":[16],"_currentPage":[32],"_itemsPerPage":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"],"messageOptions":[32]},[[1,"keydown","handleKeyDown"]],{"validation":["onValidationMessageChange"],"valid":["onValidChange"]}],[1,"c-spacer"]]]]'),e)));
|
|
2
2
|
//# sourceMappingURL=csc-ui.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,
|
|
1
|
+
{"version":3,"names":["patchBrowser","importMeta","url","opts","resourcesUrl","URL","href","promiseResolve","then","options","bootstrapLazy","JSON","parse"],"sources":["../../node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.7.2 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, doc, promiseResolve, H } from '@stencil/core';\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n if (importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n }\n return promiseResolve(opts);\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"mappings":"sFAKA,MAAMA,EAAe,KAajB,MAAMC,cAAyBC,IAC/B,MAAMC,EAAqE,GAC3E,GAAIF,IAAe,GAAI,CACnBE,EAAKC,aAAe,IAAIC,IAAI,IAAKJ,GAAYK,IACrD,CACI,OAAOC,EAAeJ,EAAK,ECnB/BH,IAAeQ,MAAKC,GAEXC,EAAcC,KAAAC,MAAA,08XAAuCH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,h as t,H as r}from"./p-565ec8e4.js";const a="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-toolbar-background-color:var(--c-toolbar-background-color, var(--c-white));--_c-toolbar-text-color:var(--c-toolbar-text-color, var(--c-text-system))}:host .c-toolbar{align-items:center;background:var(--_c-toolbar-background-color);box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);color:var(--_c-toolbar-text-color);column-gap:12px;display:flex;height:60px;padding-left:16px;padding-right:16px;position:fixed;width:100%;z-index:9}:host .spacer{height:60px;width:100%}:host(.relative) .c-toolbar{position:relative;margin-bottom:-60px}";const l=class{constructor(t){o(this,t)}render(){return t(r,null,t("div",{class:"c-toolbar"},t("slot",null)),t("div",{class:"spacer"}))}};l.style=a;export{l as c_toolbar};
|
|
2
|
+
//# sourceMappingURL=p-040ed3e2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cToolbarCss","CToolbar","render","h","Host","class"],"sources":["src/components/c-toolbar/c-toolbar.scss?tag=c-toolbar&encapsulation=shadow","src/components/c-toolbar/c-toolbar.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-toolbar-background-color: Toolbar background color\n * @prop --c-toolbar-text-color: Toolbar text color\n */\n --_c-toolbar-background-color: var(--c-toolbar-background-color, var(--c-white));\n --_c-toolbar-text-color: var(--c-toolbar-text-color, var(--c-text-system));\n\n .c-toolbar {\n align-items: center;\n background: var(--_c-toolbar-background-color);\n box-shadow: 2px 4px 10px #00000029;\n color: var(--_c-toolbar-text-color);\n column-gap: 12px;\n display: flex;\n height: 60px;\n padding-left: 16px;\n padding-right: 16px;\n position: fixed;\n width: 100%;\n z-index: 9;\n }\n\n .spacer {\n height: 60px;\n width: 100%;\n }\n}\n\n:host(.relative) .c-toolbar {\n position: relative;\n margin-bottom: -60px;\n}\n","import { Component, Host, h } from '@stencil/core';\n/**\n * @group Navigation\n * @slot Default slot - Content of toolbar\n */\n@Component({\n tag: 'c-toolbar',\n styleUrl: 'c-toolbar.scss',\n shadow: true,\n})\nexport class CToolbar {\n render() {\n return (\n <Host>\n <div class=\"c-toolbar\">\n <slot></slot>\n </div>\n <div class=\"spacer\"></div>\n </Host>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAc,+sB,MCUPC,EAAQ,M,yBACnB,MAAAC,GACE,OACEC,EAACC,EAAI,KACHD,EAAA,OAAKE,MAAM,aACTF,EAAA,cAEFA,EAAA,OAAKE,MAAM,W"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r,h as t,H as e}from"./p-565ec8e4.js";import{
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r,h as t,H as e}from"./p-565ec8e4.js";import{d as o,e as a,g as l,h as c}from"./p-f24b9d97.js";const s="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}.c-alert{--c-alert-color:var(--c-primary-600);display:grid;gap:16px;grid-template-columns:1fr;color:var(--c-alert-color);border:2px solid currentColor;border-left-width:12px;border-radius:6px;padding:12px}.c-alert--info,.c-alert--error,.c-alert--success,.c-alert--warning{grid-template-columns:auto 1fr}.c-alert--info{--c-alert-color:var(--c-info-600)}.c-alert--error{--c-alert-color:var(--c-error-600)}.c-alert--success{--c-alert-color:var(--c-success-600)}.c-alert--warning{--c-alert-color:var(--c-warning-600)}.c-alert__content{color:rgba(0, 0, 0, 0.87);display:grid;align-items:center;grid-template-columns:1fr;gap:8px}svg{fill:currentColor}::slotted(*[slot=title]){margin:0 !important;font-size:18px;font-weight:600;line-height:24px}";const i=class{constructor(t){r(this,t);this._icons={warning:o,error:a,success:l,info:c};this.type=undefined}render(){const r=Object.assign({"c-alert":true},!!this.type&&{[`c-alert--${this.type}`]:true});return t(e,null,t("div",{class:r},!!this.type&&t("svg",{width:"22",height:"22",viewBox:"0 0 24 24"},t("path",{d:this._icons[this.type]})),t("div",{class:"c-alert__content"},t("slot",{name:"title"}),t("slot",null))))}};i.style=s;export{i as c_alert};
|
|
2
|
+
//# sourceMappingURL=p-1d6c84df.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as o,h as r}from"./p-565ec8e4.js";const t="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-main-background-color:var(--c-main-background-color, var(--c-primary-200));--_c-main-text-color:var(--c-main-text-color, var(--c-text-body));background:var(--_c-main-background-color);color:var(--_c-main-text-color);display:flex;flex-direction:column;height:100vh}:host ::slotted(*){color:var(--_c-main-text-color)}";const a=class{constructor(r){o(this,r)}render(){return r("main",null,r("slot",null))}};a.style=t;export{a as c_main};
|
|
2
|
+
//# sourceMappingURL=p-39df362b.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cMainCss","CMain","render","h"],"sources":["src/components/c-main/c-main.scss?tag=c-main&encapsulation=shadow","src/components/c-main/c-main.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-main-background-color: Background color\n * @prop --c-main-text-color: Text color\n */\n --_c-main-background-color: var(--c-main-background-color, var(--c-primary-200));\n --_c-main-text-color: var(--c-main-text-color, var(--c-text-body));\n\n background: var(--_c-main-background-color);\n color: var(--_c-main-text-color);\n display: flex;\n flex-direction: column;\n height: 100vh;\n\n ::slotted(*) {\n color: var(--_c-main-text-color);\n }\n}\n","import { Component, h } from '@stencil/core';\n/**\n * Wrapper component for the whole page\n *\n * @group Layout\n * @slot Default slot - Contents of the page\n */\n@Component({\n tag: 'c-main',\n styleUrl: 'c-main.scss',\n shadow: true,\n})\nexport class CMain {\n render() {\n return (\n <main>\n <slot></slot>\n </main>\n );\n }\n}\n"],"mappings":"2CAAA,MAAMA,EAAW,mf,MCYJC,EAAK,M,yBAChB,MAAAC,GACE,OACEC,EAAA,YACEA,EAAA,a"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,H as a,g as e}from"./p-565ec8e4.js";import{p as o,o as c}from"./p-5461ca29.js";const n='html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(.c-tabs){--_c-tabs-border-color:var(--c-tabs-border-color, var(--c-tertiary-200));--_c-tabs-indicator-color:var(--c-tabs-indicator-color, var(--c-primary-600));--_c-tabs-transition-speed:0.001ms;display:block;width:100%;transform:translateX(0%);max-width:100%}:host(.c-tabs) .c-tabs__container{display:grid;grid-template-columns:1fr;align-items:center;gap:4px;--c-icon-button-border-radius:4px}:host(.c-tabs) .c-tabs__tabs{display:flex;overflow:hidden;padding:4px;position:relative;margin:-4px}:host(.c-tabs) .c-tabs__tabs::after{position:absolute;content:"";bottom:4px;inset-inline:0;height:1px;background-color:var(--_c-tabs-border-color)}:host(.c-tabs) .c-tabs__scroll{transform:translateX(var(--_c-tabs-scroll-position-x));transition:transform var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);display:flex;margin:0;padding:0;position:relative;flex-grow:1}:host(.c-tabs) .c-tabs__scroll::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;scale:var(--_c-tabs-indicator-width, 0.125) 1;opacity:0.01;translate:var(--_c-tabs-indicator-left, 0) 0;transform-origin:left;transition:scale var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1), translate var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);background:var(--_c-tabs-indicator-color)}:host(.c-tabs) .c-tabs__content{display:flex}:host(.c-tabs) ::slotted(c-tab-buttons){flex-grow:1}:host(.c-tabs.c-tabs--justify-start:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-start:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) .c-tabs__scroll{justify-content:end}:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) .c-tabs__scroll{justify-content:center}:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--vertical.c-tabs--mobile){grid-template-columns:1fr}:host(.c-tabs.c-tabs--vertical){display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr}:host(.c-tabs.c-tabs--vertical) .c-tabs__tabs::after{display:none}:host(.c-tabs.c-tabs--vertical) ::slotted(c-tab-items){position:relative;min-height:100%}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll{display:grid;max-width:100%}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll::after{display:none}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll::before{content:"";position:absolute;width:4px;top:0;bottom:0;right:0;scale:1 var(--_c-tabs-indicator-width, 0.125);opacity:0.01;translate:0 var(--_c-tabs-indicator-top, 0);transform-origin:top left;transition:scale var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1), translate var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);background:var(--_c-tabs-indicator-color)}:host(.c-tabs.c-tabs--vertical) ::slotted(c-tab){box-shadow:inset -1px 0 0 0 var(--_c-tabs-border-color);padding-inline:24px;justify-content:start;max-width:100%;min-width:100%}:host(.c-tabs.c-tabs--buttons) .c-tabs__tabs::after,:host(.c-tabs.c-tabs--buttons) .c-tabs__scroll::after{display:none}:host(.c-tabs--borderless) ::slotted(c-tab){box-shadow:none}:host(.c-tabs.c-tabs--initialized) .c-tabs__scroll::after{opacity:1}:host(.c-tabs.c-tabs--initialized) .c-tabs__scroll::before{opacity:1}:host(.c-tabs.c-tabs--overflow) .c-tabs__container{grid-template-columns:auto 1fr auto}';var r;(function(t){t[t["Left"]=2]="Left";t[t["Right"]=4]="Right"})(r||(r={}));const h=class{constructor(i){t(this,i);this.changeValue=s(this,"changeValue",3);this._initialized=false;this._debounce=null;this._moveDebounce=null;this._isDirty=false;this._focusedTabValue=this.value;this._intersectionObserver=new IntersectionObserver((([t])=>{if(t.isIntersecting){setTimeout((()=>{this._handleOverflow()}),1e3)}}),{threshold:1});this._previousWidth=0;this._maxScrollOffset=0;this._startX=0;this._touchOffset=0;this.value=undefined;this.borderless=false;this.disableAnimation=false;this.justify="stretch";this.mobileBreakpoint=640;this.vertical=false;this.isOverflowing=false;this.isMobile=false;this.scrollOffset=0}onJustificationChange(){this._handleActiveTab()}onExternalValueChange(){this._handleActiveTab();this.changeValue.emit(this.value)}tabFocusHandler(t){t.stopPropagation();this._focusedTabValue=t.detail}tabChangeHandler(t){t.stopPropagation();this.value=t.detail.value;this._updateItemsValue()}handleKeyDown(t){if(!this.tabs.includes(t.target)||t.target.disabled)return;if(t.key==="Enter"||t.code==="Space"){this.value=t.target.value}}handleKeyUp(t){this._isDirty=true;if(!this.tabs.includes(t.target))return;const s=t.key==="ArrowLeft";const i=t.key==="ArrowRight";if(!i&&!s)return;const a=this._getTabIndex(this._focusedTabValue);const e=this.availableValues.at(0);const o=this.availableValues.at(-1);const c=this._focusedTabValue===e;const n=this._focusedTabValue===o;const r=n?e:this.availableValues[a+1];const h=c?o:this.availableValues[a-1];if(s){if(c)return;this._focusTab(h)}if(i){if(n)return;this._focusTab(r)}}get _prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||this.disableAnimation}get _tabItems(){return this.el.querySelector(":scope > c-tab-items")}get _tabButtons(){return this.el.querySelector(":scope > c-tab-buttons")}_updateItemsValue(){this.tabItems.value=this.value;if(this._tabButtons){this._tabButtons.value=this.value}}componentWillLoad(){h._uniqueId+=1;this._tabItems.disableAnimation=this._prefersReducedMotion;if(this._tabButtons){this.el.classList.add("c-tabs--buttons");this._tabButtons.setAttribute("tabs","true")}this._updateItemsValue()}componentDidLoad(){this._resizeObserver=new ResizeObserver((t=>{this._handleResize(t[0].contentRect.width)}));this._resizeObserver.observe(this.el);this._intersectionObserver.observe(this.el);this.el.style.setProperty("--_c-tabs-count",this.setsize.toString());requestAnimationFrame((()=>{this._handleOverflow()}))}disconnectedCallback(){this._intersectionObserver.disconnect()}get tabs(){if(!!this._tabButtons){return Array.from(this._tabButtons.querySelectorAll(":scope > c-button"))}return Array.from(this.el.querySelectorAll(":scope > c-tab"))}get tabItems(){return this.el.querySelector("c-tab-items")}get setsize(){return this.tabs.length}get availableValues(){return this.tabs.map((t=>t.value))}_getTabIndex(t){return this.availableValues.findIndex((s=>s===t))}_setIndicatorTop(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-top",`${t}px`)}_setIndicatorLeft(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-left",`${t}px`)}_setIndicatorWidth(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-width",t.toString())}_handleActiveTab(){requestAnimationFrame((()=>{var t;let s=0;const i=(t=this.el.querySelector('[aria-selected="true"]'))!==null&&t!==void 0?t:this.tabs[0];this.tabs.forEach(((t,a)=>{if(!t.disabled){s+=1}const e=t.value===this.value;const o=`c-tab-${h._uniqueId}-${a+1}`;const c=`c-tab-item-${h._uniqueId}-${a+1}`;t.setAttribute("id",o);t.setAttribute("aria-controls",c);if(!this._tabButtons){t.active=e}else if(e){this._tabButtons.value=t.value}const n=Array.from(this.tabItems.querySelectorAll(":scope > c-tab-item")).find((s=>s.value===t.value));n.setAttribute("disabled",(!!t.disabled).toString());n.setAttribute("id",c);n.setAttribute("aria-labelledby",o);n.active=e;n.setAttribute("active",e.toString());if(!t.disabled){t.setAttribute("aria-posinset",s.toString());t.setAttribute("setsize",this.availableValues.length.toString())}if(e&&!this._tabButtons){this._moveIndicator(i,t);requestAnimationFrame((()=>{if(!this.isOverflowing)return;const t=this.el.querySelector('c-tab[aria-selected="true"]');this._moveToTab(t);this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","200ms")}))}if(e&&this._isDirty){t.focus()}}))}))}_getDimensions(t){const{x:s,width:i}=t.getBoundingClientRect();const{x:a,width:e}=this._tabsTabsElement.getBoundingClientRect();const{x:o,width:c}=this._tabsScrollElement.getBoundingClientRect();return{x:s,width:i,containerWidth:e,containerX:a,scrollerX:o,scrollerWidth:c}}_focusTab(t){if(this._tabButtons){return}requestAnimationFrame((()=>{const s=this.tabs.find((s=>s.value===t));const{x:i,width:a,containerX:e,containerWidth:o}=this._getDimensions(s);const c=i>=e&&i+a<=e+o;if(c){s===null||s===void 0?void 0:s.focus();return}this._moveToTab(s)}))}_handleResize(t){if(this._moveDebounce!==null)return;if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=setTimeout((()=>{const s=this.el.shadowRoot.querySelector(".c-tabs__scroll");const i=this.el.shadowRoot.querySelector(".c-tabs__tabs");requestAnimationFrame((()=>{if(t===this._previousWidth)return;this._handleOverflow();this.isMobile=t<this.mobileBreakpoint;this._maxScrollOffset=-1*(s.scrollWidth-i.clientWidth);this._handleActiveTab();this._previousWidth=t}))}),200)}_moveIndicator(t,s){if(this._moveDebounce!==null)return;this._moveDebounce=setTimeout((()=>{requestAnimationFrame((()=>{const i=this.el.shadowRoot.querySelector(".c-tabs__scroll");const a=this.el.shadowRoot.querySelector(".c-tabs__tabs");if(this._initialized&&!this._prefersReducedMotion){a.style.setProperty("--_c-tabs-transition-speed","200ms")}const e=this.isOverflowing?32:0;const o=s.offsetWidth/i.offsetWidth;const c=this.vertical?s.offsetHeight/i.offsetHeight:s.offsetHeight/i.offsetHeight;const n=t.compareDocumentPosition(s);let h=0;if(n===r.Right){h=this.vertical?s.offsetTop+s.offsetHeight-t.offsetTop:s.offsetLeft+s.offsetWidth-t.offsetLeft}else{h=this.vertical?t.offsetTop+t.offsetHeight-s.offsetTop:t.offsetLeft+t.offsetWidth-s.offsetLeft;this._setIndicatorLeft(s.offsetLeft-e);this._setIndicatorTop(s.offsetTop-e)}this._setIndicatorWidth(this.vertical?h/i.offsetHeight:h/i.offsetWidth);const l=t=>{if(t.propertyName!=="scale")return;this._setIndicatorLeft(s.offsetLeft-e);this._setIndicatorTop(s.offsetTop-e);this._setIndicatorWidth(this.vertical?c:o);i.removeEventListener("transitionend",l);if(!this._initialized){this.el.classList.add("c-tabs--initialized")}this._initialized=true};i.addEventListener("transitionend",l)}));clearTimeout(this._moveDebounce);this._moveDebounce=null}),200)}onScrollOffsetChange(t){this._tabsTabsElement.style.setProperty("--_c-tabs-scroll-position-x",`${t}px`)}_handleOverflow(){if(this._tabButtons){this.isOverflowing=false;return}const t=this.el.shadowRoot.querySelector(".c-tabs__scroll");const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");const i=t.scrollWidth;const a=s.clientWidth;this.isOverflowing=a+1<i}_onTouchEnd(){this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","200ms")}_onTouchMove(t){if(this.vertical)return;t.preventDefault();this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","0ms");const s=-1*(this._touchOffset+this._startX-t.touches[0].clientX);const i=s<=0&&s>=this._maxScrollOffset;if(i){this.scrollOffset=s}else if(s>0||!this.isOverflowing){this.scrollOffset=0}else if(s<this._maxScrollOffset){this.scrollOffset=this._maxScrollOffset}}_onTouchStart(t){this._handleOverflow();if(!this.isOverflowing)return;this._touchOffset=this.scrollOffset*-1;this._startX=t.touches[0].clientX}_onBackClick(){const t=0;const s=this._tabsTabsElement.clientWidth/2;this.scrollOffset=Math.min(this.scrollOffset+s,t)}_onForwardClick(){const t=(this._tabsScrollElement.scrollWidth-this._tabsTabsElement.clientWidth)*-1;const s=this._tabsTabsElement.clientWidth/2;this.scrollOffset=Math.max(-1*s+this.scrollOffset,t)}_moveToTab(t){const s=()=>{t===null||t===void 0?void 0:t.focus();this._tabsScrollElement.removeEventListener("transitionend",s)};requestAnimationFrame((()=>{const s=this._getTabIndex(t.dataset.value);const i=s===0;const a=s===this.availableValues.length-1;if(i){this.scrollOffset=0;return}if(a){this.scrollOffset=this._maxScrollOffset-8;return}const{x:e,width:o,containerWidth:c,containerX:n}=this._getDimensions(t);const r=e+o;const h=n+c;const l=e<n;const b=r>h;if(l){const t=r-n;const s=t-o;this.scrollOffset=this.scrollOffset-s+4}if(b){this.scrollOffset-=r-h+4}}));const i=this.el.shadowRoot.querySelector(".c-tabs__scroll");i.addEventListener("transitionend",s)}render(){const t={"c-tabs":true,"c-tabs--borderless":this.borderless,"c-tabs--vertical":this.vertical,"c-tabs--overflow":this.isOverflowing,"c-tabs--mobile":this.isMobile,[`c-tabs--justify-${this.justify}`]:true};return i(a,{role:"tablist",class:t},i("div",{class:"c-tabs__container"},this.isOverflowing&&!this.vertical&&i("c-icon-button",{size:"x-small",ghost:true,onClick:this._onBackClick.bind(this)},i("c-icon",{path:o})),i("div",{ref:t=>this._tabsTabsElement=t,class:"c-tabs__tabs",onTouchStart:this._onTouchStart.bind(this),onTouchMove:this._onTouchMove.bind(this),onTouchEnd:this._onTouchEnd.bind(this)},i("div",{ref:t=>this._tabsScrollElement=t,class:"c-tabs__scroll"},i("slot",null))),this.isOverflowing&&!this.vertical&&i("c-icon-button",{size:"x-small",ghost:true,onClick:this._onForwardClick.bind(this)},i("c-icon",{path:c}))),i("div",{class:"c-tabs__content"},i("slot",{name:"items"})))}get el(){return e(this)}static get watchers(){return{justify:["onJustificationChange"],value:["onExternalValueChange"],scrollOffset:["onScrollOffsetChange"]}}};h._uniqueId=0;h.style=n;export{h as c_tabs};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,H as a,g as e}from"./p-565ec8e4.js";import{p as o,o as c}from"./p-f24b9d97.js";const n='html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(.c-tabs){--_c-tabs-border-color:var(--c-tabs-border-color, var(--c-tertiary-200));--_c-tabs-indicator-color:var(--c-tabs-indicator-color, var(--c-primary-600));--_c-tabs-transition-speed:0.001ms;display:block;width:100%;transform:translateX(0%);max-width:100%}:host(.c-tabs) .c-tabs__container{display:grid;grid-template-columns:1fr;align-items:center;gap:4px;--c-icon-button-border-radius:4px}:host(.c-tabs) .c-tabs__tabs{display:flex;overflow:hidden;padding:4px;position:relative;margin:-4px}:host(.c-tabs) .c-tabs__tabs::after{position:absolute;content:"";bottom:4px;inset-inline:0;height:1px;background-color:var(--_c-tabs-border-color)}:host(.c-tabs) .c-tabs__scroll{transform:translateX(var(--_c-tabs-scroll-position-x));transition:transform var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);display:flex;margin:0;padding:0;position:relative;flex-grow:1}:host(.c-tabs) .c-tabs__scroll::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;scale:var(--_c-tabs-indicator-width, 0.125) 1;opacity:0.01;translate:var(--_c-tabs-indicator-left, 0) 0;transform-origin:left;transition:scale var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1), translate var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);background:var(--_c-tabs-indicator-color)}:host(.c-tabs) .c-tabs__content{display:flex}:host(.c-tabs) ::slotted(c-tab-buttons){flex-grow:1}:host(.c-tabs.c-tabs--justify-start:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-start:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) .c-tabs__scroll{justify-content:end}:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-end:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) .c-tabs__scroll{justify-content:center}:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) ::slotted(c-tab-buttons),:host(.c-tabs.c-tabs--justify-center:not(.c-tabs--vertical)) ::slotted(c-tab){flex-grow:0}:host(.c-tabs.c-tabs--vertical.c-tabs--mobile){grid-template-columns:1fr}:host(.c-tabs.c-tabs--vertical){display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr}:host(.c-tabs.c-tabs--vertical) .c-tabs__tabs::after{display:none}:host(.c-tabs.c-tabs--vertical) ::slotted(c-tab-items){position:relative;min-height:100%}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll{display:grid;max-width:100%}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll::after{display:none}:host(.c-tabs.c-tabs--vertical) .c-tabs__scroll::before{content:"";position:absolute;width:4px;top:0;bottom:0;right:0;scale:1 var(--_c-tabs-indicator-width, 0.125);opacity:0.01;translate:0 var(--_c-tabs-indicator-top, 0);transform-origin:top left;transition:scale var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1), translate var(--_c-tabs-transition-speed) cubic-bezier(0.075, 0.82, 0.165, 1);background:var(--_c-tabs-indicator-color)}:host(.c-tabs.c-tabs--vertical) ::slotted(c-tab){box-shadow:inset -1px 0 0 0 var(--_c-tabs-border-color);padding-inline:24px;justify-content:start;max-width:100%;min-width:100%}:host(.c-tabs.c-tabs--buttons) .c-tabs__tabs::after,:host(.c-tabs.c-tabs--buttons) .c-tabs__scroll::after{display:none}:host(.c-tabs--borderless) ::slotted(c-tab){box-shadow:none}:host(.c-tabs.c-tabs--initialized) .c-tabs__scroll::after{opacity:1}:host(.c-tabs.c-tabs--initialized) .c-tabs__scroll::before{opacity:1}:host(.c-tabs.c-tabs--overflow) .c-tabs__container{grid-template-columns:auto 1fr auto}';var r;(function(t){t[t["Left"]=2]="Left";t[t["Right"]=4]="Right"})(r||(r={}));const h=class{constructor(i){t(this,i);this.changeValue=s(this,"changeValue",3);this._initialized=false;this._debounce=null;this._moveDebounce=null;this._isDirty=false;this._focusedTabValue=this.value;this._intersectionObserver=new IntersectionObserver((([t])=>{if(t.isIntersecting){setTimeout((()=>{this._handleOverflow()}),1e3)}}),{threshold:1});this._previousWidth=0;this._maxScrollOffset=0;this._startX=0;this._touchOffset=0;this.value=undefined;this.borderless=false;this.disableAnimation=false;this.justify="stretch";this.mobileBreakpoint=640;this.vertical=false;this.isOverflowing=false;this.isMobile=false;this.scrollOffset=0}onJustificationChange(){this._handleActiveTab()}onExternalValueChange(){this._handleActiveTab();this.changeValue.emit(this.value)}tabFocusHandler(t){t.stopPropagation();this._focusedTabValue=t.detail}tabChangeHandler(t){t.stopPropagation();this.value=t.detail.value;this._updateItemsValue()}handleKeyDown(t){if(!this.tabs.includes(t.target)||t.target.disabled)return;if(t.key==="Enter"||t.code==="Space"){this.value=t.target.value}}handleKeyUp(t){this._isDirty=true;if(!this.tabs.includes(t.target))return;const s=t.key==="ArrowLeft";const i=t.key==="ArrowRight";if(!i&&!s)return;const a=this._getTabIndex(this._focusedTabValue);const e=this.availableValues.at(0);const o=this.availableValues.at(-1);const c=this._focusedTabValue===e;const n=this._focusedTabValue===o;const r=n?e:this.availableValues[a+1];const h=c?o:this.availableValues[a-1];if(s){if(c)return;this._focusTab(h)}if(i){if(n)return;this._focusTab(r)}}get _prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||this.disableAnimation}get _tabItems(){return this.el.querySelector(":scope > c-tab-items")}get _tabButtons(){return this.el.querySelector(":scope > c-tab-buttons")}_updateItemsValue(){this.tabItems.value=this.value;if(this._tabButtons){this._tabButtons.value=this.value}}componentWillLoad(){h._uniqueId+=1;this._tabItems.disableAnimation=this._prefersReducedMotion;if(this._tabButtons){this.el.classList.add("c-tabs--buttons");this._tabButtons.setAttribute("tabs","true")}this._updateItemsValue()}componentDidLoad(){this._resizeObserver=new ResizeObserver((t=>{this._handleResize(t[0].contentRect.width)}));this._resizeObserver.observe(this.el);this._intersectionObserver.observe(this.el);this.el.style.setProperty("--_c-tabs-count",this.setsize.toString());requestAnimationFrame((()=>{this._handleOverflow()}))}disconnectedCallback(){this._intersectionObserver.disconnect()}get tabs(){if(!!this._tabButtons){return Array.from(this._tabButtons.querySelectorAll(":scope > c-button"))}return Array.from(this.el.querySelectorAll(":scope > c-tab"))}get tabItems(){return this.el.querySelector("c-tab-items")}get setsize(){return this.tabs.length}get availableValues(){return this.tabs.map((t=>t.value))}_getTabIndex(t){return this.availableValues.findIndex((s=>s===t))}_setIndicatorTop(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-top",`${t}px`)}_setIndicatorLeft(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-left",`${t}px`)}_setIndicatorWidth(t){const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");s.style.setProperty("--_c-tabs-indicator-width",t.toString())}_handleActiveTab(){requestAnimationFrame((()=>{var t;let s=0;const i=(t=this.el.querySelector('[aria-selected="true"]'))!==null&&t!==void 0?t:this.tabs[0];this.tabs.forEach(((t,a)=>{if(!t.disabled){s+=1}const e=t.value===this.value;const o=`c-tab-${h._uniqueId}-${a+1}`;const c=`c-tab-item-${h._uniqueId}-${a+1}`;t.setAttribute("id",o);t.setAttribute("aria-controls",c);if(!this._tabButtons){t.active=e}else if(e){this._tabButtons.value=t.value}const n=Array.from(this.tabItems.querySelectorAll(":scope > c-tab-item")).find((s=>s.value===t.value));n.setAttribute("disabled",(!!t.disabled).toString());n.setAttribute("id",c);n.setAttribute("aria-labelledby",o);n.active=e;n.setAttribute("active",e.toString());if(!t.disabled){t.setAttribute("aria-posinset",s.toString());t.setAttribute("setsize",this.availableValues.length.toString())}if(e&&!this._tabButtons){this._moveIndicator(i,t);requestAnimationFrame((()=>{if(!this.isOverflowing)return;const t=this.el.querySelector('c-tab[aria-selected="true"]');this._moveToTab(t);this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","200ms")}))}if(e&&this._isDirty){t.focus()}}))}))}_getDimensions(t){const{x:s,width:i}=t.getBoundingClientRect();const{x:a,width:e}=this._tabsTabsElement.getBoundingClientRect();const{x:o,width:c}=this._tabsScrollElement.getBoundingClientRect();return{x:s,width:i,containerWidth:e,containerX:a,scrollerX:o,scrollerWidth:c}}_focusTab(t){if(this._tabButtons){return}requestAnimationFrame((()=>{const s=this.tabs.find((s=>s.value===t));const{x:i,width:a,containerX:e,containerWidth:o}=this._getDimensions(s);const c=i>=e&&i+a<=e+o;if(c){s===null||s===void 0?void 0:s.focus();return}this._moveToTab(s)}))}_handleResize(t){if(this._moveDebounce!==null)return;if(this._debounce!==null){clearTimeout(this._debounce);this._debounce=null}this._debounce=setTimeout((()=>{const s=this.el.shadowRoot.querySelector(".c-tabs__scroll");const i=this.el.shadowRoot.querySelector(".c-tabs__tabs");requestAnimationFrame((()=>{if(t===this._previousWidth)return;this._handleOverflow();this.isMobile=t<this.mobileBreakpoint;this._maxScrollOffset=-1*(s.scrollWidth-i.clientWidth);this._handleActiveTab();this._previousWidth=t}))}),200)}_moveIndicator(t,s){if(this._moveDebounce!==null)return;this._moveDebounce=setTimeout((()=>{requestAnimationFrame((()=>{const i=this.el.shadowRoot.querySelector(".c-tabs__scroll");const a=this.el.shadowRoot.querySelector(".c-tabs__tabs");if(this._initialized&&!this._prefersReducedMotion){a.style.setProperty("--_c-tabs-transition-speed","200ms")}const e=this.isOverflowing?32:0;const o=s.offsetWidth/i.offsetWidth;const c=this.vertical?s.offsetHeight/i.offsetHeight:s.offsetHeight/i.offsetHeight;const n=t.compareDocumentPosition(s);let h=0;if(n===r.Right){h=this.vertical?s.offsetTop+s.offsetHeight-t.offsetTop:s.offsetLeft+s.offsetWidth-t.offsetLeft}else{h=this.vertical?t.offsetTop+t.offsetHeight-s.offsetTop:t.offsetLeft+t.offsetWidth-s.offsetLeft;this._setIndicatorLeft(s.offsetLeft-e);this._setIndicatorTop(s.offsetTop-e)}this._setIndicatorWidth(this.vertical?h/i.offsetHeight:h/i.offsetWidth);const l=t=>{if(t.propertyName!=="scale")return;this._setIndicatorLeft(s.offsetLeft-e);this._setIndicatorTop(s.offsetTop-e);this._setIndicatorWidth(this.vertical?c:o);i.removeEventListener("transitionend",l);if(!this._initialized){this.el.classList.add("c-tabs--initialized")}this._initialized=true};i.addEventListener("transitionend",l)}));clearTimeout(this._moveDebounce);this._moveDebounce=null}),200)}onScrollOffsetChange(t){this._tabsTabsElement.style.setProperty("--_c-tabs-scroll-position-x",`${t}px`)}_handleOverflow(){if(this._tabButtons){this.isOverflowing=false;return}const t=this.el.shadowRoot.querySelector(".c-tabs__scroll");const s=this.el.shadowRoot.querySelector(".c-tabs__tabs");const i=t.scrollWidth;const a=s.clientWidth;this.isOverflowing=a+1<i}_onTouchEnd(){this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","200ms")}_onTouchMove(t){if(this.vertical)return;t.preventDefault();this._tabsTabsElement.style.setProperty("--_c-tabs-transition-speed","0ms");const s=-1*(this._touchOffset+this._startX-t.touches[0].clientX);const i=s<=0&&s>=this._maxScrollOffset;if(i){this.scrollOffset=s}else if(s>0||!this.isOverflowing){this.scrollOffset=0}else if(s<this._maxScrollOffset){this.scrollOffset=this._maxScrollOffset}}_onTouchStart(t){this._handleOverflow();if(!this.isOverflowing)return;this._touchOffset=this.scrollOffset*-1;this._startX=t.touches[0].clientX}_onBackClick(){const t=0;const s=this._tabsTabsElement.clientWidth/2;this.scrollOffset=Math.min(this.scrollOffset+s,t)}_onForwardClick(){const t=(this._tabsScrollElement.scrollWidth-this._tabsTabsElement.clientWidth)*-1;const s=this._tabsTabsElement.clientWidth/2;this.scrollOffset=Math.max(-1*s+this.scrollOffset,t)}_moveToTab(t){const s=()=>{t===null||t===void 0?void 0:t.focus();this._tabsScrollElement.removeEventListener("transitionend",s)};requestAnimationFrame((()=>{const s=this._getTabIndex(t.dataset.value);const i=s===0;const a=s===this.availableValues.length-1;if(i){this.scrollOffset=0;return}if(a){this.scrollOffset=this._maxScrollOffset-8;return}const{x:e,width:o,containerWidth:c,containerX:n}=this._getDimensions(t);const r=e+o;const h=n+c;const l=e<n;const b=r>h;if(l){const t=r-n;const s=t-o;this.scrollOffset=this.scrollOffset-s+4}if(b){this.scrollOffset-=r-h+4}}));const i=this.el.shadowRoot.querySelector(".c-tabs__scroll");i.addEventListener("transitionend",s)}render(){const t={"c-tabs":true,"c-tabs--borderless":this.borderless,"c-tabs--vertical":this.vertical,"c-tabs--overflow":this.isOverflowing,"c-tabs--mobile":this.isMobile,[`c-tabs--justify-${this.justify}`]:true};return i(a,{role:"tablist",class:t},i("div",{class:"c-tabs__container"},this.isOverflowing&&!this.vertical&&i("c-icon-button",{size:"x-small",ghost:true,onClick:this._onBackClick.bind(this)},i("c-icon",{path:o})),i("div",{ref:t=>this._tabsTabsElement=t,class:"c-tabs__tabs",onTouchStart:this._onTouchStart.bind(this),onTouchMove:this._onTouchMove.bind(this),onTouchEnd:this._onTouchEnd.bind(this)},i("div",{ref:t=>this._tabsScrollElement=t,class:"c-tabs__scroll"},i("slot",null))),this.isOverflowing&&!this.vertical&&i("c-icon-button",{size:"x-small",ghost:true,onClick:this._onForwardClick.bind(this)},i("c-icon",{path:c}))),i("div",{class:"c-tabs__content"},i("slot",{name:"items"})))}get el(){return e(this)}static get watchers(){return{justify:["onJustificationChange"],value:["onExternalValueChange"],scrollOffset:["onScrollOffsetChange"]}}};h._uniqueId=0;h.style=n;export{h as c_tabs};
|
|
2
|
+
//# sourceMappingURL=p-3bb67f38.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=e=>new Promise((o=>{if(!e){o(undefined)}let l=e.parentNode;while(l){if(l.shadowRoot===undefined){l=l.host}else{const{overflow:e,overflowX:n}=window.getComputedStyle(l);if(n!=="scroll"&&e.split(" ").every((e=>e==="auto"||e==="scroll"))){o(l)}l=l.parentNode}}o(document.documentElement)}));export{e as g};
|
|
2
|
+
//# sourceMappingURL=p-3f0e51ff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getScrollParent","element","Promise","resolve","undefined","parent","parentNode","shadowRoot","host","overflow","overflowX","window","getComputedStyle","split","every","o","document","documentElement"],"sources":["src/utils/getScrollParent.ts"],"sourcesContent":["export const getScrollParent = (element): Promise<HTMLElement> => {\n return new Promise((resolve) => {\n if (!element) {\n resolve(undefined);\n }\n\n let parent = element.parentNode;\n\n while (parent) {\n if (parent.shadowRoot === undefined) {\n parent = parent.host;\n } else {\n const { overflow, overflowX } = window.getComputedStyle(parent);\n\n if (\n overflowX !== 'scroll' &&\n overflow.split(' ').every((o) => o === 'auto' || o === 'scroll')\n ) {\n resolve(parent);\n }\n\n parent = parent.parentNode;\n }\n }\n\n resolve(document.documentElement);\n });\n};\n"],"mappings":"MAAaA,EAAmBC,GACvB,IAAIC,SAASC,IAClB,IAAKF,EAAS,CACZE,EAAQC,U,CAGV,IAAIC,EAASJ,EAAQK,WAErB,MAAOD,EAAQ,CACb,GAAIA,EAAOE,aAAeH,UAAW,CACnCC,EAASA,EAAOG,I,KACX,CACL,MAAMC,SAAEA,EAAQC,UAAEA,GAAcC,OAAOC,iBAAiBP,GAExD,GACEK,IAAc,UACdD,EAASI,MAAM,KAAKC,OAAOC,GAAMA,IAAM,QAAUA,IAAM,WACvD,CACAZ,EAAQE,E,CAGVA,EAASA,EAAOC,U,EAIpBH,EAAQa,SAASC,gBAAgB,W"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,c as o,h as t,H as e,g as c}from"./p-565ec8e4.js";import{
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,c as o,h as t,H as e,g as c}from"./p-565ec8e4.js";import{f as r}from"./p-f24b9d97.js";const a="html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-accordion-item-header-background-color:var(--c-accordion-item-header-background-color, var(--c-primary-200));--_c-accordion-item-outline-color:var(--c-accordion-item-outline-color, var(--c-primary-600));--_c-accordion-item-text-color:var(--c-accordion-item-text-color, var(--c-primary-600));max-width:100%}:host summary::-webkit-details-marker{display:none}.c-accordion-item{--_c-accordion-item-indicator-rotation:rotate(0deg);--_c-accordion-item-content-height:0;--_c-accordion-item-min-height:46px;--_c-accordion-item-border-radius:6px;--_c-accordion-item-padding:12px;--_c-accordion-item-overflow:visible;--_c-accordion-item-outline-color-offset:2px;display:block;overflow:var(--_c-accordion-item-overflow)}.c-accordion-item--expanding{--_c-accordion-item-overflow:hidden !important;--_c-accordion-item-outline-color:transparent}.c-accordion-item--expanded{--_c-accordion-item-content-height:auto;--_c-accordion-item-indicator-rotation:rotate(90deg);--_c-accordion-item-overflow:visible}.c-accordion-item--outlined{box-shadow:inset 0 0 0 2px var(--_c-accordion-item-header-background-color);border-radius:var(--_c-accordion-item-border-radius)}.c-accordion-item__header{min-height:var(--_c-accordion-item-min-height);user-select:none;background-color:var(--_c-accordion-item-header-background-color);display:grid;column-gap:8px;align-items:center;padding:0 var(--_c-accordion-item-padding);border-radius:var(--_c-accordion-item-border-radius);cursor:pointer;grid-template-columns:auto 1fr auto;border:none;text-align:left;margin:0;font-family:var(--c-font-family);position:relative}.c-accordion-item__header--expanded{cursor:default}.c-accordion-item__header--expanded.c-accordion-item__header--collapsable{cursor:pointer}.c-accordion-item__header:focus{outline:2px var(--_c-accordion-item-outline-color) solid;outline-offset:var(--_c-accordion-item-outline-color-offset)}@supports selector(:focus-visible){.c-accordion-item__header:focus{outline:none}}.c-accordion-item__header:focus-visible{outline:2px var(--_c-accordion-item-outline-color) solid;outline-offset:var(--_c-accordion-item-outline-color-offset)}.c-accordion-item__title{margin-top:0;margin-bottom:0;font-weight:500;font-size:16px;line-height:1;color:var(--_c-accordion-item-text-color)}.c-accordion-item__content{padding:16px}.c-accordion-item__content-wrapper{overflow:visible}.c-accordion-item__icon{height:24px;font-size:24px;color:var(--_c-accordion-item-text-color);display:flex;align-items:center}.c-accordion-item__icon>*{height:24px;display:flex;align-items:center}.c-accordion-item__indicator{display:flex;align-items:center;color:var(--_c-accordion-item-text-color)}.c-accordion-item__indicator c-icon{width:24px;height:24px !important;transform:var(--_c-accordion-item-indicator-rotation);transition:transform 0.3s ease}";const n=class{constructor(t){i(this,t);this.itemChange=o(this,"itemChange",7);this._isCollapsing=false;this._isExpanding=false;this.collapsable=false;this.heading=undefined;this.value=undefined;this.expanded=false;this.outlined=false}handleKeyDown(i){if(i.target.tagName==="C-ACCORDION-ITEM"&&(i.key==="Enter"||i.code==="Space")){i.preventDefault();this._onToggleAccordion(i)}}stop(i){i.stopPropagation()}get _collapsedHeight(){const i=this.outlined?4:0;return this._accordionHeader.offsetHeight+i}get _expandedHeight(){const i=this.outlined?4:0;const o=this._accordionHeader.offsetHeight;const t=this._accordionContent.offsetHeight;return o+t+i}_onToggleAccordion(i){i.preventDefault();if(!this.collapsable&&this.expanded)return;this._accordionElement.classList.add("c-accordion-item--expanding");if(this._isCollapsing||!this.expanded){this._expand()}else if(this._isExpanding||this.expanded){this._collapse()}}_collapse(){this._isCollapsing=true;const i=`${this._accordionElement.offsetHeight}px`;const o=`${this._collapsedHeight}px`;if(this._animation){this._animation.cancel()}this.itemChange.emit({value:this.value,expanded:this.expanded});this._animation=this._accordionElement.animate({height:[i,o]},{duration:300,easing:"cubic-bezier(0.075, 0.82, 0.165, 1)"});this._animation.onfinish=()=>this._onAnimationFinish(false);this._animation.oncancel=()=>this._isCollapsing=false}_expand(){this._accordionElement.style.height=`${this._accordionElement.offsetHeight}px`;this.expanded=true;window.requestAnimationFrame((()=>{this._isExpanding=true;const i=`${this._collapsedHeight}px`;const o=`${this._expandedHeight}px`;if(this._animation){this._animation.cancel()}this.itemChange.emit({value:this.value,expanded:this.expanded});this._animation=this._accordionElement.animate({height:[i,o]},{duration:300,easing:"cubic-bezier(0.25, 0.8, 0.5, 1)"});this._animation.onfinish=()=>this._onAnimationFinish(true);this._animation.oncancel=()=>this._isExpanding=false}))}_onAnimationFinish(i){this.expanded=i;this._animation=null;this._isCollapsing=false;this._isExpanding=false;this._accordionElement.style.height="";this._accordionElement.classList.remove("c-accordion-item--expanding");this.expanded=i}componentWillLoad(){n._uniqueId+=1}render(){const i={"c-accordion-item":true,"c-accordion-item--expanded":this.expanded,"c-accordion-item--outlined":this.outlined};const o={"c-accordion-item__header":true,"c-accordion-item__header--collapsable":this.collapsable,"c-accordion-item__header--expanded":this.expanded};const c={"c-accordion-item__indicator":true,"c-accordion-item__indicator--expanded":this.expanded};return t(e,null,t("details",{id:`panel__${n._uniqueId}`,ref:i=>this._accordionElement=i,class:i,open:!!this.expanded},t("summary",{ref:i=>this._accordionHeader=i,class:o,onClick:i=>this._onToggleAccordion(i)},t("div",{class:"c-accordion-item__icon","aria-visible":"hidden"},t("slot",{name:"icon"})),t("div",{class:"c-accordion-item__title"},this.heading),t("div",{class:c},t("c-icon",{path:r,class:{expanded:this.expanded}}))),t("div",{ref:i=>this._accordionContent=i,class:"c-accordion-item__content-wrapper"},t("div",{class:"c-accordion-item__content",role:"region","aria-labelledby":`header__${n._uniqueId}`},t("slot",null)))))}get el(){return c(this)}};n._uniqueId=0;n.style=a;export{n as c_accordion_item};
|
|
2
|
+
//# sourceMappingURL=p-468d9583.entry.js.map
|