@ionic/core 7.5.7-dev.11701201960.104b3a1f → 7.5.7-dev.11701203423.1b6a8829
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.
- package/components/backdrop.js +12 -0
- package/components/data.js +1 -1
- package/components/gesture-controller.js +1 -1
- package/components/icon.js +14 -23
- package/components/index7.js +1 -1
- package/components/ion-content.js +1 -1
- package/components/ion-datetime.js +61 -28
- package/components/ion-picker-column-internal.d.ts +11 -0
- package/components/ion-picker-column-internal.js +9 -0
- package/components/ion-picker-column.js +2 -2
- package/components/{ion-picker-legacy.d.ts → ion-picker-internal.d.ts} +4 -4
- package/components/ion-picker-internal.js +9 -0
- package/components/ion-picker.js +299 -1
- package/components/overlays.js +4 -11
- package/components/picker-column-internal.js +390 -0
- package/components/picker-column.js +320 -331
- package/components/{picker.js → picker-internal.js} +16 -16
- package/dist/cjs/{button-active-cd07b55b.js → button-active-af897e0e.js} +1 -1
- package/dist/cjs/{data-4845b494.js → data-c8d21093.js} +1 -1
- package/dist/cjs/{gesture-controller-d6a3f907.js → gesture-controller-b46721be.js} +0 -1
- package/dist/cjs/{index-0f8b33f8.js → index-0ee995e4.js} +1 -1
- package/dist/cjs/{index-09471526.js → index-5ea49600.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -4
- package/dist/cjs/ion-alert.cjs.entry.js +4 -4
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-back-button.cjs.entry.js +1 -1
- package/dist/cjs/ion-backdrop.cjs.entry.js +12 -0
- package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-button_2.cjs.entry.js +14 -23
- package/dist/cjs/ion-datetime-button.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +40 -27
- package/dist/cjs/ion-fab_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +1 -1
- package/dist/cjs/ion-item-option_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-item_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -2
- package/dist/cjs/ion-menu_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-modal.cjs.entry.js +3 -3
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/{ion-picker-column.cjs.entry.js → ion-picker-column-internal.cjs.entry.js} +9 -9
- package/dist/cjs/{ion-picker.cjs.entry.js → ion-picker-internal.cjs.entry.js} +13 -13
- package/dist/cjs/ion-popover.cjs.entry.js +1 -2
- package/dist/cjs/ion-range.cjs.entry.js +1 -1
- package/dist/cjs/ion-refresher_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-searchbar.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +2 -3
- package/dist/cjs/ion-toast.cjs.entry.js +1 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-dbb71984.js → overlays-2ffc5f27.js} +4 -11
- package/dist/cjs/{swipe-back-a6dc6e5d.js → swipe-back-d0412fb6.js} +2 -2
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/backdrop/backdrop.js +12 -0
- package/dist/collection/components/content/content.css +4 -0
- package/dist/collection/components/datetime/datetime.ios.css +25 -84
- package/dist/collection/components/datetime/datetime.js +29 -14
- package/dist/collection/components/datetime/datetime.md.css +25 -89
- package/dist/collection/components/datetime/test/a11y/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/a11y/datetime.spec.js +9 -6
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +0 -10
- package/dist/collection/components/datetime/test/disabled/datetime.spec.js +4 -4
- package/dist/collection/components/datetime/test/minmax/datetime.e2e.js +5 -5
- package/dist/collection/components/datetime/test/month-year-picker/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +1 -1
- package/dist/collection/components/datetime/test/readonly/datetime.e2e.js +2 -2
- package/dist/collection/components/datetime/test/values/datetime.e2e.js +5 -5
- package/dist/collection/components/datetime/utils/data.js +1 -1
- package/dist/collection/components/picker/picker.ios.css +205 -100
- package/dist/collection/components/picker/picker.js +735 -463
- package/dist/collection/components/picker/picker.md.css +194 -98
- package/dist/collection/components/picker/test/basic/picker.e2e.js +13 -106
- package/dist/collection/components/{picker-legacy → picker}/test/is-open/picker.e2e.js +4 -4
- package/dist/collection/components/{picker-legacy → picker}/test/picker-id.spec.js +5 -5
- package/dist/collection/components/{picker-legacy → picker}/test/trigger/picker.e2e.js +1 -1
- package/dist/collection/components/picker-column/picker-column.ios.css +176 -59
- package/dist/collection/components/picker-column/picker-column.js +333 -478
- package/dist/collection/components/picker-column/picker-column.md.css +113 -63
- package/dist/collection/components/{picker-legacy-column → picker-column}/test/picker-column-aria.spec.js +3 -3
- package/dist/collection/components/{picker-legacy-column → picker-column}/test/picker-column-dynamic.spec.js +2 -2
- package/dist/collection/components/{picker-legacy-column → picker-column}/test/picker-column.spec.js +2 -2
- package/dist/collection/components/{picker-legacy-column → picker-column}/test/standalone/picker-column.e2e.js +3 -3
- package/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +138 -0
- package/dist/collection/components/picker-column-internal/picker-column-internal.js +565 -0
- package/dist/collection/components/{picker-legacy-column/picker-column.md.css → picker-column-internal/picker-column-internal.md.css} +63 -113
- package/dist/collection/components/{picker-column/test/basic/picker-column.e2e.js → picker-column-internal/test/basic/picker-column-internal.e2e.js} +7 -7
- package/dist/collection/components/{picker-column/test/disabled/picker-column.e2e.js → picker-column-internal/test/disabled/picker-column-internal.e2e.js} +39 -39
- package/dist/collection/components/{picker-legacy/picker.md.css → picker-internal/picker-internal.ios.css} +100 -192
- package/dist/collection/components/picker-internal/picker-internal.js +544 -0
- package/dist/collection/components/{picker-legacy-column/picker-column.ios.css → picker-internal/picker-internal.md.css} +101 -98
- package/dist/collection/components/{picker/test/a11y/picker.e2e.js → picker-internal/test/a11y/picker-internal.e2e.js} +2 -2
- package/dist/collection/components/picker-internal/test/basic/picker-internal.e2e.js +118 -0
- package/dist/collection/components/{picker/test/keyboard-entry/picker.e2e.js → picker-internal/test/keyboard-entry/picker-internal.e2e.js} +20 -20
- package/dist/collection/utils/gesture/gesture-controller.js +1 -1
- package/dist/collection/utils/overlays.js +4 -11
- package/dist/docs.json +40 -322
- package/dist/esm/{button-active-5b0516e7.js → button-active-ce5cba4c.js} +1 -1
- package/dist/esm/{data-12e24f00.js → data-44d9e816.js} +1 -1
- package/dist/esm/{gesture-controller-3723db7c.js → gesture-controller-0fa396c4.js} +1 -1
- package/dist/esm/{index-c132c5f1.js → index-d1a56aed.js} +1 -1
- package/dist/esm/{index-32cbee52.js → index-ff313b19.js} +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +4 -4
- package/dist/esm/ion-alert.entry.js +4 -4
- package/dist/esm/ion-app_8.entry.js +2 -2
- package/dist/esm/ion-back-button.entry.js +1 -1
- package/dist/esm/ion-backdrop.entry.js +12 -0
- package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ion-button_2.entry.js +14 -23
- package/dist/esm/ion-datetime-button.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +39 -26
- package/dist/esm/ion-fab_3.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +1 -1
- package/dist/esm/ion-item-option_3.entry.js +1 -1
- package/dist/esm/ion-item_8.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -2
- package/dist/esm/ion-menu_3.entry.js +4 -4
- package/dist/esm/ion-modal.entry.js +3 -3
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/{ion-picker-column.entry.js → ion-picker-column-internal.entry.js} +9 -9
- package/dist/esm/{ion-picker.entry.js → ion-picker-internal.entry.js} +13 -13
- package/dist/esm/ion-popover.entry.js +1 -2
- package/dist/esm/ion-range.entry.js +1 -1
- package/dist/esm/ion-refresher_2.entry.js +4 -4
- package/dist/esm/ion-reorder_2.entry.js +2 -2
- package/dist/esm/ion-searchbar.entry.js +1 -1
- package/dist/esm/ion-segment_2.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +2 -3
- package/dist/esm/ion-toast.entry.js +1 -2
- package/dist/esm/ion-toggle.entry.js +2 -2
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-789cd7a7.js → overlays-6c9feb7e.js} +4 -11
- package/dist/esm/{swipe-back-cc4c2bcb.js → swipe-back-0f3bfc8e.js} +2 -2
- package/dist/esm-es5/{button-active-5b0516e7.js → button-active-ce5cba4c.js} +1 -1
- package/dist/esm-es5/{gesture-controller-3723db7c.js → gesture-controller-0fa396c4.js} +1 -1
- package/dist/esm-es5/{index-32cbee52.js → index-ff313b19.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-back-button.entry.js +1 -1
- package/dist/esm-es5/ion-backdrop.entry.js +1 -1
- package/dist/esm-es5/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-fab_3.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-item-option_3.entry.js +1 -1
- package/dist/esm-es5/ion-item_8.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +4 -0
- package/dist/esm-es5/ion-picker-internal.entry.js +4 -0
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-searchbar.entry.js +1 -1
- package/dist/esm-es5/ion-segment_2.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/overlays-6c9feb7e.js +4 -0
- package/dist/esm-es5/swipe-back-0f3bfc8e.js +4 -0
- package/dist/html.html-data.json +1 -96
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-14aca3fb.entry.js → p-04dca48d.entry.js} +1 -1
- package/dist/ionic/{p-a8e68fd9.entry.js → p-0838e6bb.entry.js} +1 -1
- package/dist/ionic/{p-a57f223c.system.js → p-09d142b3.system.js} +1 -1
- package/dist/ionic/p-0d8e9393.entry.js +4 -0
- package/dist/ionic/{p-abacb44b.system.entry.js → p-14923cd7.system.entry.js} +1 -1
- package/dist/ionic/p-18e01b30.system.entry.js +4 -0
- package/dist/ionic/p-19a7c660.system.entry.js +4 -0
- package/dist/ionic/{p-9b5301cc.system.entry.js → p-1cb5f2f8.system.entry.js} +1 -1
- package/dist/ionic/p-1e5165db.system.entry.js +4 -0
- package/dist/ionic/p-29adc040.entry.js +4 -0
- package/dist/ionic/p-29fe18ef.entry.js +4 -0
- package/dist/ionic/{p-56224549.entry.js → p-3de79805.entry.js} +1 -1
- package/dist/ionic/p-40903d34.system.js +1 -1
- package/dist/ionic/{p-664d2b07.system.entry.js → p-42435018.system.entry.js} +1 -1
- package/dist/ionic/p-431151f2.entry.js +4 -0
- package/dist/ionic/{p-cb62e3fc.system.entry.js → p-4c80afe1.system.entry.js} +1 -1
- package/dist/ionic/{p-d3952bd5.system.entry.js → p-4d786d1f.system.entry.js} +1 -1
- package/dist/ionic/{p-b6a8588f.entry.js → p-4fa201a7.entry.js} +1 -1
- package/dist/ionic/{p-ee800093.entry.js → p-52360c7a.entry.js} +1 -1
- package/dist/ionic/p-5bd4e009.entry.js +4 -0
- package/dist/ionic/{p-b3e79338.system.entry.js → p-61c30156.system.entry.js} +1 -1
- package/dist/ionic/{p-f5a750e4.system.entry.js → p-640efee6.system.entry.js} +1 -1
- package/dist/ionic/p-64296b15.entry.js +4 -0
- package/dist/ionic/{p-5da0eb3e.system.entry.js → p-6594d76a.system.entry.js} +1 -1
- package/dist/ionic/{p-02d8fdba.system.entry.js → p-67e644bd.system.entry.js} +1 -1
- package/dist/ionic/{p-3f88eab8.system.entry.js → p-67ed452a.system.entry.js} +1 -1
- package/dist/ionic/{p-835e0346.entry.js → p-68166ba6.entry.js} +1 -1
- package/dist/ionic/{p-966cf574.system.entry.js → p-6d812360.system.entry.js} +1 -1
- package/dist/ionic/{p-a4cda7a8.system.entry.js → p-6e23777e.system.entry.js} +1 -1
- package/dist/ionic/{p-2ba9414e.entry.js → p-7176cea3.entry.js} +1 -1
- package/dist/ionic/{p-878c7aa5.system.entry.js → p-7b4cd5fc.system.entry.js} +1 -1
- package/dist/ionic/{p-4f3e2767.system.entry.js → p-7d7fdaf0.system.entry.js} +1 -1
- package/dist/ionic/p-800ef057.js +4 -0
- package/dist/ionic/{p-3fb57e1b.system.entry.js → p-8659f9a9.system.entry.js} +1 -1
- package/dist/ionic/p-86b2394a.entry.js +4 -0
- package/dist/ionic/{p-48d9faa7.entry.js → p-899fb2da.entry.js} +1 -1
- package/dist/ionic/{p-baa7cb1e.entry.js → p-8ad82eb3.entry.js} +1 -1
- package/dist/ionic/{p-a7e2ac5c.js → p-8b1be026.js} +1 -1
- package/dist/ionic/{p-a21b8d05.entry.js → p-8cbf0979.entry.js} +1 -1
- package/dist/ionic/{p-477a182e.entry.js → p-8d5a30dd.entry.js} +1 -1
- package/dist/ionic/p-8dbdb163.system.js +4 -0
- package/dist/ionic/{p-9e6bf9ed.entry.js → p-8e1bded3.entry.js} +1 -1
- package/dist/ionic/{p-5ce11143.entry.js → p-965677f1.entry.js} +1 -1
- package/dist/ionic/{p-f4cc91f6.entry.js → p-97a96f5f.entry.js} +1 -1
- package/dist/ionic/p-97e31c0a.system.js +4 -0
- package/dist/ionic/{p-6500b298.system.js → p-9e852ff1.system.js} +1 -1
- package/dist/ionic/{p-1e86a71b.entry.js → p-a43603ce.entry.js} +1 -1
- package/dist/ionic/{p-c7fd81ba.system.js → p-a936d224.system.js} +1 -1
- package/dist/ionic/p-a9c3699b.system.entry.js +4 -0
- package/dist/ionic/p-b91fe549.entry.js +4 -0
- package/dist/ionic/{p-c1229981.entry.js → p-bd76524d.entry.js} +1 -1
- package/dist/ionic/p-beb64be7.system.entry.js +4 -0
- package/dist/ionic/{p-07d9e9cd.system.entry.js → p-c429a314.system.entry.js} +1 -1
- package/dist/ionic/p-c56b6570.system.entry.js +4 -0
- package/dist/ionic/p-c6be7737.system.entry.js +4 -0
- package/dist/ionic/p-c919498d.entry.js +4 -0
- package/dist/ionic/{p-d21bfe66.system.entry.js → p-cd2808f5.system.entry.js} +1 -1
- package/dist/ionic/p-cf425ec5.system.entry.js +4 -0
- package/dist/ionic/{p-c31fc05f.system.entry.js → p-db5043df.system.entry.js} +1 -1
- package/dist/ionic/{p-22813b28.system.entry.js → p-dbf7d6e5.system.entry.js} +1 -1
- package/dist/ionic/p-ddfc4ef4.system.entry.js +4 -0
- package/dist/ionic/{p-dd837fa8.entry.js → p-deab76dc.entry.js} +1 -1
- package/dist/ionic/{p-100ef961.js → p-e0b06b65.js} +1 -1
- package/dist/ionic/{p-302091ab.js → p-e627ed84.js} +1 -1
- package/dist/ionic/p-e6b240a0.js +4 -0
- package/dist/ionic/{p-b6f8ee31.entry.js → p-ee2469c1.entry.js} +1 -1
- package/dist/ionic/{p-939d903b.entry.js → p-f37b4b79.entry.js} +1 -1
- package/dist/ionic/{p-06e6d235.system.entry.js → p-f3c82f74.system.entry.js} +2 -2
- package/dist/ionic/p-f54ddd19.entry.js +4 -0
- package/dist/ionic/{p-2e1794df.system.js → p-fa8d4788.system.js} +1 -1
- package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +1 -0
- package/dist/types/components/backdrop/backdrop.d.ts +3 -0
- package/dist/types/components/datetime/datetime.d.ts +1 -0
- package/dist/types/components/datetime/utils/data.d.ts +2 -2
- package/dist/types/components/menu/menu.d.ts +1 -1
- package/dist/types/components/picker/picker.d.ts +131 -74
- package/dist/types/components/picker-column/picker-column.d.ts +39 -94
- package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +102 -0
- package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +8 -0
- package/dist/types/components/picker-internal/picker-internal.d.ts +102 -0
- package/dist/types/components.d.ts +122 -122
- package/dist/types/interface.d.ts +1 -1
- package/dist/types/utils/config.d.ts +2 -2
- package/dist/types/utils/gesture/gesture-controller.d.ts +0 -1
- package/dist/types/utils/overlays.d.ts +2 -5
- package/hydrate/index.js +1083 -1067
- package/package.json +2 -2
- package/components/ion-picker-legacy-column.d.ts +0 -11
- package/components/ion-picker-legacy-column.js +0 -9
- package/components/ion-picker-legacy.js +0 -309
- package/components/picker-column2.js +0 -379
- package/dist/collection/components/picker-legacy/picker.ios.css +0 -367
- package/dist/collection/components/picker-legacy/picker.js +0 -817
- package/dist/collection/components/picker-legacy/test/basic/picker.e2e.js +0 -25
- package/dist/collection/components/picker-legacy-column/picker-column.js +0 -419
- package/dist/collection/utils/test/overlays/overlays-scroll-blocking.spec.js +0 -65
- package/dist/esm-es5/ion-picker-column.entry.js +0 -4
- package/dist/esm-es5/ion-picker.entry.js +0 -4
- package/dist/esm-es5/overlays-789cd7a7.js +0 -4
- package/dist/esm-es5/swipe-back-cc4c2bcb.js +0 -4
- package/dist/ionic/p-0c244faf.entry.js +0 -4
- package/dist/ionic/p-1dc91702.entry.js +0 -4
- package/dist/ionic/p-234b9617.system.entry.js +0 -4
- package/dist/ionic/p-25c34422.system.entry.js +0 -4
- package/dist/ionic/p-2804781b.entry.js +0 -4
- package/dist/ionic/p-2ad38423.system.entry.js +0 -4
- package/dist/ionic/p-39074595.entry.js +0 -4
- package/dist/ionic/p-439e20ef.entry.js +0 -4
- package/dist/ionic/p-6893f6e4.entry.js +0 -4
- package/dist/ionic/p-7c66a566.system.entry.js +0 -4
- package/dist/ionic/p-8b4ab236.entry.js +0 -4
- package/dist/ionic/p-9403b297.system.entry.js +0 -4
- package/dist/ionic/p-992d3bad.entry.js +0 -4
- package/dist/ionic/p-9c967a65.system.entry.js +0 -4
- package/dist/ionic/p-b4cbb736.js +0 -4
- package/dist/ionic/p-ba70d455.entry.js +0 -4
- package/dist/ionic/p-c32bf078.system.entry.js +0 -4
- package/dist/ionic/p-dc565ca3.js +0 -4
- package/dist/ionic/p-e88ed07f.system.js +0 -4
- package/dist/ionic/p-eb07ec1a.system.entry.js +0 -4
- package/dist/ionic/p-eb5697b5.system.js +0 -4
- package/dist/ionic/p-f0559c5d.system.entry.js +0 -4
- package/dist/ionic/p-fdd22426.entry.js +0 -4
- package/dist/types/components/picker/picker-interfaces.d.ts +0 -8
- package/dist/types/components/picker-legacy/picker.d.ts +0 -158
- package/dist/types/components/picker-legacy-column/picker-column.d.ts +0 -46
- /package/dist/collection/components/{picker-legacy → picker}/animations/ios.enter.js +0 -0
- /package/dist/collection/components/{picker-legacy → picker}/animations/ios.leave.js +0 -0
- /package/dist/collection/components/picker/{picker-interfaces.js → picker-interface.js} +0 -0
- /package/dist/collection/components/{picker-legacy-column → picker-column}/test/test.utils.js +0 -0
- /package/dist/collection/components/{picker-column/picker-column-interfaces.js → picker-column-internal/picker-column-internal-interfaces.js} +0 -0
- /package/dist/collection/components/{picker-legacy/picker-interface.js → picker-internal/picker-internal-interfaces.js} +0 -0
- /package/dist/esm-es5/{data-12e24f00.js → data-44d9e816.js} +0 -0
- /package/dist/esm-es5/{index-c132c5f1.js → index-d1a56aed.js} +0 -0
- /package/dist/ionic/{p-bb849ebb.js → p-17240d90.js} +0 -0
- /package/dist/ionic/{p-ea96fa73.js → p-6e383534.js} +0 -0
- /package/dist/ionic/{p-8050b9b9.system.js → p-84c6dece.system.js} +0 -0
- /package/dist/ionic/{p-e4219e27.system.js → p-b8c3f071.system.js} +0 -0
- /package/dist/types/components/{picker-legacy → picker}/animations/ios.enter.d.ts +0 -0
- /package/dist/types/components/{picker-legacy → picker}/animations/ios.leave.d.ts +0 -0
- /package/dist/types/components/{picker-legacy → picker}/picker-interface.d.ts +0 -0
- /package/dist/types/components/{picker-legacy-column → picker-column}/test/test.utils.d.ts +0 -0
- /package/dist/types/components/{picker-column/picker-column-interfaces.d.ts → picker-column-internal/picker-column-internal-interfaces.d.ts} +0 -0
|
@@ -2,361 +2,345 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h } from "@stencil/core";
|
|
5
|
-
import {
|
|
5
|
+
import { clamp } from "../../utils/helpers";
|
|
6
6
|
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from "../../utils/native/haptic";
|
|
7
|
-
import {
|
|
8
|
-
import { createColorClasses } from "../../utils/theme";
|
|
7
|
+
import { getClassMap } from "../../utils/theme";
|
|
9
8
|
import { getIonMode } from "../../global/ionic-global";
|
|
10
9
|
/**
|
|
11
|
-
* @
|
|
10
|
+
* @internal
|
|
12
11
|
*/
|
|
13
|
-
export class
|
|
12
|
+
export class PickerColumnCmp {
|
|
14
13
|
constructor() {
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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;
|
|
37
130
|
}
|
|
38
|
-
}
|
|
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);
|
|
44
131
|
}
|
|
45
132
|
else {
|
|
46
|
-
|
|
47
|
-
|
|
133
|
+
translateZ = 0;
|
|
134
|
+
translateY = optOffset;
|
|
48
135
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* for text entry.
|
|
54
|
-
*/
|
|
55
|
-
this.inputModeChange = (ev) => {
|
|
56
|
-
if (!this.numericInput) {
|
|
57
|
-
return;
|
|
136
|
+
const selected = selectedIndex === i;
|
|
137
|
+
transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
|
138
|
+
if (this.scaleFactor !== 1 && !selected) {
|
|
139
|
+
transform += scaleStr;
|
|
58
140
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
|
-
const isColumnActive = inputModeColumn === undefined || inputModeColumn === this.el;
|
|
65
|
-
if (!useInputMode || !isColumnActive) {
|
|
66
|
-
this.setInputModeActive(false);
|
|
67
|
-
return;
|
|
141
|
+
// Update transition duration
|
|
142
|
+
if (this.noAnimate) {
|
|
143
|
+
opt.duration = 0;
|
|
144
|
+
button.style.transitionDuration = '';
|
|
68
145
|
}
|
|
69
|
-
|
|
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;
|
|
146
|
+
else if (duration !== opt.duration) {
|
|
147
|
+
opt.duration = duration;
|
|
148
|
+
button.style.transitionDuration = durationStr;
|
|
85
149
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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;
|
|
228
|
-
}
|
|
229
|
-
valueChange() {
|
|
230
|
-
if (this.isColumnVisible) {
|
|
150
|
+
// Update transform
|
|
151
|
+
if (transform !== opt.transform) {
|
|
152
|
+
opt.transform = transform;
|
|
153
|
+
}
|
|
154
|
+
button.style.transform = transform;
|
|
231
155
|
/**
|
|
232
|
-
*
|
|
233
|
-
*
|
|
156
|
+
* Ensure that the select column
|
|
157
|
+
* item has the selected class
|
|
234
158
|
*/
|
|
235
|
-
|
|
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;
|
|
236
175
|
}
|
|
237
176
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
this.setPickerItemActiveState(activeItem, true);
|
|
261
|
-
}
|
|
262
|
-
this.initializeScrollListener();
|
|
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;
|
|
188
|
+
}
|
|
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());
|
|
263
199
|
}
|
|
264
200
|
else {
|
|
265
|
-
this.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.destroyScrollListener = undefined;
|
|
269
|
-
}
|
|
201
|
+
this.velocity = 0;
|
|
202
|
+
this.emitColChange();
|
|
203
|
+
hapticSelectionEnd();
|
|
270
204
|
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
//
|
|
276
|
-
|
|
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();
|
|
277
212
|
}
|
|
278
213
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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);
|
|
295
236
|
}
|
|
296
237
|
}
|
|
238
|
+
this.minY = -(minY * this.optHeight);
|
|
239
|
+
this.maxY = -(maxY * this.optHeight);
|
|
297
240
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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;
|
|
303
260
|
}
|
|
261
|
+
this.update(y, 0, false);
|
|
304
262
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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;
|
|
290
|
+
}
|
|
291
|
+
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
292
|
+
this.velocity = Math.abs(this.velocity);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
this.decelerate();
|
|
318
296
|
}
|
|
319
297
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
298
|
+
refresh(forceRefresh, animated) {
|
|
299
|
+
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);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
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);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
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;
|
|
333
|
+
}
|
|
334
|
+
this.refresh(forceRefresh, animated);
|
|
325
335
|
}
|
|
326
336
|
render() {
|
|
327
|
-
const
|
|
337
|
+
const col = this.col;
|
|
328
338
|
const mode = getIonMode(this);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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")));
|
|
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))));
|
|
357
342
|
}
|
|
358
343
|
static get is() { return "ion-picker-column"; }
|
|
359
|
-
static get encapsulation() { return "shadow"; }
|
|
360
344
|
static get originalStyleUrls() {
|
|
361
345
|
return {
|
|
362
346
|
"ios": ["picker-column.ios.scss"],
|
|
@@ -371,194 +355,65 @@ export class PickerColumn {
|
|
|
371
355
|
}
|
|
372
356
|
static get properties() {
|
|
373
357
|
return {
|
|
374
|
-
"
|
|
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": {
|
|
358
|
+
"col": {
|
|
393
359
|
"type": "unknown",
|
|
394
360
|
"mutable": false,
|
|
395
361
|
"complexType": {
|
|
396
|
-
"original": "
|
|
397
|
-
"resolved": "
|
|
362
|
+
"original": "PickerColumn",
|
|
363
|
+
"resolved": "PickerColumn",
|
|
398
364
|
"references": {
|
|
399
|
-
"
|
|
365
|
+
"PickerColumn": {
|
|
400
366
|
"location": "import",
|
|
401
|
-
"path": "
|
|
402
|
-
"id": "src/components/picker
|
|
367
|
+
"path": "../picker/picker-interface",
|
|
368
|
+
"id": "src/components/picker/picker-interface.ts::PickerColumn"
|
|
403
369
|
}
|
|
404
370
|
}
|
|
405
371
|
},
|
|
406
|
-
"required":
|
|
372
|
+
"required": true,
|
|
407
373
|
"optional": false,
|
|
408
374
|
"docs": {
|
|
409
375
|
"tags": [],
|
|
410
|
-
"text": "
|
|
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"
|
|
376
|
+
"text": "Picker column data"
|
|
377
|
+
}
|
|
475
378
|
}
|
|
476
379
|
};
|
|
477
380
|
}
|
|
478
|
-
static get states() {
|
|
479
|
-
return {
|
|
480
|
-
"isActive": {}
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
381
|
static get events() {
|
|
484
382
|
return [{
|
|
485
|
-
"method": "
|
|
486
|
-
"name": "
|
|
383
|
+
"method": "ionPickerColChange",
|
|
384
|
+
"name": "ionPickerColChange",
|
|
487
385
|
"bubbles": true,
|
|
488
386
|
"cancelable": true,
|
|
489
387
|
"composed": true,
|
|
490
388
|
"docs": {
|
|
491
|
-
"tags": [
|
|
492
|
-
|
|
389
|
+
"tags": [{
|
|
390
|
+
"name": "internal",
|
|
391
|
+
"text": undefined
|
|
392
|
+
}],
|
|
393
|
+
"text": "Emitted when the selected value has changed"
|
|
493
394
|
},
|
|
494
395
|
"complexType": {
|
|
495
|
-
"original": "
|
|
496
|
-
"resolved": "
|
|
396
|
+
"original": "PickerColumn",
|
|
397
|
+
"resolved": "PickerColumn",
|
|
497
398
|
"references": {
|
|
498
|
-
"
|
|
399
|
+
"PickerColumn": {
|
|
499
400
|
"location": "import",
|
|
500
|
-
"path": "
|
|
501
|
-
"id": "src/components/picker
|
|
401
|
+
"path": "../picker/picker-interface",
|
|
402
|
+
"id": "src/components/picker/picker-interface.ts::PickerColumn"
|
|
502
403
|
}
|
|
503
404
|
}
|
|
504
405
|
}
|
|
505
406
|
}];
|
|
506
407
|
}
|
|
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
|
-
}
|
|
554
408
|
static get elementRef() { return "el"; }
|
|
555
409
|
static get watchers() {
|
|
556
410
|
return [{
|
|
557
|
-
"propName": "
|
|
558
|
-
"methodName": "
|
|
411
|
+
"propName": "col",
|
|
412
|
+
"methodName": "colChanged"
|
|
559
413
|
}];
|
|
560
414
|
}
|
|
561
415
|
}
|
|
562
|
-
const
|
|
563
|
-
const
|
|
564
|
-
const
|
|
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;
|