voyager-ionic-core 8.8.12 → 9.0.1
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/index.js +1 -1
- package/components/ion-accordion-group.js +1 -1
- package/components/ion-accordion.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-app.js +1 -1
- package/components/ion-avatar.js +1 -1
- package/components/ion-back-button.js +1 -1
- package/components/ion-backdrop.js +1 -1
- package/components/ion-badge.js +1 -1
- package/components/ion-breadcrumb.js +1 -1
- package/components/ion-breadcrumbs.js +1 -1
- package/components/ion-button.js +1 -1
- package/components/ion-buttons.js +1 -1
- package/components/ion-card-content.js +1 -1
- package/components/ion-card-header.js +1 -1
- package/components/ion-card-subtitle.js +1 -1
- package/components/ion-card-title.js +1 -1
- package/components/ion-card.js +1 -1
- package/components/ion-checkbox.js +1 -1
- package/components/ion-chip.js +1 -1
- package/components/ion-col.js +1 -1
- package/components/ion-content.js +1 -1
- package/components/ion-datetime-button.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-fab-button.js +1 -1
- package/components/ion-fab-list.js +1 -1
- package/components/ion-fab.js +1 -1
- package/components/ion-footer.js +1 -1
- package/components/ion-grid.js +1 -1
- package/components/ion-header.js +1 -1
- package/components/ion-icon.js +1 -1
- package/components/ion-img.js +1 -1
- package/components/ion-infinite-scroll-content.js +1 -1
- package/components/ion-infinite-scroll.js +1 -1
- package/components/ion-input-otp.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-input.js +1 -1
- package/components/ion-item-divider.js +1 -1
- package/components/ion-item-group.js +1 -1
- package/components/ion-item-option.js +1 -1
- package/components/ion-item-options.js +1 -1
- package/components/ion-item-sliding.js +1 -1
- package/components/ion-item.js +1 -1
- package/components/ion-label.js +1 -1
- package/components/ion-list-header.js +1 -1
- package/components/ion-list.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu-toggle.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-nav-link.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-note.js +1 -1
- package/components/ion-picker-column-option.js +1 -1
- package/components/ion-picker-column.js +1 -1
- package/components/ion-picker.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-progress-bar.js +1 -1
- package/components/ion-radio-group.js +1 -1
- package/components/ion-radio.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-refresher-content.js +1 -1
- package/components/ion-refresher.js +1 -1
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-reorder.js +1 -1
- package/components/ion-ripple-effect.js +1 -1
- package/components/ion-route-redirect.js +1 -1
- package/components/ion-route.js +1 -1
- package/components/ion-router-link.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-router.js +1 -1
- package/components/ion-row.js +1 -1
- package/components/ion-searchbar.js +1 -1
- package/components/ion-segment-button.js +1 -1
- package/components/ion-segment-content.js +1 -1
- package/components/ion-segment-view.js +1 -1
- package/components/ion-segment.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-option.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-skeleton-text.js +1 -1
- package/components/ion-spinner.js +1 -1
- package/components/ion-split-pane.js +1 -1
- package/components/ion-tab-bar.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +1 -1
- package/components/ion-tabs.js +1 -1
- package/components/ion-text.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-thumbnail.js +1 -1
- package/components/ion-title.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/ion-toolbar.js +1 -1
- package/components/p-1sJ0ZDPe.js +4 -0
- package/components/p-5ldEpNdG.js +4 -0
- package/components/p-6ZLn6K5e.js +4 -0
- package/components/p-B4lxwJ8N.js +4 -0
- package/components/{p-rCa2eL0j.js → p-BF48Oc0v.js} +1 -1
- package/components/p-BJr2B5hZ.js +4 -0
- package/components/p-BMPN55of.js +4 -0
- package/components/p-BNBnVi_1.js +4 -0
- package/components/{p-C4t5ymfq.js → p-BQyuFxYc.js} +1 -1
- package/components/p-BSQPZ79H.js +4 -0
- package/components/p-BT9-hMMz.js +4 -0
- package/components/p-BWoa-cki.js +4 -0
- package/components/p-BYJRZKHa.js +4 -0
- package/components/p-B_gJaBk0.js +4 -0
- package/components/p-BgkOsq-d.js +4 -0
- package/components/p-BhamHSw3.js +4 -0
- package/components/p-Bi-it1EH.js +4 -0
- package/components/p-C-NbvXu4.js +4 -0
- package/components/p-C0493tbX.js +4 -0
- package/components/p-C09TXohi.js +4 -0
- package/components/p-C4VpVfrJ.js +4 -0
- package/components/p-CEW4RXZO.js +4 -0
- package/components/p-CG_zZq_I.js +4 -0
- package/components/{p-B9jFTlwE.js → p-CJgnoKcN.js} +1 -1
- package/components/p-CMRYD_yR.js +4 -0
- package/components/{p-lE_JGpHD.js → p-CNLioZ3B.js} +1 -1
- package/components/{p--JUspHvy.js → p-COO0eJOA.js} +1 -1
- package/components/p-CWAks_S_.js +4 -0
- package/{dist/ionic/p-KjNvRoEp.js → components/p-Cd1WaN-0.js} +1 -1
- package/components/p-CqbGBmqb.js +4 -0
- package/components/p-CrAKlX71.js +4 -0
- package/components/p-Cw6WocLJ.js +4 -0
- package/components/p-D0YpjgON.js +4 -0
- package/components/{p-BirPFsRD.js → p-D5w_FlVa.js} +1 -1
- package/components/p-D7-vHX0A.js +4 -0
- package/components/p-D7wDJdFn.js +4 -0
- package/components/p-DFLJvuRK.js +4 -0
- package/components/p-DGPjJNOU.js +4 -0
- package/components/p-DJR0R0e1.js +4 -0
- package/components/p-DL13ieTa.js +4 -0
- package/components/{p-DqLB8yFQ.js → p-DM1gJSMP.js} +1 -1
- package/components/p-DMBiAyOR.js +4 -0
- package/components/p-DWCzVL3Y.js +4 -0
- package/components/p-DZRZic9C.js +4 -0
- package/components/{p-DNQI6d-L.js → p-DhNuxvJH.js} +1 -1
- package/components/p-DiuOa1vw.js +4 -0
- package/components/p-Dj40C8gm.js +4 -0
- package/components/p-Djmz-ssp.js +4 -0
- package/components/p-DnBNYc7u.js +4 -0
- package/components/p-DngGb-NV.js +4 -0
- package/components/p-Dojwmvde.js +4 -0
- package/components/p-DwSXbQSz.js +4 -0
- package/components/p-DxhHlJln.js +4 -0
- package/components/{p-DqZAXv2t.js → p-GGbIHyEF.js} +1 -1
- package/components/{p-j5IxBIan.js → p-Hp8t4RMX.js} +1 -1
- package/components/p-M34T2gyX.js +4 -0
- package/components/p-TWw4e4sO.js +4 -0
- package/components/{p-Cfx4M1Bn.js → p-YjMkHuvH.js} +1 -1
- package/components/p-byZM6qHV.js +4 -0
- package/components/p-cEN43Ahr.js +4 -0
- package/components/p-qAXsfUff.js +4 -0
- package/dist/cjs/{animation-BJq0kcy2.js → animation-Kd1N7WTN.js} +4 -4
- package/dist/cjs/{app-globals-BlqrqKTN.js → app-globals-b1G4t26O.js} +1 -1
- package/dist/cjs/{button-active-0mPOKmV2.js → button-active-CQCFubJJ.js} +3 -3
- package/dist/cjs/config-CjUbvdPW.js +36 -0
- package/dist/cjs/dir-zwDPRE5K.js +30 -0
- package/dist/cjs/{data-DLTUw-KF.js → format-bHU8N1g5.js} +48 -562
- package/dist/cjs/{framework-delegate-BtICZDHr.js → framework-delegate-d-fWfeI6.js} +5 -7
- package/dist/cjs/{gesture-controller-dtqlP_q4.js → gesture-controller-CeJslptU.js} +1 -2
- package/dist/cjs/{haptic-ClPPQ_PS.js → haptic-Ch-X4gRx.js} +2 -3
- package/dist/cjs/{hardware-back-button-iUuF_76h.js → hardware-back-button-Bu4Dzw8l.js} +4 -4
- package/dist/cjs/{helpers-Cv23MFHM.js → helpers-7wzdhdeg.js} +15 -11
- package/dist/cjs/index-BbqUBe2T.js +429 -0
- package/dist/cjs/{index-D81eLYUM.js → index-C74Q3t6a.js} +3 -2
- package/dist/cjs/{index-BERfRao3.js → index-CQfEIyLK.js} +5 -5
- package/dist/cjs/{index-aC4x3Fk3.js → index-DFNrCX7M.js} +6 -7
- package/dist/cjs/{index-CAvQ7Tka.js → index-DRPqwSvU.js} +13 -30
- package/dist/cjs/{index-Ct7gcRif.js → index-DXoo08JC.js} +321 -26
- package/dist/cjs/{index-CIrkNXqJ.js → index-DtvKGwdh.js} +34 -2
- package/dist/cjs/{index-DqmRDbxg.js → index-wOmugbdg.js} +1 -1
- package/dist/cjs/index.cjs.js +19 -18
- package/dist/cjs/{input-shims-CFLg7uzj.js → input-shims-VJIiKBKv.js} +10 -11
- package/dist/cjs/input.utils-EHVE2RK_.js +35 -0
- package/dist/cjs/ion-accordion_2.cjs.entry.js +12 -12
- package/dist/cjs/ion-action-sheet.cjs.entry.js +92 -44
- package/dist/cjs/ion-alert.cjs.entry.js +144 -65
- package/dist/cjs/ion-app_8.cjs.entry.js +112 -40
- package/dist/cjs/ion-avatar_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-back-button.cjs.entry.js +6 -5
- package/dist/cjs/ion-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +8 -7
- package/dist/cjs/ion-button_2.cjs.entry.js +18 -10
- package/dist/cjs/ion-card_5.cjs.entry.js +6 -5
- package/dist/cjs/ion-checkbox.cjs.entry.js +25 -12
- package/dist/cjs/ion-chip.cjs.entry.js +3 -3
- package/dist/cjs/ion-col_3.cjs.entry.js +10 -6
- package/dist/cjs/ion-datetime-button.cjs.entry.js +29 -30
- package/dist/cjs/{ion-datetime_3.cjs.entry.js → ion-datetime.cjs.entry.js} +773 -796
- package/dist/cjs/ion-fab_3.cjs.entry.js +93 -14
- package/dist/cjs/ion-img.cjs.entry.js +7 -4
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +8 -6
- package/dist/cjs/ion-input-otp.cjs.entry.js +20 -29
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +9 -10
- package/dist/cjs/ion-input.cjs.entry.js +58 -70
- package/dist/cjs/ion-item-option_3.cjs.entry.js +21 -24
- package/dist/cjs/ion-item_8.cjs.entry.js +117 -33
- package/dist/cjs/ion-loading.cjs.entry.js +29 -15
- package/dist/cjs/ion-menu_3.cjs.entry.js +23 -24
- package/dist/cjs/ion-modal.cjs.entry.js +307 -159
- package/dist/cjs/ion-nav_2.cjs.entry.js +30 -138
- package/dist/cjs/ion-picker-column-option.cjs.entry.js +8 -13
- package/dist/cjs/ion-picker-column.cjs.entry.js +218 -62
- package/dist/cjs/ion-picker.cjs.entry.js +4 -4
- package/dist/cjs/ion-popover.cjs.entry.js +50 -30
- package/dist/cjs/ion-progress-bar.cjs.entry.js +6 -5
- package/dist/cjs/ion-radio_2.cjs.entry.js +24 -14
- package/dist/cjs/ion-range.cjs.entry.js +30 -25
- package/dist/cjs/ion-refresher_2.cjs.entry.js +61 -26
- package/dist/cjs/ion-reorder_2.cjs.entry.js +10 -9
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +3 -3
- package/dist/cjs/ion-route_4.cjs.entry.js +36 -30
- package/dist/cjs/ion-searchbar.cjs.entry.js +27 -22
- package/dist/cjs/ion-segment-content.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment-view.cjs.entry.js +5 -6
- package/dist/cjs/ion-segment_2.cjs.entry.js +30 -26
- package/dist/cjs/ion-select-modal.cjs.entry.js +93 -38
- package/dist/cjs/ion-select_3.cjs.entry.js +495 -125
- package/dist/cjs/ion-spinner.cjs.entry.js +5 -6
- package/dist/cjs/ion-split-pane.cjs.entry.js +4 -4
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +15 -12
- package/dist/cjs/ion-tab_2.cjs.entry.js +26 -19
- package/dist/cjs/ion-text.cjs.entry.js +5 -5
- package/dist/cjs/ion-textarea.cjs.entry.js +56 -65
- package/dist/cjs/ion-toast.cjs.entry.js +26 -21
- package/dist/cjs/ion-toggle.cjs.entry.js +36 -15
- package/dist/cjs/{ionic-global-B-cA6LkY.js → ionic-global-CYJNT-2P.js} +13 -8
- package/dist/cjs/ionic.cjs.js +5 -5
- package/dist/cjs/{ios.transition-BOSWOaiK.js → ios.transition-DYGiD6gM.js} +14 -17
- package/dist/cjs/item-multiple-inputs-Dv6qrMhm.js +38 -0
- package/dist/cjs/{keyboard-hHzlEQpk.js → keyboard-Cix5TVkD.js} +2 -2
- package/dist/cjs/{keyboard-UuAS4D_9.js → keyboard-cHxZlTyz.js} +2 -2
- package/dist/cjs/{keyboard-controller-GXBiBRKS.js → keyboard-controller-PtZoN2GS.js} +6 -6
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{md.transition-B8-wBZqt.js → md.transition-CrSkaoz6.js} +8 -8
- package/dist/cjs/overlay-control-label-D2sdL2O8.js +50 -0
- package/dist/cjs/{overlays-TbKsuC-K.js → overlays-BR21NUIG.js} +120 -57
- package/dist/cjs/select-option-render-CrbLc-1j.js +123 -0
- package/dist/cjs/slot-mutation-controller-D6IjSEIh.js +397 -0
- package/dist/cjs/{status-tap-BXX8H8_Y.js → status-tap-CNP5eD1R.js} +4 -3
- package/dist/cjs/{swipe-back-CCMaNiP2.js → swipe-back-CSIJQfu5.js} +5 -5
- package/dist/cjs/{theme-CeDs6Hcv.js → theme-Bw0rpaNN.js} +6 -1
- package/dist/collection/collection-manifest.json +7 -11
- package/dist/collection/components/accordion/accordion.js +5 -6
- package/dist/collection/components/accordion-group/accordion-group.js +2 -2
- package/dist/collection/components/action-sheet/action-sheet.ios.css +228 -2
- package/dist/collection/components/action-sheet/action-sheet.js +77 -31
- package/dist/collection/components/action-sheet/action-sheet.md.css +174 -2
- package/dist/collection/components/alert/alert.ios.css +279 -10
- package/dist/collection/components/alert/alert.js +127 -50
- package/dist/collection/components/alert/alert.md.css +268 -20
- package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/collection/components/button/button.js +11 -4
- package/dist/collection/components/card/card.js +1 -1
- package/dist/collection/components/checkbox/checkbox.ios.css +18 -0
- package/dist/collection/components/checkbox/checkbox.js +19 -8
- package/dist/collection/components/checkbox/checkbox.md.css +18 -0
- package/dist/collection/components/col/col.js +7 -3
- package/dist/collection/components/content/content.js +56 -6
- package/dist/collection/components/datetime/datetime.ios.css +42 -2
- package/dist/collection/components/datetime/datetime.js +193 -79
- package/dist/collection/components/datetime/datetime.md.css +42 -1
- package/dist/collection/components/datetime/utils/data.js +13 -14
- package/dist/collection/components/datetime/utils/format.js +21 -11
- package/dist/collection/components/datetime/utils/manipulation.js +8 -8
- package/dist/collection/components/datetime/utils/parse.js +10 -10
- package/dist/collection/components/datetime/utils/state.js +8 -2
- package/dist/collection/components/datetime/utils/validate.js +4 -5
- package/dist/collection/components/datetime-button/datetime-button.ios.css +5 -0
- package/dist/collection/components/datetime-button/datetime-button.js +21 -25
- package/dist/collection/components/datetime-button/datetime-button.md.css +5 -0
- package/dist/collection/components/fab-button/fab-button.js +114 -10
- package/dist/collection/components/footer/footer.js +1 -1
- package/dist/collection/components/header/header.js +2 -2
- package/dist/collection/components/img/img.js +6 -1
- package/dist/collection/components/input/input.ios.css +57 -26
- package/dist/collection/components/input/input.js +51 -64
- package/dist/collection/components/input/input.md.css +79 -43
- package/dist/collection/components/input-otp/input-otp.js +15 -24
- package/dist/collection/components/input-password-toggle/input-password-toggle.js +5 -6
- package/dist/collection/components/item/item.ios.css +11 -0
- package/dist/collection/components/item/item.js +99 -15
- package/dist/collection/components/item/item.md.css +11 -0
- package/dist/collection/components/item-divider/item-divider.js +2 -2
- package/dist/collection/components/item-group/item-group.js +1 -1
- package/dist/collection/components/item-option/item-option.js +2 -2
- package/dist/collection/components/item-options/item-options.js +1 -1
- package/dist/collection/components/item-sliding/item-sliding.js +12 -16
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/list/list.js +2 -2
- package/dist/collection/components/list-header/list-header.js +2 -2
- package/dist/collection/components/loading/loading.js +17 -5
- package/dist/collection/components/menu/menu.js +6 -8
- package/dist/collection/components/menu-button/menu-button.js +2 -2
- package/dist/collection/components/menu-toggle/menu-toggle.js +2 -2
- package/dist/collection/components/modal/animations/ios.enter.js +1 -1
- package/dist/collection/components/modal/animations/md.enter.js +1 -1
- package/dist/collection/components/modal/gestures/sheet.js +47 -32
- package/dist/collection/components/modal/gestures/swipe-to-close.js +23 -33
- package/dist/collection/components/modal/gestures/utils.js +17 -0
- package/dist/collection/components/modal/modal.ios.css +8 -0
- package/dist/collection/components/modal/modal.js +158 -65
- package/dist/collection/components/modal/modal.md.css +8 -0
- package/dist/collection/components/modal/safe-area-utils.js +39 -5
- package/dist/collection/components/nav/nav.js +24 -235
- package/dist/collection/components/nav-link/nav-link.js +1 -1
- package/dist/collection/components/note/note.js +2 -2
- package/dist/collection/components/picker/picker.js +1 -2
- package/dist/collection/components/picker-column/picker-column.css +3 -0
- package/dist/collection/components/picker-column/picker-column.js +212 -58
- package/dist/collection/components/picker-column-option/picker-column-option.js +3 -10
- package/dist/collection/components/picker-column-option/picker-column-option.md.css +6 -1
- package/dist/collection/components/popover/animations/ios.enter.js +1 -2
- package/dist/collection/components/popover/animations/md.enter.js +1 -2
- package/dist/collection/components/popover/popover.ios.css +15 -0
- package/dist/collection/components/popover/popover.js +32 -9
- package/dist/collection/components/popover/popover.md.css +15 -0
- package/dist/collection/components/popover/utils.js +4 -6
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio/radio.ios.css +11 -15
- package/dist/collection/components/radio/radio.js +17 -9
- package/dist/collection/components/radio/radio.md.css +11 -11
- package/dist/collection/components/radio-group/radio-group.js +2 -2
- package/dist/collection/components/range/range.js +24 -19
- package/dist/collection/components/refresher/refresher.js +49 -16
- package/dist/collection/components/refresher-content/refresher-content.js +1 -1
- package/dist/collection/components/reorder/reorder.js +1 -1
- package/dist/collection/components/reorder-group/reorder-group.js +1 -1
- package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
- package/dist/collection/components/route/route.js +1 -1
- package/dist/collection/components/router/router.js +2 -6
- package/dist/collection/components/router/utils/dom.js +25 -7
- package/dist/collection/components/router/utils/matching.js +6 -9
- package/dist/collection/components/router/utils/parser.js +1 -1
- package/dist/collection/components/router/utils/path.js +0 -1
- package/dist/collection/components/router-link/router-link.js +2 -2
- package/dist/collection/components/router-outlet/router-outlet.js +49 -10
- package/dist/collection/components/row/row.js +1 -1
- package/dist/collection/components/searchbar/searchbar.js +25 -20
- package/dist/collection/components/segment/segment.js +9 -11
- package/dist/collection/components/segment-button/segment-button.js +15 -9
- package/dist/collection/components/segment-content/segment-content.js +1 -1
- package/dist/collection/components/segment-view/segment-view.js +3 -4
- package/dist/collection/components/select/select.ios.css +96 -69
- package/dist/collection/components/select/select.js +405 -91
- package/dist/collection/components/select/select.md.css +118 -85
- package/dist/collection/components/select-modal/select-modal.ios.css +218 -0
- package/dist/collection/components/select-modal/select-modal.js +80 -27
- package/dist/collection/components/select-modal/select-modal.md.css +164 -0
- package/dist/collection/components/select-option/select-option.js +67 -3
- package/dist/collection/components/select-popover/select-popover.ios.css +218 -0
- package/dist/collection/components/select-popover/select-popover.js +78 -26
- package/dist/collection/components/select-popover/select-popover.md.css +164 -0
- package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
- package/dist/collection/components/spinner/spinner.js +2 -3
- package/dist/collection/components/split-pane/split-pane.js +2 -2
- package/dist/collection/components/tab/tab.js +20 -13
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-button/tab-button.js +6 -4
- package/dist/collection/components/tabs/tabs.js +2 -3
- package/dist/collection/components/text/text.js +2 -2
- package/dist/collection/components/textarea/textarea.ios.css +94 -62
- package/dist/collection/components/textarea/textarea.js +47 -57
- package/dist/collection/components/textarea/textarea.md.css +103 -77
- package/dist/collection/components/thumbnail/thumbnail.js +1 -1
- package/dist/collection/components/title/title.js +2 -2
- package/dist/collection/components/toast/toast.js +12 -9
- package/dist/collection/components/toggle/toggle.ios.css +12 -4
- package/dist/collection/components/toggle/toggle.js +27 -7
- package/dist/collection/components/toggle/toggle.md.css +42 -5
- package/dist/collection/components/toolbar/toolbar.js +7 -4
- package/dist/collection/global/config.js +3 -3
- package/dist/collection/global/ionic-global.js +8 -2
- package/dist/collection/index.js +1 -1
- package/dist/collection/utils/animation/animation.js +3 -3
- package/dist/collection/utils/config.js +5 -4
- package/dist/collection/utils/content/index.js +30 -0
- package/dist/collection/utils/focus-controller/index.js +1 -1
- package/dist/collection/utils/focus-trap.js +3 -3
- package/dist/collection/utils/forms/index.js +2 -0
- package/dist/collection/utils/forms/item-multiple-inputs.js +33 -0
- package/dist/collection/utils/forms/start-container-controller.js +132 -0
- package/dist/collection/utils/framework-delegate.js +4 -6
- package/dist/collection/utils/gesture/gesture-controller.js +1 -2
- package/dist/collection/utils/gesture/index.js +10 -2
- package/dist/collection/utils/gesture/listener.js +4 -27
- package/dist/collection/utils/hardware-back-button.js +3 -3
- package/dist/collection/utils/helpers.js +14 -10
- package/dist/collection/utils/input-shims/hacks/scroll-assist.js +4 -5
- package/dist/collection/utils/input-shims/hacks/scroll-data.js +1 -2
- package/dist/collection/utils/keyboard/keyboard-controller.js +5 -5
- package/dist/collection/utils/keyboard/keyboard.js +1 -1
- package/dist/collection/utils/logging/index.js +23 -4
- package/dist/collection/utils/menu-controller/index.js +1 -2
- package/dist/collection/utils/native/haptic.js +2 -3
- package/dist/collection/utils/native/keyboard.js +2 -2
- package/dist/collection/utils/native/status-bar.js +1 -1
- package/dist/collection/utils/overlay-control-label.js +45 -0
- package/dist/collection/utils/overlays.js +109 -47
- package/dist/collection/utils/platform.js +4 -5
- package/dist/collection/utils/rtl/dir.js +17 -7
- package/dist/collection/utils/sanitization/index.js +275 -20
- package/dist/collection/utils/select-option-render.js +118 -0
- package/dist/collection/utils/slot-mutation-controller.js +1 -2
- package/dist/collection/utils/test/late-props/late-props.js +69 -0
- package/dist/collection/utils/test/playwright/apply-keyboard-focus.js +25 -0
- package/dist/collection/utils/test/playwright/detach-reattach.js +23 -0
- package/dist/collection/utils/test/playwright/drag-element.js +14 -0
- package/dist/collection/utils/test/playwright/generator.js +3 -4
- package/dist/collection/utils/test/playwright/index.js +2 -0
- package/dist/collection/utils/test/playwright/page/event-spy.js +2 -4
- package/dist/collection/utils/test/playwright/page/utils/goto.js +4 -5
- package/dist/collection/utils/test/playwright/page/utils/set-content.js +1 -1
- package/dist/collection/utils/test/playwright/page/utils/set-ion-viewport.js +2 -3
- package/dist/collection/utils/test/press-keys.js +6 -16
- package/dist/collection/utils/theme.js +6 -1
- package/dist/collection/utils/transition/ios.transition.js +9 -13
- package/dist/collection/utils/transition/md.transition.js +3 -4
- package/dist/docs.json +972 -1402
- package/dist/esm/{animation-DLJpuoEz.js → animation-BFNVlYum.js} +4 -4
- package/dist/esm/{app-globals-D0C5S4hU.js → app-globals-BgX0BGL1.js} +1 -1
- package/dist/esm/{button-active-BSpTQmS9.js → button-active-BfOvDr3b.js} +3 -3
- package/dist/esm/config-DWCzVL3Y.js +32 -0
- package/dist/esm/dir-Dojwmvde.js +28 -0
- package/dist/esm/{data-DZI70dKr.js → format-DDFE9jM5.js} +41 -554
- package/dist/esm/{framework-delegate-FnPGymXL.js → framework-delegate-BwNhx9NR.js} +5 -7
- package/dist/esm/{gesture-controller-BTEOs1at.js → gesture-controller-B_gJaBk0.js} +1 -2
- package/dist/esm/{haptic-DzAMWJuk.js → haptic-Cq4UAeka.js} +2 -3
- package/dist/esm/{hardware-back-button-B93Gru0Y.js → hardware-back-button-DmkiRgOT.js} +4 -4
- package/dist/esm/{helpers-HEqiOzXb.js → helpers-BSmc0nst.js} +15 -11
- package/dist/esm/{index-CfgBF1SE.js → index-BmLuEdV7.js} +13 -30
- package/dist/esm/{index-Q6UPU0Ay.js → index-BuPaALjU.js} +6 -7
- package/dist/esm/{index-DV3sJJW8.js → index-BvabGprD.js} +2 -2
- package/dist/esm/{index-MEDq2S8l.js → index-C1b9CLFg.js} +33 -3
- package/dist/esm/{index-tcQvqkiX.js → index-C23AVPx9.js} +303 -26
- package/dist/esm/{index-BRHzoo00.js → index-CJln0gS3.js} +3 -2
- package/dist/esm/index-CqoUoxgG.js +423 -0
- package/dist/esm/{index-B_dQk_WE.js → index-DnA_7Bnx.js} +5 -5
- package/dist/esm/index.js +17 -15
- package/dist/esm/{input-shims-D10mwcw1.js → input-shims-Dqk-Ou25.js} +10 -11
- package/dist/esm/input.utils-rqoH22pW.js +33 -0
- package/dist/esm/ion-accordion_2.entry.js +12 -12
- package/dist/esm/ion-action-sheet.entry.js +92 -44
- package/dist/esm/ion-alert.entry.js +143 -64
- package/dist/esm/ion-app_8.entry.js +112 -40
- package/dist/esm/ion-avatar_3.entry.js +4 -4
- package/dist/esm/ion-back-button.entry.js +6 -5
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-breadcrumb_2.entry.js +8 -7
- package/dist/esm/ion-button_2.entry.js +18 -10
- package/dist/esm/ion-card_5.entry.js +6 -5
- package/dist/esm/ion-checkbox.entry.js +25 -12
- package/dist/esm/ion-chip.entry.js +3 -3
- package/dist/esm/ion-col_3.entry.js +10 -6
- package/dist/esm/ion-datetime-button.entry.js +28 -29
- package/dist/esm/{ion-datetime_3.entry.js → ion-datetime.entry.js} +712 -733
- package/dist/esm/ion-fab_3.entry.js +93 -14
- package/dist/esm/ion-img.entry.js +7 -4
- package/dist/esm/ion-infinite-scroll_2.entry.js +7 -5
- package/dist/esm/ion-input-otp.entry.js +20 -29
- package/dist/esm/ion-input-password-toggle.entry.js +9 -10
- package/dist/esm/ion-input.entry.js +56 -68
- package/dist/esm/ion-item-option_3.entry.js +21 -24
- package/dist/esm/ion-item_8.entry.js +117 -33
- package/dist/esm/ion-loading.entry.js +28 -14
- package/dist/esm/ion-menu_3.entry.js +23 -24
- package/dist/esm/ion-modal.entry.js +295 -147
- package/dist/esm/ion-nav_2.entry.js +30 -138
- package/dist/esm/ion-picker-column-option.entry.js +8 -13
- package/dist/esm/ion-picker-column.entry.js +218 -62
- package/dist/esm/ion-picker.entry.js +4 -4
- package/dist/esm/ion-popover.entry.js +50 -30
- package/dist/esm/ion-progress-bar.entry.js +6 -5
- package/dist/esm/ion-radio_2.entry.js +24 -14
- package/dist/esm/ion-range.entry.js +30 -25
- package/dist/esm/ion-refresher_2.entry.js +59 -24
- package/dist/esm/ion-reorder_2.entry.js +10 -9
- package/dist/esm/ion-ripple-effect.entry.js +3 -3
- package/dist/esm/ion-route_4.entry.js +36 -30
- package/dist/esm/ion-searchbar.entry.js +27 -22
- package/dist/esm/ion-segment-content.entry.js +2 -2
- package/dist/esm/ion-segment-view.entry.js +5 -6
- package/dist/esm/ion-segment_2.entry.js +30 -26
- package/dist/esm/ion-select-modal.entry.js +93 -38
- package/dist/esm/ion-select_3.entry.js +495 -125
- package/dist/esm/ion-spinner.entry.js +5 -6
- package/dist/esm/ion-split-pane.entry.js +4 -4
- package/dist/esm/ion-tab-bar_2.entry.js +15 -12
- package/dist/esm/ion-tab_2.entry.js +26 -19
- package/dist/esm/ion-text.entry.js +5 -5
- package/dist/esm/ion-textarea.entry.js +55 -64
- package/dist/esm/ion-toast.entry.js +25 -20
- package/dist/esm/ion-toggle.entry.js +36 -15
- package/dist/esm/{ionic-global-Cp_eT4sZ.js → ionic-global-ZXjCXKH0.js} +13 -8
- package/dist/esm/ionic.js +6 -6
- package/dist/esm/{ios.transition-ClFrsIrS.js → ios.transition-CWAgfQ1r.js} +14 -17
- package/dist/esm/item-multiple-inputs-DZnIiOO_.js +36 -0
- package/dist/esm/{keyboard-ywgs5efA.js → keyboard-Cj8mLJeq.js} +2 -2
- package/dist/esm/{keyboard-CUw4ekVy.js → keyboard-DAF8GNJ9.js} +2 -2
- package/dist/esm/{keyboard-controller-BaaVITYt.js → keyboard-controller-DEwoa1ev.js} +6 -6
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{md.transition-D0msQmzI.js → md.transition-ZuqDDdDW.js} +8 -8
- package/dist/esm/overlay-control-label-BSQPZ79H.js +47 -0
- package/dist/esm/{overlays-TbiM4mdr.js → overlays-DKE0DgvE.js} +119 -57
- package/dist/esm/select-option-render-1W6W9pbC.js +121 -0
- package/dist/esm/slot-mutation-controller-B5NpUZ-N.js +393 -0
- package/dist/esm/{status-tap-Kan2W7sh.js → status-tap-Cv9gb3ja.js} +4 -3
- package/dist/esm/{swipe-back-ZUWwA-KF.js → swipe-back-De5HlmeM.js} +5 -5
- package/dist/esm/{theme-DiVJyqlX.js → theme-byZM6qHV.js} +6 -1
- package/dist/html.html-data.json +58 -82
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-06c6b540.entry.js +4 -0
- package/dist/ionic/p-099b7f9f.entry.js +4 -0
- package/dist/ionic/p-0dcb7bb6.entry.js +4 -0
- package/dist/ionic/p-1347880c.entry.js +4 -0
- package/dist/ionic/p-191a651e.entry.js +4 -0
- package/dist/ionic/p-1f24cb24.entry.js +4 -0
- package/dist/ionic/p-271c3640.entry.js +4 -0
- package/dist/ionic/p-2c52fe3e.entry.js +4 -0
- package/dist/ionic/p-2ea4bb36.entry.js +4 -0
- package/dist/ionic/p-338a02e0.entry.js +4 -0
- package/dist/ionic/p-38b9375b.entry.js +4 -0
- package/dist/ionic/p-3bba83ee.entry.js +4 -0
- package/dist/ionic/p-4712a8a9.entry.js +4 -0
- package/dist/ionic/p-4c3e50f8.entry.js +4 -0
- package/dist/ionic/p-4e2fef42.entry.js +4 -0
- package/dist/ionic/p-54cbb0a7.entry.js +4 -0
- package/dist/ionic/{p-2bb2cb18.entry.js → p-561af487.entry.js} +1 -1
- package/dist/ionic/p-5906ea6f.entry.js +4 -0
- package/dist/ionic/p-5cc09b40.entry.js +4 -0
- package/dist/ionic/p-5d9094ac.entry.js +4 -0
- package/dist/ionic/p-612ea3b1.entry.js +4 -0
- package/dist/ionic/p-66f150ec.entry.js +4 -0
- package/dist/ionic/p-68cc89a6.entry.js +4 -0
- package/dist/ionic/{p-dfa8d673.entry.js → p-6e386853.entry.js} +1 -1
- package/dist/ionic/p-77c96e08.entry.js +4 -0
- package/dist/ionic/p-7bfeccb3.entry.js +4 -0
- package/dist/ionic/p-7e394cc3.entry.js +4 -0
- package/dist/ionic/{p-0fa9c382.entry.js → p-7fbb3319.entry.js} +1 -1
- package/dist/ionic/p-837db1b9.entry.js +4 -0
- package/dist/ionic/p-85599fe3.entry.js +4 -0
- package/dist/ionic/p-8b80d9f9.entry.js +4 -0
- package/dist/ionic/p-90f50a65.entry.js +4 -0
- package/dist/ionic/p-9595e305.entry.js +4 -0
- package/dist/ionic/p-9c5f2691.entry.js +4 -0
- package/dist/ionic/p-BMPN55of.js +4 -0
- package/dist/ionic/p-BSQPZ79H.js +4 -0
- package/dist/ionic/p-BY6BzzPF.js +4 -0
- package/dist/ionic/p-B_gJaBk0.js +4 -0
- package/dist/ionic/p-BaeKWZ-a.js +4 -0
- package/dist/ionic/p-Bd72UYI2.js +4 -0
- package/dist/ionic/p-BgOvhHy_.js +4 -0
- package/dist/ionic/p-BhamHSw3.js +4 -0
- package/dist/ionic/p-BijjLYjT.js +4 -0
- package/dist/ionic/{p-DV3sJJW8.js → p-BvabGprD.js} +1 -1
- package/dist/ionic/p-C23AVPx9.js +6 -0
- package/dist/ionic/p-C8XilMh0.js +4 -0
- package/dist/ionic/p-CER8qW8Y.js +4 -0
- package/dist/ionic/p-CFuOr1Tu.js +4 -0
- package/dist/ionic/p-CM5OBjTW.js +4 -0
- package/dist/ionic/p-CMZYmFb4.js +4 -0
- package/dist/ionic/p-CkxVYPtX.js +4 -0
- package/dist/ionic/p-CmXuiRT6.js +4 -0
- package/dist/ionic/p-D0YpjgON.js +4 -0
- package/dist/ionic/p-D4OrdtJf.js +4 -0
- package/dist/ionic/p-D5t_-oMk.js +4 -0
- package/dist/ionic/p-D6rHcCvc.js +4 -0
- package/dist/ionic/p-DLM95R4x.js +4 -0
- package/dist/ionic/p-DTxBioUO.js +4 -0
- package/dist/ionic/p-DWCzVL3Y.js +4 -0
- package/dist/ionic/p-DYUjHcuH.js +4 -0
- package/dist/ionic/p-DZ6Hmc-8.js +4 -0
- package/dist/ionic/p-D_gb-kdd.js +4 -0
- package/dist/ionic/p-DajLgJ4d.js +4 -0
- package/dist/ionic/p-Do3zTvCA.js +4 -0
- package/dist/ionic/p-Dojwmvde.js +4 -0
- package/dist/ionic/p-T71k3C35.js +4 -0
- package/dist/ionic/p-a1cc2861.entry.js +4 -0
- package/dist/ionic/p-a20a2ebe.entry.js +4 -0
- package/dist/ionic/p-a8ff2489.entry.js +4 -0
- package/dist/ionic/p-b3532b8d.entry.js +4 -0
- package/dist/ionic/p-b80c86c4.entry.js +4 -0
- package/dist/ionic/p-b9b4e85d.entry.js +4 -0
- package/dist/ionic/p-byZM6qHV.js +4 -0
- package/dist/ionic/p-c57fc396.entry.js +4 -0
- package/dist/ionic/{p-c6e49f3f.entry.js → p-ca1b8865.entry.js} +1 -1
- package/dist/ionic/p-cc4320d3.entry.js +4 -0
- package/dist/ionic/p-d6755739.entry.js +4 -0
- package/dist/ionic/p-d8c138d9.entry.js +4 -0
- package/dist/ionic/p-db449915.entry.js +4 -0
- package/dist/ionic/p-dd01be0a.entry.js +4 -0
- package/dist/ionic/p-ec00fd0d.entry.js +4 -0
- package/dist/ionic/p-ee09ac9d.entry.js +4 -0
- package/dist/ionic/{p-37e720da.entry.js → p-efc0cf82.entry.js} +1 -1
- package/dist/ionic/p-f0fb23c1.entry.js +4 -0
- package/dist/ionic/p-f83b3e0c.entry.js +4 -0
- package/dist/ionic/p-fU3rOYad.js +4 -0
- package/dist/ionic/p-zWf7R2xV.js +4 -0
- package/dist/types/components/action-sheet/action-sheet.d.ts +10 -0
- package/dist/types/components/alert/alert.d.ts +7 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -0
- package/dist/types/components/content/content.d.ts +12 -0
- package/dist/types/components/datetime/datetime.d.ts +13 -1
- package/dist/types/components/fab-button/fab-button.d.ts +15 -0
- package/dist/types/components/img/img.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +12 -6
- package/dist/types/components/item/item.d.ts +19 -0
- package/dist/types/components/modal/gestures/sheet.d.ts +1 -0
- package/dist/types/components/modal/gestures/utils.d.ts +11 -0
- package/dist/types/components/modal/modal-interface.d.ts +9 -0
- package/dist/types/components/modal/modal.d.ts +25 -7
- package/dist/types/components/modal/safe-area-utils.d.ts +6 -0
- package/dist/types/components/nav/nav-interface.d.ts +0 -1
- package/dist/types/components/nav/nav.d.ts +2 -22
- package/dist/types/components/picker-column/picker-column.d.ts +42 -0
- package/dist/types/components/radio/radio.d.ts +1 -0
- package/dist/types/components/range/range.d.ts +4 -1
- package/dist/types/components/refresher/refresher.d.ts +7 -0
- package/dist/types/components/route/route.d.ts +1 -1
- package/dist/types/components/router-outlet/router-outlet.d.ts +7 -0
- package/dist/types/components/searchbar/searchbar.d.ts +1 -1
- package/dist/types/components/select/select-interface.d.ts +31 -0
- package/dist/types/components/select/select.d.ts +30 -6
- package/dist/types/components/select-option/select-option.d.ts +42 -1
- package/dist/types/components/tab/tab.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +12 -5
- package/dist/types/components/toggle/toggle.d.ts +1 -0
- package/dist/types/components.d.ts +94 -318
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interface.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +12 -0
- package/dist/types/utils/config.d.ts +1 -8
- package/dist/types/utils/content/index.d.ts +12 -0
- package/dist/types/utils/forms/index.d.ts +2 -0
- package/dist/types/utils/forms/item-multiple-inputs.d.ts +13 -0
- package/dist/types/utils/forms/start-container-controller.d.ts +34 -0
- package/dist/types/utils/helpers.d.ts +8 -5
- package/dist/types/utils/logging/index.d.ts +2 -1
- package/dist/types/utils/overlay-control-label.d.ts +32 -0
- package/dist/types/utils/overlays.d.ts +20 -9
- package/dist/types/utils/rtl/dir.d.ts +10 -4
- package/dist/types/utils/sanitization/index.d.ts +58 -2
- package/dist/types/utils/select-option-render.d.ts +53 -0
- package/dist/types/utils/test/playwright/apply-keyboard-focus.d.ts +16 -0
- package/dist/types/utils/test/playwright/detach-reattach.d.ts +13 -0
- package/dist/types/utils/test/playwright/index.d.ts +2 -0
- package/dist/types/utils/test/playwright/playwright-page.d.ts +1 -1
- package/dist/types/utils/test/playwright/testExpect.d.ts +1 -1
- package/hydrate/index.js +3341 -2197
- package/hydrate/index.mjs +3341 -2197
- package/loader/index.d.ts +1 -1
- package/package.json +61 -17
- package/components/ion-picker-legacy-column.d.ts +0 -11
- package/components/ion-picker-legacy-column.js +0 -4
- package/components/ion-picker-legacy.d.ts +0 -11
- package/components/ion-picker-legacy.js +0 -4
- package/components/p-0NRupjzW.js +0 -4
- package/components/p-5bE_Wz4Y.js +0 -4
- package/components/p-B60hm8Qv.js +0 -4
- package/components/p-BAYYcg3o.js +0 -4
- package/components/p-BLmJ0zRm.js +0 -4
- package/components/p-BSEgsdFI.js +0 -4
- package/components/p-BTEOs1at.js +0 -4
- package/components/p-BTPfOxsU.js +0 -4
- package/components/p-BT_5jSqG.js +0 -4
- package/components/p-Baq1XyAy.js +0 -4
- package/components/p-BjfgFSSR.js +0 -4
- package/components/p-BjoEPDW5.js +0 -4
- package/components/p-BnqQlm7c.js +0 -4
- package/components/p-BsPelv04.js +0 -4
- package/components/p-Bth-EzJ0.js +0 -4
- package/components/p-Bz0dSlXZ.js +0 -4
- package/components/p-C1aScSTo.js +0 -4
- package/components/p-C2lKgrXx.js +0 -4
- package/components/p-C53feagD.js +0 -4
- package/components/p-CHqRYvYm.js +0 -4
- package/components/p-CI3ncNZm.js +0 -4
- package/components/p-CSZf8_j0.js +0 -4
- package/components/p-CU5rbWAW.js +0 -4
- package/components/p-C_xFdyXe.js +0 -4
- package/components/p-Ciz1-FuE.js +0 -4
- package/components/p-Cl0B-RWe.js +0 -4
- package/components/p-CmR5uXej.js +0 -4
- package/components/p-CtWGkNnJ.js +0 -4
- package/components/p-CtukzcyX.js +0 -4
- package/components/p-D13Eaw-8.js +0 -4
- package/components/p-D5Ubpm7D.js +0 -4
- package/components/p-D6Ynv7Xh.js +0 -4
- package/components/p-D7bSXQD3.js +0 -4
- package/components/p-DDWp95gH.js +0 -4
- package/components/p-DIE4pXMl.js +0 -4
- package/components/p-DOFCbuQR.js +0 -4
- package/components/p-DiVJyqlX.js +0 -4
- package/components/p-DnL1c9_X.js +0 -4
- package/components/p-W5nO8mX_.js +0 -4
- package/components/p-W9CZ2mWX.js +0 -4
- package/components/p-XlSIJDJ-.js +0 -4
- package/components/p-cyNmxje6.js +0 -4
- package/components/p-dhLYXa7A.js +0 -4
- package/components/p-ijF0iCrA.js +0 -4
- package/components/p-k_E4tX5Z.js +0 -4
- package/components/p-nQi4oKcG.js +0 -4
- package/components/p-ryqmO0B-.js +0 -4
- package/dist/cjs/config-xninhj0J.js +0 -201
- package/dist/cjs/dir-Cn0z1rJH.js +0 -20
- package/dist/cjs/input.utils-DetjmtH2.js +0 -150
- package/dist/cjs/notch-controller-18PzRGXd.js +0 -155
- package/dist/collection/components/picker-legacy/animations/ios.enter.js +0 -27
- package/dist/collection/components/picker-legacy/animations/ios.leave.js +0 -23
- package/dist/collection/components/picker-legacy/picker-interface.js +0 -1
- package/dist/collection/components/picker-legacy/picker.ios.css +0 -300
- package/dist/collection/components/picker-legacy/picker.js +0 -890
- package/dist/collection/components/picker-legacy/picker.md.css +0 -287
- package/dist/collection/components/picker-legacy-column/picker-column.ios.css +0 -231
- package/dist/collection/components/picker-legacy-column/picker-column.js +0 -422
- package/dist/collection/components/picker-legacy-column/picker-column.md.css +0 -222
- package/dist/collection/components/picker-legacy-column/test/test.utils.js +0 -43
- package/dist/esm/config-DQCONYYp.js +0 -195
- package/dist/esm/dir-C53feagD.js +0 -18
- package/dist/esm/input.utils-Y6NgW8bw.js +0 -147
- package/dist/esm/notch-controller-DKDjU_O7.js +0 -153
- package/dist/ionic/p-00dbb17e.entry.js +0 -4
- package/dist/ionic/p-01f81ea5.entry.js +0 -4
- package/dist/ionic/p-06c232a4.entry.js +0 -4
- package/dist/ionic/p-0d005398.entry.js +0 -4
- package/dist/ionic/p-1ae21e4c.entry.js +0 -4
- package/dist/ionic/p-20b1a044.entry.js +0 -4
- package/dist/ionic/p-21eb76d5.entry.js +0 -4
- package/dist/ionic/p-2394a9a6.entry.js +0 -4
- package/dist/ionic/p-27d30585.entry.js +0 -4
- package/dist/ionic/p-2f55dc1a.entry.js +0 -4
- package/dist/ionic/p-30bf9737.entry.js +0 -4
- package/dist/ionic/p-3353c229.entry.js +0 -4
- package/dist/ionic/p-33704f20.entry.js +0 -4
- package/dist/ionic/p-390ca786.entry.js +0 -4
- package/dist/ionic/p-3a126bca.entry.js +0 -4
- package/dist/ionic/p-3a541154.entry.js +0 -4
- package/dist/ionic/p-3a7d1e91.entry.js +0 -4
- package/dist/ionic/p-3ae5f277.entry.js +0 -4
- package/dist/ionic/p-4745f534.entry.js +0 -4
- package/dist/ionic/p-4858af1f.entry.js +0 -4
- package/dist/ionic/p-4baa5b82.entry.js +0 -4
- package/dist/ionic/p-4dc1c33c.entry.js +0 -4
- package/dist/ionic/p-4e92a11f.entry.js +0 -4
- package/dist/ionic/p-50e1194a.entry.js +0 -4
- package/dist/ionic/p-5d1da0a2.entry.js +0 -4
- package/dist/ionic/p-75dc25ba.entry.js +0 -4
- package/dist/ionic/p-81ea5652.entry.js +0 -4
- package/dist/ionic/p-84d5ce05.entry.js +0 -4
- package/dist/ionic/p-874b4bd8.entry.js +0 -4
- package/dist/ionic/p-8c8eee7d.entry.js +0 -4
- package/dist/ionic/p-8eb8ee76.entry.js +0 -4
- package/dist/ionic/p-8fce95d5.entry.js +0 -4
- package/dist/ionic/p-94f2a736.entry.js +0 -4
- package/dist/ionic/p-9a65ac7f.entry.js +0 -4
- package/dist/ionic/p-9eeaBrnk.js +0 -4
- package/dist/ionic/p-9f1103ce.entry.js +0 -4
- package/dist/ionic/p-BGqMS-oh.js +0 -4
- package/dist/ionic/p-BTEOs1at.js +0 -4
- package/dist/ionic/p-BUFIpxKM.js +0 -4
- package/dist/ionic/p-C53feagD.js +0 -4
- package/dist/ionic/p-CFlfIb2g.js +0 -4
- package/dist/ionic/p-CKvCXMs9.js +0 -4
- package/dist/ionic/p-Cl0B-RWe.js +0 -4
- package/dist/ionic/p-CtWGkNnJ.js +0 -4
- package/dist/ionic/p-CwdymDLH.js +0 -4
- package/dist/ionic/p-Cx3IXROA.js +0 -4
- package/dist/ionic/p-D13Eaw-8.js +0 -4
- package/dist/ionic/p-DAAFkPFT.js +0 -4
- package/dist/ionic/p-DC3RagnA.js +0 -4
- package/dist/ionic/p-DIuEbVLu.js +0 -4
- package/dist/ionic/p-DSG2s2Eb.js +0 -4
- package/dist/ionic/p-Dfbt-q2k.js +0 -4
- package/dist/ionic/p-DiVJyqlX.js +0 -4
- package/dist/ionic/p-DoJvtrbw.js +0 -4
- package/dist/ionic/p-DzWaWHGc.js +0 -4
- package/dist/ionic/p-Nqf6uvGh.js +0 -4
- package/dist/ionic/p-SNAkTDfm.js +0 -4
- package/dist/ionic/p-VAemlbDS.js +0 -4
- package/dist/ionic/p-Wk5HzclC.js +0 -4
- package/dist/ionic/p-a21add2f.entry.js +0 -4
- package/dist/ionic/p-a3bdcae6.entry.js +0 -4
- package/dist/ionic/p-aa5d6b8f.entry.js +0 -4
- package/dist/ionic/p-c0fb8edd.entry.js +0 -4
- package/dist/ionic/p-c4d8641b.entry.js +0 -4
- package/dist/ionic/p-e0be05c5.entry.js +0 -4
- package/dist/ionic/p-e847a888.entry.js +0 -4
- package/dist/ionic/p-ec090e0a.entry.js +0 -4
- package/dist/ionic/p-ef4c3bee.entry.js +0 -4
- package/dist/ionic/p-fabcce6c.entry.js +0 -4
- package/dist/ionic/p-facfde02.entry.js +0 -4
- package/dist/ionic/p-fd7eebc4.entry.js +0 -4
- package/dist/ionic/p-mjKAFv89.js +0 -4
- package/dist/ionic/p-tcQvqkiX.js +0 -5
- package/dist/ionic/p-viFHDgRs.js +0 -4
- package/dist/ionic/p-xOfi7-Zn.js +0 -4
- package/dist/ionic/p-xWb6fgfq.js +0 -4
- package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +0 -5
- package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +0 -5
- package/dist/types/components/picker-legacy/picker-interface.d.ts +0 -52
- 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/types/components/picker-legacy-column/test/test.utils.d.ts +0 -9
- /package/components/{p-CO7fmmxt.js → p-LpMHEu3v.js} +0 -0
|
@@ -1,23 +1,541 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { j as printIonError, f as printIonWarning, r as registerInstance, c as createEvent, w as writeTask, h, d as Host, g as getElement } from './index-
|
|
4
|
+
import { j as printIonError, f as printIonWarning, r as registerInstance, c as createEvent, w as writeTask, e as config, h, d as Host, g as getElement } from './index-C23AVPx9.js';
|
|
5
5
|
import { startFocusVisible } from './focus-visible-BmVRXR1y.js';
|
|
6
|
-
import { r as raf, g as getElementRoot, a as renderHiddenInput
|
|
7
|
-
import { F as FOCUS_TRAP_DISABLE_CLASS
|
|
8
|
-
import { i as isRTL } from './dir-
|
|
9
|
-
import { c as createColorClasses
|
|
10
|
-
import {
|
|
11
|
-
import { b as getIonMode } from './ionic-global-
|
|
12
|
-
import {
|
|
13
|
-
import { c as createLockController } from './lock-controller-B-hirT0v.js';
|
|
14
|
-
import { c as createAnimation } from './animation-DLJpuoEz.js';
|
|
15
|
-
import { a as hapticSelectionChanged, h as hapticSelectionEnd, b as hapticSelectionStart } from './haptic-DzAMWJuk.js';
|
|
6
|
+
import { r as raf, g as getElementRoot, a as renderHiddenInput } from './helpers-BSmc0nst.js';
|
|
7
|
+
import { F as FOCUS_TRAP_DISABLE_CLASS } from './overlays-DKE0DgvE.js';
|
|
8
|
+
import { i as isRTL } from './dir-Dojwmvde.js';
|
|
9
|
+
import { c as createColorClasses } from './theme-byZM6qHV.js';
|
|
10
|
+
import { b as chevronDown, d as caretUpSharp, e as chevronForward, f as caretDownSharp, c as chevronBack } from './index-BvabGprD.js';
|
|
11
|
+
import { b as getIonMode } from './ionic-global-ZXjCXKH0.js';
|
|
12
|
+
import { r as removeDateTzOffset, g as getNextMonth, a as getPreviousMonth, b as getTodayLabel, c as getYear, d as getHourCycle, e as getInternalHourValue, f as getFormattedHour, h as addTimePadding, i as getLocalizedDayPeriod, j as isBefore, k as isSameDay, l as isAfter, m as is24Hour, n as getNumDaysInMonth, o as getDay, p as generateDayAriaLabel, v as validateParts, q as getPartsFromCalendarDay, s as getNextYear, t as getPreviousYear, u as getEndOfWeek, w as getStartOfWeek, x as getPreviousDay, y as getNextDay, z as getPreviousWeek, A as getNextWeek, B as parseMinParts, C as parseMaxParts, D as parseDate, E as warnIfValueOutOfBounds, F as parseAmPm, G as clampDate, H as convertToArrayOfNumbers, I as convertDataToISO, J as getClosestValidDate, K as isMonthFirstLocale, L as isLocaleDayPeriodRTL, M as calculateHourFromAMPM, N as getMonthAndYear, O as getLocalizedTime, P as getLocalizedDateTime, Q as formatValue } from './format-DDFE9jM5.js';
|
|
16
13
|
import './index-ZjP4CjeZ.js';
|
|
17
|
-
import './hardware-back-button-
|
|
18
|
-
import './framework-delegate-
|
|
19
|
-
import './gesture-controller-
|
|
20
|
-
|
|
14
|
+
import './hardware-back-button-DmkiRgOT.js';
|
|
15
|
+
import './framework-delegate-BwNhx9NR.js';
|
|
16
|
+
import './gesture-controller-B_gJaBk0.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns the current date as
|
|
20
|
+
* an ISO string in the user's
|
|
21
|
+
* time zone.
|
|
22
|
+
*/
|
|
23
|
+
const getToday = () => {
|
|
24
|
+
/**
|
|
25
|
+
* ion-datetime intentionally does not
|
|
26
|
+
* parse time zones/do automatic time zone
|
|
27
|
+
* conversion when accepting user input.
|
|
28
|
+
* However when we get today's date string,
|
|
29
|
+
* we want it formatted relative to the user's
|
|
30
|
+
* time zone.
|
|
31
|
+
*
|
|
32
|
+
* When calling toISOString(), the browser
|
|
33
|
+
* will convert the date to UTC time by either adding
|
|
34
|
+
* or subtracting the time zone offset.
|
|
35
|
+
* To work around this, we need to either add
|
|
36
|
+
* or subtract the time zone offset to the Date
|
|
37
|
+
* object prior to calling toISOString().
|
|
38
|
+
* This allows us to get an ISO string
|
|
39
|
+
* that is in the user's time zone.
|
|
40
|
+
*/
|
|
41
|
+
return removeDateTzOffset(new Date()).toISOString();
|
|
42
|
+
};
|
|
43
|
+
const minutes = [
|
|
44
|
+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
45
|
+
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
|
|
46
|
+
];
|
|
47
|
+
// h11 hour system uses 0-11. Midnight starts at 0:00am.
|
|
48
|
+
const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
49
|
+
// h12 hour system uses 0-12. Midnight starts at 12:00am.
|
|
50
|
+
const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
51
|
+
// h23 hour system uses 0-23. Midnight starts at 0:00.
|
|
52
|
+
const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
|
53
|
+
// h24 hour system uses 1-24. Midnight starts at 24:00.
|
|
54
|
+
const hour24 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0];
|
|
55
|
+
/**
|
|
56
|
+
* Given a locale and a mode,
|
|
57
|
+
* return an array with formatted days
|
|
58
|
+
* of the week. iOS should display days
|
|
59
|
+
* such as "Mon" or "Tue".
|
|
60
|
+
* MD should display days such as "M"
|
|
61
|
+
* or "T".
|
|
62
|
+
*/
|
|
63
|
+
const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
|
|
64
|
+
/**
|
|
65
|
+
* Nov 1st, 2020 starts on a Sunday.
|
|
66
|
+
* ion-datetime assumes weeks start on Sunday,
|
|
67
|
+
* but is configurable via `firstDayOfWeek`.
|
|
68
|
+
*/
|
|
69
|
+
const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
|
|
70
|
+
const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
|
|
71
|
+
const startDate = new Date('11/01/2020');
|
|
72
|
+
const daysOfWeek = [];
|
|
73
|
+
/**
|
|
74
|
+
* For each day of the week,
|
|
75
|
+
* get the day name.
|
|
76
|
+
*/
|
|
77
|
+
for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
|
|
78
|
+
const currentDate = new Date(startDate);
|
|
79
|
+
currentDate.setDate(currentDate.getDate() + i);
|
|
80
|
+
daysOfWeek.push(intl.format(currentDate));
|
|
81
|
+
}
|
|
82
|
+
return daysOfWeek;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Returns an array containing all of the
|
|
86
|
+
* days in a month for a given year. Values are
|
|
87
|
+
* aligned with a week calendar starting on
|
|
88
|
+
* the firstDayOfWeek value (Sunday by default)
|
|
89
|
+
* using null values.
|
|
90
|
+
*/
|
|
91
|
+
const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
|
|
92
|
+
const numDays = getNumDaysInMonth(month, year);
|
|
93
|
+
let previousNumDays; //previous month number of days
|
|
94
|
+
if (month === 1) {
|
|
95
|
+
// If the current month is January, the previous month should be December of the previous year.
|
|
96
|
+
previousNumDays = getNumDaysInMonth(12, year - 1);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// Otherwise, the previous month should be the current month - 1 of the same year.
|
|
100
|
+
previousNumDays = getNumDaysInMonth(month - 1, year);
|
|
101
|
+
}
|
|
102
|
+
const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
|
|
103
|
+
/**
|
|
104
|
+
* To get the first day of the month aligned on the correct
|
|
105
|
+
* day of the week, we need to determine how many "filler" days
|
|
106
|
+
* to generate. These filler days as empty/disabled buttons
|
|
107
|
+
* that fill the space of the days of the week before the first
|
|
108
|
+
* of the month.
|
|
109
|
+
*
|
|
110
|
+
* There are two cases here:
|
|
111
|
+
*
|
|
112
|
+
* 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
|
|
113
|
+
* is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
|
|
114
|
+
* this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
|
|
115
|
+
* the first day of the month.
|
|
116
|
+
*
|
|
117
|
+
* 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
|
|
118
|
+
* is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
|
|
119
|
+
* this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
|
|
120
|
+
* the first day of the month.
|
|
121
|
+
*/
|
|
122
|
+
const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
|
|
123
|
+
let days = [];
|
|
124
|
+
for (let i = 1; i <= numDays; i++) {
|
|
125
|
+
days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
|
|
126
|
+
}
|
|
127
|
+
if (showAdjacentDays) {
|
|
128
|
+
for (let i = 0; i <= offset; i++) {
|
|
129
|
+
// Using offset create previous month adjacent day, starting from last day
|
|
130
|
+
days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
|
|
131
|
+
}
|
|
132
|
+
// Calculate positiveOffset
|
|
133
|
+
// The calendar will display 42 days (6 rows of 7 columns)
|
|
134
|
+
// Knowing this the offset is 41 (we start at index 0)
|
|
135
|
+
// minus (the previous offset + the current month days)
|
|
136
|
+
const positiveOffset = 41 - (numDays + offset);
|
|
137
|
+
for (let i = 0; i < positiveOffset; i++) {
|
|
138
|
+
days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
for (let i = 0; i <= offset; i++) {
|
|
143
|
+
days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return days;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Returns an array of pre-defined hour
|
|
150
|
+
* values based on the provided hourCycle.
|
|
151
|
+
*/
|
|
152
|
+
const getHourData = (hourCycle) => {
|
|
153
|
+
switch (hourCycle) {
|
|
154
|
+
case 'h11':
|
|
155
|
+
return hour11;
|
|
156
|
+
case 'h12':
|
|
157
|
+
return hour12;
|
|
158
|
+
case 'h23':
|
|
159
|
+
return hour23;
|
|
160
|
+
case 'h24':
|
|
161
|
+
return hour24;
|
|
162
|
+
default:
|
|
163
|
+
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Given a local, reference datetime parts and option
|
|
168
|
+
* max/min bound datetime parts, calculate the acceptable
|
|
169
|
+
* hour and minute values according to the bounds and locale.
|
|
170
|
+
*/
|
|
171
|
+
const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
|
172
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
173
|
+
const use24Hour = is24Hour(computedHourCycle);
|
|
174
|
+
let processedHours = getHourData(computedHourCycle);
|
|
175
|
+
let processedMinutes = minutes;
|
|
176
|
+
let isAMAllowed = true;
|
|
177
|
+
let isPMAllowed = true;
|
|
178
|
+
if (hourValues) {
|
|
179
|
+
processedHours = processedHours.filter((hour) => hourValues.includes(hour));
|
|
180
|
+
}
|
|
181
|
+
if (minuteValues) {
|
|
182
|
+
processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
|
|
183
|
+
}
|
|
184
|
+
if (minParts) {
|
|
185
|
+
/**
|
|
186
|
+
* If ref day is the same as the
|
|
187
|
+
* minimum allowed day, filter hour/minute
|
|
188
|
+
* values according to min hour and minute.
|
|
189
|
+
*/
|
|
190
|
+
if (isSameDay(refParts, minParts)) {
|
|
191
|
+
/**
|
|
192
|
+
* Users may not always set the hour/minute for
|
|
193
|
+
* min value (i.e. 2021-06-02) so we should allow
|
|
194
|
+
* all hours/minutes in that case.
|
|
195
|
+
*/
|
|
196
|
+
if (minParts.hour !== undefined) {
|
|
197
|
+
processedHours = processedHours.filter((hour) => {
|
|
198
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
199
|
+
return (use24Hour ? hour : convertedHour) >= minParts.hour;
|
|
200
|
+
});
|
|
201
|
+
isAMAllowed = minParts.hour < 13;
|
|
202
|
+
}
|
|
203
|
+
if (minParts.minute !== undefined) {
|
|
204
|
+
/**
|
|
205
|
+
* The minimum minute range should not be enforced when
|
|
206
|
+
* the hour is greater than the min hour.
|
|
207
|
+
*
|
|
208
|
+
* For example with a minimum range of 09:30, users
|
|
209
|
+
* should be able to select 10:00-10:29 and beyond.
|
|
210
|
+
*/
|
|
211
|
+
let isPastMinHour = false;
|
|
212
|
+
if (minParts.hour !== undefined && refParts.hour !== undefined) {
|
|
213
|
+
if (refParts.hour > minParts.hour) {
|
|
214
|
+
isPastMinHour = true;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
processedMinutes = processedMinutes.filter((minute) => {
|
|
218
|
+
if (isPastMinHour) {
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
return minute >= minParts.minute;
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* If ref day is before minimum
|
|
226
|
+
* day do not render any hours/minute values
|
|
227
|
+
*/
|
|
228
|
+
}
|
|
229
|
+
else if (isBefore(refParts, minParts)) {
|
|
230
|
+
processedHours = [];
|
|
231
|
+
processedMinutes = [];
|
|
232
|
+
isAMAllowed = isPMAllowed = false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (maxParts) {
|
|
236
|
+
/**
|
|
237
|
+
* If ref day is the same as the
|
|
238
|
+
* maximum allowed day, filter hour/minute
|
|
239
|
+
* values according to max hour and minute.
|
|
240
|
+
*/
|
|
241
|
+
if (isSameDay(refParts, maxParts)) {
|
|
242
|
+
/**
|
|
243
|
+
* Users may not always set the hour/minute for
|
|
244
|
+
* max value (i.e. 2021-06-02) so we should allow
|
|
245
|
+
* all hours/minutes in that case.
|
|
246
|
+
*/
|
|
247
|
+
if (maxParts.hour !== undefined) {
|
|
248
|
+
processedHours = processedHours.filter((hour) => {
|
|
249
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
250
|
+
return (use24Hour ? hour : convertedHour) <= maxParts.hour;
|
|
251
|
+
});
|
|
252
|
+
isPMAllowed = maxParts.hour >= 12;
|
|
253
|
+
}
|
|
254
|
+
if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
|
|
255
|
+
// The available minutes should only be filtered when the hour is the same as the max hour.
|
|
256
|
+
// For example if the max hour is 10:30 and the current hour is 10:00,
|
|
257
|
+
// users should be able to select 00-30 minutes.
|
|
258
|
+
// If the current hour is 09:00, users should be able to select 00-60 minutes.
|
|
259
|
+
processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* If ref day is after minimum
|
|
263
|
+
* day do not render any hours/minute values
|
|
264
|
+
*/
|
|
265
|
+
}
|
|
266
|
+
else if (isAfter(refParts, maxParts)) {
|
|
267
|
+
processedHours = [];
|
|
268
|
+
processedMinutes = [];
|
|
269
|
+
isAMAllowed = isPMAllowed = false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
hours: processedHours,
|
|
274
|
+
minutes: processedMinutes,
|
|
275
|
+
am: isAMAllowed,
|
|
276
|
+
pm: isPMAllowed,
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Given DatetimeParts, generate the previous,
|
|
281
|
+
* current, and and next months.
|
|
282
|
+
*/
|
|
283
|
+
const generateMonths = (refParts, forcedDate) => {
|
|
284
|
+
const current = { month: refParts.month, year: refParts.year, day: refParts.day };
|
|
285
|
+
/**
|
|
286
|
+
* If we're forcing a month to appear, and it's different from the current month,
|
|
287
|
+
* ensure it appears by replacing the next or previous month as appropriate.
|
|
288
|
+
*/
|
|
289
|
+
if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
|
|
290
|
+
const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
|
|
291
|
+
const forcedMonthIsBefore = isBefore(forced, current);
|
|
292
|
+
return forcedMonthIsBefore
|
|
293
|
+
? [forced, current, getNextMonth(refParts)]
|
|
294
|
+
: [getPreviousMonth(refParts), current, forced];
|
|
295
|
+
}
|
|
296
|
+
return [getPreviousMonth(refParts), current, getNextMonth(refParts)];
|
|
297
|
+
};
|
|
298
|
+
const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
|
299
|
+
month: 'long',
|
|
300
|
+
}) => {
|
|
301
|
+
const { year } = refParts;
|
|
302
|
+
const months = [];
|
|
303
|
+
if (monthValues !== undefined) {
|
|
304
|
+
let processedMonths = monthValues;
|
|
305
|
+
if (maxParts?.month !== undefined) {
|
|
306
|
+
processedMonths = processedMonths.filter((month) => month <= maxParts.month);
|
|
307
|
+
}
|
|
308
|
+
if (minParts?.month !== undefined) {
|
|
309
|
+
processedMonths = processedMonths.filter((month) => month >= minParts.month);
|
|
310
|
+
}
|
|
311
|
+
processedMonths.forEach((processedMonth) => {
|
|
312
|
+
const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
|
|
313
|
+
const monthString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
314
|
+
months.push({ text: monthString, value: processedMonth });
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
|
|
319
|
+
const minMonth = minParts && minParts.year === year ? minParts.month : 1;
|
|
320
|
+
for (let i = minMonth; i <= maxMonth; i++) {
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
* There is a bug on iOS 14 where
|
|
324
|
+
* Intl.DateTimeFormat takes into account
|
|
325
|
+
* the local timezone offset when formatting dates.
|
|
326
|
+
*
|
|
327
|
+
* Forcing the timezone to 'UTC' fixes the issue. However,
|
|
328
|
+
* we should keep this workaround as it is safer. In the event
|
|
329
|
+
* this breaks in another browser, we will not be impacted
|
|
330
|
+
* because all dates will be interpreted in UTC.
|
|
331
|
+
*
|
|
332
|
+
* Example:
|
|
333
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
|
|
334
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
|
|
335
|
+
*
|
|
336
|
+
* In certain timezones, iOS 14 shows the wrong
|
|
337
|
+
* date for .toUTCString(). To combat this, we
|
|
338
|
+
* force all of the timezones to GMT+0000 (UTC).
|
|
339
|
+
*
|
|
340
|
+
* Example:
|
|
341
|
+
* Time Zone: Central European Standard Time
|
|
342
|
+
* new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
|
|
343
|
+
* new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
|
|
344
|
+
*/
|
|
345
|
+
const date = new Date(`${i}/1/${year} GMT+0000`);
|
|
346
|
+
const monthString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
347
|
+
months.push({ text: monthString, value: i });
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return months;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Returns information regarding
|
|
354
|
+
* selectable dates (i.e 1st, 2nd, 3rd, etc)
|
|
355
|
+
* within a reference month.
|
|
356
|
+
* @param locale The locale to format the date with
|
|
357
|
+
* @param refParts The reference month/year to generate dates for
|
|
358
|
+
* @param minParts The minimum bound on the date that can be returned
|
|
359
|
+
* @param maxParts The maximum bound on the date that can be returned
|
|
360
|
+
* @param dayValues The allowed date values
|
|
361
|
+
* @returns Date data to be used in ion-picker-column
|
|
362
|
+
*/
|
|
363
|
+
const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
|
|
364
|
+
day: 'numeric',
|
|
365
|
+
}) => {
|
|
366
|
+
const { month, year } = refParts;
|
|
367
|
+
const days = [];
|
|
368
|
+
/**
|
|
369
|
+
* If we have max/min bounds that in the same
|
|
370
|
+
* month/year as the refParts, we should
|
|
371
|
+
* use the define day as the max/min day.
|
|
372
|
+
* Otherwise, fallback to the max/min days in a month.
|
|
373
|
+
*/
|
|
374
|
+
const numDaysInMonth = getNumDaysInMonth(month, year);
|
|
375
|
+
const maxDay = maxParts?.day !== null && maxParts?.day !== undefined && maxParts.year === year && maxParts.month === month
|
|
376
|
+
? maxParts.day
|
|
377
|
+
: numDaysInMonth;
|
|
378
|
+
const minDay = minParts?.day !== null && minParts?.day !== undefined && minParts.year === year && minParts.month === month
|
|
379
|
+
? minParts.day
|
|
380
|
+
: 1;
|
|
381
|
+
if (dayValues !== undefined) {
|
|
382
|
+
let processedDays = dayValues;
|
|
383
|
+
processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
|
|
384
|
+
processedDays.forEach((processedDay) => {
|
|
385
|
+
const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
|
|
386
|
+
const dayString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
387
|
+
days.push({ text: dayString, value: processedDay });
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
for (let i = minDay; i <= maxDay; i++) {
|
|
392
|
+
const date = new Date(`${month}/${i}/${year} GMT+0000`);
|
|
393
|
+
const dayString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
394
|
+
days.push({ text: dayString, value: i });
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return days;
|
|
398
|
+
};
|
|
399
|
+
const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
|
|
400
|
+
let processedYears = [];
|
|
401
|
+
if (yearValues !== undefined) {
|
|
402
|
+
processedYears = yearValues;
|
|
403
|
+
if (maxParts?.year !== undefined) {
|
|
404
|
+
processedYears = processedYears.filter((year) => year <= maxParts.year);
|
|
405
|
+
}
|
|
406
|
+
if (minParts?.year !== undefined) {
|
|
407
|
+
processedYears = processedYears.filter((year) => year >= minParts.year);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
const { year } = refParts;
|
|
412
|
+
const maxYear = maxParts?.year ?? year;
|
|
413
|
+
const minYear = minParts?.year ?? year - 100;
|
|
414
|
+
for (let i = minYear; i <= maxYear; i++) {
|
|
415
|
+
processedYears.push(i);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return processedYears.map((year) => ({
|
|
419
|
+
text: getYear(locale, { year, month: refParts.month, day: refParts.day }),
|
|
420
|
+
value: year,
|
|
421
|
+
}));
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Given a starting date and an upper bound,
|
|
425
|
+
* this functions returns an array of all
|
|
426
|
+
* month objects in that range.
|
|
427
|
+
*/
|
|
428
|
+
const getAllMonthsInRange = (currentParts, maxParts) => {
|
|
429
|
+
if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
|
|
430
|
+
return [currentParts];
|
|
431
|
+
}
|
|
432
|
+
return [currentParts, ...getAllMonthsInRange(getNextMonth(currentParts), maxParts)];
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Creates and returns picker items
|
|
436
|
+
* that represent the days in a month.
|
|
437
|
+
* Example: "Thu, Jun 2"
|
|
438
|
+
*/
|
|
439
|
+
const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
|
|
440
|
+
let items = [];
|
|
441
|
+
let parts = [];
|
|
442
|
+
/**
|
|
443
|
+
* Get all month objects from the min date
|
|
444
|
+
* to the max date. Note: Do not use getMonthColumnData
|
|
445
|
+
* as that function only generates dates within a
|
|
446
|
+
* single year.
|
|
447
|
+
*/
|
|
448
|
+
let months = getAllMonthsInRange(minParts, maxParts);
|
|
449
|
+
/**
|
|
450
|
+
* Filter out any disallowed month values.
|
|
451
|
+
*/
|
|
452
|
+
if (monthValues) {
|
|
453
|
+
months = months.filter(({ month }) => monthValues.includes(month));
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Get all of the days in the month.
|
|
457
|
+
* From there, generate an array where
|
|
458
|
+
* each item has the month, date, and day
|
|
459
|
+
* of work as the text.
|
|
460
|
+
*/
|
|
461
|
+
months.forEach((monthObject) => {
|
|
462
|
+
const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
|
|
463
|
+
const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
|
|
464
|
+
month: 'short',
|
|
465
|
+
day: 'numeric',
|
|
466
|
+
weekday: 'short',
|
|
467
|
+
});
|
|
468
|
+
const dateParts = [];
|
|
469
|
+
const dateColumnItems = [];
|
|
470
|
+
monthDays.forEach((dayObject) => {
|
|
471
|
+
const isToday = isSameDay({ ...referenceMonth, day: dayObject.value }, todayParts);
|
|
472
|
+
/**
|
|
473
|
+
* Today's date should read as "Today" (localized)
|
|
474
|
+
* not the actual date string
|
|
475
|
+
*/
|
|
476
|
+
dateColumnItems.push({
|
|
477
|
+
text: isToday ? getTodayLabel(locale) : dayObject.text,
|
|
478
|
+
value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
|
|
479
|
+
});
|
|
480
|
+
/**
|
|
481
|
+
* When selecting a date in the wheel picker
|
|
482
|
+
* we need access to the raw datetime parts data.
|
|
483
|
+
* The picker column only accepts values of
|
|
484
|
+
* type string or number, so we need to return
|
|
485
|
+
* two sets of data: A data set to be passed
|
|
486
|
+
* to the picker column, and a data set to
|
|
487
|
+
* be used to reference the raw data when
|
|
488
|
+
* updating the picker column value.
|
|
489
|
+
*/
|
|
490
|
+
dateParts.push({
|
|
491
|
+
month: referenceMonth.month,
|
|
492
|
+
year: referenceMonth.year,
|
|
493
|
+
day: dayObject.value,
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
parts = [...parts, ...dateParts];
|
|
497
|
+
items = [...items, ...dateColumnItems];
|
|
498
|
+
});
|
|
499
|
+
return {
|
|
500
|
+
parts,
|
|
501
|
+
items,
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
|
|
505
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
506
|
+
const use24Hour = is24Hour(computedHourCycle);
|
|
507
|
+
const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
|
|
508
|
+
const hoursItems = hours.map((hour) => {
|
|
509
|
+
return {
|
|
510
|
+
text: getFormattedHour(hour, computedHourCycle),
|
|
511
|
+
value: getInternalHourValue(hour, use24Hour, refParts.ampm),
|
|
512
|
+
};
|
|
513
|
+
});
|
|
514
|
+
const minutesItems = minutes.map((minute) => {
|
|
515
|
+
return {
|
|
516
|
+
text: addTimePadding(minute),
|
|
517
|
+
value: minute,
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
const dayPeriodItems = [];
|
|
521
|
+
if (am && !use24Hour) {
|
|
522
|
+
dayPeriodItems.push({
|
|
523
|
+
text: getLocalizedDayPeriod(locale, 'am'),
|
|
524
|
+
value: 'am',
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
if (pm && !use24Hour) {
|
|
528
|
+
dayPeriodItems.push({
|
|
529
|
+
text: getLocalizedDayPeriod(locale, 'pm'),
|
|
530
|
+
value: 'pm',
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
minutesData: minutesItems,
|
|
535
|
+
hoursData: hoursItems,
|
|
536
|
+
dayPeriodData: dayPeriodItems,
|
|
537
|
+
};
|
|
538
|
+
};
|
|
21
539
|
|
|
22
540
|
const isYearDisabled = (refYear, minParts, maxParts) => {
|
|
23
541
|
if (minParts && minParts.year > refYear) {
|
|
@@ -139,7 +657,10 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
|
|
|
139
657
|
* previous navigation button is disabled.
|
|
140
658
|
*/
|
|
141
659
|
const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
|
|
142
|
-
const prevMonth =
|
|
660
|
+
const prevMonth = {
|
|
661
|
+
...getPreviousMonth(refParts),
|
|
662
|
+
day: null,
|
|
663
|
+
};
|
|
143
664
|
return isMonthDisabled(prevMonth, {
|
|
144
665
|
minParts,
|
|
145
666
|
maxParts,
|
|
@@ -150,7 +671,10 @@ const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
|
|
|
150
671
|
* determine if the next navigation button is disabled.
|
|
151
672
|
*/
|
|
152
673
|
const isNextMonthDisabled = (refParts, maxParts) => {
|
|
153
|
-
const nextMonth =
|
|
674
|
+
const nextMonth = {
|
|
675
|
+
...getNextMonth(refParts),
|
|
676
|
+
day: null,
|
|
677
|
+
};
|
|
154
678
|
return isMonthDisabled(nextMonth, {
|
|
155
679
|
maxParts,
|
|
156
680
|
});
|
|
@@ -193,11 +717,10 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
|
193
717
|
* confusion.
|
|
194
718
|
*/
|
|
195
719
|
const warnIfTimeZoneProvided = (el, formatOptions) => {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
|
|
720
|
+
if (formatOptions?.date?.timeZone ||
|
|
721
|
+
formatOptions?.date?.timeZoneName ||
|
|
722
|
+
formatOptions?.time?.timeZone ||
|
|
723
|
+
formatOptions?.time?.timeZoneName) {
|
|
201
724
|
printIonWarning('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
|
|
202
725
|
}
|
|
203
726
|
};
|
|
@@ -229,9 +752,9 @@ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) =>
|
|
|
229
752
|
}
|
|
230
753
|
};
|
|
231
754
|
|
|
232
|
-
const datetimeIosCss = () => `:host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2);font-size:min(1.375rem, 35.2px)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}`;
|
|
755
|
+
const datetimeIosCss = () => `:host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host(.ion-color) .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);font-size:min(1.375rem, 35.2px)}:host(.ion-color) .calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary, #0054e9);font-weight:600}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base)}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-primary, #0054e9);color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}`;
|
|
233
756
|
|
|
234
|
-
const datetimeMdCss = () => `:host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}`;
|
|
757
|
+
const datetimeMdCss = () => `:host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons ion-button{--color:var(--ion-color-primary, #0054e9)}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.2)}:host(.ion-color) .calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-primary, #0054e9)}:host(.ion-color.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color){--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-primary, #0054e9);color:var(--title-color)}:host(.ion-color) .datetime-header{background:var(--ion-color-base)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-primary, #0054e9);color:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-primary-contrast, #fff)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-primary, #0054e9);background:var(--ion-color-primary, #0054e9)}:host(.ion-color) .calendar-day.calendar-day-active,:host(.ion-color) .calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}`;
|
|
235
758
|
|
|
236
759
|
const Datetime = class {
|
|
237
760
|
constructor(hostRef) {
|
|
@@ -248,6 +771,10 @@ const Datetime = class {
|
|
|
248
771
|
* Set true only by `visibleCallback`. Lets `hiddenCallback` ignore the
|
|
249
772
|
* synthetic "not intersecting" entry IntersectionObserver fires on
|
|
250
773
|
* `observe()` when the host mounts offscreen.
|
|
774
|
+
*
|
|
775
|
+
* Don't reset this in `disconnectedCallback`. Overlays disconnect and
|
|
776
|
+
* reconnect the host without re-creating the observers, so a reset there
|
|
777
|
+
* makes `hiddenCallback` miss the dismissal.
|
|
251
778
|
*/
|
|
252
779
|
this.hasBeenIntersecting = false;
|
|
253
780
|
this.prevPresentation = null;
|
|
@@ -263,12 +790,6 @@ const Datetime = class {
|
|
|
263
790
|
isAdjacentDay: false,
|
|
264
791
|
};
|
|
265
792
|
this.isTimePopoverOpen = false;
|
|
266
|
-
/**
|
|
267
|
-
* The color to use from your application's color palette.
|
|
268
|
-
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
|
|
269
|
-
* For more information on colors, see [theming](/docs/theming/basics).
|
|
270
|
-
*/
|
|
271
|
-
this.color = 'primary';
|
|
272
793
|
/**
|
|
273
794
|
* The name of the control, which is submitted with the form data.
|
|
274
795
|
*/
|
|
@@ -407,9 +928,8 @@ const Datetime = class {
|
|
|
407
928
|
* is selected.
|
|
408
929
|
*/
|
|
409
930
|
this.getActivePartsWithFallback = () => {
|
|
410
|
-
var _a;
|
|
411
931
|
const { defaultParts } = this;
|
|
412
|
-
return
|
|
932
|
+
return this.getActivePart() ?? defaultParts;
|
|
413
933
|
};
|
|
414
934
|
this.getActivePart = () => {
|
|
415
935
|
const { activeParts } = this;
|
|
@@ -422,7 +942,9 @@ const Datetime = class {
|
|
|
422
942
|
}
|
|
423
943
|
};
|
|
424
944
|
this.setWorkingParts = (parts) => {
|
|
425
|
-
this.workingParts =
|
|
945
|
+
this.workingParts = {
|
|
946
|
+
...parts,
|
|
947
|
+
};
|
|
426
948
|
};
|
|
427
949
|
this.setActiveParts = (parts, removeDate = false) => {
|
|
428
950
|
/** if the datetime component is in readonly mode,
|
|
@@ -455,7 +977,9 @@ const Datetime = class {
|
|
|
455
977
|
}
|
|
456
978
|
}
|
|
457
979
|
else {
|
|
458
|
-
this.activeParts =
|
|
980
|
+
this.activeParts = {
|
|
981
|
+
...validatedParts,
|
|
982
|
+
};
|
|
459
983
|
}
|
|
460
984
|
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
|
|
461
985
|
if (hasSlottedButtons || this.showDefaultButtons) {
|
|
@@ -481,7 +1005,6 @@ const Datetime = class {
|
|
|
481
1005
|
* Tab should jump between bodies of selectable content.
|
|
482
1006
|
*/
|
|
483
1007
|
const checkCalendarBodyFocus = (ev) => {
|
|
484
|
-
var _a;
|
|
485
1008
|
const record = ev[0];
|
|
486
1009
|
/**
|
|
487
1010
|
* If calendar body was already focused
|
|
@@ -489,7 +1012,7 @@ const Datetime = class {
|
|
|
489
1012
|
* if not currently focused, we should not re-focus
|
|
490
1013
|
* the inner day.
|
|
491
1014
|
*/
|
|
492
|
-
if (
|
|
1015
|
+
if (record.oldValue?.includes('ion-focused') || !calendarBodyRef.classList.contains('ion-focused')) {
|
|
493
1016
|
return;
|
|
494
1017
|
}
|
|
495
1018
|
this.focusWorkingDay(currentMonth);
|
|
@@ -497,7 +1020,7 @@ const Datetime = class {
|
|
|
497
1020
|
const mo = new MutationObserver(checkCalendarBodyFocus);
|
|
498
1021
|
mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
|
|
499
1022
|
this.destroyKeyboardMO = () => {
|
|
500
|
-
mo
|
|
1023
|
+
mo?.disconnect();
|
|
501
1024
|
};
|
|
502
1025
|
/**
|
|
503
1026
|
* We must use keydown not keyup as we want
|
|
@@ -559,7 +1082,10 @@ const Datetime = class {
|
|
|
559
1082
|
if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
|
|
560
1083
|
return;
|
|
561
1084
|
}
|
|
562
|
-
this.setWorkingParts(
|
|
1085
|
+
this.setWorkingParts({
|
|
1086
|
+
...this.workingParts,
|
|
1087
|
+
...partsToFocus,
|
|
1088
|
+
});
|
|
563
1089
|
/**
|
|
564
1090
|
* Give view a chance to re-render
|
|
565
1091
|
* then move focus to the new working day
|
|
@@ -710,8 +1236,8 @@ const Datetime = class {
|
|
|
710
1236
|
return;
|
|
711
1237
|
const { month, day, year } = newDate;
|
|
712
1238
|
if (isMonthDisabled({ month, year, day: null }, {
|
|
713
|
-
minParts:
|
|
714
|
-
maxParts:
|
|
1239
|
+
minParts: { ...this.minParts, day: null },
|
|
1240
|
+
maxParts: { ...this.maxParts, day: null },
|
|
715
1241
|
})) {
|
|
716
1242
|
return;
|
|
717
1243
|
}
|
|
@@ -731,8 +1257,12 @@ const Datetime = class {
|
|
|
731
1257
|
* if we did not do this.
|
|
732
1258
|
*/
|
|
733
1259
|
writeTask(() => {
|
|
734
|
-
|
|
735
|
-
|
|
1260
|
+
this.setWorkingParts({
|
|
1261
|
+
...this.workingParts,
|
|
1262
|
+
month,
|
|
1263
|
+
day: day,
|
|
1264
|
+
year,
|
|
1265
|
+
});
|
|
736
1266
|
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
737
1267
|
calendarBodyRef.style.removeProperty('overflow');
|
|
738
1268
|
if (this.resolveForceDateScrolling) {
|
|
@@ -740,7 +1270,7 @@ const Datetime = class {
|
|
|
740
1270
|
}
|
|
741
1271
|
const activeEl = this.el.shadowRoot.activeElement;
|
|
742
1272
|
if (activeEl && activeEl.classList.contains('calendar-day')) {
|
|
743
|
-
|
|
1273
|
+
activeEl.closest('.calendar-body')?.focus();
|
|
744
1274
|
}
|
|
745
1275
|
});
|
|
746
1276
|
};
|
|
@@ -969,10 +1499,11 @@ const Datetime = class {
|
|
|
969
1499
|
return;
|
|
970
1500
|
}
|
|
971
1501
|
const left = nextMonth.offsetWidth * 2;
|
|
1502
|
+
const scrollMode = config.getBoolean('animated', true) ? 'smooth' : 'instant';
|
|
972
1503
|
calendarBodyRef.scrollTo({
|
|
973
1504
|
top: 0,
|
|
974
1505
|
left: left * (isRTL(this.el) ? -1 : 1),
|
|
975
|
-
behavior:
|
|
1506
|
+
behavior: scrollMode,
|
|
976
1507
|
});
|
|
977
1508
|
};
|
|
978
1509
|
this.prevMonth = () => {
|
|
@@ -985,10 +1516,11 @@ const Datetime = class {
|
|
|
985
1516
|
return;
|
|
986
1517
|
}
|
|
987
1518
|
const left = prevMonth.offsetWidth * 2;
|
|
1519
|
+
const scrollMode = config.getBoolean('animated', true) ? 'smooth' : 'instant';
|
|
988
1520
|
calendarBodyRef.scrollTo({
|
|
989
1521
|
top: 0,
|
|
990
1522
|
left: left * (isRTL(this.el) ? 1 : -1),
|
|
991
|
-
behavior:
|
|
1523
|
+
behavior: scrollMode,
|
|
992
1524
|
});
|
|
993
1525
|
};
|
|
994
1526
|
this.toggleMonthAndYearView = () => {
|
|
@@ -1103,6 +1635,16 @@ const Datetime = class {
|
|
|
1103
1635
|
this.closeParentOverlay(CANCEL_ROLE);
|
|
1104
1636
|
}
|
|
1105
1637
|
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Returns the default parts the datetime falls back to when no value is set:
|
|
1640
|
+
* today's date and time snapped to the closest value allowed by the
|
|
1641
|
+
* component's constraints (`min`, `max`, and the `*Values` props).
|
|
1642
|
+
*
|
|
1643
|
+
* @internal
|
|
1644
|
+
*/
|
|
1645
|
+
async getDefaultPart() {
|
|
1646
|
+
return this.defaultParts;
|
|
1647
|
+
}
|
|
1106
1648
|
get isCalendarPicker() {
|
|
1107
1649
|
const { presentation } = this;
|
|
1108
1650
|
return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
@@ -1119,7 +1661,6 @@ const Datetime = class {
|
|
|
1119
1661
|
this.clearFocusVisible = undefined;
|
|
1120
1662
|
}
|
|
1121
1663
|
this.loadTimeoutCleanup();
|
|
1122
|
-
this.hasBeenIntersecting = false;
|
|
1123
1664
|
}
|
|
1124
1665
|
initializeListeners() {
|
|
1125
1666
|
this.initializeCalendarListener();
|
|
@@ -1149,7 +1690,7 @@ const Datetime = class {
|
|
|
1149
1690
|
* could cause the datetime to start at a visibility of 0, erroneously
|
|
1150
1691
|
* triggering the `hiddenIO` observer below.
|
|
1151
1692
|
*/
|
|
1152
|
-
raf(() => visibleIO
|
|
1693
|
+
raf(() => visibleIO?.observe(intersectionTrackerRef));
|
|
1153
1694
|
/**
|
|
1154
1695
|
* TODO(FW-6931): Remove this fallback upon solving the root cause
|
|
1155
1696
|
* Fallback: If IntersectionObserver never reports that the
|
|
@@ -1195,7 +1736,7 @@ const Datetime = class {
|
|
|
1195
1736
|
});
|
|
1196
1737
|
};
|
|
1197
1738
|
const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
|
|
1198
|
-
raf(() => hiddenIO
|
|
1739
|
+
raf(() => hiddenIO?.observe(intersectionTrackerRef));
|
|
1199
1740
|
/**
|
|
1200
1741
|
* Datetime uses Ionic components that emit
|
|
1201
1742
|
* ionFocus and ionBlur. These events are
|
|
@@ -1376,7 +1917,6 @@ const Datetime = class {
|
|
|
1376
1917
|
}
|
|
1377
1918
|
renderCombinedDatePickerColumn() {
|
|
1378
1919
|
const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
1379
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1380
1920
|
/**
|
|
1381
1921
|
* By default, generate a range of 3 months:
|
|
1382
1922
|
* Previous month, current month, and next month
|
|
@@ -1416,7 +1956,10 @@ const Datetime = class {
|
|
|
1416
1956
|
catch (e) {
|
|
1417
1957
|
printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1418
1958
|
}
|
|
1419
|
-
return
|
|
1959
|
+
return {
|
|
1960
|
+
...itemObject,
|
|
1961
|
+
disabled,
|
|
1962
|
+
};
|
|
1420
1963
|
});
|
|
1421
1964
|
}
|
|
1422
1965
|
/**
|
|
@@ -1429,10 +1972,18 @@ const Datetime = class {
|
|
|
1429
1972
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1430
1973
|
const { value } = ev.detail;
|
|
1431
1974
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
1432
|
-
|
|
1433
|
-
this.
|
|
1975
|
+
// Read live so parts a sibling column just committed are included.
|
|
1976
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1977
|
+
this.setWorkingParts({
|
|
1978
|
+
...this.workingParts,
|
|
1979
|
+
...findPart,
|
|
1980
|
+
});
|
|
1981
|
+
this.setActiveParts({
|
|
1982
|
+
...activePart,
|
|
1983
|
+
...findPart,
|
|
1984
|
+
});
|
|
1434
1985
|
ev.stopPropagation();
|
|
1435
|
-
} }, items.map((item) => (h("ion-picker-column-option", { part: item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: item.value, disabled: item.disabled, value: item.value }, item.text)))));
|
|
1986
|
+
} }, items.map((item) => (h("ion-picker-column-option", { color: this.color, part: item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: item.value, disabled: item.disabled, value: item.value }, item.text)))));
|
|
1436
1987
|
}
|
|
1437
1988
|
renderIndividualDatePickerColumns(forcePresentation) {
|
|
1438
1989
|
const { workingParts, isDateEnabled } = this;
|
|
@@ -1465,7 +2016,10 @@ const Datetime = class {
|
|
|
1465
2016
|
catch (e) {
|
|
1466
2017
|
printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1467
2018
|
}
|
|
1468
|
-
return
|
|
2019
|
+
return {
|
|
2020
|
+
...dayObject,
|
|
2021
|
+
disabled,
|
|
2022
|
+
};
|
|
1469
2023
|
});
|
|
1470
2024
|
}
|
|
1471
2025
|
const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
|
|
@@ -1494,42 +2048,68 @@ const Datetime = class {
|
|
|
1494
2048
|
return renderArray;
|
|
1495
2049
|
}
|
|
1496
2050
|
renderDayPickerColumn(days) {
|
|
1497
|
-
var _a;
|
|
1498
2051
|
if (days.length === 0) {
|
|
1499
2052
|
return [];
|
|
1500
2053
|
}
|
|
1501
2054
|
const { disabled, workingParts } = this;
|
|
1502
|
-
const
|
|
1503
|
-
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
2055
|
+
const pickerColumnValue = (workingParts.day !== null ? workingParts.day : this.defaultParts.day) ?? undefined;
|
|
1504
2056
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1505
|
-
|
|
1506
|
-
|
|
2057
|
+
// Read live so parts a sibling column just committed are included.
|
|
2058
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2059
|
+
this.setWorkingParts({
|
|
2060
|
+
...this.workingParts,
|
|
2061
|
+
day: ev.detail.value,
|
|
2062
|
+
});
|
|
2063
|
+
this.setActiveParts({
|
|
2064
|
+
...activePart,
|
|
2065
|
+
day: ev.detail.value,
|
|
2066
|
+
});
|
|
1507
2067
|
ev.stopPropagation();
|
|
1508
|
-
} }, days.map((day) => (h("ion-picker-column-option", { part: day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: day.value, disabled: day.disabled, value: day.value }, day.text)))));
|
|
2068
|
+
} }, days.map((day) => (h("ion-picker-column-option", { color: this.color, part: day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: day.value, disabled: day.disabled, value: day.value }, day.text)))));
|
|
1509
2069
|
}
|
|
1510
2070
|
renderMonthPickerColumn(months) {
|
|
1511
2071
|
if (months.length === 0) {
|
|
1512
2072
|
return [];
|
|
1513
2073
|
}
|
|
1514
2074
|
const { disabled, workingParts } = this;
|
|
1515
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1516
2075
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
1517
|
-
|
|
1518
|
-
|
|
2076
|
+
// Read live so parts a sibling column just committed are included.
|
|
2077
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2078
|
+
this.setWorkingParts({
|
|
2079
|
+
...this.workingParts,
|
|
2080
|
+
month: ev.detail.value,
|
|
2081
|
+
});
|
|
2082
|
+
// Month wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
|
|
2083
|
+
if (!this.multiple) {
|
|
2084
|
+
this.setActiveParts({
|
|
2085
|
+
...activePart,
|
|
2086
|
+
month: ev.detail.value,
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
1519
2089
|
ev.stopPropagation();
|
|
1520
|
-
} }, months.map((month) => (h("ion-picker-column-option", { part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
|
|
2090
|
+
} }, months.map((month) => (h("ion-picker-column-option", { color: this.color, part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
|
|
1521
2091
|
}
|
|
1522
2092
|
renderYearPickerColumn(years) {
|
|
1523
2093
|
if (years.length === 0) {
|
|
1524
2094
|
return [];
|
|
1525
2095
|
}
|
|
1526
2096
|
const { disabled, workingParts } = this;
|
|
1527
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1528
2097
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
1529
|
-
|
|
1530
|
-
|
|
2098
|
+
// Read live so parts a sibling column just committed are included.
|
|
2099
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2100
|
+
this.setWorkingParts({
|
|
2101
|
+
...this.workingParts,
|
|
2102
|
+
year: ev.detail.value,
|
|
2103
|
+
});
|
|
2104
|
+
// Year wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
|
|
2105
|
+
if (!this.multiple) {
|
|
2106
|
+
this.setActiveParts({
|
|
2107
|
+
...activePart,
|
|
2108
|
+
year: ev.detail.value,
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
1531
2111
|
ev.stopPropagation();
|
|
1532
|
-
} }, years.map((year) => (h("ion-picker-column-option", { part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
|
|
2112
|
+
} }, years.map((year) => (h("ion-picker-column-option", { color: this.color, part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
|
|
1533
2113
|
}
|
|
1534
2114
|
renderTimePickerColumns(forcePresentation) {
|
|
1535
2115
|
if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
|
|
@@ -1554,40 +2134,64 @@ const Datetime = class {
|
|
|
1554
2134
|
];
|
|
1555
2135
|
}
|
|
1556
2136
|
renderHourPickerColumn(hoursData) {
|
|
1557
|
-
const { disabled
|
|
2137
|
+
const { disabled } = this;
|
|
1558
2138
|
if (hoursData.length === 0)
|
|
1559
2139
|
return [];
|
|
1560
2140
|
const activePart = this.getActivePartsWithFallback();
|
|
1561
2141
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1562
|
-
|
|
1563
|
-
this.
|
|
2142
|
+
// Read live so parts a sibling column just committed are included.
|
|
2143
|
+
this.setWorkingParts({
|
|
2144
|
+
...this.workingParts,
|
|
2145
|
+
hour: ev.detail.value,
|
|
2146
|
+
});
|
|
2147
|
+
this.setActiveParts({
|
|
2148
|
+
...this.getActivePartsWithFallback(),
|
|
2149
|
+
hour: ev.detail.value,
|
|
2150
|
+
});
|
|
1564
2151
|
ev.stopPropagation();
|
|
1565
|
-
} }, hoursData.map((hour) => (h("ion-picker-column-option", { part: hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: hour.value, disabled: hour.disabled, value: hour.value }, hour.text)))));
|
|
2152
|
+
} }, hoursData.map((hour) => (h("ion-picker-column-option", { color: this.color, part: hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: hour.value, disabled: hour.disabled, value: hour.value }, hour.text)))));
|
|
1566
2153
|
}
|
|
1567
2154
|
renderMinutePickerColumn(minutesData) {
|
|
1568
|
-
const { disabled
|
|
2155
|
+
const { disabled } = this;
|
|
1569
2156
|
if (minutesData.length === 0)
|
|
1570
2157
|
return [];
|
|
1571
2158
|
const activePart = this.getActivePartsWithFallback();
|
|
1572
2159
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1573
|
-
|
|
1574
|
-
this.
|
|
2160
|
+
// Read live so parts a sibling column just committed are included.
|
|
2161
|
+
this.setWorkingParts({
|
|
2162
|
+
...this.workingParts,
|
|
2163
|
+
minute: ev.detail.value,
|
|
2164
|
+
});
|
|
2165
|
+
this.setActiveParts({
|
|
2166
|
+
...this.getActivePartsWithFallback(),
|
|
2167
|
+
minute: ev.detail.value,
|
|
2168
|
+
});
|
|
1575
2169
|
ev.stopPropagation();
|
|
1576
|
-
} }, minutesData.map((minute) => (h("ion-picker-column-option", { part: minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: minute.value, disabled: minute.disabled, value: minute.value }, minute.text)))));
|
|
2170
|
+
} }, minutesData.map((minute) => (h("ion-picker-column-option", { color: this.color, part: minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: minute.value, disabled: minute.disabled, value: minute.value }, minute.text)))));
|
|
1577
2171
|
}
|
|
1578
2172
|
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
1579
|
-
const { disabled
|
|
2173
|
+
const { disabled } = this;
|
|
1580
2174
|
if (dayPeriodData.length === 0) {
|
|
1581
2175
|
return [];
|
|
1582
2176
|
}
|
|
1583
2177
|
const activePart = this.getActivePartsWithFallback();
|
|
1584
2178
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
1585
2179
|
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
2180
|
+
// Read live so parts a sibling column just committed are included.
|
|
2181
|
+
const currentParts = this.workingParts;
|
|
2182
|
+
const hour = calculateHourFromAMPM(currentParts, ev.detail.value);
|
|
2183
|
+
this.setWorkingParts({
|
|
2184
|
+
...currentParts,
|
|
2185
|
+
ampm: ev.detail.value,
|
|
2186
|
+
hour,
|
|
2187
|
+
});
|
|
2188
|
+
this.setActiveParts({
|
|
2189
|
+
...this.getActivePartsWithFallback(),
|
|
2190
|
+
ampm: ev.detail.value,
|
|
2191
|
+
hour,
|
|
2192
|
+
});
|
|
1589
2193
|
ev.stopPropagation();
|
|
1590
|
-
} }, dayPeriodData.map((dayPeriod) => (h("ion-picker-column-option", { part: dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: dayPeriod.value, disabled: dayPeriod.disabled, value: dayPeriod.value }, dayPeriod.text)))));
|
|
2194
|
+
} }, dayPeriodData.map((dayPeriod) => (h("ion-picker-column-option", { color: this.color, part: dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: dayPeriod.value, disabled: dayPeriod.disabled, value: dayPeriod.value }, dayPeriod.text)))));
|
|
1591
2195
|
}
|
|
1592
2196
|
renderWheelView(forcePresentation) {
|
|
1593
2197
|
const { locale } = this;
|
|
@@ -1631,8 +2235,8 @@ const Datetime = class {
|
|
|
1631
2235
|
// The day is not used when checking if a month is disabled.
|
|
1632
2236
|
// Users should be able to access the min or max month, even if the
|
|
1633
2237
|
// min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
|
|
1634
|
-
minParts:
|
|
1635
|
-
maxParts:
|
|
2238
|
+
minParts: { ...this.minParts, day: null },
|
|
2239
|
+
maxParts: { ...this.maxParts, day: null },
|
|
1636
2240
|
});
|
|
1637
2241
|
// The working month should never have swipe disabled.
|
|
1638
2242
|
// Otherwise the CSS scroll snap will not work and the user
|
|
@@ -1741,18 +2345,24 @@ const Datetime = class {
|
|
|
1741
2345
|
if (isAdjacentDay) {
|
|
1742
2346
|
// The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
|
|
1743
2347
|
this.el.blur();
|
|
1744
|
-
this.activeParts =
|
|
2348
|
+
this.activeParts = { ...activePart, ...referenceParts };
|
|
1745
2349
|
this.animateToDate(referenceParts);
|
|
1746
2350
|
this.confirm();
|
|
1747
2351
|
}
|
|
1748
2352
|
else {
|
|
1749
|
-
this.setWorkingParts(
|
|
2353
|
+
this.setWorkingParts({
|
|
2354
|
+
...this.workingParts,
|
|
2355
|
+
...referenceParts,
|
|
2356
|
+
});
|
|
1750
2357
|
// Multiple only needs date info so we can wipe out other fields like time.
|
|
1751
2358
|
if (multiple) {
|
|
1752
2359
|
this.setActiveParts(referenceParts, isActive);
|
|
1753
2360
|
}
|
|
1754
2361
|
else {
|
|
1755
|
-
this.setActiveParts(
|
|
2362
|
+
this.setActiveParts({
|
|
2363
|
+
...activePart,
|
|
2364
|
+
...referenceParts,
|
|
2365
|
+
});
|
|
1756
2366
|
}
|
|
1757
2367
|
}
|
|
1758
2368
|
}
|
|
@@ -1795,7 +2405,7 @@ const Datetime = class {
|
|
|
1795
2405
|
await popoverRef.onWillDismiss();
|
|
1796
2406
|
this.isTimePopoverOpen = false;
|
|
1797
2407
|
}
|
|
1798
|
-
} }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions
|
|
2408
|
+
} }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions?.time)),
|
|
1799
2409
|
h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
1800
2410
|
/**
|
|
1801
2411
|
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
@@ -1818,7 +2428,6 @@ const Datetime = class {
|
|
|
1818
2428
|
];
|
|
1819
2429
|
}
|
|
1820
2430
|
getHeaderSelectedDateText() {
|
|
1821
|
-
var _a;
|
|
1822
2431
|
const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
|
|
1823
2432
|
const isArray = Array.isArray(activeParts);
|
|
1824
2433
|
let headerText;
|
|
@@ -1835,7 +2444,7 @@ const Datetime = class {
|
|
|
1835
2444
|
}
|
|
1836
2445
|
else {
|
|
1837
2446
|
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
1838
|
-
headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(),
|
|
2447
|
+
headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), formatOptions?.date ?? { weekday: 'short', month: 'short', day: 'numeric' });
|
|
1839
2448
|
}
|
|
1840
2449
|
return headerText;
|
|
1841
2450
|
}
|
|
@@ -1924,17 +2533,19 @@ const Datetime = class {
|
|
|
1924
2533
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1925
2534
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1926
2535
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1927
|
-
return (h(Host, { key: '
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
2536
|
+
return (h(Host, { key: '4e0b529a70924b065bcc6191e08550428b5a52a0', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: {
|
|
2537
|
+
...createColorClasses(color, {
|
|
2538
|
+
[mode]: true,
|
|
2539
|
+
['datetime-readonly']: readonly,
|
|
2540
|
+
['datetime-disabled']: disabled,
|
|
2541
|
+
'show-month-and-year': shouldShowMonthAndYear,
|
|
2542
|
+
'month-year-picker-open': monthYearPickerOpen,
|
|
2543
|
+
[`datetime-presentation-${presentation}`]: true,
|
|
2544
|
+
[`datetime-size-${size}`]: true,
|
|
2545
|
+
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
2546
|
+
[`datetime-grid`]: isGridStyle,
|
|
2547
|
+
}),
|
|
2548
|
+
} }, h("div", { key: 'cc9d1b92f960984cb0466d0003a240ace67da243', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1938
2549
|
}
|
|
1939
2550
|
get el() { return getElement(this); }
|
|
1940
2551
|
static get watchers() { return {
|
|
@@ -1984,636 +2595,4 @@ Datetime.style = {
|
|
|
1984
2595
|
md: datetimeMdCss()
|
|
1985
2596
|
};
|
|
1986
2597
|
|
|
1987
|
-
|
|
1988
|
-
* iOS Picker Enter Animation
|
|
1989
|
-
*/
|
|
1990
|
-
const iosEnterAnimation = (baseEl) => {
|
|
1991
|
-
const baseAnimation = createAnimation();
|
|
1992
|
-
const backdropAnimation = createAnimation();
|
|
1993
|
-
const wrapperAnimation = createAnimation();
|
|
1994
|
-
backdropAnimation
|
|
1995
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
1996
|
-
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
1997
|
-
.beforeStyles({
|
|
1998
|
-
'pointer-events': 'none',
|
|
1999
|
-
})
|
|
2000
|
-
.afterClearStyles(['pointer-events']);
|
|
2001
|
-
wrapperAnimation
|
|
2002
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
2003
|
-
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
2004
|
-
return baseAnimation
|
|
2005
|
-
.addElement(baseEl)
|
|
2006
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
2007
|
-
.duration(400)
|
|
2008
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
2009
|
-
};
|
|
2010
|
-
|
|
2011
|
-
/**
|
|
2012
|
-
* iOS Picker Leave Animation
|
|
2013
|
-
*/
|
|
2014
|
-
const iosLeaveAnimation = (baseEl) => {
|
|
2015
|
-
const baseAnimation = createAnimation();
|
|
2016
|
-
const backdropAnimation = createAnimation();
|
|
2017
|
-
const wrapperAnimation = createAnimation();
|
|
2018
|
-
backdropAnimation
|
|
2019
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
2020
|
-
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
2021
|
-
wrapperAnimation
|
|
2022
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
2023
|
-
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
2024
|
-
return baseAnimation
|
|
2025
|
-
.addElement(baseEl)
|
|
2026
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
2027
|
-
.duration(400)
|
|
2028
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
2029
|
-
};
|
|
2030
|
-
|
|
2031
|
-
const pickerIosCss = () => `.sc-ion-picker-legacy-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-ios-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-ios-h{display:none}.picker-wrapper.sc-ion-picker-legacy-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-ios:active,.picker-button.sc-ion-picker-legacy-ios:focus{outline:none}.picker-columns.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-ios,.picker-below-highlight.sc-ion-picker-legacy-ios{display:none;pointer-events:none}.sc-ion-picker-legacy-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-legacy-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-legacy-ios:last-child .picker-button.sc-ion-picker-legacy-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-legacy-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-legacy-ios,.picker-button.ion-activated.sc-ion-picker-legacy-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:16px}.picker-columns.sc-ion-picker-legacy-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-legacy-ios{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-ios{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}`;
|
|
2032
|
-
|
|
2033
|
-
const pickerMdCss = () => `.sc-ion-picker-legacy-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-md-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-md-h{display:none}.picker-wrapper.sc-ion-picker-legacy-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-md:active,.picker-button.sc-ion-picker-legacy-md:focus{outline:none}.picker-columns.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-md,.picker-below-highlight.sc-ion-picker-legacy-md{display:none;pointer-events:none}.sc-ion-picker-legacy-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-legacy-md,.picker-button.ion-activated.sc-ion-picker-legacy-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}.picker-columns.sc-ion-picker-legacy-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-legacy-md{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-md{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}`;
|
|
2034
|
-
|
|
2035
|
-
const Picker = class {
|
|
2036
|
-
constructor(hostRef) {
|
|
2037
|
-
registerInstance(this, hostRef);
|
|
2038
|
-
this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
|
|
2039
|
-
this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
|
|
2040
|
-
this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
|
|
2041
|
-
this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
|
|
2042
|
-
this.didPresentShorthand = createEvent(this, "didPresent", 7);
|
|
2043
|
-
this.willPresentShorthand = createEvent(this, "willPresent", 7);
|
|
2044
|
-
this.willDismissShorthand = createEvent(this, "willDismiss", 7);
|
|
2045
|
-
this.didDismissShorthand = createEvent(this, "didDismiss", 7);
|
|
2046
|
-
this.delegateController = createDelegateController(this);
|
|
2047
|
-
this.lockController = createLockController();
|
|
2048
|
-
this.triggerController = createTriggerController();
|
|
2049
|
-
this.presented = false;
|
|
2050
|
-
/** @internal */
|
|
2051
|
-
this.hasController = false;
|
|
2052
|
-
/**
|
|
2053
|
-
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
|
|
2054
|
-
*/
|
|
2055
|
-
this.keyboardClose = true;
|
|
2056
|
-
/**
|
|
2057
|
-
* Array of buttons to be displayed at the top of the picker.
|
|
2058
|
-
*/
|
|
2059
|
-
this.buttons = [];
|
|
2060
|
-
/**
|
|
2061
|
-
* Array of columns to be displayed in the picker.
|
|
2062
|
-
*/
|
|
2063
|
-
this.columns = [];
|
|
2064
|
-
/**
|
|
2065
|
-
* Number of milliseconds to wait before dismissing the picker.
|
|
2066
|
-
*/
|
|
2067
|
-
this.duration = 0;
|
|
2068
|
-
/**
|
|
2069
|
-
* If `true`, a backdrop will be displayed behind the picker.
|
|
2070
|
-
*/
|
|
2071
|
-
this.showBackdrop = true;
|
|
2072
|
-
/**
|
|
2073
|
-
* If `true`, the picker will be dismissed when the backdrop is clicked.
|
|
2074
|
-
*/
|
|
2075
|
-
this.backdropDismiss = true;
|
|
2076
|
-
/**
|
|
2077
|
-
* If `true`, the picker will animate.
|
|
2078
|
-
*/
|
|
2079
|
-
this.animated = true;
|
|
2080
|
-
/**
|
|
2081
|
-
* If `true`, the picker will open. If `false`, the picker will close.
|
|
2082
|
-
* Use this if you need finer grained control over presentation, otherwise
|
|
2083
|
-
* just use the pickerController or the `trigger` property.
|
|
2084
|
-
* Note: `isOpen` will not automatically be set back to `false` when
|
|
2085
|
-
* the picker dismisses. You will need to do that in your code.
|
|
2086
|
-
*/
|
|
2087
|
-
this.isOpen = false;
|
|
2088
|
-
this.onBackdropTap = () => {
|
|
2089
|
-
this.dismiss(undefined, BACKDROP);
|
|
2090
|
-
};
|
|
2091
|
-
this.dispatchCancelHandler = (ev) => {
|
|
2092
|
-
const role = ev.detail.role;
|
|
2093
|
-
if (isCancel(role)) {
|
|
2094
|
-
const cancelButton = this.buttons.find((b) => b.role === 'cancel');
|
|
2095
|
-
this.callButtonHandler(cancelButton);
|
|
2096
|
-
}
|
|
2097
|
-
};
|
|
2098
|
-
}
|
|
2099
|
-
onIsOpenChange(newValue, oldValue) {
|
|
2100
|
-
if (newValue === true && oldValue === false) {
|
|
2101
|
-
this.present();
|
|
2102
|
-
}
|
|
2103
|
-
else if (newValue === false && oldValue === true) {
|
|
2104
|
-
this.dismiss();
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
triggerChanged() {
|
|
2108
|
-
const { trigger, el, triggerController } = this;
|
|
2109
|
-
if (trigger) {
|
|
2110
|
-
triggerController.addClickListener(el, trigger);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
connectedCallback() {
|
|
2114
|
-
prepareOverlay(this.el);
|
|
2115
|
-
this.triggerChanged();
|
|
2116
|
-
}
|
|
2117
|
-
disconnectedCallback() {
|
|
2118
|
-
this.triggerController.removeClickListener();
|
|
2119
|
-
}
|
|
2120
|
-
componentWillLoad() {
|
|
2121
|
-
var _a;
|
|
2122
|
-
if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
2123
|
-
setOverlayId(this.el);
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
componentDidLoad() {
|
|
2127
|
-
printIonWarning('[ion-picker-legacy] - ion-picker-legacy and ion-picker-legacy-column have been deprecated in favor of new versions of the ion-picker and ion-picker-column components. These new components display inline with your page content allowing for more presentation flexibility than before.', this.el);
|
|
2128
|
-
/**
|
|
2129
|
-
* If picker was rendered with isOpen="true"
|
|
2130
|
-
* then we should open picker immediately.
|
|
2131
|
-
*/
|
|
2132
|
-
if (this.isOpen === true) {
|
|
2133
|
-
raf(() => this.present());
|
|
2134
|
-
}
|
|
2135
|
-
/**
|
|
2136
|
-
* When binding values in frameworks such as Angular
|
|
2137
|
-
* it is possible for the value to be set after the Web Component
|
|
2138
|
-
* initializes but before the value watcher is set up in Stencil.
|
|
2139
|
-
* As a result, the watcher callback may not be fired.
|
|
2140
|
-
* We work around this by manually calling the watcher
|
|
2141
|
-
* callback when the component has loaded and the watcher
|
|
2142
|
-
* is configured.
|
|
2143
|
-
*/
|
|
2144
|
-
this.triggerChanged();
|
|
2145
|
-
}
|
|
2146
|
-
/**
|
|
2147
|
-
* Present the picker overlay after it has been created.
|
|
2148
|
-
*/
|
|
2149
|
-
async present() {
|
|
2150
|
-
const unlock = await this.lockController.lock();
|
|
2151
|
-
await this.delegateController.attachViewToDom();
|
|
2152
|
-
await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
|
|
2153
|
-
if (this.duration > 0) {
|
|
2154
|
-
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
|
2155
|
-
}
|
|
2156
|
-
unlock();
|
|
2157
|
-
}
|
|
2158
|
-
/**
|
|
2159
|
-
* Dismiss the picker overlay after it has been presented.
|
|
2160
|
-
*
|
|
2161
|
-
* @param data Any data to emit in the dismiss events.
|
|
2162
|
-
* @param role The role of the element that is dismissing the picker.
|
|
2163
|
-
* This can be useful in a button handler for determining which button was
|
|
2164
|
-
* clicked to dismiss the picker.
|
|
2165
|
-
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
2166
|
-
*/
|
|
2167
|
-
async dismiss(data, role) {
|
|
2168
|
-
const unlock = await this.lockController.lock();
|
|
2169
|
-
if (this.durationTimeout) {
|
|
2170
|
-
clearTimeout(this.durationTimeout);
|
|
2171
|
-
}
|
|
2172
|
-
const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
|
|
2173
|
-
if (dismissed) {
|
|
2174
|
-
this.delegateController.removeViewFromDom();
|
|
2175
|
-
}
|
|
2176
|
-
unlock();
|
|
2177
|
-
return dismissed;
|
|
2178
|
-
}
|
|
2179
|
-
/**
|
|
2180
|
-
* Returns a promise that resolves when the picker did dismiss.
|
|
2181
|
-
*/
|
|
2182
|
-
onDidDismiss() {
|
|
2183
|
-
return eventMethod(this.el, 'ionPickerDidDismiss');
|
|
2184
|
-
}
|
|
2185
|
-
/**
|
|
2186
|
-
* Returns a promise that resolves when the picker will dismiss.
|
|
2187
|
-
*/
|
|
2188
|
-
onWillDismiss() {
|
|
2189
|
-
return eventMethod(this.el, 'ionPickerWillDismiss');
|
|
2190
|
-
}
|
|
2191
|
-
/**
|
|
2192
|
-
* Get the column that matches the specified name.
|
|
2193
|
-
*
|
|
2194
|
-
* @param name The name of the column.
|
|
2195
|
-
*/
|
|
2196
|
-
getColumn(name) {
|
|
2197
|
-
return Promise.resolve(this.columns.find((column) => column.name === name));
|
|
2198
|
-
}
|
|
2199
|
-
async buttonClick(button) {
|
|
2200
|
-
const role = button.role;
|
|
2201
|
-
if (isCancel(role)) {
|
|
2202
|
-
return this.dismiss(undefined, role);
|
|
2203
|
-
}
|
|
2204
|
-
const shouldDismiss = await this.callButtonHandler(button);
|
|
2205
|
-
if (shouldDismiss) {
|
|
2206
|
-
return this.dismiss(this.getSelected(), button.role);
|
|
2207
|
-
}
|
|
2208
|
-
return Promise.resolve();
|
|
2209
|
-
}
|
|
2210
|
-
async callButtonHandler(button) {
|
|
2211
|
-
if (button) {
|
|
2212
|
-
// a handler has been provided, execute it
|
|
2213
|
-
// pass the handler the values from the inputs
|
|
2214
|
-
const rtn = await safeCall(button.handler, this.getSelected());
|
|
2215
|
-
if (rtn === false) {
|
|
2216
|
-
// if the return value of the handler is false then do not dismiss
|
|
2217
|
-
return false;
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
return true;
|
|
2221
|
-
}
|
|
2222
|
-
getSelected() {
|
|
2223
|
-
const selected = {};
|
|
2224
|
-
this.columns.forEach((col, index) => {
|
|
2225
|
-
const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
|
|
2226
|
-
selected[col.name] = {
|
|
2227
|
-
text: selectedColumn ? selectedColumn.text : undefined,
|
|
2228
|
-
value: selectedColumn ? selectedColumn.value : undefined,
|
|
2229
|
-
columnIndex: index,
|
|
2230
|
-
};
|
|
2231
|
-
});
|
|
2232
|
-
return selected;
|
|
2233
|
-
}
|
|
2234
|
-
render() {
|
|
2235
|
-
const { htmlAttributes } = this;
|
|
2236
|
-
const mode = getIonMode(this);
|
|
2237
|
-
return (h(Host, Object.assign({ key: '80f66d33780d8a1352d24be9cb63a0cc03d01ab5', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
|
2238
|
-
zIndex: `${20000 + this.overlayIndex}`,
|
|
2239
|
-
}, class: Object.assign({ [mode]: true,
|
|
2240
|
-
// Used internally for styling
|
|
2241
|
-
[`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: '97fb8e10ba08b197610cb8c0cdea61103883d55f', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: 'b3969cb6fbf7153623d14e3ca1493d3370efb211', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '299268483c3727e698d9135bfdf40349a7050ac1', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: '95394de3ef691899b7dbf416f56fd3e86bbdce3f', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '05f18bb8d00dc0e22f691b7e41f90f729a6c66d7', class: "picker-columns" }, h("div", { key: '4a8fdf224effc0af67fd413e2e6aca8a78d1cf43', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: 'e50a31db45e3f39e9d0fed36a21be9257eec09bf', class: "picker-below-highlight" }))), h("div", { key: '5a78cb2176ac807ea0c195c6b76cd0e8eef9d4c0', tabindex: "0", "aria-hidden": "true" })));
|
|
2242
|
-
}
|
|
2243
|
-
get el() { return getElement(this); }
|
|
2244
|
-
static get watchers() { return {
|
|
2245
|
-
"isOpen": [{
|
|
2246
|
-
"onIsOpenChange": 0
|
|
2247
|
-
}],
|
|
2248
|
-
"trigger": [{
|
|
2249
|
-
"triggerChanged": 0
|
|
2250
|
-
}]
|
|
2251
|
-
}; }
|
|
2252
|
-
};
|
|
2253
|
-
const buttonWrapperClass = (button) => {
|
|
2254
|
-
return {
|
|
2255
|
-
[`picker-toolbar-${button.role}`]: button.role !== undefined,
|
|
2256
|
-
'picker-toolbar-button': true,
|
|
2257
|
-
};
|
|
2258
|
-
};
|
|
2259
|
-
const buttonClass = (button) => {
|
|
2260
|
-
return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
|
|
2261
|
-
};
|
|
2262
|
-
Picker.style = {
|
|
2263
|
-
ios: pickerIosCss(),
|
|
2264
|
-
md: pickerMdCss()
|
|
2265
|
-
};
|
|
2266
|
-
|
|
2267
|
-
const pickerColumnIosCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}[dir=rtl] .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}}`;
|
|
2268
|
-
|
|
2269
|
-
const pickerColumnMdCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #0054e9)}`;
|
|
2270
|
-
|
|
2271
|
-
const PickerColumnCmp = class {
|
|
2272
|
-
constructor(hostRef) {
|
|
2273
|
-
registerInstance(this, hostRef);
|
|
2274
|
-
this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
|
|
2275
|
-
this.optHeight = 0;
|
|
2276
|
-
this.rotateFactor = 0;
|
|
2277
|
-
this.scaleFactor = 1;
|
|
2278
|
-
this.velocity = 0;
|
|
2279
|
-
this.y = 0;
|
|
2280
|
-
this.noAnimate = true;
|
|
2281
|
-
// `colDidChange` is a flag that gets set when the column is changed
|
|
2282
|
-
// dynamically. When this flag is set, the column will refresh
|
|
2283
|
-
// after the component re-renders to incorporate the new column data.
|
|
2284
|
-
// This is necessary because `this.refresh` queries for the option elements,
|
|
2285
|
-
// so it needs to wait for the latest elements to be available in the DOM.
|
|
2286
|
-
// Ex: column is created with 3 options. User updates the column data
|
|
2287
|
-
// to have 5 options. The column will still think it only has 3 options.
|
|
2288
|
-
this.colDidChange = false;
|
|
2289
|
-
}
|
|
2290
|
-
colChanged() {
|
|
2291
|
-
this.colDidChange = true;
|
|
2292
|
-
}
|
|
2293
|
-
async connectedCallback() {
|
|
2294
|
-
let pickerRotateFactor = 0;
|
|
2295
|
-
let pickerScaleFactor = 0.81;
|
|
2296
|
-
const mode = getIonMode(this);
|
|
2297
|
-
if (mode === 'ios') {
|
|
2298
|
-
pickerRotateFactor = -0.46;
|
|
2299
|
-
pickerScaleFactor = 1;
|
|
2300
|
-
}
|
|
2301
|
-
this.rotateFactor = pickerRotateFactor;
|
|
2302
|
-
this.scaleFactor = pickerScaleFactor;
|
|
2303
|
-
this.gesture = (await import('./index-CfgBF1SE.js')).createGesture({
|
|
2304
|
-
el: this.el,
|
|
2305
|
-
gestureName: 'picker-swipe',
|
|
2306
|
-
gesturePriority: 100,
|
|
2307
|
-
threshold: 0,
|
|
2308
|
-
passive: false,
|
|
2309
|
-
onStart: (ev) => this.onStart(ev),
|
|
2310
|
-
onMove: (ev) => this.onMove(ev),
|
|
2311
|
-
onEnd: (ev) => this.onEnd(ev),
|
|
2312
|
-
});
|
|
2313
|
-
this.gesture.enable();
|
|
2314
|
-
// Options have not been initialized yet
|
|
2315
|
-
// Animation must be disabled through the `noAnimate` flag
|
|
2316
|
-
// Otherwise, the options will render
|
|
2317
|
-
// at the top of the column and transition down
|
|
2318
|
-
this.tmrId = setTimeout(() => {
|
|
2319
|
-
this.noAnimate = false;
|
|
2320
|
-
// After initialization, `refresh()` will be called
|
|
2321
|
-
// At this point, animation will be enabled. The options will
|
|
2322
|
-
// animate as they are being selected.
|
|
2323
|
-
this.refresh(true);
|
|
2324
|
-
}, 250);
|
|
2325
|
-
}
|
|
2326
|
-
componentDidLoad() {
|
|
2327
|
-
this.onDomChange();
|
|
2328
|
-
}
|
|
2329
|
-
componentDidUpdate() {
|
|
2330
|
-
// Options may have changed since last update.
|
|
2331
|
-
if (this.colDidChange) {
|
|
2332
|
-
// Animation must be disabled through the `onDomChange` parameter.
|
|
2333
|
-
// Otherwise, the recently added options will render
|
|
2334
|
-
// at the top of the column and transition down
|
|
2335
|
-
this.onDomChange(true, false);
|
|
2336
|
-
this.colDidChange = false;
|
|
2337
|
-
}
|
|
2338
|
-
}
|
|
2339
|
-
disconnectedCallback() {
|
|
2340
|
-
if (this.rafId !== undefined)
|
|
2341
|
-
cancelAnimationFrame(this.rafId);
|
|
2342
|
-
if (this.tmrId)
|
|
2343
|
-
clearTimeout(this.tmrId);
|
|
2344
|
-
if (this.gesture) {
|
|
2345
|
-
this.gesture.destroy();
|
|
2346
|
-
this.gesture = undefined;
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
emitColChange() {
|
|
2350
|
-
this.ionPickerColChange.emit(this.col);
|
|
2351
|
-
}
|
|
2352
|
-
setSelected(selectedIndex, duration) {
|
|
2353
|
-
// if there is a selected index, then figure out it's y position
|
|
2354
|
-
// if there isn't a selected index, then just use the top y position
|
|
2355
|
-
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
2356
|
-
this.velocity = 0;
|
|
2357
|
-
// set what y position we're at
|
|
2358
|
-
if (this.rafId !== undefined)
|
|
2359
|
-
cancelAnimationFrame(this.rafId);
|
|
2360
|
-
this.update(y, duration, true);
|
|
2361
|
-
this.emitColChange();
|
|
2362
|
-
}
|
|
2363
|
-
update(y, duration, saveY) {
|
|
2364
|
-
if (!this.optsEl) {
|
|
2365
|
-
return;
|
|
2366
|
-
}
|
|
2367
|
-
// ensure we've got a good round number :)
|
|
2368
|
-
let translateY = 0;
|
|
2369
|
-
let translateZ = 0;
|
|
2370
|
-
const { col, rotateFactor } = this;
|
|
2371
|
-
const prevSelected = col.selectedIndex;
|
|
2372
|
-
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
2373
|
-
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
2374
|
-
const scaleStr = `scale(${this.scaleFactor})`;
|
|
2375
|
-
const children = this.optsEl.children;
|
|
2376
|
-
for (let i = 0; i < children.length; i++) {
|
|
2377
|
-
const button = children[i];
|
|
2378
|
-
const opt = col.options[i];
|
|
2379
|
-
const optOffset = i * this.optHeight + y;
|
|
2380
|
-
let transform = '';
|
|
2381
|
-
if (rotateFactor !== 0) {
|
|
2382
|
-
const rotateX = optOffset * rotateFactor;
|
|
2383
|
-
if (Math.abs(rotateX) <= 90) {
|
|
2384
|
-
translateY = 0;
|
|
2385
|
-
translateZ = 90;
|
|
2386
|
-
transform = `rotateX(${rotateX}deg) `;
|
|
2387
|
-
}
|
|
2388
|
-
else {
|
|
2389
|
-
translateY = -9999;
|
|
2390
|
-
}
|
|
2391
|
-
}
|
|
2392
|
-
else {
|
|
2393
|
-
translateZ = 0;
|
|
2394
|
-
translateY = optOffset;
|
|
2395
|
-
}
|
|
2396
|
-
const selected = selectedIndex === i;
|
|
2397
|
-
transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
|
2398
|
-
if (this.scaleFactor !== 1 && !selected) {
|
|
2399
|
-
transform += scaleStr;
|
|
2400
|
-
}
|
|
2401
|
-
// Update transition duration
|
|
2402
|
-
if (this.noAnimate) {
|
|
2403
|
-
opt.duration = 0;
|
|
2404
|
-
button.style.transitionDuration = '';
|
|
2405
|
-
}
|
|
2406
|
-
else if (duration !== opt.duration) {
|
|
2407
|
-
opt.duration = duration;
|
|
2408
|
-
button.style.transitionDuration = durationStr;
|
|
2409
|
-
}
|
|
2410
|
-
// Update transform
|
|
2411
|
-
if (transform !== opt.transform) {
|
|
2412
|
-
opt.transform = transform;
|
|
2413
|
-
}
|
|
2414
|
-
button.style.transform = transform;
|
|
2415
|
-
/**
|
|
2416
|
-
* Ensure that the select column
|
|
2417
|
-
* item has the selected class
|
|
2418
|
-
*/
|
|
2419
|
-
opt.selected = selected;
|
|
2420
|
-
if (selected) {
|
|
2421
|
-
button.classList.add(PICKER_OPT_SELECTED);
|
|
2422
|
-
}
|
|
2423
|
-
else {
|
|
2424
|
-
button.classList.remove(PICKER_OPT_SELECTED);
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
this.col.prevSelected = prevSelected;
|
|
2428
|
-
if (saveY) {
|
|
2429
|
-
this.y = y;
|
|
2430
|
-
}
|
|
2431
|
-
if (this.lastIndex !== selectedIndex) {
|
|
2432
|
-
// have not set a last index yet
|
|
2433
|
-
hapticSelectionChanged();
|
|
2434
|
-
this.lastIndex = selectedIndex;
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
decelerate() {
|
|
2438
|
-
if (this.velocity !== 0) {
|
|
2439
|
-
// still decelerating
|
|
2440
|
-
this.velocity *= DECELERATION_FRICTION;
|
|
2441
|
-
// do not let it go slower than a velocity of 1
|
|
2442
|
-
this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
|
|
2443
|
-
let y = this.y + this.velocity;
|
|
2444
|
-
if (y > this.minY) {
|
|
2445
|
-
// whoops, it's trying to scroll up farther than the options we have!
|
|
2446
|
-
y = this.minY;
|
|
2447
|
-
this.velocity = 0;
|
|
2448
|
-
}
|
|
2449
|
-
else if (y < this.maxY) {
|
|
2450
|
-
// gahh, it's trying to scroll down farther than we can!
|
|
2451
|
-
y = this.maxY;
|
|
2452
|
-
this.velocity = 0;
|
|
2453
|
-
}
|
|
2454
|
-
this.update(y, 0, true);
|
|
2455
|
-
const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
|
|
2456
|
-
if (notLockedIn) {
|
|
2457
|
-
// isn't locked in yet, keep decelerating until it is
|
|
2458
|
-
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
2459
|
-
}
|
|
2460
|
-
else {
|
|
2461
|
-
this.velocity = 0;
|
|
2462
|
-
this.emitColChange();
|
|
2463
|
-
hapticSelectionEnd();
|
|
2464
|
-
}
|
|
2465
|
-
}
|
|
2466
|
-
else if (this.y % this.optHeight !== 0) {
|
|
2467
|
-
// needs to still get locked into a position so options line up
|
|
2468
|
-
const currentPos = Math.abs(this.y % this.optHeight);
|
|
2469
|
-
// create a velocity in the direction it needs to scroll
|
|
2470
|
-
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
2471
|
-
this.decelerate();
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
|
-
indexForY(y) {
|
|
2475
|
-
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
2476
|
-
}
|
|
2477
|
-
onStart(detail) {
|
|
2478
|
-
// We have to prevent default in order to block scrolling under the picker
|
|
2479
|
-
// but we DO NOT have to stop propagation, since we still want
|
|
2480
|
-
// some "click" events to capture
|
|
2481
|
-
if (detail.event.cancelable) {
|
|
2482
|
-
detail.event.preventDefault();
|
|
2483
|
-
}
|
|
2484
|
-
detail.event.stopPropagation();
|
|
2485
|
-
hapticSelectionStart();
|
|
2486
|
-
// reset everything
|
|
2487
|
-
if (this.rafId !== undefined)
|
|
2488
|
-
cancelAnimationFrame(this.rafId);
|
|
2489
|
-
const options = this.col.options;
|
|
2490
|
-
let minY = options.length - 1;
|
|
2491
|
-
let maxY = 0;
|
|
2492
|
-
for (let i = 0; i < options.length; i++) {
|
|
2493
|
-
if (!options[i].disabled) {
|
|
2494
|
-
minY = Math.min(minY, i);
|
|
2495
|
-
maxY = Math.max(maxY, i);
|
|
2496
|
-
}
|
|
2497
|
-
}
|
|
2498
|
-
this.minY = -(minY * this.optHeight);
|
|
2499
|
-
this.maxY = -(maxY * this.optHeight);
|
|
2500
|
-
}
|
|
2501
|
-
onMove(detail) {
|
|
2502
|
-
if (detail.event.cancelable) {
|
|
2503
|
-
detail.event.preventDefault();
|
|
2504
|
-
}
|
|
2505
|
-
detail.event.stopPropagation();
|
|
2506
|
-
// update the scroll position relative to pointer start position
|
|
2507
|
-
let y = this.y + detail.deltaY;
|
|
2508
|
-
if (y > this.minY) {
|
|
2509
|
-
// scrolling up higher than scroll area
|
|
2510
|
-
y = Math.pow(y, 0.8);
|
|
2511
|
-
this.bounceFrom = y;
|
|
2512
|
-
}
|
|
2513
|
-
else if (y < this.maxY) {
|
|
2514
|
-
// scrolling down below scroll area
|
|
2515
|
-
y += Math.pow(this.maxY - y, 0.9);
|
|
2516
|
-
this.bounceFrom = y;
|
|
2517
|
-
}
|
|
2518
|
-
else {
|
|
2519
|
-
this.bounceFrom = 0;
|
|
2520
|
-
}
|
|
2521
|
-
this.update(y, 0, false);
|
|
2522
|
-
}
|
|
2523
|
-
onEnd(detail) {
|
|
2524
|
-
if (this.bounceFrom > 0) {
|
|
2525
|
-
// bounce back up
|
|
2526
|
-
this.update(this.minY, 100, true);
|
|
2527
|
-
this.emitColChange();
|
|
2528
|
-
return;
|
|
2529
|
-
}
|
|
2530
|
-
else if (this.bounceFrom < 0) {
|
|
2531
|
-
// bounce back down
|
|
2532
|
-
this.update(this.maxY, 100, true);
|
|
2533
|
-
this.emitColChange();
|
|
2534
|
-
return;
|
|
2535
|
-
}
|
|
2536
|
-
this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
|
2537
|
-
if (this.velocity === 0 && detail.deltaY === 0) {
|
|
2538
|
-
const opt = detail.event.target.closest('.picker-opt');
|
|
2539
|
-
if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
|
|
2540
|
-
this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
|
2541
|
-
}
|
|
2542
|
-
}
|
|
2543
|
-
else {
|
|
2544
|
-
this.y += detail.deltaY;
|
|
2545
|
-
if (Math.abs(detail.velocityY) < 0.05) {
|
|
2546
|
-
const isScrollingUp = detail.deltaY > 0;
|
|
2547
|
-
const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
|
2548
|
-
if (isScrollingUp && optHeightFraction > 0.5) {
|
|
2549
|
-
this.velocity = Math.abs(this.velocity) * -1;
|
|
2550
|
-
}
|
|
2551
|
-
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
2552
|
-
this.velocity = Math.abs(this.velocity);
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
this.decelerate();
|
|
2556
|
-
}
|
|
2557
|
-
}
|
|
2558
|
-
refresh(forceRefresh, animated) {
|
|
2559
|
-
var _a;
|
|
2560
|
-
let min = this.col.options.length - 1;
|
|
2561
|
-
let max = 0;
|
|
2562
|
-
const options = this.col.options;
|
|
2563
|
-
for (let i = 0; i < options.length; i++) {
|
|
2564
|
-
if (!options[i].disabled) {
|
|
2565
|
-
min = Math.min(min, i);
|
|
2566
|
-
max = Math.max(max, i);
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
/**
|
|
2570
|
-
* Only update selected value if column has a
|
|
2571
|
-
* velocity of 0. If it does not, then the
|
|
2572
|
-
* column is animating might land on
|
|
2573
|
-
* a value different than the value at
|
|
2574
|
-
* selectedIndex
|
|
2575
|
-
*/
|
|
2576
|
-
if (this.velocity !== 0) {
|
|
2577
|
-
return;
|
|
2578
|
-
}
|
|
2579
|
-
const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
|
|
2580
|
-
if (this.col.prevSelected !== selectedIndex || forceRefresh) {
|
|
2581
|
-
const y = selectedIndex * this.optHeight * -1;
|
|
2582
|
-
const duration = animated ? TRANSITION_DURATION : 0;
|
|
2583
|
-
this.velocity = 0;
|
|
2584
|
-
this.update(y, duration, true);
|
|
2585
|
-
}
|
|
2586
|
-
}
|
|
2587
|
-
onDomChange(forceRefresh, animated) {
|
|
2588
|
-
const colEl = this.optsEl;
|
|
2589
|
-
if (colEl) {
|
|
2590
|
-
// DOM READ
|
|
2591
|
-
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
|
|
2592
|
-
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
2593
|
-
}
|
|
2594
|
-
this.refresh(forceRefresh, animated);
|
|
2595
|
-
}
|
|
2596
|
-
render() {
|
|
2597
|
-
const col = this.col;
|
|
2598
|
-
const mode = getIonMode(this);
|
|
2599
|
-
return (h(Host, { key: '86125e95f18837dfd021db01777d72a1562d8ee3', class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
2600
|
-
'max-width': this.col.columnWidth,
|
|
2601
|
-
} }, col.prefix && (h("div", { key: 'b0f3d39e0bd128781066ffefb7a1e40d12a9e76d', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { key: '0b106ac4d56916eaaa7f09d1b68348b3754b7bba', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { key: '00ff2f9dbb4561787e5a5223327c6a2a33f8362e', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
2602
|
-
}
|
|
2603
|
-
get el() { return getElement(this); }
|
|
2604
|
-
static get watchers() { return {
|
|
2605
|
-
"col": [{
|
|
2606
|
-
"colChanged": 0
|
|
2607
|
-
}]
|
|
2608
|
-
}; }
|
|
2609
|
-
};
|
|
2610
|
-
const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
|
2611
|
-
const DECELERATION_FRICTION = 0.97;
|
|
2612
|
-
const MAX_PICKER_SPEED = 90;
|
|
2613
|
-
const TRANSITION_DURATION = 150;
|
|
2614
|
-
PickerColumnCmp.style = {
|
|
2615
|
-
ios: pickerColumnIosCss(),
|
|
2616
|
-
md: pickerColumnMdCss()
|
|
2617
|
-
};
|
|
2618
|
-
|
|
2619
|
-
export { Datetime as ion_datetime, Picker as ion_picker_legacy, PickerColumnCmp as ion_picker_legacy_column };
|
|
2598
|
+
export { Datetime as ion_datetime };
|