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
@@ -132,11 +132,14 @@ export class Q2Tag {
132
132
  this.dropdownBtn.focus();
133
133
  }
134
134
  popoverStateHandler({ detail: { open } }) {
135
- if (this.open !== open)
136
- this.open = open;
135
+ var _a;
136
+ if (this.open === open)
137
+ return;
138
+ this.open = open;
137
139
  if (open)
138
140
  return;
139
141
  this.optionList.setActiveElement(null);
142
+ (_a = this.dropdownBtn) === null || _a === void 0 ? void 0 : _a.focus();
140
143
  }
141
144
  // #endregion
142
145
  // #region Public Methods API
@@ -194,7 +197,7 @@ export class Q2Tag {
194
197
  if (this.optionCount)
195
198
  wrapperClassNames.push('has-options');
196
199
  const shouldShowOptions = this.optionCount > 0;
197
- return (h(Host, { key: 'da6dc23ff4f250b18242a49db02eccc16210b043' }, h("click-elsewhere", { key: 'ee1da442ffd5aa53e55ae95f95b3ac51e2f5c71e', onChange: this.onClickElsewhere }, shouldShowOptions ? (h(Fragment, null, h("button", { class: "tag-wrapper", ref: el => (this.dropdownBtn = el), "test-id": "btn-control", type: "button", role: "combobox", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-expanded": open ? 'true' : 'false', "aria-describedby": "option-description", "aria-label": loc(this.label) }, h("div", { class: wrapperClassNames.join(' ') }, loc(this.label)), h("q2-icon", { type: "options" })), this.renderHiddenElement())) : (h("div", { class: "tag-wrapper", onClick: e => e.stopPropagation() }, h("div", { class: wrapperClassNames.join(' ') }, h("slot", { name: "decorator" }), loc(this.label)))), shouldShowOptions && (h("q2-popover", { key: '578989b60b19f6f5e01c1cbc49a83e87fc74c5a9', ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment }, h("q2-option-list", { key: 'd21abcd1fe11241e14b4f411d9559c12c139c18a', id: "option-list", ref: el => (this.optionList = el), onChange: this.handleChange, type: "menu", align: "right", label: loc('tecton.element.optionList.label', [this.optionListLabel]), "no-select": true }, h("slot", { key: 'd46ec7dad47e40cec883205d6fb2424abcdd1038' })))))));
200
+ return (h(Host, { key: 'a18af83301ac8bf08d1638b05d4dd8795f11cd46' }, h("click-elsewhere", { key: '130d173a4bf53dd6eec1775944d910c630e704ae', onChange: this.onClickElsewhere }, shouldShowOptions ? (h(Fragment, null, h("button", { class: "tag-wrapper", ref: el => (this.dropdownBtn = el), "test-id": "btn-control", type: "button", role: "combobox", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-expanded": open ? 'true' : 'false', "aria-describedby": "option-description", "aria-label": loc(this.label) }, h("div", { class: wrapperClassNames.join(' ') }, loc(this.label)), h("q2-icon", { type: "options" })), this.renderHiddenElement())) : (h("div", { class: "tag-wrapper", onClick: e => e.stopPropagation() }, h("div", { class: wrapperClassNames.join(' ') }, h("slot", { name: "decorator" }), loc(this.label)))), shouldShowOptions && (h("q2-popover", { key: '07bf52f6b4d8c4bbf42e90e69ff9a9deec82810b', ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, maxHeight: this.popoverMaxHeight, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: this.popoverAlignment }, h("q2-option-list", { key: 'eefdf7202c269194a9753e438b4c6060984ba33e', id: "option-list", ref: el => (this.optionList = el), onChange: this.handleChange, type: "menu", align: "right", label: loc('tecton.element.optionList.label', [this.optionListLabel]), "no-select": true }, h("slot", { key: '3067ac9beee239562c410d7dfe4af04c651ef8ae' })))))));
198
201
  }
199
202
  static get is() { return "q2-tag"; }
200
203
  static get encapsulation() { return "shadow"; }
@@ -277,7 +277,7 @@ export class Q2Textarea {
277
277
  ]))));
278
278
  }
279
279
  render() {
280
- return (h("div", { key: '9b3eb74c84edd99af52a0ec71ba8b2fd8adbd1f2', class: this.wrapperClasses }, renderLabel(this), h("div", { key: 'a00772502ea6c1fde5af5bf4c12f0606a629252a', class: "content-container", ref: el => (this.contentContainer = el) }, this.renderInput(), this.maxlength ? this.renderMaxLength() : '', renderMessages(this))));
280
+ return (h("div", { key: '21a303feabd0c8fc09d9cc7f0de8b9b50081a56a', class: this.wrapperClasses }, renderLabel(this), h("div", { key: '58b5be24312fe523d09efe176b1ecf42b884166a', class: "content-container", ref: el => (this.contentContainer = el) }, this.renderInput(), this.maxlength ? this.renderMaxLength() : '', renderMessages(this))));
281
281
  }
282
282
  static get is() { return "q2-textarea"; }
283
283
  static get encapsulation() { return "shadow"; }
@@ -364,9 +364,9 @@ export class Q2Textarea {
364
364
  "docs": {
365
365
  "tags": [{
366
366
  "name": "warning",
367
- "text": "Only use when a visible label is impractical."
367
+ "text": "Hides the label visually. `label` text is still required for screenreader compliance."
368
368
  }],
369
- "text": "Hide's the field's `<label>` element from view."
369
+ "text": "Hides the field's `<label>` element from view."
370
370
  },
371
371
  "getter": false,
372
372
  "setter": false,
@@ -427,6 +427,9 @@ export class Q2Textarea {
427
427
  "optional": false,
428
428
  "docs": {
429
429
  "tags": [{
430
+ "name": "warning",
431
+ "text": "Required for screen reader compliance even when `hideLabel` is `true`."
432
+ }, {
430
433
  "name": "localizable",
431
434
  "text": undefined
432
435
  }],
@@ -1,7 +1,7 @@
1
1
  import { expect } from "@playwright/test";
2
2
  import { test } from "@stencil/playwright";
3
3
  import { setupPage, THEMES, FONT_SCALE_PX, FONT_SCALE_SUFFIX } from "../../../utils/test/vr-helpers";
4
- const TRIGGER = `<q2-btn intent="workflow-primary"><span>Trigger</span></q2-btn>`;
4
+ const TRIGGER = `<q2-btn intent="primary"><span>Trigger</span></q2-btn>`;
5
5
  // Pad the wrapper so the tooltip has room to render in any direction without clipping.
6
6
  const wrap = (inner) => `<div style="padding: 80px; display: inline-block;">${inner}</div>`;
7
7
  // Use `immediate` so hover doesn't have to wait through the 1s delay before the
@@ -51,9 +51,9 @@ export class TectonTabPane {
51
51
  // #endregion
52
52
  // #region Render Methods
53
53
  render() {
54
- return (h("div", { key: '6c0524ab1981900cc7a37803fd9426c6397049c4', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, this.selected && this.provided !== undefined && !this.provided && (h("div", { key: '10cc2712e1ccefa6a9bb3b657830636da4d81980' }, h("slot", { key: 'cde7112d4035c6f118e9c50b0fe5d9d91c70ee7d', name: "loading-wrapper" }), h("iframe", { key: '851972991feb3b8f6c7f569e92ff2e624d94e221', hidden: true, name: this.moduleId, scrolling: "no", src: this.showForm && this.authPayload.length ? '' : this.url || '', "data-module-id": this.moduleId, style: this.minHeight ? { minHeight: this.minHeight } : null, onLoad: this.onIFrameLoad, title: this.iframeTitle, allow: "geolocation; camera" }), this._showForm && this.authPayload ? (h("form", { hidden: true, method: "post", action: this.url, target: this.moduleId, encType: "multipart/form-data" }, this.authPayload.map(element => {
54
+ return (h("div", { key: 'b55643965ef49af2e41a683686db00b97e1c90b7', id: `tab-pane-${this.guid}-${this.index}`, class: `tab-pane${this.selected ? '' : ' hidden'}`, role: "tabpanel", tabindex: "-1", "aria-hidden": `${!this.selected}`, "aria-labelledby": `tab-${this.guid}-${this.index}` }, this.selected && this.provided !== undefined && !this.provided && (h("div", { key: 'f04f1594eba66d962d9adbab48bf3559f658c650' }, h("slot", { key: '08804102412a6b57ac9b9db2002d1608f8b22c19', name: "loading-wrapper" }), h("iframe", { key: 'a2524435de8072fb27ebdcc9762a1f20367df098', hidden: true, name: this.moduleId, scrolling: "no", src: this.showForm && this.authPayload.length ? '' : this.url || '', "data-module-id": this.moduleId, style: this.minHeight ? { minHeight: this.minHeight } : null, onLoad: this.onIFrameLoad, title: this.iframeTitle, allow: "geolocation; camera" }), this._showForm && this.authPayload ? (h("form", { hidden: true, method: "post", action: this.url, target: this.moduleId, encType: "multipart/form-data" }, this.authPayload.map(element => {
55
55
  return (h("input", { type: "hidden", value: element.value, name: element.key }));
56
- }))) : (''))), h("div", { key: '741c6f2c89dc15493f165428929f589425aa4d75', class: "slot-wrapper", hidden: this.selected && this.provided !== undefined && !this.provided }, h("slot", { key: '17100ec2dc0ea2d1e27628d36e9e6e1139f293a9' }))));
56
+ }))) : (''))), h("div", { key: '59e9d5ddbabadb0e66615d998403d267c259f937', class: "slot-wrapper", hidden: this.selected && this.provided !== undefined && !this.provided }, h("slot", { key: '450c5724cf32ba05a2fc93b8adeba83b08e871e4' }))));
57
57
  }
58
58
  static get is() { return "tecton-tab-pane"; }
59
59
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,76 @@
1
+ import { loc } from "./index";
2
+ /** Localized feedback shared by chart keyboard controls. */
3
+ export function chartPointDescription(name, value, index, count) {
4
+ return loc('tecton.element.chart.pointDescription', [loc(name) || '', value, `${index + 1}`, `${count}`]);
5
+ }
6
+ /** Coordinates keyboard exploration with ECharts emphasis without changing chart data. */
7
+ export function createChartKeyboardNavigation(options) {
8
+ let index = null;
9
+ let focused = false;
10
+ const clear = () => {
11
+ var _a;
12
+ if (index !== null) {
13
+ (_a = options.getChart()) === null || _a === void 0 ? void 0 : _a.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: index });
14
+ }
15
+ index = null;
16
+ options.onChange(null);
17
+ };
18
+ const select = (next) => {
19
+ var _a;
20
+ if (!options.getData()[next] || next === index)
21
+ return;
22
+ clear();
23
+ index = next;
24
+ (_a = options.getChart()) === null || _a === void 0 ? void 0 : _a.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: index });
25
+ options.onChange(index);
26
+ };
27
+ const order = () => { var _a, _b; return (_b = (_a = options.getOrder) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _b !== void 0 ? _b : options.getData().map((_, i) => i); };
28
+ return {
29
+ onFocus: () => {
30
+ focused = true;
31
+ select(order()[0]);
32
+ },
33
+ onBlur: () => {
34
+ focused = false;
35
+ clear();
36
+ },
37
+ onKeyDown: (event) => {
38
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
39
+ return;
40
+ const indices = order();
41
+ if (!indices.length)
42
+ return;
43
+ const position = index === null ? -1 : indices.indexOf(index);
44
+ let next;
45
+ switch (event.key) {
46
+ case 'ArrowRight':
47
+ case 'ArrowDown':
48
+ next = Math.min(position + 1, indices.length - 1);
49
+ break;
50
+ case 'ArrowLeft':
51
+ case 'ArrowUp':
52
+ next = Math.max(position - 1, 0);
53
+ break;
54
+ case 'Home':
55
+ next = 0;
56
+ break;
57
+ case 'End':
58
+ next = indices.length - 1;
59
+ break;
60
+ case 'Escape':
61
+ event.preventDefault();
62
+ clear();
63
+ return;
64
+ default:
65
+ return;
66
+ }
67
+ event.preventDefault();
68
+ select(indices[next]);
69
+ },
70
+ refresh: () => {
71
+ clear();
72
+ if (focused)
73
+ select(order()[0]);
74
+ },
75
+ };
76
+ }
@@ -0,0 +1,239 @@
1
+ import { addDays, format as formatDate, formatISO, isAfter, isBefore, isSameDay, isValid as isValidDate, } from "date-fns";
2
+ import { loc } from "../index";
3
+ const defaultDisplayFormat = 'MM/DD/YYYY';
4
+ const supportedDisplayFormats = [
5
+ defaultDisplayFormat,
6
+ 'DD/MM/YYYY',
7
+ 'MM-DD-YYYY',
8
+ 'DD-MM-YYYY',
9
+ 'YYYY-MM-DD',
10
+ ];
11
+ const defaultDatePickerStringKeys = {
12
+ 'Choose a date': 'tecton.element.datePicker.calendarLabel',
13
+ 'Dates are shown in your local time zone.': 'tecton.element.datePicker.disclaimer.localTimeZone',
14
+ };
15
+ const isoDatePattern = /^\d{4}-\d{2}-\d{2}$/;
16
+ const isoLikeDatePattern = /^(\d{4})-(\d{1,2})-(\d{1,2})(?:T.*)?$/;
17
+ const slashDatePattern = /^(\d{1,2})\/(\d{1,2})\/(\d{2}|\d{4})$/;
18
+ /** Determines a year for a month and day when typeable input omits the year. */
19
+ export function buildInputDate(input, assume) {
20
+ const [month, day, year] = input.split('/');
21
+ if (!month)
22
+ return;
23
+ if (!day)
24
+ return new Date(new Date().getFullYear(), Number(month) - 1, 1);
25
+ if (Number(day) <= 0)
26
+ return;
27
+ const selectedYear = (year === null || year === void 0 ? void 0 : year.length) === 4 ? Number(year) : Number(assumeYear(month, day, assume));
28
+ const date = new Date(selectedYear, Number(month) - 1, Number(day));
29
+ return isValidDate(date) ? date : undefined;
30
+ }
31
+ /** Formats a valid date as an ISO calendar date. */
32
+ export function formatDateISO(value) {
33
+ if (!isValidDate(value))
34
+ return;
35
+ return formatISO(value, { representation: 'date' });
36
+ }
37
+ /** Formats a date for an accessible day label. */
38
+ export function formatDateFull(value) {
39
+ if (!isValidDate(value))
40
+ return;
41
+ return new Intl.DateTimeFormat('en-US', {
42
+ month: 'long',
43
+ day: 'numeric',
44
+ year: 'numeric',
45
+ weekday: 'long',
46
+ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
47
+ }).format(value);
48
+ }
49
+ /** Returns localized abbreviated day names beginning with Sunday. */
50
+ export function getDays() {
51
+ return [
52
+ loc('tecton.element.calendar.days.short.Sunday'),
53
+ loc('tecton.element.calendar.days.short.Monday'),
54
+ loc('tecton.element.calendar.days.short.Tuesday'),
55
+ loc('tecton.element.calendar.days.short.Wednesday'),
56
+ loc('tecton.element.calendar.days.short.Thursday'),
57
+ loc('tecton.element.calendar.days.short.Friday'),
58
+ loc('tecton.element.calendar.days.short.Saturday'),
59
+ ];
60
+ }
61
+ /** Returns localized full day names beginning with Sunday. */
62
+ export function getDaysOfWeek() {
63
+ return [
64
+ loc('tecton.element.calendar.days.Sunday'),
65
+ loc('tecton.element.calendar.days.Monday'),
66
+ loc('tecton.element.calendar.days.Tuesday'),
67
+ loc('tecton.element.calendar.days.Wednesday'),
68
+ loc('tecton.element.calendar.days.Thursday'),
69
+ loc('tecton.element.calendar.days.Friday'),
70
+ loc('tecton.element.calendar.days.Saturday'),
71
+ ];
72
+ }
73
+ /** Parses the date picker's public ISO-only value contract. */
74
+ export function parseDatePickerValue(value) {
75
+ if (!value || !isoDatePattern.test(value))
76
+ return;
77
+ const [year, month, day] = value.split('-').map(Number);
78
+ return dateFromParts(year, month, day);
79
+ }
80
+ /** Normalizes a legacy string or Moment-like value for the date picker's ISO-only calendar. */
81
+ export function normalizeDatePickerValue(value) {
82
+ if (!value)
83
+ return;
84
+ let date;
85
+ if (value instanceof Date) {
86
+ date = value;
87
+ }
88
+ else if (isMomentLike(value)) {
89
+ try {
90
+ date = value.toDate();
91
+ }
92
+ catch (_a) {
93
+ return;
94
+ }
95
+ }
96
+ else {
97
+ const input = value.trim();
98
+ if (!input)
99
+ return;
100
+ date = parseDatePickerValue(input);
101
+ if (!date) {
102
+ const isoLikeParts = input.match(isoLikeDatePattern);
103
+ const slashParts = input.match(slashDatePattern);
104
+ if (isoLikeParts) {
105
+ date = dateFromParts(Number(isoLikeParts[1]), Number(isoLikeParts[2]), Number(isoLikeParts[3]));
106
+ }
107
+ else if (slashParts) {
108
+ const parsedYear = Number(slashParts[3]);
109
+ const year = parsedYear < 100 ? (parsedYear >= 69 ? 1900 : 2000) + parsedYear : parsedYear;
110
+ date = dateFromParts(year, Number(slashParts[1]), Number(slashParts[2]));
111
+ }
112
+ else {
113
+ const parsedDate = new Date(input);
114
+ date = isValidDate(parsedDate)
115
+ ? dateFromParts(parsedDate.getFullYear(), parsedDate.getMonth() + 1, parsedDate.getDate())
116
+ : undefined;
117
+ }
118
+ }
119
+ }
120
+ return formatDateISO(date);
121
+ }
122
+ /** Returns the month and year used to initialize the date picker grid. */
123
+ export function setupMonthYear(value = new Date()) {
124
+ return {
125
+ monthIndex: value.getMonth(),
126
+ selectedYear: value.getFullYear(),
127
+ };
128
+ }
129
+ /** Returns the enabled day indexes represented by a calendar checksum. */
130
+ export function getValidDaysOfWeek(checksum = 127) {
131
+ const validDays = [];
132
+ for (let day = 0; day < 7; day++) {
133
+ if (checksum & (1 << day))
134
+ validDays.push(day);
135
+ }
136
+ return checksum > 0 ? validDays : [];
137
+ }
138
+ /** Determines whether a date satisfies the configured bounds and cutoff. */
139
+ export function baseValidation(dateValidators, now, newDate) {
140
+ const isNewDateBeforeStartDate = isAfter(dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.startDate, newDate);
141
+ const isNewDateAfterEndDate = isBefore(dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.endDate, newDate);
142
+ const isNowAfterCutoffTime = isSameDay(now, newDate) && isAfter(now, dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.cutOffTime);
143
+ return !(isNewDateBeforeStartDate || isNowAfterCutoffTime || isNewDateAfterEndDate);
144
+ }
145
+ /** Determines whether a date's weekday is enabled. */
146
+ export function validateAgainstChecksum(validDaysOfWeek, date) {
147
+ return validDaysOfWeek.includes(date.getDay());
148
+ }
149
+ /** Determines whether a date is absent from a blacklist. */
150
+ export function validateAgainstBlacklist(invalidDates, date) {
151
+ return !validateAgainstWhitelist(invalidDates, date);
152
+ }
153
+ /** Determines whether a date is present in a whitelist. */
154
+ export function validateAgainstWhitelist(validDates, date) {
155
+ return validDates.some(validDate => isSameDay(validDate, date));
156
+ }
157
+ function assumeYear(month, day, assume) {
158
+ const monthDay = `${month.padStart(2, '0')}/${day.padStart(2, '0')}`;
159
+ const now = new Date();
160
+ const currentMonthDay = `${now.getMonth() + 1}`.padStart(2, '0') + `/${now.getDate()}`.padStart(2, '0');
161
+ let year = now.getFullYear();
162
+ if (assume === 'future' && currentMonthDay > monthDay)
163
+ year++;
164
+ if (assume === 'past' && currentMonthDay < monthDay)
165
+ year--;
166
+ return `${year}`;
167
+ }
168
+ function parseDatePickerValues(values) {
169
+ return (values || []).map(parseDatePickerValue).filter((date) => !!date);
170
+ }
171
+ function dateFromParts(year, month, day) {
172
+ const date = new Date(0);
173
+ date.setFullYear(year, month - 1, day);
174
+ date.setHours(0, 0, 0, 0);
175
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day)
176
+ return;
177
+ return date;
178
+ }
179
+ function isMomentLike(value) {
180
+ return typeof value !== 'string' && typeof (value === null || value === void 0 ? void 0 : value.toDate) === 'function';
181
+ }
182
+ /** Formats a date using one of the date picker's supported numeric display formats. */
183
+ export function formatDisplayDate(date, displayFormat) {
184
+ const separator = displayFormat.includes('-') ? '-' : '/';
185
+ const month = `${date.getMonth() + 1}`.padStart(2, '0');
186
+ const day = `${date.getDate()}`.padStart(2, '0');
187
+ const year = `${date.getFullYear()}`;
188
+ const dateParts = displayFormat.startsWith('YYYY')
189
+ ? [year, month, day]
190
+ : displayFormat.startsWith('DD')
191
+ ? [day, month, year]
192
+ : [month, day, year];
193
+ return dateParts.join(separator);
194
+ }
195
+ /** Formats a date using the legacy Moment-style tokens accepted by q2-calendar. */
196
+ export function formatLegacyDisplayDate(date, displayFormat) {
197
+ const dateFnsFormat = displayFormat
198
+ .replace(/[d]/g, 'E')
199
+ .replace(/[D]/g, 'd')
200
+ .replace(/[Y]/g, 'y')
201
+ .replace(/[l]/g, 'P')
202
+ .replace(/[W]/g, 'I');
203
+ return formatDate(date, dateFnsFormat);
204
+ }
205
+ /** Determines whether a date satisfies every configured selection constraint. */
206
+ export function isDateSelectable(date, constraints) {
207
+ const cutoffTime = new Date(constraints.cutoffTime || '');
208
+ const withinBounds = baseValidation({
209
+ startDate: parseDatePickerValue(constraints.startDate),
210
+ endDate: parseDatePickerValue(constraints.endDate),
211
+ cutOffTime: isValidDate(cutoffTime) ? cutoffTime : undefined,
212
+ }, new Date(), date);
213
+ const validDates = parseDatePickerValues(constraints.validDates);
214
+ const matchesAllowedDates = (validDates === null || validDates === void 0 ? void 0 : validDates.length)
215
+ ? validateAgainstWhitelist(validDates, date)
216
+ : validateAgainstChecksum(getValidDaysOfWeek(constraints.daysOfWeekChecksum), date);
217
+ return (withinBounds &&
218
+ matchesAllowedDates &&
219
+ validateAgainstBlacklist(parseDatePickerValues(constraints.invalidDates), date));
220
+ }
221
+ /** Determines whether every date in an inclusive range is selectable. */
222
+ export function isRangeSelectable(start, end, constraints) {
223
+ for (let date = start; date.getTime() <= end.getTime(); date = addDays(date, 1)) {
224
+ if (!isDateSelectable(date, constraints))
225
+ return false;
226
+ }
227
+ return true;
228
+ }
229
+ /** Resolves a date-picker localization key or mapped default string. */
230
+ export function localizeDatePickerString(value, substitutions = {}) {
231
+ if (!value)
232
+ return '';
233
+ return loc(defaultDatePickerStringKeys[value] || value, substitutions);
234
+ }
235
+ /** Returns a supported display format, falling back to the date-picker default. */
236
+ export function normalizeDisplayFormat(displayFormat) {
237
+ const normalizedFormat = displayFormat === null || displayFormat === void 0 ? void 0 : displayFormat.toUpperCase();
238
+ return supportedDisplayFormats.includes(normalizedFormat) ? normalizedFormat : defaultDisplayFormat;
239
+ }
@@ -336,7 +336,7 @@ export const resizeIframe = () => {
336
336
  // Handling color attribute (deprecated)
337
337
  export const handleColor = (target) => {
338
338
  if (!target.intent && ['primary', 'secondary'].includes(target.color)) {
339
- target.intent = `workflow-${target.color}`;
339
+ target.intent = target.color;
340
340
  target.color = undefined;
341
341
  }
342
342
  };