@ionic/core 8.8.10 → 8.8.11-dev.11781186446.19d9a1cc

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 (288) 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-input.js +1 -1
  14. package/components/ion-item-option.js +1 -1
  15. package/components/ion-item.js +1 -1
  16. package/components/ion-loading.js +1 -1
  17. package/components/ion-menu-button.js +1 -1
  18. package/components/ion-menu.js +1 -1
  19. package/components/ion-modal.js +1 -1
  20. package/components/ion-popover.js +1 -1
  21. package/components/ion-progress-bar.js +1 -1
  22. package/components/ion-radio.js +1 -1
  23. package/components/ion-range.js +1 -1
  24. package/components/ion-refresher-content.js +1 -1
  25. package/components/ion-refresher.js +1 -1
  26. package/components/ion-reorder-group.js +1 -1
  27. package/components/ion-reorder.js +1 -1
  28. package/components/ion-ripple-effect.js +1 -1
  29. package/components/ion-router-link.js +1 -1
  30. package/components/ion-router-outlet.js +1 -1
  31. package/components/ion-row.js +1 -1
  32. package/components/ion-searchbar.js +1 -1
  33. package/components/ion-segment-button.js +1 -1
  34. package/components/ion-segment-content.js +1 -1
  35. package/components/ion-segment-view.js +1 -1
  36. package/components/ion-segment.js +1 -1
  37. package/components/ion-select-modal.js +1 -1
  38. package/components/ion-select-option.js +1 -1
  39. package/components/ion-select-popover.js +1 -1
  40. package/components/ion-select.js +1 -1
  41. package/components/ion-skeleton-text.js +1 -1
  42. package/components/ion-spinner.js +1 -1
  43. package/components/ion-split-pane.js +1 -1
  44. package/components/ion-tab-bar.js +1 -1
  45. package/components/ion-tab-button.js +1 -1
  46. package/components/ion-tab.js +1 -1
  47. package/components/ion-tabs.js +1 -1
  48. package/components/ion-text.js +1 -1
  49. package/components/ion-textarea.js +1 -1
  50. package/components/ion-thumbnail.js +1 -1
  51. package/components/ion-title.js +1 -1
  52. package/components/ion-toast.js +1 -1
  53. package/components/ion-toggle.js +1 -1
  54. package/components/ion-toolbar.js +1 -1
  55. package/components/{p-nQi4oKcG.js → p-B8U2xbtx.js} +1 -1
  56. package/components/p-BpCi7xHq.js +4 -0
  57. package/components/p-CHzfYZbv.js +4 -0
  58. package/components/{p-DDWp95gH.js → p-Ck2wcXbv.js} +1 -1
  59. package/components/{p-C2lKgrXx.js → p-DEBD4LvH.js} +1 -1
  60. package/components/p-DH50pr9O.js +4 -0
  61. package/components/{p-BSEgsdFI.js → p-DhkITZ-y.js} +1 -1
  62. package/components/p-DmpBvltk.js +4 -0
  63. package/components/{p-5bE_Wz4Y.js → p-DpV-p5Xs.js} +1 -1
  64. package/components/{p-Cfx4M1Bn.js → p-Dz74mwlk.js} +1 -1
  65. package/components/{p-BLmJ0zRm.js → p-XJWMAP8m.js} +1 -1
  66. package/components/p-djQLE88P.js +4 -0
  67. package/components/{p-B60hm8Qv.js → p-r0aq7dpt.js} +1 -1
  68. package/components/{p-rCa2eL0j.js → p-wk2QqrAo.js} +1 -1
  69. package/dist/cjs/index.cjs.js +1 -2
  70. package/dist/cjs/ion-action-sheet.cjs.entry.js +8 -4
  71. package/dist/cjs/ion-alert.cjs.entry.js +7 -3
  72. package/dist/cjs/ion-app_8.cjs.entry.js +23 -9
  73. package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
  74. package/dist/cjs/ion-col_3.cjs.entry.js +1 -1
  75. package/dist/cjs/{ion-datetime_3.cjs.entry.js → ion-datetime.cjs.entry.js} +1 -639
  76. package/dist/cjs/ion-input.cjs.entry.js +4 -4
  77. package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
  78. package/dist/cjs/ion-loading.cjs.entry.js +7 -3
  79. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  80. package/dist/cjs/ion-modal.cjs.entry.js +9 -5
  81. package/dist/cjs/ion-popover.cjs.entry.js +7 -3
  82. package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
  83. package/dist/cjs/ion-radio_2.cjs.entry.js +3 -3
  84. package/dist/cjs/ion-range.cjs.entry.js +3 -3
  85. package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
  86. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
  87. package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
  88. package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
  89. package/dist/cjs/ion-searchbar.cjs.entry.js +5 -5
  90. package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
  91. package/dist/cjs/ion-segment-view.cjs.entry.js +2 -2
  92. package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
  93. package/dist/cjs/ion-select-modal.cjs.entry.js +2 -2
  94. package/dist/cjs/ion-select_3.cjs.entry.js +36 -5
  95. package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
  96. package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
  97. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
  98. package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
  99. package/dist/cjs/ion-text.cjs.entry.js +2 -2
  100. package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
  101. package/dist/cjs/ion-toast.cjs.entry.js +3 -3
  102. package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
  103. package/dist/cjs/ionic.cjs.js +1 -1
  104. package/dist/cjs/loader.cjs.js +1 -1
  105. package/dist/cjs/{overlays-TbKsuC-K.js → overlays-DSmSrd_4.js} +26 -7
  106. package/dist/collection/collection-manifest.json +5 -9
  107. package/dist/collection/components/action-sheet/action-sheet.js +8 -4
  108. package/dist/collection/components/alert/alert.js +7 -3
  109. package/dist/collection/components/input/input.js +8 -8
  110. package/dist/collection/components/loading/loading.js +7 -3
  111. package/dist/collection/components/modal/modal.js +9 -5
  112. package/dist/collection/components/popover/popover.js +7 -3
  113. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  114. package/dist/collection/components/radio/radio.js +4 -4
  115. package/dist/collection/components/range/range.js +3 -3
  116. package/dist/collection/components/refresher/refresher.js +1 -1
  117. package/dist/collection/components/refresher-content/refresher-content.js +1 -1
  118. package/dist/collection/components/reorder/reorder.js +1 -1
  119. package/dist/collection/components/reorder-group/reorder-group.js +1 -1
  120. package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
  121. package/dist/collection/components/router-link/router-link.js +2 -2
  122. package/dist/collection/components/router-outlet/router-outlet.js +38 -5
  123. package/dist/collection/components/row/row.js +1 -1
  124. package/dist/collection/components/searchbar/searchbar.js +9 -9
  125. package/dist/collection/components/segment/segment.js +2 -2
  126. package/dist/collection/components/segment-button/segment-button.js +2 -2
  127. package/dist/collection/components/segment-content/segment-content.js +1 -1
  128. package/dist/collection/components/segment-view/segment-view.js +2 -2
  129. package/dist/collection/components/select/select.js +33 -2
  130. package/dist/collection/components/select-modal/select-modal.js +1 -1
  131. package/dist/collection/components/select-option/select-option.js +1 -1
  132. package/dist/collection/components/select-popover/select-popover.js +1 -1
  133. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
  134. package/dist/collection/components/spinner/spinner.js +1 -1
  135. package/dist/collection/components/split-pane/split-pane.js +2 -2
  136. package/dist/collection/components/tab/tab.js +2 -2
  137. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  138. package/dist/collection/components/tab-button/tab-button.js +2 -2
  139. package/dist/collection/components/tabs/tabs.js +1 -1
  140. package/dist/collection/components/text/text.js +2 -2
  141. package/dist/collection/components/textarea/textarea.js +2 -2
  142. package/dist/collection/components/thumbnail/thumbnail.js +1 -1
  143. package/dist/collection/components/title/title.js +2 -2
  144. package/dist/collection/components/toast/toast.js +2 -2
  145. package/dist/collection/components/toggle/toggle.js +3 -3
  146. package/dist/collection/components/toolbar/toolbar.js +2 -2
  147. package/dist/collection/index.js +1 -1
  148. package/dist/collection/utils/overlays.js +25 -6
  149. package/dist/docs.json +247 -1170
  150. package/dist/esm/{index-DV3sJJW8.js → index-AlrZKoWR.js} +1 -1
  151. package/dist/esm/index.js +1 -1
  152. package/dist/esm/ion-accordion_2.entry.js +1 -1
  153. package/dist/esm/ion-action-sheet.entry.js +8 -4
  154. package/dist/esm/ion-alert.entry.js +7 -3
  155. package/dist/esm/ion-app_8.entry.js +23 -9
  156. package/dist/esm/ion-avatar_3.entry.js +1 -1
  157. package/dist/esm/ion-back-button.entry.js +1 -1
  158. package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
  159. package/dist/esm/ion-col_3.entry.js +1 -1
  160. package/dist/esm/{ion-datetime_3.entry.js → ion-datetime.entry.js} +5 -641
  161. package/dist/esm/ion-fab_3.entry.js +1 -1
  162. package/dist/esm/ion-input-password-toggle.entry.js +1 -1
  163. package/dist/esm/ion-input.entry.js +5 -5
  164. package/dist/esm/ion-item_8.entry.js +3 -3
  165. package/dist/esm/ion-loading.entry.js +7 -3
  166. package/dist/esm/ion-menu_3.entry.js +2 -2
  167. package/dist/esm/ion-modal.entry.js +9 -5
  168. package/dist/esm/ion-popover.entry.js +7 -3
  169. package/dist/esm/ion-progress-bar.entry.js +1 -1
  170. package/dist/esm/ion-radio_2.entry.js +3 -3
  171. package/dist/esm/ion-range.entry.js +3 -3
  172. package/dist/esm/ion-refresher_2.entry.js +3 -3
  173. package/dist/esm/ion-reorder_2.entry.js +3 -3
  174. package/dist/esm/ion-ripple-effect.entry.js +1 -1
  175. package/dist/esm/ion-route_4.entry.js +2 -2
  176. package/dist/esm/ion-searchbar.entry.js +6 -6
  177. package/dist/esm/ion-segment-content.entry.js +1 -1
  178. package/dist/esm/ion-segment-view.entry.js +2 -2
  179. package/dist/esm/ion-segment_2.entry.js +4 -4
  180. package/dist/esm/ion-select-modal.entry.js +2 -2
  181. package/dist/esm/ion-select_3.entry.js +38 -7
  182. package/dist/esm/ion-spinner.entry.js +1 -1
  183. package/dist/esm/ion-split-pane.entry.js +2 -2
  184. package/dist/esm/ion-tab-bar_2.entry.js +4 -4
  185. package/dist/esm/ion-tab_2.entry.js +3 -3
  186. package/dist/esm/ion-text.entry.js +2 -2
  187. package/dist/esm/ion-textarea.entry.js +2 -2
  188. package/dist/esm/ion-toast.entry.js +3 -3
  189. package/dist/esm/ion-toggle.entry.js +4 -4
  190. package/dist/esm/ionic.js +1 -1
  191. package/dist/esm/loader.js +1 -1
  192. package/dist/esm/{overlays-TbiM4mdr.js → overlays-DLNOHWNc.js} +26 -7
  193. package/dist/html.html-data.json +6 -77
  194. package/dist/ionic/index.esm.js +1 -1
  195. package/dist/ionic/ionic.esm.js +1 -1
  196. package/dist/ionic/{p-aa5d6b8f.entry.js → p-03aa786d.entry.js} +1 -1
  197. package/dist/ionic/{p-8fce95d5.entry.js → p-14095ba5.entry.js} +1 -1
  198. package/dist/ionic/{p-3a126bca.entry.js → p-259d0d98.entry.js} +1 -1
  199. package/dist/ionic/{p-e847a888.entry.js → p-2a6d6565.entry.js} +1 -1
  200. package/dist/ionic/{p-fabcce6c.entry.js → p-341032b3.entry.js} +1 -1
  201. package/dist/ionic/{p-a21add2f.entry.js → p-441fbb13.entry.js} +1 -1
  202. package/dist/ionic/{p-3a7d1e91.entry.js → p-4502a274.entry.js} +1 -1
  203. package/dist/ionic/p-4621c387.entry.js +4 -0
  204. package/dist/ionic/p-4bb3eb60.entry.js +4 -0
  205. package/dist/ionic/{p-874b4bd8.entry.js → p-51cd1643.entry.js} +1 -1
  206. package/dist/ionic/p-5c3ec490.entry.js +4 -0
  207. package/dist/ionic/{p-3ae5f277.entry.js → p-627fabd9.entry.js} +1 -1
  208. package/dist/ionic/{p-e0be05c5.entry.js → p-629e4703.entry.js} +1 -1
  209. package/dist/ionic/{p-5d1da0a2.entry.js → p-76e92a84.entry.js} +1 -1
  210. package/dist/ionic/{p-9f1103ce.entry.js → p-7a37b3ce.entry.js} +1 -1
  211. package/dist/ionic/p-7aed7726.entry.js +4 -0
  212. package/dist/ionic/p-7ebd980c.entry.js +4 -0
  213. package/dist/ionic/{p-3353c229.entry.js → p-80b44b3c.entry.js} +1 -1
  214. package/dist/ionic/p-8d624ee5.entry.js +4 -0
  215. package/dist/ionic/{p-390ca786.entry.js → p-9177f4ac.entry.js} +1 -1
  216. package/dist/ionic/p-944c8939.entry.js +4 -0
  217. package/dist/ionic/p-9c6a5a8d.entry.js +4 -0
  218. package/dist/ionic/{p-DV3sJJW8.js → p-AlrZKoWR.js} +1 -1
  219. package/dist/ionic/p-Cg5-OQYy.js +4 -0
  220. package/dist/ionic/p-a2e51c5d.entry.js +4 -0
  221. package/dist/ionic/{p-4858af1f.entry.js → p-a5213260.entry.js} +1 -1
  222. package/dist/ionic/{p-37e720da.entry.js → p-a7628bc7.entry.js} +1 -1
  223. package/dist/ionic/{p-ef4c3bee.entry.js → p-b1599fca.entry.js} +1 -1
  224. package/dist/ionic/p-b16be471.entry.js +4 -0
  225. package/dist/ionic/{p-84d5ce05.entry.js → p-b9ac1fe0.entry.js} +1 -1
  226. package/dist/ionic/{p-94f2a736.entry.js → p-c93553d2.entry.js} +1 -1
  227. package/dist/ionic/{p-75dc25ba.entry.js → p-d2c7f046.entry.js} +1 -1
  228. package/dist/ionic/{p-c4d8641b.entry.js → p-d8387b99.entry.js} +1 -1
  229. package/dist/ionic/p-d8ac9eea.entry.js +4 -0
  230. package/dist/ionic/{p-9a65ac7f.entry.js → p-db1b6738.entry.js} +1 -1
  231. package/dist/ionic/p-ed797c72.entry.js +4 -0
  232. package/dist/ionic/{p-8eb8ee76.entry.js → p-ef93ca92.entry.js} +1 -1
  233. package/dist/ionic/p-f09f9642.entry.js +4 -0
  234. package/dist/ionic/p-f1c06f82.entry.js +4 -0
  235. package/dist/ionic/{p-0fa9c382.entry.js → p-fe4aa1db.entry.js} +1 -1
  236. package/dist/types/components/input/input.d.ts +1 -1
  237. package/dist/types/components/router-outlet/router-outlet.d.ts +7 -0
  238. package/dist/types/components/searchbar/searchbar.d.ts +1 -1
  239. package/dist/types/components/select/select.d.ts +1 -0
  240. package/dist/types/components.d.ts +19 -282
  241. package/dist/types/index.d.ts +1 -1
  242. package/dist/types/interface.d.ts +0 -1
  243. package/dist/types/utils/config.d.ts +0 -8
  244. package/dist/types/utils/overlays.d.ts +11 -9
  245. package/hydrate/index.js +202 -795
  246. package/hydrate/index.mjs +202 -795
  247. package/package.json +37 -5
  248. package/components/ion-picker-legacy-column.d.ts +0 -11
  249. package/components/ion-picker-legacy-column.js +0 -4
  250. package/components/ion-picker-legacy.d.ts +0 -11
  251. package/components/ion-picker-legacy.js +0 -4
  252. package/components/p-0NRupjzW.js +0 -4
  253. package/components/p-Bth-EzJ0.js +0 -4
  254. package/components/p-CU5rbWAW.js +0 -4
  255. package/components/p-W9CZ2mWX.js +0 -4
  256. package/components/p-dhLYXa7A.js +0 -4
  257. package/components/p-uVRyUM3z.js +0 -4
  258. package/dist/collection/components/picker-legacy/animations/ios.enter.js +0 -27
  259. package/dist/collection/components/picker-legacy/animations/ios.leave.js +0 -23
  260. package/dist/collection/components/picker-legacy/picker-interface.js +0 -1
  261. package/dist/collection/components/picker-legacy/picker.ios.css +0 -300
  262. package/dist/collection/components/picker-legacy/picker.js +0 -890
  263. package/dist/collection/components/picker-legacy/picker.md.css +0 -287
  264. package/dist/collection/components/picker-legacy-column/picker-column.ios.css +0 -231
  265. package/dist/collection/components/picker-legacy-column/picker-column.js +0 -422
  266. package/dist/collection/components/picker-legacy-column/picker-column.md.css +0 -222
  267. package/dist/collection/components/picker-legacy-column/test/test.utils.js +0 -43
  268. package/dist/ionic/p-00dbb17e.entry.js +0 -4
  269. package/dist/ionic/p-01f81ea5.entry.js +0 -4
  270. package/dist/ionic/p-0d005398.entry.js +0 -4
  271. package/dist/ionic/p-27d30585.entry.js +0 -4
  272. package/dist/ionic/p-2bb2cb18.entry.js +0 -4
  273. package/dist/ionic/p-2f55dc1a.entry.js +0 -4
  274. package/dist/ionic/p-30bf9737.entry.js +0 -4
  275. package/dist/ionic/p-3a541154.entry.js +0 -4
  276. package/dist/ionic/p-485fda23.entry.js +0 -4
  277. package/dist/ionic/p-4baa5b82.entry.js +0 -4
  278. package/dist/ionic/p-4dc1c33c.entry.js +0 -4
  279. package/dist/ionic/p-5fc7e542.entry.js +0 -4
  280. package/dist/ionic/p-e686695b.entry.js +0 -4
  281. package/dist/ionic/p-ec090e0a.entry.js +0 -4
  282. package/dist/ionic/p-xOfi7-Zn.js +0 -4
  283. package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +0 -5
  284. package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +0 -5
  285. package/dist/types/components/picker-legacy/picker-interface.d.ts +0 -52
  286. package/dist/types/components/picker-legacy/picker.d.ts +0 -158
  287. package/dist/types/components/picker-legacy-column/picker-column.d.ts +0 -46
  288. package/dist/types/components/picker-legacy-column/test/test.utils.d.ts +0 -9
@@ -3,21 +3,17 @@
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-tcQvqkiX.js';
5
5
  import { startFocusVisible } from './focus-visible-BmVRXR1y.js';
6
- import { r as raf, g as getElementRoot, a as renderHiddenInput, e as clamp } from './helpers-HEqiOzXb.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-TbiM4mdr.js';
6
+ import { r as raf, g as getElementRoot, a as renderHiddenInput } from './helpers-HEqiOzXb.js';
7
+ import { F as FOCUS_TRAP_DISABLE_CLASS } from './overlays-DLNOHWNc.js';
8
8
  import { i as isRTL } from './dir-C53feagD.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';
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';
11
11
  import { b as getIonMode } from './ionic-global-Cp_eT4sZ.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-DZI70dKr.js';
13
- import { c as createLockController } from './lock-controller-B-hirT0v.js';
14
- import { c as createAnimation } from './animation-DLJpuoEz.js';
15
- import { a as hapticSelectionChanged, h as hapticSelectionEnd, b as hapticSelectionStart } from './haptic-DzAMWJuk.js';
16
13
  import './index-ZjP4CjeZ.js';
17
14
  import './hardware-back-button-B93Gru0Y.js';
18
15
  import './framework-delegate-FnPGymXL.js';
19
16
  import './gesture-controller-BTEOs1at.js';
20
- import './capacitor-CFERIeaU.js';
21
17
 
22
18
  const isYearDisabled = (refYear, minParts, maxParts) => {
23
19
  if (minParts && minParts.year > refYear) {
@@ -1984,636 +1980,4 @@ Datetime.style = {
1984
1980
  md: datetimeMdCss()
1985
1981
  };
1986
1982
 
1987
- /**
1988
- * iOS Picker Enter Animation
1989
- */
1990
- const iosEnterAnimation = (baseEl) => {
1991
- const baseAnimation = createAnimation();
1992
- const backdropAnimation = createAnimation();
1993
- const wrapperAnimation = createAnimation();
1994
- backdropAnimation
1995
- .addElement(baseEl.querySelector('ion-backdrop'))
1996
- .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
1997
- .beforeStyles({
1998
- 'pointer-events': 'none',
1999
- })
2000
- .afterClearStyles(['pointer-events']);
2001
- wrapperAnimation
2002
- .addElement(baseEl.querySelector('.picker-wrapper'))
2003
- .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
2004
- return baseAnimation
2005
- .addElement(baseEl)
2006
- .easing('cubic-bezier(.36,.66,.04,1)')
2007
- .duration(400)
2008
- .addAnimation([backdropAnimation, wrapperAnimation]);
2009
- };
2010
-
2011
- /**
2012
- * iOS Picker Leave Animation
2013
- */
2014
- const iosLeaveAnimation = (baseEl) => {
2015
- const baseAnimation = createAnimation();
2016
- const backdropAnimation = createAnimation();
2017
- const wrapperAnimation = createAnimation();
2018
- backdropAnimation
2019
- .addElement(baseEl.querySelector('ion-backdrop'))
2020
- .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
2021
- wrapperAnimation
2022
- .addElement(baseEl.querySelector('.picker-wrapper'))
2023
- .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
2024
- return baseAnimation
2025
- .addElement(baseEl)
2026
- .easing('cubic-bezier(.36,.66,.04,1)')
2027
- .duration(400)
2028
- .addAnimation([backdropAnimation, wrapperAnimation]);
2029
- };
2030
-
2031
- 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}`;
2032
-
2033
- 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}`;
2034
-
2035
- const Picker = class {
2036
- constructor(hostRef) {
2037
- registerInstance(this, hostRef);
2038
- this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
2039
- this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
2040
- this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
2041
- this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
2042
- this.didPresentShorthand = createEvent(this, "didPresent", 7);
2043
- this.willPresentShorthand = createEvent(this, "willPresent", 7);
2044
- this.willDismissShorthand = createEvent(this, "willDismiss", 7);
2045
- this.didDismissShorthand = createEvent(this, "didDismiss", 7);
2046
- this.delegateController = createDelegateController(this);
2047
- this.lockController = createLockController();
2048
- this.triggerController = createTriggerController();
2049
- this.presented = false;
2050
- /** @internal */
2051
- this.hasController = false;
2052
- /**
2053
- * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
2054
- */
2055
- this.keyboardClose = true;
2056
- /**
2057
- * Array of buttons to be displayed at the top of the picker.
2058
- */
2059
- this.buttons = [];
2060
- /**
2061
- * Array of columns to be displayed in the picker.
2062
- */
2063
- this.columns = [];
2064
- /**
2065
- * Number of milliseconds to wait before dismissing the picker.
2066
- */
2067
- this.duration = 0;
2068
- /**
2069
- * If `true`, a backdrop will be displayed behind the picker.
2070
- */
2071
- this.showBackdrop = true;
2072
- /**
2073
- * If `true`, the picker will be dismissed when the backdrop is clicked.
2074
- */
2075
- this.backdropDismiss = true;
2076
- /**
2077
- * If `true`, the picker will animate.
2078
- */
2079
- this.animated = true;
2080
- /**
2081
- * If `true`, the picker will open. If `false`, the picker will close.
2082
- * Use this if you need finer grained control over presentation, otherwise
2083
- * just use the pickerController or the `trigger` property.
2084
- * Note: `isOpen` will not automatically be set back to `false` when
2085
- * the picker dismisses. You will need to do that in your code.
2086
- */
2087
- this.isOpen = false;
2088
- this.onBackdropTap = () => {
2089
- this.dismiss(undefined, BACKDROP);
2090
- };
2091
- this.dispatchCancelHandler = (ev) => {
2092
- const role = ev.detail.role;
2093
- if (isCancel(role)) {
2094
- const cancelButton = this.buttons.find((b) => b.role === 'cancel');
2095
- this.callButtonHandler(cancelButton);
2096
- }
2097
- };
2098
- }
2099
- onIsOpenChange(newValue, oldValue) {
2100
- if (newValue === true && oldValue === false) {
2101
- this.present();
2102
- }
2103
- else if (newValue === false && oldValue === true) {
2104
- this.dismiss();
2105
- }
2106
- }
2107
- triggerChanged() {
2108
- const { trigger, el, triggerController } = this;
2109
- if (trigger) {
2110
- triggerController.addClickListener(el, trigger);
2111
- }
2112
- }
2113
- connectedCallback() {
2114
- prepareOverlay(this.el);
2115
- this.triggerChanged();
2116
- }
2117
- disconnectedCallback() {
2118
- this.triggerController.removeClickListener();
2119
- }
2120
- componentWillLoad() {
2121
- var _a;
2122
- if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
2123
- setOverlayId(this.el);
2124
- }
2125
- }
2126
- componentDidLoad() {
2127
- 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);
2128
- /**
2129
- * If picker was rendered with isOpen="true"
2130
- * then we should open picker immediately.
2131
- */
2132
- if (this.isOpen === true) {
2133
- raf(() => this.present());
2134
- }
2135
- /**
2136
- * When binding values in frameworks such as Angular
2137
- * it is possible for the value to be set after the Web Component
2138
- * initializes but before the value watcher is set up in Stencil.
2139
- * As a result, the watcher callback may not be fired.
2140
- * We work around this by manually calling the watcher
2141
- * callback when the component has loaded and the watcher
2142
- * is configured.
2143
- */
2144
- this.triggerChanged();
2145
- }
2146
- /**
2147
- * Present the picker overlay after it has been created.
2148
- */
2149
- async present() {
2150
- const unlock = await this.lockController.lock();
2151
- await this.delegateController.attachViewToDom();
2152
- await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
2153
- if (this.duration > 0) {
2154
- this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
2155
- }
2156
- unlock();
2157
- }
2158
- /**
2159
- * Dismiss the picker overlay after it has been presented.
2160
- *
2161
- * @param data Any data to emit in the dismiss events.
2162
- * @param role The role of the element that is dismissing the picker.
2163
- * This can be useful in a button handler for determining which button was
2164
- * clicked to dismiss the picker.
2165
- * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
2166
- */
2167
- async dismiss(data, role) {
2168
- const unlock = await this.lockController.lock();
2169
- if (this.durationTimeout) {
2170
- clearTimeout(this.durationTimeout);
2171
- }
2172
- const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
2173
- if (dismissed) {
2174
- this.delegateController.removeViewFromDom();
2175
- }
2176
- unlock();
2177
- return dismissed;
2178
- }
2179
- /**
2180
- * Returns a promise that resolves when the picker did dismiss.
2181
- */
2182
- onDidDismiss() {
2183
- return eventMethod(this.el, 'ionPickerDidDismiss');
2184
- }
2185
- /**
2186
- * Returns a promise that resolves when the picker will dismiss.
2187
- */
2188
- onWillDismiss() {
2189
- return eventMethod(this.el, 'ionPickerWillDismiss');
2190
- }
2191
- /**
2192
- * Get the column that matches the specified name.
2193
- *
2194
- * @param name The name of the column.
2195
- */
2196
- getColumn(name) {
2197
- return Promise.resolve(this.columns.find((column) => column.name === name));
2198
- }
2199
- async buttonClick(button) {
2200
- const role = button.role;
2201
- if (isCancel(role)) {
2202
- return this.dismiss(undefined, role);
2203
- }
2204
- const shouldDismiss = await this.callButtonHandler(button);
2205
- if (shouldDismiss) {
2206
- return this.dismiss(this.getSelected(), button.role);
2207
- }
2208
- return Promise.resolve();
2209
- }
2210
- async callButtonHandler(button) {
2211
- if (button) {
2212
- // a handler has been provided, execute it
2213
- // pass the handler the values from the inputs
2214
- const rtn = await safeCall(button.handler, this.getSelected());
2215
- if (rtn === false) {
2216
- // if the return value of the handler is false then do not dismiss
2217
- return false;
2218
- }
2219
- }
2220
- return true;
2221
- }
2222
- getSelected() {
2223
- const selected = {};
2224
- this.columns.forEach((col, index) => {
2225
- const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
2226
- selected[col.name] = {
2227
- text: selectedColumn ? selectedColumn.text : undefined,
2228
- value: selectedColumn ? selectedColumn.value : undefined,
2229
- columnIndex: index,
2230
- };
2231
- });
2232
- return selected;
2233
- }
2234
- render() {
2235
- const { htmlAttributes } = this;
2236
- const mode = getIonMode(this);
2237
- return (h(Host, Object.assign({ key: '80f66d33780d8a1352d24be9cb63a0cc03d01ab5', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
2238
- zIndex: `${20000 + this.overlayIndex}`,
2239
- }, class: Object.assign({ [mode]: true,
2240
- // Used internally for styling
2241
- [`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" })));
2242
- }
2243
- get el() { return getElement(this); }
2244
- static get watchers() { return {
2245
- "isOpen": [{
2246
- "onIsOpenChange": 0
2247
- }],
2248
- "trigger": [{
2249
- "triggerChanged": 0
2250
- }]
2251
- }; }
2252
- };
2253
- const buttonWrapperClass = (button) => {
2254
- return {
2255
- [`picker-toolbar-${button.role}`]: button.role !== undefined,
2256
- 'picker-toolbar-button': true,
2257
- };
2258
- };
2259
- const buttonClass = (button) => {
2260
- return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
2261
- };
2262
- Picker.style = {
2263
- ios: pickerIosCss(),
2264
- md: pickerMdCss()
2265
- };
2266
-
2267
- 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}}`;
2268
-
2269
- 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)}`;
2270
-
2271
- const PickerColumnCmp = class {
2272
- constructor(hostRef) {
2273
- registerInstance(this, hostRef);
2274
- this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
2275
- this.optHeight = 0;
2276
- this.rotateFactor = 0;
2277
- this.scaleFactor = 1;
2278
- this.velocity = 0;
2279
- this.y = 0;
2280
- this.noAnimate = true;
2281
- // `colDidChange` is a flag that gets set when the column is changed
2282
- // dynamically. When this flag is set, the column will refresh
2283
- // after the component re-renders to incorporate the new column data.
2284
- // This is necessary because `this.refresh` queries for the option elements,
2285
- // so it needs to wait for the latest elements to be available in the DOM.
2286
- // Ex: column is created with 3 options. User updates the column data
2287
- // to have 5 options. The column will still think it only has 3 options.
2288
- this.colDidChange = false;
2289
- }
2290
- colChanged() {
2291
- this.colDidChange = true;
2292
- }
2293
- async connectedCallback() {
2294
- let pickerRotateFactor = 0;
2295
- let pickerScaleFactor = 0.81;
2296
- const mode = getIonMode(this);
2297
- if (mode === 'ios') {
2298
- pickerRotateFactor = -0.46;
2299
- pickerScaleFactor = 1;
2300
- }
2301
- this.rotateFactor = pickerRotateFactor;
2302
- this.scaleFactor = pickerScaleFactor;
2303
- this.gesture = (await import('./index-CfgBF1SE.js')).createGesture({
2304
- el: this.el,
2305
- gestureName: 'picker-swipe',
2306
- gesturePriority: 100,
2307
- threshold: 0,
2308
- passive: false,
2309
- onStart: (ev) => this.onStart(ev),
2310
- onMove: (ev) => this.onMove(ev),
2311
- onEnd: (ev) => this.onEnd(ev),
2312
- });
2313
- this.gesture.enable();
2314
- // Options have not been initialized yet
2315
- // Animation must be disabled through the `noAnimate` flag
2316
- // Otherwise, the options will render
2317
- // at the top of the column and transition down
2318
- this.tmrId = setTimeout(() => {
2319
- this.noAnimate = false;
2320
- // After initialization, `refresh()` will be called
2321
- // At this point, animation will be enabled. The options will
2322
- // animate as they are being selected.
2323
- this.refresh(true);
2324
- }, 250);
2325
- }
2326
- componentDidLoad() {
2327
- this.onDomChange();
2328
- }
2329
- componentDidUpdate() {
2330
- // Options may have changed since last update.
2331
- if (this.colDidChange) {
2332
- // Animation must be disabled through the `onDomChange` parameter.
2333
- // Otherwise, the recently added options will render
2334
- // at the top of the column and transition down
2335
- this.onDomChange(true, false);
2336
- this.colDidChange = false;
2337
- }
2338
- }
2339
- disconnectedCallback() {
2340
- if (this.rafId !== undefined)
2341
- cancelAnimationFrame(this.rafId);
2342
- if (this.tmrId)
2343
- clearTimeout(this.tmrId);
2344
- if (this.gesture) {
2345
- this.gesture.destroy();
2346
- this.gesture = undefined;
2347
- }
2348
- }
2349
- emitColChange() {
2350
- this.ionPickerColChange.emit(this.col);
2351
- }
2352
- setSelected(selectedIndex, duration) {
2353
- // if there is a selected index, then figure out it's y position
2354
- // if there isn't a selected index, then just use the top y position
2355
- const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
2356
- this.velocity = 0;
2357
- // set what y position we're at
2358
- if (this.rafId !== undefined)
2359
- cancelAnimationFrame(this.rafId);
2360
- this.update(y, duration, true);
2361
- this.emitColChange();
2362
- }
2363
- update(y, duration, saveY) {
2364
- if (!this.optsEl) {
2365
- return;
2366
- }
2367
- // ensure we've got a good round number :)
2368
- let translateY = 0;
2369
- let translateZ = 0;
2370
- const { col, rotateFactor } = this;
2371
- const prevSelected = col.selectedIndex;
2372
- const selectedIndex = (col.selectedIndex = this.indexForY(-y));
2373
- const durationStr = duration === 0 ? '' : duration + 'ms';
2374
- const scaleStr = `scale(${this.scaleFactor})`;
2375
- const children = this.optsEl.children;
2376
- for (let i = 0; i < children.length; i++) {
2377
- const button = children[i];
2378
- const opt = col.options[i];
2379
- const optOffset = i * this.optHeight + y;
2380
- let transform = '';
2381
- if (rotateFactor !== 0) {
2382
- const rotateX = optOffset * rotateFactor;
2383
- if (Math.abs(rotateX) <= 90) {
2384
- translateY = 0;
2385
- translateZ = 90;
2386
- transform = `rotateX(${rotateX}deg) `;
2387
- }
2388
- else {
2389
- translateY = -9999;
2390
- }
2391
- }
2392
- else {
2393
- translateZ = 0;
2394
- translateY = optOffset;
2395
- }
2396
- const selected = selectedIndex === i;
2397
- transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
2398
- if (this.scaleFactor !== 1 && !selected) {
2399
- transform += scaleStr;
2400
- }
2401
- // Update transition duration
2402
- if (this.noAnimate) {
2403
- opt.duration = 0;
2404
- button.style.transitionDuration = '';
2405
- }
2406
- else if (duration !== opt.duration) {
2407
- opt.duration = duration;
2408
- button.style.transitionDuration = durationStr;
2409
- }
2410
- // Update transform
2411
- if (transform !== opt.transform) {
2412
- opt.transform = transform;
2413
- }
2414
- button.style.transform = transform;
2415
- /**
2416
- * Ensure that the select column
2417
- * item has the selected class
2418
- */
2419
- opt.selected = selected;
2420
- if (selected) {
2421
- button.classList.add(PICKER_OPT_SELECTED);
2422
- }
2423
- else {
2424
- button.classList.remove(PICKER_OPT_SELECTED);
2425
- }
2426
- }
2427
- this.col.prevSelected = prevSelected;
2428
- if (saveY) {
2429
- this.y = y;
2430
- }
2431
- if (this.lastIndex !== selectedIndex) {
2432
- // have not set a last index yet
2433
- hapticSelectionChanged();
2434
- this.lastIndex = selectedIndex;
2435
- }
2436
- }
2437
- decelerate() {
2438
- if (this.velocity !== 0) {
2439
- // still decelerating
2440
- this.velocity *= DECELERATION_FRICTION;
2441
- // do not let it go slower than a velocity of 1
2442
- this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
2443
- let y = this.y + this.velocity;
2444
- if (y > this.minY) {
2445
- // whoops, it's trying to scroll up farther than the options we have!
2446
- y = this.minY;
2447
- this.velocity = 0;
2448
- }
2449
- else if (y < this.maxY) {
2450
- // gahh, it's trying to scroll down farther than we can!
2451
- y = this.maxY;
2452
- this.velocity = 0;
2453
- }
2454
- this.update(y, 0, true);
2455
- const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
2456
- if (notLockedIn) {
2457
- // isn't locked in yet, keep decelerating until it is
2458
- this.rafId = requestAnimationFrame(() => this.decelerate());
2459
- }
2460
- else {
2461
- this.velocity = 0;
2462
- this.emitColChange();
2463
- hapticSelectionEnd();
2464
- }
2465
- }
2466
- else if (this.y % this.optHeight !== 0) {
2467
- // needs to still get locked into a position so options line up
2468
- const currentPos = Math.abs(this.y % this.optHeight);
2469
- // create a velocity in the direction it needs to scroll
2470
- this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
2471
- this.decelerate();
2472
- }
2473
- }
2474
- indexForY(y) {
2475
- return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
2476
- }
2477
- onStart(detail) {
2478
- // We have to prevent default in order to block scrolling under the picker
2479
- // but we DO NOT have to stop propagation, since we still want
2480
- // some "click" events to capture
2481
- if (detail.event.cancelable) {
2482
- detail.event.preventDefault();
2483
- }
2484
- detail.event.stopPropagation();
2485
- hapticSelectionStart();
2486
- // reset everything
2487
- if (this.rafId !== undefined)
2488
- cancelAnimationFrame(this.rafId);
2489
- const options = this.col.options;
2490
- let minY = options.length - 1;
2491
- let maxY = 0;
2492
- for (let i = 0; i < options.length; i++) {
2493
- if (!options[i].disabled) {
2494
- minY = Math.min(minY, i);
2495
- maxY = Math.max(maxY, i);
2496
- }
2497
- }
2498
- this.minY = -(minY * this.optHeight);
2499
- this.maxY = -(maxY * this.optHeight);
2500
- }
2501
- onMove(detail) {
2502
- if (detail.event.cancelable) {
2503
- detail.event.preventDefault();
2504
- }
2505
- detail.event.stopPropagation();
2506
- // update the scroll position relative to pointer start position
2507
- let y = this.y + detail.deltaY;
2508
- if (y > this.minY) {
2509
- // scrolling up higher than scroll area
2510
- y = Math.pow(y, 0.8);
2511
- this.bounceFrom = y;
2512
- }
2513
- else if (y < this.maxY) {
2514
- // scrolling down below scroll area
2515
- y += Math.pow(this.maxY - y, 0.9);
2516
- this.bounceFrom = y;
2517
- }
2518
- else {
2519
- this.bounceFrom = 0;
2520
- }
2521
- this.update(y, 0, false);
2522
- }
2523
- onEnd(detail) {
2524
- if (this.bounceFrom > 0) {
2525
- // bounce back up
2526
- this.update(this.minY, 100, true);
2527
- this.emitColChange();
2528
- return;
2529
- }
2530
- else if (this.bounceFrom < 0) {
2531
- // bounce back down
2532
- this.update(this.maxY, 100, true);
2533
- this.emitColChange();
2534
- return;
2535
- }
2536
- this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
2537
- if (this.velocity === 0 && detail.deltaY === 0) {
2538
- const opt = detail.event.target.closest('.picker-opt');
2539
- if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
2540
- this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
2541
- }
2542
- }
2543
- else {
2544
- this.y += detail.deltaY;
2545
- if (Math.abs(detail.velocityY) < 0.05) {
2546
- const isScrollingUp = detail.deltaY > 0;
2547
- const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
2548
- if (isScrollingUp && optHeightFraction > 0.5) {
2549
- this.velocity = Math.abs(this.velocity) * -1;
2550
- }
2551
- else if (!isScrollingUp && optHeightFraction <= 0.5) {
2552
- this.velocity = Math.abs(this.velocity);
2553
- }
2554
- }
2555
- this.decelerate();
2556
- }
2557
- }
2558
- refresh(forceRefresh, animated) {
2559
- var _a;
2560
- let min = this.col.options.length - 1;
2561
- let max = 0;
2562
- const options = this.col.options;
2563
- for (let i = 0; i < options.length; i++) {
2564
- if (!options[i].disabled) {
2565
- min = Math.min(min, i);
2566
- max = Math.max(max, i);
2567
- }
2568
- }
2569
- /**
2570
- * Only update selected value if column has a
2571
- * velocity of 0. If it does not, then the
2572
- * column is animating might land on
2573
- * a value different than the value at
2574
- * selectedIndex
2575
- */
2576
- if (this.velocity !== 0) {
2577
- return;
2578
- }
2579
- const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
2580
- if (this.col.prevSelected !== selectedIndex || forceRefresh) {
2581
- const y = selectedIndex * this.optHeight * -1;
2582
- const duration = animated ? TRANSITION_DURATION : 0;
2583
- this.velocity = 0;
2584
- this.update(y, duration, true);
2585
- }
2586
- }
2587
- onDomChange(forceRefresh, animated) {
2588
- const colEl = this.optsEl;
2589
- if (colEl) {
2590
- // DOM READ
2591
- // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
2592
- this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
2593
- }
2594
- this.refresh(forceRefresh, animated);
2595
- }
2596
- render() {
2597
- const col = this.col;
2598
- const mode = getIonMode(this);
2599
- 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: {
2600
- 'max-width': this.col.columnWidth,
2601
- } }, 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))));
2602
- }
2603
- get el() { return getElement(this); }
2604
- static get watchers() { return {
2605
- "col": [{
2606
- "colChanged": 0
2607
- }]
2608
- }; }
2609
- };
2610
- const PICKER_OPT_SELECTED = 'picker-opt-selected';
2611
- const DECELERATION_FRICTION = 0.97;
2612
- const MAX_PICKER_SPEED = 90;
2613
- const TRANSITION_DURATION = 150;
2614
- PickerColumnCmp.style = {
2615
- ios: pickerColumnIosCss(),
2616
- md: pickerColumnMdCss()
2617
- };
2618
-
2619
- export { Datetime as ion_datetime, Picker as ion_picker_legacy, PickerColumnCmp as ion_picker_legacy_column };
1983
+ export { Datetime as ion_datetime };