@siemens/ix 4.1.0 → 4.2.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 (160) hide show
  1. package/READMEOSS.html +1 -1
  2. package/components/index.js.map +1 -1
  3. package/components/ix-checkbox-group.js +3 -3
  4. package/components/ix-checkbox.js +1 -1
  5. package/components/ix-custom-field.js +3 -3
  6. package/components/ix-date-input.js +8 -10
  7. package/components/ix-date-input.js.map +1 -1
  8. package/components/ix-datetime-picker.js +1 -1
  9. package/components/ix-field-label.js +1 -1
  10. package/components/ix-field-wrapper.js +1 -1
  11. package/components/ix-helper-text.js +1 -1
  12. package/components/ix-input.js +4 -4
  13. package/components/ix-menu-about.js +2 -2
  14. package/components/ix-menu-settings.js +1 -1
  15. package/components/ix-number-input.js +4 -4
  16. package/components/ix-pagination.js +3 -3
  17. package/components/ix-radio-group.js +3 -3
  18. package/components/ix-radio.js +1 -1
  19. package/components/ix-select.js +1 -1
  20. package/components/ix-tab-item.js +1 -1
  21. package/components/ix-textarea.js +4 -4
  22. package/components/ix-time-input.js +9 -11
  23. package/components/ix-time-input.js.map +1 -1
  24. package/components/ix-time-picker.js +1 -1
  25. package/components/ix-toggle.js +1 -1
  26. package/components/{p-DyGPjxFm.js → p-7E7AMiQV.js} +3 -3
  27. package/components/p-7E7AMiQV.js.map +1 -0
  28. package/components/{p-Bz7hxKB6.js → p-B1p0kpQJ.js} +3 -3
  29. package/components/{p-Bz7hxKB6.js.map → p-B1p0kpQJ.js.map} +1 -1
  30. package/components/{p-BVUD9f4A.js → p-BIg1TSrD.js} +3 -3
  31. package/components/{p-BVUD9f4A.js.map → p-BIg1TSrD.js.map} +1 -1
  32. package/components/{p-BZLbfHdO.js → p-BOQ00Fbs.js} +5 -5
  33. package/components/{p-BZLbfHdO.js.map → p-BOQ00Fbs.js.map} +1 -1
  34. package/components/{p-Cc4uqNv5.js → p-BiqdnsgA.js} +3 -3
  35. package/components/{p-Cc4uqNv5.js.map → p-BiqdnsgA.js.map} +1 -1
  36. package/components/{p-kJlC6ZD0.js → p-BmMUyJRQ.js} +35 -20
  37. package/components/p-BmMUyJRQ.js.map +1 -0
  38. package/components/{p-g2Y5blor.js → p-DUU5I7wZ.js} +3 -3
  39. package/components/{p-g2Y5blor.js.map → p-DUU5I7wZ.js.map} +1 -1
  40. package/components/{p-xHo-3QVy.js → p-Dq_H2flK.js} +9 -3
  41. package/components/p-Dq_H2flK.js.map +1 -0
  42. package/dist/cjs/index.cjs.js.map +1 -1
  43. package/dist/cjs/{input.fc-B5JMSZbY.js → input.fc-DrxRYq_G.js} +3 -3
  44. package/dist/cjs/{input.fc-B5JMSZbY.js.map → input.fc-DrxRYq_G.js.map} +1 -1
  45. package/dist/cjs/ix-checkbox-group.cjs.entry.js +1 -1
  46. package/dist/cjs/ix-checkbox.cjs.entry.js +1 -1
  47. package/dist/cjs/ix-custom-field.cjs.entry.js +1 -1
  48. package/dist/cjs/ix-date-input.cjs.entry.js +6 -8
  49. package/dist/cjs/ix-date-input.entry.cjs.js.map +1 -1
  50. package/dist/cjs/ix-field-label_2.cjs.entry.js +1 -1
  51. package/dist/cjs/ix-helper-text.cjs.entry.js +1 -1
  52. package/dist/cjs/ix-input.cjs.entry.js +2 -2
  53. package/dist/cjs/ix-number-input.cjs.entry.js +2 -2
  54. package/dist/cjs/ix-radio-group.cjs.entry.js +1 -1
  55. package/dist/cjs/ix-radio.cjs.entry.js +1 -1
  56. package/dist/cjs/ix-select.cjs.entry.js +1 -1
  57. package/dist/cjs/ix-tab-item.ix-tabs.entry.cjs.js.map +1 -1
  58. package/dist/cjs/ix-tab-item_2.cjs.entry.js +1 -1
  59. package/dist/cjs/ix-textarea.cjs.entry.js +2 -2
  60. package/dist/cjs/ix-time-input.cjs.entry.js +6 -8
  61. package/dist/cjs/ix-time-input.entry.cjs.js.map +1 -1
  62. package/dist/cjs/ix-time-picker.cjs.entry.js +33 -18
  63. package/dist/cjs/ix-time-picker.entry.cjs.js.map +1 -1
  64. package/dist/cjs/ix-toggle.cjs.entry.js +1 -1
  65. package/dist/cjs/{validation-CfL71_0d.js → validation-DTmSqO2d.js} +9 -2
  66. package/dist/{esm/validation-D_dk-JqT.js.map → cjs/validation-DTmSqO2d.js.map} +1 -1
  67. package/dist/collection/components/date-input/date-input.js +5 -7
  68. package/dist/collection/components/date-input/date-input.js.map +1 -1
  69. package/dist/collection/components/tab-item/tab-item.css +1 -1
  70. package/dist/collection/components/time-input/time-input.js +5 -7
  71. package/dist/collection/components/time-input/time-input.js.map +1 -1
  72. package/dist/collection/components/time-picker/time-picker.js +33 -18
  73. package/dist/collection/components/time-picker/time-picker.js.map +1 -1
  74. package/dist/collection/components/utils/input/validation.js +6 -0
  75. package/dist/collection/components/utils/input/validation.js.map +1 -1
  76. package/dist/collection/components/utils/modal/index.js.map +1 -1
  77. package/dist/collection/components/utils/modal/loading.js.map +1 -1
  78. package/dist/esm/index.js.map +1 -1
  79. package/dist/esm/{input.fc-CQbX6V05.js → input.fc-KJF8Z9iJ.js} +3 -3
  80. package/dist/esm/{input.fc-CQbX6V05.js.map → input.fc-KJF8Z9iJ.js.map} +1 -1
  81. package/dist/esm/ix-checkbox-group.entry.js +1 -1
  82. package/dist/esm/ix-checkbox.entry.js +1 -1
  83. package/dist/esm/ix-custom-field.entry.js +1 -1
  84. package/dist/esm/ix-date-input.entry.js +6 -8
  85. package/dist/esm/ix-date-input.entry.js.map +1 -1
  86. package/dist/esm/ix-field-label_2.entry.js +1 -1
  87. package/dist/esm/ix-helper-text.entry.js +1 -1
  88. package/dist/esm/ix-input.entry.js +2 -2
  89. package/dist/esm/ix-number-input.entry.js +2 -2
  90. package/dist/esm/ix-radio-group.entry.js +1 -1
  91. package/dist/esm/ix-radio.entry.js +1 -1
  92. package/dist/esm/ix-select.entry.js +1 -1
  93. package/dist/esm/ix-tab-item.ix-tabs.entry.js.map +1 -1
  94. package/dist/esm/ix-tab-item_2.entry.js +1 -1
  95. package/dist/esm/ix-textarea.entry.js +2 -2
  96. package/dist/esm/ix-time-input.entry.js +6 -8
  97. package/dist/esm/ix-time-input.entry.js.map +1 -1
  98. package/dist/esm/ix-time-picker.entry.js +33 -18
  99. package/dist/esm/ix-time-picker.entry.js.map +1 -1
  100. package/dist/esm/ix-toggle.entry.js +1 -1
  101. package/dist/esm/{validation-D_dk-JqT.js → validation-LJh16vt2.js} +9 -3
  102. package/dist/{cjs/validation-CfL71_0d.js.map → esm/validation-LJh16vt2.js.map} +1 -1
  103. package/dist/siemens-ix/index.esm.js.map +1 -1
  104. package/dist/siemens-ix/ix-date-input.entry.esm.js.map +1 -1
  105. package/dist/siemens-ix/ix-tab-item.ix-tabs.entry.esm.js.map +1 -1
  106. package/dist/siemens-ix/ix-time-input.entry.esm.js.map +1 -1
  107. package/dist/siemens-ix/ix-time-picker.entry.esm.js.map +1 -1
  108. package/dist/siemens-ix/p-0c325f08.entry.js +2 -0
  109. package/dist/siemens-ix/p-0c325f08.entry.js.map +1 -0
  110. package/dist/siemens-ix/p-0eca5a77.entry.js +2 -0
  111. package/dist/siemens-ix/{p-3751c675.entry.js.map → p-0eca5a77.entry.js.map} +1 -1
  112. package/dist/siemens-ix/{p-086d31e7.entry.js → p-26c629c3.entry.js} +2 -2
  113. package/dist/siemens-ix/{p-51ae739e.entry.js → p-33b3ed5b.entry.js} +2 -2
  114. package/dist/siemens-ix/{p-7f90eeef.entry.js → p-4431f891.entry.js} +2 -2
  115. package/dist/siemens-ix/{p-620158aa.entry.js → p-4e77d861.entry.js} +2 -2
  116. package/dist/siemens-ix/p-68aaf0fe.entry.js +2 -0
  117. package/dist/siemens-ix/p-68aaf0fe.entry.js.map +1 -0
  118. package/dist/siemens-ix/{p-ebef3d52.entry.js → p-79537728.entry.js} +2 -2
  119. package/dist/siemens-ix/{p-CAj3Tlcn.js → p-C7nQNUsO.js} +2 -2
  120. package/dist/siemens-ix/{p-CAj3Tlcn.js.map → p-C7nQNUsO.js.map} +1 -1
  121. package/dist/siemens-ix/{p-5iwF1M9X.js → p-DaswuiGO.js} +2 -2
  122. package/dist/siemens-ix/{p-5iwF1M9X.js.map → p-DaswuiGO.js.map} +1 -1
  123. package/dist/siemens-ix/{p-3b7573d6.entry.js → p-a4225101.entry.js} +2 -2
  124. package/dist/siemens-ix/{p-1c83cb5f.entry.js → p-b27a9744.entry.js} +2 -2
  125. package/dist/siemens-ix/{p-3f13b14e.entry.js → p-ba9ed3d1.entry.js} +2 -2
  126. package/dist/siemens-ix/{p-10f2a239.entry.js → p-c15e64a8.entry.js} +2 -2
  127. package/dist/siemens-ix/{p-7364534a.entry.js → p-c43b201b.entry.js} +2 -2
  128. package/dist/siemens-ix/{p-84df2a86.entry.js → p-d2c18c15.entry.js} +2 -2
  129. package/dist/siemens-ix/p-d2c18c15.entry.js.map +1 -0
  130. package/dist/siemens-ix/{p-5d6f43fd.entry.js → p-f119c105.entry.js} +2 -2
  131. package/dist/siemens-ix/{p-6445a54f.entry.js → p-fc73c8cc.entry.js} +2 -2
  132. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  133. package/dist/types/components/time-picker/time-picker.d.ts +2 -1
  134. package/dist/types/components/utils/input/validation.d.ts +1 -0
  135. package/dist/types/components/utils/modal/index.d.ts +1 -1
  136. package/dist/types/components/utils/modal/loading.d.ts +4 -0
  137. package/hydrate/index.js +48 -31
  138. package/hydrate/index.mjs +48 -31
  139. package/package.json +1 -1
  140. package/components/p-DyGPjxFm.js.map +0 -1
  141. package/components/p-kJlC6ZD0.js.map +0 -1
  142. package/components/p-xHo-3QVy.js.map +0 -1
  143. package/dist/siemens-ix/p-3751c675.entry.js +0 -2
  144. package/dist/siemens-ix/p-84df2a86.entry.js.map +0 -1
  145. package/dist/siemens-ix/p-dd16efd4.entry.js +0 -2
  146. package/dist/siemens-ix/p-dd16efd4.entry.js.map +0 -1
  147. package/dist/siemens-ix/p-f05aa76f.entry.js +0 -2
  148. package/dist/siemens-ix/p-f05aa76f.entry.js.map +0 -1
  149. /package/dist/siemens-ix/{p-086d31e7.entry.js.map → p-26c629c3.entry.js.map} +0 -0
  150. /package/dist/siemens-ix/{p-51ae739e.entry.js.map → p-33b3ed5b.entry.js.map} +0 -0
  151. /package/dist/siemens-ix/{p-7f90eeef.entry.js.map → p-4431f891.entry.js.map} +0 -0
  152. /package/dist/siemens-ix/{p-620158aa.entry.js.map → p-4e77d861.entry.js.map} +0 -0
  153. /package/dist/siemens-ix/{p-ebef3d52.entry.js.map → p-79537728.entry.js.map} +0 -0
  154. /package/dist/siemens-ix/{p-3b7573d6.entry.js.map → p-a4225101.entry.js.map} +0 -0
  155. /package/dist/siemens-ix/{p-1c83cb5f.entry.js.map → p-b27a9744.entry.js.map} +0 -0
  156. /package/dist/siemens-ix/{p-3f13b14e.entry.js.map → p-ba9ed3d1.entry.js.map} +0 -0
  157. /package/dist/siemens-ix/{p-10f2a239.entry.js.map → p-c15e64a8.entry.js.map} +0 -0
  158. /package/dist/siemens-ix/{p-7364534a.entry.js.map → p-c43b201b.entry.js.map} +0 -0
  159. /package/dist/siemens-ix/{p-5d6f43fd.entry.js.map → p-f119c105.entry.js.map} +0 -0
  160. /package/dist/siemens-ix/{p-6445a54f.entry.js.map → p-fc73c8cc.entry.js.map} +0 -0
@@ -239,15 +239,7 @@ const TimePicker = class {
239
239
  if (elementContainer) {
240
240
  elementContainer.focus({ preventScroll: true });
241
241
  if (!this.isElementVisible(elementContainer, elementList)) {
242
- elementContainer.scrollIntoView({
243
- block: this.focusScrollAlignment,
244
- });
245
- if (this.focusScrollAlignment === 'end') {
246
- elementList.scrollTop += 4;
247
- }
248
- else {
249
- elementList.scrollTop -= 4;
250
- }
242
+ this.scrollElementIntoView(elementContainer, elementList, this.focusScrollAlignment);
251
243
  }
252
244
  }
253
245
  }
@@ -306,7 +298,16 @@ const TimePicker = class {
306
298
  event.preventDefault();
307
299
  }
308
300
  }
309
- onUnitCellBlur(unit) {
301
+ onUnitCellBlur(unit, event) {
302
+ var _a;
303
+ const relatedTarget = event.relatedTarget;
304
+ // Check if column lost focus to scroll back to selected value
305
+ if (relatedTarget) {
306
+ const relatedUnit = (_a = relatedTarget.dataset.elementContainerId) === null || _a === void 0 ? void 0 : _a.split('-')[0];
307
+ if (relatedUnit !== unit) {
308
+ this.elementListScrollToTop(unit, Number(this.formattedTime[unit]), 'smooth');
309
+ }
310
+ }
310
311
  this.isUnitFocused = false;
311
312
  const focusedValue = Number(this.formattedTime[unit]);
312
313
  this.updateDescriptorFocusedValue(unit, focusedValue);
@@ -331,6 +332,19 @@ const TimePicker = class {
331
332
  return (elementRect.top >= containerRect.top &&
332
333
  elementRect.bottom <= containerRect.bottom);
333
334
  }
335
+ scrollElementIntoView(element, container, alignment) {
336
+ const SCROLL_BUFFER = 1;
337
+ const containerRect = container.getBoundingClientRect();
338
+ const elementRect = element.getBoundingClientRect();
339
+ if (alignment === 'end') {
340
+ container.scrollTop +=
341
+ elementRect.bottom - containerRect.bottom + SCROLL_BUFFER;
342
+ }
343
+ else {
344
+ container.scrollTop +=
345
+ elementRect.top - containerRect.top - SCROLL_BUFFER;
346
+ }
347
+ }
334
348
  updateFocusedValue(value) {
335
349
  const numberArray = this.getNumberArrayForUnit(this.focusedUnit);
336
350
  const maxValue = numberArray[numberArray.length - 1];
@@ -544,6 +558,9 @@ const TimePicker = class {
544
558
  return this.formattedTime[unit] === String(number);
545
559
  }
546
560
  select(unit, number) {
561
+ if (this.isSelected(unit, number)) {
562
+ return;
563
+ }
547
564
  this.formattedTime = Object.assign(Object.assign({}, this.formattedTime), { [unit]: String(number) });
548
565
  this.timeUpdate(unit, number);
549
566
  this.elementListScrollToTop(unit, number, 'smooth');
@@ -615,28 +632,26 @@ const TimePicker = class {
615
632
  return '-1';
616
633
  }
617
634
  render() {
618
- return (index.h(index.Host, { key: '839c389efc9ca4e169f1758801ef32c6be5e73a1' }, index.h("ix-date-time-card", { key: '422e71349a15cfb712831262f095403e0a35e32e', embedded: this.embedded, timePickerAppearance: true, corners: this.corners, hasFooter: !this.dateTimePickerAppearance, hideHeader: this.hideHeader }, index.h("div", { key: 'eea778cdaff7a2108f93d8cbb276fe5704517607', class: "header", slot: "header" }, index.h("ix-typography", { key: '768ab46368d044392e5854be19ee8ed313cd862c', format: "body" }, this.i18nHeader)), index.h("div", { key: 'bfeaccce8c41b7b57f1fe2ea49c87c3f2669fe26', class: "clock" }, this.timePickerDescriptors.map((descriptor, index$1) => (index.h("div", { class: "flex" }, index.h("div", { class: { columns: true, hidden: descriptor.hidden } }, index.h("div", { class: "column-header", title: descriptor.header }, descriptor.header), index.h("div", { "data-element-list-id": descriptor.unit, class: "element-list", tabIndex: -1 }, descriptor.numberArray.map((number) => {
635
+ return (index.h(index.Host, { key: 'da95d86956db27851713b28d3727ee9d8e33f785' }, index.h("ix-date-time-card", { key: '5a8a88d641f859eaa2c1e1e2f7b699abd56f7f74', embedded: this.embedded, timePickerAppearance: true, corners: this.corners, hasFooter: !this.dateTimePickerAppearance, hideHeader: this.hideHeader }, index.h("div", { key: '85639253213bee998504da73ea4de0421cf146c3', class: "header", slot: "header" }, index.h("ix-typography", { key: '0a21cf47dd51eaf17c44271dbe4d63d909523055', format: "body" }, this.i18nHeader)), index.h("div", { key: '9d716194b4a37662e298e8d59c54142e78b9a6a0', class: "clock" }, this.timePickerDescriptors.map((descriptor, index$1) => (index.h("div", { class: "flex" }, index.h("div", { class: { columns: true, hidden: descriptor.hidden } }, index.h("div", { class: "column-header", title: descriptor.header }, descriptor.header), index.h("div", { "data-element-list-id": descriptor.unit, class: "element-list", tabIndex: -1 }, descriptor.numberArray.map((number) => {
619
636
  return (index.h("button", { "data-element-container-id": `${descriptor.unit}-${number}`, class: {
620
637
  selected: this.isSelected(descriptor.unit, number),
621
638
  'element-container': true,
622
- }, onMouseDown: (e) => {
623
- e.preventDefault();
624
639
  }, onClick: () => {
625
640
  this.select(descriptor.unit, number);
626
- }, onFocus: () => this.onUnitCellFocus(descriptor.unit, number), onBlur: () => this.onUnitCellBlur(descriptor.unit), tabindex: this.getElementContainerTabIndex(number, descriptor.unit), "aria-label": `${descriptor.header}: ${number}` }, this.formatUnitValue(descriptor.unit, number)));
641
+ }, onFocus: () => this.onUnitCellFocus(descriptor.unit, number), onBlur: (e) => this.onUnitCellBlur(descriptor.unit, e), tabindex: this.getElementContainerTabIndex(number, descriptor.unit), "aria-label": `${descriptor.header}: ${number}` }, this.formatUnitValue(descriptor.unit, number)));
627
642
  }), index.h("div", { class: "element-list-padding" }))), index$1 !== this.timePickerDescriptors.length - 1 && (index.h("div", { class: {
628
643
  'column-separator': true,
629
644
  hidden: descriptor.hidden,
630
- } }, this.getColumnSeparator(index$1)))))), this.timeRef && (index.h("div", { key: 'eeaba00cf2b322d10a360e44671853c283400af9', class: "flex" }, index.h("div", { key: '1161427b3b741c7f9b5f4767f94ef55dd6beb243', class: "column-separator" }), index.h("div", { key: '72ed1ab0c39dab3af9a84f816d49bc86c0628a88', class: "columns" }, index.h("div", { key: '4c7997c6a197c7d46eef48a9da927a78d93d5fd5', class: "column-header", title: "AM/PM" }), index.h("div", { key: '0e87179f7e1c1868eedb2d2dfdfd4b9a7d44f3dc', class: "element-list", tabIndex: -1 }, index.h("button", { key: '7e3ddb25677ecb071415eff72849147cf821b44f', "data-am-pm-id": "AM", class: {
645
+ } }, this.getColumnSeparator(index$1)))))), this.timeRef && (index.h("div", { key: 'b177d5ea743648618ab6b877f60a37b46d8a5fa5', class: "flex" }, index.h("div", { key: 'a714f52d250386088368bdfe5c28ad45a1fe2dd0', class: "column-separator" }), index.h("div", { key: 'c7730b336e486ec34fd23e293b8e70e309d153fe', class: "columns" }, index.h("div", { key: '56677d7c350e235777e5d06afd61b925934923d6', class: "column-header", title: "AM/PM" }), index.h("div", { key: '764fd7297bdafaa69d24c9a2655c9d4fa7a73966', class: "element-list", tabIndex: -1 }, index.h("button", { key: '6b7ddefac72c7d4a778e8de6c42fd593003f5e5f', "data-am-pm-id": "AM", class: {
631
646
  selected: this.timeRef === 'AM',
632
647
  'element-container': true,
633
- }, onClick: () => this.changeTimeReference('AM'), tabindex: "0", "aria-label": "AM" }, "AM"), index.h("button", { key: '2c7c518bb68ee8a1267ce6fb30ff7cb495ac783e', "data-am-pm-id": "PM", class: {
648
+ }, onClick: () => this.changeTimeReference('AM'), tabindex: "0", "aria-label": "AM" }, "AM"), index.h("button", { key: '75cccf55946da3b04faac2da0bd3c989b8f633a3', "data-am-pm-id": "PM", class: {
634
649
  selected: this.timeRef === 'PM',
635
650
  'element-container': true,
636
- }, onClick: () => this.changeTimeReference('PM'), tabindex: "0", "aria-label": "PM" }, "PM")))))), index.h("div", { key: 'ec8fcc0064bded7ebed521b9aa99c6b51cd97b0e', class: {
651
+ }, onClick: () => this.changeTimeReference('PM'), tabindex: "0", "aria-label": "PM" }, "PM")))))), index.h("div", { key: 'e033175f6d142fd73661703c89c975874bc9d6be', class: {
637
652
  footer: true,
638
653
  'footer--compact': this.timePickerDescriptors.length <= 2,
639
- }, slot: "footer" }, index.h("ix-button", { key: '76b47429595ed91fef0696509787f89b275bf682', class: "confirm-button", onClick: () => {
654
+ }, slot: "footer" }, index.h("ix-button", { key: '795d890b983737fd09cc7471c428266945062262', class: "confirm-button", onClick: () => {
640
655
  var _a;
641
656
  this.timeSelect.emit((_a = this._time) === null || _a === void 0 ? void 0 : _a.toFormat(this.format));
642
657
  } }, this.i18nConfirmTime)))));
@@ -1 +1 @@
1
- {"version":3,"file":"ix-time-picker.entry.cjs.js","sources":["src/components/time-picker/time-picker.scss?tag=ix-time-picker&encapsulation=shadow","src/components/time-picker/time-picker.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@use './common-variables' as vars;\n@use 'mixins/shadow-dom/component';\n@use 'mixins/input';\n@use 'legacy/components/forms';\n\n@include input.form;\n\n:host {\n display: block;\n position: relative;\n width: fit-content;\n\n @include component.ix-component;\n\n .standaloneAppearance {\n box-shadow: none;\n }\n\n .hidden {\n display: none;\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: center;\n height: vars.$default-control-height;\n }\n\n .clock {\n display: flex;\n justify-content: center;\n align-items: start;\n\n .flex {\n display: flex;\n height: 100%;\n align-items: start;\n\n .columns {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-around;\n\n .column-header {\n height: 2.5rem;\n width: 2.5rem;\n line-height: 2.5rem;\n text-align: center;\n color: var(--theme-color-soft-text);\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n }\n\n .column-separator {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100%;\n margin-top: 3rem;\n width: 0.5rem;\n }\n }\n\n .element-list {\n list-style-type: none;\n overflow: auto;\n padding: 0.0625rem;\n margin: -0.0625rem;\n max-height: calc(2.5rem * 6 + 0.125rem * 6);\n\n button {\n all: unset;\n }\n\n .element-container {\n box-sizing: border-box;\n width: 2.5rem;\n height: 2.5rem;\n margin-bottom: 0.125rem;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: var(--theme-color-primary);\n\n &:hover {\n background-color: var(--theme-datepicker-day--background--hover);\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 1px var(--theme-color-focus-bdr);\n }\n }\n\n .selected {\n background-color: var(--theme-datepicker-day--background--selected);\n color: var(--theme-datepicker-day--color--selected);\n font-weight: var(--theme-font-weight-bold);\n\n &:hover {\n background-color: var(\n --theme-datepicker-day--background--selected-hover\n );\n }\n\n &:focus-visible {\n border: 0.0625rem solid var(--theme-color-inv-contrast-text);\n }\n }\n\n .element-list-padding {\n width: 2.5rem;\n height: calc(2.5rem * 5 + 5 * 0.125rem);\n min-height: calc(2.5rem * 5 + 5 * 0.125rem);\n }\n }\n\n div.element-list {\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n }\n }\n\n .footer {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n .confirm-button {\n margin-left: auto;\n }\n\n &--compact {\n flex-direction: column;\n align-items: center;\n\n .confirm-button {\n margin-left: initial;\n }\n }\n }\n\n .default-space {\n margin-left: vars.$default-space;\n }\n\n .text-align {\n text-align: center;\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { DateTime } from 'luxon';\nimport { OnListener } from '../utils/listener';\nimport type { TimePickerCorners } from './time-picker.types';\n\ntype TimePickerDescriptorUnit = 'hour' | 'minute' | 'second' | 'millisecond';\n\ninterface TimePickerDescriptor {\n unit: TimePickerDescriptorUnit;\n header: string;\n hidden: boolean;\n numberArray: number[];\n focusedValue: number;\n}\n\ninterface TimeOutputFormat {\n hour: string;\n minute: string;\n second: string;\n millisecond: string;\n}\n\nconst LUXON_FORMAT_PATTERNS = {\n // h, hh, H, HH and various time formats that include hours\n hours: /\\b[Hh]\\b|HH|hh|H{3,4}|h{3,4}|t|tt|ttt|tttt|T|TT|TTT|TTTT/,\n // m, mm and time formats that include minutes\n minutes: /\\bm\\b|mm|t|tt|ttt|tttt|T|TT|TTT|TTTT/,\n // s, ss and time formats that include seconds\n seconds: /\\bs\\b|ss|tt|ttt|tttt|TT|TTT|TTTT/,\n // S, SSS (milliseconds), u/uu/uuu (fractional seconds), x/X (timestamps)\n milliseconds: /\\bS\\b|SSS|u|uu|uuu/,\n};\n\nconst HOUR_INTERVAL_DEFAULT = 1;\nconst MINUTE_INTERVAL_DEFAULT = 1;\nconst SECOND_INTERVAL_DEFAULT = 1;\nconst MILLISECOND_INTERVAL_DEFAULT = 100;\n\nconst CONFIRM_BUTTON_DEFAULT = 'Confirm';\nconst HEADER_DEFAULT = 'Time';\n\nconst FORMATTED_TIME_EMPTY: TimeOutputFormat = {\n hour: '',\n minute: '',\n second: '',\n millisecond: '',\n};\n\n@Component({\n tag: 'ix-time-picker',\n styleUrl: 'time-picker.scss',\n shadow: true,\n})\nexport class TimePicker {\n @Element() hostElement!: HTMLIxTimePickerElement;\n\n /**\n * Format of time string\n * See {@link https://moment.github.io/luxon/#/formatting?id=table-of-tokens} for all available tokens.\n * Note: Formats that combine date and time (like f or F) are not supported. Timestamp tokens x and X are not supported either.\n */\n @Prop() format: string = 'TT';\n @Watch('format')\n watchFormatIntervalPropHandler(newValue: string) {\n if (!newValue) {\n return;\n }\n\n this.initPicker();\n this.updateScrollPositions();\n }\n\n /**\n * Corner style\n */\n @Prop() corners: TimePickerCorners = 'rounded';\n\n /**\n * Embedded style (for use in other components)\n */\n @Prop() embedded = false;\n\n /**\n * @internal Temporary prop needed until datetime-picker is reworked for new design\n */\n @Prop() dateTimePickerAppearance: boolean = false;\n\n /**\n * Hides the header of the picker.\n *\n * @since 3.2.0\n */\n @Prop() hideHeader: boolean = false;\n\n /**\n * Interval for hour selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) hourInterval: number = HOUR_INTERVAL_DEFAULT;\n @Watch('hourInterval')\n watchHourIntervalPropHandler(newValue: number) {\n if (\n Number.isInteger(newValue) &&\n newValue >= 0 &&\n newValue <= (this.timeRef ? 12 : 23)\n ) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('hour', newValue);\n this.hourInterval = HOUR_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for minute selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) minuteInterval: number = MINUTE_INTERVAL_DEFAULT;\n @Watch('minuteInterval')\n watchMinuteIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 59) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('minute', newValue);\n this.minuteInterval = MINUTE_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for second selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) secondInterval: number = SECOND_INTERVAL_DEFAULT;\n @Watch('secondInterval')\n watchSecondIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 59) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('second', newValue);\n this.secondInterval = SECOND_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for millisecond selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) millisecondInterval: number =\n MILLISECOND_INTERVAL_DEFAULT;\n @Watch('millisecondInterval')\n watchMillisecondIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 999) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('millisecond', newValue);\n this.millisecondInterval = MILLISECOND_INTERVAL_DEFAULT;\n }\n\n private printIntervalError(intervalName: string, value: number) {\n console.error(\n `Value ${value} is not valid for ${intervalName}-interval. Falling back to default.`\n );\n }\n\n /**\n * Select time with format string\n * Format has to match the `format` property.\n */\n @Prop() time?: string;\n\n @Watch('time')\n watchTimePropHandler(newValue: string) {\n const timeFormat = DateTime.fromFormat(newValue, this.format);\n if (!timeFormat.isValid) {\n throw new Error('Format is not supported or not correct');\n }\n\n this._time = timeFormat;\n }\n\n /**\n * Get default time value\n * @returns DateTime.now() for empty state (no selection)\n */\n private getDefaultTime(): DateTime | undefined {\n return DateTime.now();\n }\n\n /**\n * Text of the time confirm button\n */\n @Prop({ attribute: 'i18n-confirm-time' }) i18nConfirmTime =\n CONFIRM_BUTTON_DEFAULT;\n\n /**\n * Text for top header\n */\n @Prop({ attribute: 'i18n-header' }) i18nHeader: string = HEADER_DEFAULT;\n\n /**\n * Text for hour column header\n */\n @Prop({ attribute: 'i18n-column-header' }) i18nHourColumnHeader: string =\n 'hr';\n\n /**\n * Text for minute column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-minute-column-header' })\n i18nMinuteColumnHeader: string = 'min';\n\n /**\n * Text for second column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-second-column-header' })\n i18nSecondColumnHeader: string = 'sec';\n\n /**\n * Text for millisecond column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-millisecond-column-header' })\n i18nMillisecondColumnHeader: string = 'ms';\n\n /**\n * Time event\n */\n @Event() timeSelect!: EventEmitter<string>;\n\n /**\n * Time change event\n */\n @Event() timeChange!: EventEmitter<string>;\n\n /**\n * Get the current time based on the wanted format\n */\n @Method()\n async getCurrentTime(): Promise<string | undefined> {\n return this._time?.toFormat(this.format);\n }\n\n @State() private _time?: DateTime;\n @Watch('_time')\n onTimeChange() {\n const formattedTimeOld = this.formattedTime;\n this.setTimeRef();\n this.formattedTime = this.getFormattedTime();\n\n this.updateScrollPositions(formattedTimeOld);\n }\n\n @State() private timeRef?: 'AM' | 'PM' | undefined;\n @State() private formattedTime: TimeOutputFormat = FORMATTED_TIME_EMPTY;\n @State() private timePickerDescriptors: TimePickerDescriptor[] = [];\n @State() private isUnitFocused: boolean = false;\n @State() private focusedUnit: TimePickerDescriptorUnit = 'hour';\n @State() private focusedValue: number = 0;\n\n private visibilityObserver?: MutationObserver;\n private focusScrollAlignment: 'start' | 'end' = 'start';\n\n componentWillLoad() {\n this.initPicker();\n }\n\n private initPicker() {\n let parsedTime: DateTime | undefined;\n\n if (this.time) {\n parsedTime = DateTime.fromFormat(this.time, this.format);\n\n if (!parsedTime.isValid) {\n console.error(\n `Invalid time format. The configured format does not match the format of the passed time. ${parsedTime.invalidReason}: ${parsedTime.invalidExplanation}`\n );\n parsedTime = this.getDefaultTime();\n }\n } else {\n parsedTime = this.getDefaultTime();\n }\n\n this._time = parsedTime;\n\n this.setTimeRef();\n this.setTimePickerDescriptors();\n this.setInitialFocusedValueAndUnit();\n\n this.watchHourIntervalPropHandler(this.hourInterval);\n this.watchMinuteIntervalPropHandler(this.minuteInterval);\n this.watchSecondIntervalPropHandler(this.secondInterval);\n this.watchMillisecondIntervalPropHandler(this.millisecondInterval);\n }\n\n componentDidLoad() {\n this.updateScrollPositions();\n this.setupVisibilityObserver();\n }\n\n componentDidRender() {\n if (this.isUnitFocused) {\n const elementContainer = this.getElementContainer(\n this.focusedUnit,\n this.focusedValue\n );\n const elementList = this.getElementList(this.focusedUnit);\n\n if (elementContainer) {\n elementContainer.focus({ preventScroll: true });\n\n if (!this.isElementVisible(elementContainer, elementList)) {\n elementContainer.scrollIntoView({\n block: this.focusScrollAlignment,\n });\n\n if (this.focusScrollAlignment === 'end') {\n elementList.scrollTop += 4;\n } else {\n elementList.scrollTop -= 4;\n }\n }\n }\n }\n }\n\n disconnectedCallback() {\n if (this.visibilityObserver) {\n this.visibilityObserver.disconnect();\n }\n }\n\n @OnListener<TimePicker>('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.isUnitFocused) {\n return;\n }\n\n let newValue = this.focusedValue;\n let shouldPreventDefault = true;\n let newValueInterval;\n\n switch (this.focusedUnit) {\n case 'hour':\n newValueInterval = this.hourInterval;\n break;\n case 'minute':\n newValueInterval = this.minuteInterval;\n break;\n case 'second':\n newValueInterval = this.secondInterval;\n break;\n case 'millisecond':\n newValueInterval = this.millisecondInterval;\n break;\n }\n\n switch (event.key) {\n case 'Tab':\n shouldPreventDefault = false;\n this.isUnitFocused = false;\n break;\n\n case 'ArrowUp':\n newValue -= newValueInterval;\n this.focusScrollAlignment = 'start';\n this.updateFocusedValue(newValue);\n this.updateDescriptorFocusedValue(this.focusedUnit, this.focusedValue);\n break;\n\n case 'ArrowDown':\n newValue += newValueInterval;\n this.focusScrollAlignment = 'end';\n this.updateFocusedValue(newValue);\n this.updateDescriptorFocusedValue(this.focusedUnit, this.focusedValue);\n break;\n\n case 'Enter':\n case ' ':\n this.select(this.focusedUnit, this.focusedValue);\n break;\n\n default:\n return;\n }\n\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }\n\n onUnitCellBlur(unit: TimePickerDescriptorUnit) {\n this.isUnitFocused = false;\n const focusedValue = Number(this.formattedTime[unit]);\n\n this.updateDescriptorFocusedValue(unit, focusedValue);\n }\n\n onUnitCellFocus(unit: TimePickerDescriptorUnit, value: number) {\n this.isUnitFocused = true;\n this.focusedUnit = unit;\n this.focusedValue = value;\n\n this.updateDescriptorFocusedValue(unit, value);\n }\n\n private getElementList(unit: TimePickerDescriptorUnit): HTMLDivElement {\n return this.hostElement.shadowRoot?.querySelector(\n `[data-element-list-id=\"${unit}\"]`\n ) as HTMLDivElement;\n }\n\n private getElementContainer(\n unit: TimePickerDescriptorUnit,\n number: number\n ): HTMLDivElement {\n return this.hostElement.shadowRoot?.querySelector(\n `[data-element-container-id=\"${unit}-${number}\"]`\n ) as HTMLDivElement;\n }\n\n private isElementVisible(\n element: HTMLElement,\n container: HTMLElement\n ): boolean {\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n return (\n elementRect.top >= containerRect.top &&\n elementRect.bottom <= containerRect.bottom\n );\n }\n\n private updateFocusedValue(value: number) {\n const numberArray = this.getNumberArrayForUnit(this.focusedUnit);\n const maxValue = numberArray[numberArray.length - 1];\n const minValue = numberArray[0];\n\n if (value > maxValue) {\n value = minValue;\n this.focusScrollAlignment = 'start';\n } else if (value < minValue) {\n value = maxValue;\n this.focusScrollAlignment = 'end';\n }\n\n this.focusedValue = value;\n }\n\n private setInitialFocusedValueAndUnit() {\n const firstVisibleDescriptor = this.timePickerDescriptors.find(\n (descriptor) => !descriptor.hidden\n );\n if (!firstVisibleDescriptor) {\n return;\n }\n\n const selectedValue = Number(\n this.formattedTime[firstVisibleDescriptor.unit]\n );\n const isValidSelection =\n firstVisibleDescriptor.numberArray.includes(selectedValue);\n\n this.focusedValue = isValidSelection\n ? selectedValue\n : firstVisibleDescriptor.numberArray[0];\n\n this.focusedUnit = firstVisibleDescriptor.unit;\n }\n\n private setupVisibilityObserver() {\n let dropdownElement: Element | null = this.hostElement;\n while (dropdownElement && dropdownElement.tagName !== 'IX-DROPDOWN') {\n dropdownElement = dropdownElement.parentElement;\n }\n\n if (!dropdownElement) {\n return;\n }\n\n this.visibilityObserver = new MutationObserver((mutations) =>\n this.mutationObserverCallback(mutations)\n );\n\n this.visibilityObserver.observe(dropdownElement, {\n attributes: true,\n attributeFilter: ['class', 'style'],\n });\n }\n\n private mutationObserverCallback(mutations: MutationRecord[]) {\n for (const mutation of mutations) {\n if (mutation.type !== 'attributes') {\n continue;\n }\n\n const dropdown = mutation.target as HTMLElement;\n\n if (!dropdown.classList.contains('show')) {\n // keep picker in sync with input\n if (this.time) {\n const timeFormat = DateTime.fromFormat(this.time, this.format);\n if (timeFormat.isValid) {\n this._time = DateTime.fromFormat(this.time, this.format);\n this.setInitialFocusedValueAndUnit();\n }\n }\n\n continue;\n }\n\n const elementsReady = this.areElementsRendered();\n if (!elementsReady) {\n continue;\n }\n\n this.updateScrollPositions();\n }\n }\n\n private areElementsRendered(): boolean {\n const elementLists =\n this.hostElement.shadowRoot?.querySelectorAll('.element-list');\n\n if (!elementLists || elementLists.length === 0) {\n return false;\n }\n\n return Array.from(elementLists).some(\n (list) => (list as HTMLElement).offsetHeight > 0\n );\n }\n\n private getFormattedTime(): TimeOutputFormat {\n if (!this._time) {\n return FORMATTED_TIME_EMPTY;\n }\n\n return {\n hour:\n this.timeRef !== undefined\n ? this._time.toFormat('h')\n : this._time.toFormat('H'),\n minute: this._time.toFormat('m'),\n second: this._time.toFormat('s'),\n millisecond: this._time.toFormat('S'),\n };\n }\n\n private timeUpdate(unit: TimePickerDescriptorUnit, value: number): number {\n let maxValue = DateTime.now().endOf('day').get(unit);\n\n if (unit === 'hour') {\n if (this.timeRef === 'PM') {\n // 12 PM should remain 12, other PM hours add 12\n value = value === 12 ? 12 : value + 12;\n } else if (this.timeRef === 'AM') {\n // 12 AM should be 0, other AM hours remain as is\n value = value === 12 ? 0 : value;\n maxValue = 12;\n }\n }\n\n if (value > maxValue) {\n value = maxValue;\n } else if (value < 0) {\n value = 0;\n }\n\n if (!this._time) {\n this._time = DateTime.now().startOf('day');\n }\n\n this._time = this._time.set({\n [unit]: value,\n });\n\n return value;\n }\n\n private changeTimeReference(newTimeRef: 'AM' | 'PM') {\n if (this.timeRef === newTimeRef) {\n return;\n }\n\n if (!this._time) {\n this._time = DateTime.now().startOf('day');\n }\n\n this.timeRef = newTimeRef;\n const currentHour = this._time.hour;\n\n if (newTimeRef === 'PM' && currentHour < 12) {\n this._time = this._time.plus({ hours: 12 });\n } else if (newTimeRef === 'AM' && currentHour >= 12) {\n this._time = this._time.minus({ hours: 12 });\n }\n\n this.timeChange.emit(this._time.toFormat(this.format));\n }\n\n private isFormat12Hour(format: string): boolean {\n // Remove any text that's inside quotes (literal text in Luxon format strings)\n let cleanFormat = '';\n let inQuote = false;\n\n for (let i = 0; i < format.length; i++) {\n const char = format[i];\n if (char === \"'\") {\n inQuote = !inQuote;\n } else if (!inQuote) {\n cleanFormat += char;\n }\n }\n\n // Check for specific 12-hour format tokens\n // Case-sensitive matching to distinguish between 'h' and 'H'\n return /h|a|t/.test(cleanFormat);\n }\n\n private setTimeRef() {\n const uses12HourFormat = this.isFormat12Hour(this.format);\n\n if (uses12HourFormat && this._time) {\n this.timeRef = this._time!.hour >= 12 ? 'PM' : 'AM';\n } else {\n this.timeRef = undefined;\n }\n }\n\n private getInitialFocusedValueForUnit(\n unit: TimePickerDescriptorUnit,\n numberArray: number[]\n ): number {\n const selectedValue = Number(this.formattedTime[unit]);\n return numberArray.includes(selectedValue) ? selectedValue : numberArray[0];\n }\n\n private setTimePickerDescriptors() {\n let hourNumbers = [];\n let minuteNumbers = [];\n let secondNumbers = [];\n let millisecondsNumbers = [];\n\n if (this.timeRef !== undefined) {\n hourNumbers = Array.from(\n { length: Math.ceil(12 / this.hourInterval) },\n (_, i) => i * this.hourInterval + 1\n ).filter((hour) => hour <= 12);\n } else {\n hourNumbers = Array.from(\n { length: Math.ceil(24 / this.hourInterval) },\n (_, i) => i * this.hourInterval\n );\n }\n\n minuteNumbers = Array.from(\n { length: Math.ceil(60 / this.minuteInterval) },\n (_, i) => i * this.minuteInterval\n );\n secondNumbers = Array.from(\n { length: Math.ceil(60 / this.secondInterval) },\n (_, i) => i * this.secondInterval\n );\n millisecondsNumbers = Array.from(\n { length: Math.ceil(1000 / this.millisecondInterval) },\n (_, i) => i * this.millisecondInterval\n );\n\n this.timePickerDescriptors = [\n {\n unit: 'hour',\n header: this.i18nHourColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.hours.test(this.format),\n numberArray: hourNumbers,\n focusedValue: this.getInitialFocusedValueForUnit('hour', hourNumbers),\n },\n {\n unit: 'minute',\n header: this.i18nMinuteColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.minutes.test(this.format),\n numberArray: minuteNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'minute',\n minuteNumbers\n ),\n },\n {\n unit: 'second',\n header: this.i18nSecondColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.seconds.test(this.format),\n numberArray: secondNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'second',\n secondNumbers\n ),\n },\n {\n unit: 'millisecond',\n header: this.i18nMillisecondColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.milliseconds.test(this.format),\n numberArray: millisecondsNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'millisecond',\n millisecondsNumbers\n ),\n },\n ];\n\n this.timePickerDescriptors = this.timePickerDescriptors.filter(\n (item) => !item.hidden\n );\n }\n\n private getNumberArrayForUnit(unit: TimePickerDescriptorUnit): number[] {\n const descriptor = this.timePickerDescriptors.find(\n (descriptor) => descriptor.unit === unit\n );\n return descriptor ? descriptor.numberArray : [];\n }\n\n private isSelected(unit: TimePickerDescriptorUnit, number: number): boolean {\n return this.formattedTime![unit] === String(number);\n }\n\n private select(unit: TimePickerDescriptorUnit, number: number) {\n this.formattedTime = {\n ...this.formattedTime!,\n [unit]: String(number),\n };\n\n this.timeUpdate(unit, number);\n this.elementListScrollToTop(unit, number, 'smooth');\n this.timeChange.emit(this._time!.toFormat(this.format));\n }\n\n private updateDescriptorFocusedValue(\n unit: TimePickerDescriptorUnit,\n value: number\n ) {\n const descriptorIndex = this.timePickerDescriptors.findIndex(\n (d) => d.unit === unit\n );\n if (descriptorIndex !== -1) {\n this.timePickerDescriptors = [\n ...this.timePickerDescriptors.slice(0, descriptorIndex),\n {\n ...this.timePickerDescriptors[descriptorIndex],\n focusedValue: value,\n },\n ...this.timePickerDescriptors.slice(descriptorIndex + 1),\n ];\n }\n }\n\n private elementListScrollToTop(\n unit: TimePickerDescriptorUnit,\n number: number,\n scrollBehaviour: 'smooth' | 'instant'\n ) {\n const elementList = this.getElementList(unit);\n const elementContainer = this.getElementContainer(unit, number);\n\n if (elementList && elementContainer) {\n const elementListHeight = elementList.clientHeight;\n const elementContainerHeight = elementContainer.clientHeight;\n\n // Offset which is used to adjust the scroll position to account for margins, elements being hidden, etc.\n let scrollPositionOffset = 11;\n if (this.hideHeader) {\n // 56 + 1 --> height of the header container and separator\n scrollPositionOffset -= 57;\n }\n\n const scrollPosition =\n elementContainer.offsetTop -\n elementListHeight / 2 +\n elementContainerHeight -\n scrollPositionOffset;\n\n elementList.scrollTo({\n top: scrollPosition,\n behavior: scrollBehaviour,\n });\n }\n }\n\n /**\n * Updates all scroll positions of the time picker elements\n * Updates only the elements that have changed if `formattedTimeOld` is provided\n */\n private updateScrollPositions(\n formattedTimeOld: TimeOutputFormat | undefined = undefined\n ) {\n for (const key in this.formattedTime) {\n const unitKey = key as keyof TimeOutputFormat;\n\n if (\n !formattedTimeOld ||\n this.formattedTime[unitKey] !== formattedTimeOld[unitKey]\n ) {\n this.elementListScrollToTop(\n unitKey as TimePickerDescriptorUnit,\n Number(this.formattedTime[unitKey]),\n 'instant'\n );\n }\n }\n }\n\n private formatUnitValue(\n unit: TimePickerDescriptorUnit,\n value: number\n ): string {\n if (unit === 'millisecond') {\n return value.toString().padStart(3, '0');\n }\n\n return value < 10 ? `0${value}` : value.toString();\n }\n\n private getColumnSeparator(currentIndex: number): string {\n if (currentIndex + 1 < this.timePickerDescriptors.length) {\n const nextUnit = this.timePickerDescriptors[currentIndex + 1].unit;\n return nextUnit === 'millisecond' ? '.' : ':';\n }\n\n return ':';\n }\n\n private getElementContainerTabIndex(\n number: number,\n descriptorUnit: TimePickerDescriptorUnit\n ): string {\n const descriptor = this.timePickerDescriptors.find(\n (d) => d.unit === descriptorUnit\n );\n\n if (number === descriptor?.focusedValue) {\n return '0';\n }\n\n return '-1';\n }\n\n render() {\n return (\n <Host>\n <ix-date-time-card\n embedded={this.embedded}\n timePickerAppearance={true}\n corners={this.corners}\n hasFooter={!this.dateTimePickerAppearance}\n hideHeader={this.hideHeader}\n >\n <div class=\"header\" slot=\"header\">\n <ix-typography format=\"body\">{this.i18nHeader}</ix-typography>\n </div>\n <div class=\"clock\">\n {this.timePickerDescriptors.map((descriptor, index: number) => (\n <div class=\"flex\">\n <div class={{ columns: true, hidden: descriptor.hidden }}>\n <div class=\"column-header\" title={descriptor.header}>\n {descriptor.header}\n </div>\n <div\n data-element-list-id={descriptor.unit}\n class=\"element-list\"\n tabIndex={-1}\n >\n {descriptor.numberArray.map((number) => {\n return (\n <button\n data-element-container-id={`${descriptor.unit}-${number}`}\n class={{\n selected: this.isSelected(descriptor.unit, number),\n 'element-container': true,\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n }}\n onClick={() => {\n this.select(descriptor.unit, number);\n }}\n onFocus={() =>\n this.onUnitCellFocus(descriptor.unit, number)\n }\n onBlur={() => this.onUnitCellBlur(descriptor.unit)}\n tabindex={this.getElementContainerTabIndex(\n number,\n descriptor.unit\n )}\n aria-label={`${descriptor.header}: ${number}`}\n >\n {this.formatUnitValue(descriptor.unit, number)}\n </button>\n );\n })}\n <div class=\"element-list-padding\"></div>\n </div>\n </div>\n\n {index !== this.timePickerDescriptors.length - 1 && (\n <div\n class={{\n 'column-separator': true,\n hidden: descriptor.hidden,\n }}\n >\n {this.getColumnSeparator(index)}\n </div>\n )}\n </div>\n ))}\n\n {this.timeRef && (\n <div class=\"flex\">\n <div class=\"column-separator\"></div>\n <div class=\"columns\">\n <div class=\"column-header\" title=\"AM/PM\" />\n <div class=\"element-list\" tabIndex={-1}>\n <button\n data-am-pm-id=\"AM\"\n class={{\n selected: this.timeRef === 'AM',\n 'element-container': true,\n }}\n onClick={() => this.changeTimeReference('AM')}\n tabindex=\"0\"\n aria-label=\"AM\"\n >\n AM\n </button>\n <button\n data-am-pm-id=\"PM\"\n class={{\n selected: this.timeRef === 'PM',\n 'element-container': true,\n }}\n onClick={() => this.changeTimeReference('PM')}\n tabindex=\"0\"\n aria-label=\"PM\"\n >\n PM\n </button>\n </div>\n </div>\n </div>\n )}\n </div>\n\n <div\n class={{\n footer: true,\n 'footer--compact': this.timePickerDescriptors.length <= 2,\n }}\n slot=\"footer\"\n >\n <ix-button\n class=\"confirm-button\"\n onClick={() => {\n this.timeSelect.emit(this._time?.toFormat(this.format));\n }}\n >\n {this.i18nConfirmTime}\n </ix-button>\n </div>\n </ix-date-time-card>\n </Host>\n );\n }\n}\n"],"names":["DateTime","h","Host","index","OnListener"],"mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,ihnBAAihnB;;ACAvinB;;;;;;;AAOG;;;;;;;;;;;AAmCH,MAAM,qBAAqB,GAAG;;AAE5B,IAAA,KAAK,EAAE,0DAA0D;;AAEjE,IAAA,OAAO,EAAE,sCAAsC;;AAE/C,IAAA,OAAO,EAAE,kCAAkC;;AAE3C,IAAA,YAAY,EAAE,oBAAoB;CACnC;AAED,MAAM,qBAAqB,GAAG,CAAC;AAC/B,MAAM,uBAAuB,GAAG,CAAC;AACjC,MAAM,uBAAuB,GAAG,CAAC;AACjC,MAAM,4BAA4B,GAAG,GAAG;AAExC,MAAM,sBAAsB,GAAG,SAAS;AACxC,MAAM,cAAc,GAAG,MAAM;AAE7B,MAAM,oBAAoB,GAAqB;AAC7C,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,MAAM,EAAE,EA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,0CAAA,EACE,KAAK,EAAE;AACL,gBAAA,MAAM,EAAE,IAAI;AACZ,gBAAA,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,CAAC,MAAM,IAAI,CAAC;aAC1D,EACD,IAAI,EAAC,QAAQ,EAAA,EAEbA,OAAA,CAAA,WAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,KAAK,EAAC,gBAAgB,EACtB,OAAO,EAAE,MAAK;;AACZ,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACxD,EAAA,EAEA,IAAI,CAAC,eAAe,CACX,CACR,CACY,CACf;;;;;;;;;;;;;AA5nBX,UAAA,CAAA;IADCG,mBAAU,CAAa,SAAS;CAyDhC,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,IAAA,CAAA;;;;;"}
1
+ {"version":3,"file":"ix-time-picker.entry.cjs.js","sources":["src/components/time-picker/time-picker.scss?tag=ix-time-picker&encapsulation=shadow","src/components/time-picker/time-picker.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n@use './common-variables' as vars;\n@use 'mixins/shadow-dom/component';\n@use 'mixins/input';\n@use 'legacy/components/forms';\n\n@include input.form;\n\n:host {\n display: block;\n position: relative;\n width: fit-content;\n\n @include component.ix-component;\n\n .standaloneAppearance {\n box-shadow: none;\n }\n\n .hidden {\n display: none;\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: center;\n height: vars.$default-control-height;\n }\n\n .clock {\n display: flex;\n justify-content: center;\n align-items: start;\n\n .flex {\n display: flex;\n height: 100%;\n align-items: start;\n\n .columns {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-around;\n\n .column-header {\n height: 2.5rem;\n width: 2.5rem;\n line-height: 2.5rem;\n text-align: center;\n color: var(--theme-color-soft-text);\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n }\n\n .column-separator {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100%;\n margin-top: 3rem;\n width: 0.5rem;\n }\n }\n\n .element-list {\n list-style-type: none;\n overflow: auto;\n padding: 0.0625rem;\n margin: -0.0625rem;\n max-height: calc(2.5rem * 6 + 0.125rem * 6);\n\n button {\n all: unset;\n }\n\n .element-container {\n box-sizing: border-box;\n width: 2.5rem;\n height: 2.5rem;\n margin-bottom: 0.125rem;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: var(--theme-color-primary);\n\n &:hover {\n background-color: var(--theme-datepicker-day--background--hover);\n }\n\n &:focus-visible {\n box-shadow: 0 0 0 1px var(--theme-color-focus-bdr);\n }\n }\n\n .selected {\n background-color: var(--theme-datepicker-day--background--selected);\n color: var(--theme-datepicker-day--color--selected);\n font-weight: var(--theme-font-weight-bold);\n\n &:hover {\n background-color: var(\n --theme-datepicker-day--background--selected-hover\n );\n }\n\n &:focus-visible {\n border: 0.0625rem solid var(--theme-color-inv-contrast-text);\n }\n }\n\n .element-list-padding {\n width: 2.5rem;\n height: calc(2.5rem * 5 + 5 * 0.125rem);\n min-height: calc(2.5rem * 5 + 5 * 0.125rem);\n }\n }\n\n div.element-list {\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n }\n }\n\n .footer {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n flex-wrap: wrap;\n\n .confirm-button {\n margin-left: auto;\n }\n\n &--compact {\n flex-direction: column;\n align-items: center;\n\n .confirm-button {\n margin-left: initial;\n }\n }\n }\n\n .default-space {\n margin-left: vars.$default-space;\n }\n\n .text-align {\n text-align: center;\n }\n}\n","/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { DateTime } from 'luxon';\nimport { OnListener } from '../utils/listener';\nimport type { TimePickerCorners } from './time-picker.types';\n\ntype TimePickerDescriptorUnit = 'hour' | 'minute' | 'second' | 'millisecond';\n\ninterface TimePickerDescriptor {\n unit: TimePickerDescriptorUnit;\n header: string;\n hidden: boolean;\n numberArray: number[];\n focusedValue: number;\n}\n\ninterface TimeOutputFormat {\n hour: string;\n minute: string;\n second: string;\n millisecond: string;\n}\n\nconst LUXON_FORMAT_PATTERNS = {\n // h, hh, H, HH and various time formats that include hours\n hours: /\\b[Hh]\\b|HH|hh|H{3,4}|h{3,4}|t|tt|ttt|tttt|T|TT|TTT|TTTT/,\n // m, mm and time formats that include minutes\n minutes: /\\bm\\b|mm|t|tt|ttt|tttt|T|TT|TTT|TTTT/,\n // s, ss and time formats that include seconds\n seconds: /\\bs\\b|ss|tt|ttt|tttt|TT|TTT|TTTT/,\n // S, SSS (milliseconds), u/uu/uuu (fractional seconds), x/X (timestamps)\n milliseconds: /\\bS\\b|SSS|u|uu|uuu/,\n};\n\nconst HOUR_INTERVAL_DEFAULT = 1;\nconst MINUTE_INTERVAL_DEFAULT = 1;\nconst SECOND_INTERVAL_DEFAULT = 1;\nconst MILLISECOND_INTERVAL_DEFAULT = 100;\n\nconst CONFIRM_BUTTON_DEFAULT = 'Confirm';\nconst HEADER_DEFAULT = 'Time';\n\nconst FORMATTED_TIME_EMPTY: TimeOutputFormat = {\n hour: '',\n minute: '',\n second: '',\n millisecond: '',\n};\n\n@Component({\n tag: 'ix-time-picker',\n styleUrl: 'time-picker.scss',\n shadow: true,\n})\nexport class TimePicker {\n @Element() hostElement!: HTMLIxTimePickerElement;\n\n /**\n * Format of time string\n * See {@link https://moment.github.io/luxon/#/formatting?id=table-of-tokens} for all available tokens.\n * Note: Formats that combine date and time (like f or F) are not supported. Timestamp tokens x and X are not supported either.\n */\n @Prop() format: string = 'TT';\n @Watch('format')\n watchFormatIntervalPropHandler(newValue: string) {\n if (!newValue) {\n return;\n }\n\n this.initPicker();\n this.updateScrollPositions();\n }\n\n /**\n * Corner style\n */\n @Prop() corners: TimePickerCorners = 'rounded';\n\n /**\n * Embedded style (for use in other components)\n */\n @Prop() embedded = false;\n\n /**\n * @internal Temporary prop needed until datetime-picker is reworked for new design\n */\n @Prop() dateTimePickerAppearance: boolean = false;\n\n /**\n * Hides the header of the picker.\n *\n * @since 3.2.0\n */\n @Prop() hideHeader: boolean = false;\n\n /**\n * Interval for hour selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) hourInterval: number = HOUR_INTERVAL_DEFAULT;\n @Watch('hourInterval')\n watchHourIntervalPropHandler(newValue: number) {\n if (\n Number.isInteger(newValue) &&\n newValue >= 0 &&\n newValue <= (this.timeRef ? 12 : 23)\n ) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('hour', newValue);\n this.hourInterval = HOUR_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for minute selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) minuteInterval: number = MINUTE_INTERVAL_DEFAULT;\n @Watch('minuteInterval')\n watchMinuteIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 59) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('minute', newValue);\n this.minuteInterval = MINUTE_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for second selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) secondInterval: number = SECOND_INTERVAL_DEFAULT;\n @Watch('secondInterval')\n watchSecondIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 59) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('second', newValue);\n this.secondInterval = SECOND_INTERVAL_DEFAULT;\n }\n\n /**\n * Interval for millisecond selection\n *\n * @since 3.2.0\n */\n @Prop({ mutable: true }) millisecondInterval: number =\n MILLISECOND_INTERVAL_DEFAULT;\n @Watch('millisecondInterval')\n watchMillisecondIntervalPropHandler(newValue: number) {\n if (newValue >= 0 && newValue <= 999) {\n this.setTimePickerDescriptors();\n return;\n }\n\n this.printIntervalError('millisecond', newValue);\n this.millisecondInterval = MILLISECOND_INTERVAL_DEFAULT;\n }\n\n private printIntervalError(intervalName: string, value: number) {\n console.error(\n `Value ${value} is not valid for ${intervalName}-interval. Falling back to default.`\n );\n }\n\n /**\n * Select time with format string\n * Format has to match the `format` property.\n */\n @Prop() time?: string;\n\n @Watch('time')\n watchTimePropHandler(newValue: string) {\n const timeFormat = DateTime.fromFormat(newValue, this.format);\n if (!timeFormat.isValid) {\n throw new Error('Format is not supported or not correct');\n }\n\n this._time = timeFormat;\n }\n\n /**\n * Get default time value\n * @returns DateTime.now() for empty state (no selection)\n */\n private getDefaultTime(): DateTime | undefined {\n return DateTime.now();\n }\n\n /**\n * Text of the time confirm button\n */\n @Prop({ attribute: 'i18n-confirm-time' }) i18nConfirmTime =\n CONFIRM_BUTTON_DEFAULT;\n\n /**\n * Text for top header\n */\n @Prop({ attribute: 'i18n-header' }) i18nHeader: string = HEADER_DEFAULT;\n\n /**\n * Text for hour column header\n */\n @Prop({ attribute: 'i18n-column-header' }) i18nHourColumnHeader: string =\n 'hr';\n\n /**\n * Text for minute column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-minute-column-header' })\n i18nMinuteColumnHeader: string = 'min';\n\n /**\n * Text for second column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-second-column-header' })\n i18nSecondColumnHeader: string = 'sec';\n\n /**\n * Text for millisecond column header\n */\n // eslint-disable-next-line @stencil-community/decorators-style\n @Prop({ attribute: 'i18n-millisecond-column-header' })\n i18nMillisecondColumnHeader: string = 'ms';\n\n /**\n * Time event\n */\n @Event() timeSelect!: EventEmitter<string>;\n\n /**\n * Time change event\n */\n @Event() timeChange!: EventEmitter<string>;\n\n /**\n * Get the current time based on the wanted format\n */\n @Method()\n async getCurrentTime(): Promise<string | undefined> {\n return this._time?.toFormat(this.format);\n }\n\n @State() private _time?: DateTime;\n @Watch('_time')\n onTimeChange() {\n const formattedTimeOld = this.formattedTime;\n this.setTimeRef();\n this.formattedTime = this.getFormattedTime();\n\n this.updateScrollPositions(formattedTimeOld);\n }\n\n @State() private timeRef?: 'AM' | 'PM' | undefined;\n @State() private formattedTime: TimeOutputFormat = FORMATTED_TIME_EMPTY;\n @State() private timePickerDescriptors: TimePickerDescriptor[] = [];\n @State() private isUnitFocused: boolean = false;\n @State() private focusedUnit: TimePickerDescriptorUnit = 'hour';\n @State() private focusedValue: number = 0;\n\n private visibilityObserver?: MutationObserver;\n private focusScrollAlignment: 'start' | 'end' = 'start';\n\n componentWillLoad() {\n this.initPicker();\n }\n\n private initPicker() {\n let parsedTime: DateTime | undefined;\n\n if (this.time) {\n parsedTime = DateTime.fromFormat(this.time, this.format);\n\n if (!parsedTime.isValid) {\n console.error(\n `Invalid time format. The configured format does not match the format of the passed time. ${parsedTime.invalidReason}: ${parsedTime.invalidExplanation}`\n );\n parsedTime = this.getDefaultTime();\n }\n } else {\n parsedTime = this.getDefaultTime();\n }\n\n this._time = parsedTime;\n\n this.setTimeRef();\n this.setTimePickerDescriptors();\n this.setInitialFocusedValueAndUnit();\n\n this.watchHourIntervalPropHandler(this.hourInterval);\n this.watchMinuteIntervalPropHandler(this.minuteInterval);\n this.watchSecondIntervalPropHandler(this.secondInterval);\n this.watchMillisecondIntervalPropHandler(this.millisecondInterval);\n }\n\n componentDidLoad() {\n this.updateScrollPositions();\n this.setupVisibilityObserver();\n }\n\n componentDidRender() {\n if (this.isUnitFocused) {\n const elementContainer = this.getElementContainer(\n this.focusedUnit,\n this.focusedValue\n );\n const elementList = this.getElementList(this.focusedUnit);\n\n if (elementContainer) {\n elementContainer.focus({ preventScroll: true });\n\n if (!this.isElementVisible(elementContainer, elementList)) {\n this.scrollElementIntoView(\n elementContainer,\n elementList,\n this.focusScrollAlignment\n );\n }\n }\n }\n }\n\n disconnectedCallback() {\n if (this.visibilityObserver) {\n this.visibilityObserver.disconnect();\n }\n }\n\n @OnListener<TimePicker>('keydown')\n handleKeyDown(event: KeyboardEvent) {\n if (!this.isUnitFocused) {\n return;\n }\n\n let newValue = this.focusedValue;\n let shouldPreventDefault = true;\n let newValueInterval;\n\n switch (this.focusedUnit) {\n case 'hour':\n newValueInterval = this.hourInterval;\n break;\n case 'minute':\n newValueInterval = this.minuteInterval;\n break;\n case 'second':\n newValueInterval = this.secondInterval;\n break;\n case 'millisecond':\n newValueInterval = this.millisecondInterval;\n break;\n }\n\n switch (event.key) {\n case 'Tab':\n shouldPreventDefault = false;\n this.isUnitFocused = false;\n break;\n\n case 'ArrowUp':\n newValue -= newValueInterval;\n this.focusScrollAlignment = 'start';\n this.updateFocusedValue(newValue);\n this.updateDescriptorFocusedValue(this.focusedUnit, this.focusedValue);\n break;\n\n case 'ArrowDown':\n newValue += newValueInterval;\n this.focusScrollAlignment = 'end';\n this.updateFocusedValue(newValue);\n this.updateDescriptorFocusedValue(this.focusedUnit, this.focusedValue);\n break;\n\n case 'Enter':\n case ' ':\n this.select(this.focusedUnit, this.focusedValue);\n break;\n\n default:\n return;\n }\n\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }\n\n onUnitCellBlur(unit: TimePickerDescriptorUnit, event: FocusEvent) {\n const relatedTarget = event.relatedTarget as HTMLElement;\n\n // Check if column lost focus to scroll back to selected value\n if (relatedTarget) {\n const relatedUnit =\n relatedTarget.dataset.elementContainerId?.split('-')[0];\n\n if (relatedUnit !== unit) {\n this.elementListScrollToTop(\n unit,\n Number(this.formattedTime[unit]),\n 'smooth'\n );\n }\n }\n\n this.isUnitFocused = false;\n const focusedValue = Number(this.formattedTime[unit]);\n\n this.updateDescriptorFocusedValue(unit, focusedValue);\n }\n\n onUnitCellFocus(unit: TimePickerDescriptorUnit, value: number) {\n this.isUnitFocused = true;\n this.focusedUnit = unit;\n this.focusedValue = value;\n\n this.updateDescriptorFocusedValue(unit, value);\n }\n\n private getElementList(unit: TimePickerDescriptorUnit): HTMLDivElement {\n return this.hostElement.shadowRoot?.querySelector(\n `[data-element-list-id=\"${unit}\"]`\n ) as HTMLDivElement;\n }\n\n private getElementContainer(\n unit: TimePickerDescriptorUnit,\n number: number\n ): HTMLDivElement {\n return this.hostElement.shadowRoot?.querySelector(\n `[data-element-container-id=\"${unit}-${number}\"]`\n ) as HTMLDivElement;\n }\n\n private isElementVisible(\n element: HTMLElement,\n container: HTMLElement\n ): boolean {\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n return (\n elementRect.top >= containerRect.top &&\n elementRect.bottom <= containerRect.bottom\n );\n }\n\n private scrollElementIntoView(\n element: HTMLElement,\n container: HTMLElement,\n alignment: 'start' | 'end'\n ) {\n const SCROLL_BUFFER = 1;\n const containerRect = container.getBoundingClientRect();\n const elementRect = element.getBoundingClientRect();\n\n if (alignment === 'end') {\n container.scrollTop +=\n elementRect.bottom - containerRect.bottom + SCROLL_BUFFER;\n } else {\n container.scrollTop +=\n elementRect.top - containerRect.top - SCROLL_BUFFER;\n }\n }\n\n private updateFocusedValue(value: number) {\n const numberArray = this.getNumberArrayForUnit(this.focusedUnit);\n const maxValue = numberArray[numberArray.length - 1];\n const minValue = numberArray[0];\n\n if (value > maxValue) {\n value = minValue;\n this.focusScrollAlignment = 'start';\n } else if (value < minValue) {\n value = maxValue;\n this.focusScrollAlignment = 'end';\n }\n\n this.focusedValue = value;\n }\n\n private setInitialFocusedValueAndUnit() {\n const firstVisibleDescriptor = this.timePickerDescriptors.find(\n (descriptor) => !descriptor.hidden\n );\n if (!firstVisibleDescriptor) {\n return;\n }\n\n const selectedValue = Number(\n this.formattedTime[firstVisibleDescriptor.unit]\n );\n const isValidSelection =\n firstVisibleDescriptor.numberArray.includes(selectedValue);\n\n this.focusedValue = isValidSelection\n ? selectedValue\n : firstVisibleDescriptor.numberArray[0];\n\n this.focusedUnit = firstVisibleDescriptor.unit;\n }\n\n private setupVisibilityObserver() {\n let dropdownElement: Element | null = this.hostElement;\n while (dropdownElement && dropdownElement.tagName !== 'IX-DROPDOWN') {\n dropdownElement = dropdownElement.parentElement;\n }\n\n if (!dropdownElement) {\n return;\n }\n\n this.visibilityObserver = new MutationObserver((mutations) =>\n this.mutationObserverCallback(mutations)\n );\n\n this.visibilityObserver.observe(dropdownElement, {\n attributes: true,\n attributeFilter: ['class', 'style'],\n });\n }\n\n private mutationObserverCallback(mutations: MutationRecord[]) {\n for (const mutation of mutations) {\n if (mutation.type !== 'attributes') {\n continue;\n }\n\n const dropdown = mutation.target as HTMLElement;\n\n if (!dropdown.classList.contains('show')) {\n // keep picker in sync with input\n if (this.time) {\n const timeFormat = DateTime.fromFormat(this.time, this.format);\n if (timeFormat.isValid) {\n this._time = DateTime.fromFormat(this.time, this.format);\n this.setInitialFocusedValueAndUnit();\n }\n }\n\n continue;\n }\n\n const elementsReady = this.areElementsRendered();\n if (!elementsReady) {\n continue;\n }\n\n this.updateScrollPositions();\n }\n }\n\n private areElementsRendered(): boolean {\n const elementLists =\n this.hostElement.shadowRoot?.querySelectorAll('.element-list');\n\n if (!elementLists || elementLists.length === 0) {\n return false;\n }\n\n return Array.from(elementLists).some(\n (list) => (list as HTMLElement).offsetHeight > 0\n );\n }\n\n private getFormattedTime(): TimeOutputFormat {\n if (!this._time) {\n return FORMATTED_TIME_EMPTY;\n }\n\n return {\n hour:\n this.timeRef !== undefined\n ? this._time.toFormat('h')\n : this._time.toFormat('H'),\n minute: this._time.toFormat('m'),\n second: this._time.toFormat('s'),\n millisecond: this._time.toFormat('S'),\n };\n }\n\n private timeUpdate(unit: TimePickerDescriptorUnit, value: number): number {\n let maxValue = DateTime.now().endOf('day').get(unit);\n\n if (unit === 'hour') {\n if (this.timeRef === 'PM') {\n // 12 PM should remain 12, other PM hours add 12\n value = value === 12 ? 12 : value + 12;\n } else if (this.timeRef === 'AM') {\n // 12 AM should be 0, other AM hours remain as is\n value = value === 12 ? 0 : value;\n maxValue = 12;\n }\n }\n\n if (value > maxValue) {\n value = maxValue;\n } else if (value < 0) {\n value = 0;\n }\n\n if (!this._time) {\n this._time = DateTime.now().startOf('day');\n }\n\n this._time = this._time.set({\n [unit]: value,\n });\n\n return value;\n }\n\n private changeTimeReference(newTimeRef: 'AM' | 'PM') {\n if (this.timeRef === newTimeRef) {\n return;\n }\n\n if (!this._time) {\n this._time = DateTime.now().startOf('day');\n }\n\n this.timeRef = newTimeRef;\n const currentHour = this._time.hour;\n\n if (newTimeRef === 'PM' && currentHour < 12) {\n this._time = this._time.plus({ hours: 12 });\n } else if (newTimeRef === 'AM' && currentHour >= 12) {\n this._time = this._time.minus({ hours: 12 });\n }\n\n this.timeChange.emit(this._time.toFormat(this.format));\n }\n\n private isFormat12Hour(format: string): boolean {\n // Remove any text that's inside quotes (literal text in Luxon format strings)\n let cleanFormat = '';\n let inQuote = false;\n\n for (let i = 0; i < format.length; i++) {\n const char = format[i];\n if (char === \"'\") {\n inQuote = !inQuote;\n } else if (!inQuote) {\n cleanFormat += char;\n }\n }\n\n // Check for specific 12-hour format tokens\n // Case-sensitive matching to distinguish between 'h' and 'H'\n return /h|a|t/.test(cleanFormat);\n }\n\n private setTimeRef() {\n const uses12HourFormat = this.isFormat12Hour(this.format);\n\n if (uses12HourFormat && this._time) {\n this.timeRef = this._time!.hour >= 12 ? 'PM' : 'AM';\n } else {\n this.timeRef = undefined;\n }\n }\n\n private getInitialFocusedValueForUnit(\n unit: TimePickerDescriptorUnit,\n numberArray: number[]\n ): number {\n const selectedValue = Number(this.formattedTime[unit]);\n return numberArray.includes(selectedValue) ? selectedValue : numberArray[0];\n }\n\n private setTimePickerDescriptors() {\n let hourNumbers = [];\n let minuteNumbers = [];\n let secondNumbers = [];\n let millisecondsNumbers = [];\n\n if (this.timeRef !== undefined) {\n hourNumbers = Array.from(\n { length: Math.ceil(12 / this.hourInterval) },\n (_, i) => i * this.hourInterval + 1\n ).filter((hour) => hour <= 12);\n } else {\n hourNumbers = Array.from(\n { length: Math.ceil(24 / this.hourInterval) },\n (_, i) => i * this.hourInterval\n );\n }\n\n minuteNumbers = Array.from(\n { length: Math.ceil(60 / this.minuteInterval) },\n (_, i) => i * this.minuteInterval\n );\n secondNumbers = Array.from(\n { length: Math.ceil(60 / this.secondInterval) },\n (_, i) => i * this.secondInterval\n );\n millisecondsNumbers = Array.from(\n { length: Math.ceil(1000 / this.millisecondInterval) },\n (_, i) => i * this.millisecondInterval\n );\n\n this.timePickerDescriptors = [\n {\n unit: 'hour',\n header: this.i18nHourColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.hours.test(this.format),\n numberArray: hourNumbers,\n focusedValue: this.getInitialFocusedValueForUnit('hour', hourNumbers),\n },\n {\n unit: 'minute',\n header: this.i18nMinuteColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.minutes.test(this.format),\n numberArray: minuteNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'minute',\n minuteNumbers\n ),\n },\n {\n unit: 'second',\n header: this.i18nSecondColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.seconds.test(this.format),\n numberArray: secondNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'second',\n secondNumbers\n ),\n },\n {\n unit: 'millisecond',\n header: this.i18nMillisecondColumnHeader,\n hidden: !LUXON_FORMAT_PATTERNS.milliseconds.test(this.format),\n numberArray: millisecondsNumbers,\n focusedValue: this.getInitialFocusedValueForUnit(\n 'millisecond',\n millisecondsNumbers\n ),\n },\n ];\n\n this.timePickerDescriptors = this.timePickerDescriptors.filter(\n (item) => !item.hidden\n );\n }\n\n private getNumberArrayForUnit(unit: TimePickerDescriptorUnit): number[] {\n const descriptor = this.timePickerDescriptors.find(\n (descriptor) => descriptor.unit === unit\n );\n return descriptor ? descriptor.numberArray : [];\n }\n\n private isSelected(unit: TimePickerDescriptorUnit, number: number): boolean {\n return this.formattedTime![unit] === String(number);\n }\n\n private select(unit: TimePickerDescriptorUnit, number: number) {\n if (this.isSelected(unit, number)) {\n return;\n }\n\n this.formattedTime = {\n ...this.formattedTime!,\n [unit]: String(number),\n };\n\n this.timeUpdate(unit, number);\n this.elementListScrollToTop(unit, number, 'smooth');\n this.timeChange.emit(this._time!.toFormat(this.format));\n }\n\n private updateDescriptorFocusedValue(\n unit: TimePickerDescriptorUnit,\n value: number\n ) {\n const descriptorIndex = this.timePickerDescriptors.findIndex(\n (d) => d.unit === unit\n );\n if (descriptorIndex !== -1) {\n this.timePickerDescriptors = [\n ...this.timePickerDescriptors.slice(0, descriptorIndex),\n {\n ...this.timePickerDescriptors[descriptorIndex],\n focusedValue: value,\n },\n ...this.timePickerDescriptors.slice(descriptorIndex + 1),\n ];\n }\n }\n\n private elementListScrollToTop(\n unit: TimePickerDescriptorUnit,\n number: number,\n scrollBehaviour: 'smooth' | 'instant'\n ) {\n const elementList = this.getElementList(unit);\n const elementContainer = this.getElementContainer(unit, number);\n\n if (elementList && elementContainer) {\n const elementListHeight = elementList.clientHeight;\n const elementContainerHeight = elementContainer.clientHeight;\n\n // Offset which is used to adjust the scroll position to account for margins, elements being hidden, etc.\n let scrollPositionOffset = 11;\n if (this.hideHeader) {\n // 56 + 1 --> height of the header container and separator\n scrollPositionOffset -= 57;\n }\n\n const scrollPosition =\n elementContainer.offsetTop -\n elementListHeight / 2 +\n elementContainerHeight -\n scrollPositionOffset;\n\n elementList.scrollTo({\n top: scrollPosition,\n behavior: scrollBehaviour,\n });\n }\n }\n\n /**\n * Updates all scroll positions of the time picker elements\n * Updates only the elements that have changed if `formattedTimeOld` is provided\n */\n private updateScrollPositions(\n formattedTimeOld: TimeOutputFormat | undefined = undefined\n ) {\n for (const key in this.formattedTime) {\n const unitKey = key as keyof TimeOutputFormat;\n\n if (\n !formattedTimeOld ||\n this.formattedTime[unitKey] !== formattedTimeOld[unitKey]\n ) {\n this.elementListScrollToTop(\n unitKey as TimePickerDescriptorUnit,\n Number(this.formattedTime[unitKey]),\n 'instant'\n );\n }\n }\n }\n\n private formatUnitValue(\n unit: TimePickerDescriptorUnit,\n value: number\n ): string {\n if (unit === 'millisecond') {\n return value.toString().padStart(3, '0');\n }\n\n return value < 10 ? `0${value}` : value.toString();\n }\n\n private getColumnSeparator(currentIndex: number): string {\n if (currentIndex + 1 < this.timePickerDescriptors.length) {\n const nextUnit = this.timePickerDescriptors[currentIndex + 1].unit;\n return nextUnit === 'millisecond' ? '.' : ':';\n }\n\n return ':';\n }\n\n private getElementContainerTabIndex(\n number: number,\n descriptorUnit: TimePickerDescriptorUnit\n ): string {\n const descriptor = this.timePickerDescriptors.find(\n (d) => d.unit === descriptorUnit\n );\n\n if (number === descriptor?.focusedValue) {\n return '0';\n }\n\n return '-1';\n }\n\n render() {\n return (\n <Host>\n <ix-date-time-card\n embedded={this.embedded}\n timePickerAppearance={true}\n corners={this.corners}\n hasFooter={!this.dateTimePickerAppearance}\n hideHeader={this.hideHeader}\n >\n <div class=\"header\" slot=\"header\">\n <ix-typography format=\"body\">{this.i18nHeader}</ix-typography>\n </div>\n <div class=\"clock\">\n {this.timePickerDescriptors.map((descriptor, index: number) => (\n <div class=\"flex\">\n <div class={{ columns: true, hidden: descriptor.hidden }}>\n <div class=\"column-header\" title={descriptor.header}>\n {descriptor.header}\n </div>\n <div\n data-element-list-id={descriptor.unit}\n class=\"element-list\"\n tabIndex={-1}\n >\n {descriptor.numberArray.map((number) => {\n return (\n <button\n data-element-container-id={`${descriptor.unit}-${number}`}\n class={{\n selected: this.isSelected(descriptor.unit, number),\n 'element-container': true,\n }}\n onClick={() => {\n this.select(descriptor.unit, number);\n }}\n onFocus={() =>\n this.onUnitCellFocus(descriptor.unit, number)\n }\n onBlur={(e) =>\n this.onUnitCellBlur(descriptor.unit, e)\n }\n tabindex={this.getElementContainerTabIndex(\n number,\n descriptor.unit\n )}\n aria-label={`${descriptor.header}: ${number}`}\n >\n {this.formatUnitValue(descriptor.unit, number)}\n </button>\n );\n })}\n <div class=\"element-list-padding\"></div>\n </div>\n </div>\n\n {index !== this.timePickerDescriptors.length - 1 && (\n <div\n class={{\n 'column-separator': true,\n hidden: descriptor.hidden,\n }}\n >\n {this.getColumnSeparator(index)}\n </div>\n )}\n </div>\n ))}\n\n {this.timeRef && (\n <div class=\"flex\">\n <div class=\"column-separator\"></div>\n <div class=\"columns\">\n <div class=\"column-header\" title=\"AM/PM\" />\n <div class=\"element-list\" tabIndex={-1}>\n <button\n data-am-pm-id=\"AM\"\n class={{\n selected: this.timeRef === 'AM',\n 'element-container': true,\n }}\n onClick={() => this.changeTimeReference('AM')}\n tabindex=\"0\"\n aria-label=\"AM\"\n >\n AM\n </button>\n <button\n data-am-pm-id=\"PM\"\n class={{\n selected: this.timeRef === 'PM',\n 'element-container': true,\n }}\n onClick={() => this.changeTimeReference('PM')}\n tabindex=\"0\"\n aria-label=\"PM\"\n >\n PM\n </button>\n </div>\n </div>\n </div>\n )}\n </div>\n\n <div\n class={{\n footer: true,\n 'footer--compact': this.timePickerDescriptors.length <= 2,\n }}\n slot=\"footer\"\n >\n <ix-button\n class=\"confirm-button\"\n onClick={() => {\n this.timeSelect.emit(this._time?.toFormat(this.format));\n }}\n >\n {this.i18nConfirmTime}\n </ix-button>\n </div>\n </ix-date-time-card>\n </Host>\n );\n }\n}\n"],"names":["DateTime","h","Host","index","OnListener"],"mappings":";;;;;;AAAA,MAAM,aAAa,GAAG,ihnBAAihnB;;ACAvinB;;;;;;;AAOG;;;;;;;;;;;AAmCH,MAAM,qBAAqB,GAAG;;AAE5B,IAAA,KAAK,EAAE,0DAA0D;;AAEjE,IAAA,OAAO,EAAE,sCAAsC;;AAE/C,IAAA,OAAO,EAAE,kCAAkC;;AAE3C,IAAA,YAAY,EAAE,oBAAoB;CACnC;AAED,MAAM,qBAAqB,GAAG,CAAC;AAC/B,MAAM,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,EAAE,MAAK;;AACZ,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACxD,EAAA,EAEA,IAAI,CAAC,eAAe,CACX,CACR,CACY,CACf;;;;;;;;;;;;;AAjqBX,UAAA,CAAA;IADCG,mBAAU,CAAa,SAAS;CAyDhC,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,IAAA,CAAA;;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-C8Xo8L1k.js');
4
4
  var a11y = require('./a11y-B_6chCvu.js');
5
- var validation = require('./validation-CfL71_0d.js');
5
+ var validation = require('./validation-DTmSqO2d.js');
6
6
 
7
7
  const toggleCss = ":host{display:inline-flex;flex-direction:row;position:relative;min-height:1.5rem;max-height:calc(100% - 0.5rem);margin-block-start:0.25rem;margin-block-end:0.25rem}:host *,:host *::after,:host *::before{box-sizing:border-box}:host ::-webkit-scrollbar-button{display:none}@-moz-document url-prefix(){:host *{scrollbar-color:var(--theme-scrollbar-thumb--background) var(--theme-scrollbar-track--background);scrollbar-width:thin}}:host{}:host ::-webkit-scrollbar{width:0.5rem;height:0.5rem}:host{}:host ::-webkit-scrollbar-track{border-radius:5px;background:var(--theme-scrollbar-track--background)}:host ::-webkit-scrollbar-track:hover{background:var(--theme-scrollbar-track--background--hover)}:host{}:host ::-webkit-scrollbar-thumb{border-radius:5px;background:var(--theme-scrollbar-thumb--background)}:host{}:host ::-webkit-scrollbar-thumb:hover{background:var(--theme-scrollbar-thumb--background--hover)}:host ::-webkit-scrollbar-corner{display:none}:host input[type=checkbox]{display:none}:host .wrapper{display:flex;align-items:flex-start;width:100%;max-height:100%}:host .label{word-break:break-word;display:block;white-space:normal;overflow:hidden;margin-block-start:0.125rem;margin-inline-start:0.5rem;min-height:1rem}:host .switch{all:unset;position:relative;display:inline-block;width:3rem;min-width:3rem;max-width:3rem;height:1.5rem}:host .slider{position:absolute;top:0;left:0;right:0;bottom:0;background-color:var(--theme-switch-off--background);transition:var(--theme-default-time);border-radius:1.5rem;border:0.0625rem solid transparent}:host .slider:before{position:absolute;content:\"\";height:1.125rem;width:1.125rem;left:0.125rem;bottom:0.125rem;background-color:var(--theme-switch-thumb-off--background);transition:var(--theme-default-time);border-radius:50%;border:1px solid var(--theme-switch-thumb-off--border-color)}:host .switch.checked>.slider::before{background-color:var(--theme-switch-thumb-on--background);transform:translateX(1.5rem)}:host .switch>.slider{border-color:var(--theme-switch-off--border-color)}:host .switch:hover>.slider{background-color:var(--theme-switch-off--background--hover);border-color:var(--theme-switch-off--border-color--hover)}:host .switch:hover>.slider:before{background-color:var(--theme-switch-thumb-off--background--hover);border:1px solid var(--theme-switch-thumb-off--border-color--hover)}:host .switch:active>.slider{background-color:var(--theme-switch-off--background--active);border-color:var(--theme-switch-off--border-color--active)}:host .switch:active>.slider:before{background-color:var(--theme-switch-thumb-off--background--active);border:1px solid var(--theme-switch-thumb-off--border-color--active)}:host .switch.checked>.slider{background-color:var(--theme-switch-on--background);border-color:var(--theme-switch-on--border-color)}:host .switch.checked>.slider:before{border:1px solid var(--theme-switch-thumb-on--border-color)}:host .switch.checked:hover>.slider{background-color:var(--theme-switch-on--background--hover);border-color:var(--theme-switch-on--border-color--hover)}:host .switch.checked:hover>.slider:before{background-color:var(--theme-switch-thumb-on--background--hover);border:1px solid var(--theme-switch-thumb-on--border-color--hover)}:host .switch.checked:active>.slider{background-color:var(--theme-switch-on--background--active);border-color:var(--theme-switch-on--border-color--active)}:host .switch.checked:active>.slider:before{background-color:var(--theme-switch-thumb-on--background--active);border:1px solid var(--theme-switch-thumb-on--border-color--active)}:host .switch.indeterminate>.slider::before{transform:translateX(0.75rem)}:host(:not(.disabled)) .wrapper{cursor:pointer}:host(:not(.disabled)) .switch:focus-visible>.slider{outline:0.0625rem solid var(--theme-color-focus-bdr);outline-offset:0.0625rem}:host(.disabled){pointer-events:none}:host(.disabled) .switch{opacity:0.5}:host(.disabled) .switch>.slider{background-color:var(--theme-switch-off--background--disabled)}:host(.disabled) .switch>.slider:before{background-color:var(--theme-switch-thumb-off--background--disabled)}:host(.disabled) .switch.checked>.slider{background-color:var(--theme-switch-on--background--disabled)}:host(.disabled) .switch.checked>.slider:before{background-color:var(--theme-switch-thumb-on--background--disabled)}:host(.disabled) .label{color:var(--theme-color-weak-text)}:host(.ix-valid:not(.disabled)) .slider{--theme-switch-off--background:var(\n --theme-switch-off--background--valid\n );--theme-switch-off--background--hover:var(\n --theme-switch-off--background--valid--hover\n );--theme-switch-off--background--active:var(\n --theme-switch-off--background--valid--active\n );--theme-switch-thumb-off--border-color:var(\n --theme-switch-thumb-off--border-color--valid\n );--theme-switch-thumb-off--border-color--hover:var(\n --theme-switch-thumb-off--border-color--valid--hover\n );--theme-switch-thumb-off--border-color--active:var(\n --theme-switch-thumb-off--border-color--valid--active\n );--theme-switch-thumb-off--background:var(\n --theme-switch-thumb-off--background--valid\n );--theme-switch-thumb-off--background--hover:var(\n --theme-switch-thumb-off--background--valid--hover\n );--theme-switch-thumb-off--background--active:var(\n --theme-switch-thumb-off--background--valid--active\n );--theme-switch-off--border-color:var(\n --theme-switch-off--border-color--valid\n );--theme-switch-off--border-color--hover:var(\n --theme-switch-off--border-color--valid--hover\n );--theme-switch-off--border-color--active:var(\n --theme-switch-off--border-color--valid--active\n );--theme-switch-on--background:var(\n --theme-switch-on--background--valid\n );--theme-switch-on--background--hover:var(\n --theme-switch-on--background--valid--hover\n );--theme-switch-on--background--active:var(\n --theme-switch-on--background--valid--active\n );--theme-switch-thumb-on--border-color:var(\n --theme-switch-thumb-on--border-color--valid\n );--theme-switch-thumb-on--border-color--hover:var(\n --theme-switch-thumb-on--border-color--valid--hover\n );--theme-switch-thumb-on--border-color--active:var(\n --theme-switch-thumb-on--border-color--valid--active\n );--theme-switch-thumb-on--background:var(\n --theme-switch-thumb-on--background--valid\n );--theme-switch-thumb-on--background--hover:var(\n --theme-switch-thumb-on--background--valid--hover\n );--theme-switch-thumb-on--background--active:var(\n --theme-switch-thumb-on--background--valid--active\n );--theme-switch-on--border-color:var(\n --theme-switch-on--border-color--valid\n );--theme-switch-on--border-color--hover:var(\n --theme-switch-on--border-color--valid--hover\n );--theme-switch-on--border-color--active:var(\n --theme-switch-on--border-color--valid--active\n );--theme-switch-mixed--background:var(\n --theme-switch-mixed--background--valid\n );--theme-switch-mixed--background--hover:var(\n --theme-switch-mixed--background--valid--hover\n );--theme-switch-mixed--background--active:var(\n --theme-switch-mixed--background--valid--active\n );--theme-switch-thumb-mixed--border-color:var(\n --theme-switch-thumb-mixed--border-color--valid\n );--theme-switch-thumb-mixed--border-color--hover:var(\n --theme-switch-thumb-mixed--border-color--valid--hover\n );--theme-switch-thumb-mixed--border-color--active:var(\n --theme-switch-thumb-mixed--border-color--valid--active\n );--theme-switch-thumb-mixed--background:var(\n --theme-switch-thumb-mixed--background--valid\n );--theme-switch-thumb-mixed--background--hover:var(\n --theme-switch-thumb-mixed--background--valid--hover\n );--theme-switch-thumb-mixed--background--active:var(\n --theme-switch-thumb-mixed--background--valid--active\n );--theme-switch-mixed--border-color:var(\n --theme-switch-mixed--border-color--valid\n );--theme-switch-mixed--border-color--hover:var(\n --theme-switch-mixed--border-color--valid--hover\n );--theme-switch-mixed--border-color--active:var(\n --theme-switch-mixed--border-color--valid--active\n )}:host(.ix-info:not(.disabled)) .slider{--theme-switch-off--background:var(\n --theme-switch-off--background--info\n );--theme-switch-off--background--hover:var(\n --theme-switch-off--background--info--hover\n );--theme-switch-off--background--active:var(\n --theme-switch-off--background--info--active\n );--theme-switch-thumb-off--border-color:var(\n --theme-switch-thumb-off--border-color--info\n );--theme-switch-thumb-off--border-color--hover:var(\n --theme-switch-thumb-off--border-color--info--hover\n );--theme-switch-thumb-off--border-color--active:var(\n --theme-switch-thumb-off--border-color--info--active\n );--theme-switch-thumb-off--background:var(\n --theme-switch-thumb-off--background--info\n );--theme-switch-thumb-off--background--hover:var(\n --theme-switch-thumb-off--background--info--hover\n );--theme-switch-thumb-off--background--active:var(\n --theme-switch-thumb-off--background--info--active\n );--theme-switch-off--border-color:var(\n --theme-switch-off--border-color--info\n );--theme-switch-off--border-color--hover:var(\n --theme-switch-off--border-color--info--hover\n );--theme-switch-off--border-color--active:var(\n --theme-switch-off--border-color--info--active\n );--theme-switch-on--background:var(\n --theme-switch-on--background--info\n );--theme-switch-on--background--hover:var(\n --theme-switch-on--background--info--hover\n );--theme-switch-on--background--active:var(\n --theme-switch-on--background--info--active\n );--theme-switch-thumb-on--border-color:var(\n --theme-switch-thumb-on--border-color--info\n );--theme-switch-thumb-on--border-color--hover:var(\n --theme-switch-thumb-on--border-color--info--hover\n );--theme-switch-thumb-on--border-color--active:var(\n --theme-switch-thumb-on--border-color--info--active\n );--theme-switch-thumb-on--background:var(\n --theme-switch-thumb-on--background--info\n );--theme-switch-thumb-on--background--hover:var(\n --theme-switch-thumb-on--background--info--hover\n );--theme-switch-thumb-on--background--active:var(\n --theme-switch-thumb-on--background--info--active\n );--theme-switch-on--border-color:var(\n --theme-switch-on--border-color--info\n );--theme-switch-on--border-color--hover:var(\n --theme-switch-on--border-color--info--hover\n );--theme-switch-on--border-color--active:var(\n --theme-switch-on--border-color--info--active\n );--theme-switch-mixed--background:var(\n --theme-switch-mixed--background--info\n );--theme-switch-mixed--background--hover:var(\n --theme-switch-mixed--background--info--hover\n );--theme-switch-mixed--background--active:var(\n --theme-switch-mixed--background--info--active\n );--theme-switch-thumb-mixed--border-color:var(\n --theme-switch-thumb-mixed--border-color--info\n );--theme-switch-thumb-mixed--border-color--hover:var(\n --theme-switch-thumb-mixed--border-color--info--hover\n );--theme-switch-thumb-mixed--border-color--active:var(\n --theme-switch-thumb-mixed--border-color--info--active\n );--theme-switch-thumb-mixed--background:var(\n --theme-switch-thumb-mixed--background--info\n );--theme-switch-thumb-mixed--background--hover:var(\n --theme-switch-thumb-mixed--background--info--hover\n );--theme-switch-thumb-mixed--background--active:var(\n --theme-switch-thumb-mixed--background--info--active\n );--theme-switch-mixed--border-color:var(\n --theme-switch-mixed--border-color--info\n );--theme-switch-mixed--border-color--hover:var(\n --theme-switch-mixed--border-color--info--hover\n );--theme-switch-mixed--border-color--active:var(\n --theme-switch-mixed--border-color--info--active\n )}:host(.ix-warning:not(.disabled)) .slider{--theme-switch-off--background:var(\n --theme-switch-off--background--warning\n );--theme-switch-off--background--hover:var(\n --theme-switch-off--background--warning--hover\n );--theme-switch-off--background--active:var(\n --theme-switch-off--background--warning--active\n );--theme-switch-thumb-off--border-color:var(\n --theme-switch-thumb-off--border-color--warning\n );--theme-switch-thumb-off--border-color--hover:var(\n --theme-switch-thumb-off--border-color--warning--hover\n );--theme-switch-thumb-off--border-color--active:var(\n --theme-switch-thumb-off--border-color--warning--active\n );--theme-switch-thumb-off--background:var(\n --theme-switch-thumb-off--background--warning\n );--theme-switch-thumb-off--background--hover:var(\n --theme-switch-thumb-off--background--warning--hover\n );--theme-switch-thumb-off--background--active:var(\n --theme-switch-thumb-off--background--warning--active\n );--theme-switch-off--border-color:var(\n --theme-switch-off--border-color--warning\n );--theme-switch-off--border-color--hover:var(\n --theme-switch-off--border-color--warning--hover\n );--theme-switch-off--border-color--active:var(\n --theme-switch-off--border-color--warning--active\n );--theme-switch-on--background:var(\n --theme-switch-on--background--warning\n );--theme-switch-on--background--hover:var(\n --theme-switch-on--background--warning--hover\n );--theme-switch-on--background--active:var(\n --theme-switch-on--background--warning--active\n );--theme-switch-thumb-on--border-color:var(\n --theme-switch-thumb-on--border-color--warning\n );--theme-switch-thumb-on--border-color--hover:var(\n --theme-switch-thumb-on--border-color--warning--hover\n );--theme-switch-thumb-on--border-color--active:var(\n --theme-switch-thumb-on--border-color--warning--active\n );--theme-switch-thumb-on--background:var(\n --theme-switch-thumb-on--background--warning\n );--theme-switch-thumb-on--background--hover:var(\n --theme-switch-thumb-on--background--warning--hover\n );--theme-switch-thumb-on--background--active:var(\n --theme-switch-thumb-on--background--warning--active\n );--theme-switch-on--border-color:var(\n --theme-switch-on--border-color--warning\n );--theme-switch-on--border-color--hover:var(\n --theme-switch-on--border-color--warning--hover\n );--theme-switch-on--border-color--active:var(\n --theme-switch-on--border-color--warning--active\n );--theme-switch-mixed--background:var(\n --theme-switch-mixed--background--warning\n );--theme-switch-mixed--background--hover:var(\n --theme-switch-mixed--background--warning--hover\n );--theme-switch-mixed--background--active:var(\n --theme-switch-mixed--background--warning--active\n );--theme-switch-thumb-mixed--border-color:var(\n --theme-switch-thumb-mixed--border-color--warning\n );--theme-switch-thumb-mixed--border-color--hover:var(\n --theme-switch-thumb-mixed--border-color--warning--hover\n );--theme-switch-thumb-mixed--border-color--active:var(\n --theme-switch-thumb-mixed--border-color--warning--active\n );--theme-switch-thumb-mixed--background:var(\n --theme-switch-thumb-mixed--background--warning\n );--theme-switch-thumb-mixed--background--hover:var(\n --theme-switch-thumb-mixed--background--warning--hover\n );--theme-switch-thumb-mixed--background--active:var(\n --theme-switch-thumb-mixed--background--warning--active\n );--theme-switch-mixed--border-color:var(\n --theme-switch-mixed--border-color--warning\n );--theme-switch-mixed--border-color--hover:var(\n --theme-switch-mixed--border-color--warning--hover\n );--theme-switch-mixed--border-color--active:var(\n --theme-switch-mixed--border-color--warning--active\n )}:host(.ix-invalid--required:not(.disabled)) .slider{--theme-switch-off--background:var(\n --theme-switch-off--background--invalid\n );--theme-switch-off--background--hover:var(\n --theme-switch-off--background--invalid--hover\n );--theme-switch-off--background--active:var(\n --theme-switch-off--background--invalid--active\n );--theme-switch-thumb-off--border-color:var(\n --theme-switch-thumb-off--border-color--invalid\n );--theme-switch-thumb-off--border-color--hover:var(\n --theme-switch-thumb-off--border-color--invalid--hover\n );--theme-switch-thumb-off--border-color--active:var(\n --theme-switch-thumb-off--border-color--invalid--active\n );--theme-switch-thumb-off--background:var(\n --theme-switch-thumb-off--background--invalid\n );--theme-switch-thumb-off--background--hover:var(\n --theme-switch-thumb-off--background--invalid--hover\n );--theme-switch-thumb-off--background--active:var(\n --theme-switch-thumb-off--background--invalid--active\n );--theme-switch-off--border-color:var(\n --theme-switch-off--border-color--invalid\n );--theme-switch-off--border-color--hover:var(\n --theme-switch-off--border-color--invalid--hover\n );--theme-switch-off--border-color--active:var(\n --theme-switch-off--border-color--invalid--active\n );--theme-switch-on--background:var(\n --theme-switch-on--background--invalid\n );--theme-switch-on--background--hover:var(\n --theme-switch-on--background--invalid--hover\n );--theme-switch-on--background--active:var(\n --theme-switch-on--background--invalid--active\n );--theme-switch-thumb-on--border-color:var(\n --theme-switch-thumb-on--border-color--invalid\n );--theme-switch-thumb-on--border-color--hover:var(\n --theme-switch-thumb-on--border-color--invalid--hover\n );--theme-switch-thumb-on--border-color--active:var(\n --theme-switch-thumb-on--border-color--invalid--active\n );--theme-switch-thumb-on--background:var(\n --theme-switch-thumb-on--background--invalid\n );--theme-switch-thumb-on--background--hover:var(\n --theme-switch-thumb-on--background--invalid--hover\n );--theme-switch-thumb-on--background--active:var(\n --theme-switch-thumb-on--background--invalid--active\n );--theme-switch-on--border-color:var(\n --theme-switch-on--border-color--invalid\n );--theme-switch-on--border-color--hover:var(\n --theme-switch-on--border-color--invalid--hover\n );--theme-switch-on--border-color--active:var(\n --theme-switch-on--border-color--invalid--active\n );--theme-switch-mixed--background:var(\n --theme-switch-mixed--background--invalid\n );--theme-switch-mixed--background--hover:var(\n --theme-switch-mixed--background--invalid--hover\n );--theme-switch-mixed--background--active:var(\n --theme-switch-mixed--background--invalid--active\n );--theme-switch-thumb-mixed--border-color:var(\n --theme-switch-thumb-mixed--border-color--invalid\n );--theme-switch-thumb-mixed--border-color--hover:var(\n --theme-switch-thumb-mixed--border-color--invalid--hover\n );--theme-switch-thumb-mixed--border-color--active:var(\n --theme-switch-thumb-mixed--border-color--invalid--active\n );--theme-switch-thumb-mixed--background:var(\n --theme-switch-thumb-mixed--background--invalid\n );--theme-switch-thumb-mixed--background--hover:var(\n --theme-switch-thumb-mixed--background--invalid--hover\n );--theme-switch-thumb-mixed--background--active:var(\n --theme-switch-thumb-mixed--background--invalid--active\n );--theme-switch-mixed--border-color:var(\n --theme-switch-mixed--border-color--invalid\n );--theme-switch-mixed--border-color--hover:var(\n --theme-switch-mixed--border-color--invalid--hover\n );--theme-switch-mixed--border-color--active:var(\n --theme-switch-mixed--border-color--invalid--active\n )}:host(.ix-invalid:not(.disabled)) .slider{--theme-switch-off--background:var(\n --theme-switch-off--background--invalid\n );--theme-switch-off--background--hover:var(\n --theme-switch-off--background--invalid--hover\n );--theme-switch-off--background--active:var(\n --theme-switch-off--background--invalid--active\n );--theme-switch-thumb-off--border-color:var(\n --theme-switch-thumb-off--border-color--invalid\n );--theme-switch-thumb-off--border-color--hover:var(\n --theme-switch-thumb-off--border-color--invalid--hover\n );--theme-switch-thumb-off--border-color--active:var(\n --theme-switch-thumb-off--border-color--invalid--active\n );--theme-switch-thumb-off--background:var(\n --theme-switch-thumb-off--background--invalid\n );--theme-switch-thumb-off--background--hover:var(\n --theme-switch-thumb-off--background--invalid--hover\n );--theme-switch-thumb-off--background--active:var(\n --theme-switch-thumb-off--background--invalid--active\n );--theme-switch-off--border-color:var(\n --theme-switch-off--border-color--invalid\n );--theme-switch-off--border-color--hover:var(\n --theme-switch-off--border-color--invalid--hover\n );--theme-switch-off--border-color--active:var(\n --theme-switch-off--border-color--invalid--active\n );--theme-switch-on--background:var(\n --theme-switch-on--background--invalid\n );--theme-switch-on--background--hover:var(\n --theme-switch-on--background--invalid--hover\n );--theme-switch-on--background--active:var(\n --theme-switch-on--background--invalid--active\n );--theme-switch-thumb-on--border-color:var(\n --theme-switch-thumb-on--border-color--invalid\n );--theme-switch-thumb-on--border-color--hover:var(\n --theme-switch-thumb-on--border-color--invalid--hover\n );--theme-switch-thumb-on--border-color--active:var(\n --theme-switch-thumb-on--border-color--invalid--active\n );--theme-switch-thumb-on--background:var(\n --theme-switch-thumb-on--background--invalid\n );--theme-switch-thumb-on--background--hover:var(\n --theme-switch-thumb-on--background--invalid--hover\n );--theme-switch-thumb-on--background--active:var(\n --theme-switch-thumb-on--background--invalid--active\n );--theme-switch-on--border-color:var(\n --theme-switch-on--border-color--invalid\n );--theme-switch-on--border-color--hover:var(\n --theme-switch-on--border-color--invalid--hover\n );--theme-switch-on--border-color--active:var(\n --theme-switch-on--border-color--invalid--active\n );--theme-switch-mixed--background:var(\n --theme-switch-mixed--background--invalid\n );--theme-switch-mixed--background--hover:var(\n --theme-switch-mixed--background--invalid--hover\n );--theme-switch-mixed--background--active:var(\n --theme-switch-mixed--background--invalid--active\n );--theme-switch-thumb-mixed--border-color:var(\n --theme-switch-thumb-mixed--border-color--invalid\n );--theme-switch-thumb-mixed--border-color--hover:var(\n --theme-switch-thumb-mixed--border-color--invalid--hover\n );--theme-switch-thumb-mixed--border-color--active:var(\n --theme-switch-thumb-mixed--border-color--invalid--active\n );--theme-switch-thumb-mixed--background:var(\n --theme-switch-thumb-mixed--background--invalid\n );--theme-switch-thumb-mixed--background--hover:var(\n --theme-switch-thumb-mixed--background--invalid--hover\n );--theme-switch-thumb-mixed--background--active:var(\n --theme-switch-thumb-mixed--background--invalid--active\n );--theme-switch-mixed--border-color:var(\n --theme-switch-mixed--border-color--invalid\n );--theme-switch-mixed--border-color--hover:var(\n --theme-switch-mixed--border-color--invalid--hover\n );--theme-switch-mixed--border-color--active:var(\n --theme-switch-mixed--border-color--invalid--active\n )}";
8
8
 
@@ -114,11 +114,18 @@ function HookValidationLifecycle(options) {
114
114
  };
115
115
  };
116
116
  }
117
+ function getValidationText(isInputInvalid, customInvalidText, i18nFallbackText) {
118
+ if (isInputInvalid) {
119
+ return customInvalidText !== null && customInvalidText !== void 0 ? customInvalidText : i18nFallbackText;
120
+ }
121
+ return customInvalidText;
122
+ }
117
123
 
118
124
  exports.HookValidationLifecycle = HookValidationLifecycle;
119
125
  exports.checkFieldClasses = checkFieldClasses;
120
126
  exports.createClassMutationObserver = createClassMutationObserver;
127
+ exports.getValidationText = getValidationText;
121
128
  exports.shouldSuppressInternalValidation = shouldSuppressInternalValidation;
122
- //# sourceMappingURL=validation-CfL71_0d.js.map
129
+ //# sourceMappingURL=validation-DTmSqO2d.js.map
123
130
 
124
- //# sourceMappingURL=validation-CfL71_0d.js.map
131
+ //# sourceMappingURL=validation-DTmSqO2d.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation-D_dk-JqT.js","sources":["src/components/utils/input/validation.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getElement } from '@stencil/core';\nimport { HTMLIxFormComponentElement, IxFormComponent } from '.';\nimport { IxComponent } from '../internal';\n\nexport type ClassMutationObserver = {\n destroy: () => void;\n};\n\nexport async function isTouched<T>(host: IxFormComponent<T>) {\n if (typeof host.isTouched === 'function') {\n return host.isTouched();\n }\n}\n\nexport async function shouldSuppressInternalValidation<T>(\n host: IxFormComponent<T>\n) {\n if (\n host.getAssociatedFormElement &&\n typeof host.getAssociatedFormElement === 'function'\n ) {\n const form = await host.getAssociatedFormElement();\n\n if (!form) {\n return false;\n }\n\n return form.noValidate;\n }\n\n return false;\n}\n\nexport function createClassMutationObserver(\n element: HTMLElement,\n callback: () => void,\n options?: {\n includeChildren?: boolean;\n }\n): ClassMutationObserver {\n const observer = new MutationObserver(callback);\n observer.observe(element, {\n subtree: options?.includeChildren,\n childList: options?.includeChildren,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return {\n destroy() {\n observer.disconnect();\n },\n };\n}\n\nexport type ValidationResultProperty =\n | 'isInvalid'\n | 'isInvalidByRequired'\n | 'isValid'\n | 'isInfo'\n | 'isWarning';\nexport type ValidationResults = Record<ValidationResultProperty, boolean>;\n\nfunction classListContains(\n hostElement: HTMLIxFormComponentElement<unknown>,\n className: string,\n includeChildren: boolean\n) {\n return (\n hostElement.classList.contains(`${className}`) ||\n (includeChildren ? !!hostElement.querySelector(`.${className}`) : false)\n );\n}\n\nexport function checkFieldClasses(\n hostElement: HTMLIxFormComponentElement<unknown>,\n includeChildren = false\n): ValidationResults {\n return {\n isInvalid:\n classListContains(hostElement, 'ix-invalid', includeChildren) ||\n classListContains(\n hostElement,\n 'ix-invalid--validity-invalid',\n includeChildren\n ),\n isInvalidByRequired: classListContains(\n hostElement,\n 'ix-invalid--required',\n includeChildren\n ),\n isValid: classListContains(hostElement, 'ix-valid', includeChildren),\n isInfo: classListContains(hostElement, 'ix-info', includeChildren),\n isWarning: classListContains(hostElement, 'ix-warning', includeChildren),\n };\n}\n\nexport function HookValidationLifecycle(options?: {\n includeChildren?: boolean;\n}) {\n return (proto: IxComponent, methodName: string) => {\n let checkIfRequiredFunction: (() => Promise<void>) | null;\n let classMutationObserver: ClassMutationObserver | null;\n const { componentWillLoad, disconnectedCallback, connectedCallback } =\n proto;\n\n proto.connectedCallback = function () {\n const host = getElement(\n this\n ) as unknown as HTMLIxFormComponentElement<unknown>;\n\n checkIfRequiredFunction = async () => {\n const skipValidation = await shouldSuppressInternalValidation(host);\n if (skipValidation) {\n return;\n }\n\n if (host.hasValidValue && typeof host.hasValidValue === 'function') {\n const hasValue = await host.hasValidValue();\n const touched = await isTouched(host);\n\n if (host.required) {\n host.classList.toggle('ix-invalid--required', !hasValue && touched);\n } else {\n host.classList.remove('ix-invalid--required');\n }\n }\n\n if (\n host.getValidityState &&\n typeof host.getValidityState === 'function'\n ) {\n const validityState = await host.getValidityState();\n\n host.classList.toggle(\n `ix-invalid--validity-patternMismatch`,\n validityState.patternMismatch\n );\n }\n };\n\n host.addEventListener('checkedChange', checkIfRequiredFunction);\n host.addEventListener('valueChange', checkIfRequiredFunction);\n host.addEventListener('ixBlur', checkIfRequiredFunction);\n setTimeout(checkIfRequiredFunction);\n return connectedCallback?.call(this);\n };\n\n proto.componentWillLoad = function () {\n const host = getElement(\n this\n ) as unknown as HTMLIxFormComponentElement<unknown>;\n classMutationObserver = createClassMutationObserver(\n host,\n () => {\n const result = checkFieldClasses(host, options?.includeChildren);\n proto[methodName].call(this, result);\n },\n options\n );\n const result = checkFieldClasses(host, options?.includeChildren);\n proto[methodName].call(this, result);\n return componentWillLoad?.call(this);\n };\n\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n\n if (host && classMutationObserver) {\n classMutationObserver.destroy();\n classMutationObserver = null;\n }\n\n if (host && checkIfRequiredFunction) {\n host.removeEventListener('checkedChange', checkIfRequiredFunction);\n host.removeEventListener('valueChange', checkIfRequiredFunction);\n host.removeEventListener('ixBlur', checkIfRequiredFunction);\n checkIfRequiredFunction = null;\n }\n\n return disconnectedCallback?.call(this);\n };\n };\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;AAOG;AASI,eAAe,SAAS,CAAI,IAAwB,EAAA;AACzD,IAAA,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE;AACxC,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;;AAE3B;AAEO,eAAe,gCAAgC,CACpD,IAAwB,EAAA;IAExB,IACE,IAAI,CAAC,wBAAwB;AAC7B,QAAA,OAAO,IAAI,CAAC,wBAAwB,KAAK,UAAU,EACnD;AACA,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,wBAAwB,EAAE;QAElD,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,KAAK;;QAGd,OAAO,IAAI,CAAC,UAAU;;AAGxB,IAAA,OAAO,KAAK;AACd;SAEgB,2BAA2B,CACzC,OAAoB,EACpB,QAAoB,EACpB,OAEC,EAAA;AAED,IAAA,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC;AAC/C,IAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE;AACxB,QAAA,OAAO,EAAE,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,MAAA,GAAA,MAAA,GAAA,OAAO,CAAE,eAAe;AACjC,QAAA,SAAS,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IAAA,IAAA,oBAAoB,KAApB,MAAA,GAAA,MAAA,GAAA,oBAAoB,CAAE,IAAI,CAAC,IAAI,CAAC;AACzC,SAAC;AACH,KAAC;AACH;;;;"}
1
+ {"version":3,"file":"validation-DTmSqO2d.js","sources":["src/components/utils/input/validation.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getElement } from '@stencil/core';\nimport { HTMLIxFormComponentElement, IxFormComponent } from '.';\nimport { IxComponent } from '../internal';\n\nexport type ClassMutationObserver = {\n destroy: () => void;\n};\n\nexport async function isTouched<T>(host: IxFormComponent<T>) {\n if (typeof host.isTouched === 'function') {\n return host.isTouched();\n }\n}\n\nexport async function shouldSuppressInternalValidation<T>(\n host: IxFormComponent<T>\n) {\n if (\n host.getAssociatedFormElement &&\n typeof host.getAssociatedFormElement === 'function'\n ) {\n const form = await host.getAssociatedFormElement();\n\n if (!form) {\n return false;\n }\n\n return form.noValidate;\n }\n\n return false;\n}\n\nexport function createClassMutationObserver(\n element: HTMLElement,\n callback: () => void,\n options?: {\n includeChildren?: boolean;\n }\n): ClassMutationObserver {\n const observer = new MutationObserver(callback);\n observer.observe(element, {\n subtree: options?.includeChildren,\n childList: options?.includeChildren,\n attributes: true,\n attributeFilter: ['class'],\n });\n\n return {\n destroy() {\n observer.disconnect();\n },\n };\n}\n\nexport type ValidationResultProperty =\n | 'isInvalid'\n | 'isInvalidByRequired'\n | 'isValid'\n | 'isInfo'\n | 'isWarning';\nexport type ValidationResults = Record<ValidationResultProperty, boolean>;\n\nfunction classListContains(\n hostElement: HTMLIxFormComponentElement<unknown>,\n className: string,\n includeChildren: boolean\n) {\n return (\n hostElement.classList.contains(`${className}`) ||\n (includeChildren ? !!hostElement.querySelector(`.${className}`) : false)\n );\n}\n\nexport function checkFieldClasses(\n hostElement: HTMLIxFormComponentElement<unknown>,\n includeChildren = false\n): ValidationResults {\n return {\n isInvalid:\n classListContains(hostElement, 'ix-invalid', includeChildren) ||\n classListContains(\n hostElement,\n 'ix-invalid--validity-invalid',\n includeChildren\n ),\n isInvalidByRequired: classListContains(\n hostElement,\n 'ix-invalid--required',\n includeChildren\n ),\n isValid: classListContains(hostElement, 'ix-valid', includeChildren),\n isInfo: classListContains(hostElement, 'ix-info', includeChildren),\n isWarning: classListContains(hostElement, 'ix-warning', includeChildren),\n };\n}\n\nexport function HookValidationLifecycle(options?: {\n includeChildren?: boolean;\n}) {\n return (proto: IxComponent, methodName: string) => {\n let checkIfRequiredFunction: (() => Promise<void>) | null;\n let classMutationObserver: ClassMutationObserver | null;\n const { componentWillLoad, disconnectedCallback, connectedCallback } =\n proto;\n\n proto.connectedCallback = function () {\n const host = getElement(\n this\n ) as unknown as HTMLIxFormComponentElement<unknown>;\n\n checkIfRequiredFunction = async () => {\n const skipValidation = await shouldSuppressInternalValidation(host);\n if (skipValidation) {\n return;\n }\n\n if (host.hasValidValue && typeof host.hasValidValue === 'function') {\n const hasValue = await host.hasValidValue();\n const touched = await isTouched(host);\n\n if (host.required) {\n host.classList.toggle('ix-invalid--required', !hasValue && touched);\n } else {\n host.classList.remove('ix-invalid--required');\n }\n }\n\n if (\n host.getValidityState &&\n typeof host.getValidityState === 'function'\n ) {\n const validityState = await host.getValidityState();\n\n host.classList.toggle(\n `ix-invalid--validity-patternMismatch`,\n validityState.patternMismatch\n );\n }\n };\n\n host.addEventListener('checkedChange', checkIfRequiredFunction);\n host.addEventListener('valueChange', checkIfRequiredFunction);\n host.addEventListener('ixBlur', checkIfRequiredFunction);\n setTimeout(checkIfRequiredFunction);\n return connectedCallback?.call(this);\n };\n\n proto.componentWillLoad = function () {\n const host = getElement(\n this\n ) as unknown as HTMLIxFormComponentElement<unknown>;\n classMutationObserver = createClassMutationObserver(\n host,\n () => {\n const result = checkFieldClasses(host, options?.includeChildren);\n proto[methodName].call(this, result);\n },\n options\n );\n const result = checkFieldClasses(host, options?.includeChildren);\n proto[methodName].call(this, result);\n return componentWillLoad?.call(this);\n };\n\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n\n if (host && classMutationObserver) {\n classMutationObserver.destroy();\n classMutationObserver = null;\n }\n\n if (host && checkIfRequiredFunction) {\n host.removeEventListener('checkedChange', checkIfRequiredFunction);\n host.removeEventListener('valueChange', checkIfRequiredFunction);\n host.removeEventListener('ixBlur', checkIfRequiredFunction);\n checkIfRequiredFunction = null;\n }\n\n return disconnectedCallback?.call(this);\n };\n };\n}\n\nexport function getValidationText(\n isInputInvalid: boolean,\n customInvalidText: string | undefined,\n i18nFallbackText: string\n): string | undefined {\n if (isInputInvalid) {\n return customInvalidText ?? i18nFallbackText;\n }\n return customInvalidText;\n}\n"],"names":["getElement"],"mappings":";;;;AAAA;;;;;;;AAOG;AASI,eAAe,SAAS,CAAI,IAAwB,EAAA;AACzD,IAAA,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE;AACxC,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;;AAE3B;AAEO,eAAe,gCAAgC,CACpD,IAAwB,EAAA;IAExB,IACE,IAAI,CAAC,wBAAwB;AAC7B,QAAA,OAAO,IAAI,CAAC,wBAAwB,KAAK,UAAU,EACnD;AACA,QAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,wBAAwB,EAAE;QAElD,IAAI,CAAC,IAAI,EAAE;AACT,YAAA,OAAO,KAAK;;QAGd,OAAO,IAAI,CAAC,UAAU;;AAGxB,IAAA,OAAO,KAAK;AACd;SAEgB,2BAA2B,CACzC,OAAoB,EACpB,QAAoB,EACpB,OAEC,EAAA;AAED,IAAA,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC;AAC/C,IAAA,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE;AACxB,QAAA,OAAO,EAAE,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,MAAA,GAAA,MAAA,GAAA,OA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GAAG,IAAI;;YAGhC,OAAO,oBAAoB,KAApB,IAAA,IAAA,oBAAoB,KAApB,MAAA,GAAA,MAAA,GAAA,oBAAoB,CAAE,IAAI,CAAC,IAAI,CAAC;AACzC,SAAC;AACH,KAAC;AACH;SAEgB,iBAAiB,CAC/B,cAAuB,EACvB,iBAAqC,EACrC,gBAAwB,EAAA;IAExB,IAAI,cAAc,EAAE;AAClB,QAAA,OAAO,iBAAiB,KAAjB,IAAA,IAAA,iBAAiB,cAAjB,iBAAiB,GAAI,gBAAgB;;AAE9C,IAAA,OAAO,iBAAiB;AAC1B;;;;;;;;"}
@@ -21,7 +21,7 @@ import { Host, h, } from "@stencil/core";
21
21
  import { DateTime } from "luxon";
22
22
  import { SlotEnd, SlotStart } from "../input/input.fc";
23
23
  import { addDisposableChangesAndVisibilityObservers, adjustPaddingForStartAndEnd, handleSubmitOnEnterKeydown, } from "../input/input.util";
24
- import { HookValidationLifecycle, createClassMutationObserver, } from "../utils/input";
24
+ import { HookValidationLifecycle, createClassMutationObserver, getValidationText, } from "../utils/input";
25
25
  import { makeRef } from "../utils/make-ref";
26
26
  import { closeDropdown as closeDropdownUtil, createValidityState, handleIconClick, openDropdown as openDropdownUtil, } from "../utils/input/picker-input.util";
27
27
  /**
@@ -243,15 +243,13 @@ export class DateInput {
243
243
  }
244
244
  render() {
245
245
  var _a;
246
- const invalidText = this.isInputInvalid
247
- ? this.i18nErrorDateUnparsable
248
- : this.invalidText;
249
- return (h(Host, { key: '011a0643000de99532a82efcecdcc48d20a817e1', class: {
246
+ const invalidText = getValidationText(this.isInputInvalid, this.invalidText, this.i18nErrorDateUnparsable);
247
+ return (h(Host, { key: '4a7f986c62a82763e46faa0203a5b6ff82415aaf', class: {
250
248
  disabled: this.disabled,
251
249
  readonly: this.readonly,
252
- } }, h("ix-field-wrapper", { key: '08411e49b366d385cb96355bd4bd869d70bcee34', label: this.label, helperText: this.helperText, isInvalid: this.isInvalid, invalidText: invalidText, infoText: this.infoText, isInfo: this.isInfo, isWarning: this.isWarning, warningText: this.warningText, isValid: this.isValid, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, required: this.required, controlRef: this.inputElementRef }, this.renderInput()), h("ix-dropdown", { key: 'b471b5b81f4b4ad45a9403d54be147658f3b3e42', "data-testid": "date-dropdown", trigger: this.inputElementRef.waitForCurrent(), ref: this.dropdownElementRef, closeBehavior: "outside", suppressOverflowBehavior: true, show: this.show, onShowChanged: (event) => {
250
+ } }, h("ix-field-wrapper", { key: 'c366d9ef3a538fd71e8d0f33d305e46da824421e', label: this.label, helperText: this.helperText, isInvalid: this.isInvalid, invalidText: invalidText, infoText: this.infoText, isInfo: this.isInfo, isWarning: this.isWarning, warningText: this.warningText, isValid: this.isValid, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, required: this.required, controlRef: this.inputElementRef }, this.renderInput()), h("ix-dropdown", { key: '6f10990b1e667f0e079f951d920707c15e24e50e', "data-testid": "date-dropdown", trigger: this.inputElementRef.waitForCurrent(), ref: this.dropdownElementRef, closeBehavior: "outside", suppressOverflowBehavior: true, show: this.show, onShowChanged: (event) => {
253
251
  this.show = event.detail;
254
- } }, h("ix-date-picker", { key: '24ca8c4f0301ec042f13401e80463e85aa8a5d44', ref: this.datepickerRef, format: this.format, locale: this.locale, singleSelection: true, from: (_a = this.from) !== null && _a !== void 0 ? _a : '', minDate: this.minDate, maxDate: this.maxDate, onDateChange: (event) => {
252
+ } }, h("ix-date-picker", { key: 'df14f590271c8177fa10360e72b0338088ed79be', ref: this.datepickerRef, format: this.format, locale: this.locale, singleSelection: true, from: (_a = this.from) !== null && _a !== void 0 ? _a : '', minDate: this.minDate, maxDate: this.maxDate, onDateChange: (event) => {
255
253
  const { from } = event.detail;
256
254
  this.onInput(from);
257
255
  }, showWeekNumbers: this.showWeekNumbers, ariaLabelNextMonthButton: this.ariaLabelNextMonthButton, ariaLabelPreviousMonthButton: this.ariaLabelPreviousMonthButton, embedded: true }))));