@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
@@ -1,422 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { Host, h } from "@stencil/core";
5
- import { clamp } from "../../utils/helpers";
6
- import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from "../../utils/native/haptic";
7
- import { getClassMap } from "../../utils/theme";
8
- import { getIonMode } from "../../global/ionic-global";
9
- /**
10
- * @internal
11
- */
12
- export class PickerColumnCmp {
13
- 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
- }
29
- colChanged() {
30
- this.colDidChange = true;
31
- }
32
- async connectedCallback() {
33
- let pickerRotateFactor = 0;
34
- let pickerScaleFactor = 0.81;
35
- const mode = getIonMode(this);
36
- if (mode === 'ios') {
37
- pickerRotateFactor = -0.46;
38
- pickerScaleFactor = 1;
39
- }
40
- this.rotateFactor = pickerRotateFactor;
41
- this.scaleFactor = pickerScaleFactor;
42
- this.gesture = (await import('../../utils/gesture')).createGesture({
43
- el: this.el,
44
- gestureName: 'picker-swipe',
45
- gesturePriority: 100,
46
- threshold: 0,
47
- passive: false,
48
- onStart: (ev) => this.onStart(ev),
49
- onMove: (ev) => this.onMove(ev),
50
- onEnd: (ev) => this.onEnd(ev),
51
- });
52
- this.gesture.enable();
53
- // Options have not been initialized yet
54
- // Animation must be disabled through the `noAnimate` flag
55
- // Otherwise, the options will render
56
- // at the top of the column and transition down
57
- this.tmrId = setTimeout(() => {
58
- this.noAnimate = false;
59
- // After initialization, `refresh()` will be called
60
- // At this point, animation will be enabled. The options will
61
- // animate as they are being selected.
62
- this.refresh(true);
63
- }, 250);
64
- }
65
- componentDidLoad() {
66
- this.onDomChange();
67
- }
68
- componentDidUpdate() {
69
- // Options may have changed since last update.
70
- if (this.colDidChange) {
71
- // Animation must be disabled through the `onDomChange` parameter.
72
- // Otherwise, the recently added options will render
73
- // at the top of the column and transition down
74
- this.onDomChange(true, false);
75
- this.colDidChange = false;
76
- }
77
- }
78
- disconnectedCallback() {
79
- if (this.rafId !== undefined)
80
- cancelAnimationFrame(this.rafId);
81
- if (this.tmrId)
82
- clearTimeout(this.tmrId);
83
- if (this.gesture) {
84
- this.gesture.destroy();
85
- this.gesture = undefined;
86
- }
87
- }
88
- emitColChange() {
89
- this.ionPickerColChange.emit(this.col);
90
- }
91
- setSelected(selectedIndex, duration) {
92
- // if there is a selected index, then figure out it's y position
93
- // if there isn't a selected index, then just use the top y position
94
- const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
95
- this.velocity = 0;
96
- // set what y position we're at
97
- if (this.rafId !== undefined)
98
- cancelAnimationFrame(this.rafId);
99
- this.update(y, duration, true);
100
- this.emitColChange();
101
- }
102
- update(y, duration, saveY) {
103
- if (!this.optsEl) {
104
- return;
105
- }
106
- // ensure we've got a good round number :)
107
- let translateY = 0;
108
- let translateZ = 0;
109
- const { col, rotateFactor } = this;
110
- const prevSelected = col.selectedIndex;
111
- const selectedIndex = (col.selectedIndex = this.indexForY(-y));
112
- const durationStr = duration === 0 ? '' : duration + 'ms';
113
- const scaleStr = `scale(${this.scaleFactor})`;
114
- const children = this.optsEl.children;
115
- for (let i = 0; i < children.length; i++) {
116
- const button = children[i];
117
- const opt = col.options[i];
118
- const optOffset = i * this.optHeight + y;
119
- let transform = '';
120
- if (rotateFactor !== 0) {
121
- const rotateX = optOffset * rotateFactor;
122
- if (Math.abs(rotateX) <= 90) {
123
- translateY = 0;
124
- translateZ = 90;
125
- transform = `rotateX(${rotateX}deg) `;
126
- }
127
- else {
128
- translateY = -9999;
129
- }
130
- }
131
- else {
132
- translateZ = 0;
133
- translateY = optOffset;
134
- }
135
- const selected = selectedIndex === i;
136
- transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
137
- if (this.scaleFactor !== 1 && !selected) {
138
- transform += scaleStr;
139
- }
140
- // Update transition duration
141
- if (this.noAnimate) {
142
- opt.duration = 0;
143
- button.style.transitionDuration = '';
144
- }
145
- else if (duration !== opt.duration) {
146
- opt.duration = duration;
147
- button.style.transitionDuration = durationStr;
148
- }
149
- // Update transform
150
- if (transform !== opt.transform) {
151
- opt.transform = transform;
152
- }
153
- button.style.transform = transform;
154
- /**
155
- * Ensure that the select column
156
- * item has the selected class
157
- */
158
- opt.selected = selected;
159
- if (selected) {
160
- button.classList.add(PICKER_OPT_SELECTED);
161
- }
162
- else {
163
- button.classList.remove(PICKER_OPT_SELECTED);
164
- }
165
- }
166
- this.col.prevSelected = prevSelected;
167
- if (saveY) {
168
- this.y = y;
169
- }
170
- if (this.lastIndex !== selectedIndex) {
171
- // have not set a last index yet
172
- hapticSelectionChanged();
173
- this.lastIndex = selectedIndex;
174
- }
175
- }
176
- decelerate() {
177
- if (this.velocity !== 0) {
178
- // still decelerating
179
- this.velocity *= DECELERATION_FRICTION;
180
- // do not let it go slower than a velocity of 1
181
- this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
182
- let y = this.y + this.velocity;
183
- if (y > this.minY) {
184
- // whoops, it's trying to scroll up farther than the options we have!
185
- y = this.minY;
186
- this.velocity = 0;
187
- }
188
- else if (y < this.maxY) {
189
- // gahh, it's trying to scroll down farther than we can!
190
- y = this.maxY;
191
- this.velocity = 0;
192
- }
193
- this.update(y, 0, true);
194
- const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
195
- if (notLockedIn) {
196
- // isn't locked in yet, keep decelerating until it is
197
- this.rafId = requestAnimationFrame(() => this.decelerate());
198
- }
199
- else {
200
- this.velocity = 0;
201
- this.emitColChange();
202
- hapticSelectionEnd();
203
- }
204
- }
205
- else if (this.y % this.optHeight !== 0) {
206
- // needs to still get locked into a position so options line up
207
- const currentPos = Math.abs(this.y % this.optHeight);
208
- // create a velocity in the direction it needs to scroll
209
- this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
210
- this.decelerate();
211
- }
212
- }
213
- indexForY(y) {
214
- return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
215
- }
216
- onStart(detail) {
217
- // We have to prevent default in order to block scrolling under the picker
218
- // but we DO NOT have to stop propagation, since we still want
219
- // some "click" events to capture
220
- if (detail.event.cancelable) {
221
- detail.event.preventDefault();
222
- }
223
- detail.event.stopPropagation();
224
- hapticSelectionStart();
225
- // reset everything
226
- if (this.rafId !== undefined)
227
- cancelAnimationFrame(this.rafId);
228
- const options = this.col.options;
229
- let minY = options.length - 1;
230
- let maxY = 0;
231
- for (let i = 0; i < options.length; i++) {
232
- if (!options[i].disabled) {
233
- minY = Math.min(minY, i);
234
- maxY = Math.max(maxY, i);
235
- }
236
- }
237
- this.minY = -(minY * this.optHeight);
238
- this.maxY = -(maxY * this.optHeight);
239
- }
240
- onMove(detail) {
241
- if (detail.event.cancelable) {
242
- detail.event.preventDefault();
243
- }
244
- detail.event.stopPropagation();
245
- // update the scroll position relative to pointer start position
246
- let y = this.y + detail.deltaY;
247
- if (y > this.minY) {
248
- // scrolling up higher than scroll area
249
- y = Math.pow(y, 0.8);
250
- this.bounceFrom = y;
251
- }
252
- else if (y < this.maxY) {
253
- // scrolling down below scroll area
254
- y += Math.pow(this.maxY - y, 0.9);
255
- this.bounceFrom = y;
256
- }
257
- else {
258
- this.bounceFrom = 0;
259
- }
260
- this.update(y, 0, false);
261
- }
262
- onEnd(detail) {
263
- if (this.bounceFrom > 0) {
264
- // bounce back up
265
- this.update(this.minY, 100, true);
266
- this.emitColChange();
267
- return;
268
- }
269
- else if (this.bounceFrom < 0) {
270
- // bounce back down
271
- this.update(this.maxY, 100, true);
272
- this.emitColChange();
273
- return;
274
- }
275
- this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
276
- if (this.velocity === 0 && detail.deltaY === 0) {
277
- const opt = detail.event.target.closest('.picker-opt');
278
- if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
279
- this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
280
- }
281
- }
282
- else {
283
- this.y += detail.deltaY;
284
- if (Math.abs(detail.velocityY) < 0.05) {
285
- const isScrollingUp = detail.deltaY > 0;
286
- const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
287
- if (isScrollingUp && optHeightFraction > 0.5) {
288
- this.velocity = Math.abs(this.velocity) * -1;
289
- }
290
- else if (!isScrollingUp && optHeightFraction <= 0.5) {
291
- this.velocity = Math.abs(this.velocity);
292
- }
293
- }
294
- this.decelerate();
295
- }
296
- }
297
- refresh(forceRefresh, animated) {
298
- var _a;
299
- let min = this.col.options.length - 1;
300
- let max = 0;
301
- const options = this.col.options;
302
- for (let i = 0; i < options.length; i++) {
303
- if (!options[i].disabled) {
304
- min = Math.min(min, i);
305
- max = Math.max(max, i);
306
- }
307
- }
308
- /**
309
- * Only update selected value if column has a
310
- * velocity of 0. If it does not, then the
311
- * column is animating might land on
312
- * a value different than the value at
313
- * selectedIndex
314
- */
315
- if (this.velocity !== 0) {
316
- return;
317
- }
318
- const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
319
- if (this.col.prevSelected !== selectedIndex || forceRefresh) {
320
- const y = selectedIndex * this.optHeight * -1;
321
- const duration = animated ? TRANSITION_DURATION : 0;
322
- this.velocity = 0;
323
- this.update(y, duration, true);
324
- }
325
- }
326
- onDomChange(forceRefresh, animated) {
327
- const colEl = this.optsEl;
328
- if (colEl) {
329
- // DOM READ
330
- // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
331
- this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
332
- }
333
- this.refresh(forceRefresh, animated);
334
- }
335
- render() {
336
- const col = this.col;
337
- const mode = getIonMode(this);
338
- 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: {
339
- 'max-width': this.col.columnWidth,
340
- } }, 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))));
341
- }
342
- static get is() { return "ion-picker-legacy-column"; }
343
- static get originalStyleUrls() {
344
- return {
345
- "ios": ["picker-column.ios.scss"],
346
- "md": ["picker-column.md.scss"]
347
- };
348
- }
349
- static get styleUrls() {
350
- return {
351
- "ios": ["picker-column.ios.css"],
352
- "md": ["picker-column.md.css"]
353
- };
354
- }
355
- static get properties() {
356
- return {
357
- "col": {
358
- "type": "unknown",
359
- "mutable": false,
360
- "complexType": {
361
- "original": "PickerColumn",
362
- "resolved": "PickerColumn",
363
- "references": {
364
- "PickerColumn": {
365
- "location": "import",
366
- "path": "../picker-legacy/picker-interface",
367
- "id": "src/components/picker-legacy/picker-interface.ts::PickerColumn",
368
- "referenceLocation": "PickerColumn"
369
- }
370
- }
371
- },
372
- "required": true,
373
- "optional": false,
374
- "docs": {
375
- "tags": [],
376
- "text": "Picker column data"
377
- },
378
- "getter": false,
379
- "setter": false
380
- }
381
- };
382
- }
383
- static get events() {
384
- return [{
385
- "method": "ionPickerColChange",
386
- "name": "ionPickerColChange",
387
- "bubbles": true,
388
- "cancelable": true,
389
- "composed": true,
390
- "docs": {
391
- "tags": [{
392
- "name": "internal",
393
- "text": undefined
394
- }],
395
- "text": "Emitted when the selected value has changed"
396
- },
397
- "complexType": {
398
- "original": "PickerColumn",
399
- "resolved": "PickerColumn",
400
- "references": {
401
- "PickerColumn": {
402
- "location": "import",
403
- "path": "../picker-legacy/picker-interface",
404
- "id": "src/components/picker-legacy/picker-interface.ts::PickerColumn",
405
- "referenceLocation": "PickerColumn"
406
- }
407
- }
408
- }
409
- }];
410
- }
411
- static get elementRef() { return "el"; }
412
- static get watchers() {
413
- return [{
414
- "propName": "col",
415
- "methodName": "colChanged"
416
- }];
417
- }
418
- }
419
- const PICKER_OPT_SELECTED = 'picker-opt-selected';
420
- const DECELERATION_FRICTION = 0.97;
421
- const MAX_PICKER_SPEED = 90;
422
- const TRANSITION_DURATION = 150;
@@ -1,222 +0,0 @@
1
- /**
2
- * Convert a font size to a dynamic font size.
3
- * Fonts that participate in Dynamic Type should use
4
- * dynamic font sizes.
5
- * @param size - The initial font size including the unit (i.e. px or pt)
6
- * @param unit (optional) - The unit to convert to. Use this if you want to
7
- * convert to a unit other than $baselineUnit.
8
- */
9
- /**
10
- * Convert a font size to a dynamic font size but impose
11
- * a maximum font size.
12
- * @param size - The initial font size including the unit (i.e. px or pt)
13
- * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
14
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
15
- * convert to a unit other than $baselineUnit.
16
- */
17
- /**
18
- * Convert a font size to a dynamic font size but impose
19
- * a minimum font size.
20
- * @param size - The initial font size including the unit (i.e. px or pt)
21
- * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
22
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
23
- * convert to a unit other than $baselineUnit.
24
- */
25
- /**
26
- * Convert a font size to a dynamic font size but impose
27
- * maximum and minimum font sizes.
28
- * @param size - The initial font size including the unit (i.e. px or pt)
29
- * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
30
- * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
31
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
32
- * convert to a unit other than $baselineUnit.
33
- */
34
- /**
35
- * A heuristic that applies CSS to tablet
36
- * viewports.
37
- *
38
- * Usage:
39
- * @include tablet-viewport() {
40
- * :host {
41
- * background-color: green;
42
- * }
43
- * }
44
- */
45
- /**
46
- * A heuristic that applies CSS to mobile
47
- * viewports (i.e. phones, not tablets).
48
- *
49
- * Usage:
50
- * @include mobile-viewport() {
51
- * :host {
52
- * background-color: blue;
53
- * }
54
- * }
55
- */
56
- .picker-col {
57
- display: flex;
58
- position: relative;
59
- flex: 1;
60
- justify-content: center;
61
- height: 100%;
62
- box-sizing: content-box;
63
- contain: content;
64
- }
65
-
66
- .picker-opts {
67
- position: relative;
68
- flex: 1;
69
- max-width: 100%;
70
- }
71
-
72
- .picker-opt {
73
- top: 0;
74
- display: block;
75
- position: absolute;
76
- width: 100%;
77
- border: 0;
78
- text-align: center;
79
- text-overflow: ellipsis;
80
- white-space: nowrap;
81
- contain: strict;
82
- overflow: hidden;
83
- will-change: transform;
84
- }
85
- .picker-opt {
86
- inset-inline-start: 0;
87
- }
88
-
89
- .picker-opt.picker-opt-disabled {
90
- pointer-events: none;
91
- }
92
-
93
- .picker-opt-disabled {
94
- opacity: 0;
95
- }
96
-
97
- .picker-opts-left {
98
- justify-content: flex-start;
99
- }
100
-
101
- .picker-opts-right {
102
- justify-content: flex-end;
103
- }
104
-
105
- .picker-opt:active, .picker-opt:focus {
106
- outline: none;
107
- }
108
-
109
- .picker-prefix {
110
- position: relative;
111
- flex: 1;
112
- text-align: end;
113
- white-space: nowrap;
114
- }
115
-
116
- .picker-suffix {
117
- position: relative;
118
- flex: 1;
119
- text-align: start;
120
- white-space: nowrap;
121
- }
122
-
123
- /**
124
- * Convert a font size to a dynamic font size.
125
- * Fonts that participate in Dynamic Type should use
126
- * dynamic font sizes.
127
- * @param size - The initial font size including the unit (i.e. px or pt)
128
- * @param unit (optional) - The unit to convert to. Use this if you want to
129
- * convert to a unit other than $baselineUnit.
130
- */
131
- /**
132
- * Convert a font size to a dynamic font size but impose
133
- * a maximum font size.
134
- * @param size - The initial font size including the unit (i.e. px or pt)
135
- * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
136
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
137
- * convert to a unit other than $baselineUnit.
138
- */
139
- /**
140
- * Convert a font size to a dynamic font size but impose
141
- * a minimum font size.
142
- * @param size - The initial font size including the unit (i.e. px or pt)
143
- * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
144
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
145
- * convert to a unit other than $baselineUnit.
146
- */
147
- /**
148
- * Convert a font size to a dynamic font size but impose
149
- * maximum and minimum font sizes.
150
- * @param size - The initial font size including the unit (i.e. px or pt)
151
- * @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
152
- * @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
153
- * @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
154
- * convert to a unit other than $baselineUnit.
155
- */
156
- /**
157
- * A heuristic that applies CSS to tablet
158
- * viewports.
159
- *
160
- * Usage:
161
- * @include tablet-viewport() {
162
- * :host {
163
- * background-color: green;
164
- * }
165
- * }
166
- */
167
- /**
168
- * A heuristic that applies CSS to mobile
169
- * viewports (i.e. phones, not tablets).
170
- *
171
- * Usage:
172
- * @include mobile-viewport() {
173
- * :host {
174
- * background-color: blue;
175
- * }
176
- * }
177
- */
178
- .picker-col {
179
- -webkit-padding-start: 8px;
180
- padding-inline-start: 8px;
181
- -webkit-padding-end: 8px;
182
- padding-inline-end: 8px;
183
- padding-top: 0;
184
- padding-bottom: 0;
185
- transform-style: preserve-3d;
186
- }
187
-
188
- .picker-prefix,
189
- .picker-suffix,
190
- .picker-opts {
191
- top: 77px;
192
- transform-style: preserve-3d;
193
- color: inherit;
194
- font-size: 22px;
195
- line-height: 42px;
196
- pointer-events: none;
197
- }
198
-
199
- .picker-opt {
200
- margin-left: 0;
201
- margin-right: 0;
202
- margin-top: 0;
203
- margin-bottom: 0;
204
- padding-left: 0;
205
- padding-right: 0;
206
- padding-top: 0;
207
- padding-bottom: 0;
208
- height: 43px;
209
- transition-timing-function: ease-out;
210
- background: transparent;
211
- color: inherit;
212
- font-size: 22px;
213
- line-height: 42px;
214
- backface-visibility: hidden;
215
- pointer-events: auto;
216
- }
217
-
218
- .picker-prefix,
219
- .picker-suffix,
220
- .picker-opt.picker-opt-selected {
221
- color: var(--ion-color-primary, #0054e9);
222
- }
@@ -1,43 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { expect } from "@playwright/test";
5
- /**
6
- * Visual regression tests for picker-column.
7
- * @param page - The page to run the tests on.
8
- * @param screenshot - The screenshot function to generate unique screenshot names
9
- * @param buttonSelector - The selector for the button that opens the picker.
10
- * @param description - The description to amend to the screenshot names (typically 'single' or 'multiple').
11
- */
12
- export async function testPickerColumn(page, screenshot, buttonSelector, description) {
13
- const ionPickerDidPresentSpy = await page.spyOnEvent('ionPickerDidPresent');
14
- await page.click(buttonSelector);
15
- await ionPickerDidPresentSpy.next();
16
- await page.waitForChanges();
17
- await expect(page).toHaveScreenshot(screenshot(`picker-${description}-column-initial`));
18
- // TODO FW-3403
19
- /*
20
- const columns = page.locator('.picker-opt-selected');
21
- const spy = await page.spyOnEvent('ionPickerColChange');
22
-
23
- const screenshots = [];
24
-
25
- for (let i = 0; i < (await columns.count()); i++) {
26
- const column = columns.nth(i);
27
-
28
- await dragElementBy(column, page, 0, -100);
29
- await spy.next();
30
-
31
- await page.waitForChanges();
32
-
33
- screenshots.push({
34
- name: screenshot(`picker-${description}-column-diff-${i}`),
35
- screenshot: await page.screenshot(),
36
- });
37
- }
38
-
39
- for (const screenshot of screenshots) {
40
- expect(screenshot.screenshot).toMatchSnapshot(screenshot.name);
41
- }
42
- */
43
- }