voyager-ionic-core 8.8.12 → 8.8.17

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 (237) hide show
  1. package/components/index.js +1 -1
  2. package/components/ion-accordion.js +1 -1
  3. package/components/ion-action-sheet.js +1 -1
  4. package/components/ion-alert.js +1 -1
  5. package/components/ion-app.js +1 -1
  6. package/components/ion-back-button.js +1 -1
  7. package/components/ion-breadcrumb.js +1 -1
  8. package/components/ion-button.js +1 -1
  9. package/components/ion-card.js +1 -1
  10. package/components/ion-checkbox.js +1 -1
  11. package/components/ion-content.js +1 -1
  12. package/components/ion-datetime-button.js +1 -1
  13. package/components/ion-datetime.js +1 -1
  14. package/components/ion-fab-button.js +1 -1
  15. package/components/ion-footer.js +1 -1
  16. package/components/ion-header.js +1 -1
  17. package/components/ion-img.js +1 -1
  18. package/components/ion-infinite-scroll.js +1 -1
  19. package/components/ion-input-otp.js +1 -1
  20. package/components/ion-input-password-toggle.js +1 -1
  21. package/components/ion-input.js +1 -1
  22. package/components/ion-item-options.js +1 -1
  23. package/components/ion-item-sliding.js +1 -1
  24. package/components/ion-item.js +1 -1
  25. package/components/ion-loading.js +1 -1
  26. package/components/ion-menu-button.js +1 -1
  27. package/components/ion-menu-toggle.js +1 -1
  28. package/components/ion-menu.js +1 -1
  29. package/components/ion-modal.js +1 -1
  30. package/components/ion-nav.js +1 -1
  31. package/components/ion-picker-column-option.js +1 -1
  32. package/components/ion-picker-column.js +1 -1
  33. package/components/ion-picker-legacy-column.js +1 -1
  34. package/components/ion-picker-legacy.js +1 -1
  35. package/components/ion-picker.js +1 -1
  36. package/components/ion-popover.js +1 -1
  37. package/components/ion-progress-bar.js +1 -1
  38. package/components/ion-radio-group.js +1 -1
  39. package/components/ion-radio.js +1 -1
  40. package/components/ion-range.js +1 -1
  41. package/components/ion-refresher-content.js +1 -1
  42. package/components/ion-refresher.js +1 -1
  43. package/components/ion-reorder-group.js +1 -1
  44. package/components/ion-router-outlet.js +1 -1
  45. package/components/ion-router.js +1 -1
  46. package/components/ion-searchbar.js +1 -1
  47. package/components/ion-segment-button.js +1 -1
  48. package/components/ion-segment.js +1 -1
  49. package/components/ion-select-modal.js +1 -1
  50. package/components/ion-select-popover.js +1 -1
  51. package/components/ion-select.js +1 -1
  52. package/components/ion-tab-button.js +1 -1
  53. package/components/ion-tab.js +1 -1
  54. package/components/ion-textarea.js +1 -1
  55. package/components/ion-toast.js +1 -1
  56. package/components/ion-toggle.js +1 -1
  57. package/components/{p-CtukzcyX.js → p-A3O24YmY.js} +1 -1
  58. package/components/{p-CU5rbWAW.js → p-ABkNVeU9.js} +1 -1
  59. package/components/{p-BT_5jSqG.js → p-B-JJgYSG.js} +1 -1
  60. package/components/p-BB42Mlnr.js +4 -0
  61. package/components/{p-lE_JGpHD.js → p-BMI53wYL.js} +1 -1
  62. package/components/p-BkKAANMJ.js +4 -0
  63. package/components/p-BlIAuGv2.js +4 -0
  64. package/components/{p-Bth-EzJ0.js → p-Bnsn6KaP.js} +1 -1
  65. package/components/p-BsBCoGa-.js +4 -0
  66. package/components/{p-BnqQlm7c.js → p-CQGnMY3n.js} +1 -1
  67. package/components/{p-DNQI6d-L.js → p-C_hpsif8.js} +1 -1
  68. package/components/p-Cf2jSDS8.js +4 -0
  69. package/components/{p-C4t5ymfq.js → p-ChIZKXUu.js} +1 -1
  70. package/components/p-CkMSOsFF.js +4 -0
  71. package/components/p-CsNJ1ULL.js +4 -0
  72. package/components/{p-BsPelv04.js → p-CzCbeKys.js} +1 -1
  73. package/components/{p-BjfgFSSR.js → p-D-aHdMxW.js} +1 -1
  74. package/components/p-D0d8qTwj.js +4 -0
  75. package/components/{p-Baq1XyAy.js → p-D3xo7hqU.js} +1 -1
  76. package/components/{p-nQi4oKcG.js → p-DCnGU1fF.js} +1 -1
  77. package/components/p-DGZpx6KJ.js +4 -0
  78. package/components/p-DGvrK8dD.js +4 -0
  79. package/components/p-DHTSTb52.js +4 -0
  80. package/components/{p-BirPFsRD.js → p-DJZp0KTQ.js} +1 -1
  81. package/components/{p-ijF0iCrA.js → p-DRugphUN.js} +1 -1
  82. package/components/{p-0NRupjzW.js → p-DV5mPYQS.js} +1 -1
  83. package/components/{p-C1aScSTo.js → p-DWkAgceV.js} +1 -1
  84. package/components/{p-DDWp95gH.js → p-KEFO0w3i.js} +1 -1
  85. package/components/{p-Ciz1-FuE.js → p-Osve4qkc.js} +1 -1
  86. package/components/{p-dhLYXa7A.js → p-SLS1rDZM.js} +1 -1
  87. package/components/{p-D5Ubpm7D.js → p-VWbRkLT7.js} +1 -1
  88. package/components/{p-BTPfOxsU.js → p-aJ6PBUvj.js} +1 -1
  89. package/components/{p-DnL1c9_X.js → p-oD4kcBRX.js} +1 -1
  90. package/components/{p-CI3ncNZm.js → p-scxfI1Dd.js} +1 -1
  91. package/components/p-yzCsOZE2.js +4 -0
  92. package/dist/cjs/{data-DLTUw-KF.js → format-PxvGiOik.js} +8 -532
  93. package/dist/cjs/index.cjs.js +1 -1
  94. package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
  95. package/dist/cjs/ion-alert.cjs.entry.js +1 -1
  96. package/dist/cjs/ion-button_2.cjs.entry.js +7 -3
  97. package/dist/cjs/ion-checkbox.cjs.entry.js +17 -7
  98. package/dist/cjs/ion-datetime-button.cjs.entry.js +17 -15
  99. package/dist/cjs/ion-datetime_3.cjs.entry.js +616 -75
  100. package/dist/cjs/ion-fab_3.cjs.entry.js +87 -9
  101. package/dist/cjs/ion-item_8.cjs.entry.js +84 -4
  102. package/dist/cjs/ion-loading.cjs.entry.js +1 -1
  103. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  104. package/dist/cjs/ion-modal.cjs.entry.js +35 -9
  105. package/dist/cjs/ion-popover.cjs.entry.js +1 -1
  106. package/dist/cjs/ion-radio_2.cjs.entry.js +16 -7
  107. package/dist/cjs/ion-refresher_2.cjs.entry.js +31 -4
  108. package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
  109. package/dist/cjs/ion-select_3.cjs.entry.js +5 -4
  110. package/dist/cjs/ion-tab_2.cjs.entry.js +20 -13
  111. package/dist/cjs/ion-toast.cjs.entry.js +1 -1
  112. package/dist/cjs/ion-toggle.cjs.entry.js +25 -6
  113. package/dist/cjs/ionic.cjs.js +1 -1
  114. package/dist/cjs/item-multiple-inputs-D-gyg57c.js +38 -0
  115. package/dist/cjs/loader.cjs.js +1 -1
  116. package/dist/cjs/{overlays-TbKsuC-K.js → overlays-DdtIYQUH.js} +24 -1
  117. package/dist/collection/components/button/button.js +7 -3
  118. package/dist/collection/components/checkbox/checkbox.ios.css +18 -0
  119. package/dist/collection/components/checkbox/checkbox.js +16 -7
  120. package/dist/collection/components/checkbox/checkbox.md.css +18 -0
  121. package/dist/collection/components/datetime/datetime.js +51 -6
  122. package/dist/collection/components/datetime-button/datetime-button.js +8 -7
  123. package/dist/collection/components/fab-button/fab-button.js +114 -10
  124. package/dist/collection/components/item/item.ios.css +11 -0
  125. package/dist/collection/components/item/item.js +85 -4
  126. package/dist/collection/components/item/item.md.css +11 -0
  127. package/dist/collection/components/modal/gestures/sheet.js +7 -0
  128. package/dist/collection/components/modal/gestures/swipe-to-close.js +7 -0
  129. package/dist/collection/components/modal/modal.ios.css +8 -0
  130. package/dist/collection/components/modal/modal.js +18 -6
  131. package/dist/collection/components/modal/modal.md.css +8 -0
  132. package/dist/collection/components/radio/radio.ios.css +11 -15
  133. package/dist/collection/components/radio/radio.js +15 -7
  134. package/dist/collection/components/radio/radio.md.css +11 -11
  135. package/dist/collection/components/refresher/refresher.js +31 -4
  136. package/dist/collection/components/select/select.js +4 -3
  137. package/dist/collection/components/tab/tab.js +20 -13
  138. package/dist/collection/components/toggle/toggle.ios.css +12 -4
  139. package/dist/collection/components/toggle/toggle.js +24 -6
  140. package/dist/collection/components/toggle/toggle.md.css +42 -5
  141. package/dist/collection/utils/forms/index.js +1 -0
  142. package/dist/collection/utils/forms/item-multiple-inputs.js +33 -0
  143. package/dist/collection/utils/overlays.js +24 -1
  144. package/dist/collection/utils/test/playwright/apply-keyboard-focus.js +25 -0
  145. package/dist/collection/utils/test/playwright/drag-element.js +15 -0
  146. package/dist/collection/utils/test/playwright/index.js +1 -0
  147. package/dist/docs.json +40 -1
  148. package/dist/esm/{data-DZI70dKr.js → format-CAmvpAez.js} +1 -524
  149. package/dist/esm/index.js +1 -1
  150. package/dist/esm/ion-action-sheet.entry.js +1 -1
  151. package/dist/esm/ion-alert.entry.js +1 -1
  152. package/dist/esm/ion-button_2.entry.js +7 -3
  153. package/dist/esm/ion-checkbox.entry.js +19 -9
  154. package/dist/esm/ion-datetime-button.entry.js +9 -7
  155. package/dist/esm/ion-datetime_3.entry.js +550 -9
  156. package/dist/esm/ion-fab_3.entry.js +89 -11
  157. package/dist/esm/ion-item_8.entry.js +84 -4
  158. package/dist/esm/ion-loading.entry.js +1 -1
  159. package/dist/esm/ion-menu_3.entry.js +1 -1
  160. package/dist/esm/ion-modal.entry.js +35 -9
  161. package/dist/esm/ion-popover.entry.js +1 -1
  162. package/dist/esm/ion-radio_2.entry.js +17 -8
  163. package/dist/esm/ion-refresher_2.entry.js +31 -4
  164. package/dist/esm/ion-select-modal.entry.js +1 -1
  165. package/dist/esm/ion-select_3.entry.js +5 -4
  166. package/dist/esm/ion-tab_2.entry.js +20 -13
  167. package/dist/esm/ion-toast.entry.js +1 -1
  168. package/dist/esm/ion-toggle.entry.js +27 -8
  169. package/dist/esm/ionic.js +1 -1
  170. package/dist/esm/item-multiple-inputs-DlNuqNJm.js +36 -0
  171. package/dist/esm/loader.js +1 -1
  172. package/dist/esm/{overlays-TbiM4mdr.js → overlays-Dg0q2_tJ.js} +25 -2
  173. package/dist/html.html-data.json +4 -0
  174. package/dist/ionic/index.esm.js +1 -1
  175. package/dist/ionic/ionic.esm.js +1 -1
  176. package/dist/ionic/{p-30bf9737.entry.js → p-0dc33652.entry.js} +1 -1
  177. package/dist/ionic/p-10e833ef.entry.js +4 -0
  178. package/dist/ionic/{p-4dc1c33c.entry.js → p-2a05aa64.entry.js} +1 -1
  179. package/dist/ionic/p-2b204c59.entry.js +4 -0
  180. package/dist/ionic/p-2fa58e80.entry.js +4 -0
  181. package/dist/ionic/{p-94f2a736.entry.js → p-34586ead.entry.js} +1 -1
  182. package/dist/ionic/p-4654ae1c.entry.js +4 -0
  183. package/dist/ionic/p-4ac4f3d6.entry.js +4 -0
  184. package/dist/ionic/p-5018dfc8.entry.js +4 -0
  185. package/dist/ionic/{p-00dbb17e.entry.js → p-5eb8e86d.entry.js} +1 -1
  186. package/dist/ionic/{p-e847a888.entry.js → p-65ebdf1b.entry.js} +1 -1
  187. package/dist/ionic/p-7c319341.entry.js +4 -0
  188. package/dist/ionic/p-829367ed.entry.js +4 -0
  189. package/dist/ionic/{p-aa5d6b8f.entry.js → p-9f9db3a2.entry.js} +1 -1
  190. package/dist/ionic/p-C0eMdTCW.js +4 -0
  191. package/dist/ionic/p-D-3ycHmd.js +4 -0
  192. package/dist/ionic/p-DqN5EA2O.js +4 -0
  193. package/dist/ionic/p-aaeedb6b.entry.js +4 -0
  194. package/dist/ionic/p-bfc9bb0f.entry.js +4 -0
  195. package/dist/ionic/p-c38b648e.entry.js +4 -0
  196. package/dist/ionic/{p-3a541154.entry.js → p-ca2ab74d.entry.js} +1 -1
  197. package/dist/ionic/p-d889ff6d.entry.js +4 -0
  198. package/dist/types/components/checkbox/checkbox.d.ts +1 -0
  199. package/dist/types/components/datetime/datetime.d.ts +8 -0
  200. package/dist/types/components/fab-button/fab-button.d.ts +15 -0
  201. package/dist/types/components/item/item.d.ts +19 -0
  202. package/dist/types/components/radio/radio.d.ts +1 -0
  203. package/dist/types/components/tab/tab.d.ts +1 -1
  204. package/dist/types/components/toggle/toggle.d.ts +1 -0
  205. package/dist/types/components.d.ts +15 -2
  206. package/dist/types/utils/forms/index.d.ts +1 -0
  207. package/dist/types/utils/forms/item-multiple-inputs.d.ts +13 -0
  208. package/dist/types/utils/test/playwright/apply-keyboard-focus.d.ts +16 -0
  209. package/dist/types/utils/test/playwright/index.d.ts +1 -0
  210. package/hydrate/index.js +382 -79
  211. package/hydrate/index.mjs +382 -79
  212. package/package.json +5 -5
  213. package/components/p-5bE_Wz4Y.js +0 -4
  214. package/components/p-B60hm8Qv.js +0 -4
  215. package/components/p-BAYYcg3o.js +0 -4
  216. package/components/p-BjoEPDW5.js +0 -4
  217. package/components/p-C2lKgrXx.js +0 -4
  218. package/components/p-D7bSXQD3.js +0 -4
  219. package/components/p-DIE4pXMl.js +0 -4
  220. package/components/p-W5nO8mX_.js +0 -4
  221. package/components/p-W9CZ2mWX.js +0 -4
  222. package/components/p-XlSIJDJ-.js +0 -4
  223. package/components/p-ryqmO0B-.js +0 -4
  224. package/dist/ionic/p-0d005398.entry.js +0 -4
  225. package/dist/ionic/p-1ae21e4c.entry.js +0 -4
  226. package/dist/ionic/p-2f55dc1a.entry.js +0 -4
  227. package/dist/ionic/p-3a126bca.entry.js +0 -4
  228. package/dist/ionic/p-3a7d1e91.entry.js +0 -4
  229. package/dist/ionic/p-81ea5652.entry.js +0 -4
  230. package/dist/ionic/p-8c8eee7d.entry.js +0 -4
  231. package/dist/ionic/p-9a65ac7f.entry.js +0 -4
  232. package/dist/ionic/p-DAAFkPFT.js +0 -4
  233. package/dist/ionic/p-a21add2f.entry.js +0 -4
  234. package/dist/ionic/p-ec090e0a.entry.js +0 -4
  235. package/dist/ionic/p-fabcce6c.entry.js +0 -4
  236. package/dist/ionic/p-facfde02.entry.js +0 -4
  237. package/dist/ionic/p-xOfi7-Zn.js +0 -4
@@ -6,12 +6,12 @@
6
6
  var index = require('./index-Ct7gcRif.js');
7
7
  var focusVisible = require('./focus-visible-CCvKiLh3.js');
8
8
  var helpers = require('./helpers-Cv23MFHM.js');
9
- var overlays = require('./overlays-TbKsuC-K.js');
9
+ var overlays = require('./overlays-DdtIYQUH.js');
10
10
  var dir = require('./dir-Cn0z1rJH.js');
11
11
  var theme = require('./theme-CeDs6Hcv.js');
12
12
  var index$1 = require('./index-DqmRDbxg.js');
13
13
  var ionicGlobal = require('./ionic-global-B-cA6LkY.js');
14
- var data = require('./data-DLTUw-KF.js');
14
+ var format = require('./format-PxvGiOik.js');
15
15
  var lockController = require('./lock-controller-aDB9wrEf.js');
16
16
  var animation = require('./animation-BJq0kcy2.js');
17
17
  var haptic = require('./haptic-ClPPQ_PS.js');
@@ -21,6 +21,529 @@ require('./framework-delegate-BtICZDHr.js');
21
21
  require('./gesture-controller-dtqlP_q4.js');
22
22
  require('./capacitor-DmA66EwP.js');
23
23
 
24
+ /**
25
+ * Returns the current date as
26
+ * an ISO string in the user's
27
+ * time zone.
28
+ */
29
+ const getToday = () => {
30
+ /**
31
+ * ion-datetime intentionally does not
32
+ * parse time zones/do automatic time zone
33
+ * conversion when accepting user input.
34
+ * However when we get today's date string,
35
+ * we want it formatted relative to the user's
36
+ * time zone.
37
+ *
38
+ * When calling toISOString(), the browser
39
+ * will convert the date to UTC time by either adding
40
+ * or subtracting the time zone offset.
41
+ * To work around this, we need to either add
42
+ * or subtract the time zone offset to the Date
43
+ * object prior to calling toISOString().
44
+ * This allows us to get an ISO string
45
+ * that is in the user's time zone.
46
+ */
47
+ return format.removeDateTzOffset(new Date()).toISOString();
48
+ };
49
+ const minutes = [
50
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
51
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
52
+ ];
53
+ // h11 hour system uses 0-11. Midnight starts at 0:00am.
54
+ const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
55
+ // h12 hour system uses 0-12. Midnight starts at 12:00am.
56
+ const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
57
+ // h23 hour system uses 0-23. Midnight starts at 0:00.
58
+ const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
59
+ // h24 hour system uses 1-24. Midnight starts at 24:00.
60
+ const hour24 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0];
61
+ /**
62
+ * Given a locale and a mode,
63
+ * return an array with formatted days
64
+ * of the week. iOS should display days
65
+ * such as "Mon" or "Tue".
66
+ * MD should display days such as "M"
67
+ * or "T".
68
+ */
69
+ const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
70
+ /**
71
+ * Nov 1st, 2020 starts on a Sunday.
72
+ * ion-datetime assumes weeks start on Sunday,
73
+ * but is configurable via `firstDayOfWeek`.
74
+ */
75
+ const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
76
+ const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
77
+ const startDate = new Date('11/01/2020');
78
+ const daysOfWeek = [];
79
+ /**
80
+ * For each day of the week,
81
+ * get the day name.
82
+ */
83
+ for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
84
+ const currentDate = new Date(startDate);
85
+ currentDate.setDate(currentDate.getDate() + i);
86
+ daysOfWeek.push(intl.format(currentDate));
87
+ }
88
+ return daysOfWeek;
89
+ };
90
+ /**
91
+ * Returns an array containing all of the
92
+ * days in a month for a given year. Values are
93
+ * aligned with a week calendar starting on
94
+ * the firstDayOfWeek value (Sunday by default)
95
+ * using null values.
96
+ */
97
+ const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
98
+ const numDays = format.getNumDaysInMonth(month, year);
99
+ let previousNumDays; //previous month number of days
100
+ if (month === 1) {
101
+ // If the current month is January, the previous month should be December of the previous year.
102
+ previousNumDays = format.getNumDaysInMonth(12, year - 1);
103
+ }
104
+ else {
105
+ // Otherwise, the previous month should be the current month - 1 of the same year.
106
+ previousNumDays = format.getNumDaysInMonth(month - 1, year);
107
+ }
108
+ const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
109
+ /**
110
+ * To get the first day of the month aligned on the correct
111
+ * day of the week, we need to determine how many "filler" days
112
+ * to generate. These filler days as empty/disabled buttons
113
+ * that fill the space of the days of the week before the first
114
+ * of the month.
115
+ *
116
+ * There are two cases here:
117
+ *
118
+ * 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
119
+ * is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
120
+ * this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
121
+ * the first day of the month.
122
+ *
123
+ * 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
124
+ * is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
125
+ * this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
126
+ * the first day of the month.
127
+ */
128
+ const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
129
+ let days = [];
130
+ for (let i = 1; i <= numDays; i++) {
131
+ days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
132
+ }
133
+ if (showAdjacentDays) {
134
+ for (let i = 0; i <= offset; i++) {
135
+ // Using offset create previous month adjacent day, starting from last day
136
+ days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
137
+ }
138
+ // Calculate positiveOffset
139
+ // The calendar will display 42 days (6 rows of 7 columns)
140
+ // Knowing this the offset is 41 (we start at index 0)
141
+ // minus (the previous offset + the current month days)
142
+ const positiveOffset = 41 - (numDays + offset);
143
+ for (let i = 0; i < positiveOffset; i++) {
144
+ days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
145
+ }
146
+ }
147
+ else {
148
+ for (let i = 0; i <= offset; i++) {
149
+ days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
150
+ }
151
+ }
152
+ return days;
153
+ };
154
+ /**
155
+ * Returns an array of pre-defined hour
156
+ * values based on the provided hourCycle.
157
+ */
158
+ const getHourData = (hourCycle) => {
159
+ switch (hourCycle) {
160
+ case 'h11':
161
+ return hour11;
162
+ case 'h12':
163
+ return hour12;
164
+ case 'h23':
165
+ return hour23;
166
+ case 'h24':
167
+ return hour24;
168
+ default:
169
+ throw new Error(`Invalid hour cycle "${hourCycle}"`);
170
+ }
171
+ };
172
+ /**
173
+ * Given a local, reference datetime parts and option
174
+ * max/min bound datetime parts, calculate the acceptable
175
+ * hour and minute values according to the bounds and locale.
176
+ */
177
+ const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
178
+ const computedHourCycle = format.getHourCycle(locale, hourCycle);
179
+ const use24Hour = format.is24Hour(computedHourCycle);
180
+ let processedHours = getHourData(computedHourCycle);
181
+ let processedMinutes = minutes;
182
+ let isAMAllowed = true;
183
+ let isPMAllowed = true;
184
+ if (hourValues) {
185
+ processedHours = processedHours.filter((hour) => hourValues.includes(hour));
186
+ }
187
+ if (minuteValues) {
188
+ processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
189
+ }
190
+ if (minParts) {
191
+ /**
192
+ * If ref day is the same as the
193
+ * minimum allowed day, filter hour/minute
194
+ * values according to min hour and minute.
195
+ */
196
+ if (format.isSameDay(refParts, minParts)) {
197
+ /**
198
+ * Users may not always set the hour/minute for
199
+ * min value (i.e. 2021-06-02) so we should allow
200
+ * all hours/minutes in that case.
201
+ */
202
+ if (minParts.hour !== undefined) {
203
+ processedHours = processedHours.filter((hour) => {
204
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
205
+ return (use24Hour ? hour : convertedHour) >= minParts.hour;
206
+ });
207
+ isAMAllowed = minParts.hour < 13;
208
+ }
209
+ if (minParts.minute !== undefined) {
210
+ /**
211
+ * The minimum minute range should not be enforced when
212
+ * the hour is greater than the min hour.
213
+ *
214
+ * For example with a minimum range of 09:30, users
215
+ * should be able to select 10:00-10:29 and beyond.
216
+ */
217
+ let isPastMinHour = false;
218
+ if (minParts.hour !== undefined && refParts.hour !== undefined) {
219
+ if (refParts.hour > minParts.hour) {
220
+ isPastMinHour = true;
221
+ }
222
+ }
223
+ processedMinutes = processedMinutes.filter((minute) => {
224
+ if (isPastMinHour) {
225
+ return true;
226
+ }
227
+ return minute >= minParts.minute;
228
+ });
229
+ }
230
+ /**
231
+ * If ref day is before minimum
232
+ * day do not render any hours/minute values
233
+ */
234
+ }
235
+ else if (format.isBefore(refParts, minParts)) {
236
+ processedHours = [];
237
+ processedMinutes = [];
238
+ isAMAllowed = isPMAllowed = false;
239
+ }
240
+ }
241
+ if (maxParts) {
242
+ /**
243
+ * If ref day is the same as the
244
+ * maximum allowed day, filter hour/minute
245
+ * values according to max hour and minute.
246
+ */
247
+ if (format.isSameDay(refParts, maxParts)) {
248
+ /**
249
+ * Users may not always set the hour/minute for
250
+ * max value (i.e. 2021-06-02) so we should allow
251
+ * all hours/minutes in that case.
252
+ */
253
+ if (maxParts.hour !== undefined) {
254
+ processedHours = processedHours.filter((hour) => {
255
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
256
+ return (use24Hour ? hour : convertedHour) <= maxParts.hour;
257
+ });
258
+ isPMAllowed = maxParts.hour >= 12;
259
+ }
260
+ if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
261
+ // The available minutes should only be filtered when the hour is the same as the max hour.
262
+ // For example if the max hour is 10:30 and the current hour is 10:00,
263
+ // users should be able to select 00-30 minutes.
264
+ // If the current hour is 09:00, users should be able to select 00-60 minutes.
265
+ processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
266
+ }
267
+ /**
268
+ * If ref day is after minimum
269
+ * day do not render any hours/minute values
270
+ */
271
+ }
272
+ else if (format.isAfter(refParts, maxParts)) {
273
+ processedHours = [];
274
+ processedMinutes = [];
275
+ isAMAllowed = isPMAllowed = false;
276
+ }
277
+ }
278
+ return {
279
+ hours: processedHours,
280
+ minutes: processedMinutes,
281
+ am: isAMAllowed,
282
+ pm: isPMAllowed,
283
+ };
284
+ };
285
+ /**
286
+ * Given DatetimeParts, generate the previous,
287
+ * current, and and next months.
288
+ */
289
+ const generateMonths = (refParts, forcedDate) => {
290
+ const current = { month: refParts.month, year: refParts.year, day: refParts.day };
291
+ /**
292
+ * If we're forcing a month to appear, and it's different from the current month,
293
+ * ensure it appears by replacing the next or previous month as appropriate.
294
+ */
295
+ if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
296
+ const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
297
+ const forcedMonthIsBefore = format.isBefore(forced, current);
298
+ return forcedMonthIsBefore
299
+ ? [forced, current, format.getNextMonth(refParts)]
300
+ : [format.getPreviousMonth(refParts), current, forced];
301
+ }
302
+ return [format.getPreviousMonth(refParts), current, format.getNextMonth(refParts)];
303
+ };
304
+ const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
305
+ month: 'long',
306
+ }) => {
307
+ const { year } = refParts;
308
+ const months = [];
309
+ if (monthValues !== undefined) {
310
+ let processedMonths = monthValues;
311
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
312
+ processedMonths = processedMonths.filter((month) => month <= maxParts.month);
313
+ }
314
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
315
+ processedMonths = processedMonths.filter((month) => month >= minParts.month);
316
+ }
317
+ processedMonths.forEach((processedMonth) => {
318
+ const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
319
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
320
+ months.push({ text: monthString, value: processedMonth });
321
+ });
322
+ }
323
+ else {
324
+ const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
325
+ const minMonth = minParts && minParts.year === year ? minParts.month : 1;
326
+ for (let i = minMonth; i <= maxMonth; i++) {
327
+ /**
328
+ *
329
+ * There is a bug on iOS 14 where
330
+ * Intl.DateTimeFormat takes into account
331
+ * the local timezone offset when formatting dates.
332
+ *
333
+ * Forcing the timezone to 'UTC' fixes the issue. However,
334
+ * we should keep this workaround as it is safer. In the event
335
+ * this breaks in another browser, we will not be impacted
336
+ * because all dates will be interpreted in UTC.
337
+ *
338
+ * Example:
339
+ * new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
340
+ * new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
341
+ *
342
+ * In certain timezones, iOS 14 shows the wrong
343
+ * date for .toUTCString(). To combat this, we
344
+ * force all of the timezones to GMT+0000 (UTC).
345
+ *
346
+ * Example:
347
+ * Time Zone: Central European Standard Time
348
+ * new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
349
+ * new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
350
+ */
351
+ const date = new Date(`${i}/1/${year} GMT+0000`);
352
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
353
+ months.push({ text: monthString, value: i });
354
+ }
355
+ }
356
+ return months;
357
+ };
358
+ /**
359
+ * Returns information regarding
360
+ * selectable dates (i.e 1st, 2nd, 3rd, etc)
361
+ * within a reference month.
362
+ * @param locale The locale to format the date with
363
+ * @param refParts The reference month/year to generate dates for
364
+ * @param minParts The minimum bound on the date that can be returned
365
+ * @param maxParts The maximum bound on the date that can be returned
366
+ * @param dayValues The allowed date values
367
+ * @returns Date data to be used in ion-picker-column
368
+ */
369
+ const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
370
+ day: 'numeric',
371
+ }) => {
372
+ const { month, year } = refParts;
373
+ const days = [];
374
+ /**
375
+ * If we have max/min bounds that in the same
376
+ * month/year as the refParts, we should
377
+ * use the define day as the max/min day.
378
+ * Otherwise, fallback to the max/min days in a month.
379
+ */
380
+ const numDaysInMonth = format.getNumDaysInMonth(month, year);
381
+ const maxDay = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== null && (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== undefined && maxParts.year === year && maxParts.month === month
382
+ ? maxParts.day
383
+ : numDaysInMonth;
384
+ const minDay = (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== null && (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== undefined && minParts.year === year && minParts.month === month
385
+ ? minParts.day
386
+ : 1;
387
+ if (dayValues !== undefined) {
388
+ let processedDays = dayValues;
389
+ processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
390
+ processedDays.forEach((processedDay) => {
391
+ const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
392
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
393
+ days.push({ text: dayString, value: processedDay });
394
+ });
395
+ }
396
+ else {
397
+ for (let i = minDay; i <= maxDay; i++) {
398
+ const date = new Date(`${month}/${i}/${year} GMT+0000`);
399
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
400
+ days.push({ text: dayString, value: i });
401
+ }
402
+ }
403
+ return days;
404
+ };
405
+ const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
406
+ var _a, _b;
407
+ let processedYears = [];
408
+ if (yearValues !== undefined) {
409
+ processedYears = yearValues;
410
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
411
+ processedYears = processedYears.filter((year) => year <= maxParts.year);
412
+ }
413
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
414
+ processedYears = processedYears.filter((year) => year >= minParts.year);
415
+ }
416
+ }
417
+ else {
418
+ const { year } = refParts;
419
+ const maxYear = (_a = maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== null && _a !== void 0 ? _a : year;
420
+ const minYear = (_b = minParts === null || minParts === void 0 ? void 0 : minParts.year) !== null && _b !== void 0 ? _b : year - 100;
421
+ for (let i = minYear; i <= maxYear; i++) {
422
+ processedYears.push(i);
423
+ }
424
+ }
425
+ return processedYears.map((year) => ({
426
+ text: format.getYear(locale, { year, month: refParts.month, day: refParts.day }),
427
+ value: year,
428
+ }));
429
+ };
430
+ /**
431
+ * Given a starting date and an upper bound,
432
+ * this functions returns an array of all
433
+ * month objects in that range.
434
+ */
435
+ const getAllMonthsInRange = (currentParts, maxParts) => {
436
+ if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
437
+ return [currentParts];
438
+ }
439
+ return [currentParts, ...getAllMonthsInRange(format.getNextMonth(currentParts), maxParts)];
440
+ };
441
+ /**
442
+ * Creates and returns picker items
443
+ * that represent the days in a month.
444
+ * Example: "Thu, Jun 2"
445
+ */
446
+ const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
447
+ let items = [];
448
+ let parts = [];
449
+ /**
450
+ * Get all month objects from the min date
451
+ * to the max date. Note: Do not use getMonthColumnData
452
+ * as that function only generates dates within a
453
+ * single year.
454
+ */
455
+ let months = getAllMonthsInRange(minParts, maxParts);
456
+ /**
457
+ * Filter out any disallowed month values.
458
+ */
459
+ if (monthValues) {
460
+ months = months.filter(({ month }) => monthValues.includes(month));
461
+ }
462
+ /**
463
+ * Get all of the days in the month.
464
+ * From there, generate an array where
465
+ * each item has the month, date, and day
466
+ * of work as the text.
467
+ */
468
+ months.forEach((monthObject) => {
469
+ const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
470
+ const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
471
+ month: 'short',
472
+ day: 'numeric',
473
+ weekday: 'short',
474
+ });
475
+ const dateParts = [];
476
+ const dateColumnItems = [];
477
+ monthDays.forEach((dayObject) => {
478
+ const isToday = format.isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
479
+ /**
480
+ * Today's date should read as "Today" (localized)
481
+ * not the actual date string
482
+ */
483
+ dateColumnItems.push({
484
+ text: isToday ? format.getTodayLabel(locale) : dayObject.text,
485
+ value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
486
+ });
487
+ /**
488
+ * When selecting a date in the wheel picker
489
+ * we need access to the raw datetime parts data.
490
+ * The picker column only accepts values of
491
+ * type string or number, so we need to return
492
+ * two sets of data: A data set to be passed
493
+ * to the picker column, and a data set to
494
+ * be used to reference the raw data when
495
+ * updating the picker column value.
496
+ */
497
+ dateParts.push({
498
+ month: referenceMonth.month,
499
+ year: referenceMonth.year,
500
+ day: dayObject.value,
501
+ });
502
+ });
503
+ parts = [...parts, ...dateParts];
504
+ items = [...items, ...dateColumnItems];
505
+ });
506
+ return {
507
+ parts,
508
+ items,
509
+ };
510
+ };
511
+ const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
512
+ const computedHourCycle = format.getHourCycle(locale, hourCycle);
513
+ const use24Hour = format.is24Hour(computedHourCycle);
514
+ const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
515
+ const hoursItems = hours.map((hour) => {
516
+ return {
517
+ text: format.getFormattedHour(hour, computedHourCycle),
518
+ value: format.getInternalHourValue(hour, use24Hour, refParts.ampm),
519
+ };
520
+ });
521
+ const minutesItems = minutes.map((minute) => {
522
+ return {
523
+ text: format.addTimePadding(minute),
524
+ value: minute,
525
+ };
526
+ });
527
+ const dayPeriodItems = [];
528
+ if (am && !use24Hour) {
529
+ dayPeriodItems.push({
530
+ text: format.getLocalizedDayPeriod(locale, 'am'),
531
+ value: 'am',
532
+ });
533
+ }
534
+ if (pm && !use24Hour) {
535
+ dayPeriodItems.push({
536
+ text: format.getLocalizedDayPeriod(locale, 'pm'),
537
+ value: 'pm',
538
+ });
539
+ }
540
+ return {
541
+ minutesData: minutesItems,
542
+ hoursData: hoursItems,
543
+ dayPeriodData: dayPeriodItems,
544
+ };
545
+ };
546
+
24
547
  const isYearDisabled = (refYear, minParts, maxParts) => {
25
548
  if (minParts && minParts.year > refYear) {
26
549
  return true;
@@ -62,7 +585,7 @@ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
62
585
  * current month === min allow month, but the current
63
586
  * day < the min allowed day?
64
587
  */
65
- if (minParts && data.isBefore(refParts, minParts)) {
588
+ if (minParts && format.isBefore(refParts, minParts)) {
66
589
  return true;
67
590
  }
68
591
  /**
@@ -76,7 +599,7 @@ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
76
599
  * current month === max allow month, but the current
77
600
  * day > the max allowed day?
78
601
  */
79
- if (maxParts && data.isAfter(refParts, maxParts)) {
602
+ if (maxParts && format.isAfter(refParts, maxParts)) {
80
603
  return true;
81
604
  }
82
605
  /**
@@ -103,8 +626,8 @@ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts
103
626
  * The day button is active if it is selected, or in other words, if refParts
104
627
  * matches at least one selected date.
105
628
  */
106
- const isActive = activePartsArray.find((parts) => data.isSameDay(refParts, parts)) !== undefined;
107
- const isToday = data.isSameDay(refParts, todayParts);
629
+ const isActive = activePartsArray.find((parts) => format.isSameDay(refParts, parts)) !== undefined;
630
+ const isToday = format.isSameDay(refParts, todayParts);
108
631
  const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
109
632
  /**
110
633
  * Note that we always return one object regardless of whether activeParts
@@ -115,8 +638,8 @@ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts
115
638
  isActive,
116
639
  isToday,
117
640
  ariaSelected: isActive ? 'true' : null,
118
- ariaLabel: data.generateDayAriaLabel(locale, isToday, refParts),
119
- text: refParts.day != null ? data.getDay(locale, refParts) : null,
641
+ ariaLabel: format.generateDayAriaLabel(locale, isToday, refParts),
642
+ text: refParts.day != null ? format.getDay(locale, refParts) : null,
120
643
  };
121
644
  };
122
645
  /**
@@ -130,7 +653,7 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
130
653
  }
131
654
  // If the date value is before the min date, then the month is disabled.
132
655
  // If the date value is after the max date, then the month is disabled.
133
- if ((minParts && data.isBefore(refParts, minParts)) || (maxParts && data.isAfter(refParts, maxParts))) {
656
+ if ((minParts && format.isBefore(refParts, minParts)) || (maxParts && format.isAfter(refParts, maxParts))) {
134
657
  return true;
135
658
  }
136
659
  return false;
@@ -141,7 +664,7 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
141
664
  * previous navigation button is disabled.
142
665
  */
143
666
  const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
144
- const prevMonth = Object.assign(Object.assign({}, data.getPreviousMonth(refParts)), { day: null });
667
+ const prevMonth = Object.assign(Object.assign({}, format.getPreviousMonth(refParts)), { day: null });
145
668
  return isMonthDisabled(prevMonth, {
146
669
  minParts,
147
670
  maxParts,
@@ -152,7 +675,7 @@ const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
152
675
  * determine if the next navigation button is disabled.
153
676
  */
154
677
  const isNextMonthDisabled = (refParts, maxParts) => {
155
- const nextMonth = Object.assign(Object.assign({}, data.getNextMonth(refParts)), { day: null });
678
+ const nextMonth = Object.assign(Object.assign({}, format.getNextMonth(refParts)), { day: null });
156
679
  return isMonthDisabled(nextMonth, {
157
680
  maxParts,
158
681
  });
@@ -445,12 +968,12 @@ const Datetime = class {
445
968
  * Additionally, we need to update the working parts
446
969
  * too in the event that the validated parts are different.
447
970
  */
448
- const validatedParts = data.validateParts(parts, minParts, maxParts);
971
+ const validatedParts = format.validateParts(parts, minParts, maxParts);
449
972
  this.setWorkingParts(validatedParts);
450
973
  if (multiple) {
451
974
  const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
452
975
  if (removeDate) {
453
- this.activeParts = activePartsArray.filter((p) => !data.isSameDay(p, validatedParts));
976
+ this.activeParts = activePartsArray.filter((p) => !format.isSameDay(p, validatedParts));
454
977
  }
455
978
  else {
456
979
  this.activeParts = [...activePartsArray, validatedParts];
@@ -510,40 +1033,40 @@ const Datetime = class {
510
1033
  if (!activeElement || !activeElement.classList.contains('calendar-day')) {
511
1034
  return;
512
1035
  }
513
- const parts = data.getPartsFromCalendarDay(activeElement);
1036
+ const parts = format.getPartsFromCalendarDay(activeElement);
514
1037
  let partsToFocus;
515
1038
  switch (ev.key) {
516
1039
  case 'ArrowDown':
517
1040
  ev.preventDefault();
518
- partsToFocus = data.getNextWeek(parts);
1041
+ partsToFocus = format.getNextWeek(parts);
519
1042
  break;
520
1043
  case 'ArrowUp':
521
1044
  ev.preventDefault();
522
- partsToFocus = data.getPreviousWeek(parts);
1045
+ partsToFocus = format.getPreviousWeek(parts);
523
1046
  break;
524
1047
  case 'ArrowRight':
525
1048
  ev.preventDefault();
526
- partsToFocus = data.getNextDay(parts);
1049
+ partsToFocus = format.getNextDay(parts);
527
1050
  break;
528
1051
  case 'ArrowLeft':
529
1052
  ev.preventDefault();
530
- partsToFocus = data.getPreviousDay(parts);
1053
+ partsToFocus = format.getPreviousDay(parts);
531
1054
  break;
532
1055
  case 'Home':
533
1056
  ev.preventDefault();
534
- partsToFocus = data.getStartOfWeek(parts);
1057
+ partsToFocus = format.getStartOfWeek(parts);
535
1058
  break;
536
1059
  case 'End':
537
1060
  ev.preventDefault();
538
- partsToFocus = data.getEndOfWeek(parts);
1061
+ partsToFocus = format.getEndOfWeek(parts);
539
1062
  break;
540
1063
  case 'PageUp':
541
1064
  ev.preventDefault();
542
- partsToFocus = ev.shiftKey ? data.getPreviousYear(parts) : data.getPreviousMonth(parts);
1065
+ partsToFocus = ev.shiftKey ? format.getPreviousYear(parts) : format.getPreviousMonth(parts);
543
1066
  break;
544
1067
  case 'PageDown':
545
1068
  ev.preventDefault();
546
- partsToFocus = ev.shiftKey ? data.getNextYear(parts) : data.getNextMonth(parts);
1069
+ partsToFocus = ev.shiftKey ? format.getNextYear(parts) : format.getNextMonth(parts);
547
1070
  break;
548
1071
  /**
549
1072
  * Do not preventDefault here
@@ -598,7 +1121,7 @@ const Datetime = class {
598
1121
  this.minParts = undefined;
599
1122
  return;
600
1123
  }
601
- this.minParts = data.parseMinParts(min, defaultParts);
1124
+ this.minParts = format.parseMinParts(min, defaultParts);
602
1125
  };
603
1126
  this.processMaxParts = () => {
604
1127
  const { max, defaultParts } = this;
@@ -606,7 +1129,7 @@ const Datetime = class {
606
1129
  this.maxParts = undefined;
607
1130
  return;
608
1131
  }
609
- this.maxParts = data.parseMaxParts(max, defaultParts);
1132
+ this.maxParts = format.parseMaxParts(max, defaultParts);
610
1133
  };
611
1134
  this.initializeCalendarListener = () => {
612
1135
  const calendarBodyRef = this.calendarBodyRef;
@@ -689,10 +1212,10 @@ const Datetime = class {
689
1212
  * the scroll callback early.
690
1213
  */
691
1214
  if (month === startMonth) {
692
- return data.getPreviousMonth(parts);
1215
+ return format.getPreviousMonth(parts);
693
1216
  }
694
1217
  else if (month === endMonth) {
695
- return data.getNextMonth(parts);
1218
+ return format.getNextMonth(parts);
696
1219
  }
697
1220
  else {
698
1221
  return;
@@ -841,7 +1364,7 @@ const Datetime = class {
841
1364
  };
842
1365
  this.processValue = (value) => {
843
1366
  const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
844
- const valueToProcess = hasValue ? data.parseDate(value) : this.defaultParts;
1367
+ const valueToProcess = hasValue ? format.parseDate(value) : this.defaultParts;
845
1368
  const { minParts, maxParts, workingParts, el } = this;
846
1369
  this.warnIfIncorrectValueUsage();
847
1370
  /**
@@ -860,7 +1383,7 @@ const Datetime = class {
860
1383
  * not true.
861
1384
  */
862
1385
  if (hasValue) {
863
- data.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
1386
+ format.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
864
1387
  }
865
1388
  /**
866
1389
  * If there are multiple values, clamp to the last one.
@@ -868,9 +1391,9 @@ const Datetime = class {
868
1391
  * has most recently interacted with.
869
1392
  */
870
1393
  const singleValue = Array.isArray(valueToProcess) ? valueToProcess[valueToProcess.length - 1] : valueToProcess;
871
- const targetValue = data.clampDate(singleValue, minParts, maxParts);
1394
+ const targetValue = format.clampDate(singleValue, minParts, maxParts);
872
1395
  const { month, day, year, hour, minute } = targetValue;
873
- const ampm = data.parseAmPm(hour);
1396
+ const ampm = format.parseAmPm(hour);
874
1397
  /**
875
1398
  * Since `activeParts` indicates a value that been explicitly selected
876
1399
  * either by the user or the app, only update `activeParts` if the
@@ -946,7 +1469,7 @@ const Datetime = class {
946
1469
  * Animate smoothly to the forced month. This will also update
947
1470
  * workingParts and correct the surrounding months for us.
948
1471
  */
949
- const targetMonthIsBefore = data.isBefore(targetValue, workingParts);
1472
+ const targetMonthIsBefore = format.isBefore(targetValue, workingParts);
950
1473
  targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
951
1474
  await forceDateScrollingPromise;
952
1475
  this.resolveForceDateScrolling = undefined;
@@ -971,10 +1494,11 @@ const Datetime = class {
971
1494
  return;
972
1495
  }
973
1496
  const left = nextMonth.offsetWidth * 2;
1497
+ const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
974
1498
  calendarBodyRef.scrollTo({
975
1499
  top: 0,
976
1500
  left: left * (dir.isRTL(this.el) ? -1 : 1),
977
- behavior: 'smooth',
1501
+ behavior: scrollMode,
978
1502
  });
979
1503
  };
980
1504
  this.prevMonth = () => {
@@ -987,10 +1511,11 @@ const Datetime = class {
987
1511
  return;
988
1512
  }
989
1513
  const left = prevMonth.offsetWidth * 2;
1514
+ const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
990
1515
  calendarBodyRef.scrollTo({
991
1516
  top: 0,
992
1517
  left: left * (dir.isRTL(this.el) ? 1 : -1),
993
- behavior: 'smooth',
1518
+ behavior: scrollMode,
994
1519
  });
995
1520
  };
996
1521
  this.toggleMonthAndYearView = () => {
@@ -1021,19 +1546,19 @@ const Datetime = class {
1021
1546
  return hasDatePresentation && !preferWheel;
1022
1547
  }
1023
1548
  yearValuesChanged() {
1024
- this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues);
1549
+ this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues);
1025
1550
  }
1026
1551
  monthValuesChanged() {
1027
- this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues);
1552
+ this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues);
1028
1553
  }
1029
1554
  dayValuesChanged() {
1030
- this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues);
1555
+ this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues);
1031
1556
  }
1032
1557
  hourValuesChanged() {
1033
- this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues);
1558
+ this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues);
1034
1559
  }
1035
1560
  minuteValuesChanged() {
1036
- this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues);
1561
+ this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues);
1037
1562
  }
1038
1563
  /**
1039
1564
  * Update the datetime value when the value changes
@@ -1067,14 +1592,14 @@ const Datetime = class {
1067
1592
  * active parts are empty, then the user has confirmed the
1068
1593
  * initial value (working parts) presented to them.
1069
1594
  */
1070
- this.setValue(data.convertDataToISO(workingParts));
1595
+ this.setValue(format.convertDataToISO(workingParts));
1071
1596
  }
1072
1597
  else {
1073
1598
  this.setValue(undefined);
1074
1599
  }
1075
1600
  }
1076
1601
  else {
1077
- this.setValue(data.convertDataToISO(activeParts));
1602
+ this.setValue(format.convertDataToISO(activeParts));
1078
1603
  }
1079
1604
  }
1080
1605
  if (closeOverlay) {
@@ -1105,6 +1630,16 @@ const Datetime = class {
1105
1630
  this.closeParentOverlay(CANCEL_ROLE);
1106
1631
  }
1107
1632
  }
1633
+ /**
1634
+ * Returns the default parts the datetime falls back to when no value is set:
1635
+ * today's date and time snapped to the closest value allowed by the
1636
+ * component's constraints (`min`, `max`, and the `*Values` props).
1637
+ *
1638
+ * @internal
1639
+ */
1640
+ async getDefaultPart() {
1641
+ return this.defaultParts;
1642
+ }
1108
1643
  get isCalendarPicker() {
1109
1644
  const { presentation } = this;
1110
1645
  return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
@@ -1292,15 +1827,15 @@ const Datetime = class {
1292
1827
  checkForPresentationFormatMismatch(el, presentation, formatOptions);
1293
1828
  warnIfTimeZoneProvided(el, formatOptions);
1294
1829
  }
1295
- const hourValues = (this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues));
1296
- const minuteValues = (this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues));
1297
- const monthValues = (this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues));
1298
- const yearValues = (this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues));
1299
- const dayValues = (this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues));
1300
- const todayParts = (this.todayParts = data.parseDate(data.getToday()));
1830
+ const hourValues = (this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues));
1831
+ const minuteValues = (this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues));
1832
+ const monthValues = (this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues));
1833
+ const yearValues = (this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues));
1834
+ const dayValues = (this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues));
1835
+ const todayParts = (this.todayParts = format.parseDate(getToday()));
1301
1836
  this.processMinParts();
1302
1837
  this.processMaxParts();
1303
- this.defaultParts = data.getClosestValidDate({
1838
+ this.defaultParts = format.getClosestValidDate({
1304
1839
  refParts: todayParts,
1305
1840
  monthValues,
1306
1841
  dayValues,
@@ -1383,13 +1918,13 @@ const Datetime = class {
1383
1918
  * By default, generate a range of 3 months:
1384
1919
  * Previous month, current month, and next month
1385
1920
  */
1386
- const monthsToRender = data.generateMonths(workingParts);
1921
+ const monthsToRender = generateMonths(workingParts);
1387
1922
  const lastMonth = monthsToRender[monthsToRender.length - 1];
1388
1923
  /**
1389
1924
  * Ensure that users can select the entire window of dates.
1390
1925
  */
1391
1926
  monthsToRender[0].day = 1;
1392
- lastMonth.day = data.getNumDaysInMonth(lastMonth.month, lastMonth.year);
1927
+ lastMonth.day = format.getNumDaysInMonth(lastMonth.month, lastMonth.year);
1393
1928
  /**
1394
1929
  * Narrow the dates rendered based on min/max dates (if any).
1395
1930
  * The `min` date is used if the min is after the generated min month.
@@ -1398,9 +1933,9 @@ const Datetime = class {
1398
1933
  * but still allows future dates to be lazily rendered based on any min/max
1399
1934
  * constraints.
1400
1935
  */
1401
- const min = minParts !== undefined && data.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1402
- const max = maxParts !== undefined && data.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1403
- const result = data.getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1936
+ const min = minParts !== undefined && format.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1937
+ const max = maxParts !== undefined && format.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1938
+ const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1404
1939
  let items = result.items;
1405
1940
  const parts = result.parts;
1406
1941
  if (isDateEnabled) {
@@ -1413,7 +1948,7 @@ const Datetime = class {
1413
1948
  * to prevent exceptions in the user's function from
1414
1949
  * interrupting the calendar rendering.
1415
1950
  */
1416
- disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
1951
+ disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
1417
1952
  }
1418
1953
  catch (e) {
1419
1954
  index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
@@ -1440,11 +1975,11 @@ const Datetime = class {
1440
1975
  const { workingParts, isDateEnabled } = this;
1441
1976
  const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1442
1977
  const months = shouldRenderMonths
1443
- ? data.getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1978
+ ? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1444
1979
  : [];
1445
1980
  const shouldRenderDays = forcePresentation === 'date';
1446
1981
  let days = shouldRenderDays
1447
- ? data.getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1982
+ ? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1448
1983
  : [];
1449
1984
  if (isDateEnabled) {
1450
1985
  days = days.map((dayObject) => {
@@ -1462,7 +1997,7 @@ const Datetime = class {
1462
1997
  * to prevent exceptions in the user's function from
1463
1998
  * interrupting the calendar rendering.
1464
1999
  */
1465
- disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
2000
+ disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
1466
2001
  }
1467
2002
  catch (e) {
1468
2003
  index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
@@ -1472,12 +2007,12 @@ const Datetime = class {
1472
2007
  }
1473
2008
  const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
1474
2009
  const years = shouldRenderYears
1475
- ? data.getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
2010
+ ? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
1476
2011
  : [];
1477
2012
  /**
1478
2013
  * Certain locales show the day before the month.
1479
2014
  */
1480
- const showMonthFirst = data.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
2015
+ const showMonthFirst = format.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
1481
2016
  let renderArray = [];
1482
2017
  if (showMonthFirst) {
1483
2018
  renderArray = [
@@ -1517,7 +2052,10 @@ const Datetime = class {
1517
2052
  const activePart = this.getActivePartsWithFallback();
1518
2053
  return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
1519
2054
  this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
1520
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
2055
+ // Month wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2056
+ if (!this.multiple) {
2057
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
2058
+ }
1521
2059
  ev.stopPropagation();
1522
2060
  } }, months.map((month) => (index.h("ion-picker-column-option", { part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
1523
2061
  }
@@ -1529,7 +2067,10 @@ const Datetime = class {
1529
2067
  const activePart = this.getActivePartsWithFallback();
1530
2068
  return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
1531
2069
  this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
1532
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
2070
+ // Year wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2071
+ if (!this.multiple) {
2072
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
2073
+ }
1533
2074
  ev.stopPropagation();
1534
2075
  } }, years.map((year) => (index.h("ion-picker-column-option", { part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
1535
2076
  }
@@ -1548,7 +2089,7 @@ const Datetime = class {
1548
2089
  */
1549
2090
  const activePart = this.getActivePart();
1550
2091
  const userHasSelectedDate = activePart !== undefined;
1551
- const { hoursData, minutesData, dayPeriodData } = data.getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
2092
+ const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
1552
2093
  return [
1553
2094
  this.renderHourPickerColumn(hoursData),
1554
2095
  this.renderMinutePickerColumn(minutesData),
@@ -1583,9 +2124,9 @@ const Datetime = class {
1583
2124
  return [];
1584
2125
  }
1585
2126
  const activePart = this.getActivePartsWithFallback();
1586
- const isDayPeriodRTL = data.isLocaleDayPeriodRTL(this.locale);
2127
+ const isDayPeriodRTL = format.isLocaleDayPeriodRTL(this.locale);
1587
2128
  return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
1588
- const hour = data.calculateHourFromAMPM(workingParts, ev.detail.value);
2129
+ const hour = format.calculateHourFromAMPM(workingParts, ev.detail.value);
1589
2130
  this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
1590
2131
  this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
1591
2132
  ev.stopPropagation();
@@ -1593,7 +2134,7 @@ const Datetime = class {
1593
2134
  }
1594
2135
  renderWheelView(forcePresentation) {
1595
2136
  const { locale } = this;
1596
- const showMonthFirst = data.isMonthFirstLocale(locale);
2137
+ const showMonthFirst = format.isMonthFirstLocale(locale);
1597
2138
  const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
1598
2139
  return (index.h("div", { class: {
1599
2140
  [`wheel-order-${columnOrder}`]: true,
@@ -1614,7 +2155,7 @@ const Datetime = class {
1614
2155
  'calendar-month-year-toggle': true,
1615
2156
  'ion-activatable': true,
1616
2157
  'ion-focusable': true,
1617
- }, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, index.h("span", { id: "toggle-wrapper" }, data.getMonthAndYear(this.locale, this.workingParts), index.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && index.h("ion-ripple-effect", null))), index.h("div", { class: "calendar-next-prev" }, index.h("ion-buttons", null, index.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth(), part: "navigation-button previous-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronBack, lazy: false, flipRtl: true })), index.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth(), part: "navigation-button next-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronForward, lazy: false, flipRtl: true }))))), index.h("div", { class: "calendar-days-of-week", "aria-hidden": "true", part: "calendar-days-of-week" }, data.getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
2158
+ }, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, index.h("span", { id: "toggle-wrapper" }, format.getMonthAndYear(this.locale, this.workingParts), index.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && index.h("ion-ripple-effect", null))), index.h("div", { class: "calendar-next-prev" }, index.h("ion-buttons", null, index.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth(), part: "navigation-button previous-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronBack, lazy: false, flipRtl: true })), index.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth(), part: "navigation-button next-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronForward, lazy: false, flipRtl: true }))))), index.h("div", { class: "calendar-days-of-week", "aria-hidden": "true", part: "calendar-days-of-week" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
1618
2159
  return index.h("div", { class: "day-of-week" }, d);
1619
2160
  }))));
1620
2161
  }
@@ -1645,7 +2186,7 @@ const Datetime = class {
1645
2186
  'calendar-month': true,
1646
2187
  // Prevents scroll snap swipe gestures for months outside of the min/max bounds
1647
2188
  'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
1648
- } }, index.h("div", { class: "calendar-month-grid" }, data.getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index$1) => {
2189
+ } }, index.h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index$1) => {
1649
2190
  const { day, dayOfWeek, isAdjacentDay } = dateObject;
1650
2191
  const { el, highlightedDates, isDateEnabled, multiple, showAdjacentDays } = this;
1651
2192
  let _month = month;
@@ -1677,7 +2218,7 @@ const Datetime = class {
1677
2218
  const referenceParts = { month: _month, day, year: _year, isAdjacentDay };
1678
2219
  const isCalendarPadding = day === null;
1679
2220
  const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
1680
- const dateIsoString = data.convertDataToISO(referenceParts);
2221
+ const dateIsoString = format.convertDataToISO(referenceParts);
1681
2222
  let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
1682
2223
  if (!isCalDayDisabled && isDateEnabled !== undefined) {
1683
2224
  try {
@@ -1762,7 +2303,7 @@ const Datetime = class {
1762
2303
  }))));
1763
2304
  }
1764
2305
  renderCalendarBody() {
1765
- return (index.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, data.generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
2306
+ return (index.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
1766
2307
  return this.renderMonth(month, year);
1767
2308
  })));
1768
2309
  }
@@ -1778,7 +2319,7 @@ const Datetime = class {
1778
2319
  }
1779
2320
  renderTimeOverlay() {
1780
2321
  const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
1781
- const computedHourCycle = data.getHourCycle(locale, hourCycle);
2322
+ const computedHourCycle = format.getHourCycle(locale, hourCycle);
1782
2323
  const activePart = this.getActivePartsWithFallback();
1783
2324
  return [
1784
2325
  index.h("div", { class: "time-header" }, this.renderTimeLabel()),
@@ -1797,7 +2338,7 @@ const Datetime = class {
1797
2338
  await popoverRef.onWillDismiss();
1798
2339
  this.isTimePopoverOpen = false;
1799
2340
  }
1800
- } }, data.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
2341
+ } }, format.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
1801
2342
  index.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1802
2343
  /**
1803
2344
  * Intersection Observers do not consistently fire between Blink and Webkit
@@ -1828,7 +2369,7 @@ const Datetime = class {
1828
2369
  headerText = `${activeParts.length} days`; // default/fallback for multiple selection
1829
2370
  if (titleSelectedDatesFormatter !== undefined) {
1830
2371
  try {
1831
- headerText = titleSelectedDatesFormatter(data.convertDataToISO(activeParts));
2372
+ headerText = titleSelectedDatesFormatter(format.convertDataToISO(activeParts));
1832
2373
  }
1833
2374
  catch (e) {
1834
2375
  index.printIonError('[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:', e);
@@ -1837,7 +2378,7 @@ const Datetime = class {
1837
2378
  }
1838
2379
  else {
1839
2380
  // for exactly 1 day selected (multiple set or not), show a formatted version of that
1840
- headerText = data.getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
2381
+ headerText = format.getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
1841
2382
  }
1842
2383
  return headerText;
1843
2384
  }
@@ -1925,8 +2466,8 @@ const Datetime = class {
1925
2466
  const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
1926
2467
  const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1927
2468
  const hasWheelVariant = hasDatePresentation && preferWheel;
1928
- helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
1929
- return (index.h(index.Host, { key: '323c8c2327088f00934b8c93c3306538cb9b5677', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
2469
+ helpers.renderHiddenInput(true, el, name, format.formatValue(value), disabled);
2470
+ return (index.h(index.Host, { key: '5e0b83cb88a87945eaae2f9402751819b75452ee', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
1930
2471
  [mode]: true,
1931
2472
  ['datetime-readonly']: readonly,
1932
2473
  ['datetime-disabled']: disabled,
@@ -1936,7 +2477,7 @@ const Datetime = class {
1936
2477
  [`datetime-size-${size}`]: true,
1937
2478
  [`datetime-prefer-wheel`]: hasWheelVariant,
1938
2479
  [`datetime-grid`]: isGridStyle,
1939
- })) }, index.h("div", { key: '1e0855c8909bc3f1e48a21ad68159fa782060691', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
2480
+ })) }, index.h("div", { key: '9f9ba72e9879525961b00abe342a7891492ca0ff', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
1940
2481
  }
1941
2482
  get el() { return index.getElement(this); }
1942
2483
  static get watchers() { return {