@ionic/core 7.5.7-dev.11701203423.1b6a8829 → 7.5.7-dev.11701270755.14f050ad

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 (333) hide show
  1. package/components/backdrop.js +0 -12
  2. package/components/data.js +1 -1
  3. package/components/gesture-controller.js +1 -1
  4. package/components/icon.js +23 -14
  5. package/components/index7.js +1 -1
  6. package/components/ion-content.js +1 -1
  7. package/components/ion-datetime.js +28 -61
  8. package/components/ion-picker-column-option.d.ts +11 -0
  9. package/components/ion-picker-column-option.js +52 -0
  10. package/components/ion-picker-column.js +2 -2
  11. package/components/ion-picker-legacy-column.d.ts +11 -0
  12. package/components/ion-picker-legacy-column.js +9 -0
  13. package/components/{ion-picker-internal.d.ts → ion-picker-legacy.d.ts} +4 -4
  14. package/components/ion-picker-legacy.js +309 -0
  15. package/components/ion-picker.js +1 -299
  16. package/components/overlays.js +11 -4
  17. package/components/picker-column.js +331 -320
  18. package/components/picker-column2.js +379 -0
  19. package/components/{picker-internal.js → picker.js} +16 -16
  20. package/dist/cjs/{button-active-af897e0e.js → button-active-cd07b55b.js} +1 -1
  21. package/dist/cjs/{data-c8d21093.js → data-4845b494.js} +1 -1
  22. package/dist/cjs/{gesture-controller-b46721be.js → gesture-controller-d6a3f907.js} +1 -0
  23. package/dist/cjs/{index-5ea49600.js → index-09471526.js} +1 -1
  24. package/dist/cjs/{index-0ee995e4.js → index-0f8b33f8.js} +1 -1
  25. package/dist/cjs/index.cjs.js +3 -3
  26. package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
  27. package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -4
  28. package/dist/cjs/ion-alert.cjs.entry.js +4 -4
  29. package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
  30. package/dist/cjs/ion-back-button.cjs.entry.js +1 -1
  31. package/dist/cjs/ion-backdrop.cjs.entry.js +0 -12
  32. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +1 -1
  33. package/dist/cjs/ion-button_2.cjs.entry.js +23 -14
  34. package/dist/cjs/ion-datetime-button.cjs.entry.js +1 -1
  35. package/dist/cjs/ion-datetime_3.cjs.entry.js +27 -40
  36. package/dist/cjs/ion-fab_3.cjs.entry.js +1 -1
  37. package/dist/cjs/ion-input.cjs.entry.js +1 -1
  38. package/dist/cjs/ion-item-option_3.cjs.entry.js +1 -1
  39. package/dist/cjs/ion-item_8.cjs.entry.js +1 -1
  40. package/dist/cjs/ion-loading.cjs.entry.js +2 -1
  41. package/dist/cjs/ion-menu_3.cjs.entry.js +4 -4
  42. package/dist/cjs/ion-modal.cjs.entry.js +3 -3
  43. package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
  44. package/dist/cjs/ion-picker-column-option.cjs.entry.js +35 -0
  45. package/dist/cjs/{ion-picker-column-internal.cjs.entry.js → ion-picker-column.cjs.entry.js} +9 -9
  46. package/dist/cjs/{ion-picker-internal.cjs.entry.js → ion-picker.cjs.entry.js} +13 -13
  47. package/dist/cjs/ion-popover.cjs.entry.js +2 -1
  48. package/dist/cjs/ion-range.cjs.entry.js +1 -1
  49. package/dist/cjs/ion-refresher_2.cjs.entry.js +4 -4
  50. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
  51. package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
  52. package/dist/cjs/ion-segment_2.cjs.entry.js +1 -1
  53. package/dist/cjs/ion-select_3.cjs.entry.js +3 -2
  54. package/dist/cjs/ion-toast.cjs.entry.js +2 -1
  55. package/dist/cjs/ion-toggle.cjs.entry.js +2 -2
  56. package/dist/cjs/ionic.cjs.js +1 -1
  57. package/dist/cjs/loader.cjs.js +1 -1
  58. package/dist/cjs/{overlays-2ffc5f27.js → overlays-dbb71984.js} +11 -4
  59. package/dist/cjs/{swipe-back-d0412fb6.js → swipe-back-a6dc6e5d.js} +2 -2
  60. package/dist/collection/collection-manifest.json +7 -6
  61. package/dist/collection/components/backdrop/backdrop.js +0 -12
  62. package/dist/collection/components/content/content.css +0 -4
  63. package/dist/collection/components/datetime/datetime.ios.css +84 -25
  64. package/dist/collection/components/datetime/datetime.js +14 -29
  65. package/dist/collection/components/datetime/datetime.md.css +89 -25
  66. package/dist/collection/components/datetime/test/a11y/datetime.e2e.js +1 -1
  67. package/dist/collection/components/datetime/test/a11y/datetime.spec.js +6 -9
  68. package/dist/collection/components/datetime/test/basic/datetime.e2e.js +10 -0
  69. package/dist/collection/components/datetime/test/disabled/datetime.spec.js +4 -4
  70. package/dist/collection/components/datetime/test/minmax/datetime.e2e.js +5 -5
  71. package/dist/collection/components/datetime/test/month-year-picker/datetime.e2e.js +1 -1
  72. package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +2 -2
  73. package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +1 -1
  74. package/dist/collection/components/datetime/test/readonly/datetime.e2e.js +2 -2
  75. package/dist/collection/components/datetime/test/values/datetime.e2e.js +5 -5
  76. package/dist/collection/components/datetime/utils/data.js +1 -1
  77. package/dist/collection/components/picker/picker.ios.css +100 -205
  78. package/dist/collection/components/picker/picker.js +463 -735
  79. package/dist/collection/components/picker/picker.md.css +98 -194
  80. package/dist/collection/components/{picker-internal/test/a11y/picker-internal.e2e.js → picker/test/a11y/picker.e2e.js} +2 -2
  81. package/dist/collection/components/picker/test/basic/picker.e2e.js +106 -13
  82. package/dist/collection/components/{picker-internal/test/keyboard-entry/picker-internal.e2e.js → picker/test/keyboard-entry/picker.e2e.js} +20 -20
  83. package/dist/collection/components/picker-column/picker-column.ios.css +59 -176
  84. package/dist/collection/components/picker-column/picker-column.js +478 -333
  85. package/dist/collection/components/picker-column/picker-column.md.css +63 -113
  86. package/dist/collection/components/{picker-column-internal/test/basic/picker-column-internal.e2e.js → picker-column/test/basic/picker-column.e2e.js} +7 -7
  87. package/dist/collection/components/{picker-column-internal/test/disabled/picker-column-internal.e2e.js → picker-column/test/disabled/picker-column.e2e.js} +39 -39
  88. package/dist/collection/components/picker-column-option/picker-column-option.js +68 -0
  89. package/dist/collection/components/picker-column-option/test/a11y/picker-column-option.e2e.js +18 -0
  90. package/dist/collection/components/picker-legacy/picker.ios.css +367 -0
  91. package/dist/collection/components/picker-legacy/picker.js +817 -0
  92. package/dist/collection/components/{picker-internal/picker-internal.ios.css → picker-legacy/picker.md.css} +192 -100
  93. package/dist/collection/components/picker-legacy/test/basic/picker.e2e.js +25 -0
  94. package/dist/collection/components/{picker → picker-legacy}/test/is-open/picker.e2e.js +4 -4
  95. package/dist/collection/components/{picker → picker-legacy}/test/picker-id.spec.js +5 -5
  96. package/dist/collection/components/{picker → picker-legacy}/test/trigger/picker.e2e.js +1 -1
  97. package/dist/collection/components/{picker-internal/picker-internal.md.css → picker-legacy-column/picker-column.ios.css} +98 -101
  98. package/dist/collection/components/picker-legacy-column/picker-column.js +419 -0
  99. package/dist/collection/components/{picker-column-internal/picker-column-internal.md.css → picker-legacy-column/picker-column.md.css} +113 -63
  100. package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column-aria.spec.js +3 -3
  101. package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column-dynamic.spec.js +2 -2
  102. package/dist/collection/components/{picker-column → picker-legacy-column}/test/picker-column.spec.js +2 -2
  103. package/dist/collection/components/{picker-column → picker-legacy-column}/test/standalone/picker-column.e2e.js +3 -3
  104. package/dist/collection/utils/gesture/gesture-controller.js +1 -1
  105. package/dist/collection/utils/overlays.js +11 -4
  106. package/dist/collection/utils/test/overlays/overlays-scroll-blocking.spec.js +65 -0
  107. package/dist/docs.json +384 -40
  108. package/dist/esm/{button-active-ce5cba4c.js → button-active-5b0516e7.js} +1 -1
  109. package/dist/esm/{data-44d9e816.js → data-12e24f00.js} +1 -1
  110. package/dist/esm/{gesture-controller-0fa396c4.js → gesture-controller-3723db7c.js} +1 -1
  111. package/dist/esm/{index-ff313b19.js → index-32cbee52.js} +2 -2
  112. package/dist/esm/{index-d1a56aed.js → index-c132c5f1.js} +1 -1
  113. package/dist/esm/index.js +3 -3
  114. package/dist/esm/ion-accordion_2.entry.js +1 -1
  115. package/dist/esm/ion-action-sheet.entry.js +4 -4
  116. package/dist/esm/ion-alert.entry.js +4 -4
  117. package/dist/esm/ion-app_8.entry.js +2 -2
  118. package/dist/esm/ion-back-button.entry.js +1 -1
  119. package/dist/esm/ion-backdrop.entry.js +0 -12
  120. package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
  121. package/dist/esm/ion-button_2.entry.js +23 -14
  122. package/dist/esm/ion-datetime-button.entry.js +1 -1
  123. package/dist/esm/ion-datetime_3.entry.js +26 -39
  124. package/dist/esm/ion-fab_3.entry.js +1 -1
  125. package/dist/esm/ion-input.entry.js +1 -1
  126. package/dist/esm/ion-item-option_3.entry.js +1 -1
  127. package/dist/esm/ion-item_8.entry.js +1 -1
  128. package/dist/esm/ion-loading.entry.js +2 -1
  129. package/dist/esm/ion-menu_3.entry.js +4 -4
  130. package/dist/esm/ion-modal.entry.js +3 -3
  131. package/dist/esm/ion-nav_2.entry.js +1 -1
  132. package/dist/esm/ion-picker-column-option.entry.js +31 -0
  133. package/dist/esm/{ion-picker-column-internal.entry.js → ion-picker-column.entry.js} +9 -9
  134. package/dist/esm/{ion-picker-internal.entry.js → ion-picker.entry.js} +13 -13
  135. package/dist/esm/ion-popover.entry.js +2 -1
  136. package/dist/esm/ion-range.entry.js +1 -1
  137. package/dist/esm/ion-refresher_2.entry.js +4 -4
  138. package/dist/esm/ion-reorder_2.entry.js +2 -2
  139. package/dist/esm/ion-searchbar.entry.js +1 -1
  140. package/dist/esm/ion-segment_2.entry.js +1 -1
  141. package/dist/esm/ion-select_3.entry.js +3 -2
  142. package/dist/esm/ion-toast.entry.js +2 -1
  143. package/dist/esm/ion-toggle.entry.js +2 -2
  144. package/dist/esm/ionic.js +1 -1
  145. package/dist/esm/loader.js +1 -1
  146. package/dist/esm/{overlays-6c9feb7e.js → overlays-789cd7a7.js} +11 -4
  147. package/dist/esm/{swipe-back-0f3bfc8e.js → swipe-back-cc4c2bcb.js} +2 -2
  148. package/dist/esm-es5/{button-active-ce5cba4c.js → button-active-5b0516e7.js} +1 -1
  149. package/dist/esm-es5/{gesture-controller-0fa396c4.js → gesture-controller-3723db7c.js} +1 -1
  150. package/dist/esm-es5/{index-ff313b19.js → index-32cbee52.js} +1 -1
  151. package/dist/esm-es5/index.js +1 -1
  152. package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
  153. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  154. package/dist/esm-es5/ion-alert.entry.js +1 -1
  155. package/dist/esm-es5/ion-app_8.entry.js +1 -1
  156. package/dist/esm-es5/ion-back-button.entry.js +1 -1
  157. package/dist/esm-es5/ion-backdrop.entry.js +1 -1
  158. package/dist/esm-es5/ion-breadcrumb_2.entry.js +1 -1
  159. package/dist/esm-es5/ion-button_2.entry.js +1 -1
  160. package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
  161. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  162. package/dist/esm-es5/ion-fab_3.entry.js +1 -1
  163. package/dist/esm-es5/ion-input.entry.js +1 -1
  164. package/dist/esm-es5/ion-item-option_3.entry.js +1 -1
  165. package/dist/esm-es5/ion-item_8.entry.js +1 -1
  166. package/dist/esm-es5/ion-loading.entry.js +1 -1
  167. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  168. package/dist/esm-es5/ion-modal.entry.js +1 -1
  169. package/dist/esm-es5/ion-nav_2.entry.js +1 -1
  170. package/dist/esm-es5/ion-picker-column-option.entry.js +4 -0
  171. package/dist/esm-es5/ion-picker-column.entry.js +4 -0
  172. package/dist/esm-es5/ion-picker.entry.js +4 -0
  173. package/dist/esm-es5/ion-popover.entry.js +1 -1
  174. package/dist/esm-es5/ion-range.entry.js +1 -1
  175. package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
  176. package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
  177. package/dist/esm-es5/ion-searchbar.entry.js +1 -1
  178. package/dist/esm-es5/ion-segment_2.entry.js +1 -1
  179. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  180. package/dist/esm-es5/ion-toast.entry.js +1 -1
  181. package/dist/esm-es5/ion-toggle.entry.js +1 -1
  182. package/dist/esm-es5/ionic.js +1 -1
  183. package/dist/esm-es5/loader.js +1 -1
  184. package/dist/esm-es5/overlays-789cd7a7.js +4 -0
  185. package/dist/esm-es5/swipe-back-cc4c2bcb.js +4 -0
  186. package/dist/html.html-data.json +119 -1
  187. package/dist/ionic/index.esm.js +1 -1
  188. package/dist/ionic/ionic.esm.js +1 -1
  189. package/dist/ionic/{p-67e644bd.system.entry.js → p-02d8fdba.system.entry.js} +1 -1
  190. package/dist/ionic/{p-f3c82f74.system.entry.js → p-06e6d235.system.entry.js} +2 -2
  191. package/dist/ionic/{p-c429a314.system.entry.js → p-07d9e9cd.system.entry.js} +1 -1
  192. package/dist/ionic/p-0c244faf.entry.js +4 -0
  193. package/dist/ionic/{p-e0b06b65.js → p-100ef961.js} +1 -1
  194. package/dist/ionic/{p-04dca48d.entry.js → p-14aca3fb.entry.js} +1 -1
  195. package/dist/ionic/p-1dc91702.entry.js +4 -0
  196. package/dist/ionic/{p-a43603ce.entry.js → p-1e86a71b.entry.js} +1 -1
  197. package/dist/ionic/{p-dbf7d6e5.system.entry.js → p-22813b28.system.entry.js} +1 -1
  198. package/dist/ionic/p-234b9617.system.entry.js +4 -0
  199. package/dist/ionic/p-25c34422.system.entry.js +4 -0
  200. package/dist/ionic/p-2804781b.entry.js +4 -0
  201. package/dist/ionic/p-2ad38423.system.entry.js +4 -0
  202. package/dist/ionic/{p-7176cea3.entry.js → p-2ba9414e.entry.js} +1 -1
  203. package/dist/ionic/{p-fa8d4788.system.js → p-2e1794df.system.js} +1 -1
  204. package/dist/ionic/{p-e627ed84.js → p-302091ab.js} +1 -1
  205. package/dist/ionic/p-332f64af.system.entry.js +4 -0
  206. package/dist/ionic/p-39074595.entry.js +4 -0
  207. package/dist/ionic/{p-67ed452a.system.entry.js → p-3f88eab8.system.entry.js} +1 -1
  208. package/dist/ionic/{p-8659f9a9.system.entry.js → p-3fb57e1b.system.entry.js} +1 -1
  209. package/dist/ionic/p-40903d34.system.js +1 -1
  210. package/dist/ionic/p-439e20ef.entry.js +4 -0
  211. package/dist/ionic/{p-8d5a30dd.entry.js → p-477a182e.entry.js} +1 -1
  212. package/dist/ionic/{p-899fb2da.entry.js → p-48d9faa7.entry.js} +1 -1
  213. package/dist/ionic/{p-7d7fdaf0.system.entry.js → p-4f3e2767.system.entry.js} +1 -1
  214. package/dist/ionic/{p-3de79805.entry.js → p-56224549.entry.js} +1 -1
  215. package/dist/ionic/{p-965677f1.entry.js → p-5ce11143.entry.js} +1 -1
  216. package/dist/ionic/{p-6594d76a.system.entry.js → p-5da0eb3e.system.entry.js} +1 -1
  217. package/dist/ionic/{p-9e852ff1.system.js → p-6500b298.system.js} +1 -1
  218. package/dist/ionic/{p-42435018.system.entry.js → p-664d2b07.system.entry.js} +1 -1
  219. package/dist/ionic/p-6893f6e4.entry.js +4 -0
  220. package/dist/ionic/p-7c66a566.system.entry.js +4 -0
  221. package/dist/ionic/{p-68166ba6.entry.js → p-835e0346.entry.js} +1 -1
  222. package/dist/ionic/{p-7b4cd5fc.system.entry.js → p-878c7aa5.system.entry.js} +1 -1
  223. package/dist/ionic/p-8b4ab236.entry.js +4 -0
  224. package/dist/ionic/{p-f37b4b79.entry.js → p-939d903b.entry.js} +1 -1
  225. package/dist/ionic/p-9403b297.system.entry.js +4 -0
  226. package/dist/ionic/{p-6d812360.system.entry.js → p-966cf574.system.entry.js} +1 -1
  227. package/dist/ionic/p-992d3bad.entry.js +4 -0
  228. package/dist/ionic/{p-1cb5f2f8.system.entry.js → p-9b5301cc.system.entry.js} +1 -1
  229. package/dist/ionic/p-9c967a65.system.entry.js +4 -0
  230. package/dist/ionic/{p-8e1bded3.entry.js → p-9e6bf9ed.entry.js} +1 -1
  231. package/dist/ionic/{p-8cbf0979.entry.js → p-a21b8d05.entry.js} +1 -1
  232. package/dist/ionic/{p-6e23777e.system.entry.js → p-a4cda7a8.system.entry.js} +1 -1
  233. package/dist/ionic/{p-09d142b3.system.js → p-a57f223c.system.js} +1 -1
  234. package/dist/ionic/{p-8b1be026.js → p-a7e2ac5c.js} +1 -1
  235. package/dist/ionic/{p-0838e6bb.entry.js → p-a8e68fd9.entry.js} +1 -1
  236. package/dist/ionic/{p-14923cd7.system.entry.js → p-abacb44b.system.entry.js} +1 -1
  237. package/dist/ionic/{p-61c30156.system.entry.js → p-b3e79338.system.entry.js} +1 -1
  238. package/dist/ionic/p-b4cbb736.js +4 -0
  239. package/dist/ionic/{p-4fa201a7.entry.js → p-b6a8588f.entry.js} +1 -1
  240. package/dist/ionic/{p-ee2469c1.entry.js → p-b6f8ee31.entry.js} +1 -1
  241. package/dist/ionic/p-ba70d455.entry.js +4 -0
  242. package/dist/ionic/{p-8ad82eb3.entry.js → p-baa7cb1e.entry.js} +1 -1
  243. package/dist/ionic/p-bd7a3269.entry.js +4 -0
  244. package/dist/ionic/{p-bd76524d.entry.js → p-c1229981.entry.js} +1 -1
  245. package/dist/ionic/{p-db5043df.system.entry.js → p-c31fc05f.system.entry.js} +1 -1
  246. package/dist/ionic/p-c32bf078.system.entry.js +4 -0
  247. package/dist/ionic/{p-a936d224.system.js → p-c7fd81ba.system.js} +1 -1
  248. package/dist/ionic/{p-4c80afe1.system.entry.js → p-cb62e3fc.system.entry.js} +1 -1
  249. package/dist/ionic/{p-cd2808f5.system.entry.js → p-d21bfe66.system.entry.js} +1 -1
  250. package/dist/ionic/{p-4d786d1f.system.entry.js → p-d3952bd5.system.entry.js} +1 -1
  251. package/dist/ionic/p-dc565ca3.js +4 -0
  252. package/dist/ionic/{p-deab76dc.entry.js → p-dd837fa8.entry.js} +1 -1
  253. package/dist/ionic/p-e88ed07f.system.js +4 -0
  254. package/dist/ionic/p-eb07ec1a.system.entry.js +4 -0
  255. package/dist/ionic/p-eb5697b5.system.js +4 -0
  256. package/dist/ionic/{p-52360c7a.entry.js → p-ee800093.entry.js} +1 -1
  257. package/dist/ionic/p-f0559c5d.system.entry.js +4 -0
  258. package/dist/ionic/{p-97a96f5f.entry.js → p-f4cc91f6.entry.js} +1 -1
  259. package/dist/ionic/{p-640efee6.system.entry.js → p-f5a750e4.system.entry.js} +1 -1
  260. package/dist/ionic/p-fdd22426.entry.js +4 -0
  261. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +0 -1
  262. package/dist/types/components/backdrop/backdrop.d.ts +0 -3
  263. package/dist/types/components/datetime/datetime.d.ts +0 -1
  264. package/dist/types/components/datetime/utils/data.d.ts +2 -2
  265. package/dist/types/components/menu/menu.d.ts +1 -1
  266. package/dist/types/components/picker/picker-interfaces.d.ts +8 -0
  267. package/dist/types/components/picker/picker.d.ts +74 -131
  268. package/dist/types/components/picker-column/picker-column.d.ts +94 -39
  269. package/dist/types/components/picker-column-option/picker-column-option.d.ts +16 -0
  270. package/dist/types/components/picker-legacy/picker.d.ts +158 -0
  271. package/dist/types/components/picker-legacy-column/picker-column.d.ts +46 -0
  272. package/dist/types/components.d.ts +151 -122
  273. package/dist/types/interface.d.ts +1 -1
  274. package/dist/types/utils/config.d.ts +2 -2
  275. package/dist/types/utils/gesture/gesture-controller.d.ts +1 -0
  276. package/dist/types/utils/overlays.d.ts +5 -2
  277. package/hydrate/index.js +1451 -1432
  278. package/package.json +2 -2
  279. package/components/ion-picker-column-internal.d.ts +0 -11
  280. package/components/ion-picker-column-internal.js +0 -9
  281. package/components/ion-picker-internal.js +0 -9
  282. package/components/picker-column-internal.js +0 -390
  283. package/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +0 -138
  284. package/dist/collection/components/picker-column-internal/picker-column-internal.js +0 -565
  285. package/dist/collection/components/picker-internal/picker-internal.js +0 -544
  286. package/dist/collection/components/picker-internal/test/basic/picker-internal.e2e.js +0 -118
  287. package/dist/esm-es5/ion-picker-column-internal.entry.js +0 -4
  288. package/dist/esm-es5/ion-picker-internal.entry.js +0 -4
  289. package/dist/esm-es5/overlays-6c9feb7e.js +0 -4
  290. package/dist/esm-es5/swipe-back-0f3bfc8e.js +0 -4
  291. package/dist/ionic/p-0d8e9393.entry.js +0 -4
  292. package/dist/ionic/p-18e01b30.system.entry.js +0 -4
  293. package/dist/ionic/p-19a7c660.system.entry.js +0 -4
  294. package/dist/ionic/p-1e5165db.system.entry.js +0 -4
  295. package/dist/ionic/p-29adc040.entry.js +0 -4
  296. package/dist/ionic/p-29fe18ef.entry.js +0 -4
  297. package/dist/ionic/p-431151f2.entry.js +0 -4
  298. package/dist/ionic/p-5bd4e009.entry.js +0 -4
  299. package/dist/ionic/p-64296b15.entry.js +0 -4
  300. package/dist/ionic/p-800ef057.js +0 -4
  301. package/dist/ionic/p-86b2394a.entry.js +0 -4
  302. package/dist/ionic/p-8dbdb163.system.js +0 -4
  303. package/dist/ionic/p-97e31c0a.system.js +0 -4
  304. package/dist/ionic/p-a9c3699b.system.entry.js +0 -4
  305. package/dist/ionic/p-b91fe549.entry.js +0 -4
  306. package/dist/ionic/p-beb64be7.system.entry.js +0 -4
  307. package/dist/ionic/p-c56b6570.system.entry.js +0 -4
  308. package/dist/ionic/p-c6be7737.system.entry.js +0 -4
  309. package/dist/ionic/p-c919498d.entry.js +0 -4
  310. package/dist/ionic/p-cf425ec5.system.entry.js +0 -4
  311. package/dist/ionic/p-ddfc4ef4.system.entry.js +0 -4
  312. package/dist/ionic/p-e6b240a0.js +0 -4
  313. package/dist/ionic/p-f54ddd19.entry.js +0 -4
  314. package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +0 -102
  315. package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +0 -8
  316. package/dist/types/components/picker-internal/picker-internal.d.ts +0 -102
  317. /package/dist/collection/components/{picker-internal/picker-internal-interfaces.js → picker/picker-interfaces.js} +0 -0
  318. /package/dist/collection/components/{picker-column-internal/picker-column-internal-interfaces.js → picker-column/picker-column-interfaces.js} +0 -0
  319. /package/dist/collection/components/{picker → picker-legacy}/animations/ios.enter.js +0 -0
  320. /package/dist/collection/components/{picker → picker-legacy}/animations/ios.leave.js +0 -0
  321. /package/dist/collection/components/{picker → picker-legacy}/picker-interface.js +0 -0
  322. /package/dist/collection/components/{picker-column → picker-legacy-column}/test/test.utils.js +0 -0
  323. /package/dist/esm-es5/{data-44d9e816.js → data-12e24f00.js} +0 -0
  324. /package/dist/esm-es5/{index-d1a56aed.js → index-c132c5f1.js} +0 -0
  325. /package/dist/ionic/{p-84c6dece.system.js → p-8050b9b9.system.js} +0 -0
  326. /package/dist/ionic/{p-17240d90.js → p-bb849ebb.js} +0 -0
  327. /package/dist/ionic/{p-b8c3f071.system.js → p-e4219e27.system.js} +0 -0
  328. /package/dist/ionic/{p-6e383534.js → p-ea96fa73.js} +0 -0
  329. /package/dist/types/components/{picker-column-internal/picker-column-internal-interfaces.d.ts → picker-column/picker-column-interfaces.d.ts} +0 -0
  330. /package/dist/types/components/{picker → picker-legacy}/animations/ios.enter.d.ts +0 -0
  331. /package/dist/types/components/{picker → picker-legacy}/animations/ios.leave.d.ts +0 -0
  332. /package/dist/types/components/{picker → picker-legacy}/picker-interface.d.ts +0 -0
  333. /package/dist/types/components/{picker-column → picker-legacy-column}/test/test.utils.d.ts +0 -0
@@ -2,345 +2,361 @@
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
4
  import { Host, h } from "@stencil/core";
5
- import { clamp } from "../../utils/helpers";
5
+ import { getElementRoot, raf } from "../../utils/helpers";
6
6
  import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from "../../utils/native/haptic";
7
- import { getClassMap } from "../../utils/theme";
7
+ import { isPlatform } from "../../utils/platform";
8
+ import { createColorClasses } from "../../utils/theme";
8
9
  import { getIonMode } from "../../global/ionic-global";
9
10
  /**
10
- * @internal
11
+ * @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
11
12
  */
12
- export class PickerColumnCmp {
13
+ export class PickerColumn {
13
14
  constructor() {
14
- this.optHeight = 0;
15
- this.rotateFactor = 0;
16
- this.scaleFactor = 1;
17
- this.velocity = 0;
18
- this.y = 0;
19
- this.noAnimate = true;
20
- // `colDidChange` is a flag that gets set when the column is changed
21
- // dynamically. When this flag is set, the column will refresh
22
- // after the component re-renders to incorporate the new column data.
23
- // This is necessary because `this.refresh` queries for the option elements,
24
- // so it needs to wait for the latest elements to be available in the DOM.
25
- // Ex: column is created with 3 options. User updates the column data
26
- // to have 5 options. The column will still think it only has 3 options.
27
- this.colDidChange = false;
28
- this.col = undefined;
29
- }
30
- colChanged() {
31
- this.colDidChange = true;
32
- }
33
- async connectedCallback() {
34
- let pickerRotateFactor = 0;
35
- let pickerScaleFactor = 0.81;
36
- const mode = getIonMode(this);
37
- if (mode === 'ios') {
38
- pickerRotateFactor = -0.46;
39
- pickerScaleFactor = 1;
40
- }
41
- this.rotateFactor = pickerRotateFactor;
42
- this.scaleFactor = pickerScaleFactor;
43
- this.gesture = (await import('../../utils/gesture')).createGesture({
44
- el: this.el,
45
- gestureName: 'picker-swipe',
46
- gesturePriority: 100,
47
- threshold: 0,
48
- passive: false,
49
- onStart: (ev) => this.onStart(ev),
50
- onMove: (ev) => this.onMove(ev),
51
- onEnd: (ev) => this.onEnd(ev),
52
- });
53
- this.gesture.enable();
54
- // Options have not been initialized yet
55
- // Animation must be disabled through the `noAnimate` flag
56
- // Otherwise, the options will render
57
- // at the top of the column and transition down
58
- this.tmrId = setTimeout(() => {
59
- this.noAnimate = false;
60
- // After initialization, `refresh()` will be called
61
- // At this point, animation will be enabled. The options will
62
- // animate as they are being selected.
63
- this.refresh(true);
64
- }, 250);
65
- }
66
- componentDidLoad() {
67
- this.onDomChange();
68
- }
69
- componentDidUpdate() {
70
- // Options may have changed since last update.
71
- if (this.colDidChange) {
72
- // Animation must be disabled through the `onDomChange` parameter.
73
- // Otherwise, the recently added options will render
74
- // at the top of the column and transition down
75
- this.onDomChange(true, false);
76
- this.colDidChange = false;
77
- }
78
- }
79
- disconnectedCallback() {
80
- if (this.rafId !== undefined)
81
- cancelAnimationFrame(this.rafId);
82
- if (this.tmrId)
83
- clearTimeout(this.tmrId);
84
- if (this.gesture) {
85
- this.gesture.destroy();
86
- this.gesture = undefined;
87
- }
88
- }
89
- emitColChange() {
90
- this.ionPickerColChange.emit(this.col);
91
- }
92
- setSelected(selectedIndex, duration) {
93
- // if there is a selected index, then figure out it's y position
94
- // if there isn't a selected index, then just use the top y position
95
- const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
96
- this.velocity = 0;
97
- // set what y position we're at
98
- if (this.rafId !== undefined)
99
- cancelAnimationFrame(this.rafId);
100
- this.update(y, duration, true);
101
- this.emitColChange();
102
- }
103
- update(y, duration, saveY) {
104
- if (!this.optsEl) {
105
- return;
106
- }
107
- // ensure we've got a good round number :)
108
- let translateY = 0;
109
- let translateZ = 0;
110
- const { col, rotateFactor } = this;
111
- const prevSelected = col.selectedIndex;
112
- const selectedIndex = (col.selectedIndex = this.indexForY(-y));
113
- const durationStr = duration === 0 ? '' : duration + 'ms';
114
- const scaleStr = `scale(${this.scaleFactor})`;
115
- const children = this.optsEl.children;
116
- for (let i = 0; i < children.length; i++) {
117
- const button = children[i];
118
- const opt = col.options[i];
119
- const optOffset = i * this.optHeight + y;
120
- let transform = '';
121
- if (rotateFactor !== 0) {
122
- const rotateX = optOffset * rotateFactor;
123
- if (Math.abs(rotateX) <= 90) {
124
- translateY = 0;
125
- translateZ = 90;
126
- transform = `rotateX(${rotateX}deg) `;
127
- }
128
- else {
129
- translateY = -9999;
15
+ this.isScrolling = false;
16
+ this.isColumnVisible = false;
17
+ this.canExitInputMode = true;
18
+ this.centerPickerItemInView = (target, smooth = true, canExitInputMode = true) => {
19
+ const { el, isColumnVisible } = this;
20
+ if (isColumnVisible) {
21
+ // (Vertical offset from parent) - (three empty picker rows) + (half the height of the target to ensure the scroll triggers)
22
+ const top = target.offsetTop - 3 * target.clientHeight + target.clientHeight / 2;
23
+ if (el.scrollTop !== top) {
24
+ /**
25
+ * Setting this flag prevents input
26
+ * mode from exiting in the picker column's
27
+ * scroll callback. This is useful when the user manually
28
+ * taps an item or types on the keyboard as both
29
+ * of these can cause a scroll to occur.
30
+ */
31
+ this.canExitInputMode = canExitInputMode;
32
+ el.scroll({
33
+ top,
34
+ left: 0,
35
+ behavior: smooth ? 'smooth' : undefined,
36
+ });
130
37
  }
131
38
  }
132
- else {
133
- translateZ = 0;
134
- translateY = optOffset;
135
- }
136
- const selected = selectedIndex === i;
137
- transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
138
- if (this.scaleFactor !== 1 && !selected) {
139
- transform += scaleStr;
140
- }
141
- // Update transition duration
142
- if (this.noAnimate) {
143
- opt.duration = 0;
144
- button.style.transitionDuration = '';
39
+ };
40
+ this.setPickerItemActiveState = (item, isActive) => {
41
+ if (isActive) {
42
+ item.classList.add(PICKER_ITEM_ACTIVE_CLASS);
43
+ item.part.add(PICKER_ITEM_ACTIVE_PART);
145
44
  }
146
- else if (duration !== opt.duration) {
147
- opt.duration = duration;
148
- button.style.transitionDuration = durationStr;
45
+ else {
46
+ item.classList.remove(PICKER_ITEM_ACTIVE_CLASS);
47
+ item.part.remove(PICKER_ITEM_ACTIVE_PART);
149
48
  }
150
- // Update transform
151
- if (transform !== opt.transform) {
152
- opt.transform = transform;
49
+ };
50
+ /**
51
+ * When ionInputModeChange is emitted, each column
52
+ * needs to check if it is the one being made available
53
+ * for text entry.
54
+ */
55
+ this.inputModeChange = (ev) => {
56
+ if (!this.numericInput) {
57
+ return;
153
58
  }
154
- button.style.transform = transform;
59
+ const { useInputMode, inputModeColumn } = ev.detail;
155
60
  /**
156
- * Ensure that the select column
157
- * item has the selected class
61
+ * If inputModeColumn is undefined then this means
62
+ * all numericInput columns are being selected.
158
63
  */
159
- opt.selected = selected;
160
- if (selected) {
161
- button.classList.add(PICKER_OPT_SELECTED);
162
- }
163
- else {
164
- button.classList.remove(PICKER_OPT_SELECTED);
165
- }
166
- }
167
- this.col.prevSelected = prevSelected;
168
- if (saveY) {
169
- this.y = y;
170
- }
171
- if (this.lastIndex !== selectedIndex) {
172
- // have not set a last index yet
173
- hapticSelectionChanged();
174
- this.lastIndex = selectedIndex;
175
- }
176
- }
177
- decelerate() {
178
- if (this.velocity !== 0) {
179
- // still decelerating
180
- this.velocity *= DECELERATION_FRICTION;
181
- // do not let it go slower than a velocity of 1
182
- this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
183
- let y = this.y + this.velocity;
184
- if (y > this.minY) {
185
- // whoops, it's trying to scroll up farther than the options we have!
186
- y = this.minY;
187
- this.velocity = 0;
64
+ const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
65
+ if (!useInputMode || !isColumnActive) {
66
+ this.setInputModeActive(false);
67
+ return;
188
68
  }
189
- else if (y < this.maxY) {
190
- // gahh, it's trying to scroll down farther than we can!
191
- y = this.maxY;
192
- this.velocity = 0;
193
- }
194
- this.update(y, 0, true);
195
- const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
196
- if (notLockedIn) {
197
- // isn't locked in yet, keep decelerating until it is
198
- this.rafId = requestAnimationFrame(() => this.decelerate());
199
- }
200
- else {
201
- this.velocity = 0;
202
- this.emitColChange();
203
- hapticSelectionEnd();
204
- }
205
- }
206
- else if (this.y % this.optHeight !== 0) {
207
- // needs to still get locked into a position so options line up
208
- const currentPos = Math.abs(this.y % this.optHeight);
209
- // create a velocity in the direction it needs to scroll
210
- this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
211
- this.decelerate();
212
- }
213
- }
214
- indexForY(y) {
215
- return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
216
- }
217
- onStart(detail) {
218
- // We have to prevent default in order to block scrolling under the picker
219
- // but we DO NOT have to stop propagation, since we still want
220
- // some "click" events to capture
221
- if (detail.event.cancelable) {
222
- detail.event.preventDefault();
223
- }
224
- detail.event.stopPropagation();
225
- hapticSelectionStart();
226
- // reset everything
227
- if (this.rafId !== undefined)
228
- cancelAnimationFrame(this.rafId);
229
- const options = this.col.options;
230
- let minY = options.length - 1;
231
- let maxY = 0;
232
- for (let i = 0; i < options.length; i++) {
233
- if (!options[i].disabled) {
234
- minY = Math.min(minY, i);
235
- maxY = Math.max(maxY, i);
69
+ this.setInputModeActive(true);
70
+ };
71
+ /**
72
+ * Setting isActive will cause a re-render.
73
+ * As a result, we do not want to cause the
74
+ * re-render mid scroll as this will cause
75
+ * the picker column to jump back to
76
+ * whatever value was selected at the
77
+ * start of the scroll interaction.
78
+ */
79
+ this.setInputModeActive = (state) => {
80
+ if (this.isScrolling) {
81
+ this.scrollEndCallback = () => {
82
+ this.isActive = state;
83
+ };
84
+ return;
236
85
  }
237
- }
238
- this.minY = -(minY * this.optHeight);
239
- this.maxY = -(maxY * this.optHeight);
86
+ this.isActive = state;
87
+ };
88
+ /**
89
+ * When the column scrolls, the component
90
+ * needs to determine which item is centered
91
+ * in the view and will emit an ionChange with
92
+ * the item object.
93
+ */
94
+ this.initializeScrollListener = () => {
95
+ /**
96
+ * The haptics for the wheel picker are
97
+ * an iOS-only feature. As a result, they should
98
+ * be disabled on Android.
99
+ */
100
+ const enableHaptics = isPlatform('ios');
101
+ const { el } = this;
102
+ let timeout;
103
+ let activeEl = this.activeItem;
104
+ const scrollCallback = () => {
105
+ raf(() => {
106
+ if (timeout) {
107
+ clearTimeout(timeout);
108
+ timeout = undefined;
109
+ }
110
+ if (!this.isScrolling) {
111
+ enableHaptics && hapticSelectionStart();
112
+ this.isScrolling = true;
113
+ }
114
+ /**
115
+ * Select item in the center of the column
116
+ * which is the month/year that we want to select
117
+ */
118
+ const bbox = el.getBoundingClientRect();
119
+ const centerX = bbox.x + bbox.width / 2;
120
+ const centerY = bbox.y + bbox.height / 2;
121
+ const activeElement = el.shadowRoot.elementFromPoint(centerX, centerY);
122
+ if (activeEl !== null) {
123
+ this.setPickerItemActiveState(activeEl, false);
124
+ }
125
+ if (activeElement === null || activeElement.disabled) {
126
+ return;
127
+ }
128
+ /**
129
+ * If we are selecting a new value,
130
+ * we need to run haptics again.
131
+ */
132
+ if (activeElement !== activeEl) {
133
+ enableHaptics && hapticSelectionChanged();
134
+ if (this.canExitInputMode) {
135
+ /**
136
+ * The native iOS wheel picker
137
+ * only dismisses the keyboard
138
+ * once the selected item has changed
139
+ * as a result of a swipe
140
+ * from the user. If `canExitInputMode` is
141
+ * `false` then this means that the
142
+ * scroll is happening as a result of
143
+ * the `value` property programmatically changing
144
+ * either by an application or by the user via the keyboard.
145
+ */
146
+ this.exitInputMode();
147
+ }
148
+ }
149
+ activeEl = activeElement;
150
+ this.setPickerItemActiveState(activeElement, true);
151
+ timeout = setTimeout(() => {
152
+ this.isScrolling = false;
153
+ enableHaptics && hapticSelectionEnd();
154
+ /**
155
+ * Certain tasks (such as those that
156
+ * cause re-renders) should only be done
157
+ * once scrolling has finished, otherwise
158
+ * flickering may occur.
159
+ */
160
+ const { scrollEndCallback } = this;
161
+ if (scrollEndCallback) {
162
+ scrollEndCallback();
163
+ this.scrollEndCallback = undefined;
164
+ }
165
+ /**
166
+ * Reset this flag as the
167
+ * next scroll interaction could
168
+ * be a scroll from the user. In this
169
+ * case, we should exit input mode.
170
+ */
171
+ this.canExitInputMode = true;
172
+ const dataIndex = activeElement.getAttribute('data-index');
173
+ /**
174
+ * If no value it is
175
+ * possible we hit one of the
176
+ * empty padding columns.
177
+ */
178
+ if (dataIndex === null) {
179
+ return;
180
+ }
181
+ const index = parseInt(dataIndex, 10);
182
+ const selectedItem = this.items[index];
183
+ if (selectedItem.value !== this.value) {
184
+ this.setValue(selectedItem.value);
185
+ }
186
+ }, 250);
187
+ });
188
+ };
189
+ /**
190
+ * Wrap this in an raf so that the scroll callback
191
+ * does not fire when component is initially shown.
192
+ */
193
+ raf(() => {
194
+ el.addEventListener('scroll', scrollCallback);
195
+ this.destroyScrollListener = () => {
196
+ el.removeEventListener('scroll', scrollCallback);
197
+ };
198
+ });
199
+ };
200
+ /**
201
+ * Tells the parent picker to
202
+ * exit text entry mode. This is only called
203
+ * when the selected item changes during scroll, so
204
+ * we know that the user likely wants to scroll
205
+ * instead of type.
206
+ */
207
+ this.exitInputMode = () => {
208
+ const { parentEl } = this;
209
+ if (parentEl == null)
210
+ return;
211
+ parentEl.exitInputMode();
212
+ /**
213
+ * setInputModeActive only takes
214
+ * effect once scrolling stops to avoid
215
+ * a component re-render while scrolling.
216
+ * However, we want the visual active
217
+ * indicator to go away immediately, so
218
+ * we call classList.remove here.
219
+ */
220
+ this.el.classList.remove('picker-column-active');
221
+ };
222
+ this.isActive = false;
223
+ this.disabled = false;
224
+ this.items = [];
225
+ this.value = undefined;
226
+ this.color = 'primary';
227
+ this.numericInput = false;
240
228
  }
241
- onMove(detail) {
242
- if (detail.event.cancelable) {
243
- detail.event.preventDefault();
244
- }
245
- detail.event.stopPropagation();
246
- // update the scroll position relative to pointer start position
247
- let y = this.y + detail.deltaY;
248
- if (y > this.minY) {
249
- // scrolling up higher than scroll area
250
- y = Math.pow(y, 0.8);
251
- this.bounceFrom = y;
252
- }
253
- else if (y < this.maxY) {
254
- // scrolling down below scroll area
255
- y += Math.pow(this.maxY - y, 0.9);
256
- this.bounceFrom = y;
257
- }
258
- else {
259
- this.bounceFrom = 0;
229
+ valueChange() {
230
+ if (this.isColumnVisible) {
231
+ /**
232
+ * Only scroll the active item into view when the picker column
233
+ * is actively visible to the user.
234
+ */
235
+ this.scrollActiveItemIntoView();
260
236
  }
261
- this.update(y, 0, false);
262
237
  }
263
- onEnd(detail) {
264
- if (this.bounceFrom > 0) {
265
- // bounce back up
266
- this.update(this.minY, 100, true);
267
- this.emitColChange();
268
- return;
269
- }
270
- else if (this.bounceFrom < 0) {
271
- // bounce back down
272
- this.update(this.maxY, 100, true);
273
- this.emitColChange();
274
- return;
275
- }
276
- this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
277
- if (this.velocity === 0 && detail.deltaY === 0) {
278
- const opt = detail.event.target.closest('.picker-opt');
279
- if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
280
- this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
281
- }
282
- }
283
- else {
284
- this.y += detail.deltaY;
285
- if (Math.abs(detail.velocityY) < 0.05) {
286
- const isScrollingUp = detail.deltaY > 0;
287
- const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
288
- if (isScrollingUp && optHeightFraction > 0.5) {
289
- this.velocity = Math.abs(this.velocity) * -1;
238
+ /**
239
+ * Only setup scroll listeners
240
+ * when the picker is visible, otherwise
241
+ * the container will have a scroll
242
+ * height of 0px.
243
+ */
244
+ componentWillLoad() {
245
+ const visibleCallback = (entries) => {
246
+ const ev = entries[0];
247
+ if (ev.isIntersecting) {
248
+ const { activeItem, el } = this;
249
+ this.isColumnVisible = true;
250
+ /**
251
+ * Because this initial call to scrollActiveItemIntoView has to fire before
252
+ * the scroll listener is set up, we need to manage the active class manually.
253
+ */
254
+ const oldActive = getElementRoot(el).querySelector(`.${PICKER_ITEM_ACTIVE_CLASS}`);
255
+ if (oldActive) {
256
+ this.setPickerItemActiveState(oldActive, false);
257
+ }
258
+ this.scrollActiveItemIntoView();
259
+ if (activeItem) {
260
+ this.setPickerItemActiveState(activeItem, true);
290
261
  }
291
- else if (!isScrollingUp && optHeightFraction <= 0.5) {
292
- this.velocity = Math.abs(this.velocity);
262
+ this.initializeScrollListener();
263
+ }
264
+ else {
265
+ this.isColumnVisible = false;
266
+ if (this.destroyScrollListener) {
267
+ this.destroyScrollListener();
268
+ this.destroyScrollListener = undefined;
293
269
  }
294
270
  }
295
- this.decelerate();
271
+ };
272
+ new IntersectionObserver(visibleCallback, { threshold: 0.001 }).observe(this.el);
273
+ const parentEl = (this.parentEl = this.el.closest('ion-picker'));
274
+ if (parentEl !== null) {
275
+ // TODO(FW-2832): type
276
+ parentEl.addEventListener('ionInputModeChange', (ev) => this.inputModeChange(ev));
296
277
  }
297
278
  }
298
- refresh(forceRefresh, animated) {
279
+ componentDidRender() {
299
280
  var _a;
300
- let min = this.col.options.length - 1;
301
- let max = 0;
302
- const options = this.col.options;
303
- for (let i = 0; i < options.length; i++) {
304
- if (!options[i].disabled) {
305
- min = Math.min(min, i);
306
- max = Math.max(max, i);
281
+ const { activeItem, items, isColumnVisible, value } = this;
282
+ if (isColumnVisible) {
283
+ if (activeItem) {
284
+ this.scrollActiveItemIntoView();
285
+ }
286
+ else if (((_a = items[0]) === null || _a === void 0 ? void 0 : _a.value) !== value) {
287
+ /**
288
+ * If the picker column does not have an active item and the current value
289
+ * does not match the first item in the picker column, that means
290
+ * the value is out of bounds. In this case, we assign the value to the
291
+ * first item to match the scroll position of the column.
292
+ *
293
+ */
294
+ this.setValue(items[0].value);
307
295
  }
308
296
  }
309
- /**
310
- * Only update selected value if column has a
311
- * velocity of 0. If it does not, then the
312
- * column is animating might land on
313
- * a value different than the value at
314
- * selectedIndex
315
- */
316
- if (this.velocity !== 0) {
317
- return;
318
- }
319
- const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
320
- if (this.col.prevSelected !== selectedIndex || forceRefresh) {
321
- const y = selectedIndex * this.optHeight * -1;
322
- const duration = animated ? TRANSITION_DURATION : 0;
323
- this.velocity = 0;
324
- this.update(y, duration, true);
297
+ }
298
+ /** @internal */
299
+ async scrollActiveItemIntoView() {
300
+ const activeEl = this.activeItem;
301
+ if (activeEl) {
302
+ this.centerPickerItemInView(activeEl, false, false);
325
303
  }
326
304
  }
327
- onDomChange(forceRefresh, animated) {
328
- const colEl = this.optsEl;
329
- if (colEl) {
330
- // DOM READ
331
- // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
332
- this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
305
+ /**
306
+ * Sets the value prop and fires the ionChange event.
307
+ * This is used when we need to fire ionChange from
308
+ * user-generated events that cannot be caught with normal
309
+ * input/change event listeners.
310
+ * @internal
311
+ */
312
+ async setValue(value) {
313
+ const { items } = this;
314
+ this.value = value;
315
+ const findItem = items.find((item) => item.value === value && item.disabled !== true);
316
+ if (findItem) {
317
+ this.ionChange.emit(findItem);
333
318
  }
334
- this.refresh(forceRefresh, animated);
319
+ }
320
+ get activeItem() {
321
+ // If the whole picker column is disabled, the current value should appear active
322
+ // If the current value item is specifically disabled, it should not appear active
323
+ const selector = `.picker-item[data-value="${this.value}"]${this.disabled ? '' : ':not([disabled])'}`;
324
+ return getElementRoot(this.el).querySelector(selector);
335
325
  }
336
326
  render() {
337
- const col = this.col;
327
+ const { items, color, disabled: pickerDisabled, isActive, numericInput } = this;
338
328
  const mode = getIonMode(this);
339
- return (h(Host, { 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: {
340
- 'max-width': this.col.columnWidth,
341
- } }, col.prefix && (h("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { 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", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
329
+ /**
330
+ * exportparts is needed so ion-datetime can expose the parts
331
+ * from two layers of shadow nesting. If this causes problems,
332
+ * the attribute can be moved to datetime.tsx and set on every
333
+ * instance of ion-picker-column there instead.
334
+ */
335
+ return (h(Host, { exportparts: `${PICKER_ITEM_PART}, ${PICKER_ITEM_ACTIVE_PART}`, disabled: pickerDisabled, tabindex: pickerDisabled ? null : 0, class: createColorClasses(color, {
336
+ [mode]: true,
337
+ ['picker-column-active']: isActive,
338
+ ['picker-column-numeric-input']: numericInput,
339
+ }) }, h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), items.map((item, index) => {
340
+ const isItemDisabled = pickerDisabled || item.disabled || false;
341
+ {
342
+ /*
343
+ Users should be able to tab
344
+ between multiple columns. As a result,
345
+ we set tabindex here so that tabbing switches
346
+ between columns instead of buttons. Users
347
+ can still use arrow keys on the keyboard to
348
+ navigate the column up and down.
349
+ */
350
+ }
351
+ return (h("button", { tabindex: "-1", class: {
352
+ 'picker-item': true,
353
+ }, "data-value": item.value, "data-index": index, onClick: (ev) => {
354
+ this.centerPickerItemInView(ev.target, true);
355
+ }, disabled: isItemDisabled, part: PICKER_ITEM_PART }, item.text));
356
+ }), h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0")));
342
357
  }
343
358
  static get is() { return "ion-picker-column"; }
359
+ static get encapsulation() { return "shadow"; }
344
360
  static get originalStyleUrls() {
345
361
  return {
346
362
  "ios": ["picker-column.ios.scss"],
@@ -355,65 +371,194 @@ export class PickerColumnCmp {
355
371
  }
356
372
  static get properties() {
357
373
  return {
358
- "col": {
374
+ "disabled": {
375
+ "type": "boolean",
376
+ "mutable": false,
377
+ "complexType": {
378
+ "original": "boolean",
379
+ "resolved": "boolean",
380
+ "references": {}
381
+ },
382
+ "required": false,
383
+ "optional": false,
384
+ "docs": {
385
+ "tags": [],
386
+ "text": "If `true`, the user cannot interact with the picker."
387
+ },
388
+ "attribute": "disabled",
389
+ "reflect": false,
390
+ "defaultValue": "false"
391
+ },
392
+ "items": {
359
393
  "type": "unknown",
360
394
  "mutable": false,
361
395
  "complexType": {
362
- "original": "PickerColumn",
363
- "resolved": "PickerColumn",
396
+ "original": "PickerColumnItem[]",
397
+ "resolved": "PickerColumnItem[]",
364
398
  "references": {
365
- "PickerColumn": {
399
+ "PickerColumnItem": {
366
400
  "location": "import",
367
- "path": "../picker/picker-interface",
368
- "id": "src/components/picker/picker-interface.ts::PickerColumn"
401
+ "path": "./picker-column-interfaces",
402
+ "id": "src/components/picker-column/picker-column-interfaces.ts::PickerColumnItem"
369
403
  }
370
404
  }
371
405
  },
372
- "required": true,
406
+ "required": false,
373
407
  "optional": false,
374
408
  "docs": {
375
409
  "tags": [],
376
- "text": "Picker column data"
377
- }
410
+ "text": "A list of options to be displayed in the picker"
411
+ },
412
+ "defaultValue": "[]"
413
+ },
414
+ "value": {
415
+ "type": "any",
416
+ "mutable": true,
417
+ "complexType": {
418
+ "original": "string | number",
419
+ "resolved": "number | string | undefined",
420
+ "references": {}
421
+ },
422
+ "required": false,
423
+ "optional": true,
424
+ "docs": {
425
+ "tags": [],
426
+ "text": "The selected option in the picker."
427
+ },
428
+ "attribute": "value",
429
+ "reflect": false
430
+ },
431
+ "color": {
432
+ "type": "string",
433
+ "mutable": false,
434
+ "complexType": {
435
+ "original": "Color",
436
+ "resolved": "\"danger\" | \"dark\" | \"light\" | \"medium\" | \"primary\" | \"secondary\" | \"success\" | \"tertiary\" | \"warning\" | string & Record<never, never> | undefined",
437
+ "references": {
438
+ "Color": {
439
+ "location": "import",
440
+ "path": "../../interface",
441
+ "id": "src/interface.d.ts::Color"
442
+ }
443
+ }
444
+ },
445
+ "required": false,
446
+ "optional": true,
447
+ "docs": {
448
+ "tags": [],
449
+ "text": "The color to use from your application's color palette.\nDefault options are: `\"primary\"`, `\"secondary\"`, `\"tertiary\"`, `\"success\"`, `\"warning\"`, `\"danger\"`, `\"light\"`, `\"medium\"`, and `\"dark\"`.\nFor more information on colors, see [theming](/docs/theming/basics)."
450
+ },
451
+ "attribute": "color",
452
+ "reflect": true,
453
+ "defaultValue": "'primary'"
454
+ },
455
+ "numericInput": {
456
+ "type": "boolean",
457
+ "mutable": false,
458
+ "complexType": {
459
+ "original": "boolean",
460
+ "resolved": "boolean",
461
+ "references": {}
462
+ },
463
+ "required": false,
464
+ "optional": false,
465
+ "docs": {
466
+ "tags": [{
467
+ "name": "internal",
468
+ "text": undefined
469
+ }],
470
+ "text": "If `true`, tapping the picker will\nreveal a number input keyboard that lets\nthe user type in values for each picker\ncolumn. This is useful when working\nwith time pickers."
471
+ },
472
+ "attribute": "numeric-input",
473
+ "reflect": false,
474
+ "defaultValue": "false"
378
475
  }
379
476
  };
380
477
  }
478
+ static get states() {
479
+ return {
480
+ "isActive": {}
481
+ };
482
+ }
381
483
  static get events() {
382
484
  return [{
383
- "method": "ionPickerColChange",
384
- "name": "ionPickerColChange",
485
+ "method": "ionChange",
486
+ "name": "ionChange",
385
487
  "bubbles": true,
386
488
  "cancelable": true,
387
489
  "composed": true,
388
490
  "docs": {
389
- "tags": [{
390
- "name": "internal",
391
- "text": undefined
392
- }],
393
- "text": "Emitted when the selected value has changed"
491
+ "tags": [],
492
+ "text": "Emitted when the value has changed."
394
493
  },
395
494
  "complexType": {
396
- "original": "PickerColumn",
397
- "resolved": "PickerColumn",
495
+ "original": "PickerColumnItem",
496
+ "resolved": "PickerColumnItem",
398
497
  "references": {
399
- "PickerColumn": {
498
+ "PickerColumnItem": {
400
499
  "location": "import",
401
- "path": "../picker/picker-interface",
402
- "id": "src/components/picker/picker-interface.ts::PickerColumn"
500
+ "path": "./picker-column-interfaces",
501
+ "id": "src/components/picker-column/picker-column-interfaces.ts::PickerColumnItem"
403
502
  }
404
503
  }
405
504
  }
406
505
  }];
407
506
  }
507
+ static get methods() {
508
+ return {
509
+ "scrollActiveItemIntoView": {
510
+ "complexType": {
511
+ "signature": "() => Promise<void>",
512
+ "parameters": [],
513
+ "references": {
514
+ "Promise": {
515
+ "location": "global",
516
+ "id": "global::Promise"
517
+ }
518
+ },
519
+ "return": "Promise<void>"
520
+ },
521
+ "docs": {
522
+ "text": "",
523
+ "tags": [{
524
+ "name": "internal",
525
+ "text": undefined
526
+ }]
527
+ }
528
+ },
529
+ "setValue": {
530
+ "complexType": {
531
+ "signature": "(value?: string | number) => Promise<void>",
532
+ "parameters": [{
533
+ "tags": [],
534
+ "text": ""
535
+ }],
536
+ "references": {
537
+ "Promise": {
538
+ "location": "global",
539
+ "id": "global::Promise"
540
+ }
541
+ },
542
+ "return": "Promise<void>"
543
+ },
544
+ "docs": {
545
+ "text": "Sets the value prop and fires the ionChange event.\nThis is used when we need to fire ionChange from\nuser-generated events that cannot be caught with normal\ninput/change event listeners.",
546
+ "tags": [{
547
+ "name": "internal",
548
+ "text": undefined
549
+ }]
550
+ }
551
+ }
552
+ };
553
+ }
408
554
  static get elementRef() { return "el"; }
409
555
  static get watchers() {
410
556
  return [{
411
- "propName": "col",
412
- "methodName": "colChanged"
557
+ "propName": "value",
558
+ "methodName": "valueChange"
413
559
  }];
414
560
  }
415
561
  }
416
- const PICKER_OPT_SELECTED = 'picker-opt-selected';
417
- const DECELERATION_FRICTION = 0.97;
418
- const MAX_PICKER_SPEED = 90;
419
- const TRANSITION_DURATION = 150;
562
+ const PICKER_ITEM_ACTIVE_CLASS = 'picker-item-active';
563
+ const PICKER_ITEM_PART = 'wheel-item';
564
+ const PICKER_ITEM_ACTIVE_PART = 'active';