@scania/tegel 1.23.0-fix-form-components-slider-reset-beta.1 → 1.23.0-value-prop-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.
Files changed (35) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/tds-checkbox.cjs.entry.js +9 -2
  3. package/dist/cjs/tds-dropdown_2.cjs.entry.js +128 -159
  4. package/dist/cjs/tds-slider.cjs.entry.js +14 -13
  5. package/dist/cjs/tegel.cjs.js +1 -1
  6. package/dist/collection/components/checkbox/checkbox.js +19 -3
  7. package/dist/collection/components/dropdown/dropdown.js +200 -209
  8. package/dist/collection/components/slider/slider.js +14 -13
  9. package/dist/components/{p-2523819c.js → p-ca4b945d.js} +135 -164
  10. package/dist/components/{p-e4d7c655.js → p-d921fe75.js} +10 -3
  11. package/dist/components/{p-462b77e8.js → p-e7868876.js} +1 -1
  12. package/dist/components/tds-checkbox.js +1 -1
  13. package/dist/components/tds-dropdown-option.js +1 -1
  14. package/dist/components/tds-dropdown.js +1 -1
  15. package/dist/components/tds-slider.js +14 -13
  16. package/dist/components/tds-table-body-row.js +1 -1
  17. package/dist/components/tds-table-footer.js +3 -3
  18. package/dist/components/tds-table-header.js +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/esm/tds-checkbox.entry.js +9 -2
  21. package/dist/esm/tds-dropdown_2.entry.js +128 -159
  22. package/dist/esm/tds-slider.entry.js +14 -13
  23. package/dist/esm/tegel.js +1 -1
  24. package/dist/tegel/p-2557b79b.entry.js +1 -0
  25. package/dist/tegel/p-6a52ed63.entry.js +1 -0
  26. package/dist/tegel/p-e252ba6e.entry.js +1 -0
  27. package/dist/tegel/tegel.esm.js +1 -1
  28. package/dist/types/components/checkbox/checkbox.d.ts +2 -0
  29. package/dist/types/components/dropdown/dropdown.d.ts +20 -36
  30. package/dist/types/components/slider/slider.d.ts +1 -0
  31. package/dist/types/components.d.ts +21 -11
  32. package/package.json +1 -1
  33. package/dist/tegel/p-1dc00838.entry.js +0 -1
  34. package/dist/tegel/p-979f5255.entry.js +0 -1
  35. package/dist/tegel/p-a464920f.entry.js +0 -1
@@ -308,37 +308,38 @@ export class TdsSlider {
308
308
  componentDidRender() {
309
309
  // Only add the event listener once:
310
310
  if (!this.resetEventListenerAdded) {
311
- const form = this.host.closest('form');
312
- form.addEventListener('reset', this.resetToInitialValue);
313
- this.resetEventListenerAdded = true;
311
+ this.formElement = this.host.closest('form');
312
+ if (this.formElement) {
313
+ this.formElement.addEventListener('reset', this.resetToInitialValue);
314
+ this.resetEventListenerAdded = true;
315
+ }
314
316
  }
315
317
  }
316
318
  disconnectedCallback() {
317
- if (this.resetEventListenerAdded) {
318
- const form = this.host.closest('form');
319
- form.removeEventListener('reset', this.resetToInitialValue);
319
+ if (this.resetEventListenerAdded && this.formElement) {
320
+ this.formElement.removeEventListener('reset', this.resetToInitialValue);
320
321
  this.resetEventListenerAdded = false;
321
322
  }
322
323
  }
323
324
  render() {
324
- return (h("div", { key: '63ea8117e50706f80560bf1c738adfd34e2ffade', class: {
325
+ return (h("div", { key: 'ed4c71d1701e0711d8b01c015f137f6a3f10457e', class: {
325
326
  'tds-slider-wrapper': true,
326
327
  'read-only': this.readOnly,
327
- } }, h("input", { key: '7f3913b7aed2b7f60a51e4e98f4676504479d54b', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, value: this.value, disabled: this.disabled }), h("div", { key: '538960334a39ca0e6433a9c42bee53fc6672e9f3', class: {
328
+ } }, h("input", { key: '7d85ba109ec41e45a4ced646cfe092832b2013a7', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, value: this.value, disabled: this.disabled }), h("div", { key: '7c32efe653a6437068026e0b612bd1cdb0fd580d', class: {
328
329
  'tds-slider': true,
329
330
  'disabled': this.disabled,
330
331
  'tds-slider-small': this.useSmall,
331
332
  }, ref: (el) => {
332
333
  this.wrapperElement = el;
333
- } }, h("label", { key: '34a702130336ce556cd076d17737f19fca879173', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '31637244738afb7b4bebda45975883eab15fc143', class: "tds-slider__input-values" }, h("div", { key: '8f25a51e0f969e803975033ac5cd9de189ff382f', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '5bb85d505ad5d6fa56aa98324c0ccc6becc1cac8', class: "tds-slider__controls" }, h("div", { key: '9d28ac902fe71e5b984d1581680bb0b9ff839d5f', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: 'd1a9cb77050503995092d5b8c954be63fd47e8ac', name: "minus", size: "16px" })))), h("div", { key: '197087cd83b899584b9e5b50d90a9ff5469bec75', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: '0508886c27cf9e050d4cad370567f86abe4e99cc', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'd49d39bda80d5f0d59954a4e1111b68bb3b913fc', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '7cdf0b42f24292d0d676c693c551e27e9d91acfb', class: "tds-slider__track", ref: (el) => {
334
+ } }, h("label", { key: '5561410214fda42ddb4553084f312de9943f825b', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '37340de05febbca285f031bd8df7d9c2588e315d', class: "tds-slider__input-values" }, h("div", { key: 'e973831529eb93eb0b0da6c5f92bd838dfb9bcdb', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '1a710d2d1ffac7533f9bae2908d4341d3b40e2f0', class: "tds-slider__controls" }, h("div", { key: '0a741834782d8e69a7d55e6cd87a3fdf4938d744', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: '8c67943ac2e15d742726e76c2b4c029d15c20f32', name: "minus", size: "16px" })))), h("div", { key: '96c4229007fbe882e106bcc3deb34f504c9604e3', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: '905fc1a02070f5419f76ec5d60d8f55d89d4650b', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'd2ccbea1b6e26ab1855c81e71730bebea0da37d8', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '30c9b4bb6f59631d443345ee6d1edf1973a83d0b', class: "tds-slider__track", ref: (el) => {
334
335
  this.trackElement = el;
335
- }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: 'f4707af65bffecb418b0aefa8d5bd55055b94203', class: "tds-slider__track-fill", ref: (el) => {
336
+ }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: '7acbccae98c481c4cfaeb2dc66d67a2e19575b93', class: "tds-slider__track-fill", ref: (el) => {
336
337
  this.trackFillElement = el;
337
- } }), h("div", { key: 'ad4c0500f2914c0d5c005f7f640e76cf3fd08568', class: "tds-slider__thumb", ref: (el) => {
338
+ } }), h("div", { key: '46a5c3135c5f765d5fb0845372dc3854586fa44d', class: "tds-slider__thumb", ref: (el) => {
338
339
  this.thumbElement = el;
339
- }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: '9609b93ff20975991f43c97b469f697b04098fc1', class: "tds-slider__value" }, this.value, h("svg", { key: 'd2dd8e895d4e7c1afb398355afc57354cf544bce', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'c707a07e816dc4f1ec60c69b451ae0abb91e845d', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: '536a9cc10e038fb0923062633cc30deada006d42', class: "tds-slider__thumb-inner", ref: (el) => {
340
+ }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: 'd39cd29d1e6302f8bd4a3d827797f8822e24b84d', class: "tds-slider__value" }, this.value, h("svg", { key: '5946f90b70b2afb2efc7f3a3bc5817a82ac3ca4a', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '9456df642aca39b94b17bb529ca02e2d6a2fde6c', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: 'b4ca73a085f837d7e87e3334b8e58e5638125118', class: "tds-slider__thumb-inner", ref: (el) => {
340
341
  this.thumbInnerElement = el;
341
- } })))), this.useInput && (h("div", { key: 'c715bfb5737d0e8a093a671ee8ce9ab8f430cf75', class: "tds-slider__input-values" }, h("div", { key: '332c7b19d7a773e71236cd4a003d198aff18ff45', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: 'cc74d8c3a68928a619d5cb97551b42a7e37b7aee', class: "tds-slider__input-field-wrapper" }, h("input", { key: '8ea3c0e38ada475aef1c85de7afc304e9fafcfe7', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, readOnly: this.readOnly, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max })))), this.useControls && (h("div", { key: 'ac446557daecd66ceffb387f40cade3856722a06', class: "tds-slider__controls" }, h("div", { key: '641cb0da0d990af682975bb21263187e9bc50707', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: '0efffdea211e8de23c6f3a119956620b60c63d4b', name: "plus", size: "16px" })))))));
342
+ } })))), this.useInput && (h("div", { key: '6574286ac7764807fd1e18875d6fa39ab7f7b304', class: "tds-slider__input-values" }, h("div", { key: '57a92adf59551f551c4ae06355c276a69b34028a', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '0e1632ca8c9510177d349147749e3162aa46f219', class: "tds-slider__input-field-wrapper" }, h("input", { key: '094d194bce54d1073a5d657f7bc3f30107f5fe41', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, readOnly: this.readOnly, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max })))), this.useControls && (h("div", { key: '207398a3fd02e11f09c70ebbb8b293d6c16afd1f', class: "tds-slider__controls" }, h("div", { key: 'ca93ce9a55d0db25a3eaefd6e4dbc53106afc895', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: '6ab123f8701fdd93580a61c500ae6da658b547fd', name: "plus", size: "16px" })))))));
342
343
  }
343
344
  static get is() { return "tds-slider"; }
344
345
  static get originalStyleUrls() {
@@ -71,6 +71,14 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
71
71
  this.tdsFocus = createEvent(this, "tdsFocus", 6);
72
72
  this.tdsBlur = createEvent(this, "tdsBlur", 6);
73
73
  this.tdsInput = createEvent(this, "tdsInput", 6);
74
+ this.tdsValueChange = createEvent(this, "tdsValueChange", 6);
75
+ this.handleChange = () => {
76
+ const value = Array.isArray(this.value) ? this.value.join(',') : this.value;
77
+ this.tdsChange.emit({
78
+ name: this.name,
79
+ value: value !== null && value !== void 0 ? value : null,
80
+ });
81
+ };
74
82
  this.setDefaultOption = () => {
75
83
  if (this.defaultValue) {
76
84
  const children = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
@@ -99,7 +107,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
99
107
  }
100
108
  }
101
109
  };
102
- /* Returns a list of all children that are tds-dropdown-option elements */
103
110
  this.getChildren = () => {
104
111
  const tdsDropdownOptions = Array.from(this.host.children).filter((element) => element.tagName === 'TDS-DROPDOWN-OPTION');
105
112
  if (tdsDropdownOptions.length === 0) {
@@ -108,6 +115,38 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
108
115
  else
109
116
  return tdsDropdownOptions;
110
117
  };
118
+ this.getSelectedChildren = () => {
119
+ if (!this.value)
120
+ return [];
121
+ const valueArray = Array.isArray(this.value) ? this.value : [this.value];
122
+ return valueArray
123
+ .map((stringValue) => {
124
+ const matchingElement = this.getChildren().find((element) => element.value === stringValue);
125
+ return matchingElement;
126
+ })
127
+ .filter(Boolean);
128
+ };
129
+ this.getSelectedChildrenLabels = () => {
130
+ var _a;
131
+ return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
132
+ };
133
+ this.getValue = () => {
134
+ const labels = this.getSelectedChildrenLabels();
135
+ if (!labels) {
136
+ return '';
137
+ }
138
+ return labels === null || labels === void 0 ? void 0 : labels.join(', ');
139
+ };
140
+ this.setValueAttribute = () => {
141
+ var _a;
142
+ if (!this.value || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '') {
143
+ this.host.removeAttribute('value');
144
+ }
145
+ else {
146
+ const valueArray = Array.isArray(this.value) ? this.value : [this.value];
147
+ this.host.setAttribute('value', valueArray.map((val) => val).toString());
148
+ }
149
+ };
111
150
  this.getOpenDirection = () => {
112
151
  var _a, _b, _c, _d, _e;
113
152
  if (this.openDirection === 'auto' || !this.openDirection) {
@@ -121,7 +160,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
121
160
  }
122
161
  return this.openDirection;
123
162
  };
124
- /* Toggles the open state of the Dropdown and sets focus to the input element */
125
163
  this.handleToggleOpen = () => {
126
164
  if (!this.disabled) {
127
165
  this.open = !this.open;
@@ -130,38 +168,10 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
130
168
  }
131
169
  }
132
170
  };
133
- /* Focuses the input element in the Dropdown, if the reference is present. */
134
171
  this.focusInputElement = () => {
135
172
  if (this.inputElement)
136
173
  this.inputElement.focus();
137
174
  };
138
- this.getSelectedChildren = () => {
139
- var _a;
140
- return (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((stringValue) => {
141
- const matchingElement = this.getChildren().find((element) => element.value === stringValue);
142
- return matchingElement;
143
- }).filter(Boolean);
144
- };
145
- this.getSelectedChildrenLabels = () => {
146
- var _a;
147
- return (_a = this.getSelectedChildren()) === null || _a === void 0 ? void 0 : _a.map((element) => element.textContent.trim());
148
- };
149
- this.getValue = () => {
150
- const labels = this.getSelectedChildrenLabels();
151
- if (!labels) {
152
- return '';
153
- }
154
- return labels === null || labels === void 0 ? void 0 : labels.join(', ');
155
- };
156
- this.setValueAttribute = () => {
157
- var _a;
158
- if (!this.value || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) === '') {
159
- this.host.removeAttribute('value');
160
- }
161
- else {
162
- this.host.setAttribute('value', this.value.map((val) => val).toString());
163
- }
164
- };
165
175
  this.handleFilter = (event) => {
166
176
  this.tdsInput.emit(event);
167
177
  const query = event.target.value.toLowerCase();
@@ -207,13 +217,6 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
207
217
  this.handleBlur = (event) => {
208
218
  this.tdsBlur.emit(event);
209
219
  };
210
- this.handleChange = () => {
211
- var _a, _b;
212
- this.tdsChange.emit({
213
- name: this.name,
214
- value: (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString()) !== null && _b !== void 0 ? _b : null,
215
- });
216
- };
217
220
  this.name = undefined;
218
221
  this.disabled = false;
219
222
  this.helper = undefined;
@@ -230,107 +233,92 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
230
233
  this.normalizeText = true;
231
234
  this.noResultText = 'No result';
232
235
  this.defaultValue = undefined;
233
- this.open = false;
234
236
  this.value = undefined;
237
+ this.open = false;
238
+ this.internalValue = undefined;
235
239
  this.filterResult = undefined;
236
240
  this.filterFocus = undefined;
237
241
  }
238
- /** Method that resets the Dropdown, marks all children as non-selected and resets the value to null. */
239
- async reset() {
240
- this.dropdownList.scrollTop = 0;
241
- this.internalReset();
242
- this.handleChange();
243
- }
244
- /** Method that forces focus on the input element. */
245
- async focusElement() {
246
- this.focusInputElement();
247
- this.handleFocus({});
248
- }
249
- /** Method for setting the value of the Dropdown.
250
- *
251
- * Single selection example:
252
- *
253
- * <code>
254
- * dropdown.setValue('option-1', 'Option 1');
255
- * </code>
256
- *
257
- * Multiselect example:
258
- *
259
- * <code>
260
- * dropdown.setValue(['option-1', 'option-2']);
261
- * </code>
262
- */
263
- // The label is optional here ONLY to not break the API. Should be removed for 2.0.
264
- // @ts-ignore
265
- // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
266
- async setValue(value, label) {
267
- let nextValue;
268
- if (typeof value === 'string')
269
- nextValue = [value];
270
- else
271
- nextValue = value;
272
- if (!this.multiselect && nextValue.length > 1) {
242
+ handleValueChange(newValue) {
243
+ if (newValue === undefined)
244
+ return;
245
+ // Ensure consistent internal array representation
246
+ const valueArray = Array.isArray(newValue) ? newValue : newValue ? [newValue] : null;
247
+ // Handle multiselect validation
248
+ if (!this.multiselect && Array.isArray(valueArray) && valueArray.length > 1) {
273
249
  console.warn('Tried to select multiple items, but multiselect is not enabled.');
274
- nextValue = [nextValue[0]];
250
+ // Coerce to single value for non-multiselect
251
+ this.value = valueArray[0];
252
+ return;
275
253
  }
276
- nextValue = [...new Set(nextValue)];
277
- this.internalReset();
278
- for (let i = 0; i < nextValue.length; i++) {
279
- const optionExist = this.getChildren().some((element) => element.value === nextValue[i]);
280
- if (!optionExist) {
281
- nextValue.splice(i, 1);
254
+ // Ensure value is always array internally for backward compatibility
255
+ this.updateSelections(valueArray);
256
+ this.handleChange();
257
+ }
258
+ updateSelections(valueArray) {
259
+ // Reset current selections
260
+ this.getChildren().forEach((element) => {
261
+ element.setSelected(false);
262
+ });
263
+ if (valueArray) {
264
+ // Validate and filter values
265
+ const validValues = valueArray.filter((val) => {
266
+ const optionExists = this.getChildren().some((element) => element.value === val);
267
+ if (!optionExists) {
268
+ console.warn(`Option with value "${val}" does not exist`);
269
+ }
270
+ return optionExists;
271
+ });
272
+ // Update internal state and selections
273
+ this.internalValue = validValues.join(', ');
274
+ this.getChildren().forEach((element) => {
275
+ if (validValues.includes(element.value)) {
276
+ element.setSelected(true);
277
+ }
278
+ });
279
+ // Update value prop with validated values
280
+ if (this.multiselect) {
281
+ this.value = validValues;
282
+ }
283
+ else {
284
+ this.value = validValues[0] || null;
282
285
  }
283
286
  }
284
- this.value = nextValue;
285
- this.setValueAttribute();
286
- this.selectChildrenAsSelectedBasedOnSelectionProp();
287
+ else {
288
+ // Handle null/undefined case
289
+ this.internalValue = '';
290
+ this.value = this.multiselect ? [] : null;
291
+ }
292
+ // Emit change events
287
293
  this.handleChange();
288
- /* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
289
- /* https://tegel.atlassian.net/browse/CDEP-2703 */
290
- const selection = this.getSelectedChildren().map((element) => ({
294
+ // Update filter input if present
295
+ if (this.filter && this.inputElement) {
296
+ this.inputElement.value = this.internalValue;
297
+ }
298
+ this.setValueAttribute();
299
+ }
300
+ async setValue(value) {
301
+ this.value = value;
302
+ return this.getSelectedChildren().map((element) => ({
291
303
  value: element.value,
292
304
  label: element.textContent.trim(),
293
305
  }));
294
- // Update inputElement value and placeholder text
295
- if (this.filter) {
296
- this.inputElement.value = this.getValue();
297
- }
298
- return selection;
299
306
  }
300
- /**
301
- * @internal
302
- */
303
- async appendValue(value) {
304
- if (this.multiselect && this.value) {
305
- this.setValue([...this.value, value]);
306
- }
307
- else {
308
- this.setValue(value);
309
- }
307
+ async reset() {
308
+ this.value = this.multiselect ? [] : null;
310
309
  }
311
- /** Method for removing a selected value in the Dropdown. */
312
310
  async removeValue(oldValue) {
313
- var _a, _b;
314
- let label;
315
- if (this.multiselect) {
316
- (_a = this.getChildren()) === null || _a === void 0 ? void 0 : _a.forEach((element) => {
317
- var _a;
318
- if (element.value === oldValue) {
319
- this.value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter((value) => value !== element.value);
320
- label = element.textContent.trim();
321
- element.setSelected(false);
322
- }
323
- return element;
324
- });
311
+ if (this.multiselect && Array.isArray(this.value)) {
312
+ this.value = this.value.filter((v) => v !== oldValue);
325
313
  }
326
314
  else {
327
- this.reset();
315
+ this.value = null;
328
316
  }
329
- this.handleChange();
330
- this.setValueAttribute();
331
- /* This returns an array of object with a value and label pair. This is ONLY to not break the API. Should be removed for 2.0. */
332
- /* https://tegel.atlassian.net/browse/CDEP-2703 */
333
- return (_b = this.value) === null || _b === void 0 ? void 0 : _b.map((value) => ({ value, label }));
317
+ }
318
+ /** Method that forces focus on the input element. */
319
+ async focusElement() {
320
+ this.focusInputElement();
321
+ this.handleFocus({});
334
322
  }
335
323
  /** Method for closing the Dropdown. */
336
324
  async close() {
@@ -384,6 +372,9 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
384
372
  }
385
373
  }
386
374
  componentWillLoad() {
375
+ if (this.defaultValue && !this.value) {
376
+ this.value = this.defaultValue;
377
+ }
387
378
  this.setDefaultOption();
388
379
  }
389
380
  /** Method to handle slot changes */
@@ -394,34 +385,19 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
394
385
  normalizeString(text) {
395
386
  return this.normalizeText ? text.normalize('NFD').replace(/\p{Diacritic}/gu, '') : text;
396
387
  }
397
- /** Method that resets the dropdown without emitting an event. */
398
- internalReset() {
399
- this.getChildren().forEach((element) => {
400
- element.setSelected(false);
401
- return element;
402
- });
403
- this.value = null;
404
- this.setValueAttribute();
405
- }
406
- selectChildrenAsSelectedBasedOnSelectionProp() {
407
- this.getChildren().forEach((element) => {
408
- this.value.forEach((selection) => {
409
- if (element.value !== selection) {
410
- // If not multiselect, we need to unselect all other options.
411
- if (!this.multiselect) {
412
- element.setSelected(false);
413
- }
414
- }
415
- else {
416
- element.setSelected(true);
417
- }
418
- });
419
- });
388
+ async appendValue(value) {
389
+ if (this.multiselect) {
390
+ this.value = Array.isArray(this.value) ? [...this.value, value] : [value];
391
+ }
392
+ else {
393
+ this.value = value;
394
+ }
420
395
  }
421
396
  render() {
422
- var _a, _b, _c, _d;
423
- appendHiddenInput(this.host, this.name, (_a = this.value) === null || _a === void 0 ? void 0 : _a.map((value) => value).toString(), this.disabled);
424
- return (h(Host, { key: '1c4995be9b1e47e254ec9976b334c4d74a44263b', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: 'ad423934dedc56ff39d06bf7746e47d011bed002', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: '99c87c0add1152f47533bf6ef5e6794cffdbb18c', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
397
+ var _a, _b, _c;
398
+ const valueArray = Array.isArray(this.value) ? this.value : this.value ? [this.value] : [];
399
+ appendHiddenInput(this.host, this.name, valueArray.map((value) => value).toString(), this.disabled);
400
+ return (h(Host, { key: '2d1d0d7551c4f5a3197538a21b245b06abb95a5b', role: "select", class: `${this.modeVariant ? `tds-mode-variant-${this.modeVariant}` : ''}` }, this.label && this.labelPosition === 'outside' && (h("div", { key: '44bf815fc834febcf5bf90aeabeb4ff75ca74e0b', class: `label-outside ${this.disabled ? 'disabled' : ''}` }, this.label)), h("div", { key: 'fe8bddaad6f52c6860a8a3b02db796d927553c64', class: `dropdown-select ${this.size} ${this.disabled ? 'disabled' : ''}` }, this.filter ? (h("div", { class: {
425
401
  filter: true,
426
402
  focus: this.filterFocus,
427
403
  disabled: this.disabled,
@@ -429,7 +405,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
429
405
  } }, h("div", { class: "value-wrapper" }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
430
406
  label-inside-as-placeholder
431
407
  ${this.size}
432
- ${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
408
+ ${((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) ? 'selected' : ''}
433
409
  ` }, this.label)), h("input", {
434
410
  // eslint-disable-next-line no-return-assign
435
411
  ref: (inputEl) => (this.inputElement = inputEl), class: `${this.labelPosition === 'inside' ? 'placeholder' : ''}`, type: "text", placeholder: this.filterFocus ? '' : this.placeholder, value: this.multiselect && this.filterFocus ? '' : this.getValue(), disabled: this.disabled, onInput: (event) => this.handleFilter(event), onBlur: (event) => {
@@ -438,15 +414,7 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
438
414
  this.inputElement.value = this.getValue();
439
415
  }
440
416
  this.handleBlur(event);
441
- }, onFocus: (event) => {
442
- this.open = true;
443
- this.filterFocus = true;
444
- if (this.multiselect) {
445
- this.inputElement.value = '';
446
- }
447
- this.handleFocus(event);
448
- this.handleFilter({ target: { value: '' } });
449
- }, onKeyDown: (event) => {
417
+ }, onFocus: (event) => this.handleFocus(event), onKeyDown: (event) => {
450
418
  if (event.key === 'Escape') {
451
419
  this.open = false;
452
420
  }
@@ -470,8 +438,8 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
470
438
  `, disabled: this.disabled }, h("div", { class: `value-wrapper ${this.size}` }, this.label && this.labelPosition === 'inside' && this.placeholder && (h("div", { class: `label-inside ${this.size}` }, this.label)), this.label && this.labelPosition === 'inside' && !this.placeholder && (h("div", { class: `
471
439
  label-inside-as-placeholder
472
440
  ${this.size}
473
- ${((_c = this.value) === null || _c === void 0 ? void 0 : _c.length) ? 'selected' : ''}
474
- ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_d = this.value) === null || _d === void 0 ? void 0 : _d.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: 'dd850ac34b473f9cac51ad5bdc8417d994b7946a', ref: (element) => (this.dropdownList = element), class: {
441
+ ${((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) ? 'selected' : ''}
442
+ ` }, this.label)), h("div", { class: `placeholder ${this.size}` }, ((_c = this.value) === null || _c === void 0 ? void 0 : _c.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: '5a725e0e42ada175ff588849debe814f4558f907', ref: (element) => (this.dropdownList = element), class: {
475
443
  'dropdown-list': true,
476
444
  [this.size]: true,
477
445
  [this.getOpenDirection()]: true,
@@ -480,10 +448,11 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
480
448
  'closed': !this.open,
481
449
  [`animation-enter-${this.animation}`]: this.animation !== 'none' && this.open,
482
450
  [`animation-exit-${this.animation}`]: this.animation !== 'none' && !this.open,
483
- } }, h("slot", { key: '790885487da46ec88e05ad98272cbd43eb6fc7ac', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: '7d9c9f695c5dc2c734fa51a746c6c1c3547d5dec', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: 'b044b0d4dd3e39000fa0262a838aa860451e5986', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: '506204fd3f113c6a903b616372660902295d0886', name: "error", size: "16px" }), this.helper))));
451
+ } }, h("slot", { key: '7cece8ee2247cf1249719673734408216b1b9ad6', onSlotchange: () => this.handleSlotChange() }), this.filterResult === 0 && this.noResultText !== '' && (h("div", { key: 'c8e1bfb413f6247710b34707e6e86e454b04739c', class: `no-result ${this.size}` }, this.noResultText))), this.helper && (h("div", { key: '90dcb3ed5268866c95f88bb53a9a066451ebc505', class: `helper ${this.error ? 'error' : ''} ${this.disabled ? 'disabled' : ''}` }, this.error && h("tds-icon", { key: 'a216d63de9d7d6011c4bce0ee0b64f6ea90fa4e4', name: "error", size: "16px" }), this.helper))));
484
452
  }
485
453
  get host() { return this; }
486
454
  static get watchers() { return {
455
+ "value": ["handleValueChange"],
487
456
  "open": ["handleOpenState"]
488
457
  }; }
489
458
  static get style() { return TdsDropdownStyle0; }
@@ -504,17 +473,19 @@ const TdsDropdown = /*@__PURE__*/ proxyCustomElement(class TdsDropdown extends H
504
473
  "normalizeText": [4, "normalize-text"],
505
474
  "noResultText": [1, "no-result-text"],
506
475
  "defaultValue": [1, "default-value"],
476
+ "value": [1025],
507
477
  "open": [32],
508
- "value": [32],
478
+ "internalValue": [32],
509
479
  "filterResult": [32],
510
480
  "filterFocus": [32],
511
- "reset": [64],
512
- "focusElement": [64],
513
481
  "setValue": [64],
514
- "appendValue": [64],
482
+ "reset": [64],
515
483
  "removeValue": [64],
516
- "close": [64]
484
+ "focusElement": [64],
485
+ "close": [64],
486
+ "appendValue": [64]
517
487
  }, [[9, "mousedown", "onAnyClick"], [0, "keydown", "onKeyDown"]], {
488
+ "value": ["handleValueChange"],
518
489
  "open": ["handleOpenState"]
519
490
  }]);
520
491
  function defineCustomElement() {
@@ -49,12 +49,19 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
49
49
  handleBlur(event) {
50
50
  this.tdsBlur.emit(event);
51
51
  }
52
+ /** Listens for a reset event inside a form */
53
+ handleFormReset(event) {
54
+ if (this.host.closest('form') === event.target) {
55
+ this.checked = false;
56
+ this.indeterminate = false;
57
+ }
58
+ }
52
59
  render() {
53
- return (h("div", { key: '0efb982ab13c1d75681614675b649e010707b701', class: "tds-checkbox" }, h("input", { key: '834b29962978ea1cf7249018e6b7eea2417da5f4',
60
+ return (h("div", { key: '068b73081ab2b1b24d58fd2afd70f2b0e4308745', class: "tds-checkbox" }, h("input", { key: '97bd225b10dea56b8166ce3d5c2e4569a7dc76f9',
54
61
  // eslint-disable-next-line no-return-assign
55
62
  ref: (inputElement) => (this.inputElement = inputElement), indeterminate: this.indeterminate, "aria-checked": this.checked, "aria-required": this.required, "aria-describedby": this.host.getAttribute('aria-describedby'), "aria-labelledby": this.host.getAttribute('aria-labelledby'), required: this.required, type: "checkbox", name: this.name, value: this.value, id: this.checkboxId, checked: this.checked, disabled: this.disabled, onFocus: (event) => this.handleFocus(event), onBlur: (event) => this.handleBlur(event), onChange: () => {
56
63
  this.handleChange();
57
- } }), h("label", { key: '2150346b336440768beac655de035bf470f9e492', htmlFor: this.checkboxId }, h("slot", { key: 'df61654810e46b8707709d86bae7bdfd627724ee', name: "label" }))));
64
+ } }), h("label", { key: '9cfe0411c9b26d12229de7fdb9421b333da0199c', htmlFor: this.checkboxId }, h("slot", { key: '17d2e45ddf05aa409926f3df82caab7a4f110b72', name: "label" }))));
58
65
  }
59
66
  get host() { return this; }
60
67
  static get watchers() { return {
@@ -70,7 +77,7 @@ const TdsCheckbox = /*@__PURE__*/ proxyCustomElement(class TdsCheckbox extends H
70
77
  "indeterminate": [1028],
71
78
  "value": [1],
72
79
  "toggleCheckbox": [64]
73
- }, undefined, {
80
+ }, [[4, "reset", "handleFormReset"]], {
74
81
  "indeterminate": ["handleIndeterminateState"]
75
82
  }]);
76
83
  function defineCustomElement() {
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-28ef5186.js';
2
- import { d as defineCustomElement$2 } from './p-e4d7c655.js';
2
+ import { d as defineCustomElement$2 } from './p-d921fe75.js';
3
3
  import { d as defineCustomElement$1 } from './p-18c1245b.js';
4
4
 
5
5
  const dropdownOptionCss = ":host{box-sizing:border-box;display:block;background-color:var(--tds-dropdown-option-background)}:host *{box-sizing:border-box}:host .dropdown-option{color:var(--tds-dropdown-option-color);border-bottom:1px solid var(--tds-dropdown-option-border);font:var(--tds-detail-02);letter-spacing:var(--tds-detail-02-ls);overflow-wrap:anywhere;transition:background-color var(--tds-motion-duration-fast-02) var(--tds-motion-easing-scania)}:host .dropdown-option.selected{background-color:var(--tds-dropdown-option-background-selected)}:host .dropdown-option.disabled{color:var(--tds-dropdown-option-color-disabled)}:host .dropdown-option button:focus{outline:2px solid var(--tds-blue-400);outline-offset:-2px}:host .dropdown-option button{all:unset;width:100%}:host .dropdown-option button.lg{padding:19px 0 20px}:host .dropdown-option button.md{padding:15px 0 16px}:host .dropdown-option button.sm{padding:11px 0 12px}:host .dropdown-option button.xs{padding:7px 0 8px}:host .dropdown-option button .single-select{display:flex;align-items:center;justify-content:space-between;padding:0 16px}:host .dropdown-option .multiselect{width:100%;height:100%}:host .dropdown-option .multiselect tds-checkbox{display:flex;height:100%;width:100%}:host .dropdown-option .multiselect tds-checkbox.lg{padding:15px 16px 16px}:host .dropdown-option .multiselect tds-checkbox.md{padding:11px 16px 12px}:host .dropdown-option .multiselect tds-checkbox.sm{padding:7px 16px 8px}:host .dropdown-option .multiselect tds-checkbox.xs{padding:7px 16px 8px}:host .dropdown-option:hover{background-color:var(--tds-dropdown-option-background-hover);cursor:pointer}:host .dropdown-option:hover.disabled{background-color:var(--tds-dropdown-option-background);cursor:not-allowed}:host([hidden]){display:none}";
@@ -1,4 +1,4 @@
1
- import { T as TdsCheckbox$1, d as defineCustomElement$1 } from './p-e4d7c655.js';
1
+ import { T as TdsCheckbox$1, d as defineCustomElement$1 } from './p-d921fe75.js';
2
2
 
3
3
  const TdsCheckbox = TdsCheckbox$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-462b77e8.js';
1
+ import { T as TdsDropdownOption$1, d as defineCustomElement$1 } from './p-e7868876.js';
2
2
 
3
3
  const TdsDropdownOption = TdsDropdownOption$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-2523819c.js';
1
+ import { T as TdsDropdown$1, d as defineCustomElement$1 } from './p-ca4b945d.js';
2
2
 
3
3
  const TdsDropdown = TdsDropdown$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -315,37 +315,38 @@ const TdsSlider$1 = /*@__PURE__*/ proxyCustomElement(class TdsSlider extends H {
315
315
  componentDidRender() {
316
316
  // Only add the event listener once:
317
317
  if (!this.resetEventListenerAdded) {
318
- const form = this.host.closest('form');
319
- form.addEventListener('reset', this.resetToInitialValue);
320
- this.resetEventListenerAdded = true;
318
+ this.formElement = this.host.closest('form');
319
+ if (this.formElement) {
320
+ this.formElement.addEventListener('reset', this.resetToInitialValue);
321
+ this.resetEventListenerAdded = true;
322
+ }
321
323
  }
322
324
  }
323
325
  disconnectedCallback() {
324
- if (this.resetEventListenerAdded) {
325
- const form = this.host.closest('form');
326
- form.removeEventListener('reset', this.resetToInitialValue);
326
+ if (this.resetEventListenerAdded && this.formElement) {
327
+ this.formElement.removeEventListener('reset', this.resetToInitialValue);
327
328
  this.resetEventListenerAdded = false;
328
329
  }
329
330
  }
330
331
  render() {
331
- return (h("div", { key: '63ea8117e50706f80560bf1c738adfd34e2ffade', class: {
332
+ return (h("div", { key: 'ed4c71d1701e0711d8b01c015f137f6a3f10457e', class: {
332
333
  'tds-slider-wrapper': true,
333
334
  'read-only': this.readOnly,
334
- } }, h("input", { key: '7f3913b7aed2b7f60a51e4e98f4676504479d54b', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, value: this.value, disabled: this.disabled }), h("div", { key: '538960334a39ca0e6433a9c42bee53fc6672e9f3', class: {
335
+ } }, h("input", { key: '7d85ba109ec41e45a4ced646cfe092832b2013a7', class: "tds-slider-native-element", type: "range", name: this.name, min: this.min, max: this.max, value: this.value, disabled: this.disabled }), h("div", { key: '7c32efe653a6437068026e0b612bd1cdb0fd580d', class: {
335
336
  'tds-slider': true,
336
337
  'disabled': this.disabled,
337
338
  'tds-slider-small': this.useSmall,
338
339
  }, ref: (el) => {
339
340
  this.wrapperElement = el;
340
- } }, h("label", { key: '34a702130336ce556cd076d17737f19fca879173', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '31637244738afb7b4bebda45975883eab15fc143', class: "tds-slider__input-values" }, h("div", { key: '8f25a51e0f969e803975033ac5cd9de189ff382f', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '5bb85d505ad5d6fa56aa98324c0ccc6becc1cac8', class: "tds-slider__controls" }, h("div", { key: '9d28ac902fe71e5b984d1581680bb0b9ff839d5f', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: 'd1a9cb77050503995092d5b8c954be63fd47e8ac', name: "minus", size: "16px" })))), h("div", { key: '197087cd83b899584b9e5b50d90a9ff5469bec75', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: '0508886c27cf9e050d4cad370567f86abe4e99cc', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'd49d39bda80d5f0d59954a4e1111b68bb3b913fc', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '7cdf0b42f24292d0d676c693c551e27e9d91acfb', class: "tds-slider__track", ref: (el) => {
341
+ } }, h("label", { key: '5561410214fda42ddb4553084f312de9943f825b', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '37340de05febbca285f031bd8df7d9c2588e315d', class: "tds-slider__input-values" }, h("div", { key: 'e973831529eb93eb0b0da6c5f92bd838dfb9bcdb', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '1a710d2d1ffac7533f9bae2908d4341d3b40e2f0', class: "tds-slider__controls" }, h("div", { key: '0a741834782d8e69a7d55e6cd87a3fdf4938d744', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: '8c67943ac2e15d742726e76c2b4c029d15c20f32', name: "minus", size: "16px" })))), h("div", { key: '96c4229007fbe882e106bcc3deb34f504c9604e3', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: '905fc1a02070f5419f76ec5d60d8f55d89d4650b', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: 'd2ccbea1b6e26ab1855c81e71730bebea0da37d8', class: "tds-slider__value-dividers" }, this.tickValues.map((value) => (h("div", { class: "tds-slider__value-divider" }, this.showTickNumbers && h("span", null, value))))))), h("div", { key: '30c9b4bb6f59631d443345ee6d1edf1973a83d0b', class: "tds-slider__track", ref: (el) => {
341
342
  this.trackElement = el;
342
- }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: 'f4707af65bffecb418b0aefa8d5bd55055b94203', class: "tds-slider__track-fill", ref: (el) => {
343
+ }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: '7acbccae98c481c4cfaeb2dc66d67a2e19575b93', class: "tds-slider__track-fill", ref: (el) => {
343
344
  this.trackFillElement = el;
344
- } }), h("div", { key: 'ad4c0500f2914c0d5c005f7f640e76cf3fd08568', class: "tds-slider__thumb", ref: (el) => {
345
+ } }), h("div", { key: '46a5c3135c5f765d5fb0845372dc3854586fa44d', class: "tds-slider__thumb", ref: (el) => {
345
346
  this.thumbElement = el;
346
- }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: '9609b93ff20975991f43c97b469f697b04098fc1', class: "tds-slider__value" }, this.value, h("svg", { key: 'd2dd8e895d4e7c1afb398355afc57354cf544bce', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'c707a07e816dc4f1ec60c69b451ae0abb91e845d', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: '536a9cc10e038fb0923062633cc30deada006d42', class: "tds-slider__thumb-inner", ref: (el) => {
347
+ }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: 'd39cd29d1e6302f8bd4a3d827797f8822e24b84d', class: "tds-slider__value" }, this.value, h("svg", { key: '5946f90b70b2afb2efc7f3a3bc5817a82ac3ca4a', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '9456df642aca39b94b17bb529ca02e2d6a2fde6c', d: "M8.15882 12.6915L0.990487 1.54076C0.562658 0.875246 1.0405 0 1.83167 0H16.1683C16.9595 0 17.4373 0.875246 17.0095 1.54076L9.84118 12.6915C9.44754 13.3038 8.55246 13.3038 8.15882 12.6915Z", fill: "currentColor" })))), h("div", { key: 'b4ca73a085f837d7e87e3334b8e58e5638125118', class: "tds-slider__thumb-inner", ref: (el) => {
347
348
  this.thumbInnerElement = el;
348
- } })))), this.useInput && (h("div", { key: 'c715bfb5737d0e8a093a671ee8ce9ab8f430cf75', class: "tds-slider__input-values" }, h("div", { key: '332c7b19d7a773e71236cd4a003d198aff18ff45', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: 'cc74d8c3a68928a619d5cb97551b42a7e37b7aee', class: "tds-slider__input-field-wrapper" }, h("input", { key: '8ea3c0e38ada475aef1c85de7afc304e9fafcfe7', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, readOnly: this.readOnly, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max })))), this.useControls && (h("div", { key: 'ac446557daecd66ceffb387f40cade3856722a06', class: "tds-slider__controls" }, h("div", { key: '641cb0da0d990af682975bb21263187e9bc50707', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: '0efffdea211e8de23c6f3a119956620b60c63d4b', name: "plus", size: "16px" })))))));
349
+ } })))), this.useInput && (h("div", { key: '6574286ac7764807fd1e18875d6fa39ab7f7b304', class: "tds-slider__input-values" }, h("div", { key: '57a92adf59551f551c4ae06355c276a69b34028a', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '0e1632ca8c9510177d349147749e3162aa46f219', class: "tds-slider__input-field-wrapper" }, h("input", { key: '094d194bce54d1073a5d657f7bc3f30107f5fe41', size: this.calculateInputSizeFromMax(), class: "tds-slider__input-field", value: this.value, readOnly: this.readOnly, onBlur: (event) => this.updateSliderValueOnInputChange(event), onKeyDown: (event) => this.handleInputFieldEnterPress(event), type: "number", min: this.min, max: this.max })))), this.useControls && (h("div", { key: '207398a3fd02e11f09c70ebbb8b293d6c16afd1f', class: "tds-slider__controls" }, h("div", { key: 'ca93ce9a55d0db25a3eaefd6e4dbc53106afc895', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: '6ab123f8701fdd93580a61c500ae6da658b547fd', name: "plus", size: "16px" })))))));
349
350
  }
350
351
  get host() { return this; }
351
352
  static get watchers() { return {