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