@scania/tegel 1.26.0-value-prop-fix.beta.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 +39 -34
- 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 +54 -32
- 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-98730c19.js → p-2d93a742.js} +4 -4
- package/dist/components/p-4487c541.js +65 -0
- package/dist/components/{p-29d19dc8.js → p-60ff84f2.js} +1 -1
- package/dist/components/{p-3cd8af42.js → p-797c8dce.js} +39 -33
- package/dist/components/{p-4c1e3344.js → p-83db8b35.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 +39 -34
- 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-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
- package/dist/tegel/p-f43278f0.entry.js +0 -1
|
@@ -80,7 +80,7 @@ export class TdsDropdownOption {
|
|
|
80
80
|
this.internalValue = convertToString(this.value);
|
|
81
81
|
}
|
|
82
82
|
render() {
|
|
83
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: 'f471d5238869b3a522b36d99d7549c1229cd83a2' }, h("div", { key: 'da9edccba96999b0ee40f8c599325774593de814', class: `dropdown-option
|
|
84
84
|
${this.size}
|
|
85
85
|
${this.selected ? 'selected' : ''}
|
|
86
86
|
${this.disabled ? 'disabled' : ''}
|
|
@@ -92,7 +92,7 @@ export class TdsDropdownOption {
|
|
|
92
92
|
this.handleMultiselect(event);
|
|
93
93
|
}, disabled: this.disabled, checked: this.selected, class: {
|
|
94
94
|
[this.size]: true,
|
|
95
|
-
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { onClick: () => {
|
|
95
|
+
} }, h("div", { slot: "label" }, h("slot", null))))) : (h("button", { role: "option", "aria-disabled": this.disabled, "aria-selected": this.selected, onClick: () => {
|
|
96
96
|
this.handleSingleSelect();
|
|
97
97
|
}, 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" })))))));
|
|
98
98
|
}
|
|
@@ -14,7 +14,7 @@ export class TdsDropdown {
|
|
|
14
14
|
const defaultValues = this.multiselect
|
|
15
15
|
? this.internalDefaultValue.split(',')
|
|
16
16
|
: [this.internalDefaultValue];
|
|
17
|
-
this.
|
|
17
|
+
this.updateDropdownStateInternal(defaultValues);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
this.getChildren = () => {
|
|
@@ -30,7 +30,7 @@ export class TdsDropdown {
|
|
|
30
30
|
return this.selectedOptions
|
|
31
31
|
.map((stringValue) => {
|
|
32
32
|
var _a;
|
|
33
|
-
const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => element.value === stringValue);
|
|
33
|
+
const matchingElement = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.find((element) => convertToString(element.value) === convertToString(stringValue));
|
|
34
34
|
return matchingElement;
|
|
35
35
|
})
|
|
36
36
|
.filter(Boolean);
|
|
@@ -149,6 +149,7 @@ export class TdsDropdown {
|
|
|
149
149
|
this.noResultText = 'No result';
|
|
150
150
|
this.defaultValue = undefined;
|
|
151
151
|
this.value = null;
|
|
152
|
+
this.tdsAriaLabel = undefined;
|
|
152
153
|
this.open = false;
|
|
153
154
|
this.internalValue = undefined;
|
|
154
155
|
this.filterResult = undefined;
|
|
@@ -157,18 +158,15 @@ export class TdsDropdown {
|
|
|
157
158
|
this.selectedOptions = [];
|
|
158
159
|
}
|
|
159
160
|
handleValueChange(newValue) {
|
|
160
|
-
console.log('Value changed:', newValue); // Debug
|
|
161
161
|
// Normalize to array
|
|
162
162
|
const normalizedValue = this.normalizeValue(newValue);
|
|
163
|
-
console.log('Normalized value:', normalizedValue); // Debug
|
|
164
163
|
// Only update if actually changed
|
|
165
164
|
if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
|
|
166
|
-
|
|
167
|
-
this.updateDropdownState(normalizedValue);
|
|
165
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
normalizeValue(value) {
|
|
171
|
-
if (
|
|
169
|
+
if (value === null || value === undefined || value === '')
|
|
172
170
|
return [];
|
|
173
171
|
// For single select, ensure we handle both string and array inputs
|
|
174
172
|
if (!this.multiselect) {
|
|
@@ -193,11 +191,15 @@ export class TdsDropdown {
|
|
|
193
191
|
return true;
|
|
194
192
|
return newValue.some((val) => !currentValue.includes(val));
|
|
195
193
|
}
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
updateDropdownStateInternal(values) {
|
|
195
|
+
this.updateDropdownState(values, false);
|
|
196
|
+
}
|
|
197
|
+
updateDropdownStateFromUser(values) {
|
|
198
|
+
this.updateDropdownState(values, true);
|
|
199
|
+
}
|
|
200
|
+
updateDropdownState(values, emitChange = true) {
|
|
198
201
|
// Validate the values first
|
|
199
202
|
const validValues = this.validateValues(values);
|
|
200
|
-
console.log('Valid values:', validValues); // Debug
|
|
201
203
|
// Update internal state
|
|
202
204
|
this.selectedOptions = [...validValues];
|
|
203
205
|
// Update the value prop
|
|
@@ -208,8 +210,9 @@ export class TdsDropdown {
|
|
|
208
210
|
this.updateOptionElements();
|
|
209
211
|
// Update display value
|
|
210
212
|
this.updateDisplayValue();
|
|
211
|
-
// Emit change event
|
|
212
|
-
|
|
213
|
+
// Emit change event only if value has changed by user
|
|
214
|
+
if (emitChange)
|
|
215
|
+
this.emitChange();
|
|
213
216
|
// Update value attribute
|
|
214
217
|
this.setValueAttribute();
|
|
215
218
|
}
|
|
@@ -217,7 +220,7 @@ export class TdsDropdown {
|
|
|
217
220
|
// Make sure we have children before validation
|
|
218
221
|
const children = this.getChildren();
|
|
219
222
|
if (!children || children.length === 0) {
|
|
220
|
-
console.warn('No dropdown options found');
|
|
223
|
+
console.warn('No dropdown options found');
|
|
221
224
|
return values; // Return original values if no children yet
|
|
222
225
|
}
|
|
223
226
|
return values.filter((val) => {
|
|
@@ -258,18 +261,18 @@ export class TdsDropdown {
|
|
|
258
261
|
else {
|
|
259
262
|
normalizedValue = [convertToString(value)];
|
|
260
263
|
}
|
|
261
|
-
this.
|
|
264
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
262
265
|
return this.getSelectedChildren().map((element) => ({
|
|
263
266
|
value: element.value,
|
|
264
267
|
label: element.textContent.trim(),
|
|
265
268
|
}));
|
|
266
269
|
}
|
|
267
270
|
async reset() {
|
|
268
|
-
this.
|
|
271
|
+
this.updateDropdownStateFromUser([]);
|
|
269
272
|
}
|
|
270
273
|
async removeValue(oldValue) {
|
|
271
274
|
const newValues = this.selectedOptions.filter((v) => v !== oldValue);
|
|
272
|
-
this.
|
|
275
|
+
this.updateDropdownStateFromUser(newValues);
|
|
273
276
|
}
|
|
274
277
|
/** Method that forces focus on the input element. */
|
|
275
278
|
async focusElement() {
|
|
@@ -349,10 +352,8 @@ export class TdsDropdown {
|
|
|
349
352
|
componentWillLoad() {
|
|
350
353
|
// First handle the value prop if it exists
|
|
351
354
|
if (this.value !== null && this.value !== undefined) {
|
|
352
|
-
console.log('Initial value:', this.value); // Debug
|
|
353
355
|
const normalizedValue = this.normalizeValue(this.value);
|
|
354
|
-
|
|
355
|
-
this.updateDropdownState(normalizedValue);
|
|
356
|
+
this.updateDropdownStateInternal(normalizedValue);
|
|
356
357
|
return; // Exit early if we handled the value prop
|
|
357
358
|
}
|
|
358
359
|
// Only use defaultValue if no value prop was provided
|
|
@@ -360,8 +361,8 @@ export class TdsDropdown {
|
|
|
360
361
|
const defaultValueStr = convertToString(this.defaultValue);
|
|
361
362
|
const initialValue = this.multiselect
|
|
362
363
|
? defaultValueStr.split(',').map(convertToString)
|
|
363
|
-
: [
|
|
364
|
-
this.
|
|
364
|
+
: [defaultValueStr];
|
|
365
|
+
this.updateDropdownStateInternal(initialValue);
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
368
|
/** Method to handle slot changes */
|
|
@@ -377,10 +378,10 @@ export class TdsDropdown {
|
|
|
377
378
|
*/
|
|
378
379
|
async appendValue(value) {
|
|
379
380
|
if (this.multiselect) {
|
|
380
|
-
this.
|
|
381
|
+
this.updateDropdownStateFromUser([...this.selectedOptions, value]);
|
|
381
382
|
}
|
|
382
383
|
else {
|
|
383
|
-
this.
|
|
384
|
+
this.updateDropdownStateFromUser([value]);
|
|
384
385
|
}
|
|
385
386
|
}
|
|
386
387
|
componentDidRender() {
|
|
@@ -395,11 +396,16 @@ export class TdsDropdown {
|
|
|
395
396
|
form.removeEventListener('reset', this.resetInput);
|
|
396
397
|
}
|
|
397
398
|
}
|
|
399
|
+
connectedCallback() {
|
|
400
|
+
if (!this.tdsAriaLabel) {
|
|
401
|
+
console.warn('Tegel Dropdown component: tdsAriaLabel prop is missing');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
398
404
|
render() {
|
|
399
405
|
appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
|
|
400
|
-
return (h(Host, { key: '
|
|
406
|
+
return (h(Host, { key: 'b8c418ebe609789c1610178d764a7d620e2231c2', class: {
|
|
401
407
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
402
|
-
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: '
|
|
408
|
+
} }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ee5c005d5020e2226ce54c93a90f2098e081a6df', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'ca674a2361f1301886bb855b7093c67b999a500a', class: {
|
|
403
409
|
'dropdown-select': true,
|
|
404
410
|
[this.size]: true,
|
|
405
411
|
'disabled': this.disabled,
|
|
@@ -412,7 +418,7 @@ export class TdsDropdown {
|
|
|
412
418
|
label-inside-as-placeholder
|
|
413
419
|
${this.size}
|
|
414
420
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
415
|
-
` }, this.label)), h("input", {
|
|
421
|
+
` }, this.label)), h("input", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled,
|
|
416
422
|
// eslint-disable-next-line no-return-assign
|
|
417
423
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
418
424
|
placeholder: this.labelPosition === 'inside',
|
|
@@ -426,8 +432,7 @@ export class TdsDropdown {
|
|
|
426
432
|
if (event.key === 'Escape') {
|
|
427
433
|
this.open = false;
|
|
428
434
|
}
|
|
429
|
-
}
|
|
430
|
-
})), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
435
|
+
} })), h("tds-icon", { tabIndex: 0, role: "button", "aria-label": "Clear filter", svgTitle: "Clear filter", onClick: this.handleFilterReset, onKeyDown: (event) => {
|
|
431
436
|
if (event.key === 'Enter') {
|
|
432
437
|
this.handleFilterReset();
|
|
433
438
|
}
|
|
@@ -438,7 +443,7 @@ export class TdsDropdown {
|
|
|
438
443
|
if (event.key === 'Enter') {
|
|
439
444
|
this.handleToggleOpen();
|
|
440
445
|
}
|
|
441
|
-
}, class: `menu-icon ${this.open ? 'open' : 'closed'}`, name: "chevron_down", size: "16px" }))) : (h("button", { onClick: () => this.handleToggleOpen(), onKeyDown: (event) => {
|
|
446
|
+
}, 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) => {
|
|
442
447
|
if (event.key === 'Escape') {
|
|
443
448
|
this.open = false;
|
|
444
449
|
}
|
|
@@ -450,7 +455,7 @@ export class TdsDropdown {
|
|
|
450
455
|
label-inside-as-placeholder
|
|
451
456
|
${this.size}
|
|
452
457
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
453
|
-
` }, 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: '
|
|
458
|
+
` }, 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) => {
|
|
454
459
|
this.dropdownList = element;
|
|
455
460
|
}, class: {
|
|
456
461
|
'dropdown-list': true,
|
|
@@ -461,11 +466,11 @@ export class TdsDropdown {
|
|
|
461
466
|
'closed': !this.open,
|
|
462
467
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
463
468
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
464
|
-
} }, h("slot", { key: '
|
|
469
|
+
} }, 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: {
|
|
465
470
|
helper: true,
|
|
466
471
|
error: this.error,
|
|
467
472
|
disabled: this.disabled,
|
|
468
|
-
} }, this.error && h("tds-icon", { key: '
|
|
473
|
+
} }, this.error && h("tds-icon", { key: 'c0ccc491caa1aca628aff12e02d8a917a74e9c86', name: "error", size: "16px" }), this.helper))));
|
|
469
474
|
}
|
|
470
475
|
static get is() { return "tds-dropdown"; }
|
|
471
476
|
static get encapsulation() { return "shadow"; }
|
|
@@ -780,6 +785,23 @@ export class TdsDropdown {
|
|
|
780
785
|
"attribute": "value",
|
|
781
786
|
"reflect": false,
|
|
782
787
|
"defaultValue": "null"
|
|
788
|
+
},
|
|
789
|
+
"tdsAriaLabel": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"mutable": false,
|
|
792
|
+
"complexType": {
|
|
793
|
+
"original": "string",
|
|
794
|
+
"resolved": "string",
|
|
795
|
+
"references": {}
|
|
796
|
+
},
|
|
797
|
+
"required": false,
|
|
798
|
+
"optional": false,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [],
|
|
801
|
+
"text": "Defines aria-label attribute for input"
|
|
802
|
+
},
|
|
803
|
+
"attribute": "tds-aria-label",
|
|
804
|
+
"reflect": false
|
|
783
805
|
}
|
|
784
806
|
};
|
|
785
807
|
}
|
|
@@ -49,7 +49,7 @@ export class Icon {
|
|
|
49
49
|
"mutable": false,
|
|
50
50
|
"complexType": {
|
|
51
51
|
"original": "IconNames",
|
|
52
|
-
"resolved": "\"profile\" | \"expand\" | \"info\" | \"error\" | \"global\" | \"copy\" | \"document\" | \"link\" | \"image\" | \"download\" | \"target\" | \"history\" | \"print\" | \"24v_battery_inactive\" | \"24v_battery\" | \"arrow_diagonal\" | \"arrow_down\" | \"arrow_left\" | \"arrow_right\" | \"arrow_up\" | \"audio_inactive\" | \"back\" | \"backward_inactive\" | \"backward\" | \"bento\" | \"burger\" | \"calendar_inactive\" | \"calendar\" | \"card\" | \"cart\" | \"charging_speed_inactive\" | \"charging_speed\" | \"charging_stopped\" | \"chevron_down\" | \"chevron_left\" | \"chevron_right\" | \"chevron_up\" | \"clock_inactive\" | \"clock\" | \"contact_inactive\" | \"contact\" | \"cross\" | \"dashboard\" | \"document_check\" | \"document_doc\" | \"document_eye\" | \"document_pdf\" | \"document_ppt\" | \"document_tool\" | \"document_wrong\" | \"document_xls\" | \"dollar\" | \"doner\" | \"double_kebab\" | \"edit_inactive\" | \"edit\" | \"email\" | \"export_inactive\" | \"export\" | \"eye_inactive\" | \"eye\" | \"face_dissatisfied\" | \"face_neutral\" | \"face_satisfied\" | \"filters_inactive\" | \"filters\" | \"flash\" | \"folder\" | \"forward_inactive\" | \"fuel_gauge_inactive\" | \"fuel_gauge\" | \"hatch_open_inactive\" | \"heart_inactive\" | \"heart\" | \"heating_inactive_screen\" | \"history_inactive\" | \"home_inactive\" | \"home\" | \"image_add\" | \"image_inactive\" | \"image_set\" | \"insights\" | \"kebab\" | \"link_broken\" | \"lock_inactive\" | \"lock\" | \"maximize_fullscreen\" | \"meatballs\" | \"message_inactive\" | \"message\" | \"mileage_inactive\" | \"mileage\" | \"minimize_fullscreen\" | \"minus\" | \"notification_inactive\" | \"notification\" | \"pause_inactive\" | \"pause\" | \"phone_inactive\" | \"phone\" | \"pie_chart\" | \"pin_inactive\" | \"pin\" | \"plus\" | \"print_inactive\" | \"profile_inactive\" | \"proportions_inactive\" | \"proportions\" | \"range_inactive\" | \"range\" | \"redirect\" | \"refresh_inactive\" | \"refresh\" | \"reload_inactive\" | \"reload\" | \"report_inactive\" | \"report\" | \"save_inactive\" | \"save\" | \"search\" | \"send_inactive\" | \"send\" | \"settings\" | \"share\" | \"skip_backwards\" | \"skip_forward\" | \"smartphone_inactive\" | \"smartphone\" | \"sorting\" | \"speedometer_inactive\" | \"speedometer\" | \"star\" | \"support\" | \"target_inactive\" | \"text_inactive\" | \"tick\" | \"timer\" | \"tool_inactive\" | \"tool\" | \"trailer\" | \"trash_inactive\" | \"trash\" | \"truck\" | \"upload\" | \"wallet\" | \"warning\" | \"wifi_inactive\" | \"wifi\"",
|
|
52
|
+
"resolved": "\"profile\" | \"expand\" | \"info\" | \"error\" | \"global\" | \"merge\" | \"copy\" | \"document\" | \"audio\" | \"link\" | \"video\" | \"image\" | \"text\" | \"download\" | \"target\" | \"placeholder\" | \"history\" | \"print\" | \"key\" | \"24v_battery_inactive\" | \"24v_battery\" | \"acceleration_inactive\" | \"acceleration\" | \"adblue_inactive\" | \"adblue\" | \"arrow_diagonal\" | \"arrow_down\" | \"arrow_left\" | \"arrow_right\" | \"arrow_up\" | \"audio_inactive\" | \"award\" | \"back\" | \"backward_inactive\" | \"backward\" | \"bento\" | \"bug_inactive\" | \"bug\" | \"burger\" | \"bus_inactive\" | \"bus\" | \"calendar_inactive\" | \"calendar\" | \"camera_inactive\" | \"camera\" | \"card\" | \"cart\" | \"charging_complete\" | \"charging_failed\" | \"charging_speed_inactive\" | \"charging_speed\" | \"charging_stopped\" | \"chevron_down\" | \"chevron_left\" | \"chevron_right\" | \"chevron_up\" | \"clock_inactive\" | \"clock\" | \"contact_inactive\" | \"contact\" | \"cookie_inactive\" | \"cookie\" | \"coolant_level_inactive\" | \"coolant_level\" | \"cross\" | \"cup_inactive\" | \"cup\" | \"dashboard\" | \"department_inactive\" | \"department\" | \"departure_scheduling_inactive\" | \"departure_scheduling\" | \"diamond_inactive\" | \"diamond\" | \"document_check\" | \"document_doc\" | \"document_eye\" | \"document_pdf\" | \"document_plus_inactive\" | \"document_plus\" | \"document_ppt\" | \"document_tool\" | \"document_wrong\" | \"document_xls\" | \"dollar\" | \"doner\" | \"double_kebab\" | \"driving_licence_inactive\" | \"driving_licence\" | \"drop_inactive\" | \"drop\" | \"edit_inactive\" | \"edit\" | \"email\" | \"engine_inactive\" | \"engine\" | \"environment_inactive\" | \"environment\" | \"exit\" | \"expand_inactive\" | \"export_inactive\" | \"export\" | \"eye_inactive\" | \"eye\" | \"face_dissatisfied\" | \"face_neutral\" | \"face_satisfied\" | \"factory_inactive\" | \"factory\" | \"ferry_inactive\" | \"ferry\" | \"filters_inactive\" | \"filters\" | \"flash_inactive\" | \"flash\" | \"folder\" | \"forward_inactive\" | \"forward\" | \"fuel_gauge_inactive\" | \"fuel_gauge\" | \"fuel_inactive\" | \"fuel\" | \"gift inactive\" | \"gift\" | \"guided_tour_inactive\" | \"guided_tour\" | \"hatch_open_1\" | \"hatch_open_2\" | \"hatch_open_inactive\" | \"hatch_open\" | \"heart_inactive\" | \"heart\" | \"heating_inactive_screen\" | \"history_inactive\" | \"home_inactive\" | \"home\" | \"idea_inactive\" | \"idea\" | \"image_add\" | \"image_inactive\" | \"image_set\" | \"insights\" | \"kebab\" | \"key_inactive\" | \"layer_inactive\" | \"layer\" | \"link_broken\" | \"list_inactive\" | \"list\" | \"lock_inactive\" | \"lock\" | \"map_cursor_inactive\" | \"map_cursor\" | \"maximize_fullscreen\" | \"meatballs\" | \"merge_inactive\" | \"message_inactive\" | \"message\" | \"mileage_inactive\" | \"mileage\" | \"minimize_fullscreen\" | \"minus\" | \"navigate_inactive\" | \"navigate\" | \"notification_inactive\" | \"notification\" | \"oil_level_inactive\" | \"oil_level\" | \"pause_inactive\" | \"pause\" | \"phone_inactive\" | \"phone\" | \"pie_chart\" | \"pin_inactive\" | \"pin\" | \"play_inactive\" | \"play\" | \"plus\" | \"powerplug_inactive\" | \"powerplug\" | \"print_inactive\" | \"privacy_inactive\" | \"privacy\" | \"profile_inactive\" | \"proportions_inactive\" | \"proportions\" | \"range_inactive\" | \"range\" | \"redirect\" | \"refresh_inactive\" | \"refresh\" | \"reload_inactive\" | \"reload\" | \"repeat\" | \"report_inactive\" | \"report\" | \"route_inactive\" | \"route\" | \"save_inactive\" | \"save\" | \"search\" | \"send_inactive\" | \"send\" | \"settings\" | \"share\" | \"skip_backwards\" | \"skip_forward\" | \"smartphone_inactive\" | \"smartphone\" | \"sorting\" | \"speedometer_inactive\" | \"speedometer\" | \"star\" | \"support\" | \"target_inactive\" | \"temperature_inactive\" | \"temperature\" | \"text_inactive\" | \"thumbs_down\" | \"thumbs_up\" | \"tick\" | \"timer\" | \"tool_inactive\" | \"tool\" | \"trailer_inactive\" | \"trailer\" | \"trash_inactive\" | \"trash\" | \"truck_inactive\" | \"truck\" | \"undo_inactive\" | \"undo\" | \"unlock\" | \"upload\" | \"video_inactive\" | \"wallet\" | \"warning\" | \"weight_inactive\" | \"weight\" | \"wifi_inactive\" | \"wifi\" | \"windscreen_heating_inactive\" | \"windscreen_heating\"",
|
|
53
53
|
"references": {
|
|
54
54
|
"IconNames": {
|
|
55
55
|
"location": "import",
|