@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,1802 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, writeTask, h, Host } from '@stencil/core/internal/client';
2
+ import { a as chevronBack, f as chevronForward, c as chevronDown, g as caretUpSharp, h as caretDownSharp } from './index2.js';
3
+ import { g as getIonMode } from './ionic-global.js';
4
+ import { startFocusVisible } from './focus-visible.js';
5
+ import { r as raf, c as renderHiddenInput, g as getElementRoot } from './helpers.js';
6
+ import { p as printIonWarning, a as printIonError } from './index4.js';
7
+ import { i as isRTL } from './dir.js';
8
+ import { c as createColorClasses } from './theme.js';
9
+ import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getEndOfWeek, j as getStartOfWeek, k as getPreviousDay, l as getNextDay, m as getPreviousWeek, n as getNextWeek, p as parseMinParts, o as parseMaxParts, q as parseDate, w as warnIfValueOutOfBounds, r as convertToArrayOfNumbers, s as convertDataToISO, t as getToday, u as getClosestValidDate, x as getNumDaysInMonth, y as getCombinedDateColumnData, z as getMonthColumnData, A as getDayColumnData, B as getYearColumnData, C as isMonthFirstLocale, D as getTimeColumnsData, E as isLocaleDayPeriodRTL, F as getMonthAndYear, G as getDaysOfWeek, H as getDaysOfMonth, I as generateMonths, J as is24Hour, K as getLocalizedTime, L as getMonthAndDay, M as formatValue, N as getNextYear, O as getPreviousYear, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data.js';
10
+ import { d as defineCustomElement$c } from './backdrop.js';
11
+ import { d as defineCustomElement$b } from './button.js';
12
+ import { d as defineCustomElement$a } from './buttons.js';
13
+ import { d as defineCustomElement$9 } from './icon.js';
14
+ import { d as defineCustomElement$8 } from './item.js';
15
+ import { d as defineCustomElement$7 } from './label.js';
16
+ import { d as defineCustomElement$6 } from './note.js';
17
+ import { d as defineCustomElement$5 } from './picker-column-internal.js';
18
+ import { d as defineCustomElement$4 } from './picker-internal.js';
19
+ import { d as defineCustomElement$3 } from './popover.js';
20
+ import { d as defineCustomElement$2 } from './ripple-effect.js';
21
+
22
+ /*!
23
+ * (C) Ionic http://ionicframework.com - MIT License
24
+ */
25
+ const isYearDisabled = (refYear, minParts, maxParts) => {
26
+ if (minParts && minParts.year > refYear) {
27
+ return true;
28
+ }
29
+ if (maxParts && maxParts.year < refYear) {
30
+ return true;
31
+ }
32
+ return false;
33
+ };
34
+ /**
35
+ * Returns true if a given day should
36
+ * not be interactive according to its value,
37
+ * or the max/min dates.
38
+ */
39
+ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
40
+ /**
41
+ * If this is a filler date (i.e. padding)
42
+ * then the date is disabled.
43
+ */
44
+ if (refParts.day === null) {
45
+ return true;
46
+ }
47
+ /**
48
+ * If user passed in a list of acceptable day values
49
+ * check to make sure that the date we are looking
50
+ * at is in this array.
51
+ */
52
+ if (dayValues !== undefined && !dayValues.includes(refParts.day)) {
53
+ return true;
54
+ }
55
+ /**
56
+ * Given a min date, perform the following
57
+ * checks. If any of them are true, then the
58
+ * day should be disabled:
59
+ * 1. Is the current year < the min allowed year?
60
+ * 2. Is the current year === min allowed year,
61
+ * but the current month < the min allowed month?
62
+ * 3. Is the current year === min allowed year, the
63
+ * current month === min allow month, but the current
64
+ * day < the min allowed day?
65
+ */
66
+ if (minParts && isBefore(refParts, minParts)) {
67
+ return true;
68
+ }
69
+ /**
70
+ * Given a max date, perform the following
71
+ * checks. If any of them are true, then the
72
+ * day should be disabled:
73
+ * 1. Is the current year > the max allowed year?
74
+ * 2. Is the current year === max allowed year,
75
+ * but the current month > the max allowed month?
76
+ * 3. Is the current year === max allowed year, the
77
+ * current month === max allow month, but the current
78
+ * day > the max allowed day?
79
+ */
80
+ if (maxParts && isAfter(refParts, maxParts)) {
81
+ return true;
82
+ }
83
+ /**
84
+ * If none of these checks
85
+ * passed then the date should
86
+ * be interactive.
87
+ */
88
+ return false;
89
+ };
90
+ /**
91
+ * Given a locale, a date, the selected date(s), and today's date,
92
+ * generate the state for a given calendar day button.
93
+ */
94
+ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
95
+ /**
96
+ * activeParts signals what day(s) are currently selected in the datetime.
97
+ * If multiple="true", this will be an array, but the logic in this util
98
+ * is the same whether we have one selected day or many because we're only
99
+ * calculating the state for one button. So, we treat a single activeParts value
100
+ * the same as an array of length one.
101
+ */
102
+ const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
103
+ /**
104
+ * The day button is active if it is selected, or in other words, if refParts
105
+ * matches at least one selected date.
106
+ */
107
+ const isActive = activePartsArray.find((parts) => isSameDay(refParts, parts)) !== undefined;
108
+ const isToday = isSameDay(refParts, todayParts);
109
+ const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
110
+ /**
111
+ * Note that we always return one object regardless of whether activeParts
112
+ * was an array, since we pare down to one value for isActive.
113
+ */
114
+ return {
115
+ disabled,
116
+ isActive,
117
+ isToday,
118
+ ariaSelected: isActive ? 'true' : null,
119
+ ariaLabel: generateDayAriaLabel(locale, isToday, refParts),
120
+ text: refParts.day != null ? getDay(locale, refParts) : null,
121
+ };
122
+ };
123
+ /**
124
+ * Returns `true` if the month is disabled given the
125
+ * current date value and min/max date constraints.
126
+ */
127
+ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
128
+ // If the year is disabled then the month is disabled.
129
+ if (isYearDisabled(refParts.year, minParts, maxParts)) {
130
+ return true;
131
+ }
132
+ // If the date value is before the min date, then the month is disabled.
133
+ // If the date value is after the max date, then the month is disabled.
134
+ if ((minParts && isBefore(refParts, minParts)) || (maxParts && isAfter(refParts, maxParts))) {
135
+ return true;
136
+ }
137
+ return false;
138
+ };
139
+ /**
140
+ * Given a working date, an optional minimum date range,
141
+ * and an optional maximum date range; determine if the
142
+ * previous navigation button is disabled.
143
+ */
144
+ const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
145
+ const prevMonth = Object.assign(Object.assign({}, getPreviousMonth(refParts)), { day: null });
146
+ return isMonthDisabled(prevMonth, {
147
+ minParts,
148
+ maxParts,
149
+ });
150
+ };
151
+ /**
152
+ * Given a working date and a maximum date range,
153
+ * determine if the next navigation button is disabled.
154
+ */
155
+ const isNextMonthDisabled = (refParts, maxParts) => {
156
+ const nextMonth = Object.assign(Object.assign({}, getNextMonth(refParts)), { day: null });
157
+ return isMonthDisabled(nextMonth, {
158
+ maxParts,
159
+ });
160
+ };
161
+
162
+ const datetimeIosCss = ":host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;top:50%;left:50%;width:32px;height:32px;transform:translate(-50%, -50%);content:\" \";z-index:-1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host .datetime-time{display:flex;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:flex;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:14px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:16px;font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:12px;font-weight:600;line-height:24px;text-transform:uppercase}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;height:calc(100% - 16px)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .calendar-day{font-size:20px}:host .calendar-day:after{opacity:0.2}:host .calendar-day:focus:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-active:after{background:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-today.calendar-day-active:after{background:var(--ion-color-base);opacity:1}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:16px;font-size:16px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:flex;align-items:center;justify-content:space-between}:host .datetime-action-buttons{width:100%}";
163
+
164
+ const datetimeMdCss = ":host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px;position:absolute;visibility:hidden;pointer-events:none}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-readonly),:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled){opacity:0.4}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center}:host .calendar-action-buttons ion-item ion-icon{padding-left:4px;padding-right:0;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-action-buttons ion-item ion-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}:host .calendar-body{display:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{scroll-snap-align:start;scroll-snap-stop:always;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day{padding-left:0px;padding-right:0px;padding-top:0px;padding-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0px;display:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{margin-left:unset;margin-right:unset;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px}}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}:host .calendar-day:after{border-radius:32px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;top:50%;left:50%;width:32px;height:32px;transform:translate(-50%, -50%);content:\" \";z-index:-1}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day:after{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host .datetime-time{display:flex;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:flex;align-items:center}:host .time-body{border-radius:8px;padding-left:12px;padding-right:12px;padding-top:6px;padding-bottom:6px;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .time-body{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-step-100, #ffffff);--title-color:var(--ion-color-contrast)}:host .datetime-header{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-header{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}:host .datetime-header .datetime-title{font-size:12px;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:34px}:host .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{color:var(--ion-color-step-650, #595959)}:host .calendar-days-of-week{padding-left:10px;padding-right:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, gray);font-size:14px;line-height:36px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-days-of-week{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-body .calendar-month .calendar-month-grid{padding-left:10px;padding-right:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-body .calendar-month .calendar-month-grid{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .calendar-day{padding-left:0px;padding-right:0;padding-top:13px;padding-bottom:13px;font-size:14px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .calendar-day{padding-left:unset;padding-right:unset;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0;padding-inline-end:0}}:host .calendar-day:focus:after{background:rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today:after{border:1px solid var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-active:after{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .datetime-time{padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-time{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}:host .time-header{color:var(--ion-color-step-650, #595959)}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;display:flex;align-items:center;justify-content:flex-end}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host .datetime-buttons{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}:host .datetime-view-buttons ion-button{color:var(--ion-color-step-800, #333333)}";
165
+
166
+ const Datetime = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
167
+ constructor() {
168
+ super();
169
+ this.__registerHost();
170
+ this.__attachShadow();
171
+ this.ionCancel = createEvent(this, "ionCancel", 7);
172
+ this.ionChange = createEvent(this, "ionChange", 7);
173
+ this.ionFocus = createEvent(this, "ionFocus", 7);
174
+ this.ionBlur = createEvent(this, "ionBlur", 7);
175
+ this.ionStyle = createEvent(this, "ionStyle", 7);
176
+ this.ionRender = createEvent(this, "ionRender", 7);
177
+ this.inputId = `ion-dt-${datetimeIds++}`;
178
+ this.prevPresentation = null;
179
+ /**
180
+ * Duplicate reference to `activeParts` that does not trigger a re-render of the component.
181
+ * Allows caching an instance of the `activeParts` in between render cycles.
182
+ */
183
+ this.activePartsClone = [];
184
+ this.showMonthAndYear = false;
185
+ this.activeParts = [];
186
+ this.workingParts = {
187
+ month: 5,
188
+ day: 28,
189
+ year: 2021,
190
+ hour: 13,
191
+ minute: 52,
192
+ ampm: 'pm',
193
+ };
194
+ this.isPresented = false;
195
+ this.isTimePopoverOpen = false;
196
+ /**
197
+ * The color to use from your application's color palette.
198
+ * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
199
+ * For more information on colors, see [theming](/docs/theming/basics).
200
+ */
201
+ this.color = 'primary';
202
+ /**
203
+ * The name of the control, which is submitted with the form data.
204
+ */
205
+ this.name = this.inputId;
206
+ /**
207
+ * If `true`, the user cannot interact with the datetime.
208
+ */
209
+ this.disabled = false;
210
+ /**
211
+ * If `true`, the datetime appears normal but is not interactive.
212
+ */
213
+ this.readonly = false;
214
+ /**
215
+ * Which values you want to select. `'date'` will show
216
+ * a calendar picker to select the month, day, and year. `'time'`
217
+ * will show a time picker to select the hour, minute, and (optionally)
218
+ * AM/PM. `'date-time'` will show the date picker first and time picker second.
219
+ * `'time-date'` will show the time picker first and date picker second.
220
+ */
221
+ this.presentation = 'date-time';
222
+ /**
223
+ * The text to display on the picker's cancel button.
224
+ */
225
+ this.cancelText = 'Cancel';
226
+ /**
227
+ * The text to display on the picker's "Done" button.
228
+ */
229
+ this.doneText = 'Done';
230
+ /**
231
+ * The text to display on the picker's "Clear" button.
232
+ */
233
+ this.clearText = 'Clear';
234
+ /**
235
+ * The locale to use for `ion-datetime`. This
236
+ * impacts month and day name formatting.
237
+ * The `'default'` value refers to the default
238
+ * locale set by your device.
239
+ */
240
+ this.locale = 'default';
241
+ /**
242
+ * The first day of the week to use for `ion-datetime`. The
243
+ * default value is `0` and represents Sunday.
244
+ */
245
+ this.firstDayOfWeek = 0;
246
+ /**
247
+ * If `true`, multiple dates can be selected at once. Only
248
+ * applies to `presentation="date"` and `preferWheel="false"`.
249
+ */
250
+ this.multiple = false;
251
+ /**
252
+ * If `true`, a header will be shown above the calendar
253
+ * picker. This will include both the slotted title, and
254
+ * the selected date.
255
+ */
256
+ this.showDefaultTitle = false;
257
+ /**
258
+ * If `true`, the default "Cancel" and "OK" buttons
259
+ * will be rendered at the bottom of the `ion-datetime`
260
+ * component. Developers can also use the `button` slot
261
+ * if they want to customize these buttons. If custom
262
+ * buttons are set in the `button` slot then the
263
+ * default buttons will not be rendered.
264
+ */
265
+ this.showDefaultButtons = false;
266
+ /**
267
+ * If `true`, a "Clear" button will be rendered alongside
268
+ * the default "Cancel" and "OK" buttons at the bottom of the `ion-datetime`
269
+ * component. Developers can also use the `button` slot
270
+ * if they want to customize these buttons. If custom
271
+ * buttons are set in the `button` slot then the
272
+ * default buttons will not be rendered.
273
+ */
274
+ this.showClearButton = false;
275
+ /**
276
+ * If `true`, the default "Time" label will be rendered
277
+ * for the time selector of the `ion-datetime` component.
278
+ * Developers can also use the `time-label` slot
279
+ * if they want to customize this label. If a custom
280
+ * label is set in the `time-label` slot then the
281
+ * default label will not be rendered.
282
+ */
283
+ this.showDefaultTimeLabel = true;
284
+ /**
285
+ * If `cover`, the `ion-datetime` will expand to cover the full width of its container.
286
+ * If `fixed`, the `ion-datetime` will have a fixed width.
287
+ */
288
+ this.size = 'fixed';
289
+ /**
290
+ * If `true`, a wheel picker will be rendered instead of a calendar grid
291
+ * where possible. If `false`, a calendar grid will be rendered instead of
292
+ * a wheel picker where possible.
293
+ *
294
+ * A wheel picker can be rendered instead of a grid when `presentation` is
295
+ * one of the following values: `'date'`, `'date-time'`, or `'time-date'`.
296
+ *
297
+ * A wheel picker will always be rendered regardless of
298
+ * the `preferWheel` value when `presentation` is one of the following values:
299
+ * `'time'`, `'month'`, `'month-year'`, or `'year'`.
300
+ */
301
+ this.preferWheel = false;
302
+ /**
303
+ * Returns the DatetimePart interface
304
+ * to use when rendering an initial set of
305
+ * data. This should be used when rendering an
306
+ * interface in an environment where the `value`
307
+ * may not be set. This function works
308
+ * by returning the first selected date in
309
+ * "activePartsClone" and then falling back to
310
+ * defaultParts if no active date is selected.
311
+ */
312
+ this.getActivePartsWithFallback = () => {
313
+ var _a;
314
+ const { defaultParts } = this;
315
+ return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
316
+ };
317
+ this.getActivePart = () => {
318
+ const { activePartsClone } = this;
319
+ return Array.isArray(activePartsClone) ? activePartsClone[0] : activePartsClone;
320
+ };
321
+ this.closeParentOverlay = () => {
322
+ const popoverOrModal = this.el.closest('ion-modal, ion-popover');
323
+ if (popoverOrModal) {
324
+ popoverOrModal.dismiss();
325
+ }
326
+ };
327
+ this.setWorkingParts = (parts) => {
328
+ this.workingParts = Object.assign({}, parts);
329
+ };
330
+ this.setActiveParts = (parts, removeDate = false) => {
331
+ const { multiple, minParts, maxParts, activePartsClone } = this;
332
+ /**
333
+ * When setting the active parts, it is possible
334
+ * to set invalid data. For example,
335
+ * when updating January 31 to February,
336
+ * February 31 does not exist. As a result
337
+ * we need to validate the active parts and
338
+ * ensure that we are only setting valid dates.
339
+ * Additionally, we need to update the working parts
340
+ * too in the event that the validated parts are different.
341
+ */
342
+ const validatedParts = validateParts(parts, minParts, maxParts);
343
+ this.setWorkingParts(validatedParts);
344
+ if (multiple) {
345
+ /**
346
+ * We read from activePartsClone here because valueChanged() only updates that,
347
+ * so it's the more reliable source of truth. If we read from activeParts, then
348
+ * if you click July 1, manually set the value to July 2, and then click July 3,
349
+ * the new value would be [July 1, July 3], ignoring the value set.
350
+ *
351
+ * We can then pass the new value to activeParts (rather than activePartsClone)
352
+ * since the clone will be updated automatically by activePartsChanged().
353
+ */
354
+ const activePartsArray = Array.isArray(activePartsClone) ? activePartsClone : [activePartsClone];
355
+ if (removeDate) {
356
+ this.activeParts = activePartsArray.filter((p) => !isSameDay(p, validatedParts));
357
+ }
358
+ else {
359
+ this.activeParts = [...activePartsArray, validatedParts];
360
+ }
361
+ }
362
+ else {
363
+ this.activeParts = Object.assign({}, validatedParts);
364
+ }
365
+ const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
366
+ if (hasSlottedButtons || this.showDefaultButtons) {
367
+ return;
368
+ }
369
+ this.confirm();
370
+ };
371
+ this.initializeKeyboardListeners = () => {
372
+ const calendarBodyRef = this.calendarBodyRef;
373
+ if (!calendarBodyRef) {
374
+ return;
375
+ }
376
+ const root = this.el.shadowRoot;
377
+ /**
378
+ * Get a reference to the month
379
+ * element we are currently viewing.
380
+ */
381
+ const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
382
+ /**
383
+ * When focusing the calendar body, we want to pass focus
384
+ * to the working day, but other days should
385
+ * only be accessible using the arrow keys. Pressing
386
+ * Tab should jump between bodies of selectable content.
387
+ */
388
+ const checkCalendarBodyFocus = (ev) => {
389
+ var _a;
390
+ const record = ev[0];
391
+ /**
392
+ * If calendar body was already focused
393
+ * when this fired or if the calendar body
394
+ * if not currently focused, we should not re-focus
395
+ * the inner day.
396
+ */
397
+ if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
398
+ return;
399
+ }
400
+ this.focusWorkingDay(currentMonth);
401
+ };
402
+ const mo = new MutationObserver(checkCalendarBodyFocus);
403
+ mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
404
+ this.destroyKeyboardMO = () => {
405
+ mo === null || mo === void 0 ? void 0 : mo.disconnect();
406
+ };
407
+ /**
408
+ * We must use keydown not keyup as we want
409
+ * to prevent scrolling when using the arrow keys.
410
+ */
411
+ calendarBodyRef.addEventListener('keydown', (ev) => {
412
+ const activeElement = root.activeElement;
413
+ if (!activeElement || !activeElement.classList.contains('calendar-day')) {
414
+ return;
415
+ }
416
+ const parts = getPartsFromCalendarDay(activeElement);
417
+ let partsToFocus;
418
+ switch (ev.key) {
419
+ case 'ArrowDown':
420
+ ev.preventDefault();
421
+ partsToFocus = getNextWeek(parts);
422
+ break;
423
+ case 'ArrowUp':
424
+ ev.preventDefault();
425
+ partsToFocus = getPreviousWeek(parts);
426
+ break;
427
+ case 'ArrowRight':
428
+ ev.preventDefault();
429
+ partsToFocus = getNextDay(parts);
430
+ break;
431
+ case 'ArrowLeft':
432
+ ev.preventDefault();
433
+ partsToFocus = getPreviousDay(parts);
434
+ break;
435
+ case 'Home':
436
+ ev.preventDefault();
437
+ partsToFocus = getStartOfWeek(parts);
438
+ break;
439
+ case 'End':
440
+ ev.preventDefault();
441
+ partsToFocus = getEndOfWeek(parts);
442
+ break;
443
+ case 'PageUp':
444
+ ev.preventDefault();
445
+ partsToFocus = ev.shiftKey ? getPreviousYear(parts) : getPreviousMonth(parts);
446
+ break;
447
+ case 'PageDown':
448
+ ev.preventDefault();
449
+ partsToFocus = ev.shiftKey ? getNextYear(parts) : getNextMonth(parts);
450
+ break;
451
+ /**
452
+ * Do not preventDefault here
453
+ * as we do not want to override other
454
+ * browser defaults such as pressing Enter/Space
455
+ * to select a day.
456
+ */
457
+ default:
458
+ return;
459
+ }
460
+ /**
461
+ * If the day we want to move focus to is
462
+ * disabled, do not do anything.
463
+ */
464
+ if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
465
+ return;
466
+ }
467
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
468
+ /**
469
+ * Give view a chance to re-render
470
+ * then move focus to the new working day
471
+ */
472
+ requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
473
+ });
474
+ };
475
+ this.focusWorkingDay = (currentMonth) => {
476
+ /**
477
+ * Get the number of padding days so
478
+ * we know how much to offset our next selector by
479
+ * to grab the correct calenday-day element.
480
+ */
481
+ const padding = currentMonth.querySelectorAll('.calendar-day-padding');
482
+ const { day } = this.workingParts;
483
+ if (day === null) {
484
+ return;
485
+ }
486
+ /**
487
+ * Get the calendar day element
488
+ * and focus it.
489
+ */
490
+ const dayEl = currentMonth.querySelector(`.calendar-day:nth-of-type(${padding.length + day})`);
491
+ if (dayEl) {
492
+ dayEl.focus();
493
+ }
494
+ };
495
+ this.processMinParts = () => {
496
+ const { min, defaultParts } = this;
497
+ if (min === undefined) {
498
+ this.minParts = undefined;
499
+ return;
500
+ }
501
+ this.minParts = parseMinParts(min, defaultParts);
502
+ };
503
+ this.processMaxParts = () => {
504
+ const { max, defaultParts } = this;
505
+ if (max === undefined) {
506
+ this.maxParts = undefined;
507
+ return;
508
+ }
509
+ this.maxParts = parseMaxParts(max, defaultParts);
510
+ };
511
+ this.initializeCalendarListener = () => {
512
+ const calendarBodyRef = this.calendarBodyRef;
513
+ if (!calendarBodyRef) {
514
+ return;
515
+ }
516
+ /**
517
+ * For performance reasons, we only render 3
518
+ * months at a time: The current month, the previous
519
+ * month, and the next month. We have a scroll listener
520
+ * on the calendar body to append/prepend new months.
521
+ *
522
+ * We can do this because Stencil is smart enough to not
523
+ * re-create the .calendar-month containers, but rather
524
+ * update the content within those containers.
525
+ *
526
+ * As an added bonus, WebKit has some troubles with
527
+ * scroll-snap-stop: always, so not rendering all of
528
+ * the months in a row allows us to mostly sidestep
529
+ * that issue.
530
+ */
531
+ const months = calendarBodyRef.querySelectorAll('.calendar-month');
532
+ const startMonth = months[0];
533
+ const workingMonth = months[1];
534
+ const endMonth = months[2];
535
+ const mode = getIonMode(this);
536
+ const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
537
+ /**
538
+ * Before setting up the scroll listener,
539
+ * scroll the middle month into view.
540
+ * scrollIntoView() will scroll entire page
541
+ * if element is not in viewport. Use scrollLeft instead.
542
+ */
543
+ writeTask(() => {
544
+ calendarBodyRef.scrollLeft = startMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
545
+ const getChangedMonth = (parts) => {
546
+ const box = calendarBodyRef.getBoundingClientRect();
547
+ const root = this.el.shadowRoot;
548
+ /**
549
+ * Get the element that is in the center of the calendar body.
550
+ * This will be an element inside of the active month.
551
+ */
552
+ const elementAtCenter = root.elementFromPoint(box.x + box.width / 2, box.y + box.height / 2);
553
+ /**
554
+ * If there is no element then the
555
+ * component may be re-rendering on a slow device.
556
+ */
557
+ if (!elementAtCenter)
558
+ return;
559
+ const month = elementAtCenter.closest('.calendar-month');
560
+ if (!month)
561
+ return;
562
+ /**
563
+ * The edge of the month must be lined up with
564
+ * the edge of the calendar body in order for
565
+ * the component to update. Otherwise, it
566
+ * may be the case that the user has paused their
567
+ * swipe or the browser has not finished snapping yet.
568
+ * Rather than check if the x values are equal,
569
+ * we give it a tolerance of 2px to account for
570
+ * sub pixel rendering.
571
+ */
572
+ const monthBox = month.getBoundingClientRect();
573
+ if (Math.abs(monthBox.x - box.x) > 2)
574
+ return;
575
+ /**
576
+ * From here, we can determine if the start
577
+ * month or the end month was scrolled into view.
578
+ * If no month was changed, then we can return from
579
+ * the scroll callback early.
580
+ */
581
+ if (month === startMonth) {
582
+ return getPreviousMonth(parts);
583
+ }
584
+ else if (month === endMonth) {
585
+ return getNextMonth(parts);
586
+ }
587
+ else {
588
+ return;
589
+ }
590
+ };
591
+ const updateActiveMonth = () => {
592
+ if (needsiOSRubberBandFix) {
593
+ calendarBodyRef.style.removeProperty('pointer-events');
594
+ appliediOSRubberBandFix = false;
595
+ }
596
+ /**
597
+ * If the month did not change
598
+ * then we can return early.
599
+ */
600
+ const newDate = getChangedMonth(this.workingParts);
601
+ if (!newDate)
602
+ return;
603
+ const { month, day, year } = newDate;
604
+ if (isMonthDisabled({ month, year, day: null }, {
605
+ minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
606
+ maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
607
+ })) {
608
+ return;
609
+ }
610
+ /**
611
+ * Prevent scrolling for other browsers
612
+ * to give the DOM time to update and the container
613
+ * time to properly snap.
614
+ */
615
+ calendarBodyRef.style.setProperty('overflow', 'hidden');
616
+ /**
617
+ * Use a writeTask here to ensure
618
+ * that the state is updated and the
619
+ * correct month is scrolled into view
620
+ * in the same frame. This is not
621
+ * typically a problem on newer devices
622
+ * but older/slower device may have a flicker
623
+ * if we did not do this.
624
+ */
625
+ writeTask(() => {
626
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
627
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
628
+ calendarBodyRef.style.removeProperty('overflow');
629
+ });
630
+ };
631
+ /**
632
+ * When the container finishes scrolling we
633
+ * need to update the DOM with the selected month.
634
+ */
635
+ let scrollTimeout;
636
+ /**
637
+ * We do not want to attempt to set pointer-events
638
+ * multiple times within a single swipe gesture as
639
+ * that adds unnecessary work to the main thread.
640
+ */
641
+ let appliediOSRubberBandFix = false;
642
+ const scrollCallback = () => {
643
+ if (scrollTimeout) {
644
+ clearTimeout(scrollTimeout);
645
+ }
646
+ /**
647
+ * On iOS it is possible to quickly rubber band
648
+ * the scroll area before the scroll timeout has fired.
649
+ * This results in users reaching the end of the scrollable
650
+ * container before the DOM has updated.
651
+ * By setting `pointer-events: none` we can ensure that
652
+ * subsequent swipes do not happen while the container
653
+ * is snapping.
654
+ */
655
+ if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
656
+ calendarBodyRef.style.setProperty('pointer-events', 'none');
657
+ appliediOSRubberBandFix = true;
658
+ }
659
+ // Wait ~3 frames
660
+ scrollTimeout = setTimeout(updateActiveMonth, 50);
661
+ };
662
+ calendarBodyRef.addEventListener('scroll', scrollCallback);
663
+ this.destroyCalendarListener = () => {
664
+ calendarBodyRef.removeEventListener('scroll', scrollCallback);
665
+ };
666
+ });
667
+ };
668
+ /**
669
+ * Clean up all listeners except for the overlay
670
+ * listener. This is so that we can re-create the listeners
671
+ * if the datetime has been hidden/presented by a modal or popover.
672
+ */
673
+ this.destroyInteractionListeners = () => {
674
+ const { destroyCalendarListener, destroyKeyboardMO } = this;
675
+ if (destroyCalendarListener !== undefined) {
676
+ destroyCalendarListener();
677
+ }
678
+ if (destroyKeyboardMO !== undefined) {
679
+ destroyKeyboardMO();
680
+ }
681
+ };
682
+ this.processValue = (value) => {
683
+ /**
684
+ * TODO FW-2646 remove value !== ''
685
+ */
686
+ const hasValue = value !== '' && value !== null && value !== undefined;
687
+ let valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
688
+ const { minParts, maxParts, multiple } = this;
689
+ if (!multiple && Array.isArray(value)) {
690
+ this.value = value[0];
691
+ valueToProcess = valueToProcess[0];
692
+ }
693
+ /**
694
+ * Datetime should only warn of out of bounds values
695
+ * if set by the user. If the `value` is undefined,
696
+ * we will default to today's date which may be out
697
+ * of bounds. In this case, the warning makes it look
698
+ * like the developer did something wrong which is
699
+ * not true.
700
+ */
701
+ if (hasValue) {
702
+ warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
703
+ }
704
+ /**
705
+ * If there are multiple values, pick an arbitrary one to clamp to. This way,
706
+ * if the values are across months, we always show at least one of them. Note
707
+ * that the values don't necessarily have to be in order.
708
+ */
709
+ const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
710
+ const { month, day, year, hour, minute, tzOffset } = clampDate(singleValue, minParts, maxParts);
711
+ const ampm = parseAmPm(hour);
712
+ this.setWorkingParts({
713
+ month,
714
+ day,
715
+ year,
716
+ hour,
717
+ minute,
718
+ tzOffset,
719
+ ampm,
720
+ });
721
+ /**
722
+ * Since `activeParts` indicates a value that
723
+ * been explicitly selected either by the
724
+ * user or the app, only update `activeParts`
725
+ * if the `value` property is set.
726
+ */
727
+ if (hasValue) {
728
+ if (Array.isArray(valueToProcess)) {
729
+ this.activeParts = [...valueToProcess];
730
+ }
731
+ else {
732
+ this.activeParts = {
733
+ month,
734
+ day,
735
+ year,
736
+ hour,
737
+ minute,
738
+ tzOffset,
739
+ ampm,
740
+ };
741
+ }
742
+ }
743
+ else {
744
+ /**
745
+ * Reset the active parts if the value is not set.
746
+ * This will clear the selected calendar day when
747
+ * performing a clear action or using the reset() method.
748
+ */
749
+ this.activeParts = [];
750
+ }
751
+ };
752
+ this.onFocus = () => {
753
+ this.ionFocus.emit();
754
+ };
755
+ this.onBlur = () => {
756
+ this.ionBlur.emit();
757
+ };
758
+ this.hasValue = () => {
759
+ return this.value != null && this.value !== '';
760
+ };
761
+ this.nextMonth = () => {
762
+ const calendarBodyRef = this.calendarBodyRef;
763
+ if (!calendarBodyRef) {
764
+ return;
765
+ }
766
+ const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
767
+ if (!nextMonth) {
768
+ return;
769
+ }
770
+ const left = nextMonth.offsetWidth * 2;
771
+ calendarBodyRef.scrollTo({
772
+ top: 0,
773
+ left: left * (isRTL(this.el) ? -1 : 1),
774
+ behavior: 'smooth',
775
+ });
776
+ };
777
+ this.prevMonth = () => {
778
+ const calendarBodyRef = this.calendarBodyRef;
779
+ if (!calendarBodyRef) {
780
+ return;
781
+ }
782
+ const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
783
+ if (!prevMonth) {
784
+ return;
785
+ }
786
+ calendarBodyRef.scrollTo({
787
+ top: 0,
788
+ left: 0,
789
+ behavior: 'smooth',
790
+ });
791
+ };
792
+ this.toggleMonthAndYearView = () => {
793
+ this.showMonthAndYear = !this.showMonthAndYear;
794
+ };
795
+ }
796
+ disabledChanged() {
797
+ this.emitStyle();
798
+ }
799
+ minChanged() {
800
+ this.processMinParts();
801
+ }
802
+ maxChanged() {
803
+ this.processMaxParts();
804
+ }
805
+ yearValuesChanged() {
806
+ this.parsedYearValues = convertToArrayOfNumbers(this.yearValues);
807
+ }
808
+ monthValuesChanged() {
809
+ this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues);
810
+ }
811
+ dayValuesChanged() {
812
+ this.parsedDayValues = convertToArrayOfNumbers(this.dayValues);
813
+ }
814
+ hourValuesChanged() {
815
+ this.parsedHourValues = convertToArrayOfNumbers(this.hourValues);
816
+ }
817
+ minuteValuesChanged() {
818
+ this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
819
+ }
820
+ activePartsChanged() {
821
+ this.activePartsClone = this.activeParts;
822
+ }
823
+ /**
824
+ * Update the datetime value when the value changes
825
+ */
826
+ valueChanged() {
827
+ const { value, minParts, maxParts, workingParts, multiple } = this;
828
+ if (this.hasValue()) {
829
+ if (!multiple && Array.isArray(value)) {
830
+ this.value = value[0];
831
+ return; // setting this.value will trigger re-run of this function
832
+ }
833
+ /**
834
+ * Clones the value of the `activeParts` to the private clone, to update
835
+ * the date display on the current render cycle without causing another render.
836
+ *
837
+ * This allows us to update the current value's date/time display without
838
+ * refocusing or shifting the user's display (leaves the user in place).
839
+ */
840
+ const valueDateParts = parseDate(value);
841
+ if (valueDateParts) {
842
+ warnIfValueOutOfBounds(valueDateParts, minParts, maxParts);
843
+ if (Array.isArray(valueDateParts)) {
844
+ this.activePartsClone = [...valueDateParts];
845
+ }
846
+ else {
847
+ const { month, day, year, hour, minute } = valueDateParts;
848
+ const ampm = hour != null ? (hour >= 12 ? 'pm' : 'am') : undefined;
849
+ this.activePartsClone = Object.assign(Object.assign({}, this.activeParts), { month,
850
+ day,
851
+ year,
852
+ hour,
853
+ minute,
854
+ ampm });
855
+ /**
856
+ * The working parts am/pm value must be updated when the value changes, to
857
+ * ensure the time picker hour column values are generated correctly.
858
+ *
859
+ * Note that we don't need to do this if valueDateParts is an array, since
860
+ * multiple="true" does not apply to time pickers.
861
+ */
862
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm }));
863
+ }
864
+ }
865
+ else {
866
+ printIonWarning(`Unable to parse date string: ${value}. Please provide a valid ISO 8601 datetime string.`);
867
+ }
868
+ }
869
+ this.emitStyle();
870
+ this.ionChange.emit({ value });
871
+ }
872
+ /**
873
+ * Confirms the selected datetime value, updates the
874
+ * `value` property, and optionally closes the popover
875
+ * or modal that the datetime was presented in.
876
+ */
877
+ async confirm(closeOverlay = false) {
878
+ const { isCalendarPicker, activeParts } = this;
879
+ /**
880
+ * We only update the value if the presentation is not a calendar picker.
881
+ */
882
+ if (activeParts !== undefined || !isCalendarPicker) {
883
+ const activePartsIsArray = Array.isArray(activeParts);
884
+ if (activePartsIsArray && activeParts.length === 0) {
885
+ this.value = undefined;
886
+ }
887
+ else {
888
+ /**
889
+ * Prevent convertDataToISO from doing any
890
+ * kind of transformation based on timezone
891
+ * This cancels out any change it attempts to make
892
+ *
893
+ * Important: Take the timezone offset based on
894
+ * the date that is currently selected, otherwise
895
+ * there can be 1 hr difference when dealing w/ DST
896
+ */
897
+ if (activePartsIsArray) {
898
+ const dates = convertDataToISO(activeParts).map((str) => new Date(str));
899
+ for (let i = 0; i < dates.length; i++) {
900
+ activeParts[i].tzOffset = dates[i].getTimezoneOffset() * -1;
901
+ }
902
+ }
903
+ else {
904
+ const date = new Date(convertDataToISO(activeParts));
905
+ activeParts.tzOffset = date.getTimezoneOffset() * -1;
906
+ }
907
+ this.value = convertDataToISO(activeParts);
908
+ }
909
+ }
910
+ if (closeOverlay) {
911
+ this.closeParentOverlay();
912
+ }
913
+ }
914
+ /**
915
+ * Resets the internal state of the datetime but does not update the value.
916
+ * Passing a valid ISO-8601 string will reset the state of the component to the provided date.
917
+ * If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
918
+ */
919
+ async reset(startDate) {
920
+ this.processValue(startDate);
921
+ }
922
+ /**
923
+ * Emits the ionCancel event and
924
+ * optionally closes the popover
925
+ * or modal that the datetime was
926
+ * presented in.
927
+ */
928
+ async cancel(closeOverlay = false) {
929
+ this.ionCancel.emit();
930
+ if (closeOverlay) {
931
+ this.closeParentOverlay();
932
+ }
933
+ }
934
+ get isCalendarPicker() {
935
+ const { presentation } = this;
936
+ return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
937
+ }
938
+ connectedCallback() {
939
+ this.clearFocusVisible = startFocusVisible(this.el).destroy;
940
+ }
941
+ disconnectedCallback() {
942
+ if (this.clearFocusVisible) {
943
+ this.clearFocusVisible();
944
+ this.clearFocusVisible = undefined;
945
+ }
946
+ }
947
+ initializeListeners() {
948
+ this.initializeCalendarListener();
949
+ this.initializeKeyboardListeners();
950
+ }
951
+ componentDidLoad() {
952
+ /**
953
+ * If a scrollable element is hidden using `display: none`,
954
+ * it will not have a scroll height meaning we cannot scroll elements
955
+ * into view. As a result, we will need to wait for the datetime to become
956
+ * visible if used inside of a modal or a popover otherwise the scrollable
957
+ * areas will not have the correct values snapped into place.
958
+ */
959
+ const visibleCallback = (entries) => {
960
+ const ev = entries[0];
961
+ if (!ev.isIntersecting) {
962
+ return;
963
+ }
964
+ this.initializeListeners();
965
+ /**
966
+ * TODO FW-2793: Datetime needs a frame to ensure that it
967
+ * can properly scroll contents into view. As a result
968
+ * we hide the scrollable content until after that frame
969
+ * so users do not see the content quickly shifting. The downside
970
+ * is that the content will pop into view a frame after. Maybe there
971
+ * is a better way to handle this?
972
+ */
973
+ writeTask(() => {
974
+ this.el.classList.add('datetime-ready');
975
+ });
976
+ };
977
+ const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01 });
978
+ /**
979
+ * Use raf to avoid a race condition between the component loading and
980
+ * its display animation starting (such as when shown in a modal). This
981
+ * could cause the datetime to start at a visibility of 0, erroneously
982
+ * triggering the `hiddenIO` observer below.
983
+ */
984
+ raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(this.el));
985
+ /**
986
+ * We need to clean up listeners when the datetime is hidden
987
+ * in a popover/modal so that we can properly scroll containers
988
+ * back into view if they are re-presented. When the datetime is hidden
989
+ * the scroll areas have scroll widths/heights of 0px, so any snapping
990
+ * we did originally has been lost.
991
+ */
992
+ const hiddenCallback = (entries) => {
993
+ const ev = entries[0];
994
+ if (ev.isIntersecting) {
995
+ return;
996
+ }
997
+ this.destroyInteractionListeners();
998
+ /**
999
+ * When datetime is hidden, we need to make sure that
1000
+ * the month/year picker is closed. Otherwise,
1001
+ * it will be open when the datetime re-appears
1002
+ * and the scroll area of the calendar grid will be 0.
1003
+ * As a result, the wrong month will be shown.
1004
+ */
1005
+ this.showMonthAndYear = false;
1006
+ writeTask(() => {
1007
+ this.el.classList.remove('datetime-ready');
1008
+ });
1009
+ };
1010
+ const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0 });
1011
+ raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(this.el));
1012
+ /**
1013
+ * Datetime uses Ionic components that emit
1014
+ * ionFocus and ionBlur. These events are
1015
+ * composed meaning they will cross
1016
+ * the shadow dom boundary. We need to
1017
+ * stop propagation on these events otherwise
1018
+ * developers will see 2 ionFocus or 2 ionBlur
1019
+ * events at a time.
1020
+ */
1021
+ const root = getElementRoot(this.el);
1022
+ root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1023
+ root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1024
+ }
1025
+ /**
1026
+ * When the presentation is changed, all calendar content is recreated,
1027
+ * so we need to re-init behavior with the new elements.
1028
+ */
1029
+ componentDidRender() {
1030
+ const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel } = this;
1031
+ /**
1032
+ * TODO(FW-2165)
1033
+ * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1034
+ * When using `min`, we add `scroll-snap-align: none`
1035
+ * to the disabled month so that users cannot scroll to it.
1036
+ * This triggers a bug in WebKit where the scroll position is reset.
1037
+ * Since the month change logic is handled by a scroll listener,
1038
+ * this causes the month to change leading to `scroll-snap-align`
1039
+ * changing again, thus changing the scroll position again and causing
1040
+ * an infinite loop.
1041
+ * This issue only applies to the calendar grid, so we can disable
1042
+ * it if the calendar grid is not being used.
1043
+ */
1044
+ const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1045
+ if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1046
+ const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1047
+ if (workingMonth) {
1048
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
1049
+ }
1050
+ }
1051
+ if (prevPresentation === null) {
1052
+ this.prevPresentation = presentation;
1053
+ return;
1054
+ }
1055
+ if (presentation === prevPresentation) {
1056
+ return;
1057
+ }
1058
+ this.prevPresentation = presentation;
1059
+ this.destroyInteractionListeners();
1060
+ this.initializeListeners();
1061
+ /**
1062
+ * The month/year picker from the date interface
1063
+ * should be closed as it is not available in non-date
1064
+ * interfaces.
1065
+ */
1066
+ this.showMonthAndYear = false;
1067
+ raf(() => {
1068
+ this.ionRender.emit();
1069
+ });
1070
+ }
1071
+ componentWillLoad() {
1072
+ const { el, multiple, presentation, preferWheel } = this;
1073
+ if (multiple) {
1074
+ if (presentation !== 'date') {
1075
+ printIonWarning('Multiple date selection is only supported for presentation="date".', el);
1076
+ }
1077
+ if (preferWheel) {
1078
+ printIonWarning('Multiple date selection is not supported with preferWheel="true".', el);
1079
+ }
1080
+ }
1081
+ this.processMinParts();
1082
+ this.processMaxParts();
1083
+ const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
1084
+ const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
1085
+ const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
1086
+ const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
1087
+ const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
1088
+ const todayParts = (this.todayParts = parseDate(getToday()));
1089
+ this.defaultParts = getClosestValidDate(todayParts, monthValues, dayValues, yearValues, hourValues, minuteValues);
1090
+ this.processValue(this.value);
1091
+ this.emitStyle();
1092
+ }
1093
+ emitStyle() {
1094
+ this.ionStyle.emit({
1095
+ interactive: true,
1096
+ datetime: true,
1097
+ 'interactive-disabled': this.disabled,
1098
+ });
1099
+ }
1100
+ /**
1101
+ * Universal render methods
1102
+ * These are pieces of datetime that
1103
+ * are rendered independently of presentation.
1104
+ */
1105
+ renderFooter() {
1106
+ const { showDefaultButtons, showClearButton } = this;
1107
+ const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1108
+ if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1109
+ return;
1110
+ }
1111
+ const clearButtonClick = () => {
1112
+ this.reset();
1113
+ this.value = undefined;
1114
+ };
1115
+ /**
1116
+ * By default we render two buttons:
1117
+ * Cancel - Dismisses the datetime and
1118
+ * does not update the `value` prop.
1119
+ * OK - Dismisses the datetime and
1120
+ * updates the `value` prop.
1121
+ */
1122
+ return (h("div", { class: "datetime-footer" }, h("div", { class: "datetime-buttons" }, h("div", { class: {
1123
+ ['datetime-action-buttons']: true,
1124
+ ['has-clear-button']: this.showClearButton,
1125
+ } }, h("slot", { name: "buttons" }, h("ion-buttons", null, showDefaultButtons && (h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true) }, this.cancelText)), h("div", null, showClearButton && (h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick() }, this.clearText)), showDefaultButtons && (h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true) }, this.doneText)))))))));
1126
+ }
1127
+ /**
1128
+ * Wheel picker render methods
1129
+ */
1130
+ renderWheelPicker(forcePresentation = this.presentation) {
1131
+ /**
1132
+ * If presentation="time-date" we switch the
1133
+ * order of the render array here instead of
1134
+ * manually reordering each date/time picker
1135
+ * column with CSS. This allows for additional
1136
+ * flexibility if we need to render subsets
1137
+ * of the date/time data or do additional ordering
1138
+ * within the child render functions.
1139
+ */
1140
+ const renderArray = forcePresentation === 'time-date'
1141
+ ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1142
+ : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1143
+ return h("ion-picker-internal", null, renderArray);
1144
+ }
1145
+ renderDatePickerColumns(forcePresentation) {
1146
+ return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1147
+ ? this.renderCombinedDatePickerColumn()
1148
+ : this.renderIndividualDatePickerColumns(forcePresentation);
1149
+ }
1150
+ renderCombinedDatePickerColumn() {
1151
+ const { defaultParts, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1152
+ const activePart = this.getActivePartsWithFallback();
1153
+ /**
1154
+ * By default, generate a range of 3 months:
1155
+ * Previous month, current month, and next month
1156
+ */
1157
+ const monthsToRender = generateMonths(workingParts);
1158
+ const lastMonth = monthsToRender[monthsToRender.length - 1];
1159
+ /**
1160
+ * Ensure that users can select the entire window of dates.
1161
+ */
1162
+ monthsToRender[0].day = 1;
1163
+ lastMonth.day = getNumDaysInMonth(lastMonth.month, lastMonth.year);
1164
+ /**
1165
+ * Narrow the dates rendered based on min/max dates (if any).
1166
+ * The `min` date is used if the min is after the generated min month.
1167
+ * The `max` date is used if the max is before the generated max month.
1168
+ * This ensures that the sliding window always stays at 3 months
1169
+ * but still allows future dates to be lazily rendered based on any min/max
1170
+ * constraints.
1171
+ */
1172
+ const min = minParts !== undefined && isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1173
+ const max = maxParts !== undefined && isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1174
+ const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1175
+ let items = result.items;
1176
+ const parts = result.parts;
1177
+ if (isDateEnabled) {
1178
+ items = items.map((itemObject, index) => {
1179
+ const referenceParts = parts[index];
1180
+ let disabled;
1181
+ try {
1182
+ /**
1183
+ * The `isDateEnabled` implementation is try-catch wrapped
1184
+ * to prevent exceptions in the user's function from
1185
+ * interrupting the calendar rendering.
1186
+ */
1187
+ disabled = !isDateEnabled(convertDataToISO(referenceParts));
1188
+ }
1189
+ catch (e) {
1190
+ printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1191
+ }
1192
+ return Object.assign(Object.assign({}, itemObject), { disabled });
1193
+ });
1194
+ }
1195
+ /**
1196
+ * If we have selected a day already, then default the column
1197
+ * to that value. Otherwise, set it to the default date.
1198
+ */
1199
+ const todayString = workingParts.day !== null
1200
+ ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1201
+ : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1202
+ return (h("ion-picker-column-internal", { class: "date-column", color: this.color, items: items, value: todayString, onIonChange: (ev) => {
1203
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1204
+ // Due to a Safari 14 issue we need to destroy
1205
+ // the scroll listener before we update state
1206
+ // and trigger a re-render.
1207
+ if (this.destroyCalendarListener) {
1208
+ this.destroyCalendarListener();
1209
+ }
1210
+ const { value } = ev.detail;
1211
+ const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1212
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1213
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1214
+ // We can re-attach the scroll listener after
1215
+ // the working parts have been updated.
1216
+ this.initializeCalendarListener();
1217
+ ev.stopPropagation();
1218
+ } }));
1219
+ }
1220
+ renderIndividualDatePickerColumns(forcePresentation) {
1221
+ const { workingParts, isDateEnabled } = this;
1222
+ const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1223
+ const months = shouldRenderMonths
1224
+ ? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1225
+ : [];
1226
+ const shouldRenderDays = forcePresentation === 'date';
1227
+ let days = shouldRenderDays
1228
+ ? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1229
+ : [];
1230
+ if (isDateEnabled) {
1231
+ days = days.map((dayObject) => {
1232
+ const { value } = dayObject;
1233
+ const valueNum = typeof value === 'string' ? parseInt(value) : value;
1234
+ const referenceParts = {
1235
+ month: workingParts.month,
1236
+ day: valueNum,
1237
+ year: workingParts.year,
1238
+ };
1239
+ let disabled;
1240
+ try {
1241
+ /**
1242
+ * The `isDateEnabled` implementation is try-catch wrapped
1243
+ * to prevent exceptions in the user's function from
1244
+ * interrupting the calendar rendering.
1245
+ */
1246
+ disabled = !isDateEnabled(convertDataToISO(referenceParts));
1247
+ }
1248
+ catch (e) {
1249
+ printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1250
+ }
1251
+ return Object.assign(Object.assign({}, dayObject), { disabled });
1252
+ });
1253
+ }
1254
+ const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
1255
+ const years = shouldRenderYears
1256
+ ? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
1257
+ : [];
1258
+ /**
1259
+ * Certain locales show the day before the month.
1260
+ */
1261
+ const showMonthFirst = isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
1262
+ let renderArray = [];
1263
+ if (showMonthFirst) {
1264
+ renderArray = [
1265
+ this.renderMonthPickerColumn(months),
1266
+ this.renderDayPickerColumn(days),
1267
+ this.renderYearPickerColumn(years),
1268
+ ];
1269
+ }
1270
+ else {
1271
+ renderArray = [
1272
+ this.renderDayPickerColumn(days),
1273
+ this.renderMonthPickerColumn(months),
1274
+ this.renderYearPickerColumn(years),
1275
+ ];
1276
+ }
1277
+ return renderArray;
1278
+ }
1279
+ renderDayPickerColumn(days) {
1280
+ var _a;
1281
+ if (days.length === 0) {
1282
+ return [];
1283
+ }
1284
+ const { workingParts } = this;
1285
+ const activePart = this.getActivePartsWithFallback();
1286
+ return (h("ion-picker-column-internal", { class: "day-column", color: this.color, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
1287
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1288
+ // Due to a Safari 14 issue we need to destroy
1289
+ // the scroll listener before we update state
1290
+ // and trigger a re-render.
1291
+ if (this.destroyCalendarListener) {
1292
+ this.destroyCalendarListener();
1293
+ }
1294
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
1295
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
1296
+ // We can re-attach the scroll listener after
1297
+ // the working parts have been updated.
1298
+ this.initializeCalendarListener();
1299
+ ev.stopPropagation();
1300
+ } }));
1301
+ }
1302
+ renderMonthPickerColumn(months) {
1303
+ if (months.length === 0) {
1304
+ return [];
1305
+ }
1306
+ const { workingParts } = this;
1307
+ const activePart = this.getActivePartsWithFallback();
1308
+ return (h("ion-picker-column-internal", { class: "month-column", color: this.color, items: months, value: workingParts.month, onIonChange: (ev) => {
1309
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1310
+ // Due to a Safari 14 issue we need to destroy
1311
+ // the scroll listener before we update state
1312
+ // and trigger a re-render.
1313
+ if (this.destroyCalendarListener) {
1314
+ this.destroyCalendarListener();
1315
+ }
1316
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
1317
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
1318
+ // We can re-attach the scroll listener after
1319
+ // the working parts have been updated.
1320
+ this.initializeCalendarListener();
1321
+ ev.stopPropagation();
1322
+ } }));
1323
+ }
1324
+ renderYearPickerColumn(years) {
1325
+ if (years.length === 0) {
1326
+ return [];
1327
+ }
1328
+ const { workingParts } = this;
1329
+ const activePart = this.getActivePartsWithFallback();
1330
+ return (h("ion-picker-column-internal", { class: "year-column", color: this.color, items: years, value: workingParts.year, onIonChange: (ev) => {
1331
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1332
+ // Due to a Safari 14 issue we need to destroy
1333
+ // the scroll listener before we update state
1334
+ // and trigger a re-render.
1335
+ if (this.destroyCalendarListener) {
1336
+ this.destroyCalendarListener();
1337
+ }
1338
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
1339
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
1340
+ // We can re-attach the scroll listener after
1341
+ // the working parts have been updated.
1342
+ this.initializeCalendarListener();
1343
+ ev.stopPropagation();
1344
+ } }));
1345
+ }
1346
+ renderTimePickerColumns(forcePresentation) {
1347
+ if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
1348
+ return [];
1349
+ }
1350
+ /**
1351
+ * If a user has not selected a date,
1352
+ * then we should show all times. If the
1353
+ * user has selected a date (even if it has
1354
+ * not been confirmed yet), we should apply
1355
+ * the max and min restrictions so that the
1356
+ * time picker shows values that are
1357
+ * appropriate for the selected date.
1358
+ */
1359
+ const activePart = this.getActivePart();
1360
+ const userHasSelectedDate = activePart !== undefined;
1361
+ const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
1362
+ return [
1363
+ this.renderHourPickerColumn(hoursData),
1364
+ this.renderMinutePickerColumn(minutesData),
1365
+ this.renderDayPeriodPickerColumn(dayPeriodData),
1366
+ ];
1367
+ }
1368
+ renderHourPickerColumn(hoursData) {
1369
+ const { workingParts } = this;
1370
+ if (hoursData.length === 0)
1371
+ return [];
1372
+ const activePart = this.getActivePartsWithFallback();
1373
+ return (h("ion-picker-column-internal", { color: this.color, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
1374
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
1375
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
1376
+ ev.stopPropagation();
1377
+ } }));
1378
+ }
1379
+ renderMinutePickerColumn(minutesData) {
1380
+ const { workingParts } = this;
1381
+ if (minutesData.length === 0)
1382
+ return [];
1383
+ const activePart = this.getActivePartsWithFallback();
1384
+ return (h("ion-picker-column-internal", { color: this.color, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
1385
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
1386
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
1387
+ ev.stopPropagation();
1388
+ } }));
1389
+ }
1390
+ renderDayPeriodPickerColumn(dayPeriodData) {
1391
+ const { workingParts } = this;
1392
+ if (dayPeriodData.length === 0) {
1393
+ return [];
1394
+ }
1395
+ const activePart = this.getActivePartsWithFallback();
1396
+ const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
1397
+ return (h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
1398
+ const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
1399
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
1400
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
1401
+ ev.stopPropagation();
1402
+ } }));
1403
+ }
1404
+ renderWheelView(forcePresentation) {
1405
+ const { locale } = this;
1406
+ const showMonthFirst = isMonthFirstLocale(locale);
1407
+ const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
1408
+ return (h("div", { class: {
1409
+ [`wheel-order-${columnOrder}`]: true,
1410
+ } }, this.renderWheelPicker(forcePresentation)));
1411
+ }
1412
+ /**
1413
+ * Grid Render Methods
1414
+ */
1415
+ renderCalendarHeader(mode) {
1416
+ const expandedIcon = mode === 'ios' ? chevronDown : caretUpSharp;
1417
+ const collapsedIcon = mode === 'ios' ? chevronForward : caretDownSharp;
1418
+ const prevMonthDisabled = isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
1419
+ const nextMonthDisabled = isNextMonthDisabled(this.workingParts, this.maxParts);
1420
+ // don't use the inheritAttributes util because it removes dir from the host, and we still need that
1421
+ const hostDir = this.el.getAttribute('dir') || undefined;
1422
+ return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("ion-item", { button: true, detail: false, lines: "none", onClick: () => this.toggleMonthAndYearView() }, h("ion-label", null, getMonthAndYear(this.locale, this.workingParts), ' ', h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })))), h("div", { class: "calendar-next-prev" }, h("ion-buttons", null, h("ion-button", { "aria-label": "previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), h("div", { class: "calendar-days-of-week" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
1423
+ return h("div", { class: "day-of-week" }, d);
1424
+ }))));
1425
+ }
1426
+ renderMonth(month, year) {
1427
+ const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
1428
+ const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
1429
+ const isCalMonthDisabled = !yearAllowed || !monthAllowed;
1430
+ const swipeDisabled = isMonthDisabled({
1431
+ month,
1432
+ year,
1433
+ day: null,
1434
+ }, {
1435
+ // The day is not used when checking if a month is disabled.
1436
+ // Users should be able to access the min or max month, even if the
1437
+ // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
1438
+ minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
1439
+ maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
1440
+ });
1441
+ // The working month should never have swipe disabled.
1442
+ // Otherwise the CSS scroll snap will not work and the user
1443
+ // can free-scroll the calendar.
1444
+ const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
1445
+ const activePart = this.getActivePartsWithFallback();
1446
+ return (h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
1447
+ 'calendar-month': true,
1448
+ // Prevents scroll snap swipe gestures for months outside of the min/max bounds
1449
+ 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
1450
+ } }, h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7).map((dateObject, index) => {
1451
+ const { day, dayOfWeek } = dateObject;
1452
+ const { isDateEnabled, multiple } = this;
1453
+ const referenceParts = { month, day, year };
1454
+ const { isActive, isToday, ariaLabel, ariaSelected, disabled, text } = getCalendarDayState(this.locale, referenceParts, this.activePartsClone, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
1455
+ let isCalDayDisabled = isCalMonthDisabled || disabled;
1456
+ if (!isCalDayDisabled && isDateEnabled !== undefined) {
1457
+ try {
1458
+ /**
1459
+ * The `isDateEnabled` implementation is try-catch wrapped
1460
+ * to prevent exceptions in the user's function from
1461
+ * interrupting the calendar rendering.
1462
+ */
1463
+ isCalDayDisabled = !isDateEnabled(convertDataToISO(referenceParts));
1464
+ }
1465
+ catch (e) {
1466
+ printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1467
+ }
1468
+ }
1469
+ return (h("button", { tabindex: "-1", "data-day": day, "data-month": month, "data-year": year, "data-index": index, "data-day-of-week": dayOfWeek, disabled: isCalDayDisabled, class: {
1470
+ 'calendar-day-padding': day === null,
1471
+ 'calendar-day': true,
1472
+ 'calendar-day-active': isActive,
1473
+ 'calendar-day-today': isToday,
1474
+ }, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
1475
+ if (day === null) {
1476
+ return;
1477
+ }
1478
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month,
1479
+ day,
1480
+ year }));
1481
+ // multiple only needs date info, so we can wipe out other fields like time
1482
+ if (multiple) {
1483
+ this.setActiveParts({
1484
+ month,
1485
+ day,
1486
+ year,
1487
+ }, isActive);
1488
+ }
1489
+ else {
1490
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month,
1491
+ day,
1492
+ year }));
1493
+ }
1494
+ } }, text));
1495
+ }))));
1496
+ }
1497
+ renderCalendarBody() {
1498
+ return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts).map(({ month, year }) => {
1499
+ return this.renderMonth(month, year);
1500
+ })));
1501
+ }
1502
+ renderCalendar(mode) {
1503
+ return (h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(mode), this.renderCalendarBody()));
1504
+ }
1505
+ renderTimeLabel() {
1506
+ const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
1507
+ if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
1508
+ return;
1509
+ }
1510
+ return h("slot", { name: "time-label" }, "Time");
1511
+ }
1512
+ renderTimeOverlay() {
1513
+ const use24Hour = is24Hour(this.locale, this.hourCycle);
1514
+ const activePart = this.getActivePartsWithFallback();
1515
+ return [
1516
+ h("div", { class: "time-header" }, this.renderTimeLabel()),
1517
+ h("button", { class: {
1518
+ 'time-body': true,
1519
+ 'time-body-active': this.isTimePopoverOpen,
1520
+ }, "aria-expanded": "false", "aria-haspopup": "true", onClick: async (ev) => {
1521
+ const { popoverRef } = this;
1522
+ if (popoverRef) {
1523
+ this.isTimePopoverOpen = true;
1524
+ popoverRef.present(new CustomEvent('ionShadowTarget', {
1525
+ detail: {
1526
+ ionShadowTarget: ev.target,
1527
+ },
1528
+ }));
1529
+ await popoverRef.onWillDismiss();
1530
+ this.isTimePopoverOpen = false;
1531
+ }
1532
+ } }, getLocalizedTime(this.locale, activePart, use24Hour)),
1533
+ h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1534
+ /**
1535
+ * Intersection Observers do not consistently fire between Blink and Webkit
1536
+ * when toggling the visibility of the popover and trying to scroll the picker
1537
+ * column to the correct time value.
1538
+ *
1539
+ * This will correctly scroll the element position to the correct time value,
1540
+ * before the popover is fully presented.
1541
+ */
1542
+ const cols = ev.target.querySelectorAll('ion-picker-column-internal');
1543
+ // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
1544
+ cols.forEach((col) => col.scrollActiveItemIntoView());
1545
+ }, style: {
1546
+ '--offset-y': '-10px',
1547
+ '--min-width': 'fit-content',
1548
+ },
1549
+ // Allow native browser keyboard events to support up/down/home/end key
1550
+ // navigation within the time picker.
1551
+ keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
1552
+ ];
1553
+ }
1554
+ getHeaderSelectedDateText() {
1555
+ const { activeParts, multiple, titleSelectedDatesFormatter } = this;
1556
+ const isArray = Array.isArray(activeParts);
1557
+ let headerText;
1558
+ if (multiple && isArray && activeParts.length !== 1) {
1559
+ headerText = `${activeParts.length} days`; // default/fallback for multiple selection
1560
+ if (titleSelectedDatesFormatter !== undefined) {
1561
+ try {
1562
+ headerText = titleSelectedDatesFormatter(convertDataToISO(activeParts));
1563
+ }
1564
+ catch (e) {
1565
+ printIonError('Exception in provided `titleSelectedDatesFormatter`: ', e);
1566
+ }
1567
+ }
1568
+ }
1569
+ else {
1570
+ // for exactly 1 day selected (multiple set or not), show a formatted version of that
1571
+ headerText = getMonthAndDay(this.locale, this.getActivePartsWithFallback());
1572
+ }
1573
+ return headerText;
1574
+ }
1575
+ renderCalendarViewHeader(showExpandedHeader = true) {
1576
+ const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
1577
+ if (!hasSlottedTitle && !this.showDefaultTitle) {
1578
+ return;
1579
+ }
1580
+ return (h("div", { class: "datetime-header" }, h("div", { class: "datetime-title" }, h("slot", { name: "title" }, "Select Date")), showExpandedHeader && h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
1581
+ }
1582
+ /**
1583
+ * Render time picker inside of datetime.
1584
+ * Do not pass color prop to segment on
1585
+ * iOS mode. MD segment has been customized and
1586
+ * should take on the color prop, but iOS
1587
+ * should just be the default segment.
1588
+ */
1589
+ renderTime() {
1590
+ const { presentation } = this;
1591
+ const timeOnlyPresentation = presentation === 'time';
1592
+ return (h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
1593
+ }
1594
+ /**
1595
+ * Renders the month/year picker that is
1596
+ * displayed on the calendar grid.
1597
+ * The .datetime-year class has additional
1598
+ * styles that let us show/hide the
1599
+ * picker when the user clicks on the
1600
+ * toggle in the calendar header.
1601
+ */
1602
+ renderCalendarViewMonthYearPicker() {
1603
+ return h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
1604
+ }
1605
+ /**
1606
+ * Render entry point
1607
+ * All presentation types are rendered from here.
1608
+ */
1609
+ renderDatetime(mode) {
1610
+ const { presentation, preferWheel } = this;
1611
+ /**
1612
+ * Certain presentation types have separate grid and wheel displays.
1613
+ * If preferWheel is true then we should show a wheel picker instead.
1614
+ */
1615
+ const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1616
+ if (preferWheel && hasWheelVariant) {
1617
+ return [this.renderCalendarViewHeader(false), this.renderWheelView(), this.renderFooter()];
1618
+ }
1619
+ switch (presentation) {
1620
+ case 'date-time':
1621
+ return [
1622
+ this.renderCalendarViewHeader(),
1623
+ this.renderCalendar(mode),
1624
+ this.renderCalendarViewMonthYearPicker(),
1625
+ this.renderTime(),
1626
+ this.renderFooter(),
1627
+ ];
1628
+ case 'time-date':
1629
+ return [
1630
+ this.renderCalendarViewHeader(),
1631
+ this.renderTime(),
1632
+ this.renderCalendar(mode),
1633
+ this.renderCalendarViewMonthYearPicker(),
1634
+ this.renderFooter(),
1635
+ ];
1636
+ case 'time':
1637
+ return [this.renderTime(), this.renderFooter()];
1638
+ case 'month':
1639
+ case 'month-year':
1640
+ case 'year':
1641
+ return [this.renderWheelView(), this.renderFooter()];
1642
+ default:
1643
+ return [
1644
+ this.renderCalendarViewHeader(),
1645
+ this.renderCalendar(mode),
1646
+ this.renderCalendarViewMonthYearPicker(),
1647
+ this.renderFooter(),
1648
+ ];
1649
+ }
1650
+ }
1651
+ render() {
1652
+ const { name, value, disabled, el, color, isPresented, readonly, showMonthAndYear, preferWheel, presentation, size, } = this;
1653
+ const mode = getIonMode(this);
1654
+ const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
1655
+ const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
1656
+ const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
1657
+ const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1658
+ const hasWheelVariant = hasDatePresentation && preferWheel;
1659
+ const hasGrid = hasDatePresentation && !preferWheel;
1660
+ renderHiddenInput(true, el, name, formatValue(value), disabled);
1661
+ return (h(Host, { "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
1662
+ [mode]: true,
1663
+ ['datetime-presented']: isPresented,
1664
+ ['datetime-readonly']: readonly,
1665
+ ['datetime-disabled']: disabled,
1666
+ 'show-month-and-year': shouldShowMonthAndYear,
1667
+ 'month-year-picker-open': monthYearPickerOpen,
1668
+ [`datetime-presentation-${presentation}`]: true,
1669
+ [`datetime-size-${size}`]: true,
1670
+ [`datetime-prefer-wheel`]: hasWheelVariant,
1671
+ [`datetime-grid`]: hasGrid,
1672
+ })) }, this.renderDatetime(mode)));
1673
+ }
1674
+ get el() { return this; }
1675
+ static get watchers() { return {
1676
+ "disabled": ["disabledChanged"],
1677
+ "min": ["minChanged"],
1678
+ "max": ["maxChanged"],
1679
+ "yearValues": ["yearValuesChanged"],
1680
+ "monthValues": ["monthValuesChanged"],
1681
+ "dayValues": ["dayValuesChanged"],
1682
+ "hourValues": ["hourValuesChanged"],
1683
+ "minuteValues": ["minuteValuesChanged"],
1684
+ "activeParts": ["activePartsChanged"],
1685
+ "value": ["valueChanged"]
1686
+ }; }
1687
+ static get style() { return {
1688
+ ios: datetimeIosCss,
1689
+ md: datetimeMdCss
1690
+ }; }
1691
+ }, [33, "ion-datetime", {
1692
+ "color": [1],
1693
+ "name": [1],
1694
+ "disabled": [4],
1695
+ "readonly": [4],
1696
+ "isDateEnabled": [16],
1697
+ "min": [1025],
1698
+ "max": [1025],
1699
+ "presentation": [1],
1700
+ "cancelText": [1, "cancel-text"],
1701
+ "doneText": [1, "done-text"],
1702
+ "clearText": [1, "clear-text"],
1703
+ "yearValues": [8, "year-values"],
1704
+ "monthValues": [8, "month-values"],
1705
+ "dayValues": [8, "day-values"],
1706
+ "hourValues": [8, "hour-values"],
1707
+ "minuteValues": [8, "minute-values"],
1708
+ "locale": [1],
1709
+ "firstDayOfWeek": [2, "first-day-of-week"],
1710
+ "titleSelectedDatesFormatter": [16],
1711
+ "multiple": [4],
1712
+ "value": [1025],
1713
+ "showDefaultTitle": [4, "show-default-title"],
1714
+ "showDefaultButtons": [4, "show-default-buttons"],
1715
+ "showClearButton": [4, "show-clear-button"],
1716
+ "showDefaultTimeLabel": [4, "show-default-time-label"],
1717
+ "hourCycle": [1, "hour-cycle"],
1718
+ "size": [1],
1719
+ "preferWheel": [4, "prefer-wheel"],
1720
+ "showMonthAndYear": [32],
1721
+ "activeParts": [32],
1722
+ "workingParts": [32],
1723
+ "isPresented": [32],
1724
+ "isTimePopoverOpen": [32],
1725
+ "confirm": [64],
1726
+ "reset": [64],
1727
+ "cancel": [64]
1728
+ }]);
1729
+ let datetimeIds = 0;
1730
+ function defineCustomElement$1() {
1731
+ if (typeof customElements === "undefined") {
1732
+ return;
1733
+ }
1734
+ const components = ["ion-datetime", "ion-backdrop", "ion-button", "ion-buttons", "ion-icon", "ion-item", "ion-label", "ion-note", "ion-picker-column-internal", "ion-picker-internal", "ion-popover", "ion-ripple-effect"];
1735
+ components.forEach(tagName => { switch (tagName) {
1736
+ case "ion-datetime":
1737
+ if (!customElements.get(tagName)) {
1738
+ customElements.define(tagName, Datetime);
1739
+ }
1740
+ break;
1741
+ case "ion-backdrop":
1742
+ if (!customElements.get(tagName)) {
1743
+ defineCustomElement$c();
1744
+ }
1745
+ break;
1746
+ case "ion-button":
1747
+ if (!customElements.get(tagName)) {
1748
+ defineCustomElement$b();
1749
+ }
1750
+ break;
1751
+ case "ion-buttons":
1752
+ if (!customElements.get(tagName)) {
1753
+ defineCustomElement$a();
1754
+ }
1755
+ break;
1756
+ case "ion-icon":
1757
+ if (!customElements.get(tagName)) {
1758
+ defineCustomElement$9();
1759
+ }
1760
+ break;
1761
+ case "ion-item":
1762
+ if (!customElements.get(tagName)) {
1763
+ defineCustomElement$8();
1764
+ }
1765
+ break;
1766
+ case "ion-label":
1767
+ if (!customElements.get(tagName)) {
1768
+ defineCustomElement$7();
1769
+ }
1770
+ break;
1771
+ case "ion-note":
1772
+ if (!customElements.get(tagName)) {
1773
+ defineCustomElement$6();
1774
+ }
1775
+ break;
1776
+ case "ion-picker-column-internal":
1777
+ if (!customElements.get(tagName)) {
1778
+ defineCustomElement$5();
1779
+ }
1780
+ break;
1781
+ case "ion-picker-internal":
1782
+ if (!customElements.get(tagName)) {
1783
+ defineCustomElement$4();
1784
+ }
1785
+ break;
1786
+ case "ion-popover":
1787
+ if (!customElements.get(tagName)) {
1788
+ defineCustomElement$3();
1789
+ }
1790
+ break;
1791
+ case "ion-ripple-effect":
1792
+ if (!customElements.get(tagName)) {
1793
+ defineCustomElement$2();
1794
+ }
1795
+ break;
1796
+ } });
1797
+ }
1798
+
1799
+ const IonDatetime = Datetime;
1800
+ const defineCustomElement = defineCustomElement$1;
1801
+
1802
+ export { IonDatetime, defineCustomElement };