@pod-os/elements 0.7.1-92705ee.0 → 0.7.1-a71f01c.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 (634) hide show
  1. package/dist/cjs/{animation-5840e4df.js → animation-9bea118f.js} +115 -84
  2. package/dist/cjs/{app-globals-1aedd05c.js → app-globals-6352043e.js} +1 -1
  3. package/dist/cjs/{cubic-bezier-dcb7bfef.js → cubic-bezier-0b702a31.js} +13 -12
  4. package/dist/cjs/data-0c9489d7.js +1510 -0
  5. package/dist/cjs/dir-011f46ea.js +20 -0
  6. package/dist/cjs/elements.cjs.js +5 -5
  7. package/dist/cjs/focus-visible-2624ec15.js +76 -0
  8. package/dist/cjs/framework-delegate-437c0645.js +119 -0
  9. package/dist/cjs/{gesture-controller-fbbe9a65.js → gesture-controller-00a6b02f.js} +6 -2
  10. package/dist/cjs/{haptic-09e73337.js → haptic-7358cb0b.js} +37 -8
  11. package/dist/cjs/{hardware-back-button-01027575.js → hardware-back-button-25372ec7.js} +11 -8
  12. package/dist/cjs/{helpers-398ced09.js → helpers-cb08f5ae.js} +115 -15
  13. package/dist/cjs/{index-2067b305.js → index-1b07c737.js} +35 -24
  14. package/dist/cjs/{index-68ae43d2.js → index-2dc3637c.js} +34 -28
  15. package/dist/cjs/index-57b9fa9e.js +30 -0
  16. package/dist/cjs/{index-d01d9183.js → index-643851c6.js} +34 -19
  17. package/dist/cjs/index-731691ca.js +48 -0
  18. package/dist/cjs/{index-6bbae9b1.js → index-7d56774d.js} +12 -8
  19. package/dist/cjs/index-9fca5d6f.js +140 -0
  20. package/dist/cjs/index-b2a479e4.js +38 -0
  21. package/dist/cjs/{index-b4a9ece2.js → index-eaa0d16e.js} +7 -0
  22. package/dist/cjs/{tap-click-f24cb477.js → index-ed2ce04f.js} +37 -19
  23. package/dist/cjs/{input-shims-e959d9e2.js → input-shims-427999f7.js} +89 -38
  24. package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
  25. package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
  26. package/dist/cjs/ion-action-sheet_3.cjs.entry.js +865 -0
  27. package/dist/cjs/{ion-app_45.cjs.entry.js → ion-app_46.cjs.entry.js} +1906 -1492
  28. package/dist/cjs/ion-avatar.cjs.entry.js +2 -2
  29. package/dist/cjs/ion-back-button.cjs.entry.js +12 -11
  30. package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
  31. package/dist/cjs/ion-breadcrumb.cjs.entry.js +101 -0
  32. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +137 -0
  33. package/dist/cjs/ion-buttons_3.cjs.entry.js +799 -0
  34. package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
  35. package/dist/cjs/{ion-list-header_3.cjs.entry.js → ion-checkbox_4.cjs.entry.js} +124 -23
  36. package/dist/cjs/ion-chip.cjs.entry.js +5 -10
  37. package/dist/cjs/ion-datetime-button.cjs.entry.js +346 -0
  38. package/dist/cjs/ion-datetime.cjs.entry.js +1548 -856
  39. package/dist/cjs/ion-fab-button.cjs.entry.js +26 -9
  40. package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
  41. package/dist/cjs/ion-fab.cjs.entry.js +15 -13
  42. package/dist/cjs/ion-img.cjs.entry.js +28 -4
  43. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
  44. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -13
  45. package/dist/cjs/ion-input.cjs.entry.js +57 -23
  46. package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
  47. package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
  48. package/dist/cjs/ion-item-sliding.cjs.entry.js +59 -63
  49. package/dist/cjs/ion-loading.cjs.entry.js +38 -37
  50. package/dist/cjs/ion-menu-button.cjs.entry.js +14 -12
  51. package/dist/cjs/ion-menu-toggle.cjs.entry.js +8 -7
  52. package/dist/cjs/ion-menu.cjs.entry.js +71 -57
  53. package/dist/cjs/ion-modal.cjs.entry.js +1386 -156
  54. package/dist/cjs/ion-nav-link.cjs.entry.js +5 -2
  55. package/dist/cjs/ion-nav.cjs.entry.js +177 -171
  56. package/dist/cjs/ion-picker-column.cjs.entry.js +25 -27
  57. package/dist/cjs/ion-picker.cjs.entry.js +22 -17
  58. package/dist/cjs/ion-popover.cjs.entry.js +1208 -182
  59. package/dist/cjs/ion-range.cjs.entry.js +137 -57
  60. package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -12
  61. package/dist/cjs/ion-refresher.cjs.entry.js +150 -148
  62. package/dist/cjs/ion-reorder-group.cjs.entry.js +42 -35
  63. package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
  64. package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
  65. package/dist/cjs/ion-route.cjs.entry.js +1 -1
  66. package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
  67. package/dist/cjs/ion-router-outlet.cjs.entry.js +24 -20
  68. package/dist/cjs/ion-router.cjs.entry.js +291 -194
  69. package/dist/cjs/ion-segment-button.cjs.entry.js +10 -17
  70. package/dist/cjs/ion-segment.cjs.entry.js +127 -26
  71. package/dist/cjs/ion-select-option.cjs.entry.js +3 -3
  72. package/dist/cjs/ion-select.cjs.entry.js +113 -78
  73. package/dist/cjs/ion-slide.cjs.entry.js +3 -3
  74. package/dist/cjs/ion-slides.cjs.entry.js +26 -27
  75. package/dist/cjs/ion-spinner.cjs.entry.js +10 -9
  76. package/dist/cjs/ion-split-pane.cjs.entry.js +16 -12
  77. package/dist/cjs/ion-tab-bar.cjs.entry.js +16 -23
  78. package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
  79. package/dist/cjs/ion-tab.cjs.entry.js +4 -4
  80. package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
  81. package/dist/cjs/ion-text.cjs.entry.js +3 -3
  82. package/dist/cjs/ion-textarea.cjs.entry.js +31 -29
  83. package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
  84. package/dist/cjs/ion-toast.cjs.entry.js +50 -60
  85. package/dist/cjs/ion-toggle.cjs.entry.js +41 -22
  86. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +39 -31
  87. package/dist/cjs/{ionic-global-56e10eb5.js → ionic-global-f2d95fd3.js} +112 -93
  88. package/dist/cjs/{ios.transition-32e4623d.js → ios.transition-0f31ec9a.js} +78 -53
  89. package/dist/cjs/{keyboard-9e8103e4.js → keyboard-79afcba2.js} +6 -3
  90. package/dist/cjs/keyboard-controller-a934d106.js +42 -0
  91. package/dist/cjs/loader.cjs.js +5 -5
  92. package/dist/cjs/{md.transition-169c54f0.js → md.transition-d2a33a23.js} +15 -17
  93. package/dist/cjs/{menu-toggle-util-087678e0.js → menu-toggle-util-0a43ff7c.js} +5 -2
  94. package/dist/cjs/{overlays-49fe9ba7.js → overlays-f7d24abf.js} +190 -72
  95. package/dist/cjs/spinner-configs-cd0abbeb.js +147 -0
  96. package/dist/cjs/{status-tap-ada894ff.js → status-tap-beaa3a71.js} +10 -5
  97. package/dist/cjs/{swipe-back-c4a778df.js → swipe-back-666ea8e6.js} +34 -15
  98. package/dist/cjs/{theme-2259d0f5.js → theme-fc63803b.js} +9 -5
  99. package/dist/collection/collection-manifest.json +10 -4
  100. package/dist/collection/components/pos-rich-link/pos-rich-link.js +1 -1
  101. package/dist/components/ResourceAware.js +5 -0
  102. package/dist/components/action-sheet.js +309 -0
  103. package/dist/{esm/ion-alert.entry.js → components/alert.js} +150 -105
  104. package/dist/{esm/animation-fe6ed422.js → components/animation.js} +115 -84
  105. package/dist/components/app.js +112 -0
  106. package/dist/components/backdrop.js +82 -0
  107. package/dist/components/badge.js +42 -0
  108. package/dist/{esm/button-active-fd9d6d91.js → components/button-active.js} +9 -6
  109. package/dist/components/button.js +207 -0
  110. package/dist/{esm/ion-buttons.entry.js → components/buttons.js} +28 -12
  111. package/dist/components/card-content.js +40 -0
  112. package/dist/components/card-header.js +51 -0
  113. package/dist/components/card-title.js +43 -0
  114. package/dist/components/card.js +102 -0
  115. package/dist/{esm/ion-checkbox.entry.js → components/checkbox.js} +42 -24
  116. package/dist/components/col.js +161 -0
  117. package/dist/components/content.js +356 -0
  118. package/dist/{esm/cubic-bezier-108b8579.js → components/cubic-bezier.js} +13 -12
  119. package/dist/components/data.js +1463 -0
  120. package/dist/components/dir.js +18 -0
  121. package/dist/components/focus-visible.js +74 -0
  122. package/dist/components/footer.js +149 -0
  123. package/dist/components/framework-delegate.js +115 -0
  124. package/dist/{esm/gesture-controller-8f35af24.js → components/gesture-controller.js} +6 -2
  125. package/dist/components/grid.js +41 -0
  126. package/dist/{esm/haptic-c424e670.js → components/haptic.js} +38 -9
  127. package/dist/{esm/hardware-back-button-bb4c578a.js → components/hardware-back-button.js} +11 -8
  128. package/dist/components/header.js +360 -0
  129. package/dist/{esm/helpers-44e3bd9f.js → components/helpers.js} +113 -16
  130. package/dist/components/icon.js +367 -0
  131. package/dist/components/index.d.ts +41 -0
  132. package/dist/components/index.js +123 -0
  133. package/dist/components/index10.js +28 -0
  134. package/dist/{esm/tap-click-a7e55ef5.js → components/index11.js} +37 -19
  135. package/dist/components/index2.js +25 -0
  136. package/dist/{esm/index-8d682224.js → components/index3.js} +12 -8
  137. package/dist/components/index4.js +34 -0
  138. package/dist/components/index5.js +128 -0
  139. package/dist/{esm/index-97199683.js → components/index6.js} +34 -28
  140. package/dist/{esm/index-8a463a85.js → components/index7.js} +35 -24
  141. package/dist/{custom-elements/index.js → components/index8.js} +1049 -20945
  142. package/dist/{esm/index-3a1bd803.js → components/index9.js} +35 -20
  143. package/dist/{custom-elements → components}/input-shims.js +88 -38
  144. package/dist/components/ion-accordion-group.js +228 -0
  145. package/dist/components/ion-accordion.js +365 -0
  146. package/dist/components/ion-action-sheet.js +6 -0
  147. package/dist/components/ion-alert.js +6 -0
  148. package/dist/components/ion-app.js +6 -0
  149. package/dist/components/ion-avatar.js +39 -0
  150. package/dist/components/ion-back-button.js +128 -0
  151. package/dist/components/ion-backdrop.js +6 -0
  152. package/dist/components/ion-badge.js +6 -0
  153. package/dist/components/ion-breadcrumb.js +135 -0
  154. package/dist/components/ion-breadcrumbs.js +158 -0
  155. package/dist/components/ion-button.js +6 -0
  156. package/dist/components/ion-buttons.js +6 -0
  157. package/dist/components/ion-card-content.js +6 -0
  158. package/dist/components/ion-card-header.js +6 -0
  159. package/dist/components/ion-card-subtitle.js +46 -0
  160. package/dist/components/ion-card-title.js +6 -0
  161. package/dist/components/ion-card.js +6 -0
  162. package/dist/components/ion-checkbox.js +6 -0
  163. package/dist/components/ion-chip.js +59 -0
  164. package/dist/components/ion-col.js +6 -0
  165. package/dist/components/ion-content.js +6 -0
  166. package/dist/components/ion-datetime-button.js +375 -0
  167. package/dist/components/ion-datetime.js +1802 -0
  168. package/dist/components/ion-fab-button.js +149 -0
  169. package/dist/components/ion-fab-list.js +62 -0
  170. package/dist/components/ion-fab.js +97 -0
  171. package/dist/components/ion-footer.js +6 -0
  172. package/dist/components/ion-grid.js +6 -0
  173. package/dist/components/ion-header.js +6 -0
  174. package/dist/components/ion-icon.js +6 -0
  175. package/dist/components/ion-img.js +120 -0
  176. package/dist/components/ion-infinite-scroll-content.js +59 -0
  177. package/dist/components/ion-infinite-scroll.js +223 -0
  178. package/dist/components/ion-input.js +352 -0
  179. package/dist/components/ion-item-divider.js +6 -0
  180. package/dist/components/ion-item-group.js +6 -0
  181. package/dist/components/ion-item-option.js +89 -0
  182. package/dist/components/ion-item-options.js +63 -0
  183. package/dist/components/ion-item-sliding.js +419 -0
  184. package/dist/components/ion-item.js +6 -0
  185. package/dist/components/ion-label.js +6 -0
  186. package/dist/components/ion-list-header.js +6 -0
  187. package/dist/components/ion-list.js +6 -0
  188. package/dist/components/ion-loading.js +256 -0
  189. package/dist/components/ion-menu-button.js +107 -0
  190. package/dist/components/ion-menu-toggle.js +62 -0
  191. package/dist/components/ion-menu.js +611 -0
  192. package/dist/components/ion-modal.js +1765 -0
  193. package/dist/components/ion-nav-link.js +65 -0
  194. package/dist/components/ion-nav.js +905 -0
  195. package/dist/components/ion-note.js +6 -0
  196. package/dist/components/ion-picker-column-internal.js +6 -0
  197. package/dist/components/ion-picker-column.js +6 -0
  198. package/dist/components/ion-picker-internal.js +6 -0
  199. package/dist/components/ion-picker.js +263 -0
  200. package/dist/components/ion-popover.js +6 -0
  201. package/dist/components/ion-progress-bar.js +6 -0
  202. package/dist/components/ion-radio-group.js +6 -0
  203. package/dist/components/ion-radio.js +6 -0
  204. package/dist/components/ion-range.js +550 -0
  205. package/dist/components/ion-refresher-content.js +64 -0
  206. package/dist/components/ion-refresher.js +826 -0
  207. package/dist/components/ion-reorder-group.js +303 -0
  208. package/dist/components/ion-reorder.js +58 -0
  209. package/dist/components/ion-ripple-effect.js +6 -0
  210. package/dist/components/ion-route-redirect.js +40 -0
  211. package/dist/components/ion-route.js +68 -0
  212. package/dist/components/ion-router-link.js +59 -0
  213. package/dist/components/ion-router-outlet.js +223 -0
  214. package/dist/components/ion-router.js +852 -0
  215. package/dist/components/ion-row.js +6 -0
  216. package/dist/components/ion-searchbar.js +6 -0
  217. package/dist/components/ion-segment-button.js +128 -0
  218. package/dist/components/ion-segment.js +463 -0
  219. package/dist/components/ion-select-option.js +44 -0
  220. package/dist/components/ion-select-popover.js +6 -0
  221. package/dist/components/ion-select.js +596 -0
  222. package/dist/components/ion-skeleton-text.js +6 -0
  223. package/dist/components/ion-slide.js +38 -0
  224. package/dist/components/ion-slides.js +423 -0
  225. package/dist/components/ion-spinner.js +6 -0
  226. package/dist/components/ion-split-pane.js +179 -0
  227. package/dist/components/ion-tab-bar.js +86 -0
  228. package/dist/components/ion-tab-button.js +132 -0
  229. package/dist/components/ion-tab.js +86 -0
  230. package/dist/components/ion-tabs.js +176 -0
  231. package/dist/components/ion-text.js +40 -0
  232. package/dist/components/ion-textarea.js +287 -0
  233. package/dist/components/ion-thumbnail.js +34 -0
  234. package/dist/components/ion-title.js +6 -0
  235. package/dist/components/ion-toast.js +317 -0
  236. package/dist/components/ion-toggle.js +207 -0
  237. package/dist/components/ion-toolbar.js +6 -0
  238. package/dist/components/ion-virtual-scroll.js +588 -0
  239. package/dist/components/ionic-global.js +226 -0
  240. package/dist/{custom-elements → components}/ios.transition.js +75 -50
  241. package/dist/components/item-divider.js +54 -0
  242. package/dist/components/item-group.js +41 -0
  243. package/dist/components/item.js +323 -0
  244. package/dist/components/keyboard-controller.js +40 -0
  245. package/dist/{custom-elements → components}/keyboard.js +6 -3
  246. package/dist/components/label.js +95 -0
  247. package/dist/components/list-header.js +45 -0
  248. package/dist/components/list.js +66 -0
  249. package/dist/{custom-elements → components}/md.transition.js +12 -14
  250. package/dist/{esm/menu-toggle-util-562dfc9c.js → components/menu-toggle-util.js} +5 -2
  251. package/dist/components/note.js +42 -0
  252. package/dist/{esm/overlays-fc9a0625.js → components/overlays.js} +188 -72
  253. package/dist/components/picker-column-internal.js +315 -0
  254. package/dist/components/picker-column.js +343 -0
  255. package/dist/components/picker-internal.js +486 -0
  256. package/dist/components/popover.js +1440 -0
  257. package/dist/components/pos-app-browser.d.ts +11 -0
  258. package/dist/components/pos-app-browser.js +299 -0
  259. package/dist/components/pos-app-generic.d.ts +11 -0
  260. package/dist/components/pos-app-generic.js +6 -0
  261. package/dist/components/pos-app-generic2.js +194 -0
  262. package/dist/components/pos-app-image-viewer.d.ts +11 -0
  263. package/dist/components/pos-app-image-viewer.js +6 -0
  264. package/dist/components/pos-app-image-viewer2.js +162 -0
  265. package/dist/components/pos-app-rdf-document.d.ts +11 -0
  266. package/dist/components/pos-app-rdf-document.js +6 -0
  267. package/dist/components/pos-app-rdf-document2.js +170 -0
  268. package/dist/components/pos-app.d.ts +11 -0
  269. package/dist/components/pos-app.js +6 -0
  270. package/dist/components/pos-app2.js +53 -0
  271. package/dist/components/pos-description.d.ts +11 -0
  272. package/dist/components/pos-description.js +6 -0
  273. package/dist/components/pos-description2.js +38 -0
  274. package/dist/components/pos-image.d.ts +11 -0
  275. package/dist/components/pos-image.js +6 -0
  276. package/dist/components/pos-image2.js +117 -0
  277. package/dist/components/pos-label.d.ts +11 -0
  278. package/dist/components/pos-label.js +6 -0
  279. package/dist/components/pos-label2.js +38 -0
  280. package/dist/components/pos-literals.d.ts +11 -0
  281. package/dist/components/pos-literals.js +6 -0
  282. package/dist/components/pos-literals2.js +87 -0
  283. package/dist/components/pos-login.d.ts +11 -0
  284. package/dist/components/pos-login.js +6 -0
  285. package/dist/components/pos-login2.js +120 -0
  286. package/dist/components/pos-navigation-bar.d.ts +11 -0
  287. package/dist/components/pos-navigation-bar.js +6 -0
  288. package/dist/components/pos-navigation-bar2.js +52 -0
  289. package/dist/components/pos-picture.d.ts +11 -0
  290. package/dist/components/pos-picture.js +6 -0
  291. package/dist/components/pos-picture2.js +62 -0
  292. package/dist/components/pos-relations.d.ts +11 -0
  293. package/dist/components/pos-relations.js +6 -0
  294. package/dist/components/pos-relations2.js +135 -0
  295. package/dist/components/pos-resource.d.ts +11 -0
  296. package/dist/components/pos-resource.js +6 -0
  297. package/dist/components/pos-resource2.js +126 -0
  298. package/dist/components/pos-reverse-relations.d.ts +11 -0
  299. package/dist/components/pos-reverse-relations.js +6 -0
  300. package/dist/components/pos-reverse-relations2.js +135 -0
  301. package/dist/components/pos-rich-link.d.ts +11 -0
  302. package/dist/components/pos-rich-link.js +6 -0
  303. package/dist/components/pos-rich-link2.js +106 -0
  304. package/dist/components/pos-router.d.ts +11 -0
  305. package/dist/components/pos-router.js +6 -0
  306. package/dist/components/pos-router2.js +813 -0
  307. package/dist/components/pos-subjects.d.ts +11 -0
  308. package/dist/components/pos-subjects.js +6 -0
  309. package/dist/components/pos-subjects2.js +125 -0
  310. package/dist/components/pos-type-badges.d.ts +11 -0
  311. package/dist/components/pos-type-badges.js +6 -0
  312. package/dist/components/pos-type-badges2.js +69 -0
  313. package/dist/components/pos-type-router.d.ts +11 -0
  314. package/dist/components/pos-type-router.js +6 -0
  315. package/dist/components/pos-type-router2.js +241 -0
  316. package/dist/components/progress-bar.js +91 -0
  317. package/dist/components/radio-group.js +139 -0
  318. package/dist/components/radio.js +135 -0
  319. package/dist/components/ripple-effect.js +107 -0
  320. package/dist/components/row.js +31 -0
  321. package/dist/components/searchbar.js +412 -0
  322. package/dist/components/select-popover.js +174 -0
  323. package/dist/components/session.js +202 -0
  324. package/dist/components/skeleton-text.js +46 -0
  325. package/dist/components/spinner.js +224 -0
  326. package/dist/{custom-elements → components}/status-tap.js +8 -4
  327. package/dist/{custom-elements → components}/swipe-back.js +33 -13
  328. package/dist/{custom-elements → components}/swiper.bundle.js +0 -0
  329. package/dist/{esm/theme-d21826a7.js → components/theme.js} +9 -5
  330. package/dist/components/title.js +66 -0
  331. package/dist/components/toolbar.js +87 -0
  332. package/dist/elements/elements.css +1 -1
  333. package/dist/elements/elements.esm.js +1 -1
  334. package/dist/elements/p-00f19b1d.js +4 -0
  335. package/dist/elements/p-0587332d.entry.js +1 -0
  336. package/dist/elements/p-07f54139.entry.js +7 -0
  337. package/dist/elements/{p-cfc0e54d.js → p-0991c811.js} +3 -0
  338. package/dist/elements/p-0a69a563.entry.js +1 -0
  339. package/dist/elements/p-0d284fe0.entry.js +1 -0
  340. package/dist/elements/p-116437b0.entry.js +13 -0
  341. package/dist/elements/p-12880671.entry.js +1 -0
  342. package/dist/elements/p-14ccd586.entry.js +1 -0
  343. package/dist/elements/{p-83d45051.entry.js → p-14df6ac0.entry.js} +1 -1
  344. package/dist/elements/{p-e860be6a.entry.js → p-17079f06.entry.js} +1 -1
  345. package/dist/elements/p-19e4a688.js +4 -0
  346. package/dist/elements/p-1afc4eb4.js +4 -0
  347. package/dist/elements/p-1beaf6bf.js +4 -0
  348. package/dist/elements/p-1d1c6a6f.entry.js +1 -0
  349. package/dist/elements/{p-31d30e42.entry.js → p-1d98f84b.entry.js} +1 -1
  350. package/dist/elements/p-1e617706.entry.js +7 -0
  351. package/dist/elements/p-278ca4c9.js +4 -0
  352. package/dist/elements/p-27f5629c.entry.js +1 -0
  353. package/dist/elements/p-29c0f03f.js +4 -0
  354. package/dist/elements/p-2a629468.entry.js +4 -0
  355. package/dist/elements/p-2da59aca.js +4 -0
  356. package/dist/elements/p-3152143f.js +4 -0
  357. package/dist/elements/p-343ff720.entry.js +7 -0
  358. package/dist/elements/p-36d4c9a8.js +4 -0
  359. package/dist/elements/p-3a30dfb2.entry.js +1 -0
  360. package/dist/elements/p-3c013bf1.entry.js +1 -0
  361. package/dist/elements/{p-74ba1e42.entry.js → p-3c318da5.entry.js} +1 -1
  362. package/dist/elements/p-3cee3222.entry.js +1 -0
  363. package/dist/elements/p-3d0f59af.entry.js +7 -0
  364. package/dist/elements/p-41cb5688.entry.js +1 -0
  365. package/dist/elements/p-480b3c4f.entry.js +1 -0
  366. package/dist/elements/p-4e9d8f18.entry.js +1 -0
  367. package/dist/elements/p-53e23176.js +2 -0
  368. package/dist/elements/p-548524f3.js +4 -0
  369. package/dist/elements/p-5739fa41.entry.js +1 -0
  370. package/dist/elements/p-5808c505.js +1 -0
  371. package/dist/elements/p-58a8cc2a.js +4 -0
  372. package/dist/elements/p-6035415e.entry.js +1 -0
  373. package/dist/elements/p-60eeae90.js +4 -0
  374. package/dist/elements/p-667550a9.entry.js +14 -0
  375. package/dist/elements/p-67777478.entry.js +1 -0
  376. package/dist/elements/p-6ab826e1.entry.js +1 -0
  377. package/dist/elements/p-6f5a2827.entry.js +1 -0
  378. package/dist/elements/p-7916ecc5.entry.js +1 -0
  379. package/dist/elements/p-79f06b80.entry.js +1 -0
  380. package/dist/elements/p-7d0def79.js +5 -0
  381. package/dist/elements/p-8112afea.js +4 -0
  382. package/dist/elements/p-83678d7d.entry.js +4 -0
  383. package/dist/elements/p-87e45c94.entry.js +1 -0
  384. package/dist/elements/p-8f80768f.entry.js +4 -0
  385. package/dist/elements/p-8fe0433b.js +4 -0
  386. package/dist/elements/{p-4cb27b48.entry.js → p-9147d82b.entry.js} +1 -1
  387. package/dist/elements/p-96aeb07a.entry.js +1 -0
  388. package/dist/elements/p-97abb434.entry.js +1 -0
  389. package/dist/elements/p-98497a4b.entry.js +1 -0
  390. package/dist/elements/p-9c719139.js +4 -0
  391. package/dist/elements/p-9ca37332.js +4 -0
  392. package/dist/elements/{p-37de7110.js → p-9d48def2.js} +3 -0
  393. package/dist/elements/p-a805f2f9.entry.js +1 -0
  394. package/dist/elements/p-a86a5bfa.entry.js +1 -0
  395. package/dist/elements/{p-9c1dbe52.entry.js → p-ac34eab7.entry.js} +1 -1
  396. package/dist/elements/p-ad366eab.entry.js +4 -0
  397. package/dist/elements/p-aef3a931.js +7 -0
  398. package/dist/elements/p-b0537eb3.entry.js +1 -0
  399. package/dist/elements/p-b41e66f0.entry.js +1 -0
  400. package/dist/elements/p-b47e7091.entry.js +1 -0
  401. package/dist/elements/p-b840320e.js +4 -0
  402. package/dist/elements/p-b934ac5d.entry.js +1 -0
  403. package/dist/elements/p-bc63f4b6.entry.js +1 -0
  404. package/dist/elements/p-bd12806f.entry.js +1 -0
  405. package/dist/elements/p-bf90022d.entry.js +4 -0
  406. package/dist/elements/p-c16d38d5.js +4 -0
  407. package/dist/elements/p-c84205a3.js +4 -0
  408. package/dist/elements/{p-06675ac7.entry.js → p-cbe318f8.entry.js} +1 -1
  409. package/dist/elements/p-cfed7395.js +4 -0
  410. package/dist/elements/p-d3e75c94.entry.js +1 -0
  411. package/dist/elements/p-d8e7ebf4.entry.js +7 -0
  412. package/dist/elements/p-d9880221.entry.js +4 -0
  413. package/dist/elements/p-da5db8fb.entry.js +1 -0
  414. package/dist/elements/{p-91fe653f.js → p-dcc6b03c.js} +3 -0
  415. package/dist/elements/{p-305e246c.entry.js → p-dd846020.entry.js} +1 -1
  416. package/dist/elements/p-dffd8689.js +4 -0
  417. package/dist/elements/p-e3bcb6e8.entry.js +1 -0
  418. package/dist/elements/p-e495a095.js +4 -0
  419. package/dist/elements/p-e59d9789.entry.js +1 -0
  420. package/dist/elements/p-e5fc7d42.entry.js +1 -0
  421. package/dist/elements/{p-aaa8393e.entry.js → p-eb137e9d.entry.js} +1 -1
  422. package/dist/elements/p-f4e54a17.js +7 -0
  423. package/dist/elements/p-f67d0717.entry.js +1 -0
  424. package/dist/elements/p-f7f4c640.js +1 -0
  425. package/dist/elements/p-f851b91a.js +4 -0
  426. package/dist/elements/p-fb27ee76.entry.js +1 -0
  427. package/dist/elements/p-fbddca35.entry.js +1 -0
  428. package/dist/elements/p-fdac5f3a.js +4 -0
  429. package/dist/elements/p-feb0cea8.entry.js +4 -0
  430. package/dist/esm/animation-801a007a.js +986 -0
  431. package/dist/esm/{app-globals-27d92837.js → app-globals-05a3abfb.js} +1 -1
  432. package/dist/esm/cubic-bezier-538b6253.js +90 -0
  433. package/dist/esm/data-62c81c24.js +1463 -0
  434. package/dist/esm/dir-defb16c6.js +18 -0
  435. package/dist/esm/elements.js +5 -5
  436. package/dist/esm/focus-visible-78d55799.js +74 -0
  437. package/dist/esm/framework-delegate-7e2b767b.js +115 -0
  438. package/dist/esm/gesture-controller-c466ff14.js +195 -0
  439. package/dist/esm/haptic-e7d5ef4d.js +135 -0
  440. package/dist/esm/hardware-back-button-242191a7.js +71 -0
  441. package/dist/esm/helpers-aeff219b.js +410 -0
  442. package/dist/esm/index-0dbaca1a.js +28 -0
  443. package/dist/esm/index-1f3d8582.js +34 -0
  444. package/dist/esm/index-2be9a18b.js +312 -0
  445. package/dist/esm/index-51e4a829.js +137 -0
  446. package/dist/esm/index-6048aed6.js +224 -0
  447. package/dist/esm/index-65ecd543.js +25 -0
  448. package/dist/{custom-elements/tap-click.js → esm/index-b212db1c.js} +37 -19
  449. package/dist/esm/{index-e4deec27.js → index-cb938ffb.js} +7 -1
  450. package/dist/esm/index-d39eb62b.js +463 -0
  451. package/dist/esm/index-ebf7f059.js +128 -0
  452. package/dist/esm/{input-shims-3b48722f.js → input-shims-8a389148.js} +89 -38
  453. package/dist/esm/ion-accordion-group.entry.js +201 -0
  454. package/dist/esm/ion-accordion.entry.js +332 -0
  455. package/dist/esm/ion-action-sheet_3.entry.js +859 -0
  456. package/dist/esm/{ion-app_45.entry.js → ion-app_46.entry.js} +1906 -1493
  457. package/dist/esm/ion-avatar.entry.js +2 -2
  458. package/dist/esm/ion-back-button.entry.js +12 -11
  459. package/dist/esm/ion-backdrop.entry.js +4 -4
  460. package/dist/esm/ion-breadcrumb.entry.js +97 -0
  461. package/dist/esm/ion-breadcrumbs.entry.js +133 -0
  462. package/dist/esm/ion-buttons_3.entry.js +793 -0
  463. package/dist/esm/ion-card-subtitle.entry.js +4 -4
  464. package/dist/esm/{ion-list-header_3.entry.js → ion-checkbox_4.entry.js} +124 -24
  465. package/dist/esm/ion-chip.entry.js +5 -10
  466. package/dist/esm/ion-datetime-button.entry.js +342 -0
  467. package/dist/esm/ion-datetime.entry.js +1548 -856
  468. package/dist/esm/ion-fab-button.entry.js +26 -9
  469. package/dist/esm/ion-fab-list.entry.js +4 -4
  470. package/dist/esm/ion-fab.entry.js +15 -13
  471. package/dist/esm/ion-img.entry.js +28 -4
  472. package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
  473. package/dist/esm/ion-infinite-scroll.entry.js +13 -13
  474. package/dist/esm/ion-input.entry.js +57 -23
  475. package/dist/esm/ion-item-option.entry.js +8 -8
  476. package/dist/esm/ion-item-options.entry.js +5 -5
  477. package/dist/esm/ion-item-sliding.entry.js +59 -63
  478. package/dist/esm/ion-loading.entry.js +38 -37
  479. package/dist/esm/ion-menu-button.entry.js +14 -12
  480. package/dist/esm/ion-menu-toggle.entry.js +8 -7
  481. package/dist/esm/ion-menu.entry.js +71 -57
  482. package/dist/esm/ion-modal.entry.js +1377 -147
  483. package/dist/esm/ion-nav-link.entry.js +5 -2
  484. package/dist/esm/ion-nav.entry.js +177 -171
  485. package/dist/esm/ion-picker-column.entry.js +25 -27
  486. package/dist/esm/ion-picker.entry.js +22 -17
  487. package/dist/esm/ion-popover.entry.js +1208 -182
  488. package/dist/esm/ion-range.entry.js +137 -57
  489. package/dist/esm/ion-refresher-content.entry.js +7 -12
  490. package/dist/esm/ion-refresher.entry.js +149 -147
  491. package/dist/esm/ion-reorder-group.entry.js +42 -35
  492. package/dist/esm/ion-reorder.entry.js +5 -4
  493. package/dist/esm/ion-route-redirect.entry.js +1 -1
  494. package/dist/esm/ion-route.entry.js +1 -1
  495. package/dist/esm/ion-router-link.entry.js +5 -5
  496. package/dist/esm/ion-router-outlet.entry.js +24 -20
  497. package/dist/esm/ion-router.entry.js +291 -194
  498. package/dist/esm/ion-segment-button.entry.js +10 -17
  499. package/dist/esm/ion-segment.entry.js +127 -26
  500. package/dist/esm/ion-select-option.entry.js +3 -3
  501. package/dist/esm/ion-select.entry.js +113 -78
  502. package/dist/esm/ion-slide.entry.js +3 -3
  503. package/dist/esm/ion-slides.entry.js +26 -27
  504. package/dist/esm/ion-spinner.entry.js +10 -9
  505. package/dist/esm/ion-split-pane.entry.js +16 -12
  506. package/dist/esm/ion-tab-bar.entry.js +16 -23
  507. package/dist/esm/ion-tab-button.entry.js +6 -6
  508. package/dist/esm/ion-tab.entry.js +4 -4
  509. package/dist/esm/ion-tabs.entry.js +4 -5
  510. package/dist/esm/ion-text.entry.js +3 -3
  511. package/dist/esm/ion-textarea.entry.js +31 -29
  512. package/dist/esm/ion-thumbnail.entry.js +2 -2
  513. package/dist/esm/ion-toast.entry.js +50 -60
  514. package/dist/esm/ion-toggle.entry.js +41 -22
  515. package/dist/esm/ion-virtual-scroll.entry.js +39 -31
  516. package/dist/esm/{ionic-global-2e28f7c7.js → ionic-global-6cd57191.js} +112 -93
  517. package/dist/esm/{ios.transition-a783e3cd.js → ios.transition-bbd952f2.js} +78 -53
  518. package/dist/esm/{keyboard-e6abcb80.js → keyboard-413afe04.js} +6 -3
  519. package/dist/esm/keyboard-controller-33693bc2.js +40 -0
  520. package/dist/esm/loader.js +5 -5
  521. package/dist/esm/{md.transition-5a4a8c82.js → md.transition-5170a6d3.js} +15 -17
  522. package/dist/esm/menu-toggle-util-82bf888a.js +12 -0
  523. package/dist/esm/overlays-bd4abb68.js +502 -0
  524. package/dist/esm/spinner-configs-cbcd1f62.js +145 -0
  525. package/dist/esm/{status-tap-69e62ad6.js → status-tap-ad757b8a.js} +10 -5
  526. package/dist/esm/swipe-back-7ef22876.js +69 -0
  527. package/dist/esm/theme-7cf2cab0.js +43 -0
  528. package/dist/types/components.d.ts +0 -13
  529. package/package.json +7 -8
  530. package/dist/cjs/button-active-c14dab31.js +0 -66
  531. package/dist/cjs/focus-visible-16c98640.js +0 -45
  532. package/dist/cjs/framework-delegate-c45292a3.js +0 -37
  533. package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -265
  534. package/dist/cjs/ion-alert.cjs.entry.js +0 -456
  535. package/dist/cjs/ion-buttons.cjs.entry.js +0 -42
  536. package/dist/cjs/ion-checkbox.cjs.entry.js +0 -117
  537. package/dist/cjs/ion-note.cjs.entry.js +0 -29
  538. package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
  539. package/dist/cjs/spinner-configs-fb16b986.js +0 -112
  540. package/dist/cjs/test-component.cjs.entry.js +0 -13
  541. package/dist/collection/test/TestComponent.js +0 -3
  542. package/dist/collection/test/mockPodOS.js +0 -35
  543. package/dist/collection/test/renderFunctionalComponent.js +0 -8
  544. package/dist/custom-elements/focus-visible.js +0 -43
  545. package/dist/custom-elements/index.d.ts +0 -165
  546. package/dist/elements/p-03bda390.js +0 -1
  547. package/dist/elements/p-0be044f1.entry.js +0 -1
  548. package/dist/elements/p-119c7c6c.entry.js +0 -1
  549. package/dist/elements/p-14c7c3ea.entry.js +0 -1
  550. package/dist/elements/p-1d4a2c61.js +0 -1
  551. package/dist/elements/p-1d894ac4.entry.js +0 -1
  552. package/dist/elements/p-1dafa1ce.entry.js +0 -1
  553. package/dist/elements/p-23b89ccb.entry.js +0 -1
  554. package/dist/elements/p-2c03b9ab.entry.js +0 -1
  555. package/dist/elements/p-346985f2.js +0 -1
  556. package/dist/elements/p-360f1c62.entry.js +0 -1
  557. package/dist/elements/p-373e1f25.entry.js +0 -1
  558. package/dist/elements/p-40547acb.entry.js +0 -1
  559. package/dist/elements/p-40b68014.entry.js +0 -1
  560. package/dist/elements/p-42e4f702.entry.js +0 -1
  561. package/dist/elements/p-489807e5.js +0 -1
  562. package/dist/elements/p-4ad72d54.entry.js +0 -1
  563. package/dist/elements/p-4cca7b5e.entry.js +0 -1
  564. package/dist/elements/p-4f24d306.js +0 -1
  565. package/dist/elements/p-519d6a53.entry.js +0 -1
  566. package/dist/elements/p-536e8e52.entry.js +0 -1
  567. package/dist/elements/p-599bb53f.entry.js +0 -1
  568. package/dist/elements/p-5eb7a546.js +0 -1
  569. package/dist/elements/p-60df2bed.entry.js +0 -1
  570. package/dist/elements/p-65133e33.js +0 -1
  571. package/dist/elements/p-6693fce8.js +0 -1
  572. package/dist/elements/p-689bdcc1.entry.js +0 -1
  573. package/dist/elements/p-70713b3d.entry.js +0 -1
  574. package/dist/elements/p-707d5d76.js +0 -1
  575. package/dist/elements/p-7212b7f2.js +0 -1
  576. package/dist/elements/p-73992898.entry.js +0 -1
  577. package/dist/elements/p-792c1e0f.entry.js +0 -1
  578. package/dist/elements/p-7e5300af.js +0 -2
  579. package/dist/elements/p-8068987c.entry.js +0 -1
  580. package/dist/elements/p-83accf46.entry.js +0 -1
  581. package/dist/elements/p-86635d06.entry.js +0 -1
  582. package/dist/elements/p-874c2b44.js +0 -1
  583. package/dist/elements/p-89c12ce8.entry.js +0 -1
  584. package/dist/elements/p-8bcba3f7.entry.js +0 -1
  585. package/dist/elements/p-8c759f51.entry.js +0 -1
  586. package/dist/elements/p-8f945e6b.entry.js +0 -1
  587. package/dist/elements/p-9300ab6a.js +0 -1
  588. package/dist/elements/p-93cacd51.entry.js +0 -1
  589. package/dist/elements/p-9408d0b4.entry.js +0 -1
  590. package/dist/elements/p-98c79eda.js +0 -1
  591. package/dist/elements/p-99f8abed.js +0 -1
  592. package/dist/elements/p-9ca7e079.js +0 -1
  593. package/dist/elements/p-a4648b74.entry.js +0 -1
  594. package/dist/elements/p-aab0f63c.js +0 -1
  595. package/dist/elements/p-ad4e2295.entry.js +0 -1
  596. package/dist/elements/p-afb8f7d5.entry.js +0 -1
  597. package/dist/elements/p-b055ec44.js +0 -1
  598. package/dist/elements/p-b078d63b.entry.js +0 -1
  599. package/dist/elements/p-b3460325.entry.js +0 -1
  600. package/dist/elements/p-b5406b58.entry.js +0 -1
  601. package/dist/elements/p-b5ef0c91.entry.js +0 -1
  602. package/dist/elements/p-b6ba623e.entry.js +0 -1
  603. package/dist/elements/p-b9926d8b.entry.js +0 -1
  604. package/dist/elements/p-bfd4cfcd.entry.js +0 -1
  605. package/dist/elements/p-c08dd7d0.entry.js +0 -1
  606. package/dist/elements/p-c0db9c51.entry.js +0 -1
  607. package/dist/elements/p-c1e7fbfb.js +0 -1
  608. package/dist/elements/p-ca69d6c9.js +0 -1
  609. package/dist/elements/p-cc4cb1ac.entry.js +0 -1
  610. package/dist/elements/p-cf8a7031.entry.js +0 -1
  611. package/dist/elements/p-cff82b6f.js +0 -1
  612. package/dist/elements/p-d01009b8.entry.js +0 -67
  613. package/dist/elements/p-d6d1e65f.entry.js +0 -1
  614. package/dist/elements/p-d9462b66.entry.js +0 -1
  615. package/dist/elements/p-e2e0fee9.entry.js +0 -1
  616. package/dist/elements/p-e642b266.entry.js +0 -1
  617. package/dist/elements/p-e953934f.entry.js +0 -1
  618. package/dist/elements/p-f0474f46.js +0 -1
  619. package/dist/elements/p-f10a94f6.entry.js +0 -1
  620. package/dist/elements/p-f2426182.entry.js +0 -1
  621. package/dist/elements/p-f327fd21.js +0 -1
  622. package/dist/elements/p-f84987ee.js +0 -1
  623. package/dist/elements/p-f8a3367d.entry.js +0 -1
  624. package/dist/esm/focus-visible-edb28f19.js +0 -43
  625. package/dist/esm/framework-delegate-9cd8048f.js +0 -34
  626. package/dist/esm/ion-action-sheet.entry.js +0 -261
  627. package/dist/esm/ion-note.entry.js +0 -25
  628. package/dist/esm/ion-select-popover.entry.js +0 -31
  629. package/dist/esm/spinner-configs-aaf2a1a9.js +0 -110
  630. package/dist/esm/swipe-back-d84cfc8a.js +0 -50
  631. package/dist/esm/test-component.entry.js +0 -9
  632. package/dist/types/test/TestComponent.d.ts +0 -2
  633. package/dist/types/test/mockPodOS.d.ts +0 -11
  634. package/dist/types/test/renderFunctionalComponent.d.ts +0 -1
@@ -0,0 +1,1463 @@
1
+ import { p as printIonWarning } from './index-1f3d8582.js';
2
+
3
+ /*!
4
+ * (C) Ionic http://ionicframework.com - MIT License
5
+ */
6
+ /**
7
+ * Returns true if the selected day is equal to the reference day
8
+ */
9
+ const isSameDay = (baseParts, compareParts) => {
10
+ return (baseParts.month === compareParts.month && baseParts.day === compareParts.day && baseParts.year === compareParts.year);
11
+ };
12
+ /**
13
+ * Returns true is the selected day is before the reference day.
14
+ */
15
+ const isBefore = (baseParts, compareParts) => {
16
+ return !!(baseParts.year < compareParts.year ||
17
+ (baseParts.year === compareParts.year && baseParts.month < compareParts.month) ||
18
+ (baseParts.year === compareParts.year &&
19
+ baseParts.month === compareParts.month &&
20
+ baseParts.day !== null &&
21
+ baseParts.day < compareParts.day));
22
+ };
23
+ /**
24
+ * Returns true is the selected day is after the reference day.
25
+ */
26
+ const isAfter = (baseParts, compareParts) => {
27
+ return !!(baseParts.year > compareParts.year ||
28
+ (baseParts.year === compareParts.year && baseParts.month > compareParts.month) ||
29
+ (baseParts.year === compareParts.year &&
30
+ baseParts.month === compareParts.month &&
31
+ baseParts.day !== null &&
32
+ baseParts.day > compareParts.day));
33
+ };
34
+ const warnIfValueOutOfBounds = (value, min, max) => {
35
+ const valueArray = Array.isArray(value) ? value : [value];
36
+ for (const val of valueArray) {
37
+ if ((min !== undefined && isBefore(val, min)) || (max !== undefined && isAfter(val, max))) {
38
+ printIonWarning('The value provided to ion-datetime is out of bounds.\n\n' +
39
+ `Min: ${JSON.stringify(min)}\n` +
40
+ `Max: ${JSON.stringify(max)}\n` +
41
+ `Value: ${JSON.stringify(value)}`);
42
+ break;
43
+ }
44
+ }
45
+ };
46
+
47
+ /*!
48
+ * (C) Ionic http://ionicframework.com - MIT License
49
+ */
50
+ /**
51
+ * Determines if given year is a
52
+ * leap year. Returns `true` if year
53
+ * is a leap year. Returns `false`
54
+ * otherwise.
55
+ */
56
+ const isLeapYear = (year) => {
57
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
58
+ };
59
+ const is24Hour = (locale, hourCycle) => {
60
+ /**
61
+ * If developer has explicitly enabled h23 time
62
+ * then return early and do not look at the system default.
63
+ */
64
+ if (hourCycle !== undefined) {
65
+ return hourCycle === 'h23';
66
+ }
67
+ /**
68
+ * If hourCycle was not specified, check the locale
69
+ * that is set on the user's device. We first check the
70
+ * Intl.DateTimeFormat hourCycle option as developers can encode this
71
+ * option into the locale string. Example: `en-US-u-hc-h23`
72
+ */
73
+ const formatted = new Intl.DateTimeFormat(locale, { hour: 'numeric' });
74
+ const options = formatted.resolvedOptions();
75
+ if (options.hourCycle !== undefined) {
76
+ return options.hourCycle === 'h23';
77
+ }
78
+ /**
79
+ * If hourCycle is not specified (either through lack
80
+ * of browser support or locale information) then fall
81
+ * back to this slower hourCycle check.
82
+ */
83
+ const date = new Date('5/18/2021 00:00');
84
+ const parts = formatted.formatToParts(date);
85
+ const hour = parts.find((p) => p.type === 'hour');
86
+ if (!hour) {
87
+ throw new Error('Hour value not found from DateTimeFormat');
88
+ }
89
+ return hour.value === '00';
90
+ };
91
+ /**
92
+ * Given a date object, returns the number
93
+ * of days in that month.
94
+ * Month value begin at 1, not 0.
95
+ * i.e. January = month 1.
96
+ */
97
+ const getNumDaysInMonth = (month, year) => {
98
+ return month === 4 || month === 6 || month === 9 || month === 11
99
+ ? 30
100
+ : month === 2
101
+ ? isLeapYear(year)
102
+ ? 29
103
+ : 28
104
+ : 31;
105
+ };
106
+ /**
107
+ * Certain locales display month then year while
108
+ * others display year then month.
109
+ * We can use Intl.DateTimeFormat to determine
110
+ * the ordering for each locale.
111
+ * The formatOptions param can be used to customize
112
+ * which pieces of a date to compare against the month
113
+ * with. For example, some locales render dd/mm/yyyy
114
+ * while others render mm/dd/yyyy. This function can be
115
+ * used for variations of the same "month first" check.
116
+ */
117
+ const isMonthFirstLocale = (locale, formatOptions = {
118
+ month: 'numeric',
119
+ year: 'numeric',
120
+ }) => {
121
+ /**
122
+ * By setting month and year we guarantee that only
123
+ * month, year, and literal (slashes '/', for example)
124
+ * values are included in the formatToParts results.
125
+ *
126
+ * The ordering of the parts will be determined by
127
+ * the locale. So if the month is the first value,
128
+ * then we know month should be shown first. If the
129
+ * year is the first value, then we know year should be shown first.
130
+ *
131
+ * This ordering can be controlled by customizing the locale property.
132
+ */
133
+ const parts = new Intl.DateTimeFormat(locale, formatOptions).formatToParts(new Date());
134
+ return parts[0].type === 'month';
135
+ };
136
+ /**
137
+ * Determines if the given locale formats the day period (am/pm) to the
138
+ * left or right of the hour.
139
+ * @param locale The locale to check.
140
+ * @returns `true` if the locale formats the day period to the left of the hour.
141
+ */
142
+ const isLocaleDayPeriodRTL = (locale) => {
143
+ const parts = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).formatToParts(new Date());
144
+ return parts[0].type === 'dayPeriod';
145
+ };
146
+
147
+ /*!
148
+ * (C) Ionic http://ionicframework.com - MIT License
149
+ */
150
+ const ISO_8601_REGEXP =
151
+ // eslint-disable-next-line no-useless-escape
152
+ /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
153
+ // eslint-disable-next-line no-useless-escape
154
+ const TIME_REGEXP = /^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
155
+ /**
156
+ * Use to convert a string of comma separated numbers or
157
+ * an array of numbers, and clean up any user input
158
+ */
159
+ const convertToArrayOfNumbers = (input) => {
160
+ if (input === undefined) {
161
+ return;
162
+ }
163
+ let processedInput = input;
164
+ if (typeof input === 'string') {
165
+ // convert the string to an array of strings
166
+ // auto remove any whitespace and [] characters
167
+ processedInput = input.replace(/\[|\]|\s/g, '').split(',');
168
+ }
169
+ let values;
170
+ if (Array.isArray(processedInput)) {
171
+ // ensure each value is an actual number in the returned array
172
+ values = processedInput.map((num) => parseInt(num, 10)).filter(isFinite);
173
+ }
174
+ else {
175
+ values = [processedInput];
176
+ }
177
+ return values;
178
+ };
179
+ /**
180
+ * Extracts date information
181
+ * from a .calendar-day element
182
+ * into DatetimeParts.
183
+ */
184
+ const getPartsFromCalendarDay = (el) => {
185
+ return {
186
+ month: parseInt(el.getAttribute('data-month'), 10),
187
+ day: parseInt(el.getAttribute('data-day'), 10),
188
+ year: parseInt(el.getAttribute('data-year'), 10),
189
+ dayOfWeek: parseInt(el.getAttribute('data-day-of-week'), 10),
190
+ };
191
+ };
192
+ function parseDate(val) {
193
+ if (Array.isArray(val)) {
194
+ return val.map((valStr) => parseDate(valStr));
195
+ }
196
+ // manually parse IS0 cuz Date.parse cannot be trusted
197
+ // ISO 8601 format: 1994-12-15T13:47:20Z
198
+ let parse = null;
199
+ if (val != null && val !== '') {
200
+ // try parsing for just time first, HH:MM
201
+ parse = TIME_REGEXP.exec(val);
202
+ if (parse) {
203
+ // adjust the array so it fits nicely with the datetime parse
204
+ parse.unshift(undefined, undefined);
205
+ parse[2] = parse[3] = undefined;
206
+ }
207
+ else {
208
+ // try parsing for full ISO datetime
209
+ parse = ISO_8601_REGEXP.exec(val);
210
+ }
211
+ }
212
+ if (parse === null) {
213
+ // wasn't able to parse the ISO datetime
214
+ return undefined;
215
+ }
216
+ // ensure all the parse values exist with at least 0
217
+ for (let i = 1; i < 8; i++) {
218
+ parse[i] = parse[i] !== undefined ? parseInt(parse[i], 10) : undefined;
219
+ }
220
+ let tzOffset = 0;
221
+ if (parse[9] && parse[10]) {
222
+ // hours
223
+ tzOffset = parseInt(parse[10], 10) * 60;
224
+ if (parse[11]) {
225
+ // minutes
226
+ tzOffset += parseInt(parse[11], 10);
227
+ }
228
+ if (parse[9] === '-') {
229
+ // + or -
230
+ tzOffset *= -1;
231
+ }
232
+ }
233
+ // can also get second and millisecond from parse[6] and parse[7] if needed
234
+ return {
235
+ year: parse[1],
236
+ month: parse[2],
237
+ day: parse[3],
238
+ hour: parse[4],
239
+ minute: parse[5],
240
+ tzOffset,
241
+ ampm: parse[4] < 12 ? 'am' : 'pm',
242
+ };
243
+ }
244
+ const clampDate = (dateParts, minParts, maxParts) => {
245
+ if (minParts && isBefore(dateParts, minParts)) {
246
+ return minParts;
247
+ }
248
+ else if (maxParts && isAfter(dateParts, maxParts)) {
249
+ return maxParts;
250
+ }
251
+ return dateParts;
252
+ };
253
+ /**
254
+ * Parses an hour and returns if the value is in the morning (am) or afternoon (pm).
255
+ * @param hour The hour to format, should be 0-23
256
+ * @returns `pm` if the hour is greater than or equal to 12, `am` if less than 12.
257
+ */
258
+ const parseAmPm = (hour) => {
259
+ return hour >= 12 ? 'pm' : 'am';
260
+ };
261
+ /**
262
+ * Takes a max date string and creates a DatetimeParts
263
+ * object, filling in any missing information.
264
+ * For example, max="2012" would fill in the missing
265
+ * month, day, hour, and minute information.
266
+ */
267
+ const parseMaxParts = (max, todayParts) => {
268
+ const { month, day, year, hour, minute } = parseDate(max);
269
+ /**
270
+ * When passing in `max` or `min`, developers
271
+ * can pass in any ISO-8601 string. This means
272
+ * that not all of the date/time fields are defined.
273
+ * For example, passing max="2012" is valid even though
274
+ * there is no month, day, hour, or minute data.
275
+ * However, all of this data is required when clamping the date
276
+ * so that the correct initial value can be selected. As a result,
277
+ * we need to fill in any omitted data with the min or max values.
278
+ */
279
+ const yearValue = year !== null && year !== void 0 ? year : todayParts.year;
280
+ const monthValue = month !== null && month !== void 0 ? month : 12;
281
+ return {
282
+ month: monthValue,
283
+ day: day !== null && day !== void 0 ? day : getNumDaysInMonth(monthValue, yearValue),
284
+ /**
285
+ * Passing in "HH:mm" is a valid ISO-8601
286
+ * string, so we just default to the current year
287
+ * in this case.
288
+ */
289
+ year: yearValue,
290
+ hour: hour !== null && hour !== void 0 ? hour : 23,
291
+ minute: minute !== null && minute !== void 0 ? minute : 59,
292
+ };
293
+ };
294
+ /**
295
+ * Takes a min date string and creates a DatetimeParts
296
+ * object, filling in any missing information.
297
+ * For example, min="2012" would fill in the missing
298
+ * month, day, hour, and minute information.
299
+ */
300
+ const parseMinParts = (min, todayParts) => {
301
+ const { month, day, year, hour, minute } = parseDate(min);
302
+ /**
303
+ * When passing in `max` or `min`, developers
304
+ * can pass in any ISO-8601 string. This means
305
+ * that not all of the date/time fields are defined.
306
+ * For example, passing max="2012" is valid even though
307
+ * there is no month, day, hour, or minute data.
308
+ * However, all of this data is required when clamping the date
309
+ * so that the correct initial value can be selected. As a result,
310
+ * we need to fill in any omitted data with the min or max values.
311
+ */
312
+ return {
313
+ month: month !== null && month !== void 0 ? month : 1,
314
+ day: day !== null && day !== void 0 ? day : 1,
315
+ /**
316
+ * Passing in "HH:mm" is a valid ISO-8601
317
+ * string, so we just default to the current year
318
+ * in this case.
319
+ */
320
+ year: year !== null && year !== void 0 ? year : todayParts.year,
321
+ hour: hour !== null && hour !== void 0 ? hour : 0,
322
+ minute: minute !== null && minute !== void 0 ? minute : 0,
323
+ };
324
+ };
325
+
326
+ /*!
327
+ * (C) Ionic http://ionicframework.com - MIT License
328
+ */
329
+ const twoDigit = (val) => {
330
+ return ('0' + (val !== undefined ? Math.abs(val) : '0')).slice(-2);
331
+ };
332
+ const fourDigit = (val) => {
333
+ return ('000' + (val !== undefined ? Math.abs(val) : '0')).slice(-4);
334
+ };
335
+ function convertDataToISO(data) {
336
+ if (Array.isArray(data)) {
337
+ return data.map((parts) => convertDataToISO(parts));
338
+ }
339
+ // https://www.w3.org/TR/NOTE-datetime
340
+ let rtn = '';
341
+ if (data.year !== undefined) {
342
+ // YYYY
343
+ rtn = fourDigit(data.year);
344
+ if (data.month !== undefined) {
345
+ // YYYY-MM
346
+ rtn += '-' + twoDigit(data.month);
347
+ if (data.day !== undefined) {
348
+ // YYYY-MM-DD
349
+ rtn += '-' + twoDigit(data.day);
350
+ if (data.hour !== undefined) {
351
+ // YYYY-MM-DDTHH:mm:SS
352
+ rtn += `T${twoDigit(data.hour)}:${twoDigit(data.minute)}:00`;
353
+ if (data.tzOffset === undefined) {
354
+ // YYYY-MM-DDTHH:mm:SSZ
355
+ rtn += 'Z';
356
+ }
357
+ else {
358
+ // YYYY-MM-DDTHH:mm:SS+/-HH:mm
359
+ rtn +=
360
+ (data.tzOffset > 0 ? '+' : '-') +
361
+ twoDigit(Math.floor(Math.abs(data.tzOffset / 60))) +
362
+ ':' +
363
+ twoDigit(data.tzOffset % 60);
364
+ }
365
+ }
366
+ }
367
+ }
368
+ }
369
+ else if (data.hour !== undefined) {
370
+ // HH:mm
371
+ rtn = twoDigit(data.hour) + ':' + twoDigit(data.minute);
372
+ }
373
+ return rtn;
374
+ }
375
+ /**
376
+ * Converts an 12 hour value to 24 hours.
377
+ */
378
+ const convert12HourTo24Hour = (hour, ampm) => {
379
+ if (ampm === undefined) {
380
+ return hour;
381
+ }
382
+ /**
383
+ * If AM and 12am
384
+ * then return 00:00.
385
+ * Otherwise just return
386
+ * the hour since it is
387
+ * already in 24 hour format.
388
+ */
389
+ if (ampm === 'am') {
390
+ if (hour === 12) {
391
+ return 0;
392
+ }
393
+ return hour;
394
+ }
395
+ /**
396
+ * If PM and 12pm
397
+ * just return 12:00
398
+ * since it is already
399
+ * in 24 hour format.
400
+ * Otherwise add 12 hours
401
+ * to the time.
402
+ */
403
+ if (hour === 12) {
404
+ return 12;
405
+ }
406
+ return hour + 12;
407
+ };
408
+ const getStartOfWeek = (refParts) => {
409
+ const { dayOfWeek } = refParts;
410
+ if (dayOfWeek === null || dayOfWeek === undefined) {
411
+ throw new Error('No day of week provided');
412
+ }
413
+ return subtractDays(refParts, dayOfWeek);
414
+ };
415
+ const getEndOfWeek = (refParts) => {
416
+ const { dayOfWeek } = refParts;
417
+ if (dayOfWeek === null || dayOfWeek === undefined) {
418
+ throw new Error('No day of week provided');
419
+ }
420
+ return addDays(refParts, 6 - dayOfWeek);
421
+ };
422
+ const getNextDay = (refParts) => {
423
+ return addDays(refParts, 1);
424
+ };
425
+ const getPreviousDay = (refParts) => {
426
+ return subtractDays(refParts, 1);
427
+ };
428
+ const getPreviousWeek = (refParts) => {
429
+ return subtractDays(refParts, 7);
430
+ };
431
+ const getNextWeek = (refParts) => {
432
+ return addDays(refParts, 7);
433
+ };
434
+ /**
435
+ * Given datetime parts, subtract
436
+ * numDays from the date.
437
+ * Returns a new DatetimeParts object
438
+ * Currently can only go backward at most 1 month.
439
+ */
440
+ const subtractDays = (refParts, numDays) => {
441
+ const { month, day, year } = refParts;
442
+ if (day === null) {
443
+ throw new Error('No day provided');
444
+ }
445
+ const workingParts = {
446
+ month,
447
+ day,
448
+ year,
449
+ };
450
+ workingParts.day = day - numDays;
451
+ /**
452
+ * If wrapping to previous month
453
+ * update days and decrement month
454
+ */
455
+ if (workingParts.day < 1) {
456
+ workingParts.month -= 1;
457
+ }
458
+ /**
459
+ * If moving to previous year, reset
460
+ * month to December and decrement year
461
+ */
462
+ if (workingParts.month < 1) {
463
+ workingParts.month = 12;
464
+ workingParts.year -= 1;
465
+ }
466
+ /**
467
+ * Determine how many days are in the current
468
+ * month
469
+ */
470
+ if (workingParts.day < 1) {
471
+ const daysInMonth = getNumDaysInMonth(workingParts.month, workingParts.year);
472
+ /**
473
+ * Take num days in month and add the
474
+ * number of underflow days. This number will
475
+ * be negative.
476
+ * Example: 1 week before Jan 2, 2021 is
477
+ * December 26, 2021 so:
478
+ * 2 - 7 = -5
479
+ * 31 + (-5) = 26
480
+ */
481
+ workingParts.day = daysInMonth + workingParts.day;
482
+ }
483
+ return workingParts;
484
+ };
485
+ /**
486
+ * Given datetime parts, add
487
+ * numDays to the date.
488
+ * Returns a new DatetimeParts object
489
+ * Currently can only go forward at most 1 month.
490
+ */
491
+ const addDays = (refParts, numDays) => {
492
+ const { month, day, year } = refParts;
493
+ if (day === null) {
494
+ throw new Error('No day provided');
495
+ }
496
+ const workingParts = {
497
+ month,
498
+ day,
499
+ year,
500
+ };
501
+ const daysInMonth = getNumDaysInMonth(month, year);
502
+ workingParts.day = day + numDays;
503
+ /**
504
+ * If wrapping to next month
505
+ * update days and increment month
506
+ */
507
+ if (workingParts.day > daysInMonth) {
508
+ workingParts.day -= daysInMonth;
509
+ workingParts.month += 1;
510
+ }
511
+ /**
512
+ * If moving to next year, reset
513
+ * month to January and increment year
514
+ */
515
+ if (workingParts.month > 12) {
516
+ workingParts.month = 1;
517
+ workingParts.year += 1;
518
+ }
519
+ return workingParts;
520
+ };
521
+ /**
522
+ * Given DatetimeParts, generate the previous month.
523
+ */
524
+ const getPreviousMonth = (refParts) => {
525
+ /**
526
+ * If current month is January, wrap backwards
527
+ * to December of the previous year.
528
+ */
529
+ const month = refParts.month === 1 ? 12 : refParts.month - 1;
530
+ const year = refParts.month === 1 ? refParts.year - 1 : refParts.year;
531
+ const numDaysInMonth = getNumDaysInMonth(month, year);
532
+ const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
533
+ return { month, year, day };
534
+ };
535
+ /**
536
+ * Given DatetimeParts, generate the next month.
537
+ */
538
+ const getNextMonth = (refParts) => {
539
+ /**
540
+ * If current month is December, wrap forwards
541
+ * to January of the next year.
542
+ */
543
+ const month = refParts.month === 12 ? 1 : refParts.month + 1;
544
+ const year = refParts.month === 12 ? refParts.year + 1 : refParts.year;
545
+ const numDaysInMonth = getNumDaysInMonth(month, year);
546
+ const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
547
+ return { month, year, day };
548
+ };
549
+ const changeYear = (refParts, yearDelta) => {
550
+ const month = refParts.month;
551
+ const year = refParts.year + yearDelta;
552
+ const numDaysInMonth = getNumDaysInMonth(month, year);
553
+ const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
554
+ return { month, year, day };
555
+ };
556
+ /**
557
+ * Given DatetimeParts, generate the previous year.
558
+ */
559
+ const getPreviousYear = (refParts) => {
560
+ return changeYear(refParts, -1);
561
+ };
562
+ /**
563
+ * Given DatetimeParts, generate the next year.
564
+ */
565
+ const getNextYear = (refParts) => {
566
+ return changeYear(refParts, 1);
567
+ };
568
+ /**
569
+ * If PM, then internal value should
570
+ * be converted to 24-hr time.
571
+ * Does not apply when public
572
+ * values are already 24-hr time.
573
+ */
574
+ const getInternalHourValue = (hour, use24Hour, ampm) => {
575
+ if (use24Hour) {
576
+ return hour;
577
+ }
578
+ return convert12HourTo24Hour(hour, ampm);
579
+ };
580
+ /**
581
+ * Unless otherwise stated, all month values are
582
+ * 1 indexed instead of the typical 0 index in JS Date.
583
+ * Example:
584
+ * January = Month 0 when using JS Date
585
+ * January = Month 1 when using this datetime util
586
+ */
587
+ /**
588
+ * Given the current datetime parts and a new AM/PM value
589
+ * calculate what the hour should be in 24-hour time format.
590
+ * Used when toggling the AM/PM segment since we store our hours
591
+ * in 24-hour time format internally.
592
+ */
593
+ const calculateHourFromAMPM = (currentParts, newAMPM) => {
594
+ const { ampm: currentAMPM, hour } = currentParts;
595
+ let newHour = hour;
596
+ /**
597
+ * If going from AM --> PM, need to update the
598
+ *
599
+ */
600
+ if (currentAMPM === 'am' && newAMPM === 'pm') {
601
+ newHour = convert12HourTo24Hour(newHour, 'pm');
602
+ /**
603
+ * If going from PM --> AM
604
+ */
605
+ }
606
+ else if (currentAMPM === 'pm' && newAMPM === 'am') {
607
+ newHour = Math.abs(newHour - 12);
608
+ }
609
+ return newHour;
610
+ };
611
+ /**
612
+ * Updates parts to ensure that month and day
613
+ * values are valid. For days that do not exist,
614
+ * the closest valid day is used.
615
+ */
616
+ const validateParts = (parts, minParts, maxParts) => {
617
+ const { month, day, year } = parts;
618
+ const partsCopy = Object.assign({}, parts);
619
+ const numDays = getNumDaysInMonth(month, year);
620
+ /**
621
+ * If the max number of days
622
+ * is greater than the day we want
623
+ * to set, update the DatetimeParts
624
+ * day field to be the max days.
625
+ */
626
+ if (day !== null && numDays < day) {
627
+ partsCopy.day = numDays;
628
+ }
629
+ /**
630
+ * If value is same day as min day,
631
+ * make sure the time value is in bounds.
632
+ */
633
+ if (minParts !== undefined && isSameDay(partsCopy, minParts)) {
634
+ /**
635
+ * If the hour is out of bounds,
636
+ * update both the hour and minute.
637
+ * This is done so that the new time
638
+ * is closest to what the user selected.
639
+ */
640
+ if (partsCopy.hour !== undefined && minParts.hour !== undefined) {
641
+ if (partsCopy.hour < minParts.hour) {
642
+ partsCopy.hour = minParts.hour;
643
+ partsCopy.minute = minParts.minute;
644
+ /**
645
+ * If only the minute is out of bounds,
646
+ * set it to the min minute.
647
+ */
648
+ }
649
+ else if (partsCopy.hour === minParts.hour &&
650
+ partsCopy.minute !== undefined &&
651
+ minParts.minute !== undefined &&
652
+ partsCopy.minute < minParts.minute) {
653
+ partsCopy.minute = minParts.minute;
654
+ }
655
+ }
656
+ }
657
+ /**
658
+ * If value is same day as max day,
659
+ * make sure the time value is in bounds.
660
+ */
661
+ if (maxParts !== undefined && isSameDay(parts, maxParts)) {
662
+ /**
663
+ * If the hour is out of bounds,
664
+ * update both the hour and minute.
665
+ * This is done so that the new time
666
+ * is closest to what the user selected.
667
+ */
668
+ if (partsCopy.hour !== undefined && maxParts.hour !== undefined) {
669
+ if (partsCopy.hour > maxParts.hour) {
670
+ partsCopy.hour = maxParts.hour;
671
+ partsCopy.minute = maxParts.minute;
672
+ /**
673
+ * If only the minute is out of bounds,
674
+ * set it to the max minute.
675
+ */
676
+ }
677
+ else if (partsCopy.hour === maxParts.hour &&
678
+ partsCopy.minute !== undefined &&
679
+ maxParts.minute !== undefined &&
680
+ partsCopy.minute > maxParts.minute) {
681
+ partsCopy.minute = maxParts.minute;
682
+ }
683
+ }
684
+ }
685
+ return partsCopy;
686
+ };
687
+ /**
688
+ * Returns the closest date to refParts
689
+ * that also meets the constraints of
690
+ * the *Values params.
691
+ * @param refParts The reference date
692
+ * @param monthValues The allowed month values
693
+ * @param dayValues The allowed day (of the month) values
694
+ * @param yearValues The allowed year values
695
+ * @param hourValues The allowed hour values
696
+ * @param minuteValues The allowed minute values
697
+ */
698
+ const getClosestValidDate = (refParts, monthValues, dayValues, yearValues, hourValues, minuteValues) => {
699
+ const { hour, minute, day, month, year } = refParts;
700
+ const copyParts = Object.assign(Object.assign({}, refParts), { dayOfWeek: undefined });
701
+ if (monthValues !== undefined) {
702
+ copyParts.month = findClosestValue(month, monthValues);
703
+ }
704
+ // Day is nullable but cannot be undefined
705
+ if (day !== null && dayValues !== undefined) {
706
+ copyParts.day = findClosestValue(day, dayValues);
707
+ }
708
+ if (yearValues !== undefined) {
709
+ copyParts.year = findClosestValue(year, yearValues);
710
+ }
711
+ if (hour !== undefined && hourValues !== undefined) {
712
+ copyParts.hour = findClosestValue(hour, hourValues);
713
+ copyParts.ampm = parseAmPm(copyParts.hour);
714
+ }
715
+ if (minute !== undefined && minuteValues !== undefined) {
716
+ copyParts.minute = findClosestValue(minute, minuteValues);
717
+ }
718
+ return copyParts;
719
+ };
720
+ /**
721
+ * Finds the value in "values" that is
722
+ * numerically closest to "reference".
723
+ * This function assumes that "values" is
724
+ * already sorted in ascending order.
725
+ * @param reference The reference number to use
726
+ * when finding the closest value
727
+ * @param values The allowed values that will be
728
+ * searched to find the closest value to "reference"
729
+ */
730
+ const findClosestValue = (reference, values) => {
731
+ let closestValue = values[0];
732
+ let rank = Math.abs(closestValue - reference);
733
+ for (let i = 1; i < values.length; i++) {
734
+ const value = values[i];
735
+ /**
736
+ * This code prioritizes the first
737
+ * closest result. Given two values
738
+ * with the same distance from reference,
739
+ * this code will prioritize the smaller of
740
+ * the two values.
741
+ */
742
+ const valueRank = Math.abs(value - reference);
743
+ if (valueRank < rank) {
744
+ closestValue = value;
745
+ rank = valueRank;
746
+ }
747
+ }
748
+ return closestValue;
749
+ };
750
+
751
+ /*!
752
+ * (C) Ionic http://ionicframework.com - MIT License
753
+ */
754
+ const getFormattedDayPeriod = (dayPeriod) => {
755
+ if (dayPeriod === undefined) {
756
+ return '';
757
+ }
758
+ return dayPeriod.toUpperCase();
759
+ };
760
+ const getLocalizedTime = (locale, refParts, use24Hour) => {
761
+ if (refParts.hour === undefined || refParts.minute === undefined) {
762
+ return 'Invalid Time';
763
+ }
764
+ return new Intl.DateTimeFormat(locale, {
765
+ hour: 'numeric',
766
+ minute: 'numeric',
767
+ timeZone: 'UTC',
768
+ /**
769
+ * We use hourCycle here instead of hour12 due to:
770
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
771
+ */
772
+ hourCycle: use24Hour ? 'h23' : 'h12',
773
+ }).format(new Date(convertDataToISO(Object.assign(Object.assign({}, refParts), {
774
+ // TODO: FW-1831 will remove the need to manually set the tzOffset to undefined
775
+ tzOffset: undefined
776
+ }))));
777
+ };
778
+ /**
779
+ * Adds padding to a time value so
780
+ * that it is always 2 digits.
781
+ */
782
+ const addTimePadding = (value) => {
783
+ const valueToString = value.toString();
784
+ if (valueToString.length > 1) {
785
+ return valueToString;
786
+ }
787
+ return `0${valueToString}`;
788
+ };
789
+ /**
790
+ * Formats 24 hour times so that
791
+ * it always has 2 digits. For
792
+ * 12 hour times it ensures that
793
+ * hour 0 is formatted as '12'.
794
+ */
795
+ const getFormattedHour = (hour, use24Hour) => {
796
+ if (use24Hour) {
797
+ return addTimePadding(hour);
798
+ }
799
+ /**
800
+ * If using 12 hour
801
+ * format, make sure hour
802
+ * 0 is formatted as '12'.
803
+ */
804
+ if (hour === 0) {
805
+ return '12';
806
+ }
807
+ return hour.toString();
808
+ };
809
+ /**
810
+ * Generates an aria-label to be read by screen readers
811
+ * given a local, a date, and whether or not that date is
812
+ * today's date.
813
+ */
814
+ const generateDayAriaLabel = (locale, today, refParts) => {
815
+ if (refParts.day === null) {
816
+ return null;
817
+ }
818
+ /**
819
+ * MM/DD/YYYY will return midnight in the user's timezone.
820
+ */
821
+ const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
822
+ const labelString = new Intl.DateTimeFormat(locale, {
823
+ weekday: 'long',
824
+ month: 'long',
825
+ day: 'numeric',
826
+ timeZone: 'UTC',
827
+ }).format(date);
828
+ /**
829
+ * If date is today, prepend "Today" so screen readers indicate
830
+ * that the date is today.
831
+ */
832
+ return today ? `Today, ${labelString}` : labelString;
833
+ };
834
+ /**
835
+ * Gets the day of the week, month, and day
836
+ * Used for the header in MD mode.
837
+ */
838
+ const getMonthAndDay = (locale, refParts) => {
839
+ const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
840
+ return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
841
+ };
842
+ /**
843
+ * Given a locale and a date object,
844
+ * return a formatted string that includes
845
+ * the month name and full year.
846
+ * Example: May 2021
847
+ */
848
+ const getMonthAndYear = (locale, refParts) => {
849
+ const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
850
+ return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
851
+ };
852
+ /**
853
+ * Given a locale and a date object,
854
+ * return a formatted string that includes
855
+ * the short month, numeric day, and full year.
856
+ * Example: Apr 22, 2021
857
+ */
858
+ const getMonthDayAndYear = (locale, refParts) => {
859
+ return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
860
+ };
861
+ /**
862
+ * Given a locale and a date object,
863
+ * return a formatted string that includes
864
+ * the numeric day.
865
+ * Note: Some languages will add literal characters
866
+ * to the end. This function removes those literals.
867
+ * Example: 29
868
+ */
869
+ const getDay = (locale, refParts) => {
870
+ return getLocalizedDateTimeParts(locale, refParts, { day: 'numeric' }).find((obj) => obj.type === 'day').value;
871
+ };
872
+ /**
873
+ * Given a locale and a date object,
874
+ * return a formatted string that includes
875
+ * the numeric year.
876
+ * Example: 2022
877
+ */
878
+ const getYear = (locale, refParts) => {
879
+ return getLocalizedDateTime(locale, refParts, { year: 'numeric' });
880
+ };
881
+ const getNormalizedDate = (refParts) => {
882
+ const timeString = refParts.hour !== undefined && refParts.minute !== undefined ? ` ${refParts.hour}:${refParts.minute}` : '';
883
+ return new Date(`${refParts.month}/${refParts.day}/${refParts.year}${timeString} GMT+0000`);
884
+ };
885
+ /**
886
+ * Given a locale, DatetimeParts, and options
887
+ * format the DatetimeParts according to the options
888
+ * and locale combination. This returns a string. If
889
+ * you want an array of the individual pieces
890
+ * that make up the localized date string, use
891
+ * getLocalizedDateTimeParts.
892
+ */
893
+ const getLocalizedDateTime = (locale, refParts, options) => {
894
+ const date = getNormalizedDate(refParts);
895
+ return getDateTimeFormat(locale, options).format(date);
896
+ };
897
+ /**
898
+ * Given a locale, DatetimeParts, and options
899
+ * format the DatetimeParts according to the options
900
+ * and locale combination. This returns an array of
901
+ * each piece of the date.
902
+ */
903
+ const getLocalizedDateTimeParts = (locale, refParts, options) => {
904
+ const date = getNormalizedDate(refParts);
905
+ return getDateTimeFormat(locale, options).formatToParts(date);
906
+ };
907
+ /**
908
+ * Wrapper function for Intl.DateTimeFormat.
909
+ * Allows developers to apply an allowed format to DatetimeParts.
910
+ * This function also has built in safeguards for older browser bugs
911
+ * with Intl.DateTimeFormat.
912
+ */
913
+ const getDateTimeFormat = (locale, options) => {
914
+ return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, options), { timeZone: 'UTC' }));
915
+ };
916
+ /**
917
+ * Gets a localized version of "Today"
918
+ * Falls back to "Today" in English for
919
+ * browsers that do not support RelativeTimeFormat.
920
+ */
921
+ const getTodayLabel = (locale) => {
922
+ if ('RelativeTimeFormat' in Intl) {
923
+ const label = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day');
924
+ return label.charAt(0).toUpperCase() + label.slice(1);
925
+ }
926
+ else {
927
+ return 'Today';
928
+ }
929
+ };
930
+ /**
931
+ * When calling toISOString(), the browser
932
+ * will convert the date to UTC time by either adding
933
+ * or subtracting the time zone offset.
934
+ * To work around this, we need to either add
935
+ * or subtract the time zone offset to the Date
936
+ * object prior to calling toISOString().
937
+ * This allows us to get an ISO string
938
+ * that is in the user's time zone.
939
+ *
940
+ * Example:
941
+ * Time zone offset is 240
942
+ * Meaning: The browser needs to add 240 minutes
943
+ * to the Date object to get UTC time.
944
+ * What Ionic does: We subtract 240 minutes
945
+ * from the Date object. The browser then adds
946
+ * 240 minutes in toISOString(). The result
947
+ * is a time that is in the user's time zone
948
+ * and not UTC.
949
+ *
950
+ * Note: Some timezones include minute adjustments
951
+ * such as 30 or 45 minutes. This is why we use setMinutes
952
+ * instead of setHours.
953
+ * Example: India Standard Time
954
+ * Timezone offset: -330 = -5.5 hours.
955
+ *
956
+ * List of timezones with 30 and 45 minute timezones:
957
+ * https://www.timeanddate.com/time/time-zones-interesting.html
958
+ */
959
+ const removeDateTzOffset = (date) => {
960
+ const tzOffset = date.getTimezoneOffset();
961
+ date.setMinutes(date.getMinutes() - tzOffset);
962
+ return date;
963
+ };
964
+ const DATE_AM = removeDateTzOffset(new Date('2022T01:00'));
965
+ const DATE_PM = removeDateTzOffset(new Date('2022T13:00'));
966
+ /**
967
+ * Formats the locale's string representation of the day period (am/pm) for a given
968
+ * ref parts day period.
969
+ *
970
+ * @param locale The locale to format the day period in.
971
+ * @param value The date string, in ISO format.
972
+ * @returns The localized day period (am/pm) representation of the given value.
973
+ */
974
+ const getLocalizedDayPeriod = (locale, dayPeriod) => {
975
+ const date = dayPeriod === 'am' ? DATE_AM : DATE_PM;
976
+ const localizedDayPeriod = new Intl.DateTimeFormat(locale, {
977
+ hour: 'numeric',
978
+ timeZone: 'UTC',
979
+ })
980
+ .formatToParts(date)
981
+ .find((part) => part.type === 'dayPeriod');
982
+ if (localizedDayPeriod) {
983
+ return localizedDayPeriod.value;
984
+ }
985
+ return getFormattedDayPeriod(dayPeriod);
986
+ };
987
+ /**
988
+ * Formats the datetime's value to a string, for use in the native input.
989
+ *
990
+ * @param value The value to format, either an ISO string or an array thereof.
991
+ */
992
+ const formatValue = (value) => {
993
+ return Array.isArray(value) ? value.join(',') : value;
994
+ };
995
+
996
+ /*!
997
+ * (C) Ionic http://ionicframework.com - MIT License
998
+ */
999
+ /**
1000
+ * Returns the current date as
1001
+ * an ISO string in the user's
1002
+ * time zone.
1003
+ */
1004
+ const getToday = () => {
1005
+ /**
1006
+ * ion-datetime intentionally does not
1007
+ * parse time zones/do automatic time zone
1008
+ * conversion when accepting user input.
1009
+ * However when we get today's date string,
1010
+ * we want it formatted relative to the user's
1011
+ * time zone.
1012
+ *
1013
+ * When calling toISOString(), the browser
1014
+ * will convert the date to UTC time by either adding
1015
+ * or subtracting the time zone offset.
1016
+ * To work around this, we need to either add
1017
+ * or subtract the time zone offset to the Date
1018
+ * object prior to calling toISOString().
1019
+ * This allows us to get an ISO string
1020
+ * that is in the user's time zone.
1021
+ */
1022
+ return removeDateTzOffset(new Date()).toISOString();
1023
+ };
1024
+ const minutes = [
1025
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1026
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1027
+ ];
1028
+ const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
1029
+ const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
1030
+ /**
1031
+ * Given a locale and a mode,
1032
+ * return an array with formatted days
1033
+ * of the week. iOS should display days
1034
+ * such as "Mon" or "Tue".
1035
+ * MD should display days such as "M"
1036
+ * or "T".
1037
+ */
1038
+ const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
1039
+ /**
1040
+ * Nov 1st, 2020 starts on a Sunday.
1041
+ * ion-datetime assumes weeks start on Sunday,
1042
+ * but is configurable via `firstDayOfWeek`.
1043
+ */
1044
+ const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
1045
+ const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
1046
+ const startDate = new Date('11/01/2020');
1047
+ const daysOfWeek = [];
1048
+ /**
1049
+ * For each day of the week,
1050
+ * get the day name.
1051
+ */
1052
+ for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
1053
+ const currentDate = new Date(startDate);
1054
+ currentDate.setDate(currentDate.getDate() + i);
1055
+ daysOfWeek.push(intl.format(currentDate));
1056
+ }
1057
+ return daysOfWeek;
1058
+ };
1059
+ /**
1060
+ * Returns an array containing all of the
1061
+ * days in a month for a given year. Values are
1062
+ * aligned with a week calendar starting on
1063
+ * the firstDayOfWeek value (Sunday by default)
1064
+ * using null values.
1065
+ */
1066
+ const getDaysOfMonth = (month, year, firstDayOfWeek) => {
1067
+ const numDays = getNumDaysInMonth(month, year);
1068
+ const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
1069
+ /**
1070
+ * To get the first day of the month aligned on the correct
1071
+ * day of the week, we need to determine how many "filler" days
1072
+ * to generate. These filler days as empty/disabled buttons
1073
+ * that fill the space of the days of the week before the first
1074
+ * of the month.
1075
+ *
1076
+ * There are two cases here:
1077
+ *
1078
+ * 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
1079
+ * is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
1080
+ * this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
1081
+ * the first day of the month.
1082
+ *
1083
+ * 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
1084
+ * is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
1085
+ * this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
1086
+ * the first day of the month.
1087
+ */
1088
+ const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
1089
+ let days = [];
1090
+ for (let i = 1; i <= numDays; i++) {
1091
+ days.push({ day: i, dayOfWeek: (offset + i) % 7 });
1092
+ }
1093
+ for (let i = 0; i <= offset; i++) {
1094
+ days = [{ day: null, dayOfWeek: null }, ...days];
1095
+ }
1096
+ return days;
1097
+ };
1098
+ /**
1099
+ * Given a local, reference datetime parts and option
1100
+ * max/min bound datetime parts, calculate the acceptable
1101
+ * hour and minute values according to the bounds and locale.
1102
+ */
1103
+ const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
1104
+ const use24Hour = hourCycle === 'h23';
1105
+ let processedHours = use24Hour ? hour23 : hour12;
1106
+ let processedMinutes = minutes;
1107
+ let isAMAllowed = true;
1108
+ let isPMAllowed = true;
1109
+ if (hourValues) {
1110
+ processedHours = processedHours.filter((hour) => hourValues.includes(hour));
1111
+ }
1112
+ if (minuteValues) {
1113
+ processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
1114
+ }
1115
+ if (minParts) {
1116
+ /**
1117
+ * If ref day is the same as the
1118
+ * minimum allowed day, filter hour/minute
1119
+ * values according to min hour and minute.
1120
+ */
1121
+ if (isSameDay(refParts, minParts)) {
1122
+ /**
1123
+ * Users may not always set the hour/minute for
1124
+ * min value (i.e. 2021-06-02) so we should allow
1125
+ * all hours/minutes in that case.
1126
+ */
1127
+ if (minParts.hour !== undefined) {
1128
+ processedHours = processedHours.filter((hour) => {
1129
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
1130
+ return (use24Hour ? hour : convertedHour) >= minParts.hour;
1131
+ });
1132
+ isAMAllowed = minParts.hour < 13;
1133
+ }
1134
+ if (minParts.minute !== undefined) {
1135
+ /**
1136
+ * The minimum minute range should not be enforced when
1137
+ * the hour is greater than the min hour.
1138
+ *
1139
+ * For example with a minimum range of 09:30, users
1140
+ * should be able to select 10:00-10:29 and beyond.
1141
+ */
1142
+ let isPastMinHour = false;
1143
+ if (minParts.hour !== undefined && refParts.hour !== undefined) {
1144
+ if (refParts.hour > minParts.hour) {
1145
+ isPastMinHour = true;
1146
+ }
1147
+ }
1148
+ processedMinutes = processedMinutes.filter((minute) => {
1149
+ if (isPastMinHour) {
1150
+ return true;
1151
+ }
1152
+ return minute >= minParts.minute;
1153
+ });
1154
+ }
1155
+ /**
1156
+ * If ref day is before minimum
1157
+ * day do not render any hours/minute values
1158
+ */
1159
+ }
1160
+ else if (isBefore(refParts, minParts)) {
1161
+ processedHours = [];
1162
+ processedMinutes = [];
1163
+ isAMAllowed = isPMAllowed = false;
1164
+ }
1165
+ }
1166
+ if (maxParts) {
1167
+ /**
1168
+ * If ref day is the same as the
1169
+ * maximum allowed day, filter hour/minute
1170
+ * values according to max hour and minute.
1171
+ */
1172
+ if (isSameDay(refParts, maxParts)) {
1173
+ /**
1174
+ * Users may not always set the hour/minute for
1175
+ * max value (i.e. 2021-06-02) so we should allow
1176
+ * all hours/minutes in that case.
1177
+ */
1178
+ if (maxParts.hour !== undefined) {
1179
+ processedHours = processedHours.filter((hour) => {
1180
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
1181
+ return (use24Hour ? hour : convertedHour) <= maxParts.hour;
1182
+ });
1183
+ isPMAllowed = maxParts.hour >= 12;
1184
+ }
1185
+ if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
1186
+ // The available minutes should only be filtered when the hour is the same as the max hour.
1187
+ // For example if the max hour is 10:30 and the current hour is 10:00,
1188
+ // users should be able to select 00-30 minutes.
1189
+ // If the current hour is 09:00, users should be able to select 00-60 minutes.
1190
+ processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
1191
+ }
1192
+ /**
1193
+ * If ref day is after minimum
1194
+ * day do not render any hours/minute values
1195
+ */
1196
+ }
1197
+ else if (isAfter(refParts, maxParts)) {
1198
+ processedHours = [];
1199
+ processedMinutes = [];
1200
+ isAMAllowed = isPMAllowed = false;
1201
+ }
1202
+ }
1203
+ return {
1204
+ hours: processedHours,
1205
+ minutes: processedMinutes,
1206
+ am: isAMAllowed,
1207
+ pm: isPMAllowed,
1208
+ };
1209
+ };
1210
+ /**
1211
+ * Given DatetimeParts, generate the previous,
1212
+ * current, and and next months.
1213
+ */
1214
+ const generateMonths = (refParts) => {
1215
+ return [
1216
+ getPreviousMonth(refParts),
1217
+ { month: refParts.month, year: refParts.year, day: refParts.day },
1218
+ getNextMonth(refParts),
1219
+ ];
1220
+ };
1221
+ const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
1222
+ month: 'long',
1223
+ }) => {
1224
+ const { year } = refParts;
1225
+ const months = [];
1226
+ if (monthValues !== undefined) {
1227
+ let processedMonths = monthValues;
1228
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
1229
+ processedMonths = processedMonths.filter((month) => month <= maxParts.month);
1230
+ }
1231
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
1232
+ processedMonths = processedMonths.filter((month) => month >= minParts.month);
1233
+ }
1234
+ processedMonths.forEach((processedMonth) => {
1235
+ const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
1236
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
1237
+ months.push({ text: monthString, value: processedMonth });
1238
+ });
1239
+ }
1240
+ else {
1241
+ const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
1242
+ const minMonth = minParts && minParts.year === year ? minParts.month : 1;
1243
+ for (let i = minMonth; i <= maxMonth; i++) {
1244
+ /**
1245
+ *
1246
+ * There is a bug on iOS 14 where
1247
+ * Intl.DateTimeFormat takes into account
1248
+ * the local timezone offset when formatting dates.
1249
+ *
1250
+ * Forcing the timezone to 'UTC' fixes the issue. However,
1251
+ * we should keep this workaround as it is safer. In the event
1252
+ * this breaks in another browser, we will not be impacted
1253
+ * because all dates will be interpreted in UTC.
1254
+ *
1255
+ * Example:
1256
+ * new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
1257
+ * new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
1258
+ *
1259
+ * In certain timezones, iOS 14 shows the wrong
1260
+ * date for .toUTCString(). To combat this, we
1261
+ * force all of the timezones to GMT+0000 (UTC).
1262
+ *
1263
+ * Example:
1264
+ * Time Zone: Central European Standard Time
1265
+ * new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
1266
+ * new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
1267
+ */
1268
+ const date = new Date(`${i}/1/${year} GMT+0000`);
1269
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
1270
+ months.push({ text: monthString, value: i });
1271
+ }
1272
+ }
1273
+ return months;
1274
+ };
1275
+ /**
1276
+ * Returns information regarding
1277
+ * selectable dates (i.e 1st, 2nd, 3rd, etc)
1278
+ * within a reference month.
1279
+ * @param locale The locale to format the date with
1280
+ * @param refParts The reference month/year to generate dates for
1281
+ * @param minParts The minimum bound on the date that can be returned
1282
+ * @param maxParts The maximum bound on the date that can be returned
1283
+ * @param dayValues The allowed date values
1284
+ * @returns Date data to be used in ion-picker-column-internal
1285
+ */
1286
+ const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
1287
+ day: 'numeric',
1288
+ }) => {
1289
+ const { month, year } = refParts;
1290
+ const days = [];
1291
+ /**
1292
+ * If we have max/min bounds that in the same
1293
+ * month/year as the refParts, we should
1294
+ * use the define day as the max/min day.
1295
+ * Otherwise, fallback to the max/min days in a month.
1296
+ */
1297
+ const numDaysInMonth = getNumDaysInMonth(month, year);
1298
+ const maxDay = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== null && (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== undefined && maxParts.year === year && maxParts.month === month
1299
+ ? maxParts.day
1300
+ : numDaysInMonth;
1301
+ const minDay = (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== null && (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== undefined && minParts.year === year && minParts.month === month
1302
+ ? minParts.day
1303
+ : 1;
1304
+ if (dayValues !== undefined) {
1305
+ let processedDays = dayValues;
1306
+ processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
1307
+ processedDays.forEach((processedDay) => {
1308
+ const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
1309
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
1310
+ days.push({ text: dayString, value: processedDay });
1311
+ });
1312
+ }
1313
+ else {
1314
+ for (let i = minDay; i <= maxDay; i++) {
1315
+ const date = new Date(`${month}/${i}/${year} GMT+0000`);
1316
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
1317
+ days.push({ text: dayString, value: i });
1318
+ }
1319
+ }
1320
+ return days;
1321
+ };
1322
+ const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
1323
+ var _a, _b;
1324
+ let processedYears = [];
1325
+ if (yearValues !== undefined) {
1326
+ processedYears = yearValues;
1327
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
1328
+ processedYears = processedYears.filter((year) => year <= maxParts.year);
1329
+ }
1330
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
1331
+ processedYears = processedYears.filter((year) => year >= minParts.year);
1332
+ }
1333
+ }
1334
+ else {
1335
+ const { year } = refParts;
1336
+ const maxYear = (_a = maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== null && _a !== void 0 ? _a : year;
1337
+ const minYear = (_b = minParts === null || minParts === void 0 ? void 0 : minParts.year) !== null && _b !== void 0 ? _b : year - 100;
1338
+ for (let i = maxYear; i >= minYear; i--) {
1339
+ processedYears.push(i);
1340
+ }
1341
+ }
1342
+ return processedYears.map((year) => ({
1343
+ text: getYear(locale, { year, month: refParts.month, day: refParts.day }),
1344
+ value: year,
1345
+ }));
1346
+ };
1347
+ /**
1348
+ * Given a starting date and an upper bound,
1349
+ * this functions returns an array of all
1350
+ * month objects in that range.
1351
+ */
1352
+ const getAllMonthsInRange = (currentParts, maxParts) => {
1353
+ if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
1354
+ return [currentParts];
1355
+ }
1356
+ return [currentParts, ...getAllMonthsInRange(getNextMonth(currentParts), maxParts)];
1357
+ };
1358
+ /**
1359
+ * Creates and returns picker items
1360
+ * that represent the days in a month.
1361
+ * Example: "Thu, Jun 2"
1362
+ */
1363
+ const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
1364
+ let items = [];
1365
+ let parts = [];
1366
+ /**
1367
+ * Get all month objects from the min date
1368
+ * to the max date. Note: Do not use getMonthColumnData
1369
+ * as that function only generates dates within a
1370
+ * single year.
1371
+ */
1372
+ let months = getAllMonthsInRange(minParts, maxParts);
1373
+ /**
1374
+ * Filter out any disallowed month values.
1375
+ */
1376
+ if (monthValues) {
1377
+ months = months.filter(({ month }) => monthValues.includes(month));
1378
+ }
1379
+ /**
1380
+ * Get all of the days in the month.
1381
+ * From there, generate an array where
1382
+ * each item has the month, date, and day
1383
+ * of work as the text.
1384
+ */
1385
+ months.forEach((monthObject) => {
1386
+ const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
1387
+ const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
1388
+ month: 'short',
1389
+ day: 'numeric',
1390
+ weekday: 'short',
1391
+ });
1392
+ const dateParts = [];
1393
+ const dateColumnItems = [];
1394
+ monthDays.forEach((dayObject) => {
1395
+ const isToday = isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
1396
+ /**
1397
+ * Today's date should read as "Today" (localized)
1398
+ * not the actual date string
1399
+ */
1400
+ dateColumnItems.push({
1401
+ text: isToday ? getTodayLabel(locale) : dayObject.text,
1402
+ value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
1403
+ });
1404
+ /**
1405
+ * When selecting a date in the wheel picker
1406
+ * we need access to the raw datetime parts data.
1407
+ * The picker column only accepts values of
1408
+ * type string or number, so we need to return
1409
+ * two sets of data: A data set to be passed
1410
+ * to the picker column, and a data set to
1411
+ * be used to reference the raw data when
1412
+ * updating the picker column value.
1413
+ */
1414
+ dateParts.push({
1415
+ month: referenceMonth.month,
1416
+ year: referenceMonth.year,
1417
+ day: dayObject.value,
1418
+ });
1419
+ });
1420
+ parts = [...parts, ...dateParts];
1421
+ items = [...items, ...dateColumnItems];
1422
+ });
1423
+ return {
1424
+ parts,
1425
+ items,
1426
+ };
1427
+ };
1428
+ const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
1429
+ const use24Hour = is24Hour(locale, hourCycle);
1430
+ const { hours, minutes, am, pm } = generateTime(refParts, use24Hour ? 'h23' : 'h12', minParts, maxParts, allowedHourValues, allowedMinuteValues);
1431
+ const hoursItems = hours.map((hour) => {
1432
+ return {
1433
+ text: getFormattedHour(hour, use24Hour),
1434
+ value: getInternalHourValue(hour, use24Hour, refParts.ampm),
1435
+ };
1436
+ });
1437
+ const minutesItems = minutes.map((minute) => {
1438
+ return {
1439
+ text: addTimePadding(minute),
1440
+ value: minute,
1441
+ };
1442
+ });
1443
+ const dayPeriodItems = [];
1444
+ if (am && !use24Hour) {
1445
+ dayPeriodItems.push({
1446
+ text: getLocalizedDayPeriod(locale, 'am'),
1447
+ value: 'am',
1448
+ });
1449
+ }
1450
+ if (pm && !use24Hour) {
1451
+ dayPeriodItems.push({
1452
+ text: getLocalizedDayPeriod(locale, 'pm'),
1453
+ value: 'pm',
1454
+ });
1455
+ }
1456
+ return {
1457
+ minutesData: minutesItems,
1458
+ hoursData: hoursItems,
1459
+ dayPeriodData: dayPeriodItems,
1460
+ };
1461
+ };
1462
+
1463
+ export { getDayColumnData as A, getYearColumnData as B, isMonthFirstLocale as C, getTimeColumnsData as D, isLocaleDayPeriodRTL as E, getDaysOfWeek as F, getMonthAndYear as G, getDaysOfMonth as H, generateMonths as I, is24Hour as J, getLocalizedTime as K, getMonthAndDay as L, formatValue as M, getNextYear as N, getPreviousYear as O, clampDate as P, parseAmPm as Q, calculateHourFromAMPM as R, getLocalizedDateTime as S, getMonthDayAndYear as T, getDay as a, isAfter as b, isSameDay as c, getPreviousMonth as d, getNextMonth as e, getPartsFromCalendarDay as f, generateDayAriaLabel as g, getEndOfWeek as h, isBefore as i, getStartOfWeek as j, getPreviousDay as k, getNextDay as l, getPreviousWeek as m, getNextWeek as n, parseMaxParts as o, parseMinParts as p, parseDate as q, convertToArrayOfNumbers as r, convertDataToISO as s, getToday as t, getClosestValidDate as u, validateParts as v, warnIfValueOutOfBounds as w, getNumDaysInMonth as x, getCombinedDateColumnData as y, getMonthColumnData as z };