@scania/tegel 1.26.0 → 1.27.0-allow-numbers-and-zero-values-beta.0
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/index-ca8040ad.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/tds-banner.cjs.entry.js +1 -1
- package/dist/cjs/tds-checkbox.cjs.entry.js +10 -3
- package/dist/cjs/tds-chip.cjs.entry.js +7 -2
- package/dist/cjs/tds-dropdown_2.cjs.entry.js +74 -45
- package/dist/cjs/tds-folder-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-folder-tabs.cjs.entry.js +4 -2
- package/dist/cjs/tds-icon.cjs.entry.js +1 -1
- package/dist/cjs/tds-inline-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-inline-tabs.cjs.entry.js +4 -2
- package/dist/cjs/tds-link.cjs.entry.js +17 -3
- package/dist/cjs/tds-message.cjs.entry.js +15 -3
- package/dist/cjs/tds-modal.cjs.entry.js +74 -2
- package/dist/cjs/tds-navigation-tab.cjs.entry.js +21 -2
- package/dist/cjs/tds-navigation-tabs.cjs.entry.js +6 -4
- package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
- package/dist/cjs/tds-text-field.cjs.entry.js +13 -7
- package/dist/cjs/tds-textarea.cjs.entry.js +21 -9
- package/dist/cjs/tds-toast.cjs.entry.js +4 -4
- package/dist/cjs/tds-toggle.cjs.entry.js +2 -2
- package/dist/cjs/tds-tooltip.cjs.entry.js +14 -4
- package/dist/cjs/tegel.cjs.js +1 -1
- package/dist/collection/components/banner/banner.css +1 -1
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +44 -3
- package/dist/collection/components/chip/chip.js +24 -2
- package/dist/collection/components/dropdown/dropdown-option/dropdown-option.js +2 -2
- package/dist/collection/components/dropdown/dropdown.js +89 -43
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/iconsArray.js +96 -1
- package/dist/collection/components/link/link.js +17 -3
- package/dist/collection/components/message/message.css +44 -26
- package/dist/collection/components/message/message.js +49 -2
- package/dist/collection/components/modal/modal.js +103 -3
- package/dist/collection/components/popover-core/tds-popover-core.css +596 -53
- package/dist/collection/components/tabs/folder-tabs/folder-tab/folder-tab.js +21 -2
- package/dist/collection/components/tabs/folder-tabs/folder-tabs.js +40 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tab/inline-tab.js +21 -2
- package/dist/collection/components/tabs/inline-tabs/inline-tabs.js +40 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tab/navigation-tab.js +21 -2
- package/dist/collection/components/tabs/navigation-tabs/navigation-tabs.js +42 -4
- package/dist/collection/components/text-field/text-field.js +31 -8
- package/dist/collection/components/textarea/textarea.css +11 -6
- package/dist/collection/components/textarea/textarea.js +38 -8
- package/dist/collection/components/toast/toast.css +1 -1
- package/dist/collection/components/toast/toast.js +3 -3
- package/dist/collection/components/toggle/toggle.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +40 -4
- package/dist/collection/utils/axeHelpers.js +1 -1
- package/dist/components/{p-c65351ab.js → p-14ab9663.js} +12 -3
- package/dist/components/p-17338bcb.js +115 -0
- package/dist/components/{p-2a43e410.js → p-2d93a742.js} +5 -5
- package/dist/components/p-4487c541.js +65 -0
- package/dist/components/{p-29d19dc8.js → p-60ff84f2.js} +1 -1
- package/dist/components/{p-a64dc22e.js → p-797c8dce.js} +75 -45
- package/dist/components/{p-4c1e3344.js → p-83db8b35.js} +1 -1
- package/dist/components/{p-b1d21573.js → p-a1181b1f.js} +1 -1
- package/dist/components/p-e71e3b2e.js +2052 -0
- package/dist/components/tds-accordion-item.js +1 -1
- package/dist/components/tds-banner.js +2 -2
- package/dist/components/tds-checkbox.js +1 -1
- package/dist/components/tds-chip.js +9 -3
- package/dist/components/tds-datetime.js +1 -1
- package/dist/components/tds-dropdown-option.js +1 -1
- package/dist/components/tds-dropdown.js +1 -1
- package/dist/components/tds-folder-tab.js +21 -2
- package/dist/components/tds-folder-tabs.js +7 -3
- package/dist/components/tds-footer-group.js +1 -1
- package/dist/components/tds-header-cell.js +1 -1
- package/dist/components/tds-header-dropdown.js +3 -3
- package/dist/components/tds-header-hamburger.js +1 -1
- package/dist/components/tds-header-launcher-button.js +1 -1
- package/dist/components/tds-header-launcher.js +4 -4
- package/dist/components/tds-icon.js +1 -1
- package/dist/components/tds-inline-tab.js +21 -2
- package/dist/components/tds-inline-tabs.js +7 -3
- package/dist/components/tds-link.js +17 -3
- package/dist/components/tds-message.js +19 -5
- package/dist/components/tds-modal.js +78 -4
- package/dist/components/tds-navigation-tab.js +21 -2
- package/dist/components/tds-navigation-tabs.js +9 -5
- package/dist/components/tds-popover-canvas.js +1 -1
- package/dist/components/tds-popover-core.js +1 -1
- package/dist/components/tds-popover-menu.js +1 -1
- package/dist/components/tds-side-menu-close-button.js +1 -1
- package/dist/components/tds-side-menu-dropdown.js +1 -1
- package/dist/components/tds-slider.js +1 -1
- package/dist/components/tds-step.js +1 -1
- package/dist/components/tds-table-body-input-wrapper.js +1 -1
- package/dist/components/tds-table-body-row.js +1 -1
- package/dist/components/tds-table-footer.js +4 -4
- package/dist/components/tds-table-header-input-wrapper.js +1 -1
- package/dist/components/tds-table-header.js +1 -1
- package/dist/components/tds-table-toolbar.js +1 -1
- package/dist/components/tds-text-field.js +15 -8
- package/dist/components/tds-textarea.js +36 -11
- package/dist/components/tds-toast.js +5 -5
- package/dist/components/tds-toggle.js +2 -2
- package/dist/components/tds-tooltip.js +1 -102
- package/dist/esm/index-51d04e39.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tds-banner.entry.js +1 -1
- package/dist/esm/tds-checkbox.entry.js +10 -3
- package/dist/esm/tds-chip.entry.js +7 -2
- package/dist/esm/tds-dropdown_2.entry.js +74 -45
- package/dist/esm/tds-folder-tab.entry.js +22 -3
- package/dist/esm/tds-folder-tabs.entry.js +4 -2
- package/dist/esm/tds-icon.entry.js +1 -1
- package/dist/esm/tds-inline-tab.entry.js +22 -3
- package/dist/esm/tds-inline-tabs.entry.js +4 -2
- package/dist/esm/tds-link.entry.js +17 -3
- package/dist/esm/tds-message.entry.js +15 -3
- package/dist/esm/tds-modal.entry.js +74 -2
- package/dist/esm/tds-navigation-tab.entry.js +22 -3
- package/dist/esm/tds-navigation-tabs.entry.js +6 -4
- package/dist/esm/tds-popover-core.entry.js +1 -1
- package/dist/esm/tds-text-field.entry.js +13 -7
- package/dist/esm/tds-textarea.entry.js +21 -9
- package/dist/esm/tds-toast.entry.js +4 -4
- package/dist/esm/tds-toggle.entry.js +2 -2
- package/dist/esm/tds-tooltip.entry.js +14 -4
- package/dist/esm/tegel.js +1 -1
- package/dist/tegel/p-0f2c9507.entry.js +1 -0
- package/dist/tegel/p-125a6b06.entry.js +1 -0
- package/dist/tegel/p-28517288.entry.js +1 -0
- package/dist/tegel/p-2af57972.entry.js +1 -0
- package/dist/tegel/p-3e9ca19a.entry.js +1 -0
- package/dist/tegel/{p-be1d1345.entry.js → p-4465f687.entry.js} +1 -1
- package/dist/tegel/p-668b7662.entry.js +1 -0
- package/dist/tegel/{p-4e298888.entry.js → p-66f394a2.entry.js} +1 -1
- package/dist/tegel/p-754a4921.entry.js +1 -0
- package/dist/tegel/{p-46205cfb.entry.js → p-769d0503.entry.js} +1 -1
- package/dist/tegel/p-843413ba.entry.js +1 -0
- package/dist/tegel/p-97f10223.entry.js +1 -0
- package/dist/tegel/p-a21250b8.entry.js +1 -0
- package/dist/tegel/p-aadb2553.entry.js +1 -0
- package/dist/tegel/p-b08886e3.entry.js +1 -0
- package/dist/tegel/p-b114ec3d.entry.js +1 -0
- package/dist/tegel/p-c3607f10.entry.js +1 -0
- package/dist/tegel/p-ddda64eb.entry.js +1 -0
- package/dist/tegel/p-eaa279dd.entry.js +1 -0
- package/dist/tegel/p-ee960089.entry.js +1 -0
- package/dist/tegel/tegel.css +13 -3
- package/dist/tegel/tegel.esm.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/chip/chip.d.ts +3 -0
- package/dist/types/components/dropdown/dropdown.d.ts +5 -0
- package/dist/types/components/message/message.d.ts +5 -0
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/tabs/folder-tabs/folder-tab/folder-tab.d.ts +2 -0
- package/dist/types/components/tabs/folder-tabs/folder-tabs.d.ts +4 -0
- package/dist/types/components/tabs/inline-tabs/inline-tab/inline-tab.d.ts +2 -0
- package/dist/types/components/tabs/inline-tabs/inline-tabs.d.ts +4 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tab/navigation-tab.d.ts +2 -0
- package/dist/types/components/tabs/navigation-tabs/navigation-tabs.d.ts +4 -0
- package/dist/types/components/text-field/text-field.d.ts +4 -1
- package/dist/types/components/textarea/textarea.d.ts +7 -4
- package/dist/types/components/tooltip/tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +130 -2
- package/dist/types/types/Icons.d.ts +1 -1
- package/dist/types/utils/axeHelpers.d.ts +1 -2
- package/package.json +1 -1
- package/dist/components/p-4764a1d5.js +0 -2052
- package/dist/components/p-a2b7bdef.js +0 -65
- package/dist/tegel/p-065d6f83.entry.js +0 -1
- package/dist/tegel/p-0c1e632d.entry.js +0 -1
- package/dist/tegel/p-168122a7.entry.js +0 -1
- package/dist/tegel/p-19eb4ae1.entry.js +0 -1
- package/dist/tegel/p-4e33cbda.entry.js +0 -1
- package/dist/tegel/p-4ee344e5.entry.js +0 -1
- package/dist/tegel/p-64c80f14.entry.js +0 -1
- package/dist/tegel/p-72fd0083.entry.js +0 -1
- package/dist/tegel/p-93a4bd11.entry.js +0 -1
- package/dist/tegel/p-9e0b31a1.entry.js +0 -1
- package/dist/tegel/p-a0fc0cc2.entry.js +0 -1
- package/dist/tegel/p-b35e7208.entry.js +0 -1
- package/dist/tegel/p-b6526302.entry.js +0 -1
- package/dist/tegel/p-b686f1ad.entry.js +0 -1
- package/dist/tegel/p-cca85da0.entry.js +0 -1
- package/dist/tegel/p-d0abf078.entry.js +0 -1
- package/dist/tegel/p-dcbc35af.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
|
|
2
|
-
import { c as
|
|
3
|
-
import { d as defineCustomElement$1 } from './p-
|
|
2
|
+
import { c as convertToString, a as convertArrayToStrings } from './p-a1181b1f.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './p-4487c541.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Find the next focusable element index in a list of focusable elements.
|
|
@@ -78,16 +78,15 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
78
78
|
const defaultValues = this.multiselect
|
|
79
79
|
? this.internalDefaultValue.split(',')
|
|
80
80
|
: [this.internalDefaultValue];
|
|
81
|
-
this.
|
|
81
|
+
this.updateDropdownStateInternal(defaultValues);
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
this.getChildren = () => {
|
|
85
85
|
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
86
86
|
if (tdsDropdownOptions.length === 0) {
|
|
87
|
-
console.warn('TDS DROPDOWN:
|
|
87
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
return tdsDropdownOptions;
|
|
89
|
+
return tdsDropdownOptions;
|
|
91
90
|
};
|
|
92
91
|
this.getSelectedChildren = () => {
|
|
93
92
|
if (this.selectedOptions.length === 0)
|
|
@@ -95,7 +94,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
95
94
|
return this.selectedOptions
|
|
96
95
|
.map((stringValue) => {
|
|
97
96
|
var _a;
|
|
98
|
-
const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => element.value === stringValue);
|
|
97
|
+
const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => convertToString(element.value) === convertToString(stringValue));
|
|
99
98
|
return matchingElement;
|
|
100
99
|
})
|
|
101
100
|
.filter(Boolean);
|
|
@@ -214,6 +213,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
214
213
|
this.noResultText = 'No result';
|
|
215
214
|
this.defaultValue = undefined;
|
|
216
215
|
this.value = null;
|
|
216
|
+
this.tdsAriaLabel = undefined;
|
|
217
217
|
this.open = false;
|
|
218
218
|
this.internalValue = undefined;
|
|
219
219
|
this.filterResult = undefined;
|
|
@@ -226,50 +226,69 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
226
226
|
const normalizedValue = this.normalizeValue(newValue);
|
|
227
227
|
// Only update if actually changed
|
|
228
228
|
if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
|
|
229
|
-
this.
|
|
229
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
normalizeValue(value) {
|
|
233
|
-
if (
|
|
234
|
-
return [];
|
|
235
|
-
// For
|
|
236
|
-
if (this.multiselect) {
|
|
233
|
+
if (value === null || value === undefined || value === '')
|
|
234
|
+
return [];
|
|
235
|
+
// For single select, ensure we handle both string and array inputs
|
|
236
|
+
if (!this.multiselect) {
|
|
237
|
+
// If array is passed to single select, take first value
|
|
237
238
|
if (Array.isArray(value)) {
|
|
238
|
-
return
|
|
239
|
+
return [convertToString(value[0])];
|
|
239
240
|
}
|
|
240
|
-
return value
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
return [convertToString(value)];
|
|
242
|
+
}
|
|
243
|
+
// For multiselect
|
|
244
|
+
if (Array.isArray(value)) {
|
|
245
|
+
return convertArrayToStrings(value);
|
|
244
246
|
}
|
|
245
|
-
//
|
|
246
|
-
return
|
|
247
|
+
// Handle comma-separated string for multiselect
|
|
248
|
+
return value
|
|
249
|
+
.toString()
|
|
250
|
+
.split(',')
|
|
251
|
+
.filter((v) => v !== '');
|
|
247
252
|
}
|
|
248
253
|
hasValueChanged(newValue, currentValue) {
|
|
249
254
|
if (newValue.length !== currentValue.length)
|
|
250
255
|
return true;
|
|
251
256
|
return newValue.some((val) => !currentValue.includes(val));
|
|
252
257
|
}
|
|
253
|
-
|
|
258
|
+
updateDropdownStateInternal(values) {
|
|
259
|
+
this.updateDropdownState(values, false);
|
|
260
|
+
}
|
|
261
|
+
updateDropdownStateFromUser(values) {
|
|
262
|
+
this.updateDropdownState(values, true);
|
|
263
|
+
}
|
|
264
|
+
updateDropdownState(values, emitChange = true) {
|
|
265
|
+
// Validate the values first
|
|
266
|
+
const validValues = this.validateValues(values);
|
|
254
267
|
// Update internal state
|
|
255
|
-
this.selectedOptions = [...
|
|
256
|
-
//
|
|
268
|
+
this.selectedOptions = [...validValues];
|
|
269
|
+
// Update the value prop
|
|
257
270
|
this.value = this.multiselect ? this.selectedOptions : this.selectedOptions[0] || null;
|
|
258
|
-
//
|
|
271
|
+
// Update internal value for display
|
|
259
272
|
this.internalValue = this.getValue();
|
|
260
273
|
// Update DOM
|
|
261
274
|
this.updateOptionElements();
|
|
262
275
|
// Update display value
|
|
263
276
|
this.updateDisplayValue();
|
|
264
|
-
// Emit change event
|
|
265
|
-
|
|
277
|
+
// Emit change event only if value has changed by user
|
|
278
|
+
if (emitChange)
|
|
279
|
+
this.emitChange();
|
|
266
280
|
// Update value attribute
|
|
267
281
|
this.setValueAttribute();
|
|
268
282
|
}
|
|
269
283
|
validateValues(values) {
|
|
284
|
+
// Make sure we have children before validation
|
|
285
|
+
const children = this.getChildren();
|
|
286
|
+
if (!children || children.length === 0) {
|
|
287
|
+
console.warn('No dropdown options found');
|
|
288
|
+
return values; // Return original values if no children yet
|
|
289
|
+
}
|
|
270
290
|
return values.filter((val) => {
|
|
271
|
-
|
|
272
|
-
const isValid = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.some((element) => element.value === val);
|
|
291
|
+
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
273
292
|
if (!isValid) {
|
|
274
293
|
console.warn(`Option with value "${val}" does not exist`);
|
|
275
294
|
}
|
|
@@ -306,18 +325,18 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
306
325
|
else {
|
|
307
326
|
normalizedValue = [convertToString(value)];
|
|
308
327
|
}
|
|
309
|
-
this.
|
|
328
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
310
329
|
return this.getSelectedChildren().map((element) => ({
|
|
311
330
|
value: element.value,
|
|
312
331
|
label: element.textContent.trim(),
|
|
313
332
|
}));
|
|
314
333
|
}
|
|
315
334
|
async reset() {
|
|
316
|
-
this.
|
|
335
|
+
this.updateDropdownStateFromUser([]);
|
|
317
336
|
}
|
|
318
337
|
async removeValue(oldValue) {
|
|
319
338
|
const newValues = this.selectedOptions.filter((v) => v !== oldValue);
|
|
320
|
-
this.
|
|
339
|
+
this.updateDropdownStateFromUser(newValues);
|
|
321
340
|
}
|
|
322
341
|
/** Method that forces focus on the input element. */
|
|
323
342
|
async focusElement() {
|
|
@@ -395,13 +414,19 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
395
414
|
}
|
|
396
415
|
}
|
|
397
416
|
componentWillLoad() {
|
|
398
|
-
|
|
399
|
-
|
|
417
|
+
// First handle the value prop if it exists
|
|
418
|
+
if (this.value !== null && this.value !== undefined) {
|
|
419
|
+
const normalizedValue = this.normalizeValue(this.value);
|
|
420
|
+
this.updateDropdownStateInternal(normalizedValue);
|
|
421
|
+
return; // Exit early if we handled the value prop
|
|
422
|
+
}
|
|
423
|
+
// Only use defaultValue if no value prop was provided
|
|
424
|
+
if (this.defaultValue !== null && this.defaultValue !== undefined) {
|
|
400
425
|
const defaultValueStr = convertToString(this.defaultValue);
|
|
401
426
|
const initialValue = this.multiselect
|
|
402
427
|
? defaultValueStr.split(',').map(convertToString)
|
|
403
|
-
: [
|
|
404
|
-
this.
|
|
428
|
+
: [defaultValueStr];
|
|
429
|
+
this.updateDropdownStateInternal(initialValue);
|
|
405
430
|
}
|
|
406
431
|
}
|
|
407
432
|
/** Method to handle slot changes */
|
|
@@ -417,10 +442,10 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
417
442
|
*/
|
|
418
443
|
async appendValue(value) {
|
|
419
444
|
if (this.multiselect) {
|
|
420
|
-
this.
|
|
445
|
+
this.updateDropdownStateFromUser([...this.selectedOptions, value]);
|
|
421
446
|
}
|
|
422
447
|
else {
|
|
423
|
-
this.
|
|
448
|
+
this.updateDropdownStateFromUser([value]);
|
|
424
449
|
}
|
|
425
450
|
}
|
|
426
451
|
componentDidRender() {
|
|
@@ -435,11 +460,16 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
435
460
|
form.removeEventListener('reset', this.resetInput);
|
|
436
461
|
}
|
|
437
462
|
}
|
|
463
|
+
connectedCallback() {
|
|
464
|
+
if (!this.tdsAriaLabel) {
|
|
465
|
+
console.warn('Tegel Dropdown component: tdsAriaLabel prop is missing');
|
|
466
|
+
}
|
|
467
|
+
}
|
|
438
468
|
render() {
|
|
439
469
|
appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
|
|
440
|
-
return (h(Host, { key: '
|
|
470
|
+
return (h(Host, { key: 'b8c418ebe609789c1610178d764a7d620e2231c2', class: {
|
|
441
471
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
442
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
472
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ee5c005d5020e2226ce54c93a90f2098e081a6df', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'ca674a2361f1301886bb855b7093c67b999a500a', class: {
|
|
443
473
|
'dropdown-select': true,
|
|
444
474
|
[this.size]: true,
|
|
445
475
|
'disabled': this.disabled,
|
|
@@ -452,7 +482,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
452
482
|
label-inside-as-placeholder
|
|
453
483
|
${this.size}
|
|
454
484
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
455
|
-
` }, this.label)), h("input", {
|
|
485
|
+
` }, this.label)), h("input", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled,
|
|
456
486
|
// eslint-disable-next-line no-return-assign
|
|
457
487
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
458
488
|
placeholder: this.labelPosition === 'inside',
|
|
@@ -466,8 +496,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
466
496
|
if (event.key === 'Escape') {
|
|
467
497
|
this.open = false;
|
|
468
498
|
}
|
|
469
|
-
}
|
|
470
|
-
})), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
499
|
+
} })), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
471
500
|
if (event.key === 'Enter') {
|
|
472
501
|
this.handleFilterReset();
|
|
473
502
|
}
|
|
@@ -478,7 +507,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
478
507
|
if (event.key === 'Enter') {
|
|
479
508
|
this.handleToggleOpen();
|
|
480
509
|
}
|
|
481
|
-
}, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
|
|
510
|
+
}, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled, onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
|
|
482
511
|
if (event.key === 'Escape') {
|
|
483
512
|
this.open = false;
|
|
484
513
|
}
|
|
@@ -490,7 +519,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
490
519
|
label-inside-as-placeholder
|
|
491
520
|
${this.size}
|
|
492
521
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
493
|
-
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '
|
|
522
|
+
` }, this.label)), h("div", { class: `placeholder ${this.size}` }, this.selectedOptions.length ? this.getValue() : this.placeholder), h("tds-icon", { "aria-label": "Open/Close dropdown", svgTitle: "Open/Close dropdown", class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))))), h("div", { key: '14558013e5903958942dc7dd3ef2d3a49f79b245', role: "listbox", "aria-label": this.tdsAriaLabel, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
494
523
|
this.dropdownList = element;
|
|
495
524
|
}, class: {
|
|
496
525
|
'dropdown-list': true,
|
|
@@ -501,11 +530,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
501
530
|
'closed': !this.open,
|
|
502
531
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
503
532
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
504
|
-
} }, h("slot", { key: '
|
|
533
|
+
} }, h("slot", { key: '5f69c2fcb5b6a130888d7cd92d4cb882122e3e58', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'bae7a62960f90cd7b679ac4956a677dbff378ac7', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'be5fe56a1e19e812fa983c22f130c0d3001da55b', class: {
|
|
505
534
|
helper: true,
|
|
506
535
|
error: this.error,
|
|
507
536
|
disabled: this.disabled,
|
|
508
|
-
} }, this.error && h("tds-icon", { key: '
|
|
537
|
+
} }, this.error && h("tds-icon", { key: 'c0ccc491caa1aca628aff12e02d8a917a74e9c86', name: "error", size: "16px" }), this.helper))));
|
|
509
538
|
}
|
|
510
539
|
get host() { return this; }
|
|
511
540
|
static get watchers() { return {
|
|
@@ -532,6 +561,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
|
|
|
532
561
|
"noResultText": [1, "no-result-text"],
|
|
533
562
|
"defaultValue": [8, "default-value"],
|
|
534
563
|
"value": [1032],
|
|
564
|
+
"tdsAriaLabel": [1, "tds-aria-label"],
|
|
535
565
|
"open": [32],
|
|
536
566
|
"internalValue": [32],
|
|
537
567
|
"filterResult": [32],
|
|
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h, c as Host } from './p-28ef5186.js';
|
|
|
2
2
|
import { i as inheritAriaAttributes } from './p-0bd4c19c.js';
|
|
3
3
|
import { d as defineCustomElement$3 } from './p-e49a0ceb.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-d61bd22e.js';
|
|
5
|
-
import { d as defineCustomElement$1 } from './p-
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-4487c541.js';
|
|
6
6
|
|
|
7
7
|
const headerLauncherButtonCss = ":host{display:block}:host tds-header-item{display:block}:host .icon{position:relative;margin-left:-6px;left:3px;transition:all 0.2s ease-in-out}";
|
|
8
8
|
const TdsHeaderLauncherButtonStyle0 = headerLauncherButtonCss;
|