@sparkle-learning/core 0.0.32 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/PrivateRoute-4abc9d29.js +35 -0
- package/dist/cjs/{active-router-eedb3bfe.js → active-router-f9e18bd8.js} +1 -1
- package/dist/cjs/{animation-6132e37f.js → animation-ee586546.js} +83 -78
- package/dist/cjs/{app-globals-9869bf67.js → app-globals-33c9f31b.js} +1 -1
- package/dist/cjs/{PrivateRoute-043bb7d3.js → auth.service-4b584cd7.js} +4 -33
- package/dist/cjs/{auth.store-ff3fda09.js → auth.store-1e630a7d.js} +48 -725
- package/dist/cjs/compass-svg.cjs.entry.js +1 -1
- package/dist/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/cjs/course-select.cjs.entry.js +1 -1
- package/dist/cjs/{cubic-bezier-293f4663.js → cubic-bezier-53d26d05.js} +10 -11
- package/dist/cjs/dom-utils-b8befdd5.js +63 -0
- package/dist/cjs/{facilitator.service-faac5c0c.js → facilitator.service-9e990274.js} +8 -7
- package/dist/cjs/{feed.service-66405969.js → feed.service-b4f09441.js} +8 -7
- package/dist/cjs/{focus-visible-ad3828a7.js → focus-visible-b0b07ba6.js} +19 -6
- package/dist/cjs/{framework-delegate-2470a246.js → framework-delegate-59a98abd.js} +11 -13
- package/dist/cjs/{gesture-controller-07c31f70.js → gesture-controller-0eb5579e.js} +1 -1
- package/dist/cjs/{haptic-91e86eb7.js → haptic-780f33c4.js} +3 -2
- package/dist/cjs/{hardware-back-button-f7b5d99e.js → hardware-back-button-92d97ff8.js} +8 -8
- package/dist/cjs/header-mobile-collapse_2.cjs.entry.js +112 -0
- package/dist/cjs/{helpers-7e28976c.js → helpers-c2496722.js} +81 -14
- package/dist/cjs/httpService-7211d93b.js +685 -0
- package/dist/cjs/{icons-80d477f6.js → icons-c61db785.js} +1 -1
- package/dist/cjs/{index-43642662.js → index-12082cba.js} +21 -18
- package/dist/cjs/{index-459a5fa9.js → index-15ea05f5.js} +19 -28
- package/dist/cjs/{index-bae2a754.js → index-51e8292e.js} +18 -11
- package/dist/cjs/index-70e63f5b.js +3071 -0
- package/dist/cjs/{index-b12edb26.js → index-787d4498.js} +17 -25
- package/dist/cjs/{tap-click-1caf1780.js → index-8b5629a6.js} +30 -20
- package/dist/cjs/{index-8540d72e.js → index-975586fd.js} +7 -1
- package/dist/cjs/index-9c7b27e4.js +140 -0
- package/dist/cjs/{index-185f9c5a.js → index-af080b50.js} +9 -8
- package/dist/cjs/index-e56e09b8.js +38 -0
- package/dist/cjs/index.cjs.js +13 -11
- package/dist/cjs/{index.es-ef3efdfb.js → index.es-38cbcdbe.js} +2 -7
- package/dist/cjs/injectHistory-7206bbb9.js +9 -0
- package/dist/cjs/{input-shims-6c442c9f.js → input-shims-eff63b88.js} +21 -24
- package/dist/cjs/ion-accordion-group.cjs.entry.js +17 -9
- package/dist/cjs/ion-accordion.cjs.entry.js +19 -23
- package/dist/cjs/ion-action-sheet_4.cjs.entry.js +216 -212
- package/dist/cjs/ion-app.cjs.entry.js +8 -8
- package/dist/cjs/ion-avatar_16.cjs.entry.js +1907 -0
- package/dist/cjs/ion-back-button.cjs.entry.js +11 -11
- package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
- package/dist/cjs/ion-badge.cjs.entry.js +3 -3
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +13 -21
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +12 -14
- package/dist/cjs/ion-buttons_3.cjs.entry.js +13 -13
- package/dist/cjs/ion-card-header.cjs.entry.js +4 -4
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
- package/dist/cjs/ion-checkbox_4.cjs.entry.js +360 -0
- package/dist/cjs/ion-chip.cjs.entry.js +3 -3
- package/dist/cjs/ion-col_3.cjs.entry.js +159 -0
- package/dist/cjs/ion-content_2.cjs.entry.js +59 -52
- package/dist/cjs/ion-datetime-button.cjs.entry.js +312 -0
- package/dist/cjs/ion-datetime.cjs.entry.js +752 -1245
- package/dist/cjs/ion-fab-button.cjs.entry.js +25 -9
- package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
- package/dist/cjs/ion-fab.cjs.entry.js +15 -13
- package/dist/cjs/ion-footer.cjs.entry.js +16 -14
- package/dist/cjs/ion-img.cjs.entry.js +4 -4
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -15
- package/dist/cjs/ion-item-divider.cjs.entry.js +4 -4
- package/dist/cjs/ion-item-group.cjs.entry.js +3 -3
- package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
- package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
- package/dist/cjs/ion-item-sliding.cjs.entry.js +41 -46
- package/dist/cjs/ion-loading.cjs.entry.js +23 -35
- package/dist/cjs/ion-menu-button.cjs.entry.js +13 -13
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +7 -7
- package/dist/cjs/ion-menu.cjs.entry.js +47 -40
- package/dist/cjs/ion-modal.cjs.entry.js +935 -282
- package/dist/cjs/ion-nav-link.cjs.entry.js +2 -2
- package/dist/cjs/ion-nav.cjs.entry.js +45 -35
- package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +151 -43
- package/dist/cjs/ion-picker-column.cjs.entry.js +23 -25
- package/dist/cjs/ion-picker.cjs.entry.js +15 -17
- package/dist/cjs/ion-progress-bar.cjs.entry.js +6 -8
- package/dist/cjs/ion-range.cjs.entry.js +515 -0
- package/dist/cjs/ion-refresher-content.cjs.entry.js +6 -12
- package/dist/cjs/ion-refresher.cjs.entry.js +68 -50
- package/dist/cjs/ion-reorder-group.cjs.entry.js +15 -16
- package/dist/cjs/ion-reorder.cjs.entry.js +3 -3
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
- package/dist/cjs/ion-router-outlet.cjs.entry.js +22 -20
- package/dist/cjs/ion-router.cjs.entry.js +32 -31
- package/dist/cjs/ion-searchbar.cjs.entry.js +14 -16
- package/dist/cjs/ion-segment-button.cjs.entry.js +8 -8
- package/dist/cjs/ion-segment.cjs.entry.js +24 -26
- package/dist/cjs/ion-select_2.cjs.entry.js +59 -56
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +4 -4
- package/dist/cjs/ion-slide.cjs.entry.js +3 -3
- package/dist/cjs/ion-slides.cjs.entry.js +23 -23
- package/dist/cjs/ion-split-pane.cjs.entry.js +10 -11
- package/dist/cjs/ion-tab-bar.cjs.entry.js +5 -5
- package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
- package/dist/cjs/ion-tab.cjs.entry.js +4 -4
- package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
- package/dist/cjs/ion-text.cjs.entry.js +24 -0
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +23 -43
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +29 -28
- package/dist/cjs/{ionic-global-878073d1.js → ionic-global-2cde9d3a.js} +27 -31
- package/dist/cjs/{ios.transition-c3bfb096.js → ios.transition-da235483.js} +71 -51
- package/dist/cjs/{keyboard-dfd76ac3.js → keyboard-91096619.js} +3 -3
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/match-path-84c9f7ca.js +511 -0
- package/dist/cjs/{md.transition-7eb9a1a7.js → md.transition-be429e07.js} +9 -16
- package/dist/cjs/{menu-toggle-util-cb549c2c.js → menu-toggle-util-7a01448c.js} +2 -2
- package/dist/cjs/{overlays-0a748609.js → overlays-32df265a.js} +29 -29
- package/dist/cjs/parse-d0071120.js +1237 -0
- package/dist/cjs/{purify-d0ad2883.js → purify-fb9c107e.js} +1 -1
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-card_3.cjs.entry.js +91 -0
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +5 -5
- package/dist/cjs/sparkle-course-root.cjs.entry.js +146 -0
- package/dist/cjs/sparkle-dropdown.cjs.entry.js +61 -0
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/{header-mobile-collapse_61.cjs.entry.js → sparkle-export-lessons_6.cjs.entry.js} +8865 -17663
- package/dist/cjs/sparkle-facilitator-header_19.cjs.entry.js +2130 -0
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +8 -7
- package/dist/cjs/sparkle-feedback.cjs.entry.js +9 -7
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +8 -7
- package/dist/cjs/sparkle-goal-progress.cjs.entry.js +19 -0
- package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-gww-item.cjs.entry.js +74 -0
- package/dist/cjs/sparkle-intro.cjs.entry.js +26 -0
- package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-menu-toggle_3.cjs.entry.js +236 -0
- package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-overlay.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-validation-error.cjs.entry.js +21 -0
- package/dist/cjs/sparkle-youtube.cjs.entry.js +1 -1
- package/dist/cjs/{spinner-configs-6f6b7ef0.js → spinner-configs-0ac05f2d.js} +43 -43
- package/dist/cjs/{status-tap-8697433c.js → status-tap-033befa2.js} +7 -5
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/cjs/stencil-route-link.cjs.entry.js +77 -0
- package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-redirect.cjs.entry.js +32 -0
- package/dist/cjs/student.service-d48f1c99.js +61 -0
- package/dist/cjs/{swipe-back-7e08b5e0.js → swipe-back-4a826f9b.js} +5 -5
- package/dist/cjs/{theme-4252ac15.js → theme-b0b295c1.js} +6 -5
- package/dist/cjs/user.store-8a049c4e.js +21 -0
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +16 -0
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +197 -3
- package/dist/collection/components/sparkle-intro/sparkle-intro.css +15 -0
- package/dist/collection/components/sparkle-intro/sparkle-intro.js +35 -0
- package/dist/esm/PrivateRoute-530ef873.js +33 -0
- package/dist/esm/{active-router-909088d6.js → active-router-9843e205.js} +1 -1
- package/dist/esm/{animation-b306f6c2.js → animation-d98d3e81.js} +83 -78
- package/dist/esm/{app-globals-5c736ae5.js → app-globals-08edc964.js} +1 -1
- package/dist/esm/{PrivateRoute-b9937c45.js → auth.service-79389d86.js} +4 -32
- package/dist/esm/{auth.store-3ed2389e.js → auth.store-b812b34b.js} +45 -725
- package/dist/esm/compass-svg.entry.js +1 -1
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/{cubic-bezier-a7ad9c8e.js → cubic-bezier-4c0db14f.js} +10 -11
- package/dist/esm/dom-utils-8e73e88b.js +55 -0
- package/dist/esm/{facilitator.service-ec0a9739.js → facilitator.service-7babc526.js} +2 -1
- package/dist/esm/{feed.service-33b83cb7.js → feed.service-80fbe79d.js} +3 -2
- package/dist/esm/{focus-visible-40cda868.js → focus-visible-4e9a0764.js} +19 -6
- package/dist/esm/{framework-delegate-3bc58c27.js → framework-delegate-9b329182.js} +11 -13
- package/dist/esm/{gesture-controller-686622ba.js → gesture-controller-7be18351.js} +1 -1
- package/dist/esm/{haptic-99c9e346.js → haptic-3a76a65c.js} +4 -3
- package/dist/esm/{hardware-back-button-b6ccf74a.js → hardware-back-button-fa04d6e9.js} +8 -8
- package/dist/esm/header-mobile-collapse_2.entry.js +107 -0
- package/dist/esm/{helpers-39367fe1.js → helpers-94a5855b.js} +81 -15
- package/dist/esm/httpService-b2b7a1ad.js +683 -0
- package/dist/esm/{icons-61dec176.js → icons-16f1a80b.js} +2 -2
- package/dist/esm/{index-a12c14bd.js → index-21661af2.js} +22 -19
- package/dist/esm/{tap-click-13f1fb0d.js → index-230a26c9.js} +30 -20
- package/dist/esm/{index-c26d8655.js → index-478745be.js} +17 -25
- package/dist/esm/{index-dc61f152.js → index-4ec6b9c2.js} +5 -2
- package/dist/esm/{index-9594837e.js → index-95307148.js} +19 -28
- package/dist/esm/{index-5568e3fa.js → index-9db08224.js} +19 -12
- package/dist/esm/index-ab1c6a9f.js +3067 -0
- package/dist/esm/{index-435af8e6.js → index-be6112f8.js} +9 -8
- package/dist/esm/index-c23a1826.js +128 -0
- package/dist/esm/index-dad75b83.js +34 -0
- package/dist/esm/{index.es-97dd8174.js → index.es-1c3b1ef3.js} +2 -7
- package/dist/esm/index.js +9 -7
- package/dist/esm/injectHistory-4bfff188.js +7 -0
- package/dist/esm/{input-shims-cc98ea92.js → input-shims-ce5c01df.js} +21 -24
- package/dist/esm/ion-accordion-group.entry.js +17 -9
- package/dist/esm/ion-accordion.entry.js +19 -23
- package/dist/esm/ion-action-sheet_4.entry.js +216 -212
- package/dist/esm/ion-app.entry.js +8 -8
- package/dist/esm/ion-avatar_16.entry.js +1888 -0
- package/dist/esm/ion-back-button.entry.js +11 -11
- package/dist/esm/ion-backdrop.entry.js +4 -4
- package/dist/esm/ion-badge.entry.js +3 -3
- package/dist/esm/ion-breadcrumb.entry.js +13 -21
- package/dist/esm/ion-breadcrumbs.entry.js +12 -14
- package/dist/esm/ion-buttons_3.entry.js +13 -13
- package/dist/esm/ion-card-header.entry.js +4 -4
- package/dist/esm/ion-card-subtitle.entry.js +4 -4
- package/dist/esm/ion-checkbox_4.entry.js +353 -0
- package/dist/esm/ion-chip.entry.js +3 -3
- package/dist/esm/ion-col_3.entry.js +153 -0
- package/dist/esm/ion-content_2.entry.js +59 -52
- package/dist/esm/ion-datetime-button.entry.js +308 -0
- package/dist/esm/ion-datetime.entry.js +723 -1216
- package/dist/esm/ion-fab-button.entry.js +25 -9
- package/dist/esm/ion-fab-list.entry.js +4 -4
- package/dist/esm/ion-fab.entry.js +15 -13
- package/dist/esm/ion-footer.entry.js +16 -14
- package/dist/esm/ion-img.entry.js +4 -4
- package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
- package/dist/esm/ion-infinite-scroll.entry.js +13 -15
- package/dist/esm/ion-item-divider.entry.js +4 -4
- package/dist/esm/ion-item-group.entry.js +3 -3
- package/dist/esm/ion-item-option.entry.js +8 -8
- package/dist/esm/ion-item-options.entry.js +5 -5
- package/dist/esm/ion-item-sliding.entry.js +41 -46
- package/dist/esm/ion-loading.entry.js +23 -35
- package/dist/esm/ion-menu-button.entry.js +13 -13
- package/dist/esm/ion-menu-toggle.entry.js +7 -7
- package/dist/esm/ion-menu.entry.js +47 -40
- package/dist/esm/ion-modal.entry.js +921 -268
- package/dist/esm/ion-nav-link.entry.js +2 -2
- package/dist/esm/ion-nav.entry.js +45 -35
- package/dist/esm/ion-picker-column-internal_2.entry.js +151 -43
- package/dist/esm/ion-picker-column.entry.js +23 -25
- package/dist/esm/ion-picker.entry.js +15 -17
- package/dist/esm/ion-progress-bar.entry.js +6 -8
- package/dist/esm/ion-range.entry.js +511 -0
- package/dist/esm/ion-refresher-content.entry.js +6 -12
- package/dist/esm/ion-refresher.entry.js +68 -50
- package/dist/esm/ion-reorder-group.entry.js +15 -16
- package/dist/esm/ion-reorder.entry.js +3 -3
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +5 -5
- package/dist/esm/ion-router-outlet.entry.js +22 -20
- package/dist/esm/ion-router.entry.js +32 -31
- package/dist/esm/ion-searchbar.entry.js +14 -16
- package/dist/esm/ion-segment-button.entry.js +8 -8
- package/dist/esm/ion-segment.entry.js +24 -26
- package/dist/esm/ion-select_2.entry.js +59 -56
- package/dist/esm/ion-skeleton-text.entry.js +4 -4
- package/dist/esm/ion-slide.entry.js +3 -3
- package/dist/esm/ion-slides.entry.js +23 -23
- package/dist/esm/ion-split-pane.entry.js +10 -11
- package/dist/esm/ion-tab-bar.entry.js +5 -5
- package/dist/esm/ion-tab-button.entry.js +6 -6
- package/dist/esm/ion-tab.entry.js +4 -4
- package/dist/esm/ion-tabs.entry.js +4 -5
- package/dist/esm/ion-text.entry.js +20 -0
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +23 -43
- package/dist/esm/ion-virtual-scroll.entry.js +29 -28
- package/dist/esm/{ionic-global-0939c477.js → ionic-global-293e882b.js} +27 -31
- package/dist/esm/{ios.transition-b4ca8a33.js → ios.transition-7cd34deb.js} +71 -51
- package/dist/esm/{keyboard-2503e874.js → keyboard-7e8329b3.js} +3 -3
- package/dist/esm/loader.js +5 -5
- package/dist/esm/match-path-36fdf5c7.js +499 -0
- package/dist/esm/{md.transition-ca5e0322.js → md.transition-2589a5b1.js} +9 -16
- package/dist/esm/{menu-toggle-util-7fa22c2f.js → menu-toggle-util-f92ba2f0.js} +2 -2
- package/dist/esm/{overlays-34cfa9e0.js → overlays-dfa730c8.js} +30 -30
- package/dist/esm/parse-1ae3a9bb.js +1196 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/{purify-ffce2b4c.js → purify-79af871f.js} +1 -1
- package/dist/esm/sparkle-animation-player.entry.js +2 -2
- package/dist/esm/sparkle-card_3.entry.js +85 -0
- package/dist/esm/sparkle-character-intro.entry.js +1 -1
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +5 -5
- package/dist/esm/sparkle-course-root.entry.js +142 -0
- package/dist/esm/sparkle-dropdown.entry.js +57 -0
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/{header-mobile-collapse_61.entry.js → sparkle-export-lessons_6.entry.js} +8860 -17603
- package/dist/esm/sparkle-facilitator-header_19.entry.js +2108 -0
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +8 -7
- package/dist/esm/sparkle-feedback.entry.js +9 -7
- package/dist/esm/sparkle-goal-form.entry.js +9 -8
- package/dist/esm/sparkle-goal-progress.entry.js +15 -0
- package/dist/esm/sparkle-gww-comment-list.entry.js +1 -1
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-gww-item.entry.js +70 -0
- package/dist/esm/sparkle-intro.entry.js +22 -0
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-menu-toggle_3.entry.js +230 -0
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +1 -1
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
- package/dist/esm/sparkle-quiz.entry.js +1 -1
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +1 -1
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-validation-error.entry.js +17 -0
- package/dist/esm/sparkle-youtube.entry.js +1 -1
- package/dist/esm/{spinner-configs-f609a655.js → spinner-configs-a37e628a.js} +43 -43
- package/dist/esm/{status-tap-6351a0cb.js → status-tap-79b6199d.js} +7 -5
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-link.entry.js +73 -0
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/stencil-router-redirect.entry.js +28 -0
- package/dist/esm/{student.service-29b688ba.js → student.service-0caed0f4.js} +3 -18
- package/dist/esm/{swipe-back-34251834.js → swipe-back-ad7a0361.js} +5 -5
- package/dist/esm/{theme-c336c9d9.js → theme-7ef00c83.js} +6 -5
- package/dist/esm/user.store-8477642a.js +19 -0
- package/dist/esm/{util-6ef753e9.js → util-a831d09d.js} +1 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +8 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +46 -22
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +43 -19
- package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +60 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +2 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +6 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +3 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +1 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +1 -6
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +1 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +1 -5
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +31 -3
- package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +29 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +24 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +24 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +4 -0
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +2 -2
- package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +8 -8
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +34 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +34 -17
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +50 -1
- package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +27 -0
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-0127a61a.entry.js +1 -0
- package/dist/sparkle-core/p-01743e3e.js +4 -0
- package/dist/sparkle-core/p-06af1bc8.entry.js +1 -0
- package/dist/sparkle-core/{p-703ca87c.js → p-076f0239.js} +0 -0
- package/dist/sparkle-core/p-0798d46a.entry.js +1 -0
- package/dist/sparkle-core/p-085eb951.entry.js +4 -0
- package/dist/sparkle-core/{p-39e5a90f.entry.js → p-0b92326d.entry.js} +1 -1
- package/dist/sparkle-core/{p-5ff6416d.entry.js → p-0c603495.entry.js} +2 -2
- package/dist/sparkle-core/{p-6bbabb80.entry.js → p-0d7cceaa.entry.js} +1 -1
- package/dist/sparkle-core/p-0d813026.entry.js +1 -0
- package/dist/sparkle-core/{p-69e7783d.js → p-0e4de1d0.js} +0 -0
- package/dist/sparkle-core/p-11ed6b7f.entry.js +1 -0
- package/dist/sparkle-core/p-122427b7.entry.js +1 -0
- package/dist/sparkle-core/p-12c4f45c.entry.js +1 -0
- package/dist/sparkle-core/p-136b93d5.entry.js +4 -0
- package/dist/sparkle-core/{p-e225581a.js → p-1394cbb8.js} +2 -2
- package/dist/sparkle-core/{p-c48bbc7c.entry.js → p-14340143.entry.js} +1 -1
- package/dist/sparkle-core/p-14a06a91.entry.js +1 -0
- package/dist/sparkle-core/{p-a9ee3f6d.entry.js → p-16b7974e.entry.js} +1 -1
- package/dist/sparkle-core/p-16c81890.entry.js +1 -0
- package/dist/sparkle-core/{p-5c9aa1f9.entry.js → p-1701723e.entry.js} +1 -1
- package/dist/sparkle-core/p-1728ead7.js +1 -0
- package/dist/sparkle-core/p-17aef6f9.js +1 -0
- package/dist/sparkle-core/p-180857a2.entry.js +1 -0
- package/dist/sparkle-core/p-1acc7870.entry.js +1 -0
- package/dist/sparkle-core/{p-513794b0.js → p-1c2aee9c.js} +1 -1
- package/dist/sparkle-core/p-1cd4c3cc.entry.js +1 -0
- package/dist/sparkle-core/p-21d9833d.js +1 -0
- package/dist/sparkle-core/p-23d713e2.js +1 -0
- package/dist/sparkle-core/p-25c13612.entry.js +1 -0
- package/dist/sparkle-core/p-2699868a.entry.js +1 -0
- package/dist/sparkle-core/p-27075abe.js +4 -0
- package/dist/sparkle-core/{p-713590fc.js → p-280e938d.js} +1 -1
- package/dist/sparkle-core/p-2bd4c60e.js +1 -0
- package/dist/sparkle-core/p-2c89a6c2.entry.js +1 -0
- package/dist/sparkle-core/p-308517b3.js +4 -0
- package/dist/sparkle-core/p-3227afcb.entry.js +1 -0
- package/dist/sparkle-core/{p-173d5461.entry.js → p-34d93a39.entry.js} +1 -1
- package/dist/sparkle-core/p-34ebfc8a.entry.js +1 -0
- package/dist/sparkle-core/p-351b82a8.entry.js +1 -0
- package/dist/sparkle-core/p-363a2d6d.js +4 -0
- package/dist/sparkle-core/p-36c48760.entry.js +1 -0
- package/dist/sparkle-core/p-3810777d.js +4 -0
- package/dist/sparkle-core/p-384911d7.entry.js +1 -0
- package/dist/sparkle-core/p-3b618eda.entry.js +1 -0
- package/dist/sparkle-core/p-3c752205.entry.js +1 -0
- package/dist/sparkle-core/{p-50aac721.entry.js → p-3d2c0e24.entry.js} +2 -2
- package/dist/sparkle-core/{p-350adbaa.entry.js → p-3eb56165.entry.js} +1 -1
- package/dist/sparkle-core/{p-ed0e9d29.entry.js → p-3ef53ebf.entry.js} +1 -1
- package/dist/sparkle-core/{p-fbd7eeca.entry.js → p-3fd92216.entry.js} +1 -1
- package/dist/sparkle-core/{p-1df05176.js → p-4338e1e3.js} +2 -2
- package/dist/sparkle-core/p-442eadcf.entry.js +1 -0
- package/dist/sparkle-core/{p-5f45d206.entry.js → p-4af496a8.entry.js} +1 -1
- package/dist/sparkle-core/{p-935e7cfc.js → p-4bd4dab2.js} +1 -1
- package/dist/sparkle-core/{p-18e62133.entry.js → p-4c9e010d.entry.js} +1 -1
- package/dist/sparkle-core/p-4d0dfbc9.js +1 -0
- package/dist/sparkle-core/{p-8c6b6038.js → p-4d4077ea.js} +0 -0
- package/dist/sparkle-core/p-4e0502b8.entry.js +4 -0
- package/dist/sparkle-core/p-506f3c5f.js +4 -0
- package/dist/sparkle-core/p-524a6174.entry.js +1 -0
- package/dist/sparkle-core/p-53aac9d7.entry.js +1 -0
- package/dist/sparkle-core/{p-0580419b.entry.js → p-56700a40.entry.js} +1 -1
- package/dist/sparkle-core/p-5722be24.entry.js +1 -0
- package/dist/sparkle-core/p-58389020.entry.js +348 -0
- package/dist/sparkle-core/{p-11cf398a.entry.js → p-58f74119.entry.js} +1 -1
- package/dist/sparkle-core/p-5979f253.entry.js +1 -0
- package/dist/sparkle-core/p-5a3de051.entry.js +4 -0
- package/dist/sparkle-core/p-5a850731.entry.js +1 -0
- package/dist/sparkle-core/{p-950effe7.entry.js → p-5dcf33fb.entry.js} +1 -1
- package/dist/sparkle-core/p-5e8fa1ac.entry.js +1 -0
- package/dist/sparkle-core/p-5ef50959.js +1 -0
- package/dist/sparkle-core/p-615b8f64.entry.js +1 -0
- package/dist/sparkle-core/{p-90389886.entry.js → p-63d8a5b7.entry.js} +1 -1
- package/dist/sparkle-core/p-6a337ad1.entry.js +1 -0
- package/dist/sparkle-core/p-6a5ace01.js +2 -0
- package/dist/sparkle-core/{p-d7baf31e.entry.js → p-6ae9c743.entry.js} +1 -1
- package/dist/sparkle-core/p-76206f80.entry.js +1 -0
- package/dist/sparkle-core/{p-99b43ee1.entry.js → p-767c9db8.entry.js} +1 -1
- package/dist/sparkle-core/p-76a6e202.entry.js +1 -0
- package/dist/sparkle-core/{p-ee0d7f19.entry.js → p-785f1879.entry.js} +1 -1
- package/dist/sparkle-core/p-788735b9.entry.js +1 -0
- package/dist/sparkle-core/{p-057f6a23.entry.js → p-7b21bd70.entry.js} +1 -1
- package/dist/sparkle-core/p-7b3d1457.js +1 -0
- package/dist/sparkle-core/p-7d8427eb.js +4 -0
- package/dist/sparkle-core/{p-5264da79.js → p-7e7ce516.js} +0 -0
- package/dist/sparkle-core/{p-838fa86d.entry.js → p-8cbe019a.entry.js} +5 -5
- package/dist/sparkle-core/{p-9c1772c3.js → p-8d630960.js} +1 -1
- package/dist/sparkle-core/{p-7052c43a.entry.js → p-8e42e634.entry.js} +1 -1
- package/dist/sparkle-core/p-8e56f9ee.entry.js +1 -0
- package/dist/sparkle-core/p-8ed0cefb.entry.js +1 -0
- package/dist/sparkle-core/{p-d4c07aca.js → p-924b2917.js} +0 -0
- package/dist/sparkle-core/p-9484e34b.entry.js +1 -0
- package/dist/sparkle-core/p-966817ec.js +1 -0
- package/dist/sparkle-core/p-969e98e5.entry.js +1 -0
- package/dist/sparkle-core/p-98f3925b.js +4 -0
- package/dist/sparkle-core/{p-a1cab0f3.js → p-99231c00.js} +2 -2
- package/dist/sparkle-core/p-9a383065.entry.js +7 -0
- package/dist/sparkle-core/p-9b4979b5.entry.js +4 -0
- package/dist/sparkle-core/{p-c69b0a7a.entry.js → p-9cd95e7e.entry.js} +1 -1
- package/dist/sparkle-core/p-9dc42d70.entry.js +1 -0
- package/dist/sparkle-core/p-9eea81f2.js +1 -0
- package/dist/sparkle-core/{p-797c23ed.entry.js → p-9ef14088.entry.js} +1 -1
- package/dist/sparkle-core/p-a05871e6.js +1 -0
- package/dist/sparkle-core/p-a111c567.entry.js +1 -0
- package/dist/sparkle-core/{p-1af044f7.js → p-a19b42f0.js} +1 -1
- package/dist/sparkle-core/p-a208ab2d.js +4 -0
- package/dist/sparkle-core/p-a2f7c751.entry.js +1 -0
- package/dist/sparkle-core/p-a458b415.entry.js +1 -0
- package/dist/sparkle-core/p-a6c1a55a.entry.js +5 -0
- package/dist/sparkle-core/{p-145e40f5.entry.js → p-ab3a8f5e.entry.js} +1 -1
- package/dist/sparkle-core/p-ac0e4d8c.entry.js +1 -0
- package/dist/sparkle-core/p-add30d46.js +4 -0
- package/dist/sparkle-core/{p-5b40aae5.entry.js → p-b00d0a47.entry.js} +1 -1
- package/dist/sparkle-core/p-b2827978.entry.js +1 -0
- package/dist/sparkle-core/p-b8ba8164.entry.js +1 -0
- package/dist/sparkle-core/{p-6823e6c1.entry.js → p-ba775d8e.entry.js} +1 -1
- package/dist/sparkle-core/{p-37c00e39.entry.js → p-bae8cd7d.entry.js} +1 -1
- package/dist/sparkle-core/p-bb3e3482.entry.js +1 -0
- package/dist/sparkle-core/p-bb575dba.entry.js +1 -0
- package/dist/sparkle-core/p-bd2c8e30.entry.js +10 -0
- package/dist/sparkle-core/p-c48352cf.js +4 -0
- package/dist/sparkle-core/{p-667accac.entry.js → p-c5eb4404.entry.js} +1 -1
- package/dist/sparkle-core/p-c8ad5a5b.entry.js +4 -0
- package/dist/sparkle-core/p-c9f474d0.js +4 -0
- package/dist/sparkle-core/p-ca0edc9b.entry.js +1 -0
- package/dist/sparkle-core/{p-680663a2.entry.js → p-cb04b18a.entry.js} +1 -1
- package/dist/sparkle-core/{p-b3909012.entry.js → p-d0d0e5e5.entry.js} +1 -1
- package/dist/sparkle-core/{p-7d61177b.entry.js → p-d220a642.entry.js} +1 -1
- package/dist/sparkle-core/p-d38a2511.entry.js +1 -0
- package/dist/sparkle-core/{p-b07a2cf2.entry.js → p-d5b8302f.entry.js} +1 -1
- package/dist/sparkle-core/p-d5ba8e80.entry.js +1 -0
- package/dist/sparkle-core/{p-3a202a38.entry.js → p-d6637b48.entry.js} +1 -1
- package/dist/sparkle-core/p-d6788642.entry.js +1 -0
- package/dist/sparkle-core/p-d6a3a639.entry.js +1 -0
- package/dist/sparkle-core/p-d86f8633.entry.js +1 -0
- package/dist/sparkle-core/{p-9cfdeb18.entry.js → p-defeaa5c.entry.js} +1 -1
- package/dist/sparkle-core/p-df5cfa7f.entry.js +1 -0
- package/dist/sparkle-core/p-df5efe0d.entry.js +1 -0
- package/dist/sparkle-core/p-dff8325e.js +4 -0
- package/dist/sparkle-core/p-e09de7ac.js +1 -0
- package/dist/sparkle-core/{p-016a7aaf.entry.js → p-e1743d82.entry.js} +1 -1
- package/dist/sparkle-core/p-e28a106d.entry.js +1 -0
- package/dist/sparkle-core/p-e566c0b3.entry.js +1 -0
- package/dist/sparkle-core/{p-bca0e465.entry.js → p-e6d39f6e.entry.js} +1 -1
- package/dist/sparkle-core/p-e9431eeb.js +7 -0
- package/dist/sparkle-core/p-ea4a9f0d.entry.js +1 -0
- package/dist/sparkle-core/p-ea7d7a3b.js +1 -0
- package/dist/sparkle-core/p-eaa8bbee.js +4 -0
- package/dist/sparkle-core/p-ed3dfd89.js +4 -0
- package/dist/sparkle-core/{p-3defe550.entry.js → p-efe37368.entry.js} +1 -1
- package/dist/sparkle-core/p-f187d129.entry.js +1 -0
- package/dist/sparkle-core/{p-a9ccb0df.js → p-f3cba72a.js} +0 -0
- package/dist/sparkle-core/{p-052caa63.js → p-f5e7bfa5.js} +1 -1
- package/dist/sparkle-core/{p-ecd39170.entry.js → p-f63a13d8.entry.js} +1 -1
- package/dist/sparkle-core/{p-1726da2f.entry.js → p-fdb9a613.entry.js} +1 -1
- package/dist/sparkle-core/p-fde96f7c.js +4 -0
- package/dist/sparkle-core/{p-aa87c7f0.entry.js → p-fe214d79.entry.js} +1 -1
- package/dist/sparkle-core/p-fe3a7bca.js +1 -0
- package/dist/sparkle-core/{p-aa9ebc39.entry.js → p-fea20ec2.entry.js} +1 -1
- package/dist/sparkle-core/p-ff26d891.entry.js +1 -0
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +16 -0
- package/dist/types/components/sparkle-intro/sparkle-intro.d.ts +7 -0
- package/dist/types/components.d.ts +73 -11
- package/package.json +3 -3
- package/dist/cjs/ion-card-title.cjs.entry.js +0 -30
- package/dist/cjs/ion-textarea.cjs.entry.js +0 -247
- package/dist/cjs/ion-toggle.cjs.entry.js +0 -160
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -19
- package/dist/cjs/student.service-744c3155.js +0 -77
- package/dist/esm/ion-card-title.entry.js +0 -26
- package/dist/esm/ion-textarea.entry.js +0 -243
- package/dist/esm/ion-toggle.entry.js +0 -156
- package/dist/esm/sparkle-feed-post.entry.js +0 -15
- package/dist/sparkle-core/p-0187adef.entry.js +0 -1
- package/dist/sparkle-core/p-03189863.js +0 -1
- package/dist/sparkle-core/p-03ec54a8.entry.js +0 -1
- package/dist/sparkle-core/p-04583c51.entry.js +0 -1
- package/dist/sparkle-core/p-063cd168.js +0 -4
- package/dist/sparkle-core/p-081968cc.entry.js +0 -1
- package/dist/sparkle-core/p-0934f5dd.entry.js +0 -1
- package/dist/sparkle-core/p-0f899097.entry.js +0 -352
- package/dist/sparkle-core/p-1339830f.entry.js +0 -1
- package/dist/sparkle-core/p-1b78dea1.entry.js +0 -1
- package/dist/sparkle-core/p-1cef8572.js +0 -4
- package/dist/sparkle-core/p-21bf4ca0.entry.js +0 -1
- package/dist/sparkle-core/p-21db4e8e.entry.js +0 -1
- package/dist/sparkle-core/p-23a9f7d1.entry.js +0 -1
- package/dist/sparkle-core/p-289a35ed.entry.js +0 -1
- package/dist/sparkle-core/p-2ee6a5f9.entry.js +0 -1
- package/dist/sparkle-core/p-35a7bd6c.entry.js +0 -1
- package/dist/sparkle-core/p-389500fd.js +0 -4
- package/dist/sparkle-core/p-45e6db62.entry.js +0 -1
- package/dist/sparkle-core/p-48f9b960.entry.js +0 -1
- package/dist/sparkle-core/p-4dc3ef96.entry.js +0 -1
- package/dist/sparkle-core/p-547b70c6.entry.js +0 -1
- package/dist/sparkle-core/p-5598650a.entry.js +0 -1
- package/dist/sparkle-core/p-55ae49e1.js +0 -4
- package/dist/sparkle-core/p-58e98f89.entry.js +0 -1
- package/dist/sparkle-core/p-59f7bf6e.entry.js +0 -1
- package/dist/sparkle-core/p-5a3d0e6b.js +0 -4
- package/dist/sparkle-core/p-5d2e54ee.entry.js +0 -1
- package/dist/sparkle-core/p-62a6c96f.entry.js +0 -1
- package/dist/sparkle-core/p-64e72f8f.js +0 -4
- package/dist/sparkle-core/p-660e0742.js +0 -1
- package/dist/sparkle-core/p-6bf07a28.js +0 -1
- package/dist/sparkle-core/p-6c6145cd.js +0 -4
- package/dist/sparkle-core/p-6c90bde6.entry.js +0 -5
- package/dist/sparkle-core/p-6e88764b.entry.js +0 -4
- package/dist/sparkle-core/p-6ee40949.js +0 -1
- package/dist/sparkle-core/p-6fbe3ca3.entry.js +0 -1
- package/dist/sparkle-core/p-6fd4985d.js +0 -4
- package/dist/sparkle-core/p-70b2452c.js +0 -4
- package/dist/sparkle-core/p-7493ee15.entry.js +0 -1
- package/dist/sparkle-core/p-75572037.js +0 -1
- package/dist/sparkle-core/p-768bcc9e.entry.js +0 -1
- package/dist/sparkle-core/p-7e61973d.entry.js +0 -7
- package/dist/sparkle-core/p-855ca600.js +0 -1
- package/dist/sparkle-core/p-857f3696.entry.js +0 -1
- package/dist/sparkle-core/p-8fe2e51f.entry.js +0 -4
- package/dist/sparkle-core/p-932bfb69.entry.js +0 -1
- package/dist/sparkle-core/p-941eaa3a.entry.js +0 -1
- package/dist/sparkle-core/p-95004267.entry.js +0 -1
- package/dist/sparkle-core/p-996361f9.entry.js +0 -1
- package/dist/sparkle-core/p-9a17f2ad.js +0 -4
- package/dist/sparkle-core/p-9babd345.js +0 -1
- package/dist/sparkle-core/p-a080e768.entry.js +0 -1
- package/dist/sparkle-core/p-a7cc0052.entry.js +0 -4
- package/dist/sparkle-core/p-ae1f145d.entry.js +0 -1
- package/dist/sparkle-core/p-b3e6427d.js +0 -7
- package/dist/sparkle-core/p-b49ca0ea.entry.js +0 -1
- package/dist/sparkle-core/p-b81e20fe.entry.js +0 -4
- package/dist/sparkle-core/p-c1279cc9.entry.js +0 -1
- package/dist/sparkle-core/p-c1376096.entry.js +0 -1
- package/dist/sparkle-core/p-c3986a52.entry.js +0 -1
- package/dist/sparkle-core/p-c3d3d5c4.entry.js +0 -1
- package/dist/sparkle-core/p-c5b9bdd6.entry.js +0 -1
- package/dist/sparkle-core/p-cbbeed67.entry.js +0 -1
- package/dist/sparkle-core/p-d4a435f8.entry.js +0 -1
- package/dist/sparkle-core/p-d5b05ece.entry.js +0 -5
- package/dist/sparkle-core/p-d8d3524a.js +0 -1
- package/dist/sparkle-core/p-e0fced48.entry.js +0 -1
- package/dist/sparkle-core/p-e1cba44b.entry.js +0 -4
- package/dist/sparkle-core/p-e3fdd0a8.entry.js +0 -1
- package/dist/sparkle-core/p-e6b66cef.entry.js +0 -1
- package/dist/sparkle-core/p-e72d4450.js +0 -4
- package/dist/sparkle-core/p-eb70a23c.entry.js +0 -1
- package/dist/sparkle-core/p-f4001fdf.js +0 -4
- package/dist/sparkle-core/p-f9b73032.entry.js +0 -1
- package/dist/sparkle-core/p-faa912d7.entry.js +0 -1
- package/dist/sparkle-core/p-fc933591.entry.js +0 -1
- package/dist/sparkle-core/p-fef04ab5.js +0 -4
@@ -0,0 +1,1196 @@
|
|
1
|
+
import { a as printIonWarning } from './index-dad75b83.js';
|
2
|
+
|
3
|
+
/*!
|
4
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
5
|
+
*/
|
6
|
+
/**
|
7
|
+
* Returns true if the selected day is equal to the reference day
|
8
|
+
*/
|
9
|
+
const isSameDay = (baseParts, compareParts) => {
|
10
|
+
return (baseParts.month === compareParts.month && baseParts.day === compareParts.day && baseParts.year === compareParts.year);
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* Returns true is the selected day is before the reference day.
|
14
|
+
*/
|
15
|
+
const isBefore = (baseParts, compareParts) => {
|
16
|
+
return (baseParts.year < compareParts.year ||
|
17
|
+
(baseParts.year === compareParts.year && baseParts.month < compareParts.month) ||
|
18
|
+
(baseParts.year === compareParts.year &&
|
19
|
+
baseParts.month === compareParts.month &&
|
20
|
+
baseParts.day &&
|
21
|
+
baseParts.day < compareParts.day));
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* Returns true is the selected day is after the reference day.
|
25
|
+
*/
|
26
|
+
const isAfter = (baseParts, compareParts) => {
|
27
|
+
return (baseParts.year > compareParts.year ||
|
28
|
+
(baseParts.year === compareParts.year && baseParts.month > compareParts.month) ||
|
29
|
+
(baseParts.year === compareParts.year &&
|
30
|
+
baseParts.month === compareParts.month &&
|
31
|
+
baseParts.day &&
|
32
|
+
baseParts.day > compareParts.day));
|
33
|
+
};
|
34
|
+
const warnIfValueOutOfBounds = (value, min, max) => {
|
35
|
+
const valueArray = Array.isArray(value) ? value : [value];
|
36
|
+
for (const val of valueArray) {
|
37
|
+
if ((min && isBefore(val, min)) || (max && isAfter(val, max))) {
|
38
|
+
printIonWarning('The value provided to ion-datetime is out of bounds.\n\n' +
|
39
|
+
`Min: ${JSON.stringify(min)}\n` +
|
40
|
+
`Max: ${JSON.stringify(max)}\n` +
|
41
|
+
`Value: ${JSON.stringify(value)}`);
|
42
|
+
break;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
};
|
46
|
+
|
47
|
+
/*!
|
48
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
49
|
+
*/
|
50
|
+
/**
|
51
|
+
* Determines if given year is a
|
52
|
+
* leap year. Returns `true` if year
|
53
|
+
* is a leap year. Returns `false`
|
54
|
+
* otherwise.
|
55
|
+
*/
|
56
|
+
const isLeapYear = (year) => {
|
57
|
+
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
58
|
+
};
|
59
|
+
const is24Hour = (locale, hourCycle) => {
|
60
|
+
/**
|
61
|
+
* If developer has explicitly enabled h23 time
|
62
|
+
* then return early and do not look at the system default.
|
63
|
+
*/
|
64
|
+
if (hourCycle !== undefined) {
|
65
|
+
return hourCycle === 'h23';
|
66
|
+
}
|
67
|
+
/**
|
68
|
+
* If hourCycle was not specified, check the locale
|
69
|
+
* that is set on the user's device. We first check the
|
70
|
+
* Intl.DateTimeFormat hourCycle option as developers can encode this
|
71
|
+
* option into the locale string. Example: `en-US-u-hc-h23`
|
72
|
+
*/
|
73
|
+
const formatted = new Intl.DateTimeFormat(locale, { hour: 'numeric' });
|
74
|
+
const options = formatted.resolvedOptions();
|
75
|
+
if (options.hourCycle !== undefined) {
|
76
|
+
return options.hourCycle === 'h23';
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* If hourCycle is not specified (either through lack
|
80
|
+
* of browser support or locale information) then fall
|
81
|
+
* back to this slower hourCycle check.
|
82
|
+
*/
|
83
|
+
const date = new Date('5/18/2021 00:00');
|
84
|
+
const parts = formatted.formatToParts(date);
|
85
|
+
const hour = parts.find((p) => p.type === 'hour');
|
86
|
+
if (!hour) {
|
87
|
+
throw new Error('Hour value not found from DateTimeFormat');
|
88
|
+
}
|
89
|
+
return hour.value === '00';
|
90
|
+
};
|
91
|
+
/**
|
92
|
+
* Given a date object, returns the number
|
93
|
+
* of days in that month.
|
94
|
+
* Month value begin at 1, not 0.
|
95
|
+
* i.e. January = month 1.
|
96
|
+
*/
|
97
|
+
const getNumDaysInMonth = (month, year) => {
|
98
|
+
return month === 4 || month === 6 || month === 9 || month === 11
|
99
|
+
? 30
|
100
|
+
: month === 2
|
101
|
+
? isLeapYear(year)
|
102
|
+
? 29
|
103
|
+
: 28
|
104
|
+
: 31;
|
105
|
+
};
|
106
|
+
/**
|
107
|
+
* Certain locales display month then year while
|
108
|
+
* others display year then month.
|
109
|
+
* We can use Intl.DateTimeFormat to determine
|
110
|
+
* the ordering for each locale.
|
111
|
+
* The formatOptions param can be used to customize
|
112
|
+
* which pieces of a date to compare against the month
|
113
|
+
* with. For example, some locales render dd/mm/yyyy
|
114
|
+
* while others render mm/dd/yyyy. This function can be
|
115
|
+
* used for variations of the same "month first" check.
|
116
|
+
*/
|
117
|
+
const isMonthFirstLocale = (locale, formatOptions = {
|
118
|
+
month: 'numeric',
|
119
|
+
year: 'numeric',
|
120
|
+
}) => {
|
121
|
+
/**
|
122
|
+
* By setting month and year we guarantee that only
|
123
|
+
* month, year, and literal (slashes '/', for example)
|
124
|
+
* values are included in the formatToParts results.
|
125
|
+
*
|
126
|
+
* The ordering of the parts will be determined by
|
127
|
+
* the locale. So if the month is the first value,
|
128
|
+
* then we know month should be shown first. If the
|
129
|
+
* year is the first value, then we know year should be shown first.
|
130
|
+
*
|
131
|
+
* This ordering can be controlled by customizing the locale property.
|
132
|
+
*/
|
133
|
+
const parts = new Intl.DateTimeFormat(locale, formatOptions).formatToParts(new Date());
|
134
|
+
return parts[0].type === 'month';
|
135
|
+
};
|
136
|
+
/**
|
137
|
+
* Determines if the given locale formats the day period (am/pm) to the
|
138
|
+
* left or right of the hour.
|
139
|
+
* @param locale The locale to check.
|
140
|
+
* @returns `true` if the locale formats the day period to the left of the hour.
|
141
|
+
*/
|
142
|
+
const isLocaleDayPeriodRTL = (locale) => {
|
143
|
+
const parts = new Intl.DateTimeFormat(locale, { hour: 'numeric' }).formatToParts(new Date());
|
144
|
+
return parts[0].type === 'dayPeriod';
|
145
|
+
};
|
146
|
+
|
147
|
+
/*!
|
148
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
149
|
+
*/
|
150
|
+
const twoDigit = (val) => {
|
151
|
+
return ('0' + (val !== undefined ? Math.abs(val) : '0')).slice(-2);
|
152
|
+
};
|
153
|
+
const fourDigit = (val) => {
|
154
|
+
return ('000' + (val !== undefined ? Math.abs(val) : '0')).slice(-4);
|
155
|
+
};
|
156
|
+
function convertDataToISO(data) {
|
157
|
+
if (Array.isArray(data)) {
|
158
|
+
return data.map((parts) => convertDataToISO(parts));
|
159
|
+
}
|
160
|
+
// https://www.w3.org/TR/NOTE-datetime
|
161
|
+
let rtn = '';
|
162
|
+
if (data.year !== undefined) {
|
163
|
+
// YYYY
|
164
|
+
rtn = fourDigit(data.year);
|
165
|
+
if (data.month !== undefined) {
|
166
|
+
// YYYY-MM
|
167
|
+
rtn += '-' + twoDigit(data.month);
|
168
|
+
if (data.day !== undefined) {
|
169
|
+
// YYYY-MM-DD
|
170
|
+
rtn += '-' + twoDigit(data.day);
|
171
|
+
if (data.hour !== undefined) {
|
172
|
+
// YYYY-MM-DDTHH:mm:SS
|
173
|
+
rtn += `T${twoDigit(data.hour)}:${twoDigit(data.minute)}:00`;
|
174
|
+
if (data.tzOffset === undefined) {
|
175
|
+
// YYYY-MM-DDTHH:mm:SSZ
|
176
|
+
rtn += 'Z';
|
177
|
+
}
|
178
|
+
else {
|
179
|
+
// YYYY-MM-DDTHH:mm:SS+/-HH:mm
|
180
|
+
rtn +=
|
181
|
+
(data.tzOffset > 0 ? '+' : '-') +
|
182
|
+
twoDigit(Math.floor(Math.abs(data.tzOffset / 60))) +
|
183
|
+
':' +
|
184
|
+
twoDigit(data.tzOffset % 60);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}
|
189
|
+
}
|
190
|
+
else if (data.hour !== undefined) {
|
191
|
+
// HH:mm
|
192
|
+
rtn = twoDigit(data.hour) + ':' + twoDigit(data.minute);
|
193
|
+
}
|
194
|
+
return rtn;
|
195
|
+
}
|
196
|
+
/**
|
197
|
+
* Converts an 12 hour value to 24 hours.
|
198
|
+
*/
|
199
|
+
const convert12HourTo24Hour = (hour, ampm) => {
|
200
|
+
if (ampm === undefined) {
|
201
|
+
return hour;
|
202
|
+
}
|
203
|
+
/**
|
204
|
+
* If AM and 12am
|
205
|
+
* then return 00:00.
|
206
|
+
* Otherwise just return
|
207
|
+
* the hour since it is
|
208
|
+
* already in 24 hour format.
|
209
|
+
*/
|
210
|
+
if (ampm === 'am') {
|
211
|
+
if (hour === 12) {
|
212
|
+
return 0;
|
213
|
+
}
|
214
|
+
return hour;
|
215
|
+
}
|
216
|
+
/**
|
217
|
+
* If PM and 12pm
|
218
|
+
* just return 12:00
|
219
|
+
* since it is already
|
220
|
+
* in 24 hour format.
|
221
|
+
* Otherwise add 12 hours
|
222
|
+
* to the time.
|
223
|
+
*/
|
224
|
+
if (hour === 12) {
|
225
|
+
return 12;
|
226
|
+
}
|
227
|
+
return hour + 12;
|
228
|
+
};
|
229
|
+
const getStartOfWeek = (refParts) => {
|
230
|
+
const { dayOfWeek } = refParts;
|
231
|
+
if (dayOfWeek === null || dayOfWeek === undefined) {
|
232
|
+
throw new Error('No day of week provided');
|
233
|
+
}
|
234
|
+
return subtractDays(refParts, dayOfWeek);
|
235
|
+
};
|
236
|
+
const getEndOfWeek = (refParts) => {
|
237
|
+
const { dayOfWeek } = refParts;
|
238
|
+
if (dayOfWeek === null || dayOfWeek === undefined) {
|
239
|
+
throw new Error('No day of week provided');
|
240
|
+
}
|
241
|
+
return addDays(refParts, 6 - dayOfWeek);
|
242
|
+
};
|
243
|
+
const getNextDay = (refParts) => {
|
244
|
+
return addDays(refParts, 1);
|
245
|
+
};
|
246
|
+
const getPreviousDay = (refParts) => {
|
247
|
+
return subtractDays(refParts, 1);
|
248
|
+
};
|
249
|
+
const getPreviousWeek = (refParts) => {
|
250
|
+
return subtractDays(refParts, 7);
|
251
|
+
};
|
252
|
+
const getNextWeek = (refParts) => {
|
253
|
+
return addDays(refParts, 7);
|
254
|
+
};
|
255
|
+
/**
|
256
|
+
* Given datetime parts, subtract
|
257
|
+
* numDays from the date.
|
258
|
+
* Returns a new DatetimeParts object
|
259
|
+
* Currently can only go backward at most 1 month.
|
260
|
+
*/
|
261
|
+
const subtractDays = (refParts, numDays) => {
|
262
|
+
const { month, day, year } = refParts;
|
263
|
+
if (day === null) {
|
264
|
+
throw new Error('No day provided');
|
265
|
+
}
|
266
|
+
const workingParts = {
|
267
|
+
month,
|
268
|
+
day,
|
269
|
+
year,
|
270
|
+
};
|
271
|
+
workingParts.day = day - numDays;
|
272
|
+
/**
|
273
|
+
* If wrapping to previous month
|
274
|
+
* update days and decrement month
|
275
|
+
*/
|
276
|
+
if (workingParts.day < 1) {
|
277
|
+
workingParts.month -= 1;
|
278
|
+
}
|
279
|
+
/**
|
280
|
+
* If moving to previous year, reset
|
281
|
+
* month to December and decrement year
|
282
|
+
*/
|
283
|
+
if (workingParts.month < 1) {
|
284
|
+
workingParts.month = 12;
|
285
|
+
workingParts.year -= 1;
|
286
|
+
}
|
287
|
+
/**
|
288
|
+
* Determine how many days are in the current
|
289
|
+
* month
|
290
|
+
*/
|
291
|
+
if (workingParts.day < 1) {
|
292
|
+
const daysInMonth = getNumDaysInMonth(workingParts.month, workingParts.year);
|
293
|
+
/**
|
294
|
+
* Take num days in month and add the
|
295
|
+
* number of underflow days. This number will
|
296
|
+
* be negative.
|
297
|
+
* Example: 1 week before Jan 2, 2021 is
|
298
|
+
* December 26, 2021 so:
|
299
|
+
* 2 - 7 = -5
|
300
|
+
* 31 + (-5) = 26
|
301
|
+
*/
|
302
|
+
workingParts.day = daysInMonth + workingParts.day;
|
303
|
+
}
|
304
|
+
return workingParts;
|
305
|
+
};
|
306
|
+
/**
|
307
|
+
* Given datetime parts, add
|
308
|
+
* numDays to the date.
|
309
|
+
* Returns a new DatetimeParts object
|
310
|
+
* Currently can only go forward at most 1 month.
|
311
|
+
*/
|
312
|
+
const addDays = (refParts, numDays) => {
|
313
|
+
const { month, day, year } = refParts;
|
314
|
+
if (day === null) {
|
315
|
+
throw new Error('No day provided');
|
316
|
+
}
|
317
|
+
const workingParts = {
|
318
|
+
month,
|
319
|
+
day,
|
320
|
+
year,
|
321
|
+
};
|
322
|
+
const daysInMonth = getNumDaysInMonth(month, year);
|
323
|
+
workingParts.day = day + numDays;
|
324
|
+
/**
|
325
|
+
* If wrapping to next month
|
326
|
+
* update days and increment month
|
327
|
+
*/
|
328
|
+
if (workingParts.day > daysInMonth) {
|
329
|
+
workingParts.day -= daysInMonth;
|
330
|
+
workingParts.month += 1;
|
331
|
+
}
|
332
|
+
/**
|
333
|
+
* If moving to next year, reset
|
334
|
+
* month to January and increment year
|
335
|
+
*/
|
336
|
+
if (workingParts.month > 12) {
|
337
|
+
workingParts.month = 1;
|
338
|
+
workingParts.year += 1;
|
339
|
+
}
|
340
|
+
return workingParts;
|
341
|
+
};
|
342
|
+
/**
|
343
|
+
* Given DatetimeParts, generate the previous month.
|
344
|
+
*/
|
345
|
+
const getPreviousMonth = (refParts) => {
|
346
|
+
/**
|
347
|
+
* If current month is January, wrap backwards
|
348
|
+
* to December of the previous year.
|
349
|
+
*/
|
350
|
+
const month = refParts.month === 1 ? 12 : refParts.month - 1;
|
351
|
+
const year = refParts.month === 1 ? refParts.year - 1 : refParts.year;
|
352
|
+
const numDaysInMonth = getNumDaysInMonth(month, year);
|
353
|
+
const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
|
354
|
+
return { month, year, day };
|
355
|
+
};
|
356
|
+
/**
|
357
|
+
* Given DatetimeParts, generate the next month.
|
358
|
+
*/
|
359
|
+
const getNextMonth = (refParts) => {
|
360
|
+
/**
|
361
|
+
* If current month is December, wrap forwards
|
362
|
+
* to January of the next year.
|
363
|
+
*/
|
364
|
+
const month = refParts.month === 12 ? 1 : refParts.month + 1;
|
365
|
+
const year = refParts.month === 12 ? refParts.year + 1 : refParts.year;
|
366
|
+
const numDaysInMonth = getNumDaysInMonth(month, year);
|
367
|
+
const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
|
368
|
+
return { month, year, day };
|
369
|
+
};
|
370
|
+
const changeYear = (refParts, yearDelta) => {
|
371
|
+
const month = refParts.month;
|
372
|
+
const year = refParts.year + yearDelta;
|
373
|
+
const numDaysInMonth = getNumDaysInMonth(month, year);
|
374
|
+
const day = numDaysInMonth < refParts.day ? numDaysInMonth : refParts.day;
|
375
|
+
return { month, year, day };
|
376
|
+
};
|
377
|
+
/**
|
378
|
+
* Given DatetimeParts, generate the previous year.
|
379
|
+
*/
|
380
|
+
const getPreviousYear = (refParts) => {
|
381
|
+
return changeYear(refParts, -1);
|
382
|
+
};
|
383
|
+
/**
|
384
|
+
* Given DatetimeParts, generate the next year.
|
385
|
+
*/
|
386
|
+
const getNextYear = (refParts) => {
|
387
|
+
return changeYear(refParts, 1);
|
388
|
+
};
|
389
|
+
/**
|
390
|
+
* If PM, then internal value should
|
391
|
+
* be converted to 24-hr time.
|
392
|
+
* Does not apply when public
|
393
|
+
* values are already 24-hr time.
|
394
|
+
*/
|
395
|
+
const getInternalHourValue = (hour, use24Hour, ampm) => {
|
396
|
+
if (use24Hour) {
|
397
|
+
return hour;
|
398
|
+
}
|
399
|
+
return convert12HourTo24Hour(hour, ampm);
|
400
|
+
};
|
401
|
+
/**
|
402
|
+
* Unless otherwise stated, all month values are
|
403
|
+
* 1 indexed instead of the typical 0 index in JS Date.
|
404
|
+
* Example:
|
405
|
+
* January = Month 0 when using JS Date
|
406
|
+
* January = Month 1 when using this datetime util
|
407
|
+
*/
|
408
|
+
/**
|
409
|
+
* Given the current datetime parts and a new AM/PM value
|
410
|
+
* calculate what the hour should be in 24-hour time format.
|
411
|
+
* Used when toggling the AM/PM segment since we store our hours
|
412
|
+
* in 24-hour time format internally.
|
413
|
+
*/
|
414
|
+
const calculateHourFromAMPM = (currentParts, newAMPM) => {
|
415
|
+
const { ampm: currentAMPM, hour } = currentParts;
|
416
|
+
let newHour = hour;
|
417
|
+
/**
|
418
|
+
* If going from AM --> PM, need to update the
|
419
|
+
*
|
420
|
+
*/
|
421
|
+
if (currentAMPM === 'am' && newAMPM === 'pm') {
|
422
|
+
newHour = convert12HourTo24Hour(newHour, 'pm');
|
423
|
+
/**
|
424
|
+
* If going from PM --> AM
|
425
|
+
*/
|
426
|
+
}
|
427
|
+
else if (currentAMPM === 'pm' && newAMPM === 'am') {
|
428
|
+
newHour = Math.abs(newHour - 12);
|
429
|
+
}
|
430
|
+
return newHour;
|
431
|
+
};
|
432
|
+
|
433
|
+
/*!
|
434
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
435
|
+
*/
|
436
|
+
const getFormattedDayPeriod = (dayPeriod) => {
|
437
|
+
if (dayPeriod === undefined) {
|
438
|
+
return '';
|
439
|
+
}
|
440
|
+
return dayPeriod.toUpperCase();
|
441
|
+
};
|
442
|
+
const getLocalizedTime = (locale, refParts, use24Hour) => {
|
443
|
+
if (refParts.hour === undefined || refParts.minute === undefined) {
|
444
|
+
return 'Invalid Time';
|
445
|
+
}
|
446
|
+
return new Intl.DateTimeFormat(locale, {
|
447
|
+
hour: 'numeric',
|
448
|
+
minute: 'numeric',
|
449
|
+
timeZone: 'UTC',
|
450
|
+
hour12: !use24Hour,
|
451
|
+
}).format(new Date(convertDataToISO(Object.assign(Object.assign({}, refParts), {
|
452
|
+
// TODO: FW-1831 will remove the need to manually set the tzOffset to undefined
|
453
|
+
tzOffset: undefined }))));
|
454
|
+
};
|
455
|
+
/**
|
456
|
+
* Adds padding to a time value so
|
457
|
+
* that it is always 2 digits.
|
458
|
+
*/
|
459
|
+
const addTimePadding = (value) => {
|
460
|
+
const valueToString = value.toString();
|
461
|
+
if (valueToString.length > 1) {
|
462
|
+
return valueToString;
|
463
|
+
}
|
464
|
+
return `0${valueToString}`;
|
465
|
+
};
|
466
|
+
/**
|
467
|
+
* Formats the hour value so that it
|
468
|
+
* is always 2 digits. Only applies
|
469
|
+
* if using 12 hour format.
|
470
|
+
*/
|
471
|
+
const getFormattedHour = (hour, use24Hour) => {
|
472
|
+
if (!use24Hour) {
|
473
|
+
return hour.toString();
|
474
|
+
}
|
475
|
+
return addTimePadding(hour);
|
476
|
+
};
|
477
|
+
/**
|
478
|
+
* Generates an aria-label to be read by screen readers
|
479
|
+
* given a local, a date, and whether or not that date is
|
480
|
+
* today's date.
|
481
|
+
*/
|
482
|
+
const generateDayAriaLabel = (locale, today, refParts) => {
|
483
|
+
if (refParts.day === null) {
|
484
|
+
return null;
|
485
|
+
}
|
486
|
+
/**
|
487
|
+
* MM/DD/YYYY will return midnight in the user's timezone.
|
488
|
+
*/
|
489
|
+
const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
|
490
|
+
const labelString = new Intl.DateTimeFormat(locale, {
|
491
|
+
weekday: 'long',
|
492
|
+
month: 'long',
|
493
|
+
day: 'numeric',
|
494
|
+
timeZone: 'UTC',
|
495
|
+
}).format(date);
|
496
|
+
/**
|
497
|
+
* If date is today, prepend "Today" so screen readers indicate
|
498
|
+
* that the date is today.
|
499
|
+
*/
|
500
|
+
return today ? `Today, ${labelString}` : labelString;
|
501
|
+
};
|
502
|
+
/**
|
503
|
+
* Gets the day of the week, month, and day
|
504
|
+
* Used for the header in MD mode.
|
505
|
+
*/
|
506
|
+
const getMonthAndDay = (locale, refParts) => {
|
507
|
+
const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
|
508
|
+
return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
|
509
|
+
};
|
510
|
+
/**
|
511
|
+
* Given a locale and a date object,
|
512
|
+
* return a formatted string that includes
|
513
|
+
* the month name and full year.
|
514
|
+
* Example: May 2021
|
515
|
+
*/
|
516
|
+
const getMonthAndYear = (locale, refParts) => {
|
517
|
+
const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year} GMT+0000`);
|
518
|
+
return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
|
519
|
+
};
|
520
|
+
/**
|
521
|
+
* Given a locale and a date object,
|
522
|
+
* return a formatted string that includes
|
523
|
+
* the short month, numeric day, and full year.
|
524
|
+
* Example: Apr 22, 2021
|
525
|
+
*/
|
526
|
+
const getMonthDayAndYear = (locale, refParts) => {
|
527
|
+
return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
|
528
|
+
};
|
529
|
+
/**
|
530
|
+
* Wrapper function for Intl.DateTimeFormat.
|
531
|
+
* Allows developers to apply an allowed format to DatetimeParts.
|
532
|
+
* This function also has built in safeguards for older browser bugs
|
533
|
+
* with Intl.DateTimeFormat.
|
534
|
+
*/
|
535
|
+
const getLocalizedDateTime = (locale, refParts, options) => {
|
536
|
+
const timeString = !!refParts.hour && !!refParts.minute ? ` ${refParts.hour}:${refParts.minute}` : '';
|
537
|
+
const date = new Date(`${refParts.month}/${refParts.day}/${refParts.year}${timeString} GMT+0000`);
|
538
|
+
return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, options), { timeZone: 'UTC' })).format(date);
|
539
|
+
};
|
540
|
+
/**
|
541
|
+
* Gets a localized version of "Today"
|
542
|
+
* Falls back to "Today" in English for
|
543
|
+
* browsers that do not support RelativeTimeFormat.
|
544
|
+
*/
|
545
|
+
const getTodayLabel = (locale) => {
|
546
|
+
if ('RelativeTimeFormat' in Intl) {
|
547
|
+
const label = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day');
|
548
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
549
|
+
}
|
550
|
+
else {
|
551
|
+
return 'Today';
|
552
|
+
}
|
553
|
+
};
|
554
|
+
/**
|
555
|
+
* When calling toISOString(), the browser
|
556
|
+
* will convert the date to UTC time by either adding
|
557
|
+
* or subtracting the time zone offset.
|
558
|
+
* To work around this, we need to either add
|
559
|
+
* or subtract the time zone offset to the Date
|
560
|
+
* object prior to calling toISOString().
|
561
|
+
* This allows us to get an ISO string
|
562
|
+
* that is in the user's time zone.
|
563
|
+
*
|
564
|
+
* Example:
|
565
|
+
* Time zone offset is 240
|
566
|
+
* Meaning: The browser needs to add 240 minutes
|
567
|
+
* to the Date object to get UTC time.
|
568
|
+
* What Ionic does: We subtract 240 minutes
|
569
|
+
* from the Date object. The browser then adds
|
570
|
+
* 240 minutes in toISOString(). The result
|
571
|
+
* is a time that is in the user's time zone
|
572
|
+
* and not UTC.
|
573
|
+
*
|
574
|
+
* Note: Some timezones include minute adjustments
|
575
|
+
* such as 30 or 45 minutes. This is why we use setMinutes
|
576
|
+
* instead of setHours.
|
577
|
+
* Example: India Standard Time
|
578
|
+
* Timezone offset: -330 = -5.5 hours.
|
579
|
+
*
|
580
|
+
* List of timezones with 30 and 45 minute timezones:
|
581
|
+
* https://www.timeanddate.com/time/time-zones-interesting.html
|
582
|
+
*/
|
583
|
+
const removeDateTzOffset = (date) => {
|
584
|
+
const tzOffset = date.getTimezoneOffset();
|
585
|
+
date.setMinutes(date.getMinutes() - tzOffset);
|
586
|
+
return date;
|
587
|
+
};
|
588
|
+
const DATE_AM = removeDateTzOffset(new Date('2022T01:00'));
|
589
|
+
const DATE_PM = removeDateTzOffset(new Date('2022T13:00'));
|
590
|
+
/**
|
591
|
+
* Formats the locale's string representation of the day period (am/pm) for a given
|
592
|
+
* ref parts day period.
|
593
|
+
*
|
594
|
+
* @param locale The locale to format the day period in.
|
595
|
+
* @param value The date string, in ISO format.
|
596
|
+
* @returns The localized day period (am/pm) representation of the given value.
|
597
|
+
*/
|
598
|
+
const getLocalizedDayPeriod = (locale, dayPeriod) => {
|
599
|
+
const date = dayPeriod === 'am' ? DATE_AM : DATE_PM;
|
600
|
+
const localizedDayPeriod = new Intl.DateTimeFormat(locale, {
|
601
|
+
hour: 'numeric',
|
602
|
+
timeZone: 'UTC',
|
603
|
+
})
|
604
|
+
.formatToParts(date)
|
605
|
+
.find((part) => part.type === 'dayPeriod');
|
606
|
+
if (localizedDayPeriod) {
|
607
|
+
return localizedDayPeriod.value;
|
608
|
+
}
|
609
|
+
return getFormattedDayPeriod(dayPeriod);
|
610
|
+
};
|
611
|
+
/**
|
612
|
+
* Formats the datetime's value to a string, for use in the native input.
|
613
|
+
*
|
614
|
+
* @param value The value to format, either an ISO string or an array thereof.
|
615
|
+
*/
|
616
|
+
const formatValue = (value) => {
|
617
|
+
return Array.isArray(value) ? value.join(',') : value;
|
618
|
+
};
|
619
|
+
|
620
|
+
/*!
|
621
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
622
|
+
*/
|
623
|
+
/**
|
624
|
+
* Returns the current date as
|
625
|
+
* an ISO string in the user's
|
626
|
+
* time zone.
|
627
|
+
*/
|
628
|
+
const getToday = () => {
|
629
|
+
/**
|
630
|
+
* ion-datetime intentionally does not
|
631
|
+
* parse time zones/do automatic time zone
|
632
|
+
* conversion when accepting user input.
|
633
|
+
* However when we get today's date string,
|
634
|
+
* we want it formatted relative to the user's
|
635
|
+
* time zone.
|
636
|
+
*
|
637
|
+
* When calling toISOString(), the browser
|
638
|
+
* will convert the date to UTC time by either adding
|
639
|
+
* or subtracting the time zone offset.
|
640
|
+
* To work around this, we need to either add
|
641
|
+
* or subtract the time zone offset to the Date
|
642
|
+
* object prior to calling toISOString().
|
643
|
+
* This allows us to get an ISO string
|
644
|
+
* that is in the user's time zone.
|
645
|
+
*/
|
646
|
+
return removeDateTzOffset(new Date()).toISOString();
|
647
|
+
};
|
648
|
+
const minutes = [
|
649
|
+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
650
|
+
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
|
651
|
+
];
|
652
|
+
const hour12 = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
653
|
+
const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
654
|
+
/**
|
655
|
+
* Given a locale and a mode,
|
656
|
+
* return an array with formatted days
|
657
|
+
* of the week. iOS should display days
|
658
|
+
* such as "Mon" or "Tue".
|
659
|
+
* MD should display days such as "M"
|
660
|
+
* or "T".
|
661
|
+
*/
|
662
|
+
const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
|
663
|
+
/**
|
664
|
+
* Nov 1st, 2020 starts on a Sunday.
|
665
|
+
* ion-datetime assumes weeks start on Sunday,
|
666
|
+
* but is configurable via `firstDayOfWeek`.
|
667
|
+
*/
|
668
|
+
const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
|
669
|
+
const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
|
670
|
+
const startDate = new Date('11/01/2020');
|
671
|
+
const daysOfWeek = [];
|
672
|
+
/**
|
673
|
+
* For each day of the week,
|
674
|
+
* get the day name.
|
675
|
+
*/
|
676
|
+
for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
|
677
|
+
const currentDate = new Date(startDate);
|
678
|
+
currentDate.setDate(currentDate.getDate() + i);
|
679
|
+
daysOfWeek.push(intl.format(currentDate));
|
680
|
+
}
|
681
|
+
return daysOfWeek;
|
682
|
+
};
|
683
|
+
/**
|
684
|
+
* Returns an array containing all of the
|
685
|
+
* days in a month for a given year. Values are
|
686
|
+
* aligned with a week calendar starting on
|
687
|
+
* the firstDayOfWeek value (Sunday by default)
|
688
|
+
* using null values.
|
689
|
+
*/
|
690
|
+
const getDaysOfMonth = (month, year, firstDayOfWeek) => {
|
691
|
+
const numDays = getNumDaysInMonth(month, year);
|
692
|
+
const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
|
693
|
+
/**
|
694
|
+
* To get the first day of the month aligned on the correct
|
695
|
+
* day of the week, we need to determine how many "filler" days
|
696
|
+
* to generate. These filler days as empty/disabled buttons
|
697
|
+
* that fill the space of the days of the week before the first
|
698
|
+
* of the month.
|
699
|
+
*
|
700
|
+
* There are two cases here:
|
701
|
+
*
|
702
|
+
* 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
|
703
|
+
* is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
|
704
|
+
* this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
|
705
|
+
* the first day of the month.
|
706
|
+
*
|
707
|
+
* 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
|
708
|
+
* is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
|
709
|
+
* this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
|
710
|
+
* the first day of the month.
|
711
|
+
*/
|
712
|
+
const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
|
713
|
+
let days = [];
|
714
|
+
for (let i = 1; i <= numDays; i++) {
|
715
|
+
days.push({ day: i, dayOfWeek: (offset + i) % 7 });
|
716
|
+
}
|
717
|
+
for (let i = 0; i <= offset; i++) {
|
718
|
+
days = [{ day: null, dayOfWeek: null }, ...days];
|
719
|
+
}
|
720
|
+
return days;
|
721
|
+
};
|
722
|
+
/**
|
723
|
+
* Given a local, reference datetime parts and option
|
724
|
+
* max/min bound datetime parts, calculate the acceptable
|
725
|
+
* hour and minute values according to the bounds and locale.
|
726
|
+
*/
|
727
|
+
const generateTime = (refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
728
|
+
const use24Hour = hourCycle === 'h23';
|
729
|
+
let processedHours = use24Hour ? hour23 : hour12;
|
730
|
+
let processedMinutes = minutes;
|
731
|
+
let isAMAllowed = true;
|
732
|
+
let isPMAllowed = true;
|
733
|
+
if (hourValues) {
|
734
|
+
processedHours = processedHours.filter((hour) => hourValues.includes(hour));
|
735
|
+
}
|
736
|
+
if (minuteValues) {
|
737
|
+
processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
|
738
|
+
}
|
739
|
+
if (minParts) {
|
740
|
+
/**
|
741
|
+
* If ref day is the same as the
|
742
|
+
* minimum allowed day, filter hour/minute
|
743
|
+
* values according to min hour and minute.
|
744
|
+
*/
|
745
|
+
if (isSameDay(refParts, minParts)) {
|
746
|
+
/**
|
747
|
+
* Users may not always set the hour/minute for
|
748
|
+
* min value (i.e. 2021-06-02) so we should allow
|
749
|
+
* all hours/minutes in that case.
|
750
|
+
*/
|
751
|
+
if (minParts.hour !== undefined) {
|
752
|
+
processedHours = processedHours.filter((hour) => {
|
753
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
754
|
+
return (use24Hour ? hour : convertedHour) >= minParts.hour;
|
755
|
+
});
|
756
|
+
isAMAllowed = minParts.hour < 13;
|
757
|
+
}
|
758
|
+
if (minParts.minute !== undefined) {
|
759
|
+
/**
|
760
|
+
* The minimum minute range should not be enforced when
|
761
|
+
* the hour is greater than the min hour.
|
762
|
+
*
|
763
|
+
* For example with a minimum range of 09:30, users
|
764
|
+
* should be able to select 10:00-10:29 and beyond.
|
765
|
+
*/
|
766
|
+
let isPastMinHour = false;
|
767
|
+
if (minParts.hour !== undefined && refParts.hour !== undefined) {
|
768
|
+
if (refParts.hour > minParts.hour) {
|
769
|
+
isPastMinHour = true;
|
770
|
+
}
|
771
|
+
}
|
772
|
+
processedMinutes = processedMinutes.filter((minute) => {
|
773
|
+
if (isPastMinHour) {
|
774
|
+
return true;
|
775
|
+
}
|
776
|
+
return minute >= minParts.minute;
|
777
|
+
});
|
778
|
+
}
|
779
|
+
/**
|
780
|
+
* If ref day is before minimum
|
781
|
+
* day do not render any hours/minute values
|
782
|
+
*/
|
783
|
+
}
|
784
|
+
else if (isBefore(refParts, minParts)) {
|
785
|
+
processedHours = [];
|
786
|
+
processedMinutes = [];
|
787
|
+
isAMAllowed = isPMAllowed = false;
|
788
|
+
}
|
789
|
+
}
|
790
|
+
if (maxParts) {
|
791
|
+
/**
|
792
|
+
* If ref day is the same as the
|
793
|
+
* maximum allowed day, filter hour/minute
|
794
|
+
* values according to max hour and minute.
|
795
|
+
*/
|
796
|
+
if (isSameDay(refParts, maxParts)) {
|
797
|
+
/**
|
798
|
+
* Users may not always set the hour/minute for
|
799
|
+
* max value (i.e. 2021-06-02) so we should allow
|
800
|
+
* all hours/minutes in that case.
|
801
|
+
*/
|
802
|
+
if (maxParts.hour !== undefined) {
|
803
|
+
processedHours = processedHours.filter((hour) => {
|
804
|
+
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
805
|
+
return (use24Hour ? hour : convertedHour) <= maxParts.hour;
|
806
|
+
});
|
807
|
+
isPMAllowed = maxParts.hour >= 13;
|
808
|
+
}
|
809
|
+
if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
|
810
|
+
// The available minutes should only be filtered when the hour is the same as the max hour.
|
811
|
+
// For example if the max hour is 10:30 and the current hour is 10:00,
|
812
|
+
// users should be able to select 00-30 minutes.
|
813
|
+
// If the current hour is 09:00, users should be able to select 00-60 minutes.
|
814
|
+
processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
|
815
|
+
}
|
816
|
+
/**
|
817
|
+
* If ref day is after minimum
|
818
|
+
* day do not render any hours/minute values
|
819
|
+
*/
|
820
|
+
}
|
821
|
+
else if (isAfter(refParts, maxParts)) {
|
822
|
+
processedHours = [];
|
823
|
+
processedMinutes = [];
|
824
|
+
isAMAllowed = isPMAllowed = false;
|
825
|
+
}
|
826
|
+
}
|
827
|
+
return {
|
828
|
+
hours: processedHours,
|
829
|
+
minutes: processedMinutes,
|
830
|
+
am: isAMAllowed,
|
831
|
+
pm: isPMAllowed,
|
832
|
+
};
|
833
|
+
};
|
834
|
+
/**
|
835
|
+
* Given DatetimeParts, generate the previous,
|
836
|
+
* current, and and next months.
|
837
|
+
*/
|
838
|
+
const generateMonths = (refParts) => {
|
839
|
+
return [
|
840
|
+
getPreviousMonth(refParts),
|
841
|
+
{ month: refParts.month, year: refParts.year, day: refParts.day },
|
842
|
+
getNextMonth(refParts),
|
843
|
+
];
|
844
|
+
};
|
845
|
+
const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
846
|
+
month: 'long',
|
847
|
+
}) => {
|
848
|
+
const { year } = refParts;
|
849
|
+
const months = [];
|
850
|
+
if (monthValues !== undefined) {
|
851
|
+
let processedMonths = monthValues;
|
852
|
+
if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
|
853
|
+
processedMonths = processedMonths.filter((month) => month <= maxParts.month);
|
854
|
+
}
|
855
|
+
if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
|
856
|
+
processedMonths = processedMonths.filter((month) => month >= minParts.month);
|
857
|
+
}
|
858
|
+
processedMonths.forEach((processedMonth) => {
|
859
|
+
const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
|
860
|
+
const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
861
|
+
months.push({ text: monthString, value: processedMonth });
|
862
|
+
});
|
863
|
+
}
|
864
|
+
else {
|
865
|
+
const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
|
866
|
+
const minMonth = minParts && minParts.year === year ? minParts.month : 1;
|
867
|
+
for (let i = minMonth; i <= maxMonth; i++) {
|
868
|
+
/**
|
869
|
+
*
|
870
|
+
* There is a bug on iOS 14 where
|
871
|
+
* Intl.DateTimeFormat takes into account
|
872
|
+
* the local timezone offset when formatting dates.
|
873
|
+
*
|
874
|
+
* Forcing the timezone to 'UTC' fixes the issue. However,
|
875
|
+
* we should keep this workaround as it is safer. In the event
|
876
|
+
* this breaks in another browser, we will not be impacted
|
877
|
+
* because all dates will be interpreted in UTC.
|
878
|
+
*
|
879
|
+
* Example:
|
880
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
|
881
|
+
* new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
|
882
|
+
*
|
883
|
+
* In certain timezones, iOS 14 shows the wrong
|
884
|
+
* date for .toUTCString(). To combat this, we
|
885
|
+
* force all of the timezones to GMT+0000 (UTC).
|
886
|
+
*
|
887
|
+
* Example:
|
888
|
+
* Time Zone: Central European Standard Time
|
889
|
+
* new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
|
890
|
+
* new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
|
891
|
+
*/
|
892
|
+
const date = new Date(`${i}/1/${year} GMT+0000`);
|
893
|
+
const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
894
|
+
months.push({ text: monthString, value: i });
|
895
|
+
}
|
896
|
+
}
|
897
|
+
return months;
|
898
|
+
};
|
899
|
+
/**
|
900
|
+
* Returns information regarding
|
901
|
+
* selectable dates (i.e 1st, 2nd, 3rd, etc)
|
902
|
+
* within a reference month.
|
903
|
+
* @param locale The locale to format the date with
|
904
|
+
* @param refParts The reference month/year to generate dates for
|
905
|
+
* @param minParts The minimum bound on the date that can be returned
|
906
|
+
* @param maxParts The maximum bound on the date that can be returned
|
907
|
+
* @param dayValues The allowed date values
|
908
|
+
* @returns Date data to be used in ion-picker-column-internal
|
909
|
+
*/
|
910
|
+
const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
|
911
|
+
day: 'numeric',
|
912
|
+
}) => {
|
913
|
+
const { month, year } = refParts;
|
914
|
+
const days = [];
|
915
|
+
/**
|
916
|
+
* If we have max/min bounds that in the same
|
917
|
+
* month/year as the refParts, we should
|
918
|
+
* use the define day as the max/min day.
|
919
|
+
* Otherwise, fallback to the max/min days in a month.
|
920
|
+
*/
|
921
|
+
const numDaysInMonth = getNumDaysInMonth(month, year);
|
922
|
+
const maxDay = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) && maxParts.year === year && maxParts.month === month ? maxParts.day : numDaysInMonth;
|
923
|
+
const minDay = (minParts === null || minParts === void 0 ? void 0 : minParts.day) && minParts.year === year && minParts.month === month ? minParts.day : 1;
|
924
|
+
if (dayValues !== undefined) {
|
925
|
+
let processedDays = dayValues;
|
926
|
+
processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
|
927
|
+
processedDays.forEach((processedDay) => {
|
928
|
+
const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
|
929
|
+
const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
930
|
+
days.push({ text: dayString, value: processedDay });
|
931
|
+
});
|
932
|
+
}
|
933
|
+
else {
|
934
|
+
for (let i = minDay; i <= maxDay; i++) {
|
935
|
+
const date = new Date(`${month}/${i}/${year} GMT+0000`);
|
936
|
+
const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
937
|
+
days.push({ text: dayString, value: i });
|
938
|
+
}
|
939
|
+
}
|
940
|
+
return days;
|
941
|
+
};
|
942
|
+
const getYearColumnData = (refParts, minParts, maxParts, yearValues) => {
|
943
|
+
let processedYears = [];
|
944
|
+
if (yearValues !== undefined) {
|
945
|
+
processedYears = yearValues;
|
946
|
+
if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
|
947
|
+
processedYears = processedYears.filter((year) => year <= maxParts.year);
|
948
|
+
}
|
949
|
+
if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
|
950
|
+
processedYears = processedYears.filter((year) => year >= minParts.year);
|
951
|
+
}
|
952
|
+
}
|
953
|
+
else {
|
954
|
+
const { year } = refParts;
|
955
|
+
const maxYear = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) || year;
|
956
|
+
const minYear = (minParts === null || minParts === void 0 ? void 0 : minParts.year) || year - 100;
|
957
|
+
for (let i = maxYear; i >= minYear; i--) {
|
958
|
+
processedYears.push(i);
|
959
|
+
}
|
960
|
+
}
|
961
|
+
return processedYears.map((year) => ({
|
962
|
+
text: `${year}`,
|
963
|
+
value: year,
|
964
|
+
}));
|
965
|
+
};
|
966
|
+
/**
|
967
|
+
* Given a starting date and an upper bound,
|
968
|
+
* this functions returns an array of all
|
969
|
+
* month objects in that range.
|
970
|
+
*/
|
971
|
+
const getAllMonthsInRange = (currentParts, maxParts) => {
|
972
|
+
if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
|
973
|
+
return [currentParts];
|
974
|
+
}
|
975
|
+
return [currentParts, ...getAllMonthsInRange(getNextMonth(currentParts), maxParts)];
|
976
|
+
};
|
977
|
+
/**
|
978
|
+
* Creates and returns picker items
|
979
|
+
* that represent the days in a month.
|
980
|
+
* Example: "Thu, Jun 2"
|
981
|
+
*/
|
982
|
+
const getCombinedDateColumnData = (locale, refParts, todayParts, minParts, maxParts, dayValues, monthValues) => {
|
983
|
+
let items = [];
|
984
|
+
let parts = [];
|
985
|
+
/**
|
986
|
+
* Get all month objects from the min date
|
987
|
+
* to the max date. Note: Do not use getMonthColumnData
|
988
|
+
* as that function only generates dates within a
|
989
|
+
* single year.
|
990
|
+
*/
|
991
|
+
let months = getAllMonthsInRange(minParts, maxParts);
|
992
|
+
/**
|
993
|
+
* Filter out any disallowed month values.
|
994
|
+
*/
|
995
|
+
if (monthValues) {
|
996
|
+
months = months.filter(({ month }) => monthValues.includes(month));
|
997
|
+
}
|
998
|
+
/**
|
999
|
+
* Get all of the days in the month.
|
1000
|
+
* From there, generate an array where
|
1001
|
+
* each item has the month, date, and day
|
1002
|
+
* of work as the text.
|
1003
|
+
*/
|
1004
|
+
months.forEach((monthObject) => {
|
1005
|
+
const referenceMonth = { month: monthObject.month, day: null, year: refParts.year };
|
1006
|
+
const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
|
1007
|
+
month: 'short',
|
1008
|
+
day: 'numeric',
|
1009
|
+
weekday: 'short',
|
1010
|
+
});
|
1011
|
+
const dateParts = [];
|
1012
|
+
const dateColumnItems = [];
|
1013
|
+
monthDays.forEach((dayObject) => {
|
1014
|
+
const isToday = isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
|
1015
|
+
/**
|
1016
|
+
* Today's date should read as "Today" (localized)
|
1017
|
+
* not the actual date string
|
1018
|
+
*/
|
1019
|
+
dateColumnItems.push({
|
1020
|
+
text: isToday ? getTodayLabel(locale) : dayObject.text,
|
1021
|
+
value: `${refParts.year}-${monthObject.month}-${dayObject.value}`,
|
1022
|
+
});
|
1023
|
+
/**
|
1024
|
+
* When selecting a date in the wheel picker
|
1025
|
+
* we need access to the raw datetime parts data.
|
1026
|
+
* The picker column only accepts values of
|
1027
|
+
* type string or number, so we need to return
|
1028
|
+
* two sets of data: A data set to be passed
|
1029
|
+
* to the picker column, and a data set to
|
1030
|
+
* be used to reference the raw data when
|
1031
|
+
* updating the picker column value.
|
1032
|
+
*/
|
1033
|
+
dateParts.push({
|
1034
|
+
month: monthObject.month,
|
1035
|
+
year: refParts.year,
|
1036
|
+
day: dayObject.value,
|
1037
|
+
});
|
1038
|
+
});
|
1039
|
+
parts = [...parts, ...dateParts];
|
1040
|
+
items = [...items, ...dateColumnItems];
|
1041
|
+
});
|
1042
|
+
return {
|
1043
|
+
parts,
|
1044
|
+
items,
|
1045
|
+
};
|
1046
|
+
};
|
1047
|
+
const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteVaues) => {
|
1048
|
+
const use24Hour = is24Hour(locale, hourCycle);
|
1049
|
+
const { hours, minutes, am, pm } = generateTime(refParts, use24Hour ? 'h23' : 'h12', minParts, maxParts, allowedHourValues, allowedMinuteVaues);
|
1050
|
+
const hoursItems = hours.map((hour) => {
|
1051
|
+
return {
|
1052
|
+
text: getFormattedHour(hour, use24Hour),
|
1053
|
+
value: getInternalHourValue(hour, use24Hour, refParts.ampm),
|
1054
|
+
};
|
1055
|
+
});
|
1056
|
+
const minutesItems = minutes.map((minute) => {
|
1057
|
+
return {
|
1058
|
+
text: addTimePadding(minute),
|
1059
|
+
value: minute,
|
1060
|
+
};
|
1061
|
+
});
|
1062
|
+
const dayPeriodItems = [];
|
1063
|
+
if (am && !use24Hour) {
|
1064
|
+
dayPeriodItems.push({
|
1065
|
+
text: getLocalizedDayPeriod(locale, 'am'),
|
1066
|
+
value: 'am',
|
1067
|
+
});
|
1068
|
+
}
|
1069
|
+
if (pm && !use24Hour) {
|
1070
|
+
dayPeriodItems.push({
|
1071
|
+
text: getLocalizedDayPeriod(locale, 'pm'),
|
1072
|
+
value: 'pm',
|
1073
|
+
});
|
1074
|
+
}
|
1075
|
+
return {
|
1076
|
+
minutesData: minutesItems,
|
1077
|
+
hoursData: hoursItems,
|
1078
|
+
dayPeriodData: dayPeriodItems,
|
1079
|
+
};
|
1080
|
+
};
|
1081
|
+
|
1082
|
+
/*!
|
1083
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
1084
|
+
*/
|
1085
|
+
const ISO_8601_REGEXP =
|
1086
|
+
// eslint-disable-next-line no-useless-escape
|
1087
|
+
/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
|
1088
|
+
// eslint-disable-next-line no-useless-escape
|
1089
|
+
const TIME_REGEXP = /^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
|
1090
|
+
/**
|
1091
|
+
* Use to convert a string of comma separated numbers or
|
1092
|
+
* an array of numbers, and clean up any user input
|
1093
|
+
*/
|
1094
|
+
const convertToArrayOfNumbers = (input) => {
|
1095
|
+
if (input === undefined) {
|
1096
|
+
return;
|
1097
|
+
}
|
1098
|
+
let processedInput = input;
|
1099
|
+
if (typeof input === 'string') {
|
1100
|
+
// convert the string to an array of strings
|
1101
|
+
// auto remove any whitespace and [] characters
|
1102
|
+
processedInput = input.replace(/\[|\]|\s/g, '').split(',');
|
1103
|
+
}
|
1104
|
+
let values;
|
1105
|
+
if (Array.isArray(processedInput)) {
|
1106
|
+
// ensure each value is an actual number in the returned array
|
1107
|
+
values = processedInput.map((num) => parseInt(num, 10)).filter(isFinite);
|
1108
|
+
}
|
1109
|
+
else {
|
1110
|
+
values = [processedInput];
|
1111
|
+
}
|
1112
|
+
return values;
|
1113
|
+
};
|
1114
|
+
/**
|
1115
|
+
* Extracts date information
|
1116
|
+
* from a .calendar-day element
|
1117
|
+
* into DatetimeParts.
|
1118
|
+
*/
|
1119
|
+
const getPartsFromCalendarDay = (el) => {
|
1120
|
+
return {
|
1121
|
+
month: parseInt(el.getAttribute('data-month'), 10),
|
1122
|
+
day: parseInt(el.getAttribute('data-day'), 10),
|
1123
|
+
year: parseInt(el.getAttribute('data-year'), 10),
|
1124
|
+
dayOfWeek: parseInt(el.getAttribute('data-day-of-week'), 10),
|
1125
|
+
};
|
1126
|
+
};
|
1127
|
+
function parseDate(val) {
|
1128
|
+
if (Array.isArray(val)) {
|
1129
|
+
return val.map((valStr) => parseDate(valStr));
|
1130
|
+
}
|
1131
|
+
// manually parse IS0 cuz Date.parse cannot be trusted
|
1132
|
+
// ISO 8601 format: 1994-12-15T13:47:20Z
|
1133
|
+
let parse = null;
|
1134
|
+
if (val != null && val !== '') {
|
1135
|
+
// try parsing for just time first, HH:MM
|
1136
|
+
parse = TIME_REGEXP.exec(val);
|
1137
|
+
if (parse) {
|
1138
|
+
// adjust the array so it fits nicely with the datetime parse
|
1139
|
+
parse.unshift(undefined, undefined);
|
1140
|
+
parse[2] = parse[3] = undefined;
|
1141
|
+
}
|
1142
|
+
else {
|
1143
|
+
// try parsing for full ISO datetime
|
1144
|
+
parse = ISO_8601_REGEXP.exec(val);
|
1145
|
+
}
|
1146
|
+
}
|
1147
|
+
if (parse === null) {
|
1148
|
+
// wasn't able to parse the ISO datetime
|
1149
|
+
return undefined;
|
1150
|
+
}
|
1151
|
+
// ensure all the parse values exist with at least 0
|
1152
|
+
for (let i = 1; i < 8; i++) {
|
1153
|
+
parse[i] = parse[i] !== undefined ? parseInt(parse[i], 10) : undefined;
|
1154
|
+
}
|
1155
|
+
let tzOffset = 0;
|
1156
|
+
if (parse[9] && parse[10]) {
|
1157
|
+
// hours
|
1158
|
+
tzOffset = parseInt(parse[10], 10) * 60;
|
1159
|
+
if (parse[11]) {
|
1160
|
+
// minutes
|
1161
|
+
tzOffset += parseInt(parse[11], 10);
|
1162
|
+
}
|
1163
|
+
if (parse[9] === '-') {
|
1164
|
+
// + or -
|
1165
|
+
tzOffset *= -1;
|
1166
|
+
}
|
1167
|
+
}
|
1168
|
+
// can also get second and millisecond from parse[6] and parse[7] if needed
|
1169
|
+
return {
|
1170
|
+
year: parse[1],
|
1171
|
+
month: parse[2],
|
1172
|
+
day: parse[3],
|
1173
|
+
hour: parse[4],
|
1174
|
+
minute: parse[5],
|
1175
|
+
tzOffset,
|
1176
|
+
};
|
1177
|
+
}
|
1178
|
+
const clampDate = (dateParts, minParts, maxParts) => {
|
1179
|
+
if (minParts && isBefore(dateParts, minParts)) {
|
1180
|
+
return minParts;
|
1181
|
+
}
|
1182
|
+
else if (maxParts && isAfter(dateParts, maxParts)) {
|
1183
|
+
return maxParts;
|
1184
|
+
}
|
1185
|
+
return dateParts;
|
1186
|
+
};
|
1187
|
+
/**
|
1188
|
+
* Parses an hour and returns if the value is in the morning (am) or afternoon (pm).
|
1189
|
+
* @param hour The hour to format, should be 0-23
|
1190
|
+
* @returns `pm` if the hour is greater than or equal to 12, `am` if less than 12.
|
1191
|
+
*/
|
1192
|
+
const parseAmPm = (hour) => {
|
1193
|
+
return hour >= 12 ? 'pm' : 'am';
|
1194
|
+
};
|
1195
|
+
|
1196
|
+
export { getMonthAndYear as A, getDaysOfMonth as B, generateMonths as C, is24Hour as D, getLocalizedTime as E, getMonthAndDay as F, formatValue as G, getNextYear as H, getPreviousYear as I, clampDate as J, parseAmPm as K, calculateHourFromAMPM as L, getLocalizedDateTime as M, getMonthDayAndYear as N, isAfter as a, isSameDay as b, getPreviousMonth as c, getNextMonth as d, getToday as e, getPartsFromCalendarDay as f, generateDayAriaLabel as g, getEndOfWeek as h, isBefore as i, getStartOfWeek as j, getPreviousDay as k, getNextDay as l, getPreviousWeek as m, getNextWeek as n, convertToArrayOfNumbers as o, parseDate as p, convertDataToISO as q, getCombinedDateColumnData as r, getMonthColumnData as s, getDayColumnData as t, getYearColumnData as u, isMonthFirstLocale as v, warnIfValueOutOfBounds as w, getTimeColumnsData as x, isLocaleDayPeriodRTL as y, getDaysOfWeek as z };
|