@sparkle-learning/core 0.0.32 → 0.0.35
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/dist/cjs/PrivateRoute-4abc9d29.js +35 -0
- package/dist/cjs/{active-router-eedb3bfe.js → active-router-f9e18bd8.js} +1 -1
- package/dist/cjs/{animation-6132e37f.js → animation-ee586546.js} +83 -78
- package/dist/cjs/{app-globals-9869bf67.js → app-globals-33c9f31b.js} +1 -1
- package/dist/cjs/{PrivateRoute-043bb7d3.js → auth.service-4b584cd7.js} +4 -33
- package/dist/cjs/{auth.store-ff3fda09.js → auth.store-1e630a7d.js} +48 -725
- package/dist/cjs/compass-svg.cjs.entry.js +1 -1
- package/dist/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/cjs/course-select.cjs.entry.js +1 -1
- package/dist/cjs/{cubic-bezier-293f4663.js → cubic-bezier-53d26d05.js} +10 -11
- package/dist/cjs/dom-utils-b8befdd5.js +63 -0
- package/dist/cjs/{facilitator.service-faac5c0c.js → facilitator.service-9e990274.js} +8 -7
- package/dist/cjs/{feed.service-66405969.js → feed.service-b4f09441.js} +8 -7
- package/dist/cjs/{focus-visible-ad3828a7.js → focus-visible-b0b07ba6.js} +19 -6
- package/dist/cjs/{framework-delegate-2470a246.js → framework-delegate-59a98abd.js} +11 -13
- package/dist/cjs/{gesture-controller-07c31f70.js → gesture-controller-0eb5579e.js} +1 -1
- package/dist/cjs/{haptic-91e86eb7.js → haptic-780f33c4.js} +3 -2
- package/dist/cjs/{hardware-back-button-f7b5d99e.js → hardware-back-button-92d97ff8.js} +8 -8
- package/dist/cjs/header-mobile-collapse_2.cjs.entry.js +112 -0
- package/dist/cjs/{helpers-7e28976c.js → helpers-c2496722.js} +81 -14
- package/dist/cjs/httpService-7211d93b.js +685 -0
- package/dist/cjs/{icons-80d477f6.js → icons-c61db785.js} +1 -1
- package/dist/cjs/{index-43642662.js → index-12082cba.js} +21 -18
- package/dist/cjs/{index-459a5fa9.js → index-15ea05f5.js} +19 -28
- package/dist/cjs/{index-bae2a754.js → index-51e8292e.js} +18 -11
- package/dist/cjs/index-70e63f5b.js +3071 -0
- package/dist/cjs/{index-b12edb26.js → index-787d4498.js} +17 -25
- package/dist/cjs/{tap-click-1caf1780.js → index-8b5629a6.js} +30 -20
- package/dist/cjs/{index-8540d72e.js → index-975586fd.js} +7 -1
- package/dist/cjs/index-9c7b27e4.js +140 -0
- package/dist/cjs/{index-185f9c5a.js → index-af080b50.js} +9 -8
- package/dist/cjs/index-e56e09b8.js +38 -0
- package/dist/cjs/index.cjs.js +13 -11
- package/dist/cjs/{index.es-ef3efdfb.js → index.es-38cbcdbe.js} +2 -7
- package/dist/cjs/injectHistory-7206bbb9.js +9 -0
- package/dist/cjs/{input-shims-6c442c9f.js → input-shims-eff63b88.js} +21 -24
- package/dist/cjs/ion-accordion-group.cjs.entry.js +17 -9
- package/dist/cjs/ion-accordion.cjs.entry.js +19 -23
- package/dist/cjs/ion-action-sheet_4.cjs.entry.js +216 -212
- package/dist/cjs/ion-app.cjs.entry.js +8 -8
- package/dist/cjs/ion-avatar_16.cjs.entry.js +1907 -0
- package/dist/cjs/ion-back-button.cjs.entry.js +11 -11
- package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
- package/dist/cjs/ion-badge.cjs.entry.js +3 -3
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +13 -21
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +12 -14
- package/dist/cjs/ion-buttons_3.cjs.entry.js +13 -13
- package/dist/cjs/ion-card-header.cjs.entry.js +4 -4
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
- package/dist/cjs/ion-checkbox_4.cjs.entry.js +360 -0
- package/dist/cjs/ion-chip.cjs.entry.js +3 -3
- package/dist/cjs/ion-col_3.cjs.entry.js +159 -0
- package/dist/cjs/ion-content_2.cjs.entry.js +59 -52
- package/dist/cjs/ion-datetime-button.cjs.entry.js +312 -0
- package/dist/cjs/ion-datetime.cjs.entry.js +752 -1245
- package/dist/cjs/ion-fab-button.cjs.entry.js +25 -9
- package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
- package/dist/cjs/ion-fab.cjs.entry.js +15 -13
- package/dist/cjs/ion-footer.cjs.entry.js +16 -14
- package/dist/cjs/ion-img.cjs.entry.js +4 -4
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -15
- package/dist/cjs/ion-item-divider.cjs.entry.js +4 -4
- package/dist/cjs/ion-item-group.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
- package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
- package/dist/cjs/ion-item-sliding.cjs.entry.js +41 -46
- package/dist/cjs/ion-loading.cjs.entry.js +23 -35
- package/dist/cjs/ion-menu-button.cjs.entry.js +13 -13
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +7 -7
- package/dist/cjs/ion-menu.cjs.entry.js +47 -40
- package/dist/cjs/ion-modal.cjs.entry.js +935 -282
- package/dist/cjs/ion-nav-link.cjs.entry.js +2 -2
- package/dist/cjs/ion-nav.cjs.entry.js +45 -35
- package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +151 -43
- package/dist/cjs/ion-picker-column.cjs.entry.js +23 -25
- package/dist/cjs/ion-picker.cjs.entry.js +15 -17
- package/dist/cjs/ion-progress-bar.cjs.entry.js +6 -8
- package/dist/cjs/ion-range.cjs.entry.js +515 -0
- package/dist/cjs/ion-refresher-content.cjs.entry.js +6 -12
- package/dist/cjs/ion-refresher.cjs.entry.js +68 -50
- package/dist/cjs/ion-reorder-group.cjs.entry.js +15 -16
- package/dist/cjs/ion-reorder.cjs.entry.js +3 -3
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
- package/dist/cjs/ion-router-outlet.cjs.entry.js +22 -20
- package/dist/cjs/ion-router.cjs.entry.js +32 -31
- package/dist/cjs/ion-searchbar.cjs.entry.js +14 -16
- package/dist/cjs/ion-segment-button.cjs.entry.js +8 -8
- package/dist/cjs/ion-segment.cjs.entry.js +24 -26
- package/dist/cjs/ion-select_2.cjs.entry.js +59 -56
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +4 -4
- package/dist/cjs/ion-slide.cjs.entry.js +3 -3
- package/dist/cjs/ion-slides.cjs.entry.js +23 -23
- package/dist/cjs/ion-split-pane.cjs.entry.js +10 -11
- package/dist/cjs/ion-tab-bar.cjs.entry.js +5 -5
- package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
- package/dist/cjs/ion-tab.cjs.entry.js +4 -4
- package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
- package/dist/cjs/ion-text.cjs.entry.js +24 -0
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +23 -43
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +29 -28
- package/dist/cjs/{ionic-global-878073d1.js → ionic-global-2cde9d3a.js} +27 -31
- package/dist/cjs/{ios.transition-c3bfb096.js → ios.transition-da235483.js} +71 -51
- package/dist/cjs/{keyboard-dfd76ac3.js → keyboard-91096619.js} +3 -3
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/match-path-84c9f7ca.js +511 -0
- package/dist/cjs/{md.transition-7eb9a1a7.js → md.transition-be429e07.js} +9 -16
- package/dist/cjs/{menu-toggle-util-cb549c2c.js → menu-toggle-util-7a01448c.js} +2 -2
- package/dist/cjs/{overlays-0a748609.js → overlays-32df265a.js} +29 -29
- package/dist/cjs/parse-d0071120.js +1237 -0
- package/dist/cjs/{purify-d0ad2883.js → purify-fb9c107e.js} +1 -1
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-card_3.cjs.entry.js +91 -0
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +5 -5
- package/dist/cjs/sparkle-course-root.cjs.entry.js +146 -0
- package/dist/cjs/sparkle-dropdown.cjs.entry.js +61 -0
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/{header-mobile-collapse_61.cjs.entry.js → sparkle-export-lessons_6.cjs.entry.js} +8865 -17663
- package/dist/cjs/sparkle-facilitator-header_19.cjs.entry.js +2130 -0
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +8 -7
- package/dist/cjs/sparkle-feedback.cjs.entry.js +9 -7
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +8 -7
- package/dist/cjs/sparkle-goal-progress.cjs.entry.js +19 -0
- package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-gww-item.cjs.entry.js +74 -0
- package/dist/cjs/sparkle-intro.cjs.entry.js +26 -0
- package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-menu-toggle_3.cjs.entry.js +236 -0
- package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-overlay.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-validation-error.cjs.entry.js +21 -0
- package/dist/cjs/sparkle-youtube.cjs.entry.js +1 -1
- package/dist/cjs/{spinner-configs-6f6b7ef0.js → spinner-configs-0ac05f2d.js} +43 -43
- package/dist/cjs/{status-tap-8697433c.js → status-tap-033befa2.js} +7 -5
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/cjs/stencil-route-link.cjs.entry.js +77 -0
- package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-redirect.cjs.entry.js +32 -0
- package/dist/cjs/student.service-d48f1c99.js +61 -0
- package/dist/cjs/{swipe-back-7e08b5e0.js → swipe-back-4a826f9b.js} +5 -5
- package/dist/cjs/{theme-4252ac15.js → theme-b0b295c1.js} +6 -5
- package/dist/cjs/user.store-8a049c4e.js +21 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +16 -0
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +197 -3
- package/dist/collection/components/sparkle-intro/sparkle-intro.css +15 -0
- package/dist/collection/components/sparkle-intro/sparkle-intro.js +35 -0
- package/dist/esm/PrivateRoute-530ef873.js +33 -0
- package/dist/esm/{active-router-909088d6.js → active-router-9843e205.js} +1 -1
- package/dist/esm/{animation-b306f6c2.js → animation-d98d3e81.js} +83 -78
- package/dist/esm/{app-globals-5c736ae5.js → app-globals-08edc964.js} +1 -1
- package/dist/esm/{PrivateRoute-b9937c45.js → auth.service-79389d86.js} +4 -32
- package/dist/esm/{auth.store-3ed2389e.js → auth.store-b812b34b.js} +45 -725
- package/dist/esm/compass-svg.entry.js +1 -1
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/{cubic-bezier-a7ad9c8e.js → cubic-bezier-4c0db14f.js} +10 -11
- package/dist/esm/dom-utils-8e73e88b.js +55 -0
- package/dist/esm/{facilitator.service-ec0a9739.js → facilitator.service-7babc526.js} +2 -1
- package/dist/esm/{feed.service-33b83cb7.js → feed.service-80fbe79d.js} +3 -2
- package/dist/esm/{focus-visible-40cda868.js → focus-visible-4e9a0764.js} +19 -6
- package/dist/esm/{framework-delegate-3bc58c27.js → framework-delegate-9b329182.js} +11 -13
- package/dist/esm/{gesture-controller-686622ba.js → gesture-controller-7be18351.js} +1 -1
- package/dist/esm/{haptic-99c9e346.js → haptic-3a76a65c.js} +4 -3
- package/dist/esm/{hardware-back-button-b6ccf74a.js → hardware-back-button-fa04d6e9.js} +8 -8
- package/dist/esm/header-mobile-collapse_2.entry.js +107 -0
- package/dist/esm/{helpers-39367fe1.js → helpers-94a5855b.js} +81 -15
- package/dist/esm/httpService-b2b7a1ad.js +683 -0
- package/dist/esm/{icons-61dec176.js → icons-16f1a80b.js} +2 -2
- package/dist/esm/{index-a12c14bd.js → index-21661af2.js} +22 -19
- package/dist/esm/{tap-click-13f1fb0d.js → index-230a26c9.js} +30 -20
- package/dist/esm/{index-c26d8655.js → index-478745be.js} +17 -25
- package/dist/esm/{index-dc61f152.js → index-4ec6b9c2.js} +5 -2
- package/dist/esm/{index-9594837e.js → index-95307148.js} +19 -28
- package/dist/esm/{index-5568e3fa.js → index-9db08224.js} +19 -12
- package/dist/esm/index-ab1c6a9f.js +3067 -0
- package/dist/esm/{index-435af8e6.js → index-be6112f8.js} +9 -8
- package/dist/esm/index-c23a1826.js +128 -0
- package/dist/esm/index-dad75b83.js +34 -0
- package/dist/esm/{index.es-97dd8174.js → index.es-1c3b1ef3.js} +2 -7
- package/dist/esm/index.js +9 -7
- package/dist/esm/injectHistory-4bfff188.js +7 -0
- package/dist/esm/{input-shims-cc98ea92.js → input-shims-ce5c01df.js} +21 -24
- package/dist/esm/ion-accordion-group.entry.js +17 -9
- package/dist/esm/ion-accordion.entry.js +19 -23
- package/dist/esm/ion-action-sheet_4.entry.js +216 -212
- package/dist/esm/ion-app.entry.js +8 -8
- package/dist/esm/ion-avatar_16.entry.js +1888 -0
- package/dist/esm/ion-back-button.entry.js +11 -11
- package/dist/esm/ion-backdrop.entry.js +4 -4
- package/dist/esm/ion-badge.entry.js +3 -3
- package/dist/esm/ion-breadcrumb.entry.js +13 -21
- package/dist/esm/ion-breadcrumbs.entry.js +12 -14
- package/dist/esm/ion-buttons_3.entry.js +13 -13
- package/dist/esm/ion-card-header.entry.js +4 -4
- package/dist/esm/ion-card-subtitle.entry.js +4 -4
- package/dist/esm/ion-checkbox_4.entry.js +353 -0
- package/dist/esm/ion-chip.entry.js +3 -3
- package/dist/esm/ion-col_3.entry.js +153 -0
- package/dist/esm/ion-content_2.entry.js +59 -52
- package/dist/esm/ion-datetime-button.entry.js +308 -0
- package/dist/esm/ion-datetime.entry.js +723 -1216
- package/dist/esm/ion-fab-button.entry.js +25 -9
- package/dist/esm/ion-fab-list.entry.js +4 -4
- package/dist/esm/ion-fab.entry.js +15 -13
- package/dist/esm/ion-footer.entry.js +16 -14
- package/dist/esm/ion-img.entry.js +4 -4
- package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
- package/dist/esm/ion-infinite-scroll.entry.js +13 -15
- package/dist/esm/ion-item-divider.entry.js +4 -4
- package/dist/esm/ion-item-group.entry.js +3 -3
- package/dist/esm/ion-item-option.entry.js +8 -8
- package/dist/esm/ion-item-options.entry.js +5 -5
- package/dist/esm/ion-item-sliding.entry.js +41 -46
- package/dist/esm/ion-loading.entry.js +23 -35
- package/dist/esm/ion-menu-button.entry.js +13 -13
- package/dist/esm/ion-menu-toggle.entry.js +7 -7
- package/dist/esm/ion-menu.entry.js +47 -40
- package/dist/esm/ion-modal.entry.js +921 -268
- package/dist/esm/ion-nav-link.entry.js +2 -2
- package/dist/esm/ion-nav.entry.js +45 -35
- package/dist/esm/ion-picker-column-internal_2.entry.js +151 -43
- package/dist/esm/ion-picker-column.entry.js +23 -25
- package/dist/esm/ion-picker.entry.js +15 -17
- package/dist/esm/ion-progress-bar.entry.js +6 -8
- package/dist/esm/ion-range.entry.js +511 -0
- package/dist/esm/ion-refresher-content.entry.js +6 -12
- package/dist/esm/ion-refresher.entry.js +68 -50
- package/dist/esm/ion-reorder-group.entry.js +15 -16
- package/dist/esm/ion-reorder.entry.js +3 -3
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +5 -5
- package/dist/esm/ion-router-outlet.entry.js +22 -20
- package/dist/esm/ion-router.entry.js +32 -31
- package/dist/esm/ion-searchbar.entry.js +14 -16
- package/dist/esm/ion-segment-button.entry.js +8 -8
- package/dist/esm/ion-segment.entry.js +24 -26
- package/dist/esm/ion-select_2.entry.js +59 -56
- package/dist/esm/ion-skeleton-text.entry.js +4 -4
- package/dist/esm/ion-slide.entry.js +3 -3
- package/dist/esm/ion-slides.entry.js +23 -23
- package/dist/esm/ion-split-pane.entry.js +10 -11
- package/dist/esm/ion-tab-bar.entry.js +5 -5
- package/dist/esm/ion-tab-button.entry.js +6 -6
- package/dist/esm/ion-tab.entry.js +4 -4
- package/dist/esm/ion-tabs.entry.js +4 -5
- package/dist/esm/ion-text.entry.js +20 -0
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +23 -43
- package/dist/esm/ion-virtual-scroll.entry.js +29 -28
- package/dist/esm/{ionic-global-0939c477.js → ionic-global-293e882b.js} +27 -31
- package/dist/esm/{ios.transition-b4ca8a33.js → ios.transition-7cd34deb.js} +71 -51
- package/dist/esm/{keyboard-2503e874.js → keyboard-7e8329b3.js} +3 -3
- package/dist/esm/loader.js +5 -5
- package/dist/esm/match-path-36fdf5c7.js +499 -0
- package/dist/esm/{md.transition-ca5e0322.js → md.transition-2589a5b1.js} +9 -16
- package/dist/esm/{menu-toggle-util-7fa22c2f.js → menu-toggle-util-f92ba2f0.js} +2 -2
- package/dist/esm/{overlays-34cfa9e0.js → overlays-dfa730c8.js} +30 -30
- package/dist/esm/parse-1ae3a9bb.js +1196 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{purify-ffce2b4c.js → purify-79af871f.js} +1 -1
- package/dist/esm/sparkle-animation-player.entry.js +2 -2
- package/dist/esm/sparkle-card_3.entry.js +85 -0
- package/dist/esm/sparkle-character-intro.entry.js +1 -1
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +5 -5
- package/dist/esm/sparkle-course-root.entry.js +142 -0
- package/dist/esm/sparkle-dropdown.entry.js +57 -0
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/{header-mobile-collapse_61.entry.js → sparkle-export-lessons_6.entry.js} +8860 -17603
- package/dist/esm/sparkle-facilitator-header_19.entry.js +2108 -0
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +8 -7
- package/dist/esm/sparkle-feedback.entry.js +9 -7
- package/dist/esm/sparkle-goal-form.entry.js +9 -8
- package/dist/esm/sparkle-goal-progress.entry.js +15 -0
- package/dist/esm/sparkle-gww-comment-list.entry.js +1 -1
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-gww-item.entry.js +70 -0
- package/dist/esm/sparkle-intro.entry.js +22 -0
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-menu-toggle_3.entry.js +230 -0
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +1 -1
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
- package/dist/esm/sparkle-quiz.entry.js +1 -1
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +1 -1
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-validation-error.entry.js +17 -0
- package/dist/esm/sparkle-youtube.entry.js +1 -1
- package/dist/esm/{spinner-configs-f609a655.js → spinner-configs-a37e628a.js} +43 -43
- package/dist/esm/{status-tap-6351a0cb.js → status-tap-79b6199d.js} +7 -5
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-link.entry.js +73 -0
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/stencil-router-redirect.entry.js +28 -0
- package/dist/esm/{student.service-29b688ba.js → student.service-0caed0f4.js} +3 -18
- package/dist/esm/{swipe-back-34251834.js → swipe-back-ad7a0361.js} +5 -5
- package/dist/esm/{theme-c336c9d9.js → theme-7ef00c83.js} +6 -5
- package/dist/esm/user.store-8477642a.js +19 -0
- package/dist/esm/{util-6ef753e9.js → util-a831d09d.js} +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +8 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +46 -22
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +43 -19
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +60 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +3 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +1 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +1 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +1 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +1 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +31 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +29 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +24 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +24 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +8 -8
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +34 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +34 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +50 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +27 -0
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-0127a61a.entry.js +1 -0
- package/dist/sparkle-core/p-01743e3e.js +4 -0
- package/dist/sparkle-core/p-06af1bc8.entry.js +1 -0
- package/dist/sparkle-core/{p-703ca87c.js → p-076f0239.js} +0 -0
- package/dist/sparkle-core/p-0798d46a.entry.js +1 -0
- package/dist/sparkle-core/p-085eb951.entry.js +4 -0
- package/dist/sparkle-core/{p-39e5a90f.entry.js → p-0b92326d.entry.js} +1 -1
- package/dist/sparkle-core/{p-5ff6416d.entry.js → p-0c603495.entry.js} +2 -2
- package/dist/sparkle-core/{p-6bbabb80.entry.js → p-0d7cceaa.entry.js} +1 -1
- package/dist/sparkle-core/p-0d813026.entry.js +1 -0
- package/dist/sparkle-core/{p-69e7783d.js → p-0e4de1d0.js} +0 -0
- package/dist/sparkle-core/p-11ed6b7f.entry.js +1 -0
- package/dist/sparkle-core/p-122427b7.entry.js +1 -0
- package/dist/sparkle-core/p-12c4f45c.entry.js +1 -0
- package/dist/sparkle-core/p-136b93d5.entry.js +4 -0
- package/dist/sparkle-core/{p-e225581a.js → p-1394cbb8.js} +2 -2
- package/dist/sparkle-core/{p-c48bbc7c.entry.js → p-14340143.entry.js} +1 -1
- package/dist/sparkle-core/p-14a06a91.entry.js +1 -0
- package/dist/sparkle-core/{p-a9ee3f6d.entry.js → p-16b7974e.entry.js} +1 -1
- package/dist/sparkle-core/p-16c81890.entry.js +1 -0
- package/dist/sparkle-core/{p-5c9aa1f9.entry.js → p-1701723e.entry.js} +1 -1
- package/dist/sparkle-core/p-1728ead7.js +1 -0
- package/dist/sparkle-core/p-17aef6f9.js +1 -0
- package/dist/sparkle-core/p-180857a2.entry.js +1 -0
- package/dist/sparkle-core/p-1acc7870.entry.js +1 -0
- package/dist/sparkle-core/{p-513794b0.js → p-1c2aee9c.js} +1 -1
- package/dist/sparkle-core/p-1cd4c3cc.entry.js +1 -0
- package/dist/sparkle-core/p-21d9833d.js +1 -0
- package/dist/sparkle-core/p-23d713e2.js +1 -0
- package/dist/sparkle-core/p-25c13612.entry.js +1 -0
- package/dist/sparkle-core/p-2699868a.entry.js +1 -0
- package/dist/sparkle-core/p-27075abe.js +4 -0
- package/dist/sparkle-core/{p-713590fc.js → p-280e938d.js} +1 -1
- package/dist/sparkle-core/p-2bd4c60e.js +1 -0
- package/dist/sparkle-core/p-2c89a6c2.entry.js +1 -0
- package/dist/sparkle-core/p-308517b3.js +4 -0
- package/dist/sparkle-core/p-3227afcb.entry.js +1 -0
- package/dist/sparkle-core/{p-173d5461.entry.js → p-34d93a39.entry.js} +1 -1
- package/dist/sparkle-core/p-34ebfc8a.entry.js +1 -0
- package/dist/sparkle-core/p-351b82a8.entry.js +1 -0
- package/dist/sparkle-core/p-363a2d6d.js +4 -0
- package/dist/sparkle-core/p-36c48760.entry.js +1 -0
- package/dist/sparkle-core/p-3810777d.js +4 -0
- package/dist/sparkle-core/p-384911d7.entry.js +1 -0
- package/dist/sparkle-core/p-3b618eda.entry.js +1 -0
- package/dist/sparkle-core/p-3c752205.entry.js +1 -0
- package/dist/sparkle-core/{p-50aac721.entry.js → p-3d2c0e24.entry.js} +2 -2
- package/dist/sparkle-core/{p-350adbaa.entry.js → p-3eb56165.entry.js} +1 -1
- package/dist/sparkle-core/{p-ed0e9d29.entry.js → p-3ef53ebf.entry.js} +1 -1
- package/dist/sparkle-core/{p-fbd7eeca.entry.js → p-3fd92216.entry.js} +1 -1
- package/dist/sparkle-core/{p-1df05176.js → p-4338e1e3.js} +2 -2
- package/dist/sparkle-core/p-442eadcf.entry.js +1 -0
- package/dist/sparkle-core/{p-5f45d206.entry.js → p-4af496a8.entry.js} +1 -1
- package/dist/sparkle-core/{p-935e7cfc.js → p-4bd4dab2.js} +1 -1
- package/dist/sparkle-core/{p-18e62133.entry.js → p-4c9e010d.entry.js} +1 -1
- package/dist/sparkle-core/p-4d0dfbc9.js +1 -0
- package/dist/sparkle-core/{p-8c6b6038.js → p-4d4077ea.js} +0 -0
- package/dist/sparkle-core/p-4e0502b8.entry.js +4 -0
- package/dist/sparkle-core/p-506f3c5f.js +4 -0
- package/dist/sparkle-core/p-524a6174.entry.js +1 -0
- package/dist/sparkle-core/p-53aac9d7.entry.js +1 -0
- package/dist/sparkle-core/{p-0580419b.entry.js → p-56700a40.entry.js} +1 -1
- package/dist/sparkle-core/p-5722be24.entry.js +1 -0
- package/dist/sparkle-core/p-58389020.entry.js +348 -0
- package/dist/sparkle-core/{p-11cf398a.entry.js → p-58f74119.entry.js} +1 -1
- package/dist/sparkle-core/p-5979f253.entry.js +1 -0
- package/dist/sparkle-core/p-5a3de051.entry.js +4 -0
- package/dist/sparkle-core/p-5a850731.entry.js +1 -0
- package/dist/sparkle-core/{p-950effe7.entry.js → p-5dcf33fb.entry.js} +1 -1
- package/dist/sparkle-core/p-5e8fa1ac.entry.js +1 -0
- package/dist/sparkle-core/p-5ef50959.js +1 -0
- package/dist/sparkle-core/p-615b8f64.entry.js +1 -0
- package/dist/sparkle-core/{p-90389886.entry.js → p-63d8a5b7.entry.js} +1 -1
- package/dist/sparkle-core/p-6a337ad1.entry.js +1 -0
- package/dist/sparkle-core/p-6a5ace01.js +2 -0
- package/dist/sparkle-core/{p-d7baf31e.entry.js → p-6ae9c743.entry.js} +1 -1
- package/dist/sparkle-core/p-76206f80.entry.js +1 -0
- package/dist/sparkle-core/{p-99b43ee1.entry.js → p-767c9db8.entry.js} +1 -1
- package/dist/sparkle-core/p-76a6e202.entry.js +1 -0
- package/dist/sparkle-core/{p-ee0d7f19.entry.js → p-785f1879.entry.js} +1 -1
- package/dist/sparkle-core/p-788735b9.entry.js +1 -0
- package/dist/sparkle-core/{p-057f6a23.entry.js → p-7b21bd70.entry.js} +1 -1
- package/dist/sparkle-core/p-7b3d1457.js +1 -0
- package/dist/sparkle-core/p-7d8427eb.js +4 -0
- package/dist/sparkle-core/{p-5264da79.js → p-7e7ce516.js} +0 -0
- package/dist/sparkle-core/{p-838fa86d.entry.js → p-8cbe019a.entry.js} +5 -5
- package/dist/sparkle-core/{p-9c1772c3.js → p-8d630960.js} +1 -1
- package/dist/sparkle-core/{p-7052c43a.entry.js → p-8e42e634.entry.js} +1 -1
- package/dist/sparkle-core/p-8e56f9ee.entry.js +1 -0
- package/dist/sparkle-core/p-8ed0cefb.entry.js +1 -0
- package/dist/sparkle-core/{p-d4c07aca.js → p-924b2917.js} +0 -0
- package/dist/sparkle-core/p-9484e34b.entry.js +1 -0
- package/dist/sparkle-core/p-966817ec.js +1 -0
- package/dist/sparkle-core/p-969e98e5.entry.js +1 -0
- package/dist/sparkle-core/p-98f3925b.js +4 -0
- package/dist/sparkle-core/{p-a1cab0f3.js → p-99231c00.js} +2 -2
- package/dist/sparkle-core/p-9a383065.entry.js +7 -0
- package/dist/sparkle-core/p-9b4979b5.entry.js +4 -0
- package/dist/sparkle-core/{p-c69b0a7a.entry.js → p-9cd95e7e.entry.js} +1 -1
- package/dist/sparkle-core/p-9dc42d70.entry.js +1 -0
- package/dist/sparkle-core/p-9eea81f2.js +1 -0
- package/dist/sparkle-core/{p-797c23ed.entry.js → p-9ef14088.entry.js} +1 -1
- package/dist/sparkle-core/p-a05871e6.js +1 -0
- package/dist/sparkle-core/p-a111c567.entry.js +1 -0
- package/dist/sparkle-core/{p-1af044f7.js → p-a19b42f0.js} +1 -1
- package/dist/sparkle-core/p-a208ab2d.js +4 -0
- package/dist/sparkle-core/p-a2f7c751.entry.js +1 -0
- package/dist/sparkle-core/p-a458b415.entry.js +1 -0
- package/dist/sparkle-core/p-a6c1a55a.entry.js +5 -0
- package/dist/sparkle-core/{p-145e40f5.entry.js → p-ab3a8f5e.entry.js} +1 -1
- package/dist/sparkle-core/p-ac0e4d8c.entry.js +1 -0
- package/dist/sparkle-core/p-add30d46.js +4 -0
- package/dist/sparkle-core/{p-5b40aae5.entry.js → p-b00d0a47.entry.js} +1 -1
- package/dist/sparkle-core/p-b2827978.entry.js +1 -0
- package/dist/sparkle-core/p-b8ba8164.entry.js +1 -0
- package/dist/sparkle-core/{p-6823e6c1.entry.js → p-ba775d8e.entry.js} +1 -1
- package/dist/sparkle-core/{p-37c00e39.entry.js → p-bae8cd7d.entry.js} +1 -1
- package/dist/sparkle-core/p-bb3e3482.entry.js +1 -0
- package/dist/sparkle-core/p-bb575dba.entry.js +1 -0
- package/dist/sparkle-core/p-bd2c8e30.entry.js +10 -0
- package/dist/sparkle-core/p-c48352cf.js +4 -0
- package/dist/sparkle-core/{p-667accac.entry.js → p-c5eb4404.entry.js} +1 -1
- package/dist/sparkle-core/p-c8ad5a5b.entry.js +4 -0
- package/dist/sparkle-core/p-c9f474d0.js +4 -0
- package/dist/sparkle-core/p-ca0edc9b.entry.js +1 -0
- package/dist/sparkle-core/{p-680663a2.entry.js → p-cb04b18a.entry.js} +1 -1
- package/dist/sparkle-core/{p-b3909012.entry.js → p-d0d0e5e5.entry.js} +1 -1
- package/dist/sparkle-core/{p-7d61177b.entry.js → p-d220a642.entry.js} +1 -1
- package/dist/sparkle-core/p-d38a2511.entry.js +1 -0
- package/dist/sparkle-core/{p-b07a2cf2.entry.js → p-d5b8302f.entry.js} +1 -1
- package/dist/sparkle-core/p-d5ba8e80.entry.js +1 -0
- package/dist/sparkle-core/{p-3a202a38.entry.js → p-d6637b48.entry.js} +1 -1
- package/dist/sparkle-core/p-d6788642.entry.js +1 -0
- package/dist/sparkle-core/p-d6a3a639.entry.js +1 -0
- package/dist/sparkle-core/p-d86f8633.entry.js +1 -0
- package/dist/sparkle-core/{p-9cfdeb18.entry.js → p-defeaa5c.entry.js} +1 -1
- package/dist/sparkle-core/p-df5cfa7f.entry.js +1 -0
- package/dist/sparkle-core/p-df5efe0d.entry.js +1 -0
- package/dist/sparkle-core/p-dff8325e.js +4 -0
- package/dist/sparkle-core/p-e09de7ac.js +1 -0
- package/dist/sparkle-core/{p-016a7aaf.entry.js → p-e1743d82.entry.js} +1 -1
- package/dist/sparkle-core/p-e28a106d.entry.js +1 -0
- package/dist/sparkle-core/p-e566c0b3.entry.js +1 -0
- package/dist/sparkle-core/{p-bca0e465.entry.js → p-e6d39f6e.entry.js} +1 -1
- package/dist/sparkle-core/p-e9431eeb.js +7 -0
- package/dist/sparkle-core/p-ea4a9f0d.entry.js +1 -0
- package/dist/sparkle-core/p-ea7d7a3b.js +1 -0
- package/dist/sparkle-core/p-eaa8bbee.js +4 -0
- package/dist/sparkle-core/p-ed3dfd89.js +4 -0
- package/dist/sparkle-core/{p-3defe550.entry.js → p-efe37368.entry.js} +1 -1
- package/dist/sparkle-core/p-f187d129.entry.js +1 -0
- package/dist/sparkle-core/{p-a9ccb0df.js → p-f3cba72a.js} +0 -0
- package/dist/sparkle-core/{p-052caa63.js → p-f5e7bfa5.js} +1 -1
- package/dist/sparkle-core/{p-ecd39170.entry.js → p-f63a13d8.entry.js} +1 -1
- package/dist/sparkle-core/{p-1726da2f.entry.js → p-fdb9a613.entry.js} +1 -1
- package/dist/sparkle-core/p-fde96f7c.js +4 -0
- package/dist/sparkle-core/{p-aa87c7f0.entry.js → p-fe214d79.entry.js} +1 -1
- package/dist/sparkle-core/p-fe3a7bca.js +1 -0
- package/dist/sparkle-core/{p-aa9ebc39.entry.js → p-fea20ec2.entry.js} +1 -1
- package/dist/sparkle-core/p-ff26d891.entry.js +1 -0
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +16 -0
- package/dist/types/components/sparkle-intro/sparkle-intro.d.ts +7 -0
- package/dist/types/components.d.ts +73 -11
- package/package.json +3 -3
- package/dist/cjs/ion-card-title.cjs.entry.js +0 -30
- package/dist/cjs/ion-textarea.cjs.entry.js +0 -247
- package/dist/cjs/ion-toggle.cjs.entry.js +0 -160
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -19
- package/dist/cjs/student.service-744c3155.js +0 -77
- package/dist/esm/ion-card-title.entry.js +0 -26
- package/dist/esm/ion-textarea.entry.js +0 -243
- package/dist/esm/ion-toggle.entry.js +0 -156
- package/dist/esm/sparkle-feed-post.entry.js +0 -15
- package/dist/sparkle-core/p-0187adef.entry.js +0 -1
- package/dist/sparkle-core/p-03189863.js +0 -1
- package/dist/sparkle-core/p-03ec54a8.entry.js +0 -1
- package/dist/sparkle-core/p-04583c51.entry.js +0 -1
- package/dist/sparkle-core/p-063cd168.js +0 -4
- package/dist/sparkle-core/p-081968cc.entry.js +0 -1
- package/dist/sparkle-core/p-0934f5dd.entry.js +0 -1
- package/dist/sparkle-core/p-0f899097.entry.js +0 -352
- package/dist/sparkle-core/p-1339830f.entry.js +0 -1
- package/dist/sparkle-core/p-1b78dea1.entry.js +0 -1
- package/dist/sparkle-core/p-1cef8572.js +0 -4
- package/dist/sparkle-core/p-21bf4ca0.entry.js +0 -1
- package/dist/sparkle-core/p-21db4e8e.entry.js +0 -1
- package/dist/sparkle-core/p-23a9f7d1.entry.js +0 -1
- package/dist/sparkle-core/p-289a35ed.entry.js +0 -1
- package/dist/sparkle-core/p-2ee6a5f9.entry.js +0 -1
- package/dist/sparkle-core/p-35a7bd6c.entry.js +0 -1
- package/dist/sparkle-core/p-389500fd.js +0 -4
- package/dist/sparkle-core/p-45e6db62.entry.js +0 -1
- package/dist/sparkle-core/p-48f9b960.entry.js +0 -1
- package/dist/sparkle-core/p-4dc3ef96.entry.js +0 -1
- package/dist/sparkle-core/p-547b70c6.entry.js +0 -1
- package/dist/sparkle-core/p-5598650a.entry.js +0 -1
- package/dist/sparkle-core/p-55ae49e1.js +0 -4
- package/dist/sparkle-core/p-58e98f89.entry.js +0 -1
- package/dist/sparkle-core/p-59f7bf6e.entry.js +0 -1
- package/dist/sparkle-core/p-5a3d0e6b.js +0 -4
- package/dist/sparkle-core/p-5d2e54ee.entry.js +0 -1
- package/dist/sparkle-core/p-62a6c96f.entry.js +0 -1
- package/dist/sparkle-core/p-64e72f8f.js +0 -4
- package/dist/sparkle-core/p-660e0742.js +0 -1
- package/dist/sparkle-core/p-6bf07a28.js +0 -1
- package/dist/sparkle-core/p-6c6145cd.js +0 -4
- package/dist/sparkle-core/p-6c90bde6.entry.js +0 -5
- package/dist/sparkle-core/p-6e88764b.entry.js +0 -4
- package/dist/sparkle-core/p-6ee40949.js +0 -1
- package/dist/sparkle-core/p-6fbe3ca3.entry.js +0 -1
- package/dist/sparkle-core/p-6fd4985d.js +0 -4
- package/dist/sparkle-core/p-70b2452c.js +0 -4
- package/dist/sparkle-core/p-7493ee15.entry.js +0 -1
- package/dist/sparkle-core/p-75572037.js +0 -1
- package/dist/sparkle-core/p-768bcc9e.entry.js +0 -1
- package/dist/sparkle-core/p-7e61973d.entry.js +0 -7
- package/dist/sparkle-core/p-855ca600.js +0 -1
- package/dist/sparkle-core/p-857f3696.entry.js +0 -1
- package/dist/sparkle-core/p-8fe2e51f.entry.js +0 -4
- package/dist/sparkle-core/p-932bfb69.entry.js +0 -1
- package/dist/sparkle-core/p-941eaa3a.entry.js +0 -1
- package/dist/sparkle-core/p-95004267.entry.js +0 -1
- package/dist/sparkle-core/p-996361f9.entry.js +0 -1
- package/dist/sparkle-core/p-9a17f2ad.js +0 -4
- package/dist/sparkle-core/p-9babd345.js +0 -1
- package/dist/sparkle-core/p-a080e768.entry.js +0 -1
- package/dist/sparkle-core/p-a7cc0052.entry.js +0 -4
- package/dist/sparkle-core/p-ae1f145d.entry.js +0 -1
- package/dist/sparkle-core/p-b3e6427d.js +0 -7
- package/dist/sparkle-core/p-b49ca0ea.entry.js +0 -1
- package/dist/sparkle-core/p-b81e20fe.entry.js +0 -4
- package/dist/sparkle-core/p-c1279cc9.entry.js +0 -1
- package/dist/sparkle-core/p-c1376096.entry.js +0 -1
- package/dist/sparkle-core/p-c3986a52.entry.js +0 -1
- package/dist/sparkle-core/p-c3d3d5c4.entry.js +0 -1
- package/dist/sparkle-core/p-c5b9bdd6.entry.js +0 -1
- package/dist/sparkle-core/p-cbbeed67.entry.js +0 -1
- package/dist/sparkle-core/p-d4a435f8.entry.js +0 -1
- package/dist/sparkle-core/p-d5b05ece.entry.js +0 -5
- package/dist/sparkle-core/p-d8d3524a.js +0 -1
- package/dist/sparkle-core/p-e0fced48.entry.js +0 -1
- package/dist/sparkle-core/p-e1cba44b.entry.js +0 -4
- package/dist/sparkle-core/p-e3fdd0a8.entry.js +0 -1
- package/dist/sparkle-core/p-e6b66cef.entry.js +0 -1
- package/dist/sparkle-core/p-e72d4450.js +0 -4
- package/dist/sparkle-core/p-eb70a23c.entry.js +0 -1
- package/dist/sparkle-core/p-f4001fdf.js +0 -4
- package/dist/sparkle-core/p-f9b73032.entry.js +0 -1
- package/dist/sparkle-core/p-faa912d7.entry.js +0 -1
- package/dist/sparkle-core/p-fc933591.entry.js +0 -1
- package/dist/sparkle-core/p-fef04ab5.js +0 -4
@@ -2,95 +2,80 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index$
|
6
|
-
const ionicGlobal = require('./ionic-global-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
12
|
-
const
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const
|
16
|
-
require('./
|
17
|
-
require('./
|
5
|
+
const index$2 = require('./index-51e8292e.js');
|
6
|
+
const ionicGlobal = require('./ionic-global-2cde9d3a.js');
|
7
|
+
const index$1 = require('./index-9c7b27e4.js');
|
8
|
+
const frameworkDelegate = require('./framework-delegate-59a98abd.js');
|
9
|
+
const helpers = require('./helpers-c2496722.js');
|
10
|
+
const keyboard = require('./keyboard-91096619.js');
|
11
|
+
const index$3 = require('./index-e56e09b8.js');
|
12
|
+
const overlays = require('./overlays-32df265a.js');
|
13
|
+
const theme = require('./theme-b0b295c1.js');
|
14
|
+
const index$4 = require('./index-787d4498.js');
|
15
|
+
const animation = require('./animation-ee586546.js');
|
16
|
+
const cubicBezier = require('./cubic-bezier-53d26d05.js');
|
17
|
+
const index = require('./index-12082cba.js');
|
18
|
+
require('./hardware-back-button-92d97ff8.js');
|
19
|
+
require('./gesture-controller-0eb5579e.js');
|
18
20
|
|
19
21
|
/*!
|
20
22
|
* (C) Ionic http://ionicframework.com - MIT License
|
21
23
|
*/
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
.progressEnd((shouldComplete) ? 1 : 0, newStepValue, duration);
|
75
|
-
if (shouldComplete) {
|
76
|
-
onDismiss();
|
24
|
+
/**
|
25
|
+
* When accessing the window, it is important
|
26
|
+
* to account for SSR applications where the
|
27
|
+
* window is not available. Code that accesses
|
28
|
+
* window when it is not available will crash.
|
29
|
+
* Even checking if `window === undefined` will cause
|
30
|
+
* apps to crash in SSR.
|
31
|
+
*
|
32
|
+
* Use win below to access an SSR-safe version
|
33
|
+
* of the window.
|
34
|
+
*
|
35
|
+
* Example 1:
|
36
|
+
* Before:
|
37
|
+
* if (window.innerWidth > 768) { ... }
|
38
|
+
*
|
39
|
+
* After:
|
40
|
+
* import { win } from 'path/to/this/file';
|
41
|
+
* if (win?.innerWidth > 768) { ... }
|
42
|
+
*
|
43
|
+
* Note: Code inside of this if-block will
|
44
|
+
* not run in an SSR environment.
|
45
|
+
*/
|
46
|
+
const win = typeof window !== 'undefined' ? window : undefined;
|
47
|
+
|
48
|
+
/*!
|
49
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
50
|
+
*/
|
51
|
+
var Style;
|
52
|
+
(function (Style) {
|
53
|
+
Style["Dark"] = "DARK";
|
54
|
+
Style["Light"] = "LIGHT";
|
55
|
+
Style["Default"] = "DEFAULT";
|
56
|
+
})(Style || (Style = {}));
|
57
|
+
const StatusBar = {
|
58
|
+
getEngine() {
|
59
|
+
var _a, _b, _c;
|
60
|
+
return ((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.isPluginAvailable('StatusBar')) && ((_c = win) === null || _c === void 0 ? void 0 : _c.Capacitor.Plugins.StatusBar);
|
61
|
+
},
|
62
|
+
supportsDefaultStatusBarStyle() {
|
63
|
+
var _a, _b;
|
64
|
+
/**
|
65
|
+
* The 'DEFAULT' status bar style was added
|
66
|
+
* to the @capacitor/status-bar plugin in Capacitor 3.
|
67
|
+
* PluginHeaders is only supported in Capacitor 3+,
|
68
|
+
* so we can use this to detect Capacitor 3.
|
69
|
+
*/
|
70
|
+
return !!((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.PluginHeaders);
|
71
|
+
},
|
72
|
+
setStyle(options) {
|
73
|
+
const engine = this.getEngine();
|
74
|
+
if (!engine) {
|
75
|
+
return;
|
77
76
|
}
|
78
|
-
|
79
|
-
|
80
|
-
el,
|
81
|
-
gestureName: 'modalSwipeToClose',
|
82
|
-
gesturePriority: 40,
|
83
|
-
direction: 'y',
|
84
|
-
threshold: 10,
|
85
|
-
canStart,
|
86
|
-
onStart,
|
87
|
-
onMove,
|
88
|
-
onEnd
|
89
|
-
});
|
90
|
-
return gesture;
|
91
|
-
};
|
92
|
-
const computeDuration = (remaining, velocity) => {
|
93
|
-
return helpers.clamp(400, remaining / Math.abs(velocity * 1.1), 500);
|
77
|
+
engine.setStyle(options);
|
78
|
+
},
|
94
79
|
};
|
95
80
|
|
96
81
|
/*!
|
@@ -121,7 +106,14 @@ const getBackdropValueForSheet = (x, backdropBreakpoint) => {
|
|
121
106
|
*
|
122
107
|
* This is simplified from:
|
123
108
|
* m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)
|
109
|
+
*
|
110
|
+
* If the backdropBreakpoint is 1, we return 0 as the
|
111
|
+
* backdrop is completely hidden.
|
112
|
+
*
|
124
113
|
*/
|
114
|
+
if (backdropBreakpoint === 1) {
|
115
|
+
return 0;
|
116
|
+
}
|
125
117
|
const slope = 1 / (1 - backdropBreakpoint);
|
126
118
|
/**
|
127
119
|
* From here, compute b which is
|
@@ -142,7 +134,410 @@ const getBackdropValueForSheet = (x, backdropBreakpoint) => {
|
|
142
134
|
* backdrop offset given an arbitrary
|
143
135
|
* gesture offset.
|
144
136
|
*/
|
145
|
-
return
|
137
|
+
return x * slope + b;
|
138
|
+
};
|
139
|
+
/**
|
140
|
+
* The tablet/desktop card modal activates
|
141
|
+
* when the window width is >= 768.
|
142
|
+
* At that point, the presenting element
|
143
|
+
* is not transformed, so we do not need to
|
144
|
+
* adjust the status bar color.
|
145
|
+
*
|
146
|
+
* Note: We check supportsDefaultStatusBarStyle so that
|
147
|
+
* Capacitor <= 2 users do not get their status bar
|
148
|
+
* stuck in an inconsistent state due to a lack of
|
149
|
+
* support for Style.Default.
|
150
|
+
*/
|
151
|
+
const setCardStatusBarDark = () => {
|
152
|
+
if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
StatusBar.setStyle({ style: Style.Dark });
|
156
|
+
};
|
157
|
+
const setCardStatusBarDefault = () => {
|
158
|
+
if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
StatusBar.setStyle({ style: Style.Default });
|
162
|
+
};
|
163
|
+
|
164
|
+
/*!
|
165
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
166
|
+
*/
|
167
|
+
const handleCanDismiss = async (el, animation) => {
|
168
|
+
/**
|
169
|
+
* If canDismiss is not a function
|
170
|
+
* then we can return early. If canDismiss is `true`,
|
171
|
+
* then canDismissBlocksGesture is `false` as canDismiss
|
172
|
+
* will never interrupt the gesture. As a result,
|
173
|
+
* this code block is never reached. If canDismiss is `false`,
|
174
|
+
* then we never dismiss.
|
175
|
+
*/
|
176
|
+
if (typeof el.canDismiss !== 'function') {
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
/**
|
180
|
+
* Run the canDismiss callback.
|
181
|
+
* If the function returns `true`,
|
182
|
+
* then we can proceed with dismiss.
|
183
|
+
*/
|
184
|
+
const shouldDismiss = await el.canDismiss();
|
185
|
+
if (!shouldDismiss) {
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
/**
|
189
|
+
* If canDismiss resolved after the snap
|
190
|
+
* back animation finished, we can
|
191
|
+
* dismiss immediately.
|
192
|
+
*
|
193
|
+
* If canDismiss resolved before the snap
|
194
|
+
* back animation finished, we need to
|
195
|
+
* wait until the snap back animation is
|
196
|
+
* done before dismissing.
|
197
|
+
*/
|
198
|
+
if (animation.isRunning()) {
|
199
|
+
animation.onFinish(() => {
|
200
|
+
el.dismiss(undefined, 'handler');
|
201
|
+
}, { oneTimeCallback: true });
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
el.dismiss(undefined, 'handler');
|
205
|
+
}
|
206
|
+
};
|
207
|
+
/**
|
208
|
+
* This function lets us simulate a realistic spring-like animation
|
209
|
+
* when swiping down on the modal.
|
210
|
+
* There are two forces that we need to use to compute the spring physics:
|
211
|
+
*
|
212
|
+
* 1. Stiffness, k: This is a measure of resistance applied a spring.
|
213
|
+
* 2. Dampening, c: This value has the effect of reducing or preventing oscillation.
|
214
|
+
*
|
215
|
+
* Using these two values, we can calculate the Spring Force and the Dampening Force
|
216
|
+
* to compute the total force applied to a spring.
|
217
|
+
*
|
218
|
+
* Spring Force: This force pulls a spring back into its equilibrium position.
|
219
|
+
* Hooke's Law tells us that that spring force (FS) = kX.
|
220
|
+
* k is the stiffness of a spring, and X is the displacement of the spring from its
|
221
|
+
* equilibrium position. In this case, it is the amount by which the free end
|
222
|
+
* of a spring was displaced (stretched/pushed) from its "relaxed" position.
|
223
|
+
*
|
224
|
+
* Dampening Force: This force slows down motion. Without it, a spring would oscillate forever.
|
225
|
+
* The dampening force, FD, can be found via this formula: FD = -cv
|
226
|
+
* where c the dampening value and v is velocity.
|
227
|
+
*
|
228
|
+
* Therefore, the resulting force that is exerted on the block is:
|
229
|
+
* F = FS + FD = -kX - cv
|
230
|
+
*
|
231
|
+
* Newton's 2nd Law tells us that F = ma:
|
232
|
+
* ma = -kX - cv.
|
233
|
+
*
|
234
|
+
* For Ionic's purposes, we can assume that m = 1:
|
235
|
+
* a = -kX - cv
|
236
|
+
*
|
237
|
+
* Imagine a block attached to the end of a spring. At equilibrium
|
238
|
+
* the block is at position x = 1.
|
239
|
+
* Pressing on the block moves it to position x = 0;
|
240
|
+
* So, to calculate the displacement, we need to take the
|
241
|
+
* current position and subtract the previous position from it.
|
242
|
+
* X = x - x0 = 0 - 1 = -1.
|
243
|
+
*
|
244
|
+
* For Ionic's purposes, we are only pushing on the spring modal
|
245
|
+
* so we have a max position of 1.
|
246
|
+
* As a result, we can expand displacement to this formula:
|
247
|
+
* X = x - 1
|
248
|
+
*
|
249
|
+
* a = -k(x - 1) - cv
|
250
|
+
*
|
251
|
+
* We can represent the motion of something as a function of time: f(t) = x.
|
252
|
+
* The derivative of position gives us the velocity: f'(t)
|
253
|
+
* The derivative of the velocity gives us the acceleration: f''(t)
|
254
|
+
*
|
255
|
+
* We can substitute the formula above with these values:
|
256
|
+
*
|
257
|
+
* f"(t) = -k * (f(t) - 1) - c * f'(t)
|
258
|
+
*
|
259
|
+
* This is called a differential equation.
|
260
|
+
*
|
261
|
+
* We know that at t = 0, we are at x = 0 because the modal does not move: f(0) = 0
|
262
|
+
* This means our velocity is also zero: f'(0) = 0.
|
263
|
+
*
|
264
|
+
* We can cheat a bit and plug the formula into Wolfram Alpha.
|
265
|
+
* However, we need to pick stiffness and dampening values:
|
266
|
+
* k = 0.57
|
267
|
+
* c = 15
|
268
|
+
*
|
269
|
+
* I picked these as they are fairly close to native iOS's spring effect
|
270
|
+
* with the modal.
|
271
|
+
*
|
272
|
+
* What we plug in is this: f(0) = 0; f'(0) = 0; f''(t) = -0.57(f(t) - 1) - 15f'(t)
|
273
|
+
*
|
274
|
+
* The result is a formula that lets us calculate the acceleration
|
275
|
+
* for a given time t.
|
276
|
+
* Note: This is the approximate form of the solution. Wolfram Alpha will
|
277
|
+
* give you a complex differential equation too.
|
278
|
+
*/
|
279
|
+
const calculateSpringStep = (t) => {
|
280
|
+
return 0.00255275 * 2.71828 ** (-14.9619 * t) - 1.00255 * 2.71828 ** (-0.0380968 * t) + 1;
|
281
|
+
};
|
282
|
+
|
283
|
+
/*!
|
284
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
285
|
+
*/
|
286
|
+
// Defaults for the card swipe animation
|
287
|
+
const SwipeToCloseDefaults = {
|
288
|
+
MIN_PRESENTING_SCALE: 0.93,
|
289
|
+
};
|
290
|
+
const createSwipeToCloseGesture = (el, animation, onDismiss) => {
|
291
|
+
/**
|
292
|
+
* The step value at which a card modal
|
293
|
+
* is eligible for dismissing via gesture.
|
294
|
+
*/
|
295
|
+
const DISMISS_THRESHOLD = 0.5;
|
296
|
+
const height = el.offsetHeight;
|
297
|
+
let isOpen = false;
|
298
|
+
let canDismissBlocksGesture = false;
|
299
|
+
let contentEl = null;
|
300
|
+
let scrollEl = null;
|
301
|
+
const canDismissMaxStep = 0.2;
|
302
|
+
let initialScrollY = true;
|
303
|
+
let lastStep = 0;
|
304
|
+
const getScrollY = () => {
|
305
|
+
if (contentEl && index$1.isIonContent(contentEl)) {
|
306
|
+
return contentEl.scrollY;
|
307
|
+
/**
|
308
|
+
* Custom scroll containers are intended to be
|
309
|
+
* used with virtual scrolling, so we assume
|
310
|
+
* there is scrolling in this case.
|
311
|
+
*/
|
312
|
+
}
|
313
|
+
else {
|
314
|
+
return true;
|
315
|
+
}
|
316
|
+
};
|
317
|
+
const canStart = (detail) => {
|
318
|
+
const target = detail.event.target;
|
319
|
+
if (target === null || !target.closest) {
|
320
|
+
return true;
|
321
|
+
}
|
322
|
+
/**
|
323
|
+
* If we are swiping on the content,
|
324
|
+
* swiping should only be possible if
|
325
|
+
* the content is scrolled all the way
|
326
|
+
* to the top so that we do not interfere
|
327
|
+
* with scrolling.
|
328
|
+
*
|
329
|
+
* We cannot assume that the `ion-content`
|
330
|
+
* target will remain consistent between
|
331
|
+
* swipes. For example, when using
|
332
|
+
* ion-nav within a card modal it is
|
333
|
+
* possible to swipe, push a view, and then
|
334
|
+
* swipe again. The target content will not
|
335
|
+
* be the same between swipes.
|
336
|
+
*/
|
337
|
+
contentEl = index$1.findClosestIonContent(target);
|
338
|
+
if (contentEl) {
|
339
|
+
/**
|
340
|
+
* The card should never swipe to close
|
341
|
+
* on the content with a refresher.
|
342
|
+
* Note: We cannot solve this by making the
|
343
|
+
* swipeToClose gesture have a higher priority
|
344
|
+
* than the refresher gesture as the iOS native
|
345
|
+
* refresh gesture uses a scroll listener in
|
346
|
+
* addition to a gesture.
|
347
|
+
*
|
348
|
+
* Note: Do not use getScrollElement here
|
349
|
+
* because we need this to be a synchronous
|
350
|
+
* operation, and getScrollElement is
|
351
|
+
* asynchronous.
|
352
|
+
*/
|
353
|
+
if (index$1.isIonContent(contentEl)) {
|
354
|
+
const root = helpers.getElementRoot(contentEl);
|
355
|
+
scrollEl = root.querySelector('.inner-scroll');
|
356
|
+
}
|
357
|
+
else {
|
358
|
+
scrollEl = contentEl;
|
359
|
+
}
|
360
|
+
const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
|
361
|
+
return !hasRefresherInContent && scrollEl.scrollTop === 0;
|
362
|
+
}
|
363
|
+
/**
|
364
|
+
* Card should be swipeable on all
|
365
|
+
* parts of the modal except for the footer.
|
366
|
+
*/
|
367
|
+
const footer = target.closest('ion-footer');
|
368
|
+
if (footer === null) {
|
369
|
+
return true;
|
370
|
+
}
|
371
|
+
return false;
|
372
|
+
};
|
373
|
+
const onStart = (detail) => {
|
374
|
+
const { deltaY } = detail;
|
375
|
+
/**
|
376
|
+
* Get the initial scrollY value so
|
377
|
+
* that we can correctly reset the scrollY
|
378
|
+
* prop when the gesture ends.
|
379
|
+
*/
|
380
|
+
initialScrollY = getScrollY();
|
381
|
+
/**
|
382
|
+
* If canDismiss is anything other than `true`
|
383
|
+
* then users should be able to swipe down
|
384
|
+
* until a threshold is hit. At that point,
|
385
|
+
* the card modal should not proceed any further.
|
386
|
+
* TODO (FW-937)
|
387
|
+
* Remove undefined check
|
388
|
+
*/
|
389
|
+
canDismissBlocksGesture = el.canDismiss !== undefined && el.canDismiss !== true;
|
390
|
+
/**
|
391
|
+
* If we are pulling down, then
|
392
|
+
* it is possible we are pulling on the
|
393
|
+
* content. We do not want scrolling to
|
394
|
+
* happen at the same time as the gesture.
|
395
|
+
*/
|
396
|
+
if (deltaY > 0 && contentEl) {
|
397
|
+
index$1.disableContentScrollY(contentEl);
|
398
|
+
}
|
399
|
+
animation.progressStart(true, isOpen ? 1 : 0);
|
400
|
+
};
|
401
|
+
const onMove = (detail) => {
|
402
|
+
const { deltaY } = detail;
|
403
|
+
/**
|
404
|
+
* If we are pulling down, then
|
405
|
+
* it is possible we are pulling on the
|
406
|
+
* content. We do not want scrolling to
|
407
|
+
* happen at the same time as the gesture.
|
408
|
+
*/
|
409
|
+
if (deltaY > 0 && contentEl) {
|
410
|
+
index$1.disableContentScrollY(contentEl);
|
411
|
+
}
|
412
|
+
/**
|
413
|
+
* If we are swiping on the content
|
414
|
+
* then the swipe gesture should only
|
415
|
+
* happen if we are pulling down.
|
416
|
+
*
|
417
|
+
* However, if we pull up and
|
418
|
+
* then down such that the scroll position
|
419
|
+
* returns to 0, we should be able to swipe
|
420
|
+
* the card.
|
421
|
+
*/
|
422
|
+
const step = detail.deltaY / height;
|
423
|
+
/**
|
424
|
+
* Check if user is swiping down and
|
425
|
+
* if we have a canDismiss value that
|
426
|
+
* should block the gesture from
|
427
|
+
* proceeding,
|
428
|
+
*/
|
429
|
+
const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;
|
430
|
+
/**
|
431
|
+
* If we are blocking the gesture from dismissing,
|
432
|
+
* set the max step value so that the sheet cannot be
|
433
|
+
* completely hidden.
|
434
|
+
*/
|
435
|
+
const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
|
436
|
+
/**
|
437
|
+
* If we are blocking the gesture from
|
438
|
+
* dismissing, calculate the spring modifier value
|
439
|
+
* this will be added to the starting breakpoint
|
440
|
+
* value to give the gesture a spring-like feeling.
|
441
|
+
* Note that the starting breakpoint is always 0,
|
442
|
+
* so we omit adding 0 to the result.
|
443
|
+
*/
|
444
|
+
const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
|
445
|
+
const clampedStep = helpers.clamp(0.0001, processedStep, maxStep);
|
446
|
+
animation.progressStep(clampedStep);
|
447
|
+
/**
|
448
|
+
* When swiping down half way, the status bar style
|
449
|
+
* should be reset to its default value.
|
450
|
+
*
|
451
|
+
* We track lastStep so that we do not fire these
|
452
|
+
* functions on every onMove, only when the user has
|
453
|
+
* crossed a certain threshold.
|
454
|
+
*/
|
455
|
+
if (clampedStep >= DISMISS_THRESHOLD && lastStep < DISMISS_THRESHOLD) {
|
456
|
+
setCardStatusBarDefault();
|
457
|
+
/**
|
458
|
+
* However, if we swipe back up, then the
|
459
|
+
* status bar style should be set to have light
|
460
|
+
* text on a dark background.
|
461
|
+
*/
|
462
|
+
}
|
463
|
+
else if (clampedStep < DISMISS_THRESHOLD && lastStep >= DISMISS_THRESHOLD) {
|
464
|
+
setCardStatusBarDark();
|
465
|
+
}
|
466
|
+
lastStep = clampedStep;
|
467
|
+
};
|
468
|
+
const onEnd = (detail) => {
|
469
|
+
const velocity = detail.velocityY;
|
470
|
+
const step = detail.deltaY / height;
|
471
|
+
const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;
|
472
|
+
const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
|
473
|
+
const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
|
474
|
+
const clampedStep = helpers.clamp(0.0001, processedStep, maxStep);
|
475
|
+
const threshold = (detail.deltaY + velocity * 1000) / height;
|
476
|
+
/**
|
477
|
+
* If canDismiss blocks
|
478
|
+
* the swipe gesture, then the
|
479
|
+
* animation can never complete until
|
480
|
+
* canDismiss is checked.
|
481
|
+
*/
|
482
|
+
const shouldComplete = !isAttempingDismissWithCanDismiss && threshold >= DISMISS_THRESHOLD;
|
483
|
+
let newStepValue = shouldComplete ? -0.001 : 0.001;
|
484
|
+
if (!shouldComplete) {
|
485
|
+
animation.easing('cubic-bezier(1, 0, 0.68, 0.28)');
|
486
|
+
newStepValue += cubicBezier.getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], clampedStep)[0];
|
487
|
+
}
|
488
|
+
else {
|
489
|
+
animation.easing('cubic-bezier(0.32, 0.72, 0, 1)');
|
490
|
+
newStepValue += cubicBezier.getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], clampedStep)[0];
|
491
|
+
}
|
492
|
+
const duration = shouldComplete
|
493
|
+
? computeDuration(step * height, velocity)
|
494
|
+
: computeDuration((1 - clampedStep) * height, velocity);
|
495
|
+
isOpen = shouldComplete;
|
496
|
+
gesture.enable(false);
|
497
|
+
if (contentEl) {
|
498
|
+
index$1.resetContentScrollY(contentEl, initialScrollY);
|
499
|
+
}
|
500
|
+
animation
|
501
|
+
.onFinish(() => {
|
502
|
+
if (!shouldComplete) {
|
503
|
+
gesture.enable(true);
|
504
|
+
}
|
505
|
+
})
|
506
|
+
.progressEnd(shouldComplete ? 1 : 0, newStepValue, duration);
|
507
|
+
/**
|
508
|
+
* If the canDismiss value blocked the gesture
|
509
|
+
* from proceeding, then we should ignore whatever
|
510
|
+
* shouldComplete is. Whether or not the modal
|
511
|
+
* animation should complete is now determined by
|
512
|
+
* canDismiss.
|
513
|
+
*
|
514
|
+
* If the user swiped >25% of the way
|
515
|
+
* to the max step, then we should
|
516
|
+
* check canDismiss. 25% was chosen
|
517
|
+
* to avoid accidental swipes.
|
518
|
+
*/
|
519
|
+
if (isAttempingDismissWithCanDismiss && clampedStep > maxStep / 4) {
|
520
|
+
handleCanDismiss(el, animation);
|
521
|
+
}
|
522
|
+
else if (shouldComplete) {
|
523
|
+
onDismiss();
|
524
|
+
}
|
525
|
+
};
|
526
|
+
const gesture = index.createGesture({
|
527
|
+
el,
|
528
|
+
gestureName: 'modalSwipeToClose',
|
529
|
+
gesturePriority: 39,
|
530
|
+
direction: 'y',
|
531
|
+
threshold: 10,
|
532
|
+
canStart,
|
533
|
+
onStart,
|
534
|
+
onMove,
|
535
|
+
onEnd,
|
536
|
+
});
|
537
|
+
return gesture;
|
538
|
+
};
|
539
|
+
const computeDuration = (remaining, velocity) => {
|
540
|
+
return helpers.clamp(400, remaining / Math.abs(velocity * 1.1), 500);
|
146
541
|
};
|
147
542
|
|
148
543
|
/*!
|
@@ -157,19 +552,17 @@ const createSheetEnterAnimation = (opts) => {
|
|
157
552
|
*/
|
158
553
|
const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint;
|
159
554
|
const initialBackdrop = shouldShowBackdrop ? `calc(var(--backdrop-opacity) * ${currentBreakpoint})` : '0';
|
160
|
-
const backdropAnimation = animation.createAnimation('backdropAnimation')
|
161
|
-
.fromTo('opacity', 0, initialBackdrop);
|
555
|
+
const backdropAnimation = animation.createAnimation('backdropAnimation').fromTo('opacity', 0, initialBackdrop);
|
162
556
|
if (shouldShowBackdrop) {
|
163
557
|
backdropAnimation
|
164
558
|
.beforeStyles({
|
165
|
-
'pointer-events': 'none'
|
559
|
+
'pointer-events': 'none',
|
166
560
|
})
|
167
561
|
.afterClearStyles(['pointer-events']);
|
168
562
|
}
|
169
|
-
const wrapperAnimation = animation.createAnimation('wrapperAnimation')
|
170
|
-
.keyframes([
|
563
|
+
const wrapperAnimation = animation.createAnimation('wrapperAnimation').keyframes([
|
171
564
|
{ offset: 0, opacity: 1, transform: 'translateY(100%)' },
|
172
|
-
{ offset: 1, opacity: 1, transform: `translateY(${100 -
|
565
|
+
{ offset: 1, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },
|
173
566
|
]);
|
174
567
|
return { wrapperAnimation, backdropAnimation };
|
175
568
|
};
|
@@ -183,19 +576,17 @@ const createSheetLeaveAnimation = (opts) => {
|
|
183
576
|
const backdropValue = `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(currentBreakpoint, backdropBreakpoint)})`;
|
184
577
|
const defaultBackdrop = [
|
185
578
|
{ offset: 0, opacity: backdropValue },
|
186
|
-
{ offset: 1, opacity: 0 }
|
579
|
+
{ offset: 1, opacity: 0 },
|
187
580
|
];
|
188
581
|
const customBackdrop = [
|
189
582
|
{ offset: 0, opacity: backdropValue },
|
190
583
|
{ offset: backdropBreakpoint, opacity: 0 },
|
191
|
-
{ offset: 1, opacity: 0 }
|
584
|
+
{ offset: 1, opacity: 0 },
|
192
585
|
];
|
193
|
-
const backdropAnimation = animation.createAnimation('backdropAnimation')
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
{ offset: 0, opacity: 1, transform: `translateY(${100 - (currentBreakpoint * 100)}%)` },
|
198
|
-
{ offset: 1, opacity: 1, transform: `translateY(100%)` }
|
586
|
+
const backdropAnimation = animation.createAnimation('backdropAnimation').keyframes(backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop);
|
587
|
+
const wrapperAnimation = animation.createAnimation('wrapperAnimation').keyframes([
|
588
|
+
{ offset: 0, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },
|
589
|
+
{ offset: 1, opacity: 1, transform: `translateY(100%)` },
|
199
590
|
]);
|
200
591
|
return { wrapperAnimation, backdropAnimation };
|
201
592
|
};
|
@@ -207,11 +598,10 @@ const createEnterAnimation$1 = () => {
|
|
207
598
|
const backdropAnimation = animation.createAnimation()
|
208
599
|
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
209
600
|
.beforeStyles({
|
210
|
-
'pointer-events': 'none'
|
601
|
+
'pointer-events': 'none',
|
211
602
|
})
|
212
603
|
.afterClearStyles(['pointer-events']);
|
213
|
-
const wrapperAnimation = animation.createAnimation()
|
214
|
-
.fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');
|
604
|
+
const wrapperAnimation = animation.createAnimation().fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');
|
215
605
|
return { backdropAnimation, wrapperAnimation };
|
216
606
|
};
|
217
607
|
/**
|
@@ -221,11 +611,8 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
221
611
|
const { presentingEl, currentBreakpoint } = opts;
|
222
612
|
const root = helpers.getElementRoot(baseEl);
|
223
613
|
const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation$1();
|
224
|
-
backdropAnimation
|
225
|
-
|
226
|
-
wrapperAnimation
|
227
|
-
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
228
|
-
.beforeStyles({ 'opacity': 1 });
|
614
|
+
backdropAnimation.addElement(root.querySelector('ion-backdrop'));
|
615
|
+
wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });
|
229
616
|
const baseAnimation = animation.createAnimation('entering-base')
|
230
617
|
.addElement(baseEl)
|
231
618
|
.easing('cubic-bezier(0.32,0.72,0,1)')
|
@@ -233,13 +620,12 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
233
620
|
.addAnimation(wrapperAnimation);
|
234
621
|
if (presentingEl) {
|
235
622
|
const isMobile = window.innerWidth < 768;
|
236
|
-
const hasCardModal =
|
623
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
237
624
|
const presentingElRoot = helpers.getElementRoot(presentingEl);
|
238
|
-
const presentingAnimation = animation.createAnimation()
|
239
|
-
|
240
|
-
'transform': 'translateY(0)',
|
625
|
+
const presentingAnimation = animation.createAnimation().beforeStyles({
|
626
|
+
transform: 'translateY(0)',
|
241
627
|
'transform-origin': 'top center',
|
242
|
-
|
628
|
+
overflow: 'hidden',
|
243
629
|
});
|
244
630
|
const bodyEl = document.body;
|
245
631
|
if (isMobile) {
|
@@ -248,19 +634,19 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
248
634
|
* No need to worry about statusbar padding since engines like Gecko
|
249
635
|
* are not used as the engine for standalone Cordova/Capacitor apps
|
250
636
|
*/
|
251
|
-
const transformOffset =
|
637
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
252
638
|
const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
253
639
|
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
254
640
|
const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
|
255
641
|
presentingAnimation
|
256
642
|
.afterStyles({
|
257
|
-
|
643
|
+
transform: finalTransform,
|
258
644
|
})
|
259
645
|
.beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
|
260
646
|
.addElement(presentingEl)
|
261
647
|
.keyframes([
|
262
648
|
{ offset: 0, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },
|
263
|
-
{ offset: 1, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' }
|
649
|
+
{ offset: 1, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },
|
264
650
|
]);
|
265
651
|
baseAnimation.addAnimation(presentingAnimation);
|
266
652
|
}
|
@@ -270,25 +656,25 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
270
656
|
wrapperAnimation.fromTo('opacity', '0', '1');
|
271
657
|
}
|
272
658
|
else {
|
273
|
-
const toPresentingScale =
|
659
|
+
const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
|
274
660
|
const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
275
661
|
presentingAnimation
|
276
662
|
.afterStyles({
|
277
|
-
|
663
|
+
transform: finalTransform,
|
278
664
|
})
|
279
665
|
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
280
666
|
.keyframes([
|
281
667
|
{ offset: 0, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },
|
282
|
-
{ offset: 1, filter: 'contrast(0.85)', transform: finalTransform }
|
668
|
+
{ offset: 1, filter: 'contrast(0.85)', transform: finalTransform },
|
283
669
|
]);
|
284
670
|
const shadowAnimation = animation.createAnimation()
|
285
671
|
.afterStyles({
|
286
|
-
|
672
|
+
transform: finalTransform,
|
287
673
|
})
|
288
674
|
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
289
675
|
.keyframes([
|
290
676
|
{ offset: 0, opacity: '1', transform: 'translateY(0) scale(1)' },
|
291
|
-
{ offset: 1, opacity: '0', transform: finalTransform }
|
677
|
+
{ offset: 1, opacity: '0', transform: finalTransform },
|
292
678
|
]);
|
293
679
|
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
294
680
|
}
|
@@ -304,10 +690,8 @@ const iosEnterAnimation = (baseEl, opts) => {
|
|
304
690
|
* (C) Ionic http://ionicframework.com - MIT License
|
305
691
|
*/
|
306
692
|
const createLeaveAnimation$1 = () => {
|
307
|
-
const backdropAnimation = animation.createAnimation()
|
308
|
-
|
309
|
-
const wrapperAnimation = animation.createAnimation()
|
310
|
-
.fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');
|
693
|
+
const backdropAnimation = animation.createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
694
|
+
const wrapperAnimation = animation.createAnimation().fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');
|
311
695
|
return { backdropAnimation, wrapperAnimation };
|
312
696
|
};
|
313
697
|
/**
|
@@ -318,9 +702,7 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
318
702
|
const root = helpers.getElementRoot(baseEl);
|
319
703
|
const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation$1();
|
320
704
|
backdropAnimation.addElement(root.querySelector('ion-backdrop'));
|
321
|
-
wrapperAnimation
|
322
|
-
.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
323
|
-
.beforeStyles({ 'opacity': 1 });
|
705
|
+
wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });
|
324
706
|
const baseAnimation = animation.createAnimation('leaving-base')
|
325
707
|
.addElement(baseEl)
|
326
708
|
.easing('cubic-bezier(0.32,0.72,0,1)')
|
@@ -328,33 +710,31 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
328
710
|
.addAnimation(wrapperAnimation);
|
329
711
|
if (presentingEl) {
|
330
712
|
const isMobile = window.innerWidth < 768;
|
331
|
-
const hasCardModal =
|
713
|
+
const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
|
332
714
|
const presentingElRoot = helpers.getElementRoot(presentingEl);
|
333
715
|
const presentingAnimation = animation.createAnimation()
|
334
716
|
.beforeClearStyles(['transform'])
|
335
717
|
.afterClearStyles(['transform'])
|
336
|
-
.onFinish(currentStep => {
|
718
|
+
.onFinish((currentStep) => {
|
337
719
|
// only reset background color if this is the last card-style modal
|
338
720
|
if (currentStep !== 1) {
|
339
721
|
return;
|
340
722
|
}
|
341
723
|
presentingEl.style.setProperty('overflow', '');
|
342
|
-
const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter(m => m.presentingElement !== undefined).length;
|
724
|
+
const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter((m) => m.presentingElement !== undefined).length;
|
343
725
|
if (numModals <= 1) {
|
344
726
|
bodyEl.style.setProperty('background-color', '');
|
345
727
|
}
|
346
728
|
});
|
347
729
|
const bodyEl = document.body;
|
348
730
|
if (isMobile) {
|
349
|
-
const transformOffset =
|
731
|
+
const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
350
732
|
const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
351
733
|
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
352
734
|
const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
|
353
|
-
presentingAnimation
|
354
|
-
.addElement(presentingEl)
|
355
|
-
.keyframes([
|
735
|
+
presentingAnimation.addElement(presentingEl).keyframes([
|
356
736
|
{ offset: 0, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },
|
357
|
-
{ offset: 1, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' }
|
737
|
+
{ offset: 1, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },
|
358
738
|
]);
|
359
739
|
baseAnimation.addAnimation(presentingAnimation);
|
360
740
|
}
|
@@ -364,25 +744,25 @@ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
|
|
364
744
|
wrapperAnimation.fromTo('opacity', '1', '0');
|
365
745
|
}
|
366
746
|
else {
|
367
|
-
const toPresentingScale =
|
747
|
+
const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
|
368
748
|
const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
369
749
|
presentingAnimation
|
370
750
|
.addElement(presentingElRoot.querySelector('.modal-wrapper'))
|
371
751
|
.afterStyles({
|
372
|
-
|
752
|
+
transform: 'translate3d(0, 0, 0)',
|
373
753
|
})
|
374
754
|
.keyframes([
|
375
755
|
{ offset: 0, filter: 'contrast(0.85)', transform: finalTransform },
|
376
|
-
{ offset: 1, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' }
|
756
|
+
{ offset: 1, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },
|
377
757
|
]);
|
378
758
|
const shadowAnimation = animation.createAnimation()
|
379
759
|
.addElement(presentingElRoot.querySelector('.modal-shadow'))
|
380
760
|
.afterStyles({
|
381
|
-
|
761
|
+
transform: 'translateY(0) scale(1)',
|
382
762
|
})
|
383
763
|
.keyframes([
|
384
764
|
{ offset: 0, opacity: '0', transform: finalTransform },
|
385
|
-
{ offset: 1, opacity: '1', transform: 'translateY(0) scale(1)' }
|
765
|
+
{ offset: 1, opacity: '1', transform: 'translateY(0) scale(1)' },
|
386
766
|
]);
|
387
767
|
baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
388
768
|
}
|
@@ -401,13 +781,12 @@ const createEnterAnimation = () => {
|
|
401
781
|
const backdropAnimation = animation.createAnimation()
|
402
782
|
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
403
783
|
.beforeStyles({
|
404
|
-
'pointer-events': 'none'
|
784
|
+
'pointer-events': 'none',
|
405
785
|
})
|
406
786
|
.afterClearStyles(['pointer-events']);
|
407
|
-
const wrapperAnimation = animation.createAnimation()
|
408
|
-
.keyframes([
|
787
|
+
const wrapperAnimation = animation.createAnimation().keyframes([
|
409
788
|
{ offset: 0, opacity: 0.01, transform: 'translateY(40px)' },
|
410
|
-
{ offset: 1, opacity: 1, transform: `translateY(0px)` }
|
789
|
+
{ offset: 1, opacity: 1, transform: `translateY(0px)` },
|
411
790
|
]);
|
412
791
|
return { backdropAnimation, wrapperAnimation };
|
413
792
|
};
|
@@ -418,10 +797,8 @@ const mdEnterAnimation = (baseEl, opts) => {
|
|
418
797
|
const { currentBreakpoint } = opts;
|
419
798
|
const root = helpers.getElementRoot(baseEl);
|
420
799
|
const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation();
|
421
|
-
backdropAnimation
|
422
|
-
|
423
|
-
wrapperAnimation
|
424
|
-
.addElement(root.querySelector('.modal-wrapper'));
|
800
|
+
backdropAnimation.addElement(root.querySelector('ion-backdrop'));
|
801
|
+
wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));
|
425
802
|
return animation.createAnimation()
|
426
803
|
.addElement(baseEl)
|
427
804
|
.easing('cubic-bezier(0.36,0.66,0.04,1)')
|
@@ -433,12 +810,10 @@ const mdEnterAnimation = (baseEl, opts) => {
|
|
433
810
|
* (C) Ionic http://ionicframework.com - MIT License
|
434
811
|
*/
|
435
812
|
const createLeaveAnimation = () => {
|
436
|
-
const backdropAnimation = animation.createAnimation()
|
437
|
-
|
438
|
-
const wrapperAnimation = animation.createAnimation()
|
439
|
-
.keyframes([
|
813
|
+
const backdropAnimation = animation.createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
814
|
+
const wrapperAnimation = animation.createAnimation().keyframes([
|
440
815
|
{ offset: 0, opacity: 0.99, transform: `translateY(0px)` },
|
441
|
-
{ offset: 1, opacity: 0, transform: 'translateY(40px)' }
|
816
|
+
{ offset: 1, opacity: 0, transform: 'translateY(40px)' },
|
442
817
|
]);
|
443
818
|
return { backdropAnimation, wrapperAnimation };
|
444
819
|
};
|
@@ -460,31 +835,34 @@ const mdLeaveAnimation = (baseEl, opts) => {
|
|
460
835
|
/*!
|
461
836
|
* (C) Ionic http://ionicframework.com - MIT License
|
462
837
|
*/
|
463
|
-
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], onDismiss, onBreakpointChange) => {
|
838
|
+
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
464
839
|
// Defaults for the sheet swipe animation
|
465
840
|
const defaultBackdrop = [
|
466
841
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
467
|
-
{ offset: 1, opacity: 0.01 }
|
842
|
+
{ offset: 1, opacity: 0.01 },
|
468
843
|
];
|
469
844
|
const customBackdrop = [
|
470
845
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
471
846
|
{ offset: 1 - backdropBreakpoint, opacity: 0 },
|
472
|
-
{ offset: 1, opacity: 0 }
|
847
|
+
{ offset: 1, opacity: 0 },
|
473
848
|
];
|
474
849
|
const SheetDefaults = {
|
475
850
|
WRAPPER_KEYFRAMES: [
|
476
851
|
{ offset: 0, transform: 'translateY(0%)' },
|
477
|
-
{ offset: 1, transform: 'translateY(100%)' }
|
852
|
+
{ offset: 1, transform: 'translateY(100%)' },
|
478
853
|
],
|
479
|
-
BACKDROP_KEYFRAMES:
|
854
|
+
BACKDROP_KEYFRAMES: backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop,
|
480
855
|
};
|
481
856
|
const contentEl = baseEl.querySelector('ion-content');
|
482
857
|
const height = wrapperEl.clientHeight;
|
483
858
|
let currentBreakpoint = initialBreakpoint;
|
484
859
|
let offset = 0;
|
485
|
-
|
486
|
-
const
|
860
|
+
let canDismissBlocksGesture = false;
|
861
|
+
const canDismissMaxStep = 0.95;
|
862
|
+
const wrapperAnimation = animation.childAnimations.find((ani) => ani.id === 'wrapperAnimation');
|
863
|
+
const backdropAnimation = animation.childAnimations.find((ani) => ani.id === 'backdropAnimation');
|
487
864
|
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
865
|
+
const minBreakpoint = breakpoints[0];
|
488
866
|
const enableBackdrop = () => {
|
489
867
|
baseEl.style.setProperty('pointer-events', 'auto');
|
490
868
|
backdropEl.style.setProperty('pointer-events', 'auto');
|
@@ -545,12 +923,26 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
545
923
|
* allow for scrolling on the content.
|
546
924
|
*/
|
547
925
|
const content = detail.event.target.closest('ion-content');
|
926
|
+
currentBreakpoint = getCurrentBreakpoint();
|
548
927
|
if (currentBreakpoint === 1 && content) {
|
549
928
|
return false;
|
550
929
|
}
|
551
930
|
return true;
|
552
931
|
};
|
553
932
|
const onStart = () => {
|
933
|
+
/**
|
934
|
+
* If canDismiss is anything other than `true`
|
935
|
+
* then users should be able to swipe down
|
936
|
+
* until a threshold is hit. At that point,
|
937
|
+
* the card modal should not proceed any further.
|
938
|
+
*
|
939
|
+
* canDismiss is never fired via gesture if there is
|
940
|
+
* no 0 breakpoint. However, it can be fired if the user
|
941
|
+
* presses Esc or the hardware back button.
|
942
|
+
* TODO (FW-937)
|
943
|
+
* Remove undefined check
|
944
|
+
*/
|
945
|
+
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
554
946
|
/**
|
555
947
|
* If swiping on the content
|
556
948
|
* we should disable scrolling otherwise
|
@@ -575,7 +967,34 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
575
967
|
* relative to where the user dragged.
|
576
968
|
*/
|
577
969
|
const initialStep = 1 - currentBreakpoint;
|
578
|
-
|
970
|
+
const secondToLastBreakpoint = breakpoints.length > 1 ? 1 - breakpoints[1] : undefined;
|
971
|
+
const step = initialStep + detail.deltaY / height;
|
972
|
+
const isAttemptingDismissWithCanDismiss = secondToLastBreakpoint !== undefined && step >= secondToLastBreakpoint && canDismissBlocksGesture;
|
973
|
+
/**
|
974
|
+
* If we are blocking the gesture from dismissing,
|
975
|
+
* set the max step value so that the sheet cannot be
|
976
|
+
* completely hidden.
|
977
|
+
*/
|
978
|
+
const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
|
979
|
+
/**
|
980
|
+
* If we are blocking the gesture from
|
981
|
+
* dismissing, calculate the spring modifier value
|
982
|
+
* this will be added to the starting breakpoint
|
983
|
+
* value to give the gesture a spring-like feeling.
|
984
|
+
* Note that when isAttemptingDismissWithCanDismiss is true,
|
985
|
+
* the modifier is always added to the breakpoint that
|
986
|
+
* appears right after the 0 breakpoint.
|
987
|
+
*
|
988
|
+
* Note that this modifier is essentially the progression
|
989
|
+
* between secondToLastBreakpoint and maxStep which is
|
990
|
+
* why we subtract secondToLastBreakpoint. This lets us get
|
991
|
+
* the result as a value from 0 to 1.
|
992
|
+
*/
|
993
|
+
const processedStep = isAttemptingDismissWithCanDismiss && secondToLastBreakpoint !== undefined
|
994
|
+
? secondToLastBreakpoint +
|
995
|
+
calculateSpringStep((step - secondToLastBreakpoint) / (maxStep - secondToLastBreakpoint))
|
996
|
+
: step;
|
997
|
+
offset = helpers.clamp(0.0001, processedStep, maxStep);
|
579
998
|
animation.progressStep(offset);
|
580
999
|
};
|
581
1000
|
const onEnd = (detail) => {
|
@@ -589,7 +1008,23 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
589
1008
|
const closest = breakpoints.reduce((a, b) => {
|
590
1009
|
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
591
1010
|
});
|
592
|
-
|
1011
|
+
moveSheetToBreakpoint({
|
1012
|
+
breakpoint: closest,
|
1013
|
+
breakpointOffset: offset,
|
1014
|
+
canDismiss: canDismissBlocksGesture,
|
1015
|
+
});
|
1016
|
+
};
|
1017
|
+
const moveSheetToBreakpoint = (options) => {
|
1018
|
+
const { breakpoint, canDismiss, breakpointOffset } = options;
|
1019
|
+
/**
|
1020
|
+
* canDismiss should only prevent snapping
|
1021
|
+
* when users are trying to dismiss. If canDismiss
|
1022
|
+
* is present but the user is trying to swipe upwards,
|
1023
|
+
* we should allow that to happen,
|
1024
|
+
*/
|
1025
|
+
const shouldPreventDismiss = canDismiss && breakpoint === 0;
|
1026
|
+
const snapToBreakpoint = shouldPreventDismiss ? currentBreakpoint : breakpoint;
|
1027
|
+
const shouldRemainOpen = snapToBreakpoint !== 0;
|
593
1028
|
currentBreakpoint = 0;
|
594
1029
|
/**
|
595
1030
|
* Update the animation so that it plays from
|
@@ -597,12 +1032,18 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
597
1032
|
*/
|
598
1033
|
if (wrapperAnimation && backdropAnimation) {
|
599
1034
|
wrapperAnimation.keyframes([
|
600
|
-
{ offset: 0, transform: `translateY(${
|
601
|
-
{ offset: 1, transform: `translateY(${(1 -
|
1035
|
+
{ offset: 0, transform: `translateY(${breakpointOffset * 100}%)` },
|
1036
|
+
{ offset: 1, transform: `translateY(${(1 - snapToBreakpoint) * 100}%)` },
|
602
1037
|
]);
|
603
1038
|
backdropAnimation.keyframes([
|
604
|
-
{
|
605
|
-
|
1039
|
+
{
|
1040
|
+
offset: 0,
|
1041
|
+
opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(1 - breakpointOffset, backdropBreakpoint)})`,
|
1042
|
+
},
|
1043
|
+
{
|
1044
|
+
offset: 1,
|
1045
|
+
opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`,
|
1046
|
+
},
|
606
1047
|
]);
|
607
1048
|
animation.progressStep(0);
|
608
1049
|
}
|
@@ -611,58 +1052,68 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
611
1052
|
* snapping animation completes.
|
612
1053
|
*/
|
613
1054
|
gesture.enable(false);
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
1055
|
+
if (shouldPreventDismiss) {
|
1056
|
+
handleCanDismiss(baseEl, animation);
|
1057
|
+
}
|
1058
|
+
else if (!shouldRemainOpen) {
|
1059
|
+
onDismiss();
|
1060
|
+
}
|
1061
|
+
return new Promise((resolve) => {
|
1062
|
+
animation
|
1063
|
+
.onFinish(() => {
|
1064
|
+
if (shouldRemainOpen) {
|
1065
|
+
/**
|
1066
|
+
* Once the snapping animation completes,
|
1067
|
+
* we need to reset the animation to go
|
1068
|
+
* from 0 to 1 so users can swipe in any direction.
|
1069
|
+
* We then set the animation offset to the current
|
1070
|
+
* breakpoint so that it starts at the snapped position.
|
1071
|
+
*/
|
1072
|
+
if (wrapperAnimation && backdropAnimation) {
|
1073
|
+
helpers.raf(() => {
|
1074
|
+
wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
|
1075
|
+
backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
|
1076
|
+
animation.progressStart(true, 1 - snapToBreakpoint);
|
1077
|
+
currentBreakpoint = snapToBreakpoint;
|
1078
|
+
onBreakpointChange(currentBreakpoint);
|
1079
|
+
/**
|
1080
|
+
* If the sheet is fully expanded, we can safely
|
1081
|
+
* enable scrolling again.
|
1082
|
+
*/
|
1083
|
+
if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
|
1084
|
+
contentEl.scrollY = true;
|
1085
|
+
}
|
1086
|
+
/**
|
1087
|
+
* Backdrop should become enabled
|
1088
|
+
* after the backdropBreakpoint value
|
1089
|
+
*/
|
1090
|
+
const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;
|
1091
|
+
if (shouldEnableBackdrop) {
|
1092
|
+
enableBackdrop();
|
1093
|
+
}
|
1094
|
+
else {
|
1095
|
+
disableBackdrop();
|
1096
|
+
}
|
1097
|
+
gesture.enable(true);
|
1098
|
+
resolve();
|
1099
|
+
});
|
1100
|
+
}
|
1101
|
+
else {
|
649
1102
|
gesture.enable(true);
|
650
|
-
|
1103
|
+
resolve();
|
1104
|
+
}
|
651
1105
|
}
|
652
1106
|
else {
|
653
|
-
|
1107
|
+
resolve();
|
654
1108
|
}
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
if (!shouldRemainOpen) {
|
664
|
-
onDismiss();
|
665
|
-
}
|
1109
|
+
/**
|
1110
|
+
* This must be a one time callback
|
1111
|
+
* otherwise a new callback will
|
1112
|
+
* be added every time onEnd runs.
|
1113
|
+
*/
|
1114
|
+
}, { oneTimeCallback: true })
|
1115
|
+
.progressEnd(1, 0, 500);
|
1116
|
+
});
|
666
1117
|
};
|
667
1118
|
const gesture = index.createGesture({
|
668
1119
|
el: wrapperEl,
|
@@ -673,26 +1124,30 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
673
1124
|
canStart,
|
674
1125
|
onStart,
|
675
1126
|
onMove,
|
676
|
-
onEnd
|
1127
|
+
onEnd,
|
677
1128
|
});
|
678
|
-
return
|
1129
|
+
return {
|
1130
|
+
gesture,
|
1131
|
+
moveSheetToBreakpoint,
|
1132
|
+
};
|
679
1133
|
};
|
680
1134
|
|
681
|
-
const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);background:var(--ion-color-step-350, #c0c0be);z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width:
|
1135
|
+
const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:\"\"}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: 1px){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: 1px){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{box-shadow:none}:host(.modal-card) .modal-shadow{box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}";
|
682
1136
|
|
683
|
-
const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);background:var(--ion-color-step-350, #c0c0be);z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{transform:translate3d(0, 40px, 0);opacity:0.01}";
|
1137
|
+
const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:\"\"}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{transform:translate3d(0, 40px, 0);opacity:0.01}";
|
684
1138
|
|
685
1139
|
const Modal = class {
|
686
1140
|
constructor(hostRef) {
|
687
|
-
index$
|
688
|
-
this.didPresent = index$
|
689
|
-
this.willPresent = index$
|
690
|
-
this.willDismiss = index$
|
691
|
-
this.didDismiss = index$
|
692
|
-
this.
|
693
|
-
this.
|
694
|
-
this.
|
695
|
-
this.
|
1141
|
+
index$2.registerInstance(this, hostRef);
|
1142
|
+
this.didPresent = index$2.createEvent(this, "ionModalDidPresent", 7);
|
1143
|
+
this.willPresent = index$2.createEvent(this, "ionModalWillPresent", 7);
|
1144
|
+
this.willDismiss = index$2.createEvent(this, "ionModalWillDismiss", 7);
|
1145
|
+
this.didDismiss = index$2.createEvent(this, "ionModalDidDismiss", 7);
|
1146
|
+
this.ionBreakpointDidChange = index$2.createEvent(this, "ionBreakpointDidChange", 7);
|
1147
|
+
this.didPresentShorthand = index$2.createEvent(this, "didPresent", 7);
|
1148
|
+
this.willPresentShorthand = index$2.createEvent(this, "willPresent", 7);
|
1149
|
+
this.willDismissShorthand = index$2.createEvent(this, "willDismiss", 7);
|
1150
|
+
this.didDismissShorthand = index$2.createEvent(this, "didDismiss", 7);
|
696
1151
|
this.modalIndex = modalIds++;
|
697
1152
|
this.coreDelegate = frameworkDelegate.CoreDelegate();
|
698
1153
|
this.isSheetModal = false;
|
@@ -716,12 +1171,26 @@ const Modal = class {
|
|
716
1171
|
* specified.
|
717
1172
|
*/
|
718
1173
|
this.backdropBreakpoint = 0;
|
1174
|
+
/**
|
1175
|
+
* The interaction behavior for the sheet modal when the handle is pressed.
|
1176
|
+
*
|
1177
|
+
* Defaults to `"none"`, which means the modal will not change size or position when the handle is pressed.
|
1178
|
+
* Set to `"cycle"` to let the modal cycle between available breakpoints when pressed.
|
1179
|
+
*
|
1180
|
+
* Handle behavior is unavailable when the `handle` property is set to `false` or
|
1181
|
+
* when the `breakpoints` property is not set (using a fullscreen or card modal).
|
1182
|
+
*/
|
1183
|
+
this.handleBehavior = 'none';
|
719
1184
|
/**
|
720
1185
|
* If `true`, the modal will be dismissed when the backdrop is clicked.
|
721
1186
|
*/
|
722
1187
|
this.backdropDismiss = true;
|
723
1188
|
/**
|
724
1189
|
* If `true`, a backdrop will be displayed behind the modal.
|
1190
|
+
* This property controls whether or not the backdrop
|
1191
|
+
* darkens the screen when the modal is presented.
|
1192
|
+
* It does not control whether or not the backdrop
|
1193
|
+
* is active or present in the DOM.
|
725
1194
|
*/
|
726
1195
|
this.showBackdrop = true;
|
727
1196
|
/**
|
@@ -730,6 +1199,7 @@ const Modal = class {
|
|
730
1199
|
this.animated = true;
|
731
1200
|
/**
|
732
1201
|
* If `true`, the modal can be swiped to dismiss. Only applies in iOS mode.
|
1202
|
+
* @deprecated - To prevent modals from dismissing, use canDismiss instead.
|
733
1203
|
*/
|
734
1204
|
this.swipeToClose = false;
|
735
1205
|
/**
|
@@ -740,12 +1210,24 @@ const Modal = class {
|
|
740
1210
|
* the modal dismisses. You will need to do that in your code.
|
741
1211
|
*/
|
742
1212
|
this.isOpen = false;
|
1213
|
+
/**
|
1214
|
+
* If `true`, the component passed into `ion-modal` will
|
1215
|
+
* automatically be mounted when the modal is created. The
|
1216
|
+
* component will remain mounted even when the modal is dismissed.
|
1217
|
+
* However, the component will be destroyed when the modal is
|
1218
|
+
* destroyed. This property is not reactive and should only be
|
1219
|
+
* used when initially creating a modal.
|
1220
|
+
*
|
1221
|
+
* Note: This feature only applies to inline modals in JavaScript
|
1222
|
+
* frameworks such as Angular, React, and Vue.
|
1223
|
+
*/
|
1224
|
+
this.keepContentsMounted = false;
|
743
1225
|
this.configureTriggerInteraction = () => {
|
744
1226
|
const { trigger, el, destroyTriggerInteraction } = this;
|
745
1227
|
if (destroyTriggerInteraction) {
|
746
1228
|
destroyTriggerInteraction();
|
747
1229
|
}
|
748
|
-
const triggerEl =
|
1230
|
+
const triggerEl = trigger !== undefined ? document.getElementById(trigger) : null;
|
749
1231
|
if (!triggerEl) {
|
750
1232
|
return;
|
751
1233
|
}
|
@@ -760,14 +1242,31 @@ const Modal = class {
|
|
760
1242
|
};
|
761
1243
|
this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, el);
|
762
1244
|
};
|
1245
|
+
this.onHandleClick = () => {
|
1246
|
+
const { sheetTransition, handleBehavior } = this;
|
1247
|
+
if (handleBehavior !== 'cycle' || sheetTransition !== undefined) {
|
1248
|
+
/**
|
1249
|
+
* The sheet modal should not advance to the next breakpoint
|
1250
|
+
* if the handle behavior is not `cycle` or if the handle
|
1251
|
+
* is clicked while the sheet is moving to a breakpoint.
|
1252
|
+
*/
|
1253
|
+
return;
|
1254
|
+
}
|
1255
|
+
this.moveToNextBreakpoint();
|
1256
|
+
};
|
763
1257
|
this.onBackdropTap = () => {
|
1258
|
+
const { sheetTransition } = this;
|
1259
|
+
if (sheetTransition !== undefined) {
|
1260
|
+
/**
|
1261
|
+
* When the handle is double clicked at the largest breakpoint,
|
1262
|
+
* it will start to move to the first breakpoint. While transitioning,
|
1263
|
+
* the backdrop will often receive the second click. We prevent the
|
1264
|
+
* backdrop from dismissing the modal while moving between breakpoints.
|
1265
|
+
*/
|
1266
|
+
return;
|
1267
|
+
}
|
764
1268
|
this.dismiss(undefined, overlays.BACKDROP);
|
765
1269
|
};
|
766
|
-
this.onDismiss = (ev) => {
|
767
|
-
ev.stopPropagation();
|
768
|
-
ev.preventDefault();
|
769
|
-
this.dismiss();
|
770
|
-
};
|
771
1270
|
this.onLifecycle = (modalEvent) => {
|
772
1271
|
const el = this.usersElement;
|
773
1272
|
const name = LIFECYCLE_MAP[modalEvent.type];
|
@@ -775,7 +1274,7 @@ const Modal = class {
|
|
775
1274
|
const ev = new CustomEvent(name, {
|
776
1275
|
bubbles: false,
|
777
1276
|
cancelable: false,
|
778
|
-
detail: modalEvent.detail
|
1277
|
+
detail: modalEvent.detail,
|
779
1278
|
});
|
780
1279
|
el.dispatchEvent(ev);
|
781
1280
|
}
|
@@ -792,27 +1291,38 @@ const Modal = class {
|
|
792
1291
|
onTriggerChange() {
|
793
1292
|
this.configureTriggerInteraction();
|
794
1293
|
}
|
795
|
-
swipeToCloseChanged(enable) {
|
1294
|
+
async swipeToCloseChanged(enable) {
|
796
1295
|
if (this.gesture) {
|
797
1296
|
this.gesture.enable(enable);
|
798
1297
|
}
|
799
1298
|
else if (enable) {
|
800
|
-
this.initSwipeToClose();
|
1299
|
+
await this.initSwipeToClose();
|
1300
|
+
}
|
1301
|
+
}
|
1302
|
+
breakpointsChanged(breakpoints) {
|
1303
|
+
if (breakpoints !== undefined) {
|
1304
|
+
this.sortedBreakpoints = breakpoints.sort((a, b) => a - b);
|
801
1305
|
}
|
802
1306
|
}
|
803
1307
|
connectedCallback() {
|
804
1308
|
overlays.prepareOverlay(this.el);
|
805
1309
|
}
|
806
1310
|
componentWillLoad() {
|
807
|
-
const { breakpoints, initialBreakpoint } = this;
|
1311
|
+
const { breakpoints, initialBreakpoint, swipeToClose } = this;
|
808
1312
|
/**
|
809
1313
|
* If user has custom ID set then we should
|
810
1314
|
* not assign the default incrementing ID.
|
811
1315
|
*/
|
812
|
-
this.modalId =
|
813
|
-
this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined;
|
1316
|
+
this.modalId = this.el.hasAttribute('id') ? this.el.getAttribute('id') : `ion-modal-${this.modalIndex}`;
|
1317
|
+
const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
|
1318
|
+
if (isSheetModal) {
|
1319
|
+
this.currentBreakpoint = this.initialBreakpoint;
|
1320
|
+
}
|
814
1321
|
if (breakpoints !== undefined && initialBreakpoint !== undefined && !breakpoints.includes(initialBreakpoint)) {
|
815
|
-
|
1322
|
+
index$3.printIonWarning('Your breakpoints array must include the initialBreakpoint value.');
|
1323
|
+
}
|
1324
|
+
if (swipeToClose) {
|
1325
|
+
index$3.printIonWarning('swipeToClose has been deprecated in favor of canDismiss.\n\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.');
|
816
1326
|
}
|
817
1327
|
}
|
818
1328
|
componentDidLoad() {
|
@@ -823,6 +1333,7 @@ const Modal = class {
|
|
823
1333
|
if (this.isOpen === true) {
|
824
1334
|
helpers.raf(() => this.present());
|
825
1335
|
}
|
1336
|
+
this.breakpointsChanged(this.breakpoints);
|
826
1337
|
this.configureTriggerInteraction();
|
827
1338
|
}
|
828
1339
|
/**
|
@@ -838,7 +1349,7 @@ const Modal = class {
|
|
838
1349
|
if (this.workingDelegate && !force) {
|
839
1350
|
return {
|
840
1351
|
delegate: this.workingDelegate,
|
841
|
-
inline: this.inline
|
1352
|
+
inline: this.inline,
|
842
1353
|
};
|
843
1354
|
}
|
844
1355
|
/**
|
@@ -851,10 +1362,29 @@ const Modal = class {
|
|
851
1362
|
* correct place.
|
852
1363
|
*/
|
853
1364
|
const parentEl = this.el.parentNode;
|
854
|
-
const inline = this.inline = parentEl !== null && !this.hasController;
|
855
|
-
const delegate = this.workingDelegate =
|
1365
|
+
const inline = (this.inline = parentEl !== null && !this.hasController);
|
1366
|
+
const delegate = (this.workingDelegate = inline ? this.delegate || this.coreDelegate : this.delegate);
|
856
1367
|
return { inline, delegate };
|
857
1368
|
}
|
1369
|
+
/**
|
1370
|
+
* Determines whether or not the
|
1371
|
+
* modal is allowed to dismiss based
|
1372
|
+
* on the state of the canDismiss prop.
|
1373
|
+
*/
|
1374
|
+
async checkCanDismiss() {
|
1375
|
+
const { canDismiss } = this;
|
1376
|
+
/**
|
1377
|
+
* TODO (FW-937) - Remove the following check in
|
1378
|
+
* the next major release of Ionic.
|
1379
|
+
*/
|
1380
|
+
if (canDismiss === undefined) {
|
1381
|
+
return true;
|
1382
|
+
}
|
1383
|
+
if (typeof canDismiss === 'function') {
|
1384
|
+
return canDismiss();
|
1385
|
+
}
|
1386
|
+
return canDismiss;
|
1387
|
+
}
|
858
1388
|
/**
|
859
1389
|
* Present the modal overlay after it has been created.
|
860
1390
|
*/
|
@@ -873,18 +1403,45 @@ const Modal = class {
|
|
873
1403
|
if (this.currentTransition !== undefined) {
|
874
1404
|
await this.currentTransition;
|
875
1405
|
}
|
1406
|
+
/**
|
1407
|
+
* If the modal is presented multiple times (inline modals), we
|
1408
|
+
* need to reset the current breakpoint to the initial breakpoint.
|
1409
|
+
*/
|
1410
|
+
this.currentBreakpoint = this.initialBreakpoint;
|
876
1411
|
const data = Object.assign(Object.assign({}, this.componentProps), { modal: this.el });
|
877
1412
|
const { inline, delegate } = this.getDelegate(true);
|
878
1413
|
this.usersElement = await frameworkDelegate.attachComponent(delegate, this.el, this.component, ['ion-page'], data, inline);
|
879
|
-
await index$
|
880
|
-
index$
|
881
|
-
this.currentTransition = overlays.present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
|
1414
|
+
await index$4.deepReady(this.usersElement);
|
1415
|
+
index$2.writeTask(() => this.el.classList.add('show-modal'));
|
1416
|
+
this.currentTransition = overlays.present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
|
1417
|
+
presentingEl: this.presentingElement,
|
1418
|
+
currentBreakpoint: this.initialBreakpoint,
|
1419
|
+
backdropBreakpoint: this.backdropBreakpoint,
|
1420
|
+
});
|
1421
|
+
/**
|
1422
|
+
* TODO (FW-937) - In the next major release of Ionic, all card modals
|
1423
|
+
* will be swipeable by default. canDismiss will be used to determine if the
|
1424
|
+
* modal can be dismissed. This check should change to check the presence of
|
1425
|
+
* presentingElement instead.
|
1426
|
+
*
|
1427
|
+
* If we did not do this check, then not using swipeToClose would mean you could
|
1428
|
+
* not run canDismiss on swipe as there would be no swipe gesture created.
|
1429
|
+
*/
|
1430
|
+
const hasCardModal = this.swipeToClose || (this.canDismiss !== undefined && this.presentingElement !== undefined);
|
1431
|
+
/**
|
1432
|
+
* We need to change the status bar at the
|
1433
|
+
* start of the animation so that it completes
|
1434
|
+
* by the time the card animation is done.
|
1435
|
+
*/
|
1436
|
+
if (hasCardModal && ionicGlobal.getIonMode(this) === 'ios') {
|
1437
|
+
setCardStatusBarDark();
|
1438
|
+
}
|
882
1439
|
await this.currentTransition;
|
883
1440
|
if (this.isSheetModal) {
|
884
1441
|
this.initSheetGesture();
|
885
1442
|
}
|
886
|
-
else if (
|
887
|
-
this.initSwipeToClose();
|
1443
|
+
else if (hasCardModal) {
|
1444
|
+
await this.initSwipeToClose();
|
888
1445
|
}
|
889
1446
|
/* tslint:disable-next-line */
|
890
1447
|
if (typeof window !== 'undefined') {
|
@@ -915,12 +1472,18 @@ const Modal = class {
|
|
915
1472
|
if (ionicGlobal.getIonMode(this) !== 'ios') {
|
916
1473
|
return;
|
917
1474
|
}
|
1475
|
+
const { el } = this;
|
918
1476
|
// All of the elements needed for the swipe gesture
|
919
1477
|
// should be in the DOM and referenced by now, except
|
920
1478
|
// for the presenting el
|
921
1479
|
const animationBuilder = this.leaveAnimation || ionicGlobal.config.get('modalLeave', iosLeaveAnimation);
|
922
|
-
const ani = this.animation = animationBuilder(
|
923
|
-
|
1480
|
+
const ani = (this.animation = animationBuilder(el, { presentingEl: this.presentingElement }));
|
1481
|
+
const contentEl = index$1.findIonContent(el);
|
1482
|
+
if (!contentEl) {
|
1483
|
+
index$1.printIonContentErrorMsg(el);
|
1484
|
+
return;
|
1485
|
+
}
|
1486
|
+
this.gesture = createSwipeToCloseGesture(el, ani, () => {
|
924
1487
|
/**
|
925
1488
|
* While the gesture animation is finishing
|
926
1489
|
* it is possible for a user to tap the backdrop.
|
@@ -940,36 +1503,46 @@ const Modal = class {
|
|
940
1503
|
this.gesture.enable(true);
|
941
1504
|
}
|
942
1505
|
initSheetGesture() {
|
943
|
-
var _a;
|
944
1506
|
const { wrapperEl, initialBreakpoint, backdropBreakpoint } = this;
|
945
1507
|
if (!wrapperEl || initialBreakpoint === undefined) {
|
946
1508
|
return;
|
947
1509
|
}
|
948
1510
|
const animationBuilder = this.enterAnimation || ionicGlobal.config.get('modalEnter', iosEnterAnimation);
|
949
|
-
const ani = this.animation = animationBuilder(this.el, {
|
1511
|
+
const ani = (this.animation = animationBuilder(this.el, {
|
1512
|
+
presentingEl: this.presentingElement,
|
1513
|
+
currentBreakpoint: initialBreakpoint,
|
1514
|
+
backdropBreakpoint,
|
1515
|
+
}));
|
950
1516
|
ani.progressStart(true, 1);
|
951
|
-
const
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
* This would result in the dismiss animation
|
957
|
-
* being played again. Typically this is avoided
|
958
|
-
* by setting `presented = false` on the overlay
|
959
|
-
* component; however, we cannot do that here as
|
960
|
-
* that would prevent the element from being
|
961
|
-
* removed from the DOM.
|
962
|
-
*/
|
963
|
-
this.gestureAnimationDismissing = true;
|
964
|
-
this.animation.onFinish(async () => {
|
965
|
-
await this.dismiss(undefined, 'gesture');
|
966
|
-
this.gestureAnimationDismissing = false;
|
967
|
-
});
|
968
|
-
}, (breakpoint) => {
|
969
|
-
this.currentBreakpoint = breakpoint;
|
1517
|
+
const { gesture, moveSheetToBreakpoint } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, () => { var _a; return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0; }, () => this.sheetOnDismiss(), (breakpoint) => {
|
1518
|
+
if (this.currentBreakpoint !== breakpoint) {
|
1519
|
+
this.currentBreakpoint = breakpoint;
|
1520
|
+
this.ionBreakpointDidChange.emit({ breakpoint });
|
1521
|
+
}
|
970
1522
|
});
|
1523
|
+
this.gesture = gesture;
|
1524
|
+
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
971
1525
|
this.gesture.enable(true);
|
972
1526
|
}
|
1527
|
+
sheetOnDismiss() {
|
1528
|
+
/**
|
1529
|
+
* While the gesture animation is finishing
|
1530
|
+
* it is possible for a user to tap the backdrop.
|
1531
|
+
* This would result in the dismiss animation
|
1532
|
+
* being played again. Typically this is avoided
|
1533
|
+
* by setting `presented = false` on the overlay
|
1534
|
+
* component; however, we cannot do that here as
|
1535
|
+
* that would prevent the element from being
|
1536
|
+
* removed from the DOM.
|
1537
|
+
*/
|
1538
|
+
this.gestureAnimationDismissing = true;
|
1539
|
+
this.animation.onFinish(async () => {
|
1540
|
+
this.currentBreakpoint = 0;
|
1541
|
+
this.ionBreakpointDidChange.emit({ breakpoint: this.currentBreakpoint });
|
1542
|
+
await this.dismiss(undefined, 'gesture');
|
1543
|
+
this.gestureAnimationDismissing = false;
|
1544
|
+
});
|
1545
|
+
}
|
973
1546
|
/**
|
974
1547
|
* Dismiss the modal overlay after it has been presented.
|
975
1548
|
*
|
@@ -980,6 +1553,24 @@ const Modal = class {
|
|
980
1553
|
if (this.gestureAnimationDismissing && role !== 'gesture') {
|
981
1554
|
return false;
|
982
1555
|
}
|
1556
|
+
/**
|
1557
|
+
* If a canDismiss handler is responsible
|
1558
|
+
* for calling the dismiss method, we should
|
1559
|
+
* not run the canDismiss check again.
|
1560
|
+
*/
|
1561
|
+
if (role !== 'handler' && !(await this.checkCanDismiss())) {
|
1562
|
+
return false;
|
1563
|
+
}
|
1564
|
+
/**
|
1565
|
+
* We need to start the status bar change
|
1566
|
+
* before the animation so that the change
|
1567
|
+
* finishes when the dismiss animation does.
|
1568
|
+
* TODO (FW-937)
|
1569
|
+
*/
|
1570
|
+
const hasCardModal = this.swipeToClose || (this.canDismiss !== undefined && this.presentingElement !== undefined);
|
1571
|
+
if (hasCardModal && ionicGlobal.getIonMode(this) === 'ios') {
|
1572
|
+
setCardStatusBarDefault();
|
1573
|
+
}
|
983
1574
|
/* tslint:disable-next-line */
|
984
1575
|
if (typeof window !== 'undefined' && this.keyboardOpenCallback) {
|
985
1576
|
window.removeEventListener(keyboard.KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
|
@@ -996,20 +1587,25 @@ const Modal = class {
|
|
996
1587
|
await this.currentTransition;
|
997
1588
|
}
|
998
1589
|
const enteringAnimation = overlays.activeAnimations.get(this) || [];
|
999
|
-
this.currentTransition = overlays.dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
|
1590
|
+
this.currentTransition = overlays.dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
|
1591
|
+
presentingEl: this.presentingElement,
|
1592
|
+
currentBreakpoint: this.currentBreakpoint || this.initialBreakpoint,
|
1593
|
+
backdropBreakpoint: this.backdropBreakpoint,
|
1594
|
+
});
|
1000
1595
|
const dismissed = await this.currentTransition;
|
1001
1596
|
if (dismissed) {
|
1002
1597
|
const { delegate } = this.getDelegate();
|
1003
1598
|
await frameworkDelegate.detachComponent(delegate, this.usersElement);
|
1004
|
-
index$
|
1599
|
+
index$2.writeTask(() => this.el.classList.remove('show-modal'));
|
1005
1600
|
if (this.animation) {
|
1006
1601
|
this.animation.destroy();
|
1007
1602
|
}
|
1008
1603
|
if (this.gesture) {
|
1009
1604
|
this.gesture.destroy();
|
1010
1605
|
}
|
1011
|
-
enteringAnimation.forEach(ani => ani.destroy());
|
1606
|
+
enteringAnimation.forEach((ani) => ani.destroy());
|
1012
1607
|
}
|
1608
|
+
this.currentBreakpoint = undefined;
|
1013
1609
|
this.currentTransition = undefined;
|
1014
1610
|
this.animation = undefined;
|
1015
1611
|
return dismissed;
|
@@ -1026,17 +1622,74 @@ const Modal = class {
|
|
1026
1622
|
onWillDismiss() {
|
1027
1623
|
return overlays.eventMethod(this.el, 'ionModalWillDismiss');
|
1028
1624
|
}
|
1625
|
+
/**
|
1626
|
+
* Move a sheet style modal to a specific breakpoint. The breakpoint value must
|
1627
|
+
* be a value defined in your `breakpoints` array.
|
1628
|
+
*/
|
1629
|
+
async setCurrentBreakpoint(breakpoint) {
|
1630
|
+
if (!this.isSheetModal) {
|
1631
|
+
index$3.printIonWarning('setCurrentBreakpoint is only supported on sheet modals.');
|
1632
|
+
return;
|
1633
|
+
}
|
1634
|
+
if (!this.breakpoints.includes(breakpoint)) {
|
1635
|
+
index$3.printIonWarning(`Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`);
|
1636
|
+
return;
|
1637
|
+
}
|
1638
|
+
const { currentBreakpoint, moveSheetToBreakpoint, canDismiss, breakpoints } = this;
|
1639
|
+
if (currentBreakpoint === breakpoint) {
|
1640
|
+
return;
|
1641
|
+
}
|
1642
|
+
if (moveSheetToBreakpoint) {
|
1643
|
+
this.sheetTransition = moveSheetToBreakpoint({
|
1644
|
+
breakpoint,
|
1645
|
+
breakpointOffset: 1 - currentBreakpoint,
|
1646
|
+
canDismiss: canDismiss !== undefined && canDismiss !== true && breakpoints[0] === 0,
|
1647
|
+
});
|
1648
|
+
await this.sheetTransition;
|
1649
|
+
this.sheetTransition = undefined;
|
1650
|
+
}
|
1651
|
+
}
|
1652
|
+
/**
|
1653
|
+
* Returns the current breakpoint of a sheet style modal
|
1654
|
+
*/
|
1655
|
+
async getCurrentBreakpoint() {
|
1656
|
+
return this.currentBreakpoint;
|
1657
|
+
}
|
1658
|
+
async moveToNextBreakpoint() {
|
1659
|
+
const { breakpoints, currentBreakpoint } = this;
|
1660
|
+
if (!breakpoints || currentBreakpoint == null) {
|
1661
|
+
/**
|
1662
|
+
* If the modal does not have breakpoints and/or the current
|
1663
|
+
* breakpoint is not set, we can't move to the next breakpoint.
|
1664
|
+
*/
|
1665
|
+
return false;
|
1666
|
+
}
|
1667
|
+
const allowedBreakpoints = breakpoints.filter((b) => b !== 0);
|
1668
|
+
const currentBreakpointIndex = allowedBreakpoints.indexOf(currentBreakpoint);
|
1669
|
+
const nextBreakpointIndex = (currentBreakpointIndex + 1) % allowedBreakpoints.length;
|
1670
|
+
const nextBreakpoint = allowedBreakpoints[nextBreakpointIndex];
|
1671
|
+
/**
|
1672
|
+
* Sets the current breakpoint to the next available breakpoint.
|
1673
|
+
* If the current breakpoint is the last breakpoint, we set the current
|
1674
|
+
* breakpoint to the first non-zero breakpoint to avoid dismissing the sheet.
|
1675
|
+
*/
|
1676
|
+
await this.setCurrentBreakpoint(nextBreakpoint);
|
1677
|
+
return true;
|
1678
|
+
}
|
1029
1679
|
render() {
|
1030
|
-
const { handle, isSheetModal, presentingElement, htmlAttributes } = this;
|
1680
|
+
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior } = this;
|
1031
1681
|
const showHandle = handle !== false && isSheetModal;
|
1032
1682
|
const mode = ionicGlobal.getIonMode(this);
|
1033
1683
|
const { modalId } = this;
|
1034
1684
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
1035
|
-
|
1685
|
+
const isHandleCycle = handleBehavior === 'cycle';
|
1686
|
+
return (index$2.h(index$2.Host, Object.assign({ "no-router": true, "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
1036
1687
|
zIndex: `${20000 + this.overlayIndex}`,
|
1037
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), id: modalId, onIonBackdropTap: this.onBackdropTap,
|
1688
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), id: modalId, onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), index$2.h("ion-backdrop", { ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$2.h("div", { class: "modal-shadow" }), index$2.h("div", { role: "dialog", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }, showHandle && (index$2.h("button", { class: "modal-handle",
|
1689
|
+
// Prevents the handle from receiving keyboard focus when it does not cycle
|
1690
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), index$2.h("slot", null))));
|
1038
1691
|
}
|
1039
|
-
get el() { return index$
|
1692
|
+
get el() { return index$2.getElement(this); }
|
1040
1693
|
static get watchers() { return {
|
1041
1694
|
"isOpen": ["onIsOpenChange"],
|
1042
1695
|
"trigger": ["onTriggerChange"],
|
@@ -1044,10 +1697,10 @@ const Modal = class {
|
|
1044
1697
|
}; }
|
1045
1698
|
};
|
1046
1699
|
const LIFECYCLE_MAP = {
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1700
|
+
ionModalDidPresent: 'ionViewDidEnter',
|
1701
|
+
ionModalWillPresent: 'ionViewWillEnter',
|
1702
|
+
ionModalWillDismiss: 'ionViewWillLeave',
|
1703
|
+
ionModalDidDismiss: 'ionViewDidLeave',
|
1051
1704
|
};
|
1052
1705
|
let modalIds = 0;
|
1053
1706
|
Modal.style = {
|