@scania/tegel 1.22.0 → 1.23.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 (71) hide show
  1. package/dist/cjs/tds-dropdown_2.cjs.entry.js +4 -4
  2. package/dist/cjs/tds-header.cjs.entry.js +1 -1
  3. package/dist/cjs/tds-icon.cjs.entry.js +1 -1
  4. package/dist/cjs/tds-popover-core.cjs.entry.js +1 -1
  5. package/dist/cjs/tds-slider.cjs.entry.js +18 -14
  6. package/dist/collection/components/banner/banner.js +1 -1
  7. package/dist/collection/components/dropdown/dropdown.js +4 -4
  8. package/dist/collection/components/header/header.css +4 -0
  9. package/dist/collection/components/icon/icon.js +1 -1
  10. package/dist/collection/components/icon/iconsArray.js +26 -1
  11. package/dist/collection/components/popover-core/tds-popover-core.css +1 -1
  12. package/dist/collection/components/slider/slider.js +18 -14
  13. package/dist/collection/utils/testConfiguration.js +65 -0
  14. package/dist/components/p-18c1245b.js +65 -0
  15. package/dist/components/{p-8bc36666.js → p-2523819c.js} +5 -5
  16. package/dist/components/{p-9411c8ea.js → p-462b77e8.js} +1 -1
  17. package/dist/components/{p-ad93662a.js → p-c48c68b3.js} +1 -1
  18. package/dist/components/{p-7f87740b.js → p-dcfecf4d.js} +1 -1
  19. package/dist/components/{p-3191ad55.js → p-e02b091c.js} +1 -1
  20. package/dist/components/tds-accordion-item.js +1 -1
  21. package/dist/components/tds-banner.js +1 -1
  22. package/dist/components/tds-datetime.js +1 -1
  23. package/dist/components/tds-dropdown-option.js +1 -1
  24. package/dist/components/tds-dropdown.js +1 -1
  25. package/dist/components/tds-folder-tabs.js +1 -1
  26. package/dist/components/tds-footer-group.js +1 -1
  27. package/dist/components/tds-header-cell.js +1 -1
  28. package/dist/components/tds-header-dropdown.js +3 -3
  29. package/dist/components/tds-header-hamburger.js +1 -1
  30. package/dist/components/tds-header-launcher-button.js +1 -1
  31. package/dist/components/tds-header-launcher.js +4 -4
  32. package/dist/components/tds-header.js +1 -1
  33. package/dist/components/tds-icon.js +1 -1
  34. package/dist/components/tds-inline-tabs.js +1 -1
  35. package/dist/components/tds-message.js +1 -1
  36. package/dist/components/tds-modal.js +1 -1
  37. package/dist/components/tds-navigation-tabs.js +1 -1
  38. package/dist/components/tds-popover-canvas.js +1 -1
  39. package/dist/components/tds-popover-core.js +1 -1
  40. package/dist/components/tds-popover-menu.js +1 -1
  41. package/dist/components/tds-side-menu-close-button.js +1 -1
  42. package/dist/components/tds-side-menu-dropdown.js +1 -1
  43. package/dist/components/tds-slider.js +19 -15
  44. package/dist/components/tds-step.js +1 -1
  45. package/dist/components/tds-table-body-input-wrapper.js +1 -1
  46. package/dist/components/tds-table-footer.js +3 -3
  47. package/dist/components/tds-table-header-input-wrapper.js +1 -1
  48. package/dist/components/tds-table-toolbar.js +1 -1
  49. package/dist/components/tds-text-field.js +1 -1
  50. package/dist/components/tds-textarea.js +1 -1
  51. package/dist/components/tds-toast.js +1 -1
  52. package/dist/components/tds-tooltip.js +1 -1
  53. package/dist/esm/tds-dropdown_2.entry.js +4 -4
  54. package/dist/esm/tds-header.entry.js +1 -1
  55. package/dist/esm/tds-icon.entry.js +1 -1
  56. package/dist/esm/tds-popover-core.entry.js +1 -1
  57. package/dist/esm/tds-slider.entry.js +18 -14
  58. package/dist/tegel/{p-89235968.entry.js → p-590b5f55.entry.js} +1 -1
  59. package/dist/tegel/p-979f5255.entry.js +1 -0
  60. package/dist/tegel/{p-7cb43ebe.entry.js → p-ac46b0a4.entry.js} +1 -1
  61. package/dist/tegel/p-e0ce5daa.entry.js +1 -0
  62. package/dist/tegel/p-f91c6e9d.entry.js +1 -0
  63. package/dist/tegel/tegel.css +1 -1
  64. package/dist/tegel/tegel.esm.js +1 -1
  65. package/dist/types/types/Icons.d.ts +1 -1
  66. package/dist/types/utils/testConfiguration.d.ts +13 -0
  67. package/package.json +1 -1
  68. package/dist/components/p-a32f9097.js +0 -65
  69. package/dist/tegel/p-07825c63.entry.js +0 -1
  70. package/dist/tegel/p-85d1ec5b.entry.js +0 -1
  71. package/dist/tegel/p-c64f2fba.entry.js +0 -1
@@ -131,16 +131,20 @@ const TdsSlider = class {
131
131
  }
132
132
  updateValue(event) {
133
133
  const trackWidth = this.getTrackWidth();
134
- const numTicks = parseInt(this.ticks);
135
- /* if snapping (supposedValueSlot > 0) is enabled, make sure we display the supposed value (instead of maybe getting a -1/+1 depending on rounding) */
136
- if (this.useSnapping && numTicks) {
137
- const supposedValue = this.tickValues[this.supposedValueSlot];
138
- this.value = `${supposedValue}`;
139
- this.calculateThumbLeftFromValue(supposedValue);
134
+ const min = parseFloat(this.min);
135
+ const max = parseFloat(this.max);
136
+ // If snapping is enabled and a valid supposedValueSlot is available,
137
+ // snap the value to the closest tick. Use the snapped value to update
138
+ // the slider's thumb position and internal value.
139
+ if (this.useSnapping && this.supposedValueSlot >= 0) {
140
+ const snappedValue = this.tickValues[this.supposedValueSlot];
141
+ this.value = snappedValue.toString();
142
+ this.calculateThumbLeftFromValue(snappedValue);
140
143
  }
141
144
  else {
142
145
  const percentage = this.thumbLeft / trackWidth;
143
- this.value = `${Math.trunc(parseFloat(this.min) + percentage * (parseFloat(this.max) - parseFloat(this.min)))}`;
146
+ const calculatedValue = min + percentage * (max - min);
147
+ this.value = Math.round(calculatedValue).toString();
144
148
  }
145
149
  this.updateTrack();
146
150
  this.tdsInput.emit({ value: this.value });
@@ -298,24 +302,24 @@ const TdsSlider = class {
298
302
  this.updateTrack();
299
303
  }
300
304
  render() {
301
- return (h("div", { key: 'c0097f8935d6c798124dd0248fd92a6e76b70a4d', class: {
305
+ return (h("div", { key: 'fd7d051192c33b19e8c68cbeaa50ea43149457bb', class: {
302
306
  'tds-slider-wrapper': true,
303
307
  'read-only': this.readOnly,
304
- } }, h("input", { key: 'd646fb0d7cd1c1faacdfb3e4b90587e7545d7477', 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: '18a15cef6af652698595d57713accbbe34017fe1', class: {
308
+ } }, h("input", { key: 'd2fe02893f865f5791736cb5f05b5bcd2494e471', 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: '2d436a5654cb20923cd20ed61f9449bd0705edd2', class: {
305
309
  'tds-slider': true,
306
310
  'disabled': this.disabled,
307
311
  'tds-slider-small': this.useSmall,
308
312
  }, ref: (el) => {
309
313
  this.wrapperElement = el;
310
- } }, h("label", { key: 'b0770ce0a08a65aac30c95c499da756855c73dc9', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '3d4d2fc521b1803a027fa9b9f559480fee777901', class: "tds-slider__input-values" }, h("div", { key: '466ab197a801f21dc2f48921ea4fa665098054c6', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: '1ab9bb7ea8953c105e0b9796762fd5b16b805c64', class: "tds-slider__controls" }, h("div", { key: 'edc63369cec158c118a8b61021c4afd448acf7bc', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: '08018f9bbfb0425e7983cbd6bd51bc8f3ec5e31b', name: "minus", size: "16px" })))), h("div", { key: '370efbc22ee6e7846a9d6ae655c5dd3c03378e36', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: 'b6f4394ae47b01024e29280e648e8ff806bad78e', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: '1e77a920f6765a4ecd1eaced040b2ed5c66a99ca', 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: 'c2890a8d8bc932c61226c79a01043d15bad740a7', class: "tds-slider__track", ref: (el) => {
314
+ } }, h("label", { key: 'd9d444d15acabbbc23c7b7633e5312f405ff9120', class: this.showTickNumbers && 'offset' }, this.label), this.useInput && (h("div", { key: '2f0d0419138851724891e2ab04fef2f3b3e099f1', class: "tds-slider__input-values" }, h("div", { key: '7f23007c0f4a1aa6358ffa7c5aaae027d0927b63', class: "tds-slider__input-value min-value" }, this.min))), this.useControls && (h("div", { key: 'df4a00a40c541b83aa8459dfcdaf22c348e2c80a', class: "tds-slider__controls" }, h("div", { key: '96cc419d369098137895b725f97a8fa3d7d50dfc', class: "tds-slider__control tds-slider__control-minus", onClick: (event) => this.stepLeft(event) }, h("tds-icon", { key: '09ed43c9f2fe81baeada6a07e4cba18027f04ba1', name: "minus", size: "16px" })))), h("div", { key: '402647683b57076bd4ac3ce3d754585a89a48e08', class: "tds-slider-inner" }, this.tickValues.length > 0 && (h("div", { key: 'd80c648eca47c7e52725e967a32fe4a4692a5729', class: "tds-slider__value-dividers-wrapper" }, h("div", { key: '030106df49f12a55c1b32a9c1c257f449629644a', 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: 'fef7013f82a191c32bc3a4d297f5e10a4db127a1', class: "tds-slider__track", ref: (el) => {
311
315
  this.trackElement = el;
312
- }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: 'f8b1bc023a6073f2c2a9703ef2cacfecd6e7cc1c', class: "tds-slider__track-fill", ref: (el) => {
316
+ }, tabindex: this.disabled ? '-1' : '0' }, h("div", { key: '24a583182c45114d1e011bffef0f81f1e4f93a36', class: "tds-slider__track-fill", ref: (el) => {
313
317
  this.trackFillElement = el;
314
- } }), h("div", { key: '18b1514b75e398225513d01ebf8cc51a00efbf96', class: "tds-slider__thumb", ref: (el) => {
318
+ } }), h("div", { key: '3bea53237beb92f41264386fb5ac181d1e9966a4', class: "tds-slider__thumb", ref: (el) => {
315
319
  this.thumbElement = el;
316
- }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: '5ca02778d43da7f7b5b8d532c3aa1aeb325b1d3b', class: "tds-slider__value" }, this.value, h("svg", { key: '1fe3190597559141e241e6199ccc74ea5d491106', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '50f9133e51d6e5bfa38b94c56758a1480c2e567d', 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: '1848440bcb20f1cf92ca61fcd40e9d5291cf79de', class: "tds-slider__thumb-inner", ref: (el) => {
320
+ }, onMouseDown: () => this.grabThumb(), onTouchStart: () => this.grabThumb() }, this.tooltip && (h("div", { key: '3ac44629cad3b03524602f9babe7fa4582b38660', class: "tds-slider__value" }, this.value, h("svg", { key: '5adbbcc274555d14454c5329f0eea8c072a3db2c', width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '248b1f8521b89be4214631e411c0ba9c7bcc07a8', 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: 'bc778a9ccd25a5229aa7685cc6c22ed5385b9d98', class: "tds-slider__thumb-inner", ref: (el) => {
317
321
  this.thumbInnerElement = el;
318
- } })))), this.useInput && (h("div", { key: '408e5d0d9e728b7ece3921e4c568ead90c8680f8', class: "tds-slider__input-values" }, h("div", { key: '7119add8d905c5319999647016195a0b7c1c182a', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: '0996a111128ba9f78bcd63a19b81a55193292106', class: "tds-slider__input-field-wrapper" }, h("input", { key: '0c392592e44cbaa741f01cd9d5269a4213d52de4', 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: 'f0e9bf533e66ec284231ab5da2f0c6e909ca3b5a', class: "tds-slider__controls" }, h("div", { key: 'b7f0f81bbadfc7c132d0ff0e8cb5441f9d7f6f55', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: 'e44a34ef12e36b84c0907b467ca21f7c774e3736', name: "plus", size: "16px" })))))));
322
+ } })))), this.useInput && (h("div", { key: '077ffffeb0986504a2c9fc4e1b08095ec689402c', class: "tds-slider__input-values" }, h("div", { key: '74a528a286e2b49a6739c5817cca8a0436b908b9', class: "tds-slider__input-value", onClick: (event) => this.stepLeft(event) }, this.max), h("div", { key: 'af2a647636c8eecba19637aa92ddda37adc52a1b', class: "tds-slider__input-field-wrapper" }, h("input", { key: '02701d15de6119994f7be13b9c9ac69ae6f2269b', 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: 'ef215ef613c381601674d4bb7dbea583a3ddde2a', class: "tds-slider__controls" }, h("div", { key: '4e553194348daf32529c9c8cedc32b0686ac32ff', class: "tds-slider__control tds-slider__control-plus", onClick: (event) => this.stepRight(event) }, h("tds-icon", { key: 'd5d67ea7ff64ed19d28bd078acad56ebda742f93', name: "plus", size: "16px" })))))));
319
323
  }
320
324
  static get watchers() { return {
321
325
  "value": ["handleValueUpdate"]