voyager-ionic-core 7.5.5 → 7.6.0
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/action-sheet.js +297 -287
- package/components/alert.js +477 -467
- package/components/animation.js +991 -990
- package/components/backdrop.js +56 -56
- package/components/button-active.js +56 -56
- package/components/button.js +236 -236
- package/components/buttons.js +29 -29
- package/components/capacitor.js +4 -4
- package/components/checkbox.js +172 -170
- package/components/config.js +142 -142
- package/components/cubic-bezier.js +49 -49
- package/components/data.js +1055 -1055
- package/components/dir.js +5 -5
- package/components/focus-visible.js +63 -63
- package/components/form-controller.js +45 -45
- package/components/framework-delegate.js +121 -121
- package/components/gesture-controller.js +182 -182
- package/components/haptic.js +150 -150
- package/components/hardware-back-button.js +48 -48
- package/components/helpers.js +257 -257
- package/components/icon.js +133 -133
- package/components/index.js +95 -95
- package/components/index2.js +163 -163
- package/components/index3.js +417 -417
- package/components/index4.js +257 -259
- package/components/index5.js +0 -22
- package/components/index6.js +3 -3
- package/components/index8.js +58 -58
- package/components/index9.js +171 -171
- package/components/input-shims.js +488 -483
- package/components/input.utils.js +107 -106
- package/components/ion-accordion-group.d.ts +2 -2
- package/components/ion-accordion-group.js +220 -220
- package/components/ion-accordion.d.ts +2 -2
- package/components/ion-accordion.js +326 -326
- package/components/ion-action-sheet.d.ts +2 -2
- package/components/ion-alert.d.ts +2 -2
- package/components/ion-app.d.ts +2 -2
- package/components/ion-app.js +93 -93
- package/components/ion-avatar.d.ts +2 -2
- package/components/ion-avatar.js +23 -23
- package/components/ion-back-button.d.ts +2 -2
- package/components/ion-back-button.js +102 -102
- package/components/ion-backdrop.d.ts +2 -2
- package/components/ion-badge.d.ts +2 -2
- package/components/ion-badge.js +29 -29
- package/components/ion-breadcrumb.d.ts +2 -2
- package/components/ion-breadcrumb.js +111 -111
- package/components/ion-breadcrumbs.d.ts +2 -2
- package/components/ion-breadcrumbs.js +139 -139
- package/components/ion-button.d.ts +2 -2
- package/components/ion-buttons.d.ts +2 -2
- package/components/ion-card-content.d.ts +2 -2
- package/components/ion-card-content.js +27 -27
- package/components/ion-card-header.d.ts +2 -2
- package/components/ion-card-header.js +33 -33
- package/components/ion-card-subtitle.d.ts +2 -2
- package/components/ion-card-subtitle.js +30 -30
- package/components/ion-card-title.d.ts +2 -2
- package/components/ion-card-title.js +30 -30
- package/components/ion-card.d.ts +2 -2
- package/components/ion-card.js +78 -78
- package/components/ion-checkbox.d.ts +2 -2
- package/components/ion-chip.d.ts +2 -2
- package/components/ion-chip.js +41 -41
- package/components/ion-col.d.ts +2 -2
- package/components/ion-col.js +156 -156
- package/components/ion-content.d.ts +2 -2
- package/components/ion-content.js +394 -394
- package/components/ion-datetime-button.d.ts +2 -2
- package/components/ion-datetime-button.js +348 -348
- package/components/ion-datetime.d.ts +2 -2
- package/components/ion-datetime.js +1722 -1709
- package/components/ion-fab-button.d.ts +2 -2
- package/components/ion-fab-button.js +109 -109
- package/components/ion-fab-list.d.ts +2 -2
- package/components/ion-fab-list.js +44 -44
- package/components/ion-fab.d.ts +2 -2
- package/components/ion-fab.js +75 -75
- package/components/ion-footer.d.ts +2 -2
- package/components/ion-footer.js +124 -124
- package/components/ion-grid.d.ts +2 -2
- package/components/ion-grid.js +27 -27
- package/components/ion-header.d.ts +2 -2
- package/components/ion-header.js +298 -298
- package/components/ion-img.d.ts +2 -2
- package/components/ion-img.js +97 -97
- package/components/ion-infinite-scroll-content.d.ts +2 -2
- package/components/ion-infinite-scroll-content.js +49 -49
- package/components/ion-infinite-scroll.d.ts +2 -2
- package/components/ion-infinite-scroll.js +187 -179
- package/components/ion-input.d.ts +2 -2
- package/components/ion-input.js +479 -454
- package/components/ion-item-divider.d.ts +2 -2
- package/components/ion-item-divider.js +34 -34
- package/components/ion-item-group.d.ts +2 -2
- package/components/ion-item-group.js +28 -28
- package/components/ion-item-option.d.ts +2 -2
- package/components/ion-item-option.js +67 -67
- package/components/ion-item-options.d.ts +2 -2
- package/components/ion-item-options.js +50 -50
- package/components/ion-item-sliding.d.ts +2 -2
- package/components/ion-item-sliding.js +404 -404
- package/components/ion-item.d.ts +2 -2
- package/components/ion-label.d.ts +2 -2
- package/components/ion-list-header.d.ts +2 -2
- package/components/ion-list.d.ts +2 -2
- package/components/ion-loading.d.ts +2 -2
- package/components/ion-loading.js +257 -247
- package/components/ion-menu-button.d.ts +2 -2
- package/components/ion-menu-button.js +77 -77
- package/components/ion-menu-toggle.d.ts +2 -2
- package/components/ion-menu-toggle.js +41 -41
- package/components/ion-menu.d.ts +2 -2
- package/components/ion-menu.js +629 -629
- package/components/ion-modal.d.ts +2 -2
- package/components/ion-modal.js +1451 -1441
- package/components/ion-nav-link.d.ts +2 -2
- package/components/ion-nav-link.js +47 -47
- package/components/ion-nav.d.ts +2 -2
- package/components/ion-nav.js +910 -910
- package/components/ion-note.d.ts +2 -2
- package/components/ion-picker-column-internal.d.ts +2 -2
- package/components/ion-picker-column.d.ts +2 -2
- package/components/ion-picker-internal.d.ts +2 -2
- package/components/ion-picker.d.ts +2 -2
- package/components/ion-picker.js +263 -253
- package/components/ion-popover.d.ts +2 -2
- package/components/ion-progress-bar.d.ts +2 -2
- package/components/ion-progress-bar.js +57 -57
- package/components/ion-radio-group.d.ts +2 -2
- package/components/ion-radio.d.ts +2 -2
- package/components/ion-range.d.ts +2 -2
- package/components/ion-range.js +593 -591
- package/components/ion-refresher-content.d.ts +2 -2
- package/components/ion-refresher-content.js +63 -63
- package/components/ion-refresher.d.ts +2 -2
- package/components/ion-refresher.js +747 -747
- package/components/ion-reorder-group.d.ts +2 -2
- package/components/ion-reorder-group.js +259 -259
- package/components/ion-reorder.d.ts +2 -2
- package/components/ion-reorder.js +39 -39
- package/components/ion-ripple-effect.d.ts +2 -2
- package/components/ion-route-redirect.d.ts +2 -2
- package/components/ion-route-redirect.js +34 -34
- package/components/ion-route.d.ts +2 -2
- package/components/ion-route.js +56 -56
- package/components/ion-router-link.d.ts +2 -2
- package/components/ion-router-link.js +45 -45
- package/components/ion-router-outlet.d.ts +2 -2
- package/components/ion-router-outlet.js +193 -193
- package/components/ion-router.d.ts +2 -2
- package/components/ion-router.js +632 -632
- package/components/ion-row.d.ts +2 -2
- package/components/ion-row.js +20 -20
- package/components/ion-searchbar.d.ts +2 -2
- package/components/ion-searchbar.js +402 -400
- package/components/ion-segment-button.d.ts +2 -2
- package/components/ion-segment-button.js +117 -117
- package/components/ion-segment.d.ts +2 -2
- package/components/ion-segment.js +427 -427
- package/components/ion-select-option.d.ts +2 -2
- package/components/ion-select-option.js +27 -27
- package/components/ion-select-popover.d.ts +2 -2
- package/components/ion-select.d.ts +2 -2
- package/components/ion-select.js +778 -763
- package/components/ion-skeleton-text.d.ts +2 -2
- package/components/ion-skeleton-text.js +45 -32
- package/components/ion-spinner.d.ts +2 -2
- package/components/ion-split-pane.d.ts +2 -2
- package/components/ion-split-pane.js +145 -145
- package/components/ion-tab-bar.d.ts +2 -2
- package/components/ion-tab-bar.js +77 -77
- package/components/ion-tab-button.d.ts +2 -2
- package/components/ion-tab-button.js +104 -104
- package/components/ion-tab.d.ts +2 -2
- package/components/ion-tab.js +72 -72
- package/components/ion-tabs.d.ts +2 -2
- package/components/ion-tabs.js +160 -160
- package/components/ion-text.d.ts +2 -2
- package/components/ion-text.js +26 -26
- package/components/ion-textarea.d.ts +2 -2
- package/components/ion-textarea.js +420 -395
- package/components/ion-thumbnail.d.ts +2 -2
- package/components/ion-thumbnail.js +20 -20
- package/components/ion-title.d.ts +2 -2
- package/components/ion-title.js +56 -56
- package/components/ion-toast.d.ts +2 -2
- package/components/ion-toast.js +819 -464
- package/components/ion-toggle.d.ts +2 -2
- package/components/ion-toggle.js +243 -241
- package/components/ion-toolbar.d.ts +2 -2
- package/components/ion-toolbar.js +71 -71
- package/components/ionic-global.js +163 -163
- package/components/ios.transition.js +598 -598
- package/components/item.js +301 -301
- package/components/keyboard-controller.js +128 -128
- package/components/keyboard.js +62 -62
- package/components/keyboard2.js +59 -59
- package/components/label.js +85 -85
- package/components/list-header.js +33 -33
- package/components/list.js +50 -50
- package/components/lock-controller.js +24 -24
- package/components/md.transition.js +44 -44
- package/components/menu-toggle-util.js +2 -2
- package/components/notch-controller.js +120 -120
- package/components/note.js +29 -29
- package/components/overlays.js +496 -495
- package/components/picker-column-internal.js +350 -345
- package/components/picker-column.js +334 -334
- package/components/picker-internal.js +468 -468
- package/components/popover.js +1154 -1144
- package/components/radio-group.js +161 -159
- package/components/radio.js +248 -208
- package/components/ripple-effect.js +81 -81
- package/components/select-popover.js +163 -163
- package/components/spinner.js +182 -182
- package/components/status-tap.js +26 -26
- package/components/swipe-back.js +65 -65
- package/components/theme.js +23 -23
- package/components/watch-options.js +30 -30
- package/css/core.css +66 -0
- package/css/core.css.map +1 -1
- package/css/display.css +44 -0
- package/css/display.css.map +1 -1
- package/css/float-elements.css +44 -0
- package/css/float-elements.css.map +1 -1
- package/css/global.bundle.css +88 -0
- package/css/global.bundle.css.map +1 -1
- package/css/ionic-swiper.css +22 -0
- package/css/ionic-swiper.css.map +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/css/padding.css +44 -0
- package/css/padding.css.map +1 -1
- package/css/structure.css +44 -0
- package/css/structure.css.map +1 -1
- package/css/text-alignment.css +44 -0
- package/css/text-alignment.css.map +1 -1
- package/css/text-transformation.css +44 -0
- package/css/text-transformation.css.map +1 -1
- package/css/typography.css +44 -0
- package/css/typography.css.map +1 -1
- package/css/utils.bundle.css +220 -0
- package/css/utils.bundle.css.map +1 -1
- package/dist/cjs/animation-9b401d39.js +1062 -0
- package/dist/cjs/{app-globals-1d4c1dbf.js → app-globals-0af482c7.js} +1 -1
- package/dist/cjs/button-active-a5185907.js +69 -0
- package/dist/cjs/{capacitor-2ffba62a.js → capacitor-c04564bf.js} +5 -5
- package/dist/cjs/compare-with-utils-df1001d7.js +44 -0
- package/dist/cjs/config-4f60b98a.js +199 -0
- package/dist/cjs/cubic-bezier-f2dccc53.js +92 -0
- package/dist/cjs/data-36b9094e.js +1622 -0
- package/dist/cjs/{dir-f1e0ca26.js → dir-94c21456.js} +5 -5
- package/dist/cjs/focus-visible-7a0ce04f.js +77 -0
- package/dist/cjs/form-controller-7d42a722.js +66 -0
- package/dist/cjs/framework-delegate-1c29b14a.js +144 -0
- package/dist/cjs/gesture-controller-c40c045a.js +197 -0
- package/dist/cjs/haptic-b882e0bb.js +212 -0
- package/dist/cjs/hardware-back-button-76833cac.js +76 -0
- package/dist/cjs/helpers-76bb7efb.js +441 -0
- package/dist/cjs/{index-cc7dfb7c.js → index-5915f9b3.js} +3 -3
- package/dist/cjs/index-b4f986cd.js +198 -0
- package/dist/cjs/{index-c2940dc1.js → index-bbb4336c.js} +58 -7
- package/dist/cjs/index-c8d52405.js +10 -0
- package/dist/cjs/index-ce101dc9.js +308 -0
- package/dist/cjs/index-d1b59ffa.js +459 -0
- package/dist/cjs/{index-da2c7a37.js → index-da15e99c.js} +60 -60
- package/dist/cjs/index-f8f13389.js +243 -0
- package/dist/cjs/index.cjs.js +113 -113
- package/dist/cjs/input-shims-a23bb0f4.js +601 -0
- package/dist/cjs/input.utils-3d0166a2.js +138 -0
- package/dist/cjs/ion-accordion_2.cjs.entry.js +488 -488
- package/dist/cjs/ion-action-sheet.cjs.entry.js +260 -250
- package/dist/cjs/ion-alert.cjs.entry.js +442 -432
- package/dist/cjs/ion-app_8.cjs.entry.js +1151 -1151
- package/dist/cjs/ion-avatar_3.cjs.entry.js +29 -29
- package/dist/cjs/ion-back-button.cjs.entry.js +73 -73
- package/dist/cjs/ion-backdrop.cjs.entry.js +40 -40
- package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +194 -194
- package/dist/cjs/ion-button_2.cjs.entry.js +303 -303
- package/dist/cjs/ion-card_5.cjs.entry.js +105 -105
- package/dist/cjs/ion-checkbox.cjs.entry.js +149 -147
- package/dist/cjs/ion-chip.cjs.entry.js +20 -20
- package/dist/cjs/ion-col_3.cjs.entry.js +136 -136
- package/dist/cjs/ion-datetime-button.cjs.entry.js +325 -325
- package/dist/cjs/ion-datetime_3.cjs.entry.js +2185 -2162
- package/dist/cjs/ion-fab_3.cjs.entry.js +150 -150
- package/dist/cjs/ion-img.cjs.entry.js +79 -79
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +198 -190
- package/dist/cjs/ion-input.cjs.entry.js +424 -399
- package/dist/cjs/ion-item-option_3.cjs.entry.js +457 -457
- package/dist/cjs/ion-item_8.cjs.entry.js +441 -428
- package/dist/cjs/ion-loading.cjs.entry.js +220 -210
- package/dist/cjs/ion-menu_3.cjs.entry.js +668 -668
- package/dist/cjs/ion-modal.cjs.entry.js +1415 -1405
- package/dist/cjs/ion-nav_2.cjs.entry.js +904 -904
- package/dist/cjs/ion-picker-column-internal.cjs.entry.js +331 -327
- package/dist/cjs/ion-picker-internal.cjs.entry.js +453 -453
- package/dist/cjs/ion-popover.cjs.entry.js +1108 -1098
- package/dist/cjs/ion-progress-bar.cjs.entry.js +40 -40
- package/dist/cjs/ion-radio_2.cjs.entry.js +321 -316
- package/dist/cjs/ion-range.cjs.entry.js +558 -556
- package/dist/cjs/ion-refresher_2.cjs.entry.js +786 -786
- package/dist/cjs/ion-reorder_2.cjs.entry.js +267 -267
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +66 -66
- package/dist/cjs/ion-route_4.cjs.entry.js +693 -693
- package/dist/cjs/ion-searchbar.cjs.entry.js +360 -358
- package/dist/cjs/ion-segment_2.cjs.entry.js +507 -507
- package/dist/cjs/ion-select_3.cjs.entry.js +784 -768
- package/dist/cjs/ion-spinner.cjs.entry.js +46 -46
- package/dist/cjs/ion-split-pane.cjs.entry.js +117 -117
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +138 -138
- package/dist/cjs/ion-tab_2.cjs.entry.js +187 -187
- package/dist/cjs/ion-text.cjs.entry.js +13 -13
- package/dist/cjs/ion-textarea.cjs.entry.js +378 -353
- package/dist/cjs/ion-toast.cjs.entry.js +771 -419
- package/dist/cjs/ion-toggle.cjs.entry.js +227 -225
- package/dist/cjs/ionic-global-f4a2093b.js +230 -0
- package/dist/cjs/ionic.cjs.js +5 -5
- package/dist/cjs/ios.transition-6787b799.js +654 -0
- package/dist/cjs/keyboard-0272231f.js +81 -0
- package/dist/cjs/{keyboard-38f2bb7b.js → keyboard-af1bb365.js} +62 -62
- package/dist/cjs/keyboard-controller-c05e747a.js +167 -0
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/lock-controller-6585a42a.js +40 -0
- package/dist/cjs/md.transition-e033d20a.js +59 -0
- package/dist/cjs/notch-controller-9735e7ac.js +155 -0
- package/dist/cjs/overlays-27a6fb16.js +716 -0
- package/dist/cjs/spinner-configs-282fd50a.js +147 -0
- package/dist/cjs/status-tap-415acac6.js +42 -0
- package/dist/cjs/swipe-back-e37a1a5c.js +81 -0
- package/dist/cjs/theme-d1c573d2.js +48 -0
- package/dist/cjs/watch-options-f5f3e158.js +49 -0
- package/dist/collection/collection-manifest.json +7 -7
- package/dist/collection/components/accordion/accordion.ios.css +44 -0
- package/dist/collection/components/accordion/accordion.js +410 -410
- package/dist/collection/components/accordion/accordion.md.css +22 -0
- package/dist/collection/components/accordion/test/a11y/accordion.e2e.js +31 -31
- package/dist/collection/components/accordion/test/accordion.e2e.js +24 -24
- package/dist/collection/components/accordion/test/accordion.spec.js +195 -0
- package/dist/collection/components/accordion/test/basic/accordion.e2e.js +26 -26
- package/dist/collection/components/accordion/test/multiple/accordion.e2e.js +18 -18
- package/dist/collection/components/accordion/test/nested/accordion.e2e.js +16 -16
- package/dist/collection/components/accordion/test/standalone/accordion.e2e.js +6 -6
- package/dist/collection/components/accordion-group/accordion-group.ios.css +44 -0
- package/dist/collection/components/accordion-group/accordion-group.js +421 -421
- package/dist/collection/components/accordion-group/accordion-group.md.css +66 -0
- package/dist/collection/components/action-sheet/action-sheet.ios.css +44 -0
- package/dist/collection/components/action-sheet/action-sheet.js +739 -729
- package/dist/collection/components/action-sheet/action-sheet.md.css +44 -0
- package/dist/collection/components/action-sheet/animations/ios.enter.js +18 -18
- package/dist/collection/components/action-sheet/animations/ios.leave.js +12 -12
- package/dist/collection/components/action-sheet/animations/md.enter.js +18 -18
- package/dist/collection/components/action-sheet/animations/md.leave.js +12 -12
- package/dist/collection/components/action-sheet/test/a11y/action-sheet.e2e.js +59 -59
- package/dist/collection/components/action-sheet/test/action-sheet-id.spec.js +32 -0
- package/dist/collection/components/action-sheet/test/basic/action-sheet-rendering.e2e.js +33 -33
- package/dist/collection/components/action-sheet/test/basic/action-sheet.e2e.js +74 -74
- package/dist/collection/components/action-sheet/test/basic/action-sheet.spec.js +18 -0
- package/dist/collection/components/action-sheet/test/basic/fixture.js +23 -23
- package/dist/collection/components/action-sheet/test/is-open/action-sheet.e2e.js +25 -25
- package/dist/collection/components/action-sheet/test/translucent/action-sheet.e2e.js +10 -10
- package/dist/collection/components/action-sheet/test/trigger/action-sheet.e2e.js +21 -21
- package/dist/collection/components/alert/alert.ios.css +85 -1
- package/dist/collection/components/alert/alert.js +977 -967
- package/dist/collection/components/alert/alert.md.css +115 -3
- package/dist/collection/components/alert/animations/ios.enter.js +19 -19
- package/dist/collection/components/alert/animations/ios.leave.js +13 -13
- package/dist/collection/components/alert/animations/md.enter.js +19 -19
- package/dist/collection/components/alert/animations/md.leave.js +10 -10
- package/dist/collection/components/alert/test/a11y/alert.e2e.js +116 -116
- package/dist/collection/components/alert/test/alert-id.spec.js +32 -0
- package/dist/collection/components/alert/test/alert.spec.js +37 -0
- package/dist/collection/components/alert/test/basic/alert-tablet.e2e.js +40 -0
- package/dist/collection/components/alert/test/basic/alert.e2e.js +96 -96
- package/dist/collection/components/alert/test/is-open/alert.e2e.js +25 -25
- package/dist/collection/components/alert/test/standalone/alert.e2e.js +9 -9
- package/dist/collection/components/alert/test/trigger/alert.e2e.js +21 -21
- package/dist/collection/components/app/app.js +116 -116
- package/dist/collection/components/app/test/safe-area/app.e2e.js +24 -24
- package/dist/collection/components/avatar/avatar.ios.css +44 -0
- package/dist/collection/components/avatar/avatar.js +17 -17
- package/dist/collection/components/avatar/avatar.md.css +44 -0
- package/dist/collection/components/avatar/test/basic/avatar.e2e.js +12 -12
- package/dist/collection/components/back-button/back-button.ios.css +44 -0
- package/dist/collection/components/back-button/back-button.js +214 -214
- package/dist/collection/components/back-button/back-button.md.css +44 -0
- package/dist/collection/components/back-button/test/a11y/back-button.e2e.js +6 -6
- package/dist/collection/components/back-button/test/back-button.spec.js +86 -0
- package/dist/collection/components/back-button/test/basic/back-button.e2e.js +6 -6
- package/dist/collection/components/back-button/test/toolbar/back-button.e2e.js +6 -6
- package/dist/collection/components/backdrop/backdrop.ios.css +44 -0
- package/dist/collection/components/backdrop/backdrop.js +131 -131
- package/dist/collection/components/backdrop/backdrop.md.css +44 -0
- package/dist/collection/components/badge/badge.ios.css +44 -0
- package/dist/collection/components/badge/badge.js +49 -49
- package/dist/collection/components/badge/badge.md.css +44 -0
- package/dist/collection/components/badge/test/a11y/badge.e2e.js +6 -6
- package/dist/collection/components/badge/test/basic/badge.e2e.js +6 -6
- package/dist/collection/components/breadcrumb/breadcrumb.ios.css +44 -0
- package/dist/collection/components/breadcrumb/breadcrumb.js +395 -395
- package/dist/collection/components/breadcrumb/breadcrumb.md.css +44 -0
- package/dist/collection/components/breadcrumb/test/aria.spec.js +22 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +22 -0
- package/dist/collection/components/breadcrumbs/breadcrumbs.js +247 -247
- package/dist/collection/components/breadcrumbs/breadcrumbs.md.css +22 -0
- package/dist/collection/components/breadcrumbs/test/a11y/breadcrumbs.e2e.js +12 -12
- package/dist/collection/components/breadcrumbs/test/basic/breadcrumbs.e2e.js +6 -6
- package/dist/collection/components/breadcrumbs/test/breadcrumbs.spec.js +58 -0
- package/dist/collection/components/breadcrumbs/test/collapsed/breadcrumbs.e2e.js +6 -6
- package/dist/collection/components/breadcrumbs/test/reactive/breadcrumbs.e2e.js +43 -43
- package/dist/collection/components/button/button.ios.css +66 -0
- package/dist/collection/components/button/button.js +541 -541
- package/dist/collection/components/button/button.md.css +44 -0
- package/dist/collection/components/button/test/a11y/button.e2e.js +21 -21
- package/dist/collection/components/button/test/basic/button.e2e.js +32 -32
- package/dist/collection/components/button/test/clear/button.e2e.js +6 -6
- package/dist/collection/components/button/test/expand/button.e2e.js +6 -6
- package/dist/collection/components/button/test/form-reference/button.e2e.js +84 -84
- package/dist/collection/components/button/test/form-reference/button.spec.js +26 -0
- package/dist/collection/components/button/test/icon/button.e2e.js +6 -6
- package/dist/collection/components/button/test/outline/button.e2e.js +6 -6
- package/dist/collection/components/button/test/round/button.e2e.js +6 -6
- package/dist/collection/components/button/test/size/button.e2e.js +22 -22
- package/dist/collection/components/button/test/strong/button.e2e.js +22 -22
- package/dist/collection/components/button/test/wrap/button.e2e.js +73 -73
- package/dist/collection/components/buttons/buttons.ios.css +66 -0
- package/dist/collection/components/buttons/buttons.js +46 -46
- package/dist/collection/components/buttons/buttons.md.css +66 -0
- package/dist/collection/components/buttons/test/a11y/buttons.e2e.js +21 -21
- package/dist/collection/components/card/card.ios.css +44 -0
- package/dist/collection/components/card/card.js +251 -251
- package/dist/collection/components/card/card.md.css +44 -0
- package/dist/collection/components/card/test/a11y/card.e2e.js +6 -6
- package/dist/collection/components/card/test/aria.spec.js +16 -0
- package/dist/collection/components/card/test/basic/card.e2e.js +38 -38
- package/dist/collection/components/card-content/card-content.ios.css +44 -0
- package/dist/collection/components/card-content/card-content.js +21 -21
- package/dist/collection/components/card-content/card-content.md.css +44 -0
- package/dist/collection/components/card-header/card-header.ios.css +44 -0
- package/dist/collection/components/card-header/card-header.js +70 -70
- package/dist/collection/components/card-header/card-header.md.css +44 -0
- package/dist/collection/components/card-header/test/basic/card-header.e2e.js +6 -6
- package/dist/collection/components/card-subtitle/card-subtitle.ios.css +44 -0
- package/dist/collection/components/card-subtitle/card-subtitle.js +50 -50
- package/dist/collection/components/card-subtitle/card-subtitle.md.css +44 -0
- package/dist/collection/components/card-title/card-title.ios.css +44 -0
- package/dist/collection/components/card-title/card-title.js +50 -50
- package/dist/collection/components/card-title/card-title.md.css +44 -0
- package/dist/collection/components/checkbox/checkbox.ios.css +66 -6
- package/dist/collection/components/checkbox/checkbox.js +418 -415
- package/dist/collection/components/checkbox/checkbox.md.css +66 -6
- package/dist/collection/components/checkbox/test/a11y/checkbox.e2e.js +14 -14
- package/dist/collection/components/checkbox/test/basic/checkbox.e2e.js +50 -50
- package/dist/collection/components/checkbox/test/checkbox.spec.js +34 -0
- package/dist/collection/components/checkbox/test/color/checkbox.e2e.js +11 -11
- package/dist/collection/components/checkbox/test/indeterminate/checkbox.e2e.js +6 -6
- package/dist/collection/components/checkbox/test/item/checkbox.e2e.js +29 -29
- package/dist/collection/components/checkbox/test/label/checkbox.e2e.js +75 -75
- package/dist/collection/components/checkbox/test/legacy/basic/checkbox.e2e.js +45 -45
- package/dist/collection/components/checkbox/test/legacy/indeterminate/checkbox.e2e.js +6 -6
- package/dist/collection/components/checkbox/test/states/checkbox.e2e.js +21 -21
- package/dist/collection/components/chip/chip.ios.css +22 -0
- package/dist/collection/components/chip/chip.js +90 -90
- package/dist/collection/components/chip/chip.md.css +22 -0
- package/dist/collection/components/chip/test/a11y/chip.e2e.js +19 -19
- package/dist/collection/components/chip/test/basic/chip.e2e.js +42 -42
- package/dist/collection/components/chip/test/states/chip.e2e.js +14 -14
- package/dist/collection/components/col/col.css +66 -0
- package/dist/collection/components/col/col.js +536 -536
- package/dist/collection/components/content/content.css +22 -0
- package/dist/collection/components/content/content.js +745 -745
- package/dist/collection/components/content/test/basic/content.e2e.js +6 -6
- package/dist/collection/components/content/test/fixed/content.e2e.js +6 -6
- package/dist/collection/components/content/test/fullscreen/content.e2e.js +6 -6
- package/dist/collection/components/content/test/standalone/content.e2e.js +5 -5
- package/dist/collection/components/datetime/datetime.ios.css +45 -0
- package/dist/collection/components/datetime/datetime.js +2245 -2232
- package/dist/collection/components/datetime/datetime.md.css +45 -0
- package/dist/collection/components/datetime/test/a11y/datetime.e2e.js +58 -58
- package/dist/collection/components/datetime/test/a11y/datetime.spec.js +43 -0
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +241 -241
- package/dist/collection/components/datetime/test/color/datetime.e2e.js +9 -9
- package/dist/collection/components/datetime/test/comparison.spec.js +43 -0
- package/dist/collection/components/datetime/test/custom/datetime.e2e.js +37 -37
- package/dist/collection/components/datetime/test/data.spec.js +456 -0
- package/dist/collection/components/datetime/test/datetime.e2e.js +29 -29
- package/dist/collection/components/datetime/test/disable-dates/datetime.e2e.js +119 -119
- package/dist/collection/components/datetime/test/disabled/datetime.e2e.js +43 -43
- package/dist/collection/components/datetime/test/disabled/datetime.spec.js +33 -0
- package/dist/collection/components/datetime/test/display/datetime.e2e.js +86 -86
- package/dist/collection/components/datetime/test/first-day-of-week/datetime.e2e.js +6 -6
- package/dist/collection/components/datetime/test/format.spec.js +124 -0
- package/dist/collection/components/datetime/test/helpers.spec.js +72 -0
- package/dist/collection/components/datetime/test/highlighted-dates/datetime.e2e.js +76 -76
- package/dist/collection/components/datetime/test/hour-cycle/datetime.e2e.js +21 -21
- package/dist/collection/components/datetime/test/locale/datetime.e2e.js +98 -98
- package/dist/collection/components/datetime/test/manipulation.spec.js +433 -0
- package/dist/collection/components/datetime/test/minmax/datetime.e2e.js +178 -178
- package/dist/collection/components/datetime/test/month-year-picker/datetime.e2e.js +17 -17
- package/dist/collection/components/datetime/test/multiple/datetime.e2e.js +170 -170
- package/dist/collection/components/datetime/test/parse.spec.js +222 -0
- package/dist/collection/components/datetime/test/position/datetime.e2e.js +14 -14
- package/dist/collection/components/datetime/test/prefer-wheel/datetime.e2e.js +263 -263
- package/dist/collection/components/datetime/test/presentation/datetime.e2e.js +137 -137
- package/dist/collection/components/datetime/test/readonly/datetime.e2e.js +86 -86
- package/dist/collection/components/datetime/test/set-value/datetime.e2e.js +40 -40
- package/dist/collection/components/datetime/test/state.spec.js +114 -0
- package/dist/collection/components/datetime/test/time-label/datetime.e2e.js +13 -13
- package/dist/collection/components/datetime/test/values/datetime.e2e.js +77 -77
- package/dist/collection/components/datetime/utils/comparison.js +22 -22
- package/dist/collection/components/datetime/utils/data.js +394 -394
- package/dist/collection/components/datetime/utils/format.js +143 -143
- package/dist/collection/components/datetime/utils/helpers.js +74 -74
- package/dist/collection/components/datetime/utils/manipulation.js +274 -274
- package/dist/collection/components/datetime/utils/parse.js +139 -139
- package/dist/collection/components/datetime/utils/state.js +123 -123
- package/dist/collection/components/datetime-button/datetime-button.css +22 -0
- package/dist/collection/components/datetime-button/datetime-button.js +399 -399
- package/dist/collection/components/datetime-button/test/a11y/datetime-button.e2e.js +11 -11
- package/dist/collection/components/datetime-button/test/basic/datetime-button.e2e.js +123 -123
- package/dist/collection/components/datetime-button/test/disabled/datetime-button.e2e.js +13 -13
- package/dist/collection/components/datetime-button/test/multiple/datetime-button.e2e.js +38 -38
- package/dist/collection/components/datetime-button/test/overlays/datetime-button.e2e.js +102 -102
- package/dist/collection/components/fab/fab.css +88 -0
- package/dist/collection/components/fab/fab.js +179 -179
- package/dist/collection/components/fab/test/basic/fab.e2e.js +50 -50
- package/dist/collection/components/fab/test/custom-size/fab.e2e.js +6 -6
- package/dist/collection/components/fab/test/safe-area/fab.e2e.js +25 -25
- package/dist/collection/components/fab/test/states/fab.e2e.js +6 -6
- package/dist/collection/components/fab/test/translucent/fab.e2e.js +17 -17
- package/dist/collection/components/fab-button/fab-button.ios.css +44 -0
- package/dist/collection/components/fab-button/fab-button.js +374 -374
- package/dist/collection/components/fab-button/fab-button.md.css +44 -0
- package/dist/collection/components/fab-button/test/a11y/fab-button.e2e.js +6 -6
- package/dist/collection/components/fab-list/fab-list.css +44 -0
- package/dist/collection/components/fab-list/fab-list.js +79 -79
- package/dist/collection/components/footer/footer.ios.css +44 -0
- package/dist/collection/components/footer/footer.js +135 -135
- package/dist/collection/components/footer/footer.md.css +44 -0
- package/dist/collection/components/footer/footer.utils.js +25 -25
- package/dist/collection/components/footer/test/basic/footer.e2e.js +18 -18
- package/dist/collection/components/footer/test/fade/footer.e2e.js +10 -10
- package/dist/collection/components/footer/test/scroll-target/footer.e2e.js +15 -15
- package/dist/collection/components/footer/test/with-tabs/footer.e2e.js +6 -6
- package/dist/collection/components/grid/grid.css +66 -0
- package/dist/collection/components/grid/grid.js +44 -44
- package/dist/collection/components/grid/test/basic/grid.e2e.js +6 -6
- package/dist/collection/components/grid/test/offsets/grid.e2e.js +6 -6
- package/dist/collection/components/grid/test/padding/grid.e2e.js +6 -6
- package/dist/collection/components/grid/test/sizes/grid.e2e.js +6 -6
- package/dist/collection/components/header/header.ios.css +44 -0
- package/dist/collection/components/header/header.js +181 -181
- package/dist/collection/components/header/header.md.css +44 -0
- package/dist/collection/components/header/header.utils.js +148 -148
- package/dist/collection/components/header/test/a11y/header.e2e.js +18 -18
- package/dist/collection/components/header/test/basic/header.e2e.js +23 -23
- package/dist/collection/components/header/test/condense/header.e2e.js +25 -25
- package/dist/collection/components/header/test/fade/header.e2e.js +10 -10
- package/dist/collection/components/header/test/scroll-target/header.e2e.js +15 -15
- package/dist/collection/components/icon/test/basic/icon.e2e.js +6 -6
- package/dist/collection/components/icon/test/dir/icon.e2e.js +11 -11
- package/dist/collection/components/img/img.js +177 -177
- package/dist/collection/components/img/test/basic/img.e2e.js +62 -62
- package/dist/collection/components/img/test/draggable/img.e2e.js +10 -10
- package/dist/collection/components/infinite-scroll/infinite-scroll.js +279 -271
- package/dist/collection/components/infinite-scroll/test/basic/infinite-scroll.e2e.js +11 -11
- package/dist/collection/components/infinite-scroll/test/scroll-target/infinite-scroll.e2e.js +11 -11
- package/dist/collection/components/infinite-scroll/test/small-dom-update/infinite-scroll.e2e.js +31 -0
- package/dist/collection/components/infinite-scroll/test/top/infinite-scroll.e2e.js +11 -11
- package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +44 -0
- package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +86 -86
- package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +44 -0
- package/dist/collection/components/infinite-scroll-content/test/infinite-scroll-content.spec.js +37 -0
- package/dist/collection/components/input/input.ios.css +76 -3
- package/dist/collection/components/input/input.js +1231 -1204
- package/dist/collection/components/input/input.md.css +145 -12
- package/dist/collection/components/input/input.utils.js +22 -22
- package/dist/collection/components/input/test/a11y/input.e2e.js +12 -12
- package/dist/collection/components/input/test/basic/input.e2e.js +63 -63
- package/dist/collection/components/input/test/bottom-content/input.e2e.js +89 -89
- package/dist/collection/components/input/test/card/input.e2e.js +6 -6
- package/dist/collection/components/input/test/clear-on-edit/input.e2e.js +25 -25
- package/dist/collection/components/input/test/color/input.e2e.js +88 -88
- package/dist/collection/components/input/test/fill/input.e2e.js +63 -63
- package/dist/collection/components/input/test/highlight/input.e2e.js +52 -52
- package/dist/collection/components/input/test/input.e2e.js +6 -6
- package/dist/collection/components/input/test/input.spec.js +85 -0
- package/dist/collection/components/input/test/item/input.e2e.js +11 -11
- package/dist/collection/components/input/test/item/input.spec.js +24 -0
- package/dist/collection/components/input/test/label-placement/input.e2e.js +104 -104
- package/dist/collection/components/input/test/legacy/a11y/input.e2e.js +15 -15
- package/dist/collection/components/input/test/legacy/basic/input.e2e.js +102 -102
- package/dist/collection/components/input/test/legacy/clear-on-edit/input.e2e.js +44 -44
- package/dist/collection/components/input/test/legacy/input-events.e2e.js +56 -56
- package/dist/collection/components/input/test/legacy/masking/input.e2e.js +15 -15
- package/dist/collection/components/input/test/legacy/spec/input.e2e.js +8 -8
- package/dist/collection/components/input/test/slot/input.e2e.js +51 -0
- package/dist/collection/components/input/test/states/input.e2e.js +11 -11
- package/dist/collection/components/item/item.ios.css +85 -3
- package/dist/collection/components/item/item.js +614 -614
- package/dist/collection/components/item/item.md.css +129 -3
- package/dist/collection/components/item/test/a11y/item.e2e.js +47 -47
- package/dist/collection/components/item/test/a11y/item.spec.js +48 -0
- package/dist/collection/components/item/test/alignment/item.e2e.js +6 -6
- package/dist/collection/components/item/test/basic/item.e2e.js +16 -16
- package/dist/collection/components/item/test/buttons/item.e2e.js +18 -18
- package/dist/collection/components/item/test/colors/item.e2e.js +6 -6
- package/dist/collection/components/item/test/counter/item.e2e.js +34 -34
- package/dist/collection/components/item/test/css-variables/item.e2e.js +6 -6
- package/dist/collection/components/item/test/disabled/item.e2e.js +6 -7
- package/dist/collection/components/item/test/dividers/item.e2e.js +6 -6
- package/dist/collection/components/item/test/groups/item.e2e.js +8 -8
- package/dist/collection/components/item/test/highlight/item.e2e.js +6 -6
- package/dist/collection/components/item/test/icons/item.e2e.js +6 -6
- package/dist/collection/components/item/test/images/item.e2e.js +6 -6
- package/dist/collection/components/item/test/inputs/item.e2e.js +139 -139
- package/dist/collection/components/item/test/legacy/alignment/item.e2e.js +6 -6
- package/dist/collection/components/item/test/legacy/disabled/item.e2e.js +6 -6
- package/dist/collection/components/item/test/legacy/fill/item.e2e.js +6 -6
- package/dist/collection/components/item/test/legacy/form/item.e2e.js +6 -6
- package/dist/collection/components/item/test/lines/item.e2e.js +6 -6
- package/dist/collection/components/item/test/media/item.e2e.js +6 -6
- package/dist/collection/components/item/test/reorder/item.e2e.js +8 -8
- package/dist/collection/components/item/test/slotted-inputs/item.e2e.js +6 -6
- package/dist/collection/components/item/test/states/item.e2e.js +6 -6
- package/dist/collection/components/item-divider/item-divider.ios.css +66 -0
- package/dist/collection/components/item-divider/item-divider.js +71 -71
- package/dist/collection/components/item-divider/item-divider.md.css +66 -0
- package/dist/collection/components/item-divider/test/a11y/item-divider.e2e.js +11 -11
- package/dist/collection/components/item-divider/test/basic/item-divider.e2e.js +25 -25
- package/dist/collection/components/item-divider/test/spec/item-divider.e2e.js +8 -8
- package/dist/collection/components/item-group/item-group.ios.css +44 -0
- package/dist/collection/components/item-group/item-group.js +22 -22
- package/dist/collection/components/item-group/item-group.md.css +44 -0
- package/dist/collection/components/item-option/item-option.ios.css +44 -0
- package/dist/collection/components/item-option/item-option.js +197 -197
- package/dist/collection/components/item-option/item-option.md.css +44 -0
- package/dist/collection/components/item-options/item-options.ios.css +66 -0
- package/dist/collection/components/item-options/item-options.js +110 -110
- package/dist/collection/components/item-options/item-options.md.css +66 -0
- package/dist/collection/components/item-sliding/item-sliding.css +22 -0
- package/dist/collection/components/item-sliding/item-sliding.js +538 -538
- package/dist/collection/components/item-sliding/test/a11y/item-sliding.e2e.js +5 -5
- package/dist/collection/components/item-sliding/test/async/item-sliding.e2e.js +25 -25
- package/dist/collection/components/item-sliding/test/basic/item-sliding.e2e.js +87 -87
- package/dist/collection/components/item-sliding/test/icons/item-sliding.e2e.js +20 -20
- package/dist/collection/components/item-sliding/test/scroll-target/item-sliding.e2e.js +18 -18
- package/dist/collection/components/item-sliding/test/test.utils.js +20 -20
- package/dist/collection/components/label/label.ios.css +80 -3
- package/dist/collection/components/label/label.js +174 -174
- package/dist/collection/components/label/label.md.css +80 -3
- package/dist/collection/components/label/test/a11y/label.e2e.js +21 -21
- package/dist/collection/components/label/test/basic/label.e2e.js +21 -21
- package/dist/collection/components/label/test/color/label.e2e.js +21 -21
- package/dist/collection/components/label/test/headings/label.e2e.js +5 -5
- package/dist/collection/components/list/list.ios.css +66 -0
- package/dist/collection/components/list/list.js +101 -101
- package/dist/collection/components/list/list.md.css +66 -0
- package/dist/collection/components/list/test/a11y/list.e2e.js +6 -6
- package/dist/collection/components/list/test/basic/list.e2e.js +6 -6
- package/dist/collection/components/list/test/inset/list.e2e.js +16 -16
- package/dist/collection/components/list/test/lines/list.e2e.js +40 -40
- package/dist/collection/components/list-header/list-header.ios.css +66 -0
- package/dist/collection/components/list-header/list-header.js +69 -69
- package/dist/collection/components/list-header/list-header.md.css +66 -0
- package/dist/collection/components/list-header/test/a11y/list-header.e2e.js +6 -6
- package/dist/collection/components/list-header/test/basic/list-header.e2e.js +14 -14
- package/dist/collection/components/loading/animations/ios.enter.js +19 -19
- package/dist/collection/components/loading/animations/ios.leave.js +13 -13
- package/dist/collection/components/loading/animations/md.enter.js +19 -19
- package/dist/collection/components/loading/animations/md.leave.js +13 -13
- package/dist/collection/components/loading/loading.ios.css +44 -0
- package/dist/collection/components/loading/loading.js +730 -720
- package/dist/collection/components/loading/loading.md.css +44 -0
- package/dist/collection/components/loading/test/a11y/loading.e2e.js +26 -26
- package/dist/collection/components/loading/test/basic/loading.e2e.js +60 -60
- package/dist/collection/components/loading/test/basic/loading.spec.js +16 -0
- package/dist/collection/components/loading/test/is-open/loading.e2e.js +17 -17
- package/dist/collection/components/loading/test/loading-id.spec.js +32 -0
- package/dist/collection/components/loading/test/loading.spec.js +37 -0
- package/dist/collection/components/loading/test/standalone/loading.e2e.js +13 -13
- package/dist/collection/components/loading/test/trigger/loading.e2e.js +21 -21
- package/dist/collection/components/menu/menu.ios.css +44 -0
- package/dist/collection/components/menu/menu.js +956 -956
- package/dist/collection/components/menu/menu.md.css +44 -0
- package/dist/collection/components/menu/test/a11y/menu.e2e.js +13 -13
- package/dist/collection/components/menu/test/basic/menu.e2e.js +102 -102
- package/dist/collection/components/menu/test/disable/menu.e2e.js +44 -44
- package/dist/collection/components/menu/test/focus-trap/menu.e2e.js +61 -61
- package/dist/collection/components/menu/test/multiple/menu.e2e.js +49 -49
- package/dist/collection/components/menu/test/safe-area/menu.e2e.js +54 -54
- package/dist/collection/components/menu-button/menu-button.ios.css +44 -0
- package/dist/collection/components/menu-button/menu-button.js +173 -173
- package/dist/collection/components/menu-button/menu-button.md.css +44 -0
- package/dist/collection/components/menu-button/test/a11y/menu-button.e2e.js +12 -12
- package/dist/collection/components/menu-button/test/async/menu-button.e2e.js +12 -12
- package/dist/collection/components/menu-button/test/basic/menu-button.e2e.js +6 -6
- package/dist/collection/components/menu-toggle/menu-toggle-util.js +2 -2
- package/dist/collection/components/menu-toggle/menu-toggle.js +93 -93
- package/dist/collection/components/menu-toggle/test/basic/menu-toggle.e2e.js +33 -33
- package/dist/collection/components/modal/animations/ios.enter.js +81 -81
- package/dist/collection/components/modal/animations/ios.leave.js +74 -74
- package/dist/collection/components/modal/animations/md.enter.js +21 -21
- package/dist/collection/components/modal/animations/md.leave.js +15 -15
- package/dist/collection/components/modal/animations/sheet.js +43 -43
- package/dist/collection/components/modal/gestures/sheet.js +289 -289
- package/dist/collection/components/modal/gestures/swipe-to-close.js +248 -247
- package/dist/collection/components/modal/gestures/utils.js +39 -39
- package/dist/collection/components/modal/modal.ios.css +44 -0
- package/dist/collection/components/modal/modal.js +1290 -1280
- package/dist/collection/components/modal/modal.md.css +44 -0
- package/dist/collection/components/modal/test/a11y/modal.e2e.js +12 -12
- package/dist/collection/components/modal/test/a11y/modal.spec.js +22 -0
- package/dist/collection/components/modal/test/basic/modal.e2e.js +110 -110
- package/dist/collection/components/modal/test/basic/modal.spec.js +16 -0
- package/dist/collection/components/modal/test/can-dismiss/modal-card.e2e.js +44 -44
- package/dist/collection/components/modal/test/can-dismiss/modal-sheet.e2e.js +62 -62
- package/dist/collection/components/modal/test/can-dismiss/modal.e2e.js +16 -16
- package/dist/collection/components/modal/test/can-dismiss/modal.spec.js +191 -0
- package/dist/collection/components/modal/test/card/modal-card.e2e.js +69 -69
- package/dist/collection/components/modal/test/card/modal-tablet.e2e.js +67 -67
- package/dist/collection/components/modal/test/card-nav/modal.e2e.js +26 -26
- package/dist/collection/components/modal/test/card-refresher/modal.e2e.js +14 -14
- package/dist/collection/components/modal/test/card-scroll-target/modal.e2e.js +34 -34
- package/dist/collection/components/modal/test/custom/modal.e2e.js +16 -16
- package/dist/collection/components/modal/test/custom-dialog/modal.e2e.js +12 -12
- package/dist/collection/components/modal/test/dark-mode/model.e2e.js +12 -12
- package/dist/collection/components/modal/test/fixtures.js +21 -21
- package/dist/collection/components/modal/test/inline/modal.e2e.js +34 -34
- package/dist/collection/components/modal/test/is-open/modal.e2e.js +17 -17
- package/dist/collection/components/modal/test/modal-id.spec.js +32 -0
- package/dist/collection/components/modal/test/sheet/modal.e2e.js +178 -178
- package/dist/collection/components/modal/test/standalone/modal.e2e.js +12 -12
- package/dist/collection/components/modal/test/trigger/modal.e2e.js +23 -23
- package/dist/collection/components/modal/utils.js +55 -55
- package/dist/collection/components/modal/utils.spec.js +7 -7
- package/dist/collection/components/nav/nav.css +22 -0
- package/dist/collection/components/nav/nav.js +1748 -1748
- package/dist/collection/components/nav/test/basic/nav.e2e.js +58 -58
- package/dist/collection/components/nav/test/modal-navigation/nav.e2e.js +52 -52
- package/dist/collection/components/nav/test/nav-controller.spec.js +749 -0
- package/dist/collection/components/nav/test/nested/nav.e2e.js +54 -54
- package/dist/collection/components/nav/test/routing/nav.e2e.js +75 -75
- package/dist/collection/components/nav/view-controller.js +52 -52
- package/dist/collection/components/nav-link/nav-link-utils.js +16 -16
- package/dist/collection/components/nav-link/nav-link.js +106 -106
- package/dist/collection/components/note/note.ios.css +44 -0
- package/dist/collection/components/note/note.js +49 -49
- package/dist/collection/components/note/note.md.css +44 -0
- package/dist/collection/components/note/test/a11y/note.e2e.js +59 -16
- package/dist/collection/components/note/test/basic/note.e2e.js +33 -33
- package/dist/collection/components/picker/animations/ios.enter.js +18 -18
- package/dist/collection/components/picker/animations/ios.leave.js +14 -14
- package/dist/collection/components/picker/picker.ios.css +44 -0
- package/dist/collection/components/picker/picker.js +782 -772
- package/dist/collection/components/picker/picker.md.css +44 -0
- package/dist/collection/components/picker/test/basic/picker.e2e.js +17 -17
- package/dist/collection/components/picker/test/is-open/picker.e2e.js +17 -17
- package/dist/collection/components/picker/test/picker-id.spec.js +32 -0
- package/dist/collection/components/picker/test/trigger/picker.e2e.js +21 -21
- package/dist/collection/components/picker-column/picker-column.ios.css +44 -0
- package/dist/collection/components/picker-column/picker-column.js +377 -377
- package/dist/collection/components/picker-column/picker-column.md.css +44 -0
- package/dist/collection/components/picker-column/test/picker-column-aria.spec.js +35 -0
- package/dist/collection/components/picker-column/test/picker-column-dynamic.spec.js +29 -0
- package/dist/collection/components/picker-column/test/picker-column.spec.js +17 -0
- package/dist/collection/components/picker-column/test/standalone/picker-column.e2e.js +27 -27
- package/dist/collection/components/picker-column/test/test.utils.js +29 -29
- package/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +33 -3
- package/dist/collection/components/picker-column-internal/picker-column-internal.js +523 -501
- package/dist/collection/components/picker-column-internal/picker-column-internal.md.css +55 -3
- package/dist/collection/components/picker-column-internal/test/basic/picker-column-internal.e2e.js +53 -53
- package/dist/collection/components/picker-column-internal/test/disabled/picker-column-internal.e2e.js +66 -37
- package/dist/collection/components/picker-internal/picker-internal.ios.css +44 -0
- package/dist/collection/components/picker-internal/picker-internal.js +517 -517
- package/dist/collection/components/picker-internal/picker-internal.md.css +44 -0
- package/dist/collection/components/picker-internal/test/a11y/picker-internal.e2e.js +6 -6
- package/dist/collection/components/picker-internal/test/basic/picker-internal.e2e.js +76 -76
- package/dist/collection/components/picker-internal/test/keyboard-entry/picker-internal.e2e.js +39 -39
- package/dist/collection/components/popover/animations/ios.enter.js +79 -79
- package/dist/collection/components/popover/animations/ios.leave.js +28 -28
- package/dist/collection/components/popover/animations/md.enter.js +58 -58
- package/dist/collection/components/popover/animations/md.leave.js +19 -19
- package/dist/collection/components/popover/popover.ios.css +44 -0
- package/dist/collection/components/popover/popover.js +1189 -1179
- package/dist/collection/components/popover/popover.md.css +44 -0
- package/dist/collection/components/popover/test/adjustment/popover.e2e.js +22 -22
- package/dist/collection/components/popover/test/arrow/popover.e2e.js +15 -15
- package/dist/collection/components/popover/test/async/popover.e2e.js +29 -29
- package/dist/collection/components/popover/test/basic/popover.e2e.js +108 -108
- package/dist/collection/components/popover/test/basic/popover.spec.js +16 -0
- package/dist/collection/components/popover/test/dismiss-on-select/popover.e2e.js +26 -26
- package/dist/collection/components/popover/test/fixture.js +16 -16
- package/dist/collection/components/popover/test/inline/popover.e2e.js +18 -18
- package/dist/collection/components/popover/test/is-open/popover.e2e.js +5 -5
- package/dist/collection/components/popover/test/nested/popover.e2e.js +81 -81
- package/dist/collection/components/popover/test/popover-id.spec.js +32 -0
- package/dist/collection/components/popover/test/position/popover.e2e.js +18 -18
- package/dist/collection/components/popover/test/reference/popover.e2e.js +14 -14
- package/dist/collection/components/popover/test/size/popover.e2e.js +29 -29
- package/dist/collection/components/popover/test/standalone/popover.e2e.js +7 -7
- package/dist/collection/components/popover/test/test.utils.js +23 -23
- package/dist/collection/components/popover/test/trigger/popover.e2e.js +35 -35
- package/dist/collection/components/popover/test/util.spec.js +53 -0
- package/dist/collection/components/popover/utils.js +606 -606
- package/dist/collection/components/progress-bar/progress-bar.ios.css +22 -0
- package/dist/collection/components/progress-bar/progress-bar.js +145 -145
- package/dist/collection/components/progress-bar/progress-bar.md.css +22 -0
- package/dist/collection/components/progress-bar/test/basic/progress-bar.e2e.js +6 -6
- package/dist/collection/components/progress-bar/test/buffer/progress-bar.e2e.js +10 -10
- package/dist/collection/components/progress-bar/test/determinate/progress-bar.e2e.js +10 -10
- package/dist/collection/components/radio/radio.ios.css +66 -6
- package/dist/collection/components/radio/radio.js +453 -449
- package/dist/collection/components/radio/radio.md.css +66 -6
- package/dist/collection/components/radio/test/a11y/radio.e2e.js +40 -40
- package/dist/collection/components/radio/test/color/radio.e2e.js +11 -11
- package/dist/collection/components/radio/test/item/radio.e2e.js +37 -37
- package/dist/collection/components/radio/test/label-placement/radio.e2e.js +70 -70
- package/dist/collection/components/radio/test/legacy/a11y/radio.e2e.js +29 -29
- package/dist/collection/components/radio/test/legacy/basic/radio.e2e.js +43 -43
- package/dist/collection/components/radio/test/radio.spec.js +60 -0
- package/dist/collection/components/radio/test/states/radio.e2e.js +21 -21
- package/dist/collection/components/radio-group/radio-group.js +279 -255
- package/dist/collection/components/radio-group/test/basic/radio-group.e2e.js +35 -35
- package/dist/collection/components/radio-group/test/fixtures.js +22 -22
- package/dist/collection/components/radio-group/test/form/radio-group.e2e.js +39 -39
- package/dist/collection/components/radio-group/test/legacy/basic/radio-group.e2e.js +59 -59
- package/dist/collection/components/radio-group/test/legacy/form/radio-group.e2e.js +22 -22
- package/dist/collection/components/radio-group/test/legacy/search/radio-group.e2e.js +27 -27
- package/dist/collection/components/radio-group/test/radio-group-events.e2e.js +42 -42
- package/dist/collection/components/radio-group/test/radio-group.spec.js +69 -0
- package/dist/collection/components/radio-group/test/search/radio-group.e2e.js +23 -23
- package/dist/collection/components/range/range.ios.css +44 -6
- package/dist/collection/components/range/range.js +1001 -998
- package/dist/collection/components/range/range.md.css +44 -6
- package/dist/collection/components/range/test/a11y/range.e2e.js +46 -46
- package/dist/collection/components/range/test/active-bar-start/range.e2e.js +6 -6
- package/dist/collection/components/range/test/basic/range.e2e.js +23 -23
- package/dist/collection/components/range/test/color/range.e2e.js +6 -6
- package/dist/collection/components/range/test/custom/range.e2e.js +6 -6
- package/dist/collection/components/range/test/item/range.e2e.js +28 -28
- package/dist/collection/components/range/test/label/range.e2e.js +99 -99
- package/dist/collection/components/range/test/label/range.spec.js +23 -0
- package/dist/collection/components/range/test/legacy/a11y/range.e2e.js +25 -25
- package/dist/collection/components/range/test/legacy/active-bar-start/range.e2e.js +6 -6
- package/dist/collection/components/range/test/legacy/basic/range.e2e.js +61 -61
- package/dist/collection/components/range/test/legacy/range-events.e2e.js +80 -80
- package/dist/collection/components/range/test/legacy/scroll-target/range.e2e.js +23 -23
- package/dist/collection/components/range/test/range-events.e2e.js +135 -135
- package/dist/collection/components/range/test/range.spec.js +221 -0
- package/dist/collection/components/range/test/scroll-target/range.e2e.js +23 -23
- package/dist/collection/components/range/test/states/range.e2e.js +21 -21
- package/dist/collection/components/refresher/refresher.ios.css +44 -0
- package/dist/collection/components/refresher/refresher.js +806 -806
- package/dist/collection/components/refresher/refresher.md.css +44 -0
- package/dist/collection/components/refresher/refresher.utils.js +148 -148
- package/dist/collection/components/refresher/test/basic/refresher.e2e.js +25 -25
- package/dist/collection/components/refresher/test/scroll-target/refresher.e2e.js +25 -25
- package/dist/collection/components/refresher/test/test.utils.js +5 -5
- package/dist/collection/components/refresher-content/refresher-content.js +131 -131
- package/dist/collection/components/refresher-content/test/refresher-content.spec.js +46 -0
- package/dist/collection/components/reorder/reorder.ios.css +22 -0
- package/dist/collection/components/reorder/reorder.js +37 -37
- package/dist/collection/components/reorder/reorder.md.css +22 -0
- package/dist/collection/components/reorder-group/reorder-group.css +22 -0
- package/dist/collection/components/reorder-group/reorder-group.js +327 -327
- package/dist/collection/components/reorder-group/test/a11y/reorder-group.e2e.js +6 -6
- package/dist/collection/components/reorder-group/test/basic/reorder-group.e2e.js +11 -11
- package/dist/collection/components/reorder-group/test/interactive/reorder-group.e2e.js +21 -21
- package/dist/collection/components/reorder-group/test/nested/reorder-group.e2e.js +21 -21
- package/dist/collection/components/reorder-group/test/scroll-target/reorder-group.e2e.js +21 -21
- package/dist/collection/components/ripple-effect/ripple-effect.css +22 -0
- package/dist/collection/components/ripple-effect/ripple-effect.js +135 -135
- package/dist/collection/components/ripple-effect/test/basic/ripple-effect.e2e.js +48 -48
- package/dist/collection/components/route/route.js +151 -151
- package/dist/collection/components/route-redirect/route-redirect.js +76 -76
- package/dist/collection/components/router/router.js +472 -472
- package/dist/collection/components/router/test/basic/router.e2e.js +55 -55
- package/dist/collection/components/router/test/guards/href/router.e2e.js +51 -51
- package/dist/collection/components/router/test/guards/link/router.e2e.js +51 -51
- package/dist/collection/components/router/test/guards/push/router.e2e.js +51 -51
- package/dist/collection/components/router/test/guards/router.e2e.js +5 -5
- package/dist/collection/components/router/test/guards/test.utils.js +2 -2
- package/dist/collection/components/router/test/matching.spec.js +250 -0
- package/dist/collection/components/router/test/parser.spec.js +133 -0
- package/dist/collection/components/router/test/path.spec.js +218 -0
- package/dist/collection/components/router/test/router.spec.js +55 -0
- package/dist/collection/components/router/utils/debug.js +14 -14
- package/dist/collection/components/router/utils/dom.js +56 -56
- package/dist/collection/components/router/utils/matching.js +150 -150
- package/dist/collection/components/router/utils/parser.js +52 -52
- package/dist/collection/components/router/utils/path.js +66 -66
- package/dist/collection/components/router-link/router-link.css +22 -0
- package/dist/collection/components/router-link/router-link.js +157 -157
- package/dist/collection/components/router-outlet/router-outlet.css +22 -0
- package/dist/collection/components/router-outlet/router-outlet.js +459 -459
- package/dist/collection/components/router-outlet/test/basic/router-outlet.e2e.js +31 -31
- package/dist/collection/components/row/row.css +66 -0
- package/dist/collection/components/row/row.js +15 -15
- package/dist/collection/components/searchbar/searchbar.ios.css +44 -0
- package/dist/collection/components/searchbar/searchbar.js +891 -889
- package/dist/collection/components/searchbar/searchbar.md.css +44 -0
- package/dist/collection/components/searchbar/test/a11y/searchbar.e2e.js +11 -11
- package/dist/collection/components/searchbar/test/basic/searchbar.e2e.js +101 -101
- package/dist/collection/components/searchbar/test/events/searchbar.e2e.js +55 -55
- package/dist/collection/components/searchbar/test/searchbar.spec.js +15 -0
- package/dist/collection/components/segment/segment.ios.css +66 -0
- package/dist/collection/components/segment/segment.js +631 -631
- package/dist/collection/components/segment/segment.md.css +66 -0
- package/dist/collection/components/segment/test/a11y/segment.e2e.js +37 -37
- package/dist/collection/components/segment/test/basic/segment.e2e.js +22 -22
- package/dist/collection/components/segment/test/custom/segment.e2e.js +6 -6
- package/dist/collection/components/segment/test/icon/segment.e2e.js +6 -6
- package/dist/collection/components/segment/test/modes/segment.e2e.js +15 -15
- package/dist/collection/components/segment/test/scrollable/segment.e2e.js +12 -12
- package/dist/collection/components/segment/test/segment-events.e2e.js +97 -97
- package/dist/collection/components/segment/test/segment.spec.js +37 -0
- package/dist/collection/components/segment/test/toolbar/segment.e2e.js +21 -21
- package/dist/collection/components/segment/test/wrap/segment.e2e.js +21 -21
- package/dist/collection/components/segment-button/segment-button.ios.css +44 -0
- package/dist/collection/components/segment-button/segment-button.js +217 -217
- package/dist/collection/components/segment-button/segment-button.md.css +44 -0
- package/dist/collection/components/select/select.ios.css +126 -7
- package/dist/collection/components/select/select.js +1201 -1184
- package/dist/collection/components/select/select.md.css +173 -19
- package/dist/collection/components/select/test/a11y/select.e2e.js +14 -14
- package/dist/collection/components/select/test/async/select.e2e.js +14 -14
- package/dist/collection/components/select/test/basic/select.e2e.js +140 -140
- package/dist/collection/components/select/test/card/select.e2e.js +6 -6
- package/dist/collection/components/select/test/color/select.e2e.js +22 -22
- package/dist/collection/components/select/test/compare-with/select.e2e.js +33 -33
- package/dist/collection/components/select/test/custom/select.e2e.js +19 -19
- package/dist/collection/components/select/test/disabled/select.e2e.js +17 -17
- package/dist/collection/components/select/test/fill/select.e2e.js +63 -63
- package/dist/collection/components/select/test/highlight/select.e2e.js +74 -74
- package/dist/collection/components/select/test/item/select.e2e.js +26 -11
- package/dist/collection/components/select/test/label/select.e2e.js +141 -141
- package/dist/collection/components/select/test/legacy/async/select.e2e.js +8 -8
- package/dist/collection/components/select/test/legacy/basic/select.e2e.js +108 -108
- package/dist/collection/components/select/test/legacy/compare-with/select.e2e.js +33 -33
- package/dist/collection/components/select/test/legacy/custom/custom.e2e.js +5 -5
- package/dist/collection/components/select/test/legacy/single-value/select.e2e.js +8 -8
- package/dist/collection/components/select/test/legacy/spec/select.e2e.js +6 -6
- package/dist/collection/components/select/test/legacy/standalone/select.e2e.js +11 -11
- package/dist/collection/components/select/test/legacy/wrapping/select.e2e.js +17 -17
- package/dist/collection/components/select/test/popover-size/select.e2e.js +63 -63
- package/dist/collection/components/select/test/select.spec.js +59 -0
- package/dist/collection/components/select/test/slot/select.e2e.js +67 -0
- package/dist/collection/components/select/test/states/select.e2e.js +21 -21
- package/dist/collection/components/select/test/toggle-icon/select.e2e.js +14 -14
- package/dist/collection/components/select/test/wrapping/select.e2e.js +16 -16
- package/dist/collection/components/select-option/select-option.js +60 -60
- package/dist/collection/components/select-popover/select-popover.ios.css +66 -0
- package/dist/collection/components/select-popover/select-popover.js +197 -197
- package/dist/collection/components/select-popover/select-popover.md.css +66 -0
- package/dist/collection/components/select-popover/test/basic/select-popover.e2e.js +52 -52
- package/dist/collection/components/select-popover/test/fixtures.js +33 -33
- package/dist/collection/components/skeleton-text/skeleton-text.css +22 -0
- package/dist/collection/components/skeleton-text/skeleton-text.js +87 -48
- package/dist/collection/components/skeleton-text/test/basic/skeleton-text.e2e.js +6 -6
- package/dist/collection/components/skeleton-text/test/custom/skeleton-text.e2e.js +6 -6
- package/dist/collection/components/slides/IonicSlides.js +95 -95
- package/dist/collection/components/spinner/spinner-configs.js +121 -121
- package/dist/collection/components/spinner/spinner.css +22 -0
- package/dist/collection/components/spinner/spinner.js +137 -137
- package/dist/collection/components/spinner/test/basic/spinner.e2e.js +10 -10
- package/dist/collection/components/spinner/test/color/spinner.e2e.js +10 -10
- package/dist/collection/components/spinner/test/resize/spinner.e2e.js +8 -8
- package/dist/collection/components/split-pane/split-pane.ios.css +66 -0
- package/dist/collection/components/split-pane/split-pane.js +225 -225
- package/dist/collection/components/split-pane/split-pane.md.css +66 -0
- package/dist/collection/components/split-pane/test/basic/split-pane.e2e.js +18 -18
- package/dist/collection/components/split-pane/test/multiple/split-pane.e2e.js +23 -23
- package/dist/collection/components/tab/tab.js +170 -170
- package/dist/collection/components/tab-bar/tab-bar.ios.css +66 -0
- package/dist/collection/components/tab-bar/tab-bar.js +177 -177
- package/dist/collection/components/tab-bar/tab-bar.md.css +66 -0
- package/dist/collection/components/tab-bar/test/basic/tab-bar.e2e.js +8 -8
- package/dist/collection/components/tab-bar/test/custom/tab-bar.e2e.js +6 -6
- package/dist/collection/components/tab-bar/test/translucent/tab-bar.e2e.js +14 -14
- package/dist/collection/components/tab-button/tab-button.ios.css +44 -0
- package/dist/collection/components/tab-button/tab-button.js +267 -267
- package/dist/collection/components/tab-button/tab-button.md.css +44 -0
- package/dist/collection/components/tab-button/test/a11y/tab-button.e2e.js +6 -6
- package/dist/collection/components/tab-button/test/basic/tab-button.e2e.js +16 -16
- package/dist/collection/components/tab-button/test/layout/tab-button.e2e.js +26 -26
- package/dist/collection/components/tab-button/test/states/tab-button.e2e.js +26 -26
- package/dist/collection/components/tabs/tabs.css +22 -0
- package/dist/collection/components/tabs/tabs.js +344 -344
- package/dist/collection/components/tabs/test/basic/tabs.e2e.js +24 -24
- package/dist/collection/components/tabs/test/placements/tabs.e2e.js +17 -17
- package/dist/collection/components/text/test/basic/text.e2e.js +11 -11
- package/dist/collection/components/text/text.css +22 -0
- package/dist/collection/components/text/text.js +47 -47
- package/dist/collection/components/textarea/test/a11y/textarea.e2e.js +12 -12
- package/dist/collection/components/textarea/test/autogrow/textarea.e2e.js +31 -31
- package/dist/collection/components/textarea/test/bottom-content/textarea.e2e.js +82 -82
- package/dist/collection/components/textarea/test/card/textarea.e2e.js +6 -6
- package/dist/collection/components/textarea/test/clear-on-edit/textarea.e2e.js +17 -17
- package/dist/collection/components/textarea/test/color/textarea.e2e.js +88 -88
- package/dist/collection/components/textarea/test/cols/textarea.e2e.js +11 -11
- package/dist/collection/components/textarea/test/fill/textarea.e2e.js +63 -63
- package/dist/collection/components/textarea/test/highlight/textarea.e2e.js +52 -52
- package/dist/collection/components/textarea/test/item/textarea.e2e.js +11 -11
- package/dist/collection/components/textarea/test/label-placement/textarea.e2e.js +150 -150
- package/dist/collection/components/textarea/test/legacy/a11y/textarea.e2e.js +15 -15
- package/dist/collection/components/textarea/test/legacy/autogrow/textarea.e2e.js +31 -31
- package/dist/collection/components/textarea/test/legacy/basic/textarea.e2e.js +30 -30
- package/dist/collection/components/textarea/test/legacy/clear-on-edit/textarea.e2e.js +17 -17
- package/dist/collection/components/textarea/test/slot/textarea.e2e.js +51 -0
- package/dist/collection/components/textarea/test/states/textarea.e2e.js +11 -11
- package/dist/collection/components/textarea/test/textarea-events.e2e.js +57 -57
- package/dist/collection/components/textarea/test/textarea.spec.js +59 -0
- package/dist/collection/components/textarea/textarea.ios.css +125 -5
- package/dist/collection/components/textarea/textarea.js +1046 -1019
- package/dist/collection/components/textarea/textarea.md.css +179 -14
- package/dist/collection/components/thumbnail/test/basic/thumbnail.e2e.js +28 -28
- package/dist/collection/components/thumbnail/thumbnail.css +22 -0
- package/dist/collection/components/thumbnail/thumbnail.js +15 -15
- package/dist/collection/components/title/test/a11y/title.e2e.js +17 -17
- package/dist/collection/components/title/test/basic/title.e2e.js +13 -13
- package/dist/collection/components/title/title.ios.css +22 -0
- package/dist/collection/components/title/title.js +119 -119
- package/dist/collection/components/title/title.md.css +22 -0
- package/dist/collection/components/toast/animations/ios.enter.js +21 -20
- package/dist/collection/components/toast/animations/ios.leave.js +18 -18
- package/dist/collection/components/toast/animations/md.enter.js +23 -22
- package/dist/collection/components/toast/animations/md.leave.js +6 -6
- package/dist/collection/components/toast/animations/utils.js +62 -56
- package/dist/collection/components/toast/gestures/swipe-to-dismiss.js +267 -0
- package/dist/collection/components/toast/test/a11y/toast.e2e.js +92 -92
- package/dist/collection/components/toast/test/basic/toast.e2e.js +101 -101
- package/dist/collection/components/toast/test/is-open/toast.e2e.js +17 -17
- package/dist/collection/components/toast/test/layout/toast.e2e.js +9 -9
- package/dist/collection/components/toast/test/position-anchor/toast.e2e.js +37 -37
- package/dist/collection/components/toast/test/standalone/toast.e2e.js +10 -10
- package/dist/collection/components/toast/test/swipe-gesture/toast.e2e.js +84 -0
- package/dist/collection/components/toast/test/toast-config.spec.js +25 -0
- package/dist/collection/components/toast/test/toast-id.spec.js +32 -0
- package/dist/collection/components/toast/test/toast.spec.js +200 -0
- package/dist/collection/components/toast/test/trigger/toast.e2e.js +21 -21
- package/dist/collection/components/toast/toast.ios.css +54 -10
- package/dist/collection/components/toast/toast.js +1065 -952
- package/dist/collection/components/toast/toast.md.css +54 -0
- package/dist/collection/components/toggle/test/a11y/toggle.e2e.js +6 -6
- package/dist/collection/components/toggle/test/color/toggle.e2e.js +11 -11
- package/dist/collection/components/toggle/test/enable-on-off-labels/toggle.e2e.js +27 -27
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +52 -52
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +65 -65
- package/dist/collection/components/toggle/test/legacy/basic/toggle.e2e.js +69 -69
- package/dist/collection/components/toggle/test/legacy/enable-on-off-labels/toggle.e2e.js +23 -23
- package/dist/collection/components/toggle/test/legacy/sizes/toggle.e2e.js +6 -6
- package/dist/collection/components/toggle/test/sizes/toggle.e2e.js +6 -6
- package/dist/collection/components/toggle/test/states/toggle.e2e.js +16 -16
- package/dist/collection/components/toggle/test/toggle.spec.js +67 -0
- package/dist/collection/components/toggle/toggle.ios.css +66 -6
- package/dist/collection/components/toggle/toggle.js +487 -484
- package/dist/collection/components/toggle/toggle.md.css +66 -6
- package/dist/collection/components/toolbar/test/basic/toolbar.e2e.js +7 -7
- package/dist/collection/components/toolbar/test/colors/toolbar.e2e.js +6 -6
- package/dist/collection/components/toolbar/toolbar.ios.css +44 -0
- package/dist/collection/components/toolbar/toolbar.js +100 -100
- package/dist/collection/components/toolbar/toolbar.md.css +44 -0
- package/dist/collection/css/test/a11y/typography.e2e.js +6 -6
- package/dist/collection/global/config.js +51 -51
- package/dist/collection/global/ionic-global.js +54 -54
- package/dist/collection/global/test/config-controller.spec.js +77 -0
- package/dist/collection/utils/animation/animation-utils.js +91 -91
- package/dist/collection/utils/animation/animation.js +905 -904
- package/dist/collection/utils/animation/cubic-bezier.js +49 -49
- package/dist/collection/utils/animation/test/animation.spec.js +447 -0
- package/dist/collection/utils/animation/test/animationbuilder/animation.e2e.js +26 -26
- package/dist/collection/utils/animation/test/basic/animation.e2e.js +12 -12
- package/dist/collection/utils/animation/test/display/animation.e2e.js +18 -18
- package/dist/collection/utils/animation/test/hooks/animation.e2e.js +39 -39
- package/dist/collection/utils/animation/test/multiple/animation.e2e.js +27 -27
- package/dist/collection/utils/browser/index.js +0 -22
- package/dist/collection/utils/config.js +20 -20
- package/dist/collection/utils/content/content.utils.spec.js +121 -121
- package/dist/collection/utils/content/index.js +58 -58
- package/dist/collection/utils/floating-point/floating-point.spec.js +14 -14
- package/dist/collection/utils/floating-point/index.js +5 -5
- package/dist/collection/utils/focus-visible.js +63 -63
- package/dist/collection/utils/forms/compare-with-utils.js +39 -0
- package/dist/collection/utils/forms/form-controller.js +45 -45
- package/dist/collection/utils/forms/index.js +1 -0
- package/dist/collection/utils/forms/notch-controller.js +120 -120
- package/dist/collection/utils/framework-delegate.js +121 -121
- package/dist/collection/utils/gesture/button-active.js +56 -56
- package/dist/collection/utils/gesture/gesture-controller.js +182 -182
- package/dist/collection/utils/gesture/index.js +222 -222
- package/dist/collection/utils/gesture/listener.js +36 -36
- package/dist/collection/utils/gesture/pointer-events.js +113 -113
- package/dist/collection/utils/gesture/recognizers.js +46 -46
- package/dist/collection/utils/gesture/swipe-back.js +65 -65
- package/dist/collection/utils/hardware-back-button.js +48 -48
- package/dist/collection/utils/helpers.js +258 -258
- package/dist/collection/utils/helpers.spec.js +28 -28
- package/dist/collection/utils/input-shims/hacks/common.js +61 -61
- package/dist/collection/utils/input-shims/hacks/hide-caret.js +19 -19
- package/dist/collection/utils/input-shims/hacks/input-blurring.js +47 -47
- package/dist/collection/utils/input-shims/hacks/scroll-assist.js +225 -225
- package/dist/collection/utils/input-shims/hacks/scroll-data.js +29 -29
- package/dist/collection/utils/input-shims/hacks/scroll-padding.js +21 -21
- package/dist/collection/utils/input-shims/hacks/test/scroll-assist.e2e.js +97 -97
- package/dist/collection/utils/input-shims/input-shims.js +87 -81
- package/dist/collection/utils/keyboard/keyboard-controller.js +128 -128
- package/dist/collection/utils/keyboard/keyboard.js +59 -59
- package/dist/collection/utils/keyboard/test/keyboard-controller.spec.js +21 -0
- package/dist/collection/utils/keyboard/test/keyboard.spec.js +214 -0
- package/dist/collection/utils/lock-controller.js +24 -24
- package/dist/collection/utils/logging/index.js +3 -3
- package/dist/collection/utils/media.js +13 -13
- package/dist/collection/utils/menu-controller/animations/base.js +8 -8
- package/dist/collection/utils/menu-controller/animations/overlay.js +21 -21
- package/dist/collection/utils/menu-controller/animations/push.js +20 -20
- package/dist/collection/utils/menu-controller/animations/reveal.js +6 -6
- package/dist/collection/utils/menu-controller/index.js +204 -206
- package/dist/collection/utils/native/capacitor.js +4 -4
- package/dist/collection/utils/native/haptic.js +151 -151
- package/dist/collection/utils/native/keyboard.js +47 -47
- package/dist/collection/utils/native/native-interface.js +15 -15
- package/dist/collection/utils/native/status-bar.js +36 -36
- package/dist/collection/utils/overlays.js +495 -494
- package/dist/collection/utils/platform.js +56 -56
- package/dist/collection/utils/rtl/dir.js +5 -5
- package/dist/collection/utils/rtl/dir.spec.js +17 -17
- package/dist/collection/utils/sanitization/index.js +122 -122
- package/dist/collection/utils/sanitization/test/sanitization.spec.js +43 -0
- package/dist/collection/utils/slot-mutation-controller.js +86 -85
- package/dist/collection/utils/status-tap.js +26 -26
- package/dist/collection/utils/tap-click/index.js +171 -171
- package/dist/collection/utils/tap-click/test/tap-click.e2e.js +12 -12
- package/dist/collection/utils/test/aria.spec.js +79 -0
- package/dist/collection/utils/test/attributes.spec.js +53 -0
- package/dist/collection/utils/test/framework-delegate/framework-delegate.e2e.js +25 -25
- package/dist/collection/utils/test/hardware-back-button.spec.js +53 -0
- package/dist/collection/utils/test/overlays/overlays.e2e.js +137 -137
- package/dist/collection/utils/test/overlays/overlays.spec.js +102 -0
- package/dist/collection/utils/test/platform.spec.js +132 -0
- package/dist/collection/utils/test/platform.utils.js +77 -77
- package/dist/collection/utils/test/playwright/drag-element.js +69 -69
- package/dist/collection/utils/test/playwright/generator.js +48 -25
- package/dist/collection/utils/test/playwright/matchers/index.js +3 -3
- package/dist/collection/utils/test/playwright/matchers/toHaveReceivedEvent.js +21 -21
- package/dist/collection/utils/test/playwright/matchers/toHaveReceivedEventDetail.js +28 -28
- package/dist/collection/utils/test/playwright/matchers/toHaveReceivedEventTimes.js +22 -22
- package/dist/collection/utils/test/playwright/page/event-spy.js +110 -110
- package/dist/collection/utils/test/playwright/page/utils/goto.js +52 -52
- package/dist/collection/utils/test/playwright/page/utils/locator.js +8 -8
- package/dist/collection/utils/test/playwright/page/utils/set-content.js +44 -35
- package/dist/collection/utils/test/playwright/page/utils/set-ion-viewport.js +19 -19
- package/dist/collection/utils/test/playwright/page/utils/spy-on-event.js +4 -4
- package/dist/collection/utils/test/playwright/page/utils/wait-for-changes.js +48 -48
- package/dist/collection/utils/test/playwright/playwright-page.js +35 -35
- package/dist/collection/utils/test/playwright/viewports/index.js +13 -13
- package/dist/collection/utils/test/press-keys.js +77 -77
- package/dist/collection/utils/test/ready.spec.js +39 -0
- package/dist/collection/utils/test/theme.spec.js +56 -0
- package/dist/collection/utils/theme.js +23 -23
- package/dist/collection/utils/transition/index.js +163 -163
- package/dist/collection/utils/transition/ios.transition.js +598 -598
- package/dist/collection/utils/transition/md.transition.js +44 -44
- package/dist/collection/utils/watch-options.js +30 -30
- package/dist/docs.json +195 -38
- package/dist/esm/animation-dde8cc0d.js +1060 -0
- package/dist/esm/{app-globals-2398e405.js → app-globals-722340c4.js} +1 -1
- package/dist/esm/button-active-c6ee4f50.js +67 -0
- package/dist/esm/capacitor-59395cbd.js +13 -0
- package/dist/esm/compare-with-utils-a96ff2ea.js +41 -0
- package/dist/esm/config-49c88215.js +193 -0
- package/dist/esm/cubic-bezier-fe2083dc.js +90 -0
- package/dist/esm/data-f5c75b4e.js +1575 -0
- package/dist/esm/{dir-912e3e13.js → dir-babeabeb.js} +5 -5
- package/dist/esm/focus-visible-dd40d69f.js +75 -0
- package/dist/esm/form-controller-548aa79c.js +64 -0
- package/dist/esm/framework-delegate-bc1fd82a.js +140 -0
- package/dist/esm/gesture-controller-1bf57181.js +195 -0
- package/dist/esm/haptic-554688a5.js +206 -0
- package/dist/esm/hardware-back-button-b2bc76db.js +71 -0
- package/dist/esm/helpers-ae653409.js +418 -0
- package/dist/esm/{index-7c9b1bca.js → index-08d686eb.js} +58 -7
- package/dist/esm/index-0c12c22b.js +306 -0
- package/dist/esm/index-1932b201.js +231 -0
- package/dist/esm/index-2cf77112.js +457 -0
- package/dist/esm/index-82eeb47f.js +196 -0
- package/dist/esm/{index-595d62c9.js → index-9b0d46f4.js} +3 -3
- package/dist/esm/index-a5d50daf.js +7 -0
- package/dist/esm/{index-4392efa5.js → index-b9e742e5.js} +60 -60
- package/dist/esm/index.js +113 -113
- package/dist/esm/input-shims-6539ce13.js +599 -0
- package/dist/esm/input.utils-a5a2d164.js +135 -0
- package/dist/esm/ion-accordion_2.entry.js +488 -488
- package/dist/esm/ion-action-sheet.entry.js +260 -250
- package/dist/esm/ion-alert.entry.js +442 -432
- package/dist/esm/ion-app_8.entry.js +1151 -1151
- package/dist/esm/ion-avatar_3.entry.js +29 -29
- package/dist/esm/ion-back-button.entry.js +73 -73
- package/dist/esm/ion-backdrop.entry.js +40 -40
- package/dist/esm/ion-breadcrumb_2.entry.js +194 -194
- package/dist/esm/ion-button_2.entry.js +303 -303
- package/dist/esm/ion-card_5.entry.js +105 -105
- package/dist/esm/ion-checkbox.entry.js +149 -147
- package/dist/esm/ion-chip.entry.js +20 -20
- package/dist/esm/ion-col_3.entry.js +136 -136
- package/dist/esm/ion-datetime-button.entry.js +325 -325
- package/dist/esm/ion-datetime_3.entry.js +2185 -2162
- package/dist/esm/ion-fab_3.entry.js +150 -150
- package/dist/esm/ion-img.entry.js +79 -79
- package/dist/esm/ion-infinite-scroll_2.entry.js +198 -190
- package/dist/esm/ion-input.entry.js +424 -399
- package/dist/esm/ion-item-option_3.entry.js +457 -457
- package/dist/esm/ion-item_8.entry.js +441 -428
- package/dist/esm/ion-loading.entry.js +220 -210
- package/dist/esm/ion-menu_3.entry.js +668 -668
- package/dist/esm/ion-modal.entry.js +1415 -1405
- package/dist/esm/ion-nav_2.entry.js +904 -904
- package/dist/esm/ion-picker-column-internal.entry.js +331 -327
- package/dist/esm/ion-picker-internal.entry.js +453 -453
- package/dist/esm/ion-popover.entry.js +1108 -1098
- package/dist/esm/ion-progress-bar.entry.js +40 -40
- package/dist/esm/ion-radio_2.entry.js +321 -316
- package/dist/esm/ion-range.entry.js +558 -556
- package/dist/esm/ion-refresher_2.entry.js +786 -786
- package/dist/esm/ion-reorder_2.entry.js +267 -267
- package/dist/esm/ion-ripple-effect.entry.js +66 -66
- package/dist/esm/ion-route_4.entry.js +693 -693
- package/dist/esm/ion-searchbar.entry.js +360 -358
- package/dist/esm/ion-segment_2.entry.js +507 -507
- package/dist/esm/ion-select_3.entry.js +784 -768
- package/dist/esm/ion-spinner.entry.js +46 -46
- package/dist/esm/ion-split-pane.entry.js +117 -117
- package/dist/esm/ion-tab-bar_2.entry.js +138 -138
- package/dist/esm/ion-tab_2.entry.js +187 -187
- package/dist/esm/ion-text.entry.js +13 -13
- package/dist/esm/ion-textarea.entry.js +378 -353
- package/dist/esm/ion-toast.entry.js +771 -419
- package/dist/esm/ion-toggle.entry.js +227 -225
- package/dist/esm/ionic-global-c0cda98e.js +224 -0
- package/dist/esm/ionic.js +6 -6
- package/dist/esm/ios.transition-802a84a6.js +651 -0
- package/dist/esm/keyboard-52278bd7.js +146 -0
- package/dist/esm/keyboard-73175e24.js +79 -0
- package/dist/esm/keyboard-controller-ec5c2bfa.js +165 -0
- package/dist/esm/loader.js +5 -5
- package/dist/esm/lock-controller-316928be.js +38 -0
- package/dist/esm/md.transition-43c2874d.js +57 -0
- package/dist/esm/notch-controller-fea7f9c5.js +153 -0
- package/dist/esm/overlays-32ef481d.js +693 -0
- package/dist/esm/spinner-configs-964f7cf3.js +145 -0
- package/dist/esm/status-tap-2b93b1b5.js +40 -0
- package/dist/esm/swipe-back-18cb49f7.js +79 -0
- package/dist/esm/theme-01f3f29c.js +43 -0
- package/dist/esm/watch-options-c2911ace.js +47 -0
- package/dist/esm-es5/{animation-8aa13916.js → animation-dde8cc0d.js} +1 -1
- package/dist/esm-es5/app-globals-722340c4.js +4 -0
- package/dist/esm-es5/{button-active-ce5cba4c.js → button-active-c6ee4f50.js} +1 -1
- package/dist/esm-es5/{capacitor-b4979570.js → capacitor-59395cbd.js} +1 -1
- package/dist/esm-es5/compare-with-utils-a96ff2ea.js +4 -0
- package/dist/esm-es5/{data-44d9e816.js → data-f5c75b4e.js} +1 -1
- package/dist/esm-es5/{form-controller-64edeaad.js → form-controller-548aa79c.js} +1 -1
- package/dist/esm-es5/{framework-delegate-aa433dea.js → framework-delegate-bc1fd82a.js} +1 -1
- package/dist/esm-es5/{haptic-1243b917.js → haptic-554688a5.js} +1 -1
- package/dist/esm-es5/{index-7c9b1bca.js → index-08d686eb.js} +1 -1
- package/dist/esm-es5/index-0c12c22b.js +4 -0
- package/dist/esm-es5/{index-6a0ccabb.js → index-1932b201.js} +1 -1
- package/dist/esm-es5/{index-ff313b19.js → index-2cf77112.js} +1 -1
- package/dist/esm-es5/{index-f0cc4e14.js → index-82eeb47f.js} +1 -1
- package/dist/esm-es5/{index-4392efa5.js → index-b9e742e5.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/input-shims-6539ce13.js +4 -0
- package/dist/esm-es5/input.utils-a5a2d164.js +4 -0
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-avatar_3.entry.js +1 -1
- package/dist/esm-es5/ion-back-button.entry.js +1 -1
- package/dist/esm-es5/ion-backdrop.entry.js +1 -1
- package/dist/esm-es5/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-card_5.entry.js +1 -1
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-chip.entry.js +1 -1
- package/dist/esm-es5/ion-col_3.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-fab_3.entry.js +1 -1
- package/dist/esm-es5/ion-img.entry.js +1 -1
- package/dist/esm-es5/ion-infinite-scroll_2.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-item-option_3.entry.js +1 -1
- package/dist/esm-es5/ion-item_8.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
- package/dist/esm-es5/ion-picker-internal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-progress-bar.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-ripple-effect.entry.js +1 -1
- package/dist/esm-es5/ion-route_4.entry.js +1 -1
- package/dist/esm-es5/ion-searchbar.entry.js +1 -1
- package/dist/esm-es5/ion-segment_2.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-spinner.entry.js +1 -1
- package/dist/esm-es5/ion-split-pane.entry.js +1 -1
- package/dist/esm-es5/ion-tab-bar_2.entry.js +1 -1
- package/dist/esm-es5/ion-tab_2.entry.js +1 -1
- package/dist/esm-es5/ion-text.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/{ionic-global-40e42e7f.js → ionic-global-c0cda98e.js} +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/{ios.transition-1651c430.js → ios.transition-802a84a6.js} +1 -1
- package/dist/esm-es5/{keyboard-b551279d.js → keyboard-52278bd7.js} +1 -1
- package/dist/esm-es5/{keyboard-b063f012.js → keyboard-73175e24.js} +1 -1
- package/dist/esm-es5/{keyboard-controller-0c2dce71.js → keyboard-controller-ec5c2bfa.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/md.transition-43c2874d.js +4 -0
- package/dist/esm-es5/{notch-controller-8c9c0e54.js → notch-controller-fea7f9c5.js} +1 -1
- package/dist/esm-es5/{overlays-6c9feb7e.js → overlays-32ef481d.js} +1 -1
- package/dist/esm-es5/{status-tap-9ce68758.js → status-tap-2b93b1b5.js} +1 -1
- package/dist/esm-es5/{swipe-back-cd4295f3.js → swipe-back-18cb49f7.js} +1 -1
- package/dist/html.html-data.json +16 -3
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/ionic.js +15 -15
- package/dist/ionic/p-013013a3.js +4 -0
- package/dist/ionic/p-01d14eba.system.entry.js +4 -0
- package/dist/ionic/p-042e6f4b.entry.js +4 -0
- package/dist/ionic/{p-f4cc91f6.entry.js → p-0add7211.entry.js} +1 -1
- package/dist/ionic/{p-41477ad9.system.js → p-0bd51c34.system.js} +1 -1
- package/dist/ionic/{p-c7b8c2ef.system.entry.js → p-0e53f8ea.system.entry.js} +1 -1
- package/dist/ionic/{p-744973f3.entry.js → p-1161a793.entry.js} +1 -1
- package/dist/ionic/{p-92800752.entry.js → p-1208f939.entry.js} +1 -1
- package/dist/ionic/{p-cf425ec5.system.entry.js → p-16756e94.system.entry.js} +1 -1
- package/dist/ionic/p-1786bc72.js +4 -0
- package/dist/ionic/{p-c7d30db9.entry.js → p-17da5ed1.entry.js} +1 -1
- package/dist/ionic/{p-a8e68fd9.entry.js → p-18ba8221.entry.js} +1 -1
- package/dist/ionic/p-1b19c04b.entry.js +4 -0
- package/dist/ionic/{p-b4b4bb29.system.js → p-1cca10d6.system.js} +1 -1
- package/dist/ionic/p-1e4371bd.js +4 -0
- package/dist/ionic/{p-0a794e83.entry.js → p-2092f39f.entry.js} +1 -1
- package/dist/ionic/p-251666e2.entry.js +4 -0
- package/dist/ionic/{p-9209d90c.entry.js → p-270e1a1d.entry.js} +1 -1
- package/dist/ionic/{p-419eb426.js → p-27281edd.js} +1 -1
- package/dist/ionic/p-28249b10.system.entry.js +4 -0
- package/dist/ionic/p-28a2c2a2.entry.js +4 -0
- package/dist/ionic/{p-ffb876b0.system.entry.js → p-2938823a.system.entry.js} +1 -1
- package/dist/ionic/p-29d03b3a.js +4 -0
- package/dist/ionic/{p-17240d90.js → p-2aea8b1e.js} +1 -1
- package/dist/ionic/p-2b7827c7.js +4 -0
- package/dist/ionic/p-2d3b9fa3.system.entry.js +4 -0
- package/dist/ionic/p-2d539df1.entry.js +4 -0
- package/dist/ionic/{p-fa8d4788.system.js → p-31b2326e.system.js} +1 -1
- package/dist/ionic/{p-c4042875.system.js → p-31fcb233.system.js} +1 -1
- package/dist/ionic/{p-a936d224.system.js → p-33a37fad.system.js} +1 -1
- package/dist/ionic/p-350f7292.system.entry.js +4 -0
- package/dist/ionic/{p-e76a4bc8.entry.js → p-353b349d.entry.js} +1 -1
- package/dist/ionic/p-36d187af.js +4 -0
- package/dist/ionic/p-376a6063.js +4 -0
- package/dist/ionic/{p-55ed230e.system.js → p-38c337e7.system.js} +1 -1
- package/dist/ionic/p-38f2c6bb.system.js +4 -0
- package/dist/ionic/{p-0492946a.entry.js → p-3a45a82b.entry.js} +1 -1
- package/dist/ionic/{p-3bad5c1a.js → p-3a75d7fd.js} +1 -1
- package/dist/ionic/{p-0dc0d9b5.entry.js → p-3dd98a73.entry.js} +1 -1
- package/dist/ionic/p-3e6b47e8.system.entry.js +4 -0
- package/dist/ionic/p-3f5179b5.entry.js +4 -0
- package/dist/ionic/p-40f68333.system.js +4 -0
- package/dist/ionic/{p-c0c81820.system.js → p-4155f352.system.js} +1 -1
- package/dist/ionic/{p-b287ab05.js → p-4180a747.js} +1 -1
- package/dist/ionic/p-4233cc1e.system.entry.js +4 -0
- package/dist/ionic/{p-b923f3d7.js → p-42f189f4.js} +1 -1
- package/dist/ionic/{p-0e23256e.system.entry.js → p-46d400b4.system.entry.js} +1 -1
- package/dist/ionic/{p-800ef057.js → p-47b6ba5b.js} +1 -1
- package/dist/ionic/p-4d67d27a.entry.js +4 -0
- package/dist/ionic/{p-1a8ae7a7.system.entry.js → p-4fb51e61.system.entry.js} +1 -1
- package/dist/ionic/{p-18e01b30.system.entry.js → p-517a9885.system.entry.js} +1 -1
- package/dist/ionic/{p-63f08fe3.entry.js → p-51a087d6.entry.js} +1 -1
- package/dist/ionic/p-53ec4f1c.system.js +4 -0
- package/dist/ionic/{p-5cfb3feb.system.entry.js → p-564af202.system.entry.js} +1 -1
- package/dist/ionic/{p-1dc91702.entry.js → p-588fdf40.entry.js} +1 -1
- package/dist/ionic/{p-41122cd6.system.js → p-5b365ca7.system.js} +1 -1
- package/dist/ionic/{p-1d269117.system.entry.js → p-5bebc7b3.system.entry.js} +1 -1
- package/dist/ionic/p-5e4eec2e.entry.js +4 -0
- package/dist/ionic/{p-702d85d8.system.js → p-5e745192.system.js} +1 -1
- package/dist/ionic/{p-6c3d5383.js → p-5ecae037.js} +1 -1
- package/dist/ionic/{p-b2a74a72.entry.js → p-5eda1d7d.entry.js} +1 -1
- package/dist/ionic/{p-6e23777e.system.entry.js → p-6577aea9.system.entry.js} +1 -1
- package/dist/ionic/p-66d633fb.js +4 -0
- package/dist/ionic/{p-3fb57e1b.system.entry.js → p-6ad34705.system.entry.js} +1 -1
- package/dist/ionic/p-6de472cb.js +4 -0
- package/dist/ionic/{p-34d2de14.system.entry.js → p-6de62649.system.entry.js} +1 -1
- package/dist/ionic/{p-ff5144f3.system.entry.js → p-6e70dd1a.system.entry.js} +1 -1
- package/dist/ionic/{p-4e6a1efb.system.entry.js → p-6f8dbe92.system.entry.js} +1 -1
- package/dist/ionic/{p-1e86a71b.entry.js → p-6fbecbda.entry.js} +1 -1
- package/dist/ionic/p-72f6ff89.js +4 -0
- package/dist/ionic/p-765f4dde.entry.js +4 -0
- package/dist/ionic/{p-8a308596.system.js → p-7798c78a.system.js} +2 -2
- package/dist/ionic/{p-64ed03a3.entry.js → p-78aadecb.entry.js} +1 -1
- package/dist/ionic/p-7d92bf15.system.entry.js +4 -0
- package/dist/ionic/{p-5bd4e009.entry.js → p-80fa068e.entry.js} +1 -1
- package/dist/ionic/{p-b8c3f071.system.js → p-82e3d633.system.js} +1 -1
- package/dist/ionic/p-8314281e.system.js +4 -0
- package/dist/ionic/p-8804a472.system.entry.js +4 -0
- package/dist/ionic/{p-613d4042.system.js → p-888db766.system.js} +1 -1
- package/dist/ionic/p-88d5fbd3.js +4 -0
- package/dist/ionic/{p-3de79805.entry.js → p-88fde0e0.entry.js} +1 -1
- package/dist/ionic/{p-ccdcb022.system.js → p-8985cdb6.system.js} +1 -1
- package/dist/ionic/p-8aa1d0b7.system.js +4 -0
- package/dist/ionic/p-8acae6b0.system.entry.js +4 -0
- package/dist/ionic/p-8d69a624.entry.js +4 -0
- package/dist/ionic/{p-14aca3fb.entry.js → p-8f5d30f5.entry.js} +1 -1
- package/dist/ionic/{p-a9c3699b.system.entry.js → p-908475e7.system.entry.js} +1 -1
- package/dist/ionic/{p-67aab78f.js → p-91d33c4a.js} +1 -1
- package/dist/ionic/p-953009b1.entry.js +4 -0
- package/dist/ionic/{p-3d7fea9b.system.entry.js → p-958d6ebe.system.entry.js} +2 -2
- package/dist/ionic/{p-07d9e9cd.system.entry.js → p-9709ebd8.system.entry.js} +1 -1
- package/dist/ionic/p-9738fd82.js +5 -0
- package/dist/ionic/p-979d4f5c.system.js +4 -0
- package/dist/ionic/{p-8b29691f.entry.js → p-98f3d827.entry.js} +1 -1
- package/dist/ionic/p-9b7f0b0f.entry.js +4 -0
- package/dist/ionic/p-9e447eb1.system.js +4 -0
- package/dist/ionic/{p-4c80afe1.system.entry.js → p-9eec42cc.system.entry.js} +1 -1
- package/dist/ionic/p-9f6ee2c0.system.entry.js +4 -0
- package/dist/ionic/{p-bed722c4.system.entry.js → p-a0bb7b92.system.entry.js} +1 -1
- package/dist/ionic/{p-97e31c0a.system.js → p-a0d7bb5e.system.js} +1 -1
- package/dist/ionic/{p-965677f1.entry.js → p-a1987850.entry.js} +1 -1
- package/dist/ionic/{p-b91fe549.entry.js → p-a3277a67.entry.js} +1 -1
- package/dist/ionic/{p-ed636a74.entry.js → p-a4afcc88.entry.js} +1 -1
- package/dist/ionic/{p-73411c1b.entry.js → p-a9978d08.entry.js} +1 -1
- package/dist/ionic/{p-1cb5f2f8.system.entry.js → p-ada96dd0.system.entry.js} +1 -1
- package/dist/ionic/p-afd6ca9d.entry.js +4 -0
- package/dist/ionic/{p-0330f0a3.system.entry.js → p-b3b3efba.system.entry.js} +1 -1
- package/dist/ionic/{p-a545b4f1.system.js → p-b4a51c42.system.js} +1 -1
- package/dist/ionic/p-b56d0866.system.entry.js +4 -0
- package/dist/ionic/{p-48d9faa7.entry.js → p-b5f9f14c.entry.js} +1 -1
- package/dist/ionic/{p-45da1e68.system.entry.js → p-b6f5e4f2.system.entry.js} +1 -1
- package/dist/ionic/p-b6f9d32a.entry.js +4 -0
- package/dist/ionic/{p-664d2b07.system.entry.js → p-b7010c69.system.entry.js} +1 -1
- package/dist/ionic/{p-5d711127.js → p-c3c3333a.js} +1 -1
- package/dist/ionic/p-c61cc894.js +4 -0
- package/dist/ionic/{p-5da0eb3e.system.entry.js → p-c847fb35.system.entry.js} +1 -1
- package/dist/ionic/{p-67e18f02.system.entry.js → p-c91ccbfa.system.entry.js} +1 -1
- package/dist/ionic/{p-f5a750e4.system.entry.js → p-c9a21dfd.system.entry.js} +1 -1
- package/dist/ionic/{p-ab4cff27.system.js → p-cabad15b.system.js} +1 -1
- package/dist/ionic/{p-d7ea6a0d.system.entry.js → p-caf21b46.system.entry.js} +1 -1
- package/dist/ionic/{p-beb64be7.system.entry.js → p-cce9f61a.system.entry.js} +1 -1
- package/dist/ionic/{p-a0b6d438.js → p-cdbeaadc.js} +1 -1
- package/dist/ionic/{p-174f3446.entry.js → p-cfe57b1b.entry.js} +1 -1
- package/dist/ionic/p-d032f825.system.entry.js +4 -0
- package/dist/ionic/{p-7cee75c0.entry.js → p-d37b441e.entry.js} +1 -1
- package/dist/ionic/{p-d2597b3e.system.js → p-d3b030b8.system.js} +1 -1
- package/dist/ionic/p-d51674c5.system.js +4 -0
- package/dist/ionic/p-dc6af8e9.entry.js +4 -0
- package/dist/ionic/{p-8ad82eb3.entry.js → p-ddb30596.entry.js} +1 -1
- package/dist/ionic/{p-bba2ce59.system.js → p-ddbb2d5b.system.js} +1 -1
- package/dist/ionic/p-de6f8b28.system.js +4 -0
- package/dist/ionic/p-de756e5c.js +4 -0
- package/dist/ionic/p-dee7c1d0.system.entry.js +4 -0
- package/dist/ionic/{p-09d142b3.system.js → p-e24ce1e5.system.js} +1 -1
- package/dist/ionic/p-e3584231.system.js +4 -0
- package/dist/ionic/{p-db5043df.system.entry.js → p-e6d68e02.system.entry.js} +1 -1
- package/dist/ionic/{p-abacb44b.system.entry.js → p-e7ea9815.system.entry.js} +1 -1
- package/dist/ionic/{p-c919498d.entry.js → p-e94c392d.entry.js} +1 -1
- package/dist/ionic/p-ea69616e.entry.js +4 -0
- package/dist/ionic/p-eef72e06.js +4 -0
- package/dist/ionic/{p-a6d83a03.system.entry.js → p-ef126ae8.system.entry.js} +1 -1
- package/dist/ionic/p-f0445d82.system.entry.js +4 -0
- package/dist/ionic/p-f5d2dc9b.js +4 -0
- package/dist/ionic/p-f656e032.system.entry.js +4 -0
- package/dist/ionic/p-f70970cf.js +4 -0
- package/dist/ionic/{p-5deff017.entry.js → p-f8a5bb89.entry.js} +1 -1
- package/dist/ionic/{p-377c636c.system.entry.js → p-fba0a6e7.system.entry.js} +1 -1
- package/dist/ionic/p-feae5133.entry.js +4 -0
- package/dist/types/components/accordion/accordion.d.ts +62 -62
- package/dist/types/components/accordion-group/accordion-group-interface.d.ts +3 -3
- package/dist/types/components/accordion-group/accordion-group.d.ts +76 -76
- package/dist/types/components/action-sheet/action-sheet-interface.d.ts +25 -25
- package/dist/types/components/action-sheet/action-sheet.d.ts +149 -149
- package/dist/types/components/action-sheet/test/basic/fixture.d.ts +7 -7
- package/dist/types/components/alert/alert-interface.d.ts +45 -45
- package/dist/types/components/alert/alert.d.ts +181 -181
- package/dist/types/components/app/app.d.ts +15 -15
- package/dist/types/components/avatar/avatar.d.ts +1 -1
- package/dist/types/components/back-button/back-button.d.ts +41 -41
- package/dist/types/components/backdrop/backdrop.d.ts +22 -22
- package/dist/types/components/badge/badge.d.ts +7 -7
- package/dist/types/components/breadcrumb/breadcrumb-interface.d.ts +4 -4
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +87 -87
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +39 -39
- package/dist/types/components/button/button.d.ts +121 -121
- package/dist/types/components/buttons/buttons.d.ts +14 -14
- package/dist/types/components/card/card.d.ts +57 -57
- package/dist/types/components/card-content/card-content.d.ts +1 -1
- package/dist/types/components/card-header/card-header.d.ts +13 -13
- package/dist/types/components/card-subtitle/card-subtitle.d.ts +7 -7
- package/dist/types/components/card-title/card-title.d.ts +7 -7
- package/dist/types/components/checkbox/checkbox-interface.d.ts +4 -4
- package/dist/types/components/checkbox/checkbox.d.ts +112 -111
- package/dist/types/components/chip/chip.d.ts +15 -15
- package/dist/types/components/col/col.d.ts +128 -128
- package/dist/types/components/content/content-interface.d.ts +6 -6
- package/dist/types/components/content/content.d.ts +129 -129
- package/dist/types/components/datetime/datetime-interface.d.ts +15 -15
- package/dist/types/components/datetime/datetime.d.ts +407 -407
- package/dist/types/components/datetime/utils/data.d.ts +11 -11
- package/dist/types/components/datetime/utils/manipulation.d.ts +25 -25
- package/dist/types/components/datetime/utils/state.d.ts +8 -8
- package/dist/types/components/datetime-button/datetime-button.d.ts +59 -59
- package/dist/types/components/fab/fab.d.ts +33 -33
- package/dist/types/components/fab-button/fab-button.d.ts +88 -88
- package/dist/types/components/fab-list/fab-list.d.ts +11 -11
- package/dist/types/components/footer/footer.d.ts +27 -27
- package/dist/types/components/grid/grid.d.ts +5 -5
- package/dist/types/components/header/header.d.ts +31 -31
- package/dist/types/components/header/header.utils.d.ts +7 -7
- package/dist/types/components/img/img.d.ts +30 -30
- package/dist/types/components/infinite-scroll/infinite-scroll-interface.d.ts +1 -1
- package/dist/types/components/infinite-scroll/infinite-scroll.d.ts +65 -58
- package/dist/types/components/infinite-scroll-content/infinite-scroll-content.d.ts +23 -23
- package/dist/types/components/input/input-interface.d.ts +6 -6
- package/dist/types/components/input/input.d.ts +321 -315
- package/dist/types/components/item/item.d.ts +111 -111
- package/dist/types/components/item-divider/item-divider.d.ts +16 -16
- package/dist/types/components/item-group/item-group.d.ts +1 -1
- package/dist/types/components/item-option/item-option.d.ts +44 -44
- package/dist/types/components/item-options/item-options.d.ts +13 -13
- package/dist/types/components/item-sliding/item-sliding-interface.d.ts +1 -1
- package/dist/types/components/item-sliding/item-sliding.d.ts +75 -75
- package/dist/types/components/label/label.d.ts +30 -30
- package/dist/types/components/list/list.d.ts +17 -17
- package/dist/types/components/list-header/list-header.d.ts +11 -11
- package/dist/types/components/loading/loading-interface.d.ts +16 -16
- package/dist/types/components/loading/loading.d.ts +152 -152
- package/dist/types/components/menu/menu-interface.d.ts +39 -39
- package/dist/types/components/menu/menu.d.ts +140 -140
- package/dist/types/components/menu-button/menu-button.d.ts +30 -30
- package/dist/types/components/menu-toggle/menu-toggle.d.ts +21 -21
- package/dist/types/components/modal/animations/sheet.d.ts +4 -4
- package/dist/types/components/modal/gestures/sheet.d.ts +30 -30
- package/dist/types/components/modal/gestures/swipe-to-close.d.ts +1 -1
- package/dist/types/components/modal/modal-interface.d.ts +27 -27
- package/dist/types/components/modal/modal.d.ts +265 -265
- package/dist/types/components/modal/test/fixtures.d.ts +7 -7
- package/dist/types/components/nav/nav-interface.d.ts +40 -40
- package/dist/types/components/nav/nav.d.ts +247 -247
- package/dist/types/components/nav/view-controller.d.ts +13 -13
- package/dist/types/components/nav-link/nav-link.d.ts +19 -19
- package/dist/types/components/note/note.d.ts +7 -7
- package/dist/types/components/picker/picker-interface.d.ts +43 -43
- package/dist/types/components/picker/picker.d.ts +149 -149
- package/dist/types/components/picker-column/picker-column.d.ts +39 -39
- package/dist/types/components/picker-column-internal/picker-column-internal-interfaces.d.ts +3 -3
- package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +93 -89
- package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +4 -4
- package/dist/types/components/picker-internal/picker-internal.d.ts +94 -94
- package/dist/types/components/popover/popover-interface.d.ts +26 -26
- package/dist/types/components/popover/popover.d.ts +279 -279
- package/dist/types/components/popover/test/fixture.d.ts +5 -5
- package/dist/types/components/popover/utils.d.ts +25 -25
- package/dist/types/components/progress-bar/progress-bar.d.ts +27 -27
- package/dist/types/components/radio/radio.d.ts +100 -99
- package/dist/types/components/radio-group/radio-group-interface.d.ts +5 -4
- package/dist/types/components/radio-group/radio-group.d.ts +51 -44
- package/dist/types/components/radio-group/test/fixtures.d.ts +5 -5
- package/dist/types/components/range/range-interface.d.ts +7 -7
- package/dist/types/components/range/range.d.ts +193 -192
- package/dist/types/components/refresher/refresher-interface.d.ts +3 -3
- package/dist/types/components/refresher/refresher.d.ts +132 -132
- package/dist/types/components/refresher-content/refresher-content.d.ts +44 -44
- package/dist/types/components/reorder/reorder.d.ts +3 -3
- package/dist/types/components/reorder-group/reorder-group-interface.d.ts +5 -5
- package/dist/types/components/reorder-group/reorder-group.d.ts +53 -53
- package/dist/types/components/ripple-effect/ripple-effect.d.ts +20 -20
- package/dist/types/components/route/route-interface.d.ts +1 -1
- package/dist/types/components/route/route.d.ts +43 -43
- package/dist/types/components/route-redirect/route-redirect.d.ts +33 -33
- package/dist/types/components/router/router.d.ts +74 -73
- package/dist/types/components/router/utils/dom.d.ts +2 -2
- package/dist/types/components/router/utils/interface.d.ts +31 -31
- package/dist/types/components/router/utils/matching.d.ts +6 -6
- package/dist/types/components/router-link/router-link.d.ts +34 -34
- package/dist/types/components/router-outlet/router-outlet.d.ts +41 -41
- package/dist/types/components/row/row.d.ts +1 -1
- package/dist/types/components/searchbar/searchbar-interface.d.ts +6 -6
- package/dist/types/components/searchbar/searchbar.d.ts +235 -233
- package/dist/types/components/segment/segment-interface.d.ts +3 -3
- package/dist/types/components/segment/segment.d.ts +82 -82
- package/dist/types/components/segment-button/segment-button.d.ts +36 -36
- package/dist/types/components/select/select-interface.d.ts +3 -3
- package/dist/types/components/select/select.d.ts +238 -233
- package/dist/types/components/select-option/select-option.d.ts +11 -11
- package/dist/types/components/select-popover/select-popover-interface.d.ts +8 -8
- package/dist/types/components/select-popover/select-popover.d.ts +39 -39
- package/dist/types/components/select-popover/test/fixtures.d.ts +12 -12
- package/dist/types/components/skeleton-text/skeleton-text.d.ts +15 -7
- package/dist/types/components/spinner/spinner-configs.d.ts +96 -96
- package/dist/types/components/spinner/spinner-interface.d.ts +14 -14
- package/dist/types/components/spinner/spinner.d.ts +21 -21
- package/dist/types/components/split-pane/split-pane.d.ts +33 -33
- package/dist/types/components/tab/tab.d.ts +21 -21
- package/dist/types/components/tab-bar/tab-bar-interface.d.ts +4 -4
- package/dist/types/components/tab-bar/tab-bar.d.ts +34 -34
- package/dist/types/components/tab-button/tab-button.d.ts +56 -56
- package/dist/types/components/tabs/tabs-interface.d.ts +4 -4
- package/dist/types/components/tabs/tabs.d.ts +52 -52
- package/dist/types/components/text/text.d.ts +7 -7
- package/dist/types/components/textarea/textarea-interface.d.ts +6 -6
- package/dist/types/components/textarea/textarea.d.ts +275 -269
- package/dist/types/components/thumbnail/thumbnail.d.ts +1 -1
- package/dist/types/components/title/title.d.ts +21 -21
- package/dist/types/components/toast/animations/utils.d.ts +15 -4
- package/dist/types/components/toast/gestures/swipe-to-dismiss.d.ts +9 -0
- package/dist/types/components/toast/toast-interface.d.ts +37 -35
- package/dist/types/components/toast/toast.d.ts +241 -214
- package/dist/types/components/toggle/toggle-interface.d.ts +4 -4
- package/dist/types/components/toggle/toggle.d.ts +117 -116
- package/dist/types/components/toolbar/toolbar.d.ts +11 -11
- package/dist/types/components.d.ts +52 -13
- package/dist/types/global/config.d.ts +6 -6
- package/dist/types/interface.d.ts +1 -5
- package/dist/types/jest.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +8 -0
- package/dist/types/utils/animation/animation-interface.d.ts +205 -205
- package/dist/types/utils/browser/index.d.ts +17 -8
- package/dist/types/utils/config.d.ts +175 -175
- package/dist/types/utils/element-interface.d.ts +6 -6
- package/dist/types/utils/focus-visible.d.ts +2 -2
- package/dist/types/utils/forms/compare-with-utils.d.ts +18 -0
- package/dist/types/utils/forms/form-controller.d.ts +3 -3
- package/dist/types/utils/forms/index.d.ts +1 -0
- package/dist/types/utils/forms/notch-controller.d.ts +2 -2
- package/dist/types/utils/framework-delegate.d.ts +3 -3
- package/dist/types/utils/gesture/gesture-controller.d.ts +49 -49
- package/dist/types/utils/gesture/index.d.ts +31 -31
- package/dist/types/utils/gesture/listener.d.ts +2 -2
- package/dist/types/utils/gesture/pointer-events.d.ts +12 -12
- package/dist/types/utils/gesture/recognizers.d.ts +4 -4
- package/dist/types/utils/hardware-back-button.d.ts +4 -0
- package/dist/types/utils/helpers.d.ts +8 -8
- package/dist/types/utils/input-shims/hacks/scroll-data.d.ts +4 -4
- package/dist/types/utils/keyboard/keyboard-controller.d.ts +3 -3
- package/dist/types/utils/lock-controller.d.ts +1 -1
- package/dist/types/utils/native/haptic.d.ts +38 -38
- package/dist/types/utils/native/keyboard.d.ts +29 -29
- package/dist/types/utils/native/native-interface.d.ts +15 -15
- package/dist/types/utils/native/status-bar.d.ts +8 -8
- package/dist/types/utils/overlays-interface.d.ts +27 -27
- package/dist/types/utils/overlays.d.ts +29 -28
- package/dist/types/utils/platform.d.ts +16 -16
- package/dist/types/utils/sanitization/index.d.ts +2 -2
- package/dist/types/utils/slot-mutation-controller.d.ts +3 -3
- package/dist/types/utils/test/platform.utils.d.ts +66 -66
- package/dist/types/utils/test/playwright/generator.d.ts +16 -7
- package/dist/types/utils/test/playwright/matchers/index.d.ts +3 -3
- package/dist/types/utils/test/playwright/matchers/toHaveReceivedEvent.d.ts +2 -2
- package/dist/types/utils/test/playwright/matchers/toHaveReceivedEventDetail.d.ts +2 -2
- package/dist/types/utils/test/playwright/matchers/toHaveReceivedEventTimes.d.ts +2 -2
- package/dist/types/utils/test/playwright/page/event-spy.d.ts +15 -15
- package/dist/types/utils/test/playwright/page/utils/goto.d.ts +3 -3
- package/dist/types/utils/test/playwright/page/utils/locator.d.ts +15 -15
- package/dist/types/utils/test/playwright/playwright-declarations.d.ts +92 -92
- package/dist/types/utils/test/playwright/playwright-page.d.ts +3 -3
- package/dist/types/utils/test/playwright/viewports/index.d.ts +12 -12
- package/dist/types/utils/test/press-keys.d.ts +14 -14
- package/dist/types/utils/transition/index.d.ts +6 -6
- package/dist/types/utils/watch-options.d.ts +1 -1
- package/hydrate/index.d.ts +1 -1
- package/hydrate/index.js +30517 -29945
- package/package.json +3 -2
- package/dist/cjs/animation-1083855c.js +0 -1061
- package/dist/cjs/button-active-af897e0e.js +0 -69
- package/dist/cjs/config-d5882735.js +0 -199
- package/dist/cjs/cubic-bezier-6b9222ad.js +0 -92
- package/dist/cjs/data-c8d21093.js +0 -1622
- package/dist/cjs/focus-visible-a7545600.js +0 -77
- package/dist/cjs/form-controller-9343050c.js +0 -66
- package/dist/cjs/framework-delegate-c0873a6f.js +0 -144
- package/dist/cjs/gesture-controller-b46721be.js +0 -197
- package/dist/cjs/haptic-678abc9f.js +0 -212
- package/dist/cjs/hardware-back-button-b67c8e75.js +0 -76
- package/dist/cjs/helpers-ea4ccbcb.js +0 -441
- package/dist/cjs/index-0ee995e4.js +0 -459
- package/dist/cjs/index-306a7476.js +0 -32
- package/dist/cjs/index-573877f3.js +0 -243
- package/dist/cjs/index-9f379eaa.js +0 -198
- package/dist/cjs/index-d7561763.js +0 -310
- package/dist/cjs/input-shims-b0a75a01.js +0 -596
- package/dist/cjs/input.utils-0fe3097c.js +0 -137
- package/dist/cjs/ionic-global-ea2901a3.js +0 -230
- package/dist/cjs/ios.transition-ac909bc8.js +0 -654
- package/dist/cjs/keyboard-controller-50beb83a.js +0 -167
- package/dist/cjs/keyboard-fd7db491.js +0 -81
- package/dist/cjs/lock-controller-4ae2eb59.js +0 -40
- package/dist/cjs/md.transition-907af519.js +0 -59
- package/dist/cjs/notch-controller-f4f6af5d.js +0 -155
- package/dist/cjs/overlays-2ffc5f27.js +0 -714
- package/dist/cjs/spinner-configs-f7b5105b.js +0 -147
- package/dist/cjs/status-tap-3fb2391a.js +0 -42
- package/dist/cjs/swipe-back-7e843e77.js +0 -81
- package/dist/cjs/theme-fbc56b3b.js +0 -48
- package/dist/cjs/watch-options-53bbb124.js +0 -49
- package/dist/collection/components/item/test/text/item.e2e.js +0 -14
- package/dist/esm/animation-8aa13916.js +0 -1059
- package/dist/esm/button-active-ce5cba4c.js +0 -67
- package/dist/esm/capacitor-b4979570.js +0 -13
- package/dist/esm/config-96c9ace3.js +0 -193
- package/dist/esm/cubic-bezier-66542bc5.js +0 -90
- package/dist/esm/data-44d9e816.js +0 -1575
- package/dist/esm/focus-visible-85493433.js +0 -75
- package/dist/esm/form-controller-64edeaad.js +0 -64
- package/dist/esm/framework-delegate-aa433dea.js +0 -140
- package/dist/esm/gesture-controller-0fa396c4.js +0 -195
- package/dist/esm/haptic-1243b917.js +0 -206
- package/dist/esm/hardware-back-button-39299f84.js +0 -71
- package/dist/esm/helpers-3379ba19.js +0 -418
- package/dist/esm/index-0aa6e61f.js +0 -308
- package/dist/esm/index-6a0ccabb.js +0 -231
- package/dist/esm/index-7a14ecec.js +0 -29
- package/dist/esm/index-f0cc4e14.js +0 -196
- package/dist/esm/index-ff313b19.js +0 -457
- package/dist/esm/input-shims-d0c93e5d.js +0 -594
- package/dist/esm/input.utils-ec063df4.js +0 -134
- package/dist/esm/ionic-global-40e42e7f.js +0 -224
- package/dist/esm/ios.transition-1651c430.js +0 -651
- package/dist/esm/keyboard-b063f012.js +0 -79
- package/dist/esm/keyboard-b551279d.js +0 -146
- package/dist/esm/keyboard-controller-0c2dce71.js +0 -165
- package/dist/esm/lock-controller-e8c6c051.js +0 -38
- package/dist/esm/md.transition-66f18369.js +0 -57
- package/dist/esm/notch-controller-8c9c0e54.js +0 -153
- package/dist/esm/overlays-6c9feb7e.js +0 -692
- package/dist/esm/spinner-configs-d09fbbbb.js +0 -145
- package/dist/esm/status-tap-9ce68758.js +0 -40
- package/dist/esm/swipe-back-cd4295f3.js +0 -79
- package/dist/esm/theme-17531cdf.js +0 -43
- package/dist/esm/watch-options-02d8498b.js +0 -47
- package/dist/esm-es5/app-globals-2398e405.js +0 -4
- package/dist/esm-es5/index-0aa6e61f.js +0 -4
- package/dist/esm-es5/input-shims-d0c93e5d.js +0 -4
- package/dist/esm-es5/input.utils-ec063df4.js +0 -4
- package/dist/esm-es5/md.transition-66f18369.js +0 -4
- package/dist/ionic/p-0d8e9393.entry.js +0 -4
- package/dist/ionic/p-114a36ed.js +0 -4
- package/dist/ionic/p-14b4348c.system.js +0 -4
- package/dist/ionic/p-1e5165db.system.entry.js +0 -4
- package/dist/ionic/p-1f4f0d59.system.entry.js +0 -4
- package/dist/ionic/p-20cf4994.js +0 -4
- package/dist/ionic/p-236063ec.system.entry.js +0 -4
- package/dist/ionic/p-276afddd.js +0 -4
- package/dist/ionic/p-2e8e0045.js +0 -4
- package/dist/ionic/p-32083c2d.js +0 -4
- package/dist/ionic/p-352c0232.system.entry.js +0 -4
- package/dist/ionic/p-3602001b.system.js +0 -4
- package/dist/ionic/p-3632220b.system.js +0 -4
- package/dist/ionic/p-39044fe6.system.entry.js +0 -4
- package/dist/ionic/p-3ce8c3e3.entry.js +0 -4
- package/dist/ionic/p-40903d34.system.js +0 -4
- package/dist/ionic/p-4518e4c0.system.entry.js +0 -4
- package/dist/ionic/p-4794e0ac.system.entry.js +0 -4
- package/dist/ionic/p-4a142496.system.entry.js +0 -4
- package/dist/ionic/p-4cd588b3.system.entry.js +0 -4
- package/dist/ionic/p-4dbac22d.entry.js +0 -4
- package/dist/ionic/p-4ecb5692.entry.js +0 -4
- package/dist/ionic/p-5370e786.js +0 -4
- package/dist/ionic/p-63d519fb.entry.js +0 -4
- package/dist/ionic/p-64296b15.entry.js +0 -4
- package/dist/ionic/p-67ed452a.system.entry.js +0 -4
- package/dist/ionic/p-67eecef4.system.js +0 -4
- package/dist/ionic/p-7176cea3.entry.js +0 -4
- package/dist/ionic/p-73420380.js +0 -4
- package/dist/ionic/p-77e7a9c8.entry.js +0 -4
- package/dist/ionic/p-7ab6fc5a.system.entry.js +0 -4
- package/dist/ionic/p-81c818e7.js +0 -4
- package/dist/ionic/p-8b1be026.js +0 -4
- package/dist/ionic/p-8cf94fc1.js +0 -4
- package/dist/ionic/p-8e1bded3.entry.js +0 -4
- package/dist/ionic/p-97c65aa5.js +0 -4
- package/dist/ionic/p-9ab6f3e6.system.js +0 -4
- package/dist/ionic/p-9b89cbde.js +0 -4
- package/dist/ionic/p-a5c1e6ce.entry.js +0 -4
- package/dist/ionic/p-af016cd3.entry.js +0 -4
- package/dist/ionic/p-b0cee324.entry.js +0 -4
- package/dist/ionic/p-b1142133.entry.js +0 -4
- package/dist/ionic/p-b17b7c3c.system.entry.js +0 -4
- package/dist/ionic/p-b203659a.system.entry.js +0 -4
- package/dist/ionic/p-b6f8ee31.entry.js +0 -4
- package/dist/ionic/p-b906c5ca.entry.js +0 -4
- package/dist/ionic/p-b912e055.system.js +0 -4
- package/dist/ionic/p-c224b9a9.js +0 -5
- package/dist/ionic/p-ca5219df.entry.js +0 -4
- package/dist/ionic/p-cc196b34.js +0 -4
- package/dist/ionic/p-d1de1188.js +0 -4
- package/dist/ionic/p-d3952bd5.system.entry.js +0 -4
- package/dist/ionic/p-dfa756ed.system.js +0 -4
- package/dist/ionic/p-e6b240a0.js +0 -4
- package/dist/ionic/p-e8400078.system.entry.js +0 -4
- package/dist/ionic/p-f8e620f1.entry.js +0 -4
- package/dist/ionic/p-ff5a10f9.system.js +0 -4
- /package/dist/esm-es5/{config-96c9ace3.js → config-49c88215.js} +0 -0
- /package/dist/esm-es5/{cubic-bezier-66542bc5.js → cubic-bezier-fe2083dc.js} +0 -0
- /package/dist/esm-es5/{dir-912e3e13.js → dir-babeabeb.js} +0 -0
- /package/dist/esm-es5/{focus-visible-85493433.js → focus-visible-dd40d69f.js} +0 -0
- /package/dist/esm-es5/{gesture-controller-0fa396c4.js → gesture-controller-1bf57181.js} +0 -0
- /package/dist/esm-es5/{hardware-back-button-39299f84.js → hardware-back-button-b2bc76db.js} +0 -0
- /package/dist/esm-es5/{helpers-3379ba19.js → helpers-ae653409.js} +0 -0
- /package/dist/esm-es5/{index-595d62c9.js → index-9b0d46f4.js} +0 -0
- /package/dist/esm-es5/{index-7a14ecec.js → index-a5d50daf.js} +0 -0
- /package/dist/esm-es5/{lock-controller-e8c6c051.js → lock-controller-316928be.js} +0 -0
- /package/dist/esm-es5/{spinner-configs-d09fbbbb.js → spinner-configs-964f7cf3.js} +0 -0
- /package/dist/esm-es5/{theme-17531cdf.js → theme-01f3f29c.js} +0 -0
- /package/dist/esm-es5/{watch-options-02d8498b.js → watch-options-c2911ace.js} +0 -0
- /package/dist/ionic/{p-5aac9314.system.js → p-012c3ceb.system.js} +0 -0
- /package/dist/ionic/{p-1b8e1d03.js → p-06fee233.js} +0 -0
- /package/dist/ionic/{p-819ff3b9.system.js → p-08e01816.system.js} +0 -0
- /package/dist/ionic/{p-63eb0acd.js → p-23a9d086.js} +0 -0
- /package/dist/ionic/{p-7c2bac85.js → p-2408c236.js} +0 -0
- /package/dist/ionic/{p-815c2fba.system.js → p-32ad210f.system.js} +0 -0
- /package/dist/ionic/{p-7b021525.js → p-41d5544e.js} +0 -0
- /package/dist/ionic/{p-f10de93b.js → p-459d13d5.js} +0 -0
- /package/dist/ionic/{p-44bc8b45.system.js → p-4609d030.system.js} +0 -0
- /package/dist/ionic/{p-1d072d3d.js → p-47794def.js} +0 -0
- /package/dist/ionic/{p-185e427e.js → p-4b3623da.js} +0 -0
- /package/dist/ionic/{p-772f6c84.system.js → p-4f255d5a.system.js} +0 -0
- /package/dist/ionic/{p-8c15eda7.system.js → p-790220fd.system.js} +0 -0
- /package/dist/ionic/{p-0e94957a.system.js → p-792919fd.system.js} +0 -0
- /package/dist/ionic/{p-b347cfd1.js → p-7b30edcc.js} +0 -0
- /package/dist/ionic/{p-e0b06b65.js → p-bb3615f7.js} +0 -0
- /package/dist/ionic/{p-87411e39.system.js → p-c468af8a.system.js} +0 -0
- /package/dist/ionic/{p-9e852ff1.system.js → p-c7c8429a.system.js} +0 -0
- /package/dist/ionic/{p-53b2a46f.js → p-ccd02320.js} +0 -0
- /package/dist/ionic/{p-76fce40e.js → p-d47265c8.js} +0 -0
- /package/dist/ionic/{p-56dc022e.system.js → p-d8d84afa.system.js} +0 -0
- /package/dist/ionic/{p-c4f2dce7.system.js → p-e673a0a2.system.js} +0 -0
- /package/dist/ionic/{p-c18d6eac.js → p-f0c2a614.js} +0 -0
- /package/dist/ionic/{p-2b89ea1b.system.js → p-f233f1e0.system.js} +0 -0
- /package/dist/ionic/{p-6dbfe5d4.js → p-fb813dab.js} +0 -0
- /package/dist/ionic/{p-479cdbf8.system.js → p-ff4b7e40.system.js} +0 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { r as registerInstance, d as createEvent, w as writeTask, h, H as Host, f as getElement } from './index-
|
|
5
|
-
import { startFocusVisible } from './focus-visible-
|
|
6
|
-
import { r as raf, d as renderHiddenInput, g as getElementRoot, l as clamp } from './helpers-
|
|
7
|
-
import { a as printIonError, p as printIonWarning } from './index-
|
|
8
|
-
import { i as isRTL } from './dir-
|
|
9
|
-
import { c as createColorClasses, g as getClassMap } from './theme-
|
|
4
|
+
import { r as registerInstance, d as createEvent, w as writeTask, h, H as Host, f as getElement } from './index-08d686eb.js';
|
|
5
|
+
import { startFocusVisible } from './focus-visible-dd40d69f.js';
|
|
6
|
+
import { r as raf, d as renderHiddenInput, g as getElementRoot, l as clamp } from './helpers-ae653409.js';
|
|
7
|
+
import { a as printIonError, p as printIonWarning } from './index-9b0d46f4.js';
|
|
8
|
+
import { i as isRTL } from './dir-babeabeb.js';
|
|
9
|
+
import { c as createColorClasses, g as getClassMap } from './theme-01f3f29c.js';
|
|
10
10
|
import { c as chevronBack, o as chevronForward, l as chevronDown, p as caretUpSharp, q as caretDownSharp } from './index-c132c5f1.js';
|
|
11
|
-
import { b as getIonMode } from './ionic-global-
|
|
12
|
-
import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getEndOfWeek, j as getStartOfWeek, k as getPreviousDay, l as getNextDay, m as getPreviousWeek, n as getNextWeek, p as parseMinParts, o as parseMaxParts, q as parseDate, w as warnIfValueOutOfBounds, r as convertToArrayOfNumbers, s as convertDataToISO, t as getToday, u as getClosestValidDate, x as getNumDaysInMonth, y as getCombinedDateColumnData, z as getMonthColumnData, A as getDayColumnData, B as getYearColumnData, C as isMonthFirstLocale, D as getTimeColumnsData, E as isLocaleDayPeriodRTL, F as getDaysOfWeek, G as getMonthAndYear, H as getDaysOfMonth, I as generateMonths, J as getHourCycle, K as getLocalizedTime, L as getMonthAndDay, M as formatValue, N as getNextYear, O as getPreviousYear, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-
|
|
13
|
-
import { c as createLockController } from './lock-controller-
|
|
14
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
15
|
-
import { c as createAnimation } from './animation-
|
|
16
|
-
import { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-
|
|
17
|
-
import './index-
|
|
18
|
-
import './framework-delegate-
|
|
19
|
-
import './hardware-back-button-
|
|
20
|
-
import './capacitor-
|
|
11
|
+
import { b as getIonMode } from './ionic-global-c0cda98e.js';
|
|
12
|
+
import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getEndOfWeek, j as getStartOfWeek, k as getPreviousDay, l as getNextDay, m as getPreviousWeek, n as getNextWeek, p as parseMinParts, o as parseMaxParts, q as parseDate, w as warnIfValueOutOfBounds, r as convertToArrayOfNumbers, s as convertDataToISO, t as getToday, u as getClosestValidDate, x as getNumDaysInMonth, y as getCombinedDateColumnData, z as getMonthColumnData, A as getDayColumnData, B as getYearColumnData, C as isMonthFirstLocale, D as getTimeColumnsData, E as isLocaleDayPeriodRTL, F as getDaysOfWeek, G as getMonthAndYear, H as getDaysOfMonth, I as generateMonths, J as getHourCycle, K as getLocalizedTime, L as getMonthAndDay, M as formatValue, N as getNextYear, O as getPreviousYear, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-f5c75b4e.js';
|
|
13
|
+
import { c as createLockController } from './lock-controller-316928be.js';
|
|
14
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-32ef481d.js';
|
|
15
|
+
import { c as createAnimation } from './animation-dde8cc0d.js';
|
|
16
|
+
import { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-554688a5.js';
|
|
17
|
+
import './index-a5d50daf.js';
|
|
18
|
+
import './framework-delegate-bc1fd82a.js';
|
|
19
|
+
import './hardware-back-button-b2bc76db.js';
|
|
20
|
+
import './capacitor-59395cbd.js';
|
|
21
21
|
|
|
22
22
|
const isYearDisabled = (refYear, minParts, maxParts) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
if (minParts && minParts.year > refYear) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (maxParts && maxParts.year < refYear) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* Returns true if a given day should
|
|
@@ -34,104 +34,104 @@ const isYearDisabled = (refYear, minParts, maxParts) => {
|
|
|
34
34
|
* or the max/min dates.
|
|
35
35
|
*/
|
|
36
36
|
const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
37
|
+
/**
|
|
38
|
+
* If this is a filler date (i.e. padding)
|
|
39
|
+
* then the date is disabled.
|
|
40
|
+
*/
|
|
41
|
+
if (refParts.day === null) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* If user passed in a list of acceptable day values
|
|
46
|
+
* check to make sure that the date we are looking
|
|
47
|
+
* at is in this array.
|
|
48
|
+
*/
|
|
49
|
+
if (dayValues !== undefined && !dayValues.includes(refParts.day)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Given a min date, perform the following
|
|
54
|
+
* checks. If any of them are true, then the
|
|
55
|
+
* day should be disabled:
|
|
56
|
+
* 1. Is the current year < the min allowed year?
|
|
57
|
+
* 2. Is the current year === min allowed year,
|
|
58
|
+
* but the current month < the min allowed month?
|
|
59
|
+
* 3. Is the current year === min allowed year, the
|
|
60
|
+
* current month === min allow month, but the current
|
|
61
|
+
* day < the min allowed day?
|
|
62
|
+
*/
|
|
63
|
+
if (minParts && isBefore(refParts, minParts)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Given a max date, perform the following
|
|
68
|
+
* checks. If any of them are true, then the
|
|
69
|
+
* day should be disabled:
|
|
70
|
+
* 1. Is the current year > the max allowed year?
|
|
71
|
+
* 2. Is the current year === max allowed year,
|
|
72
|
+
* but the current month > the max allowed month?
|
|
73
|
+
* 3. Is the current year === max allowed year, the
|
|
74
|
+
* current month === max allow month, but the current
|
|
75
|
+
* day > the max allowed day?
|
|
76
|
+
*/
|
|
77
|
+
if (maxParts && isAfter(refParts, maxParts)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* If none of these checks
|
|
82
|
+
* passed then the date should
|
|
83
|
+
* be interactive.
|
|
84
|
+
*/
|
|
85
|
+
return false;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
88
|
* Given a locale, a date, the selected date(s), and today's date,
|
|
89
89
|
* generate the state for a given calendar day button.
|
|
90
90
|
*/
|
|
91
91
|
const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
92
|
+
/**
|
|
93
|
+
* activeParts signals what day(s) are currently selected in the datetime.
|
|
94
|
+
* If multiple="true", this will be an array, but the logic in this util
|
|
95
|
+
* is the same whether we have one selected day or many because we're only
|
|
96
|
+
* calculating the state for one button. So, we treat a single activeParts value
|
|
97
|
+
* the same as an array of length one.
|
|
98
|
+
*/
|
|
99
|
+
const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
|
|
100
|
+
/**
|
|
101
|
+
* The day button is active if it is selected, or in other words, if refParts
|
|
102
|
+
* matches at least one selected date.
|
|
103
|
+
*/
|
|
104
|
+
const isActive = activePartsArray.find((parts) => isSameDay(refParts, parts)) !== undefined;
|
|
105
|
+
const isToday = isSameDay(refParts, todayParts);
|
|
106
|
+
const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
|
|
107
|
+
/**
|
|
108
|
+
* Note that we always return one object regardless of whether activeParts
|
|
109
|
+
* was an array, since we pare down to one value for isActive.
|
|
110
|
+
*/
|
|
111
|
+
return {
|
|
112
|
+
disabled,
|
|
113
|
+
isActive,
|
|
114
|
+
isToday,
|
|
115
|
+
ariaSelected: isActive ? 'true' : null,
|
|
116
|
+
ariaLabel: generateDayAriaLabel(locale, isToday, refParts),
|
|
117
|
+
text: refParts.day != null ? getDay(locale, refParts) : null,
|
|
118
|
+
};
|
|
119
119
|
};
|
|
120
120
|
/**
|
|
121
121
|
* Returns `true` if the month is disabled given the
|
|
122
122
|
* current date value and min/max date constraints.
|
|
123
123
|
*/
|
|
124
124
|
const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
// If the year is disabled then the month is disabled.
|
|
126
|
+
if (isYearDisabled(refParts.year, minParts, maxParts)) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
// If the date value is before the min date, then the month is disabled.
|
|
130
|
+
// If the date value is after the max date, then the month is disabled.
|
|
131
|
+
if ((minParts && isBefore(refParts, minParts)) || (maxParts && isAfter(refParts, maxParts))) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
135
|
};
|
|
136
136
|
/**
|
|
137
137
|
* Given a working date, an optional minimum date range,
|
|
@@ -139,21 +139,21 @@ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
|
|
|
139
139
|
* previous navigation button is disabled.
|
|
140
140
|
*/
|
|
141
141
|
const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
const prevMonth = Object.assign(Object.assign({}, getPreviousMonth(refParts)), { day: null });
|
|
143
|
+
return isMonthDisabled(prevMonth, {
|
|
144
|
+
minParts,
|
|
145
|
+
maxParts,
|
|
146
|
+
});
|
|
147
147
|
};
|
|
148
148
|
/**
|
|
149
149
|
* Given a working date and a maximum date range,
|
|
150
150
|
* determine if the next navigation button is disabled.
|
|
151
151
|
*/
|
|
152
152
|
const isNextMonthDisabled = (refParts, maxParts) => {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
const nextMonth = Object.assign(Object.assign({}, getNextMonth(refParts)), { day: null });
|
|
154
|
+
return isMonthDisabled(nextMonth, {
|
|
155
|
+
maxParts,
|
|
156
|
+
});
|
|
157
157
|
};
|
|
158
158
|
/**
|
|
159
159
|
* Given the value of the highlightedDates property
|
|
@@ -161,1618 +161,1631 @@ const isNextMonthDisabled = (refParts, maxParts) => {
|
|
|
161
161
|
* that date, or undefined if none are found.
|
|
162
162
|
*/
|
|
163
163
|
const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
/**
|
|
176
|
-
* Wrap in a try-catch to prevent exceptions in the user's function
|
|
177
|
-
* from interrupting the calendar's rendering.
|
|
178
|
-
*/
|
|
179
|
-
try {
|
|
180
|
-
return highlightedDates(dateIsoString);
|
|
164
|
+
if (Array.isArray(highlightedDates)) {
|
|
165
|
+
const dateStringWithoutTime = dateIsoString.split('T')[0];
|
|
166
|
+
const matchingHighlight = highlightedDates.find((hd) => hd.date === dateStringWithoutTime);
|
|
167
|
+
if (matchingHighlight) {
|
|
168
|
+
return {
|
|
169
|
+
textColor: matchingHighlight.textColor,
|
|
170
|
+
backgroundColor: matchingHighlight.backgroundColor,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
181
173
|
}
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
else {
|
|
175
|
+
/**
|
|
176
|
+
* Wrap in a try-catch to prevent exceptions in the user's function
|
|
177
|
+
* from interrupting the calendar's rendering.
|
|
178
|
+
*/
|
|
179
|
+
try {
|
|
180
|
+
return highlightedDates(dateIsoString);
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
printIonError('Exception thrown from provided `highlightedDates` callback. Please check your function and try again.', el, e);
|
|
184
|
+
}
|
|
184
185
|
}
|
|
185
|
-
|
|
186
|
-
return undefined;
|
|
186
|
+
return undefined;
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
const datetimeIosCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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: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, #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 ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #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, #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}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}: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, #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)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{color:var(--ion-color-contrast)}: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, #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%}";
|
|
189
|
+
const datetimeIosCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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: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, #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 ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #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, #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}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}:host .calendar-action-buttons ion-item ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}: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, #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)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{color:var(--ion-color-contrast)}: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, #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%}";
|
|
190
190
|
|
|
191
|
-
const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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: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, #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 ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-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 .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, #595959)}: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, 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{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}: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, #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}";
|
|
191
|
+
const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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: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, #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 ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-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 .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, #595959)}: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, 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{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}: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, #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}";
|
|
192
192
|
|
|
193
193
|
const Datetime = class {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
194
|
+
constructor(hostRef) {
|
|
195
|
+
registerInstance(this, hostRef);
|
|
196
|
+
this.ionCancel = createEvent(this, "ionCancel", 7);
|
|
197
|
+
this.ionChange = createEvent(this, "ionChange", 7);
|
|
198
|
+
this.ionValueChange = createEvent(this, "ionValueChange", 7);
|
|
199
|
+
this.ionFocus = createEvent(this, "ionFocus", 7);
|
|
200
|
+
this.ionBlur = createEvent(this, "ionBlur", 7);
|
|
201
|
+
this.ionStyle = createEvent(this, "ionStyle", 7);
|
|
202
|
+
this.ionRender = createEvent(this, "ionRender", 7);
|
|
203
|
+
this.inputId = `ion-dt-${datetimeIds++}`;
|
|
204
|
+
this.prevPresentation = null;
|
|
205
|
+
this.warnIfIncorrectValueUsage = () => {
|
|
206
|
+
const { multiple, value } = this;
|
|
207
|
+
if (!multiple && Array.isArray(value)) {
|
|
208
|
+
/**
|
|
209
|
+
* We do some processing on the `value` array so
|
|
210
|
+
* that it looks more like an array when logged to
|
|
211
|
+
* the console.
|
|
212
|
+
* Example given ['a', 'b']
|
|
213
|
+
* Default toString() behavior: a,b
|
|
214
|
+
* Custom behavior: ['a', 'b']
|
|
215
|
+
*/
|
|
216
|
+
printIonWarning(`ion-datetime was passed an array of values, but multiple="false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".
|
|
217
217
|
|
|
218
218
|
Value Passed: [${value.map((v) => `'${v}'`).join(', ')}]
|
|
219
219
|
`, this.el);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
this.setValue = (value) => {
|
|
223
|
+
this.value = value;
|
|
224
|
+
this.ionChange.emit({ value });
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Returns the DatetimePart interface
|
|
228
|
+
* to use when rendering an initial set of
|
|
229
|
+
* data. This should be used when rendering an
|
|
230
|
+
* interface in an environment where the `value`
|
|
231
|
+
* may not be set. This function works
|
|
232
|
+
* by returning the first selected date and then
|
|
233
|
+
* falling back to defaultParts if no active date
|
|
234
|
+
* is selected.
|
|
235
|
+
*/
|
|
236
|
+
this.getActivePartsWithFallback = () => {
|
|
237
|
+
var _a;
|
|
238
|
+
const { defaultParts } = this;
|
|
239
|
+
return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
|
|
240
|
+
};
|
|
241
|
+
this.getActivePart = () => {
|
|
242
|
+
const { activeParts } = this;
|
|
243
|
+
return Array.isArray(activeParts) ? activeParts[0] : activeParts;
|
|
244
|
+
};
|
|
245
|
+
this.closeParentOverlay = () => {
|
|
246
|
+
const popoverOrModal = this.el.closest('ion-modal, ion-popover');
|
|
247
|
+
if (popoverOrModal) {
|
|
248
|
+
popoverOrModal.dismiss();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
this.setWorkingParts = (parts) => {
|
|
252
|
+
this.workingParts = Object.assign({}, parts);
|
|
253
|
+
};
|
|
254
|
+
this.setActiveParts = (parts, removeDate = false) => {
|
|
255
|
+
/** if the datetime component is in readonly mode,
|
|
256
|
+
* allow browsing of the calendar without changing
|
|
257
|
+
* the set value
|
|
258
|
+
*/
|
|
259
|
+
if (this.readonly) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const { multiple, minParts, maxParts, activeParts } = this;
|
|
263
|
+
/**
|
|
264
|
+
* When setting the active parts, it is possible
|
|
265
|
+
* to set invalid data. For example,
|
|
266
|
+
* when updating January 31 to February,
|
|
267
|
+
* February 31 does not exist. As a result
|
|
268
|
+
* we need to validate the active parts and
|
|
269
|
+
* ensure that we are only setting valid dates.
|
|
270
|
+
* Additionally, we need to update the working parts
|
|
271
|
+
* too in the event that the validated parts are different.
|
|
272
|
+
*/
|
|
273
|
+
const validatedParts = validateParts(parts, minParts, maxParts);
|
|
274
|
+
this.setWorkingParts(validatedParts);
|
|
275
|
+
if (multiple) {
|
|
276
|
+
const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
|
|
277
|
+
if (removeDate) {
|
|
278
|
+
this.activeParts = activePartsArray.filter((p) => !isSameDay(p, validatedParts));
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
this.activeParts = [...activePartsArray, validatedParts];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
this.activeParts = Object.assign({}, validatedParts);
|
|
286
|
+
}
|
|
287
|
+
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
|
|
288
|
+
if (hasSlottedButtons || this.showDefaultButtons) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.confirm();
|
|
292
|
+
};
|
|
293
|
+
this.initializeKeyboardListeners = () => {
|
|
294
|
+
const calendarBodyRef = this.calendarBodyRef;
|
|
295
|
+
if (!calendarBodyRef) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const root = this.el.shadowRoot;
|
|
299
|
+
/**
|
|
300
|
+
* Get a reference to the month
|
|
301
|
+
* element we are currently viewing.
|
|
302
|
+
*/
|
|
303
|
+
const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
|
|
304
|
+
/**
|
|
305
|
+
* When focusing the calendar body, we want to pass focus
|
|
306
|
+
* to the working day, but other days should
|
|
307
|
+
* only be accessible using the arrow keys. Pressing
|
|
308
|
+
* Tab should jump between bodies of selectable content.
|
|
309
|
+
*/
|
|
310
|
+
const checkCalendarBodyFocus = (ev) => {
|
|
311
|
+
var _a;
|
|
312
|
+
const record = ev[0];
|
|
313
|
+
/**
|
|
314
|
+
* If calendar body was already focused
|
|
315
|
+
* when this fired or if the calendar body
|
|
316
|
+
* if not currently focused, we should not re-focus
|
|
317
|
+
* the inner day.
|
|
318
|
+
*/
|
|
319
|
+
if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
this.focusWorkingDay(currentMonth);
|
|
323
|
+
};
|
|
324
|
+
const mo = new MutationObserver(checkCalendarBodyFocus);
|
|
325
|
+
mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
|
|
326
|
+
this.destroyKeyboardMO = () => {
|
|
327
|
+
mo === null || mo === void 0 ? void 0 : mo.disconnect();
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* We must use keydown not keyup as we want
|
|
331
|
+
* to prevent scrolling when using the arrow keys.
|
|
332
|
+
*/
|
|
333
|
+
calendarBodyRef.addEventListener('keydown', (ev) => {
|
|
334
|
+
const activeElement = root.activeElement;
|
|
335
|
+
if (!activeElement || !activeElement.classList.contains('calendar-day')) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const parts = getPartsFromCalendarDay(activeElement);
|
|
339
|
+
let partsToFocus;
|
|
340
|
+
switch (ev.key) {
|
|
341
|
+
case 'ArrowDown':
|
|
342
|
+
ev.preventDefault();
|
|
343
|
+
partsToFocus = getNextWeek(parts);
|
|
344
|
+
break;
|
|
345
|
+
case 'ArrowUp':
|
|
346
|
+
ev.preventDefault();
|
|
347
|
+
partsToFocus = getPreviousWeek(parts);
|
|
348
|
+
break;
|
|
349
|
+
case 'ArrowRight':
|
|
350
|
+
ev.preventDefault();
|
|
351
|
+
partsToFocus = getNextDay(parts);
|
|
352
|
+
break;
|
|
353
|
+
case 'ArrowLeft':
|
|
354
|
+
ev.preventDefault();
|
|
355
|
+
partsToFocus = getPreviousDay(parts);
|
|
356
|
+
break;
|
|
357
|
+
case 'Home':
|
|
358
|
+
ev.preventDefault();
|
|
359
|
+
partsToFocus = getStartOfWeek(parts);
|
|
360
|
+
break;
|
|
361
|
+
case 'End':
|
|
362
|
+
ev.preventDefault();
|
|
363
|
+
partsToFocus = getEndOfWeek(parts);
|
|
364
|
+
break;
|
|
365
|
+
case 'PageUp':
|
|
366
|
+
ev.preventDefault();
|
|
367
|
+
partsToFocus = ev.shiftKey ? getPreviousYear(parts) : getPreviousMonth(parts);
|
|
368
|
+
break;
|
|
369
|
+
case 'PageDown':
|
|
370
|
+
ev.preventDefault();
|
|
371
|
+
partsToFocus = ev.shiftKey ? getNextYear(parts) : getNextMonth(parts);
|
|
372
|
+
break;
|
|
373
|
+
/**
|
|
374
|
+
* Do not preventDefault here
|
|
375
|
+
* as we do not want to override other
|
|
376
|
+
* browser defaults such as pressing Enter/Space
|
|
377
|
+
* to select a day.
|
|
378
|
+
*/
|
|
379
|
+
default:
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* If the day we want to move focus to is
|
|
384
|
+
* disabled, do not do anything.
|
|
385
|
+
*/
|
|
386
|
+
if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
|
|
390
|
+
/**
|
|
391
|
+
* Give view a chance to re-render
|
|
392
|
+
* then move focus to the new working day
|
|
393
|
+
*/
|
|
394
|
+
requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
this.focusWorkingDay = (currentMonth) => {
|
|
398
|
+
/**
|
|
399
|
+
* Get the number of padding days so
|
|
400
|
+
* we know how much to offset our next selector by
|
|
401
|
+
* to grab the correct calendar-day element.
|
|
402
|
+
*/
|
|
403
|
+
const padding = currentMonth.querySelectorAll('.calendar-day-padding');
|
|
404
|
+
const { day } = this.workingParts;
|
|
405
|
+
if (day === null) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Get the calendar day element
|
|
410
|
+
* and focus it.
|
|
411
|
+
*/
|
|
412
|
+
const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${padding.length + day}) .calendar-day`);
|
|
413
|
+
if (dayEl) {
|
|
414
|
+
dayEl.focus();
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
this.processMinParts = () => {
|
|
418
|
+
const { min, defaultParts } = this;
|
|
419
|
+
if (min === undefined) {
|
|
420
|
+
this.minParts = undefined;
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
this.minParts = parseMinParts(min, defaultParts);
|
|
424
|
+
};
|
|
425
|
+
this.processMaxParts = () => {
|
|
426
|
+
const { max, defaultParts } = this;
|
|
427
|
+
if (max === undefined) {
|
|
428
|
+
this.maxParts = undefined;
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
this.maxParts = parseMaxParts(max, defaultParts);
|
|
432
|
+
};
|
|
433
|
+
this.initializeCalendarListener = () => {
|
|
434
|
+
const calendarBodyRef = this.calendarBodyRef;
|
|
435
|
+
if (!calendarBodyRef) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* For performance reasons, we only render 3
|
|
440
|
+
* months at a time: The current month, the previous
|
|
441
|
+
* month, and the next month. We have a scroll listener
|
|
442
|
+
* on the calendar body to append/prepend new months.
|
|
443
|
+
*
|
|
444
|
+
* We can do this because Stencil is smart enough to not
|
|
445
|
+
* re-create the .calendar-month containers, but rather
|
|
446
|
+
* update the content within those containers.
|
|
447
|
+
*
|
|
448
|
+
* As an added bonus, WebKit has some troubles with
|
|
449
|
+
* scroll-snap-stop: always, so not rendering all of
|
|
450
|
+
* the months in a row allows us to mostly sidestep
|
|
451
|
+
* that issue.
|
|
452
|
+
*/
|
|
453
|
+
const months = calendarBodyRef.querySelectorAll('.calendar-month');
|
|
454
|
+
const startMonth = months[0];
|
|
455
|
+
const workingMonth = months[1];
|
|
456
|
+
const endMonth = months[2];
|
|
457
|
+
const mode = getIonMode(this);
|
|
458
|
+
const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
|
|
459
|
+
/**
|
|
460
|
+
* Before setting up the scroll listener,
|
|
461
|
+
* scroll the middle month into view.
|
|
462
|
+
* scrollIntoView() will scroll entire page
|
|
463
|
+
* if element is not in viewport. Use scrollLeft instead.
|
|
464
|
+
*/
|
|
465
|
+
writeTask(() => {
|
|
466
|
+
calendarBodyRef.scrollLeft = startMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
467
|
+
const getChangedMonth = (parts) => {
|
|
468
|
+
const box = calendarBodyRef.getBoundingClientRect();
|
|
469
|
+
/**
|
|
470
|
+
* If the current scroll position is all the way to the left
|
|
471
|
+
* then we have scrolled to the previous month.
|
|
472
|
+
* Otherwise, assume that we have scrolled to the next
|
|
473
|
+
* month. We have a tolerance of 2px to account for
|
|
474
|
+
* sub pixel rendering.
|
|
475
|
+
*
|
|
476
|
+
* Check below the next line ensures that we did not
|
|
477
|
+
* swipe and abort (i.e. we swiped but we are still on the current month).
|
|
478
|
+
*/
|
|
479
|
+
const month = calendarBodyRef.scrollLeft <= 2 ? startMonth : endMonth;
|
|
480
|
+
/**
|
|
481
|
+
* The edge of the month must be lined up with
|
|
482
|
+
* the edge of the calendar body in order for
|
|
483
|
+
* the component to update. Otherwise, it
|
|
484
|
+
* may be the case that the user has paused their
|
|
485
|
+
* swipe or the browser has not finished snapping yet.
|
|
486
|
+
* Rather than check if the x values are equal,
|
|
487
|
+
* we give it a tolerance of 2px to account for
|
|
488
|
+
* sub pixel rendering.
|
|
489
|
+
*/
|
|
490
|
+
const monthBox = month.getBoundingClientRect();
|
|
491
|
+
if (Math.abs(monthBox.x - box.x) > 2)
|
|
492
|
+
return;
|
|
493
|
+
/**
|
|
494
|
+
* If we're force-rendering a month, assume we've
|
|
495
|
+
* scrolled to that and return it.
|
|
496
|
+
*
|
|
497
|
+
* If forceRenderDate is ever used in a context where the
|
|
498
|
+
* forced month is not immediately auto-scrolled to, this
|
|
499
|
+
* should be updated to also check whether `month` has the
|
|
500
|
+
* same month and year as the forced date.
|
|
501
|
+
*/
|
|
502
|
+
const { forceRenderDate } = this;
|
|
503
|
+
if (forceRenderDate !== undefined) {
|
|
504
|
+
return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* From here, we can determine if the start
|
|
508
|
+
* month or the end month was scrolled into view.
|
|
509
|
+
* If no month was changed, then we can return from
|
|
510
|
+
* the scroll callback early.
|
|
511
|
+
*/
|
|
512
|
+
if (month === startMonth) {
|
|
513
|
+
return getPreviousMonth(parts);
|
|
514
|
+
}
|
|
515
|
+
else if (month === endMonth) {
|
|
516
|
+
return getNextMonth(parts);
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
const updateActiveMonth = () => {
|
|
523
|
+
if (needsiOSRubberBandFix) {
|
|
524
|
+
calendarBodyRef.style.removeProperty('pointer-events');
|
|
525
|
+
appliediOSRubberBandFix = false;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* If the month did not change
|
|
529
|
+
* then we can return early.
|
|
530
|
+
*/
|
|
531
|
+
const newDate = getChangedMonth(this.workingParts);
|
|
532
|
+
if (!newDate)
|
|
533
|
+
return;
|
|
534
|
+
const { month, day, year } = newDate;
|
|
535
|
+
if (isMonthDisabled({ month, year, day: null }, {
|
|
536
|
+
minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
|
|
537
|
+
maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
|
|
538
|
+
})) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Prevent scrolling for other browsers
|
|
543
|
+
* to give the DOM time to update and the container
|
|
544
|
+
* time to properly snap.
|
|
545
|
+
*/
|
|
546
|
+
calendarBodyRef.style.setProperty('overflow', 'hidden');
|
|
547
|
+
/**
|
|
548
|
+
* Use a writeTask here to ensure
|
|
549
|
+
* that the state is updated and the
|
|
550
|
+
* correct month is scrolled into view
|
|
551
|
+
* in the same frame. This is not
|
|
552
|
+
* typically a problem on newer devices
|
|
553
|
+
* but older/slower device may have a flicker
|
|
554
|
+
* if we did not do this.
|
|
555
|
+
*/
|
|
556
|
+
writeTask(() => {
|
|
557
|
+
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
|
|
558
|
+
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
559
|
+
calendarBodyRef.style.removeProperty('overflow');
|
|
560
|
+
if (this.resolveForceDateScrolling) {
|
|
561
|
+
this.resolveForceDateScrolling();
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* When the container finishes scrolling we
|
|
567
|
+
* need to update the DOM with the selected month.
|
|
568
|
+
*/
|
|
569
|
+
let scrollTimeout;
|
|
570
|
+
/**
|
|
571
|
+
* We do not want to attempt to set pointer-events
|
|
572
|
+
* multiple times within a single swipe gesture as
|
|
573
|
+
* that adds unnecessary work to the main thread.
|
|
574
|
+
*/
|
|
575
|
+
let appliediOSRubberBandFix = false;
|
|
576
|
+
const scrollCallback = () => {
|
|
577
|
+
if (scrollTimeout) {
|
|
578
|
+
clearTimeout(scrollTimeout);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* On iOS it is possible to quickly rubber band
|
|
582
|
+
* the scroll area before the scroll timeout has fired.
|
|
583
|
+
* This results in users reaching the end of the scrollable
|
|
584
|
+
* container before the DOM has updated.
|
|
585
|
+
* By setting `pointer-events: none` we can ensure that
|
|
586
|
+
* subsequent swipes do not happen while the container
|
|
587
|
+
* is snapping.
|
|
588
|
+
*/
|
|
589
|
+
if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
|
|
590
|
+
calendarBodyRef.style.setProperty('pointer-events', 'none');
|
|
591
|
+
appliediOSRubberBandFix = true;
|
|
592
|
+
}
|
|
593
|
+
// Wait ~3 frames
|
|
594
|
+
scrollTimeout = setTimeout(updateActiveMonth, 50);
|
|
595
|
+
};
|
|
596
|
+
calendarBodyRef.addEventListener('scroll', scrollCallback);
|
|
597
|
+
this.destroyCalendarListener = () => {
|
|
598
|
+
calendarBodyRef.removeEventListener('scroll', scrollCallback);
|
|
599
|
+
};
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
/**
|
|
603
|
+
* Clean up all listeners except for the overlay
|
|
604
|
+
* listener. This is so that we can re-create the listeners
|
|
605
|
+
* if the datetime has been hidden/presented by a modal or popover.
|
|
606
|
+
*/
|
|
607
|
+
this.destroyInteractionListeners = () => {
|
|
608
|
+
const { destroyCalendarListener, destroyKeyboardMO } = this;
|
|
609
|
+
if (destroyCalendarListener !== undefined) {
|
|
610
|
+
destroyCalendarListener();
|
|
611
|
+
}
|
|
612
|
+
if (destroyKeyboardMO !== undefined) {
|
|
613
|
+
destroyKeyboardMO();
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
this.processValue = (value) => {
|
|
617
|
+
const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
|
|
618
|
+
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
|
|
619
|
+
const { minParts, maxParts, workingParts, el } = this;
|
|
620
|
+
this.warnIfIncorrectValueUsage();
|
|
621
|
+
/**
|
|
622
|
+
* Return early if the value wasn't parsed correctly, such as
|
|
623
|
+
* if an improperly formatted date string was provided.
|
|
624
|
+
*/
|
|
625
|
+
if (!valueToProcess) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Datetime should only warn of out of bounds values
|
|
630
|
+
* if set by the user. If the `value` is undefined,
|
|
631
|
+
* we will default to today's date which may be out
|
|
632
|
+
* of bounds. In this case, the warning makes it look
|
|
633
|
+
* like the developer did something wrong which is
|
|
634
|
+
* not true.
|
|
635
|
+
*/
|
|
636
|
+
if (hasValue) {
|
|
637
|
+
warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* If there are multiple values, pick an arbitrary one to clamp to. This way,
|
|
641
|
+
* if the values are across months, we always show at least one of them. Note
|
|
642
|
+
* that the values don't necessarily have to be in order.
|
|
643
|
+
*/
|
|
644
|
+
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
|
|
645
|
+
const targetValue = clampDate(singleValue, minParts, maxParts);
|
|
646
|
+
const { month, day, year, hour, minute } = targetValue;
|
|
647
|
+
const ampm = parseAmPm(hour);
|
|
648
|
+
/**
|
|
649
|
+
* Since `activeParts` indicates a value that
|
|
650
|
+
* been explicitly selected either by the
|
|
651
|
+
* user or the app, only update `activeParts`
|
|
652
|
+
* if the `value` property is set.
|
|
653
|
+
*/
|
|
654
|
+
if (hasValue) {
|
|
655
|
+
if (Array.isArray(valueToProcess)) {
|
|
656
|
+
this.activeParts = [...valueToProcess];
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
this.activeParts = {
|
|
660
|
+
month,
|
|
661
|
+
day,
|
|
662
|
+
year,
|
|
663
|
+
hour,
|
|
664
|
+
minute,
|
|
665
|
+
ampm,
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
/**
|
|
671
|
+
* Reset the active parts if the value is not set.
|
|
672
|
+
* This will clear the selected calendar day when
|
|
673
|
+
* performing a clear action or using the reset() method.
|
|
674
|
+
*/
|
|
675
|
+
this.activeParts = [];
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Only animate if:
|
|
679
|
+
* 1. We're using grid style (wheel style pickers should just jump to new value)
|
|
680
|
+
* 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
|
|
681
|
+
* 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
|
|
682
|
+
* 4. The month/year picker is not open (since you wouldn't see the animation anyway)
|
|
683
|
+
*/
|
|
684
|
+
const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
|
|
685
|
+
const bodyIsVisible = el.classList.contains('datetime-ready');
|
|
686
|
+
const { isGridStyle, showMonthAndYear } = this;
|
|
687
|
+
if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
|
|
688
|
+
this.animateToDate(targetValue);
|
|
689
|
+
}
|
|
690
|
+
else {
|
|
691
|
+
/**
|
|
692
|
+
* We only need to do this if we didn't just animate to a new month,
|
|
693
|
+
* since that calls prevMonth/nextMonth which calls setWorkingParts for us.
|
|
694
|
+
*/
|
|
695
|
+
this.setWorkingParts({
|
|
696
|
+
month,
|
|
697
|
+
day,
|
|
698
|
+
year,
|
|
699
|
+
hour,
|
|
700
|
+
minute,
|
|
701
|
+
ampm,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
this.animateToDate = async (targetValue) => {
|
|
706
|
+
const { workingParts } = this;
|
|
707
|
+
/**
|
|
708
|
+
* Tell other render functions that we need to force the
|
|
709
|
+
* target month to appear in place of the actual next/prev month.
|
|
710
|
+
* Because this is a State variable, a rerender will be triggered
|
|
711
|
+
* automatically, updating the rendered months.
|
|
712
|
+
*/
|
|
713
|
+
this.forceRenderDate = targetValue;
|
|
714
|
+
/**
|
|
715
|
+
* Flag that we've started scrolling to the forced date.
|
|
716
|
+
* The resolve function will be called by the datetime's
|
|
717
|
+
* scroll listener when it's done updating everything.
|
|
718
|
+
* This is a replacement for making prev/nextMonth async,
|
|
719
|
+
* since the logic we're waiting on is in a listener.
|
|
720
|
+
*/
|
|
721
|
+
const forceDateScrollingPromise = new Promise((resolve) => {
|
|
722
|
+
this.resolveForceDateScrolling = resolve;
|
|
723
|
+
});
|
|
724
|
+
/**
|
|
725
|
+
* Animate smoothly to the forced month. This will also update
|
|
726
|
+
* workingParts and correct the surrounding months for us.
|
|
727
|
+
*/
|
|
728
|
+
const targetMonthIsBefore = isBefore(targetValue, workingParts);
|
|
729
|
+
targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
|
|
730
|
+
await forceDateScrollingPromise;
|
|
731
|
+
this.resolveForceDateScrolling = undefined;
|
|
732
|
+
this.forceRenderDate = undefined;
|
|
733
|
+
};
|
|
734
|
+
this.onFocus = () => {
|
|
735
|
+
this.ionFocus.emit();
|
|
736
|
+
};
|
|
737
|
+
this.onBlur = () => {
|
|
738
|
+
this.ionBlur.emit();
|
|
739
|
+
};
|
|
740
|
+
this.hasValue = () => {
|
|
741
|
+
return this.value != null;
|
|
742
|
+
};
|
|
743
|
+
this.nextMonth = () => {
|
|
744
|
+
const calendarBodyRef = this.calendarBodyRef;
|
|
745
|
+
if (!calendarBodyRef) {
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
|
|
749
|
+
if (!nextMonth) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const left = nextMonth.offsetWidth * 2;
|
|
753
|
+
calendarBodyRef.scrollTo({
|
|
754
|
+
top: 0,
|
|
755
|
+
left: left * (isRTL(this.el) ? -1 : 1),
|
|
756
|
+
behavior: 'smooth',
|
|
757
|
+
});
|
|
758
|
+
};
|
|
759
|
+
this.prevMonth = () => {
|
|
760
|
+
const calendarBodyRef = this.calendarBodyRef;
|
|
761
|
+
if (!calendarBodyRef) {
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
|
|
765
|
+
if (!prevMonth) {
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
calendarBodyRef.scrollTo({
|
|
769
|
+
top: 0,
|
|
770
|
+
left: 0,
|
|
771
|
+
behavior: 'smooth',
|
|
772
|
+
});
|
|
773
|
+
};
|
|
774
|
+
this.toggleMonthAndYearView = () => {
|
|
775
|
+
this.showMonthAndYear = !this.showMonthAndYear;
|
|
776
|
+
};
|
|
777
|
+
this.showMonthAndYear = false;
|
|
778
|
+
this.activeParts = [];
|
|
779
|
+
this.workingParts = {
|
|
780
|
+
month: 5,
|
|
781
|
+
day: 28,
|
|
782
|
+
year: 2021,
|
|
783
|
+
hour: 13,
|
|
784
|
+
minute: 52,
|
|
785
|
+
ampm: 'pm',
|
|
786
|
+
};
|
|
787
|
+
this.isTimePopoverOpen = false;
|
|
788
|
+
this.forceRenderDate = undefined;
|
|
789
|
+
this.color = 'primary';
|
|
790
|
+
this.name = this.inputId;
|
|
791
|
+
this.disabled = false;
|
|
792
|
+
this.readonly = false;
|
|
793
|
+
this.isDateEnabled = undefined;
|
|
794
|
+
this.min = undefined;
|
|
795
|
+
this.max = undefined;
|
|
796
|
+
this.presentation = 'date-time';
|
|
797
|
+
this.cancelText = 'Cancel';
|
|
798
|
+
this.doneText = 'Done';
|
|
799
|
+
this.clearText = 'Clear';
|
|
800
|
+
this.yearValues = undefined;
|
|
801
|
+
this.monthValues = undefined;
|
|
802
|
+
this.dayValues = undefined;
|
|
803
|
+
this.hourValues = undefined;
|
|
804
|
+
this.minuteValues = undefined;
|
|
805
|
+
this.locale = 'default';
|
|
806
|
+
this.firstDayOfWeek = 0;
|
|
807
|
+
this.titleSelectedDatesFormatter = undefined;
|
|
808
|
+
this.multiple = false;
|
|
809
|
+
this.highlightedDates = undefined;
|
|
810
|
+
this.value = undefined;
|
|
811
|
+
this.showDefaultTitle = false;
|
|
812
|
+
this.showDefaultButtons = false;
|
|
813
|
+
this.showClearButton = false;
|
|
814
|
+
this.showDefaultTimeLabel = true;
|
|
815
|
+
this.hourCycle = undefined;
|
|
816
|
+
this.size = 'fixed';
|
|
817
|
+
this.preferWheel = false;
|
|
818
|
+
}
|
|
819
|
+
disabledChanged() {
|
|
820
|
+
this.emitStyle();
|
|
821
|
+
}
|
|
822
|
+
minChanged() {
|
|
823
|
+
this.processMinParts();
|
|
824
|
+
}
|
|
825
|
+
maxChanged() {
|
|
826
|
+
this.processMaxParts();
|
|
827
|
+
}
|
|
828
|
+
get isGridStyle() {
|
|
829
|
+
const { presentation, preferWheel } = this;
|
|
830
|
+
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
831
|
+
return hasDatePresentation && !preferWheel;
|
|
832
|
+
}
|
|
833
|
+
yearValuesChanged() {
|
|
834
|
+
this.parsedYearValues = convertToArrayOfNumbers(this.yearValues);
|
|
835
|
+
}
|
|
836
|
+
monthValuesChanged() {
|
|
837
|
+
this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues);
|
|
838
|
+
}
|
|
839
|
+
dayValuesChanged() {
|
|
840
|
+
this.parsedDayValues = convertToArrayOfNumbers(this.dayValues);
|
|
841
|
+
}
|
|
842
|
+
hourValuesChanged() {
|
|
843
|
+
this.parsedHourValues = convertToArrayOfNumbers(this.hourValues);
|
|
844
|
+
}
|
|
845
|
+
minuteValuesChanged() {
|
|
846
|
+
this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
|
|
847
|
+
}
|
|
226
848
|
/**
|
|
227
|
-
*
|
|
228
|
-
* to use when rendering an initial set of
|
|
229
|
-
* data. This should be used when rendering an
|
|
230
|
-
* interface in an environment where the `value`
|
|
231
|
-
* may not be set. This function works
|
|
232
|
-
* by returning the first selected date and then
|
|
233
|
-
* falling back to defaultParts if no active date
|
|
234
|
-
* is selected.
|
|
849
|
+
* Update the datetime value when the value changes
|
|
235
850
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
this.getActivePart = () => {
|
|
242
|
-
const { activeParts } = this;
|
|
243
|
-
return Array.isArray(activeParts) ? activeParts[0] : activeParts;
|
|
244
|
-
};
|
|
245
|
-
this.closeParentOverlay = () => {
|
|
246
|
-
const popoverOrModal = this.el.closest('ion-modal, ion-popover');
|
|
247
|
-
if (popoverOrModal) {
|
|
248
|
-
popoverOrModal.dismiss();
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
this.setWorkingParts = (parts) => {
|
|
252
|
-
this.workingParts = Object.assign({}, parts);
|
|
253
|
-
};
|
|
254
|
-
this.setActiveParts = (parts, removeDate = false) => {
|
|
255
|
-
/** if the datetime component is in readonly mode,
|
|
256
|
-
* allow browsing of the calendar without changing
|
|
257
|
-
* the set value
|
|
258
|
-
*/
|
|
259
|
-
if (this.readonly) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const { multiple, minParts, maxParts, activeParts } = this;
|
|
263
|
-
/**
|
|
264
|
-
* When setting the active parts, it is possible
|
|
265
|
-
* to set invalid data. For example,
|
|
266
|
-
* when updating January 31 to February,
|
|
267
|
-
* February 31 does not exist. As a result
|
|
268
|
-
* we need to validate the active parts and
|
|
269
|
-
* ensure that we are only setting valid dates.
|
|
270
|
-
* Additionally, we need to update the working parts
|
|
271
|
-
* too in the event that the validated parts are different.
|
|
272
|
-
*/
|
|
273
|
-
const validatedParts = validateParts(parts, minParts, maxParts);
|
|
274
|
-
this.setWorkingParts(validatedParts);
|
|
275
|
-
if (multiple) {
|
|
276
|
-
const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
|
|
277
|
-
if (removeDate) {
|
|
278
|
-
this.activeParts = activePartsArray.filter((p) => !isSameDay(p, validatedParts));
|
|
851
|
+
async valueChanged() {
|
|
852
|
+
const { value } = this;
|
|
853
|
+
if (this.hasValue()) {
|
|
854
|
+
this.processValue(value);
|
|
279
855
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
this.confirm();
|
|
292
|
-
};
|
|
293
|
-
this.initializeKeyboardListeners = () => {
|
|
294
|
-
const calendarBodyRef = this.calendarBodyRef;
|
|
295
|
-
if (!calendarBodyRef) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
const root = this.el.shadowRoot;
|
|
299
|
-
/**
|
|
300
|
-
* Get a reference to the month
|
|
301
|
-
* element we are currently viewing.
|
|
302
|
-
*/
|
|
303
|
-
const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
|
|
304
|
-
/**
|
|
305
|
-
* When focusing the calendar body, we want to pass focus
|
|
306
|
-
* to the working day, but other days should
|
|
307
|
-
* only be accessible using the arrow keys. Pressing
|
|
308
|
-
* Tab should jump between bodies of selectable content.
|
|
309
|
-
*/
|
|
310
|
-
const checkCalendarBodyFocus = (ev) => {
|
|
311
|
-
var _a;
|
|
312
|
-
const record = ev[0];
|
|
856
|
+
this.emitStyle();
|
|
857
|
+
this.ionValueChange.emit({ value });
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* Confirms the selected datetime value, updates the
|
|
861
|
+
* `value` property, and optionally closes the popover
|
|
862
|
+
* or modal that the datetime was presented in.
|
|
863
|
+
*/
|
|
864
|
+
async confirm(closeOverlay = false) {
|
|
865
|
+
const { isCalendarPicker, activeParts } = this;
|
|
313
866
|
/**
|
|
314
|
-
*
|
|
315
|
-
* when this fired or if the calendar body
|
|
316
|
-
* if not currently focused, we should not re-focus
|
|
317
|
-
* the inner day.
|
|
867
|
+
* We only update the value if the presentation is not a calendar picker.
|
|
318
868
|
*/
|
|
319
|
-
if (
|
|
320
|
-
|
|
869
|
+
if (activeParts !== undefined || !isCalendarPicker) {
|
|
870
|
+
const activePartsIsArray = Array.isArray(activeParts);
|
|
871
|
+
if (activePartsIsArray && activeParts.length === 0) {
|
|
872
|
+
this.setValue(undefined);
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
this.setValue(convertDataToISO(activeParts));
|
|
876
|
+
}
|
|
321
877
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
const mo = new MutationObserver(checkCalendarBodyFocus);
|
|
325
|
-
mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
|
|
326
|
-
this.destroyKeyboardMO = () => {
|
|
327
|
-
mo === null || mo === void 0 ? void 0 : mo.disconnect();
|
|
328
|
-
};
|
|
329
|
-
/**
|
|
330
|
-
* We must use keydown not keyup as we want
|
|
331
|
-
* to prevent scrolling when using the arrow keys.
|
|
332
|
-
*/
|
|
333
|
-
calendarBodyRef.addEventListener('keydown', (ev) => {
|
|
334
|
-
const activeElement = root.activeElement;
|
|
335
|
-
if (!activeElement || !activeElement.classList.contains('calendar-day')) {
|
|
336
|
-
return;
|
|
878
|
+
if (closeOverlay) {
|
|
879
|
+
this.closeParentOverlay();
|
|
337
880
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
case 'Home':
|
|
358
|
-
ev.preventDefault();
|
|
359
|
-
partsToFocus = getStartOfWeek(parts);
|
|
360
|
-
break;
|
|
361
|
-
case 'End':
|
|
362
|
-
ev.preventDefault();
|
|
363
|
-
partsToFocus = getEndOfWeek(parts);
|
|
364
|
-
break;
|
|
365
|
-
case 'PageUp':
|
|
366
|
-
ev.preventDefault();
|
|
367
|
-
partsToFocus = ev.shiftKey ? getPreviousYear(parts) : getPreviousMonth(parts);
|
|
368
|
-
break;
|
|
369
|
-
case 'PageDown':
|
|
370
|
-
ev.preventDefault();
|
|
371
|
-
partsToFocus = ev.shiftKey ? getNextYear(parts) : getNextMonth(parts);
|
|
372
|
-
break;
|
|
373
|
-
/**
|
|
374
|
-
* Do not preventDefault here
|
|
375
|
-
* as we do not want to override other
|
|
376
|
-
* browser defaults such as pressing Enter/Space
|
|
377
|
-
* to select a day.
|
|
378
|
-
*/
|
|
379
|
-
default:
|
|
380
|
-
return;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Resets the internal state of the datetime but does not update the value.
|
|
884
|
+
* Passing a valid ISO-8601 string will reset the state of the component to the provided date.
|
|
885
|
+
* If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
|
|
886
|
+
*/
|
|
887
|
+
async reset(startDate) {
|
|
888
|
+
this.processValue(startDate);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Emits the ionCancel event and
|
|
892
|
+
* optionally closes the popover
|
|
893
|
+
* or modal that the datetime was
|
|
894
|
+
* presented in.
|
|
895
|
+
*/
|
|
896
|
+
async cancel(closeOverlay = false) {
|
|
897
|
+
this.ionCancel.emit();
|
|
898
|
+
if (closeOverlay) {
|
|
899
|
+
this.closeParentOverlay();
|
|
381
900
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
901
|
+
}
|
|
902
|
+
get isCalendarPicker() {
|
|
903
|
+
const { presentation } = this;
|
|
904
|
+
return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
905
|
+
}
|
|
906
|
+
connectedCallback() {
|
|
907
|
+
this.clearFocusVisible = startFocusVisible(this.el).destroy;
|
|
908
|
+
}
|
|
909
|
+
disconnectedCallback() {
|
|
910
|
+
if (this.clearFocusVisible) {
|
|
911
|
+
this.clearFocusVisible();
|
|
912
|
+
this.clearFocusVisible = undefined;
|
|
388
913
|
}
|
|
389
|
-
|
|
914
|
+
}
|
|
915
|
+
initializeListeners() {
|
|
916
|
+
this.initializeCalendarListener();
|
|
917
|
+
this.initializeKeyboardListeners();
|
|
918
|
+
}
|
|
919
|
+
componentDidLoad() {
|
|
390
920
|
/**
|
|
391
|
-
*
|
|
392
|
-
*
|
|
921
|
+
* If a scrollable element is hidden using `display: none`,
|
|
922
|
+
* it will not have a scroll height meaning we cannot scroll elements
|
|
923
|
+
* into view. As a result, we will need to wait for the datetime to become
|
|
924
|
+
* visible if used inside of a modal or a popover otherwise the scrollable
|
|
925
|
+
* areas will not have the correct values snapped into place.
|
|
393
926
|
*/
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Get the number of padding days so
|
|
400
|
-
* we know how much to offset our next selector by
|
|
401
|
-
* to grab the correct calendar-day element.
|
|
402
|
-
*/
|
|
403
|
-
const padding = currentMonth.querySelectorAll('.calendar-day-padding');
|
|
404
|
-
const { day } = this.workingParts;
|
|
405
|
-
if (day === null) {
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Get the calendar day element
|
|
410
|
-
* and focus it.
|
|
411
|
-
*/
|
|
412
|
-
const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${padding.length + day}) .calendar-day`);
|
|
413
|
-
if (dayEl) {
|
|
414
|
-
dayEl.focus();
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
this.processMinParts = () => {
|
|
418
|
-
const { min, defaultParts } = this;
|
|
419
|
-
if (min === undefined) {
|
|
420
|
-
this.minParts = undefined;
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
this.minParts = parseMinParts(min, defaultParts);
|
|
424
|
-
};
|
|
425
|
-
this.processMaxParts = () => {
|
|
426
|
-
const { max, defaultParts } = this;
|
|
427
|
-
if (max === undefined) {
|
|
428
|
-
this.maxParts = undefined;
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
this.maxParts = parseMaxParts(max, defaultParts);
|
|
432
|
-
};
|
|
433
|
-
this.initializeCalendarListener = () => {
|
|
434
|
-
const calendarBodyRef = this.calendarBodyRef;
|
|
435
|
-
if (!calendarBodyRef) {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* For performance reasons, we only render 3
|
|
440
|
-
* months at a time: The current month, the previous
|
|
441
|
-
* month, and the next month. We have a scroll listener
|
|
442
|
-
* on the calendar body to append/prepend new months.
|
|
443
|
-
*
|
|
444
|
-
* We can do this because Stencil is smart enough to not
|
|
445
|
-
* re-create the .calendar-month containers, but rather
|
|
446
|
-
* update the content within those containers.
|
|
447
|
-
*
|
|
448
|
-
* As an added bonus, WebKit has some troubles with
|
|
449
|
-
* scroll-snap-stop: always, so not rendering all of
|
|
450
|
-
* the months in a row allows us to mostly sidestep
|
|
451
|
-
* that issue.
|
|
452
|
-
*/
|
|
453
|
-
const months = calendarBodyRef.querySelectorAll('.calendar-month');
|
|
454
|
-
const startMonth = months[0];
|
|
455
|
-
const workingMonth = months[1];
|
|
456
|
-
const endMonth = months[2];
|
|
457
|
-
const mode = getIonMode(this);
|
|
458
|
-
const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
|
|
459
|
-
/**
|
|
460
|
-
* Before setting up the scroll listener,
|
|
461
|
-
* scroll the middle month into view.
|
|
462
|
-
* scrollIntoView() will scroll entire page
|
|
463
|
-
* if element is not in viewport. Use scrollLeft instead.
|
|
464
|
-
*/
|
|
465
|
-
writeTask(() => {
|
|
466
|
-
calendarBodyRef.scrollLeft = startMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
467
|
-
const getChangedMonth = (parts) => {
|
|
468
|
-
const box = calendarBodyRef.getBoundingClientRect();
|
|
469
|
-
/**
|
|
470
|
-
* If the current scroll position is all the way to the left
|
|
471
|
-
* then we have scrolled to the previous month.
|
|
472
|
-
* Otherwise, assume that we have scrolled to the next
|
|
473
|
-
* month. We have a tolerance of 2px to account for
|
|
474
|
-
* sub pixel rendering.
|
|
475
|
-
*
|
|
476
|
-
* Check below the next line ensures that we did not
|
|
477
|
-
* swipe and abort (i.e. we swiped but we are still on the current month).
|
|
478
|
-
*/
|
|
479
|
-
const month = calendarBodyRef.scrollLeft <= 2 ? startMonth : endMonth;
|
|
480
|
-
/**
|
|
481
|
-
* The edge of the month must be lined up with
|
|
482
|
-
* the edge of the calendar body in order for
|
|
483
|
-
* the component to update. Otherwise, it
|
|
484
|
-
* may be the case that the user has paused their
|
|
485
|
-
* swipe or the browser has not finished snapping yet.
|
|
486
|
-
* Rather than check if the x values are equal,
|
|
487
|
-
* we give it a tolerance of 2px to account for
|
|
488
|
-
* sub pixel rendering.
|
|
489
|
-
*/
|
|
490
|
-
const monthBox = month.getBoundingClientRect();
|
|
491
|
-
if (Math.abs(monthBox.x - box.x) > 2)
|
|
492
|
-
return;
|
|
493
|
-
/**
|
|
494
|
-
* If we're force-rendering a month, assume we've
|
|
495
|
-
* scrolled to that and return it.
|
|
496
|
-
*
|
|
497
|
-
* If forceRenderDate is ever used in a context where the
|
|
498
|
-
* forced month is not immediately auto-scrolled to, this
|
|
499
|
-
* should be updated to also check whether `month` has the
|
|
500
|
-
* same month and year as the forced date.
|
|
501
|
-
*/
|
|
502
|
-
const { forceRenderDate } = this;
|
|
503
|
-
if (forceRenderDate !== undefined) {
|
|
504
|
-
return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* From here, we can determine if the start
|
|
508
|
-
* month or the end month was scrolled into view.
|
|
509
|
-
* If no month was changed, then we can return from
|
|
510
|
-
* the scroll callback early.
|
|
511
|
-
*/
|
|
512
|
-
if (month === startMonth) {
|
|
513
|
-
return getPreviousMonth(parts);
|
|
514
|
-
}
|
|
515
|
-
else if (month === endMonth) {
|
|
516
|
-
return getNextMonth(parts);
|
|
517
|
-
}
|
|
518
|
-
else {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
const updateActiveMonth = () => {
|
|
523
|
-
if (needsiOSRubberBandFix) {
|
|
524
|
-
calendarBodyRef.style.removeProperty('pointer-events');
|
|
525
|
-
appliediOSRubberBandFix = false;
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* If the month did not change
|
|
529
|
-
* then we can return early.
|
|
530
|
-
*/
|
|
531
|
-
const newDate = getChangedMonth(this.workingParts);
|
|
532
|
-
if (!newDate)
|
|
533
|
-
return;
|
|
534
|
-
const { month, day, year } = newDate;
|
|
535
|
-
if (isMonthDisabled({ month, year, day: null }, {
|
|
536
|
-
minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
|
|
537
|
-
maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
|
|
538
|
-
})) {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
/**
|
|
542
|
-
* Prevent scrolling for other browsers
|
|
543
|
-
* to give the DOM time to update and the container
|
|
544
|
-
* time to properly snap.
|
|
545
|
-
*/
|
|
546
|
-
calendarBodyRef.style.setProperty('overflow', 'hidden');
|
|
547
|
-
/**
|
|
548
|
-
* Use a writeTask here to ensure
|
|
549
|
-
* that the state is updated and the
|
|
550
|
-
* correct month is scrolled into view
|
|
551
|
-
* in the same frame. This is not
|
|
552
|
-
* typically a problem on newer devices
|
|
553
|
-
* but older/slower device may have a flicker
|
|
554
|
-
* if we did not do this.
|
|
555
|
-
*/
|
|
556
|
-
writeTask(() => {
|
|
557
|
-
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
|
|
558
|
-
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
559
|
-
calendarBodyRef.style.removeProperty('overflow');
|
|
560
|
-
if (this.resolveForceDateScrolling) {
|
|
561
|
-
this.resolveForceDateScrolling();
|
|
927
|
+
const visibleCallback = (entries) => {
|
|
928
|
+
const ev = entries[0];
|
|
929
|
+
if (!ev.isIntersecting) {
|
|
930
|
+
return;
|
|
562
931
|
}
|
|
563
|
-
|
|
932
|
+
this.initializeListeners();
|
|
933
|
+
/**
|
|
934
|
+
* TODO FW-2793: Datetime needs a frame to ensure that it
|
|
935
|
+
* can properly scroll contents into view. As a result
|
|
936
|
+
* we hide the scrollable content until after that frame
|
|
937
|
+
* so users do not see the content quickly shifting. The downside
|
|
938
|
+
* is that the content will pop into view a frame after. Maybe there
|
|
939
|
+
* is a better way to handle this?
|
|
940
|
+
*/
|
|
941
|
+
writeTask(() => {
|
|
942
|
+
this.el.classList.add('datetime-ready');
|
|
943
|
+
});
|
|
564
944
|
};
|
|
945
|
+
const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01 });
|
|
565
946
|
/**
|
|
566
|
-
*
|
|
567
|
-
*
|
|
947
|
+
* Use raf to avoid a race condition between the component loading and
|
|
948
|
+
* its display animation starting (such as when shown in a modal). This
|
|
949
|
+
* could cause the datetime to start at a visibility of 0, erroneously
|
|
950
|
+
* triggering the `hiddenIO` observer below.
|
|
568
951
|
*/
|
|
569
|
-
|
|
952
|
+
raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(this.el));
|
|
570
953
|
/**
|
|
571
|
-
* We
|
|
572
|
-
*
|
|
573
|
-
*
|
|
954
|
+
* We need to clean up listeners when the datetime is hidden
|
|
955
|
+
* in a popover/modal so that we can properly scroll containers
|
|
956
|
+
* back into view if they are re-presented. When the datetime is hidden
|
|
957
|
+
* the scroll areas have scroll widths/heights of 0px, so any snapping
|
|
958
|
+
* we did originally has been lost.
|
|
574
959
|
*/
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
// Wait ~3 frames
|
|
594
|
-
scrollTimeout = setTimeout(updateActiveMonth, 50);
|
|
595
|
-
};
|
|
596
|
-
calendarBodyRef.addEventListener('scroll', scrollCallback);
|
|
597
|
-
this.destroyCalendarListener = () => {
|
|
598
|
-
calendarBodyRef.removeEventListener('scroll', scrollCallback);
|
|
960
|
+
const hiddenCallback = (entries) => {
|
|
961
|
+
const ev = entries[0];
|
|
962
|
+
if (ev.isIntersecting) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
this.destroyInteractionListeners();
|
|
966
|
+
/**
|
|
967
|
+
* When datetime is hidden, we need to make sure that
|
|
968
|
+
* the month/year picker is closed. Otherwise,
|
|
969
|
+
* it will be open when the datetime re-appears
|
|
970
|
+
* and the scroll area of the calendar grid will be 0.
|
|
971
|
+
* As a result, the wrong month will be shown.
|
|
972
|
+
*/
|
|
973
|
+
this.showMonthAndYear = false;
|
|
974
|
+
writeTask(() => {
|
|
975
|
+
this.el.classList.remove('datetime-ready');
|
|
976
|
+
});
|
|
599
977
|
};
|
|
600
|
-
|
|
601
|
-
|
|
978
|
+
const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0 });
|
|
979
|
+
raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(this.el));
|
|
980
|
+
/**
|
|
981
|
+
* Datetime uses Ionic components that emit
|
|
982
|
+
* ionFocus and ionBlur. These events are
|
|
983
|
+
* composed meaning they will cross
|
|
984
|
+
* the shadow dom boundary. We need to
|
|
985
|
+
* stop propagation on these events otherwise
|
|
986
|
+
* developers will see 2 ionFocus or 2 ionBlur
|
|
987
|
+
* events at a time.
|
|
988
|
+
*/
|
|
989
|
+
const root = getElementRoot(this.el);
|
|
990
|
+
root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
|
|
991
|
+
root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
|
|
992
|
+
}
|
|
602
993
|
/**
|
|
603
|
-
*
|
|
604
|
-
*
|
|
605
|
-
* if the datetime has been hidden/presented by a modal or popover.
|
|
994
|
+
* When the presentation is changed, all calendar content is recreated,
|
|
995
|
+
* so we need to re-init behavior with the new elements.
|
|
606
996
|
*/
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
if (destroyCalendarListener !== undefined) {
|
|
610
|
-
destroyCalendarListener();
|
|
611
|
-
}
|
|
612
|
-
if (destroyKeyboardMO !== undefined) {
|
|
613
|
-
destroyKeyboardMO();
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
this.processValue = (value) => {
|
|
617
|
-
const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
|
|
618
|
-
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
|
|
619
|
-
const { minParts, maxParts, workingParts, el } = this;
|
|
620
|
-
this.warnIfIncorrectValueUsage();
|
|
621
|
-
/**
|
|
622
|
-
* Return early if the value wasn't parsed correctly, such as
|
|
623
|
-
* if an improperly formatted date string was provided.
|
|
624
|
-
*/
|
|
625
|
-
if (!valueToProcess) {
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Datetime should only warn of out of bounds values
|
|
630
|
-
* if set by the user. If the `value` is undefined,
|
|
631
|
-
* we will default to today's date which may be out
|
|
632
|
-
* of bounds. In this case, the warning makes it look
|
|
633
|
-
* like the developer did something wrong which is
|
|
634
|
-
* not true.
|
|
635
|
-
*/
|
|
636
|
-
if (hasValue) {
|
|
637
|
-
warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
|
|
638
|
-
}
|
|
639
|
-
/**
|
|
640
|
-
* If there are multiple values, pick an arbitrary one to clamp to. This way,
|
|
641
|
-
* if the values are across months, we always show at least one of them. Note
|
|
642
|
-
* that the values don't necessarily have to be in order.
|
|
643
|
-
*/
|
|
644
|
-
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
|
|
645
|
-
const targetValue = clampDate(singleValue, minParts, maxParts);
|
|
646
|
-
const { month, day, year, hour, minute } = targetValue;
|
|
647
|
-
const ampm = parseAmPm(hour);
|
|
648
|
-
/**
|
|
649
|
-
* Since `activeParts` indicates a value that
|
|
650
|
-
* been explicitly selected either by the
|
|
651
|
-
* user or the app, only update `activeParts`
|
|
652
|
-
* if the `value` property is set.
|
|
653
|
-
*/
|
|
654
|
-
if (hasValue) {
|
|
655
|
-
if (Array.isArray(valueToProcess)) {
|
|
656
|
-
this.activeParts = [...valueToProcess];
|
|
657
|
-
}
|
|
658
|
-
else {
|
|
659
|
-
this.activeParts = {
|
|
660
|
-
month,
|
|
661
|
-
day,
|
|
662
|
-
year,
|
|
663
|
-
hour,
|
|
664
|
-
minute,
|
|
665
|
-
ampm,
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
else {
|
|
997
|
+
componentDidRender() {
|
|
998
|
+
const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
|
|
670
999
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
1000
|
+
* TODO(FW-2165)
|
|
1001
|
+
* Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
|
|
1002
|
+
* When using `min`, we add `scroll-snap-align: none`
|
|
1003
|
+
* to the disabled month so that users cannot scroll to it.
|
|
1004
|
+
* This triggers a bug in WebKit where the scroll position is reset.
|
|
1005
|
+
* Since the month change logic is handled by a scroll listener,
|
|
1006
|
+
* this causes the month to change leading to `scroll-snap-align`
|
|
1007
|
+
* changing again, thus changing the scroll position again and causing
|
|
1008
|
+
* an infinite loop.
|
|
1009
|
+
* This issue only applies to the calendar grid, so we can disable
|
|
1010
|
+
* it if the calendar grid is not being used.
|
|
674
1011
|
*/
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
1012
|
+
const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
|
|
1013
|
+
if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
|
|
1014
|
+
const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
|
|
1015
|
+
/**
|
|
1016
|
+
* We need to make sure the datetime is not in the process
|
|
1017
|
+
* of scrolling to a new datetime value if the value
|
|
1018
|
+
* is updated programmatically.
|
|
1019
|
+
* Otherwise, the datetime will appear to not scroll at all because
|
|
1020
|
+
* we are resetting the scroll position to the center of the view.
|
|
1021
|
+
* Prior to the datetime's value being updated programmatically,
|
|
1022
|
+
* the calendarBodyRef is scrolled such that the middle month is centered
|
|
1023
|
+
* in the view. The below code updates the scroll position so the middle
|
|
1024
|
+
* month is also centered in the view. Since the scroll position did not change,
|
|
1025
|
+
* the scroll callback in this file does not fire,
|
|
1026
|
+
* and the resolveForceDateScrolling promise never resolves.
|
|
1027
|
+
*/
|
|
1028
|
+
if (workingMonth && forceRenderDate === undefined) {
|
|
1029
|
+
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
if (prevPresentation === null) {
|
|
1033
|
+
this.prevPresentation = presentation;
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
if (presentation === prevPresentation) {
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
this.prevPresentation = presentation;
|
|
1040
|
+
this.destroyInteractionListeners();
|
|
1041
|
+
this.initializeListeners();
|
|
691
1042
|
/**
|
|
692
|
-
*
|
|
693
|
-
*
|
|
1043
|
+
* The month/year picker from the date interface
|
|
1044
|
+
* should be closed as it is not available in non-date
|
|
1045
|
+
* interfaces.
|
|
694
1046
|
*/
|
|
695
|
-
this.
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
year,
|
|
699
|
-
hour,
|
|
700
|
-
minute,
|
|
701
|
-
ampm,
|
|
1047
|
+
this.showMonthAndYear = false;
|
|
1048
|
+
raf(() => {
|
|
1049
|
+
this.ionRender.emit();
|
|
702
1050
|
});
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
this.forceRenderDate = targetValue;
|
|
714
|
-
/**
|
|
715
|
-
* Flag that we've started scrolling to the forced date.
|
|
716
|
-
* The resolve function will be called by the datetime's
|
|
717
|
-
* scroll listener when it's done updating everything.
|
|
718
|
-
* This is a replacement for making prev/nextMonth async,
|
|
719
|
-
* since the logic we're waiting on is in a listener.
|
|
720
|
-
*/
|
|
721
|
-
const forceDateScrollingPromise = new Promise((resolve) => {
|
|
722
|
-
this.resolveForceDateScrolling = resolve;
|
|
723
|
-
});
|
|
724
|
-
/**
|
|
725
|
-
* Animate smoothly to the forced month. This will also update
|
|
726
|
-
* workingParts and correct the surrounding months for us.
|
|
727
|
-
*/
|
|
728
|
-
const targetMonthIsBefore = isBefore(targetValue, workingParts);
|
|
729
|
-
targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
|
|
730
|
-
await forceDateScrollingPromise;
|
|
731
|
-
this.resolveForceDateScrolling = undefined;
|
|
732
|
-
this.forceRenderDate = undefined;
|
|
733
|
-
};
|
|
734
|
-
this.onFocus = () => {
|
|
735
|
-
this.ionFocus.emit();
|
|
736
|
-
};
|
|
737
|
-
this.onBlur = () => {
|
|
738
|
-
this.ionBlur.emit();
|
|
739
|
-
};
|
|
740
|
-
this.hasValue = () => {
|
|
741
|
-
return this.value != null;
|
|
742
|
-
};
|
|
743
|
-
this.nextMonth = () => {
|
|
744
|
-
const calendarBodyRef = this.calendarBodyRef;
|
|
745
|
-
if (!calendarBodyRef) {
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
|
|
749
|
-
if (!nextMonth) {
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
const left = nextMonth.offsetWidth * 2;
|
|
753
|
-
calendarBodyRef.scrollTo({
|
|
754
|
-
top: 0,
|
|
755
|
-
left: left * (isRTL(this.el) ? -1 : 1),
|
|
756
|
-
behavior: 'smooth',
|
|
757
|
-
});
|
|
758
|
-
};
|
|
759
|
-
this.prevMonth = () => {
|
|
760
|
-
const calendarBodyRef = this.calendarBodyRef;
|
|
761
|
-
if (!calendarBodyRef) {
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
|
|
765
|
-
if (!prevMonth) {
|
|
766
|
-
return;
|
|
767
|
-
}
|
|
768
|
-
calendarBodyRef.scrollTo({
|
|
769
|
-
top: 0,
|
|
770
|
-
left: 0,
|
|
771
|
-
behavior: 'smooth',
|
|
772
|
-
});
|
|
773
|
-
};
|
|
774
|
-
this.toggleMonthAndYearView = () => {
|
|
775
|
-
this.showMonthAndYear = !this.showMonthAndYear;
|
|
776
|
-
};
|
|
777
|
-
this.showMonthAndYear = false;
|
|
778
|
-
this.activeParts = [];
|
|
779
|
-
this.workingParts = {
|
|
780
|
-
month: 5,
|
|
781
|
-
day: 28,
|
|
782
|
-
year: 2021,
|
|
783
|
-
hour: 13,
|
|
784
|
-
minute: 52,
|
|
785
|
-
ampm: 'pm',
|
|
786
|
-
};
|
|
787
|
-
this.isTimePopoverOpen = false;
|
|
788
|
-
this.forceRenderDate = undefined;
|
|
789
|
-
this.color = 'primary';
|
|
790
|
-
this.name = this.inputId;
|
|
791
|
-
this.disabled = false;
|
|
792
|
-
this.readonly = false;
|
|
793
|
-
this.isDateEnabled = undefined;
|
|
794
|
-
this.min = undefined;
|
|
795
|
-
this.max = undefined;
|
|
796
|
-
this.presentation = 'date-time';
|
|
797
|
-
this.cancelText = 'Cancel';
|
|
798
|
-
this.doneText = 'Done';
|
|
799
|
-
this.clearText = 'Clear';
|
|
800
|
-
this.yearValues = undefined;
|
|
801
|
-
this.monthValues = undefined;
|
|
802
|
-
this.dayValues = undefined;
|
|
803
|
-
this.hourValues = undefined;
|
|
804
|
-
this.minuteValues = undefined;
|
|
805
|
-
this.locale = 'default';
|
|
806
|
-
this.firstDayOfWeek = 0;
|
|
807
|
-
this.titleSelectedDatesFormatter = undefined;
|
|
808
|
-
this.multiple = false;
|
|
809
|
-
this.highlightedDates = undefined;
|
|
810
|
-
this.value = undefined;
|
|
811
|
-
this.showDefaultTitle = false;
|
|
812
|
-
this.showDefaultButtons = false;
|
|
813
|
-
this.showClearButton = false;
|
|
814
|
-
this.showDefaultTimeLabel = true;
|
|
815
|
-
this.hourCycle = undefined;
|
|
816
|
-
this.size = 'fixed';
|
|
817
|
-
this.preferWheel = false;
|
|
818
|
-
}
|
|
819
|
-
disabledChanged() {
|
|
820
|
-
this.emitStyle();
|
|
821
|
-
}
|
|
822
|
-
minChanged() {
|
|
823
|
-
this.processMinParts();
|
|
824
|
-
}
|
|
825
|
-
maxChanged() {
|
|
826
|
-
this.processMaxParts();
|
|
827
|
-
}
|
|
828
|
-
get isGridStyle() {
|
|
829
|
-
const { presentation, preferWheel } = this;
|
|
830
|
-
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
831
|
-
return hasDatePresentation && !preferWheel;
|
|
832
|
-
}
|
|
833
|
-
yearValuesChanged() {
|
|
834
|
-
this.parsedYearValues = convertToArrayOfNumbers(this.yearValues);
|
|
835
|
-
}
|
|
836
|
-
monthValuesChanged() {
|
|
837
|
-
this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues);
|
|
838
|
-
}
|
|
839
|
-
dayValuesChanged() {
|
|
840
|
-
this.parsedDayValues = convertToArrayOfNumbers(this.dayValues);
|
|
841
|
-
}
|
|
842
|
-
hourValuesChanged() {
|
|
843
|
-
this.parsedHourValues = convertToArrayOfNumbers(this.hourValues);
|
|
844
|
-
}
|
|
845
|
-
minuteValuesChanged() {
|
|
846
|
-
this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
|
|
847
|
-
}
|
|
848
|
-
/**
|
|
849
|
-
* Update the datetime value when the value changes
|
|
850
|
-
*/
|
|
851
|
-
async valueChanged() {
|
|
852
|
-
const { value } = this;
|
|
853
|
-
if (this.hasValue()) {
|
|
854
|
-
this.processValue(value);
|
|
855
|
-
}
|
|
856
|
-
this.emitStyle();
|
|
857
|
-
this.ionValueChange.emit({ value });
|
|
858
|
-
}
|
|
859
|
-
/**
|
|
860
|
-
* Confirms the selected datetime value, updates the
|
|
861
|
-
* `value` property, and optionally closes the popover
|
|
862
|
-
* or modal that the datetime was presented in.
|
|
863
|
-
*/
|
|
864
|
-
async confirm(closeOverlay = false) {
|
|
865
|
-
const { isCalendarPicker, activeParts } = this;
|
|
866
|
-
/**
|
|
867
|
-
* We only update the value if the presentation is not a calendar picker.
|
|
868
|
-
*/
|
|
869
|
-
if (activeParts !== undefined || !isCalendarPicker) {
|
|
870
|
-
const activePartsIsArray = Array.isArray(activeParts);
|
|
871
|
-
if (activePartsIsArray && activeParts.length === 0) {
|
|
872
|
-
this.setValue(undefined);
|
|
873
|
-
}
|
|
874
|
-
else {
|
|
875
|
-
this.setValue(convertDataToISO(activeParts));
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
if (closeOverlay) {
|
|
879
|
-
this.closeParentOverlay();
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Resets the internal state of the datetime but does not update the value.
|
|
884
|
-
* Passing a valid ISO-8601 string will reset the state of the component to the provided date.
|
|
885
|
-
* If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
|
|
886
|
-
*/
|
|
887
|
-
async reset(startDate) {
|
|
888
|
-
this.processValue(startDate);
|
|
889
|
-
}
|
|
890
|
-
/**
|
|
891
|
-
* Emits the ionCancel event and
|
|
892
|
-
* optionally closes the popover
|
|
893
|
-
* or modal that the datetime was
|
|
894
|
-
* presented in.
|
|
895
|
-
*/
|
|
896
|
-
async cancel(closeOverlay = false) {
|
|
897
|
-
this.ionCancel.emit();
|
|
898
|
-
if (closeOverlay) {
|
|
899
|
-
this.closeParentOverlay();
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
get isCalendarPicker() {
|
|
903
|
-
const { presentation } = this;
|
|
904
|
-
return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
905
|
-
}
|
|
906
|
-
connectedCallback() {
|
|
907
|
-
this.clearFocusVisible = startFocusVisible(this.el).destroy;
|
|
908
|
-
}
|
|
909
|
-
disconnectedCallback() {
|
|
910
|
-
if (this.clearFocusVisible) {
|
|
911
|
-
this.clearFocusVisible();
|
|
912
|
-
this.clearFocusVisible = undefined;
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
initializeListeners() {
|
|
916
|
-
this.initializeCalendarListener();
|
|
917
|
-
this.initializeKeyboardListeners();
|
|
918
|
-
}
|
|
919
|
-
componentDidLoad() {
|
|
920
|
-
/**
|
|
921
|
-
* If a scrollable element is hidden using `display: none`,
|
|
922
|
-
* it will not have a scroll height meaning we cannot scroll elements
|
|
923
|
-
* into view. As a result, we will need to wait for the datetime to become
|
|
924
|
-
* visible if used inside of a modal or a popover otherwise the scrollable
|
|
925
|
-
* areas will not have the correct values snapped into place.
|
|
926
|
-
*/
|
|
927
|
-
const visibleCallback = (entries) => {
|
|
928
|
-
const ev = entries[0];
|
|
929
|
-
if (!ev.isIntersecting) {
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
this.initializeListeners();
|
|
933
|
-
/**
|
|
934
|
-
* TODO FW-2793: Datetime needs a frame to ensure that it
|
|
935
|
-
* can properly scroll contents into view. As a result
|
|
936
|
-
* we hide the scrollable content until after that frame
|
|
937
|
-
* so users do not see the content quickly shifting. The downside
|
|
938
|
-
* is that the content will pop into view a frame after. Maybe there
|
|
939
|
-
* is a better way to handle this?
|
|
940
|
-
*/
|
|
941
|
-
writeTask(() => {
|
|
942
|
-
this.el.classList.add('datetime-ready');
|
|
943
|
-
});
|
|
944
|
-
};
|
|
945
|
-
const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01 });
|
|
946
|
-
/**
|
|
947
|
-
* Use raf to avoid a race condition between the component loading and
|
|
948
|
-
* its display animation starting (such as when shown in a modal). This
|
|
949
|
-
* could cause the datetime to start at a visibility of 0, erroneously
|
|
950
|
-
* triggering the `hiddenIO` observer below.
|
|
951
|
-
*/
|
|
952
|
-
raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(this.el));
|
|
953
|
-
/**
|
|
954
|
-
* We need to clean up listeners when the datetime is hidden
|
|
955
|
-
* in a popover/modal so that we can properly scroll containers
|
|
956
|
-
* back into view if they are re-presented. When the datetime is hidden
|
|
957
|
-
* the scroll areas have scroll widths/heights of 0px, so any snapping
|
|
958
|
-
* we did originally has been lost.
|
|
959
|
-
*/
|
|
960
|
-
const hiddenCallback = (entries) => {
|
|
961
|
-
const ev = entries[0];
|
|
962
|
-
if (ev.isIntersecting) {
|
|
963
|
-
return;
|
|
964
|
-
}
|
|
965
|
-
this.destroyInteractionListeners();
|
|
966
|
-
/**
|
|
967
|
-
* When datetime is hidden, we need to make sure that
|
|
968
|
-
* the month/year picker is closed. Otherwise,
|
|
969
|
-
* it will be open when the datetime re-appears
|
|
970
|
-
* and the scroll area of the calendar grid will be 0.
|
|
971
|
-
* As a result, the wrong month will be shown.
|
|
972
|
-
*/
|
|
973
|
-
this.showMonthAndYear = false;
|
|
974
|
-
writeTask(() => {
|
|
975
|
-
this.el.classList.remove('datetime-ready');
|
|
976
|
-
});
|
|
977
|
-
};
|
|
978
|
-
const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0 });
|
|
979
|
-
raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(this.el));
|
|
980
|
-
/**
|
|
981
|
-
* Datetime uses Ionic components that emit
|
|
982
|
-
* ionFocus and ionBlur. These events are
|
|
983
|
-
* composed meaning they will cross
|
|
984
|
-
* the shadow dom boundary. We need to
|
|
985
|
-
* stop propagation on these events otherwise
|
|
986
|
-
* developers will see 2 ionFocus or 2 ionBlur
|
|
987
|
-
* events at a time.
|
|
988
|
-
*/
|
|
989
|
-
const root = getElementRoot(this.el);
|
|
990
|
-
root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
|
|
991
|
-
root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* When the presentation is changed, all calendar content is recreated,
|
|
995
|
-
* so we need to re-init behavior with the new elements.
|
|
996
|
-
*/
|
|
997
|
-
componentDidRender() {
|
|
998
|
-
const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel } = this;
|
|
999
|
-
/**
|
|
1000
|
-
* TODO(FW-2165)
|
|
1001
|
-
* Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
|
|
1002
|
-
* When using `min`, we add `scroll-snap-align: none`
|
|
1003
|
-
* to the disabled month so that users cannot scroll to it.
|
|
1004
|
-
* This triggers a bug in WebKit where the scroll position is reset.
|
|
1005
|
-
* Since the month change logic is handled by a scroll listener,
|
|
1006
|
-
* this causes the month to change leading to `scroll-snap-align`
|
|
1007
|
-
* changing again, thus changing the scroll position again and causing
|
|
1008
|
-
* an infinite loop.
|
|
1009
|
-
* This issue only applies to the calendar grid, so we can disable
|
|
1010
|
-
* it if the calendar grid is not being used.
|
|
1011
|
-
*/
|
|
1012
|
-
const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
|
|
1013
|
-
if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
|
|
1014
|
-
const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
|
|
1015
|
-
if (workingMonth) {
|
|
1016
|
-
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
if (prevPresentation === null) {
|
|
1020
|
-
this.prevPresentation = presentation;
|
|
1021
|
-
return;
|
|
1022
|
-
}
|
|
1023
|
-
if (presentation === prevPresentation) {
|
|
1024
|
-
return;
|
|
1025
|
-
}
|
|
1026
|
-
this.prevPresentation = presentation;
|
|
1027
|
-
this.destroyInteractionListeners();
|
|
1028
|
-
this.initializeListeners();
|
|
1029
|
-
/**
|
|
1030
|
-
* The month/year picker from the date interface
|
|
1031
|
-
* should be closed as it is not available in non-date
|
|
1032
|
-
* interfaces.
|
|
1033
|
-
*/
|
|
1034
|
-
this.showMonthAndYear = false;
|
|
1035
|
-
raf(() => {
|
|
1036
|
-
this.ionRender.emit();
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
componentWillLoad() {
|
|
1040
|
-
const { el, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
1041
|
-
if (multiple) {
|
|
1042
|
-
if (presentation !== 'date') {
|
|
1043
|
-
printIonWarning('Multiple date selection is only supported for presentation="date".', el);
|
|
1044
|
-
}
|
|
1045
|
-
if (preferWheel) {
|
|
1046
|
-
printIonWarning('Multiple date selection is not supported with preferWheel="true".', el);
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
if (highlightedDates !== undefined) {
|
|
1050
|
-
if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
|
|
1051
|
-
printIonWarning('The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
|
|
1052
|
-
}
|
|
1053
|
-
if (preferWheel) {
|
|
1054
|
-
printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
|
|
1058
|
-
const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
|
|
1059
|
-
const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
|
|
1060
|
-
const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
|
|
1061
|
-
const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
|
|
1062
|
-
const todayParts = (this.todayParts = parseDate(getToday()));
|
|
1063
|
-
this.defaultParts = getClosestValidDate(todayParts, monthValues, dayValues, yearValues, hourValues, minuteValues);
|
|
1064
|
-
this.processMinParts();
|
|
1065
|
-
this.processMaxParts();
|
|
1066
|
-
this.processValue(this.value);
|
|
1067
|
-
this.emitStyle();
|
|
1068
|
-
}
|
|
1069
|
-
emitStyle() {
|
|
1070
|
-
this.ionStyle.emit({
|
|
1071
|
-
interactive: true,
|
|
1072
|
-
datetime: true,
|
|
1073
|
-
'interactive-disabled': this.disabled,
|
|
1074
|
-
});
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Universal render methods
|
|
1078
|
-
* These are pieces of datetime that
|
|
1079
|
-
* are rendered independently of presentation.
|
|
1080
|
-
*/
|
|
1081
|
-
renderFooter() {
|
|
1082
|
-
const { disabled, readonly, showDefaultButtons, showClearButton } = this;
|
|
1083
|
-
/**
|
|
1084
|
-
* The cancel, clear, and confirm buttons
|
|
1085
|
-
* should not be interactive if the datetime
|
|
1086
|
-
* is disabled or readonly.
|
|
1087
|
-
*/
|
|
1088
|
-
const isButtonDisabled = disabled || readonly;
|
|
1089
|
-
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
|
|
1090
|
-
if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
|
|
1091
|
-
return;
|
|
1092
|
-
}
|
|
1093
|
-
const clearButtonClick = () => {
|
|
1094
|
-
this.reset();
|
|
1095
|
-
this.setValue(undefined);
|
|
1096
|
-
};
|
|
1097
|
-
/**
|
|
1098
|
-
* By default we render two buttons:
|
|
1099
|
-
* Cancel - Dismisses the datetime and
|
|
1100
|
-
* does not update the `value` prop.
|
|
1101
|
-
* OK - Dismisses the datetime and
|
|
1102
|
-
* updates the `value` prop.
|
|
1103
|
-
*/
|
|
1104
|
-
return (h("div", { class: "datetime-footer" }, h("div", { class: "datetime-buttons" }, h("div", { class: {
|
|
1105
|
-
['datetime-action-buttons']: true,
|
|
1106
|
-
['has-clear-button']: this.showClearButton,
|
|
1107
|
-
} }, h("slot", { name: "buttons" }, h("ion-buttons", null, showDefaultButtons && (h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), h("div", { class: "datetime-action-buttons-container" }, showClearButton && (h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText)))))))));
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Wheel picker render methods
|
|
1111
|
-
*/
|
|
1112
|
-
renderWheelPicker(forcePresentation = this.presentation) {
|
|
1113
|
-
/**
|
|
1114
|
-
* If presentation="time-date" we switch the
|
|
1115
|
-
* order of the render array here instead of
|
|
1116
|
-
* manually reordering each date/time picker
|
|
1117
|
-
* column with CSS. This allows for additional
|
|
1118
|
-
* flexibility if we need to render subsets
|
|
1119
|
-
* of the date/time data or do additional ordering
|
|
1120
|
-
* within the child render functions.
|
|
1121
|
-
*/
|
|
1122
|
-
const renderArray = forcePresentation === 'time-date'
|
|
1123
|
-
? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
|
|
1124
|
-
: [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
|
|
1125
|
-
return h("ion-picker-internal", null, renderArray);
|
|
1126
|
-
}
|
|
1127
|
-
renderDatePickerColumns(forcePresentation) {
|
|
1128
|
-
return forcePresentation === 'date-time' || forcePresentation === 'time-date'
|
|
1129
|
-
? this.renderCombinedDatePickerColumn()
|
|
1130
|
-
: this.renderIndividualDatePickerColumns(forcePresentation);
|
|
1131
|
-
}
|
|
1132
|
-
renderCombinedDatePickerColumn() {
|
|
1133
|
-
const { defaultParts, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
1134
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1135
|
-
/**
|
|
1136
|
-
* By default, generate a range of 3 months:
|
|
1137
|
-
* Previous month, current month, and next month
|
|
1138
|
-
*/
|
|
1139
|
-
const monthsToRender = generateMonths(workingParts);
|
|
1140
|
-
const lastMonth = monthsToRender[monthsToRender.length - 1];
|
|
1141
|
-
/**
|
|
1142
|
-
* Ensure that users can select the entire window of dates.
|
|
1143
|
-
*/
|
|
1144
|
-
monthsToRender[0].day = 1;
|
|
1145
|
-
lastMonth.day = getNumDaysInMonth(lastMonth.month, lastMonth.year);
|
|
1146
|
-
/**
|
|
1147
|
-
* Narrow the dates rendered based on min/max dates (if any).
|
|
1148
|
-
* The `min` date is used if the min is after the generated min month.
|
|
1149
|
-
* The `max` date is used if the max is before the generated max month.
|
|
1150
|
-
* This ensures that the sliding window always stays at 3 months
|
|
1151
|
-
* but still allows future dates to be lazily rendered based on any min/max
|
|
1152
|
-
* constraints.
|
|
1153
|
-
*/
|
|
1154
|
-
const min = minParts !== undefined && isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
|
|
1155
|
-
const max = maxParts !== undefined && isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
|
|
1156
|
-
const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
|
|
1157
|
-
let items = result.items;
|
|
1158
|
-
const parts = result.parts;
|
|
1159
|
-
if (isDateEnabled) {
|
|
1160
|
-
items = items.map((itemObject, index) => {
|
|
1161
|
-
const referenceParts = parts[index];
|
|
1162
|
-
let disabled;
|
|
1163
|
-
try {
|
|
1164
|
-
/**
|
|
1165
|
-
* The `isDateEnabled` implementation is try-catch wrapped
|
|
1166
|
-
* to prevent exceptions in the user's function from
|
|
1167
|
-
* interrupting the calendar rendering.
|
|
1168
|
-
*/
|
|
1169
|
-
disabled = !isDateEnabled(convertDataToISO(referenceParts));
|
|
1051
|
+
}
|
|
1052
|
+
componentWillLoad() {
|
|
1053
|
+
const { el, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
1054
|
+
if (multiple) {
|
|
1055
|
+
if (presentation !== 'date') {
|
|
1056
|
+
printIonWarning('Multiple date selection is only supported for presentation="date".', el);
|
|
1057
|
+
}
|
|
1058
|
+
if (preferWheel) {
|
|
1059
|
+
printIonWarning('Multiple date selection is not supported with preferWheel="true".', el);
|
|
1060
|
+
}
|
|
1170
1061
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1062
|
+
if (highlightedDates !== undefined) {
|
|
1063
|
+
if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
|
|
1064
|
+
printIonWarning('The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
|
|
1065
|
+
}
|
|
1066
|
+
if (preferWheel) {
|
|
1067
|
+
printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
|
|
1068
|
+
}
|
|
1173
1069
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1070
|
+
const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
|
|
1071
|
+
const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
|
|
1072
|
+
const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
|
|
1073
|
+
const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
|
|
1074
|
+
const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
|
|
1075
|
+
const todayParts = (this.todayParts = parseDate(getToday()));
|
|
1076
|
+
this.defaultParts = getClosestValidDate(todayParts, monthValues, dayValues, yearValues, hourValues, minuteValues);
|
|
1077
|
+
this.processMinParts();
|
|
1078
|
+
this.processMaxParts();
|
|
1079
|
+
this.processValue(this.value);
|
|
1080
|
+
this.emitStyle();
|
|
1081
|
+
}
|
|
1082
|
+
emitStyle() {
|
|
1083
|
+
this.ionStyle.emit({
|
|
1084
|
+
interactive: true,
|
|
1085
|
+
datetime: true,
|
|
1086
|
+
'interactive-disabled': this.disabled,
|
|
1087
|
+
});
|
|
1176
1088
|
}
|
|
1177
1089
|
/**
|
|
1178
|
-
*
|
|
1179
|
-
*
|
|
1090
|
+
* Universal render methods
|
|
1091
|
+
* These are pieces of datetime that
|
|
1092
|
+
* are rendered independently of presentation.
|
|
1180
1093
|
*/
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1094
|
+
renderFooter() {
|
|
1095
|
+
const { disabled, readonly, showDefaultButtons, showClearButton } = this;
|
|
1096
|
+
/**
|
|
1097
|
+
* The cancel, clear, and confirm buttons
|
|
1098
|
+
* should not be interactive if the datetime
|
|
1099
|
+
* is disabled or readonly.
|
|
1100
|
+
*/
|
|
1101
|
+
const isButtonDisabled = disabled || readonly;
|
|
1102
|
+
const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
|
|
1103
|
+
if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
|
|
1104
|
+
return;
|
|
1191
1105
|
}
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
|
|
1196
|
-
// We can re-attach the scroll listener after
|
|
1197
|
-
// the working parts have been updated.
|
|
1198
|
-
this.initializeCalendarListener();
|
|
1199
|
-
ev.stopPropagation();
|
|
1200
|
-
} }));
|
|
1201
|
-
}
|
|
1202
|
-
renderIndividualDatePickerColumns(forcePresentation) {
|
|
1203
|
-
const { workingParts, isDateEnabled } = this;
|
|
1204
|
-
const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
|
|
1205
|
-
const months = shouldRenderMonths
|
|
1206
|
-
? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
|
|
1207
|
-
: [];
|
|
1208
|
-
const shouldRenderDays = forcePresentation === 'date';
|
|
1209
|
-
let days = shouldRenderDays
|
|
1210
|
-
? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
|
|
1211
|
-
: [];
|
|
1212
|
-
if (isDateEnabled) {
|
|
1213
|
-
days = days.map((dayObject) => {
|
|
1214
|
-
const { value } = dayObject;
|
|
1215
|
-
const valueNum = typeof value === 'string' ? parseInt(value) : value;
|
|
1216
|
-
const referenceParts = {
|
|
1217
|
-
month: workingParts.month,
|
|
1218
|
-
day: valueNum,
|
|
1219
|
-
year: workingParts.year,
|
|
1106
|
+
const clearButtonClick = () => {
|
|
1107
|
+
this.reset();
|
|
1108
|
+
this.setValue(undefined);
|
|
1220
1109
|
};
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
}
|
|
1233
|
-
return Object.assign(Object.assign({}, dayObject), { disabled });
|
|
1234
|
-
});
|
|
1110
|
+
/**
|
|
1111
|
+
* By default we render two buttons:
|
|
1112
|
+
* Cancel - Dismisses the datetime and
|
|
1113
|
+
* does not update the `value` prop.
|
|
1114
|
+
* OK - Dismisses the datetime and
|
|
1115
|
+
* updates the `value` prop.
|
|
1116
|
+
*/
|
|
1117
|
+
return (h("div", { class: "datetime-footer" }, h("div", { class: "datetime-buttons" }, h("div", { class: {
|
|
1118
|
+
['datetime-action-buttons']: true,
|
|
1119
|
+
['has-clear-button']: this.showClearButton,
|
|
1120
|
+
} }, h("slot", { name: "buttons" }, h("ion-buttons", null, showDefaultButtons && (h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), h("div", { class: "datetime-action-buttons-container" }, showClearButton && (h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText)))))))));
|
|
1235
1121
|
}
|
|
1236
|
-
const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
|
|
1237
|
-
const years = shouldRenderYears
|
|
1238
|
-
? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
|
|
1239
|
-
: [];
|
|
1240
1122
|
/**
|
|
1241
|
-
*
|
|
1123
|
+
* Wheel picker render methods
|
|
1242
1124
|
*/
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1125
|
+
renderWheelPicker(forcePresentation = this.presentation) {
|
|
1126
|
+
/**
|
|
1127
|
+
* If presentation="time-date" we switch the
|
|
1128
|
+
* order of the render array here instead of
|
|
1129
|
+
* manually reordering each date/time picker
|
|
1130
|
+
* column with CSS. This allows for additional
|
|
1131
|
+
* flexibility if we need to render subsets
|
|
1132
|
+
* of the date/time data or do additional ordering
|
|
1133
|
+
* within the child render functions.
|
|
1134
|
+
*/
|
|
1135
|
+
const renderArray = forcePresentation === 'time-date'
|
|
1136
|
+
? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
|
|
1137
|
+
: [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
|
|
1138
|
+
return h("ion-picker-internal", null, renderArray);
|
|
1251
1139
|
}
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
// the working parts have been updated.
|
|
1302
|
-
this.initializeCalendarListener();
|
|
1303
|
-
ev.stopPropagation();
|
|
1304
|
-
} }));
|
|
1305
|
-
}
|
|
1306
|
-
renderYearPickerColumn(years) {
|
|
1307
|
-
if (years.length === 0) {
|
|
1308
|
-
return [];
|
|
1309
|
-
}
|
|
1310
|
-
const { workingParts } = this;
|
|
1311
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1312
|
-
return (h("ion-picker-column-internal", { class: "year-column", color: this.color, items: years, value: workingParts.year, onIonChange: (ev) => {
|
|
1313
|
-
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1314
|
-
// Due to a Safari 14 issue we need to destroy
|
|
1315
|
-
// the scroll listener before we update state
|
|
1316
|
-
// and trigger a re-render.
|
|
1317
|
-
if (this.destroyCalendarListener) {
|
|
1318
|
-
this.destroyCalendarListener();
|
|
1140
|
+
renderDatePickerColumns(forcePresentation) {
|
|
1141
|
+
return forcePresentation === 'date-time' || forcePresentation === 'time-date'
|
|
1142
|
+
? this.renderCombinedDatePickerColumn()
|
|
1143
|
+
: this.renderIndividualDatePickerColumns(forcePresentation);
|
|
1144
|
+
}
|
|
1145
|
+
renderCombinedDatePickerColumn() {
|
|
1146
|
+
const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
|
|
1147
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1148
|
+
/**
|
|
1149
|
+
* By default, generate a range of 3 months:
|
|
1150
|
+
* Previous month, current month, and next month
|
|
1151
|
+
*/
|
|
1152
|
+
const monthsToRender = generateMonths(workingParts);
|
|
1153
|
+
const lastMonth = monthsToRender[monthsToRender.length - 1];
|
|
1154
|
+
/**
|
|
1155
|
+
* Ensure that users can select the entire window of dates.
|
|
1156
|
+
*/
|
|
1157
|
+
monthsToRender[0].day = 1;
|
|
1158
|
+
lastMonth.day = getNumDaysInMonth(lastMonth.month, lastMonth.year);
|
|
1159
|
+
/**
|
|
1160
|
+
* Narrow the dates rendered based on min/max dates (if any).
|
|
1161
|
+
* The `min` date is used if the min is after the generated min month.
|
|
1162
|
+
* The `max` date is used if the max is before the generated max month.
|
|
1163
|
+
* This ensures that the sliding window always stays at 3 months
|
|
1164
|
+
* but still allows future dates to be lazily rendered based on any min/max
|
|
1165
|
+
* constraints.
|
|
1166
|
+
*/
|
|
1167
|
+
const min = minParts !== undefined && isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
|
|
1168
|
+
const max = maxParts !== undefined && isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
|
|
1169
|
+
const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
|
|
1170
|
+
let items = result.items;
|
|
1171
|
+
const parts = result.parts;
|
|
1172
|
+
if (isDateEnabled) {
|
|
1173
|
+
items = items.map((itemObject, index) => {
|
|
1174
|
+
const referenceParts = parts[index];
|
|
1175
|
+
let disabled;
|
|
1176
|
+
try {
|
|
1177
|
+
/**
|
|
1178
|
+
* The `isDateEnabled` implementation is try-catch wrapped
|
|
1179
|
+
* to prevent exceptions in the user's function from
|
|
1180
|
+
* interrupting the calendar rendering.
|
|
1181
|
+
*/
|
|
1182
|
+
disabled = !isDateEnabled(convertDataToISO(referenceParts));
|
|
1183
|
+
}
|
|
1184
|
+
catch (e) {
|
|
1185
|
+
printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1186
|
+
}
|
|
1187
|
+
return Object.assign(Object.assign({}, itemObject), { disabled });
|
|
1188
|
+
});
|
|
1319
1189
|
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1190
|
+
/**
|
|
1191
|
+
* If we have selected a day already, then default the column
|
|
1192
|
+
* to that value. Otherwise, set it to the default date.
|
|
1193
|
+
*/
|
|
1194
|
+
const todayString = workingParts.day !== null
|
|
1195
|
+
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
1196
|
+
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
1197
|
+
return (h("ion-picker-column-internal", { class: "date-column", color: this.color, disabled: disabled, items: items, value: todayString, onIonChange: (ev) => {
|
|
1198
|
+
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1199
|
+
// Due to a Safari 14 issue we need to destroy
|
|
1200
|
+
// the scroll listener before we update state
|
|
1201
|
+
// and trigger a re-render.
|
|
1202
|
+
if (this.destroyCalendarListener) {
|
|
1203
|
+
this.destroyCalendarListener();
|
|
1204
|
+
}
|
|
1205
|
+
const { value } = ev.detail;
|
|
1206
|
+
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
1207
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
|
|
1208
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
|
|
1209
|
+
// We can re-attach the scroll listener after
|
|
1210
|
+
// the working parts have been updated.
|
|
1211
|
+
this.initializeCalendarListener();
|
|
1212
|
+
ev.stopPropagation();
|
|
1213
|
+
} }));
|
|
1331
1214
|
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
} }));
|
|
1371
|
-
}
|
|
1372
|
-
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
1373
|
-
const { workingParts } = this;
|
|
1374
|
-
if (dayPeriodData.length === 0) {
|
|
1375
|
-
return [];
|
|
1376
|
-
}
|
|
1377
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1378
|
-
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
1379
|
-
return (h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
|
|
1380
|
-
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
1381
|
-
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
1382
|
-
this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
|
|
1383
|
-
ev.stopPropagation();
|
|
1384
|
-
} }));
|
|
1385
|
-
}
|
|
1386
|
-
renderWheelView(forcePresentation) {
|
|
1387
|
-
const { locale } = this;
|
|
1388
|
-
const showMonthFirst = isMonthFirstLocale(locale);
|
|
1389
|
-
const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
|
|
1390
|
-
return (h("div", { class: {
|
|
1391
|
-
[`wheel-order-${columnOrder}`]: true,
|
|
1392
|
-
} }, this.renderWheelPicker(forcePresentation)));
|
|
1393
|
-
}
|
|
1394
|
-
/**
|
|
1395
|
-
* Grid Render Methods
|
|
1396
|
-
*/
|
|
1397
|
-
renderCalendarHeader(mode) {
|
|
1398
|
-
const { disabled } = this;
|
|
1399
|
-
const expandedIcon = mode === 'ios' ? chevronDown : caretUpSharp;
|
|
1400
|
-
const collapsedIcon = mode === 'ios' ? chevronForward : caretDownSharp;
|
|
1401
|
-
const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
|
|
1402
|
-
const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
|
|
1403
|
-
// don't use the inheritAttributes util because it removes dir from the host, and we still need that
|
|
1404
|
-
const hostDir = this.el.getAttribute('dir') || undefined;
|
|
1405
|
-
return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("ion-item", { part: "month-year-button", ref: (el) => (this.monthYearToggleItemRef = el), button: true, "aria-label": "Show year picker", detail: false, lines: "none", disabled: disabled, onClick: () => {
|
|
1406
|
-
var _a;
|
|
1407
|
-
this.toggleMonthAndYearView();
|
|
1215
|
+
renderIndividualDatePickerColumns(forcePresentation) {
|
|
1216
|
+
const { workingParts, isDateEnabled } = this;
|
|
1217
|
+
const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
|
|
1218
|
+
const months = shouldRenderMonths
|
|
1219
|
+
? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
|
|
1220
|
+
: [];
|
|
1221
|
+
const shouldRenderDays = forcePresentation === 'date';
|
|
1222
|
+
let days = shouldRenderDays
|
|
1223
|
+
? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
|
|
1224
|
+
: [];
|
|
1225
|
+
if (isDateEnabled) {
|
|
1226
|
+
days = days.map((dayObject) => {
|
|
1227
|
+
const { value } = dayObject;
|
|
1228
|
+
const valueNum = typeof value === 'string' ? parseInt(value) : value;
|
|
1229
|
+
const referenceParts = {
|
|
1230
|
+
month: workingParts.month,
|
|
1231
|
+
day: valueNum,
|
|
1232
|
+
year: workingParts.year,
|
|
1233
|
+
};
|
|
1234
|
+
let disabled;
|
|
1235
|
+
try {
|
|
1236
|
+
/**
|
|
1237
|
+
* The `isDateEnabled` implementation is try-catch wrapped
|
|
1238
|
+
* to prevent exceptions in the user's function from
|
|
1239
|
+
* interrupting the calendar rendering.
|
|
1240
|
+
*/
|
|
1241
|
+
disabled = !isDateEnabled(convertDataToISO(referenceParts));
|
|
1242
|
+
}
|
|
1243
|
+
catch (e) {
|
|
1244
|
+
printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
|
|
1245
|
+
}
|
|
1246
|
+
return Object.assign(Object.assign({}, dayObject), { disabled });
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
|
|
1250
|
+
const years = shouldRenderYears
|
|
1251
|
+
? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
|
|
1252
|
+
: [];
|
|
1408
1253
|
/**
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
* Currently there is not a way to set the aria-label on the inner button
|
|
1412
|
-
* on the `ion-item` and have it be reactive to changes. This is a workaround
|
|
1413
|
-
* until we either refactor `ion-item` to a button or Stencil adds a way to
|
|
1414
|
-
* have reactive props for built-in properties, such as `aria-label`.
|
|
1254
|
+
* Certain locales show the day before the month.
|
|
1415
1255
|
*/
|
|
1416
|
-
const {
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1256
|
+
const showMonthFirst = isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
|
|
1257
|
+
let renderArray = [];
|
|
1258
|
+
if (showMonthFirst) {
|
|
1259
|
+
renderArray = [
|
|
1260
|
+
this.renderMonthPickerColumn(months),
|
|
1261
|
+
this.renderDayPickerColumn(days),
|
|
1262
|
+
this.renderYearPickerColumn(years),
|
|
1263
|
+
];
|
|
1423
1264
|
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
|
|
1431
|
-
const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
|
|
1432
|
-
const isCalMonthDisabled = !yearAllowed || !monthAllowed;
|
|
1433
|
-
const isDatetimeDisabled = disabled || readonly;
|
|
1434
|
-
const swipeDisabled = disabled ||
|
|
1435
|
-
isMonthDisabled({
|
|
1436
|
-
month,
|
|
1437
|
-
year,
|
|
1438
|
-
day: null,
|
|
1439
|
-
}, {
|
|
1440
|
-
// The day is not used when checking if a month is disabled.
|
|
1441
|
-
// Users should be able to access the min or max month, even if the
|
|
1442
|
-
// min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
|
|
1443
|
-
minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
|
|
1444
|
-
maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
|
|
1445
|
-
});
|
|
1446
|
-
// The working month should never have swipe disabled.
|
|
1447
|
-
// Otherwise the CSS scroll snap will not work and the user
|
|
1448
|
-
// can free-scroll the calendar.
|
|
1449
|
-
const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
|
|
1450
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1451
|
-
return (h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
|
|
1452
|
-
'calendar-month': true,
|
|
1453
|
-
// Prevents scroll snap swipe gestures for months outside of the min/max bounds
|
|
1454
|
-
'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
|
|
1455
|
-
} }, h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7).map((dateObject, index) => {
|
|
1456
|
-
const { day, dayOfWeek } = dateObject;
|
|
1457
|
-
const { el, highlightedDates, isDateEnabled, multiple } = this;
|
|
1458
|
-
const referenceParts = { month, day, year };
|
|
1459
|
-
const isCalendarPadding = day === null;
|
|
1460
|
-
const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
|
|
1461
|
-
const dateIsoString = convertDataToISO(referenceParts);
|
|
1462
|
-
let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
|
|
1463
|
-
if (!isCalDayDisabled && isDateEnabled !== undefined) {
|
|
1464
|
-
try {
|
|
1465
|
-
/**
|
|
1466
|
-
* The `isDateEnabled` implementation is try-catch wrapped
|
|
1467
|
-
* to prevent exceptions in the user's function from
|
|
1468
|
-
* interrupting the calendar rendering.
|
|
1469
|
-
*/
|
|
1470
|
-
isCalDayDisabled = !isDateEnabled(dateIsoString);
|
|
1265
|
+
else {
|
|
1266
|
+
renderArray = [
|
|
1267
|
+
this.renderDayPickerColumn(days),
|
|
1268
|
+
this.renderMonthPickerColumn(months),
|
|
1269
|
+
this.renderYearPickerColumn(years),
|
|
1270
|
+
];
|
|
1471
1271
|
}
|
|
1472
|
-
|
|
1473
|
-
|
|
1272
|
+
return renderArray;
|
|
1273
|
+
}
|
|
1274
|
+
renderDayPickerColumn(days) {
|
|
1275
|
+
var _a;
|
|
1276
|
+
if (days.length === 0) {
|
|
1277
|
+
return [];
|
|
1474
1278
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
}
|
|
1497
|
-
return (h("div", { class: "calendar-day-wrapper" }, h("button", {
|
|
1498
|
-
// We need to use !important for the inline styles here because
|
|
1499
|
-
// otherwise the CSS shadow parts will override these styles.
|
|
1500
|
-
// See https://github.com/WICG/webcomponents/issues/847
|
|
1501
|
-
// Both the CSS shadow parts and highlightedDates styles are
|
|
1502
|
-
// provided by the developer, but highlightedDates styles should
|
|
1503
|
-
// always take priority.
|
|
1504
|
-
ref: (el) => {
|
|
1505
|
-
if (el) {
|
|
1506
|
-
el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
|
|
1507
|
-
el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
|
|
1508
|
-
}
|
|
1509
|
-
}, tabindex: "-1", "data-day": day, "data-month": month, "data-year": year, "data-index": index, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
|
|
1510
|
-
'calendar-day-padding': isCalendarPadding,
|
|
1511
|
-
'calendar-day': true,
|
|
1512
|
-
'calendar-day-active': isActive,
|
|
1513
|
-
'calendar-day-constrained': isCalDayConstrained,
|
|
1514
|
-
'calendar-day-today': isToday,
|
|
1515
|
-
}, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
|
|
1516
|
-
if (isCalendarPadding) {
|
|
1517
|
-
return;
|
|
1518
|
-
}
|
|
1519
|
-
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month,
|
|
1520
|
-
day,
|
|
1521
|
-
year }));
|
|
1522
|
-
// multiple only needs date info, so we can wipe out other fields like time
|
|
1523
|
-
if (multiple) {
|
|
1524
|
-
this.setActiveParts({
|
|
1525
|
-
month,
|
|
1526
|
-
day,
|
|
1527
|
-
year,
|
|
1528
|
-
}, isActive);
|
|
1529
|
-
}
|
|
1530
|
-
else {
|
|
1531
|
-
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month,
|
|
1532
|
-
day,
|
|
1533
|
-
year }));
|
|
1534
|
-
}
|
|
1279
|
+
const { disabled, workingParts } = this;
|
|
1280
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1281
|
+
return (h("ion-picker-column-internal", { class: "day-column", color: this.color, disabled: disabled, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
|
|
1282
|
+
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1283
|
+
// Due to a Safari 14 issue we need to destroy
|
|
1284
|
+
// the scroll listener before we update state
|
|
1285
|
+
// and trigger a re-render.
|
|
1286
|
+
if (this.destroyCalendarListener) {
|
|
1287
|
+
this.destroyCalendarListener();
|
|
1288
|
+
}
|
|
1289
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
|
|
1290
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
|
|
1291
|
+
// We can re-attach the scroll listener after
|
|
1292
|
+
// the working parts have been updated.
|
|
1293
|
+
this.initializeCalendarListener();
|
|
1294
|
+
ev.stopPropagation();
|
|
1295
|
+
} }));
|
|
1296
|
+
}
|
|
1297
|
+
renderMonthPickerColumn(months) {
|
|
1298
|
+
if (months.length === 0) {
|
|
1299
|
+
return [];
|
|
1535
1300
|
}
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
const activePart = this.getActivePartsWithFallback();
|
|
1558
|
-
return [
|
|
1559
|
-
h("div", { class: "time-header" }, this.renderTimeLabel()),
|
|
1560
|
-
h("button", { class: {
|
|
1561
|
-
'time-body': true,
|
|
1562
|
-
'time-body-active': isTimePopoverOpen,
|
|
1563
|
-
}, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
|
|
1564
|
-
const { popoverRef } = this;
|
|
1565
|
-
if (popoverRef) {
|
|
1566
|
-
this.isTimePopoverOpen = true;
|
|
1567
|
-
popoverRef.present(new CustomEvent('ionShadowTarget', {
|
|
1568
|
-
detail: {
|
|
1569
|
-
ionShadowTarget: ev.target,
|
|
1570
|
-
},
|
|
1571
|
-
}));
|
|
1572
|
-
await popoverRef.onWillDismiss();
|
|
1573
|
-
this.isTimePopoverOpen = false;
|
|
1574
|
-
}
|
|
1575
|
-
} }, getLocalizedTime(locale, activePart, computedHourCycle)),
|
|
1576
|
-
h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
1577
|
-
/**
|
|
1578
|
-
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
1579
|
-
* when toggling the visibility of the popover and trying to scroll the picker
|
|
1580
|
-
* column to the correct time value.
|
|
1581
|
-
*
|
|
1582
|
-
* This will correctly scroll the element position to the correct time value,
|
|
1583
|
-
* before the popover is fully presented.
|
|
1584
|
-
*/
|
|
1585
|
-
const cols = ev.target.querySelectorAll('ion-picker-column-internal');
|
|
1586
|
-
// TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
|
|
1587
|
-
cols.forEach((col) => col.scrollActiveItemIntoView());
|
|
1588
|
-
}, style: {
|
|
1589
|
-
'--offset-y': '-10px',
|
|
1590
|
-
'--min-width': 'fit-content',
|
|
1591
|
-
},
|
|
1592
|
-
// Allow native browser keyboard events to support up/down/home/end key
|
|
1593
|
-
// navigation within the time picker.
|
|
1594
|
-
keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
|
|
1595
|
-
];
|
|
1596
|
-
}
|
|
1597
|
-
getHeaderSelectedDateText() {
|
|
1598
|
-
const { activeParts, multiple, titleSelectedDatesFormatter } = this;
|
|
1599
|
-
const isArray = Array.isArray(activeParts);
|
|
1600
|
-
let headerText;
|
|
1601
|
-
if (multiple && isArray && activeParts.length !== 1) {
|
|
1602
|
-
headerText = `${activeParts.length} days`; // default/fallback for multiple selection
|
|
1603
|
-
if (titleSelectedDatesFormatter !== undefined) {
|
|
1604
|
-
try {
|
|
1605
|
-
headerText = titleSelectedDatesFormatter(convertDataToISO(activeParts));
|
|
1301
|
+
const { disabled, workingParts } = this;
|
|
1302
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1303
|
+
return (h("ion-picker-column-internal", { class: "month-column", color: this.color, disabled: disabled, items: months, value: workingParts.month, onIonChange: (ev) => {
|
|
1304
|
+
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1305
|
+
// Due to a Safari 14 issue we need to destroy
|
|
1306
|
+
// the scroll listener before we update state
|
|
1307
|
+
// and trigger a re-render.
|
|
1308
|
+
if (this.destroyCalendarListener) {
|
|
1309
|
+
this.destroyCalendarListener();
|
|
1310
|
+
}
|
|
1311
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
|
|
1312
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
|
|
1313
|
+
// We can re-attach the scroll listener after
|
|
1314
|
+
// the working parts have been updated.
|
|
1315
|
+
this.initializeCalendarListener();
|
|
1316
|
+
ev.stopPropagation();
|
|
1317
|
+
} }));
|
|
1318
|
+
}
|
|
1319
|
+
renderYearPickerColumn(years) {
|
|
1320
|
+
if (years.length === 0) {
|
|
1321
|
+
return [];
|
|
1606
1322
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1323
|
+
const { disabled, workingParts } = this;
|
|
1324
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1325
|
+
return (h("ion-picker-column-internal", { class: "year-column", color: this.color, disabled: disabled, items: years, value: workingParts.year, onIonChange: (ev) => {
|
|
1326
|
+
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
|
|
1327
|
+
// Due to a Safari 14 issue we need to destroy
|
|
1328
|
+
// the scroll listener before we update state
|
|
1329
|
+
// and trigger a re-render.
|
|
1330
|
+
if (this.destroyCalendarListener) {
|
|
1331
|
+
this.destroyCalendarListener();
|
|
1332
|
+
}
|
|
1333
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
|
|
1334
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
|
|
1335
|
+
// We can re-attach the scroll listener after
|
|
1336
|
+
// the working parts have been updated.
|
|
1337
|
+
this.initializeCalendarListener();
|
|
1338
|
+
ev.stopPropagation();
|
|
1339
|
+
} }));
|
|
1340
|
+
}
|
|
1341
|
+
renderTimePickerColumns(forcePresentation) {
|
|
1342
|
+
if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
|
|
1343
|
+
return [];
|
|
1609
1344
|
}
|
|
1610
|
-
|
|
1345
|
+
/**
|
|
1346
|
+
* If a user has not selected a date,
|
|
1347
|
+
* then we should show all times. If the
|
|
1348
|
+
* user has selected a date (even if it has
|
|
1349
|
+
* not been confirmed yet), we should apply
|
|
1350
|
+
* the max and min restrictions so that the
|
|
1351
|
+
* time picker shows values that are
|
|
1352
|
+
* appropriate for the selected date.
|
|
1353
|
+
*/
|
|
1354
|
+
const activePart = this.getActivePart();
|
|
1355
|
+
const userHasSelectedDate = activePart !== undefined;
|
|
1356
|
+
const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
|
|
1357
|
+
return [
|
|
1358
|
+
this.renderHourPickerColumn(hoursData),
|
|
1359
|
+
this.renderMinutePickerColumn(minutesData),
|
|
1360
|
+
this.renderDayPeriodPickerColumn(dayPeriodData),
|
|
1361
|
+
];
|
|
1362
|
+
}
|
|
1363
|
+
renderHourPickerColumn(hoursData) {
|
|
1364
|
+
const { disabled, workingParts } = this;
|
|
1365
|
+
if (hoursData.length === 0)
|
|
1366
|
+
return [];
|
|
1367
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1368
|
+
return (h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
|
|
1369
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
1370
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
|
|
1371
|
+
ev.stopPropagation();
|
|
1372
|
+
} }));
|
|
1373
|
+
}
|
|
1374
|
+
renderMinutePickerColumn(minutesData) {
|
|
1375
|
+
const { disabled, workingParts } = this;
|
|
1376
|
+
if (minutesData.length === 0)
|
|
1377
|
+
return [];
|
|
1378
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1379
|
+
return (h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
|
|
1380
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
1381
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
|
|
1382
|
+
ev.stopPropagation();
|
|
1383
|
+
} }));
|
|
1384
|
+
}
|
|
1385
|
+
renderDayPeriodPickerColumn(dayPeriodData) {
|
|
1386
|
+
const { disabled, workingParts } = this;
|
|
1387
|
+
if (dayPeriodData.length === 0) {
|
|
1388
|
+
return [];
|
|
1389
|
+
}
|
|
1390
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1391
|
+
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
1392
|
+
return (h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
|
|
1393
|
+
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
1394
|
+
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
1395
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
|
|
1396
|
+
ev.stopPropagation();
|
|
1397
|
+
} }));
|
|
1398
|
+
}
|
|
1399
|
+
renderWheelView(forcePresentation) {
|
|
1400
|
+
const { locale } = this;
|
|
1401
|
+
const showMonthFirst = isMonthFirstLocale(locale);
|
|
1402
|
+
const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
|
|
1403
|
+
return (h("div", { class: {
|
|
1404
|
+
[`wheel-order-${columnOrder}`]: true,
|
|
1405
|
+
} }, this.renderWheelPicker(forcePresentation)));
|
|
1611
1406
|
}
|
|
1612
|
-
else {
|
|
1613
|
-
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
1614
|
-
headerText = getMonthAndDay(this.locale, this.getActivePartsWithFallback());
|
|
1615
|
-
}
|
|
1616
|
-
return headerText;
|
|
1617
|
-
}
|
|
1618
|
-
renderHeader(showExpandedHeader = true) {
|
|
1619
|
-
const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
|
|
1620
|
-
if (!hasSlottedTitle && !this.showDefaultTitle) {
|
|
1621
|
-
return;
|
|
1622
|
-
}
|
|
1623
|
-
return (h("div", { class: "datetime-header" }, h("div", { class: "datetime-title" }, h("slot", { name: "title" }, "Select Date")), showExpandedHeader && h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
|
|
1624
|
-
}
|
|
1625
|
-
/**
|
|
1626
|
-
* Render time picker inside of datetime.
|
|
1627
|
-
* Do not pass color prop to segment on
|
|
1628
|
-
* iOS mode. MD segment has been customized and
|
|
1629
|
-
* should take on the color prop, but iOS
|
|
1630
|
-
* should just be the default segment.
|
|
1631
|
-
*/
|
|
1632
|
-
renderTime() {
|
|
1633
|
-
const { presentation } = this;
|
|
1634
|
-
const timeOnlyPresentation = presentation === 'time';
|
|
1635
|
-
return (h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
|
|
1636
|
-
}
|
|
1637
|
-
/**
|
|
1638
|
-
* Renders the month/year picker that is
|
|
1639
|
-
* displayed on the calendar grid.
|
|
1640
|
-
* The .datetime-year class has additional
|
|
1641
|
-
* styles that let us show/hide the
|
|
1642
|
-
* picker when the user clicks on the
|
|
1643
|
-
* toggle in the calendar header.
|
|
1644
|
-
*/
|
|
1645
|
-
renderCalendarViewMonthYearPicker() {
|
|
1646
|
-
return h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
|
|
1647
|
-
}
|
|
1648
|
-
/**
|
|
1649
|
-
* Render entry point
|
|
1650
|
-
* All presentation types are rendered from here.
|
|
1651
|
-
*/
|
|
1652
|
-
renderDatetime(mode) {
|
|
1653
|
-
const { presentation, preferWheel } = this;
|
|
1654
1407
|
/**
|
|
1655
|
-
*
|
|
1656
|
-
* If preferWheel is true then we should show a wheel picker instead.
|
|
1408
|
+
* Grid Render Methods
|
|
1657
1409
|
*/
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1410
|
+
renderCalendarHeader(mode) {
|
|
1411
|
+
const { disabled } = this;
|
|
1412
|
+
const expandedIcon = mode === 'ios' ? chevronDown : caretUpSharp;
|
|
1413
|
+
const collapsedIcon = mode === 'ios' ? chevronForward : caretDownSharp;
|
|
1414
|
+
const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
|
|
1415
|
+
const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
|
|
1416
|
+
// don't use the inheritAttributes util because it removes dir from the host, and we still need that
|
|
1417
|
+
const hostDir = this.el.getAttribute('dir') || undefined;
|
|
1418
|
+
return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("ion-item", { part: "month-year-button", ref: (el) => (this.monthYearToggleItemRef = el), button: true, "aria-label": "Show year picker", detail: false, lines: "none", disabled: disabled, onClick: () => {
|
|
1419
|
+
var _a;
|
|
1420
|
+
this.toggleMonthAndYearView();
|
|
1421
|
+
/**
|
|
1422
|
+
* TODO: FW-3547
|
|
1423
|
+
*
|
|
1424
|
+
* Currently there is not a way to set the aria-label on the inner button
|
|
1425
|
+
* on the `ion-item` and have it be reactive to changes. This is a workaround
|
|
1426
|
+
* until we either refactor `ion-item` to a button or Stencil adds a way to
|
|
1427
|
+
* have reactive props for built-in properties, such as `aria-label`.
|
|
1428
|
+
*/
|
|
1429
|
+
const { monthYearToggleItemRef } = this;
|
|
1430
|
+
if (monthYearToggleItemRef) {
|
|
1431
|
+
const btn = (_a = monthYearToggleItemRef.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.item-native');
|
|
1432
|
+
if (btn) {
|
|
1433
|
+
const monthYearAriaLabel = this.showMonthAndYear ? 'Hide year picker' : 'Show year picker';
|
|
1434
|
+
btn.setAttribute('aria-label', monthYearAriaLabel);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
} }, h("ion-label", null, getMonthAndYear(this.locale, this.workingParts), h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })))), h("div", { class: "calendar-next-prev" }, h("ion-buttons", null, h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
|
|
1438
|
+
return h("div", { class: "day-of-week" }, d);
|
|
1439
|
+
}))));
|
|
1661
1440
|
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1441
|
+
renderMonth(month, year) {
|
|
1442
|
+
const { disabled, readonly } = this;
|
|
1443
|
+
const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
|
|
1444
|
+
const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
|
|
1445
|
+
const isCalMonthDisabled = !yearAllowed || !monthAllowed;
|
|
1446
|
+
const isDatetimeDisabled = disabled || readonly;
|
|
1447
|
+
const swipeDisabled = disabled ||
|
|
1448
|
+
isMonthDisabled({
|
|
1449
|
+
month,
|
|
1450
|
+
year,
|
|
1451
|
+
day: null,
|
|
1452
|
+
}, {
|
|
1453
|
+
// The day is not used when checking if a month is disabled.
|
|
1454
|
+
// Users should be able to access the min or max month, even if the
|
|
1455
|
+
// min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
|
|
1456
|
+
minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
|
|
1457
|
+
maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
|
|
1458
|
+
});
|
|
1459
|
+
// The working month should never have swipe disabled.
|
|
1460
|
+
// Otherwise the CSS scroll snap will not work and the user
|
|
1461
|
+
// can free-scroll the calendar.
|
|
1462
|
+
const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
|
|
1463
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1464
|
+
return (h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
|
|
1465
|
+
'calendar-month': true,
|
|
1466
|
+
// Prevents scroll snap swipe gestures for months outside of the min/max bounds
|
|
1467
|
+
'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
|
|
1468
|
+
} }, h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7).map((dateObject, index) => {
|
|
1469
|
+
const { day, dayOfWeek } = dateObject;
|
|
1470
|
+
const { el, highlightedDates, isDateEnabled, multiple } = this;
|
|
1471
|
+
const referenceParts = { month, day, year };
|
|
1472
|
+
const isCalendarPadding = day === null;
|
|
1473
|
+
const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
|
|
1474
|
+
const dateIsoString = convertDataToISO(referenceParts);
|
|
1475
|
+
let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
|
|
1476
|
+
if (!isCalDayDisabled && isDateEnabled !== undefined) {
|
|
1477
|
+
try {
|
|
1478
|
+
/**
|
|
1479
|
+
* The `isDateEnabled` implementation is try-catch wrapped
|
|
1480
|
+
* to prevent exceptions in the user's function from
|
|
1481
|
+
* interrupting the calendar rendering.
|
|
1482
|
+
*/
|
|
1483
|
+
isCalDayDisabled = !isDateEnabled(dateIsoString);
|
|
1484
|
+
}
|
|
1485
|
+
catch (e) {
|
|
1486
|
+
printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Some days are constrained through max & min or allowed dates
|
|
1491
|
+
* and also disabled because the component is readonly or disabled.
|
|
1492
|
+
* These need to be displayed differently.
|
|
1493
|
+
*/
|
|
1494
|
+
const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
|
|
1495
|
+
const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
|
|
1496
|
+
let dateStyle = undefined;
|
|
1497
|
+
/**
|
|
1498
|
+
* Custom highlight styles should not override the style for selected dates,
|
|
1499
|
+
* nor apply to "filler days" at the start of the grid.
|
|
1500
|
+
*/
|
|
1501
|
+
if (highlightedDates !== undefined && !isActive && day !== null) {
|
|
1502
|
+
dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
|
|
1503
|
+
}
|
|
1504
|
+
let dateParts = undefined;
|
|
1505
|
+
// "Filler days" at the beginning of the grid should not get the calendar day
|
|
1506
|
+
// CSS parts added to them
|
|
1507
|
+
if (!isCalendarPadding) {
|
|
1508
|
+
dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
|
|
1509
|
+
}
|
|
1510
|
+
return (h("div", { class: "calendar-day-wrapper" }, h("button", {
|
|
1511
|
+
// We need to use !important for the inline styles here because
|
|
1512
|
+
// otherwise the CSS shadow parts will override these styles.
|
|
1513
|
+
// See https://github.com/WICG/webcomponents/issues/847
|
|
1514
|
+
// Both the CSS shadow parts and highlightedDates styles are
|
|
1515
|
+
// provided by the developer, but highlightedDates styles should
|
|
1516
|
+
// always take priority.
|
|
1517
|
+
ref: (el) => {
|
|
1518
|
+
if (el) {
|
|
1519
|
+
el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
|
|
1520
|
+
el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
|
|
1521
|
+
}
|
|
1522
|
+
}, tabindex: "-1", "data-day": day, "data-month": month, "data-year": year, "data-index": index, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
|
|
1523
|
+
'calendar-day-padding': isCalendarPadding,
|
|
1524
|
+
'calendar-day': true,
|
|
1525
|
+
'calendar-day-active': isActive,
|
|
1526
|
+
'calendar-day-constrained': isCalDayConstrained,
|
|
1527
|
+
'calendar-day-today': isToday,
|
|
1528
|
+
}, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
|
|
1529
|
+
if (isCalendarPadding) {
|
|
1530
|
+
return;
|
|
1531
|
+
}
|
|
1532
|
+
this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month,
|
|
1533
|
+
day,
|
|
1534
|
+
year }));
|
|
1535
|
+
// multiple only needs date info, so we can wipe out other fields like time
|
|
1536
|
+
if (multiple) {
|
|
1537
|
+
this.setActiveParts({
|
|
1538
|
+
month,
|
|
1539
|
+
day,
|
|
1540
|
+
year,
|
|
1541
|
+
}, isActive);
|
|
1542
|
+
}
|
|
1543
|
+
else {
|
|
1544
|
+
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month,
|
|
1545
|
+
day,
|
|
1546
|
+
year }));
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
}, text)));
|
|
1550
|
+
}))));
|
|
1551
|
+
}
|
|
1552
|
+
renderCalendarBody() {
|
|
1553
|
+
return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
|
|
1554
|
+
return this.renderMonth(month, year);
|
|
1555
|
+
})));
|
|
1556
|
+
}
|
|
1557
|
+
renderCalendar(mode) {
|
|
1558
|
+
return (h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(mode), this.renderCalendarBody()));
|
|
1559
|
+
}
|
|
1560
|
+
renderTimeLabel() {
|
|
1561
|
+
const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
|
|
1562
|
+
if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
|
|
1563
|
+
return;
|
|
1564
|
+
}
|
|
1565
|
+
return h("slot", { name: "time-label" }, "Time");
|
|
1566
|
+
}
|
|
1567
|
+
renderTimeOverlay() {
|
|
1568
|
+
const { disabled, hourCycle, isTimePopoverOpen, locale } = this;
|
|
1569
|
+
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
1570
|
+
const activePart = this.getActivePartsWithFallback();
|
|
1686
1571
|
return [
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1572
|
+
h("div", { class: "time-header" }, this.renderTimeLabel()),
|
|
1573
|
+
h("button", { class: {
|
|
1574
|
+
'time-body': true,
|
|
1575
|
+
'time-body-active': isTimePopoverOpen,
|
|
1576
|
+
}, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
|
|
1577
|
+
const { popoverRef } = this;
|
|
1578
|
+
if (popoverRef) {
|
|
1579
|
+
this.isTimePopoverOpen = true;
|
|
1580
|
+
popoverRef.present(new CustomEvent('ionShadowTarget', {
|
|
1581
|
+
detail: {
|
|
1582
|
+
ionShadowTarget: ev.target,
|
|
1583
|
+
},
|
|
1584
|
+
}));
|
|
1585
|
+
await popoverRef.onWillDismiss();
|
|
1586
|
+
this.isTimePopoverOpen = false;
|
|
1587
|
+
}
|
|
1588
|
+
} }, getLocalizedTime(locale, activePart, computedHourCycle)),
|
|
1589
|
+
h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
1590
|
+
/**
|
|
1591
|
+
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
1592
|
+
* when toggling the visibility of the popover and trying to scroll the picker
|
|
1593
|
+
* column to the correct time value.
|
|
1594
|
+
*
|
|
1595
|
+
* This will correctly scroll the element position to the correct time value,
|
|
1596
|
+
* before the popover is fully presented.
|
|
1597
|
+
*/
|
|
1598
|
+
const cols = ev.target.querySelectorAll('ion-picker-column-internal');
|
|
1599
|
+
// TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
|
|
1600
|
+
cols.forEach((col) => col.scrollActiveItemIntoView());
|
|
1601
|
+
}, style: {
|
|
1602
|
+
'--offset-y': '-10px',
|
|
1603
|
+
'--min-width': 'fit-content',
|
|
1604
|
+
},
|
|
1605
|
+
// Allow native browser keyboard events to support up/down/home/end key
|
|
1606
|
+
// navigation within the time picker.
|
|
1607
|
+
keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
|
|
1691
1608
|
];
|
|
1692
1609
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1610
|
+
getHeaderSelectedDateText() {
|
|
1611
|
+
const { activeParts, multiple, titleSelectedDatesFormatter } = this;
|
|
1612
|
+
const isArray = Array.isArray(activeParts);
|
|
1613
|
+
let headerText;
|
|
1614
|
+
if (multiple && isArray && activeParts.length !== 1) {
|
|
1615
|
+
headerText = `${activeParts.length} days`; // default/fallback for multiple selection
|
|
1616
|
+
if (titleSelectedDatesFormatter !== undefined) {
|
|
1617
|
+
try {
|
|
1618
|
+
headerText = titleSelectedDatesFormatter(convertDataToISO(activeParts));
|
|
1619
|
+
}
|
|
1620
|
+
catch (e) {
|
|
1621
|
+
printIonError('Exception in provided `titleSelectedDatesFormatter`: ', e);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
else {
|
|
1626
|
+
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
1627
|
+
headerText = getMonthAndDay(this.locale, this.getActivePartsWithFallback());
|
|
1628
|
+
}
|
|
1629
|
+
return headerText;
|
|
1630
|
+
}
|
|
1631
|
+
renderHeader(showExpandedHeader = true) {
|
|
1632
|
+
const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
|
|
1633
|
+
if (!hasSlottedTitle && !this.showDefaultTitle) {
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1636
|
+
return (h("div", { class: "datetime-header" }, h("div", { class: "datetime-title" }, h("slot", { name: "title" }, "Select Date")), showExpandedHeader && h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Render time picker inside of datetime.
|
|
1640
|
+
* Do not pass color prop to segment on
|
|
1641
|
+
* iOS mode. MD segment has been customized and
|
|
1642
|
+
* should take on the color prop, but iOS
|
|
1643
|
+
* should just be the default segment.
|
|
1644
|
+
*/
|
|
1645
|
+
renderTime() {
|
|
1646
|
+
const { presentation } = this;
|
|
1647
|
+
const timeOnlyPresentation = presentation === 'time';
|
|
1648
|
+
return (h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
|
|
1649
|
+
}
|
|
1650
|
+
/**
|
|
1651
|
+
* Renders the month/year picker that is
|
|
1652
|
+
* displayed on the calendar grid.
|
|
1653
|
+
* The .datetime-year class has additional
|
|
1654
|
+
* styles that let us show/hide the
|
|
1655
|
+
* picker when the user clicks on the
|
|
1656
|
+
* toggle in the calendar header.
|
|
1657
|
+
*/
|
|
1658
|
+
renderCalendarViewMonthYearPicker() {
|
|
1659
|
+
return h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* Render entry point
|
|
1663
|
+
* All presentation types are rendered from here.
|
|
1664
|
+
*/
|
|
1665
|
+
renderDatetime(mode) {
|
|
1666
|
+
const { presentation, preferWheel } = this;
|
|
1667
|
+
/**
|
|
1668
|
+
* Certain presentation types have separate grid and wheel displays.
|
|
1669
|
+
* If preferWheel is true then we should show a wheel picker instead.
|
|
1670
|
+
*/
|
|
1671
|
+
const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1672
|
+
if (preferWheel && hasWheelVariant) {
|
|
1673
|
+
return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
|
|
1674
|
+
}
|
|
1675
|
+
switch (presentation) {
|
|
1676
|
+
case 'date-time':
|
|
1677
|
+
return [
|
|
1678
|
+
this.renderHeader(),
|
|
1679
|
+
this.renderCalendar(mode),
|
|
1680
|
+
this.renderCalendarViewMonthYearPicker(),
|
|
1681
|
+
this.renderTime(),
|
|
1682
|
+
this.renderFooter(),
|
|
1683
|
+
];
|
|
1684
|
+
case 'time-date':
|
|
1685
|
+
return [
|
|
1686
|
+
this.renderHeader(),
|
|
1687
|
+
this.renderTime(),
|
|
1688
|
+
this.renderCalendar(mode),
|
|
1689
|
+
this.renderCalendarViewMonthYearPicker(),
|
|
1690
|
+
this.renderFooter(),
|
|
1691
|
+
];
|
|
1692
|
+
case 'time':
|
|
1693
|
+
return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
|
|
1694
|
+
case 'month':
|
|
1695
|
+
case 'month-year':
|
|
1696
|
+
case 'year':
|
|
1697
|
+
return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
|
|
1698
|
+
default:
|
|
1699
|
+
return [
|
|
1700
|
+
this.renderHeader(),
|
|
1701
|
+
this.renderCalendar(mode),
|
|
1702
|
+
this.renderCalendarViewMonthYearPicker(),
|
|
1703
|
+
this.renderFooter(),
|
|
1704
|
+
];
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
render() {
|
|
1708
|
+
const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
|
|
1709
|
+
const mode = getIonMode(this);
|
|
1710
|
+
const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
|
|
1711
|
+
const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
|
|
1712
|
+
const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
|
|
1713
|
+
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1714
|
+
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1715
|
+
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1716
|
+
return (h(Host, { "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1717
|
+
[mode]: true,
|
|
1718
|
+
['datetime-readonly']: readonly,
|
|
1719
|
+
['datetime-disabled']: disabled,
|
|
1720
|
+
'show-month-and-year': shouldShowMonthAndYear,
|
|
1721
|
+
'month-year-picker-open': monthYearPickerOpen,
|
|
1722
|
+
[`datetime-presentation-${presentation}`]: true,
|
|
1723
|
+
[`datetime-size-${size}`]: true,
|
|
1724
|
+
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1725
|
+
[`datetime-grid`]: isGridStyle,
|
|
1726
|
+
})) }, this.renderDatetime(mode)));
|
|
1727
|
+
}
|
|
1728
|
+
get el() { return getElement(this); }
|
|
1729
|
+
static get watchers() { return {
|
|
1730
|
+
"disabled": ["disabledChanged"],
|
|
1731
|
+
"min": ["minChanged"],
|
|
1732
|
+
"max": ["maxChanged"],
|
|
1733
|
+
"yearValues": ["yearValuesChanged"],
|
|
1734
|
+
"monthValues": ["monthValuesChanged"],
|
|
1735
|
+
"dayValues": ["dayValuesChanged"],
|
|
1736
|
+
"hourValues": ["hourValuesChanged"],
|
|
1737
|
+
"minuteValues": ["minuteValuesChanged"],
|
|
1738
|
+
"value": ["valueChanged"]
|
|
1739
|
+
}; }
|
|
1727
1740
|
};
|
|
1728
1741
|
let datetimeIds = 0;
|
|
1729
1742
|
Datetime.style = {
|
|
1730
|
-
|
|
1731
|
-
|
|
1743
|
+
ios: datetimeIosCss,
|
|
1744
|
+
md: datetimeMdCss
|
|
1732
1745
|
};
|
|
1733
1746
|
|
|
1734
1747
|
/**
|
|
1735
1748
|
* iOS Picker Enter Animation
|
|
1736
1749
|
*/
|
|
1737
1750
|
const iosEnterAnimation = (baseEl) => {
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1751
|
+
const baseAnimation = createAnimation();
|
|
1752
|
+
const backdropAnimation = createAnimation();
|
|
1753
|
+
const wrapperAnimation = createAnimation();
|
|
1754
|
+
backdropAnimation
|
|
1755
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
1756
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
|
1757
|
+
.beforeStyles({
|
|
1758
|
+
'pointer-events': 'none',
|
|
1759
|
+
})
|
|
1760
|
+
.afterClearStyles(['pointer-events']);
|
|
1761
|
+
wrapperAnimation
|
|
1762
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
1763
|
+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
|
1764
|
+
return baseAnimation
|
|
1765
|
+
.addElement(baseEl)
|
|
1766
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
1767
|
+
.duration(400)
|
|
1768
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
1756
1769
|
};
|
|
1757
1770
|
|
|
1758
1771
|
/**
|
|
1759
1772
|
* iOS Picker Leave Animation
|
|
1760
1773
|
*/
|
|
1761
1774
|
const iosLeaveAnimation = (baseEl) => {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1775
|
+
const baseAnimation = createAnimation();
|
|
1776
|
+
const backdropAnimation = createAnimation();
|
|
1777
|
+
const wrapperAnimation = createAnimation();
|
|
1778
|
+
backdropAnimation
|
|
1779
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
|
1780
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
|
1781
|
+
wrapperAnimation
|
|
1782
|
+
.addElement(baseEl.querySelector('.picker-wrapper'))
|
|
1783
|
+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
|
1784
|
+
return baseAnimation
|
|
1785
|
+
.addElement(baseEl)
|
|
1786
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
|
1787
|
+
.duration(400)
|
|
1788
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
|
1776
1789
|
};
|
|
1777
1790
|
|
|
1778
1791
|
const pickerIosCss = ".sc-ion-picker-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}@supports (inset-inline-start: 0){.sc-ion-picker-ios-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){.sc-ion-picker-ios-h{left:0}[dir=rtl].sc-ion-picker-ios-h,[dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.sc-ion-picker-ios-h:dir(rtl){left:unset;right:unset;right:0}}}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-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-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active,.picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-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-ios,.picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-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, #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-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-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, #3880ff);font-size:16px}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-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}@supports (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-ios{left:0}[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-above-highlight.sc-ion-picker-ios:dir(rtl){left:unset;right:unset;right:0}}}.picker-below-highlight.sc-ion-picker-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}@supports (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-ios{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-ios{left:0}[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-below-highlight.sc-ion-picker-ios:dir(rtl){left:unset;right:unset;right:0}}}";
|
|
@@ -1780,195 +1793,205 @@ const pickerIosCss = ".sc-ion-picker-ios-h{--border-radius:0;--border-style:soli
|
|
|
1780
1793
|
const pickerMdCss = ".sc-ion-picker-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}@supports (inset-inline-start: 0){.sc-ion-picker-md-h{inset-inline-start:0}}@supports not (inset-inline-start: 0){.sc-ion-picker-md-h{left:0}[dir=rtl].sc-ion-picker-md-h,[dir=rtl] .sc-ion-picker-md-h{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.sc-ion-picker-md-h:dir(rtl){left:unset;right:unset;right:0}}}.overlay-hidden.sc-ion-picker-md-h{display:none}.picker-wrapper.sc-ion-picker-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-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-md:active,.picker-button.sc-ion-picker-md:focus{outline:none}.picker-columns.sc-ion-picker-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-md,.picker-below-highlight.sc-ion-picker-md{display:none;pointer-events:none}.sc-ion-picker-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, 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-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-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, #3880ff);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}.picker-columns.sc-ion-picker-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-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, 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}@supports (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-above-highlight.sc-ion-picker-md{left:0}[dir=rtl].sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-md .picker-above-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-above-highlight.sc-ion-picker-md:dir(rtl){left:unset;right:unset;right:0}}}.picker-below-highlight.sc-ion-picker-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, 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}@supports (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-md{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-below-highlight.sc-ion-picker-md{left:0}[dir=rtl].sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}[dir=rtl].sc-ion-picker-md .picker-below-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-below-highlight.sc-ion-picker-md:dir(rtl){left:unset;right:unset;right:0}}}";
|
|
1781
1794
|
|
|
1782
1795
|
const Picker = class {
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1796
|
+
constructor(hostRef) {
|
|
1797
|
+
registerInstance(this, hostRef);
|
|
1798
|
+
this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
|
|
1799
|
+
this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
|
|
1800
|
+
this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
|
|
1801
|
+
this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
|
|
1802
|
+
this.didPresentShorthand = createEvent(this, "didPresent", 7);
|
|
1803
|
+
this.willPresentShorthand = createEvent(this, "willPresent", 7);
|
|
1804
|
+
this.willDismissShorthand = createEvent(this, "willDismiss", 7);
|
|
1805
|
+
this.didDismissShorthand = createEvent(this, "didDismiss", 7);
|
|
1806
|
+
this.delegateController = createDelegateController(this);
|
|
1807
|
+
this.lockController = createLockController();
|
|
1808
|
+
this.triggerController = createTriggerController();
|
|
1809
|
+
this.onBackdropTap = () => {
|
|
1810
|
+
this.dismiss(undefined, BACKDROP);
|
|
1811
|
+
};
|
|
1812
|
+
this.dispatchCancelHandler = (ev) => {
|
|
1813
|
+
const role = ev.detail.role;
|
|
1814
|
+
if (isCancel(role)) {
|
|
1815
|
+
const cancelButton = this.buttons.find((b) => b.role === 'cancel');
|
|
1816
|
+
this.callButtonHandler(cancelButton);
|
|
1817
|
+
}
|
|
1818
|
+
};
|
|
1819
|
+
this.presented = false;
|
|
1820
|
+
this.overlayIndex = undefined;
|
|
1821
|
+
this.delegate = undefined;
|
|
1822
|
+
this.hasController = false;
|
|
1823
|
+
this.keyboardClose = true;
|
|
1824
|
+
this.enterAnimation = undefined;
|
|
1825
|
+
this.leaveAnimation = undefined;
|
|
1826
|
+
this.buttons = [];
|
|
1827
|
+
this.columns = [];
|
|
1828
|
+
this.cssClass = undefined;
|
|
1829
|
+
this.duration = 0;
|
|
1830
|
+
this.showBackdrop = true;
|
|
1831
|
+
this.backdropDismiss = true;
|
|
1832
|
+
this.animated = true;
|
|
1833
|
+
this.htmlAttributes = undefined;
|
|
1834
|
+
this.isOpen = false;
|
|
1835
|
+
this.trigger = undefined;
|
|
1836
|
+
}
|
|
1837
|
+
onIsOpenChange(newValue, oldValue) {
|
|
1838
|
+
if (newValue === true && oldValue === false) {
|
|
1839
|
+
this.present();
|
|
1840
|
+
}
|
|
1841
|
+
else if (newValue === false && oldValue === true) {
|
|
1842
|
+
this.dismiss();
|
|
1843
|
+
}
|
|
1844
|
+
}
|
|
1845
|
+
triggerChanged() {
|
|
1846
|
+
const { trigger, el, triggerController } = this;
|
|
1847
|
+
if (trigger) {
|
|
1848
|
+
triggerController.addClickListener(el, trigger);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
connectedCallback() {
|
|
1852
|
+
prepareOverlay(this.el);
|
|
1853
|
+
this.triggerChanged();
|
|
1854
|
+
}
|
|
1855
|
+
disconnectedCallback() {
|
|
1856
|
+
this.triggerController.removeClickListener();
|
|
1857
|
+
}
|
|
1858
|
+
componentWillLoad() {
|
|
1859
|
+
setOverlayId(this.el);
|
|
1860
|
+
}
|
|
1861
|
+
componentDidLoad() {
|
|
1862
|
+
/**
|
|
1863
|
+
* If picker was rendered with isOpen="true"
|
|
1864
|
+
* then we should open picker immediately.
|
|
1865
|
+
*/
|
|
1866
|
+
if (this.isOpen === true) {
|
|
1867
|
+
raf(() => this.present());
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* When binding values in frameworks such as Angular
|
|
1871
|
+
* it is possible for the value to be set after the Web Component
|
|
1872
|
+
* initializes but before the value watcher is set up in Stencil.
|
|
1873
|
+
* As a result, the watcher callback may not be fired.
|
|
1874
|
+
* We work around this by manually calling the watcher
|
|
1875
|
+
* callback when the component has loaded and the watcher
|
|
1876
|
+
* is configured.
|
|
1877
|
+
*/
|
|
1878
|
+
this.triggerChanged();
|
|
1879
|
+
}
|
|
1849
1880
|
/**
|
|
1850
|
-
*
|
|
1851
|
-
* then we should open picker immediately.
|
|
1881
|
+
* Present the picker overlay after it has been created.
|
|
1852
1882
|
*/
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
[`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { tabindex: "0" }), h("div", { class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { class: "picker-columns" }, h("div", { class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-column", { col: c })), h("div", { class: "picker-below-highlight" }))), h("div", { tabindex: "0" })));
|
|
1953
|
-
}
|
|
1954
|
-
get el() { return getElement(this); }
|
|
1955
|
-
static get watchers() { return {
|
|
1956
|
-
"isOpen": ["onIsOpenChange"],
|
|
1957
|
-
"trigger": ["triggerChanged"]
|
|
1958
|
-
}; }
|
|
1883
|
+
async present() {
|
|
1884
|
+
const unlock = await this.lockController.lock();
|
|
1885
|
+
await this.delegateController.attachViewToDom();
|
|
1886
|
+
await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
|
|
1887
|
+
if (this.duration > 0) {
|
|
1888
|
+
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
|
1889
|
+
}
|
|
1890
|
+
unlock();
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Dismiss the picker overlay after it has been presented.
|
|
1894
|
+
*
|
|
1895
|
+
* @param data Any data to emit in the dismiss events.
|
|
1896
|
+
* @param role The role of the element that is dismissing the picker.
|
|
1897
|
+
* This can be useful in a button handler for determining which button was
|
|
1898
|
+
* clicked to dismiss the picker.
|
|
1899
|
+
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
|
1900
|
+
*/
|
|
1901
|
+
async dismiss(data, role) {
|
|
1902
|
+
const unlock = await this.lockController.lock();
|
|
1903
|
+
if (this.durationTimeout) {
|
|
1904
|
+
clearTimeout(this.durationTimeout);
|
|
1905
|
+
}
|
|
1906
|
+
const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
|
|
1907
|
+
if (dismissed) {
|
|
1908
|
+
this.delegateController.removeViewFromDom();
|
|
1909
|
+
}
|
|
1910
|
+
unlock();
|
|
1911
|
+
return dismissed;
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* Returns a promise that resolves when the picker did dismiss.
|
|
1915
|
+
*/
|
|
1916
|
+
onDidDismiss() {
|
|
1917
|
+
return eventMethod(this.el, 'ionPickerDidDismiss');
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Returns a promise that resolves when the picker will dismiss.
|
|
1921
|
+
*/
|
|
1922
|
+
onWillDismiss() {
|
|
1923
|
+
return eventMethod(this.el, 'ionPickerWillDismiss');
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Get the column that matches the specified name.
|
|
1927
|
+
*
|
|
1928
|
+
* @param name The name of the column.
|
|
1929
|
+
*/
|
|
1930
|
+
getColumn(name) {
|
|
1931
|
+
return Promise.resolve(this.columns.find((column) => column.name === name));
|
|
1932
|
+
}
|
|
1933
|
+
async buttonClick(button) {
|
|
1934
|
+
const role = button.role;
|
|
1935
|
+
if (isCancel(role)) {
|
|
1936
|
+
return this.dismiss(undefined, role);
|
|
1937
|
+
}
|
|
1938
|
+
const shouldDismiss = await this.callButtonHandler(button);
|
|
1939
|
+
if (shouldDismiss) {
|
|
1940
|
+
return this.dismiss(this.getSelected(), button.role);
|
|
1941
|
+
}
|
|
1942
|
+
return Promise.resolve();
|
|
1943
|
+
}
|
|
1944
|
+
async callButtonHandler(button) {
|
|
1945
|
+
if (button) {
|
|
1946
|
+
// a handler has been provided, execute it
|
|
1947
|
+
// pass the handler the values from the inputs
|
|
1948
|
+
const rtn = await safeCall(button.handler, this.getSelected());
|
|
1949
|
+
if (rtn === false) {
|
|
1950
|
+
// if the return value of the handler is false then do not dismiss
|
|
1951
|
+
return false;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
return true;
|
|
1955
|
+
}
|
|
1956
|
+
getSelected() {
|
|
1957
|
+
const selected = {};
|
|
1958
|
+
this.columns.forEach((col, index) => {
|
|
1959
|
+
const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
|
|
1960
|
+
selected[col.name] = {
|
|
1961
|
+
text: selectedColumn ? selectedColumn.text : undefined,
|
|
1962
|
+
value: selectedColumn ? selectedColumn.value : undefined,
|
|
1963
|
+
columnIndex: index,
|
|
1964
|
+
};
|
|
1965
|
+
});
|
|
1966
|
+
return selected;
|
|
1967
|
+
}
|
|
1968
|
+
render() {
|
|
1969
|
+
const { htmlAttributes } = this;
|
|
1970
|
+
const mode = getIonMode(this);
|
|
1971
|
+
return (h(Host, Object.assign({ "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
|
1972
|
+
zIndex: `${20000 + this.overlayIndex}`,
|
|
1973
|
+
}, class: Object.assign({ [mode]: true,
|
|
1974
|
+
// Used internally for styling
|
|
1975
|
+
[`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { tabindex: "0" }), h("div", { class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { class: "picker-columns" }, h("div", { class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-column", { col: c })), h("div", { class: "picker-below-highlight" }))), h("div", { tabindex: "0" })));
|
|
1976
|
+
}
|
|
1977
|
+
get el() { return getElement(this); }
|
|
1978
|
+
static get watchers() { return {
|
|
1979
|
+
"isOpen": ["onIsOpenChange"],
|
|
1980
|
+
"trigger": ["triggerChanged"]
|
|
1981
|
+
}; }
|
|
1959
1982
|
};
|
|
1960
1983
|
const buttonWrapperClass = (button) => {
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1984
|
+
return {
|
|
1985
|
+
[`picker-toolbar-${button.role}`]: button.role !== undefined,
|
|
1986
|
+
'picker-toolbar-button': true,
|
|
1987
|
+
};
|
|
1965
1988
|
};
|
|
1966
1989
|
const buttonClass = (button) => {
|
|
1967
|
-
|
|
1990
|
+
return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
|
|
1968
1991
|
};
|
|
1969
1992
|
Picker.style = {
|
|
1970
|
-
|
|
1971
|
-
|
|
1993
|
+
ios: pickerIosCss,
|
|
1994
|
+
md: pickerMdCss
|
|
1972
1995
|
};
|
|
1973
1996
|
|
|
1974
1997
|
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}@supports (inset-inline-start: 0){.picker-opt{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-opt{left:0}:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}[dir=rtl] .picker-opt{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){left:unset;right:unset;right: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}}";
|
|
@@ -1976,350 +1999,350 @@ const pickerColumnIosCss = ".picker-col{display:-ms-flexbox;display:flex;positio
|
|
|
1976
1999
|
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}@supports (inset-inline-start: 0){.picker-opt{inset-inline-start:0}}@supports not (inset-inline-start: 0){.picker-opt{left:0}:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}[dir=rtl] .picker-opt{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){left:unset;right:unset;right: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, #3880ff)}";
|
|
1977
2000
|
|
|
1978
2001
|
const PickerColumnCmp = class {
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
}
|
|
2009
|
-
this.rotateFactor = pickerRotateFactor;
|
|
2010
|
-
this.scaleFactor = pickerScaleFactor;
|
|
2011
|
-
this.gesture = (await import('./index-ff313b19.js')).createGesture({
|
|
2012
|
-
el: this.el,
|
|
2013
|
-
gestureName: 'picker-swipe',
|
|
2014
|
-
gesturePriority: 100,
|
|
2015
|
-
threshold: 0,
|
|
2016
|
-
passive: false,
|
|
2017
|
-
onStart: (ev) => this.onStart(ev),
|
|
2018
|
-
onMove: (ev) => this.onMove(ev),
|
|
2019
|
-
onEnd: (ev) => this.onEnd(ev),
|
|
2020
|
-
});
|
|
2021
|
-
this.gesture.enable();
|
|
2022
|
-
// Options have not been initialized yet
|
|
2023
|
-
// Animation must be disabled through the `noAnimate` flag
|
|
2024
|
-
// Otherwise, the options will render
|
|
2025
|
-
// at the top of the column and transition down
|
|
2026
|
-
this.tmrId = setTimeout(() => {
|
|
2027
|
-
this.noAnimate = false;
|
|
2028
|
-
// After initialization, `refresh()` will be called
|
|
2029
|
-
// At this point, animation will be enabled. The options will
|
|
2030
|
-
// animate as they are being selected.
|
|
2031
|
-
this.refresh(true);
|
|
2032
|
-
}, 250);
|
|
2033
|
-
}
|
|
2034
|
-
componentDidLoad() {
|
|
2035
|
-
this.onDomChange();
|
|
2036
|
-
}
|
|
2037
|
-
componentDidUpdate() {
|
|
2038
|
-
// Options may have changed since last update.
|
|
2039
|
-
if (this.colDidChange) {
|
|
2040
|
-
// Animation must be disabled through the `onDomChange` parameter.
|
|
2041
|
-
// Otherwise, the recently added options will render
|
|
2042
|
-
// at the top of the column and transition down
|
|
2043
|
-
this.onDomChange(true, false);
|
|
2044
|
-
this.colDidChange = false;
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
disconnectedCallback() {
|
|
2048
|
-
if (this.rafId !== undefined)
|
|
2049
|
-
cancelAnimationFrame(this.rafId);
|
|
2050
|
-
if (this.tmrId)
|
|
2051
|
-
clearTimeout(this.tmrId);
|
|
2052
|
-
if (this.gesture) {
|
|
2053
|
-
this.gesture.destroy();
|
|
2054
|
-
this.gesture = undefined;
|
|
2055
|
-
}
|
|
2056
|
-
}
|
|
2057
|
-
emitColChange() {
|
|
2058
|
-
this.ionPickerColChange.emit(this.col);
|
|
2059
|
-
}
|
|
2060
|
-
setSelected(selectedIndex, duration) {
|
|
2061
|
-
// if there is a selected index, then figure out it's y position
|
|
2062
|
-
// if there isn't a selected index, then just use the top y position
|
|
2063
|
-
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
2064
|
-
this.velocity = 0;
|
|
2065
|
-
// set what y position we're at
|
|
2066
|
-
if (this.rafId !== undefined)
|
|
2067
|
-
cancelAnimationFrame(this.rafId);
|
|
2068
|
-
this.update(y, duration, true);
|
|
2069
|
-
this.emitColChange();
|
|
2070
|
-
}
|
|
2071
|
-
update(y, duration, saveY) {
|
|
2072
|
-
if (!this.optsEl) {
|
|
2073
|
-
return;
|
|
2074
|
-
}
|
|
2075
|
-
// ensure we've got a good round number :)
|
|
2076
|
-
let translateY = 0;
|
|
2077
|
-
let translateZ = 0;
|
|
2078
|
-
const { col, rotateFactor } = this;
|
|
2079
|
-
const prevSelected = col.selectedIndex;
|
|
2080
|
-
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
2081
|
-
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
2082
|
-
const scaleStr = `scale(${this.scaleFactor})`;
|
|
2083
|
-
const children = this.optsEl.children;
|
|
2084
|
-
for (let i = 0; i < children.length; i++) {
|
|
2085
|
-
const button = children[i];
|
|
2086
|
-
const opt = col.options[i];
|
|
2087
|
-
const optOffset = i * this.optHeight + y;
|
|
2088
|
-
let transform = '';
|
|
2089
|
-
if (rotateFactor !== 0) {
|
|
2090
|
-
const rotateX = optOffset * rotateFactor;
|
|
2091
|
-
if (Math.abs(rotateX) <= 90) {
|
|
2092
|
-
translateY = 0;
|
|
2093
|
-
translateZ = 90;
|
|
2094
|
-
transform = `rotateX(${rotateX}deg) `;
|
|
2002
|
+
constructor(hostRef) {
|
|
2003
|
+
registerInstance(this, hostRef);
|
|
2004
|
+
this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
|
|
2005
|
+
this.optHeight = 0;
|
|
2006
|
+
this.rotateFactor = 0;
|
|
2007
|
+
this.scaleFactor = 1;
|
|
2008
|
+
this.velocity = 0;
|
|
2009
|
+
this.y = 0;
|
|
2010
|
+
this.noAnimate = true;
|
|
2011
|
+
// `colDidChange` is a flag that gets set when the column is changed
|
|
2012
|
+
// dynamically. When this flag is set, the column will refresh
|
|
2013
|
+
// after the component re-renders to incorporate the new column data.
|
|
2014
|
+
// This is necessary because `this.refresh` queries for the option elements,
|
|
2015
|
+
// so it needs to wait for the latest elements to be available in the DOM.
|
|
2016
|
+
// Ex: column is created with 3 options. User updates the column data
|
|
2017
|
+
// to have 5 options. The column will still think it only has 3 options.
|
|
2018
|
+
this.colDidChange = false;
|
|
2019
|
+
this.col = undefined;
|
|
2020
|
+
}
|
|
2021
|
+
colChanged() {
|
|
2022
|
+
this.colDidChange = true;
|
|
2023
|
+
}
|
|
2024
|
+
async connectedCallback() {
|
|
2025
|
+
let pickerRotateFactor = 0;
|
|
2026
|
+
let pickerScaleFactor = 0.81;
|
|
2027
|
+
const mode = getIonMode(this);
|
|
2028
|
+
if (mode === 'ios') {
|
|
2029
|
+
pickerRotateFactor = -0.46;
|
|
2030
|
+
pickerScaleFactor = 1;
|
|
2095
2031
|
}
|
|
2096
|
-
|
|
2097
|
-
|
|
2032
|
+
this.rotateFactor = pickerRotateFactor;
|
|
2033
|
+
this.scaleFactor = pickerScaleFactor;
|
|
2034
|
+
this.gesture = (await import('./index-2cf77112.js')).createGesture({
|
|
2035
|
+
el: this.el,
|
|
2036
|
+
gestureName: 'picker-swipe',
|
|
2037
|
+
gesturePriority: 100,
|
|
2038
|
+
threshold: 0,
|
|
2039
|
+
passive: false,
|
|
2040
|
+
onStart: (ev) => this.onStart(ev),
|
|
2041
|
+
onMove: (ev) => this.onMove(ev),
|
|
2042
|
+
onEnd: (ev) => this.onEnd(ev),
|
|
2043
|
+
});
|
|
2044
|
+
this.gesture.enable();
|
|
2045
|
+
// Options have not been initialized yet
|
|
2046
|
+
// Animation must be disabled through the `noAnimate` flag
|
|
2047
|
+
// Otherwise, the options will render
|
|
2048
|
+
// at the top of the column and transition down
|
|
2049
|
+
this.tmrId = setTimeout(() => {
|
|
2050
|
+
this.noAnimate = false;
|
|
2051
|
+
// After initialization, `refresh()` will be called
|
|
2052
|
+
// At this point, animation will be enabled. The options will
|
|
2053
|
+
// animate as they are being selected.
|
|
2054
|
+
this.refresh(true);
|
|
2055
|
+
}, 250);
|
|
2056
|
+
}
|
|
2057
|
+
componentDidLoad() {
|
|
2058
|
+
this.onDomChange();
|
|
2059
|
+
}
|
|
2060
|
+
componentDidUpdate() {
|
|
2061
|
+
// Options may have changed since last update.
|
|
2062
|
+
if (this.colDidChange) {
|
|
2063
|
+
// Animation must be disabled through the `onDomChange` parameter.
|
|
2064
|
+
// Otherwise, the recently added options will render
|
|
2065
|
+
// at the top of the column and transition down
|
|
2066
|
+
this.onDomChange(true, false);
|
|
2067
|
+
this.colDidChange = false;
|
|
2098
2068
|
}
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
}
|
|
2118
|
-
// Update transform
|
|
2119
|
-
if (transform !== opt.transform) {
|
|
2120
|
-
opt.transform = transform;
|
|
2121
|
-
}
|
|
2122
|
-
button.style.transform = transform;
|
|
2123
|
-
/**
|
|
2124
|
-
* Ensure that the select column
|
|
2125
|
-
* item has the selected class
|
|
2126
|
-
*/
|
|
2127
|
-
opt.selected = selected;
|
|
2128
|
-
if (selected) {
|
|
2129
|
-
button.classList.add(PICKER_OPT_SELECTED);
|
|
2130
|
-
}
|
|
2131
|
-
else {
|
|
2132
|
-
button.classList.remove(PICKER_OPT_SELECTED);
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
this.col.prevSelected = prevSelected;
|
|
2136
|
-
if (saveY) {
|
|
2137
|
-
this.y = y;
|
|
2138
|
-
}
|
|
2139
|
-
if (this.lastIndex !== selectedIndex) {
|
|
2140
|
-
// have not set a last index yet
|
|
2141
|
-
hapticSelectionChanged();
|
|
2142
|
-
this.lastIndex = selectedIndex;
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
decelerate() {
|
|
2146
|
-
if (this.velocity !== 0) {
|
|
2147
|
-
// still decelerating
|
|
2148
|
-
this.velocity *= DECELERATION_FRICTION;
|
|
2149
|
-
// do not let it go slower than a velocity of 1
|
|
2150
|
-
this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
|
|
2151
|
-
let y = this.y + this.velocity;
|
|
2152
|
-
if (y > this.minY) {
|
|
2153
|
-
// whoops, it's trying to scroll up farther than the options we have!
|
|
2154
|
-
y = this.minY;
|
|
2155
|
-
this.velocity = 0;
|
|
2156
|
-
}
|
|
2157
|
-
else if (y < this.maxY) {
|
|
2158
|
-
// gahh, it's trying to scroll down farther than we can!
|
|
2159
|
-
y = this.maxY;
|
|
2160
|
-
this.velocity = 0;
|
|
2161
|
-
}
|
|
2162
|
-
this.update(y, 0, true);
|
|
2163
|
-
const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
|
|
2164
|
-
if (notLockedIn) {
|
|
2165
|
-
// isn't locked in yet, keep decelerating until it is
|
|
2166
|
-
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
2167
|
-
}
|
|
2168
|
-
else {
|
|
2069
|
+
}
|
|
2070
|
+
disconnectedCallback() {
|
|
2071
|
+
if (this.rafId !== undefined)
|
|
2072
|
+
cancelAnimationFrame(this.rafId);
|
|
2073
|
+
if (this.tmrId)
|
|
2074
|
+
clearTimeout(this.tmrId);
|
|
2075
|
+
if (this.gesture) {
|
|
2076
|
+
this.gesture.destroy();
|
|
2077
|
+
this.gesture = undefined;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
emitColChange() {
|
|
2081
|
+
this.ionPickerColChange.emit(this.col);
|
|
2082
|
+
}
|
|
2083
|
+
setSelected(selectedIndex, duration) {
|
|
2084
|
+
// if there is a selected index, then figure out it's y position
|
|
2085
|
+
// if there isn't a selected index, then just use the top y position
|
|
2086
|
+
const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
|
|
2169
2087
|
this.velocity = 0;
|
|
2088
|
+
// set what y position we're at
|
|
2089
|
+
if (this.rafId !== undefined)
|
|
2090
|
+
cancelAnimationFrame(this.rafId);
|
|
2091
|
+
this.update(y, duration, true);
|
|
2170
2092
|
this.emitColChange();
|
|
2171
|
-
hapticSelectionEnd();
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
else if (this.y % this.optHeight !== 0) {
|
|
2175
|
-
// needs to still get locked into a position so options line up
|
|
2176
|
-
const currentPos = Math.abs(this.y % this.optHeight);
|
|
2177
|
-
// create a velocity in the direction it needs to scroll
|
|
2178
|
-
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
2179
|
-
this.decelerate();
|
|
2180
|
-
}
|
|
2181
|
-
}
|
|
2182
|
-
indexForY(y) {
|
|
2183
|
-
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
2184
|
-
}
|
|
2185
|
-
onStart(detail) {
|
|
2186
|
-
// We have to prevent default in order to block scrolling under the picker
|
|
2187
|
-
// but we DO NOT have to stop propagation, since we still want
|
|
2188
|
-
// some "click" events to capture
|
|
2189
|
-
if (detail.event.cancelable) {
|
|
2190
|
-
detail.event.preventDefault();
|
|
2191
|
-
}
|
|
2192
|
-
detail.event.stopPropagation();
|
|
2193
|
-
hapticSelectionStart();
|
|
2194
|
-
// reset everything
|
|
2195
|
-
if (this.rafId !== undefined)
|
|
2196
|
-
cancelAnimationFrame(this.rafId);
|
|
2197
|
-
const options = this.col.options;
|
|
2198
|
-
let minY = options.length - 1;
|
|
2199
|
-
let maxY = 0;
|
|
2200
|
-
for (let i = 0; i < options.length; i++) {
|
|
2201
|
-
if (!options[i].disabled) {
|
|
2202
|
-
minY = Math.min(minY, i);
|
|
2203
|
-
maxY = Math.max(maxY, i);
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
this.minY = -(minY * this.optHeight);
|
|
2207
|
-
this.maxY = -(maxY * this.optHeight);
|
|
2208
|
-
}
|
|
2209
|
-
onMove(detail) {
|
|
2210
|
-
if (detail.event.cancelable) {
|
|
2211
|
-
detail.event.preventDefault();
|
|
2212
|
-
}
|
|
2213
|
-
detail.event.stopPropagation();
|
|
2214
|
-
// update the scroll position relative to pointer start position
|
|
2215
|
-
let y = this.y + detail.deltaY;
|
|
2216
|
-
if (y > this.minY) {
|
|
2217
|
-
// scrolling up higher than scroll area
|
|
2218
|
-
y = Math.pow(y, 0.8);
|
|
2219
|
-
this.bounceFrom = y;
|
|
2220
|
-
}
|
|
2221
|
-
else if (y < this.maxY) {
|
|
2222
|
-
// scrolling down below scroll area
|
|
2223
|
-
y += Math.pow(this.maxY - y, 0.9);
|
|
2224
|
-
this.bounceFrom = y;
|
|
2225
2093
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2094
|
+
update(y, duration, saveY) {
|
|
2095
|
+
if (!this.optsEl) {
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
// ensure we've got a good round number :)
|
|
2099
|
+
let translateY = 0;
|
|
2100
|
+
let translateZ = 0;
|
|
2101
|
+
const { col, rotateFactor } = this;
|
|
2102
|
+
const prevSelected = col.selectedIndex;
|
|
2103
|
+
const selectedIndex = (col.selectedIndex = this.indexForY(-y));
|
|
2104
|
+
const durationStr = duration === 0 ? '' : duration + 'ms';
|
|
2105
|
+
const scaleStr = `scale(${this.scaleFactor})`;
|
|
2106
|
+
const children = this.optsEl.children;
|
|
2107
|
+
for (let i = 0; i < children.length; i++) {
|
|
2108
|
+
const button = children[i];
|
|
2109
|
+
const opt = col.options[i];
|
|
2110
|
+
const optOffset = i * this.optHeight + y;
|
|
2111
|
+
let transform = '';
|
|
2112
|
+
if (rotateFactor !== 0) {
|
|
2113
|
+
const rotateX = optOffset * rotateFactor;
|
|
2114
|
+
if (Math.abs(rotateX) <= 90) {
|
|
2115
|
+
translateY = 0;
|
|
2116
|
+
translateZ = 90;
|
|
2117
|
+
transform = `rotateX(${rotateX}deg) `;
|
|
2118
|
+
}
|
|
2119
|
+
else {
|
|
2120
|
+
translateY = -9999;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
else {
|
|
2124
|
+
translateZ = 0;
|
|
2125
|
+
translateY = optOffset;
|
|
2126
|
+
}
|
|
2127
|
+
const selected = selectedIndex === i;
|
|
2128
|
+
transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
|
2129
|
+
if (this.scaleFactor !== 1 && !selected) {
|
|
2130
|
+
transform += scaleStr;
|
|
2131
|
+
}
|
|
2132
|
+
// Update transition duration
|
|
2133
|
+
if (this.noAnimate) {
|
|
2134
|
+
opt.duration = 0;
|
|
2135
|
+
button.style.transitionDuration = '';
|
|
2136
|
+
}
|
|
2137
|
+
else if (duration !== opt.duration) {
|
|
2138
|
+
opt.duration = duration;
|
|
2139
|
+
button.style.transitionDuration = durationStr;
|
|
2140
|
+
}
|
|
2141
|
+
// Update transform
|
|
2142
|
+
if (transform !== opt.transform) {
|
|
2143
|
+
opt.transform = transform;
|
|
2144
|
+
}
|
|
2145
|
+
button.style.transform = transform;
|
|
2146
|
+
/**
|
|
2147
|
+
* Ensure that the select column
|
|
2148
|
+
* item has the selected class
|
|
2149
|
+
*/
|
|
2150
|
+
opt.selected = selected;
|
|
2151
|
+
if (selected) {
|
|
2152
|
+
button.classList.add(PICKER_OPT_SELECTED);
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
button.classList.remove(PICKER_OPT_SELECTED);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
this.col.prevSelected = prevSelected;
|
|
2159
|
+
if (saveY) {
|
|
2160
|
+
this.y = y;
|
|
2161
|
+
}
|
|
2162
|
+
if (this.lastIndex !== selectedIndex) {
|
|
2163
|
+
// have not set a last index yet
|
|
2164
|
+
hapticSelectionChanged();
|
|
2165
|
+
this.lastIndex = selectedIndex;
|
|
2166
|
+
}
|
|
2250
2167
|
}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2168
|
+
decelerate() {
|
|
2169
|
+
if (this.velocity !== 0) {
|
|
2170
|
+
// still decelerating
|
|
2171
|
+
this.velocity *= DECELERATION_FRICTION;
|
|
2172
|
+
// do not let it go slower than a velocity of 1
|
|
2173
|
+
this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
|
|
2174
|
+
let y = this.y + this.velocity;
|
|
2175
|
+
if (y > this.minY) {
|
|
2176
|
+
// whoops, it's trying to scroll up farther than the options we have!
|
|
2177
|
+
y = this.minY;
|
|
2178
|
+
this.velocity = 0;
|
|
2179
|
+
}
|
|
2180
|
+
else if (y < this.maxY) {
|
|
2181
|
+
// gahh, it's trying to scroll down farther than we can!
|
|
2182
|
+
y = this.maxY;
|
|
2183
|
+
this.velocity = 0;
|
|
2184
|
+
}
|
|
2185
|
+
this.update(y, 0, true);
|
|
2186
|
+
const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
|
|
2187
|
+
if (notLockedIn) {
|
|
2188
|
+
// isn't locked in yet, keep decelerating until it is
|
|
2189
|
+
this.rafId = requestAnimationFrame(() => this.decelerate());
|
|
2190
|
+
}
|
|
2191
|
+
else {
|
|
2192
|
+
this.velocity = 0;
|
|
2193
|
+
this.emitColChange();
|
|
2194
|
+
hapticSelectionEnd();
|
|
2195
|
+
}
|
|
2258
2196
|
}
|
|
2259
|
-
else if (
|
|
2260
|
-
|
|
2197
|
+
else if (this.y % this.optHeight !== 0) {
|
|
2198
|
+
// needs to still get locked into a position so options line up
|
|
2199
|
+
const currentPos = Math.abs(this.y % this.optHeight);
|
|
2200
|
+
// create a velocity in the direction it needs to scroll
|
|
2201
|
+
this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
|
|
2202
|
+
this.decelerate();
|
|
2261
2203
|
}
|
|
2262
|
-
}
|
|
2263
|
-
this.decelerate();
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
refresh(forceRefresh, animated) {
|
|
2267
|
-
var _a;
|
|
2268
|
-
let min = this.col.options.length - 1;
|
|
2269
|
-
let max = 0;
|
|
2270
|
-
const options = this.col.options;
|
|
2271
|
-
for (let i = 0; i < options.length; i++) {
|
|
2272
|
-
if (!options[i].disabled) {
|
|
2273
|
-
min = Math.min(min, i);
|
|
2274
|
-
max = Math.max(max, i);
|
|
2275
|
-
}
|
|
2276
2204
|
}
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2205
|
+
indexForY(y) {
|
|
2206
|
+
return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
|
2207
|
+
}
|
|
2208
|
+
onStart(detail) {
|
|
2209
|
+
// We have to prevent default in order to block scrolling under the picker
|
|
2210
|
+
// but we DO NOT have to stop propagation, since we still want
|
|
2211
|
+
// some "click" events to capture
|
|
2212
|
+
if (detail.event.cancelable) {
|
|
2213
|
+
detail.event.preventDefault();
|
|
2214
|
+
}
|
|
2215
|
+
detail.event.stopPropagation();
|
|
2216
|
+
hapticSelectionStart();
|
|
2217
|
+
// reset everything
|
|
2218
|
+
if (this.rafId !== undefined)
|
|
2219
|
+
cancelAnimationFrame(this.rafId);
|
|
2220
|
+
const options = this.col.options;
|
|
2221
|
+
let minY = options.length - 1;
|
|
2222
|
+
let maxY = 0;
|
|
2223
|
+
for (let i = 0; i < options.length; i++) {
|
|
2224
|
+
if (!options[i].disabled) {
|
|
2225
|
+
minY = Math.min(minY, i);
|
|
2226
|
+
maxY = Math.max(maxY, i);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
this.minY = -(minY * this.optHeight);
|
|
2230
|
+
this.maxY = -(maxY * this.optHeight);
|
|
2231
|
+
}
|
|
2232
|
+
onMove(detail) {
|
|
2233
|
+
if (detail.event.cancelable) {
|
|
2234
|
+
detail.event.preventDefault();
|
|
2235
|
+
}
|
|
2236
|
+
detail.event.stopPropagation();
|
|
2237
|
+
// update the scroll position relative to pointer start position
|
|
2238
|
+
let y = this.y + detail.deltaY;
|
|
2239
|
+
if (y > this.minY) {
|
|
2240
|
+
// scrolling up higher than scroll area
|
|
2241
|
+
y = Math.pow(y, 0.8);
|
|
2242
|
+
this.bounceFrom = y;
|
|
2243
|
+
}
|
|
2244
|
+
else if (y < this.maxY) {
|
|
2245
|
+
// scrolling down below scroll area
|
|
2246
|
+
y += Math.pow(this.maxY - y, 0.9);
|
|
2247
|
+
this.bounceFrom = y;
|
|
2248
|
+
}
|
|
2249
|
+
else {
|
|
2250
|
+
this.bounceFrom = 0;
|
|
2251
|
+
}
|
|
2252
|
+
this.update(y, 0, false);
|
|
2253
|
+
}
|
|
2254
|
+
onEnd(detail) {
|
|
2255
|
+
if (this.bounceFrom > 0) {
|
|
2256
|
+
// bounce back up
|
|
2257
|
+
this.update(this.minY, 100, true);
|
|
2258
|
+
this.emitColChange();
|
|
2259
|
+
return;
|
|
2260
|
+
}
|
|
2261
|
+
else if (this.bounceFrom < 0) {
|
|
2262
|
+
// bounce back down
|
|
2263
|
+
this.update(this.maxY, 100, true);
|
|
2264
|
+
this.emitColChange();
|
|
2265
|
+
return;
|
|
2266
|
+
}
|
|
2267
|
+
this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
|
2268
|
+
if (this.velocity === 0 && detail.deltaY === 0) {
|
|
2269
|
+
const opt = detail.event.target.closest('.picker-opt');
|
|
2270
|
+
if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
|
|
2271
|
+
this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
else {
|
|
2275
|
+
this.y += detail.deltaY;
|
|
2276
|
+
if (Math.abs(detail.velocityY) < 0.05) {
|
|
2277
|
+
const isScrollingUp = detail.deltaY > 0;
|
|
2278
|
+
const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
|
2279
|
+
if (isScrollingUp && optHeightFraction > 0.5) {
|
|
2280
|
+
this.velocity = Math.abs(this.velocity) * -1;
|
|
2281
|
+
}
|
|
2282
|
+
else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
|
2283
|
+
this.velocity = Math.abs(this.velocity);
|
|
2284
|
+
}
|
|
2285
|
+
}
|
|
2286
|
+
this.decelerate();
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
refresh(forceRefresh, animated) {
|
|
2290
|
+
var _a;
|
|
2291
|
+
let min = this.col.options.length - 1;
|
|
2292
|
+
let max = 0;
|
|
2293
|
+
const options = this.col.options;
|
|
2294
|
+
for (let i = 0; i < options.length; i++) {
|
|
2295
|
+
if (!options[i].disabled) {
|
|
2296
|
+
min = Math.min(min, i);
|
|
2297
|
+
max = Math.max(max, i);
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Only update selected value if column has a
|
|
2302
|
+
* velocity of 0. If it does not, then the
|
|
2303
|
+
* column is animating might land on
|
|
2304
|
+
* a value different than the value at
|
|
2305
|
+
* selectedIndex
|
|
2306
|
+
*/
|
|
2307
|
+
if (this.velocity !== 0) {
|
|
2308
|
+
return;
|
|
2309
|
+
}
|
|
2310
|
+
const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
|
|
2311
|
+
if (this.col.prevSelected !== selectedIndex || forceRefresh) {
|
|
2312
|
+
const y = selectedIndex * this.optHeight * -1;
|
|
2313
|
+
const duration = animated ? TRANSITION_DURATION : 0;
|
|
2314
|
+
this.velocity = 0;
|
|
2315
|
+
this.update(y, duration, true);
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
onDomChange(forceRefresh, animated) {
|
|
2319
|
+
const colEl = this.optsEl;
|
|
2320
|
+
if (colEl) {
|
|
2321
|
+
// DOM READ
|
|
2322
|
+
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
|
|
2323
|
+
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
2324
|
+
}
|
|
2325
|
+
this.refresh(forceRefresh, animated);
|
|
2326
|
+
}
|
|
2327
|
+
render() {
|
|
2328
|
+
const col = this.col;
|
|
2329
|
+
const mode = getIonMode(this);
|
|
2330
|
+
return (h(Host, { class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
2331
|
+
'max-width': this.col.columnWidth,
|
|
2332
|
+
} }, col.prefix && (h("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
2333
|
+
}
|
|
2334
|
+
get el() { return getElement(this); }
|
|
2335
|
+
static get watchers() { return {
|
|
2336
|
+
"col": ["colChanged"]
|
|
2337
|
+
}; }
|
|
2315
2338
|
};
|
|
2316
2339
|
const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
|
2317
2340
|
const DECELERATION_FRICTION = 0.97;
|
|
2318
2341
|
const MAX_PICKER_SPEED = 90;
|
|
2319
2342
|
const TRANSITION_DURATION = 150;
|
|
2320
2343
|
PickerColumnCmp.style = {
|
|
2321
|
-
|
|
2322
|
-
|
|
2344
|
+
ios: pickerColumnIosCss,
|
|
2345
|
+
md: pickerColumnMdCss
|
|
2323
2346
|
};
|
|
2324
2347
|
|
|
2325
2348
|
export { Datetime as ion_datetime, Picker as ion_picker, PickerColumnCmp as ion_picker_column };
|