@sparkle-learning/core 0.0.27 → 0.0.30
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-cee9b061.js → PrivateRoute-043bb7d3.js} +6 -40
- package/dist/cjs/{active-router-3bd7b540.js → active-router-eedb3bfe.js} +1 -1
- package/dist/cjs/{animation-05337433.js → animation-6132e37f.js} +28 -4
- package/dist/cjs/app-globals-9869bf67.js +9 -0
- package/dist/cjs/{auth.store-aba3d22f.js → auth.store-ff3fda09.js} +1869 -357
- 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-24e309bf.js → cubic-bezier-293f4663.js} +3 -0
- package/dist/cjs/dir-5af5259a.js +20 -0
- package/dist/cjs/{facilitator.service-e1e2f719.js → facilitator.service-faac5c0c.js} +1 -1
- package/dist/cjs/feed.service-66405969.js +124 -0
- package/dist/cjs/focus-visible-ad3828a7.js +63 -0
- package/dist/cjs/framework-delegate-2470a246.js +113 -0
- package/dist/cjs/{gesture-controller-e824cfb3.js → gesture-controller-07c31f70.js} +3 -0
- package/dist/cjs/{haptic-415dac5b.js → haptic-91e86eb7.js} +3 -0
- package/dist/cjs/{hardware-back-button-ca468aae.js → hardware-back-button-f7b5d99e.js} +3 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +18001 -0
- package/dist/cjs/{helpers-26770c32.js → helpers-7e28976c.js} +122 -3
- package/dist/cjs/{icons-a0fef92b.js → icons-b8a2231a.js} +1 -1
- package/dist/cjs/{index-427d03fb.js → index-185f9c5a.js} +3 -0
- package/dist/cjs/{index-6eff209d.js → index-43642662.js} +24 -3
- package/dist/cjs/{index-7bcd36a0.js → index-459a5fa9.js} +20 -4
- package/dist/cjs/index-8540d72e.js +42 -0
- package/dist/cjs/{index-58b3ee93.js → index-b12edb26.js} +34 -5
- package/dist/cjs/{index-fbf4d3bf.js → index-bae2a754.js} +303 -207
- package/dist/cjs/index.cjs.js +8 -7
- package/dist/cjs/index.es-ef3efdfb.js +10671 -0
- package/dist/cjs/{input-shims-213e83f8.js → input-shims-6c442c9f.js} +34 -10
- package/dist/cjs/ion-accordion-group.cjs.entry.js +197 -0
- package/dist/cjs/ion-accordion.cjs.entry.js +340 -0
- package/dist/cjs/ion-action-sheet_4.cjs.entry.js +2203 -0
- package/dist/cjs/ion-app.cjs.entry.js +23 -8
- package/dist/cjs/ion-back-button.cjs.entry.js +14 -9
- package/dist/cjs/ion-backdrop.cjs.entry.js +3 -3
- package/dist/cjs/ion-badge.cjs.entry.js +3 -3
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +103 -0
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +135 -0
- package/dist/cjs/ion-buttons_3.cjs.entry.js +7 -6
- package/dist/cjs/ion-card-header.cjs.entry.js +3 -3
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +3 -3
- package/dist/cjs/ion-card-title.cjs.entry.js +3 -3
- package/dist/cjs/ion-chip.cjs.entry.js +3 -3
- package/dist/cjs/ion-content_2.cjs.entry.js +144 -56
- package/dist/cjs/ion-datetime.cjs.entry.js +1902 -779
- package/dist/cjs/ion-fab-button.cjs.entry.js +5 -4
- package/dist/cjs/ion-fab-list.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab.cjs.entry.js +2 -2
- package/dist/cjs/ion-footer.cjs.entry.js +79 -4
- package/dist/cjs/ion-img.cjs.entry.js +33 -7
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +3 -3
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +4 -2
- package/dist/cjs/ion-item-divider.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option.cjs.entry.js +4 -4
- package/dist/cjs/ion-item-options.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-sliding.cjs.entry.js +52 -8
- package/dist/cjs/ion-loading.cjs.entry.js +23 -11
- package/dist/cjs/ion-menu-button.cjs.entry.js +17 -11
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +7 -7
- package/dist/cjs/ion-menu.cjs.entry.js +141 -29
- package/dist/cjs/ion-modal.cjs.entry.js +649 -75
- package/dist/cjs/ion-nav-link.cjs.entry.js +4 -1
- package/dist/cjs/ion-nav.cjs.entry.js +140 -137
- package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +700 -0
- package/dist/cjs/ion-picker-column.cjs.entry.js +5 -5
- package/dist/cjs/ion-picker.cjs.entry.js +18 -11
- package/dist/cjs/ion-progress-bar.cjs.entry.js +17 -13
- package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -6
- package/dist/cjs/ion-refresher.cjs.entry.js +83 -84
- package/dist/cjs/ion-reorder-group.cjs.entry.js +9 -8
- package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
- 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 +3 -3
- package/dist/cjs/ion-router-outlet.cjs.entry.js +50 -12
- package/dist/cjs/ion-router.cjs.entry.js +378 -234
- package/dist/cjs/ion-searchbar.cjs.entry.js +50 -17
- package/dist/cjs/ion-segment-button.cjs.entry.js +12 -9
- package/dist/cjs/ion-segment.cjs.entry.js +89 -10
- package/dist/cjs/ion-select_2.cjs.entry.js +64 -30
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +4 -4
- package/dist/cjs/ion-slide.cjs.entry.js +2 -2
- package/dist/cjs/ion-slides.cjs.entry.js +19 -32
- package/dist/cjs/ion-split-pane.cjs.entry.js +8 -3
- package/dist/cjs/ion-tab-bar.cjs.entry.js +25 -12
- package/dist/cjs/ion-tab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab.cjs.entry.js +3 -2
- package/dist/cjs/ion-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +9 -8
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +37 -27
- package/dist/cjs/ion-toggle.cjs.entry.js +15 -15
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +13 -3
- package/dist/cjs/{ionic-global-4930d319.js → ionic-global-878073d1.js} +103 -77
- package/dist/cjs/{ios.transition-6e1fd3d6.js → ios.transition-c3bfb096.js} +8 -5
- package/dist/cjs/{keyboard-1dcbde6c.js → keyboard-dfd76ac3.js} +3 -0
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/localstorage.service-6346a41d.js +40 -0
- package/dist/cjs/{md.transition-3652ad78.js → md.transition-7eb9a1a7.js} +7 -4
- package/dist/cjs/{menu-toggle-util-a8fb4c56.js → menu-toggle-util-cb549c2c.js} +4 -1
- package/dist/cjs/{overlays-08a817ea.js → overlays-0a748609.js} +188 -47
- package/dist/cjs/{purify-596fc2d6.js → purify-d0ad2883.js} +187 -74
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +56 -50
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +26 -0
- 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 +7 -7
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +7 -7
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-feedback.cjs.entry.js +7 -7
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +15 -14
- 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-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- 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 +2 -2
- 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-youtube.cjs.entry.js +2 -2
- package/dist/cjs/{spinner-configs-559523fd.js → spinner-configs-6f6b7ef0.js} +36 -1
- package/dist/cjs/status-tap-8697433c.js +40 -0
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- 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/{student.service-41c7c78d.js → student.service-744c3155.js} +1 -1
- package/dist/cjs/{swipe-back-c1951cbd.js → swipe-back-7e08b5e0.js} +32 -8
- package/dist/cjs/{swiper.bundle-cbea42d8.js → swiper.bundle-8c897c07.js} +4 -4
- package/dist/cjs/{tap-click-cd858b48.js → tap-click-1caf1780.js} +8 -1
- package/dist/cjs/{theme-98ccfc24.js → theme-4252ac15.js} +3 -0
- package/dist/cjs/util-d383acb8.js +2462 -0
- package/dist/collection/collection-manifest.json +9 -2
- package/dist/collection/components/layout/page/page.js +1 -0
- package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +78 -66
- package/dist/collection/components/sparkle-character-intro/assets/characters/character-img.jpg +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/jen.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/kimberly.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/valeria.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/yuna.png +0 -0
- package/dist/collection/components/sparkle-character-intro/assets/characters/zynab.png +0 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +67 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +64 -0
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +48 -43
- package/dist/collection/components/sparkle-youtube/sparkle-youtube.js +6 -2
- package/dist/collection/util.js +1 -0
- package/dist/esm/{PrivateRoute-9f0973bb.js → PrivateRoute-b9937c45.js} +3 -37
- package/dist/esm/{active-router-b3ae32c7.js → active-router-909088d6.js} +1 -1
- package/dist/esm/{animation-72fdacfb.js → animation-b306f6c2.js} +28 -4
- package/dist/esm/app-globals-5c736ae5.js +7 -0
- package/dist/esm/auth.store-3ed2389e.js +4061 -0
- 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-ed243a9b.js → cubic-bezier-a7ad9c8e.js} +3 -0
- package/dist/esm/dir-03012648.js +18 -0
- package/dist/esm/{facilitator.service-cddb2feb.js → facilitator.service-ec0a9739.js} +1 -1
- package/dist/esm/feed.service-33b83cb7.js +119 -0
- package/dist/esm/focus-visible-40cda868.js +61 -0
- package/dist/esm/framework-delegate-3bc58c27.js +109 -0
- package/dist/esm/{gesture-controller-604336b7.js → gesture-controller-686622ba.js} +3 -0
- package/dist/esm/{haptic-67928174.js → haptic-99c9e346.js} +4 -1
- package/dist/esm/{hardware-back-button-508e48cf.js → hardware-back-button-b6ccf74a.js} +3 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +17937 -0
- package/dist/esm/{helpers-e7f66b2b.js → helpers-39367fe1.js} +119 -4
- package/dist/esm/{icons-33e5804c.js → icons-5debfbaf.js} +1 -1
- package/dist/esm/{index-cc97b114.js → index-435af8e6.js} +3 -0
- package/dist/esm/{index-55fc9f5e.js → index-5568e3fa.js} +303 -208
- package/dist/esm/{index-dc09784f.js → index-9594837e.js} +20 -4
- package/dist/esm/{index-b2ad0f1a.js → index-a12c14bd.js} +25 -4
- package/dist/esm/{index-a94619f9.js → index-c26d8655.js} +34 -5
- package/dist/esm/index-dc61f152.js +22 -0
- package/dist/esm/index.es-97dd8174.js +10585 -0
- package/dist/esm/index.js +8 -7
- package/dist/esm/{input-shims-3a97fa86.js → input-shims-cc98ea92.js} +34 -10
- package/dist/esm/ion-accordion-group.entry.js +193 -0
- package/dist/esm/ion-accordion.entry.js +336 -0
- package/dist/esm/ion-action-sheet_4.entry.js +2196 -0
- package/dist/esm/ion-app.entry.js +23 -8
- package/dist/esm/ion-back-button.entry.js +14 -9
- package/dist/esm/ion-backdrop.entry.js +3 -3
- package/dist/esm/ion-badge.entry.js +3 -3
- package/dist/esm/ion-breadcrumb.entry.js +99 -0
- package/dist/esm/ion-breadcrumbs.entry.js +131 -0
- package/dist/esm/ion-buttons_3.entry.js +7 -6
- package/dist/esm/ion-card-header.entry.js +3 -3
- package/dist/esm/ion-card-subtitle.entry.js +3 -3
- package/dist/esm/ion-card-title.entry.js +3 -3
- package/dist/esm/ion-chip.entry.js +3 -3
- package/dist/esm/ion-content_2.entry.js +144 -56
- package/dist/esm/ion-datetime.entry.js +1902 -779
- package/dist/esm/ion-fab-button.entry.js +5 -4
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +79 -4
- package/dist/esm/ion-img.entry.js +33 -7
- package/dist/esm/ion-infinite-scroll-content.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll.entry.js +4 -2
- package/dist/esm/ion-item-divider.entry.js +3 -3
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +4 -4
- package/dist/esm/ion-item-options.entry.js +3 -3
- package/dist/esm/ion-item-sliding.entry.js +52 -8
- package/dist/esm/ion-loading.entry.js +23 -11
- package/dist/esm/ion-menu-button.entry.js +17 -11
- package/dist/esm/ion-menu-toggle.entry.js +7 -7
- package/dist/esm/ion-menu.entry.js +141 -29
- package/dist/esm/ion-modal.entry.js +649 -75
- package/dist/esm/ion-nav-link.entry.js +4 -1
- package/dist/esm/ion-nav.entry.js +140 -137
- package/dist/esm/ion-picker-column-internal_2.entry.js +695 -0
- package/dist/esm/ion-picker-column.entry.js +5 -5
- package/dist/esm/ion-picker.entry.js +18 -11
- package/dist/esm/ion-progress-bar.entry.js +17 -13
- package/dist/esm/ion-refresher-content.entry.js +7 -6
- package/dist/esm/ion-refresher.entry.js +82 -83
- package/dist/esm/ion-reorder-group.entry.js +9 -8
- package/dist/esm/ion-reorder.entry.js +5 -4
- 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 +3 -3
- package/dist/esm/ion-router-outlet.entry.js +50 -12
- package/dist/esm/ion-router.entry.js +378 -234
- package/dist/esm/ion-searchbar.entry.js +50 -17
- package/dist/esm/ion-segment-button.entry.js +12 -9
- package/dist/esm/ion-segment.entry.js +89 -10
- package/dist/esm/ion-select_2.entry.js +64 -30
- package/dist/esm/ion-skeleton-text.entry.js +4 -4
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +19 -32
- package/dist/esm/ion-split-pane.entry.js +8 -3
- package/dist/esm/ion-tab-bar.entry.js +25 -12
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +3 -2
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +9 -8
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +37 -27
- package/dist/esm/ion-toggle.entry.js +15 -15
- package/dist/esm/ion-virtual-scroll.entry.js +13 -3
- package/dist/esm/{ionic-global-1f9287cc.js → ionic-global-0939c477.js} +103 -77
- package/dist/esm/{ios.transition-d01abefd.js → ios.transition-b4ca8a33.js} +8 -5
- package/dist/esm/{keyboard-06906eac.js → keyboard-2503e874.js} +3 -0
- package/dist/esm/loader.js +5 -5
- package/dist/esm/localstorage.service-4bf408c8.js +36 -0
- package/dist/esm/{md.transition-245ffa55.js → md.transition-ca5e0322.js} +7 -4
- package/dist/esm/{menu-toggle-util-fe83fcf5.js → menu-toggle-util-7fa22c2f.js} +4 -1
- package/dist/esm/{overlays-8363621c.js → overlays-34cfa9e0.js} +187 -47
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/esm/{purify-4247e2d0.js → purify-ffce2b4c.js} +185 -72
- package/dist/esm/sparkle-animation-player.entry.js +56 -50
- package/dist/esm/sparkle-character-intro.entry.js +22 -0
- 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 +7 -7
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +7 -7
- package/dist/esm/sparkle-feed-post.entry.js +1 -1
- package/dist/esm/sparkle-feedback.entry.js +7 -7
- package/dist/esm/sparkle-goal-form.entry.js +8 -7
- 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-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- 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 +2 -2
- 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-youtube.entry.js +2 -2
- package/dist/esm/{spinner-configs-9536fae2.js → spinner-configs-f609a655.js} +36 -1
- package/dist/esm/status-tap-6351a0cb.js +38 -0
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/{student.service-c36c5a75.js → student.service-29b688ba.js} +1 -1
- package/dist/esm/{swipe-back-21f58ecf.js → swipe-back-34251834.js} +32 -8
- package/dist/esm/{swiper.bundle-d4422d52.js → swiper.bundle-b6a959de.js} +4 -4
- package/dist/esm/{tap-click-8c728329.js → tap-click-13f1fb0d.js} +8 -1
- package/dist/esm/{theme-12606872.js → theme-c336c9d9.js} +3 -0
- package/dist/esm/util-6ef753e9.js +2451 -0
- package/dist/loader/index.d.ts +0 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.ios.css +75 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.md.css +72 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.ios.css +25 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.md.css +59 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +10 -19
- package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +19 -16
- package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.ios.css +234 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.md.css +237 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +38 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.md.css +37 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +0 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +5 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +60 -14
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +586 -68
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +575 -68
- package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +16 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +105 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +295 -22
- package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +7 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +100 -18
- package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +74 -11
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +48 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +59 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +62 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +122 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +118 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +83 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +49 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +53 -38
- package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +53 -38
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +3 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +5 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +12 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +30 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/{select-popover.css → select-popover.ios.css} +4 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.md.css +37 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +4 -4
- package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +15 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +9 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +4 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +14 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +14 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +1 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +3 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/virtual-scroll/virtual-scroll.css +1 -1
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/button/button.css +49 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/card/card.css +208 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/cards.css +31 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/code/code.css +245 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/dropdown/dropdown.css +115 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header-mobile-collapse/header-mobile-collapse.css +255 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header.css +232 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/collapsible/collapsible.css +3 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu-toggle/menu-toggle.css +25 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu.css +71 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/nav/nav.css +194 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/notfound-page/notfound-page.css +4 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/overlay/overlay.css +67 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/page-footer/page-footer.css +18 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/pagination/pagination.css +89 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/select/select.css +52 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sidebar/sidebar.css +98 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sparkle-lower-content-nav/sparkle-lower-content-nav.css +8 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/table-of-contents/table-of-contents.css +37 -0
- package/dist/node_modules/@sparkle-learning/components/dist/collection/components/tabs/tabs.css +64 -0
- package/dist/sparkle-core/assets/characters/character-img.jpg +0 -0
- package/dist/sparkle-core/assets/characters/jen.png +0 -0
- package/dist/sparkle-core/assets/characters/kimberly.png +0 -0
- package/dist/sparkle-core/assets/characters/valeria.png +0 -0
- package/dist/sparkle-core/assets/characters/yuna.png +0 -0
- package/dist/sparkle-core/assets/characters/zynab.png +0 -0
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-0146afa0.entry.js +1 -0
- package/dist/sparkle-core/{p-52355989.entry.js → p-016a7aaf.entry.js} +1 -1
- package/dist/sparkle-core/p-0187adef.entry.js +1 -0
- package/dist/sparkle-core/p-03189863.js +1 -0
- package/dist/sparkle-core/{p-d4d9aa4a.entry.js → p-03ec54a8.entry.js} +1 -1
- package/dist/sparkle-core/p-04583c51.entry.js +1 -0
- package/dist/sparkle-core/{p-6d506f4e.js → p-052caa63.js} +1 -1
- package/dist/sparkle-core/{p-016bf847.entry.js → p-057f6a23.entry.js} +1 -1
- package/dist/sparkle-core/p-0580419b.entry.js +1 -0
- package/dist/sparkle-core/{p-c563b4de.js → p-063cd168.js} +4 -1
- package/dist/sparkle-core/p-081968cc.entry.js +1 -0
- package/dist/sparkle-core/p-0934f5dd.entry.js +1 -0
- package/dist/sparkle-core/{p-3f5d7a08.entry.js → p-11cf398a.entry.js} +1 -1
- package/dist/sparkle-core/p-1339830f.entry.js +1 -0
- package/dist/sparkle-core/p-145e40f5.entry.js +1 -0
- package/dist/sparkle-core/{p-68f3c93d.entry.js → p-1726da2f.entry.js} +1 -1
- package/dist/sparkle-core/p-173d5461.entry.js +7 -0
- package/dist/sparkle-core/p-18e62133.entry.js +1 -0
- package/dist/sparkle-core/p-1af044f7.js +3 -0
- package/dist/sparkle-core/p-1b78dea1.entry.js +1 -0
- package/dist/sparkle-core/p-1cef8572.js +4 -0
- package/dist/sparkle-core/p-1df05176.js +4 -0
- package/dist/sparkle-core/p-21bf4ca0.entry.js +1 -0
- package/dist/sparkle-core/p-21db4e8e.entry.js +1 -0
- package/dist/sparkle-core/p-23a9f7d1.entry.js +1 -0
- package/dist/sparkle-core/p-289a35ed.entry.js +1 -0
- package/dist/sparkle-core/p-2ee6a5f9.entry.js +1 -0
- package/dist/sparkle-core/p-350adbaa.entry.js +1 -0
- package/dist/sparkle-core/{p-bccd9036.entry.js → p-35a7bd6c.entry.js} +1 -1
- package/dist/sparkle-core/{p-66e3bd1c.entry.js → p-37c00e39.entry.js} +1 -1
- package/dist/sparkle-core/p-389500fd.js +4 -0
- package/dist/sparkle-core/p-39e5a90f.entry.js +1 -0
- package/dist/sparkle-core/{p-ac5e5308.entry.js → p-3a202a38.entry.js} +1 -1
- package/dist/sparkle-core/p-3defe550.entry.js +1 -0
- package/dist/sparkle-core/p-45e6db62.entry.js +1 -0
- package/dist/sparkle-core/{p-581ca370.entry.js → p-48f9b960.entry.js} +1 -1
- package/dist/sparkle-core/{p-0efbc0b3.entry.js → p-4dc3ef96.entry.js} +1 -1
- package/dist/sparkle-core/p-506221fe.js +4 -0
- package/dist/sparkle-core/p-50aac721.entry.js +7 -0
- package/dist/sparkle-core/p-513794b0.js +16 -0
- package/dist/sparkle-core/{p-2e4e8117.js → p-5264da79.js} +3 -0
- package/dist/sparkle-core/{p-40db85ac.entry.js → p-547b70c6.entry.js} +1 -1
- package/dist/sparkle-core/p-5598650a.entry.js +1 -0
- package/dist/sparkle-core/p-55ae49e1.js +4 -0
- package/dist/sparkle-core/p-58e98f89.entry.js +1 -0
- package/dist/sparkle-core/p-59f7bf6e.entry.js +1 -0
- package/dist/sparkle-core/p-5a3d0e6b.js +4 -0
- package/dist/sparkle-core/{p-85d31769.entry.js → p-5b40aae5.entry.js} +1 -1
- package/dist/sparkle-core/p-5c9aa1f9.entry.js +4 -0
- package/dist/sparkle-core/p-5d2e54ee.entry.js +1 -0
- package/dist/sparkle-core/p-5d409601.js +1 -0
- package/dist/sparkle-core/{p-afbaad64.entry.js → p-5f45d206.entry.js} +1 -1
- package/dist/sparkle-core/p-5ff6416d.entry.js +7 -0
- package/dist/sparkle-core/{p-cf2332bb.entry.js → p-62a6c96f.entry.js} +1 -1
- package/dist/sparkle-core/p-64e72f8f.js +4 -0
- package/dist/sparkle-core/p-660e0742.js +1 -0
- package/dist/sparkle-core/{p-d5023db0.entry.js → p-667accac.entry.js} +1 -1
- package/dist/sparkle-core/{p-9ca56f5d.entry.js → p-680663a2.entry.js} +1 -1
- package/dist/sparkle-core/{p-e975924a.entry.js → p-6823e6c1.entry.js} +1 -1
- package/dist/sparkle-core/p-69e7783d.js +4 -0
- package/dist/sparkle-core/p-6bbabb80.entry.js +1 -0
- package/dist/sparkle-core/p-6bf07a28.js +1 -0
- package/dist/sparkle-core/p-6c6145cd.js +4 -0
- package/dist/sparkle-core/p-6c90bde6.entry.js +5 -0
- package/dist/sparkle-core/p-6e88764b.entry.js +4 -0
- package/dist/sparkle-core/p-6ee40949.js +1 -0
- package/dist/sparkle-core/p-6fbe3ca3.entry.js +1 -0
- package/dist/sparkle-core/{p-f2660943.js → p-6fd4985d.js} +3 -0
- package/dist/sparkle-core/{p-8fc9298a.js → p-703ca87c.js} +3 -0
- package/dist/sparkle-core/{p-1bf8bed6.entry.js → p-7052c43a.entry.js} +1 -1
- package/dist/sparkle-core/{p-111520a0.js → p-70b2452c.js} +3 -0
- package/dist/sparkle-core/p-713590fc.js +5 -0
- package/dist/sparkle-core/p-7493ee15.entry.js +1 -0
- package/dist/sparkle-core/p-75572037.js +1 -0
- package/dist/sparkle-core/{p-eb56aa20.entry.js → p-768bcc9e.entry.js} +1 -1
- package/dist/sparkle-core/p-797c23ed.entry.js +1 -0
- package/dist/sparkle-core/{p-03eb2164.js → p-7c38a70b.js} +1 -1
- package/dist/sparkle-core/{p-09d43bee.entry.js → p-7d61177b.entry.js} +1 -1
- package/dist/sparkle-core/p-7dbfc316.js +1 -0
- package/dist/sparkle-core/p-7e61973d.entry.js +7 -0
- package/dist/sparkle-core/{p-3cd28c60.entry.js → p-82e98d07.entry.js} +1 -1
- package/dist/sparkle-core/p-838fa86d.entry.js +18 -0
- package/dist/sparkle-core/p-855ca600.js +1 -0
- package/dist/sparkle-core/p-857f3696.entry.js +1 -0
- package/dist/sparkle-core/{p-8f72be08.js → p-8c6b6038.js} +3 -0
- package/dist/sparkle-core/p-8fe2e51f.entry.js +4 -0
- package/dist/sparkle-core/{p-f72a6e6d.entry.js → p-90389886.entry.js} +1 -1
- package/dist/sparkle-core/p-932bfb69.entry.js +1 -0
- package/dist/sparkle-core/p-935e7cfc.js +1 -0
- package/dist/sparkle-core/{p-c70b9765.entry.js → p-941eaa3a.entry.js} +1 -1
- package/dist/sparkle-core/p-95004267.entry.js +1 -0
- package/dist/sparkle-core/p-950effe7.entry.js +1 -0
- package/dist/sparkle-core/{p-1ca4bf1d.entry.js → p-996361f9.entry.js} +1 -1
- package/dist/sparkle-core/p-9a17f2ad.js +4 -0
- package/dist/sparkle-core/p-9a443f51.js +1 -1
- package/dist/sparkle-core/p-9babd345.js +1 -0
- package/dist/sparkle-core/p-9cfdeb18.entry.js +1 -0
- package/dist/sparkle-core/p-a080e768.entry.js +1 -0
- package/dist/sparkle-core/p-a1cab0f3.js +4 -0
- package/dist/sparkle-core/p-a7cc0052.entry.js +4 -0
- package/dist/sparkle-core/p-a9ccb0df.js +4 -0
- package/dist/sparkle-core/p-a9ee3f6d.entry.js +1 -0
- package/dist/sparkle-core/{p-abe2676a.entry.js → p-aa87c7f0.entry.js} +1 -1
- package/dist/sparkle-core/{p-e818b11d.entry.js → p-aa9ebc39.entry.js} +1 -1
- package/dist/sparkle-core/p-ae1f145d.entry.js +1 -0
- package/dist/sparkle-core/{p-73a646fb.entry.js → p-b07a2cf2.entry.js} +1 -1
- package/dist/sparkle-core/{p-c82b05e0.entry.js → p-b3909012.entry.js} +1 -1
- package/dist/sparkle-core/p-b3e6427d.js +7 -0
- package/dist/sparkle-core/p-b49ca0ea.entry.js +1 -0
- package/dist/sparkle-core/p-b81e20fe.entry.js +4 -0
- package/dist/sparkle-core/p-bca0e465.entry.js +1 -0
- package/dist/sparkle-core/p-c1279cc9.entry.js +1 -0
- package/dist/sparkle-core/{p-82d95fcd.entry.js → p-c1376096.entry.js} +1 -1
- package/dist/sparkle-core/p-c3986a52.entry.js +1 -0
- package/dist/sparkle-core/p-c3d3d5c4.entry.js +1 -0
- package/dist/sparkle-core/p-c48bbc7c.entry.js +4 -0
- package/dist/sparkle-core/p-c5b9bdd6.entry.js +1 -0
- package/dist/sparkle-core/{p-15d68269.entry.js → p-c69b0a7a.entry.js} +1 -1
- package/dist/sparkle-core/p-cbbeed67.entry.js +1 -0
- package/dist/sparkle-core/p-d4a435f8.entry.js +1 -0
- package/dist/sparkle-core/p-d4c07aca.js +4 -0
- package/dist/sparkle-core/p-d5b05ece.entry.js +5 -0
- package/dist/sparkle-core/p-d7baf31e.entry.js +1 -0
- package/dist/sparkle-core/p-d8d3524a.js +1 -0
- package/dist/sparkle-core/p-df0070c5.entry.js +352 -0
- package/dist/sparkle-core/{p-22926eed.entry.js → p-e0fced48.entry.js} +1 -1
- package/dist/sparkle-core/p-e1cba44b.entry.js +4 -0
- package/dist/sparkle-core/p-e225581a.js +7 -0
- package/dist/sparkle-core/{p-4e28ca37.entry.js → p-e3fdd0a8.entry.js} +1 -1
- package/dist/sparkle-core/p-e72d4450.js +4 -0
- package/dist/sparkle-core/p-eb70a23c.entry.js +1 -0
- package/dist/sparkle-core/{p-f9143c5d.entry.js → p-ecd39170.entry.js} +1 -1
- package/dist/sparkle-core/{p-151afa9e.entry.js → p-ed0e9d29.entry.js} +1 -1
- package/dist/sparkle-core/{p-92d42c10.entry.js → p-ee0d7f19.entry.js} +1 -1
- package/dist/sparkle-core/p-f4001fdf.js +4 -0
- package/dist/sparkle-core/p-f9b73032.entry.js +1 -0
- package/dist/sparkle-core/p-faa912d7.entry.js +1 -0
- package/dist/sparkle-core/{p-a250e2ae.entry.js → p-fbd7eeca.entry.js} +1 -1
- package/dist/sparkle-core/p-fc933591.entry.js +1 -0
- package/dist/sparkle-core/p-fef04ab5.js +4 -0
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/sparkle-core/svg/balloon-outline.svg +1 -0
- package/dist/sparkle-core/svg/balloon-sharp.svg +1 -0
- package/dist/sparkle-core/svg/balloon.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball-outline.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball-sharp.svg +1 -0
- package/dist/sparkle-core/svg/bowling-ball.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number-outline.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number-sharp.svg +1 -0
- package/dist/sparkle-core/svg/calendar-number.svg +1 -0
- package/dist/sparkle-core/svg/diamond-outline.svg +1 -0
- package/dist/sparkle-core/svg/diamond-sharp.svg +1 -0
- package/dist/sparkle-core/svg/diamond.svg +1 -0
- package/dist/sparkle-core/svg/footsteps-outline.svg +1 -0
- package/dist/sparkle-core/svg/footsteps-sharp.svg +1 -0
- package/dist/sparkle-core/svg/footsteps.svg +1 -0
- package/dist/sparkle-core/svg/id-card-outline.svg +1 -0
- package/dist/sparkle-core/svg/id-card-sharp.svg +1 -0
- package/dist/sparkle-core/svg/id-card.svg +1 -0
- package/dist/sparkle-core/svg/logo-apple-ar.svg +1 -0
- package/dist/sparkle-core/svg/prism-outline.svg +1 -0
- package/dist/sparkle-core/svg/prism-sharp.svg +1 -0
- package/dist/sparkle-core/svg/prism.svg +1 -0
- package/dist/sparkle-core/svg/scale-outline.svg +1 -0
- package/dist/sparkle-core/svg/scale-sharp.svg +1 -0
- package/dist/sparkle-core/svg/scale.svg +1 -0
- package/dist/sparkle-core/svg/shield-half-outline.svg +1 -0
- package/dist/sparkle-core/svg/shield-half-sharp.svg +1 -0
- package/dist/sparkle-core/svg/shield-half.svg +1 -0
- package/dist/sparkle-core/svg/sparkles-outline.svg +1 -0
- package/dist/sparkle-core/svg/sparkles-sharp.svg +1 -0
- package/dist/sparkle-core/svg/sparkles.svg +1 -0
- package/dist/sparkle-core/swiper/swiper.bundle.js +2 -2
- package/dist/types/components/sparkle-animation-player/sparkle-animation-player.d.ts +1 -0
- package/dist/types/components/sparkle-character-intro/sparkle-character-intro.d.ts +7 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +2 -2
- package/dist/types/components/sparkle-youtube/sparkle-youtube.d.ts +1 -1
- package/dist/types/components.d.ts +17 -0
- package/dist/types/models/definitions.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +200 -190
- package/dist/types/util.d.ts +1 -0
- package/package.json +26 -26
- package/dist/cjs/app-globals-98121d6d.js +0 -9
- package/dist/cjs/button-active-9456fb4d.js +0 -66
- package/dist/cjs/feed.service-518d18fd.js +0 -5802
- package/dist/cjs/focus-visible-1583bc8e.js +0 -45
- package/dist/cjs/framework-delegate-72815681.js +0 -37
- package/dist/cjs/header-mobile-collapse_60.cjs.entry.js +0 -86
- package/dist/cjs/index.es-baef3314.js +0 -13834
- package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -261
- package/dist/cjs/ion-alert.cjs.entry.js +0 -455
- package/dist/cjs/ion-note.cjs.entry.js +0 -29
- package/dist/cjs/ion-popover.cjs.entry.js +0 -365
- package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
- package/dist/cjs/status-tap-466a7c6a.js +0 -25
- package/dist/esm/app-globals-6451faf3.js +0 -7
- package/dist/esm/auth.store-dd944bc2.js +0 -2552
- package/dist/esm/button-active-97535443.js +0 -64
- package/dist/esm/feed.service-0fda1e36.js +0 -5787
- package/dist/esm/focus-visible-abf04ce3.js +0 -43
- package/dist/esm/framework-delegate-2c397da3.js +0 -34
- package/dist/esm/header-mobile-collapse_60.entry.js +0 -19
- package/dist/esm/index.es-a5bf9a49.js +0 -13748
- package/dist/esm/ion-action-sheet.entry.js +0 -257
- package/dist/esm/ion-alert.entry.js +0 -451
- package/dist/esm/ion-note.entry.js +0 -25
- package/dist/esm/ion-popover.entry.js +0 -361
- package/dist/esm/ion-select-popover.entry.js +0 -31
- package/dist/esm/status-tap-9221cd79.js +0 -23
- package/dist/sparkle-core/p-019d9d02.entry.js +0 -1
- package/dist/sparkle-core/p-02d6d899.js +0 -1
- package/dist/sparkle-core/p-03fd27d0.entry.js +0 -1
- package/dist/sparkle-core/p-07018d29.js +0 -1
- package/dist/sparkle-core/p-083d57a6.entry.js +0 -1
- package/dist/sparkle-core/p-090f2624.js +0 -1
- package/dist/sparkle-core/p-0e1c7c8c.js +0 -1
- package/dist/sparkle-core/p-101feae9.js +0 -1
- package/dist/sparkle-core/p-13b0cdfc.entry.js +0 -1
- package/dist/sparkle-core/p-13c9bf3a.entry.js +0 -1
- package/dist/sparkle-core/p-169920f1.js +0 -1
- package/dist/sparkle-core/p-1e1f5e98.entry.js +0 -1
- package/dist/sparkle-core/p-1e866c41.entry.js +0 -1
- package/dist/sparkle-core/p-2474bf60.entry.js +0 -1
- package/dist/sparkle-core/p-25bbf9b4.entry.js +0 -1
- package/dist/sparkle-core/p-2a45b732.js +0 -1
- package/dist/sparkle-core/p-2abf4d37.entry.js +0 -1
- package/dist/sparkle-core/p-2c5edb9f.entry.js +0 -1
- package/dist/sparkle-core/p-2d966d35.js +0 -1
- package/dist/sparkle-core/p-30b641a4.entry.js +0 -1
- package/dist/sparkle-core/p-34ea6639.entry.js +0 -1
- package/dist/sparkle-core/p-359422b6.entry.js +0 -1
- package/dist/sparkle-core/p-37bfb548.entry.js +0 -1
- package/dist/sparkle-core/p-38307b31.js +0 -1
- package/dist/sparkle-core/p-3a29a75b.entry.js +0 -1
- package/dist/sparkle-core/p-3bb55510.entry.js +0 -1
- package/dist/sparkle-core/p-3be0a218.js +0 -1
- package/dist/sparkle-core/p-417a8dd6.js +0 -1
- package/dist/sparkle-core/p-447163be.entry.js +0 -1
- package/dist/sparkle-core/p-49265a8e.entry.js +0 -1
- package/dist/sparkle-core/p-4950f841.entry.js +0 -1
- package/dist/sparkle-core/p-4b7db0e6.js +0 -1
- package/dist/sparkle-core/p-4d8cb365.entry.js +0 -1
- package/dist/sparkle-core/p-5073899e.entry.js +0 -1
- package/dist/sparkle-core/p-5b366c20.entry.js +0 -1
- package/dist/sparkle-core/p-5dce20b9.entry.js +0 -1
- package/dist/sparkle-core/p-6006beec.entry.js +0 -1
- package/dist/sparkle-core/p-600d04fc.entry.js +0 -1
- package/dist/sparkle-core/p-60828739.entry.js +0 -1
- package/dist/sparkle-core/p-6112b180.entry.js +0 -1
- package/dist/sparkle-core/p-66eb6b7a.entry.js +0 -1
- package/dist/sparkle-core/p-67ddec3f.entry.js +0 -1
- package/dist/sparkle-core/p-68cb7d41.entry.js +0 -1
- package/dist/sparkle-core/p-69cd49de.js +0 -1
- package/dist/sparkle-core/p-6edbdde5.entry.js +0 -1
- package/dist/sparkle-core/p-6f0ecbe3.js +0 -1
- package/dist/sparkle-core/p-765b8593.js +0 -1
- package/dist/sparkle-core/p-770128c8.js +0 -1
- package/dist/sparkle-core/p-7840618d.js +0 -1
- package/dist/sparkle-core/p-7b37d523.entry.js +0 -1
- package/dist/sparkle-core/p-7d83d006.entry.js +0 -1
- package/dist/sparkle-core/p-7f3d5344.js +0 -1
- package/dist/sparkle-core/p-81651f26.entry.js +0 -1
- package/dist/sparkle-core/p-86148067.entry.js +0 -1
- package/dist/sparkle-core/p-8b5bc1d6.entry.js +0 -1
- package/dist/sparkle-core/p-8c3ee44c.entry.js +0 -1
- package/dist/sparkle-core/p-9007a06b.entry.js +0 -1
- package/dist/sparkle-core/p-90482861.entry.js +0 -1
- package/dist/sparkle-core/p-a061537e.entry.js +0 -1
- package/dist/sparkle-core/p-a38ea475.js +0 -1
- package/dist/sparkle-core/p-ad1ddf1f.js +0 -483
- package/dist/sparkle-core/p-aef0bba0.js +0 -1
- package/dist/sparkle-core/p-b080c1e3.entry.js +0 -1
- package/dist/sparkle-core/p-b11fe0c7.js +0 -1
- package/dist/sparkle-core/p-bac45a26.entry.js +0 -1
- package/dist/sparkle-core/p-bbe5977b.entry.js +0 -1
- package/dist/sparkle-core/p-bc568dcb.js +0 -1
- package/dist/sparkle-core/p-bfb55f1d.js +0 -3
- package/dist/sparkle-core/p-c163c16d.entry.js +0 -1
- package/dist/sparkle-core/p-c3166584.entry.js +0 -1
- package/dist/sparkle-core/p-c34269ae.entry.js +0 -1
- package/dist/sparkle-core/p-c466ee32.js +0 -1
- package/dist/sparkle-core/p-c6710592.entry.js +0 -1
- package/dist/sparkle-core/p-c7022391.entry.js +0 -1
- package/dist/sparkle-core/p-d4ad796c.js +0 -1
- package/dist/sparkle-core/p-d6152660.entry.js +0 -1
- package/dist/sparkle-core/p-d63406d8.js +0 -1
- package/dist/sparkle-core/p-dba672d5.entry.js +0 -1
- package/dist/sparkle-core/p-dd73d01a.entry.js +0 -1
- package/dist/sparkle-core/p-de33872d.entry.js +0 -1
- package/dist/sparkle-core/p-dee2128a.entry.js +0 -1
- package/dist/sparkle-core/p-df07e132.entry.js +0 -1
- package/dist/sparkle-core/p-e5d5aaa5.js +0 -1
- package/dist/sparkle-core/p-e72c6d87.entry.js +0 -1
- package/dist/sparkle-core/p-e8df6ea6.entry.js +0 -1
- package/dist/sparkle-core/p-ef2a2172.js +0 -1
- package/dist/sparkle-core/p-f1a4ab33.entry.js +0 -1
- package/dist/sparkle-core/p-f43ac631.entry.js +0 -1
- package/dist/sparkle-core/p-f8063d7b.js +0 -1
- package/dist/sparkle-core/p-fd62283e.entry.js +0 -1
- package/dist/sparkle-core/p-fef71e0e.entry.js +0 -1
@@ -0,0 +1,2196 @@
|
|
1
|
+
import { w as writeTask, r as registerInstance, i as createEvent, j as readTask, h, H as Host, e as getElement, f as forceUpdate } from './index-5568e3fa.js';
|
2
|
+
import { g as getIonMode, a as isPlatform } from './ionic-global-0939c477.js';
|
3
|
+
import { c as hapticSelectionEnd, a as hapticSelectionStart, b as hapticSelectionChanged } from './haptic-99c9e346.js';
|
4
|
+
import { createGesture } from './index-a12c14bd.js';
|
5
|
+
import { B as BACKDROP, i as isCancel, b as present, p as prepareOverlay, d as dismiss, e as eventMethod, s as safeCall, j as focusFirstDescendant } from './overlays-34cfa9e0.js';
|
6
|
+
import { g as getClassMap } from './theme-c336c9d9.js';
|
7
|
+
import { c as createAnimation } from './animation-b306f6c2.js';
|
8
|
+
import { s as sanitizeDOMString } from './index-435af8e6.js';
|
9
|
+
import { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate-3bc58c27.js';
|
10
|
+
import { k as raf, g as getElementRoot, a as addEventListener } from './helpers-39367fe1.js';
|
11
|
+
import { d as deepReady } from './index-c26d8655.js';
|
12
|
+
import './gesture-controller-686622ba.js';
|
13
|
+
import './hardware-back-button-b6ccf74a.js';
|
14
|
+
|
15
|
+
/*!
|
16
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
17
|
+
*/
|
18
|
+
const createButtonActiveGesture = (el, isButton) => {
|
19
|
+
let currentTouchedButton;
|
20
|
+
let initialTouchedButton;
|
21
|
+
const activateButtonAtPoint = (x, y, hapticFeedbackFn) => {
|
22
|
+
if (typeof document === 'undefined') {
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
const target = document.elementFromPoint(x, y);
|
26
|
+
if (!target || !isButton(target)) {
|
27
|
+
clearActiveButton();
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
if (target !== currentTouchedButton) {
|
31
|
+
clearActiveButton();
|
32
|
+
setActiveButton(target, hapticFeedbackFn);
|
33
|
+
}
|
34
|
+
};
|
35
|
+
const setActiveButton = (button, hapticFeedbackFn) => {
|
36
|
+
currentTouchedButton = button;
|
37
|
+
if (!initialTouchedButton) {
|
38
|
+
initialTouchedButton = currentTouchedButton;
|
39
|
+
}
|
40
|
+
const buttonToModify = currentTouchedButton;
|
41
|
+
writeTask(() => buttonToModify.classList.add('ion-activated'));
|
42
|
+
hapticFeedbackFn();
|
43
|
+
};
|
44
|
+
const clearActiveButton = (dispatchClick = false) => {
|
45
|
+
if (!currentTouchedButton) {
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
const buttonToModify = currentTouchedButton;
|
49
|
+
writeTask(() => buttonToModify.classList.remove('ion-activated'));
|
50
|
+
/**
|
51
|
+
* Clicking on one button, but releasing on another button
|
52
|
+
* does not dispatch a click event in browsers, so we
|
53
|
+
* need to do it manually here. Some browsers will
|
54
|
+
* dispatch a click if clicking on one button, dragging over
|
55
|
+
* another button, and releasing on the original button. In that
|
56
|
+
* case, we need to make sure we do not cause a double click there.
|
57
|
+
*/
|
58
|
+
if (dispatchClick && initialTouchedButton !== currentTouchedButton) {
|
59
|
+
currentTouchedButton.click();
|
60
|
+
}
|
61
|
+
currentTouchedButton = undefined;
|
62
|
+
};
|
63
|
+
return createGesture({
|
64
|
+
el,
|
65
|
+
gestureName: 'buttonActiveDrag',
|
66
|
+
threshold: 0,
|
67
|
+
onStart: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionStart),
|
68
|
+
onMove: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionChanged),
|
69
|
+
onEnd: () => {
|
70
|
+
clearActiveButton(true);
|
71
|
+
hapticSelectionEnd();
|
72
|
+
initialTouchedButton = undefined;
|
73
|
+
}
|
74
|
+
});
|
75
|
+
};
|
76
|
+
|
77
|
+
/*!
|
78
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
79
|
+
*/
|
80
|
+
/**
|
81
|
+
* iOS Action Sheet Enter Animation
|
82
|
+
*/
|
83
|
+
const iosEnterAnimation$2 = (baseEl) => {
|
84
|
+
const baseAnimation = createAnimation();
|
85
|
+
const backdropAnimation = createAnimation();
|
86
|
+
const wrapperAnimation = createAnimation();
|
87
|
+
backdropAnimation
|
88
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
89
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
90
|
+
.beforeStyles({
|
91
|
+
'pointer-events': 'none'
|
92
|
+
})
|
93
|
+
.afterClearStyles(['pointer-events']);
|
94
|
+
wrapperAnimation
|
95
|
+
.addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
96
|
+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
97
|
+
return baseAnimation
|
98
|
+
.addElement(baseEl)
|
99
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
100
|
+
.duration(400)
|
101
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
102
|
+
};
|
103
|
+
|
104
|
+
/*!
|
105
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
106
|
+
*/
|
107
|
+
/**
|
108
|
+
* iOS Action Sheet Leave Animation
|
109
|
+
*/
|
110
|
+
const iosLeaveAnimation$2 = (baseEl) => {
|
111
|
+
const baseAnimation = createAnimation();
|
112
|
+
const backdropAnimation = createAnimation();
|
113
|
+
const wrapperAnimation = createAnimation();
|
114
|
+
backdropAnimation
|
115
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
116
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
117
|
+
wrapperAnimation
|
118
|
+
.addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
119
|
+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
120
|
+
return baseAnimation
|
121
|
+
.addElement(baseEl)
|
122
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
123
|
+
.duration(450)
|
124
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
125
|
+
};
|
126
|
+
|
127
|
+
/*!
|
128
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
129
|
+
*/
|
130
|
+
/**
|
131
|
+
* MD Action Sheet Enter Animation
|
132
|
+
*/
|
133
|
+
const mdEnterAnimation$2 = (baseEl) => {
|
134
|
+
const baseAnimation = createAnimation();
|
135
|
+
const backdropAnimation = createAnimation();
|
136
|
+
const wrapperAnimation = createAnimation();
|
137
|
+
backdropAnimation
|
138
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
139
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
140
|
+
.beforeStyles({
|
141
|
+
'pointer-events': 'none'
|
142
|
+
})
|
143
|
+
.afterClearStyles(['pointer-events']);
|
144
|
+
wrapperAnimation
|
145
|
+
.addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
146
|
+
.fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
147
|
+
return baseAnimation
|
148
|
+
.addElement(baseEl)
|
149
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
150
|
+
.duration(400)
|
151
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
152
|
+
};
|
153
|
+
|
154
|
+
/*!
|
155
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
156
|
+
*/
|
157
|
+
/**
|
158
|
+
* MD Action Sheet Leave Animation
|
159
|
+
*/
|
160
|
+
const mdLeaveAnimation$2 = (baseEl) => {
|
161
|
+
const baseAnimation = createAnimation();
|
162
|
+
const backdropAnimation = createAnimation();
|
163
|
+
const wrapperAnimation = createAnimation();
|
164
|
+
backdropAnimation
|
165
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
166
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
167
|
+
wrapperAnimation
|
168
|
+
.addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
169
|
+
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
170
|
+
return baseAnimation
|
171
|
+
.addElement(baseEl)
|
172
|
+
.easing('cubic-bezier(.36,.66,.04,1)')
|
173
|
+
.duration(450)
|
174
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
175
|
+
};
|
176
|
+
|
177
|
+
const actionSheetIosCss = ".sc-ion-action-sheet-ios-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-ios-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-ios{left:0;right:0;bottom:0;transform:translate3d(0, 100%, 0);display:block;position:absolute;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);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-ios{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-ios{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-ios{display:flex;flex-flow:column;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-ios{flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-ios::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-ios{flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-ios{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-ios:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-ios:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--backdrop-opacity:var(--ion-backdrop-opacity, 0.4);--button-background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent;--button-background-activated:var(--ion-text-color, #000);--button-background-activated-opacity:.08;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-background-selected:var(--ion-color-step-150, var(--ion-background-color, #fff));--button-background-selected-opacity:1;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-400, #999999);text-align:center}.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:var(--ion-safe-area-bottom, 0)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-container.sc-ion-action-sheet-ios{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-container.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.action-sheet-group.sc-ion-action-sheet-ios{border-radius:13px;margin-bottom:8px}.action-sheet-group.sc-ion-action-sheet-ios:first-child{margin-top:10px}.action-sheet-group.sc-ion-action-sheet-ios:last-child{margin-bottom:10px}@supports (backdrop-filter: blur(0)){.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-group.sc-ion-action-sheet-ios{background-color:transparent;backdrop-filter:saturate(280%) blur(20px)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-title.sc-ion-action-sheet-ios,.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.sc-ion-action-sheet-ios{background-color:transparent;background-image:linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%);background-repeat:no-repeat;background-position:top, bottom;background-size:100% calc(100% - 1px), 100% 1px;backdrop-filter:saturate(120%)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.ion-activated.sc-ion-action-sheet-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7);background-image:none}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-cancel.sc-ion-action-sheet-ios{background:var(--button-background-selected)}}.action-sheet-title.sc-ion-action-sheet-ios{background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent}.action-sheet-title.sc-ion-action-sheet-ios{padding-left:10px;padding-right:10px;padding-top:14px;padding-bottom:13px;color:var(--color, var(--ion-color-step-400, #999999));font-size:13px;font-weight:400;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.action-sheet-title.action-sheet-has-sub-title.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-sub-title.sc-ion-action-sheet-ios{padding-left:0;padding-right:0;padding-top:6px;padding-bottom:0;font-size:13px;font-weight:400}.action-sheet-button.sc-ion-action-sheet-ios{padding-left:18px;padding-right:18px;padding-top:18px;padding-bottom:18px;height:56px;font-size:20px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:18px;padding-inline-start:18px;-webkit-padding-end:18px;padding-inline-end:18px}}.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:0.3em;font-size:28px;pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.action-sheet-button.sc-ion-action-sheet-ios:last-child{background-image:none}.action-sheet-selected.sc-ion-action-sheet-ios{font-weight:bold}.action-sheet-cancel.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-cancel.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-destructive.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-activated.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-focused.sc-ion-action-sheet-ios{color:var(--ion-color-danger, #eb445a)}@media (any-hover: hover){.action-sheet-destructive.sc-ion-action-sheet-ios:hover{color:var(--ion-color-danger, #eb445a)}}";
|
178
|
+
|
179
|
+
const actionSheetMdCss = ".sc-ion-action-sheet-md-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;transform:translate3d(0, 100%, 0);display:block;position:absolute;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);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-md{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-md{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-md{display:flex;flex-flow:column;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-md{flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-md{flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-md{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-md::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-md:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-md:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);--button-background:transparent;--button-background-selected:currentColor;--button-background-selected-opacity:0;--button-background-activated:transparent;--button-background-activated-opacity:0;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-color:var(--ion-color-step-850, #262626);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-title.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:20px;padding-bottom:17px;min-height:60px;color:var(--color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54));font-size:16px;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:14px}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:var(--ion-safe-area-bottom)}.action-sheet-button.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;position:relative;height:52px;font-size:16px;text-align:start;contain:strict;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-icon.sc-ion-action-sheet-md{padding-bottom:4px;margin-left:0;margin-right:32px;margin-top:0;margin-bottom:0;color:var(--color);font-size:24px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-icon.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:32px;margin-inline-end:32px}}.action-sheet-button-inner.sc-ion-action-sheet-md{justify-content:flex-start}.action-sheet-selected.sc-ion-action-sheet-md{font-weight:bold}";
|
180
|
+
|
181
|
+
const ActionSheet = class {
|
182
|
+
constructor(hostRef) {
|
183
|
+
registerInstance(this, hostRef);
|
184
|
+
this.didPresent = createEvent(this, "ionActionSheetDidPresent", 7);
|
185
|
+
this.willPresent = createEvent(this, "ionActionSheetWillPresent", 7);
|
186
|
+
this.willDismiss = createEvent(this, "ionActionSheetWillDismiss", 7);
|
187
|
+
this.didDismiss = createEvent(this, "ionActionSheetDidDismiss", 7);
|
188
|
+
this.presented = false;
|
189
|
+
/**
|
190
|
+
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
|
191
|
+
*/
|
192
|
+
this.keyboardClose = true;
|
193
|
+
/**
|
194
|
+
* An array of buttons for the action sheet.
|
195
|
+
*/
|
196
|
+
this.buttons = [];
|
197
|
+
/**
|
198
|
+
* If `true`, the action sheet will be dismissed when the backdrop is clicked.
|
199
|
+
*/
|
200
|
+
this.backdropDismiss = true;
|
201
|
+
/**
|
202
|
+
* If `true`, the action sheet will be translucent.
|
203
|
+
* Only applies when the mode is `"ios"` and the device supports
|
204
|
+
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
205
|
+
*/
|
206
|
+
this.translucent = false;
|
207
|
+
/**
|
208
|
+
* If `true`, the action sheet will animate.
|
209
|
+
*/
|
210
|
+
this.animated = true;
|
211
|
+
this.onBackdropTap = () => {
|
212
|
+
this.dismiss(undefined, BACKDROP);
|
213
|
+
};
|
214
|
+
this.dispatchCancelHandler = (ev) => {
|
215
|
+
const role = ev.detail.role;
|
216
|
+
if (isCancel(role)) {
|
217
|
+
const cancelButton = this.getButtons().find(b => b.role === 'cancel');
|
218
|
+
this.callButtonHandler(cancelButton);
|
219
|
+
}
|
220
|
+
};
|
221
|
+
}
|
222
|
+
/**
|
223
|
+
* Present the action sheet overlay after it has been created.
|
224
|
+
*/
|
225
|
+
present() {
|
226
|
+
return present(this, 'actionSheetEnter', iosEnterAnimation$2, mdEnterAnimation$2);
|
227
|
+
}
|
228
|
+
connectedCallback() {
|
229
|
+
prepareOverlay(this.el);
|
230
|
+
}
|
231
|
+
/**
|
232
|
+
* Dismiss the action sheet overlay after it has been presented.
|
233
|
+
*
|
234
|
+
* @param data Any data to emit in the dismiss events.
|
235
|
+
* @param role The role of the element that is dismissing the action sheet.
|
236
|
+
* This can be useful in a button handler for determining which button was
|
237
|
+
* clicked to dismiss the action sheet.
|
238
|
+
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
239
|
+
*/
|
240
|
+
dismiss(data, role) {
|
241
|
+
return dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$2, mdLeaveAnimation$2);
|
242
|
+
}
|
243
|
+
/**
|
244
|
+
* Returns a promise that resolves when the action sheet did dismiss.
|
245
|
+
*/
|
246
|
+
onDidDismiss() {
|
247
|
+
return eventMethod(this.el, 'ionActionSheetDidDismiss');
|
248
|
+
}
|
249
|
+
/**
|
250
|
+
* Returns a promise that resolves when the action sheet will dismiss.
|
251
|
+
*
|
252
|
+
*/
|
253
|
+
onWillDismiss() {
|
254
|
+
return eventMethod(this.el, 'ionActionSheetWillDismiss');
|
255
|
+
}
|
256
|
+
async buttonClick(button) {
|
257
|
+
const role = button.role;
|
258
|
+
if (isCancel(role)) {
|
259
|
+
return this.dismiss(button.data, role);
|
260
|
+
}
|
261
|
+
const shouldDismiss = await this.callButtonHandler(button);
|
262
|
+
if (shouldDismiss) {
|
263
|
+
return this.dismiss(button.data, button.role);
|
264
|
+
}
|
265
|
+
return Promise.resolve();
|
266
|
+
}
|
267
|
+
async callButtonHandler(button) {
|
268
|
+
if (button) {
|
269
|
+
// a handler has been provided, execute it
|
270
|
+
// pass the handler the values from the inputs
|
271
|
+
const rtn = await safeCall(button.handler);
|
272
|
+
if (rtn === false) {
|
273
|
+
// if the return value of the handler is false then do not dismiss
|
274
|
+
return false;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
return true;
|
278
|
+
}
|
279
|
+
getButtons() {
|
280
|
+
return this.buttons.map(b => {
|
281
|
+
return (typeof b === 'string')
|
282
|
+
? { text: b }
|
283
|
+
: b;
|
284
|
+
});
|
285
|
+
}
|
286
|
+
disconnectedCallback() {
|
287
|
+
if (this.gesture) {
|
288
|
+
this.gesture.destroy();
|
289
|
+
this.gesture = undefined;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
componentDidLoad() {
|
293
|
+
/**
|
294
|
+
* Do not create gesture if:
|
295
|
+
* 1. A gesture already exists
|
296
|
+
* 2. App is running in MD mode
|
297
|
+
* 3. A wrapper ref does not exist
|
298
|
+
*/
|
299
|
+
const { groupEl, wrapperEl } = this;
|
300
|
+
if (this.gesture || getIonMode(this) === 'md' || !wrapperEl || !groupEl) {
|
301
|
+
return;
|
302
|
+
}
|
303
|
+
readTask(() => {
|
304
|
+
const isScrollable = groupEl.scrollHeight > groupEl.clientHeight;
|
305
|
+
if (!isScrollable) {
|
306
|
+
this.gesture = createButtonActiveGesture(wrapperEl, (refEl) => refEl.classList.contains('action-sheet-button'));
|
307
|
+
this.gesture.enable(true);
|
308
|
+
}
|
309
|
+
});
|
310
|
+
}
|
311
|
+
render() {
|
312
|
+
const { htmlAttributes } = this;
|
313
|
+
const mode = getIonMode(this);
|
314
|
+
const allButtons = this.getButtons();
|
315
|
+
const cancelButton = allButtons.find(b => b.role === 'cancel');
|
316
|
+
const buttons = allButtons.filter(b => b.role !== 'cancel');
|
317
|
+
return (h(Host, Object.assign({ role: "dialog", "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
318
|
+
zIndex: `${20000 + this.overlayIndex}`,
|
319
|
+
}, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { tappable: this.backdropDismiss }), h("div", { tabindex: "0" }), h("div", { class: "action-sheet-wrapper ion-overlay-wrapper", role: "dialog", ref: el => this.wrapperEl = el }, h("div", { class: "action-sheet-container" }, h("div", { class: "action-sheet-group", ref: el => this.groupEl = el }, this.header !== undefined &&
|
320
|
+
h("div", { class: {
|
321
|
+
'action-sheet-title': true,
|
322
|
+
'action-sheet-has-sub-title': this.subHeader !== undefined
|
323
|
+
} }, this.header, this.subHeader && h("div", { class: "action-sheet-sub-title" }, this.subHeader)), buttons.map(b => h("button", { type: "button", id: b.id, class: buttonClass$1(b), onClick: () => this.buttonClick(b) }, h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null)))), cancelButton &&
|
324
|
+
h("div", { class: "action-sheet-group action-sheet-group-cancel" }, h("button", { type: "button", class: buttonClass$1(cancelButton), onClick: () => this.buttonClick(cancelButton) }, h("span", { class: "action-sheet-button-inner" }, cancelButton.icon &&
|
325
|
+
h("ion-icon", { icon: cancelButton.icon, lazy: false, class: "action-sheet-icon" }), cancelButton.text), mode === 'md' && h("ion-ripple-effect", null))))), h("div", { tabindex: "0" })));
|
326
|
+
}
|
327
|
+
get el() { return getElement(this); }
|
328
|
+
};
|
329
|
+
const buttonClass$1 = (button) => {
|
330
|
+
return Object.assign({ 'action-sheet-button': true, 'ion-activatable': true, 'ion-focusable': true, [`action-sheet-${button.role}`]: button.role !== undefined }, getClassMap(button.cssClass));
|
331
|
+
};
|
332
|
+
ActionSheet.style = {
|
333
|
+
ios: actionSheetIosCss,
|
334
|
+
md: actionSheetMdCss
|
335
|
+
};
|
336
|
+
|
337
|
+
/*!
|
338
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
339
|
+
*/
|
340
|
+
/**
|
341
|
+
* iOS Alert Enter Animation
|
342
|
+
*/
|
343
|
+
const iosEnterAnimation$1 = (baseEl) => {
|
344
|
+
const baseAnimation = createAnimation();
|
345
|
+
const backdropAnimation = createAnimation();
|
346
|
+
const wrapperAnimation = createAnimation();
|
347
|
+
backdropAnimation
|
348
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
349
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
350
|
+
.beforeStyles({
|
351
|
+
'pointer-events': 'none'
|
352
|
+
})
|
353
|
+
.afterClearStyles(['pointer-events']);
|
354
|
+
wrapperAnimation
|
355
|
+
.addElement(baseEl.querySelector('.alert-wrapper'))
|
356
|
+
.keyframes([
|
357
|
+
{ offset: 0, opacity: '0.01', transform: 'scale(1.1)' },
|
358
|
+
{ offset: 1, opacity: '1', transform: 'scale(1)' }
|
359
|
+
]);
|
360
|
+
return baseAnimation
|
361
|
+
.addElement(baseEl)
|
362
|
+
.easing('ease-in-out')
|
363
|
+
.duration(200)
|
364
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
365
|
+
};
|
366
|
+
|
367
|
+
/*!
|
368
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
369
|
+
*/
|
370
|
+
/**
|
371
|
+
* iOS Alert Leave Animation
|
372
|
+
*/
|
373
|
+
const iosLeaveAnimation$1 = (baseEl) => {
|
374
|
+
const baseAnimation = createAnimation();
|
375
|
+
const backdropAnimation = createAnimation();
|
376
|
+
const wrapperAnimation = createAnimation();
|
377
|
+
backdropAnimation
|
378
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
379
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
380
|
+
wrapperAnimation
|
381
|
+
.addElement(baseEl.querySelector('.alert-wrapper'))
|
382
|
+
.keyframes([
|
383
|
+
{ offset: 0, opacity: 0.99, transform: 'scale(1)' },
|
384
|
+
{ offset: 1, opacity: 0, transform: 'scale(0.9)' }
|
385
|
+
]);
|
386
|
+
return baseAnimation
|
387
|
+
.addElement(baseEl)
|
388
|
+
.easing('ease-in-out')
|
389
|
+
.duration(200)
|
390
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
391
|
+
};
|
392
|
+
|
393
|
+
/*!
|
394
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
395
|
+
*/
|
396
|
+
/**
|
397
|
+
* Md Alert Enter Animation
|
398
|
+
*/
|
399
|
+
const mdEnterAnimation$1 = (baseEl) => {
|
400
|
+
const baseAnimation = createAnimation();
|
401
|
+
const backdropAnimation = createAnimation();
|
402
|
+
const wrapperAnimation = createAnimation();
|
403
|
+
backdropAnimation
|
404
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
405
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
406
|
+
.beforeStyles({
|
407
|
+
'pointer-events': 'none'
|
408
|
+
})
|
409
|
+
.afterClearStyles(['pointer-events']);
|
410
|
+
wrapperAnimation
|
411
|
+
.addElement(baseEl.querySelector('.alert-wrapper'))
|
412
|
+
.keyframes([
|
413
|
+
{ offset: 0, opacity: '0.01', transform: 'scale(0.9)' },
|
414
|
+
{ offset: 1, opacity: '1', transform: 'scale(1)' }
|
415
|
+
]);
|
416
|
+
return baseAnimation
|
417
|
+
.addElement(baseEl)
|
418
|
+
.easing('ease-in-out')
|
419
|
+
.duration(150)
|
420
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
421
|
+
};
|
422
|
+
|
423
|
+
/*!
|
424
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
425
|
+
*/
|
426
|
+
/**
|
427
|
+
* Md Alert Leave Animation
|
428
|
+
*/
|
429
|
+
const mdLeaveAnimation$1 = (baseEl) => {
|
430
|
+
const baseAnimation = createAnimation();
|
431
|
+
const backdropAnimation = createAnimation();
|
432
|
+
const wrapperAnimation = createAnimation();
|
433
|
+
backdropAnimation
|
434
|
+
.addElement(baseEl.querySelector('ion-backdrop'))
|
435
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
436
|
+
wrapperAnimation
|
437
|
+
.addElement(baseEl.querySelector('.alert-wrapper'))
|
438
|
+
.fromTo('opacity', 0.99, 0);
|
439
|
+
return baseAnimation
|
440
|
+
.addElement(baseEl)
|
441
|
+
.easing('ease-in-out')
|
442
|
+
.duration(150)
|
443
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
444
|
+
};
|
445
|
+
|
446
|
+
const alertIosCss = ".sc-ion-alert-ios-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-ios-h{display:none}.alert-top.sc-ion-alert-ios-h{padding-top:50px;align-items:flex-start}.alert-wrapper.sc-ion-alert-ios{display:flex;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-ios{box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-message.sc-ion-alert-ios::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-ios{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;box-sizing:border-box}.alert-button-group.sc-ion-alert-ios{display:flex;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-ios{flex-direction:column;flex-wrap:nowrap}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-ios,.alert-tappable.ion-focused.sc-ion-alert-ios{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-ios{display:flex;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-ios,.alert-checkbox-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios,.alert-radio-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;appearance:none;contain:strict}.alert-button.sc-ion-alert-ios,.alert-checkbox.sc-ion-alert-ios,.alert-input.sc-ion-alert-ios,.alert-radio.sc-ion-alert-ios{outline:none}.alert-radio-icon.sc-ion-alert-ios,.alert-checkbox-icon.sc-ion-alert-ios,.alert-checkbox-inner.sc-ion-alert-ios{box-sizing:border-box}textarea.alert-input.sc-ion-alert-ios{min-height:37px;resize:none}.sc-ion-alert-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);font-size:14px}.alert-wrapper.sc-ion-alert-ios{border-radius:13px;box-shadow:none;overflow:hidden}.alert-button.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{pointer-events:none}@supports (backdrop-filter: blur(0)){.alert-translucent.sc-ion-alert-ios-h .alert-wrapper.sc-ion-alert-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);backdrop-filter:saturate(180%) blur(20px)}}.alert-head.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:7px;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-title.sc-ion-alert-ios{margin-top:8px;color:var(--ion-text-color, #000);font-size:17px;font-weight:600}.alert-sub-title.sc-ion-alert-ios{color:var(--ion-color-step-600, #666666);font-size:14px}.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:21px;color:var(--ion-text-color, #000);font-size:13px;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-message.sc-ion-alert-ios{max-height:240px}.alert-message.sc-ion-alert-ios:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:12px}.alert-input.sc-ion-alert-ios{border-radius:4px;margin-top:10px;padding-left:6px;padding-right:6px;padding-top:6px;padding-bottom:6px;border:0.55px solid var(--ion-color-step-250, #bfbfbf);background-color:var(--ion-background-color, #fff);appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-input.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}.alert-input.sc-ion-alert-ios::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-clear{display:none}.alert-radio-group.sc-ion-alert-ios,.alert-checkbox-group.sc-ion-alert-ios{overscroll-behavior:contain;max-height:240px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);overflow-y:auto;-webkit-overflow-scrolling:touch}.alert-tappable.sc-ion-alert-ios{height:44px}.alert-radio-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;flex:1;order:0;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}[aria-checked=true].sc-ion-alert-ios .alert-radio-label.sc-ion-alert-ios{color:var(--ion-color-primary, #3880ff)}.alert-radio-icon.sc-ion-alert-ios{position:relative;order:1;min-width:30px}[aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:7px;top:-7px;position:absolute;width:6px;height:12px;transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:unset;right:unset;right:7px}.alert-checkbox-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}.alert-checkbox-icon.sc-ion-alert-ios{border-radius:50%;margin-left:16px;margin-right:6px;margin-top:10px;margin-bottom:10px;position:relative;width:24px;height:24px;border-width:1px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));background-color:var(--ion-item-background, var(--ion-background-color, #fff));contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-icon.sc-ion-alert-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:6px;margin-inline-end:6px}}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-icon.sc-ion-alert-ios{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:9px;top:4px;position:absolute;width:5px;height:12px;transform:rotate(45deg);border-width:1px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-background-color, #fff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:unset;right:unset;right:9px}.alert-button-group.sc-ion-alert-ios{margin-right:-0.55px;flex-wrap:wrap}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-ios{margin-right:unset;-webkit-margin-end:-0.55px;margin-inline-end:-0.55px}}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:0;flex:1 1 auto;min-width:50%;height:44px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);background-color:transparent;color:var(--ion-color-primary, #3880ff);font-size:17px;overflow:hidden}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:first-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child{border-right:0}.alert-button.sc-ion-alert-ios:last-child{border-right:0;font-weight:bold}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:last-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child{border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}.alert-button.ion-activated.sc-ion-alert-ios{background-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1)}.alert-button-role-destructive.sc-ion-alert-ios,.alert-button-role-destructive.ion-activated.sc-ion-alert-ios,.alert-button-role-destructive.ion-focused.sc-ion-alert-ios{color:var(--ion-color-danger, #eb445a)}";
|
447
|
+
|
448
|
+
const alertMdCss = ".sc-ion-alert-md-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-md-h{display:none}.alert-top.sc-ion-alert-md-h{padding-top:50px;align-items:flex-start}.alert-wrapper.sc-ion-alert-md{display:flex;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-md{box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-md::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-md::-webkit-scrollbar,.alert-message.sc-ion-alert-md::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-md{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;box-sizing:border-box}.alert-button-group.sc-ion-alert-md{display:flex;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-md{flex-direction:column;flex-wrap:nowrap}.alert-button.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-md,.alert-tappable.ion-focused.sc-ion-alert-md{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-md{display:flex;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-md,.alert-checkbox-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md,.alert-radio-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;appearance:none;contain:strict}.alert-button.sc-ion-alert-md,.alert-checkbox.sc-ion-alert-md,.alert-input.sc-ion-alert-md,.alert-radio.sc-ion-alert-md{outline:none}.alert-radio-icon.sc-ion-alert-md,.alert-checkbox-icon.sc-ion-alert-md,.alert-checkbox-inner.sc-ion-alert-md{box-sizing:border-box}textarea.alert-input.sc-ion-alert-md{min-height:37px;resize:none}.sc-ion-alert-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--max-width:280px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);font-size:14px}.alert-wrapper.sc-ion-alert-md{border-radius:4px;box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12)}.alert-head.sc-ion-alert-md{padding-left:23px;padding-right:23px;padding-top:20px;padding-bottom:15px;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:23px;padding-inline-start:23px;-webkit-padding-end:23px;padding-inline-end:23px}}.alert-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:20px;font-weight:500}.alert-sub-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:16px}.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:24px;padding-right:24px;padding-top:20px;padding-bottom:20px;color:var(--ion-color-step-550, #737373)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px}}.alert-message.sc-ion-alert-md{max-height:266px;font-size:16px}.alert-message.sc-ion-alert-md:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-head.sc-ion-alert-md+.alert-message.sc-ion-alert-md{padding-top:0}.alert-input.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);color:var(--ion-text-color, #000)}.alert-input.sc-ion-alert-md::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-clear{display:none}.alert-input.sc-ion-alert-md:focus{margin-bottom:4px;border-bottom:2px solid var(--ion-color-primary, #3880ff)}.alert-radio-group.sc-ion-alert-md,.alert-checkbox-group.sc-ion-alert-md{position:relative;max-height:266px;border-top:1px solid var(--ion-color-step-150, #d9d9d9);border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);overflow:auto}.alert-tappable.sc-ion-alert-md{position:relative;height:48px;overflow:hidden}.alert-radio-label.sc-ion-alert-md{padding-left:52px;padding-right:26px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:52px;padding-inline-start:52px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-radio-icon.sc-ion-alert-md{left:26px;top:0;border-radius:50%;display:block;position:relative;width:20px;height:20px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373)}[dir=rtl].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}.alert-radio-inner.sc-ion-alert-md{left:3px;top:3px;border-radius:50%;position:absolute;width:10px;height:10px;transform:scale3d(0, 0, 0);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}[aria-checked=true].sc-ion-alert-md .alert-radio-label.sc-ion-alert-md{color:var(--ion-color-step-850, #262626)}[aria-checked=true].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md{transform:scale3d(1, 1, 1)}.alert-checkbox-label.sc-ion-alert-md{padding-left:53px;padding-right:26px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:53px;padding-inline-start:53px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-checkbox-icon.sc-ion-alert-md{left:26px;top:0;border-radius:2px;position:relative;width:16px;height:16px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373);contain:strict}[dir=rtl].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}[aria-checked=true].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:3px;top:0;position:absolute;width:6px;height:10px;transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary-contrast, #fff)}[dir=rtl].sc-ion-alert-md [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}.alert-button-group.sc-ion-alert-md{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;box-sizing:border-box;flex-wrap:wrap-reverse;justify-content:flex-end}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.alert-button.sc-ion-alert-md{border-radius:2px;margin-left:0;margin-right:8px;margin-top:0;margin-bottom:0;padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;color:var(--ion-color-primary, #3880ff);font-weight:500;text-align:end;text-transform:uppercase;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.alert-button-inner.sc-ion-alert-md{justify-content:flex-end}";
|
449
|
+
|
450
|
+
const Alert = class {
|
451
|
+
constructor(hostRef) {
|
452
|
+
registerInstance(this, hostRef);
|
453
|
+
this.didPresent = createEvent(this, "ionAlertDidPresent", 7);
|
454
|
+
this.willPresent = createEvent(this, "ionAlertWillPresent", 7);
|
455
|
+
this.willDismiss = createEvent(this, "ionAlertWillDismiss", 7);
|
456
|
+
this.didDismiss = createEvent(this, "ionAlertDidDismiss", 7);
|
457
|
+
this.processedInputs = [];
|
458
|
+
this.processedButtons = [];
|
459
|
+
this.presented = false;
|
460
|
+
/**
|
461
|
+
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
|
462
|
+
*/
|
463
|
+
this.keyboardClose = true;
|
464
|
+
/**
|
465
|
+
* Array of buttons to be added to the alert.
|
466
|
+
*/
|
467
|
+
this.buttons = [];
|
468
|
+
/**
|
469
|
+
* Array of input to show in the alert.
|
470
|
+
*/
|
471
|
+
this.inputs = [];
|
472
|
+
/**
|
473
|
+
* If `true`, the alert will be dismissed when the backdrop is clicked.
|
474
|
+
*/
|
475
|
+
this.backdropDismiss = true;
|
476
|
+
/**
|
477
|
+
* If `true`, the alert will be translucent.
|
478
|
+
* Only applies when the mode is `"ios"` and the device supports
|
479
|
+
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
480
|
+
*/
|
481
|
+
this.translucent = false;
|
482
|
+
/**
|
483
|
+
* If `true`, the alert will animate.
|
484
|
+
*/
|
485
|
+
this.animated = true;
|
486
|
+
this.onBackdropTap = () => {
|
487
|
+
this.dismiss(undefined, BACKDROP);
|
488
|
+
};
|
489
|
+
this.dispatchCancelHandler = (ev) => {
|
490
|
+
const role = ev.detail.role;
|
491
|
+
if (isCancel(role)) {
|
492
|
+
const cancelButton = this.processedButtons.find(b => b.role === 'cancel');
|
493
|
+
this.callButtonHandler(cancelButton);
|
494
|
+
}
|
495
|
+
};
|
496
|
+
}
|
497
|
+
onKeydown(ev) {
|
498
|
+
const inputTypes = new Set(this.processedInputs.map(i => i.type));
|
499
|
+
// The only inputs we want to navigate between using arrow keys are the radios
|
500
|
+
// ignore the keydown event if it is not on a radio button
|
501
|
+
if (!inputTypes.has('radio')
|
502
|
+
|| (ev.target && !this.el.contains(ev.target))
|
503
|
+
|| ev.target.classList.contains('alert-button')) {
|
504
|
+
return;
|
505
|
+
}
|
506
|
+
// Get all radios inside of the radio group and then
|
507
|
+
// filter out disabled radios since we need to skip those
|
508
|
+
const query = this.el.querySelectorAll('.alert-radio');
|
509
|
+
const radios = Array.from(query).filter(radio => !radio.disabled);
|
510
|
+
// The focused radio is the one that shares the same id as
|
511
|
+
// the event target
|
512
|
+
const index = radios.findIndex(radio => radio.id === ev.target.id);
|
513
|
+
// We need to know what the next radio element should
|
514
|
+
// be in order to change the focus
|
515
|
+
let nextEl;
|
516
|
+
// If hitting arrow down or arrow right, move to the next radio
|
517
|
+
// If we're on the last radio, move to the first radio
|
518
|
+
if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
|
519
|
+
nextEl = (index === radios.length - 1)
|
520
|
+
? radios[0]
|
521
|
+
: radios[index + 1];
|
522
|
+
}
|
523
|
+
// If hitting arrow up or arrow left, move to the previous radio
|
524
|
+
// If we're on the first radio, move to the last radio
|
525
|
+
if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
|
526
|
+
nextEl = (index === 0)
|
527
|
+
? radios[radios.length - 1]
|
528
|
+
: radios[index - 1];
|
529
|
+
}
|
530
|
+
if (nextEl && radios.includes(nextEl)) {
|
531
|
+
const nextProcessed = this.processedInputs.find(input => input.id === (nextEl === null || nextEl === void 0 ? void 0 : nextEl.id));
|
532
|
+
if (nextProcessed) {
|
533
|
+
this.rbClick(nextProcessed);
|
534
|
+
nextEl.focus();
|
535
|
+
}
|
536
|
+
}
|
537
|
+
}
|
538
|
+
buttonsChanged() {
|
539
|
+
const buttons = this.buttons;
|
540
|
+
this.processedButtons = buttons.map(btn => {
|
541
|
+
return (typeof btn === 'string')
|
542
|
+
? { text: btn, role: btn.toLowerCase() === 'cancel' ? 'cancel' : undefined }
|
543
|
+
: btn;
|
544
|
+
});
|
545
|
+
}
|
546
|
+
inputsChanged() {
|
547
|
+
const inputs = this.inputs;
|
548
|
+
// Get the first input that is not disabled and the checked one
|
549
|
+
// If an enabled checked input exists, set it to be the focusable input
|
550
|
+
// otherwise we default to focus the first input
|
551
|
+
// This will only be used when the input is type radio
|
552
|
+
const first = inputs.find(input => !input.disabled);
|
553
|
+
const checked = inputs.find(input => input.checked && !input.disabled);
|
554
|
+
const focusable = checked || first;
|
555
|
+
// An alert can be created with several different inputs. Radios,
|
556
|
+
// checkboxes and inputs are all accepted, but they cannot be mixed.
|
557
|
+
const inputTypes = new Set(inputs.map(i => i.type));
|
558
|
+
if (inputTypes.has('checkbox') && inputTypes.has('radio')) {
|
559
|
+
console.warn(`Alert cannot mix input types: ${(Array.from(inputTypes.values()).join('/'))}. Please see alert docs for more info.`);
|
560
|
+
}
|
561
|
+
this.inputType = inputTypes.values().next().value;
|
562
|
+
this.processedInputs = inputs.map((i, index) => ({
|
563
|
+
type: i.type || 'text',
|
564
|
+
name: i.name || `${index}`,
|
565
|
+
placeholder: i.placeholder || '',
|
566
|
+
value: i.value,
|
567
|
+
label: i.label,
|
568
|
+
checked: !!i.checked,
|
569
|
+
disabled: !!i.disabled,
|
570
|
+
id: i.id || `alert-input-${this.overlayIndex}-${index}`,
|
571
|
+
handler: i.handler,
|
572
|
+
min: i.min,
|
573
|
+
max: i.max,
|
574
|
+
cssClass: i.cssClass || '',
|
575
|
+
attributes: i.attributes || {},
|
576
|
+
tabindex: (i.type === 'radio' && i !== focusable) ? -1 : 0
|
577
|
+
}));
|
578
|
+
}
|
579
|
+
connectedCallback() {
|
580
|
+
prepareOverlay(this.el);
|
581
|
+
}
|
582
|
+
componentWillLoad() {
|
583
|
+
this.inputsChanged();
|
584
|
+
this.buttonsChanged();
|
585
|
+
}
|
586
|
+
disconnectedCallback() {
|
587
|
+
if (this.gesture) {
|
588
|
+
this.gesture.destroy();
|
589
|
+
this.gesture = undefined;
|
590
|
+
}
|
591
|
+
}
|
592
|
+
componentDidLoad() {
|
593
|
+
/**
|
594
|
+
* Do not create gesture if:
|
595
|
+
* 1. A gesture already exists
|
596
|
+
* 2. App is running in MD mode
|
597
|
+
* 3. A wrapper ref does not exist
|
598
|
+
*/
|
599
|
+
if (this.gesture || getIonMode(this) === 'md' || !this.wrapperEl) {
|
600
|
+
return;
|
601
|
+
}
|
602
|
+
this.gesture = createButtonActiveGesture(this.wrapperEl, (refEl) => refEl.classList.contains('alert-button'));
|
603
|
+
this.gesture.enable(true);
|
604
|
+
}
|
605
|
+
/**
|
606
|
+
* Present the alert overlay after it has been created.
|
607
|
+
*/
|
608
|
+
present() {
|
609
|
+
return present(this, 'alertEnter', iosEnterAnimation$1, mdEnterAnimation$1);
|
610
|
+
}
|
611
|
+
/**
|
612
|
+
* Dismiss the alert overlay after it has been presented.
|
613
|
+
*
|
614
|
+
* @param data Any data to emit in the dismiss events.
|
615
|
+
* @param role The role of the element that is dismissing the alert.
|
616
|
+
* This can be useful in a button handler for determining which button was
|
617
|
+
* clicked to dismiss the alert.
|
618
|
+
* Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
|
619
|
+
*/
|
620
|
+
dismiss(data, role) {
|
621
|
+
return dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$1, mdLeaveAnimation$1);
|
622
|
+
}
|
623
|
+
/**
|
624
|
+
* Returns a promise that resolves when the alert did dismiss.
|
625
|
+
*/
|
626
|
+
onDidDismiss() {
|
627
|
+
return eventMethod(this.el, 'ionAlertDidDismiss');
|
628
|
+
}
|
629
|
+
/**
|
630
|
+
* Returns a promise that resolves when the alert will dismiss.
|
631
|
+
*/
|
632
|
+
onWillDismiss() {
|
633
|
+
return eventMethod(this.el, 'ionAlertWillDismiss');
|
634
|
+
}
|
635
|
+
rbClick(selectedInput) {
|
636
|
+
for (const input of this.processedInputs) {
|
637
|
+
input.checked = input === selectedInput;
|
638
|
+
input.tabindex = input === selectedInput ? 0 : -1;
|
639
|
+
}
|
640
|
+
this.activeId = selectedInput.id;
|
641
|
+
safeCall(selectedInput.handler, selectedInput);
|
642
|
+
forceUpdate(this);
|
643
|
+
}
|
644
|
+
cbClick(selectedInput) {
|
645
|
+
selectedInput.checked = !selectedInput.checked;
|
646
|
+
safeCall(selectedInput.handler, selectedInput);
|
647
|
+
forceUpdate(this);
|
648
|
+
}
|
649
|
+
buttonClick(button) {
|
650
|
+
const role = button.role;
|
651
|
+
const values = this.getValues();
|
652
|
+
if (isCancel(role)) {
|
653
|
+
return this.dismiss({ values }, role);
|
654
|
+
}
|
655
|
+
const returnData = this.callButtonHandler(button, values);
|
656
|
+
if (returnData !== false) {
|
657
|
+
return this.dismiss(Object.assign({ values }, returnData), button.role);
|
658
|
+
}
|
659
|
+
return Promise.resolve(false);
|
660
|
+
}
|
661
|
+
callButtonHandler(button, data) {
|
662
|
+
if (button && button.handler) {
|
663
|
+
// a handler has been provided, execute it
|
664
|
+
// pass the handler the values from the inputs
|
665
|
+
const returnData = safeCall(button.handler, data);
|
666
|
+
if (returnData === false) {
|
667
|
+
// if the return value of the handler is false then do not dismiss
|
668
|
+
return false;
|
669
|
+
}
|
670
|
+
if (typeof returnData === 'object') {
|
671
|
+
return returnData;
|
672
|
+
}
|
673
|
+
}
|
674
|
+
return {};
|
675
|
+
}
|
676
|
+
getValues() {
|
677
|
+
if (this.processedInputs.length === 0) {
|
678
|
+
// this is an alert without any options/inputs at all
|
679
|
+
return undefined;
|
680
|
+
}
|
681
|
+
if (this.inputType === 'radio') {
|
682
|
+
// this is an alert with radio buttons (single value select)
|
683
|
+
// return the one value which is checked, otherwise undefined
|
684
|
+
const checkedInput = this.processedInputs.find(i => !!i.checked);
|
685
|
+
return checkedInput ? checkedInput.value : undefined;
|
686
|
+
}
|
687
|
+
if (this.inputType === 'checkbox') {
|
688
|
+
// this is an alert with checkboxes (multiple value select)
|
689
|
+
// return an array of all the checked values
|
690
|
+
return this.processedInputs.filter(i => i.checked).map(i => i.value);
|
691
|
+
}
|
692
|
+
// this is an alert with text inputs
|
693
|
+
// return an object of all the values with the input name as the key
|
694
|
+
const values = {};
|
695
|
+
this.processedInputs.forEach(i => {
|
696
|
+
values[i.name] = i.value || '';
|
697
|
+
});
|
698
|
+
return values;
|
699
|
+
}
|
700
|
+
renderAlertInputs() {
|
701
|
+
switch (this.inputType) {
|
702
|
+
case 'checkbox': return this.renderCheckbox();
|
703
|
+
case 'radio': return this.renderRadio();
|
704
|
+
default: return this.renderInput();
|
705
|
+
}
|
706
|
+
}
|
707
|
+
renderCheckbox() {
|
708
|
+
const inputs = this.processedInputs;
|
709
|
+
const mode = getIonMode(this);
|
710
|
+
if (inputs.length === 0) {
|
711
|
+
return null;
|
712
|
+
}
|
713
|
+
return (h("div", { class: "alert-checkbox-group" }, inputs.map(i => (h("button", { type: "button", onClick: () => this.cbClick(i), "aria-checked": `${i.checked}`, id: i.id, disabled: i.disabled, tabIndex: i.tabindex, role: "checkbox", class: Object.assign(Object.assign({}, getClassMap(i.cssClass)), { 'alert-tappable': true, 'alert-checkbox': true, 'alert-checkbox-button': true, 'ion-focusable': true, 'alert-checkbox-button-disabled': i.disabled || false }) }, h("div", { class: "alert-button-inner" }, h("div", { class: "alert-checkbox-icon" }, h("div", { class: "alert-checkbox-inner" })), h("div", { class: "alert-checkbox-label" }, i.label)), mode === 'md' && h("ion-ripple-effect", null))))));
|
714
|
+
}
|
715
|
+
renderRadio() {
|
716
|
+
const inputs = this.processedInputs;
|
717
|
+
if (inputs.length === 0) {
|
718
|
+
return null;
|
719
|
+
}
|
720
|
+
return (h("div", { class: "alert-radio-group", role: "radiogroup", "aria-activedescendant": this.activeId }, inputs.map(i => (h("button", { type: "button", onClick: () => this.rbClick(i), "aria-checked": `${i.checked}`, disabled: i.disabled, id: i.id, tabIndex: i.tabindex, class: Object.assign(Object.assign({}, getClassMap(i.cssClass)), { 'alert-radio-button': true, 'alert-tappable': true, 'alert-radio': true, 'ion-focusable': true, 'alert-radio-button-disabled': i.disabled || false }), role: "radio" }, h("div", { class: "alert-button-inner" }, h("div", { class: "alert-radio-icon" }, h("div", { class: "alert-radio-inner" })), h("div", { class: "alert-radio-label" }, i.label)))))));
|
721
|
+
}
|
722
|
+
renderInput() {
|
723
|
+
const inputs = this.processedInputs;
|
724
|
+
if (inputs.length === 0) {
|
725
|
+
return null;
|
726
|
+
}
|
727
|
+
return (h("div", { class: "alert-input-group" }, inputs.map(i => {
|
728
|
+
var _a, _b, _c, _d;
|
729
|
+
if (i.type === 'textarea') {
|
730
|
+
return (h("div", { class: "alert-input-wrapper" }, h("textarea", Object.assign({ placeholder: i.placeholder, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_b = (_a = i.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : i.disabled, class: inputClass(i), onInput: e => {
|
731
|
+
var _a;
|
732
|
+
i.value = e.target.value;
|
733
|
+
if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
|
734
|
+
i.attributes.onInput(e);
|
735
|
+
}
|
736
|
+
} }))));
|
737
|
+
}
|
738
|
+
else {
|
739
|
+
return (h("div", { class: "alert-input-wrapper" }, h("input", Object.assign({ placeholder: i.placeholder, type: i.type, min: i.min, max: i.max, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_d = (_c = i.attributes) === null || _c === void 0 ? void 0 : _c.disabled) !== null && _d !== void 0 ? _d : i.disabled, class: inputClass(i), onInput: e => {
|
740
|
+
var _a;
|
741
|
+
i.value = e.target.value;
|
742
|
+
if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
|
743
|
+
i.attributes.onInput(e);
|
744
|
+
}
|
745
|
+
} }))));
|
746
|
+
}
|
747
|
+
})));
|
748
|
+
}
|
749
|
+
renderAlertButtons() {
|
750
|
+
const buttons = this.processedButtons;
|
751
|
+
const mode = getIonMode(this);
|
752
|
+
const alertButtonGroupClass = {
|
753
|
+
'alert-button-group': true,
|
754
|
+
'alert-button-group-vertical': buttons.length > 2
|
755
|
+
};
|
756
|
+
return (h("div", { class: alertButtonGroupClass }, buttons.map(button => h("button", { type: "button", id: button.id, class: buttonClass(button), tabIndex: 0, onClick: () => this.buttonClick(button) }, h("span", { class: "alert-button-inner" }, button.text), mode === 'md' && h("ion-ripple-effect", null)))));
|
757
|
+
}
|
758
|
+
render() {
|
759
|
+
const { overlayIndex, header, subHeader, htmlAttributes } = this;
|
760
|
+
const mode = getIonMode(this);
|
761
|
+
const hdrId = `alert-${overlayIndex}-hdr`;
|
762
|
+
const subHdrId = `alert-${overlayIndex}-sub-hdr`;
|
763
|
+
const msgId = `alert-${overlayIndex}-msg`;
|
764
|
+
const role = this.inputs.length > 0 || this.buttons.length > 0 ? 'alertdialog' : 'alert';
|
765
|
+
return (h(Host, Object.assign({ role: role, "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
|
766
|
+
zIndex: `${20000 + overlayIndex}`,
|
767
|
+
}, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { tappable: this.backdropDismiss }), h("div", { tabindex: "0" }), h("div", { class: "alert-wrapper ion-overlay-wrapper", ref: el => this.wrapperEl = el }, h("div", { class: "alert-head" }, header && h("h2", { id: hdrId, class: "alert-title" }, header), subHeader && h("h2", { id: subHdrId, class: "alert-sub-title" }, subHeader)), h("div", { id: msgId, class: "alert-message", innerHTML: sanitizeDOMString(this.message) }), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { tabindex: "0" })));
|
768
|
+
}
|
769
|
+
get el() { return getElement(this); }
|
770
|
+
static get watchers() { return {
|
771
|
+
"buttons": ["buttonsChanged"],
|
772
|
+
"inputs": ["inputsChanged"]
|
773
|
+
}; }
|
774
|
+
};
|
775
|
+
const inputClass = (input) => {
|
776
|
+
var _a, _b, _c;
|
777
|
+
return Object.assign(Object.assign({ 'alert-input': true, 'alert-input-disabled': ((_b = (_a = input.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : input.disabled) || false }, getClassMap(input.cssClass)), getClassMap(input.attributes ? (_c = input.attributes.class) === null || _c === void 0 ? void 0 : _c.toString() : ''));
|
778
|
+
};
|
779
|
+
const buttonClass = (button) => {
|
780
|
+
return Object.assign({ 'alert-button': true, 'ion-focusable': true, 'ion-activatable': true, [`alert-button-role-${button.role}`]: button.role !== undefined }, getClassMap(button.cssClass));
|
781
|
+
};
|
782
|
+
Alert.style = {
|
783
|
+
ios: alertIosCss,
|
784
|
+
md: alertMdCss
|
785
|
+
};
|
786
|
+
|
787
|
+
/*!
|
788
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
789
|
+
*/
|
790
|
+
/**
|
791
|
+
* Returns the dimensions of the popover
|
792
|
+
* arrow on `ios` mode. If arrow is disabled
|
793
|
+
* returns (0, 0).
|
794
|
+
*/
|
795
|
+
const getArrowDimensions = (arrowEl) => {
|
796
|
+
if (!arrowEl) {
|
797
|
+
return { arrowWidth: 0, arrowHeight: 0 };
|
798
|
+
}
|
799
|
+
const { width, height } = arrowEl.getBoundingClientRect();
|
800
|
+
return { arrowWidth: width, arrowHeight: height };
|
801
|
+
};
|
802
|
+
/**
|
803
|
+
* Returns the recommended dimensions of the popover
|
804
|
+
* that takes into account whether or not the width
|
805
|
+
* should match the trigger width.
|
806
|
+
*/
|
807
|
+
const getPopoverDimensions = (size, contentEl, triggerEl) => {
|
808
|
+
const contentDimentions = contentEl.getBoundingClientRect();
|
809
|
+
const contentHeight = contentDimentions.height;
|
810
|
+
let contentWidth = contentDimentions.width;
|
811
|
+
if (size === 'cover' && triggerEl) {
|
812
|
+
const triggerDimensions = triggerEl.getBoundingClientRect();
|
813
|
+
contentWidth = triggerDimensions.width;
|
814
|
+
}
|
815
|
+
return {
|
816
|
+
contentWidth,
|
817
|
+
contentHeight
|
818
|
+
};
|
819
|
+
};
|
820
|
+
const configureDismissInteraction = (triggerEl, triggerAction, popoverEl, parentPopoverEl) => {
|
821
|
+
let dismissCallbacks = [];
|
822
|
+
const root = getElementRoot(parentPopoverEl);
|
823
|
+
const parentContentEl = root.querySelector('.popover-content');
|
824
|
+
switch (triggerAction) {
|
825
|
+
case 'hover':
|
826
|
+
dismissCallbacks = [
|
827
|
+
{
|
828
|
+
/**
|
829
|
+
* Do not use mouseover here
|
830
|
+
* as this will causes the event to
|
831
|
+
* be dispatched on each underlying
|
832
|
+
* element rather than on the popover
|
833
|
+
* content as a whole.
|
834
|
+
*/
|
835
|
+
eventName: 'mouseenter',
|
836
|
+
callback: (ev) => {
|
837
|
+
/**
|
838
|
+
* Do not dismiss the popover is we
|
839
|
+
* are hovering over its trigger.
|
840
|
+
* This would be easier if we used mouseover
|
841
|
+
* but this would cause the event to be dispatched
|
842
|
+
* more often than we would like, potentially
|
843
|
+
* causing performance issues.
|
844
|
+
*/
|
845
|
+
const element = document.elementFromPoint(ev.clientX, ev.clientY);
|
846
|
+
if (element === triggerEl) {
|
847
|
+
return;
|
848
|
+
}
|
849
|
+
popoverEl.dismiss(undefined, undefined, false);
|
850
|
+
}
|
851
|
+
}
|
852
|
+
];
|
853
|
+
break;
|
854
|
+
case 'context-menu':
|
855
|
+
case 'click':
|
856
|
+
default:
|
857
|
+
dismissCallbacks = [
|
858
|
+
{
|
859
|
+
eventName: 'click',
|
860
|
+
callback: (ev) => {
|
861
|
+
/**
|
862
|
+
* Do not dismiss the popover is we
|
863
|
+
* are hovering over its trigger.
|
864
|
+
*/
|
865
|
+
const target = ev.target;
|
866
|
+
const closestTrigger = target.closest('[data-ion-popover-trigger]');
|
867
|
+
if (closestTrigger === triggerEl) {
|
868
|
+
/**
|
869
|
+
* stopPropagation here so if the
|
870
|
+
* popover has dismissOnSelect="true"
|
871
|
+
* the popover does not dismiss since
|
872
|
+
* we just clicked a trigger element.
|
873
|
+
*/
|
874
|
+
ev.stopPropagation();
|
875
|
+
return;
|
876
|
+
}
|
877
|
+
popoverEl.dismiss(undefined, undefined, false);
|
878
|
+
}
|
879
|
+
}
|
880
|
+
];
|
881
|
+
break;
|
882
|
+
}
|
883
|
+
dismissCallbacks.forEach(({ eventName, callback }) => parentContentEl.addEventListener(eventName, callback));
|
884
|
+
return () => {
|
885
|
+
dismissCallbacks.forEach(({ eventName, callback }) => parentContentEl.removeEventListener(eventName, callback));
|
886
|
+
};
|
887
|
+
};
|
888
|
+
/**
|
889
|
+
* Configures the triggerEl to respond
|
890
|
+
* to user interaction based upon the triggerAction
|
891
|
+
* prop that devs have defined.
|
892
|
+
*/
|
893
|
+
const configureTriggerInteraction = (triggerEl, triggerAction, popoverEl) => {
|
894
|
+
let triggerCallbacks = [];
|
895
|
+
/**
|
896
|
+
* Based upon the kind of trigger interaction
|
897
|
+
* the user wants, we setup the correct event
|
898
|
+
* listeners.
|
899
|
+
*/
|
900
|
+
switch (triggerAction) {
|
901
|
+
case 'hover':
|
902
|
+
let hoverTimeout;
|
903
|
+
triggerCallbacks = [
|
904
|
+
{
|
905
|
+
eventName: 'mouseenter',
|
906
|
+
callback: async (ev) => {
|
907
|
+
ev.stopPropagation();
|
908
|
+
if (hoverTimeout) {
|
909
|
+
clearTimeout(hoverTimeout);
|
910
|
+
}
|
911
|
+
/**
|
912
|
+
* Hovering over a trigger should not
|
913
|
+
* immediately open the next popover.
|
914
|
+
*/
|
915
|
+
hoverTimeout = setTimeout(() => {
|
916
|
+
raf(() => {
|
917
|
+
popoverEl.presentFromTrigger(ev);
|
918
|
+
hoverTimeout = undefined;
|
919
|
+
});
|
920
|
+
}, 100);
|
921
|
+
}
|
922
|
+
},
|
923
|
+
{
|
924
|
+
eventName: 'mouseleave',
|
925
|
+
callback: (ev) => {
|
926
|
+
if (hoverTimeout) {
|
927
|
+
clearTimeout(hoverTimeout);
|
928
|
+
}
|
929
|
+
/**
|
930
|
+
* If mouse is over another popover
|
931
|
+
* that is not this popover then we should
|
932
|
+
* close this popover.
|
933
|
+
*/
|
934
|
+
const target = ev.relatedTarget;
|
935
|
+
if (!target) {
|
936
|
+
return;
|
937
|
+
}
|
938
|
+
if (target.closest('ion-popover') !== popoverEl) {
|
939
|
+
popoverEl.dismiss(undefined, undefined, false);
|
940
|
+
}
|
941
|
+
}
|
942
|
+
},
|
943
|
+
{
|
944
|
+
/**
|
945
|
+
* stopPropagation here prevents the popover
|
946
|
+
* from dismissing when dismiss-on-select="true".
|
947
|
+
*/
|
948
|
+
eventName: 'click',
|
949
|
+
callback: (ev) => ev.stopPropagation()
|
950
|
+
},
|
951
|
+
{
|
952
|
+
eventName: 'ionPopoverActivateTrigger',
|
953
|
+
callback: (ev) => popoverEl.presentFromTrigger(ev, true)
|
954
|
+
}
|
955
|
+
];
|
956
|
+
break;
|
957
|
+
case 'context-menu':
|
958
|
+
triggerCallbacks = [
|
959
|
+
{
|
960
|
+
eventName: 'contextmenu',
|
961
|
+
callback: (ev) => {
|
962
|
+
/**
|
963
|
+
* Prevents the platform context
|
964
|
+
* menu from appearing.
|
965
|
+
*/
|
966
|
+
ev.preventDefault();
|
967
|
+
popoverEl.presentFromTrigger(ev);
|
968
|
+
}
|
969
|
+
},
|
970
|
+
{
|
971
|
+
eventName: 'click',
|
972
|
+
callback: (ev) => ev.stopPropagation()
|
973
|
+
},
|
974
|
+
{
|
975
|
+
eventName: 'ionPopoverActivateTrigger',
|
976
|
+
callback: (ev) => popoverEl.presentFromTrigger(ev, true)
|
977
|
+
}
|
978
|
+
];
|
979
|
+
break;
|
980
|
+
case 'click':
|
981
|
+
default:
|
982
|
+
triggerCallbacks = [
|
983
|
+
{
|
984
|
+
/**
|
985
|
+
* Do not do a stopPropagation() here
|
986
|
+
* because if you had two click triggers
|
987
|
+
* then clicking the first trigger and then
|
988
|
+
* clicking the second trigger would not cause
|
989
|
+
* the first popover to dismiss.
|
990
|
+
*/
|
991
|
+
eventName: 'click',
|
992
|
+
callback: (ev) => popoverEl.presentFromTrigger(ev)
|
993
|
+
},
|
994
|
+
{
|
995
|
+
eventName: 'ionPopoverActivateTrigger',
|
996
|
+
callback: (ev) => popoverEl.presentFromTrigger(ev, true)
|
997
|
+
}
|
998
|
+
];
|
999
|
+
break;
|
1000
|
+
}
|
1001
|
+
triggerCallbacks.forEach(({ eventName, callback }) => triggerEl.addEventListener(eventName, callback));
|
1002
|
+
triggerEl.setAttribute('data-ion-popover-trigger', 'true');
|
1003
|
+
return () => {
|
1004
|
+
triggerCallbacks.forEach(({ eventName, callback }) => triggerEl.removeEventListener(eventName, callback));
|
1005
|
+
triggerEl.removeAttribute('data-ion-popover-trigger');
|
1006
|
+
};
|
1007
|
+
};
|
1008
|
+
/**
|
1009
|
+
* Returns the index of an ion-item in an array of ion-items.
|
1010
|
+
*/
|
1011
|
+
const getIndexOfItem = (items, item) => {
|
1012
|
+
if (!item || item.tagName !== 'ION-ITEM') {
|
1013
|
+
return -1;
|
1014
|
+
}
|
1015
|
+
return items.findIndex(el => el === item);
|
1016
|
+
};
|
1017
|
+
/**
|
1018
|
+
* Given an array of elements and a currently focused ion-item
|
1019
|
+
* returns the next ion-item relative to the focused one or
|
1020
|
+
* undefined.
|
1021
|
+
*/
|
1022
|
+
const getNextItem = (items, currentItem) => {
|
1023
|
+
const currentItemIndex = getIndexOfItem(items, currentItem);
|
1024
|
+
return items[currentItemIndex + 1];
|
1025
|
+
};
|
1026
|
+
/**
|
1027
|
+
* Given an array of elements and a currently focused ion-item
|
1028
|
+
* returns the previous ion-item relative to the focused one or
|
1029
|
+
* undefined.
|
1030
|
+
*/
|
1031
|
+
const getPrevItem = (items, currentItem) => {
|
1032
|
+
const currentItemIndex = getIndexOfItem(items, currentItem);
|
1033
|
+
return items[currentItemIndex - 1];
|
1034
|
+
};
|
1035
|
+
/** Focus the internal button of the ion-item */
|
1036
|
+
const focusItem = (item) => {
|
1037
|
+
const root = getElementRoot(item);
|
1038
|
+
const button = root.querySelector('button');
|
1039
|
+
if (button) {
|
1040
|
+
raf(() => button.focus());
|
1041
|
+
}
|
1042
|
+
};
|
1043
|
+
/**
|
1044
|
+
* Returns `true` if `el` has been designated
|
1045
|
+
* as a trigger element for an ion-popover.
|
1046
|
+
*/
|
1047
|
+
const isTriggerElement = (el) => el.hasAttribute('data-ion-popover-trigger');
|
1048
|
+
const configureKeyboardInteraction = (popoverEl) => {
|
1049
|
+
const callback = async (ev) => {
|
1050
|
+
const activeElement = document.activeElement;
|
1051
|
+
let items = [];
|
1052
|
+
/**
|
1053
|
+
* Complex selectors with :not() are :not supported
|
1054
|
+
* in older versions of Chromium so we need to do a
|
1055
|
+
* try/catch here so errors are not thrown.
|
1056
|
+
*/
|
1057
|
+
try {
|
1058
|
+
/**
|
1059
|
+
* Select all ion-items that are not children of child popovers.
|
1060
|
+
* i.e. only select ion-item elements that are part of this popover
|
1061
|
+
*/
|
1062
|
+
items = Array.from(popoverEl.querySelectorAll('ion-item:not(ion-popover ion-popover *):not([disabled])'));
|
1063
|
+
/* tslint:disable-next-line */
|
1064
|
+
}
|
1065
|
+
catch (_a) { }
|
1066
|
+
switch (ev.key) {
|
1067
|
+
/**
|
1068
|
+
* If we are in a child popover
|
1069
|
+
* then pressing the left arrow key
|
1070
|
+
* should close this popover and move
|
1071
|
+
* focus to the popover that presented
|
1072
|
+
* this one.
|
1073
|
+
*/
|
1074
|
+
case 'ArrowLeft':
|
1075
|
+
const parentPopover = await popoverEl.getParentPopover();
|
1076
|
+
if (parentPopover) {
|
1077
|
+
popoverEl.dismiss(undefined, undefined, false);
|
1078
|
+
}
|
1079
|
+
break;
|
1080
|
+
/**
|
1081
|
+
* ArrowDown should move focus to the next focusable ion-item.
|
1082
|
+
*/
|
1083
|
+
case 'ArrowDown':
|
1084
|
+
// Disable movement/scroll with keyboard
|
1085
|
+
ev.preventDefault();
|
1086
|
+
const nextItem = getNextItem(items, activeElement);
|
1087
|
+
// tslint:disable-next-line:strict-type-predicates
|
1088
|
+
if (nextItem !== undefined) {
|
1089
|
+
focusItem(nextItem);
|
1090
|
+
}
|
1091
|
+
break;
|
1092
|
+
/**
|
1093
|
+
* ArrowUp should move focus to the previous focusable ion-item.
|
1094
|
+
*/
|
1095
|
+
case 'ArrowUp':
|
1096
|
+
// Disable movement/scroll with keyboard
|
1097
|
+
ev.preventDefault();
|
1098
|
+
const prevItem = getPrevItem(items, activeElement);
|
1099
|
+
// tslint:disable-next-line:strict-type-predicates
|
1100
|
+
if (prevItem !== undefined) {
|
1101
|
+
focusItem(prevItem);
|
1102
|
+
}
|
1103
|
+
break;
|
1104
|
+
/**
|
1105
|
+
* Home should move focus to the first focusable ion-item.
|
1106
|
+
*/
|
1107
|
+
case 'Home':
|
1108
|
+
ev.preventDefault();
|
1109
|
+
const firstItem = items[0];
|
1110
|
+
// tslint:disable-next-line:strict-type-predicates
|
1111
|
+
if (firstItem !== undefined) {
|
1112
|
+
focusItem(firstItem);
|
1113
|
+
}
|
1114
|
+
break;
|
1115
|
+
/**
|
1116
|
+
* End should move focus to the last focusable ion-item.
|
1117
|
+
*/
|
1118
|
+
case 'End':
|
1119
|
+
ev.preventDefault();
|
1120
|
+
const lastItem = items[items.length - 1];
|
1121
|
+
// tslint:disable-next-line:strict-type-predicates
|
1122
|
+
if (lastItem !== undefined) {
|
1123
|
+
focusItem(lastItem);
|
1124
|
+
}
|
1125
|
+
break;
|
1126
|
+
/**
|
1127
|
+
* ArrowRight, Spacebar, or Enter should activate
|
1128
|
+
* the currently focused trigger item to open a
|
1129
|
+
* popover if the element is a trigger item.
|
1130
|
+
*/
|
1131
|
+
case 'ArrowRight':
|
1132
|
+
case ' ':
|
1133
|
+
case 'Enter':
|
1134
|
+
if (activeElement && isTriggerElement(activeElement)) {
|
1135
|
+
const rightEvent = new CustomEvent('ionPopoverActivateTrigger');
|
1136
|
+
activeElement.dispatchEvent(rightEvent);
|
1137
|
+
}
|
1138
|
+
break;
|
1139
|
+
}
|
1140
|
+
};
|
1141
|
+
popoverEl.addEventListener('keydown', callback);
|
1142
|
+
return () => popoverEl.removeEventListener('keydown', callback);
|
1143
|
+
};
|
1144
|
+
/**
|
1145
|
+
* Positions a popover by taking into account
|
1146
|
+
* the reference point, preferred side, alignment
|
1147
|
+
* and viewport dimensions.
|
1148
|
+
*/
|
1149
|
+
const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, triggerEl, event) => {
|
1150
|
+
var _a;
|
1151
|
+
let referenceCoordinates = {
|
1152
|
+
top: 0,
|
1153
|
+
left: 0,
|
1154
|
+
width: 0,
|
1155
|
+
height: 0
|
1156
|
+
};
|
1157
|
+
/**
|
1158
|
+
* Calculate position relative to the
|
1159
|
+
* x-y coordinates in the event that
|
1160
|
+
* was passed in
|
1161
|
+
*/
|
1162
|
+
switch (reference) {
|
1163
|
+
case 'event':
|
1164
|
+
if (!event) {
|
1165
|
+
return defaultPosition;
|
1166
|
+
}
|
1167
|
+
const mouseEv = event;
|
1168
|
+
referenceCoordinates = {
|
1169
|
+
top: mouseEv.clientY,
|
1170
|
+
left: mouseEv.clientX,
|
1171
|
+
width: 1,
|
1172
|
+
height: 1
|
1173
|
+
};
|
1174
|
+
break;
|
1175
|
+
/**
|
1176
|
+
* Calculate position relative to the bounding
|
1177
|
+
* box on either the trigger element
|
1178
|
+
* specified via the `trigger` prop or
|
1179
|
+
* the target specified on the event
|
1180
|
+
* that was passed in.
|
1181
|
+
*/
|
1182
|
+
case 'trigger':
|
1183
|
+
default:
|
1184
|
+
const customEv = event;
|
1185
|
+
/**
|
1186
|
+
* ionShadowTarget is used when we need to align the
|
1187
|
+
* popover with an element inside of the shadow root
|
1188
|
+
* of an Ionic component. Ex: Presenting a popover
|
1189
|
+
* by clicking on the collapsed indicator inside
|
1190
|
+
* of `ion-breadcrumb` and centering it relative
|
1191
|
+
* to the indicator rather than `ion-breadcrumb`
|
1192
|
+
* as a whole.
|
1193
|
+
*/
|
1194
|
+
const actualTriggerEl = (triggerEl || ((_a = customEv === null || customEv === void 0 ? void 0 : customEv.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (customEv === null || customEv === void 0 ? void 0 : customEv.target));
|
1195
|
+
if (!actualTriggerEl) {
|
1196
|
+
return defaultPosition;
|
1197
|
+
}
|
1198
|
+
const triggerBoundingBox = actualTriggerEl.getBoundingClientRect();
|
1199
|
+
referenceCoordinates = {
|
1200
|
+
top: triggerBoundingBox.top,
|
1201
|
+
left: triggerBoundingBox.left,
|
1202
|
+
width: triggerBoundingBox.width,
|
1203
|
+
height: triggerBoundingBox.height
|
1204
|
+
};
|
1205
|
+
break;
|
1206
|
+
}
|
1207
|
+
/**
|
1208
|
+
* Get top/left offset that would allow
|
1209
|
+
* popover to be positioned on the
|
1210
|
+
* preferred side of the reference.
|
1211
|
+
*/
|
1212
|
+
const coordinates = calculatePopoverSide(side, referenceCoordinates, contentWidth, contentHeight, arrowWidth, arrowHeight, isRTL);
|
1213
|
+
/**
|
1214
|
+
* Get the top/left adjustments that
|
1215
|
+
* would allow the popover content
|
1216
|
+
* to have the correct alignment.
|
1217
|
+
*/
|
1218
|
+
const alignedCoordinates = calculatePopoverAlign(align, side, referenceCoordinates, contentWidth, contentHeight);
|
1219
|
+
const top = coordinates.top + alignedCoordinates.top;
|
1220
|
+
const left = coordinates.left + alignedCoordinates.left;
|
1221
|
+
const { arrowTop, arrowLeft } = calculateArrowPosition(side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL);
|
1222
|
+
const { originX, originY } = calculatePopoverOrigin(side, align, isRTL);
|
1223
|
+
return { top, left, referenceCoordinates, arrowTop, arrowLeft, originX, originY };
|
1224
|
+
};
|
1225
|
+
/**
|
1226
|
+
* Determines the transform-origin
|
1227
|
+
* of the popover animation so that it
|
1228
|
+
* is in line with what the side and alignment
|
1229
|
+
* prop values are. Currently only used
|
1230
|
+
* with the MD animation.
|
1231
|
+
*/
|
1232
|
+
const calculatePopoverOrigin = (side, align, isRTL) => {
|
1233
|
+
switch (side) {
|
1234
|
+
case 'top':
|
1235
|
+
return { originX: getOriginXAlignment(align), originY: 'bottom' };
|
1236
|
+
case 'bottom':
|
1237
|
+
return { originX: getOriginXAlignment(align), originY: 'top' };
|
1238
|
+
case 'left':
|
1239
|
+
return { originX: 'right', originY: getOriginYAlignment(align) };
|
1240
|
+
case 'right':
|
1241
|
+
return { originX: 'left', originY: getOriginYAlignment(align) };
|
1242
|
+
case 'start':
|
1243
|
+
return { originX: (isRTL) ? 'left' : 'right', originY: getOriginYAlignment(align) };
|
1244
|
+
case 'end':
|
1245
|
+
return { originX: (isRTL) ? 'right' : 'left', originY: getOriginYAlignment(align) };
|
1246
|
+
}
|
1247
|
+
};
|
1248
|
+
const getOriginXAlignment = (align) => {
|
1249
|
+
switch (align) {
|
1250
|
+
case 'start':
|
1251
|
+
return 'left';
|
1252
|
+
case 'center':
|
1253
|
+
return 'center';
|
1254
|
+
case 'end':
|
1255
|
+
return 'right';
|
1256
|
+
}
|
1257
|
+
};
|
1258
|
+
const getOriginYAlignment = (align) => {
|
1259
|
+
switch (align) {
|
1260
|
+
case 'start':
|
1261
|
+
return 'top';
|
1262
|
+
case 'center':
|
1263
|
+
return 'center';
|
1264
|
+
case 'end':
|
1265
|
+
return 'bottom';
|
1266
|
+
}
|
1267
|
+
};
|
1268
|
+
/**
|
1269
|
+
* Calculates where the arrow positioning
|
1270
|
+
* should be relative to the popover content.
|
1271
|
+
*/
|
1272
|
+
const calculateArrowPosition = (side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL) => {
|
1273
|
+
/**
|
1274
|
+
* Note: When side is left, right, start, or end, the arrow is
|
1275
|
+
* been rotated using a `transform`, so to move the arrow up or down
|
1276
|
+
* by its dimension, you need to use `arrowWidth`.
|
1277
|
+
*/
|
1278
|
+
const leftPosition = { arrowTop: top + (contentHeight / 2) - (arrowWidth / 2), arrowLeft: left + contentWidth - (arrowWidth / 2) };
|
1279
|
+
/**
|
1280
|
+
* Move the arrow to the left by arrowWidth and then
|
1281
|
+
* again by half of its width because we have rotated
|
1282
|
+
* the arrow using a transform.
|
1283
|
+
*/
|
1284
|
+
const rightPosition = { arrowTop: top + (contentHeight / 2) - (arrowWidth / 2), arrowLeft: left - (arrowWidth * 1.5) };
|
1285
|
+
switch (side) {
|
1286
|
+
case 'top':
|
1287
|
+
return { arrowTop: top + contentHeight, arrowLeft: left + (contentWidth / 2) - (arrowWidth / 2) };
|
1288
|
+
case 'bottom':
|
1289
|
+
return { arrowTop: top - arrowHeight, arrowLeft: left + (contentWidth / 2) - (arrowWidth / 2) };
|
1290
|
+
case 'left':
|
1291
|
+
return leftPosition;
|
1292
|
+
case 'right':
|
1293
|
+
return rightPosition;
|
1294
|
+
case 'start':
|
1295
|
+
return (isRTL) ? rightPosition : leftPosition;
|
1296
|
+
case 'end':
|
1297
|
+
return (isRTL) ? leftPosition : rightPosition;
|
1298
|
+
default:
|
1299
|
+
return { arrowTop: 0, arrowLeft: 0 };
|
1300
|
+
}
|
1301
|
+
};
|
1302
|
+
/**
|
1303
|
+
* Calculates the required top/left
|
1304
|
+
* values needed to position the popover
|
1305
|
+
* content on the side specified in the
|
1306
|
+
* `side` prop.
|
1307
|
+
*/
|
1308
|
+
const calculatePopoverSide = (side, triggerBoundingBox, contentWidth, contentHeight, arrowWidth, arrowHeight, isRTL) => {
|
1309
|
+
const sideLeft = {
|
1310
|
+
top: triggerBoundingBox.top,
|
1311
|
+
left: triggerBoundingBox.left - contentWidth - arrowWidth
|
1312
|
+
};
|
1313
|
+
const sideRight = {
|
1314
|
+
top: triggerBoundingBox.top,
|
1315
|
+
left: triggerBoundingBox.left + triggerBoundingBox.width + arrowWidth
|
1316
|
+
};
|
1317
|
+
switch (side) {
|
1318
|
+
case 'top':
|
1319
|
+
return {
|
1320
|
+
top: triggerBoundingBox.top - contentHeight - arrowHeight,
|
1321
|
+
left: triggerBoundingBox.left
|
1322
|
+
};
|
1323
|
+
case 'right':
|
1324
|
+
return sideRight;
|
1325
|
+
case 'bottom':
|
1326
|
+
return {
|
1327
|
+
top: triggerBoundingBox.top + triggerBoundingBox.height + arrowHeight,
|
1328
|
+
left: triggerBoundingBox.left
|
1329
|
+
};
|
1330
|
+
case 'left':
|
1331
|
+
return sideLeft;
|
1332
|
+
case 'start':
|
1333
|
+
return (isRTL) ? sideRight : sideLeft;
|
1334
|
+
case 'end':
|
1335
|
+
return (isRTL) ? sideLeft : sideRight;
|
1336
|
+
}
|
1337
|
+
};
|
1338
|
+
/**
|
1339
|
+
* Calculates the required top/left
|
1340
|
+
* offset values needed to provide the
|
1341
|
+
* correct alignment regardless while taking
|
1342
|
+
* into account the side the popover is on.
|
1343
|
+
*/
|
1344
|
+
const calculatePopoverAlign = (align, side, triggerBoundingBox, contentWidth, contentHeight) => {
|
1345
|
+
switch (align) {
|
1346
|
+
case 'center':
|
1347
|
+
return calculatePopoverCenterAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
1348
|
+
case 'end':
|
1349
|
+
return calculatePopoverEndAlign(side, triggerBoundingBox, contentWidth, contentHeight);
|
1350
|
+
case 'start':
|
1351
|
+
default:
|
1352
|
+
return { top: 0, left: 0 };
|
1353
|
+
}
|
1354
|
+
};
|
1355
|
+
/**
|
1356
|
+
* Calculate the end alignment for
|
1357
|
+
* the popover. If side is on the x-axis
|
1358
|
+
* then the align values refer to the top
|
1359
|
+
* and bottom margins of the content.
|
1360
|
+
* If side is on the y-axis then the
|
1361
|
+
* align values refer to the left and right
|
1362
|
+
* margins of the content.
|
1363
|
+
*/
|
1364
|
+
const calculatePopoverEndAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
1365
|
+
switch (side) {
|
1366
|
+
case 'start':
|
1367
|
+
case 'end':
|
1368
|
+
case 'left':
|
1369
|
+
case 'right':
|
1370
|
+
return {
|
1371
|
+
top: -(contentHeight - triggerBoundingBox.height),
|
1372
|
+
left: 0
|
1373
|
+
};
|
1374
|
+
case 'top':
|
1375
|
+
case 'bottom':
|
1376
|
+
default:
|
1377
|
+
return {
|
1378
|
+
top: 0,
|
1379
|
+
left: -(contentWidth - triggerBoundingBox.width)
|
1380
|
+
};
|
1381
|
+
}
|
1382
|
+
};
|
1383
|
+
/**
|
1384
|
+
* Calculate the center alignment for
|
1385
|
+
* the popover. If side is on the x-axis
|
1386
|
+
* then the align values refer to the top
|
1387
|
+
* and bottom margins of the content.
|
1388
|
+
* If side is on the y-axis then the
|
1389
|
+
* align values refer to the left and right
|
1390
|
+
* margins of the content.
|
1391
|
+
*/
|
1392
|
+
const calculatePopoverCenterAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
|
1393
|
+
switch (side) {
|
1394
|
+
case 'start':
|
1395
|
+
case 'end':
|
1396
|
+
case 'left':
|
1397
|
+
case 'right':
|
1398
|
+
return {
|
1399
|
+
top: -((contentHeight / 2) - (triggerBoundingBox.height / 2)),
|
1400
|
+
left: 0
|
1401
|
+
};
|
1402
|
+
case 'top':
|
1403
|
+
case 'bottom':
|
1404
|
+
default:
|
1405
|
+
return {
|
1406
|
+
top: 0,
|
1407
|
+
left: -((contentWidth / 2) - (triggerBoundingBox.width / 2))
|
1408
|
+
};
|
1409
|
+
}
|
1410
|
+
};
|
1411
|
+
/**
|
1412
|
+
* Adjusts popover positioning coordinates
|
1413
|
+
* such that popover does not appear offscreen
|
1414
|
+
* or overlapping safe area bounds.
|
1415
|
+
*/
|
1416
|
+
const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyWidth, bodyHeight, contentWidth, contentHeight, safeAreaMargin, contentOriginX, contentOriginY, triggerCoordinates, coordArrowTop = 0, coordArrowLeft = 0, arrowHeight = 0) => {
|
1417
|
+
let arrowTop = coordArrowTop;
|
1418
|
+
const arrowLeft = coordArrowLeft;
|
1419
|
+
let left = coordLeft;
|
1420
|
+
let top = coordTop;
|
1421
|
+
let bottom;
|
1422
|
+
let originX = contentOriginX;
|
1423
|
+
let originY = contentOriginY;
|
1424
|
+
let checkSafeAreaLeft = false;
|
1425
|
+
let checkSafeAreaRight = false;
|
1426
|
+
const triggerTop = triggerCoordinates ? triggerCoordinates.top + triggerCoordinates.height : bodyHeight / 2 - contentHeight / 2;
|
1427
|
+
const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
|
1428
|
+
let addPopoverBottomClass = false;
|
1429
|
+
/**
|
1430
|
+
* Adjust popover so it does not
|
1431
|
+
* go off the left of the screen.
|
1432
|
+
*/
|
1433
|
+
if (left < bodyPadding + safeAreaMargin) {
|
1434
|
+
left = bodyPadding;
|
1435
|
+
checkSafeAreaLeft = true;
|
1436
|
+
originX = 'left';
|
1437
|
+
/**
|
1438
|
+
* Adjust popover so it does not
|
1439
|
+
* go off the right of the screen.
|
1440
|
+
*/
|
1441
|
+
}
|
1442
|
+
else if (contentWidth + bodyPadding + left + safeAreaMargin > bodyWidth) {
|
1443
|
+
checkSafeAreaRight = true;
|
1444
|
+
left = bodyWidth - contentWidth - bodyPadding;
|
1445
|
+
originX = 'right';
|
1446
|
+
}
|
1447
|
+
/**
|
1448
|
+
* Adjust popover so it does not
|
1449
|
+
* go off the top of the screen.
|
1450
|
+
* If popover is on the left or the right of
|
1451
|
+
* the trigger, then we should not adjust top
|
1452
|
+
* margins.
|
1453
|
+
*/
|
1454
|
+
if (triggerTop + triggerHeight + contentHeight > bodyHeight &&
|
1455
|
+
(side === 'top' || side === 'bottom')) {
|
1456
|
+
if (triggerTop - contentHeight > 0) {
|
1457
|
+
top = triggerTop - contentHeight - triggerHeight - (arrowHeight - 1);
|
1458
|
+
arrowTop = top + contentHeight;
|
1459
|
+
originY = 'bottom';
|
1460
|
+
addPopoverBottomClass = true;
|
1461
|
+
/**
|
1462
|
+
* If not enough room for popover to appear
|
1463
|
+
* above trigger, then cut it off.
|
1464
|
+
*/
|
1465
|
+
}
|
1466
|
+
else {
|
1467
|
+
bottom = bodyPadding;
|
1468
|
+
}
|
1469
|
+
}
|
1470
|
+
return { top, left, bottom, originX, originY, checkSafeAreaLeft, checkSafeAreaRight, arrowTop, arrowLeft, addPopoverBottomClass };
|
1471
|
+
};
|
1472
|
+
const shouldShowArrow = (side, didAdjustBounds = false, ev, trigger) => {
|
1473
|
+
/**
|
1474
|
+
* If no event provided and
|
1475
|
+
* we do not have a trigger,
|
1476
|
+
* then this popover was likely
|
1477
|
+
* presented via the popoverController
|
1478
|
+
* or users called `present` manually.
|
1479
|
+
* In this case, the arrow should not be
|
1480
|
+
* shown as we do not have a reference.
|
1481
|
+
*/
|
1482
|
+
if (!ev && !trigger) {
|
1483
|
+
return false;
|
1484
|
+
}
|
1485
|
+
/**
|
1486
|
+
* If popover is on the left or the right
|
1487
|
+
* of a trigger, but we needed to adjust the
|
1488
|
+
* popover due to screen bounds, then we should
|
1489
|
+
* hide the arrow as it will never be pointing
|
1490
|
+
* at the trigger.
|
1491
|
+
*/
|
1492
|
+
if (side !== 'top' && side !== 'bottom' && didAdjustBounds) {
|
1493
|
+
return false;
|
1494
|
+
}
|
1495
|
+
return true;
|
1496
|
+
};
|
1497
|
+
|
1498
|
+
/*!
|
1499
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
1500
|
+
*/
|
1501
|
+
const POPOVER_IOS_BODY_PADDING = 5;
|
1502
|
+
/**
|
1503
|
+
* iOS Popover Enter Animation
|
1504
|
+
*/
|
1505
|
+
const iosEnterAnimation = (baseEl, opts) => {
|
1506
|
+
var _a;
|
1507
|
+
const { event: ev, size, trigger, reference, side, align } = opts;
|
1508
|
+
const doc = baseEl.ownerDocument;
|
1509
|
+
const isRTL = doc.dir === 'rtl';
|
1510
|
+
const bodyWidth = doc.defaultView.innerWidth;
|
1511
|
+
const bodyHeight = doc.defaultView.innerHeight;
|
1512
|
+
const root = getElementRoot(baseEl);
|
1513
|
+
const contentEl = root.querySelector('.popover-content');
|
1514
|
+
const arrowEl = root.querySelector('.popover-arrow');
|
1515
|
+
const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
|
1516
|
+
const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
|
1517
|
+
const { arrowWidth, arrowHeight } = getArrowDimensions(arrowEl);
|
1518
|
+
const defaultPosition = {
|
1519
|
+
top: bodyHeight / 2 - contentHeight / 2,
|
1520
|
+
left: bodyWidth / 2 - contentWidth / 2,
|
1521
|
+
originX: isRTL ? 'right' : 'left',
|
1522
|
+
originY: 'top'
|
1523
|
+
};
|
1524
|
+
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, trigger, ev);
|
1525
|
+
const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING;
|
1526
|
+
const margin = size === 'cover' ? 0 : 25;
|
1527
|
+
const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, arrowTop, arrowLeft, addPopoverBottomClass } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, margin, results.originX, results.originY, results.referenceCoordinates, results.arrowTop, results.arrowLeft, arrowHeight);
|
1528
|
+
const baseAnimation = createAnimation();
|
1529
|
+
const backdropAnimation = createAnimation();
|
1530
|
+
const wrapperAnimation = createAnimation();
|
1531
|
+
backdropAnimation
|
1532
|
+
.addElement(root.querySelector('ion-backdrop'))
|
1533
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
1534
|
+
.beforeStyles({
|
1535
|
+
'pointer-events': 'none'
|
1536
|
+
})
|
1537
|
+
.afterClearStyles(['pointer-events']);
|
1538
|
+
wrapperAnimation
|
1539
|
+
.addElement(root.querySelector('.popover-wrapper'))
|
1540
|
+
.fromTo('opacity', 0.01, 1);
|
1541
|
+
return baseAnimation
|
1542
|
+
.easing('ease')
|
1543
|
+
.duration(100)
|
1544
|
+
.beforeAddWrite(() => {
|
1545
|
+
if (size === 'cover') {
|
1546
|
+
baseEl.style.setProperty('--width', `${contentWidth}px`);
|
1547
|
+
}
|
1548
|
+
if (addPopoverBottomClass) {
|
1549
|
+
baseEl.classList.add('popover-bottom');
|
1550
|
+
}
|
1551
|
+
if (bottom !== undefined) {
|
1552
|
+
contentEl.style.setProperty('bottom', `${bottom}px`);
|
1553
|
+
}
|
1554
|
+
const safeAreaLeft = ' + var(--ion-safe-area-left, 0)';
|
1555
|
+
const safeAreaRight = ' - var(--ion-safe-area-right, 0)';
|
1556
|
+
let leftValue = `${left}px`;
|
1557
|
+
if (checkSafeAreaLeft) {
|
1558
|
+
leftValue = `${left}px${safeAreaLeft}`;
|
1559
|
+
}
|
1560
|
+
if (checkSafeAreaRight) {
|
1561
|
+
leftValue = `${left}px${safeAreaRight}`;
|
1562
|
+
}
|
1563
|
+
contentEl.style.setProperty('top', `calc(${top}px + var(--offset-y, 0))`);
|
1564
|
+
contentEl.style.setProperty('left', `calc(${leftValue} + var(--offset-x, 0))`);
|
1565
|
+
contentEl.style.setProperty('transform-origin', `${originY} ${originX}`);
|
1566
|
+
if (arrowEl !== null) {
|
1567
|
+
const didAdjustBounds = results.top !== top || results.left !== left;
|
1568
|
+
const showArrow = shouldShowArrow(side, didAdjustBounds, ev, trigger);
|
1569
|
+
if (showArrow) {
|
1570
|
+
arrowEl.style.setProperty('top', `calc(${arrowTop}px + var(--offset-y, 0))`);
|
1571
|
+
arrowEl.style.setProperty('left', `calc(${arrowLeft}px + var(--offset-x, 0))`);
|
1572
|
+
}
|
1573
|
+
else {
|
1574
|
+
arrowEl.style.setProperty('display', 'none');
|
1575
|
+
}
|
1576
|
+
}
|
1577
|
+
})
|
1578
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
1579
|
+
};
|
1580
|
+
|
1581
|
+
/*!
|
1582
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
1583
|
+
*/
|
1584
|
+
/**
|
1585
|
+
* iOS Popover Leave Animation
|
1586
|
+
*/
|
1587
|
+
const iosLeaveAnimation = (baseEl) => {
|
1588
|
+
const root = getElementRoot(baseEl);
|
1589
|
+
const contentEl = root.querySelector('.popover-content');
|
1590
|
+
const arrowEl = root.querySelector('.popover-arrow');
|
1591
|
+
const baseAnimation = createAnimation();
|
1592
|
+
const backdropAnimation = createAnimation();
|
1593
|
+
const wrapperAnimation = createAnimation();
|
1594
|
+
backdropAnimation
|
1595
|
+
.addElement(root.querySelector('ion-backdrop'))
|
1596
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
1597
|
+
wrapperAnimation
|
1598
|
+
.addElement(root.querySelector('.popover-wrapper'))
|
1599
|
+
.fromTo('opacity', 0.99, 0);
|
1600
|
+
return baseAnimation
|
1601
|
+
.easing('ease')
|
1602
|
+
.afterAddWrite(() => {
|
1603
|
+
baseEl.style.removeProperty('--width');
|
1604
|
+
baseEl.classList.remove('popover-bottom');
|
1605
|
+
contentEl.style.removeProperty('top');
|
1606
|
+
contentEl.style.removeProperty('left');
|
1607
|
+
contentEl.style.removeProperty('bottom');
|
1608
|
+
contentEl.style.removeProperty('transform-origin');
|
1609
|
+
if (arrowEl) {
|
1610
|
+
arrowEl.style.removeProperty('top');
|
1611
|
+
arrowEl.style.removeProperty('left');
|
1612
|
+
arrowEl.style.removeProperty('display');
|
1613
|
+
}
|
1614
|
+
})
|
1615
|
+
.duration(300)
|
1616
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
1617
|
+
};
|
1618
|
+
|
1619
|
+
/*!
|
1620
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
1621
|
+
*/
|
1622
|
+
const POPOVER_MD_BODY_PADDING = 12;
|
1623
|
+
/**
|
1624
|
+
* Md Popover Enter Animation
|
1625
|
+
*/
|
1626
|
+
const mdEnterAnimation = (baseEl, opts) => {
|
1627
|
+
var _a;
|
1628
|
+
const { event: ev, size, trigger, reference, side, align } = opts;
|
1629
|
+
const doc = baseEl.ownerDocument;
|
1630
|
+
const isRTL = doc.dir === 'rtl';
|
1631
|
+
const bodyWidth = doc.defaultView.innerWidth;
|
1632
|
+
const bodyHeight = doc.defaultView.innerHeight;
|
1633
|
+
const root = getElementRoot(baseEl);
|
1634
|
+
const contentEl = root.querySelector('.popover-content');
|
1635
|
+
const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
|
1636
|
+
const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
|
1637
|
+
const defaultPosition = {
|
1638
|
+
top: bodyHeight / 2 - contentHeight / 2,
|
1639
|
+
left: bodyWidth / 2 - contentWidth / 2,
|
1640
|
+
originX: isRTL ? 'right' : 'left',
|
1641
|
+
originY: 'top'
|
1642
|
+
};
|
1643
|
+
const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
|
1644
|
+
const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
|
1645
|
+
const { originX, originY, top, left, bottom } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, 0, results.originX, results.originY, results.referenceCoordinates);
|
1646
|
+
const baseAnimation = createAnimation();
|
1647
|
+
const backdropAnimation = createAnimation();
|
1648
|
+
const wrapperAnimation = createAnimation();
|
1649
|
+
const contentAnimation = createAnimation();
|
1650
|
+
const viewportAnimation = createAnimation();
|
1651
|
+
backdropAnimation
|
1652
|
+
.addElement(root.querySelector('ion-backdrop'))
|
1653
|
+
.fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
1654
|
+
.beforeStyles({
|
1655
|
+
'pointer-events': 'none'
|
1656
|
+
})
|
1657
|
+
.afterClearStyles(['pointer-events']);
|
1658
|
+
wrapperAnimation
|
1659
|
+
.addElement(root.querySelector('.popover-wrapper'))
|
1660
|
+
.duration(150)
|
1661
|
+
.fromTo('opacity', 0.01, 1);
|
1662
|
+
contentAnimation
|
1663
|
+
.addElement(contentEl)
|
1664
|
+
.beforeStyles({
|
1665
|
+
'top': `calc(${top}px + var(--offset-y, 0px))`,
|
1666
|
+
'left': `calc(${left}px + var(--offset-x, 0px))`,
|
1667
|
+
'transform-origin': `${originY} ${originX}`
|
1668
|
+
})
|
1669
|
+
.beforeAddWrite(() => {
|
1670
|
+
if (bottom !== undefined) {
|
1671
|
+
contentEl.style.setProperty('bottom', `${bottom}px`);
|
1672
|
+
}
|
1673
|
+
})
|
1674
|
+
.fromTo('transform', 'scale(0.8)', 'scale(1)');
|
1675
|
+
viewportAnimation
|
1676
|
+
.addElement(root.querySelector('.popover-viewport'))
|
1677
|
+
.fromTo('opacity', 0.01, 1);
|
1678
|
+
return baseAnimation
|
1679
|
+
.easing('cubic-bezier(0.36,0.66,0.04,1)')
|
1680
|
+
.duration(300)
|
1681
|
+
.beforeAddWrite(() => {
|
1682
|
+
if (size === 'cover') {
|
1683
|
+
baseEl.style.setProperty('--width', `${contentWidth}px`);
|
1684
|
+
}
|
1685
|
+
if (originY === 'bottom') {
|
1686
|
+
baseEl.classList.add('popover-bottom');
|
1687
|
+
}
|
1688
|
+
})
|
1689
|
+
.addAnimation([backdropAnimation, wrapperAnimation, contentAnimation, viewportAnimation]);
|
1690
|
+
};
|
1691
|
+
|
1692
|
+
/*!
|
1693
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
1694
|
+
*/
|
1695
|
+
/**
|
1696
|
+
* Md Popover Leave Animation
|
1697
|
+
*/
|
1698
|
+
const mdLeaveAnimation = (baseEl) => {
|
1699
|
+
const root = getElementRoot(baseEl);
|
1700
|
+
const contentEl = root.querySelector('.popover-content');
|
1701
|
+
const baseAnimation = createAnimation();
|
1702
|
+
const backdropAnimation = createAnimation();
|
1703
|
+
const wrapperAnimation = createAnimation();
|
1704
|
+
backdropAnimation
|
1705
|
+
.addElement(root.querySelector('ion-backdrop'))
|
1706
|
+
.fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
1707
|
+
wrapperAnimation
|
1708
|
+
.addElement(root.querySelector('.popover-wrapper'))
|
1709
|
+
.fromTo('opacity', 0.99, 0);
|
1710
|
+
return baseAnimation
|
1711
|
+
.easing('ease')
|
1712
|
+
.afterAddWrite(() => {
|
1713
|
+
baseEl.style.removeProperty('--width');
|
1714
|
+
baseEl.classList.remove('popover-bottom');
|
1715
|
+
contentEl.style.removeProperty('top');
|
1716
|
+
contentEl.style.removeProperty('left');
|
1717
|
+
contentEl.style.removeProperty('bottom');
|
1718
|
+
contentEl.style.removeProperty('transform-origin');
|
1719
|
+
})
|
1720
|
+
.duration(150)
|
1721
|
+
.addAnimation([backdropAnimation, wrapperAnimation]);
|
1722
|
+
};
|
1723
|
+
|
1724
|
+
const popoverIosCss = ":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{opacity:0;z-index:10}.popover-content{display:flex;position:absolute;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:flex;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, #e6e6e6)}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden}.popover-arrow::after{left:3px;top:3px;border-radius:3px;position:absolute;width:14px;height:14px;transform:rotate(45deg);background:var(--background);content:\"\";z-index:10}[dir=rtl] .popover-arrow::after,:host-context([dir=rtl]) .popover-arrow::after{left:unset;right:unset;right:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{transform:rotate(-90deg)}:host(.popover-side-end) .popover-arrow{transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{transform:rotate(90deg)}@supports (backdrop-filter: blur(0)){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}}";
|
1725
|
+
|
1726
|
+
const popoverMdCss = ":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{opacity:0;z-index:10}.popover-content{display:flex;position:absolute;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:flex;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;transform-origin:left top}[dir=rtl] .popover-content,:host-context([dir=rtl]) .popover-content{transform-origin:right top}.popover-viewport{transition-delay:100ms}";
|
1727
|
+
|
1728
|
+
const Popover = class {
|
1729
|
+
constructor(hostRef) {
|
1730
|
+
registerInstance(this, hostRef);
|
1731
|
+
this.didPresent = createEvent(this, "ionPopoverDidPresent", 7);
|
1732
|
+
this.willPresent = createEvent(this, "ionPopoverWillPresent", 7);
|
1733
|
+
this.willDismiss = createEvent(this, "ionPopoverWillDismiss", 7);
|
1734
|
+
this.didDismiss = createEvent(this, "ionPopoverDidDismiss", 7);
|
1735
|
+
this.didPresentShorthand = createEvent(this, "didPresent", 7);
|
1736
|
+
this.willPresentShorthand = createEvent(this, "willPresent", 7);
|
1737
|
+
this.willDismissShorthand = createEvent(this, "willDismiss", 7);
|
1738
|
+
this.didDismissShorthand = createEvent(this, "didDismiss", 7);
|
1739
|
+
this.parentPopover = null;
|
1740
|
+
this.popoverIndex = popoverIds++;
|
1741
|
+
this.coreDelegate = CoreDelegate();
|
1742
|
+
this.inline = false;
|
1743
|
+
this.focusDescendantOnPresent = false;
|
1744
|
+
this.presented = false;
|
1745
|
+
/** @internal */
|
1746
|
+
this.hasController = false;
|
1747
|
+
/**
|
1748
|
+
* If `true`, the keyboard will be automatically dismissed when the overlay is presented.
|
1749
|
+
*/
|
1750
|
+
this.keyboardClose = true;
|
1751
|
+
/**
|
1752
|
+
* If `true`, the popover will be dismissed when the backdrop is clicked.
|
1753
|
+
*/
|
1754
|
+
this.backdropDismiss = true;
|
1755
|
+
/**
|
1756
|
+
* If `true`, a backdrop will be displayed behind the popover.
|
1757
|
+
*/
|
1758
|
+
this.showBackdrop = true;
|
1759
|
+
/**
|
1760
|
+
* If `true`, the popover will be translucent.
|
1761
|
+
* Only applies when the mode is `"ios"` and the device supports
|
1762
|
+
* [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
|
1763
|
+
*/
|
1764
|
+
this.translucent = false;
|
1765
|
+
/**
|
1766
|
+
* If `true`, the popover will animate.
|
1767
|
+
*/
|
1768
|
+
this.animated = true;
|
1769
|
+
/**
|
1770
|
+
* Describes what kind of interaction with the trigger that
|
1771
|
+
* should cause the popover to open. Does not apply when the `trigger`
|
1772
|
+
* property is `undefined`.
|
1773
|
+
* If `'click'`, the popover will be presented when the trigger is left clicked.
|
1774
|
+
* If `'hover'`, the popover will be presented when a pointer hovers over the trigger.
|
1775
|
+
* If `'context-menu'`, the popover will be presented when the trigger is right
|
1776
|
+
* clicked on desktop and long pressed on mobile. This will also prevent your
|
1777
|
+
* device's normal context menu from appearing.
|
1778
|
+
*/
|
1779
|
+
this.triggerAction = 'click';
|
1780
|
+
/**
|
1781
|
+
* Describes how to calculate the popover width.
|
1782
|
+
* If `'cover'`, the popover width will match the width of the trigger.
|
1783
|
+
* If `'auto'`, the popover width will be determined by the content in
|
1784
|
+
* the popover.
|
1785
|
+
*/
|
1786
|
+
this.size = 'auto';
|
1787
|
+
/**
|
1788
|
+
* If `true`, the popover will be automatically
|
1789
|
+
* dismissed when the content has been clicked.
|
1790
|
+
*/
|
1791
|
+
this.dismissOnSelect = false;
|
1792
|
+
/**
|
1793
|
+
* Describes what to position the popover relative to.
|
1794
|
+
* If `'trigger'`, the popover will be positioned relative
|
1795
|
+
* to the trigger button. If passing in an event, this is
|
1796
|
+
* determined via event.target.
|
1797
|
+
* If `'event'`, the popover will be positioned relative
|
1798
|
+
* to the x/y coordinates of the trigger action. If passing
|
1799
|
+
* in an event, this is determined via event.clientX and event.clientY.
|
1800
|
+
*/
|
1801
|
+
this.reference = 'trigger';
|
1802
|
+
/**
|
1803
|
+
* Describes which side of the `reference` point to position
|
1804
|
+
* the popover on. The `'start'` and `'end'` values are RTL-aware,
|
1805
|
+
* and the `'left'` and `'right'` values are not.
|
1806
|
+
*/
|
1807
|
+
this.side = 'bottom';
|
1808
|
+
/**
|
1809
|
+
* If `true`, the popover will display an arrow
|
1810
|
+
* that points at the `reference` when running in `ios` mode
|
1811
|
+
* on mobile. Does not apply in `md` mode or on desktop.
|
1812
|
+
*/
|
1813
|
+
this.arrow = true;
|
1814
|
+
/**
|
1815
|
+
* If `true`, the popover will open. If `false`, the popover will close.
|
1816
|
+
* Use this if you need finer grained control over presentation, otherwise
|
1817
|
+
* just use the popoverController or the `trigger` property.
|
1818
|
+
* Note: `isOpen` will not automatically be set back to `false` when
|
1819
|
+
* the popover dismisses. You will need to do that in your code.
|
1820
|
+
*/
|
1821
|
+
this.isOpen = false;
|
1822
|
+
/**
|
1823
|
+
* @internal
|
1824
|
+
*
|
1825
|
+
* If `true` the popover will not register its own keyboard event handlers.
|
1826
|
+
* This allows the contents of the popover to handle their own keyboard interactions.
|
1827
|
+
*
|
1828
|
+
* If `false`, the popover will register its own keyboard event handlers for
|
1829
|
+
* navigating `ion-list` items within a popover (up/down/home/end/etc.).
|
1830
|
+
* This will also cancel browser keyboard event bindings to prevent scroll
|
1831
|
+
* behavior in a popover using a list of items.
|
1832
|
+
*/
|
1833
|
+
this.keyboardEvents = false;
|
1834
|
+
this.onDismiss = (ev) => {
|
1835
|
+
ev.stopPropagation();
|
1836
|
+
ev.preventDefault();
|
1837
|
+
this.dismiss();
|
1838
|
+
};
|
1839
|
+
this.onBackdropTap = () => {
|
1840
|
+
this.dismiss(undefined, BACKDROP);
|
1841
|
+
};
|
1842
|
+
this.onLifecycle = (modalEvent) => {
|
1843
|
+
const el = this.usersElement;
|
1844
|
+
const name = LIFECYCLE_MAP[modalEvent.type];
|
1845
|
+
if (el && name) {
|
1846
|
+
const event = new CustomEvent(name, {
|
1847
|
+
bubbles: false,
|
1848
|
+
cancelable: false,
|
1849
|
+
detail: modalEvent.detail
|
1850
|
+
});
|
1851
|
+
el.dispatchEvent(event);
|
1852
|
+
}
|
1853
|
+
};
|
1854
|
+
this.configureTriggerInteraction = () => {
|
1855
|
+
const { trigger, triggerAction, el, destroyTriggerInteraction } = this;
|
1856
|
+
if (destroyTriggerInteraction) {
|
1857
|
+
destroyTriggerInteraction();
|
1858
|
+
}
|
1859
|
+
const triggerEl = this.triggerEl = (trigger !== undefined) ? document.getElementById(trigger) : null;
|
1860
|
+
if (!triggerEl) {
|
1861
|
+
return;
|
1862
|
+
}
|
1863
|
+
this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, triggerAction, el);
|
1864
|
+
};
|
1865
|
+
this.configureKeyboardInteraction = () => {
|
1866
|
+
const { destroyKeyboardInteraction, el } = this;
|
1867
|
+
if (destroyKeyboardInteraction) {
|
1868
|
+
destroyKeyboardInteraction();
|
1869
|
+
}
|
1870
|
+
this.destroyKeyboardInteraction = configureKeyboardInteraction(el);
|
1871
|
+
};
|
1872
|
+
this.configureDismissInteraction = () => {
|
1873
|
+
const { destroyDismissInteraction, parentPopover, triggerAction, triggerEl, el } = this;
|
1874
|
+
if (!parentPopover || !triggerEl) {
|
1875
|
+
return;
|
1876
|
+
}
|
1877
|
+
if (destroyDismissInteraction) {
|
1878
|
+
destroyDismissInteraction();
|
1879
|
+
}
|
1880
|
+
this.destroyDismissInteraction = configureDismissInteraction(triggerEl, triggerAction, el, parentPopover);
|
1881
|
+
};
|
1882
|
+
}
|
1883
|
+
onTriggerChange() {
|
1884
|
+
this.configureTriggerInteraction();
|
1885
|
+
}
|
1886
|
+
onIsOpenChange(newValue, oldValue) {
|
1887
|
+
if (newValue === true && oldValue === false) {
|
1888
|
+
this.present();
|
1889
|
+
}
|
1890
|
+
else if (newValue === false && oldValue === true) {
|
1891
|
+
this.dismiss();
|
1892
|
+
}
|
1893
|
+
}
|
1894
|
+
connectedCallback() {
|
1895
|
+
prepareOverlay(this.el);
|
1896
|
+
}
|
1897
|
+
componentWillLoad() {
|
1898
|
+
/**
|
1899
|
+
* If user has custom ID set then we should
|
1900
|
+
* not assign the default incrementing ID.
|
1901
|
+
*/
|
1902
|
+
this.popoverId = (this.el.hasAttribute('id')) ? this.el.getAttribute('id') : `ion-popover-${this.popoverIndex}`;
|
1903
|
+
this.parentPopover = this.el.closest(`ion-popover:not(#${this.popoverId})`);
|
1904
|
+
if (this.alignment === undefined) {
|
1905
|
+
this.alignment = getIonMode(this) === 'ios' ? 'center' : 'start';
|
1906
|
+
}
|
1907
|
+
}
|
1908
|
+
componentDidLoad() {
|
1909
|
+
const { parentPopover, isOpen } = this;
|
1910
|
+
/**
|
1911
|
+
* If popover was rendered with isOpen="true"
|
1912
|
+
* then we should open popover immediately.
|
1913
|
+
*/
|
1914
|
+
if (isOpen === true) {
|
1915
|
+
raf(() => this.present());
|
1916
|
+
}
|
1917
|
+
if (parentPopover) {
|
1918
|
+
addEventListener(parentPopover, 'ionPopoverWillDismiss', () => {
|
1919
|
+
this.dismiss(undefined, undefined, false);
|
1920
|
+
});
|
1921
|
+
}
|
1922
|
+
this.configureTriggerInteraction();
|
1923
|
+
}
|
1924
|
+
/**
|
1925
|
+
* When opening a popover from a trigger, we should not be
|
1926
|
+
* modifying the `event` prop from inside the component.
|
1927
|
+
* Additionally, when pressing the "Right" arrow key, we need
|
1928
|
+
* to shift focus to the first descendant in the newly presented
|
1929
|
+
* popover.
|
1930
|
+
*
|
1931
|
+
* @internal
|
1932
|
+
*/
|
1933
|
+
async presentFromTrigger(event, focusDescendant = false) {
|
1934
|
+
this.focusDescendantOnPresent = focusDescendant;
|
1935
|
+
await this.present(event);
|
1936
|
+
this.focusDescendantOnPresent = false;
|
1937
|
+
}
|
1938
|
+
/**
|
1939
|
+
* Determines whether or not an overlay
|
1940
|
+
* is being used inline or via a controller/JS
|
1941
|
+
* and returns the correct delegate.
|
1942
|
+
* By default, subsequent calls to getDelegate
|
1943
|
+
* will use a cached version of the delegate.
|
1944
|
+
* This is useful for calling dismiss after
|
1945
|
+
* present so that the correct delegate is given.
|
1946
|
+
*/
|
1947
|
+
getDelegate(force = false) {
|
1948
|
+
if (this.workingDelegate && !force) {
|
1949
|
+
return {
|
1950
|
+
delegate: this.workingDelegate,
|
1951
|
+
inline: this.inline
|
1952
|
+
};
|
1953
|
+
}
|
1954
|
+
/**
|
1955
|
+
* If using overlay inline
|
1956
|
+
* we potentially need to use the coreDelegate
|
1957
|
+
* so that this works in vanilla JS apps.
|
1958
|
+
* If a developer has presented this component
|
1959
|
+
* via a controller, then we can assume
|
1960
|
+
* the component is already in the
|
1961
|
+
* correct place.
|
1962
|
+
*/
|
1963
|
+
const parentEl = this.el.parentNode;
|
1964
|
+
const inline = this.inline = parentEl !== null && !this.hasController;
|
1965
|
+
const delegate = this.workingDelegate = (inline) ? this.delegate || this.coreDelegate : this.delegate;
|
1966
|
+
return { inline, delegate };
|
1967
|
+
}
|
1968
|
+
/**
|
1969
|
+
* Present the popover overlay after it has been created.
|
1970
|
+
* Developers can pass a mouse, touch, or pointer event
|
1971
|
+
* to position the popover relative to where that event
|
1972
|
+
* was dispatched.
|
1973
|
+
*/
|
1974
|
+
async present(event) {
|
1975
|
+
if (this.presented) {
|
1976
|
+
return;
|
1977
|
+
}
|
1978
|
+
/**
|
1979
|
+
* When using an inline popover
|
1980
|
+
* and dismissing a popover it is possible to
|
1981
|
+
* quickly present the popover while it is
|
1982
|
+
* dismissing. We need to await any current
|
1983
|
+
* transition to allow the dismiss to finish
|
1984
|
+
* before presenting again.
|
1985
|
+
*/
|
1986
|
+
if (this.currentTransition !== undefined) {
|
1987
|
+
await this.currentTransition;
|
1988
|
+
}
|
1989
|
+
const data = Object.assign(Object.assign({}, this.componentProps), { popover: this.el });
|
1990
|
+
const { inline, delegate } = this.getDelegate(true);
|
1991
|
+
this.usersElement = await attachComponent(delegate, this.el, this.component, ['popover-viewport'], data, inline);
|
1992
|
+
await deepReady(this.usersElement);
|
1993
|
+
if (!this.keyboardEvents) {
|
1994
|
+
this.configureKeyboardInteraction();
|
1995
|
+
}
|
1996
|
+
this.configureDismissInteraction();
|
1997
|
+
this.currentTransition = present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
|
1998
|
+
event: event || this.event,
|
1999
|
+
size: this.size,
|
2000
|
+
trigger: this.triggerEl,
|
2001
|
+
reference: this.reference,
|
2002
|
+
side: this.side,
|
2003
|
+
align: this.alignment
|
2004
|
+
});
|
2005
|
+
await this.currentTransition;
|
2006
|
+
this.currentTransition = undefined;
|
2007
|
+
/**
|
2008
|
+
* If popover is nested and was
|
2009
|
+
* presented using the "Right" arrow key,
|
2010
|
+
* we need to move focus to the first
|
2011
|
+
* descendant inside of the popover.
|
2012
|
+
*/
|
2013
|
+
if (this.focusDescendantOnPresent) {
|
2014
|
+
focusFirstDescendant(this.el, this.el);
|
2015
|
+
}
|
2016
|
+
}
|
2017
|
+
/**
|
2018
|
+
* Dismiss the popover overlay after it has been presented.
|
2019
|
+
*
|
2020
|
+
* @param data Any data to emit in the dismiss events.
|
2021
|
+
* @param role The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'.
|
2022
|
+
* @param dismissParentPopover If `true`, dismissing this popover will also dismiss
|
2023
|
+
* a parent popover if this popover is nested. Defaults to `true`.
|
2024
|
+
*/
|
2025
|
+
async dismiss(data, role, dismissParentPopover = true) {
|
2026
|
+
/**
|
2027
|
+
* When using an inline popover
|
2028
|
+
* and presenting a popover it is possible to
|
2029
|
+
* quickly dismiss the popover while it is
|
2030
|
+
* presenting. We need to await any current
|
2031
|
+
* transition to allow the present to finish
|
2032
|
+
* before dismissing again.
|
2033
|
+
*/
|
2034
|
+
if (this.currentTransition !== undefined) {
|
2035
|
+
await this.currentTransition;
|
2036
|
+
}
|
2037
|
+
const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
|
2038
|
+
if (dismissParentPopover && this.parentPopover) {
|
2039
|
+
this.parentPopover.dismiss(data, role, dismissParentPopover);
|
2040
|
+
}
|
2041
|
+
this.currentTransition = dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
|
2042
|
+
const shouldDismiss = await this.currentTransition;
|
2043
|
+
if (shouldDismiss) {
|
2044
|
+
if (destroyKeyboardInteraction) {
|
2045
|
+
destroyKeyboardInteraction();
|
2046
|
+
this.destroyKeyboardInteraction = undefined;
|
2047
|
+
}
|
2048
|
+
if (destroyDismissInteraction) {
|
2049
|
+
destroyDismissInteraction();
|
2050
|
+
this.destroyDismissInteraction = undefined;
|
2051
|
+
}
|
2052
|
+
/**
|
2053
|
+
* If using popover inline
|
2054
|
+
* we potentially need to use the coreDelegate
|
2055
|
+
* so that this works in vanilla JS apps
|
2056
|
+
*/
|
2057
|
+
const { delegate } = this.getDelegate();
|
2058
|
+
await detachComponent(delegate, this.usersElement);
|
2059
|
+
}
|
2060
|
+
this.currentTransition = undefined;
|
2061
|
+
return shouldDismiss;
|
2062
|
+
}
|
2063
|
+
/**
|
2064
|
+
* @internal
|
2065
|
+
*/
|
2066
|
+
async getParentPopover() {
|
2067
|
+
return this.parentPopover;
|
2068
|
+
}
|
2069
|
+
/**
|
2070
|
+
* Returns a promise that resolves when the popover did dismiss.
|
2071
|
+
*/
|
2072
|
+
onDidDismiss() {
|
2073
|
+
return eventMethod(this.el, 'ionPopoverDidDismiss');
|
2074
|
+
}
|
2075
|
+
/**
|
2076
|
+
* Returns a promise that resolves when the popover will dismiss.
|
2077
|
+
*/
|
2078
|
+
onWillDismiss() {
|
2079
|
+
return eventMethod(this.el, 'ionPopoverWillDismiss');
|
2080
|
+
}
|
2081
|
+
render() {
|
2082
|
+
const mode = getIonMode(this);
|
2083
|
+
const { onLifecycle, popoverId, parentPopover, dismissOnSelect, side, arrow, htmlAttributes } = this;
|
2084
|
+
const desktop = isPlatform('desktop');
|
2085
|
+
const enableArrow = arrow && !parentPopover && !desktop;
|
2086
|
+
return (h(Host, Object.assign({ "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
2087
|
+
zIndex: `${20000 + this.overlayIndex}`,
|
2088
|
+
}, id: popoverId, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonDismiss: this.onDismiss, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { class: "popover-arrow", part: "arrow" }), h("div", { class: "popover-content", part: "content" }, h("slot", null)))));
|
2089
|
+
}
|
2090
|
+
get el() { return getElement(this); }
|
2091
|
+
static get watchers() { return {
|
2092
|
+
"trigger": ["onTriggerChange"],
|
2093
|
+
"triggerAction": ["onTriggerChange"],
|
2094
|
+
"isOpen": ["onIsOpenChange"]
|
2095
|
+
}; }
|
2096
|
+
};
|
2097
|
+
const LIFECYCLE_MAP = {
|
2098
|
+
'ionPopoverDidPresent': 'ionViewDidEnter',
|
2099
|
+
'ionPopoverWillPresent': 'ionViewWillEnter',
|
2100
|
+
'ionPopoverWillDismiss': 'ionViewWillLeave',
|
2101
|
+
'ionPopoverDidDismiss': 'ionViewDidLeave',
|
2102
|
+
};
|
2103
|
+
let popoverIds = 0;
|
2104
|
+
Popover.style = {
|
2105
|
+
ios: popoverIosCss,
|
2106
|
+
md: popoverMdCss
|
2107
|
+
};
|
2108
|
+
|
2109
|
+
const selectPopoverIosCss = ".sc-ion-select-popover-ios-h ion-list.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-ios,ion-label.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
2110
|
+
|
2111
|
+
const selectPopoverMdCss = ".sc-ion-select-popover-md-h ion-list.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-md,ion-label.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md{opacity:0}ion-item.sc-ion-select-popover-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-popover-md{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08);--background-focused:var(--ion-color-primary, #3880ff);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #3880ff);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-popover-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #3880ff)}";
|
2112
|
+
|
2113
|
+
const SelectPopover = class {
|
2114
|
+
constructor(hostRef) {
|
2115
|
+
registerInstance(this, hostRef);
|
2116
|
+
/**
|
2117
|
+
* An array of options for the popover
|
2118
|
+
*/
|
2119
|
+
this.options = [];
|
2120
|
+
}
|
2121
|
+
onSelect(ev) {
|
2122
|
+
this.setChecked(ev);
|
2123
|
+
this.callOptionHandler(ev);
|
2124
|
+
}
|
2125
|
+
findOptionFromEvent(ev) {
|
2126
|
+
const { options } = this;
|
2127
|
+
return options.find(o => o.value === ev.target.value);
|
2128
|
+
}
|
2129
|
+
/**
|
2130
|
+
* When an option is selected we need to get the value(s)
|
2131
|
+
* of the selected option(s) and return it in the option
|
2132
|
+
* handler
|
2133
|
+
*/
|
2134
|
+
callOptionHandler(ev) {
|
2135
|
+
const option = this.findOptionFromEvent(ev);
|
2136
|
+
const values = this.getValues(ev);
|
2137
|
+
if (option && option.handler) {
|
2138
|
+
safeCall(option.handler, values);
|
2139
|
+
}
|
2140
|
+
}
|
2141
|
+
/**
|
2142
|
+
* This is required when selecting a radio that is already
|
2143
|
+
* selected because it will not trigger the ionChange event
|
2144
|
+
* but we still want to close the popover
|
2145
|
+
*/
|
2146
|
+
rbClick(ev) {
|
2147
|
+
this.callOptionHandler(ev);
|
2148
|
+
}
|
2149
|
+
setChecked(ev) {
|
2150
|
+
const { multiple } = this;
|
2151
|
+
const option = this.findOptionFromEvent(ev);
|
2152
|
+
// this is a popover with checkboxes (multiple value select)
|
2153
|
+
// we need to set the checked value for this option
|
2154
|
+
if (multiple && option) {
|
2155
|
+
option.checked = ev.detail.checked;
|
2156
|
+
}
|
2157
|
+
}
|
2158
|
+
getValues(ev) {
|
2159
|
+
const { multiple, options } = this;
|
2160
|
+
if (multiple) {
|
2161
|
+
// this is a popover with checkboxes (multiple value select)
|
2162
|
+
// return an array of all the checked values
|
2163
|
+
return options.filter(o => o.checked).map(o => o.value);
|
2164
|
+
}
|
2165
|
+
// this is a popover with radio buttons (single value select)
|
2166
|
+
// return the value that was clicked, otherwise undefined
|
2167
|
+
const option = this.findOptionFromEvent(ev);
|
2168
|
+
return option ? option.value : undefined;
|
2169
|
+
}
|
2170
|
+
renderOptions(options) {
|
2171
|
+
const { multiple } = this;
|
2172
|
+
switch (multiple) {
|
2173
|
+
case true: return this.renderCheckboxOptions(options);
|
2174
|
+
default: return this.renderRadioOptions(options);
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
renderCheckboxOptions(options) {
|
2178
|
+
return (options.map(option => h("ion-item", { class: getClassMap(option.cssClass) }, h("ion-checkbox", { slot: "start", value: option.value, disabled: option.disabled, checked: option.checked }), h("ion-label", null, option.text))));
|
2179
|
+
}
|
2180
|
+
renderRadioOptions(options) {
|
2181
|
+
const checked = options.filter(o => o.checked).map(o => o.value)[0];
|
2182
|
+
return (h("ion-radio-group", { value: checked }, options.map(option => h("ion-item", { class: getClassMap(option.cssClass) }, h("ion-label", null, option.text), h("ion-radio", { value: option.value, disabled: option.disabled, onClick: ev => this.rbClick(ev) })))));
|
2183
|
+
}
|
2184
|
+
render() {
|
2185
|
+
const { header, message, options, subHeader } = this;
|
2186
|
+
const hasSubHeaderOrMessage = subHeader !== undefined || message !== undefined;
|
2187
|
+
return (h(Host, { class: getIonMode(this) }, h("ion-list", null, header !== undefined && h("ion-list-header", null, header), hasSubHeaderOrMessage &&
|
2188
|
+
h("ion-item", null, h("ion-label", { class: "ion-text-wrap" }, subHeader !== undefined && h("h3", null, subHeader), message !== undefined && h("p", null, message))), this.renderOptions(options))));
|
2189
|
+
}
|
2190
|
+
};
|
2191
|
+
SelectPopover.style = {
|
2192
|
+
ios: selectPopoverIosCss,
|
2193
|
+
md: selectPopoverMdCss
|
2194
|
+
};
|
2195
|
+
|
2196
|
+
export { ActionSheet as ion_action_sheet, Alert as ion_alert, Popover as ion_popover, SelectPopover as ion_select_popover };
|