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
|
@@ -3,23 +3,541 @@
|
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-DXoo08JC.js');
|
|
7
7
|
var focusVisible = require('./focus-visible-CCvKiLh3.js');
|
|
8
|
-
var helpers = require('./helpers-
|
|
9
|
-
var overlays = require('./overlays-
|
|
10
|
-
var dir = require('./dir-
|
|
11
|
-
var theme = require('./theme-
|
|
12
|
-
var index$1 = require('./index-
|
|
13
|
-
var ionicGlobal = require('./ionic-global-
|
|
14
|
-
var
|
|
15
|
-
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
16
|
-
var animation = require('./animation-BJq0kcy2.js');
|
|
17
|
-
var haptic = require('./haptic-ClPPQ_PS.js');
|
|
8
|
+
var helpers = require('./helpers-7wzdhdeg.js');
|
|
9
|
+
var overlays = require('./overlays-BR21NUIG.js');
|
|
10
|
+
var dir = require('./dir-zwDPRE5K.js');
|
|
11
|
+
var theme = require('./theme-Bw0rpaNN.js');
|
|
12
|
+
var index$1 = require('./index-wOmugbdg.js');
|
|
13
|
+
var ionicGlobal = require('./ionic-global-CYJNT-2P.js');
|
|
14
|
+
var format = require('./format-bHU8N1g5.js');
|
|
18
15
|
require('./index-DkNv4J_i.js');
|
|
19
|
-
require('./hardware-back-button-
|
|
20
|
-
require('./framework-delegate-
|
|
21
|
-
require('./gesture-controller-
|
|
22
|
-
|
|
16
|
+
require('./hardware-back-button-Bu4Dzw8l.js');
|
|
17
|
+
require('./framework-delegate-d-fWfeI6.js');
|
|
18
|
+
require('./gesture-controller-CeJslptU.js');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the current date as
|
|
22
|
+
* an ISO string in the user's
|
|
23
|
+
* time zone.
|
|
24
|
+
*/
|
|
25
|
+
const getToday = () => {
|
|
26
|
+
/**
|
|
27
|
+
* ion-datetime intentionally does not
|
|
28
|
+
* parse time zones/do automatic time zone
|
|
29
|
+
* conversion when accepting user input.
|
|
30
|
+
* However when we get today's date string,
|
|
31
|
+
* we want it formatted relative to the user's
|
|
32
|
+
* time zone.
|
|
33
|
+
*
|
|
34
|
+
* When calling toISOString(), the browser
|
|
35
|
+
* will convert the date to UTC time by either adding
|
|
36
|
+
* or subtracting the time zone offset.
|
|
37
|
+
* To work around this, we need to either add
|
|
38
|
+
* or subtract the time zone offset to the Date
|
|
39
|
+
* object prior to calling toISOString().
|
|
40
|
+
* This allows us to get an ISO string
|
|
41
|
+
* that is in the user's time zone.
|
|
42
|
+
*/
|
|
43
|
+
return format.removeDateTzOffset(new Date()).toISOString();
|
|
44
|
+
};
|
|
45
|
+
const minutes = [
|
|
46
|
+
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,
|
|
47
|
+
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,
|
|
48
|
+
];
|
|
49
|
+
// h11 hour system uses 0-11. Midnight starts at 0:00am.
|
|
50
|
+
const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
51
|
+
// h12 hour system uses 0-12. Midnight starts at 12:00am.
|
|
52
|
+
const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
53
|
+
// h23 hour system uses 0-23. Midnight starts at 0:00.
|
|
54
|
+
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];
|
|
55
|
+
// h24 hour system uses 1-24. Midnight starts at 24:00.
|
|
56
|
+
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];
|
|
57
|
+
/**
|
|
58
|
+
* Given a locale and a mode,
|
|
59
|
+
* return an array with formatted days
|
|
60
|
+
* of the week. iOS should display days
|
|
61
|
+
* such as "Mon" or "Tue".
|
|
62
|
+
* MD should display days such as "M"
|
|
63
|
+
* or "T".
|
|
64
|
+
*/
|
|
65
|
+
const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
|
|
66
|
+
/**
|
|
67
|
+
* Nov 1st, 2020 starts on a Sunday.
|
|
68
|
+
* ion-datetime assumes weeks start on Sunday,
|
|
69
|
+
* but is configurable via `firstDayOfWeek`.
|
|
70
|
+
*/
|
|
71
|
+
const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
|
|
72
|
+
const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
|
|
73
|
+
const startDate = new Date('11/01/2020');
|
|
74
|
+
const daysOfWeek = [];
|
|
75
|
+
/**
|
|
76
|
+
* For each day of the week,
|
|
77
|
+
* get the day name.
|
|
78
|
+
*/
|
|
79
|
+
for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
|
|
80
|
+
const currentDate = new Date(startDate);
|
|
81
|
+
currentDate.setDate(currentDate.getDate() + i);
|
|
82
|
+
daysOfWeek.push(intl.format(currentDate));
|
|
83
|
+
}
|
|
84
|
+
return daysOfWeek;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Returns an array containing all of the
|
|
88
|
+
* days in a month for a given year. Values are
|
|
89
|
+
* aligned with a week calendar starting on
|
|
90
|
+
* the firstDayOfWeek value (Sunday by default)
|
|
91
|
+
* using null values.
|
|
92
|
+
*/
|
|
93
|
+
const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
|
|
94
|
+
const numDays = format.getNumDaysInMonth(month, year);
|
|
95
|
+
let previousNumDays; //previous month number of days
|
|
96
|
+
if (month === 1) {
|
|
97
|
+
// If the current month is January, the previous month should be December of the previous year.
|
|
98
|
+
previousNumDays = format.getNumDaysInMonth(12, year - 1);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Otherwise, the previous month should be the current month - 1 of the same year.
|
|
102
|
+
previousNumDays = format.getNumDaysInMonth(month - 1, year);
|
|
103
|
+
}
|
|
104
|
+
const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
|
|
105
|
+
/**
|
|
106
|
+
* To get the first day of the month aligned on the correct
|
|
107
|
+
* day of the week, we need to determine how many "filler" days
|
|
108
|
+
* to generate. These filler days as empty/disabled buttons
|
|
109
|
+
* that fill the space of the days of the week before the first
|
|
110
|
+
* of the month.
|
|
111
|
+
*
|
|
112
|
+
* There are two cases here:
|
|
113
|
+
*
|
|
114
|
+
* 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
|
|
115
|
+
* is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
|
|
116
|
+
* this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
|
|
117
|
+
* the first day of the month.
|
|
118
|
+
*
|
|
119
|
+
* 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
|
|
120
|
+
* is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
|
|
121
|
+
* this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
|
|
122
|
+
* the first day of the month.
|
|
123
|
+
*/
|
|
124
|
+
const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
|
|
125
|
+
let days = [];
|
|
126
|
+
for (let i = 1; i <= numDays; i++) {
|
|
127
|
+
days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
|
|
128
|
+
}
|
|
129
|
+
if (showAdjacentDays) {
|
|
130
|
+
for (let i = 0; i <= offset; i++) {
|
|
131
|
+
// Using offset create previous month adjacent day, starting from last day
|
|
132
|
+
days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
|
|
133
|
+
}
|
|
134
|
+
// Calculate positiveOffset
|
|
135
|
+
// The calendar will display 42 days (6 rows of 7 columns)
|
|
136
|
+
// Knowing this the offset is 41 (we start at index 0)
|
|
137
|
+
// minus (the previous offset + the current month days)
|
|
138
|
+
const positiveOffset = 41 - (numDays + offset);
|
|
139
|
+
for (let i = 0; i < positiveOffset; i++) {
|
|
140
|
+
days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
for (let i = 0; i <= offset; i++) {
|
|
145
|
+
days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return days;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Returns an array of pre-defined hour
|
|
152
|
+
* values based on the provided hourCycle.
|
|
153
|
+
*/
|
|
154
|
+
const getHourData = (hourCycle) => {
|
|
155
|
+
switch (hourCycle) {
|
|
156
|
+
case 'h11':
|
|
157
|
+
return hour11;
|
|
158
|
+
case 'h12':
|
|
159
|
+
return hour12;
|
|
160
|
+
case 'h23':
|
|
161
|
+
return hour23;
|
|
162
|
+
case 'h24':
|
|
163
|
+
return hour24;
|
|
164
|
+
default:
|
|
165
|
+
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Given a local, reference datetime parts and option
|
|
170
|
+
* max/min bound datetime parts, calculate the acceptable
|
|
171
|
+
* hour and minute values according to the bounds and locale.
|
|
172
|
+
*/
|
|
173
|
+
const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
|
174
|
+
const computedHourCycle = format.getHourCycle(locale, hourCycle);
|
|
175
|
+
const use24Hour = format.is24Hour(computedHourCycle);
|
|
176
|
+
let processedHours = getHourData(computedHourCycle);
|
|
177
|
+
let processedMinutes = minutes;
|
|
178
|
+
let isAMAllowed = true;
|
|
179
|
+
let isPMAllowed = true;
|
|
180
|
+
if (hourValues) {
|
|
181
|
+
processedHours = processedHours.filter((hour) => hourValues.includes(hour));
|
|
182
|
+
}
|
|
183
|
+
if (minuteValues) {
|
|
184
|
+
processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
|
|
185
|
+
}
|
|
186
|
+
if (minParts) {
|
|
187
|
+
/**
|
|
188
|
+
* If ref day is the same as the
|
|
189
|
+
* minimum allowed day, filter hour/minute
|
|
190
|
+
* values according to min hour and minute.
|
|
191
|
+
*/
|
|
192
|
+
if (format.isSameDay(refParts, minParts)) {
|
|
193
|
+
/**
|
|
194
|
+
* Users may not always set the hour/minute for
|
|
195
|
+
* min value (i.e. 2021-06-02) so we should allow
|
|
196
|
+
* all hours/minutes in that case.
|
|
197
|
+
*/
|
|
198
|
+
if (minParts.hour !== undefined) {
|
|
199
|
+
processedHours = processedHours.filter((hour) => {
|
|
200
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
201
|
+
return (use24Hour ? hour : convertedHour) >= minParts.hour;
|
|
202
|
+
});
|
|
203
|
+
isAMAllowed = minParts.hour < 13;
|
|
204
|
+
}
|
|
205
|
+
if (minParts.minute !== undefined) {
|
|
206
|
+
/**
|
|
207
|
+
* The minimum minute range should not be enforced when
|
|
208
|
+
* the hour is greater than the min hour.
|
|
209
|
+
*
|
|
210
|
+
* For example with a minimum range of 09:30, users
|
|
211
|
+
* should be able to select 10:00-10:29 and beyond.
|
|
212
|
+
*/
|
|
213
|
+
let isPastMinHour = false;
|
|
214
|
+
if (minParts.hour !== undefined && refParts.hour !== undefined) {
|
|
215
|
+
if (refParts.hour > minParts.hour) {
|
|
216
|
+
isPastMinHour = true;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
processedMinutes = processedMinutes.filter((minute) => {
|
|
220
|
+
if (isPastMinHour) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
return minute >= minParts.minute;
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* If ref day is before minimum
|
|
228
|
+
* day do not render any hours/minute values
|
|
229
|
+
*/
|
|
230
|
+
}
|
|
231
|
+
else if (format.isBefore(refParts, minParts)) {
|
|
232
|
+
processedHours = [];
|
|
233
|
+
processedMinutes = [];
|
|
234
|
+
isAMAllowed = isPMAllowed = false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (maxParts) {
|
|
238
|
+
/**
|
|
239
|
+
* If ref day is the same as the
|
|
240
|
+
* maximum allowed day, filter hour/minute
|
|
241
|
+
* values according to max hour and minute.
|
|
242
|
+
*/
|
|
243
|
+
if (format.isSameDay(refParts, maxParts)) {
|
|
244
|
+
/**
|
|
245
|
+
* Users may not always set the hour/minute for
|
|
246
|
+
* max value (i.e. 2021-06-02) so we should allow
|
|
247
|
+
* all hours/minutes in that case.
|
|
248
|
+
*/
|
|
249
|
+
if (maxParts.hour !== undefined) {
|
|
250
|
+
processedHours = processedHours.filter((hour) => {
|
|
251
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
252
|
+
return (use24Hour ? hour : convertedHour) <= maxParts.hour;
|
|
253
|
+
});
|
|
254
|
+
isPMAllowed = maxParts.hour >= 12;
|
|
255
|
+
}
|
|
256
|
+
if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
|
|
257
|
+
// The available minutes should only be filtered when the hour is the same as the max hour.
|
|
258
|
+
// For example if the max hour is 10:30 and the current hour is 10:00,
|
|
259
|
+
// users should be able to select 00-30 minutes.
|
|
260
|
+
// If the current hour is 09:00, users should be able to select 00-60 minutes.
|
|
261
|
+
processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* If ref day is after minimum
|
|
265
|
+
* day do not render any hours/minute values
|
|
266
|
+
*/
|
|
267
|
+
}
|
|
268
|
+
else if (format.isAfter(refParts, maxParts)) {
|
|
269
|
+
processedHours = [];
|
|
270
|
+
processedMinutes = [];
|
|
271
|
+
isAMAllowed = isPMAllowed = false;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
hours: processedHours,
|
|
276
|
+
minutes: processedMinutes,
|
|
277
|
+
am: isAMAllowed,
|
|
278
|
+
pm: isPMAllowed,
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Given DatetimeParts, generate the previous,
|
|
283
|
+
* current, and and next months.
|
|
284
|
+
*/
|
|
285
|
+
const generateMonths = (refParts, forcedDate) => {
|
|
286
|
+
const current = { month: refParts.month, year: refParts.year, day: refParts.day };
|
|
287
|
+
/**
|
|
288
|
+
* If we're forcing a month to appear, and it's different from the current month,
|
|
289
|
+
* ensure it appears by replacing the next or previous month as appropriate.
|
|
290
|
+
*/
|
|
291
|
+
if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
|
|
292
|
+
const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
|
|
293
|
+
const forcedMonthIsBefore = format.isBefore(forced, current);
|
|
294
|
+
return forcedMonthIsBefore
|
|
295
|
+
? [forced, current, format.getNextMonth(refParts)]
|
|
296
|
+
: [format.getPreviousMonth(refParts), current, forced];
|
|
297
|
+
}
|
|
298
|
+
return [format.getPreviousMonth(refParts), current, format.getNextMonth(refParts)];
|
|
299
|
+
};
|
|
300
|
+
const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
|
301
|
+
month: 'long',
|
|
302
|
+
}) => {
|
|
303
|
+
const { year } = refParts;
|
|
304
|
+
const months = [];
|
|
305
|
+
if (monthValues !== undefined) {
|
|
306
|
+
let processedMonths = monthValues;
|
|
307
|
+
if (maxParts?.month !== undefined) {
|
|
308
|
+
processedMonths = processedMonths.filter((month) => month <= maxParts.month);
|
|
309
|
+
}
|
|
310
|
+
if (minParts?.month !== undefined) {
|
|
311
|
+
processedMonths = processedMonths.filter((month) => month >= minParts.month);
|
|
312
|
+
}
|
|
313
|
+
processedMonths.forEach((processedMonth) => {
|
|
314
|
+
const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
|
|
315
|
+
const monthString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
316
|
+
months.push({ text: monthString, value: processedMonth });
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
|
|
321
|
+
const minMonth = minParts && minParts.year === year ? minParts.month : 1;
|
|
322
|
+
for (let i = minMonth; i <= maxMonth; i++) {
|
|
323
|
+
/**
|
|
324
|
+
*
|
|
325
|
+
* There is a bug on iOS 14 where
|
|
326
|
+
* Intl.DateTimeFormat takes into account
|
|
327
|
+
* the local timezone offset when formatting dates.
|
|
328
|
+
*
|
|
329
|
+
* Forcing the timezone to 'UTC' fixes the issue. However,
|
|
330
|
+
* we should keep this workaround as it is safer. In the event
|
|
331
|
+
* this breaks in another browser, we will not be impacted
|
|
332
|
+
* because all dates will be interpreted in UTC.
|
|
333
|
+
*
|
|
334
|
+
* Example:
|
|
335
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
|
|
336
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
|
|
337
|
+
*
|
|
338
|
+
* In certain timezones, iOS 14 shows the wrong
|
|
339
|
+
* date for .toUTCString(). To combat this, we
|
|
340
|
+
* force all of the timezones to GMT+0000 (UTC).
|
|
341
|
+
*
|
|
342
|
+
* Example:
|
|
343
|
+
* Time Zone: Central European Standard Time
|
|
344
|
+
* new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
|
|
345
|
+
* new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
|
|
346
|
+
*/
|
|
347
|
+
const date = new Date(`${i}/1/${year} GMT+0000`);
|
|
348
|
+
const monthString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
349
|
+
months.push({ text: monthString, value: i });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return months;
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* Returns information regarding
|
|
356
|
+
* selectable dates (i.e 1st, 2nd, 3rd, etc)
|
|
357
|
+
* within a reference month.
|
|
358
|
+
* @param locale The locale to format the date with
|
|
359
|
+
* @param refParts The reference month/year to generate dates for
|
|
360
|
+
* @param minParts The minimum bound on the date that can be returned
|
|
361
|
+
* @param maxParts The maximum bound on the date that can be returned
|
|
362
|
+
* @param dayValues The allowed date values
|
|
363
|
+
* @returns Date data to be used in ion-picker-column
|
|
364
|
+
*/
|
|
365
|
+
const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
|
|
366
|
+
day: 'numeric',
|
|
367
|
+
}) => {
|
|
368
|
+
const { month, year } = refParts;
|
|
369
|
+
const days = [];
|
|
370
|
+
/**
|
|
371
|
+
* If we have max/min bounds that in the same
|
|
372
|
+
* month/year as the refParts, we should
|
|
373
|
+
* use the define day as the max/min day.
|
|
374
|
+
* Otherwise, fallback to the max/min days in a month.
|
|
375
|
+
*/
|
|
376
|
+
const numDaysInMonth = format.getNumDaysInMonth(month, year);
|
|
377
|
+
const maxDay = maxParts?.day !== null && maxParts?.day !== undefined && maxParts.year === year && maxParts.month === month
|
|
378
|
+
? maxParts.day
|
|
379
|
+
: numDaysInMonth;
|
|
380
|
+
const minDay = minParts?.day !== null && minParts?.day !== undefined && minParts.year === year && minParts.month === month
|
|
381
|
+
? minParts.day
|
|
382
|
+
: 1;
|
|
383
|
+
if (dayValues !== undefined) {
|
|
384
|
+
let processedDays = dayValues;
|
|
385
|
+
processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
|
|
386
|
+
processedDays.forEach((processedDay) => {
|
|
387
|
+
const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
|
|
388
|
+
const dayString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
389
|
+
days.push({ text: dayString, value: processedDay });
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
for (let i = minDay; i <= maxDay; i++) {
|
|
394
|
+
const date = new Date(`${month}/${i}/${year} GMT+0000`);
|
|
395
|
+
const dayString = new Intl.DateTimeFormat(locale, { ...formatOptions, timeZone: 'UTC' }).format(date);
|
|
396
|
+
days.push({ text: dayString, value: i });
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return days;
|
|
400
|
+
};
|
|
401
|
+
const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
|
|
402
|
+
let processedYears = [];
|
|
403
|
+
if (yearValues !== undefined) {
|
|
404
|
+
processedYears = yearValues;
|
|
405
|
+
if (maxParts?.year !== undefined) {
|
|
406
|
+
processedYears = processedYears.filter((year) => year <= maxParts.year);
|
|
407
|
+
}
|
|
408
|
+
if (minParts?.year !== undefined) {
|
|
409
|
+
processedYears = processedYears.filter((year) => year >= minParts.year);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
const { year } = refParts;
|
|
414
|
+
const maxYear = maxParts?.year ?? year;
|
|
415
|
+
const minYear = minParts?.year ?? year - 100;
|
|
416
|
+
for (let i = minYear; i <= maxYear; i++) {
|
|
417
|
+
processedYears.push(i);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return processedYears.map((year) => ({
|
|
421
|
+
text: format.getYear(locale, { year, month: refParts.month, day: refParts.day }),
|
|
422
|
+
value: year,
|
|
423
|
+
}));
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* Given a starting date and an upper bound,
|
|
427
|
+
* this functions returns an array of all
|
|
428
|
+
* month objects in that range.
|
|
429
|
+
*/
|
|
430
|
+
const getAllMonthsInRange = (currentParts, maxParts) => {
|
|
431
|
+
if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
|
|
432
|
+
return [currentParts];
|
|
433
|
+
}
|
|
434
|
+
return [currentParts, ...getAllMonthsInRange(format.getNextMonth(currentParts), maxParts)];
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* Creates and returns picker items
|
|
438
|
+
* that represent the days in a month.
|
|
439
|
+
* Example: "Thu, Jun 2"
|
|
440
|
+
*/
|
|
441
|
+
const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
|
|
442
|
+
let items = [];
|
|
443
|
+
let parts = [];
|
|
444
|
+
/**
|
|
445
|
+
* Get all month objects from the min date
|
|
446
|
+
* to the max date. Note: Do not use getMonthColumnData
|
|
447
|
+
* as that function only generates dates within a
|
|
448
|
+
* single year.
|
|
449
|
+
*/
|
|
450
|
+
let months = getAllMonthsInRange(minParts, maxParts);
|
|
451
|
+
/**
|
|
452
|
+
* Filter out any disallowed month values.
|
|
453
|
+
*/
|
|
454
|
+
if (monthValues) {
|
|
455
|
+
months = months.filter(({ month }) => monthValues.includes(month));
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Get all of the days in the month.
|
|
459
|
+
* From there, generate an array where
|
|
460
|
+
* each item has the month, date, and day
|
|
461
|
+
* of work as the text.
|
|
462
|
+
*/
|
|
463
|
+
months.forEach((monthObject) => {
|
|
464
|
+
const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
|
|
465
|
+
const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
|
|
466
|
+
month: 'short',
|
|
467
|
+
day: 'numeric',
|
|
468
|
+
weekday: 'short',
|
|
469
|
+
});
|
|
470
|
+
const dateParts = [];
|
|
471
|
+
const dateColumnItems = [];
|
|
472
|
+
monthDays.forEach((dayObject) => {
|
|
473
|
+
const isToday = format.isSameDay({ ...referenceMonth, day: dayObject.value }, todayParts);
|
|
474
|
+
/**
|
|
475
|
+
* Today's date should read as "Today" (localized)
|
|
476
|
+
* not the actual date string
|
|
477
|
+
*/
|
|
478
|
+
dateColumnItems.push({
|
|
479
|
+
text: isToday ? format.getTodayLabel(locale) : dayObject.text,
|
|
480
|
+
value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
|
|
481
|
+
});
|
|
482
|
+
/**
|
|
483
|
+
* When selecting a date in the wheel picker
|
|
484
|
+
* we need access to the raw datetime parts data.
|
|
485
|
+
* The picker column only accepts values of
|
|
486
|
+
* type string or number, so we need to return
|
|
487
|
+
* two sets of data: A data set to be passed
|
|
488
|
+
* to the picker column, and a data set to
|
|
489
|
+
* be used to reference the raw data when
|
|
490
|
+
* updating the picker column value.
|
|
491
|
+
*/
|
|
492
|
+
dateParts.push({
|
|
493
|
+
month: referenceMonth.month,
|
|
494
|
+
year: referenceMonth.year,
|
|
495
|
+
day: dayObject.value,
|
|
496
|
+
});
|
|
497
|
+
});
|
|
498
|
+
parts = [...parts, ...dateParts];
|
|
499
|
+
items = [...items, ...dateColumnItems];
|
|
500
|
+
});
|
|
501
|
+
return {
|
|
502
|
+
parts,
|
|
503
|
+
items,
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
|
|
507
|
+
const computedHourCycle = format.getHourCycle(locale, hourCycle);
|
|
508
|
+
const use24Hour = format.is24Hour(computedHourCycle);
|
|
509
|
+
const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
|
|
510
|
+
const hoursItems = hours.map((hour) => {
|
|
511
|
+
return {
|
|
512
|
+
text: format.getFormattedHour(hour, computedHourCycle),
|
|
513
|
+
value: format.getInternalHourValue(hour, use24Hour, refParts.ampm),
|
|
514
|
+
};
|
|
515
|
+
});
|
|
516
|
+
const minutesItems = minutes.map((minute) => {
|
|
517
|
+
return {
|
|
518
|
+
text: format.addTimePadding(minute),
|
|
519
|
+
value: minute,
|
|
520
|
+
};
|
|
521
|
+
});
|
|
522
|
+
const dayPeriodItems = [];
|
|
523
|
+
if (am && !use24Hour) {
|
|
524
|
+
dayPeriodItems.push({
|
|
525
|
+
text: format.getLocalizedDayPeriod(locale, 'am'),
|
|
526
|
+
value: 'am',
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
if (pm && !use24Hour) {
|
|
530
|
+
dayPeriodItems.push({
|
|
531
|
+
text: format.getLocalizedDayPeriod(locale, 'pm'),
|
|
532
|
+
value: 'pm',
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return {
|
|
536
|
+
minutesData: minutesItems,
|
|
537
|
+
hoursData: hoursItems,
|
|
538
|
+
dayPeriodData: dayPeriodItems,
|
|
539
|
+
};
|
|
540
|
+
};
|
|
23
541
|
|
|
24
542
|
const isYearDisabled = (refYear, minParts, maxParts) => {
|
|
25
543
|
if (minParts && minParts.year > refYear) {
|
|
@@ -62,7 +580,7 @@ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
|
|
|
62
580
|
* current month === min allow month, but the current
|
|
63
581
|
* day < the min allowed day?
|
|
64
582
|
*/
|
|
65
|
-
if (minParts &&
|
|
583
|
+
if (minParts && format.isBefore(refParts, minParts)) {
|
|
66
584
|
return true;
|
|
67
585
|
}
|
|
68
586
|
/**
|
|
@@ -76,7 +594,7 @@ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
|
|
|
76
594
|
* current month === max allow month, but the current
|
|
77
595
|
* day > the max allowed day?
|
|
78
596
|
*/
|
|
79
|
-
if (maxParts &&
|
|
597
|
+
if (maxParts && format.isAfter(refParts, maxParts)) {
|
|
80
598
|
return true;
|
|
81
599
|
}
|
|
82
600
|
/**
|
|
@@ -103,8 +621,8 @@ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts
|
|
|
103
621
|
* The day button is active if it is selected, or in other words, if refParts
|
|
104
622
|
* matches at least one selected date.
|
|
105
623
|
*/
|
|
106
|
-
const isActive = activePartsArray.find((parts) =>
|
|
107
|
-
const isToday =
|
|
624
|
+
const isActive = activePartsArray.find((parts) => format.isSameDay(refParts, parts)) !== undefined;
|
|
625
|
+
const isToday = format.isSameDay(refParts, todayParts);
|
|
108
626
|
const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
|
|
109
627
|
/**
|
|
110
628
|
* Note that we always return one object regardless of whether activeParts
|
|
@@ -115,8 +633,8 @@ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts
|
|
|
115
633
|
isActive,
|
|
116
634
|
isToday,
|
|
117
635
|
ariaSelected: isActive ? 'true' : null,
|
|
118
|
-
ariaLabel:
|
|
119
|
-
text: refParts.day != null ?
|
|
636
|
+
ariaLabel: format.generateDayAriaLabel(locale, isToday, refParts),
|
|
637
|
+
text: refParts.day != null ? format.getDay(locale, refParts) : null,
|
|
120
638
|
};
|
|
121
639
|
};
|
|
122
640
|
/**
|
|
@@ -130,7 +648,7 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
|
|
|
130
648
|
}
|
|
131
649
|
// If the date value is before the min date, then the month is disabled.
|
|
132
650
|
// If the date value is after the max date, then the month is disabled.
|
|
133
|
-
if ((minParts &&
|
|
651
|
+
if ((minParts && format.isBefore(refParts, minParts)) || (maxParts && format.isAfter(refParts, maxParts))) {
|
|
134
652
|
return true;
|
|
135
653
|
}
|
|
136
654
|
return false;
|
|
@@ -141,7 +659,10 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
|
|
|
141
659
|
* previous navigation button is disabled.
|
|
142
660
|
*/
|
|
143
661
|
const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
|
|
144
|
-
const prevMonth =
|
|
662
|
+
const prevMonth = {
|
|
663
|
+
...format.getPreviousMonth(refParts),
|
|
664
|
+
day: null,
|
|
665
|
+
};
|
|
145
666
|
return isMonthDisabled(prevMonth, {
|
|
146
667
|
minParts,
|
|
147
668
|
maxParts,
|
|
@@ -152,7 +673,10 @@ const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
|
|
|
152
673
|
* determine if the next navigation button is disabled.
|
|
153
674
|
*/
|
|
154
675
|
const isNextMonthDisabled = (refParts, maxParts) => {
|
|
155
|
-
const nextMonth =
|
|
676
|
+
const nextMonth = {
|
|
677
|
+
...format.getNextMonth(refParts),
|
|
678
|
+
day: null,
|
|
679
|
+
};
|
|
156
680
|
return isMonthDisabled(nextMonth, {
|
|
157
681
|
maxParts,
|
|
158
682
|
});
|
|
@@ -195,11 +719,10 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
|
195
719
|
* confusion.
|
|
196
720
|
*/
|
|
197
721
|
const warnIfTimeZoneProvided = (el, formatOptions) => {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
|
|
722
|
+
if (formatOptions?.date?.timeZone ||
|
|
723
|
+
formatOptions?.date?.timeZoneName ||
|
|
724
|
+
formatOptions?.time?.timeZone ||
|
|
725
|
+
formatOptions?.time?.timeZoneName) {
|
|
203
726
|
index.printIonWarning('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
|
|
204
727
|
}
|
|
205
728
|
};
|
|
@@ -231,9 +754,9 @@ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) =>
|
|
|
231
754
|
}
|
|
232
755
|
};
|
|
233
756
|
|
|
234
|
-
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%}`;
|
|
757
|
+
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%}`;
|
|
235
758
|
|
|
236
|
-
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}`;
|
|
759
|
+
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}`;
|
|
237
760
|
|
|
238
761
|
const Datetime = class {
|
|
239
762
|
constructor(hostRef) {
|
|
@@ -250,6 +773,10 @@ const Datetime = class {
|
|
|
250
773
|
* Set true only by `visibleCallback`. Lets `hiddenCallback` ignore the
|
|
251
774
|
* synthetic "not intersecting" entry IntersectionObserver fires on
|
|
252
775
|
* `observe()` when the host mounts offscreen.
|
|
776
|
+
*
|
|
777
|
+
* Don't reset this in `disconnectedCallback`. Overlays disconnect and
|
|
778
|
+
* reconnect the host without re-creating the observers, so a reset there
|
|
779
|
+
* makes `hiddenCallback` miss the dismissal.
|
|
253
780
|
*/
|
|
254
781
|
this.hasBeenIntersecting = false;
|
|
255
782
|
this.prevPresentation = null;
|
|
@@ -265,12 +792,6 @@ const Datetime = class {
|
|
|
265
792
|
isAdjacentDay: false,
|
|
266
793
|
};
|
|
267
794
|
this.isTimePopoverOpen = false;
|
|
268
|
-
/**
|
|
269
|
-
* The color to use from your application's color palette.
|
|
270
|
-
* Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
|
|
271
|
-
* For more information on colors, see [theming](/docs/theming/basics).
|
|
272
|
-
*/
|
|
273
|
-
this.color = 'primary';
|
|
274
795
|
/**
|
|
275
796
|
* The name of the control, which is submitted with the form data.
|
|
276
797
|
*/
|
|
@@ -409,9 +930,8 @@ const Datetime = class {
|
|
|
409
930
|
* is selected.
|
|
410
931
|
*/
|
|
411
932
|
this.getActivePartsWithFallback = () => {
|
|
412
|
-
var _a;
|
|
413
933
|
const { defaultParts } = this;
|
|
414
|
-
return
|
|
934
|
+
return this.getActivePart() ?? defaultParts;
|
|
415
935
|
};
|
|
416
936
|
this.getActivePart = () => {
|
|
417
937
|
const { activeParts } = this;
|
|
@@ -424,7 +944,9 @@ const Datetime = class {
|
|
|
424
944
|
}
|
|
425
945
|
};
|
|
426
946
|
this.setWorkingParts = (parts) => {
|
|
427
|
-
this.workingParts =
|
|
947
|
+
this.workingParts = {
|
|
948
|
+
...parts,
|
|
949
|
+
};
|
|
428
950
|
};
|
|
429
951
|
this.setActiveParts = (parts, removeDate = false) => {
|
|
430
952
|
/** if the datetime component is in readonly mode,
|
|
@@ -445,19 +967,21 @@ const Datetime = class {
|
|
|
445
967
|
* Additionally, we need to update the working parts
|
|
446
968
|
* too in the event that the validated parts are different.
|
|
447
969
|
*/
|
|
448
|
-
const validatedParts =
|
|
970
|
+
const validatedParts = format.validateParts(parts, minParts, maxParts);
|
|
449
971
|
this.setWorkingParts(validatedParts);
|
|
450
972
|
if (multiple) {
|
|
451
973
|
const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
|
|
452
974
|
if (removeDate) {
|
|
453
|
-
this.activeParts = activePartsArray.filter((p) => !
|
|
975
|
+
this.activeParts = activePartsArray.filter((p) => !format.isSameDay(p, validatedParts));
|
|
454
976
|
}
|
|
455
977
|
else {
|
|
456
978
|
this.activeParts = [...activePartsArray, validatedParts];
|
|
457
979
|
}
|
|
458
980
|
}
|
|
459
981
|
else {
|
|
460
|
-
this.activeParts =
|
|
982
|
+
this.activeParts = {
|
|
983
|
+
...validatedParts,
|
|
984
|
+
};
|
|
461
985
|
}
|
|
462
986
|
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
|
|
463
987
|
if (hasSlottedButtons || this.showDefaultButtons) {
|
|
@@ -483,7 +1007,6 @@ const Datetime = class {
|
|
|
483
1007
|
* Tab should jump between bodies of selectable content.
|
|
484
1008
|
*/
|
|
485
1009
|
const checkCalendarBodyFocus = (ev) => {
|
|
486
|
-
var _a;
|
|
487
1010
|
const record = ev[0];
|
|
488
1011
|
/**
|
|
489
1012
|
* If calendar body was already focused
|
|
@@ -491,7 +1014,7 @@ const Datetime = class {
|
|
|
491
1014
|
* if not currently focused, we should not re-focus
|
|
492
1015
|
* the inner day.
|
|
493
1016
|
*/
|
|
494
|
-
if (
|
|
1017
|
+
if (record.oldValue?.includes('ion-focused') || !calendarBodyRef.classList.contains('ion-focused')) {
|
|
495
1018
|
return;
|
|
496
1019
|
}
|
|
497
1020
|
this.focusWorkingDay(currentMonth);
|
|
@@ -499,7 +1022,7 @@ const Datetime = class {
|
|
|
499
1022
|
const mo = new MutationObserver(checkCalendarBodyFocus);
|
|
500
1023
|
mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
|
|
501
1024
|
this.destroyKeyboardMO = () => {
|
|
502
|
-
mo
|
|
1025
|
+
mo?.disconnect();
|
|
503
1026
|
};
|
|
504
1027
|
/**
|
|
505
1028
|
* We must use keydown not keyup as we want
|
|
@@ -510,40 +1033,40 @@ const Datetime = class {
|
|
|
510
1033
|
if (!activeElement || !activeElement.classList.contains('calendar-day')) {
|
|
511
1034
|
return;
|
|
512
1035
|
}
|
|
513
|
-
const parts =
|
|
1036
|
+
const parts = format.getPartsFromCalendarDay(activeElement);
|
|
514
1037
|
let partsToFocus;
|
|
515
1038
|
switch (ev.key) {
|
|
516
1039
|
case 'ArrowDown':
|
|
517
1040
|
ev.preventDefault();
|
|
518
|
-
partsToFocus =
|
|
1041
|
+
partsToFocus = format.getNextWeek(parts);
|
|
519
1042
|
break;
|
|
520
1043
|
case 'ArrowUp':
|
|
521
1044
|
ev.preventDefault();
|
|
522
|
-
partsToFocus =
|
|
1045
|
+
partsToFocus = format.getPreviousWeek(parts);
|
|
523
1046
|
break;
|
|
524
1047
|
case 'ArrowRight':
|
|
525
1048
|
ev.preventDefault();
|
|
526
|
-
partsToFocus =
|
|
1049
|
+
partsToFocus = format.getNextDay(parts);
|
|
527
1050
|
break;
|
|
528
1051
|
case 'ArrowLeft':
|
|
529
1052
|
ev.preventDefault();
|
|
530
|
-
partsToFocus =
|
|
1053
|
+
partsToFocus = format.getPreviousDay(parts);
|
|
531
1054
|
break;
|
|
532
1055
|
case 'Home':
|
|
533
1056
|
ev.preventDefault();
|
|
534
|
-
partsToFocus =
|
|
1057
|
+
partsToFocus = format.getStartOfWeek(parts);
|
|
535
1058
|
break;
|
|
536
1059
|
case 'End':
|
|
537
1060
|
ev.preventDefault();
|
|
538
|
-
partsToFocus =
|
|
1061
|
+
partsToFocus = format.getEndOfWeek(parts);
|
|
539
1062
|
break;
|
|
540
1063
|
case 'PageUp':
|
|
541
1064
|
ev.preventDefault();
|
|
542
|
-
partsToFocus = ev.shiftKey ?
|
|
1065
|
+
partsToFocus = ev.shiftKey ? format.getPreviousYear(parts) : format.getPreviousMonth(parts);
|
|
543
1066
|
break;
|
|
544
1067
|
case 'PageDown':
|
|
545
1068
|
ev.preventDefault();
|
|
546
|
-
partsToFocus = ev.shiftKey ?
|
|
1069
|
+
partsToFocus = ev.shiftKey ? format.getNextYear(parts) : format.getNextMonth(parts);
|
|
547
1070
|
break;
|
|
548
1071
|
/**
|
|
549
1072
|
* Do not preventDefault here
|
|
@@ -561,7 +1084,10 @@ const Datetime = class {
|
|
|
561
1084
|
if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
|
|
562
1085
|
return;
|
|
563
1086
|
}
|
|
564
|
-
this.setWorkingParts(
|
|
1087
|
+
this.setWorkingParts({
|
|
1088
|
+
...this.workingParts,
|
|
1089
|
+
...partsToFocus,
|
|
1090
|
+
});
|
|
565
1091
|
/**
|
|
566
1092
|
* Give view a chance to re-render
|
|
567
1093
|
* then move focus to the new working day
|
|
@@ -598,7 +1124,7 @@ const Datetime = class {
|
|
|
598
1124
|
this.minParts = undefined;
|
|
599
1125
|
return;
|
|
600
1126
|
}
|
|
601
|
-
this.minParts =
|
|
1127
|
+
this.minParts = format.parseMinParts(min, defaultParts);
|
|
602
1128
|
};
|
|
603
1129
|
this.processMaxParts = () => {
|
|
604
1130
|
const { max, defaultParts } = this;
|
|
@@ -606,7 +1132,7 @@ const Datetime = class {
|
|
|
606
1132
|
this.maxParts = undefined;
|
|
607
1133
|
return;
|
|
608
1134
|
}
|
|
609
|
-
this.maxParts =
|
|
1135
|
+
this.maxParts = format.parseMaxParts(max, defaultParts);
|
|
610
1136
|
};
|
|
611
1137
|
this.initializeCalendarListener = () => {
|
|
612
1138
|
const calendarBodyRef = this.calendarBodyRef;
|
|
@@ -689,10 +1215,10 @@ const Datetime = class {
|
|
|
689
1215
|
* the scroll callback early.
|
|
690
1216
|
*/
|
|
691
1217
|
if (month === startMonth) {
|
|
692
|
-
return
|
|
1218
|
+
return format.getPreviousMonth(parts);
|
|
693
1219
|
}
|
|
694
1220
|
else if (month === endMonth) {
|
|
695
|
-
return
|
|
1221
|
+
return format.getNextMonth(parts);
|
|
696
1222
|
}
|
|
697
1223
|
else {
|
|
698
1224
|
return;
|
|
@@ -712,8 +1238,8 @@ const Datetime = class {
|
|
|
712
1238
|
return;
|
|
713
1239
|
const { month, day, year } = newDate;
|
|
714
1240
|
if (isMonthDisabled({ month, year, day: null }, {
|
|
715
|
-
minParts:
|
|
716
|
-
maxParts:
|
|
1241
|
+
minParts: { ...this.minParts, day: null },
|
|
1242
|
+
maxParts: { ...this.maxParts, day: null },
|
|
717
1243
|
})) {
|
|
718
1244
|
return;
|
|
719
1245
|
}
|
|
@@ -733,8 +1259,12 @@ const Datetime = class {
|
|
|
733
1259
|
* if we did not do this.
|
|
734
1260
|
*/
|
|
735
1261
|
index.writeTask(() => {
|
|
736
|
-
|
|
737
|
-
|
|
1262
|
+
this.setWorkingParts({
|
|
1263
|
+
...this.workingParts,
|
|
1264
|
+
month,
|
|
1265
|
+
day: day,
|
|
1266
|
+
year,
|
|
1267
|
+
});
|
|
738
1268
|
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
|
|
739
1269
|
calendarBodyRef.style.removeProperty('overflow');
|
|
740
1270
|
if (this.resolveForceDateScrolling) {
|
|
@@ -742,7 +1272,7 @@ const Datetime = class {
|
|
|
742
1272
|
}
|
|
743
1273
|
const activeEl = this.el.shadowRoot.activeElement;
|
|
744
1274
|
if (activeEl && activeEl.classList.contains('calendar-day')) {
|
|
745
|
-
|
|
1275
|
+
activeEl.closest('.calendar-body')?.focus();
|
|
746
1276
|
}
|
|
747
1277
|
});
|
|
748
1278
|
};
|
|
@@ -841,7 +1371,7 @@ const Datetime = class {
|
|
|
841
1371
|
};
|
|
842
1372
|
this.processValue = (value) => {
|
|
843
1373
|
const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
|
|
844
|
-
const valueToProcess = hasValue ?
|
|
1374
|
+
const valueToProcess = hasValue ? format.parseDate(value) : this.defaultParts;
|
|
845
1375
|
const { minParts, maxParts, workingParts, el } = this;
|
|
846
1376
|
this.warnIfIncorrectValueUsage();
|
|
847
1377
|
/**
|
|
@@ -860,7 +1390,7 @@ const Datetime = class {
|
|
|
860
1390
|
* not true.
|
|
861
1391
|
*/
|
|
862
1392
|
if (hasValue) {
|
|
863
|
-
|
|
1393
|
+
format.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
|
|
864
1394
|
}
|
|
865
1395
|
/**
|
|
866
1396
|
* If there are multiple values, clamp to the last one.
|
|
@@ -868,9 +1398,9 @@ const Datetime = class {
|
|
|
868
1398
|
* has most recently interacted with.
|
|
869
1399
|
*/
|
|
870
1400
|
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[valueToProcess.length - 1] : valueToProcess;
|
|
871
|
-
const targetValue =
|
|
1401
|
+
const targetValue = format.clampDate(singleValue, minParts, maxParts);
|
|
872
1402
|
const { month, day, year, hour, minute } = targetValue;
|
|
873
|
-
const ampm =
|
|
1403
|
+
const ampm = format.parseAmPm(hour);
|
|
874
1404
|
/**
|
|
875
1405
|
* Since `activeParts` indicates a value that been explicitly selected
|
|
876
1406
|
* either by the user or the app, only update `activeParts` if the
|
|
@@ -946,7 +1476,7 @@ const Datetime = class {
|
|
|
946
1476
|
* Animate smoothly to the forced month. This will also update
|
|
947
1477
|
* workingParts and correct the surrounding months for us.
|
|
948
1478
|
*/
|
|
949
|
-
const targetMonthIsBefore =
|
|
1479
|
+
const targetMonthIsBefore = format.isBefore(targetValue, workingParts);
|
|
950
1480
|
targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
|
|
951
1481
|
await forceDateScrollingPromise;
|
|
952
1482
|
this.resolveForceDateScrolling = undefined;
|
|
@@ -971,10 +1501,11 @@ const Datetime = class {
|
|
|
971
1501
|
return;
|
|
972
1502
|
}
|
|
973
1503
|
const left = nextMonth.offsetWidth * 2;
|
|
1504
|
+
const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
|
|
974
1505
|
calendarBodyRef.scrollTo({
|
|
975
1506
|
top: 0,
|
|
976
1507
|
left: left * (dir.isRTL(this.el) ? -1 : 1),
|
|
977
|
-
behavior:
|
|
1508
|
+
behavior: scrollMode,
|
|
978
1509
|
});
|
|
979
1510
|
};
|
|
980
1511
|
this.prevMonth = () => {
|
|
@@ -987,10 +1518,11 @@ const Datetime = class {
|
|
|
987
1518
|
return;
|
|
988
1519
|
}
|
|
989
1520
|
const left = prevMonth.offsetWidth * 2;
|
|
1521
|
+
const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
|
|
990
1522
|
calendarBodyRef.scrollTo({
|
|
991
1523
|
top: 0,
|
|
992
1524
|
left: left * (dir.isRTL(this.el) ? 1 : -1),
|
|
993
|
-
behavior:
|
|
1525
|
+
behavior: scrollMode,
|
|
994
1526
|
});
|
|
995
1527
|
};
|
|
996
1528
|
this.toggleMonthAndYearView = () => {
|
|
@@ -1021,19 +1553,19 @@ const Datetime = class {
|
|
|
1021
1553
|
return hasDatePresentation && !preferWheel;
|
|
1022
1554
|
}
|
|
1023
1555
|
yearValuesChanged() {
|
|
1024
|
-
this.parsedYearValues =
|
|
1556
|
+
this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues);
|
|
1025
1557
|
}
|
|
1026
1558
|
monthValuesChanged() {
|
|
1027
|
-
this.parsedMonthValues =
|
|
1559
|
+
this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues);
|
|
1028
1560
|
}
|
|
1029
1561
|
dayValuesChanged() {
|
|
1030
|
-
this.parsedDayValues =
|
|
1562
|
+
this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues);
|
|
1031
1563
|
}
|
|
1032
1564
|
hourValuesChanged() {
|
|
1033
|
-
this.parsedHourValues =
|
|
1565
|
+
this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues);
|
|
1034
1566
|
}
|
|
1035
1567
|
minuteValuesChanged() {
|
|
1036
|
-
this.parsedMinuteValues =
|
|
1568
|
+
this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues);
|
|
1037
1569
|
}
|
|
1038
1570
|
/**
|
|
1039
1571
|
* Update the datetime value when the value changes
|
|
@@ -1067,14 +1599,14 @@ const Datetime = class {
|
|
|
1067
1599
|
* active parts are empty, then the user has confirmed the
|
|
1068
1600
|
* initial value (working parts) presented to them.
|
|
1069
1601
|
*/
|
|
1070
|
-
this.setValue(
|
|
1602
|
+
this.setValue(format.convertDataToISO(workingParts));
|
|
1071
1603
|
}
|
|
1072
1604
|
else {
|
|
1073
1605
|
this.setValue(undefined);
|
|
1074
1606
|
}
|
|
1075
1607
|
}
|
|
1076
1608
|
else {
|
|
1077
|
-
this.setValue(
|
|
1609
|
+
this.setValue(format.convertDataToISO(activeParts));
|
|
1078
1610
|
}
|
|
1079
1611
|
}
|
|
1080
1612
|
if (closeOverlay) {
|
|
@@ -1105,6 +1637,16 @@ const Datetime = class {
|
|
|
1105
1637
|
this.closeParentOverlay(CANCEL_ROLE);
|
|
1106
1638
|
}
|
|
1107
1639
|
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Returns the default parts the datetime falls back to when no value is set:
|
|
1642
|
+
* today's date and time snapped to the closest value allowed by the
|
|
1643
|
+
* component's constraints (`min`, `max`, and the `*Values` props).
|
|
1644
|
+
*
|
|
1645
|
+
* @internal
|
|
1646
|
+
*/
|
|
1647
|
+
async getDefaultPart() {
|
|
1648
|
+
return this.defaultParts;
|
|
1649
|
+
}
|
|
1108
1650
|
get isCalendarPicker() {
|
|
1109
1651
|
const { presentation } = this;
|
|
1110
1652
|
return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
@@ -1121,7 +1663,6 @@ const Datetime = class {
|
|
|
1121
1663
|
this.clearFocusVisible = undefined;
|
|
1122
1664
|
}
|
|
1123
1665
|
this.loadTimeoutCleanup();
|
|
1124
|
-
this.hasBeenIntersecting = false;
|
|
1125
1666
|
}
|
|
1126
1667
|
initializeListeners() {
|
|
1127
1668
|
this.initializeCalendarListener();
|
|
@@ -1151,7 +1692,7 @@ const Datetime = class {
|
|
|
1151
1692
|
* could cause the datetime to start at a visibility of 0, erroneously
|
|
1152
1693
|
* triggering the `hiddenIO` observer below.
|
|
1153
1694
|
*/
|
|
1154
|
-
helpers.raf(() => visibleIO
|
|
1695
|
+
helpers.raf(() => visibleIO?.observe(intersectionTrackerRef));
|
|
1155
1696
|
/**
|
|
1156
1697
|
* TODO(FW-6931): Remove this fallback upon solving the root cause
|
|
1157
1698
|
* Fallback: If IntersectionObserver never reports that the
|
|
@@ -1197,7 +1738,7 @@ const Datetime = class {
|
|
|
1197
1738
|
});
|
|
1198
1739
|
};
|
|
1199
1740
|
const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
|
|
1200
|
-
helpers.raf(() => hiddenIO
|
|
1741
|
+
helpers.raf(() => hiddenIO?.observe(intersectionTrackerRef));
|
|
1201
1742
|
/**
|
|
1202
1743
|
* Datetime uses Ionic components that emit
|
|
1203
1744
|
* ionFocus and ionBlur. These events are
|
|
@@ -1292,15 +1833,15 @@ const Datetime = class {
|
|
|
1292
1833
|
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
1293
1834
|
warnIfTimeZoneProvided(el, formatOptions);
|
|
1294
1835
|
}
|
|
1295
|
-
const hourValues = (this.parsedHourValues =
|
|
1296
|
-
const minuteValues = (this.parsedMinuteValues =
|
|
1297
|
-
const monthValues = (this.parsedMonthValues =
|
|
1298
|
-
const yearValues = (this.parsedYearValues =
|
|
1299
|
-
const dayValues = (this.parsedDayValues =
|
|
1300
|
-
const todayParts = (this.todayParts =
|
|
1836
|
+
const hourValues = (this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues));
|
|
1837
|
+
const minuteValues = (this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues));
|
|
1838
|
+
const monthValues = (this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues));
|
|
1839
|
+
const yearValues = (this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues));
|
|
1840
|
+
const dayValues = (this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues));
|
|
1841
|
+
const todayParts = (this.todayParts = format.parseDate(getToday()));
|
|
1301
1842
|
this.processMinParts();
|
|
1302
1843
|
this.processMaxParts();
|
|
1303
|
-
this.defaultParts =
|
|
1844
|
+
this.defaultParts = format.getClosestValidDate({
|
|
1304
1845
|
refParts: todayParts,
|
|
1305
1846
|
monthValues,
|
|
1306
1847
|
dayValues,
|
|
@@ -1378,18 +1919,17 @@ const Datetime = class {
|
|
|
1378
1919
|
}
|
|
1379
1920
|
renderCombinedDatePickerColumn() {
|
|
1380
1921
|
const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
1381
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1382
1922
|
/**
|
|
1383
1923
|
* By default, generate a range of 3 months:
|
|
1384
1924
|
* Previous month, current month, and next month
|
|
1385
1925
|
*/
|
|
1386
|
-
const monthsToRender =
|
|
1926
|
+
const monthsToRender = generateMonths(workingParts);
|
|
1387
1927
|
const lastMonth = monthsToRender[monthsToRender.length - 1];
|
|
1388
1928
|
/**
|
|
1389
1929
|
* Ensure that users can select the entire window of dates.
|
|
1390
1930
|
*/
|
|
1391
1931
|
monthsToRender[0].day = 1;
|
|
1392
|
-
lastMonth.day =
|
|
1932
|
+
lastMonth.day = format.getNumDaysInMonth(lastMonth.month, lastMonth.year);
|
|
1393
1933
|
/**
|
|
1394
1934
|
* Narrow the dates rendered based on min/max dates (if any).
|
|
1395
1935
|
* The `min` date is used if the min is after the generated min month.
|
|
@@ -1398,9 +1938,9 @@ const Datetime = class {
|
|
|
1398
1938
|
* but still allows future dates to be lazily rendered based on any min/max
|
|
1399
1939
|
* constraints.
|
|
1400
1940
|
*/
|
|
1401
|
-
const min = minParts !== undefined &&
|
|
1402
|
-
const max = maxParts !== undefined &&
|
|
1403
|
-
const result =
|
|
1941
|
+
const min = minParts !== undefined && format.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
|
|
1942
|
+
const max = maxParts !== undefined && format.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
|
|
1943
|
+
const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
|
|
1404
1944
|
let items = result.items;
|
|
1405
1945
|
const parts = result.parts;
|
|
1406
1946
|
if (isDateEnabled) {
|
|
@@ -1413,12 +1953,15 @@ const Datetime = class {
|
|
|
1413
1953
|
* to prevent exceptions in the user's function from
|
|
1414
1954
|
* interrupting the calendar rendering.
|
|
1415
1955
|
*/
|
|
1416
|
-
disabled = !isDateEnabled(
|
|
1956
|
+
disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
|
|
1417
1957
|
}
|
|
1418
1958
|
catch (e) {
|
|
1419
1959
|
index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1420
1960
|
}
|
|
1421
|
-
return
|
|
1961
|
+
return {
|
|
1962
|
+
...itemObject,
|
|
1963
|
+
disabled,
|
|
1964
|
+
};
|
|
1422
1965
|
});
|
|
1423
1966
|
}
|
|
1424
1967
|
/**
|
|
@@ -1431,20 +1974,28 @@ const Datetime = class {
|
|
|
1431
1974
|
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1432
1975
|
const { value } = ev.detail;
|
|
1433
1976
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
1434
|
-
|
|
1435
|
-
this.
|
|
1977
|
+
// Read live so parts a sibling column just committed are included.
|
|
1978
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1979
|
+
this.setWorkingParts({
|
|
1980
|
+
...this.workingParts,
|
|
1981
|
+
...findPart,
|
|
1982
|
+
});
|
|
1983
|
+
this.setActiveParts({
|
|
1984
|
+
...activePart,
|
|
1985
|
+
...findPart,
|
|
1986
|
+
});
|
|
1436
1987
|
ev.stopPropagation();
|
|
1437
|
-
} }, items.map((item) => (index.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)))));
|
|
1988
|
+
} }, items.map((item) => (index.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)))));
|
|
1438
1989
|
}
|
|
1439
1990
|
renderIndividualDatePickerColumns(forcePresentation) {
|
|
1440
1991
|
const { workingParts, isDateEnabled } = this;
|
|
1441
1992
|
const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
|
|
1442
1993
|
const months = shouldRenderMonths
|
|
1443
|
-
?
|
|
1994
|
+
? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
|
|
1444
1995
|
: [];
|
|
1445
1996
|
const shouldRenderDays = forcePresentation === 'date';
|
|
1446
1997
|
let days = shouldRenderDays
|
|
1447
|
-
?
|
|
1998
|
+
? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
|
|
1448
1999
|
: [];
|
|
1449
2000
|
if (isDateEnabled) {
|
|
1450
2001
|
days = days.map((dayObject) => {
|
|
@@ -1462,22 +2013,25 @@ const Datetime = class {
|
|
|
1462
2013
|
* to prevent exceptions in the user's function from
|
|
1463
2014
|
* interrupting the calendar rendering.
|
|
1464
2015
|
*/
|
|
1465
|
-
disabled = !isDateEnabled(
|
|
2016
|
+
disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
|
|
1466
2017
|
}
|
|
1467
2018
|
catch (e) {
|
|
1468
2019
|
index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1469
2020
|
}
|
|
1470
|
-
return
|
|
2021
|
+
return {
|
|
2022
|
+
...dayObject,
|
|
2023
|
+
disabled,
|
|
2024
|
+
};
|
|
1471
2025
|
});
|
|
1472
2026
|
}
|
|
1473
2027
|
const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
|
|
1474
2028
|
const years = shouldRenderYears
|
|
1475
|
-
?
|
|
2029
|
+
? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
|
|
1476
2030
|
: [];
|
|
1477
2031
|
/**
|
|
1478
2032
|
* Certain locales show the day before the month.
|
|
1479
2033
|
*/
|
|
1480
|
-
const showMonthFirst =
|
|
2034
|
+
const showMonthFirst = format.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
|
|
1481
2035
|
let renderArray = [];
|
|
1482
2036
|
if (showMonthFirst) {
|
|
1483
2037
|
renderArray = [
|
|
@@ -1496,42 +2050,68 @@ const Datetime = class {
|
|
|
1496
2050
|
return renderArray;
|
|
1497
2051
|
}
|
|
1498
2052
|
renderDayPickerColumn(days) {
|
|
1499
|
-
var _a;
|
|
1500
2053
|
if (days.length === 0) {
|
|
1501
2054
|
return [];
|
|
1502
2055
|
}
|
|
1503
2056
|
const { disabled, workingParts } = this;
|
|
1504
|
-
const
|
|
1505
|
-
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
2057
|
+
const pickerColumnValue = (workingParts.day !== null ? workingParts.day : this.defaultParts.day) ?? undefined;
|
|
1506
2058
|
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1507
|
-
|
|
1508
|
-
|
|
2059
|
+
// Read live so parts a sibling column just committed are included.
|
|
2060
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2061
|
+
this.setWorkingParts({
|
|
2062
|
+
...this.workingParts,
|
|
2063
|
+
day: ev.detail.value,
|
|
2064
|
+
});
|
|
2065
|
+
this.setActiveParts({
|
|
2066
|
+
...activePart,
|
|
2067
|
+
day: ev.detail.value,
|
|
2068
|
+
});
|
|
1509
2069
|
ev.stopPropagation();
|
|
1510
|
-
} }, days.map((day) => (index.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)))));
|
|
2070
|
+
} }, days.map((day) => (index.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)))));
|
|
1511
2071
|
}
|
|
1512
2072
|
renderMonthPickerColumn(months) {
|
|
1513
2073
|
if (months.length === 0) {
|
|
1514
2074
|
return [];
|
|
1515
2075
|
}
|
|
1516
2076
|
const { disabled, workingParts } = this;
|
|
1517
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1518
2077
|
return (index.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) => {
|
|
1519
|
-
|
|
1520
|
-
|
|
2078
|
+
// Read live so parts a sibling column just committed are included.
|
|
2079
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2080
|
+
this.setWorkingParts({
|
|
2081
|
+
...this.workingParts,
|
|
2082
|
+
month: ev.detail.value,
|
|
2083
|
+
});
|
|
2084
|
+
// Month wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
|
|
2085
|
+
if (!this.multiple) {
|
|
2086
|
+
this.setActiveParts({
|
|
2087
|
+
...activePart,
|
|
2088
|
+
month: ev.detail.value,
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
1521
2091
|
ev.stopPropagation();
|
|
1522
|
-
} }, months.map((month) => (index.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)))));
|
|
2092
|
+
} }, months.map((month) => (index.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)))));
|
|
1523
2093
|
}
|
|
1524
2094
|
renderYearPickerColumn(years) {
|
|
1525
2095
|
if (years.length === 0) {
|
|
1526
2096
|
return [];
|
|
1527
2097
|
}
|
|
1528
2098
|
const { disabled, workingParts } = this;
|
|
1529
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1530
2099
|
return (index.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) => {
|
|
1531
|
-
|
|
1532
|
-
|
|
2100
|
+
// Read live so parts a sibling column just committed are included.
|
|
2101
|
+
const activePart = this.getActivePartsWithFallback();
|
|
2102
|
+
this.setWorkingParts({
|
|
2103
|
+
...this.workingParts,
|
|
2104
|
+
year: ev.detail.value,
|
|
2105
|
+
});
|
|
2106
|
+
// Year wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
|
|
2107
|
+
if (!this.multiple) {
|
|
2108
|
+
this.setActiveParts({
|
|
2109
|
+
...activePart,
|
|
2110
|
+
year: ev.detail.value,
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
1533
2113
|
ev.stopPropagation();
|
|
1534
|
-
} }, years.map((year) => (index.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)))));
|
|
2114
|
+
} }, years.map((year) => (index.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)))));
|
|
1535
2115
|
}
|
|
1536
2116
|
renderTimePickerColumns(forcePresentation) {
|
|
1537
2117
|
if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
|
|
@@ -1548,7 +2128,7 @@ const Datetime = class {
|
|
|
1548
2128
|
*/
|
|
1549
2129
|
const activePart = this.getActivePart();
|
|
1550
2130
|
const userHasSelectedDate = activePart !== undefined;
|
|
1551
|
-
const { hoursData, minutesData, dayPeriodData } =
|
|
2131
|
+
const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
|
|
1552
2132
|
return [
|
|
1553
2133
|
this.renderHourPickerColumn(hoursData),
|
|
1554
2134
|
this.renderMinutePickerColumn(minutesData),
|
|
@@ -1556,44 +2136,68 @@ const Datetime = class {
|
|
|
1556
2136
|
];
|
|
1557
2137
|
}
|
|
1558
2138
|
renderHourPickerColumn(hoursData) {
|
|
1559
|
-
const { disabled
|
|
2139
|
+
const { disabled } = this;
|
|
1560
2140
|
if (hoursData.length === 0)
|
|
1561
2141
|
return [];
|
|
1562
2142
|
const activePart = this.getActivePartsWithFallback();
|
|
1563
2143
|
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1564
|
-
|
|
1565
|
-
this.
|
|
2144
|
+
// Read live so parts a sibling column just committed are included.
|
|
2145
|
+
this.setWorkingParts({
|
|
2146
|
+
...this.workingParts,
|
|
2147
|
+
hour: ev.detail.value,
|
|
2148
|
+
});
|
|
2149
|
+
this.setActiveParts({
|
|
2150
|
+
...this.getActivePartsWithFallback(),
|
|
2151
|
+
hour: ev.detail.value,
|
|
2152
|
+
});
|
|
1566
2153
|
ev.stopPropagation();
|
|
1567
|
-
} }, hoursData.map((hour) => (index.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)))));
|
|
2154
|
+
} }, hoursData.map((hour) => (index.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)))));
|
|
1568
2155
|
}
|
|
1569
2156
|
renderMinutePickerColumn(minutesData) {
|
|
1570
|
-
const { disabled
|
|
2157
|
+
const { disabled } = this;
|
|
1571
2158
|
if (minutesData.length === 0)
|
|
1572
2159
|
return [];
|
|
1573
2160
|
const activePart = this.getActivePartsWithFallback();
|
|
1574
2161
|
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1575
|
-
|
|
1576
|
-
this.
|
|
2162
|
+
// Read live so parts a sibling column just committed are included.
|
|
2163
|
+
this.setWorkingParts({
|
|
2164
|
+
...this.workingParts,
|
|
2165
|
+
minute: ev.detail.value,
|
|
2166
|
+
});
|
|
2167
|
+
this.setActiveParts({
|
|
2168
|
+
...this.getActivePartsWithFallback(),
|
|
2169
|
+
minute: ev.detail.value,
|
|
2170
|
+
});
|
|
1577
2171
|
ev.stopPropagation();
|
|
1578
|
-
} }, minutesData.map((minute) => (index.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)))));
|
|
2172
|
+
} }, minutesData.map((minute) => (index.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)))));
|
|
1579
2173
|
}
|
|
1580
2174
|
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
1581
|
-
const { disabled
|
|
2175
|
+
const { disabled } = this;
|
|
1582
2176
|
if (dayPeriodData.length === 0) {
|
|
1583
2177
|
return [];
|
|
1584
2178
|
}
|
|
1585
2179
|
const activePart = this.getActivePartsWithFallback();
|
|
1586
|
-
const isDayPeriodRTL =
|
|
2180
|
+
const isDayPeriodRTL = format.isLocaleDayPeriodRTL(this.locale);
|
|
1587
2181
|
return (index.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) => {
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
2182
|
+
// Read live so parts a sibling column just committed are included.
|
|
2183
|
+
const currentParts = this.workingParts;
|
|
2184
|
+
const hour = format.calculateHourFromAMPM(currentParts, ev.detail.value);
|
|
2185
|
+
this.setWorkingParts({
|
|
2186
|
+
...currentParts,
|
|
2187
|
+
ampm: ev.detail.value,
|
|
2188
|
+
hour,
|
|
2189
|
+
});
|
|
2190
|
+
this.setActiveParts({
|
|
2191
|
+
...this.getActivePartsWithFallback(),
|
|
2192
|
+
ampm: ev.detail.value,
|
|
2193
|
+
hour,
|
|
2194
|
+
});
|
|
1591
2195
|
ev.stopPropagation();
|
|
1592
|
-
} }, dayPeriodData.map((dayPeriod) => (index.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)))));
|
|
2196
|
+
} }, dayPeriodData.map((dayPeriod) => (index.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)))));
|
|
1593
2197
|
}
|
|
1594
2198
|
renderWheelView(forcePresentation) {
|
|
1595
2199
|
const { locale } = this;
|
|
1596
|
-
const showMonthFirst =
|
|
2200
|
+
const showMonthFirst = format.isMonthFirstLocale(locale);
|
|
1597
2201
|
const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
|
|
1598
2202
|
return (index.h("div", { class: {
|
|
1599
2203
|
[`wheel-order-${columnOrder}`]: true,
|
|
@@ -1614,7 +2218,7 @@ const Datetime = class {
|
|
|
1614
2218
|
'calendar-month-year-toggle': true,
|
|
1615
2219
|
'ion-activatable': true,
|
|
1616
2220
|
'ion-focusable': true,
|
|
1617
|
-
}, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, index.h("span", { id: "toggle-wrapper" },
|
|
2221
|
+
}, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, index.h("span", { id: "toggle-wrapper" }, format.getMonthAndYear(this.locale, this.workingParts), index.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && index.h("ion-ripple-effect", null))), index.h("div", { class: "calendar-next-prev" }, index.h("ion-buttons", null, index.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth(), part: "navigation-button previous-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronBack, lazy: false, flipRtl: true })), index.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth(), part: "navigation-button next-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$1.chevronForward, lazy: false, flipRtl: true }))))), index.h("div", { class: "calendar-days-of-week", "aria-hidden": "true", part: "calendar-days-of-week" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
|
|
1618
2222
|
return index.h("div", { class: "day-of-week" }, d);
|
|
1619
2223
|
}))));
|
|
1620
2224
|
}
|
|
@@ -1633,8 +2237,8 @@ const Datetime = class {
|
|
|
1633
2237
|
// The day is not used when checking if a month is disabled.
|
|
1634
2238
|
// Users should be able to access the min or max month, even if the
|
|
1635
2239
|
// min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
|
|
1636
|
-
minParts:
|
|
1637
|
-
maxParts:
|
|
2240
|
+
minParts: { ...this.minParts, day: null },
|
|
2241
|
+
maxParts: { ...this.maxParts, day: null },
|
|
1638
2242
|
});
|
|
1639
2243
|
// The working month should never have swipe disabled.
|
|
1640
2244
|
// Otherwise the CSS scroll snap will not work and the user
|
|
@@ -1645,7 +2249,7 @@ const Datetime = class {
|
|
|
1645
2249
|
'calendar-month': true,
|
|
1646
2250
|
// Prevents scroll snap swipe gestures for months outside of the min/max bounds
|
|
1647
2251
|
'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
|
|
1648
|
-
} }, index.h("div", { class: "calendar-month-grid" },
|
|
2252
|
+
} }, index.h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index$1) => {
|
|
1649
2253
|
const { day, dayOfWeek, isAdjacentDay } = dateObject;
|
|
1650
2254
|
const { el, highlightedDates, isDateEnabled, multiple, showAdjacentDays } = this;
|
|
1651
2255
|
let _month = month;
|
|
@@ -1677,7 +2281,7 @@ const Datetime = class {
|
|
|
1677
2281
|
const referenceParts = { month: _month, day, year: _year, isAdjacentDay };
|
|
1678
2282
|
const isCalendarPadding = day === null;
|
|
1679
2283
|
const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
|
|
1680
|
-
const dateIsoString =
|
|
2284
|
+
const dateIsoString = format.convertDataToISO(referenceParts);
|
|
1681
2285
|
let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
|
|
1682
2286
|
if (!isCalDayDisabled && isDateEnabled !== undefined) {
|
|
1683
2287
|
try {
|
|
@@ -1743,18 +2347,24 @@ const Datetime = class {
|
|
|
1743
2347
|
if (isAdjacentDay) {
|
|
1744
2348
|
// The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
|
|
1745
2349
|
this.el.blur();
|
|
1746
|
-
this.activeParts =
|
|
2350
|
+
this.activeParts = { ...activePart, ...referenceParts };
|
|
1747
2351
|
this.animateToDate(referenceParts);
|
|
1748
2352
|
this.confirm();
|
|
1749
2353
|
}
|
|
1750
2354
|
else {
|
|
1751
|
-
this.setWorkingParts(
|
|
2355
|
+
this.setWorkingParts({
|
|
2356
|
+
...this.workingParts,
|
|
2357
|
+
...referenceParts,
|
|
2358
|
+
});
|
|
1752
2359
|
// Multiple only needs date info so we can wipe out other fields like time.
|
|
1753
2360
|
if (multiple) {
|
|
1754
2361
|
this.setActiveParts(referenceParts, isActive);
|
|
1755
2362
|
}
|
|
1756
2363
|
else {
|
|
1757
|
-
this.setActiveParts(
|
|
2364
|
+
this.setActiveParts({
|
|
2365
|
+
...activePart,
|
|
2366
|
+
...referenceParts,
|
|
2367
|
+
});
|
|
1758
2368
|
}
|
|
1759
2369
|
}
|
|
1760
2370
|
}
|
|
@@ -1762,7 +2372,7 @@ const Datetime = class {
|
|
|
1762
2372
|
}))));
|
|
1763
2373
|
}
|
|
1764
2374
|
renderCalendarBody() {
|
|
1765
|
-
return (index.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" },
|
|
2375
|
+
return (index.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
|
|
1766
2376
|
return this.renderMonth(month, year);
|
|
1767
2377
|
})));
|
|
1768
2378
|
}
|
|
@@ -1778,7 +2388,7 @@ const Datetime = class {
|
|
|
1778
2388
|
}
|
|
1779
2389
|
renderTimeOverlay() {
|
|
1780
2390
|
const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
|
|
1781
|
-
const computedHourCycle =
|
|
2391
|
+
const computedHourCycle = format.getHourCycle(locale, hourCycle);
|
|
1782
2392
|
const activePart = this.getActivePartsWithFallback();
|
|
1783
2393
|
return [
|
|
1784
2394
|
index.h("div", { class: "time-header" }, this.renderTimeLabel()),
|
|
@@ -1797,7 +2407,7 @@ const Datetime = class {
|
|
|
1797
2407
|
await popoverRef.onWillDismiss();
|
|
1798
2408
|
this.isTimePopoverOpen = false;
|
|
1799
2409
|
}
|
|
1800
|
-
} },
|
|
2410
|
+
} }, format.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions?.time)),
|
|
1801
2411
|
index.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
1802
2412
|
/**
|
|
1803
2413
|
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
@@ -1820,7 +2430,6 @@ const Datetime = class {
|
|
|
1820
2430
|
];
|
|
1821
2431
|
}
|
|
1822
2432
|
getHeaderSelectedDateText() {
|
|
1823
|
-
var _a;
|
|
1824
2433
|
const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
|
|
1825
2434
|
const isArray = Array.isArray(activeParts);
|
|
1826
2435
|
let headerText;
|
|
@@ -1828,7 +2437,7 @@ const Datetime = class {
|
|
|
1828
2437
|
headerText = `${activeParts.length} days`; // default/fallback for multiple selection
|
|
1829
2438
|
if (titleSelectedDatesFormatter !== undefined) {
|
|
1830
2439
|
try {
|
|
1831
|
-
headerText = titleSelectedDatesFormatter(
|
|
2440
|
+
headerText = titleSelectedDatesFormatter(format.convertDataToISO(activeParts));
|
|
1832
2441
|
}
|
|
1833
2442
|
catch (e) {
|
|
1834
2443
|
index.printIonError('[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:', e);
|
|
@@ -1837,7 +2446,7 @@ const Datetime = class {
|
|
|
1837
2446
|
}
|
|
1838
2447
|
else {
|
|
1839
2448
|
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
1840
|
-
headerText =
|
|
2449
|
+
headerText = format.getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), formatOptions?.date ?? { weekday: 'short', month: 'short', day: 'numeric' });
|
|
1841
2450
|
}
|
|
1842
2451
|
return headerText;
|
|
1843
2452
|
}
|
|
@@ -1925,18 +2534,20 @@ const Datetime = class {
|
|
|
1925
2534
|
const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
|
|
1926
2535
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1927
2536
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1928
|
-
helpers.renderHiddenInput(true, el, name,
|
|
1929
|
-
return (index.h(index.Host, { key: '
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
2537
|
+
helpers.renderHiddenInput(true, el, name, format.formatValue(value), disabled);
|
|
2538
|
+
return (index.h(index.Host, { key: '4e0b529a70924b065bcc6191e08550428b5a52a0', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: {
|
|
2539
|
+
...theme.createColorClasses(color, {
|
|
2540
|
+
[mode]: true,
|
|
2541
|
+
['datetime-readonly']: readonly,
|
|
2542
|
+
['datetime-disabled']: disabled,
|
|
2543
|
+
'show-month-and-year': shouldShowMonthAndYear,
|
|
2544
|
+
'month-year-picker-open': monthYearPickerOpen,
|
|
2545
|
+
[`datetime-presentation-${presentation}`]: true,
|
|
2546
|
+
[`datetime-size-${size}`]: true,
|
|
2547
|
+
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
2548
|
+
[`datetime-grid`]: isGridStyle,
|
|
2549
|
+
}),
|
|
2550
|
+
} }, index.h("div", { key: 'cc9d1b92f960984cb0466d0003a240ace67da243', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1940
2551
|
}
|
|
1941
2552
|
get el() { return index.getElement(this); }
|
|
1942
2553
|
static get watchers() { return {
|
|
@@ -1986,638 +2597,4 @@ Datetime.style = {
|
|
|
1986
2597
|
md: datetimeMdCss()
|
|
1987
2598
|
};
|
|
1988
2599
|
|
|
1989
|
-
/**
|
|
1990
|
-
* iOS Picker Enter Animation
|
|
1991
|
-
*/
|
|
1992
|
-
const iosEnterAnimation = (baseEl) => {
|
|
1993
|
-
const baseAnimation = animation.createAnimation();
|
|
1994
|
-
const backdropAnimation = animation.createAnimation();
|
|
1995
|
-
const wrapperAnimation = animation.createAnimation();
|
|
1996
|
-
backdropAnimation
|
|
1997
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
1998
|
-
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
1999
|
-
.beforeStyles({
|
|
2000
|
-
'pointer-events': 'none',
|
|
2001
|
-
})
|
|
2002
|
-
.afterClearStyles(['pointer-events']);
|
|
2003
|
-
wrapperAnimation
|
|
2004
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
2005
|
-
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
2006
|
-
return baseAnimation
|
|
2007
|
-
.addElement(baseEl)
|
|
2008
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
2009
|
-
.duration(400)
|
|
2010
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
2011
|
-
};
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* iOS Picker Leave Animation
|
|
2015
|
-
*/
|
|
2016
|
-
const iosLeaveAnimation = (baseEl) => {
|
|
2017
|
-
const baseAnimation = animation.createAnimation();
|
|
2018
|
-
const backdropAnimation = animation.createAnimation();
|
|
2019
|
-
const wrapperAnimation = animation.createAnimation();
|
|
2020
|
-
backdropAnimation
|
|
2021
|
-
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
2022
|
-
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
2023
|
-
wrapperAnimation
|
|
2024
|
-
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
2025
|
-
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
2026
|
-
return baseAnimation
|
|
2027
|
-
.addElement(baseEl)
|
|
2028
|
-
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
2029
|
-
.duration(400)
|
|
2030
|
-
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
2031
|
-
};
|
|
2032
|
-
|
|
2033
|
-
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}`;
|
|
2034
|
-
|
|
2035
|
-
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}`;
|
|
2036
|
-
|
|
2037
|
-
const Picker = class {
|
|
2038
|
-
constructor(hostRef) {
|
|
2039
|
-
index.registerInstance(this, hostRef);
|
|
2040
|
-
this.didPresent = index.createEvent(this, "ionPickerDidPresent", 7);
|
|
2041
|
-
this.willPresent = index.createEvent(this, "ionPickerWillPresent", 7);
|
|
2042
|
-
this.willDismiss = index.createEvent(this, "ionPickerWillDismiss", 7);
|
|
2043
|
-
this.didDismiss = index.createEvent(this, "ionPickerDidDismiss", 7);
|
|
2044
|
-
this.didPresentShorthand = index.createEvent(this, "didPresent", 7);
|
|
2045
|
-
this.willPresentShorthand = index.createEvent(this, "willPresent", 7);
|
|
2046
|
-
this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
|
|
2047
|
-
this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
|
|
2048
|
-
this.delegateController = overlays.createDelegateController(this);
|
|
2049
|
-
this.lockController = lockController.createLockController();
|
|
2050
|
-
this.triggerController = overlays.createTriggerController();
|
|
2051
|
-
this.presented = false;
|
|
2052
|
-
/** @internal */
|
|
2053
|
-
this.hasController = false;
|
|
2054
|
-
/**
|
|
2055
|
-
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
|
|
2056
|
-
*/
|
|
2057
|
-
this.keyboardClose = true;
|
|
2058
|
-
/**
|
|
2059
|
-
* Array of buttons to be displayed at the top of the picker.
|
|
2060
|
-
*/
|
|
2061
|
-
this.buttons = [];
|
|
2062
|
-
/**
|
|
2063
|
-
* Array of columns to be displayed in the picker.
|
|
2064
|
-
*/
|
|
2065
|
-
this.columns = [];
|
|
2066
|
-
/**
|
|
2067
|
-
* Number of milliseconds to wait before dismissing the picker.
|
|
2068
|
-
*/
|
|
2069
|
-
this.duration = 0;
|
|
2070
|
-
/**
|
|
2071
|
-
* If `true`, a backdrop will be displayed behind the picker.
|
|
2072
|
-
*/
|
|
2073
|
-
this.showBackdrop = true;
|
|
2074
|
-
/**
|
|
2075
|
-
* If `true`, the picker will be dismissed when the backdrop is clicked.
|
|
2076
|
-
*/
|
|
2077
|
-
this.backdropDismiss = true;
|
|
2078
|
-
/**
|
|
2079
|
-
* If `true`, the picker will animate.
|
|
2080
|
-
*/
|
|
2081
|
-
this.animated = true;
|
|
2082
|
-
/**
|
|
2083
|
-
* If `true`, the picker will open. If `false`, the picker will close.
|
|
2084
|
-
* Use this if you need finer grained control over presentation, otherwise
|
|
2085
|
-
* just use the pickerController or the `trigger` property.
|
|
2086
|
-
* Note: `isOpen` will not automatically be set back to `false` when
|
|
2087
|
-
* the picker dismisses. You will need to do that in your code.
|
|
2088
|
-
*/
|
|
2089
|
-
this.isOpen = false;
|
|
2090
|
-
this.onBackdropTap = () => {
|
|
2091
|
-
this.dismiss(undefined, overlays.BACKDROP);
|
|
2092
|
-
};
|
|
2093
|
-
this.dispatchCancelHandler = (ev) => {
|
|
2094
|
-
const role = ev.detail.role;
|
|
2095
|
-
if (overlays.isCancel(role)) {
|
|
2096
|
-
const cancelButton = this.buttons.find((b) => b.role === 'cancel');
|
|
2097
|
-
this.callButtonHandler(cancelButton);
|
|
2098
|
-
}
|
|
2099
|
-
};
|
|
2100
|
-
}
|
|
2101
|
-
onIsOpenChange(newValue, oldValue) {
|
|
2102
|
-
if (newValue === true && oldValue === false) {
|
|
2103
|
-
this.present();
|
|
2104
|
-
}
|
|
2105
|
-
else if (newValue === false && oldValue === true) {
|
|
2106
|
-
this.dismiss();
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
triggerChanged() {
|
|
2110
|
-
const { trigger, el, triggerController } = this;
|
|
2111
|
-
if (trigger) {
|
|
2112
|
-
triggerController.addClickListener(el, trigger);
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
connectedCallback() {
|
|
2116
|
-
overlays.prepareOverlay(this.el);
|
|
2117
|
-
this.triggerChanged();
|
|
2118
|
-
}
|
|
2119
|
-
disconnectedCallback() {
|
|
2120
|
-
this.triggerController.removeClickListener();
|
|
2121
|
-
}
|
|
2122
|
-
componentWillLoad() {
|
|
2123
|
-
var _a;
|
|
2124
|
-
if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
2125
|
-
overlays.setOverlayId(this.el);
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
componentDidLoad() {
|
|
2129
|
-
index.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);
|
|
2130
|
-
/**
|
|
2131
|
-
* If picker was rendered with isOpen="true"
|
|
2132
|
-
* then we should open picker immediately.
|
|
2133
|
-
*/
|
|
2134
|
-
if (this.isOpen === true) {
|
|
2135
|
-
helpers.raf(() => this.present());
|
|
2136
|
-
}
|
|
2137
|
-
/**
|
|
2138
|
-
* When binding values in frameworks such as Angular
|
|
2139
|
-
* it is possible for the value to be set after the Web Component
|
|
2140
|
-
* initializes but before the value watcher is set up in Stencil.
|
|
2141
|
-
* As a result, the watcher callback may not be fired.
|
|
2142
|
-
* We work around this by manually calling the watcher
|
|
2143
|
-
* callback when the component has loaded and the watcher
|
|
2144
|
-
* is configured.
|
|
2145
|
-
*/
|
|
2146
|
-
this.triggerChanged();
|
|
2147
|
-
}
|
|
2148
|
-
/**
|
|
2149
|
-
* Present the picker overlay after it has been created.
|
|
2150
|
-
*/
|
|
2151
|
-
async present() {
|
|
2152
|
-
const unlock = await this.lockController.lock();
|
|
2153
|
-
await this.delegateController.attachViewToDom();
|
|
2154
|
-
await overlays.present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
|
|
2155
|
-
if (this.duration > 0) {
|
|
2156
|
-
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
|
2157
|
-
}
|
|
2158
|
-
unlock();
|
|
2159
|
-
}
|
|
2160
|
-
/**
|
|
2161
|
-
* Dismiss the picker overlay after it has been presented.
|
|
2162
|
-
*
|
|
2163
|
-
* @param data Any data to emit in the dismiss events.
|
|
2164
|
-
* @param role The role of the element that is dismissing the picker.
|
|
2165
|
-
* This can be useful in a button handler for determining which button was
|
|
2166
|
-
* clicked to dismiss the picker.
|
|
2167
|
-
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
2168
|
-
*/
|
|
2169
|
-
async dismiss(data, role) {
|
|
2170
|
-
const unlock = await this.lockController.lock();
|
|
2171
|
-
if (this.durationTimeout) {
|
|
2172
|
-
clearTimeout(this.durationTimeout);
|
|
2173
|
-
}
|
|
2174
|
-
const dismissed = await overlays.dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
|
|
2175
|
-
if (dismissed) {
|
|
2176
|
-
this.delegateController.removeViewFromDom();
|
|
2177
|
-
}
|
|
2178
|
-
unlock();
|
|
2179
|
-
return dismissed;
|
|
2180
|
-
}
|
|
2181
|
-
/**
|
|
2182
|
-
* Returns a promise that resolves when the picker did dismiss.
|
|
2183
|
-
*/
|
|
2184
|
-
onDidDismiss() {
|
|
2185
|
-
return overlays.eventMethod(this.el, 'ionPickerDidDismiss');
|
|
2186
|
-
}
|
|
2187
|
-
/**
|
|
2188
|
-
* Returns a promise that resolves when the picker will dismiss.
|
|
2189
|
-
*/
|
|
2190
|
-
onWillDismiss() {
|
|
2191
|
-
return overlays.eventMethod(this.el, 'ionPickerWillDismiss');
|
|
2192
|
-
}
|
|
2193
|
-
/**
|
|
2194
|
-
* Get the column that matches the specified name.
|
|
2195
|
-
*
|
|
2196
|
-
* @param name The name of the column.
|
|
2197
|
-
*/
|
|
2198
|
-
getColumn(name) {
|
|
2199
|
-
return Promise.resolve(this.columns.find((column) => column.name === name));
|
|
2200
|
-
}
|
|
2201
|
-
async buttonClick(button) {
|
|
2202
|
-
const role = button.role;
|
|
2203
|
-
if (overlays.isCancel(role)) {
|
|
2204
|
-
return this.dismiss(undefined, role);
|
|
2205
|
-
}
|
|
2206
|
-
const shouldDismiss = await this.callButtonHandler(button);
|
|
2207
|
-
if (shouldDismiss) {
|
|
2208
|
-
return this.dismiss(this.getSelected(), button.role);
|
|
2209
|
-
}
|
|
2210
|
-
return Promise.resolve();
|
|
2211
|
-
}
|
|
2212
|
-
async callButtonHandler(button) {
|
|
2213
|
-
if (button) {
|
|
2214
|
-
// a handler has been provided, execute it
|
|
2215
|
-
// pass the handler the values from the inputs
|
|
2216
|
-
const rtn = await overlays.safeCall(button.handler, this.getSelected());
|
|
2217
|
-
if (rtn === false) {
|
|
2218
|
-
// if the return value of the handler is false then do not dismiss
|
|
2219
|
-
return false;
|
|
2220
|
-
}
|
|
2221
|
-
}
|
|
2222
|
-
return true;
|
|
2223
|
-
}
|
|
2224
|
-
getSelected() {
|
|
2225
|
-
const selected = {};
|
|
2226
|
-
this.columns.forEach((col, index) => {
|
|
2227
|
-
const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
|
|
2228
|
-
selected[col.name] = {
|
|
2229
|
-
text: selectedColumn ? selectedColumn.text : undefined,
|
|
2230
|
-
value: selectedColumn ? selectedColumn.value : undefined,
|
|
2231
|
-
columnIndex: index,
|
|
2232
|
-
};
|
|
2233
|
-
});
|
|
2234
|
-
return selected;
|
|
2235
|
-
}
|
|
2236
|
-
render() {
|
|
2237
|
-
const { htmlAttributes } = this;
|
|
2238
|
-
const mode = ionicGlobal.getIonMode(this);
|
|
2239
|
-
return (index.h(index.Host, Object.assign({ key: '80f66d33780d8a1352d24be9cb63a0cc03d01ab5', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
|
2240
|
-
zIndex: `${20000 + this.overlayIndex}`,
|
|
2241
|
-
}, class: Object.assign({ [mode]: true,
|
|
2242
|
-
// Used internally for styling
|
|
2243
|
-
[`picker-${mode}`]: true, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), index.h("ion-backdrop", { key: '97fb8e10ba08b197610cb8c0cdea61103883d55f', visible: this.showBackdrop, tappable: this.backdropDismiss }), index.h("div", { key: 'b3969cb6fbf7153623d14e3ca1493d3370efb211', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: '299268483c3727e698d9135bfdf40349a7050ac1', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, index.h("div", { key: '95394de3ef691899b7dbf416f56fd3e86bbdce3f', class: "picker-toolbar" }, this.buttons.map((b) => (index.h("div", { class: buttonWrapperClass(b) }, index.h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), index.h("div", { key: '05f18bb8d00dc0e22f691b7e41f90f729a6c66d7', class: "picker-columns" }, index.h("div", { key: '4a8fdf224effc0af67fd413e2e6aca8a78d1cf43', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => index.h("ion-picker-legacy-column", { col: c })), index.h("div", { key: 'e50a31db45e3f39e9d0fed36a21be9257eec09bf', class: "picker-below-highlight" }))), index.h("div", { key: '5a78cb2176ac807ea0c195c6b76cd0e8eef9d4c0', tabindex: "0", "aria-hidden": "true" })));
|
|
2244
|
-
}
|
|
2245
|
-
get el() { return index.getElement(this); }
|
|
2246
|
-
static get watchers() { return {
|
|
2247
|
-
"isOpen": [{
|
|
2248
|
-
"onIsOpenChange": 0
|
|
2249
|
-
}],
|
|
2250
|
-
"trigger": [{
|
|
2251
|
-
"triggerChanged": 0
|
|
2252
|
-
}]
|
|
2253
|
-
}; }
|
|
2254
|
-
};
|
|
2255
|
-
const buttonWrapperClass = (button) => {
|
|
2256
|
-
return {
|
|
2257
|
-
[`picker-toolbar-${button.role}`]: button.role !== undefined,
|
|
2258
|
-
'picker-toolbar-button': true,
|
|
2259
|
-
};
|
|
2260
|
-
};
|
|
2261
|
-
const buttonClass = (button) => {
|
|
2262
|
-
return Object.assign({ 'picker-button': true, 'ion-activatable': true }, theme.getClassMap(button.cssClass));
|
|
2263
|
-
};
|
|
2264
|
-
Picker.style = {
|
|
2265
|
-
ios: pickerIosCss(),
|
|
2266
|
-
md: pickerMdCss()
|
|
2267
|
-
};
|
|
2268
|
-
|
|
2269
|
-
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}}`;
|
|
2270
|
-
|
|
2271
|
-
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)}`;
|
|
2272
|
-
|
|
2273
|
-
const PickerColumnCmp = class {
|
|
2274
|
-
constructor(hostRef) {
|
|
2275
|
-
index.registerInstance(this, hostRef);
|
|
2276
|
-
this.ionPickerColChange = index.createEvent(this, "ionPickerColChange", 7);
|
|
2277
|
-
this.optHeight = 0;
|
|
2278
|
-
this.rotateFactor = 0;
|
|
2279
|
-
this.scaleFactor = 1;
|
|
2280
|
-
this.velocity = 0;
|
|
2281
|
-
this.y = 0;
|
|
2282
|
-
this.noAnimate = true;
|
|
2283
|
-
// `colDidChange` is a flag that gets set when the column is changed
|
|
2284
|
-
// dynamically. When this flag is set, the column will refresh
|
|
2285
|
-
// after the component re-renders to incorporate the new column data.
|
|
2286
|
-
// This is necessary because `this.refresh` queries for the option elements,
|
|
2287
|
-
// so it needs to wait for the latest elements to be available in the DOM.
|
|
2288
|
-
// Ex: column is created with 3 options. User updates the column data
|
|
2289
|
-
// to have 5 options. The column will still think it only has 3 options.
|
|
2290
|
-
this.colDidChange = false;
|
|
2291
|
-
}
|
|
2292
|
-
colChanged() {
|
|
2293
|
-
this.colDidChange = true;
|
|
2294
|
-
}
|
|
2295
|
-
async connectedCallback() {
|
|
2296
|
-
let pickerRotateFactor = 0;
|
|
2297
|
-
let pickerScaleFactor = 0.81;
|
|
2298
|
-
const mode = ionicGlobal.getIonMode(this);
|
|
2299
|
-
if (mode === 'ios') {
|
|
2300
|
-
pickerRotateFactor = -0.46;
|
|
2301
|
-
pickerScaleFactor = 1;
|
|
2302
|
-
}
|
|
2303
|
-
this.rotateFactor = pickerRotateFactor;
|
|
2304
|
-
this.scaleFactor = pickerScaleFactor;
|
|
2305
|
-
this.gesture = (await Promise.resolve().then(function () { return require('./index-CAvQ7Tka.js'); })).createGesture({
|
|
2306
|
-
el: this.el,
|
|
2307
|
-
gestureName: 'picker-swipe',
|
|
2308
|
-
gesturePriority: 100,
|
|
2309
|
-
threshold: 0,
|
|
2310
|
-
passive: false,
|
|
2311
|
-
onStart: (ev) => this.onStart(ev),
|
|
2312
|
-
onMove: (ev) => this.onMove(ev),
|
|
2313
|
-
onEnd: (ev) => this.onEnd(ev),
|
|
2314
|
-
});
|
|
2315
|
-
this.gesture.enable();
|
|
2316
|
-
// Options have not been initialized yet
|
|
2317
|
-
// Animation must be disabled through the `noAnimate` flag
|
|
2318
|
-
// Otherwise, the options will render
|
|
2319
|
-
// at the top of the column and transition down
|
|
2320
|
-
this.tmrId = setTimeout(() => {
|
|
2321
|
-
this.noAnimate = false;
|
|
2322
|
-
// After initialization, `refresh()` will be called
|
|
2323
|
-
// At this point, animation will be enabled. The options will
|
|
2324
|
-
// animate as they are being selected.
|
|
2325
|
-
this.refresh(true);
|
|
2326
|
-
}, 250);
|
|
2327
|
-
}
|
|
2328
|
-
componentDidLoad() {
|
|
2329
|
-
this.onDomChange();
|
|
2330
|
-
}
|
|
2331
|
-
componentDidUpdate() {
|
|
2332
|
-
// Options may have changed since last update.
|
|
2333
|
-
if (this.colDidChange) {
|
|
2334
|
-
// Animation must be disabled through the `onDomChange` parameter.
|
|
2335
|
-
// Otherwise, the recently added options will render
|
|
2336
|
-
// at the top of the column and transition down
|
|
2337
|
-
this.onDomChange(true, false);
|
|
2338
|
-
this.colDidChange = false;
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
disconnectedCallback() {
|
|
2342
|
-
if (this.rafId !== undefined)
|
|
2343
|
-
cancelAnimationFrame(this.rafId);
|
|
2344
|
-
if (this.tmrId)
|
|
2345
|
-
clearTimeout(this.tmrId);
|
|
2346
|
-
if (this.gesture) {
|
|
2347
|
-
this.gesture.destroy();
|
|
2348
|
-
this.gesture = undefined;
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
emitColChange() {
|
|
2352
|
-
this.ionPickerColChange.emit(this.col);
|
|
2353
|
-
}
|
|
2354
|
-
setSelected(selectedIndex, duration) {
|
|
2355
|
-
// if there is a selected index, then figure out it's y position
|
|
2356
|
-
// if there isn't a selected index, then just use the top y position
|
|
2357
|
-
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
2358
|
-
this.velocity = 0;
|
|
2359
|
-
// set what y position we're at
|
|
2360
|
-
if (this.rafId !== undefined)
|
|
2361
|
-
cancelAnimationFrame(this.rafId);
|
|
2362
|
-
this.update(y, duration, true);
|
|
2363
|
-
this.emitColChange();
|
|
2364
|
-
}
|
|
2365
|
-
update(y, duration, saveY) {
|
|
2366
|
-
if (!this.optsEl) {
|
|
2367
|
-
return;
|
|
2368
|
-
}
|
|
2369
|
-
// ensure we've got a good round number :)
|
|
2370
|
-
let translateY = 0;
|
|
2371
|
-
let translateZ = 0;
|
|
2372
|
-
const { col, rotateFactor } = this;
|
|
2373
|
-
const prevSelected = col.selectedIndex;
|
|
2374
|
-
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
2375
|
-
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
2376
|
-
const scaleStr = `scale(${this.scaleFactor})`;
|
|
2377
|
-
const children = this.optsEl.children;
|
|
2378
|
-
for (let i = 0; i < children.length; i++) {
|
|
2379
|
-
const button = children[i];
|
|
2380
|
-
const opt = col.options[i];
|
|
2381
|
-
const optOffset = i * this.optHeight + y;
|
|
2382
|
-
let transform = '';
|
|
2383
|
-
if (rotateFactor !== 0) {
|
|
2384
|
-
const rotateX = optOffset * rotateFactor;
|
|
2385
|
-
if (Math.abs(rotateX) <= 90) {
|
|
2386
|
-
translateY = 0;
|
|
2387
|
-
translateZ = 90;
|
|
2388
|
-
transform = `rotateX(${rotateX}deg) `;
|
|
2389
|
-
}
|
|
2390
|
-
else {
|
|
2391
|
-
translateY = -9999;
|
|
2392
|
-
}
|
|
2393
|
-
}
|
|
2394
|
-
else {
|
|
2395
|
-
translateZ = 0;
|
|
2396
|
-
translateY = optOffset;
|
|
2397
|
-
}
|
|
2398
|
-
const selected = selectedIndex === i;
|
|
2399
|
-
transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
|
2400
|
-
if (this.scaleFactor !== 1 && !selected) {
|
|
2401
|
-
transform += scaleStr;
|
|
2402
|
-
}
|
|
2403
|
-
// Update transition duration
|
|
2404
|
-
if (this.noAnimate) {
|
|
2405
|
-
opt.duration = 0;
|
|
2406
|
-
button.style.transitionDuration = '';
|
|
2407
|
-
}
|
|
2408
|
-
else if (duration !== opt.duration) {
|
|
2409
|
-
opt.duration = duration;
|
|
2410
|
-
button.style.transitionDuration = durationStr;
|
|
2411
|
-
}
|
|
2412
|
-
// Update transform
|
|
2413
|
-
if (transform !== opt.transform) {
|
|
2414
|
-
opt.transform = transform;
|
|
2415
|
-
}
|
|
2416
|
-
button.style.transform = transform;
|
|
2417
|
-
/**
|
|
2418
|
-
* Ensure that the select column
|
|
2419
|
-
* item has the selected class
|
|
2420
|
-
*/
|
|
2421
|
-
opt.selected = selected;
|
|
2422
|
-
if (selected) {
|
|
2423
|
-
button.classList.add(PICKER_OPT_SELECTED);
|
|
2424
|
-
}
|
|
2425
|
-
else {
|
|
2426
|
-
button.classList.remove(PICKER_OPT_SELECTED);
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
this.col.prevSelected = prevSelected;
|
|
2430
|
-
if (saveY) {
|
|
2431
|
-
this.y = y;
|
|
2432
|
-
}
|
|
2433
|
-
if (this.lastIndex !== selectedIndex) {
|
|
2434
|
-
// have not set a last index yet
|
|
2435
|
-
haptic.hapticSelectionChanged();
|
|
2436
|
-
this.lastIndex = selectedIndex;
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
|
-
decelerate() {
|
|
2440
|
-
if (this.velocity !== 0) {
|
|
2441
|
-
// still decelerating
|
|
2442
|
-
this.velocity *= DECELERATION_FRICTION;
|
|
2443
|
-
// do not let it go slower than a velocity of 1
|
|
2444
|
-
this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
|
|
2445
|
-
let y = this.y + this.velocity;
|
|
2446
|
-
if (y > this.minY) {
|
|
2447
|
-
// whoops, it's trying to scroll up farther than the options we have!
|
|
2448
|
-
y = this.minY;
|
|
2449
|
-
this.velocity = 0;
|
|
2450
|
-
}
|
|
2451
|
-
else if (y < this.maxY) {
|
|
2452
|
-
// gahh, it's trying to scroll down farther than we can!
|
|
2453
|
-
y = this.maxY;
|
|
2454
|
-
this.velocity = 0;
|
|
2455
|
-
}
|
|
2456
|
-
this.update(y, 0, true);
|
|
2457
|
-
const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
|
|
2458
|
-
if (notLockedIn) {
|
|
2459
|
-
// isn't locked in yet, keep decelerating until it is
|
|
2460
|
-
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
2461
|
-
}
|
|
2462
|
-
else {
|
|
2463
|
-
this.velocity = 0;
|
|
2464
|
-
this.emitColChange();
|
|
2465
|
-
haptic.hapticSelectionEnd();
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
else if (this.y % this.optHeight !== 0) {
|
|
2469
|
-
// needs to still get locked into a position so options line up
|
|
2470
|
-
const currentPos = Math.abs(this.y % this.optHeight);
|
|
2471
|
-
// create a velocity in the direction it needs to scroll
|
|
2472
|
-
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
2473
|
-
this.decelerate();
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
indexForY(y) {
|
|
2477
|
-
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
2478
|
-
}
|
|
2479
|
-
onStart(detail) {
|
|
2480
|
-
// We have to prevent default in order to block scrolling under the picker
|
|
2481
|
-
// but we DO NOT have to stop propagation, since we still want
|
|
2482
|
-
// some "click" events to capture
|
|
2483
|
-
if (detail.event.cancelable) {
|
|
2484
|
-
detail.event.preventDefault();
|
|
2485
|
-
}
|
|
2486
|
-
detail.event.stopPropagation();
|
|
2487
|
-
haptic.hapticSelectionStart();
|
|
2488
|
-
// reset everything
|
|
2489
|
-
if (this.rafId !== undefined)
|
|
2490
|
-
cancelAnimationFrame(this.rafId);
|
|
2491
|
-
const options = this.col.options;
|
|
2492
|
-
let minY = options.length - 1;
|
|
2493
|
-
let maxY = 0;
|
|
2494
|
-
for (let i = 0; i < options.length; i++) {
|
|
2495
|
-
if (!options[i].disabled) {
|
|
2496
|
-
minY = Math.min(minY, i);
|
|
2497
|
-
maxY = Math.max(maxY, i);
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
this.minY = -(minY * this.optHeight);
|
|
2501
|
-
this.maxY = -(maxY * this.optHeight);
|
|
2502
|
-
}
|
|
2503
|
-
onMove(detail) {
|
|
2504
|
-
if (detail.event.cancelable) {
|
|
2505
|
-
detail.event.preventDefault();
|
|
2506
|
-
}
|
|
2507
|
-
detail.event.stopPropagation();
|
|
2508
|
-
// update the scroll position relative to pointer start position
|
|
2509
|
-
let y = this.y + detail.deltaY;
|
|
2510
|
-
if (y > this.minY) {
|
|
2511
|
-
// scrolling up higher than scroll area
|
|
2512
|
-
y = Math.pow(y, 0.8);
|
|
2513
|
-
this.bounceFrom = y;
|
|
2514
|
-
}
|
|
2515
|
-
else if (y < this.maxY) {
|
|
2516
|
-
// scrolling down below scroll area
|
|
2517
|
-
y += Math.pow(this.maxY - y, 0.9);
|
|
2518
|
-
this.bounceFrom = y;
|
|
2519
|
-
}
|
|
2520
|
-
else {
|
|
2521
|
-
this.bounceFrom = 0;
|
|
2522
|
-
}
|
|
2523
|
-
this.update(y, 0, false);
|
|
2524
|
-
}
|
|
2525
|
-
onEnd(detail) {
|
|
2526
|
-
if (this.bounceFrom > 0) {
|
|
2527
|
-
// bounce back up
|
|
2528
|
-
this.update(this.minY, 100, true);
|
|
2529
|
-
this.emitColChange();
|
|
2530
|
-
return;
|
|
2531
|
-
}
|
|
2532
|
-
else if (this.bounceFrom < 0) {
|
|
2533
|
-
// bounce back down
|
|
2534
|
-
this.update(this.maxY, 100, true);
|
|
2535
|
-
this.emitColChange();
|
|
2536
|
-
return;
|
|
2537
|
-
}
|
|
2538
|
-
this.velocity = helpers.clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
|
2539
|
-
if (this.velocity === 0 && detail.deltaY === 0) {
|
|
2540
|
-
const opt = detail.event.target.closest('.picker-opt');
|
|
2541
|
-
if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
|
|
2542
|
-
this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
else {
|
|
2546
|
-
this.y += detail.deltaY;
|
|
2547
|
-
if (Math.abs(detail.velocityY) < 0.05) {
|
|
2548
|
-
const isScrollingUp = detail.deltaY > 0;
|
|
2549
|
-
const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
|
2550
|
-
if (isScrollingUp && optHeightFraction > 0.5) {
|
|
2551
|
-
this.velocity = Math.abs(this.velocity) * -1;
|
|
2552
|
-
}
|
|
2553
|
-
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
2554
|
-
this.velocity = Math.abs(this.velocity);
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
this.decelerate();
|
|
2558
|
-
}
|
|
2559
|
-
}
|
|
2560
|
-
refresh(forceRefresh, animated) {
|
|
2561
|
-
var _a;
|
|
2562
|
-
let min = this.col.options.length - 1;
|
|
2563
|
-
let max = 0;
|
|
2564
|
-
const options = this.col.options;
|
|
2565
|
-
for (let i = 0; i < options.length; i++) {
|
|
2566
|
-
if (!options[i].disabled) {
|
|
2567
|
-
min = Math.min(min, i);
|
|
2568
|
-
max = Math.max(max, i);
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
/**
|
|
2572
|
-
* Only update selected value if column has a
|
|
2573
|
-
* velocity of 0. If it does not, then the
|
|
2574
|
-
* column is animating might land on
|
|
2575
|
-
* a value different than the value at
|
|
2576
|
-
* selectedIndex
|
|
2577
|
-
*/
|
|
2578
|
-
if (this.velocity !== 0) {
|
|
2579
|
-
return;
|
|
2580
|
-
}
|
|
2581
|
-
const selectedIndex = helpers.clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
|
|
2582
|
-
if (this.col.prevSelected !== selectedIndex || forceRefresh) {
|
|
2583
|
-
const y = selectedIndex * this.optHeight * -1;
|
|
2584
|
-
const duration = animated ? TRANSITION_DURATION : 0;
|
|
2585
|
-
this.velocity = 0;
|
|
2586
|
-
this.update(y, duration, true);
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
onDomChange(forceRefresh, animated) {
|
|
2590
|
-
const colEl = this.optsEl;
|
|
2591
|
-
if (colEl) {
|
|
2592
|
-
// DOM READ
|
|
2593
|
-
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
|
|
2594
|
-
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
2595
|
-
}
|
|
2596
|
-
this.refresh(forceRefresh, animated);
|
|
2597
|
-
}
|
|
2598
|
-
render() {
|
|
2599
|
-
const col = this.col;
|
|
2600
|
-
const mode = ionicGlobal.getIonMode(this);
|
|
2601
|
-
return (index.h(index.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' }, theme.getClassMap(col.cssClass)), style: {
|
|
2602
|
-
'max-width': this.col.columnWidth,
|
|
2603
|
-
} }, col.prefix && (index.h("div", { key: 'b0f3d39e0bd128781066ffefb7a1e40d12a9e76d', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), index.h("div", { key: '0b106ac4d56916eaaa7f09d1b68348b3754b7bba', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index$1) => (index.h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index$1 }, o.text)))), col.suffix && (index.h("div", { key: '00ff2f9dbb4561787e5a5223327c6a2a33f8362e', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
2604
|
-
}
|
|
2605
|
-
get el() { return index.getElement(this); }
|
|
2606
|
-
static get watchers() { return {
|
|
2607
|
-
"col": [{
|
|
2608
|
-
"colChanged": 0
|
|
2609
|
-
}]
|
|
2610
|
-
}; }
|
|
2611
|
-
};
|
|
2612
|
-
const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
|
2613
|
-
const DECELERATION_FRICTION = 0.97;
|
|
2614
|
-
const MAX_PICKER_SPEED = 90;
|
|
2615
|
-
const TRANSITION_DURATION = 150;
|
|
2616
|
-
PickerColumnCmp.style = {
|
|
2617
|
-
ios: pickerColumnIosCss(),
|
|
2618
|
-
md: pickerColumnMdCss()
|
|
2619
|
-
};
|
|
2620
|
-
|
|
2621
2600
|
exports.ion_datetime = Datetime;
|
|
2622
|
-
exports.ion_picker_legacy = Picker;
|
|
2623
|
-
exports.ion_picker_legacy_column = PickerColumnCmp;
|