@scania/tegel 1.26.0 → 1.27.0-toast-aria-live.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 +71 -42
- 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 +11 -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 +86 -40
- 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 +45 -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-663b8e51.js} +72 -42
- 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 +14 -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 +71 -42
- 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 +11 -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-be1d1345.entry.js → p-4465f687.entry.js} +1 -1
- package/dist/tegel/p-668b7662.entry.js +1 -0
- package/dist/tegel/p-746e2927.entry.js +1 -0
- 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-ad9a2141.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/toast/toast.d.ts +5 -0
- package/dist/types/components/tooltip/tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +146 -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-4e298888.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
|
@@ -89,16 +89,15 @@ const TdsDropdown = class {
|
|
|
89
89
|
const defaultValues = this.multiselect
|
|
90
90
|
? this.internalDefaultValue.split(',')
|
|
91
91
|
: [this.internalDefaultValue];
|
|
92
|
-
this.
|
|
92
|
+
this.updateDropdownStateInternal(defaultValues);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
this.getChildren = () => {
|
|
96
96
|
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
97
97
|
if (tdsDropdownOptions.length === 0) {
|
|
98
|
-
console.warn('TDS DROPDOWN:
|
|
98
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
return tdsDropdownOptions;
|
|
100
|
+
return tdsDropdownOptions;
|
|
102
101
|
};
|
|
103
102
|
this.getSelectedChildren = () => {
|
|
104
103
|
if (this.selectedOptions.length === 0)
|
|
@@ -225,6 +224,7 @@ const TdsDropdown = class {
|
|
|
225
224
|
this.noResultText = 'No result';
|
|
226
225
|
this.defaultValue = undefined;
|
|
227
226
|
this.value = null;
|
|
227
|
+
this.tdsAriaLabel = undefined;
|
|
228
228
|
this.open = false;
|
|
229
229
|
this.internalValue = undefined;
|
|
230
230
|
this.filterResult = undefined;
|
|
@@ -237,50 +237,69 @@ const TdsDropdown = class {
|
|
|
237
237
|
const normalizedValue = this.normalizeValue(newValue);
|
|
238
238
|
// Only update if actually changed
|
|
239
239
|
if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
|
|
240
|
-
this.
|
|
240
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
normalizeValue(value) {
|
|
244
244
|
if (!value || value === '')
|
|
245
|
-
return [];
|
|
246
|
-
// For
|
|
247
|
-
if (this.multiselect) {
|
|
245
|
+
return [];
|
|
246
|
+
// For single select, ensure we handle both string and array inputs
|
|
247
|
+
if (!this.multiselect) {
|
|
248
|
+
// If array is passed to single select, take first value
|
|
248
249
|
if (Array.isArray(value)) {
|
|
249
|
-
return
|
|
250
|
+
return [convertToString(value[0])];
|
|
250
251
|
}
|
|
251
|
-
return value
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
return [convertToString(value)];
|
|
253
|
+
}
|
|
254
|
+
// For multiselect
|
|
255
|
+
if (Array.isArray(value)) {
|
|
256
|
+
return convertArrayToStrings(value);
|
|
255
257
|
}
|
|
256
|
-
//
|
|
257
|
-
return
|
|
258
|
+
// Handle comma-separated string for multiselect
|
|
259
|
+
return value
|
|
260
|
+
.toString()
|
|
261
|
+
.split(',')
|
|
262
|
+
.filter((v) => v !== '');
|
|
258
263
|
}
|
|
259
264
|
hasValueChanged(newValue, currentValue) {
|
|
260
265
|
if (newValue.length !== currentValue.length)
|
|
261
266
|
return true;
|
|
262
267
|
return newValue.some((val) => !currentValue.includes(val));
|
|
263
268
|
}
|
|
264
|
-
|
|
269
|
+
updateDropdownStateInternal(values) {
|
|
270
|
+
this.updateDropdownState(values, false);
|
|
271
|
+
}
|
|
272
|
+
updateDropdownStateFromUser(values) {
|
|
273
|
+
this.updateDropdownState(values, true);
|
|
274
|
+
}
|
|
275
|
+
updateDropdownState(values, emitChange = true) {
|
|
276
|
+
// Validate the values first
|
|
277
|
+
const validValues = this.validateValues(values);
|
|
265
278
|
// Update internal state
|
|
266
|
-
this.selectedOptions = [...
|
|
267
|
-
//
|
|
279
|
+
this.selectedOptions = [...validValues];
|
|
280
|
+
// Update the value prop
|
|
268
281
|
this.value = this.multiselect ? this.selectedOptions : this.selectedOptions[0] || null;
|
|
269
|
-
//
|
|
282
|
+
// Update internal value for display
|
|
270
283
|
this.internalValue = this.getValue();
|
|
271
284
|
// Update DOM
|
|
272
285
|
this.updateOptionElements();
|
|
273
286
|
// Update display value
|
|
274
287
|
this.updateDisplayValue();
|
|
275
|
-
// Emit change event
|
|
276
|
-
|
|
288
|
+
// Emit change event only if value has changed by user
|
|
289
|
+
if (emitChange)
|
|
290
|
+
this.emitChange();
|
|
277
291
|
// Update value attribute
|
|
278
292
|
this.setValueAttribute();
|
|
279
293
|
}
|
|
280
294
|
validateValues(values) {
|
|
295
|
+
// Make sure we have children before validation
|
|
296
|
+
const children = this.getChildren();
|
|
297
|
+
if (!children || children.length === 0) {
|
|
298
|
+
console.warn('No dropdown options found');
|
|
299
|
+
return values; // Return original values if no children yet
|
|
300
|
+
}
|
|
281
301
|
return values.filter((val) => {
|
|
282
|
-
|
|
283
|
-
const isValid = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.some((element) => element.value === val);
|
|
302
|
+
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
284
303
|
if (!isValid) {
|
|
285
304
|
console.warn(`Option with value "${val}" does not exist`);
|
|
286
305
|
}
|
|
@@ -317,18 +336,18 @@ const TdsDropdown = class {
|
|
|
317
336
|
else {
|
|
318
337
|
normalizedValue = [convertToString(value)];
|
|
319
338
|
}
|
|
320
|
-
this.
|
|
339
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
321
340
|
return this.getSelectedChildren().map((element) => ({
|
|
322
341
|
value: element.value,
|
|
323
342
|
label: element.textContent.trim(),
|
|
324
343
|
}));
|
|
325
344
|
}
|
|
326
345
|
async reset() {
|
|
327
|
-
this.
|
|
346
|
+
this.updateDropdownStateFromUser([]);
|
|
328
347
|
}
|
|
329
348
|
async removeValue(oldValue) {
|
|
330
349
|
const newValues = this.selectedOptions.filter((v) => v !== oldValue);
|
|
331
|
-
this.
|
|
350
|
+
this.updateDropdownStateFromUser(newValues);
|
|
332
351
|
}
|
|
333
352
|
/** Method that forces focus on the input element. */
|
|
334
353
|
async focusElement() {
|
|
@@ -406,13 +425,19 @@ const TdsDropdown = class {
|
|
|
406
425
|
}
|
|
407
426
|
}
|
|
408
427
|
componentWillLoad() {
|
|
409
|
-
|
|
410
|
-
|
|
428
|
+
// First handle the value prop if it exists
|
|
429
|
+
if (this.value !== null && this.value !== undefined) {
|
|
430
|
+
const normalizedValue = this.normalizeValue(this.value);
|
|
431
|
+
this.updateDropdownStateInternal(normalizedValue);
|
|
432
|
+
return; // Exit early if we handled the value prop
|
|
433
|
+
}
|
|
434
|
+
// Only use defaultValue if no value prop was provided
|
|
435
|
+
if (this.defaultValue !== null && this.defaultValue !== undefined) {
|
|
411
436
|
const defaultValueStr = convertToString(this.defaultValue);
|
|
412
437
|
const initialValue = this.multiselect
|
|
413
438
|
? defaultValueStr.split(',').map(convertToString)
|
|
414
439
|
: [convertToString(this.defaultValue)];
|
|
415
|
-
this.
|
|
440
|
+
this.updateDropdownStateInternal(initialValue);
|
|
416
441
|
}
|
|
417
442
|
}
|
|
418
443
|
/** Method to handle slot changes */
|
|
@@ -428,10 +453,10 @@ const TdsDropdown = class {
|
|
|
428
453
|
*/
|
|
429
454
|
async appendValue(value) {
|
|
430
455
|
if (this.multiselect) {
|
|
431
|
-
this.
|
|
456
|
+
this.updateDropdownStateFromUser([...this.selectedOptions, value]);
|
|
432
457
|
}
|
|
433
458
|
else {
|
|
434
|
-
this.
|
|
459
|
+
this.updateDropdownStateFromUser([value]);
|
|
435
460
|
}
|
|
436
461
|
}
|
|
437
462
|
componentDidRender() {
|
|
@@ -446,11 +471,16 @@ const TdsDropdown = class {
|
|
|
446
471
|
form.removeEventListener('reset', this.resetInput);
|
|
447
472
|
}
|
|
448
473
|
}
|
|
474
|
+
connectedCallback() {
|
|
475
|
+
if (!this.tdsAriaLabel) {
|
|
476
|
+
console.warn('Tegel Dropdown component: tdsAriaLabel prop is missing');
|
|
477
|
+
}
|
|
478
|
+
}
|
|
449
479
|
render() {
|
|
450
480
|
appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
|
|
451
|
-
return (h(Host, { key: '
|
|
481
|
+
return (h(Host, { key: 'dbd588020c5f634d489ca464c2a4fd568e9b905a', class: {
|
|
452
482
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
453
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
483
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'e0b7d8efe2206136140695647f7b0656de6f4559', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'abc333e48a6ecc7d89f2ddeec0ff587371baf78c', class: {
|
|
454
484
|
'dropdown-select': true,
|
|
455
485
|
[this.size]: true,
|
|
456
486
|
'disabled': this.disabled,
|
|
@@ -463,7 +493,7 @@ const TdsDropdown = class {
|
|
|
463
493
|
label-inside-as-placeholder
|
|
464
494
|
${this.size}
|
|
465
495
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
466
|
-
` }, this.label)), h("input", {
|
|
496
|
+
` }, this.label)), h("input", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled,
|
|
467
497
|
// eslint-disable-next-line no-return-assign
|
|
468
498
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
469
499
|
placeholder: this.labelPosition === 'inside',
|
|
@@ -477,8 +507,7 @@ const TdsDropdown = class {
|
|
|
477
507
|
if (event.key === 'Escape') {
|
|
478
508
|
this.open = false;
|
|
479
509
|
}
|
|
480
|
-
}
|
|
481
|
-
})), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
510
|
+
} })), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
482
511
|
if (event.key === 'Enter') {
|
|
483
512
|
this.handleFilterReset();
|
|
484
513
|
}
|
|
@@ -489,7 +518,7 @@ const TdsDropdown = class {
|
|
|
489
518
|
if (event.key === 'Enter') {
|
|
490
519
|
this.handleToggleOpen();
|
|
491
520
|
}
|
|
492
|
-
}, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
|
|
521
|
+
}, 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) => {
|
|
493
522
|
if (event.key === 'Escape') {
|
|
494
523
|
this.open = false;
|
|
495
524
|
}
|
|
@@ -501,7 +530,7 @@ const TdsDropdown = class {
|
|
|
501
530
|
label-inside-as-placeholder
|
|
502
531
|
${this.size}
|
|
503
532
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
504
|
-
` }, 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: '
|
|
533
|
+
` }, 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: 'd83c66bf81a1d2878827d5ed71cdeee73625cbd0', role: "listbox", "aria-label": this.tdsAriaLabel, "aria-orientation": "vertical", "aria-multiselectable": this.multiselect, ref: (element) => {
|
|
505
534
|
this.dropdownList = element;
|
|
506
535
|
}, class: {
|
|
507
536
|
'dropdown-list': true,
|
|
@@ -512,11 +541,11 @@ const TdsDropdown = class {
|
|
|
512
541
|
'closed': !this.open,
|
|
513
542
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
514
543
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
515
|
-
} }, h("slot", { key: '
|
|
544
|
+
} }, h("slot", { key: '0133acc19540fb2ebfd44611fb906b5895d300d6', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '3cdf4874c3e5f593850b3238b9f87508ad67c312', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'a51e0a23e67f22427010ee9c965ab7535c46176e', class: {
|
|
516
545
|
helper: true,
|
|
517
546
|
error: this.error,
|
|
518
547
|
disabled: this.disabled,
|
|
519
|
-
} }, this.error && h("tds-icon", { key: '
|
|
548
|
+
} }, this.error && h("tds-icon", { key: '719a9da93ed73509c1a0694d3011f8e304d73cf9', name: "error", size: "16px" }), this.helper))));
|
|
520
549
|
}
|
|
521
550
|
get host() { return getElement(this); }
|
|
522
551
|
static get watchers() { return {
|
|
@@ -611,7 +640,7 @@ const TdsDropdownOption = class {
|
|
|
611
640
|
this.internalValue = convertToString(this.value);
|
|
612
641
|
}
|
|
613
642
|
render() {
|
|
614
|
-
return (h(Host, { key: '
|
|
643
|
+
return (h(Host, { key: 'f471d5238869b3a522b36d99d7549c1229cd83a2' }, h("div", { key: 'da9edccba96999b0ee40f8c599325774593de814', class: `dropdown-option
|
|
615
644
|
${this.size}
|
|
616
645
|
${this.selected ? 'selected' : ''}
|
|
617
646
|
${this.disabled ? 'disabled' : ''}
|
|
@@ -623,7 +652,7 @@ const TdsDropdownOption = class {
|
|
|
623
652
|
this.handleMultiselect(event);
|
|
624
653
|
}, disabled: this.disabled, checked: this.selected, class: {
|
|
625
654
|
[this.size]: true,
|
|
626
|
-
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { onClick: () => {
|
|
655
|
+
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, onClick: () => {
|
|
627
656
|
this.handleSingleSelect();
|
|
628
657
|
}, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), disabled: this.disabled, class: this.size }, h("div", { class: "single-select" }, h("slot", null), this.selected && h("tds-icon", { name: "tick", size: "16px" })))))));
|
|
629
658
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-51d04e39.js';
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-51d04e39.js';
|
|
2
2
|
|
|
3
3
|
const folderTabCss = ":host{box-sizing:border-box;position:relative}:host *{box-sizing:border-box}:host ::slotted(*){all:unset;min-width:142px;display:block;width:calc(100% - 32px);font:var(--tds-headline-07) !important;letter-spacing:var(--tds-headline-07-ls) !important;cursor:pointer;padding:16px;white-space:nowrap;text-decoration:none;text-align:left;outline:none;border:none;border-left:1px solid;border-left-color:transparent}:host ::slotted(*:focus-visible){outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host div:not(.selected){background-color:var(--tds-folder-tab-background)}:host div:not(.selected) ::slotted(*){border-left-color:var(--tds-folder-tab-divider-color);border-top:2px solid var(--tds-folder-tab-background);color:var(--tds-folder-tab-item-color)}:host div:not(.selected):hover:not(.disabled){background-color:var(--tds-folder-tab-background-hover);cursor:pointer}:host div:not(.selected):hover:not(.disabled) ::slotted(*){border-top-color:var(--tds-folder-tab-background-hover);color:var(--tds-folder-tab-color)}:host div:not(.selected).disabled ::slotted(*){color:var(--tds-folder-tab-item-color-disabled)}:host div:not(.selected).disabled ::slotted(*:focus-visible){outline:none}:host div:not(.selected).disabled ::slotted(*:hover){cursor:not-allowed}:host div:not(.selected).disabled ::slotted(*::after){content:none}:host .selected{background-color:var(--tds-folder-tab-background-selected);border-top:2px solid var(--tds-folder-tab-border-selected)}:host .selected::after{content:\" \";background-color:var(--tds-folder-tab-background-selected);width:1px;top:0;bottom:0;right:-1px;display:block;position:absolute;z-index:1}:host .selected ::slotted(*){color:var(--tds-folder-tab-color)}:host(.first) :not(.selected) ::slotted(*){border-left-color:transparent}";
|
|
4
4
|
const TdsFolderTabStyle0 = folderTabCss;
|
|
@@ -18,12 +18,31 @@ const TdsFolderTab = class {
|
|
|
18
18
|
async setSelected(selected) {
|
|
19
19
|
this.selected = selected;
|
|
20
20
|
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
const elements = this.host.querySelectorAll('button, a');
|
|
23
|
+
for (let index = 0; index < elements.length; index++) {
|
|
24
|
+
const element = elements[index];
|
|
25
|
+
if (!element.getAttribute('aria-controls')) {
|
|
26
|
+
console.warn('Tegel folder-tab component: Interactive elements should have aria-controls attribute to link the tab to its corresponding panel');
|
|
27
|
+
}
|
|
28
|
+
if (element.getAttribute('role') !== 'tab') {
|
|
29
|
+
console.warn('Tegel folder-tab component: Interactive elements should have attribute role="tab"');
|
|
30
|
+
}
|
|
31
|
+
if (this.disabled) {
|
|
32
|
+
element.setAttribute('aria-disabled', 'true');
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
element.removeAttribute('aria-disabled');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
21
39
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: '9290c4ab2f7d051bba9fec4dad9a7d07790ed5b7', "aria-selected": this.selected }, h("div", { key: '36225101c510f2d77282fd600c4ee00085791109', class: {
|
|
23
41
|
selected: this.selected,
|
|
24
42
|
disabled: this.disabled,
|
|
25
|
-
}, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '
|
|
43
|
+
}, style: { width: `${this.tabWidth}px` } }, h("slot", { key: '05954c498b9fbd6a2a1231d84bf2657a0616db36' }))));
|
|
26
44
|
}
|
|
45
|
+
get host() { return getElement(this); }
|
|
27
46
|
};
|
|
28
47
|
TdsFolderTab.style = TdsFolderTabStyle0;
|
|
29
48
|
|
|
@@ -63,6 +63,8 @@ const TdsFolderTabs = class {
|
|
|
63
63
|
this.modeVariant = null;
|
|
64
64
|
this.defaultSelectedIndex = 0;
|
|
65
65
|
this.selectedIndex = undefined;
|
|
66
|
+
this.tdsScrollLeftAriaLabel = 'Scroll left';
|
|
67
|
+
this.tdsScrollRightAriaLabel = 'Scroll right';
|
|
66
68
|
this.buttonWidth = 0;
|
|
67
69
|
this.showLeftScroll = false;
|
|
68
70
|
this.showRightScroll = false;
|
|
@@ -163,9 +165,9 @@ const TdsFolderTabs = class {
|
|
|
163
165
|
this.removeEventListenerFromTabs();
|
|
164
166
|
}
|
|
165
167
|
render() {
|
|
166
|
-
return (h(Host, { key: '
|
|
168
|
+
return (h(Host, { key: '54a3cceed49387a8f0dbe74eecb96ae284882ff9', role: "tablist", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, h("div", { key: '170e5256bde8efdce412bbab1a674b23159d02d1', class: "wrapper", ref: (el) => {
|
|
167
169
|
this.navWrapperElement = el;
|
|
168
|
-
} }, h("button", { key: '
|
|
170
|
+
} }, h("button", { key: '1c74ef8c81361bfa6ff5d227c145a3371fb2f66f', "aria-label": this.tdsScrollLeftAriaLabel, class: `scroll-left-button ${this.showLeftScroll ? 'show' : ''}`, disabled: !this.showLeftScroll, onClick: () => this.scrollLeft() }, h("tds-icon", { key: '94ddd85d4107c89487db727f13a9c443fd160fc6', name: "chevron_left", size: "20px" })), h("slot", { key: '63978c3c62482bc0a251377756630f555f10dfef', onSlotchange: () => this.handleSlotChange() }), h("button", { key: 'aeb86fbdb365e62df37b72daa0b53f51486834a9', "aria-label": this.tdsScrollRightAriaLabel, class: `scroll-right-button ${this.showRightScroll ? 'show' : ''}`, disabled: !this.showRightScroll, onClick: () => this.scrollRight() }, h("tds-icon", { key: '2cc4d301a4490d6b8d8f2373fc2450c93922a814', name: "chevron_right", size: "20px" })))));
|
|
169
171
|
}
|
|
170
172
|
get host() { return getElement(this); }
|
|
171
173
|
static get watchers() { return {
|