@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
|
@@ -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,16 +14,15 @@ 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 = () => {
|
|
21
21
|
const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
|
|
22
22
|
if (tdsDropdownOptions.length === 0) {
|
|
23
|
-
console.warn('TDS DROPDOWN:
|
|
23
|
+
console.warn('TDS DROPDOWN: No options found. Disregard if loading data asynchronously.');
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
return tdsDropdownOptions;
|
|
25
|
+
return tdsDropdownOptions;
|
|
27
26
|
};
|
|
28
27
|
this.getSelectedChildren = () => {
|
|
29
28
|
if (this.selectedOptions.length === 0)
|
|
@@ -31,7 +30,7 @@ export class TdsDropdown {
|
|
|
31
30
|
return this.selectedOptions
|
|
32
31
|
.map((stringValue) => {
|
|
33
32
|
var _a;
|
|
34
|
-
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));
|
|
35
34
|
return matchingElement;
|
|
36
35
|
})
|
|
37
36
|
.filter(Boolean);
|
|
@@ -150,6 +149,7 @@ export class TdsDropdown {
|
|
|
150
149
|
this.noResultText = 'No result';
|
|
151
150
|
this.defaultValue = undefined;
|
|
152
151
|
this.value = null;
|
|
152
|
+
this.tdsAriaLabel = undefined;
|
|
153
153
|
this.open = false;
|
|
154
154
|
this.internalValue = undefined;
|
|
155
155
|
this.filterResult = undefined;
|
|
@@ -162,50 +162,69 @@ export class TdsDropdown {
|
|
|
162
162
|
const normalizedValue = this.normalizeValue(newValue);
|
|
163
163
|
// Only update if actually changed
|
|
164
164
|
if (this.hasValueChanged(normalizedValue, this.selectedOptions)) {
|
|
165
|
-
this.
|
|
165
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
normalizeValue(value) {
|
|
169
|
-
if (
|
|
170
|
-
return [];
|
|
171
|
-
// For
|
|
172
|
-
if (this.multiselect) {
|
|
169
|
+
if (value === null || value === undefined || value === '')
|
|
170
|
+
return [];
|
|
171
|
+
// For single select, ensure we handle both string and array inputs
|
|
172
|
+
if (!this.multiselect) {
|
|
173
|
+
// If array is passed to single select, take first value
|
|
173
174
|
if (Array.isArray(value)) {
|
|
174
|
-
return
|
|
175
|
+
return [convertToString(value[0])];
|
|
175
176
|
}
|
|
176
|
-
return value
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
return [convertToString(value)];
|
|
178
|
+
}
|
|
179
|
+
// For multiselect
|
|
180
|
+
if (Array.isArray(value)) {
|
|
181
|
+
return convertArrayToStrings(value);
|
|
180
182
|
}
|
|
181
|
-
//
|
|
182
|
-
return
|
|
183
|
+
// Handle comma-separated string for multiselect
|
|
184
|
+
return value
|
|
185
|
+
.toString()
|
|
186
|
+
.split(',')
|
|
187
|
+
.filter((v) => v !== '');
|
|
183
188
|
}
|
|
184
189
|
hasValueChanged(newValue, currentValue) {
|
|
185
190
|
if (newValue.length !== currentValue.length)
|
|
186
191
|
return true;
|
|
187
192
|
return newValue.some((val) => !currentValue.includes(val));
|
|
188
193
|
}
|
|
189
|
-
|
|
194
|
+
updateDropdownStateInternal(values) {
|
|
195
|
+
this.updateDropdownState(values, false);
|
|
196
|
+
}
|
|
197
|
+
updateDropdownStateFromUser(values) {
|
|
198
|
+
this.updateDropdownState(values, true);
|
|
199
|
+
}
|
|
200
|
+
updateDropdownState(values, emitChange = true) {
|
|
201
|
+
// Validate the values first
|
|
202
|
+
const validValues = this.validateValues(values);
|
|
190
203
|
// Update internal state
|
|
191
|
-
this.selectedOptions = [...
|
|
192
|
-
//
|
|
204
|
+
this.selectedOptions = [...validValues];
|
|
205
|
+
// Update the value prop
|
|
193
206
|
this.value = this.multiselect ? this.selectedOptions : this.selectedOptions[0] || null;
|
|
194
|
-
//
|
|
207
|
+
// Update internal value for display
|
|
195
208
|
this.internalValue = this.getValue();
|
|
196
209
|
// Update DOM
|
|
197
210
|
this.updateOptionElements();
|
|
198
211
|
// Update display value
|
|
199
212
|
this.updateDisplayValue();
|
|
200
|
-
// Emit change event
|
|
201
|
-
|
|
213
|
+
// Emit change event only if value has changed by user
|
|
214
|
+
if (emitChange)
|
|
215
|
+
this.emitChange();
|
|
202
216
|
// Update value attribute
|
|
203
217
|
this.setValueAttribute();
|
|
204
218
|
}
|
|
205
219
|
validateValues(values) {
|
|
220
|
+
// Make sure we have children before validation
|
|
221
|
+
const children = this.getChildren();
|
|
222
|
+
if (!children || children.length === 0) {
|
|
223
|
+
console.warn('No dropdown options found');
|
|
224
|
+
return values; // Return original values if no children yet
|
|
225
|
+
}
|
|
206
226
|
return values.filter((val) => {
|
|
207
|
-
|
|
208
|
-
const isValid = (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.some((element) => element.value === val);
|
|
227
|
+
const isValid = children.some((element) => convertToString(element.value) === convertToString(val));
|
|
209
228
|
if (!isValid) {
|
|
210
229
|
console.warn(`Option with value "${val}" does not exist`);
|
|
211
230
|
}
|
|
@@ -242,18 +261,18 @@ export class TdsDropdown {
|
|
|
242
261
|
else {
|
|
243
262
|
normalizedValue = [convertToString(value)];
|
|
244
263
|
}
|
|
245
|
-
this.
|
|
264
|
+
this.updateDropdownStateFromUser(normalizedValue);
|
|
246
265
|
return this.getSelectedChildren().map((element) => ({
|
|
247
266
|
value: element.value,
|
|
248
267
|
label: element.textContent.trim(),
|
|
249
268
|
}));
|
|
250
269
|
}
|
|
251
270
|
async reset() {
|
|
252
|
-
this.
|
|
271
|
+
this.updateDropdownStateFromUser([]);
|
|
253
272
|
}
|
|
254
273
|
async removeValue(oldValue) {
|
|
255
274
|
const newValues = this.selectedOptions.filter((v) => v !== oldValue);
|
|
256
|
-
this.
|
|
275
|
+
this.updateDropdownStateFromUser(newValues);
|
|
257
276
|
}
|
|
258
277
|
/** Method that forces focus on the input element. */
|
|
259
278
|
async focusElement() {
|
|
@@ -331,13 +350,19 @@ export class TdsDropdown {
|
|
|
331
350
|
}
|
|
332
351
|
}
|
|
333
352
|
componentWillLoad() {
|
|
334
|
-
|
|
335
|
-
|
|
353
|
+
// First handle the value prop if it exists
|
|
354
|
+
if (this.value !== null && this.value !== undefined) {
|
|
355
|
+
const normalizedValue = this.normalizeValue(this.value);
|
|
356
|
+
this.updateDropdownStateInternal(normalizedValue);
|
|
357
|
+
return; // Exit early if we handled the value prop
|
|
358
|
+
}
|
|
359
|
+
// Only use defaultValue if no value prop was provided
|
|
360
|
+
if (this.defaultValue !== null && this.defaultValue !== undefined) {
|
|
336
361
|
const defaultValueStr = convertToString(this.defaultValue);
|
|
337
362
|
const initialValue = this.multiselect
|
|
338
363
|
? defaultValueStr.split(',').map(convertToString)
|
|
339
|
-
: [
|
|
340
|
-
this.
|
|
364
|
+
: [defaultValueStr];
|
|
365
|
+
this.updateDropdownStateInternal(initialValue);
|
|
341
366
|
}
|
|
342
367
|
}
|
|
343
368
|
/** Method to handle slot changes */
|
|
@@ -353,10 +378,10 @@ export class TdsDropdown {
|
|
|
353
378
|
*/
|
|
354
379
|
async appendValue(value) {
|
|
355
380
|
if (this.multiselect) {
|
|
356
|
-
this.
|
|
381
|
+
this.updateDropdownStateFromUser([...this.selectedOptions, value]);
|
|
357
382
|
}
|
|
358
383
|
else {
|
|
359
|
-
this.
|
|
384
|
+
this.updateDropdownStateFromUser([value]);
|
|
360
385
|
}
|
|
361
386
|
}
|
|
362
387
|
componentDidRender() {
|
|
@@ -371,11 +396,16 @@ export class TdsDropdown {
|
|
|
371
396
|
form.removeEventListener('reset', this.resetInput);
|
|
372
397
|
}
|
|
373
398
|
}
|
|
399
|
+
connectedCallback() {
|
|
400
|
+
if (!this.tdsAriaLabel) {
|
|
401
|
+
console.warn('Tegel Dropdown component: tdsAriaLabel prop is missing');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
374
404
|
render() {
|
|
375
405
|
appendHiddenInput(this.host, this.name, this.selectedOptions.join(','), this.disabled);
|
|
376
|
-
return (h(Host, { key: '
|
|
406
|
+
return (h(Host, { key: 'b8c418ebe609789c1610178d764a7d620e2231c2', class: {
|
|
377
407
|
[`tds-mode-variant-${this.modeVariant}`]: Boolean(this.modeVariant),
|
|
378
|
-
} }, 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: {
|
|
379
409
|
'dropdown-select': true,
|
|
380
410
|
[this.size]: true,
|
|
381
411
|
'disabled': this.disabled,
|
|
@@ -388,7 +418,7 @@ export class TdsDropdown {
|
|
|
388
418
|
label-inside-as-placeholder
|
|
389
419
|
${this.size}
|
|
390
420
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
391
|
-
` }, this.label)), h("input", {
|
|
421
|
+
` }, this.label)), h("input", { "aria-label": this.tdsAriaLabel, "aria-disabled": this.disabled,
|
|
392
422
|
// eslint-disable-next-line no-return-assign
|
|
393
423
|
ref: (inputEl) => (this.inputElement = inputEl), class: {
|
|
394
424
|
placeholder: this.labelPosition === 'inside',
|
|
@@ -402,8 +432,7 @@ export class TdsDropdown {
|
|
|
402
432
|
if (event.key === 'Escape') {
|
|
403
433
|
this.open = false;
|
|
404
434
|
}
|
|
405
|
-
}
|
|
406
|
-
})), 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) => {
|
|
407
436
|
if (event.key === 'Enter') {
|
|
408
437
|
this.handleFilterReset();
|
|
409
438
|
}
|
|
@@ -414,7 +443,7 @@ export class TdsDropdown {
|
|
|
414
443
|
if (event.key === 'Enter') {
|
|
415
444
|
this.handleToggleOpen();
|
|
416
445
|
}
|
|
417
|
-
}, 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) => {
|
|
418
447
|
if (event.key === 'Escape') {
|
|
419
448
|
this.open = false;
|
|
420
449
|
}
|
|
@@ -426,7 +455,7 @@ export class TdsDropdown {
|
|
|
426
455
|
label-inside-as-placeholder
|
|
427
456
|
${this.size}
|
|
428
457
|
${this.selectedOptions.length ? 'selected' : ''}
|
|
429
|
-
` }, 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) => {
|
|
430
459
|
this.dropdownList = element;
|
|
431
460
|
}, class: {
|
|
432
461
|
'dropdown-list': true,
|
|
@@ -437,11 +466,11 @@ export class TdsDropdown {
|
|
|
437
466
|
'closed': !this.open,
|
|
438
467
|
[`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
|
|
439
468
|
[`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
|
|
440
|
-
} }, 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: {
|
|
441
470
|
helper: true,
|
|
442
471
|
error: this.error,
|
|
443
472
|
disabled: this.disabled,
|
|
444
|
-
} }, this.error && h("tds-icon", { key: '
|
|
473
|
+
} }, this.error && h("tds-icon", { key: 'c0ccc491caa1aca628aff12e02d8a917a74e9c86', name: "error", size: "16px" }), this.helper))));
|
|
445
474
|
}
|
|
446
475
|
static get is() { return "tds-dropdown"; }
|
|
447
476
|
static get encapsulation() { return "shadow"; }
|
|
@@ -756,6 +785,23 @@ export class TdsDropdown {
|
|
|
756
785
|
"attribute": "value",
|
|
757
786
|
"reflect": false,
|
|
758
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
|
|
759
805
|
}
|
|
760
806
|
};
|
|
761
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",
|