q2-tecton-elements 1.72.0 → 1.73.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 (383) hide show
  1. package/dist/bundle-report.json +38990 -33801
  2. package/dist/cjs/{charting-ClN1ldqv.js → charting-CdNTrVBe.js} +80 -0
  3. package/dist/cjs/click-elsewhere_3.cjs.entry.js +81 -14
  4. package/dist/cjs/{dataSample-BYR-wrOn.js → dataSample-B4blhlH4.js} +1 -1
  5. package/dist/cjs/date-picker-helpers-UYvPn98R.js +257 -0
  6. package/dist/cjs/{index-BY3aao8R.js → index-BqyWHpNu.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/q2-action-group.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-action-sheet.cjs.entry.js +98 -18
  10. package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-badge_2.cjs.entry.js +2 -2
  12. package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
  13. package/dist/cjs/q2-calendar.cjs.entry.js +9 -4
  14. package/dist/cjs/q2-card-image.cjs.entry.js +3 -3
  15. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-carousel-pane.cjs.entry.js +3 -3
  17. package/dist/cjs/q2-carousel.cjs.entry.js +20 -6
  18. package/dist/cjs/q2-chart-area.cjs.entry.js +38 -7
  19. package/dist/cjs/q2-chart-bar.cjs.entry.js +39 -8
  20. package/dist/cjs/q2-chart-donut.cjs.entry.js +31 -13
  21. package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
  22. package/dist/cjs/q2-checkbox_2.cjs.entry.js +8 -5
  23. package/dist/cjs/q2-context.cjs.entry.js +4 -4
  24. package/dist/cjs/q2-currency.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-data-table.cjs.entry.js +7 -7
  26. package/dist/cjs/q2-date-calendar.cjs.entry.js +452 -0
  27. package/dist/cjs/q2-date-picker_2.cjs.entry.js +968 -0
  28. package/dist/cjs/q2-detail.cjs.entry.js +2 -2
  29. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-dropdown.cjs.entry.js +3 -3
  31. package/dist/cjs/q2-editable-field.cjs.entry.js +20 -7
  32. package/dist/cjs/q2-example.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-file-picker.cjs.entry.js +2 -2
  34. package/dist/cjs/q2-form.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-formatted-text.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-item.cjs.entry.js +20 -2
  38. package/dist/cjs/q2-legend.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-link_2.cjs.entry.js +2 -2
  40. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  41. package/dist/cjs/q2-message.cjs.entry.js +2 -2
  42. package/dist/cjs/q2-meter.cjs.entry.js +2 -2
  43. package/dist/cjs/q2-modal.cjs.entry.js +2 -2
  44. package/dist/cjs/q2-month-picker.cjs.entry.js +3 -3
  45. package/dist/cjs/q2-mutation-observer.cjs.entry.js +1 -1
  46. package/dist/cjs/q2-option.cjs.entry.js +1 -1
  47. package/dist/cjs/q2-otp.cjs.entry.js +5 -5
  48. package/dist/cjs/q2-pagination.cjs.entry.js +4 -4
  49. package/dist/cjs/q2-pill.cjs.entry.js +7 -4
  50. package/dist/cjs/q2-radio-group.cjs.entry.js +2 -2
  51. package/dist/cjs/q2-radio.cjs.entry.js +2 -2
  52. package/dist/cjs/q2-relative-time.cjs.entry.js +2 -2
  53. package/dist/cjs/q2-resize-observer.cjs.entry.js +1 -1
  54. package/dist/cjs/q2-search.cjs.entry.js +3 -3
  55. package/dist/cjs/q2-section.cjs.entry.js +3 -3
  56. package/dist/cjs/q2-select.cjs.entry.js +8 -4
  57. package/dist/cjs/q2-stepper-pane.cjs.entry.js +2 -2
  58. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +2 -2
  59. package/dist/cjs/q2-stepper.cjs.entry.js +2 -2
  60. package/dist/cjs/q2-surface.cjs.entry.js +1 -1
  61. package/dist/cjs/q2-tab-container.cjs.entry.js +2 -2
  62. package/dist/cjs/q2-tab-pane.cjs.entry.js +1 -1
  63. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  64. package/dist/cjs/q2-textarea.cjs.entry.js +2 -2
  65. package/dist/cjs/q2-toast.cjs.entry.js +1 -1
  66. package/dist/cjs/q2-tooltip.cjs.entry.js +1 -1
  67. package/dist/cjs/{sectorHelper-9TWL-3dw.js → sectorHelper-CxhDl5ql.js} +1 -1
  68. package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
  69. package/dist/collection/collection-manifest.json +2 -0
  70. package/dist/collection/components/q2-action-sheet/q2-action-sheet.css +52 -0
  71. package/dist/collection/components/q2-action-sheet/q2-action-sheet.js +98 -18
  72. package/dist/collection/components/q2-action-sheet/test/q2-action-sheet-test.vr.js +124 -0
  73. package/dist/collection/components/q2-avatar/q2-avatar.js +1 -1
  74. package/dist/collection/components/q2-btn/q2-btn.css +84 -136
  75. package/dist/collection/components/q2-btn/q2-btn.js +10 -4
  76. package/dist/collection/components/q2-btn/test/q2-btn-test.vr.js +99 -43
  77. package/dist/collection/components/q2-calendar/q2-calendar.js +16 -5
  78. package/dist/collection/components/q2-calendar/q2-month-picker.js +2 -2
  79. package/dist/collection/components/q2-calendar/test/q2-calendar-test.vr.js +3 -13
  80. package/dist/collection/components/q2-card-image/q2-card-image.js +2 -2
  81. package/dist/collection/components/q2-carousel/q2-carousel.js +19 -5
  82. package/dist/collection/components/q2-carousel/test/q2-carousel-test.vr.js +32 -0
  83. package/dist/collection/components/q2-carousel-pane/q2-carousel-pane.js +2 -2
  84. package/dist/collection/components/q2-chart-area/q2-chart-area.css +11 -0
  85. package/dist/collection/components/q2-chart-area/q2-chart-area.js +53 -7
  86. package/dist/collection/components/q2-chart-area/test/q2-chart-area-test.vr.js +14 -0
  87. package/dist/collection/components/q2-chart-bar/q2-chart-bar.css +11 -0
  88. package/dist/collection/components/q2-chart-bar/q2-chart-bar.js +50 -4
  89. package/dist/collection/components/q2-chart-bar/test/q2-chart-bar-test.vr.js +14 -0
  90. package/dist/collection/components/q2-chart-donut/q2-chart-donut.js +30 -10
  91. package/dist/collection/components/q2-chart-donut/test/q2-chart-donut-test.vr.js +25 -0
  92. package/dist/collection/components/q2-checkbox/q2-checkbox.js +6 -3
  93. package/dist/collection/components/q2-checkbox-group/q2-checkbox-group.js +6 -3
  94. package/dist/collection/components/q2-context/q2-context.js +3 -3
  95. package/dist/collection/components/q2-context/test/q2-context-test.vr.js +3 -3
  96. package/dist/collection/components/q2-currency/q2-currency.js +1 -1
  97. package/dist/collection/components/q2-data-table/q2-data-table.css +3 -0
  98. package/dist/collection/components/q2-data-table/q2-data-table.js +5 -5
  99. package/dist/collection/components/q2-data-table/test/q2-data-table-test.vr.js +47 -0
  100. package/dist/collection/components/q2-date-calendar/q2-date-calendar.css +393 -0
  101. package/dist/collection/components/q2-date-calendar/q2-date-calendar.js +1022 -0
  102. package/dist/collection/components/q2-date-calendar/test/q2-date-calendar-test.vr.js +111 -0
  103. package/dist/collection/components/q2-date-picker/q2-date-picker.css +138 -0
  104. package/dist/collection/components/q2-date-picker/q2-date-picker.js +2010 -0
  105. package/dist/collection/components/q2-date-picker/test/q2-date-picker-test.vr.js +179 -0
  106. package/dist/collection/components/q2-detail/q2-detail.js +1 -1
  107. package/dist/collection/components/q2-dropdown/q2-dropdown.js +5 -5
  108. package/dist/collection/components/q2-editable-field/q2-editable-field.js +27 -8
  109. package/dist/collection/components/q2-example/q2-example.js +1 -1
  110. package/dist/collection/components/q2-file-picker/q2-file-picker.js +1 -1
  111. package/dist/collection/components/q2-form/q2-form.js +1 -1
  112. package/dist/collection/components/q2-formatted-text/q2-formatted-text.js +1 -1
  113. package/dist/collection/components/q2-input/q2-input.js +6 -3
  114. package/dist/collection/components/q2-item/q2-item.js +19 -1
  115. package/dist/collection/components/q2-item/test/q2-item-test.vr.js +2 -2
  116. package/dist/collection/components/q2-legend/q2-legend.js +1 -1
  117. package/dist/collection/components/q2-list/q2-list.js +1 -1
  118. package/dist/collection/components/q2-message/q2-message.js +1 -1
  119. package/dist/collection/components/q2-meter/q2-meter.js +1 -1
  120. package/dist/collection/components/q2-modal/q2-modal.js +1 -1
  121. package/dist/collection/components/q2-modal/test/q2-modal-test.vr.js +7 -7
  122. package/dist/collection/components/q2-mutation-observer/q2-mutation-observer.js +1 -1
  123. package/dist/collection/components/q2-optgroup/q2-optgroup.js +1 -1
  124. package/dist/collection/components/q2-option-list/q2-option-list.js +36 -4
  125. package/dist/collection/components/q2-otp/q2-otp.js +4 -4
  126. package/dist/collection/components/q2-pagination/q2-pagination.js +3 -3
  127. package/dist/collection/components/q2-pill/q2-pill.js +6 -3
  128. package/dist/collection/components/q2-popover/q2-popover.css +1 -0
  129. package/dist/collection/components/q2-popover/q2-popover.js +43 -8
  130. package/dist/collection/components/q2-radio/q2-radio.js +5 -2
  131. package/dist/collection/components/q2-radio-group/q2-radio-group.js +6 -3
  132. package/dist/collection/components/q2-relative-time/q2-relative-time.js +1 -1
  133. package/dist/collection/components/q2-resize-observer/q2-resize-observer.js +1 -1
  134. package/dist/collection/components/q2-search/q2-search.js +6 -3
  135. package/dist/collection/components/q2-section/q2-section.js +2 -2
  136. package/dist/collection/components/q2-select/q2-select.js +12 -5
  137. package/dist/collection/components/q2-stepper/q2-stepper.js +1 -1
  138. package/dist/collection/components/q2-stepper-pane/q2-stepper-pane.js +1 -1
  139. package/dist/collection/components/q2-stepper-vertical/q2-stepper-vertical.js +1 -1
  140. package/dist/collection/components/q2-surface/q2-surface.js +1 -1
  141. package/dist/collection/components/q2-surface/test/q2-surface-test.vr.js +2 -2
  142. package/dist/collection/components/q2-tab-container/q2-tab-container.js +1 -1
  143. package/dist/collection/components/q2-tab-pane/q2-tab-pane.js +1 -1
  144. package/dist/collection/components/q2-tag/q2-tag.js +6 -3
  145. package/dist/collection/components/q2-textarea/q2-textarea.js +6 -3
  146. package/dist/collection/components/q2-tooltip/test/q2-tooltip-test.vr.js +1 -1
  147. package/dist/collection/components/tecton-tab-pane/tecton-tab-pane.js +2 -2
  148. package/dist/collection/utils/chart-keyboard.js +76 -0
  149. package/dist/collection/utils/date-picker/date-picker-helpers.js +239 -0
  150. package/dist/collection/utils/date-picker/date-picker-types.js +1 -0
  151. package/dist/collection/utils/index.js +1 -1
  152. package/dist/components/charting.js +1603 -1532
  153. package/dist/components/dataSample.js +7 -7
  154. package/dist/components/index.js +57 -53
  155. package/dist/components/index2.js +2 -2
  156. package/dist/components/q2-action-sheet.js +224 -103
  157. package/dist/components/q2-avatar2.js +8 -8
  158. package/dist/components/q2-btn2.js +2 -2
  159. package/dist/components/q2-calendar.js +6 -3
  160. package/dist/components/q2-card-image.js +2 -2
  161. package/dist/components/q2-carousel-pane2.js +3 -3
  162. package/dist/components/q2-carousel.js +37 -24
  163. package/dist/components/q2-chart-area.js +415 -369
  164. package/dist/components/q2-chart-bar.js +193 -148
  165. package/dist/components/q2-chart-donut.js +185 -158
  166. package/dist/components/q2-checkbox-group.js +6 -6
  167. package/dist/components/q2-checkbox2.js +11 -11
  168. package/dist/components/q2-context.js +20 -20
  169. package/dist/components/q2-currency.js +9 -9
  170. package/dist/components/q2-data-table.js +111 -111
  171. package/dist/components/q2-date-calendar.d.ts +11 -0
  172. package/dist/components/q2-date-calendar.js +5 -0
  173. package/dist/components/q2-date-calendar2.js +678 -0
  174. package/dist/components/q2-date-picker.d.ts +11 -0
  175. package/dist/components/q2-date-picker.js +5 -0
  176. package/dist/components/q2-date-picker2.js +875 -0
  177. package/dist/components/q2-detail.js +3 -3
  178. package/dist/components/q2-dropdown.js +17 -17
  179. package/dist/components/q2-editable-field.js +16 -5
  180. package/dist/components/q2-example.js +11 -11
  181. package/dist/components/q2-file-picker.js +1 -1
  182. package/dist/components/q2-form.js +6 -6
  183. package/dist/components/q2-formatted-text.js +2 -2
  184. package/dist/components/q2-input2.js +5 -5
  185. package/dist/components/q2-item2.js +32 -22
  186. package/dist/components/q2-legend2.js +7 -7
  187. package/dist/components/q2-list2.js +6 -6
  188. package/dist/components/q2-message2.js +9 -9
  189. package/dist/components/q2-meter.js +7 -7
  190. package/dist/components/q2-modal.js +22 -22
  191. package/dist/components/q2-month-picker.js +17 -17
  192. package/dist/components/q2-mutation-observer.js +1 -1
  193. package/dist/components/q2-optgroup2.js +7 -7
  194. package/dist/components/q2-option-list2.js +55 -34
  195. package/dist/components/q2-otp.js +8 -8
  196. package/dist/components/q2-pagination.js +67 -67
  197. package/dist/components/q2-pill.js +16 -14
  198. package/dist/components/q2-popover2.js +70 -49
  199. package/dist/components/q2-radio-group.js +7 -7
  200. package/dist/components/q2-radio.js +6 -6
  201. package/dist/components/q2-relative-time.js +1 -1
  202. package/dist/components/q2-resize-observer2.js +23 -23
  203. package/dist/components/q2-search.js +5 -5
  204. package/dist/components/q2-section.js +19 -19
  205. package/dist/components/q2-select2.js +2 -2
  206. package/dist/components/q2-stepper-pane.js +9 -9
  207. package/dist/components/q2-stepper-vertical.js +4 -4
  208. package/dist/components/q2-stepper.js +57 -57
  209. package/dist/components/q2-surface.js +3 -3
  210. package/dist/components/q2-tab-container.js +17 -17
  211. package/dist/components/q2-tab-pane.js +2 -2
  212. package/dist/components/q2-tag2.js +8 -6
  213. package/dist/components/q2-textarea.js +3 -3
  214. package/dist/components/sectorHelper.js +78 -78
  215. package/dist/components/tecton-tab-pane.js +10 -10
  216. package/dist/esm/{charting-DOZct-UB.js → charting-DFXJklqs.js} +79 -1
  217. package/dist/esm/click-elsewhere_3.entry.js +81 -14
  218. package/dist/esm/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +1 -1
  219. package/dist/esm/date-picker-helpers-D8QnN_AS.js +242 -0
  220. package/dist/esm/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
  221. package/dist/esm/loader.js +1 -1
  222. package/dist/esm/q2-action-group.entry.js +1 -1
  223. package/dist/esm/q2-action-sheet.entry.js +99 -19
  224. package/dist/esm/q2-avatar.entry.js +1 -1
  225. package/dist/esm/q2-badge_2.entry.js +2 -2
  226. package/dist/esm/q2-btn_2.entry.js +2 -2
  227. package/dist/esm/q2-calendar.entry.js +9 -4
  228. package/dist/esm/q2-card-image.entry.js +3 -3
  229. package/dist/esm/q2-card.entry.js +1 -1
  230. package/dist/esm/q2-carousel-pane.entry.js +3 -3
  231. package/dist/esm/q2-carousel.entry.js +20 -6
  232. package/dist/esm/q2-chart-area.entry.js +38 -7
  233. package/dist/esm/q2-chart-bar.entry.js +39 -8
  234. package/dist/esm/q2-chart-donut.entry.js +31 -13
  235. package/dist/esm/q2-checkbox-group.entry.js +2 -2
  236. package/dist/esm/q2-checkbox_2.entry.js +8 -5
  237. package/dist/esm/q2-context.entry.js +4 -4
  238. package/dist/esm/q2-currency.entry.js +1 -1
  239. package/dist/esm/q2-data-table.entry.js +7 -7
  240. package/dist/esm/q2-date-calendar.entry.js +450 -0
  241. package/dist/esm/q2-date-picker_2.entry.js +965 -0
  242. package/dist/esm/q2-detail.entry.js +2 -2
  243. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  244. package/dist/esm/q2-dropdown.entry.js +3 -3
  245. package/dist/esm/q2-editable-field.entry.js +20 -7
  246. package/dist/esm/q2-example.entry.js +1 -1
  247. package/dist/esm/q2-file-picker.entry.js +2 -2
  248. package/dist/esm/q2-form.entry.js +1 -1
  249. package/dist/esm/q2-formatted-text.entry.js +1 -1
  250. package/dist/esm/q2-icon.entry.js +1 -1
  251. package/dist/esm/q2-item.entry.js +20 -2
  252. package/dist/esm/q2-legend.entry.js +1 -1
  253. package/dist/esm/q2-link_2.entry.js +2 -2
  254. package/dist/esm/q2-loc.entry.js +1 -1
  255. package/dist/esm/q2-message.entry.js +2 -2
  256. package/dist/esm/q2-meter.entry.js +2 -2
  257. package/dist/esm/q2-modal.entry.js +2 -2
  258. package/dist/esm/q2-month-picker.entry.js +3 -3
  259. package/dist/esm/q2-mutation-observer.entry.js +1 -1
  260. package/dist/esm/q2-option.entry.js +1 -1
  261. package/dist/esm/q2-otp.entry.js +5 -5
  262. package/dist/esm/q2-pagination.entry.js +4 -4
  263. package/dist/esm/q2-pill.entry.js +7 -4
  264. package/dist/esm/q2-radio-group.entry.js +2 -2
  265. package/dist/esm/q2-radio.entry.js +2 -2
  266. package/dist/esm/q2-relative-time.entry.js +2 -2
  267. package/dist/esm/q2-resize-observer.entry.js +1 -1
  268. package/dist/esm/q2-search.entry.js +3 -3
  269. package/dist/esm/q2-section.entry.js +3 -3
  270. package/dist/esm/q2-select.entry.js +8 -4
  271. package/dist/esm/q2-stepper-pane.entry.js +2 -2
  272. package/dist/esm/q2-stepper-vertical.entry.js +2 -2
  273. package/dist/esm/q2-stepper.entry.js +2 -2
  274. package/dist/esm/q2-surface.entry.js +1 -1
  275. package/dist/esm/q2-tab-container.entry.js +2 -2
  276. package/dist/esm/q2-tab-pane.entry.js +1 -1
  277. package/dist/esm/q2-tecton-elements.js +1 -1
  278. package/dist/esm/q2-textarea.entry.js +2 -2
  279. package/dist/esm/q2-toast.entry.js +1 -1
  280. package/dist/esm/q2-tooltip.entry.js +1 -1
  281. package/dist/esm/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +1 -1
  282. package/dist/esm/tecton-tab-pane.entry.js +2 -2
  283. package/dist/q2-tecton-elements/{charting-DOZct-UB.js → charting-DFXJklqs.js} +1625 -1554
  284. package/dist/q2-tecton-elements/click-elsewhere_3.entry.js +85 -43
  285. package/dist/q2-tecton-elements/{dataSample-Dm1zpQNi.js → dataSample-CP_VKNqt.js} +33 -33
  286. package/dist/q2-tecton-elements/date-picker-helpers-D8QnN_AS.js +153 -0
  287. package/dist/q2-tecton-elements/{index-DJw6Feh0.js → index-CP8pXJ-l.js} +1 -1
  288. package/dist/q2-tecton-elements/q2-action-group.entry.js +1 -1
  289. package/dist/q2-tecton-elements/q2-action-sheet.entry.js +169 -84
  290. package/dist/q2-tecton-elements/q2-avatar.entry.js +8 -8
  291. package/dist/q2-tecton-elements/q2-badge_2.entry.js +5 -5
  292. package/dist/q2-tecton-elements/q2-btn_2.entry.js +23 -23
  293. package/dist/q2-tecton-elements/q2-calendar.entry.js +7 -4
  294. package/dist/q2-tecton-elements/q2-card-image.entry.js +3 -3
  295. package/dist/q2-tecton-elements/q2-card.entry.js +1 -1
  296. package/dist/q2-tecton-elements/q2-carousel-pane.entry.js +4 -4
  297. package/dist/q2-tecton-elements/q2-carousel.entry.js +24 -11
  298. package/dist/q2-tecton-elements/q2-chart-area.entry.js +187 -141
  299. package/dist/q2-tecton-elements/q2-chart-bar.entry.js +377 -333
  300. package/dist/q2-tecton-elements/q2-chart-donut.entry.js +184 -158
  301. package/dist/q2-tecton-elements/q2-checkbox-group.entry.js +7 -7
  302. package/dist/q2-tecton-elements/q2-checkbox_2.entry.js +20 -18
  303. package/dist/q2-tecton-elements/q2-context.entry.js +21 -21
  304. package/dist/q2-tecton-elements/q2-currency.entry.js +9 -9
  305. package/dist/q2-tecton-elements/q2-data-table.entry.js +7 -7
  306. package/dist/q2-tecton-elements/q2-date-calendar.entry.js +438 -0
  307. package/dist/q2-tecton-elements/q2-date-picker_2.entry.js +792 -0
  308. package/dist/q2-tecton-elements/q2-detail.entry.js +4 -4
  309. package/dist/q2-tecton-elements/q2-dropdown-item.entry.js +1 -1
  310. package/dist/q2-tecton-elements/q2-dropdown.entry.js +16 -16
  311. package/dist/q2-tecton-elements/q2-editable-field.entry.js +17 -6
  312. package/dist/q2-tecton-elements/q2-example.entry.js +1 -1
  313. package/dist/q2-tecton-elements/q2-file-picker.entry.js +2 -2
  314. package/dist/q2-tecton-elements/q2-form.entry.js +2 -2
  315. package/dist/q2-tecton-elements/q2-formatted-text.entry.js +2 -2
  316. package/dist/q2-tecton-elements/q2-icon.entry.js +1 -1
  317. package/dist/q2-tecton-elements/q2-item.entry.js +26 -16
  318. package/dist/q2-tecton-elements/q2-legend.entry.js +2 -2
  319. package/dist/q2-tecton-elements/q2-link_2.entry.js +7 -7
  320. package/dist/q2-tecton-elements/q2-loc.entry.js +1 -1
  321. package/dist/q2-tecton-elements/q2-message.entry.js +28 -28
  322. package/dist/q2-tecton-elements/q2-meter.entry.js +8 -8
  323. package/dist/q2-tecton-elements/q2-modal.entry.js +18 -18
  324. package/dist/q2-tecton-elements/q2-month-picker.entry.js +14 -14
  325. package/dist/q2-tecton-elements/q2-mutation-observer.entry.js +1 -1
  326. package/dist/q2-tecton-elements/q2-option.entry.js +1 -1
  327. package/dist/q2-tecton-elements/q2-otp.entry.js +9 -9
  328. package/dist/q2-tecton-elements/q2-pagination.entry.js +20 -20
  329. package/dist/q2-tecton-elements/q2-pill.entry.js +42 -40
  330. package/dist/q2-tecton-elements/q2-radio-group.entry.js +8 -8
  331. package/dist/q2-tecton-elements/q2-radio.entry.js +7 -7
  332. package/dist/q2-tecton-elements/q2-relative-time.entry.js +5 -5
  333. package/dist/q2-tecton-elements/q2-resize-observer.entry.js +13 -13
  334. package/dist/q2-tecton-elements/q2-search.entry.js +6 -6
  335. package/dist/q2-tecton-elements/q2-section.entry.js +20 -20
  336. package/dist/q2-tecton-elements/q2-select.entry.js +3 -3
  337. package/dist/q2-tecton-elements/q2-stepper-pane.entry.js +13 -13
  338. package/dist/q2-tecton-elements/q2-stepper-vertical.entry.js +9 -9
  339. package/dist/q2-tecton-elements/q2-stepper.entry.js +45 -45
  340. package/dist/q2-tecton-elements/q2-surface.entry.js +3 -3
  341. package/dist/q2-tecton-elements/q2-tab-container.entry.js +20 -20
  342. package/dist/q2-tecton-elements/q2-tab-pane.entry.js +7 -7
  343. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  344. package/dist/q2-tecton-elements/q2-textarea.entry.js +3 -3
  345. package/dist/q2-tecton-elements/q2-toast.entry.js +1 -1
  346. package/dist/q2-tecton-elements/q2-tooltip.entry.js +1 -1
  347. package/dist/q2-tecton-elements/{sectorHelper--RMGWGAy.js → sectorHelper-DBtkWtpl.js} +56 -56
  348. package/dist/q2-tecton-elements/tecton-tab-pane.entry.js +6 -6
  349. package/dist/types/components/q2-action-sheet/q2-action-sheet.d.ts +21 -1
  350. package/dist/types/components/q2-action-sheet/test/q2-action-sheet-test.vr.d.ts +1 -0
  351. package/dist/types/components/q2-btn/q2-btn.d.ts +7 -3
  352. package/dist/types/components/q2-calendar/q2-calendar.d.ts +10 -2
  353. package/dist/types/components/q2-carousel/q2-carousel.d.ts +5 -0
  354. package/dist/types/components/q2-chart-area/q2-chart-area.d.ts +11 -2
  355. package/dist/types/components/q2-chart-bar/q2-chart-bar.d.ts +9 -0
  356. package/dist/types/components/q2-chart-donut/q2-chart-donut.d.ts +1 -0
  357. package/dist/types/components/q2-checkbox/q2-checkbox.d.ts +4 -3
  358. package/dist/types/components/q2-checkbox-group/q2-checkbox-group.d.ts +4 -2
  359. package/dist/types/components/q2-date-calendar/q2-date-calendar.d.ts +122 -0
  360. package/dist/types/components/q2-date-calendar/test/q2-date-calendar-test.vr.d.ts +1 -0
  361. package/dist/types/components/q2-date-picker/q2-date-picker.d.ts +304 -0
  362. package/dist/types/components/q2-date-picker/test/q2-date-picker-test.vr.d.ts +1 -0
  363. package/dist/types/components/q2-dropdown/q2-dropdown.d.ts +3 -3
  364. package/dist/types/components/q2-editable-field/q2-editable-field.d.ts +14 -1
  365. package/dist/types/components/q2-input/q2-input.d.ts +4 -2
  366. package/dist/types/components/q2-item/q2-item.d.ts +3 -0
  367. package/dist/types/components/q2-option-list/q2-option-list.d.ts +1 -0
  368. package/dist/types/components/q2-popover/q2-popover.d.ts +4 -0
  369. package/dist/types/components/q2-radio/q2-radio.d.ts +3 -2
  370. package/dist/types/components/q2-radio-group/q2-radio-group.d.ts +4 -2
  371. package/dist/types/components/q2-search/q2-search.d.ts +3 -1
  372. package/dist/types/components/q2-select/q2-select.d.ts +4 -2
  373. package/dist/types/components/q2-textarea/q2-textarea.d.ts +4 -2
  374. package/dist/types/components.d.ts +858 -49
  375. package/dist/types/global.d.ts +1 -0
  376. package/dist/types/index.d.ts +1 -0
  377. package/dist/types/utils/chart-keyboard.d.ts +16 -0
  378. package/dist/types/utils/date-picker/date-picker-helpers.d.ts +47 -0
  379. package/dist/types/utils/date-picker/date-picker-types.d.ts +42 -0
  380. package/package.json +3 -3
  381. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -70
  382. package/dist/esm/q2-optgroup.entry.js +0 -68
  383. package/dist/q2-tecton-elements/q2-optgroup.entry.js +0 -88
@@ -0,0 +1,965 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-Cqkz7Bnm.js';
2
+ import { d as dateFnsExports } from './index-O1A-ZSZs.js';
3
+ import { q as handleDeprecationWarning, o as overrideFocus, i as isEventFromElement, w as waitForNextPaint, l as loc, h as hasSlotContent, c as createGuid } from './index-CP8pXJ-l.js';
4
+ import { s as shouldShowActionSheet } from './action-sheet-DuQ7VZ08.js';
5
+ import { m as mirrorEmit } from './mirror-emit-DUjY_ucm.js';
6
+ import { f as formatDateISO, p as parseDatePickerValue, e as normalizeDatePickerValue, h as formatLegacyDisplayDate, n as normalizeDisplayFormat, b as formatDisplayDate, i as isDateSelectable, c as isRangeSelectable, l as localizeDatePickerString, j as buildInputDate } from './date-picker-helpers-D8QnN_AS.js';
7
+ import { b as hasValidAncestor } from './component-DaQM9u3s.js';
8
+
9
+ const q2DatePickerCss = () => `*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}@container style(--t-prefers-motion: "reduced"){*,*::before,*::after{animation-duration:0.01ms !important;transition-duration:0.01ms !important;animation-delay:0ms !important;transition-delay:0ms !important}}@container (not style(--t-prefers-motion: "normal")) and (not style(--t-prefers-motion: "reduced")){@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:0.01ms !important;transition-duration:0.01ms !important;animation-delay:0ms !important;transition-delay:0ms !important}}}:host{--comp-date-picker-width:var(--tct-date-picker-width, var(--tct-date-calendar-width, 360px));box-sizing:border-box;display:block}:host[hidden]{display:none}click-elsewhere,.date-picker-input{display:block;width:100%}q2-date-calendar{--comp-date-calendar-width:var(--comp-date-picker-width);display:block;width:var(--comp-date-picker-width)}q2-date-calendar.is-action-sheet{--comp-date-calendar-width:100%;width:100%}q2-popover{--tct-popover-width:var(--comp-date-picker-width);--tct-popover-border-radius:var(--tct-date-picker-border-radius, var(--tct-date-calendar-border-radius, var(--app-border-radius-1, 4px)))}@media (max-width: 768px){:host{--comp-date-picker-width:min( 100%, calc( 100vw - var(--tct-date-picker-mobile-gutter, var(--tct-date-calendar-mobile-gutter, 24px)) - var(--tct-date-picker-mobile-gutter, var(--tct-date-calendar-mobile-gutter, 24px)) ), var(--tct-date-picker-mobile-max-width, var(--tct-date-calendar-mobile-max-width, 420px)) )}}`;
10
+
11
+ const Q2DatePicker = class {
12
+ constructor(hostRef) {
13
+ registerInstance(this, hostRef);
14
+ this.change = createEvent(this, "change", 7);
15
+ this.error = createEvent(this, "error", 7);
16
+ this.success = createEvent(this, "success", 7);
17
+ this.tctCancel = createEvent(this, "tctCancel", 7);
18
+ this.tctChange = createEvent(this, "tctChange", 7);
19
+ this.tctClose = createEvent(this, "tctClose", 7);
20
+ this.tctError = createEvent(this, "tctError", 7);
21
+ this.tctSuccess = createEvent(this, "tctSuccess", 7);
22
+ var _a;
23
+ this.committingValue = false;
24
+ this.normalizedDateLists = new WeakMap();
25
+ // #endregion
26
+ // #region State Properties
27
+ this.activePopoverDirection = 'down';
28
+ this.typeableValue = '';
29
+ // #endregion
30
+ // #region Public Property API
31
+ /**
32
+ * Renders the calendar panel inline with behavior specific to being hosted by `q2-action-sheet`.
33
+ * @private
34
+ */
35
+ this._actionSheet = false;
36
+ /**
37
+ * Determines the year for a committed month/day typeable date with no year.
38
+ * `future` selects the next year for dates before today, while `past` selects the prior year for dates after today.
39
+ * Only applies to `single-typeable` mode with a month-first or day-first display format.
40
+ */
41
+ this.assume = 'current';
42
+ /** Displays a button in the input field allowing the user to clear the selected date or range. */
43
+ this.clearable = false;
44
+ /** Delay in milliseconds before the popover closes after selection. Explicitly undefined or non-positive values close immediately. */
45
+ this.closeDelay = 400;
46
+ /** Indicates the date picker cannot be focused or interacted with. */
47
+ this.disabled = false;
48
+ /**
49
+ * Hides the input field's visible label while retaining its accessible name.
50
+ * @warning
51
+ * Hides the label visually. `label` text is still required for screenreader compliance.
52
+ */
53
+ this.hideLabel = false;
54
+ /**
55
+ * Instructs the component to use the action sheet workflow for displaying its calendar.
56
+ *
57
+ * For more information, see [Action Sheets](https://tecton.q2developer.com/guides/action-sheets/).
58
+ */
59
+ this.hoist = ((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.useActionSheets) ? true : undefined;
60
+ /** Shows the input field's error visual state. */
61
+ this.invalid = false;
62
+ /** Formats selected dates using the provided locale. Accepts multiple locales in an array as sequential fallbacks. */
63
+ this.locale = document.documentElement.lang || 'en-US';
64
+ /**
65
+ * Selects calendar or typeable behavior for a single date or date range.
66
+ * Enabling the legacy `typeable` prop uses `single-typeable` when `mode` is left at its default; an explicit mode takes precedence.
67
+ */
68
+ this.mode = 'single';
69
+ /** Controls whether the date picker popover is open or closed. */
70
+ this.open = false;
71
+ /** Appends "(optional)" to the input label and marks the field as not required. */
72
+ this.optional = false;
73
+ /** Aligns the calendar popover to the left or right side of the input field. */
74
+ this.popoverAlignment = 'left';
75
+ /** @deprecated Retained for compatibility with `q2-date-picker`. */
76
+ this.popoverMinHeight = 355;
77
+ /**
78
+ * Uses absolute positioning for the popover when set to `legacy`.
79
+ *
80
+ * This compatibility option supports layouts where transformed ancestors interfere with fixed positioning.
81
+ */
82
+ this.popoverMode = null;
83
+ /**
84
+ * The field's content is not editable, but the field remains focusable.
85
+ *
86
+ * Appends "(read only)" to the field label.
87
+ */
88
+ this.readonly = false;
89
+ /** Enables the legacy single-date typeable input behavior. */
90
+ this.typeable = false;
91
+ /** Shows the input field's success visual state when no errors are active. */
92
+ this.valid = false;
93
+ this.onCalendarCancel = (event) => {
94
+ event.stopPropagation();
95
+ this.calendarError = '';
96
+ if (this._actionSheet) {
97
+ this.tctCancel.emit();
98
+ return;
99
+ }
100
+ this.closeCalendar();
101
+ };
102
+ this.onCalendarCommit = (event) => {
103
+ event.stopPropagation();
104
+ if (this.disabled || this.readonly)
105
+ return;
106
+ if (!event.detail)
107
+ return;
108
+ this.calendarError = '';
109
+ const { value, rangeStart, rangeEnd } = event.detail;
110
+ if (this.isRangeMode) {
111
+ if (!rangeStart || !rangeEnd)
112
+ return;
113
+ this.rangeStart = rangeStart;
114
+ this.rangeEnd = rangeEnd;
115
+ mirrorEmit(this, ['change', 'tctChange'], { rangeStart, rangeEnd });
116
+ this.closeCalendar(true, true);
117
+ return;
118
+ }
119
+ if (!value)
120
+ return;
121
+ this.commitSingleValue(value);
122
+ this.closeAfterSelection();
123
+ };
124
+ this.onCalendarDismiss = (event) => {
125
+ event.stopPropagation();
126
+ this.calendarError = '';
127
+ if (this._actionSheet) {
128
+ this.tctCancel.emit();
129
+ return;
130
+ }
131
+ this.closeCalendar();
132
+ };
133
+ this.onCalendarError = (event) => {
134
+ event.stopPropagation();
135
+ this.calendarError = event.detail;
136
+ if (this._actionSheet) {
137
+ this.tctClose.emit({ error: event.detail });
138
+ return;
139
+ }
140
+ this.closeCalendar(true, true);
141
+ };
142
+ this.onCalendarToggleClick = (event) => {
143
+ event.stopPropagation();
144
+ this.toggleCalendar();
145
+ };
146
+ this.onClear = () => {
147
+ this.calendarError = '';
148
+ this.typeableError = '';
149
+ this.typeableValue = '';
150
+ if (this.isRangeMode) {
151
+ this.rangeStart = undefined;
152
+ this.rangeEnd = undefined;
153
+ mirrorEmit(this, ['change', 'tctChange'], { rangeStart: null, rangeEnd: null });
154
+ return;
155
+ }
156
+ this.value = undefined;
157
+ mirrorEmit(this, ['change', 'tctChange'], { value: null });
158
+ };
159
+ this.onClickElsewhere = (event) => {
160
+ if (event.target.localName !== 'click-elsewhere')
161
+ return;
162
+ event.stopPropagation();
163
+ this.closeCalendar(false);
164
+ };
165
+ this.onInputClick = () => {
166
+ if (this.acceptsTypeableInput)
167
+ return;
168
+ this.toggleCalendar();
169
+ };
170
+ this.onInputKeydown = (event) => {
171
+ if (this.disabled || this.readonly)
172
+ return;
173
+ if (this.acceptsTypeableInput) {
174
+ if (event.metaKey || event.ctrlKey || event.altKey || event.key.length !== 1)
175
+ return;
176
+ if (!this.typeableAllowedCharacters.test(event.key))
177
+ event.preventDefault();
178
+ return;
179
+ }
180
+ if (shouldShowActionSheet({ hoist: this.hoist }, event)) {
181
+ event.preventDefault();
182
+ this.showActionSheet();
183
+ return;
184
+ }
185
+ if (event.key === 'Escape' && this.open) {
186
+ event.preventDefault();
187
+ this.closeCalendar();
188
+ return;
189
+ }
190
+ if (!['Enter', ' ', 'ArrowDown'].includes(event.key) || this.open)
191
+ return;
192
+ event.preventDefault();
193
+ this.setActivePopoverDirection();
194
+ this.open = true;
195
+ requestAnimationFrame(() => this.focusRenderedDate());
196
+ };
197
+ this.onTypeableChange = (event) => {
198
+ event.stopImmediatePropagation();
199
+ if (this.disabled || this.readonly)
200
+ return;
201
+ if (this.isSingleTypeable) {
202
+ const date = this.parseTypeableDate(this.typeableValue);
203
+ if (!date || !this.isDateValid(date)) {
204
+ this.setTypeableError(this.dateFormatValidationError);
205
+ return;
206
+ }
207
+ this.setTypeableError('');
208
+ const value = formatDateISO(date);
209
+ this.commitSingleValue(value);
210
+ return;
211
+ }
212
+ const [startValue, endValue] = this.typeableValue.split(' - ');
213
+ const start = this.parseTypeableDate(startValue);
214
+ const end = this.parseTypeableDate(endValue);
215
+ if (!start || !end) {
216
+ this.setTypeableError(this.rangeFormatValidationError);
217
+ return;
218
+ }
219
+ const rangeError = this.typeableRangeError(start, end);
220
+ if (rangeError) {
221
+ this.setTypeableError(rangeError);
222
+ return;
223
+ }
224
+ this.setTypeableError('');
225
+ const rangeStart = formatDateISO(start);
226
+ const rangeEnd = formatDateISO(end);
227
+ this.rangeStart = rangeStart;
228
+ this.rangeEnd = rangeEnd;
229
+ mirrorEmit(this, ['change', 'tctChange'], { rangeStart, rangeEnd });
230
+ };
231
+ this.onTypeableInput = (event) => {
232
+ var _a;
233
+ event.stopImmediatePropagation();
234
+ if (this.disabled || this.readonly)
235
+ return;
236
+ const maxDigits = this.isRangeTypeable ? 16 : 8;
237
+ const digits = String(((_a = event.detail) === null || _a === void 0 ? void 0 : _a.value) || '')
238
+ .replace(/\D/g, '')
239
+ .slice(0, maxDigits);
240
+ this.typeableValue =
241
+ this.isRangeTypeable && digits.length > 8
242
+ ? `${this.formatTypeableDate(digits.slice(0, 8))} - ${this.formatTypeableDate(digits.slice(8))}`
243
+ : this.formatTypeableDate(digits);
244
+ this.validateTypeableValue();
245
+ };
246
+ }
247
+ // #endregion
248
+ // #region Component Lifecycle Events
249
+ connectedCallback() {
250
+ const normalizedValue = this.normalizedValue;
251
+ if (normalizedValue && this.value !== normalizedValue)
252
+ this.value = normalizedValue;
253
+ this.activePopoverDirection = this.effectivePopoverDirection || 'down';
254
+ this.typeableValue = this.formattedTypeableValue;
255
+ this.validateCurrentValue();
256
+ }
257
+ disconnectedCallback() {
258
+ clearTimeout(this.closeTimeout);
259
+ }
260
+ componentWillLoad() {
261
+ if (this.popDirection)
262
+ handleDeprecationWarning(this, 'popDirection', 'prop');
263
+ }
264
+ componentDidLoad() {
265
+ overrideFocus(this.hostElement);
266
+ }
267
+ componentDidRender() {
268
+ if (this.open && this.activePopoverDirection === 'up')
269
+ this.scrollUpCalendarToBottom();
270
+ }
271
+ // #endregion
272
+ // #region Listeners
273
+ beforeInputHandler(event) {
274
+ if (this.acceptsTypeableInput && event.data && !this.typeableAllowedCharacters.test(event.data)) {
275
+ event.preventDefault();
276
+ }
277
+ }
278
+ delegateFocus(event) {
279
+ var _a;
280
+ if (!isEventFromElement(event, this.hostElement))
281
+ return;
282
+ (_a = this.controlElement) === null || _a === void 0 ? void 0 : _a.focus();
283
+ }
284
+ popoverStateHandler({ detail: { open } }) {
285
+ if (this.open !== open)
286
+ this.open = open;
287
+ }
288
+ // #endregion
289
+ // #region Public Methods API
290
+ /** Closes the calendar popover if it is open. */
291
+ async closePopover() {
292
+ this.closeCalendar();
293
+ }
294
+ /** Moves the visible month to the provided date and focuses that day. */
295
+ async focusDate(date) {
296
+ var _a;
297
+ if (!dateFnsExports.isValid(date))
298
+ return;
299
+ await waitForNextPaint();
300
+ await ((_a = this.calendarElement) === null || _a === void 0 ? void 0 : _a.focusDate(date));
301
+ }
302
+ /** Opens the calendar popover if it is closed. */
303
+ async openPopover() {
304
+ var _a;
305
+ if (this.open || this.disabled || this.readonly || this._actionSheet)
306
+ return;
307
+ this.setActivePopoverDirection();
308
+ this.open = true;
309
+ await waitForNextPaint();
310
+ const toggleElement = this.acceptsTypeableInput
311
+ ? (_a = this.controlElement) === null || _a === void 0 ? void 0 : _a.querySelector('[test-id="datePickerCalendarToggle"]')
312
+ : this.controlElement;
313
+ toggleElement === null || toggleElement === void 0 ? void 0 : toggleElement.focus();
314
+ toggleElement === null || toggleElement === void 0 ? void 0 : toggleElement.dispatchEvent(new FocusEvent('focus'));
315
+ }
316
+ /** Clears selected values, uncommitted typeable input, and error state without changing configuration props. */
317
+ async reset() {
318
+ clearTimeout(this.closeTimeout);
319
+ this.value = undefined;
320
+ this.rangeStart = undefined;
321
+ this.rangeEnd = undefined;
322
+ this.errors = undefined;
323
+ this.invalid = false;
324
+ this.calendarError = '';
325
+ this.typeableError = '';
326
+ this.typeableValue = '';
327
+ }
328
+ /** Opens the calendar and selects the provided date when it is valid. */
329
+ async setValue(value) {
330
+ var _a;
331
+ const date = parseDatePickerValue(normalizeDatePickerValue(value));
332
+ if (this.disabled || this.readonly || this.isRangeTypeable || !dateFnsExports.isValid(date) || !this.isDateValid(date)) {
333
+ return;
334
+ }
335
+ if (!this._actionSheet) {
336
+ this.setActivePopoverDirection();
337
+ this.open = true;
338
+ await waitForNextPaint();
339
+ }
340
+ await ((_a = this.calendarElement) === null || _a === void 0 ? void 0 : _a.setValue(date));
341
+ }
342
+ /**
343
+ * Focuses the single typeable input and stages a valid date without committing it.
344
+ *
345
+ * @warning
346
+ * Only applicable when the effective mode is `single-typeable`.
347
+ */
348
+ async typeValue(value) {
349
+ var _a;
350
+ if (!this.isSingleTypeable)
351
+ return;
352
+ const date = parseDatePickerValue(normalizeDatePickerValue(value));
353
+ if (!dateFnsExports.isValid(date))
354
+ return;
355
+ await ((_a = this.controlElement) === null || _a === void 0 ? void 0 : _a.setValue(this.formatDateWithModifier(date)));
356
+ }
357
+ // #endregion
358
+ // #region Watchers
359
+ constraintsChanged() {
360
+ if (this.committingValue)
361
+ return;
362
+ if (this.acceptsTypeableInput)
363
+ this.revalidateTypeableValue();
364
+ if (!this.typeableError)
365
+ this.validateCurrentValue();
366
+ }
367
+ disabledChanged(disabled) {
368
+ if (disabled)
369
+ this.closeCalendar(false);
370
+ }
371
+ displayFormatChanged() {
372
+ this.calendarError = '';
373
+ this.typeableError = '';
374
+ this.typeableValue = this.formattedTypeableValue;
375
+ }
376
+ modeChanged() {
377
+ this.open = false;
378
+ this.calendarError = '';
379
+ this.typeableError = '';
380
+ this.typeableValue = this.formattedTypeableValue;
381
+ }
382
+ openChanged(open) {
383
+ if (!open)
384
+ return;
385
+ this.setActivePopoverDirection();
386
+ if (this.isRangeMode && this.activePopoverDirection === 'down')
387
+ this.scrollDownCalendarToTop();
388
+ }
389
+ popDirectionChanged() {
390
+ if (this.popDirection)
391
+ handleDeprecationWarning(this, 'popDirection', 'prop');
392
+ this.setActivePopoverDirection();
393
+ }
394
+ popoverDirectionChanged() {
395
+ this.setActivePopoverDirection();
396
+ }
397
+ rangeEndChanged() {
398
+ if (!this.isRangeMode)
399
+ return;
400
+ this.calendarError = '';
401
+ if (this.isRangeTypeable)
402
+ this.syncTypeableValue();
403
+ }
404
+ rangeStartChanged() {
405
+ if (!this.isRangeMode)
406
+ return;
407
+ this.calendarError = '';
408
+ if (this.isRangeTypeable)
409
+ this.syncTypeableValue();
410
+ }
411
+ readonlyChanged(readonly) {
412
+ if (readonly)
413
+ this.closeCalendar(false);
414
+ }
415
+ valueChanged(value) {
416
+ const normalizedValue = normalizeDatePickerValue(value);
417
+ if (normalizedValue && value !== normalizedValue) {
418
+ this.value = normalizedValue;
419
+ return;
420
+ }
421
+ if (this.isRangeMode || this.committingValue)
422
+ return;
423
+ this.calendarError = '';
424
+ if (this.isSingleTypeable)
425
+ this.syncTypeableValue();
426
+ this.validateCurrentValue();
427
+ }
428
+ // #endregion
429
+ // #region Local Methods
430
+ get acceptsTypeableInput() {
431
+ return this.isRangeTypeable || this.isSingleTypeable;
432
+ }
433
+ get actionSheetData() {
434
+ return {
435
+ appearance: 'date-picker',
436
+ title: this.localizeForLocale(this.calendarLabel || 'Choose a date'),
437
+ datePickerProps: {
438
+ calendarLabel: this.calendarLabel,
439
+ closeDelay: this.closeDelay,
440
+ cutoffTime: this.cutoffTime,
441
+ daysOfWeekChecksum: this.daysOfWeekChecksum,
442
+ disclaimer: this.disclaimer,
443
+ endDate: normalizeDatePickerValue(this.endDate),
444
+ displayFormat: this.normalizedDisplayFormat,
445
+ invalidDates: this.normalizedInvalidDates,
446
+ locale: this.locale,
447
+ mode: this.isRangeMode ? 'range' : 'single',
448
+ rangeEnd: normalizeDatePickerValue(this.rangeEnd),
449
+ rangeStart: normalizeDatePickerValue(this.rangeStart),
450
+ startDate: normalizeDatePickerValue(this.startDate),
451
+ validDates: this.normalizedValidDates,
452
+ value: this.normalizedValue,
453
+ },
454
+ };
455
+ }
456
+ get automaticPopoverDirection() {
457
+ var _a, _b;
458
+ const { top = 0, bottom = 0 } = ((_b = (_a = this.controlElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect) === null || _b === void 0 ? void 0 : _b.call(_a)) || {};
459
+ return top > window.innerHeight - bottom ? 'up' : 'down';
460
+ }
461
+ get canClear() {
462
+ return this.clearable && (this.isRangeMode ? !!this.rangeStart || !!this.rangeEnd : !!this.normalizedValue);
463
+ }
464
+ get computedErrors() {
465
+ const errors = [...(this.errors || [])];
466
+ const internalError = this.typeableError || this.calendarError;
467
+ if (internalError)
468
+ errors.push(internalError);
469
+ if (!errors.length && this.invalid)
470
+ errors.push('tecton.element.calendar.invalid');
471
+ return errors.length ? [errors[0]] : undefined;
472
+ }
473
+ get computedPlaceholder() {
474
+ if (this.disabled && this.disabledMsg)
475
+ return this.localizeForLocale(this.disabledMsg);
476
+ return this.localizeForLocale(this.placeholder);
477
+ }
478
+ get dateFormatValidationError() {
479
+ return this.localizeForLocale('tecton.element.datePicker.validation.dateFormat', {
480
+ format: this.normalizedDisplayFormat,
481
+ });
482
+ }
483
+ get effectiveMode() {
484
+ if (this.mode !== 'single')
485
+ return this.mode;
486
+ return this.typeable ? 'single-typeable' : 'single';
487
+ }
488
+ get effectivePopoverDirection() {
489
+ return this.popoverDirection || this.popDirection;
490
+ }
491
+ get formattedTypeableValue() {
492
+ if (!this.selectedDate)
493
+ return '';
494
+ if (!this.isRangeTypeable)
495
+ return this.formatDateWithModifier(this.selectedDate);
496
+ if (!this.rangeEndDate)
497
+ return '';
498
+ return `${this.formatDateWithModifier(this.selectedDate)} - ${this.formatDateWithModifier(this.rangeEndDate)}`;
499
+ }
500
+ get formattedValue() {
501
+ if (!this.selectedDate)
502
+ return '';
503
+ const formatDate = (date) => this.displayFormat ? formatLegacyDisplayDate(date, this.displayFormat) : this.formatLongDate(date);
504
+ if (this.effectiveMode !== 'range' || !this.rangeEndDate)
505
+ return formatDate(this.selectedDate);
506
+ return `${formatDate(this.selectedDate)} – ${formatDate(this.rangeEndDate)}`;
507
+ }
508
+ get isRangeMode() {
509
+ return this.effectiveMode === 'range' || this.isRangeTypeable;
510
+ }
511
+ get isRangeTypeable() {
512
+ return this.effectiveMode === 'range-typeable';
513
+ }
514
+ get isSingleTypeable() {
515
+ return this.effectiveMode === 'single-typeable';
516
+ }
517
+ get normalizedDisplayFormat() {
518
+ return normalizeDisplayFormat(this.displayFormat);
519
+ }
520
+ get normalizedInvalidDates() {
521
+ return this.normalizeDateList(this.invalidDates);
522
+ }
523
+ get normalizedValidDates() {
524
+ return this.normalizeDateList(this.validDates);
525
+ }
526
+ get normalizedValue() {
527
+ return normalizeDatePickerValue(this.value);
528
+ }
529
+ get rangeEndDate() {
530
+ const date = parseDatePickerValue(normalizeDatePickerValue(this.rangeEnd));
531
+ return dateFnsExports.isValid(date) ? date : undefined;
532
+ }
533
+ get rangeFormatValidationError() {
534
+ return this.localizeForLocale('tecton.element.datePicker.validation.rangeFormat', {
535
+ format: this.rangeTypeableFormat,
536
+ });
537
+ }
538
+ get rangeOrderValidationError() {
539
+ return this.localizeForLocale('tecton.element.datePicker.validation.rangeOrder');
540
+ }
541
+ get rangeTypeableFormat() {
542
+ return `${this.normalizedDisplayFormat} - ${this.normalizedDisplayFormat}`;
543
+ }
544
+ get rangeValidationError() {
545
+ return this.localizeForLocale('tecton.element.datePicker.validation.rangeUnavailable');
546
+ }
547
+ get selectedDate() {
548
+ const date = parseDatePickerValue(this.isRangeMode ? normalizeDatePickerValue(this.rangeStart) : this.normalizedValue);
549
+ return dateFnsExports.isValid(date) ? date : undefined;
550
+ }
551
+ get typeableAllowedCharacters() {
552
+ const formatSeparators = this.normalizedDisplayFormat.replace(/[MDY]/g, '');
553
+ const rangeSeparator = this.isRangeTypeable ? ' -' : '';
554
+ const escapedSeparators = `${formatSeparators}${rangeSeparator}`.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
555
+ return new RegExp(`^[0-9${escapedSeparators}]+$`);
556
+ }
557
+ closeAfterSelection() {
558
+ clearTimeout(this.closeTimeout);
559
+ const closeDelay = Number(this.closeDelay);
560
+ if (!closeDelay || closeDelay <= 0) {
561
+ this.closeCalendar(true, true);
562
+ return;
563
+ }
564
+ this.closeTimeout = setTimeout(() => this.closeCalendar(true, true), closeDelay);
565
+ }
566
+ closeCalendar(returnFocus = true, emitClose = false) {
567
+ var _a;
568
+ if (!this.open)
569
+ return;
570
+ this.open = false;
571
+ if (emitClose)
572
+ this.tctClose.emit();
573
+ if (returnFocus)
574
+ (_a = this.controlElement) === null || _a === void 0 ? void 0 : _a.focus();
575
+ }
576
+ commitSingleValue(value) {
577
+ if (this.committingValue)
578
+ return;
579
+ // Watchers and consumer change handlers may update constraints during either event alias.
580
+ this.committingValue = true;
581
+ try {
582
+ this.value = value;
583
+ mirrorEmit(this, ['change', 'tctChange'], { value });
584
+ }
585
+ finally {
586
+ this.committingValue = false;
587
+ }
588
+ if (this.isSingleTypeable)
589
+ this.syncTypeableValue();
590
+ if (!this.typeableError)
591
+ this.validateCurrentValue();
592
+ }
593
+ emitValidationError(message) {
594
+ if (this.isRangeMode)
595
+ return;
596
+ mirrorEmit(this, ['error', 'tctError'], {
597
+ errors: [{ message, errorCode: 'generalInvalid' }],
598
+ });
599
+ }
600
+ emitValidationSuccess(value) {
601
+ if (this.isRangeMode)
602
+ return;
603
+ mirrorEmit(this, ['success', 'tctSuccess'], { value });
604
+ }
605
+ focusRenderedDate(value) {
606
+ var _a;
607
+ (_a = this.calendarElement) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new CustomEvent('tctCalendarFocus', {
608
+ detail: { value },
609
+ }));
610
+ }
611
+ formatDateWithModifier(date) {
612
+ return formatDisplayDate(date, this.normalizedDisplayFormat);
613
+ }
614
+ formatLongDate(date) {
615
+ return new Intl.DateTimeFormat(this.locale, {
616
+ year: 'numeric',
617
+ month: 'long',
618
+ day: 'numeric',
619
+ }).format(date);
620
+ }
621
+ formatTypeableDate(value) {
622
+ const separator = this.normalizedDisplayFormat.includes('-') ? '-' : '/';
623
+ const dateParts = this.normalizedDisplayFormat.startsWith('YYYY')
624
+ ? [value.slice(0, 4), value.slice(4, 6), value.slice(6, 8)]
625
+ : [value.slice(0, 2), value.slice(2, 4), value.slice(4, 8)];
626
+ return dateParts.filter(Boolean).join(separator);
627
+ }
628
+ isDateValid(date) {
629
+ return isDateSelectable(date, {
630
+ cutoffTime: this.cutoffTime,
631
+ daysOfWeekChecksum: this.daysOfWeekChecksum,
632
+ endDate: normalizeDatePickerValue(this.endDate),
633
+ invalidDates: this.normalizedInvalidDates,
634
+ startDate: normalizeDatePickerValue(this.startDate),
635
+ validDates: this.normalizedValidDates,
636
+ });
637
+ }
638
+ isRangeValid(start, end) {
639
+ return isRangeSelectable(start, end, {
640
+ cutoffTime: this.cutoffTime,
641
+ daysOfWeekChecksum: this.daysOfWeekChecksum,
642
+ endDate: normalizeDatePickerValue(this.endDate),
643
+ invalidDates: this.normalizedInvalidDates,
644
+ startDate: normalizeDatePickerValue(this.startDate),
645
+ validDates: this.normalizedValidDates,
646
+ });
647
+ }
648
+ isTypeableDatePrefixInvalid(digits) {
649
+ const isYearFirst = this.normalizedDisplayFormat.startsWith('YYYY');
650
+ const isDayFirst = this.normalizedDisplayFormat.startsWith('DD');
651
+ const firstPart = isYearFirst ? digits.slice(0, 4) : digits.slice(0, 2);
652
+ const secondPart = isYearFirst ? digits.slice(4, 6) : digits.slice(2, 4);
653
+ const monthPart = isYearFirst || isDayFirst ? secondPart : firstPart;
654
+ const dayPart = isYearFirst ? digits.slice(6, 8) : isDayFirst ? firstPart : secondPart;
655
+ const isSegmentInvalid = (segment, maximum) => {
656
+ if (!segment)
657
+ return false;
658
+ if (segment.length === 1)
659
+ return Number(segment) > Math.floor(maximum / 10);
660
+ const value = Number(segment);
661
+ return value < 1 || value > maximum;
662
+ };
663
+ if (isSegmentInvalid(monthPart, 12) || isSegmentInvalid(dayPart, 31))
664
+ return true;
665
+ if (monthPart.length < 2 || dayPart.length < 2)
666
+ return false;
667
+ return Number(dayPart) > new Date(2000, Number(monthPart), 0).getDate();
668
+ }
669
+ localizeForLocale(value, substitutions = {}) {
670
+ return localizeDatePickerString(value, substitutions);
671
+ }
672
+ normalizeDateList(values) {
673
+ if (!values)
674
+ return;
675
+ // Stable references prevent child constraint watchers from clearing errors on unrelated renders.
676
+ if (!this.normalizedDateLists.has(values)) {
677
+ this.normalizedDateLists.set(values, values.map(value => normalizeDatePickerValue(value)).filter((value) => !!value));
678
+ }
679
+ return this.normalizedDateLists.get(values);
680
+ }
681
+ parseTypeableDate(value) {
682
+ var _a;
683
+ const separator = this.normalizedDisplayFormat.includes('-') ? '-' : '/';
684
+ const escapedSeparator = separator === '-' ? '\\-' : '/';
685
+ const isYearFirst = this.normalizedDisplayFormat.startsWith('YYYY');
686
+ const pattern = isYearFirst
687
+ ? `^\\d{4}${escapedSeparator}\\d{2}${escapedSeparator}\\d{2}$`
688
+ : `^\\d{2}${escapedSeparator}\\d{2}(?:${escapedSeparator}\\d{4})?$`;
689
+ if (!new RegExp(pattern).test(value || ''))
690
+ return;
691
+ const dateParts = value.split(separator);
692
+ const [yearPart, monthPart, dayPart] = isYearFirst
693
+ ? dateParts
694
+ : this.normalizedDisplayFormat.startsWith('DD')
695
+ ? [dateParts[2], dateParts[1], dateParts[0]]
696
+ : [dateParts[2], dateParts[0], dateParts[1]];
697
+ const month = Number(monthPart);
698
+ const day = Number(dayPart);
699
+ const year = yearPart ? Number(yearPart) : (_a = buildInputDate(`${month}/${day}`, this.assume)) === null || _a === void 0 ? void 0 : _a.getFullYear();
700
+ if (!year)
701
+ return;
702
+ const date = new Date(year, month - 1, day);
703
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day)
704
+ return;
705
+ return date;
706
+ }
707
+ /**
708
+ * Recomputes the typeable error from the current `typeableValue`, applying the same range checks the commit path
709
+ * uses so a stale error cannot outlive the text that produced it.
710
+ */
711
+ revalidateTypeableValue() {
712
+ this.validateTypeableValue();
713
+ if (this.typeableError || !this.isRangeTypeable)
714
+ return;
715
+ const [startValue, endValue] = this.typeableValue.split(' - ');
716
+ const start = this.parseTypeableDate(startValue);
717
+ const end = this.parseTypeableDate(endValue);
718
+ if (!start || !end)
719
+ return;
720
+ this.typeableError = this.typeableRangeError(start, end);
721
+ }
722
+ async scrollDownCalendarToTop() {
723
+ var _a;
724
+ if (!this.open || !this.isRangeMode || this.activePopoverDirection !== 'down')
725
+ return;
726
+ await waitForNextPaint();
727
+ await waitForNextPaint();
728
+ if (!this.open || !this.isRangeMode || this.activePopoverDirection !== 'down')
729
+ return;
730
+ await ((_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.scrollContainerTo({ top: 0 }));
731
+ }
732
+ async scrollUpCalendarToBottom() {
733
+ var _a;
734
+ if (!this.open || this.activePopoverDirection !== 'up')
735
+ return;
736
+ await waitForNextPaint();
737
+ await waitForNextPaint();
738
+ if (!this.open || this.activePopoverDirection !== 'up')
739
+ return;
740
+ await ((_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.scrollContainerTo({ top: Number.MAX_SAFE_INTEGER }));
741
+ }
742
+ setActivePopoverDirection() {
743
+ this.activePopoverDirection = this.effectivePopoverDirection || this.automaticPopoverDirection;
744
+ }
745
+ setTypeableError(error) {
746
+ if (this.typeableError === error)
747
+ return;
748
+ this.typeableError = error;
749
+ if (error)
750
+ this.emitValidationError(error);
751
+ }
752
+ async showActionSheet() {
753
+ var _a, _b;
754
+ const result = (await ((_a = window.TectonElements) === null || _a === void 0 ? void 0 : _a.showActionSheet(this.actionSheetData)));
755
+ (_b = this.controlElement) === null || _b === void 0 ? void 0 : _b.focus();
756
+ if (result === null || result === void 0 ? void 0 : result.error) {
757
+ this.calendarError = result.error;
758
+ this.tctClose.emit({ error: result.error });
759
+ return;
760
+ }
761
+ if (!result || result.type === 'cancel')
762
+ return;
763
+ if (this.isRangeMode) {
764
+ const { rangeStart, rangeEnd } = result;
765
+ if (!rangeStart || !rangeEnd)
766
+ return;
767
+ this.rangeStart = rangeStart;
768
+ this.rangeEnd = rangeEnd;
769
+ mirrorEmit(this, ['change', 'tctChange'], { rangeStart, rangeEnd });
770
+ this.tctClose.emit();
771
+ return;
772
+ }
773
+ if (!result.value)
774
+ return;
775
+ this.commitSingleValue(result.value);
776
+ this.tctClose.emit();
777
+ }
778
+ syncTypeableValue() {
779
+ this.typeableValue = this.formattedTypeableValue;
780
+ this.revalidateTypeableValue();
781
+ }
782
+ toggleCalendar() {
783
+ if (this.disabled || this.readonly)
784
+ return;
785
+ if (shouldShowActionSheet({ hoist: this.hoist })) {
786
+ this.showActionSheet();
787
+ return;
788
+ }
789
+ if (!this.open)
790
+ this.setActivePopoverDirection();
791
+ this.open = !this.open;
792
+ }
793
+ typeableRangeError(start, end) {
794
+ if (start.getTime() > end.getTime())
795
+ return this.rangeOrderValidationError;
796
+ if (!this.isRangeValid(start, end))
797
+ return this.rangeValidationError;
798
+ return '';
799
+ }
800
+ validateCurrentValue(value = this.value) {
801
+ if (!value || this.isRangeMode)
802
+ return;
803
+ const normalizedValue = normalizeDatePickerValue(value);
804
+ const date = parseDatePickerValue(normalizedValue);
805
+ if (!normalizedValue || !dateFnsExports.isValid(date) || !this.isDateValid(date)) {
806
+ this.emitValidationError(`Value passed is invalid: The date ${value} is not valid`);
807
+ return;
808
+ }
809
+ this.emitValidationSuccess(normalizedValue);
810
+ }
811
+ validateTypeableValue() {
812
+ const digits = this.typeableValue.replace(/\D/g, '');
813
+ if (!digits) {
814
+ this.setTypeableError('');
815
+ return;
816
+ }
817
+ const dateParts = this.isRangeTypeable ? [digits.slice(0, 8), digits.slice(8)] : [digits];
818
+ const containsInvalidDate = dateParts.some(part => {
819
+ if (this.isTypeableDatePrefixInvalid(part))
820
+ return true;
821
+ if (part.length !== 8)
822
+ return false;
823
+ const date = this.parseTypeableDate(this.formatTypeableDate(part));
824
+ return !date || !this.isDateValid(date);
825
+ });
826
+ this.setTypeableError(containsInvalidDate
827
+ ? this.isRangeTypeable
828
+ ? this.rangeFormatValidationError
829
+ : this.dateFormatValidationError
830
+ : '');
831
+ }
832
+ // #endregion
833
+ // #region Render Methods
834
+ renderCalendar() {
835
+ return (h("q2-date-calendar", { ref: element => (this.calendarElement = element), class: this._actionSheet ? 'is-action-sheet' : undefined, accessibleLabel: this.calendarLabel || 'Choose a date', actionSheet: this._actionSheet, calendarLabel: this.calendarLabel, cutoffTime: this.cutoffTime, daysOfWeekChecksum: this.daysOfWeekChecksum, direction: this.activePopoverDirection, disabled: this.disabled, disclaimer: this.disclaimer, displayFormat: this.normalizedDisplayFormat, endDate: normalizeDatePickerValue(this.endDate), invalidDates: this.normalizedInvalidDates, locale: this.locale, mode: this.effectiveMode, open: this.open, rangeEnd: normalizeDatePickerValue(this.rangeEnd), rangeStart: normalizeDatePickerValue(this.rangeStart), readonly: this.readonly, startDate: normalizeDatePickerValue(this.startDate), validDates: this.normalizedValidDates, value: this.normalizedValue, onTctCalendarCancel: this.onCalendarCancel, onTctCalendarCommit: this.onCalendarCommit, onTctCalendarDismiss: this.onCalendarDismiss, onTctCalendarError: this.onCalendarError }));
836
+ }
837
+ render() {
838
+ if (this._actionSheet)
839
+ return this.renderCalendar();
840
+ return (h("click-elsewhere", { class: this.open ? 'dropdown-open' : undefined, onChange: this.onClickElsewhere }, h("q2-input", { ref: element => (this.controlElement = element), class: "date-picker-input", clearable: this.canClear, disabled: this.disabled, errors: this.computedErrors, hideLabel: this.hideLabel, hints: this.hints, readonly: this.readonly, optional: this.optional, valid: this.valid, value: this.acceptsTypeableInput ? this.typeableValue : this.formattedValue, label: loc(this.label), placeholder: this.computedPlaceholder, "icon-right": this.acceptsTypeableInput ? undefined : 'calendar', autocomplete: "off", maxlength: this.isRangeTypeable ? 23 : this.isSingleTypeable ? 10 : undefined, "aria-haspopup": "dialog", "aria-expanded": `${this.open}`, "aria-controls": "date-picker-popover", onClick: this.acceptsTypeableInput ? undefined : this.onInputClick, onChange: event => event.stopImmediatePropagation(), onTctChange: this.acceptsTypeableInput ? this.onTypeableChange : event => event.stopImmediatePropagation(), onInput: event => event.stopImmediatePropagation(), onTctInput: this.acceptsTypeableInput ? this.onTypeableInput : event => event.stopImmediatePropagation(), onTctClear: this.onClear, onKeyDown: this.onInputKeydown, "test-id": "datePickerToggle", _preventEntry: !this.acceptsTypeableInput }, hasSlotContent(this.hostElement, 'label') && (h("slot", { name: "label", slot: "label" })), this.acceptsTypeableInput && (h("q2-btn", { slot: "input-right", "hide-label": true, disabled: this.disabled || this.readonly, label: "tecton.element.calendar.toggleAriaLabel", onClick: this.onCalendarToggleClick, "test-id": "datePickerCalendarToggle" }, h("q2-icon", { type: "calendar" })))), h("q2-popover", { ref: element => (this.popoverElement = element), id: "date-picker-popover", controlElement: this.controlElement, open: this.open, direction: this.effectivePopoverDirection, align: this.popoverAlignment, minHeight: this.popoverMinHeight, mode: this.popoverMode || undefined }, this.renderCalendar())));
841
+ }
842
+ get hostElement() { return getElement(this); }
843
+ static get watchers() { return {
844
+ "cutoffTime": [{
845
+ "constraintsChanged": 0
846
+ }],
847
+ "assume": [{
848
+ "constraintsChanged": 0
849
+ }],
850
+ "daysOfWeekChecksum": [{
851
+ "constraintsChanged": 0
852
+ }],
853
+ "endDate": [{
854
+ "constraintsChanged": 0
855
+ }],
856
+ "invalidDates": [{
857
+ "constraintsChanged": 0
858
+ }],
859
+ "startDate": [{
860
+ "constraintsChanged": 0
861
+ }],
862
+ "validDates": [{
863
+ "constraintsChanged": 0
864
+ }],
865
+ "disabled": [{
866
+ "disabledChanged": 0
867
+ }],
868
+ "displayFormat": [{
869
+ "displayFormatChanged": 0
870
+ }],
871
+ "mode": [{
872
+ "modeChanged": 0
873
+ }],
874
+ "typeable": [{
875
+ "modeChanged": 0
876
+ }],
877
+ "open": [{
878
+ "openChanged": 0
879
+ }],
880
+ "popDirection": [{
881
+ "popDirectionChanged": 0
882
+ }],
883
+ "popoverDirection": [{
884
+ "popoverDirectionChanged": 0
885
+ }],
886
+ "rangeEnd": [{
887
+ "rangeEndChanged": 0
888
+ }],
889
+ "rangeStart": [{
890
+ "rangeStartChanged": 0
891
+ }],
892
+ "readonly": [{
893
+ "readonlyChanged": 0
894
+ }],
895
+ "value": [{
896
+ "valueChanged": 0
897
+ }]
898
+ }; }
899
+ };
900
+ Q2DatePicker.style = q2DatePickerCss();
901
+
902
+ const q2OptgroupCss = () => `*{box-sizing:border-box}*:active{outline:none}*:focus-visible{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #0066cc)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}@container style(--t-prefers-motion: "reduced"){*,*::before,*::after{animation-duration:0.01ms !important;transition-duration:0.01ms !important;animation-delay:0ms !important;transition-delay:0ms !important}}@container (not style(--t-prefers-motion: "normal")) and (not style(--t-prefers-motion: "reduced")){@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:0.01ms !important;transition-duration:0.01ms !important;animation-delay:0ms !important;transition-delay:0ms !important}}}:host{display:block}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-background, var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--t-base, #FFFFFF))));color:var(--tct-optgroup-header-color, inherit);font-size:var(--tct-optgroup-header-font-size, var(--const-px-14, 14px));font-weight:var(--tct-optgroup-header-font-weight, 600);letter-spacing:var(--tct-optgroup-header-letter-spacing, inherit);position:var(--tct-optgroup-header-position, sticky);padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, none));top:calc(var(--comp-popover-top-container-height, 0px) + var(--tct-optgroup-top, var(--t-optgroup-top, 0px)));z-index:5}`;
903
+
904
+ const Q2Optgroup = class {
905
+ constructor(hostRef) {
906
+ registerInstance(this, hostRef);
907
+ // #region Own Properties
908
+ this.guid = createGuid();
909
+ // #endregion
910
+ // #region State Properties
911
+ this.hidden = false;
912
+ // #endregion
913
+ // #region Public Property API
914
+ /** Determines whether all nested options are disabled. */
915
+ this.disabled = false;
916
+ this.setHidden = () => {
917
+ this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
918
+ };
919
+ }
920
+ // #endregion
921
+ // #region Component Lifecycle Events
922
+ disconnectedCallback() {
923
+ var _a;
924
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
925
+ this.mutationObserver = null;
926
+ }
927
+ componentWillLoad() {
928
+ hasValidAncestor(this.hostElement, 'q2-option-list, q2-select, q2-dropdown, q2-pill');
929
+ const observer = new MutationObserver(this.setHidden);
930
+ observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
931
+ this.mutationObserver = observer;
932
+ // set initially
933
+ this.setHidden();
934
+ this.disabledWatcher(this.disabled);
935
+ }
936
+ // #endregion
937
+ // #region Watchers
938
+ disabledWatcher(disabled) {
939
+ this.options.forEach(opt => {
940
+ opt.disabledGroup = !!disabled;
941
+ });
942
+ }
943
+ // #endregion
944
+ // #region Local Methods
945
+ get headerId() {
946
+ return `q2-optgroup-header-${this.guid}`;
947
+ }
948
+ get options() {
949
+ return Array.from(this.hostElement.querySelectorAll('q2-option'));
950
+ }
951
+ // #endregion
952
+ // #region Render Methods
953
+ render() {
954
+ return (h("div", { key: '829ae5ebec150734128c98343ddb8112de0ee21e', class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, h("div", { key: '6683155f922a2d15349f885aabac0bf9ee6a4575', class: "q2-optgroup-header", id: this.headerId }, (this.label && loc(this.label)) || ''), h("div", { key: 'b974da306256b13283183fa03e4dc8bcc8be3f44', class: "q2-optgroup-options" }, h("slot", { key: '2f0035aad12309be2c5c4ea3125077cc704e65e4' }))));
955
+ }
956
+ get hostElement() { return getElement(this); }
957
+ static get watchers() { return {
958
+ "disabled": [{
959
+ "disabledWatcher": 0
960
+ }]
961
+ }; }
962
+ };
963
+ Q2Optgroup.style = q2OptgroupCss();
964
+
965
+ export { Q2DatePicker as q2_date_picker, Q2Optgroup as q2_optgroup };