@ionic/core 8.8.6-dev.11777572994.1147595d → 8.8.6-nightly.20260501

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 (280) hide show
  1. package/components/index.js +1 -1
  2. package/components/ion-action-sheet.js +1 -1
  3. package/components/ion-alert.js +1 -1
  4. package/components/ion-back-button.js +1 -1
  5. package/components/ion-button.js +1 -1
  6. package/components/ion-card.js +1 -1
  7. package/components/ion-chip.js +1 -1
  8. package/components/ion-datetime-button.js +1 -1
  9. package/components/ion-datetime.js +1 -1
  10. package/components/ion-fab-button.js +1 -1
  11. package/components/ion-infinite-scroll-content.js +1 -1
  12. package/components/ion-input-password-toggle.js +1 -1
  13. package/components/ion-item-option.js +1 -1
  14. package/components/ion-item.js +1 -1
  15. package/components/ion-loading.js +1 -1
  16. package/components/ion-menu-button.js +1 -1
  17. package/components/ion-menu.js +1 -1
  18. package/components/ion-modal.js +1 -1
  19. package/components/ion-picker-legacy-column.d.ts +11 -0
  20. package/components/ion-picker-legacy-column.js +4 -0
  21. package/components/ion-picker-legacy.d.ts +11 -0
  22. package/components/ion-picker-legacy.js +4 -0
  23. package/components/ion-popover.js +1 -1
  24. package/components/ion-progress-bar.js +1 -1
  25. package/components/ion-radio.js +1 -1
  26. package/components/ion-range.js +1 -1
  27. package/components/ion-refresher-content.js +1 -1
  28. package/components/ion-refresher.js +1 -1
  29. package/components/ion-reorder-group.js +1 -1
  30. package/components/ion-reorder.js +1 -1
  31. package/components/ion-ripple-effect.js +1 -1
  32. package/components/ion-router-link.js +1 -1
  33. package/components/ion-router-outlet.js +1 -1
  34. package/components/ion-row.js +1 -1
  35. package/components/ion-searchbar.js +1 -1
  36. package/components/ion-segment-button.js +1 -1
  37. package/components/ion-segment-content.js +1 -1
  38. package/components/ion-segment-view.js +1 -1
  39. package/components/ion-segment.js +1 -1
  40. package/components/ion-select-modal.js +1 -1
  41. package/components/ion-select-option.js +1 -1
  42. package/components/ion-select-popover.js +1 -1
  43. package/components/ion-select.js +1 -1
  44. package/components/ion-skeleton-text.js +1 -1
  45. package/components/ion-spinner.js +1 -1
  46. package/components/ion-split-pane.js +1 -1
  47. package/components/ion-tab-bar.js +1 -1
  48. package/components/ion-tab-button.js +1 -1
  49. package/components/ion-tab.js +1 -1
  50. package/components/ion-tabs.js +1 -1
  51. package/components/ion-text.js +1 -1
  52. package/components/ion-textarea.js +1 -1
  53. package/components/ion-thumbnail.js +1 -1
  54. package/components/ion-title.js +1 -1
  55. package/components/ion-toast.js +1 -1
  56. package/components/ion-toggle.js +1 -1
  57. package/components/ion-toolbar.js +1 -1
  58. package/components/p-1KVKSLu5.js +4 -0
  59. package/components/{p-DbISMmiI.js → p-BSB38Tek.js} +1 -1
  60. package/components/{p-CDXBV7oG.js → p-BTeL5HCK.js} +1 -1
  61. package/components/p-BegtE7nr.js +4 -0
  62. package/components/{p-Ct3FLpwo.js → p-BlNv564p.js} +1 -1
  63. package/components/p-CH0NYjKq.js +4 -0
  64. package/components/{p-DL2W2mt3.js → p-CgfaEEem.js} +1 -1
  65. package/components/p-Cq8cQ0NL.js +4 -0
  66. package/components/{p-nPoOPlPt.js → p-Cyxa_4PV.js} +1 -1
  67. package/components/{p-OOMJP0jy.js → p-D-cP12ZN.js} +1 -1
  68. package/components/p-DHsZWn1l.js +4 -0
  69. package/components/{p-BeL7B3Bb.js → p-DJMZehmW.js} +1 -1
  70. package/components/p-DUqnmRFi.js +4 -0
  71. package/components/{p-DrIm1s9R.js → p-fpbh6w3f.js} +1 -1
  72. package/components/{p-DxXmSp9Y.js → p-kvaDs24J.js} +1 -1
  73. package/dist/cjs/index.cjs.js +2 -1
  74. package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -8
  75. package/dist/cjs/ion-alert.cjs.entry.js +3 -7
  76. package/dist/cjs/ion-app_8.cjs.entry.js +9 -23
  77. package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
  78. package/dist/cjs/ion-col_3.cjs.entry.js +1 -1
  79. package/dist/cjs/{ion-datetime.cjs.entry.js → ion-datetime_3.cjs.entry.js} +639 -1
  80. package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
  81. package/dist/cjs/ion-loading.cjs.entry.js +3 -7
  82. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  83. package/dist/cjs/ion-modal.cjs.entry.js +5 -9
  84. package/dist/cjs/ion-popover.cjs.entry.js +3 -7
  85. package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
  86. package/dist/cjs/ion-radio_2.cjs.entry.js +3 -3
  87. package/dist/cjs/ion-range.cjs.entry.js +3 -3
  88. package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
  89. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
  90. package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
  91. package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
  92. package/dist/cjs/ion-searchbar.cjs.entry.js +4 -4
  93. package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
  94. package/dist/cjs/ion-segment-view.cjs.entry.js +2 -2
  95. package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
  96. package/dist/cjs/ion-select-modal.cjs.entry.js +2 -2
  97. package/dist/cjs/ion-select_3.cjs.entry.js +5 -5
  98. package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
  99. package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
  100. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
  101. package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
  102. package/dist/cjs/ion-text.cjs.entry.js +2 -2
  103. package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
  104. package/dist/cjs/ion-toast.cjs.entry.js +3 -3
  105. package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
  106. package/dist/cjs/ionic.cjs.js +1 -1
  107. package/dist/cjs/loader.cjs.js +1 -1
  108. package/dist/cjs/{overlays-DIfHxkst.js → overlays-C2jiBSNQ.js} +7 -26
  109. package/dist/collection/collection-manifest.json +9 -5
  110. package/dist/collection/components/action-sheet/action-sheet.js +4 -8
  111. package/dist/collection/components/alert/alert.js +3 -7
  112. package/dist/collection/components/loading/loading.js +3 -7
  113. package/dist/collection/components/modal/modal.js +5 -9
  114. package/dist/collection/components/picker-legacy/animations/ios.enter.js +27 -0
  115. package/dist/collection/components/picker-legacy/animations/ios.leave.js +23 -0
  116. package/dist/collection/components/picker-legacy/picker-interface.js +1 -0
  117. package/dist/collection/components/picker-legacy/picker.ios.css +300 -0
  118. package/dist/collection/components/picker-legacy/picker.js +890 -0
  119. package/dist/collection/components/picker-legacy/picker.md.css +287 -0
  120. package/dist/collection/components/picker-legacy-column/picker-column.ios.css +231 -0
  121. package/dist/collection/components/picker-legacy-column/picker-column.js +422 -0
  122. package/dist/collection/components/picker-legacy-column/picker-column.md.css +222 -0
  123. package/dist/collection/components/picker-legacy-column/test/test.utils.js +43 -0
  124. package/dist/collection/components/popover/popover.js +3 -7
  125. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  126. package/dist/collection/components/radio/radio.js +4 -4
  127. package/dist/collection/components/range/range.js +3 -3
  128. package/dist/collection/components/refresher/refresher.js +1 -1
  129. package/dist/collection/components/refresher-content/refresher-content.js +1 -1
  130. package/dist/collection/components/reorder/reorder.js +1 -1
  131. package/dist/collection/components/reorder-group/reorder-group.js +1 -1
  132. package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
  133. package/dist/collection/components/router-link/router-link.js +2 -2
  134. package/dist/collection/components/router-outlet/router-outlet.js +5 -38
  135. package/dist/collection/components/row/row.js +1 -1
  136. package/dist/collection/components/searchbar/searchbar.js +4 -4
  137. package/dist/collection/components/segment/segment.js +2 -2
  138. package/dist/collection/components/segment-button/segment-button.js +2 -2
  139. package/dist/collection/components/segment-content/segment-content.js +1 -1
  140. package/dist/collection/components/segment-view/segment-view.js +2 -2
  141. package/dist/collection/components/select/select.js +2 -2
  142. package/dist/collection/components/select-modal/select-modal.js +1 -1
  143. package/dist/collection/components/select-option/select-option.js +1 -1
  144. package/dist/collection/components/select-popover/select-popover.js +1 -1
  145. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
  146. package/dist/collection/components/spinner/spinner.js +1 -1
  147. package/dist/collection/components/split-pane/split-pane.js +2 -2
  148. package/dist/collection/components/tab/tab.js +2 -2
  149. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  150. package/dist/collection/components/tab-button/tab-button.js +2 -2
  151. package/dist/collection/components/tabs/tabs.js +1 -1
  152. package/dist/collection/components/text/text.js +2 -2
  153. package/dist/collection/components/textarea/textarea.js +2 -2
  154. package/dist/collection/components/thumbnail/thumbnail.js +1 -1
  155. package/dist/collection/components/title/title.js +2 -2
  156. package/dist/collection/components/toast/toast.js +2 -2
  157. package/dist/collection/components/toggle/toggle.js +3 -3
  158. package/dist/collection/components/toolbar/toolbar.js +2 -2
  159. package/dist/collection/index.js +1 -1
  160. package/dist/collection/utils/overlays.js +6 -25
  161. package/dist/docs.json +941 -28
  162. package/dist/esm/{index-AlrZKoWR.js → index-DV3sJJW8.js} +1 -1
  163. package/dist/esm/index.js +1 -1
  164. package/dist/esm/ion-accordion_2.entry.js +1 -1
  165. package/dist/esm/ion-action-sheet.entry.js +4 -8
  166. package/dist/esm/ion-alert.entry.js +3 -7
  167. package/dist/esm/ion-app_8.entry.js +9 -23
  168. package/dist/esm/ion-avatar_3.entry.js +1 -1
  169. package/dist/esm/ion-back-button.entry.js +1 -1
  170. package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
  171. package/dist/esm/ion-col_3.entry.js +1 -1
  172. package/dist/esm/{ion-datetime.entry.js → ion-datetime_3.entry.js} +641 -5
  173. package/dist/esm/ion-fab_3.entry.js +1 -1
  174. package/dist/esm/ion-input-password-toggle.entry.js +1 -1
  175. package/dist/esm/ion-input.entry.js +1 -1
  176. package/dist/esm/ion-item_8.entry.js +3 -3
  177. package/dist/esm/ion-loading.entry.js +3 -7
  178. package/dist/esm/ion-menu_3.entry.js +2 -2
  179. package/dist/esm/ion-modal.entry.js +5 -9
  180. package/dist/esm/ion-popover.entry.js +3 -7
  181. package/dist/esm/ion-progress-bar.entry.js +1 -1
  182. package/dist/esm/ion-radio_2.entry.js +3 -3
  183. package/dist/esm/ion-range.entry.js +3 -3
  184. package/dist/esm/ion-refresher_2.entry.js +3 -3
  185. package/dist/esm/ion-reorder_2.entry.js +3 -3
  186. package/dist/esm/ion-ripple-effect.entry.js +1 -1
  187. package/dist/esm/ion-route_4.entry.js +2 -2
  188. package/dist/esm/ion-searchbar.entry.js +5 -5
  189. package/dist/esm/ion-segment-content.entry.js +1 -1
  190. package/dist/esm/ion-segment-view.entry.js +2 -2
  191. package/dist/esm/ion-segment_2.entry.js +4 -4
  192. package/dist/esm/ion-select-modal.entry.js +2 -2
  193. package/dist/esm/ion-select_3.entry.js +6 -6
  194. package/dist/esm/ion-spinner.entry.js +1 -1
  195. package/dist/esm/ion-split-pane.entry.js +2 -2
  196. package/dist/esm/ion-tab-bar_2.entry.js +4 -4
  197. package/dist/esm/ion-tab_2.entry.js +3 -3
  198. package/dist/esm/ion-text.entry.js +2 -2
  199. package/dist/esm/ion-textarea.entry.js +2 -2
  200. package/dist/esm/ion-toast.entry.js +3 -3
  201. package/dist/esm/ion-toggle.entry.js +4 -4
  202. package/dist/esm/ionic.js +1 -1
  203. package/dist/esm/loader.js +1 -1
  204. package/dist/esm/{overlays-BDGzTP3L.js → overlays-F8GHPo-e.js} +7 -26
  205. package/dist/html.html-data.json +59 -4
  206. package/dist/ionic/index.esm.js +1 -1
  207. package/dist/ionic/ionic.esm.js +1 -1
  208. package/dist/ionic/{p-f17d05e3.entry.js → p-031b76f7.entry.js} +1 -1
  209. package/dist/ionic/{p-ede28b71.entry.js → p-07506134.entry.js} +1 -1
  210. package/dist/ionic/{p-e9dd191b.entry.js → p-084c25b2.entry.js} +1 -1
  211. package/dist/ionic/{p-fed27c64.entry.js → p-0d8b5c38.entry.js} +1 -1
  212. package/dist/ionic/p-16813ce7.entry.js +4 -0
  213. package/dist/ionic/p-1b02923f.entry.js +4 -0
  214. package/dist/ionic/{p-898f9d11.entry.js → p-1b169fb6.entry.js} +1 -1
  215. package/dist/ionic/p-23fac490.entry.js +4 -0
  216. package/dist/ionic/{p-7fe42b71.entry.js → p-28a9e720.entry.js} +1 -1
  217. package/dist/ionic/{p-3b58996c.entry.js → p-294f4bb5.entry.js} +1 -1
  218. package/dist/ionic/{p-f7762013.entry.js → p-2a68388b.entry.js} +1 -1
  219. package/dist/ionic/p-2f5a8140.entry.js +4 -0
  220. package/dist/ionic/{p-34b3a309.entry.js → p-2fd110aa.entry.js} +1 -1
  221. package/dist/ionic/{p-4ed63122.entry.js → p-301c43f8.entry.js} +1 -1
  222. package/dist/ionic/p-4c67ce4c.entry.js +4 -0
  223. package/dist/ionic/p-51c11c47.entry.js +4 -0
  224. package/dist/ionic/p-53f750a5.entry.js +4 -0
  225. package/dist/ionic/p-6b701daa.entry.js +4 -0
  226. package/dist/ionic/{p-19adf785.entry.js → p-7620be24.entry.js} +1 -1
  227. package/dist/ionic/{p-18b5d5ff.entry.js → p-771b27a5.entry.js} +1 -1
  228. package/dist/ionic/p-7ca71c83.entry.js +4 -0
  229. package/dist/ionic/{p-66494f9b.entry.js → p-80cac7a2.entry.js} +1 -1
  230. package/dist/ionic/{p-506038d3.entry.js → p-8fda6a62.entry.js} +1 -1
  231. package/dist/ionic/{p-7f269aff.entry.js → p-9cbc6f1f.entry.js} +1 -1
  232. package/dist/ionic/{p-b6f16f18.entry.js → p-9cdbabbb.entry.js} +1 -1
  233. package/dist/ionic/p-DTPR1Wpn.js +4 -0
  234. package/dist/ionic/{p-AlrZKoWR.js → p-DV3sJJW8.js} +1 -1
  235. package/dist/ionic/{p-dc198c3a.entry.js → p-a84f2d21.entry.js} +1 -1
  236. package/dist/ionic/{p-b8f4a31c.entry.js → p-aa812c4b.entry.js} +1 -1
  237. package/dist/ionic/{p-30f5ad9e.entry.js → p-b325a113.entry.js} +1 -1
  238. package/dist/ionic/p-b5ea8cdd.entry.js +4 -0
  239. package/dist/ionic/{p-1d2163ad.entry.js → p-bcaa827e.entry.js} +1 -1
  240. package/dist/ionic/{p-6e99ae8d.entry.js → p-c3cce9d8.entry.js} +1 -1
  241. package/dist/ionic/{p-b553828c.entry.js → p-d4e8b473.entry.js} +1 -1
  242. package/dist/ionic/p-e0287f41.entry.js +4 -0
  243. package/dist/ionic/{p-6da572e7.entry.js → p-e863ffe8.entry.js} +1 -1
  244. package/dist/ionic/p-f2deaceb.entry.js +4 -0
  245. package/dist/ionic/{p-460fbe5b.entry.js → p-f69a5f71.entry.js} +1 -1
  246. package/dist/ionic/{p-4ea520a4.entry.js → p-f8186550.entry.js} +1 -1
  247. package/dist/ionic/{p-8a3a936b.entry.js → p-fdbc90d4.entry.js} +1 -1
  248. package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +5 -0
  249. package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +5 -0
  250. package/dist/types/components/picker-legacy/picker-interface.d.ts +52 -0
  251. package/dist/types/components/picker-legacy/picker.d.ts +158 -0
  252. package/dist/types/components/picker-legacy-column/picker-column.d.ts +46 -0
  253. package/dist/types/components/picker-legacy-column/test/test.utils.d.ts +9 -0
  254. package/dist/types/components/router-outlet/router-outlet.d.ts +0 -7
  255. package/dist/types/components.d.ts +272 -9
  256. package/dist/types/index.d.ts +1 -1
  257. package/dist/types/interface.d.ts +1 -0
  258. package/dist/types/utils/config.d.ts +8 -0
  259. package/dist/types/utils/overlays.d.ts +9 -11
  260. package/hydrate/index.js +788 -164
  261. package/hydrate/index.mjs +788 -164
  262. package/package.json +3 -3
  263. package/components/p-BHlzkIpO.js +0 -4
  264. package/components/p-Bg7NsGS9.js +0 -4
  265. package/components/p-CWpbvhwY.js +0 -4
  266. package/components/p-DBHdZu4y.js +0 -4
  267. package/components/p-DPdqO7R6.js +0 -4
  268. package/dist/ionic/p-2089f9cb.entry.js +0 -4
  269. package/dist/ionic/p-4c8d8c55.entry.js +0 -4
  270. package/dist/ionic/p-4f3a8ccf.entry.js +0 -4
  271. package/dist/ionic/p-528d4c1d.entry.js +0 -4
  272. package/dist/ionic/p-5430ae94.entry.js +0 -4
  273. package/dist/ionic/p-5c2cc090.entry.js +0 -4
  274. package/dist/ionic/p-6406d5a9.entry.js +0 -4
  275. package/dist/ionic/p-7f9db51b.entry.js +0 -4
  276. package/dist/ionic/p-Csx_Ej2k.js +0 -4
  277. package/dist/ionic/p-a39db980.entry.js +0 -4
  278. package/dist/ionic/p-b5e3e1f7.entry.js +0 -4
  279. package/dist/ionic/p-cce0cd26.entry.js +0 -4
  280. package/dist/ionic/p-d92ba088.entry.js +0 -4
@@ -3,17 +3,21 @@
3
3
  */
4
4
  import { j as printIonError, f as printIonWarning, r as registerInstance, c as createEvent, w as writeTask, h, d as Host, g as getElement } from './index-IGIE5vDm.js';
5
5
  import { startFocusVisible } from './focus-visible-BmVRXR1y.js';
6
- import { r as raf, g as getElementRoot, a as renderHiddenInput } from './helpers-Tl8jw6S2.js';
7
- import { F as FOCUS_TRAP_DISABLE_CLASS } from './overlays-BDGzTP3L.js';
6
+ import { r as raf, g as getElementRoot, a as renderHiddenInput, e as clamp } from './helpers-Tl8jw6S2.js';
7
+ import { F as FOCUS_TRAP_DISABLE_CLASS, d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-F8GHPo-e.js';
8
8
  import { i as isRTL } from './dir-C53feagD.js';
9
- import { c as createColorClasses } from './theme-DiVJyqlX.js';
10
- import { b as chevronDown, d as caretUpSharp, e as chevronForward, f as caretDownSharp, c as chevronBack } from './index-AlrZKoWR.js';
9
+ import { c as createColorClasses, g as getClassMap } from './theme-DiVJyqlX.js';
10
+ import { l as chevronDown, o as caretUpSharp, p as chevronForward, q as caretDownSharp, c as chevronBack } from './index-DV3sJJW8.js';
11
11
  import { b as getIonMode } from './ionic-global-DfbeLwcV.js';
12
12
  import { i as isBefore, a as isAfter, g as getPreviousMonth, b as getNextMonth, c as isSameDay, d as getDay, e as generateDayAriaLabel, v as validateParts, f as getPartsFromCalendarDay, h as getNextYear, j as getPreviousYear, k as getEndOfWeek, l as getStartOfWeek, m as getPreviousDay, n as getNextDay, o as getPreviousWeek, p as getNextWeek, q as parseMinParts, r as parseMaxParts, s as parseDate, w as warnIfValueOutOfBounds, t as parseAmPm, u as clampDate, x as convertToArrayOfNumbers, y as convertDataToISO, z as getToday, A as getClosestValidDate, B as generateMonths, C as getNumDaysInMonth, D as getCombinedDateColumnData, E as getMonthColumnData, F as getDayColumnData, G as getYearColumnData, H as isMonthFirstLocale, I as getTimeColumnsData, J as isLocaleDayPeriodRTL, K as calculateHourFromAMPM, L as getDaysOfWeek, M as getMonthAndYear, N as getDaysOfMonth, O as getHourCycle, P as getLocalizedTime, Q as getLocalizedDateTime, R as formatValue } from './data-B9iGR5YO.js';
13
+ import { c as createLockController } from './lock-controller-B-hirT0v.js';
14
+ import { c as createAnimation } from './animation-CnGMT4ji.js';
15
+ import { a as hapticSelectionChanged, h as hapticSelectionEnd, b as hapticSelectionStart } from './haptic-DzAMWJuk.js';
13
16
  import './index-ZjP4CjeZ.js';
14
17
  import './hardware-back-button-CTe4XmL7.js';
15
18
  import './framework-delegate-CyxE1S_P.js';
16
19
  import './gesture-controller-BTEOs1at.js';
20
+ import './capacitor-CFERIeaU.js';
17
21
 
18
22
  const isYearDisabled = (refYear, minParts, maxParts) => {
19
23
  if (minParts && minParts.year > refYear) {
@@ -1964,4 +1968,636 @@ Datetime.style = {
1964
1968
  md: datetimeMdCss()
1965
1969
  };
1966
1970
 
1967
- export { Datetime as ion_datetime };
1971
+ /**
1972
+ * iOS Picker Enter Animation
1973
+ */
1974
+ const iosEnterAnimation = (baseEl) => {
1975
+ const baseAnimation = createAnimation();
1976
+ const backdropAnimation = createAnimation();
1977
+ const wrapperAnimation = createAnimation();
1978
+ backdropAnimation
1979
+ .addElement(baseEl.querySelector('ion-backdrop'))
1980
+ .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
1981
+ .beforeStyles({
1982
+ 'pointer-events': 'none',
1983
+ })
1984
+ .afterClearStyles(['pointer-events']);
1985
+ wrapperAnimation
1986
+ .addElement(baseEl.querySelector('.picker-wrapper'))
1987
+ .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
1988
+ return baseAnimation
1989
+ .addElement(baseEl)
1990
+ .easing('cubic-bezier(.36,.66,.04,1)')
1991
+ .duration(400)
1992
+ .addAnimation([backdropAnimation, wrapperAnimation]);
1993
+ };
1994
+
1995
+ /**
1996
+ * iOS Picker Leave Animation
1997
+ */
1998
+ const iosLeaveAnimation = (baseEl) => {
1999
+ const baseAnimation = createAnimation();
2000
+ const backdropAnimation = createAnimation();
2001
+ const wrapperAnimation = createAnimation();
2002
+ backdropAnimation
2003
+ .addElement(baseEl.querySelector('ion-backdrop'))
2004
+ .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
2005
+ wrapperAnimation
2006
+ .addElement(baseEl.querySelector('.picker-wrapper'))
2007
+ .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
2008
+ return baseAnimation
2009
+ .addElement(baseEl)
2010
+ .easing('cubic-bezier(.36,.66,.04,1)')
2011
+ .duration(400)
2012
+ .addAnimation([backdropAnimation, wrapperAnimation]);
2013
+ };
2014
+
2015
+ const pickerIosCss = () => `.sc-ion-picker-legacy-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-ios-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-ios-h{display:none}.picker-wrapper.sc-ion-picker-legacy-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-ios:active,.picker-button.sc-ion-picker-legacy-ios:focus{outline:none}.picker-columns.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-ios,.picker-below-highlight.sc-ion-picker-legacy-ios{display:none;pointer-events:none}.sc-ion-picker-legacy-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-legacy-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-legacy-ios:last-child .picker-button.sc-ion-picker-legacy-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-legacy-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-legacy-ios,.picker-button.ion-activated.sc-ion-picker-legacy-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:16px}.picker-columns.sc-ion-picker-legacy-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-legacy-ios{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-ios{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}`;
2016
+
2017
+ const pickerMdCss = () => `.sc-ion-picker-legacy-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-md-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-md-h{display:none}.picker-wrapper.sc-ion-picker-legacy-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-md:active,.picker-button.sc-ion-picker-legacy-md:focus{outline:none}.picker-columns.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-md,.picker-below-highlight.sc-ion-picker-legacy-md{display:none;pointer-events:none}.sc-ion-picker-legacy-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-legacy-md,.picker-button.ion-activated.sc-ion-picker-legacy-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}.picker-columns.sc-ion-picker-legacy-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-legacy-md{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-md{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}`;
2018
+
2019
+ const Picker = class {
2020
+ constructor(hostRef) {
2021
+ registerInstance(this, hostRef);
2022
+ this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
2023
+ this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
2024
+ this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
2025
+ this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
2026
+ this.didPresentShorthand = createEvent(this, "didPresent", 7);
2027
+ this.willPresentShorthand = createEvent(this, "willPresent", 7);
2028
+ this.willDismissShorthand = createEvent(this, "willDismiss", 7);
2029
+ this.didDismissShorthand = createEvent(this, "didDismiss", 7);
2030
+ this.delegateController = createDelegateController(this);
2031
+ this.lockController = createLockController();
2032
+ this.triggerController = createTriggerController();
2033
+ this.presented = false;
2034
+ /** @internal */
2035
+ this.hasController = false;
2036
+ /**
2037
+ * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
2038
+ */
2039
+ this.keyboardClose = true;
2040
+ /**
2041
+ * Array of buttons to be displayed at the top of the picker.
2042
+ */
2043
+ this.buttons = [];
2044
+ /**
2045
+ * Array of columns to be displayed in the picker.
2046
+ */
2047
+ this.columns = [];
2048
+ /**
2049
+ * Number of milliseconds to wait before dismissing the picker.
2050
+ */
2051
+ this.duration = 0;
2052
+ /**
2053
+ * If `true`, a backdrop will be displayed behind the picker.
2054
+ */
2055
+ this.showBackdrop = true;
2056
+ /**
2057
+ * If `true`, the picker will be dismissed when the backdrop is clicked.
2058
+ */
2059
+ this.backdropDismiss = true;
2060
+ /**
2061
+ * If `true`, the picker will animate.
2062
+ */
2063
+ this.animated = true;
2064
+ /**
2065
+ * If `true`, the picker will open. If `false`, the picker will close.
2066
+ * Use this if you need finer grained control over presentation, otherwise
2067
+ * just use the pickerController or the `trigger` property.
2068
+ * Note: `isOpen` will not automatically be set back to `false` when
2069
+ * the picker dismisses. You will need to do that in your code.
2070
+ */
2071
+ this.isOpen = false;
2072
+ this.onBackdropTap = () => {
2073
+ this.dismiss(undefined, BACKDROP);
2074
+ };
2075
+ this.dispatchCancelHandler = (ev) => {
2076
+ const role = ev.detail.role;
2077
+ if (isCancel(role)) {
2078
+ const cancelButton = this.buttons.find((b) => b.role === 'cancel');
2079
+ this.callButtonHandler(cancelButton);
2080
+ }
2081
+ };
2082
+ }
2083
+ onIsOpenChange(newValue, oldValue) {
2084
+ if (newValue === true && oldValue === false) {
2085
+ this.present();
2086
+ }
2087
+ else if (newValue === false && oldValue === true) {
2088
+ this.dismiss();
2089
+ }
2090
+ }
2091
+ triggerChanged() {
2092
+ const { trigger, el, triggerController } = this;
2093
+ if (trigger) {
2094
+ triggerController.addClickListener(el, trigger);
2095
+ }
2096
+ }
2097
+ connectedCallback() {
2098
+ prepareOverlay(this.el);
2099
+ this.triggerChanged();
2100
+ }
2101
+ disconnectedCallback() {
2102
+ this.triggerController.removeClickListener();
2103
+ }
2104
+ componentWillLoad() {
2105
+ var _a;
2106
+ if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
2107
+ setOverlayId(this.el);
2108
+ }
2109
+ }
2110
+ componentDidLoad() {
2111
+ printIonWarning('[ion-picker-legacy] - ion-picker-legacy and ion-picker-legacy-column have been deprecated in favor of new versions of the ion-picker and ion-picker-column components. These new components display inline with your page content allowing for more presentation flexibility than before.', this.el);
2112
+ /**
2113
+ * If picker was rendered with isOpen="true"
2114
+ * then we should open picker immediately.
2115
+ */
2116
+ if (this.isOpen === true) {
2117
+ raf(() => this.present());
2118
+ }
2119
+ /**
2120
+ * When binding values in frameworks such as Angular
2121
+ * it is possible for the value to be set after the Web Component
2122
+ * initializes but before the value watcher is set up in Stencil.
2123
+ * As a result, the watcher callback may not be fired.
2124
+ * We work around this by manually calling the watcher
2125
+ * callback when the component has loaded and the watcher
2126
+ * is configured.
2127
+ */
2128
+ this.triggerChanged();
2129
+ }
2130
+ /**
2131
+ * Present the picker overlay after it has been created.
2132
+ */
2133
+ async present() {
2134
+ const unlock = await this.lockController.lock();
2135
+ await this.delegateController.attachViewToDom();
2136
+ await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
2137
+ if (this.duration > 0) {
2138
+ this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
2139
+ }
2140
+ unlock();
2141
+ }
2142
+ /**
2143
+ * Dismiss the picker overlay after it has been presented.
2144
+ *
2145
+ * @param data Any data to emit in the dismiss events.
2146
+ * @param role The role of the element that is dismissing the picker.
2147
+ * This can be useful in a button handler for determining which button was
2148
+ * clicked to dismiss the picker.
2149
+ * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
2150
+ */
2151
+ async dismiss(data, role) {
2152
+ const unlock = await this.lockController.lock();
2153
+ if (this.durationTimeout) {
2154
+ clearTimeout(this.durationTimeout);
2155
+ }
2156
+ const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
2157
+ if (dismissed) {
2158
+ this.delegateController.removeViewFromDom();
2159
+ }
2160
+ unlock();
2161
+ return dismissed;
2162
+ }
2163
+ /**
2164
+ * Returns a promise that resolves when the picker did dismiss.
2165
+ */
2166
+ onDidDismiss() {
2167
+ return eventMethod(this.el, 'ionPickerDidDismiss');
2168
+ }
2169
+ /**
2170
+ * Returns a promise that resolves when the picker will dismiss.
2171
+ */
2172
+ onWillDismiss() {
2173
+ return eventMethod(this.el, 'ionPickerWillDismiss');
2174
+ }
2175
+ /**
2176
+ * Get the column that matches the specified name.
2177
+ *
2178
+ * @param name The name of the column.
2179
+ */
2180
+ getColumn(name) {
2181
+ return Promise.resolve(this.columns.find((column) => column.name === name));
2182
+ }
2183
+ async buttonClick(button) {
2184
+ const role = button.role;
2185
+ if (isCancel(role)) {
2186
+ return this.dismiss(undefined, role);
2187
+ }
2188
+ const shouldDismiss = await this.callButtonHandler(button);
2189
+ if (shouldDismiss) {
2190
+ return this.dismiss(this.getSelected(), button.role);
2191
+ }
2192
+ return Promise.resolve();
2193
+ }
2194
+ async callButtonHandler(button) {
2195
+ if (button) {
2196
+ // a handler has been provided, execute it
2197
+ // pass the handler the values from the inputs
2198
+ const rtn = await safeCall(button.handler, this.getSelected());
2199
+ if (rtn === false) {
2200
+ // if the return value of the handler is false then do not dismiss
2201
+ return false;
2202
+ }
2203
+ }
2204
+ return true;
2205
+ }
2206
+ getSelected() {
2207
+ const selected = {};
2208
+ this.columns.forEach((col, index) => {
2209
+ const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
2210
+ selected[col.name] = {
2211
+ text: selectedColumn ? selectedColumn.text : undefined,
2212
+ value: selectedColumn ? selectedColumn.value : undefined,
2213
+ columnIndex: index,
2214
+ };
2215
+ });
2216
+ return selected;
2217
+ }
2218
+ render() {
2219
+ const { htmlAttributes } = this;
2220
+ const mode = getIonMode(this);
2221
+ return (h(Host, Object.assign({ key: '80f66d33780d8a1352d24be9cb63a0cc03d01ab5', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
2222
+ zIndex: `${20000 + this.overlayIndex}`,
2223
+ }, class: Object.assign({ [mode]: true,
2224
+ // Used internally for styling
2225
+ [`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: '97fb8e10ba08b197610cb8c0cdea61103883d55f', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: 'b3969cb6fbf7153623d14e3ca1493d3370efb211', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '299268483c3727e698d9135bfdf40349a7050ac1', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: '95394de3ef691899b7dbf416f56fd3e86bbdce3f', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '05f18bb8d00dc0e22f691b7e41f90f729a6c66d7', class: "picker-columns" }, h("div", { key: '4a8fdf224effc0af67fd413e2e6aca8a78d1cf43', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: 'e50a31db45e3f39e9d0fed36a21be9257eec09bf', class: "picker-below-highlight" }))), h("div", { key: '5a78cb2176ac807ea0c195c6b76cd0e8eef9d4c0', tabindex: "0", "aria-hidden": "true" })));
2226
+ }
2227
+ get el() { return getElement(this); }
2228
+ static get watchers() { return {
2229
+ "isOpen": [{
2230
+ "onIsOpenChange": 0
2231
+ }],
2232
+ "trigger": [{
2233
+ "triggerChanged": 0
2234
+ }]
2235
+ }; }
2236
+ };
2237
+ const buttonWrapperClass = (button) => {
2238
+ return {
2239
+ [`picker-toolbar-${button.role}`]: button.role !== undefined,
2240
+ 'picker-toolbar-button': true,
2241
+ };
2242
+ };
2243
+ const buttonClass = (button) => {
2244
+ return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
2245
+ };
2246
+ Picker.style = {
2247
+ ios: pickerIosCss(),
2248
+ md: pickerMdCss()
2249
+ };
2250
+
2251
+ const pickerColumnIosCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}[dir=rtl] .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}}`;
2252
+
2253
+ const pickerColumnMdCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #0054e9)}`;
2254
+
2255
+ const PickerColumnCmp = class {
2256
+ constructor(hostRef) {
2257
+ registerInstance(this, hostRef);
2258
+ this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
2259
+ this.optHeight = 0;
2260
+ this.rotateFactor = 0;
2261
+ this.scaleFactor = 1;
2262
+ this.velocity = 0;
2263
+ this.y = 0;
2264
+ this.noAnimate = true;
2265
+ // `colDidChange` is a flag that gets set when the column is changed
2266
+ // dynamically. When this flag is set, the column will refresh
2267
+ // after the component re-renders to incorporate the new column data.
2268
+ // This is necessary because `this.refresh` queries for the option elements,
2269
+ // so it needs to wait for the latest elements to be available in the DOM.
2270
+ // Ex: column is created with 3 options. User updates the column data
2271
+ // to have 5 options. The column will still think it only has 3 options.
2272
+ this.colDidChange = false;
2273
+ }
2274
+ colChanged() {
2275
+ this.colDidChange = true;
2276
+ }
2277
+ async connectedCallback() {
2278
+ let pickerRotateFactor = 0;
2279
+ let pickerScaleFactor = 0.81;
2280
+ const mode = getIonMode(this);
2281
+ if (mode === 'ios') {
2282
+ pickerRotateFactor = -0.46;
2283
+ pickerScaleFactor = 1;
2284
+ }
2285
+ this.rotateFactor = pickerRotateFactor;
2286
+ this.scaleFactor = pickerScaleFactor;
2287
+ this.gesture = (await import('./index-CfgBF1SE.js')).createGesture({
2288
+ el: this.el,
2289
+ gestureName: 'picker-swipe',
2290
+ gesturePriority: 100,
2291
+ threshold: 0,
2292
+ passive: false,
2293
+ onStart: (ev) => this.onStart(ev),
2294
+ onMove: (ev) => this.onMove(ev),
2295
+ onEnd: (ev) => this.onEnd(ev),
2296
+ });
2297
+ this.gesture.enable();
2298
+ // Options have not been initialized yet
2299
+ // Animation must be disabled through the `noAnimate` flag
2300
+ // Otherwise, the options will render
2301
+ // at the top of the column and transition down
2302
+ this.tmrId = setTimeout(() => {
2303
+ this.noAnimate = false;
2304
+ // After initialization, `refresh()` will be called
2305
+ // At this point, animation will be enabled. The options will
2306
+ // animate as they are being selected.
2307
+ this.refresh(true);
2308
+ }, 250);
2309
+ }
2310
+ componentDidLoad() {
2311
+ this.onDomChange();
2312
+ }
2313
+ componentDidUpdate() {
2314
+ // Options may have changed since last update.
2315
+ if (this.colDidChange) {
2316
+ // Animation must be disabled through the `onDomChange` parameter.
2317
+ // Otherwise, the recently added options will render
2318
+ // at the top of the column and transition down
2319
+ this.onDomChange(true, false);
2320
+ this.colDidChange = false;
2321
+ }
2322
+ }
2323
+ disconnectedCallback() {
2324
+ if (this.rafId !== undefined)
2325
+ cancelAnimationFrame(this.rafId);
2326
+ if (this.tmrId)
2327
+ clearTimeout(this.tmrId);
2328
+ if (this.gesture) {
2329
+ this.gesture.destroy();
2330
+ this.gesture = undefined;
2331
+ }
2332
+ }
2333
+ emitColChange() {
2334
+ this.ionPickerColChange.emit(this.col);
2335
+ }
2336
+ setSelected(selectedIndex, duration) {
2337
+ // if there is a selected index, then figure out it's y position
2338
+ // if there isn't a selected index, then just use the top y position
2339
+ const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
2340
+ this.velocity = 0;
2341
+ // set what y position we're at
2342
+ if (this.rafId !== undefined)
2343
+ cancelAnimationFrame(this.rafId);
2344
+ this.update(y, duration, true);
2345
+ this.emitColChange();
2346
+ }
2347
+ update(y, duration, saveY) {
2348
+ if (!this.optsEl) {
2349
+ return;
2350
+ }
2351
+ // ensure we've got a good round number :)
2352
+ let translateY = 0;
2353
+ let translateZ = 0;
2354
+ const { col, rotateFactor } = this;
2355
+ const prevSelected = col.selectedIndex;
2356
+ const selectedIndex = (col.selectedIndex = this.indexForY(-y));
2357
+ const durationStr = duration === 0 ? '' : duration + 'ms';
2358
+ const scaleStr = `scale(${this.scaleFactor})`;
2359
+ const children = this.optsEl.children;
2360
+ for (let i = 0; i < children.length; i++) {
2361
+ const button = children[i];
2362
+ const opt = col.options[i];
2363
+ const optOffset = i * this.optHeight + y;
2364
+ let transform = '';
2365
+ if (rotateFactor !== 0) {
2366
+ const rotateX = optOffset * rotateFactor;
2367
+ if (Math.abs(rotateX) <= 90) {
2368
+ translateY = 0;
2369
+ translateZ = 90;
2370
+ transform = `rotateX(${rotateX}deg) `;
2371
+ }
2372
+ else {
2373
+ translateY = -9999;
2374
+ }
2375
+ }
2376
+ else {
2377
+ translateZ = 0;
2378
+ translateY = optOffset;
2379
+ }
2380
+ const selected = selectedIndex === i;
2381
+ transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
2382
+ if (this.scaleFactor !== 1 && !selected) {
2383
+ transform += scaleStr;
2384
+ }
2385
+ // Update transition duration
2386
+ if (this.noAnimate) {
2387
+ opt.duration = 0;
2388
+ button.style.transitionDuration = '';
2389
+ }
2390
+ else if (duration !== opt.duration) {
2391
+ opt.duration = duration;
2392
+ button.style.transitionDuration = durationStr;
2393
+ }
2394
+ // Update transform
2395
+ if (transform !== opt.transform) {
2396
+ opt.transform = transform;
2397
+ }
2398
+ button.style.transform = transform;
2399
+ /**
2400
+ * Ensure that the select column
2401
+ * item has the selected class
2402
+ */
2403
+ opt.selected = selected;
2404
+ if (selected) {
2405
+ button.classList.add(PICKER_OPT_SELECTED);
2406
+ }
2407
+ else {
2408
+ button.classList.remove(PICKER_OPT_SELECTED);
2409
+ }
2410
+ }
2411
+ this.col.prevSelected = prevSelected;
2412
+ if (saveY) {
2413
+ this.y = y;
2414
+ }
2415
+ if (this.lastIndex !== selectedIndex) {
2416
+ // have not set a last index yet
2417
+ hapticSelectionChanged();
2418
+ this.lastIndex = selectedIndex;
2419
+ }
2420
+ }
2421
+ decelerate() {
2422
+ if (this.velocity !== 0) {
2423
+ // still decelerating
2424
+ this.velocity *= DECELERATION_FRICTION;
2425
+ // do not let it go slower than a velocity of 1
2426
+ this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
2427
+ let y = this.y + this.velocity;
2428
+ if (y > this.minY) {
2429
+ // whoops, it's trying to scroll up farther than the options we have!
2430
+ y = this.minY;
2431
+ this.velocity = 0;
2432
+ }
2433
+ else if (y < this.maxY) {
2434
+ // gahh, it's trying to scroll down farther than we can!
2435
+ y = this.maxY;
2436
+ this.velocity = 0;
2437
+ }
2438
+ this.update(y, 0, true);
2439
+ const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
2440
+ if (notLockedIn) {
2441
+ // isn't locked in yet, keep decelerating until it is
2442
+ this.rafId = requestAnimationFrame(() => this.decelerate());
2443
+ }
2444
+ else {
2445
+ this.velocity = 0;
2446
+ this.emitColChange();
2447
+ hapticSelectionEnd();
2448
+ }
2449
+ }
2450
+ else if (this.y % this.optHeight !== 0) {
2451
+ // needs to still get locked into a position so options line up
2452
+ const currentPos = Math.abs(this.y % this.optHeight);
2453
+ // create a velocity in the direction it needs to scroll
2454
+ this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
2455
+ this.decelerate();
2456
+ }
2457
+ }
2458
+ indexForY(y) {
2459
+ return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
2460
+ }
2461
+ onStart(detail) {
2462
+ // We have to prevent default in order to block scrolling under the picker
2463
+ // but we DO NOT have to stop propagation, since we still want
2464
+ // some "click" events to capture
2465
+ if (detail.event.cancelable) {
2466
+ detail.event.preventDefault();
2467
+ }
2468
+ detail.event.stopPropagation();
2469
+ hapticSelectionStart();
2470
+ // reset everything
2471
+ if (this.rafId !== undefined)
2472
+ cancelAnimationFrame(this.rafId);
2473
+ const options = this.col.options;
2474
+ let minY = options.length - 1;
2475
+ let maxY = 0;
2476
+ for (let i = 0; i < options.length; i++) {
2477
+ if (!options[i].disabled) {
2478
+ minY = Math.min(minY, i);
2479
+ maxY = Math.max(maxY, i);
2480
+ }
2481
+ }
2482
+ this.minY = -(minY * this.optHeight);
2483
+ this.maxY = -(maxY * this.optHeight);
2484
+ }
2485
+ onMove(detail) {
2486
+ if (detail.event.cancelable) {
2487
+ detail.event.preventDefault();
2488
+ }
2489
+ detail.event.stopPropagation();
2490
+ // update the scroll position relative to pointer start position
2491
+ let y = this.y + detail.deltaY;
2492
+ if (y > this.minY) {
2493
+ // scrolling up higher than scroll area
2494
+ y = Math.pow(y, 0.8);
2495
+ this.bounceFrom = y;
2496
+ }
2497
+ else if (y < this.maxY) {
2498
+ // scrolling down below scroll area
2499
+ y += Math.pow(this.maxY - y, 0.9);
2500
+ this.bounceFrom = y;
2501
+ }
2502
+ else {
2503
+ this.bounceFrom = 0;
2504
+ }
2505
+ this.update(y, 0, false);
2506
+ }
2507
+ onEnd(detail) {
2508
+ if (this.bounceFrom > 0) {
2509
+ // bounce back up
2510
+ this.update(this.minY, 100, true);
2511
+ this.emitColChange();
2512
+ return;
2513
+ }
2514
+ else if (this.bounceFrom < 0) {
2515
+ // bounce back down
2516
+ this.update(this.maxY, 100, true);
2517
+ this.emitColChange();
2518
+ return;
2519
+ }
2520
+ this.velocity = clamp(-90, detail.velocityY * 23, MAX_PICKER_SPEED);
2521
+ if (this.velocity === 0 && detail.deltaY === 0) {
2522
+ const opt = detail.event.target.closest('.picker-opt');
2523
+ if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
2524
+ this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
2525
+ }
2526
+ }
2527
+ else {
2528
+ this.y += detail.deltaY;
2529
+ if (Math.abs(detail.velocityY) < 0.05) {
2530
+ const isScrollingUp = detail.deltaY > 0;
2531
+ const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
2532
+ if (isScrollingUp && optHeightFraction > 0.5) {
2533
+ this.velocity = Math.abs(this.velocity) * -1;
2534
+ }
2535
+ else if (!isScrollingUp && optHeightFraction <= 0.5) {
2536
+ this.velocity = Math.abs(this.velocity);
2537
+ }
2538
+ }
2539
+ this.decelerate();
2540
+ }
2541
+ }
2542
+ refresh(forceRefresh, animated) {
2543
+ var _a;
2544
+ let min = this.col.options.length - 1;
2545
+ let max = 0;
2546
+ const options = this.col.options;
2547
+ for (let i = 0; i < options.length; i++) {
2548
+ if (!options[i].disabled) {
2549
+ min = Math.min(min, i);
2550
+ max = Math.max(max, i);
2551
+ }
2552
+ }
2553
+ /**
2554
+ * Only update selected value if column has a
2555
+ * velocity of 0. If it does not, then the
2556
+ * column is animating might land on
2557
+ * a value different than the value at
2558
+ * selectedIndex
2559
+ */
2560
+ if (this.velocity !== 0) {
2561
+ return;
2562
+ }
2563
+ const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
2564
+ if (this.col.prevSelected !== selectedIndex || forceRefresh) {
2565
+ const y = selectedIndex * this.optHeight * -1;
2566
+ const duration = animated ? TRANSITION_DURATION : 0;
2567
+ this.velocity = 0;
2568
+ this.update(y, duration, true);
2569
+ }
2570
+ }
2571
+ onDomChange(forceRefresh, animated) {
2572
+ const colEl = this.optsEl;
2573
+ if (colEl) {
2574
+ // DOM READ
2575
+ // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
2576
+ this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
2577
+ }
2578
+ this.refresh(forceRefresh, animated);
2579
+ }
2580
+ render() {
2581
+ const col = this.col;
2582
+ const mode = getIonMode(this);
2583
+ return (h(Host, { key: '86125e95f18837dfd021db01777d72a1562d8ee3', class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
2584
+ 'max-width': this.col.columnWidth,
2585
+ } }, col.prefix && (h("div", { key: 'b0f3d39e0bd128781066ffefb7a1e40d12a9e76d', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { key: '0b106ac4d56916eaaa7f09d1b68348b3754b7bba', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { key: '00ff2f9dbb4561787e5a5223327c6a2a33f8362e', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
2586
+ }
2587
+ get el() { return getElement(this); }
2588
+ static get watchers() { return {
2589
+ "col": [{
2590
+ "colChanged": 0
2591
+ }]
2592
+ }; }
2593
+ };
2594
+ const PICKER_OPT_SELECTED = 'picker-opt-selected';
2595
+ const DECELERATION_FRICTION = 0.97;
2596
+ const MAX_PICKER_SPEED = 90;
2597
+ const TRANSITION_DURATION = 150;
2598
+ PickerColumnCmp.style = {
2599
+ ios: pickerColumnIosCss(),
2600
+ md: pickerColumnMdCss()
2601
+ };
2602
+
2603
+ export { Datetime as ion_datetime, Picker as ion_picker_legacy, PickerColumnCmp as ion_picker_legacy_column };