@vonage/vivid 4.16.2 → 4.18.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 (447) hide show
  1. package/custom-elements.json +8857 -5894
  2. package/date-time-picker/index.cjs +5 -0
  3. package/date-time-picker/index.js +3 -0
  4. package/dial-pad/index.cjs +1 -1
  5. package/dial-pad/index.js +1 -1
  6. package/dialog/index.cjs +1 -1
  7. package/dialog/index.js +1 -1
  8. package/divider/index.cjs +1 -1
  9. package/divider/index.js +1 -1
  10. package/elevation/index.cjs +1 -1
  11. package/elevation/index.js +1 -1
  12. package/empty-state/index.cjs +1 -1
  13. package/empty-state/index.js +1 -1
  14. package/fab/index.cjs +1 -1
  15. package/fab/index.js +1 -1
  16. package/file-picker/index.cjs +1 -1
  17. package/file-picker/index.js +1 -1
  18. package/header/index.cjs +1 -1
  19. package/header/index.js +1 -1
  20. package/icon/index.cjs +1 -1
  21. package/icon/index.js +1 -1
  22. package/index.cjs +198 -87
  23. package/index.js +66 -60
  24. package/layout/index.cjs +1 -1
  25. package/layout/index.js +1 -1
  26. package/lib/accordion/definition.d.ts +2 -0
  27. package/lib/accordion-item/definition.d.ts +2 -0
  28. package/lib/action-group/action-group.d.ts +449 -3
  29. package/lib/action-group/definition.d.ts +2 -0
  30. package/lib/alert/definition.d.ts +2 -0
  31. package/lib/audio-player/definition.d.ts +2 -0
  32. package/lib/avatar/definition.d.ts +2 -0
  33. package/lib/badge/definition.d.ts +2 -0
  34. package/lib/banner/banner.d.ts +449 -3
  35. package/lib/banner/definition.d.ts +2 -0
  36. package/lib/breadcrumb/definition.d.ts +2 -0
  37. package/lib/breadcrumb-item/breadcrumb-item.d.ts +449 -1
  38. package/lib/breadcrumb-item/definition.d.ts +2 -0
  39. package/lib/button/definition.d.ts +2 -0
  40. package/lib/calendar/calendar.d.ts +2 -0
  41. package/lib/calendar/definition.d.ts +2 -0
  42. package/lib/calendar-event/definition.d.ts +2 -0
  43. package/lib/card/definition.d.ts +2 -0
  44. package/lib/checkbox/checkbox.d.ts +449 -4
  45. package/lib/checkbox/definition.d.ts +2 -0
  46. package/lib/combobox/definition.d.ts +2 -0
  47. package/lib/components.d.ts +2 -0
  48. package/lib/data-grid/definition.d.ts +4 -0
  49. package/lib/date-picker/date-picker.d.ts +2182 -4
  50. package/lib/date-picker/date-picker.template.d.ts +2 -0
  51. package/lib/date-picker/definition.d.ts +2 -0
  52. package/lib/date-range-picker/date-range-picker.d.ts +1110 -4
  53. package/lib/date-range-picker/date-range-picker.template.d.ts +2 -0
  54. package/lib/date-range-picker/definition.d.ts +2 -0
  55. package/lib/date-time-picker/date-time-picker.d.ts +2175 -0
  56. package/lib/date-time-picker/date-time-picker.template.d.ts +2 -0
  57. package/lib/date-time-picker/definition.d.ts +1 -0
  58. package/lib/date-time-picker/locale.d.ts +9 -0
  59. package/lib/dial-pad/definition.d.ts +2 -0
  60. package/lib/dialog/definition.d.ts +2 -0
  61. package/lib/dialog/dialog.d.ts +449 -2
  62. package/lib/divider/definition.d.ts +2 -0
  63. package/lib/divider/divider.d.ts +448 -1
  64. package/lib/empty-state/definition.d.ts +2 -0
  65. package/lib/enums.d.ts +6 -0
  66. package/lib/fab/definition.d.ts +2 -0
  67. package/lib/file-picker/definition.d.ts +2 -0
  68. package/lib/header/definition.d.ts +2 -0
  69. package/lib/icon/definition.d.ts +2 -0
  70. package/lib/layout/definition.d.ts +2 -0
  71. package/lib/menu/definition.d.ts +2 -0
  72. package/lib/menu/menu.d.ts +900 -5
  73. package/lib/menu-item/definition.d.ts +2 -0
  74. package/lib/nav/definition.d.ts +2 -0
  75. package/lib/nav-disclosure/definition.d.ts +2 -0
  76. package/lib/nav-disclosure/nav-disclosure.d.ts +449 -2
  77. package/lib/nav-item/definition.d.ts +2 -0
  78. package/lib/note/definition.d.ts +2 -0
  79. package/lib/number-field/definition.d.ts +2 -0
  80. package/lib/number-field/number-field.d.ts +450 -3
  81. package/lib/option/definition.d.ts +2 -0
  82. package/lib/option/option.d.ts +1 -11
  83. package/lib/pagination/definition.d.ts +2 -0
  84. package/lib/popup/definition.d.ts +0 -1
  85. package/lib/popup/popup.d.ts +25 -0
  86. package/lib/progress/definition.d.ts +2 -0
  87. package/lib/progress/progress.d.ts +449 -2
  88. package/lib/progress-ring/definition.d.ts +2 -0
  89. package/lib/progress-ring/progress-ring.d.ts +449 -2
  90. package/lib/radio/definition.d.ts +2 -0
  91. package/lib/radio-group/definition.d.ts +2 -0
  92. package/lib/range-slider/definition.d.ts +2 -0
  93. package/lib/rich-text-editor/definition.d.ts +2 -0
  94. package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +2 -0
  95. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +8 -0
  96. package/lib/rich-text-editor/rich-text-editor.d.ts +16 -0
  97. package/lib/rich-text-editor/rich-text-editor.template.d.ts +4 -0
  98. package/lib/searchable-select/definition.d.ts +2 -0
  99. package/lib/select/definition.d.ts +2 -0
  100. package/lib/select/select.d.ts +1 -5
  101. package/lib/selectable-box/definition.d.ts +2 -0
  102. package/lib/selectable-box/selectable-box.d.ts +449 -2
  103. package/lib/side-drawer/definition.d.ts +2 -0
  104. package/lib/slider/definition.d.ts +2 -0
  105. package/lib/slider/slider.d.ts +449 -3
  106. package/lib/split-button/definition.d.ts +2 -0
  107. package/lib/split-button/split-button.d.ts +449 -3
  108. package/lib/switch/definition.d.ts +2 -0
  109. package/lib/switch/switch.d.ts +449 -2
  110. package/lib/tab/definition.d.ts +2 -0
  111. package/lib/tab-panel/definition.d.ts +2 -0
  112. package/lib/tabs/definition.d.ts +2 -0
  113. package/lib/tag/definition.d.ts +2 -0
  114. package/lib/tag-group/definition.d.ts +2 -0
  115. package/lib/tag-group/tag-group.d.ts +449 -2
  116. package/lib/text-anchor/text-anchor.d.ts +449 -1
  117. package/lib/text-area/definition.d.ts +2 -0
  118. package/lib/text-area/text-area.d.ts +450 -3
  119. package/lib/text-field/definition.d.ts +2 -0
  120. package/lib/text-field/text-field.d.ts +450 -7
  121. package/lib/time-picker/definition.d.ts +2 -0
  122. package/lib/time-picker/locale.d.ts +0 -2
  123. package/lib/time-picker/time-picker.d.ts +1053 -9
  124. package/lib/time-picker/time-picker.template.d.ts +2 -2
  125. package/lib/toggletip/definition.d.ts +2 -0
  126. package/lib/toggletip/toggletip.d.ts +454 -4
  127. package/lib/tooltip/definition.d.ts +2 -0
  128. package/lib/tooltip/tooltip.d.ts +454 -4
  129. package/lib/tree-item/definition.d.ts +2 -0
  130. package/lib/tree-view/definition.d.ts +2 -0
  131. package/lib/video-player/definition.d.ts +2 -0
  132. package/locales/de-DE.cjs +29 -5
  133. package/locales/de-DE.js +29 -5
  134. package/locales/en-GB.cjs +29 -5
  135. package/locales/en-GB.js +29 -5
  136. package/locales/en-US.cjs +29 -5
  137. package/locales/en-US.js +29 -5
  138. package/locales/ja-JP.cjs +29 -5
  139. package/locales/ja-JP.js +29 -5
  140. package/locales/zh-CN.cjs +29 -5
  141. package/locales/zh-CN.js +29 -5
  142. package/menu/index.cjs +1 -1
  143. package/menu/index.js +1 -1
  144. package/menu-item/index.cjs +1 -1
  145. package/menu-item/index.js +1 -1
  146. package/nav/index.cjs +1 -1
  147. package/nav/index.js +1 -1
  148. package/nav-disclosure/index.cjs +1 -1
  149. package/nav-disclosure/index.js +1 -1
  150. package/nav-item/index.cjs +1 -1
  151. package/nav-item/index.js +1 -1
  152. package/note/index.cjs +1 -1
  153. package/note/index.js +1 -1
  154. package/number-field/index.cjs +1 -1
  155. package/number-field/index.js +1 -1
  156. package/option/index.cjs +1 -1
  157. package/option/index.js +1 -1
  158. package/package.json +7 -2
  159. package/pagination/index.cjs +1 -1
  160. package/pagination/index.js +1 -1
  161. package/popup/index.cjs +1 -1
  162. package/popup/index.js +1 -1
  163. package/progress/index.cjs +1 -1
  164. package/progress/index.js +1 -1
  165. package/progress-ring/index.cjs +1 -1
  166. package/progress-ring/index.js +1 -1
  167. package/radio/index.cjs +1 -1
  168. package/radio/index.js +1 -1
  169. package/radio-group/index.cjs +1 -1
  170. package/radio-group/index.js +1 -1
  171. package/range-slider/index.cjs +1 -1
  172. package/range-slider/index.js +1 -1
  173. package/rich-text-editor/index.cjs +5 -0
  174. package/rich-text-editor/index.js +3 -0
  175. package/searchable-select/index.cjs +1 -1
  176. package/searchable-select/index.js +1 -1
  177. package/select/index.cjs +1 -1
  178. package/select/index.js +1 -1
  179. package/selectable-box/index.cjs +1 -1
  180. package/selectable-box/index.js +1 -1
  181. package/shared/Reflector.cjs +71 -0
  182. package/shared/Reflector.js +69 -0
  183. package/shared/affix.cjs +2 -4
  184. package/shared/affix.js +3 -5
  185. package/shared/anchor.cjs +0 -10
  186. package/shared/anchor.js +0 -10
  187. package/shared/anchored.cjs +12 -9
  188. package/shared/anchored.js +13 -10
  189. package/shared/aria/delegates-aria.d.ts +454 -0
  190. package/shared/base-progress.js +1 -1
  191. package/shared/breadcrumb-item.cjs +2 -1
  192. package/shared/breadcrumb-item.js +2 -1
  193. package/shared/button.cjs +2 -13
  194. package/shared/button.js +2 -13
  195. package/shared/{presentationDate.cjs → calendar-picker.template.cjs} +681 -853
  196. package/shared/{presentationDate.js → calendar-picker.template.js} +673 -848
  197. package/shared/datetime/dateTimeStr.d.ts +6 -0
  198. package/shared/datetime/presentationDate.d.ts +4 -0
  199. package/shared/{date-picker/calendar → datetime}/presentationDateRange.d.ts +3 -3
  200. package/shared/datetime/presentationDateTime.d.ts +4 -0
  201. package/{lib/time-picker/time → shared/datetime}/time.d.ts +1 -0
  202. package/shared/definition.cjs +1 -1
  203. package/shared/definition.js +2 -2
  204. package/shared/definition10.cjs +1 -0
  205. package/shared/definition10.js +2 -2
  206. package/shared/definition11.cjs +9 -12
  207. package/shared/definition11.js +10 -13
  208. package/shared/definition12.cjs +1 -1
  209. package/shared/definition12.js +2 -2
  210. package/shared/definition13.cjs +15 -2
  211. package/shared/definition13.js +16 -4
  212. package/shared/definition14.cjs +4 -3
  213. package/shared/definition14.js +5 -5
  214. package/shared/definition15.cjs +4 -11
  215. package/shared/definition15.js +5 -12
  216. package/shared/definition16.cjs +44 -48
  217. package/shared/definition16.js +32 -36
  218. package/shared/definition17.cjs +4 -1
  219. package/shared/definition17.js +3 -3
  220. package/shared/definition18.cjs +59 -94
  221. package/shared/definition18.js +58 -93
  222. package/shared/definition19.cjs +79 -43
  223. package/shared/definition19.js +60 -24
  224. package/shared/definition2.cjs +1 -0
  225. package/shared/definition2.js +2 -2
  226. package/shared/definition20.cjs +253 -219
  227. package/shared/definition20.js +254 -220
  228. package/shared/definition21.cjs +201 -286
  229. package/shared/definition21.js +199 -285
  230. package/shared/definition22.cjs +302 -31
  231. package/shared/definition22.js +301 -30
  232. package/shared/definition23.cjs +37 -57
  233. package/shared/definition23.js +36 -57
  234. package/shared/definition24.cjs +50 -69
  235. package/shared/definition24.js +49 -69
  236. package/shared/definition25.cjs +75 -2475
  237. package/shared/definition25.js +74 -2475
  238. package/shared/definition26.cjs +2480 -49
  239. package/shared/definition26.js +2480 -49
  240. package/shared/definition27.cjs +53 -271
  241. package/shared/definition27.js +52 -269
  242. package/shared/definition28.cjs +271 -47
  243. package/shared/definition28.js +269 -47
  244. package/shared/definition29.cjs +37 -772
  245. package/shared/definition29.js +36 -767
  246. package/shared/definition3.cjs +3 -9
  247. package/shared/definition3.js +4 -11
  248. package/shared/definition30.cjs +739 -56
  249. package/shared/definition30.js +733 -56
  250. package/shared/definition31.cjs +93 -21
  251. package/shared/definition31.js +92 -21
  252. package/shared/definition32.cjs +28 -9
  253. package/shared/definition32.js +27 -9
  254. package/shared/definition33.cjs +10 -51
  255. package/shared/definition33.js +9 -51
  256. package/shared/definition34.cjs +31 -412
  257. package/shared/definition34.js +31 -413
  258. package/shared/definition35.cjs +423 -53
  259. package/shared/definition35.js +424 -54
  260. package/shared/definition36.cjs +53 -215
  261. package/shared/definition36.js +53 -215
  262. package/shared/definition37.cjs +202 -72
  263. package/shared/definition37.js +201 -71
  264. package/shared/definition38.cjs +54 -48
  265. package/shared/definition38.js +53 -48
  266. package/shared/definition39.cjs +57 -262
  267. package/shared/definition39.js +56 -262
  268. package/shared/definition4.cjs +4 -3
  269. package/shared/definition4.js +5 -5
  270. package/shared/definition40.cjs +220 -148
  271. package/shared/definition40.js +220 -148
  272. package/shared/definition41.cjs +144 -568
  273. package/shared/definition41.js +144 -569
  274. package/shared/definition42.cjs +476 -967
  275. package/shared/definition42.js +477 -969
  276. package/shared/definition43.cjs +13508 -851
  277. package/shared/definition43.js +13508 -851
  278. package/shared/definition44.cjs +1111 -103
  279. package/shared/definition44.js +1112 -103
  280. package/shared/definition45.cjs +849 -80
  281. package/shared/definition45.js +849 -80
  282. package/shared/definition46.cjs +108 -464
  283. package/shared/definition46.js +107 -463
  284. package/shared/definition47.cjs +96 -118
  285. package/shared/definition47.js +95 -118
  286. package/shared/definition48.cjs +430 -82
  287. package/shared/definition48.js +430 -83
  288. package/shared/definition49.cjs +135 -15
  289. package/shared/definition49.js +134 -15
  290. package/shared/definition5.cjs +5 -4
  291. package/shared/definition5.js +6 -6
  292. package/shared/definition50.cjs +109 -85
  293. package/shared/definition50.js +108 -85
  294. package/shared/definition51.cjs +14 -519
  295. package/shared/definition51.js +13 -519
  296. package/shared/definition52.cjs +96 -23
  297. package/shared/definition52.js +95 -23
  298. package/shared/definition53.cjs +480 -99
  299. package/shared/definition53.js +479 -99
  300. package/shared/definition54.cjs +24 -296
  301. package/shared/definition54.js +23 -296
  302. package/shared/definition55.cjs +126 -69
  303. package/shared/definition55.js +125 -69
  304. package/shared/definition56.cjs +186 -775
  305. package/shared/definition56.js +187 -776
  306. package/shared/definition57.cjs +511 -107
  307. package/shared/definition57.js +511 -107
  308. package/shared/definition58.cjs +27 -128
  309. package/shared/definition58.js +27 -128
  310. package/shared/definition59.cjs +106 -162
  311. package/shared/definition59.js +105 -160
  312. package/shared/definition6.cjs +3 -2
  313. package/shared/definition6.js +4 -4
  314. package/shared/definition60.cjs +81 -252
  315. package/shared/definition60.js +80 -252
  316. package/shared/definition61.cjs +156 -70156
  317. package/shared/definition61.js +154 -70156
  318. package/shared/definition62.cjs +271 -29
  319. package/shared/definition62.js +270 -28
  320. package/shared/definition63.cjs +69236 -2018
  321. package/shared/definition63.js +69235 -2016
  322. package/shared/definition64.cjs +55 -0
  323. package/shared/definition64.js +51 -0
  324. package/shared/definition65.cjs +2195 -0
  325. package/shared/definition65.js +2190 -0
  326. package/shared/definition7.cjs +3 -2
  327. package/shared/definition7.js +4 -4
  328. package/shared/definition8.cjs +5 -10
  329. package/shared/definition8.js +6 -12
  330. package/shared/definition9.cjs +2 -2
  331. package/shared/definition9.js +3 -3
  332. package/shared/delegates-aria.cjs +69 -0
  333. package/shared/delegates-aria.js +67 -0
  334. package/shared/enums.cjs +8 -0
  335. package/shared/enums.js +8 -1
  336. package/shared/form-elements.cjs +8 -8
  337. package/shared/form-elements.js +9 -9
  338. package/shared/foundation/anchor/anchor.d.ts +0 -8
  339. package/shared/foundation/button/button.d.ts +449 -7
  340. package/shared/foundation/listbox/listbox.d.ts +0 -9
  341. package/shared/foundation/vivid-element/vivid-element.d.ts +1 -0
  342. package/shared/listbox.cjs +4 -30
  343. package/shared/listbox.js +4 -30
  344. package/shared/localization/Locale.d.ts +6 -2
  345. package/shared/option.cjs +1 -38
  346. package/shared/option.js +1 -38
  347. package/shared/patterns/anchored.d.ts +891 -10
  348. package/shared/patterns/trapped-focus.d.ts +2 -0
  349. package/shared/picker-field/locale.d.ts +4 -0
  350. package/shared/picker-field/mixins/calendar-picker.d.ts +558 -0
  351. package/shared/{date-picker/locale.d.ts → picker-field/mixins/calendar-picker.locale.d.ts} +1 -3
  352. package/shared/picker-field/mixins/calendar-picker.template.d.ts +555 -0
  353. package/shared/picker-field/mixins/calendar-segments/calendarGrid.d.ts +17 -0
  354. package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/monthPickerGrid.d.ts +3 -3
  355. package/shared/picker-field/mixins/inline-time-picker/columns.d.ts +13 -0
  356. package/shared/picker-field/mixins/inline-time-picker/definition.d.ts +1 -0
  357. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +15 -0
  358. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.template.d.ts +5 -0
  359. package/{lib/time-picker/time/picker.d.ts → shared/picker-field/mixins/inline-time-picker/picker-option.d.ts} +1 -1
  360. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1110 -0
  361. package/shared/picker-field/mixins/single-date-picker.d.ts +1626 -0
  362. package/shared/picker-field/mixins/single-value-picker.d.ts +518 -0
  363. package/shared/picker-field/mixins/time-selection-picker.d.ts +1053 -0
  364. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +1050 -0
  365. package/shared/picker-field/picker-field.d.ts +11 -0
  366. package/shared/picker-field/picker-field.form-associated.d.ts +11 -0
  367. package/shared/picker-field/picker-field.template.d.ts +7 -0
  368. package/shared/picker-field.template.cjs +315 -0
  369. package/shared/picker-field.template.js +310 -0
  370. package/shared/single-date-picker.cjs +46 -0
  371. package/shared/single-date-picker.js +44 -0
  372. package/shared/single-value-picker.cjs +77 -0
  373. package/shared/single-value-picker.js +75 -0
  374. package/shared/slider.template.cjs +6 -6
  375. package/shared/slider.template.js +6 -6
  376. package/shared/text-anchor.cjs +2 -1
  377. package/shared/text-anchor.js +2 -1
  378. package/shared/text-anchor.template.cjs +5 -7
  379. package/shared/text-anchor.template.js +5 -7
  380. package/shared/time-selection-picker.template.cjs +776 -0
  381. package/shared/time-selection-picker.template.js +767 -0
  382. package/shared/utils/mixins.d.ts +3 -0
  383. package/shared/vivid-element.cjs +3 -0
  384. package/shared/vivid-element.js +4 -1
  385. package/side-drawer/index.cjs +1 -1
  386. package/side-drawer/index.js +1 -1
  387. package/slider/index.cjs +1 -1
  388. package/slider/index.js +1 -1
  389. package/split-button/index.cjs +1 -1
  390. package/split-button/index.js +1 -1
  391. package/styles/core/all.css +1 -1
  392. package/styles/core/theme.css +1 -1
  393. package/styles/core/typography.css +1 -1
  394. package/styles/tokens/theme-dark.css +4 -4
  395. package/styles/tokens/theme-light.css +4 -4
  396. package/styles/tokens/vivid-2-compat.css +1 -1
  397. package/switch/index.cjs +1 -1
  398. package/switch/index.js +1 -1
  399. package/tab/index.cjs +1 -1
  400. package/tab/index.js +1 -1
  401. package/tab-panel/index.cjs +1 -1
  402. package/tab-panel/index.js +1 -1
  403. package/tabs/index.cjs +1 -1
  404. package/tabs/index.js +1 -1
  405. package/tag/index.cjs +1 -1
  406. package/tag/index.js +1 -1
  407. package/tag-group/index.cjs +1 -1
  408. package/tag-group/index.js +1 -1
  409. package/text-anchor/index.cjs +1 -1
  410. package/text-anchor/index.js +2 -2
  411. package/text-area/index.cjs +1 -1
  412. package/text-area/index.js +1 -1
  413. package/text-field/index.cjs +1 -1
  414. package/text-field/index.js +1 -1
  415. package/time-picker/index.cjs +1 -1
  416. package/time-picker/index.js +1 -1
  417. package/toggletip/index.cjs +1 -1
  418. package/toggletip/index.js +1 -1
  419. package/tooltip/index.cjs +1 -1
  420. package/tooltip/index.js +1 -1
  421. package/tree-item/index.cjs +1 -1
  422. package/tree-item/index.js +1 -1
  423. package/tree-view/index.cjs +1 -1
  424. package/tree-view/index.js +1 -1
  425. package/video-player/index.cjs +1 -1
  426. package/video-player/index.js +1 -1
  427. package/vivid.api.json +21748 -1
  428. package/lib/time-picker/time-picker.form-associated.d.ts +0 -11
  429. package/shared/aria-global.cjs +0 -93
  430. package/shared/aria-global.js +0 -91
  431. package/shared/date-picker/calendar/calendarGrid.d.ts +0 -17
  432. package/shared/date-picker/calendar/presentationDate.d.ts +0 -4
  433. package/shared/date-picker/date-picker-base.d.ts +0 -21
  434. package/shared/date-picker/date-picker-base.form-associated.d.ts +0 -11
  435. package/shared/date-picker/date-picker-base.template.d.ts +0 -3
  436. package/shared/foundation/patterns/aria-global.d.ts +0 -21
  437. package/shared/foundation/patterns/index.d.ts +0 -1
  438. package/shared/text-field2.cjs +0 -575
  439. package/shared/text-field2.js +0 -572
  440. package/shared/trapped-focus.cjs +0 -29
  441. package/shared/trapped-focus.js +0 -27
  442. /package/shared/{date-picker/calendar → datetime}/dateRange.d.ts +0 -0
  443. /package/shared/{date-picker/calendar → datetime}/dateStr.d.ts +0 -0
  444. /package/shared/{date-picker/calendar → datetime}/month.d.ts +0 -0
  445. /package/{lib/time-picker/time → shared/datetime}/presentationTime.d.ts +0 -0
  446. /package/shared/{date-picker/calendar → datetime}/year.d.ts +0 -0
  447. /package/shared/{date-picker/calendar → picker-field/mixins/calendar-segments}/segment.d.ts +0 -0
@@ -1,21 +1,11 @@
1
+ import { o as observable, v as volatile, D as DOM, a as attr, h as html } from './vivid-element.js';
2
+ import { D as Divider } from './definition23.js';
1
3
  import { B as Button } from './definition11.js';
2
- import { P as Popup } from './definition63.js';
3
- import { T as TextField } from './text-field2.js';
4
- import { D as Divider } from './definition22.js';
5
- import { h as html, V as VividElement, O as Observable, i as defaultExecutionContext, D as DOM, a as attr, o as observable, v as volatile } from './vivid-element.js';
6
- import { r as ref } from './ref.js';
7
- import { s as slotted } from './slotted.js';
8
4
  import { r as repeat } from './repeat.js';
9
5
  import { w as when } from './when.js';
10
6
  import { c as classNames } from './class-names.js';
11
- import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
12
- import { h as handleEscapeKeyAndStopPropogation } from './index.js';
13
- import { F as FormAssociated } from './form-associated.js';
14
- import { T as TrappedFocus } from './trapped-focus.js';
15
- import { a as FormElementHelperText } from './form-elements.js';
16
- import { L as Localized } from './localized.js';
17
7
 
18
- const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:8px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px;--focus-inset: -2px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));color:var(--vvd-color-canvas-text)}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button:disabled{cursor:not-allowed}";
8
+ const calendarStyles = ".segments{display:inline-flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:8px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px;--focus-inset: -2px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));color:var(--vvd-color-canvas-text)}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button:disabled{cursor:not-allowed}";
19
9
 
20
10
  /**
21
11
  * @name toDate
@@ -1537,8 +1527,6 @@ const lightFormatters = {
1537
1527
  };
1538
1528
 
1539
1529
  const dayPeriodEnum = {
1540
- am: "am",
1541
- pm: "pm",
1542
1530
  midnight: "midnight",
1543
1531
  noon: "noon",
1544
1532
  morning: "morning",
@@ -5478,7 +5466,7 @@ function cleanEscapedString(input) {
5478
5466
  return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
5479
5467
  }
5480
5468
 
5481
- const formatDateStr = (date) => formatISO(date, { representation: "date" });
5469
+ const formatDateStr = (date) => formatISO(date, { });
5482
5470
  const currentDateStr = (now = /* @__PURE__ */ new Date()) => formatDateStr(now);
5483
5471
  const parseDateStr = (dateStr) => {
5484
5472
  const [year, month, day] = dateStr.split("-");
@@ -5505,6 +5493,15 @@ const isValidDateStr = (string) => {
5505
5493
  return hasThreeComponents(components) && allComponentsAreNumbers(components) && isValidDate(components);
5506
5494
  };
5507
5495
 
5496
+ const formatPresentationDate = (dateStr, locale) => {
5497
+ const date = parseDateStr(dateStr);
5498
+ return format(date, locale.dateFormat);
5499
+ };
5500
+ const parsePresentationDate = (presentationDate, locale) => {
5501
+ const date = parse(presentationDate, locale.dateFormat, /* @__PURE__ */ new Date());
5502
+ return formatDateStr(date);
5503
+ };
5504
+
5508
5505
  const getCurrentMonth = (now = /* @__PURE__ */ new Date()) => ({
5509
5506
  month: now.getMonth(),
5510
5507
  year: now.getFullYear()
@@ -5522,36 +5519,564 @@ const compareMonths = (a, b) => a.year === b.year ? a.month - b.month : a.year -
5522
5519
  const areMonthsEqual = (a, b) => compareMonths(a, b) === 0;
5523
5520
  const monthToStr = ({ month, year }) => `${year.toString().padStart(4, "0")}-${(month + 1).toString().padStart(2, "0")}`;
5524
5521
 
5522
+ const yearOfDate = (dateStr) => {
5523
+ const date = parseDateStr(dateStr);
5524
+ return date.getFullYear();
5525
+ };
5526
+
5527
+ const MonthsPerRow = 4;
5528
+ const buildMonthPickerGrid = (year, locale) => {
5529
+ const grid = [];
5530
+ let row = [];
5531
+ for (let i = 0; i < 12; i++) {
5532
+ const month = { month: i, year };
5533
+ row.push({
5534
+ label: locale.months.shorthand[i],
5535
+ monthName: locale.months.name[i],
5536
+ month
5537
+ });
5538
+ if (row.length === MonthsPerRow) {
5539
+ grid.push(row);
5540
+ row = [];
5541
+ }
5542
+ }
5543
+ return grid;
5544
+ };
5545
+
5546
+ const getWeekdays = (locale) => {
5547
+ const firstDayOfWeek = locale.firstDayOfWeek;
5548
+ const localeWeekdayToNative = (day) => (day + firstDayOfWeek) % 7;
5549
+ const days = [];
5550
+ for (let i = 0; i < 7; i++) {
5551
+ days.push({
5552
+ name: locale.weekdays.name[localeWeekdayToNative(i)],
5553
+ shortName: locale.weekdays.shorthand[localeWeekdayToNative(i)]
5554
+ });
5555
+ }
5556
+ return days;
5557
+ };
5558
+ const gridDate = (date, isOutsideMonth2) => ({
5559
+ date: formatDateStr(date),
5560
+ label: `${date.getDate()}`,
5561
+ isOutsideMonth: isOutsideMonth2
5562
+ });
5563
+ function isOutsideMonth(dayIndexInMonth, daysInMonth) {
5564
+ return dayIndexInMonth < 0 || dayIndexInMonth >= daysInMonth;
5565
+ }
5566
+ const buildDateGrid = ({ month, year }, getDay) => {
5567
+ const grid = [];
5568
+ const firstDay = new Date(year, month, 1);
5569
+ const lastDay = new Date(year, month + 1, 0);
5570
+ const firstDayInWeek = getDay(firstDay);
5571
+ const daysInMonth = lastDay.getDate();
5572
+ const daysOutsideMonthInLastWeek = 7 - getDay(lastDay);
5573
+ const totalDaysInCalendar = daysInMonth + firstDayInWeek + daysOutsideMonthInLastWeek;
5574
+ let week = [];
5575
+ for (let i = 0; i < totalDaysInCalendar; i++) {
5576
+ const dayIndexInMonth = i - firstDayInWeek;
5577
+ week.push(
5578
+ gridDate(
5579
+ addDays$1(firstDay, dayIndexInMonth),
5580
+ isOutsideMonth(dayIndexInMonth, daysInMonth)
5581
+ )
5582
+ );
5583
+ if (week.length === 7) {
5584
+ grid.push(week);
5585
+ week = [];
5586
+ }
5587
+ }
5588
+ return grid;
5589
+ };
5590
+ const buildCalendarGrid = (month, locale) => {
5591
+ const { firstDayOfWeek } = locale;
5592
+ const getShiftedDay = (date) => (date.getDay() - firstDayOfWeek + 7) % 7;
5593
+ return {
5594
+ weekdays: getWeekdays(locale),
5595
+ grid: buildDateGrid(month, getShiftedDay)
5596
+ };
5597
+ };
5598
+
5599
+ var __defProp$1 = Object.defineProperty;
5600
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5601
+ var __decorateClass$1 = (decorators, target, key, kind) => {
5602
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5603
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
5604
+ if (decorator = decorators[i])
5605
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5606
+ if (kind && result) __defProp$1(target, key, result);
5607
+ return result;
5608
+ };
5609
+ const CalendarPicker = (Base) => {
5610
+ class CalendarPickerElement extends Base {
5611
+ // --- Core ---
5612
+ constructor(...args) {
5613
+ super(...args);
5614
+ this._selectedMonth = getCurrentMonth();
5615
+ /**
5616
+ * Today's date.
5617
+ * @internal
5618
+ */
5619
+ this._currentDate = currentDateStr();
5620
+ /**
5621
+ * Today's month.
5622
+ * @internal
5623
+ */
5624
+ this._currentMonth = getCurrentMonth();
5625
+ this._numCalendars = 1;
5626
+ // --- Date picker ---
5627
+ /**
5628
+ * @internal
5629
+ */
5630
+ this._hideDatesOutsideMonth = false;
5631
+ this._lastFocussedDate = null;
5632
+ this._monthPickerYear = null;
5633
+ this._lastFocussedMonth = null;
5634
+ this.value = "";
5635
+ }
5636
+ /**
5637
+ * @internal
5638
+ */
5639
+ _adjustSelectedMonthToEnsureVisibilityOf(date) {
5640
+ const month = monthOfDate(date);
5641
+ const firstDisplayedMonth = this._selectedMonth;
5642
+ const lastDisplayedMonth = addMonths(
5643
+ this._selectedMonth,
5644
+ this._numCalendars - 1
5645
+ );
5646
+ if (compareMonths(month, firstDisplayedMonth) < 0) {
5647
+ this._selectedMonth = month;
5648
+ return true;
5649
+ } else if (compareMonths(month, lastDisplayedMonth) > 0) {
5650
+ this._selectedMonth = addMonths(month, 1 - this._numCalendars);
5651
+ return true;
5652
+ }
5653
+ return false;
5654
+ }
5655
+ /**
5656
+ * @internal
5657
+ */
5658
+ _isDateInValidRange(date) {
5659
+ return (!this._resolvedMinDate || compareDateStr(date, this._resolvedMinDate) >= 0) && (!this._resolvedMaxDate || compareDateStr(date, this._resolvedMaxDate) <= 0);
5660
+ }
5661
+ #isMonthAfterValidRange(month) {
5662
+ return this._resolvedMaxDate && compareMonths(month, monthOfDate(this._resolvedMaxDate)) > 0;
5663
+ }
5664
+ #isMonthBeforeValidRange(month) {
5665
+ return this._resolvedMinDate && compareMonths(month, monthOfDate(this._resolvedMinDate)) < 0;
5666
+ }
5667
+ /**
5668
+ * @internal
5669
+ */
5670
+ _isMonthInValidRange(month) {
5671
+ return !(this.#isMonthBeforeValidRange(month) || this.#isMonthAfterValidRange(month));
5672
+ }
5673
+ /**
5674
+ * @internal
5675
+ */
5676
+ _closePopup(restoreFocusToTextField = true) {
5677
+ super._closePopup(restoreFocusToTextField);
5678
+ this._monthPickerYear = null;
5679
+ }
5680
+ /**
5681
+ * @internal
5682
+ */
5683
+ _onPickerButtonClick() {
5684
+ super._onPickerButtonClick();
5685
+ if (this._popupOpen) {
5686
+ DOM.processUpdates();
5687
+ const tabbableDate = this._tabbableDate;
5688
+ if (tabbableDate)
5689
+ this.shadowRoot.querySelector(
5690
+ `[data-date="${tabbableDate}"]`
5691
+ ).focus();
5692
+ }
5693
+ }
5694
+ // --- Calendar header ---
5695
+ /**
5696
+ * @internal
5697
+ */
5698
+ _onTitleActionClick() {
5699
+ if (this._inMonthPicker) {
5700
+ this._monthPickerYear = null;
5701
+ } else {
5702
+ this._monthPickerYear = this._selectedMonth.year;
5703
+ }
5704
+ }
5705
+ get _isPrevYearDisabled() {
5706
+ const currentYear = this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year;
5707
+ const prevYear = currentYear - 1;
5708
+ return this._resolvedMinDate && prevYear < yearOfDate(this._resolvedMinDate);
5709
+ }
5710
+ /**
5711
+ * @internal
5712
+ */
5713
+ _onPrevYearClick() {
5714
+ if (this._inMonthPicker) {
5715
+ this._monthPickerYear = this._monthPickerYear - 1;
5716
+ } else {
5717
+ this._selectedMonth = {
5718
+ year: this._selectedMonth.year - 1,
5719
+ month: this._selectedMonth.month
5720
+ };
5721
+ }
5722
+ }
5723
+ get _isNextYearDisabled() {
5724
+ const currentYear = this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year;
5725
+ const nextYear = currentYear + 1;
5726
+ return this._resolvedMaxDate && nextYear > yearOfDate(this._resolvedMaxDate);
5727
+ }
5728
+ /**
5729
+ * @internal
5730
+ */
5731
+ _onNextYearClick() {
5732
+ if (this._inMonthPicker) {
5733
+ this._monthPickerYear = this._monthPickerYear + 1;
5734
+ } else {
5735
+ this._selectedMonth = {
5736
+ year: this._selectedMonth.year + 1,
5737
+ month: this._selectedMonth.month
5738
+ };
5739
+ }
5740
+ }
5741
+ /**
5742
+ * @internal
5743
+ */
5744
+ get _isPrevMonthDisabled() {
5745
+ return this.#isMonthBeforeValidRange(addMonths(this._selectedMonth, -1));
5746
+ }
5747
+ /**
5748
+ * @internal
5749
+ */
5750
+ _onPrevMonthClick() {
5751
+ this._selectedMonth = addMonths(this._selectedMonth, -1);
5752
+ }
5753
+ /**
5754
+ * @internal
5755
+ */
5756
+ get _isNextMonthDisabled() {
5757
+ return this.#isMonthAfterValidRange(addMonths(this._selectedMonth, 1));
5758
+ }
5759
+ /**
5760
+ * @internal
5761
+ */
5762
+ _onNextMonthClick() {
5763
+ this._selectedMonth = addMonths(this._selectedMonth, 1);
5764
+ }
5765
+ /**
5766
+ * @internal
5767
+ */
5768
+ get _segments() {
5769
+ const segments = [];
5770
+ if (this._inMonthPicker) {
5771
+ segments.push({
5772
+ id: 0,
5773
+ type: "month-picker",
5774
+ title: `${this._monthPickerYear}`,
5775
+ titleClickable: true,
5776
+ prevYearButton: true,
5777
+ nextYearButton: true,
5778
+ months: buildMonthPickerGrid(
5779
+ this._monthPickerYear,
5780
+ this.locale.calendarPicker
5781
+ )
5782
+ });
5783
+ } else {
5784
+ for (let i = 0; i < this._numCalendars; i++) {
5785
+ const month = addMonths(this._selectedMonth, i);
5786
+ const isSingle = this._numCalendars === 1;
5787
+ const isFirst = i === 0;
5788
+ const isLast = i === this._numCalendars - 1;
5789
+ segments.push({
5790
+ id: i,
5791
+ type: "calendar",
5792
+ title: `${this.locale.calendarPicker.months.name[month.month]} ${month.year}`,
5793
+ titleClickable: isSingle,
5794
+ prevYearButton: isFirst && isSingle,
5795
+ prevMonthButton: isFirst,
5796
+ nextMonthButton: isLast,
5797
+ nextYearButton: isLast && isSingle,
5798
+ calendar: buildCalendarGrid(month, this.locale.calendarPicker)
5799
+ });
5800
+ }
5801
+ }
5802
+ return segments;
5803
+ }
5804
+ /**
5805
+ * @internal
5806
+ */
5807
+ _isDateSelected(_) {
5808
+ return false;
5809
+ }
5810
+ /**
5811
+ * @internal
5812
+ * @private
5813
+ */
5814
+ _isDateInSelectedRange(_) {
5815
+ return false;
5816
+ }
5817
+ /**
5818
+ * @internal
5819
+ */
5820
+ _isDateRangeStart(_) {
5821
+ return false;
5822
+ }
5823
+ /**
5824
+ * @internal
5825
+ */
5826
+ _isDateRangeEnd(_) {
5827
+ return false;
5828
+ }
5829
+ /**
5830
+ * @internal
5831
+ */
5832
+ _onDateMouseEnter(_) {
5833
+ }
5834
+ /**
5835
+ * @internal
5836
+ */
5837
+ _onDateMouseLeave(_) {
5838
+ }
5839
+ /**
5840
+ * Handle keydown on a date in the calendar.
5841
+ * @internal
5842
+ */
5843
+ _onDateKeydown(date, event) {
5844
+ let newDate = null;
5845
+ if (event.key === "ArrowUp") {
5846
+ newDate = addDays(date, -7);
5847
+ } else if (event.key === "ArrowDown") {
5848
+ newDate = addDays(date, 7);
5849
+ } else if (event.key === "ArrowLeft") {
5850
+ newDate = addDays(date, -1);
5851
+ } else if (event.key === "ArrowRight") {
5852
+ newDate = addDays(date, 1);
5853
+ }
5854
+ if (newDate && this._isDateInValidRange(newDate)) {
5855
+ if (this._adjustSelectedMonthToEnsureVisibilityOf(newDate)) {
5856
+ DOM.processUpdates();
5857
+ }
5858
+ this._dialogEl.querySelector(
5859
+ `[data-date="${newDate}"]`
5860
+ ).focus();
5861
+ return false;
5862
+ }
5863
+ return true;
5864
+ }
5865
+ /**
5866
+ * @internal
5867
+ */
5868
+ _onDateFocus(date) {
5869
+ this._lastFocussedDate = date;
5870
+ }
5871
+ get _tabbableDate() {
5872
+ const datesInSegments = this._segments.filter(
5873
+ (segment) => segment.type === "calendar"
5874
+ ).flatMap((segment) => segment.calendar.grid.flat().map((d) => d.date));
5875
+ const candidates = [
5876
+ this._lastFocussedDate,
5877
+ ...this._getSelectedDates(),
5878
+ currentDateStr(),
5879
+ ...datesInSegments
5880
+ ];
5881
+ const firstVisibleMonth = this._selectedMonth;
5882
+ const lastVisibleMonth = addMonths(
5883
+ this._selectedMonth,
5884
+ this._numCalendars - 1
5885
+ );
5886
+ return candidates.find(
5887
+ (date) => date && compareMonths(monthOfDate(date), firstVisibleMonth) >= 0 && compareMonths(monthOfDate(date), lastVisibleMonth) <= 0 && this._isDateInValidRange(date)
5888
+ ) ?? null;
5889
+ }
5890
+ /**
5891
+ * @internal
5892
+ */
5893
+ get _inMonthPicker() {
5894
+ return this._monthPickerYear !== null;
5895
+ }
5896
+ /**
5897
+ * Handle month selected in the month picker.
5898
+ * @internal
5899
+ */
5900
+ _onMonthClick(month) {
5901
+ this._selectedMonth = month;
5902
+ this._monthPickerYear = null;
5903
+ }
5904
+ /**
5905
+ * Handle keydown on a month in the month picker.
5906
+ * @internal
5907
+ */
5908
+ _onMonthKeydown(month, event) {
5909
+ let newMonth = null;
5910
+ if (event.key === "ArrowUp") {
5911
+ newMonth = addMonths(month, -4);
5912
+ } else if (event.key === "ArrowDown") {
5913
+ newMonth = addMonths(month, MonthsPerRow);
5914
+ } else if (event.key === "ArrowLeft") {
5915
+ newMonth = addMonths(month, -1);
5916
+ } else if (event.key === "ArrowRight") {
5917
+ newMonth = addMonths(month, 1);
5918
+ }
5919
+ if (newMonth && this._isMonthInValidRange(newMonth)) {
5920
+ if (newMonth.year !== this._monthPickerYear) {
5921
+ this._monthPickerYear = newMonth.year;
5922
+ DOM.processUpdates();
5923
+ }
5924
+ this._dialogEl.querySelector(
5925
+ `[data-month="${monthToStr(newMonth)}"]`
5926
+ ).focus();
5927
+ return false;
5928
+ }
5929
+ return true;
5930
+ }
5931
+ /**
5932
+ * @internal
5933
+ */
5934
+ _onMonthFocus(month) {
5935
+ this._lastFocussedMonth = month;
5936
+ }
5937
+ get _tabbableMonth() {
5938
+ const monthsInSegments = this._segments.filter(
5939
+ (segments) => segments.type === "month-picker"
5940
+ ).flatMap((segment) => segment.months.flat().map((c) => c.month));
5941
+ const candidates = [
5942
+ this._lastFocussedMonth,
5943
+ this._selectedMonth,
5944
+ getCurrentMonth(),
5945
+ ...monthsInSegments
5946
+ ];
5947
+ return candidates.find(
5948
+ (month) => month && month.year === this._monthPickerYear && this._isMonthInValidRange(month)
5949
+ ) ?? null;
5950
+ }
5951
+ }
5952
+ __decorateClass$1([
5953
+ observable
5954
+ ], CalendarPickerElement.prototype, "_selectedMonth", 2);
5955
+ __decorateClass$1([
5956
+ volatile
5957
+ ], CalendarPickerElement.prototype, "_isPrevYearDisabled", 1);
5958
+ __decorateClass$1([
5959
+ volatile
5960
+ ], CalendarPickerElement.prototype, "_isNextYearDisabled", 1);
5961
+ __decorateClass$1([
5962
+ observable
5963
+ ], CalendarPickerElement.prototype, "_numCalendars", 2);
5964
+ __decorateClass$1([
5965
+ observable
5966
+ ], CalendarPickerElement.prototype, "_lastFocussedDate", 2);
5967
+ __decorateClass$1([
5968
+ volatile
5969
+ ], CalendarPickerElement.prototype, "_tabbableDate", 1);
5970
+ __decorateClass$1([
5971
+ observable
5972
+ ], CalendarPickerElement.prototype, "_monthPickerYear", 2);
5973
+ __decorateClass$1([
5974
+ observable
5975
+ ], CalendarPickerElement.prototype, "_lastFocussedMonth", 2);
5976
+ __decorateClass$1([
5977
+ volatile
5978
+ ], CalendarPickerElement.prototype, "_tabbableMonth", 1);
5979
+ return CalendarPickerElement;
5980
+ };
5981
+
5982
+ var __defProp = Object.defineProperty;
5983
+ var __decorateClass = (decorators, target, key, kind) => {
5984
+ var result = void 0 ;
5985
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
5986
+ if (decorator = decorators[i])
5987
+ result = (decorator(target, key, result) ) || result;
5988
+ if (result) __defProp(target, key, result);
5989
+ return result;
5990
+ };
5991
+ const ValidDateFilter = {
5992
+ fromView: (value) => {
5993
+ if (value && isValidDateStr(value)) {
5994
+ return value;
5995
+ }
5996
+ return "";
5997
+ },
5998
+ toView(value) {
5999
+ return value;
6000
+ }
6001
+ };
6002
+ const MinMaxCalendarPicker = (SuperClass) => {
6003
+ class MinMaxDatePickerElement extends SuperClass {
6004
+ /**
6005
+ * @internal
6006
+ */
6007
+ minChanged(_, newMin) {
6008
+ if (this.proxy instanceof HTMLInputElement) {
6009
+ this.proxy.min = newMin;
6010
+ this.validate();
6011
+ }
6012
+ }
6013
+ /**
6014
+ * @internal
6015
+ */
6016
+ get _resolvedMinDate() {
6017
+ return this.min;
6018
+ }
6019
+ /**
6020
+ * @internal
6021
+ */
6022
+ maxChanged(_, newMax) {
6023
+ if (this.proxy instanceof HTMLInputElement) {
6024
+ this.proxy.max = newMax;
6025
+ this.validate();
6026
+ }
6027
+ }
6028
+ /**
6029
+ * The latest accepted date.
6030
+ * @internal
6031
+ */
6032
+ get _resolvedMaxDate() {
6033
+ return this.max;
6034
+ }
6035
+ constructor(...args) {
6036
+ super(...args);
6037
+ this.min = "";
6038
+ this.max = "";
6039
+ }
6040
+ }
6041
+ __decorateClass([
6042
+ attr({ converter: ValidDateFilter })
6043
+ ], MinMaxDatePickerElement.prototype, "min");
6044
+ __decorateClass([
6045
+ attr({ converter: ValidDateFilter })
6046
+ ], MinMaxDatePickerElement.prototype, "max");
6047
+ return MinMaxDatePickerElement;
6048
+ };
6049
+
5525
6050
  function renderDialogHeader(context) {
5526
6051
  const buttonTag = context.tagFor(Button);
5527
- return html`<div class="header">
6052
+ return html` <div class="header">
5528
6053
  ${when(
5529
6054
  (x) => x.prevYearButton,
5530
6055
  html`
5531
6056
  <${buttonTag}
5532
- tabindex="1"
5533
- class="vwc-button"
5534
- size="super-condensed"
5535
- icon="${(_, c) => c.parent._inMonthPicker ? "chevron-left-line" : "double-chevron-left-line"}"
5536
- aria-label="${(_, c) => c.parent.locale.datePicker.prevYearLabel}"
5537
- ?disabled="${(_, c) => c.parent._isPrevYearDisabled}"
5538
- @click="${(_, c) => c.parent._onPrevYearClick()}"
6057
+ tabindex='1'
6058
+ class='vwc-button'
6059
+ size='super-condensed'
6060
+ icon='${(_, c) => c.parent._inMonthPicker ? "chevron-left-line" : "double-chevron-left-line"}'
6061
+ aria-label='${(_, c) => c.parent.locale.calendarPicker.prevYearLabel}'
6062
+ ?disabled='${(_, c) => c.parent._isPrevYearDisabled}'
6063
+ @click='${(_, c) => c.parent._onPrevYearClick()}'
5539
6064
  ></${buttonTag}>
5540
- `
6065
+ `
5541
6066
  )}
5542
6067
  ${when(
5543
6068
  (x) => x.prevMonthButton,
5544
6069
  html`
5545
6070
  <${buttonTag}
5546
- tabindex="1"
5547
- class="vwc-button"
5548
- size="super-condensed"
5549
- icon="chevron-left-line"
5550
- aria-label="${(_, c) => c.parent.locale.datePicker.prevMonthLabel}"
5551
- ?disabled="${(_, c) => c.parent._isPrevMonthDisabled}"
5552
- @click="${(_, c) => c.parent._onPrevMonthClick()}"
6071
+ tabindex='1'
6072
+ class='vwc-button'
6073
+ size='super-condensed'
6074
+ icon='chevron-left-line'
6075
+ aria-label='${(_, c) => c.parent.locale.calendarPicker.prevMonthLabel}'
6076
+ ?disabled='${(_, c) => c.parent._isPrevMonthDisabled}'
6077
+ @click='${(_, c) => c.parent._onPrevMonthClick()}'
5553
6078
  ></${buttonTag}>
5554
- `
6079
+ `
5555
6080
  )}
5556
6081
  <div class="title">
5557
6082
  ${when(
@@ -5585,70 +6110,71 @@ function renderDialogHeader(context) {
5585
6110
  ${when(
5586
6111
  (x) => x.nextMonthButton,
5587
6112
  html`
5588
- <${buttonTag}
5589
- tabindex="1"
5590
- class="vwc-button"
5591
- size="super-condensed"
5592
- icon="chevron-right-line"
5593
- aria-label="${(_, c) => c.parent.locale.datePicker.nextMonthLabel}"
5594
- ?disabled="${(_, c) => c.parent._isNextMonthDisabled}"
5595
- @click="${(_, c) => c.parent._onNextMonthClick()}"
5596
- ></${buttonTag}>
5597
- `
6113
+ <${buttonTag}
6114
+ tabindex='1'
6115
+ class='vwc-button'
6116
+ size='super-condensed'
6117
+ icon='chevron-right-line'
6118
+ aria-label='${(_, c) => c.parent.locale.calendarPicker.nextMonthLabel}'
6119
+ ?disabled='${(_, c) => c.parent._isNextMonthDisabled}'
6120
+ @click='${(_, c) => c.parent._onNextMonthClick()}'
6121
+ ></${buttonTag}>
6122
+ `
5598
6123
  )}
5599
6124
  ${when(
5600
6125
  (x) => x.nextYearButton,
5601
6126
  html`
5602
- <${buttonTag}
5603
- tabindex="1"
5604
- class="vwc-button"
5605
- size="super-condensed"
5606
- icon="${(_, c) => c.parent._inMonthPicker ? "chevron-right-line" : "double-chevron-right-line"}"
5607
- aria-label="${(_, c) => c.parent.locale.datePicker.nextYearLabel}"
5608
- ?disabled="${(_, c) => c.parent._isNextYearDisabled}"
5609
- @click="${(_, c) => c.parent._onNextYearClick()}"
5610
- ></${buttonTag}>
5611
- `
6127
+ <${buttonTag}
6128
+ tabindex='1'
6129
+ class='vwc-button'
6130
+ size='super-condensed'
6131
+ icon='${(_, c) => c.parent._inMonthPicker ? "chevron-right-line" : "double-chevron-right-line"}'
6132
+ aria-label='${(_, c) => c.parent.locale.calendarPicker.nextYearLabel}'
6133
+ ?disabled='${(_, c) => c.parent._isNextYearDisabled}'
6134
+ @click='${(_, c) => c.parent._onNextYearClick()}'
6135
+ ></${buttonTag}>
6136
+ `
5612
6137
  )}
5613
6138
  </div>`;
5614
6139
  }
5615
6140
  function renderCalendarGrid(context) {
5616
6141
  const dividerTag = context.tagFor(Divider);
5617
- return html`<div
5618
- class="calendar"
5619
- role="grid"
5620
- aria-labelledby="${(x) => `grid-label-${x.id}`}"
5621
- >
5622
- <div class="calendar-weekdays" role="row">
5623
- ${repeat(
6142
+ return html`
6143
+ <div
6144
+ class='calendar'
6145
+ role='grid'
6146
+ aria-labelledby='${(x) => `grid-label-${x.id}`}'
6147
+ >
6148
+ <div class='calendar-weekdays' role='row'>
6149
+ ${repeat(
5624
6150
  (x) => x.calendar.weekdays,
5625
6151
  html`
5626
- <div
5627
- class="calendar-weekday"
5628
- role="columnheader"
5629
- aria-label="${(x) => x.name}"
5630
- >
5631
- ${(x) => x.shortName}
5632
- </div>
5633
- `
6152
+ <div
6153
+ class="calendar-weekday"
6154
+ role="columnheader"
6155
+ aria-label="${(x) => x.name}"
6156
+ >
6157
+ ${(x) => x.shortName}
6158
+ </div>
6159
+ `
5634
6160
  )}
5635
- </div>
5636
- <${dividerTag} class="calendar-separator" role="presentation"></${dividerTag}>
5637
- ${repeat(
6161
+ </div>
6162
+ <${dividerTag} class='calendar-separator' role='presentation'></${dividerTag}>
6163
+ ${repeat(
5638
6164
  (x) => x.calendar.grid,
5639
6165
  html` <div class="calendar-week" role="row">
5640
- ${repeat(
6166
+ ${repeat(
5641
6167
  (x) => x,
5642
6168
  html`
5643
- ${when(
6169
+ ${when(
5644
6170
  (x, c) => c.parentContext.parentContext.parent._hideDatesOutsideMonth && x.isOutsideMonth,
5645
6171
  html`<div class="calendar-day"></div>`
5646
6172
  )}
5647
- ${when(
6173
+ ${when(
5648
6174
  (x, c) => !c.parentContext.parentContext.parent._hideDatesOutsideMonth || !x.isOutsideMonth,
5649
6175
  html` <span role="gridcell">
5650
- <button
5651
- class="${(x, c) => classNames(
6176
+ <button
6177
+ class="${(x, c) => classNames(
5652
6178
  "calendar-day",
5653
6179
  "button",
5654
6180
  [
@@ -5657,7 +6183,9 @@ function renderCalendarGrid(context) {
5657
6183
  ],
5658
6184
  [
5659
6185
  "selected",
5660
- c.parentContext.parentContext.parent._isDateSelected(x.date)
6186
+ c.parentContext.parentContext.parent._isDateSelected(
6187
+ x.date
6188
+ )
5661
6189
  ],
5662
6190
  [
5663
6191
  "range",
@@ -5673,57 +6201,69 @@ function renderCalendarGrid(context) {
5673
6201
  ],
5674
6202
  [
5675
6203
  "end",
5676
- c.parentContext.parentContext.parent._isDateRangeEnd(x.date)
6204
+ c.parentContext.parentContext.parent._isDateRangeEnd(
6205
+ x.date
6206
+ )
5677
6207
  ],
5678
6208
  ["outside-month", x.isOutsideMonth]
5679
6209
  )}"
5680
- ?disabled="${(x, c) => !c.parentContext.parentContext.parent._isDateInValidRange(
6210
+ ?disabled="${(x, c) => !c.parentContext.parentContext.parent._isDateInValidRange(
6211
+ x.date
6212
+ )}"
6213
+ tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
6214
+ aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(
6215
+ x.date
6216
+ )}"
6217
+ data-date="${(x) => x.date}"
6218
+ @click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(
5681
6219
  x.date
5682
6220
  )}"
5683
- tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
5684
- aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(x.date)}"
5685
- data-date="${(x) => x.date}"
5686
- @click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
5687
- @focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
5688
- @mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(x.date)}"
5689
- @mouseleave="${(x, c) => c.parentContext.parentContext.parent._onDateMouseLeave(x.date)}"
5690
- @keydown="${(x, c) => c.parentContext.parentContext.parent._onDateKeydown(
6221
+ @focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(
6222
+ x.date
6223
+ )}"
6224
+ @mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(
6225
+ x.date
6226
+ )}"
6227
+ @mouseleave="${(x, c) => c.parentContext.parentContext.parent._onDateMouseLeave(
6228
+ x.date
6229
+ )}"
6230
+ @keydown="${(x, c) => c.parentContext.parentContext.parent._onDateKeydown(
5691
6231
  x.date,
5692
6232
  c.event
5693
6233
  )}"
5694
- >
5695
- ${(x) => x.label}
5696
- </button>
5697
- </span>`
6234
+ >
6235
+ ${(x) => x.label}
6236
+ </button>
6237
+ </span>`
5698
6238
  )}
5699
- </div>
5700
- `
6239
+ </div>
6240
+ `
5701
6241
  )}
5702
- </div>`
6242
+ </div>`
5703
6243
  )}`;
5704
6244
  }
5705
6245
  function renderMonthPickerGrid(context) {
5706
6246
  const dividerTag = context.tagFor(Divider);
5707
6247
  return html`
5708
6248
  <${dividerTag}
5709
- class="months-separator"
5710
- role="presentation"
6249
+ class='months-separator'
6250
+ role='presentation'
5711
6251
  ></${dividerTag}>
5712
6252
  <div
5713
- class="month-grid"
5714
- role="grid"
5715
- aria-labelledby="grid-label"
5716
- >
5717
- ${repeat(
6253
+ class='month-grid'
6254
+ role='grid'
6255
+ aria-labelledby='grid-label'
6256
+ >
6257
+ ${repeat(
5718
6258
  (x) => x.months,
5719
6259
  html`
5720
- <div class="months-row" role="row">
5721
- ${repeat(
6260
+ <div class="months-row" role="row">
6261
+ ${repeat(
5722
6262
  (x) => x,
5723
6263
  html`
5724
- <span role="gridcell">
5725
- <button
5726
- class="${(x, c) => classNames(
6264
+ <span role="gridcell">
6265
+ <button
6266
+ class="${(x, c) => classNames(
5727
6267
  "month",
5728
6268
  "button",
5729
6269
  [
@@ -5741,774 +6281,59 @@ function renderMonthPickerGrid(context) {
5741
6281
  )
5742
6282
  ]
5743
6283
  )}"
5744
- tabindex="${(x, c) => c.parentContext.parentContext.parent._tabbableMonth && areMonthsEqual(
6284
+ tabindex="${(x, c) => c.parentContext.parentContext.parent._tabbableMonth && areMonthsEqual(
5745
6285
  x.month,
5746
6286
  c.parentContext.parentContext.parent._tabbableMonth
5747
6287
  ) ? 2 : -1}"
5748
- aria-label="${(x) => x.monthName}"
5749
- aria-selected="${(x, c) => areMonthsEqual(
6288
+ aria-label="${(x) => x.monthName}"
6289
+ aria-selected="${(x, c) => areMonthsEqual(
5750
6290
  x.month,
5751
6291
  c.parentContext.parentContext.parent._selectedMonth
5752
6292
  )}"
5753
- data-month="${(x) => monthToStr(x.month)}"
5754
- ?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
6293
+ data-month="${(x) => monthToStr(x.month)}"
6294
+ ?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
5755
6295
  x.month
5756
6296
  )}"
5757
- @click="${(x, c) => c.parentContext.parentContext.parent._onMonthClick(
6297
+ @click="${(x, c) => c.parentContext.parentContext.parent._onMonthClick(
5758
6298
  x.month
5759
6299
  )}"
5760
- @focus="${(x, c) => c.parentContext.parentContext.parent._onMonthFocus(
6300
+ @focus="${(x, c) => c.parentContext.parentContext.parent._onMonthFocus(
5761
6301
  x.month
5762
6302
  )}"
5763
- @keydown="${(x, c) => c.parentContext.parentContext.parent._onMonthKeydown(
6303
+ @keydown="${(x, c) => c.parentContext.parentContext.parent._onMonthKeydown(
5764
6304
  x.month,
5765
6305
  c.event
5766
6306
  )}"
5767
- >
5768
- ${(x) => x.label}
5769
- </button>
5770
- </span>
5771
- `
6307
+ >
6308
+ ${(x) => x.label}
6309
+ </button>
6310
+ </span>
6311
+ `
5772
6312
  )}
5773
- </div>
5774
- `
6313
+ </div>
6314
+ `
5775
6315
  )}
5776
- </div>`;
6316
+ </div>`;
5777
6317
  }
5778
- const DatePickerBaseTemplate = (context) => {
5779
- const popupTag = context.tagFor(Popup);
5780
- const textFieldTag = context.tagFor(TextField);
5781
- const buttonTag = context.tagFor(Button);
5782
- return html`<div class="base" @keydown="${(x, { event }) => x._onBaseKeyDown(event)}">
5783
- <${textFieldTag} id="text-field"
5784
- ${ref("_textFieldEl")}
5785
- class="control"
5786
- label="${(x) => x.label}"
5787
- helper-text="${(x) => x.helperText}"
5788
- error-text="${(x) => x.errorValidationMessage}"
5789
- placeholder="${(x) => x._textFieldPlaceholder}"
5790
- size="${(x) => x._textFieldSize}"
5791
- current-value="${(x) => x._presentationValue}"
5792
- ?disabled="${(x) => x.disabled}"
5793
- ?readonly="${(x) => x.readOnly}"
5794
- @input="${(x, c) => x._onTextFieldInput(c.event)}"
5795
- @change="${(x) => x._onTextFieldChange()}"
5796
- >
5797
- <slot
5798
- slot="${(x) => x._helperTextSlottedContent?.length ? "helper-text" : void 0}"
5799
- name="helper-text"
5800
- ${slotted("_helperTextSlottedContent")}
5801
- ></slot>
5802
- <${buttonTag}
5803
- id="calendar-button"
5804
- ${ref("_calendarButtonEl")}
5805
- slot="action-items"
5806
- size="condensed"
5807
- icon="calendar-line"
5808
- appearance="ghost"
5809
- ?disabled="${(x) => x.disabled || x.readOnly}"
5810
- aria-label="${(x) => x._calendarButtonLabel}"
5811
- @click="${(x) => x._onCalendarButtonClick()}"
5812
- ></${buttonTag}>
5813
- </${textFieldTag}>
5814
- <${popupTag}
5815
- ?open="${(x) => x._popupOpen}"
5816
- :anchor="${(x) => x._textFieldEl}"
5817
- placement="bottom-start"
5818
- class="popup">
5819
- <div class="dialog" role="dialog" ${ref(
5820
- "_dialogEl"
5821
- )} aria-modal="true" aria-label="${(x) => x.locale.datePicker.chooseDateLabel}">
5822
- <div class="segments">
5823
- ${repeat(
6318
+ const CalendarPickerTemplate = (context) => {
6319
+ return html`
6320
+ <div class="segments">
6321
+ ${repeat(
5824
6322
  (x) => x._segments,
5825
6323
  html` <div class="segment">
5826
- ${renderDialogHeader(context)}
5827
- ${when(
6324
+ ${renderDialogHeader(context)}
6325
+ ${when(
5828
6326
  (x) => x.type === "month-picker",
5829
6327
  html`${renderMonthPickerGrid(context)}`
5830
6328
  )}
5831
- ${when(
6329
+ ${when(
5832
6330
  (x) => x.type === "calendar",
5833
6331
  html`${renderCalendarGrid(context)}`
5834
6332
  )}
5835
- </div>`
6333
+ </div>`
5836
6334
  )}
5837
- </div>
5838
- <div class="footer">
5839
- <${buttonTag}
5840
- tabindex="3"
5841
- class="vwc-button"
5842
- size="condensed"
5843
- label="${(x) => x.locale.datePicker.clearLabel}"
5844
- @click="${(x) => x._onClearClick()},
5845
- ${(x) => x.$emit("clear-click")}"
5846
- ></${buttonTag}>
5847
- <${buttonTag}
5848
- tabindex="3"
5849
- class="vwc-button"
5850
- size="condensed"
5851
- appearance="filled"
5852
- label="${(x) => x.locale.datePicker.okLabel}"
5853
- @click="${(x) => x._onOkClick()}"
5854
- ></${buttonTag}>
5855
- </div>
5856
- </div>
5857
- </${popupTag}>
5858
- </div>`;
5859
- };
5860
-
5861
- const getWeekdays = (locale) => {
5862
- const firstDayOfWeek = locale.firstDayOfWeek;
5863
- const localeWeekdayToNative = (day) => (day + firstDayOfWeek) % 7;
5864
- const days = [];
5865
- for (let i = 0; i < 7; i++) {
5866
- days.push({
5867
- name: locale.weekdays.name[localeWeekdayToNative(i)],
5868
- shortName: locale.weekdays.shorthand[localeWeekdayToNative(i)]
5869
- });
5870
- }
5871
- return days;
5872
- };
5873
- const gridDate = (date, isOutsideMonth2) => ({
5874
- date: formatDateStr(date),
5875
- label: `${date.getDate()}`,
5876
- isOutsideMonth: isOutsideMonth2
5877
- });
5878
- function isOutsideMonth(dayIndexInMonth, daysInMonth) {
5879
- return dayIndexInMonth < 0 || dayIndexInMonth >= daysInMonth;
5880
- }
5881
- const buildDateGrid = ({ month, year }, getDay) => {
5882
- const grid = [];
5883
- const firstDay = new Date(year, month, 1);
5884
- const lastDay = new Date(year, month + 1, 0);
5885
- const firstDayInWeek = getDay(firstDay);
5886
- const daysInMonth = lastDay.getDate();
5887
- const daysOutsideMonthInLastWeek = 7 - getDay(lastDay);
5888
- const totalDaysInCalendar = daysInMonth + firstDayInWeek + daysOutsideMonthInLastWeek;
5889
- let week = [];
5890
- for (let i = 0; i < totalDaysInCalendar; i++) {
5891
- const dayIndexInMonth = i - firstDayInWeek;
5892
- week.push(
5893
- gridDate(
5894
- addDays$1(firstDay, dayIndexInMonth),
5895
- isOutsideMonth(dayIndexInMonth, daysInMonth)
5896
- )
5897
- );
5898
- if (week.length === 7) {
5899
- grid.push(week);
5900
- week = [];
5901
- }
5902
- }
5903
- return grid;
5904
- };
5905
- const buildCalendarGrid = (month, locale) => {
5906
- const { firstDayOfWeek } = locale;
5907
- const getShiftedDay = (date) => (date.getDay() - firstDayOfWeek + 7) % 7;
5908
- return {
5909
- weekdays: getWeekdays(locale),
5910
- grid: buildDateGrid(month, getShiftedDay)
5911
- };
5912
- };
5913
-
5914
- const MonthsPerRow = 4;
5915
- const buildMonthPickerGrid = (year, locale) => {
5916
- const grid = [];
5917
- let row = [];
5918
- for (let i = 0; i < 12; i++) {
5919
- const month = { month: i, year };
5920
- row.push({
5921
- label: locale.months.shorthand[i],
5922
- monthName: locale.months.name[i],
5923
- month
5924
- });
5925
- if (row.length === MonthsPerRow) {
5926
- grid.push(row);
5927
- row = [];
5928
- }
5929
- }
5930
- return grid;
5931
- };
5932
-
5933
- const yearOfDate = (dateStr) => {
5934
- const date = parseDateStr(dateStr);
5935
- return date.getFullYear();
5936
- };
5937
-
5938
- class _DatePickerBase extends VividElement {
5939
- }
5940
- class FormAssociatedDatePickerBase extends FormAssociated(
5941
- _DatePickerBase
5942
- ) {
5943
- constructor() {
5944
- super(...arguments);
5945
- this.proxy = document.createElement("input");
5946
- }
5947
- }
5948
-
5949
- var __defProp = Object.defineProperty;
5950
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5951
- var __decorateClass = (decorators, target, key, kind) => {
5952
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5953
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
5954
- if (decorator = decorators[i])
5955
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5956
- if (kind && result) __defProp(target, key, result);
5957
- return result;
5958
- };
5959
- const ValidDateFilter = {
5960
- fromView: (value) => {
5961
- if (value && isValidDateStr(value)) {
5962
- return value;
5963
- }
5964
- return "";
5965
- },
5966
- toView(value) {
5967
- return value;
5968
- }
5969
- };
5970
- class DatePickerBase extends FormAssociatedDatePickerBase {
5971
- // --- Core ---
5972
- constructor() {
5973
- super();
5974
- this.readOnly = false;
5975
- this._selectedMonth = getCurrentMonth();
5976
- /**
5977
- * Today's date.
5978
- * @internal
5979
- */
5980
- this._currentDate = currentDateStr();
5981
- /**
5982
- * Today's month.
5983
- * @internal
5984
- */
5985
- this._currentMonth = getCurrentMonth();
5986
- this.#onFocusIn = () => {
5987
- this.$emit("focus", void 0, { bubbles: false });
5988
- };
5989
- this.#onFocusOut = () => {
5990
- this.$emit("blur", void 0, { bubbles: false });
5991
- };
5992
- // Reformat the presentation value when the locale changes
5993
- this.#localeChangeHandler = {
5994
- handleChange: () => {
5995
- this._updatePresentationValue();
5996
- }
5997
- };
5998
- this._popupOpen = false;
5999
- this.#dismissOnClickOutside = (event) => {
6000
- if (!this._popupOpen) {
6001
- return;
6002
- }
6003
- const path = event.composedPath();
6004
- const elementsToIgnoreClicksOn = [this._dialogEl, this._calendarButtonEl];
6005
- if (!elementsToIgnoreClicksOn.some((element) => path.includes(element))) {
6006
- this._closePopup(false);
6007
- }
6008
- };
6009
- this._presentationValue = "";
6010
- this._numCalendars = 1;
6011
- /**
6012
- * @internal
6013
- */
6014
- this._hideDatesOutsideMonth = false;
6015
- this._lastFocussedDate = null;
6016
- this._monthPickerYear = null;
6017
- this._lastFocussedMonth = null;
6018
- this.value = "";
6019
- this.min = "";
6020
- this.max = "";
6021
- }
6022
- /**
6023
- * @internal
6024
- */
6025
- minChanged(_, newMin) {
6026
- if (this.proxy instanceof HTMLInputElement) {
6027
- this.proxy.min = newMin;
6028
- this.validate();
6029
- }
6030
- }
6031
- /**
6032
- * @internal
6033
- */
6034
- maxChanged(_, newMax) {
6035
- if (this.proxy instanceof HTMLInputElement) {
6036
- this.proxy.max = newMax;
6037
- this.validate();
6038
- }
6039
- }
6040
- /**
6041
- * @internal
6042
- */
6043
- readOnlyChanged() {
6044
- if (this.proxy instanceof HTMLInputElement) {
6045
- this.proxy.readOnly = this.readOnly;
6046
- this.validate();
6047
- }
6048
- }
6049
- _adjustSelectedMonthToEnsureVisibilityOf(date) {
6050
- const month = monthOfDate(date);
6051
- const firstDisplayedMonth = this._selectedMonth;
6052
- const lastDisplayedMonth = addMonths(
6053
- this._selectedMonth,
6054
- this._numCalendars - 1
6055
- );
6056
- if (compareMonths(month, firstDisplayedMonth) < 0) {
6057
- this._selectedMonth = month;
6058
- return true;
6059
- } else if (compareMonths(month, lastDisplayedMonth) > 0) {
6060
- this._selectedMonth = addMonths(month, 1 - this._numCalendars);
6061
- return true;
6062
- }
6063
- return false;
6064
- }
6065
- /**
6066
- * @internal
6067
- */
6068
- _isDateInValidRange(date) {
6069
- return (!this.min || compareDateStr(date, this.min) >= 0) && (!this.max || compareDateStr(date, this.max) <= 0);
6070
- }
6071
- #isMonthAfterValidRange(month) {
6072
- return this.max && compareMonths(month, monthOfDate(this.max)) > 0;
6073
- }
6074
- #isMonthBeforeValidRange(month) {
6075
- return this.min && compareMonths(month, monthOfDate(this.min)) < 0;
6076
- }
6077
- /**
6078
- * @internal
6079
- */
6080
- _isMonthInValidRange(month) {
6081
- return !(this.#isMonthBeforeValidRange(month) || this.#isMonthAfterValidRange(month));
6082
- }
6083
- connectedCallback() {
6084
- super.connectedCallback();
6085
- document.addEventListener("click", this.#dismissOnClickOutside);
6086
- this.addEventListener("focusin", this.#onFocusIn);
6087
- this.addEventListener("focusout", this.#onFocusOut);
6088
- this.#localeChangeObserver = Observable.binding(
6089
- () => this.locale,
6090
- this.#localeChangeHandler
6091
- );
6092
- this.#localeChangeObserver.observe(this, defaultExecutionContext);
6093
- }
6094
- disconnectedCallback() {
6095
- super.disconnectedCallback();
6096
- document.removeEventListener("click", this.#dismissOnClickOutside);
6097
- this.removeEventListener("focusin", this.#onFocusIn);
6098
- this.removeEventListener("focusout", this.#onFocusOut);
6099
- this.#localeChangeObserver.disconnect();
6100
- }
6101
- #onFocusIn;
6102
- #onFocusOut;
6103
- /**
6104
- * @internal
6105
- */
6106
- validate() {
6107
- if (this.proxy) {
6108
- this.proxy.setCustomValidity(this._getCustomValidationError() ?? "");
6109
- }
6110
- super.validate(this._textFieldEl?.querySelector("input") ?? void 0);
6111
- }
6112
- #localeChangeHandler;
6113
- #localeChangeObserver;
6114
- #dismissOnClickOutside;
6115
- #openPopupIfPossible() {
6116
- if (!this.readOnly) {
6117
- this._popupOpen = true;
6118
- }
6119
- }
6120
- /**
6121
- * @internal
6122
- */
6123
- _closePopup(restoreFocusToTextField = true) {
6124
- this._popupOpen = false;
6125
- this._monthPickerYear = null;
6126
- if (restoreFocusToTextField) {
6127
- this._textFieldEl.focus();
6128
- }
6129
- }
6130
- /**
6131
- * On keydown anywhere in the date picker.
6132
- * @internal
6133
- */
6134
- _onBaseKeyDown(event) {
6135
- if (this._popupOpen && handleEscapeKeyAndStopPropogation(event)) {
6136
- this._closePopup();
6137
- return false;
6138
- }
6139
- if (this._trappedFocus(
6140
- event,
6141
- () => this.shadowRoot.querySelectorAll(`
6142
- .dialog .button:not(:disabled),
6143
- .dialog .vwc-button:not(:disabled)
6144
- `)
6145
- )) {
6146
- return false;
6147
- }
6148
- return true;
6149
- }
6150
- /**
6151
- * @internal
6152
- */
6153
- _presentationValueChanged() {
6154
- this.dirtyValue = true;
6155
- this.validate();
6156
- }
6157
- /**
6158
- * @internal
6159
- */
6160
- _onTextFieldInput(event) {
6161
- const textField = event.currentTarget;
6162
- this._presentationValue = textField.value;
6163
- }
6164
- /**
6165
- * @internal
6166
- */
6167
- _onCalendarButtonClick() {
6168
- if (this._popupOpen) {
6169
- this._closePopup();
6170
- } else {
6171
- this.#openPopupIfPossible();
6172
- DOM.processUpdates();
6173
- const tabbableDate = this._tabbableDate;
6174
- if (tabbableDate)
6175
- this.shadowRoot.querySelector(
6176
- `[data-date="${tabbableDate}"]`
6177
- ).focus();
6178
- }
6179
- }
6180
- // --- Dialog header ---
6181
- /**
6182
- * @internal
6183
- */
6184
- _onTitleActionClick() {
6185
- if (this._inMonthPicker) {
6186
- this._monthPickerYear = null;
6187
- } else {
6188
- this._monthPickerYear = this._selectedMonth.year;
6189
- }
6190
- }
6191
- get _isPrevYearDisabled() {
6192
- const currentYear = this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year;
6193
- const prevYear = currentYear - 1;
6194
- return this.min && prevYear < yearOfDate(this.min);
6195
- }
6196
- /**
6197
- * @internal
6198
- */
6199
- _onPrevYearClick() {
6200
- if (this._inMonthPicker) {
6201
- this._monthPickerYear = this._monthPickerYear - 1;
6202
- } else {
6203
- this._selectedMonth = {
6204
- year: this._selectedMonth.year - 1,
6205
- month: this._selectedMonth.month
6206
- };
6207
- }
6208
- }
6209
- get _isNextYearDisabled() {
6210
- const currentYear = this._inMonthPicker ? this._monthPickerYear : this._selectedMonth.year;
6211
- const nextYear = currentYear + 1;
6212
- return this.max && nextYear > yearOfDate(this.max);
6213
- }
6214
- /**
6215
- * @internal
6216
- */
6217
- _onNextYearClick() {
6218
- if (this._inMonthPicker) {
6219
- this._monthPickerYear = this._monthPickerYear + 1;
6220
- } else {
6221
- this._selectedMonth = {
6222
- year: this._selectedMonth.year + 1,
6223
- month: this._selectedMonth.month
6224
- };
6225
- }
6226
- }
6227
- /**
6228
- * @internal
6229
- */
6230
- get _isPrevMonthDisabled() {
6231
- return this.#isMonthBeforeValidRange(addMonths(this._selectedMonth, -1));
6232
- }
6233
- /**
6234
- * @internal
6235
- */
6236
- _onPrevMonthClick() {
6237
- this._selectedMonth = addMonths(this._selectedMonth, -1);
6238
- }
6239
- /**
6240
- * @internal
6241
- */
6242
- get _isNextMonthDisabled() {
6243
- return this.#isMonthAfterValidRange(addMonths(this._selectedMonth, 1));
6244
- }
6245
- /**
6246
- * @internal
6247
- */
6248
- _onNextMonthClick() {
6249
- this._selectedMonth = addMonths(this._selectedMonth, 1);
6250
- }
6251
- /**
6252
- * @internal
6253
- */
6254
- get _segments() {
6255
- const segments = [];
6256
- if (this._inMonthPicker) {
6257
- segments.push({
6258
- id: 0,
6259
- type: "month-picker",
6260
- title: `${this._monthPickerYear}`,
6261
- titleClickable: true,
6262
- prevYearButton: true,
6263
- nextYearButton: true,
6264
- months: buildMonthPickerGrid(
6265
- this._monthPickerYear,
6266
- this.locale.datePicker
6267
- )
6268
- });
6269
- } else {
6270
- for (let i = 0; i < this._numCalendars; i++) {
6271
- const month = addMonths(this._selectedMonth, i);
6272
- const isSingle = this._numCalendars === 1;
6273
- const isFirst = i === 0;
6274
- const isLast = i === this._numCalendars - 1;
6275
- segments.push({
6276
- id: i,
6277
- type: "calendar",
6278
- title: `${this.locale.datePicker.months.name[month.month]} ${month.year}`,
6279
- titleClickable: isSingle,
6280
- prevYearButton: isFirst && isSingle,
6281
- prevMonthButton: isFirst,
6282
- nextMonthButton: isLast,
6283
- nextYearButton: isLast && isSingle,
6284
- calendar: buildCalendarGrid(month, this.locale.datePicker)
6285
- });
6286
- }
6287
- }
6288
- return segments;
6289
- }
6290
- /**
6291
- * @internal
6292
- */
6293
- _isDateSelected(_) {
6294
- return false;
6295
- }
6296
- /**
6297
- * @internal
6298
- */
6299
- _isDateInSelectedRange(_) {
6300
- return false;
6301
- }
6302
- /**
6303
- * @internal
6304
- */
6305
- _isDateRangeStart(_) {
6306
- return false;
6307
- }
6308
- /**
6309
- * @internal
6310
- */
6311
- _isDateRangeEnd(_) {
6312
- return false;
6313
- }
6314
- /**
6315
- * @internal
6316
- */
6317
- _onDateMouseEnter(_) {
6318
- }
6319
- /**
6320
- * @internal
6321
- */
6322
- _onDateMouseLeave(_) {
6323
- }
6324
- /**
6325
- * Handle keydown on a date in the calendar.
6326
- * @internal
6327
- */
6328
- _onDateKeydown(date, event) {
6329
- let newDate = null;
6330
- if (event.key === "ArrowUp") {
6331
- newDate = addDays(date, -7);
6332
- } else if (event.key === "ArrowDown") {
6333
- newDate = addDays(date, 7);
6334
- } else if (event.key === "ArrowLeft") {
6335
- newDate = addDays(date, -1);
6336
- } else if (event.key === "ArrowRight") {
6337
- newDate = addDays(date, 1);
6338
- }
6339
- if (newDate && this._isDateInValidRange(newDate)) {
6340
- if (this._adjustSelectedMonthToEnsureVisibilityOf(newDate)) {
6341
- DOM.processUpdates();
6342
- }
6343
- this._dialogEl.querySelector(
6344
- `[data-date="${newDate}"]`
6345
- ).focus();
6346
- return false;
6347
- }
6348
- return true;
6349
- }
6350
- /**
6351
- * @internal
6352
- */
6353
- _onDateFocus(date) {
6354
- this._lastFocussedDate = date;
6355
- }
6356
- get _tabbableDate() {
6357
- const datesInSegments = this._segments.filter(
6358
- (segment) => segment.type === "calendar"
6359
- ).flatMap((segment) => segment.calendar.grid.flat().map((d) => d.date));
6360
- const candidates = [
6361
- this._lastFocussedDate,
6362
- ...this._getSelectedDates(),
6363
- currentDateStr(),
6364
- ...datesInSegments
6365
- ];
6366
- const firstVisibleMonth = this._selectedMonth;
6367
- const lastVisibleMonth = addMonths(
6368
- this._selectedMonth,
6369
- this._numCalendars - 1
6370
- );
6371
- return candidates.find(
6372
- (date) => date && compareMonths(monthOfDate(date), firstVisibleMonth) >= 0 && compareMonths(monthOfDate(date), lastVisibleMonth) <= 0 && this._isDateInValidRange(date)
6373
- ) ?? null;
6374
- }
6375
- /**
6376
- * @internal
6377
- */
6378
- get _inMonthPicker() {
6379
- return this._monthPickerYear !== null;
6380
- }
6381
- /**
6382
- * Handle month selected in the month picker.
6383
- * @internal
6384
- */
6385
- _onMonthClick(month) {
6386
- this._selectedMonth = month;
6387
- this._monthPickerYear = null;
6388
- }
6389
- /**
6390
- * Handle keydown on a month in the month picker.
6391
- * @internal
6392
- */
6393
- _onMonthKeydown(month, event) {
6394
- let newMonth = null;
6395
- if (event.key === "ArrowUp") {
6396
- newMonth = addMonths(month, -MonthsPerRow);
6397
- } else if (event.key === "ArrowDown") {
6398
- newMonth = addMonths(month, MonthsPerRow);
6399
- } else if (event.key === "ArrowLeft") {
6400
- newMonth = addMonths(month, -1);
6401
- } else if (event.key === "ArrowRight") {
6402
- newMonth = addMonths(month, 1);
6403
- }
6404
- if (newMonth && this._isMonthInValidRange(newMonth)) {
6405
- if (newMonth.year !== this._monthPickerYear) {
6406
- this._monthPickerYear = newMonth.year;
6407
- DOM.processUpdates();
6408
- }
6409
- this._dialogEl.querySelector(
6410
- `[data-month="${monthToStr(newMonth)}"]`
6411
- ).focus();
6412
- return false;
6413
- }
6414
- return true;
6415
- }
6416
- /**
6417
- * @internal
6418
- */
6419
- _onMonthFocus(month) {
6420
- this._lastFocussedMonth = month;
6421
- }
6422
- get _tabbableMonth() {
6423
- const monthsInSegments = this._segments.filter(
6424
- (segments) => segments.type === "month-picker"
6425
- ).flatMap((segment) => segment.months.flat().map((c) => c.month));
6426
- const candidates = [
6427
- this._lastFocussedMonth,
6428
- this._selectedMonth,
6429
- getCurrentMonth(),
6430
- ...monthsInSegments
6431
- ];
6432
- return candidates.find(
6433
- (month) => month && month.year === this._monthPickerYear && this._isMonthInValidRange(month)
6434
- ) ?? null;
6435
- }
6436
- // --- Dialog footer ---
6437
- /**
6438
- * @internal
6439
- */
6440
- _onOkClick() {
6441
- this._closePopup();
6442
- }
6443
- /**
6444
- * @internal
6445
- */
6446
- _onClearClick() {
6447
- this._closePopup();
6448
- }
6449
- }
6450
- __decorateClass([
6451
- attr({ converter: ValidDateFilter })
6452
- ], DatePickerBase.prototype, "min", 2);
6453
- __decorateClass([
6454
- attr({ converter: ValidDateFilter })
6455
- ], DatePickerBase.prototype, "max", 2);
6456
- __decorateClass([
6457
- attr({ attribute: "value" })
6458
- ], DatePickerBase.prototype, "initialValue", 2);
6459
- __decorateClass([
6460
- attr({ attribute: "current-value" })
6461
- ], DatePickerBase.prototype, "currentValue", 2);
6462
- __decorateClass([
6463
- attr({ attribute: "readonly", mode: "boolean" })
6464
- ], DatePickerBase.prototype, "readOnly", 2);
6465
- __decorateClass([
6466
- observable
6467
- ], DatePickerBase.prototype, "_selectedMonth", 2);
6468
- __decorateClass([
6469
- observable
6470
- ], DatePickerBase.prototype, "_popupOpen", 2);
6471
- __decorateClass([
6472
- observable
6473
- ], DatePickerBase.prototype, "_presentationValue", 2);
6474
- __decorateClass([
6475
- volatile
6476
- ], DatePickerBase.prototype, "_isPrevYearDisabled", 1);
6477
- __decorateClass([
6478
- volatile
6479
- ], DatePickerBase.prototype, "_isNextYearDisabled", 1);
6480
- __decorateClass([
6481
- observable
6482
- ], DatePickerBase.prototype, "_numCalendars", 2);
6483
- __decorateClass([
6484
- observable
6485
- ], DatePickerBase.prototype, "_lastFocussedDate", 2);
6486
- __decorateClass([
6487
- volatile
6488
- ], DatePickerBase.prototype, "_tabbableDate", 1);
6489
- __decorateClass([
6490
- observable
6491
- ], DatePickerBase.prototype, "_monthPickerYear", 2);
6492
- __decorateClass([
6493
- observable
6494
- ], DatePickerBase.prototype, "_lastFocussedMonth", 2);
6495
- __decorateClass([
6496
- volatile
6497
- ], DatePickerBase.prototype, "_tabbableMonth", 1);
6498
- applyMixinsWithObservables(
6499
- DatePickerBase,
6500
- Localized,
6501
- FormElementHelperText,
6502
- TrappedFocus
6503
- );
6504
-
6505
- const formatPresentationDate = (dateStr, locale) => {
6506
- const date = parseDateStr(dateStr);
6507
- return format(date, locale.dateFormat);
6508
- };
6509
- const parsePresentationDate = (presentationDate, locale) => {
6510
- const date = parse(presentationDate, locale.dateFormat, /* @__PURE__ */ new Date());
6511
- return formatDateStr(date);
6335
+ </div>
6336
+ `;
6512
6337
  };
6513
6338
 
6514
- export { DatePickerBase as D, DatePickerBaseTemplate as a, compareDateStr as c, formatPresentationDate as f, isValidDateStr as i, parsePresentationDate as p, styles as s };
6339
+ export { CalendarPicker as C, MinMaxCalendarPicker as M, ValidDateFilter as V, CalendarPickerTemplate as a, compareDateStr as b, calendarStyles as c, currentDateStr as d, formatPresentationDate as f, isValidDateStr as i, parsePresentationDate as p };