@pod-os/elements 0.7.1-92705ee.0 → 0.7.1-a71f01c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{animation-5840e4df.js → animation-9bea118f.js} +115 -84
- package/dist/cjs/{app-globals-1aedd05c.js → app-globals-6352043e.js} +1 -1
- package/dist/cjs/{cubic-bezier-dcb7bfef.js → cubic-bezier-0b702a31.js} +13 -12
- package/dist/cjs/data-0c9489d7.js +1510 -0
- package/dist/cjs/dir-011f46ea.js +20 -0
- package/dist/cjs/elements.cjs.js +5 -5
- package/dist/cjs/focus-visible-2624ec15.js +76 -0
- package/dist/cjs/framework-delegate-437c0645.js +119 -0
- package/dist/cjs/{gesture-controller-fbbe9a65.js → gesture-controller-00a6b02f.js} +6 -2
- package/dist/cjs/{haptic-09e73337.js → haptic-7358cb0b.js} +37 -8
- package/dist/cjs/{hardware-back-button-01027575.js → hardware-back-button-25372ec7.js} +11 -8
- package/dist/cjs/{helpers-398ced09.js → helpers-cb08f5ae.js} +115 -15
- package/dist/cjs/{index-2067b305.js → index-1b07c737.js} +35 -24
- package/dist/cjs/{index-68ae43d2.js → index-2dc3637c.js} +34 -28
- package/dist/cjs/index-57b9fa9e.js +30 -0
- package/dist/cjs/{index-d01d9183.js → index-643851c6.js} +34 -19
- package/dist/cjs/index-731691ca.js +48 -0
- package/dist/cjs/{index-6bbae9b1.js → index-7d56774d.js} +12 -8
- package/dist/cjs/index-9fca5d6f.js +140 -0
- package/dist/cjs/index-b2a479e4.js +38 -0
- package/dist/cjs/{index-b4a9ece2.js → index-eaa0d16e.js} +7 -0
- package/dist/cjs/{tap-click-f24cb477.js → index-ed2ce04f.js} +37 -19
- package/dist/cjs/{input-shims-e959d9e2.js → input-shims-427999f7.js} +89 -38
- package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
- package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
- package/dist/cjs/ion-action-sheet_3.cjs.entry.js +865 -0
- package/dist/cjs/{ion-app_45.cjs.entry.js → ion-app_46.cjs.entry.js} +1906 -1492
- package/dist/cjs/ion-avatar.cjs.entry.js +2 -2
- package/dist/cjs/ion-back-button.cjs.entry.js +12 -11
- package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
- package/dist/cjs/ion-breadcrumb.cjs.entry.js +101 -0
- package/dist/cjs/ion-breadcrumbs.cjs.entry.js +137 -0
- package/dist/cjs/ion-buttons_3.cjs.entry.js +799 -0
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
- package/dist/cjs/{ion-list-header_3.cjs.entry.js → ion-checkbox_4.cjs.entry.js} +124 -23
- package/dist/cjs/ion-chip.cjs.entry.js +5 -10
- package/dist/cjs/ion-datetime-button.cjs.entry.js +346 -0
- package/dist/cjs/ion-datetime.cjs.entry.js +1548 -856
- package/dist/cjs/ion-fab-button.cjs.entry.js +26 -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-img.cjs.entry.js +28 -4
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -13
- package/dist/cjs/ion-input.cjs.entry.js +57 -23
- 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 +59 -63
- package/dist/cjs/ion-loading.cjs.entry.js +38 -37
- package/dist/cjs/ion-menu-button.cjs.entry.js +14 -12
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +8 -7
- package/dist/cjs/ion-menu.cjs.entry.js +71 -57
- package/dist/cjs/ion-modal.cjs.entry.js +1386 -156
- package/dist/cjs/ion-nav-link.cjs.entry.js +5 -2
- package/dist/cjs/ion-nav.cjs.entry.js +177 -171
- package/dist/cjs/ion-picker-column.cjs.entry.js +25 -27
- package/dist/cjs/ion-picker.cjs.entry.js +22 -17
- package/dist/cjs/ion-popover.cjs.entry.js +1208 -182
- package/dist/cjs/ion-range.cjs.entry.js +137 -57
- package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -12
- package/dist/cjs/ion-refresher.cjs.entry.js +150 -148
- package/dist/cjs/ion-reorder-group.cjs.entry.js +42 -35
- 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 +5 -5
- package/dist/cjs/ion-router-outlet.cjs.entry.js +24 -20
- package/dist/cjs/ion-router.cjs.entry.js +291 -194
- package/dist/cjs/ion-segment-button.cjs.entry.js +10 -17
- package/dist/cjs/ion-segment.cjs.entry.js +127 -26
- package/dist/cjs/ion-select-option.cjs.entry.js +3 -3
- package/dist/cjs/ion-select.cjs.entry.js +113 -78
- package/dist/cjs/ion-slide.cjs.entry.js +3 -3
- package/dist/cjs/ion-slides.cjs.entry.js +26 -27
- package/dist/cjs/ion-spinner.cjs.entry.js +10 -9
- package/dist/cjs/ion-split-pane.cjs.entry.js +16 -12
- package/dist/cjs/ion-tab-bar.cjs.entry.js +16 -23
- 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 +3 -3
- package/dist/cjs/ion-textarea.cjs.entry.js +31 -29
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +50 -60
- package/dist/cjs/ion-toggle.cjs.entry.js +41 -22
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +39 -31
- package/dist/cjs/{ionic-global-56e10eb5.js → ionic-global-f2d95fd3.js} +112 -93
- package/dist/cjs/{ios.transition-32e4623d.js → ios.transition-0f31ec9a.js} +78 -53
- package/dist/cjs/{keyboard-9e8103e4.js → keyboard-79afcba2.js} +6 -3
- package/dist/cjs/keyboard-controller-a934d106.js +42 -0
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/{md.transition-169c54f0.js → md.transition-d2a33a23.js} +15 -17
- package/dist/cjs/{menu-toggle-util-087678e0.js → menu-toggle-util-0a43ff7c.js} +5 -2
- package/dist/cjs/{overlays-49fe9ba7.js → overlays-f7d24abf.js} +190 -72
- package/dist/cjs/spinner-configs-cd0abbeb.js +147 -0
- package/dist/cjs/{status-tap-ada894ff.js → status-tap-beaa3a71.js} +10 -5
- package/dist/cjs/{swipe-back-c4a778df.js → swipe-back-666ea8e6.js} +34 -15
- package/dist/cjs/{theme-2259d0f5.js → theme-fc63803b.js} +9 -5
- package/dist/collection/collection-manifest.json +10 -4
- package/dist/collection/components/pos-rich-link/pos-rich-link.js +1 -1
- package/dist/components/ResourceAware.js +5 -0
- package/dist/components/action-sheet.js +309 -0
- package/dist/{esm/ion-alert.entry.js → components/alert.js} +150 -105
- package/dist/{esm/animation-fe6ed422.js → components/animation.js} +115 -84
- package/dist/components/app.js +112 -0
- package/dist/components/backdrop.js +82 -0
- package/dist/components/badge.js +42 -0
- package/dist/{esm/button-active-fd9d6d91.js → components/button-active.js} +9 -6
- package/dist/components/button.js +207 -0
- package/dist/{esm/ion-buttons.entry.js → components/buttons.js} +28 -12
- package/dist/components/card-content.js +40 -0
- package/dist/components/card-header.js +51 -0
- package/dist/components/card-title.js +43 -0
- package/dist/components/card.js +102 -0
- package/dist/{esm/ion-checkbox.entry.js → components/checkbox.js} +42 -24
- package/dist/components/col.js +161 -0
- package/dist/components/content.js +356 -0
- package/dist/{esm/cubic-bezier-108b8579.js → components/cubic-bezier.js} +13 -12
- package/dist/components/data.js +1463 -0
- package/dist/components/dir.js +18 -0
- package/dist/components/focus-visible.js +74 -0
- package/dist/components/footer.js +149 -0
- package/dist/components/framework-delegate.js +115 -0
- package/dist/{esm/gesture-controller-8f35af24.js → components/gesture-controller.js} +6 -2
- package/dist/components/grid.js +41 -0
- package/dist/{esm/haptic-c424e670.js → components/haptic.js} +38 -9
- package/dist/{esm/hardware-back-button-bb4c578a.js → components/hardware-back-button.js} +11 -8
- package/dist/components/header.js +360 -0
- package/dist/{esm/helpers-44e3bd9f.js → components/helpers.js} +113 -16
- package/dist/components/icon.js +367 -0
- package/dist/components/index.d.ts +41 -0
- package/dist/components/index.js +123 -0
- package/dist/components/index10.js +28 -0
- package/dist/{esm/tap-click-a7e55ef5.js → components/index11.js} +37 -19
- package/dist/components/index2.js +25 -0
- package/dist/{esm/index-8d682224.js → components/index3.js} +12 -8
- package/dist/components/index4.js +34 -0
- package/dist/components/index5.js +128 -0
- package/dist/{esm/index-97199683.js → components/index6.js} +34 -28
- package/dist/{esm/index-8a463a85.js → components/index7.js} +35 -24
- package/dist/{custom-elements/index.js → components/index8.js} +1049 -20945
- package/dist/{esm/index-3a1bd803.js → components/index9.js} +35 -20
- package/dist/{custom-elements → components}/input-shims.js +88 -38
- package/dist/components/ion-accordion-group.js +228 -0
- package/dist/components/ion-accordion.js +365 -0
- package/dist/components/ion-action-sheet.js +6 -0
- package/dist/components/ion-alert.js +6 -0
- package/dist/components/ion-app.js +6 -0
- package/dist/components/ion-avatar.js +39 -0
- package/dist/components/ion-back-button.js +128 -0
- package/dist/components/ion-backdrop.js +6 -0
- package/dist/components/ion-badge.js +6 -0
- package/dist/components/ion-breadcrumb.js +135 -0
- package/dist/components/ion-breadcrumbs.js +158 -0
- package/dist/components/ion-button.js +6 -0
- package/dist/components/ion-buttons.js +6 -0
- package/dist/components/ion-card-content.js +6 -0
- package/dist/components/ion-card-header.js +6 -0
- package/dist/components/ion-card-subtitle.js +46 -0
- package/dist/components/ion-card-title.js +6 -0
- package/dist/components/ion-card.js +6 -0
- package/dist/components/ion-checkbox.js +6 -0
- package/dist/components/ion-chip.js +59 -0
- package/dist/components/ion-col.js +6 -0
- package/dist/components/ion-content.js +6 -0
- package/dist/components/ion-datetime-button.js +375 -0
- package/dist/components/ion-datetime.js +1802 -0
- package/dist/components/ion-fab-button.js +149 -0
- package/dist/components/ion-fab-list.js +62 -0
- package/dist/components/ion-fab.js +97 -0
- package/dist/components/ion-footer.js +6 -0
- package/dist/components/ion-grid.js +6 -0
- package/dist/components/ion-header.js +6 -0
- package/dist/components/ion-icon.js +6 -0
- package/dist/components/ion-img.js +120 -0
- package/dist/components/ion-infinite-scroll-content.js +59 -0
- package/dist/components/ion-infinite-scroll.js +223 -0
- package/dist/components/ion-input.js +352 -0
- package/dist/components/ion-item-divider.js +6 -0
- package/dist/components/ion-item-group.js +6 -0
- package/dist/components/ion-item-option.js +89 -0
- package/dist/components/ion-item-options.js +63 -0
- package/dist/components/ion-item-sliding.js +419 -0
- package/dist/components/ion-item.js +6 -0
- package/dist/components/ion-label.js +6 -0
- package/dist/components/ion-list-header.js +6 -0
- package/dist/components/ion-list.js +6 -0
- package/dist/components/ion-loading.js +256 -0
- package/dist/components/ion-menu-button.js +107 -0
- package/dist/components/ion-menu-toggle.js +62 -0
- package/dist/components/ion-menu.js +611 -0
- package/dist/components/ion-modal.js +1765 -0
- package/dist/components/ion-nav-link.js +65 -0
- package/dist/components/ion-nav.js +905 -0
- package/dist/components/ion-note.js +6 -0
- package/dist/components/ion-picker-column-internal.js +6 -0
- package/dist/components/ion-picker-column.js +6 -0
- package/dist/components/ion-picker-internal.js +6 -0
- package/dist/components/ion-picker.js +263 -0
- package/dist/components/ion-popover.js +6 -0
- package/dist/components/ion-progress-bar.js +6 -0
- package/dist/components/ion-radio-group.js +6 -0
- package/dist/components/ion-radio.js +6 -0
- package/dist/components/ion-range.js +550 -0
- package/dist/components/ion-refresher-content.js +64 -0
- package/dist/components/ion-refresher.js +826 -0
- package/dist/components/ion-reorder-group.js +303 -0
- package/dist/components/ion-reorder.js +58 -0
- package/dist/components/ion-ripple-effect.js +6 -0
- package/dist/components/ion-route-redirect.js +40 -0
- package/dist/components/ion-route.js +68 -0
- package/dist/components/ion-router-link.js +59 -0
- package/dist/components/ion-router-outlet.js +223 -0
- package/dist/components/ion-router.js +852 -0
- package/dist/components/ion-row.js +6 -0
- package/dist/components/ion-searchbar.js +6 -0
- package/dist/components/ion-segment-button.js +128 -0
- package/dist/components/ion-segment.js +463 -0
- package/dist/components/ion-select-option.js +44 -0
- package/dist/components/ion-select-popover.js +6 -0
- package/dist/components/ion-select.js +596 -0
- package/dist/components/ion-skeleton-text.js +6 -0
- package/dist/components/ion-slide.js +38 -0
- package/dist/components/ion-slides.js +423 -0
- package/dist/components/ion-spinner.js +6 -0
- package/dist/components/ion-split-pane.js +179 -0
- package/dist/components/ion-tab-bar.js +86 -0
- package/dist/components/ion-tab-button.js +132 -0
- package/dist/components/ion-tab.js +86 -0
- package/dist/components/ion-tabs.js +176 -0
- package/dist/components/ion-text.js +40 -0
- package/dist/components/ion-textarea.js +287 -0
- package/dist/components/ion-thumbnail.js +34 -0
- package/dist/components/ion-title.js +6 -0
- package/dist/components/ion-toast.js +317 -0
- package/dist/components/ion-toggle.js +207 -0
- package/dist/components/ion-toolbar.js +6 -0
- package/dist/components/ion-virtual-scroll.js +588 -0
- package/dist/components/ionic-global.js +226 -0
- package/dist/{custom-elements → components}/ios.transition.js +75 -50
- package/dist/components/item-divider.js +54 -0
- package/dist/components/item-group.js +41 -0
- package/dist/components/item.js +323 -0
- package/dist/components/keyboard-controller.js +40 -0
- package/dist/{custom-elements → components}/keyboard.js +6 -3
- package/dist/components/label.js +95 -0
- package/dist/components/list-header.js +45 -0
- package/dist/components/list.js +66 -0
- package/dist/{custom-elements → components}/md.transition.js +12 -14
- package/dist/{esm/menu-toggle-util-562dfc9c.js → components/menu-toggle-util.js} +5 -2
- package/dist/components/note.js +42 -0
- package/dist/{esm/overlays-fc9a0625.js → components/overlays.js} +188 -72
- package/dist/components/picker-column-internal.js +315 -0
- package/dist/components/picker-column.js +343 -0
- package/dist/components/picker-internal.js +486 -0
- package/dist/components/popover.js +1440 -0
- package/dist/components/pos-app-browser.d.ts +11 -0
- package/dist/components/pos-app-browser.js +299 -0
- package/dist/components/pos-app-generic.d.ts +11 -0
- package/dist/components/pos-app-generic.js +6 -0
- package/dist/components/pos-app-generic2.js +194 -0
- package/dist/components/pos-app-image-viewer.d.ts +11 -0
- package/dist/components/pos-app-image-viewer.js +6 -0
- package/dist/components/pos-app-image-viewer2.js +162 -0
- package/dist/components/pos-app-rdf-document.d.ts +11 -0
- package/dist/components/pos-app-rdf-document.js +6 -0
- package/dist/components/pos-app-rdf-document2.js +170 -0
- package/dist/components/pos-app.d.ts +11 -0
- package/dist/components/pos-app.js +6 -0
- package/dist/components/pos-app2.js +53 -0
- package/dist/components/pos-description.d.ts +11 -0
- package/dist/components/pos-description.js +6 -0
- package/dist/components/pos-description2.js +38 -0
- package/dist/components/pos-image.d.ts +11 -0
- package/dist/components/pos-image.js +6 -0
- package/dist/components/pos-image2.js +117 -0
- package/dist/components/pos-label.d.ts +11 -0
- package/dist/components/pos-label.js +6 -0
- package/dist/components/pos-label2.js +38 -0
- package/dist/components/pos-literals.d.ts +11 -0
- package/dist/components/pos-literals.js +6 -0
- package/dist/components/pos-literals2.js +87 -0
- package/dist/components/pos-login.d.ts +11 -0
- package/dist/components/pos-login.js +6 -0
- package/dist/components/pos-login2.js +120 -0
- package/dist/components/pos-navigation-bar.d.ts +11 -0
- package/dist/components/pos-navigation-bar.js +6 -0
- package/dist/components/pos-navigation-bar2.js +52 -0
- package/dist/components/pos-picture.d.ts +11 -0
- package/dist/components/pos-picture.js +6 -0
- package/dist/components/pos-picture2.js +62 -0
- package/dist/components/pos-relations.d.ts +11 -0
- package/dist/components/pos-relations.js +6 -0
- package/dist/components/pos-relations2.js +135 -0
- package/dist/components/pos-resource.d.ts +11 -0
- package/dist/components/pos-resource.js +6 -0
- package/dist/components/pos-resource2.js +126 -0
- package/dist/components/pos-reverse-relations.d.ts +11 -0
- package/dist/components/pos-reverse-relations.js +6 -0
- package/dist/components/pos-reverse-relations2.js +135 -0
- package/dist/components/pos-rich-link.d.ts +11 -0
- package/dist/components/pos-rich-link.js +6 -0
- package/dist/components/pos-rich-link2.js +106 -0
- package/dist/components/pos-router.d.ts +11 -0
- package/dist/components/pos-router.js +6 -0
- package/dist/components/pos-router2.js +813 -0
- package/dist/components/pos-subjects.d.ts +11 -0
- package/dist/components/pos-subjects.js +6 -0
- package/dist/components/pos-subjects2.js +125 -0
- package/dist/components/pos-type-badges.d.ts +11 -0
- package/dist/components/pos-type-badges.js +6 -0
- package/dist/components/pos-type-badges2.js +69 -0
- package/dist/components/pos-type-router.d.ts +11 -0
- package/dist/components/pos-type-router.js +6 -0
- package/dist/components/pos-type-router2.js +241 -0
- package/dist/components/progress-bar.js +91 -0
- package/dist/components/radio-group.js +139 -0
- package/dist/components/radio.js +135 -0
- package/dist/components/ripple-effect.js +107 -0
- package/dist/components/row.js +31 -0
- package/dist/components/searchbar.js +412 -0
- package/dist/components/select-popover.js +174 -0
- package/dist/components/session.js +202 -0
- package/dist/components/skeleton-text.js +46 -0
- package/dist/components/spinner.js +224 -0
- package/dist/{custom-elements → components}/status-tap.js +8 -4
- package/dist/{custom-elements → components}/swipe-back.js +33 -13
- package/dist/{custom-elements → components}/swiper.bundle.js +0 -0
- package/dist/{esm/theme-d21826a7.js → components/theme.js} +9 -5
- package/dist/components/title.js +66 -0
- package/dist/components/toolbar.js +87 -0
- package/dist/elements/elements.css +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/p-00f19b1d.js +4 -0
- package/dist/elements/p-0587332d.entry.js +1 -0
- package/dist/elements/p-07f54139.entry.js +7 -0
- package/dist/elements/{p-cfc0e54d.js → p-0991c811.js} +3 -0
- package/dist/elements/p-0a69a563.entry.js +1 -0
- package/dist/elements/p-0d284fe0.entry.js +1 -0
- package/dist/elements/p-116437b0.entry.js +13 -0
- package/dist/elements/p-12880671.entry.js +1 -0
- package/dist/elements/p-14ccd586.entry.js +1 -0
- package/dist/elements/{p-83d45051.entry.js → p-14df6ac0.entry.js} +1 -1
- package/dist/elements/{p-e860be6a.entry.js → p-17079f06.entry.js} +1 -1
- package/dist/elements/p-19e4a688.js +4 -0
- package/dist/elements/p-1afc4eb4.js +4 -0
- package/dist/elements/p-1beaf6bf.js +4 -0
- package/dist/elements/p-1d1c6a6f.entry.js +1 -0
- package/dist/elements/{p-31d30e42.entry.js → p-1d98f84b.entry.js} +1 -1
- package/dist/elements/p-1e617706.entry.js +7 -0
- package/dist/elements/p-278ca4c9.js +4 -0
- package/dist/elements/p-27f5629c.entry.js +1 -0
- package/dist/elements/p-29c0f03f.js +4 -0
- package/dist/elements/p-2a629468.entry.js +4 -0
- package/dist/elements/p-2da59aca.js +4 -0
- package/dist/elements/p-3152143f.js +4 -0
- package/dist/elements/p-343ff720.entry.js +7 -0
- package/dist/elements/p-36d4c9a8.js +4 -0
- package/dist/elements/p-3a30dfb2.entry.js +1 -0
- package/dist/elements/p-3c013bf1.entry.js +1 -0
- package/dist/elements/{p-74ba1e42.entry.js → p-3c318da5.entry.js} +1 -1
- package/dist/elements/p-3cee3222.entry.js +1 -0
- package/dist/elements/p-3d0f59af.entry.js +7 -0
- package/dist/elements/p-41cb5688.entry.js +1 -0
- package/dist/elements/p-480b3c4f.entry.js +1 -0
- package/dist/elements/p-4e9d8f18.entry.js +1 -0
- package/dist/elements/p-53e23176.js +2 -0
- package/dist/elements/p-548524f3.js +4 -0
- package/dist/elements/p-5739fa41.entry.js +1 -0
- package/dist/elements/p-5808c505.js +1 -0
- package/dist/elements/p-58a8cc2a.js +4 -0
- package/dist/elements/p-6035415e.entry.js +1 -0
- package/dist/elements/p-60eeae90.js +4 -0
- package/dist/elements/p-667550a9.entry.js +14 -0
- package/dist/elements/p-67777478.entry.js +1 -0
- package/dist/elements/p-6ab826e1.entry.js +1 -0
- package/dist/elements/p-6f5a2827.entry.js +1 -0
- package/dist/elements/p-7916ecc5.entry.js +1 -0
- package/dist/elements/p-79f06b80.entry.js +1 -0
- package/dist/elements/p-7d0def79.js +5 -0
- package/dist/elements/p-8112afea.js +4 -0
- package/dist/elements/p-83678d7d.entry.js +4 -0
- package/dist/elements/p-87e45c94.entry.js +1 -0
- package/dist/elements/p-8f80768f.entry.js +4 -0
- package/dist/elements/p-8fe0433b.js +4 -0
- package/dist/elements/{p-4cb27b48.entry.js → p-9147d82b.entry.js} +1 -1
- package/dist/elements/p-96aeb07a.entry.js +1 -0
- package/dist/elements/p-97abb434.entry.js +1 -0
- package/dist/elements/p-98497a4b.entry.js +1 -0
- package/dist/elements/p-9c719139.js +4 -0
- package/dist/elements/p-9ca37332.js +4 -0
- package/dist/elements/{p-37de7110.js → p-9d48def2.js} +3 -0
- package/dist/elements/p-a805f2f9.entry.js +1 -0
- package/dist/elements/p-a86a5bfa.entry.js +1 -0
- package/dist/elements/{p-9c1dbe52.entry.js → p-ac34eab7.entry.js} +1 -1
- package/dist/elements/p-ad366eab.entry.js +4 -0
- package/dist/elements/p-aef3a931.js +7 -0
- package/dist/elements/p-b0537eb3.entry.js +1 -0
- package/dist/elements/p-b41e66f0.entry.js +1 -0
- package/dist/elements/p-b47e7091.entry.js +1 -0
- package/dist/elements/p-b840320e.js +4 -0
- package/dist/elements/p-b934ac5d.entry.js +1 -0
- package/dist/elements/p-bc63f4b6.entry.js +1 -0
- package/dist/elements/p-bd12806f.entry.js +1 -0
- package/dist/elements/p-bf90022d.entry.js +4 -0
- package/dist/elements/p-c16d38d5.js +4 -0
- package/dist/elements/p-c84205a3.js +4 -0
- package/dist/elements/{p-06675ac7.entry.js → p-cbe318f8.entry.js} +1 -1
- package/dist/elements/p-cfed7395.js +4 -0
- package/dist/elements/p-d3e75c94.entry.js +1 -0
- package/dist/elements/p-d8e7ebf4.entry.js +7 -0
- package/dist/elements/p-d9880221.entry.js +4 -0
- package/dist/elements/p-da5db8fb.entry.js +1 -0
- package/dist/elements/{p-91fe653f.js → p-dcc6b03c.js} +3 -0
- package/dist/elements/{p-305e246c.entry.js → p-dd846020.entry.js} +1 -1
- package/dist/elements/p-dffd8689.js +4 -0
- package/dist/elements/p-e3bcb6e8.entry.js +1 -0
- package/dist/elements/p-e495a095.js +4 -0
- package/dist/elements/p-e59d9789.entry.js +1 -0
- package/dist/elements/p-e5fc7d42.entry.js +1 -0
- package/dist/elements/{p-aaa8393e.entry.js → p-eb137e9d.entry.js} +1 -1
- package/dist/elements/p-f4e54a17.js +7 -0
- package/dist/elements/p-f67d0717.entry.js +1 -0
- package/dist/elements/p-f7f4c640.js +1 -0
- package/dist/elements/p-f851b91a.js +4 -0
- package/dist/elements/p-fb27ee76.entry.js +1 -0
- package/dist/elements/p-fbddca35.entry.js +1 -0
- package/dist/elements/p-fdac5f3a.js +4 -0
- package/dist/elements/p-feb0cea8.entry.js +4 -0
- package/dist/esm/animation-801a007a.js +986 -0
- package/dist/esm/{app-globals-27d92837.js → app-globals-05a3abfb.js} +1 -1
- package/dist/esm/cubic-bezier-538b6253.js +90 -0
- package/dist/esm/data-62c81c24.js +1463 -0
- package/dist/esm/dir-defb16c6.js +18 -0
- package/dist/esm/elements.js +5 -5
- package/dist/esm/focus-visible-78d55799.js +74 -0
- package/dist/esm/framework-delegate-7e2b767b.js +115 -0
- package/dist/esm/gesture-controller-c466ff14.js +195 -0
- package/dist/esm/haptic-e7d5ef4d.js +135 -0
- package/dist/esm/hardware-back-button-242191a7.js +71 -0
- package/dist/esm/helpers-aeff219b.js +410 -0
- package/dist/esm/index-0dbaca1a.js +28 -0
- package/dist/esm/index-1f3d8582.js +34 -0
- package/dist/esm/index-2be9a18b.js +312 -0
- package/dist/esm/index-51e4a829.js +137 -0
- package/dist/esm/index-6048aed6.js +224 -0
- package/dist/esm/index-65ecd543.js +25 -0
- package/dist/{custom-elements/tap-click.js → esm/index-b212db1c.js} +37 -19
- package/dist/esm/{index-e4deec27.js → index-cb938ffb.js} +7 -1
- package/dist/esm/index-d39eb62b.js +463 -0
- package/dist/esm/index-ebf7f059.js +128 -0
- package/dist/esm/{input-shims-3b48722f.js → input-shims-8a389148.js} +89 -38
- package/dist/esm/ion-accordion-group.entry.js +201 -0
- package/dist/esm/ion-accordion.entry.js +332 -0
- package/dist/esm/ion-action-sheet_3.entry.js +859 -0
- package/dist/esm/{ion-app_45.entry.js → ion-app_46.entry.js} +1906 -1493
- package/dist/esm/ion-avatar.entry.js +2 -2
- package/dist/esm/ion-back-button.entry.js +12 -11
- package/dist/esm/ion-backdrop.entry.js +4 -4
- package/dist/esm/ion-breadcrumb.entry.js +97 -0
- package/dist/esm/ion-breadcrumbs.entry.js +133 -0
- package/dist/esm/ion-buttons_3.entry.js +793 -0
- package/dist/esm/ion-card-subtitle.entry.js +4 -4
- package/dist/esm/{ion-list-header_3.entry.js → ion-checkbox_4.entry.js} +124 -24
- package/dist/esm/ion-chip.entry.js +5 -10
- package/dist/esm/ion-datetime-button.entry.js +342 -0
- package/dist/esm/ion-datetime.entry.js +1548 -856
- package/dist/esm/ion-fab-button.entry.js +26 -9
- package/dist/esm/ion-fab-list.entry.js +4 -4
- package/dist/esm/ion-fab.entry.js +15 -13
- package/dist/esm/ion-img.entry.js +28 -4
- package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
- package/dist/esm/ion-infinite-scroll.entry.js +13 -13
- package/dist/esm/ion-input.entry.js +57 -23
- 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 +59 -63
- package/dist/esm/ion-loading.entry.js +38 -37
- package/dist/esm/ion-menu-button.entry.js +14 -12
- package/dist/esm/ion-menu-toggle.entry.js +8 -7
- package/dist/esm/ion-menu.entry.js +71 -57
- package/dist/esm/ion-modal.entry.js +1377 -147
- package/dist/esm/ion-nav-link.entry.js +5 -2
- package/dist/esm/ion-nav.entry.js +177 -171
- package/dist/esm/ion-picker-column.entry.js +25 -27
- package/dist/esm/ion-picker.entry.js +22 -17
- package/dist/esm/ion-popover.entry.js +1208 -182
- package/dist/esm/ion-range.entry.js +137 -57
- package/dist/esm/ion-refresher-content.entry.js +7 -12
- package/dist/esm/ion-refresher.entry.js +149 -147
- package/dist/esm/ion-reorder-group.entry.js +42 -35
- 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 +5 -5
- package/dist/esm/ion-router-outlet.entry.js +24 -20
- package/dist/esm/ion-router.entry.js +291 -194
- package/dist/esm/ion-segment-button.entry.js +10 -17
- package/dist/esm/ion-segment.entry.js +127 -26
- package/dist/esm/ion-select-option.entry.js +3 -3
- package/dist/esm/ion-select.entry.js +113 -78
- package/dist/esm/ion-slide.entry.js +3 -3
- package/dist/esm/ion-slides.entry.js +26 -27
- package/dist/esm/ion-spinner.entry.js +10 -9
- package/dist/esm/ion-split-pane.entry.js +16 -12
- package/dist/esm/ion-tab-bar.entry.js +16 -23
- 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 +3 -3
- package/dist/esm/ion-textarea.entry.js +31 -29
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +50 -60
- package/dist/esm/ion-toggle.entry.js +41 -22
- package/dist/esm/ion-virtual-scroll.entry.js +39 -31
- package/dist/esm/{ionic-global-2e28f7c7.js → ionic-global-6cd57191.js} +112 -93
- package/dist/esm/{ios.transition-a783e3cd.js → ios.transition-bbd952f2.js} +78 -53
- package/dist/esm/{keyboard-e6abcb80.js → keyboard-413afe04.js} +6 -3
- package/dist/esm/keyboard-controller-33693bc2.js +40 -0
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{md.transition-5a4a8c82.js → md.transition-5170a6d3.js} +15 -17
- package/dist/esm/menu-toggle-util-82bf888a.js +12 -0
- package/dist/esm/overlays-bd4abb68.js +502 -0
- package/dist/esm/spinner-configs-cbcd1f62.js +145 -0
- package/dist/esm/{status-tap-69e62ad6.js → status-tap-ad757b8a.js} +10 -5
- package/dist/esm/swipe-back-7ef22876.js +69 -0
- package/dist/esm/theme-7cf2cab0.js +43 -0
- package/dist/types/components.d.ts +0 -13
- package/package.json +7 -8
- package/dist/cjs/button-active-c14dab31.js +0 -66
- package/dist/cjs/focus-visible-16c98640.js +0 -45
- package/dist/cjs/framework-delegate-c45292a3.js +0 -37
- package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -265
- package/dist/cjs/ion-alert.cjs.entry.js +0 -456
- package/dist/cjs/ion-buttons.cjs.entry.js +0 -42
- package/dist/cjs/ion-checkbox.cjs.entry.js +0 -117
- package/dist/cjs/ion-note.cjs.entry.js +0 -29
- package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
- package/dist/cjs/spinner-configs-fb16b986.js +0 -112
- package/dist/cjs/test-component.cjs.entry.js +0 -13
- package/dist/collection/test/TestComponent.js +0 -3
- package/dist/collection/test/mockPodOS.js +0 -35
- package/dist/collection/test/renderFunctionalComponent.js +0 -8
- package/dist/custom-elements/focus-visible.js +0 -43
- package/dist/custom-elements/index.d.ts +0 -165
- package/dist/elements/p-03bda390.js +0 -1
- package/dist/elements/p-0be044f1.entry.js +0 -1
- package/dist/elements/p-119c7c6c.entry.js +0 -1
- package/dist/elements/p-14c7c3ea.entry.js +0 -1
- package/dist/elements/p-1d4a2c61.js +0 -1
- package/dist/elements/p-1d894ac4.entry.js +0 -1
- package/dist/elements/p-1dafa1ce.entry.js +0 -1
- package/dist/elements/p-23b89ccb.entry.js +0 -1
- package/dist/elements/p-2c03b9ab.entry.js +0 -1
- package/dist/elements/p-346985f2.js +0 -1
- package/dist/elements/p-360f1c62.entry.js +0 -1
- package/dist/elements/p-373e1f25.entry.js +0 -1
- package/dist/elements/p-40547acb.entry.js +0 -1
- package/dist/elements/p-40b68014.entry.js +0 -1
- package/dist/elements/p-42e4f702.entry.js +0 -1
- package/dist/elements/p-489807e5.js +0 -1
- package/dist/elements/p-4ad72d54.entry.js +0 -1
- package/dist/elements/p-4cca7b5e.entry.js +0 -1
- package/dist/elements/p-4f24d306.js +0 -1
- package/dist/elements/p-519d6a53.entry.js +0 -1
- package/dist/elements/p-536e8e52.entry.js +0 -1
- package/dist/elements/p-599bb53f.entry.js +0 -1
- package/dist/elements/p-5eb7a546.js +0 -1
- package/dist/elements/p-60df2bed.entry.js +0 -1
- package/dist/elements/p-65133e33.js +0 -1
- package/dist/elements/p-6693fce8.js +0 -1
- package/dist/elements/p-689bdcc1.entry.js +0 -1
- package/dist/elements/p-70713b3d.entry.js +0 -1
- package/dist/elements/p-707d5d76.js +0 -1
- package/dist/elements/p-7212b7f2.js +0 -1
- package/dist/elements/p-73992898.entry.js +0 -1
- package/dist/elements/p-792c1e0f.entry.js +0 -1
- package/dist/elements/p-7e5300af.js +0 -2
- package/dist/elements/p-8068987c.entry.js +0 -1
- package/dist/elements/p-83accf46.entry.js +0 -1
- package/dist/elements/p-86635d06.entry.js +0 -1
- package/dist/elements/p-874c2b44.js +0 -1
- package/dist/elements/p-89c12ce8.entry.js +0 -1
- package/dist/elements/p-8bcba3f7.entry.js +0 -1
- package/dist/elements/p-8c759f51.entry.js +0 -1
- package/dist/elements/p-8f945e6b.entry.js +0 -1
- package/dist/elements/p-9300ab6a.js +0 -1
- package/dist/elements/p-93cacd51.entry.js +0 -1
- package/dist/elements/p-9408d0b4.entry.js +0 -1
- package/dist/elements/p-98c79eda.js +0 -1
- package/dist/elements/p-99f8abed.js +0 -1
- package/dist/elements/p-9ca7e079.js +0 -1
- package/dist/elements/p-a4648b74.entry.js +0 -1
- package/dist/elements/p-aab0f63c.js +0 -1
- package/dist/elements/p-ad4e2295.entry.js +0 -1
- package/dist/elements/p-afb8f7d5.entry.js +0 -1
- package/dist/elements/p-b055ec44.js +0 -1
- package/dist/elements/p-b078d63b.entry.js +0 -1
- package/dist/elements/p-b3460325.entry.js +0 -1
- package/dist/elements/p-b5406b58.entry.js +0 -1
- package/dist/elements/p-b5ef0c91.entry.js +0 -1
- package/dist/elements/p-b6ba623e.entry.js +0 -1
- package/dist/elements/p-b9926d8b.entry.js +0 -1
- package/dist/elements/p-bfd4cfcd.entry.js +0 -1
- package/dist/elements/p-c08dd7d0.entry.js +0 -1
- package/dist/elements/p-c0db9c51.entry.js +0 -1
- package/dist/elements/p-c1e7fbfb.js +0 -1
- package/dist/elements/p-ca69d6c9.js +0 -1
- package/dist/elements/p-cc4cb1ac.entry.js +0 -1
- package/dist/elements/p-cf8a7031.entry.js +0 -1
- package/dist/elements/p-cff82b6f.js +0 -1
- package/dist/elements/p-d01009b8.entry.js +0 -67
- package/dist/elements/p-d6d1e65f.entry.js +0 -1
- package/dist/elements/p-d9462b66.entry.js +0 -1
- package/dist/elements/p-e2e0fee9.entry.js +0 -1
- package/dist/elements/p-e642b266.entry.js +0 -1
- package/dist/elements/p-e953934f.entry.js +0 -1
- package/dist/elements/p-f0474f46.js +0 -1
- package/dist/elements/p-f10a94f6.entry.js +0 -1
- package/dist/elements/p-f2426182.entry.js +0 -1
- package/dist/elements/p-f327fd21.js +0 -1
- package/dist/elements/p-f84987ee.js +0 -1
- package/dist/elements/p-f8a3367d.entry.js +0 -1
- package/dist/esm/focus-visible-edb28f19.js +0 -43
- package/dist/esm/framework-delegate-9cd8048f.js +0 -34
- package/dist/esm/ion-action-sheet.entry.js +0 -261
- package/dist/esm/ion-note.entry.js +0 -25
- package/dist/esm/ion-select-popover.entry.js +0 -31
- package/dist/esm/spinner-configs-aaf2a1a9.js +0 -110
- package/dist/esm/swipe-back-d84cfc8a.js +0 -50
- package/dist/esm/test-component.entry.js +0 -9
- package/dist/types/test/TestComponent.d.ts +0 -2
- package/dist/types/test/mockPodOS.d.ts +0 -11
- package/dist/types/test/renderFunctionalComponent.d.ts +0 -1
|
@@ -0,0 +1,986 @@
|
|
|
1
|
+
import { r as raf } from './helpers-aeff219b.js';
|
|
2
|
+
import { w as win } from './index-0dbaca1a.js';
|
|
3
|
+
|
|
4
|
+
/*!
|
|
5
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
6
|
+
*/
|
|
7
|
+
let animationPrefix;
|
|
8
|
+
/**
|
|
9
|
+
* Web Animations requires hyphenated CSS properties
|
|
10
|
+
* to be written in camelCase when animating
|
|
11
|
+
*/
|
|
12
|
+
const processKeyframes = (keyframes) => {
|
|
13
|
+
keyframes.forEach((keyframe) => {
|
|
14
|
+
for (const key in keyframe) {
|
|
15
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
16
|
+
if (keyframe.hasOwnProperty(key)) {
|
|
17
|
+
const value = keyframe[key];
|
|
18
|
+
if (key === 'easing') {
|
|
19
|
+
const newKey = 'animation-timing-function';
|
|
20
|
+
keyframe[newKey] = value;
|
|
21
|
+
delete keyframe[key];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const newKey = convertCamelCaseToHypen(key);
|
|
25
|
+
if (newKey !== key) {
|
|
26
|
+
keyframe[newKey] = value;
|
|
27
|
+
delete keyframe[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return keyframes;
|
|
34
|
+
};
|
|
35
|
+
const convertCamelCaseToHypen = (str) => {
|
|
36
|
+
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
37
|
+
};
|
|
38
|
+
const getAnimationPrefix = (el) => {
|
|
39
|
+
if (animationPrefix === undefined) {
|
|
40
|
+
const supportsUnprefixed = el.style.animationName !== undefined;
|
|
41
|
+
const supportsWebkitPrefix = el.style.webkitAnimationName !== undefined;
|
|
42
|
+
animationPrefix = !supportsUnprefixed && supportsWebkitPrefix ? '-webkit-' : '';
|
|
43
|
+
}
|
|
44
|
+
return animationPrefix;
|
|
45
|
+
};
|
|
46
|
+
const setStyleProperty = (element, propertyName, value) => {
|
|
47
|
+
const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';
|
|
48
|
+
element.style.setProperty(prefix + propertyName, value);
|
|
49
|
+
};
|
|
50
|
+
const removeStyleProperty = (element, propertyName) => {
|
|
51
|
+
const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';
|
|
52
|
+
element.style.removeProperty(prefix + propertyName);
|
|
53
|
+
};
|
|
54
|
+
const animationEnd = (el, callback) => {
|
|
55
|
+
let unRegTrans;
|
|
56
|
+
const opts = { passive: true };
|
|
57
|
+
const unregister = () => {
|
|
58
|
+
if (unRegTrans) {
|
|
59
|
+
unRegTrans();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const onTransitionEnd = (ev) => {
|
|
63
|
+
if (el === ev.target) {
|
|
64
|
+
unregister();
|
|
65
|
+
callback(ev);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (el) {
|
|
69
|
+
el.addEventListener('webkitAnimationEnd', onTransitionEnd, opts);
|
|
70
|
+
el.addEventListener('animationend', onTransitionEnd, opts);
|
|
71
|
+
unRegTrans = () => {
|
|
72
|
+
el.removeEventListener('webkitAnimationEnd', onTransitionEnd, opts);
|
|
73
|
+
el.removeEventListener('animationend', onTransitionEnd, opts);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return unregister;
|
|
77
|
+
};
|
|
78
|
+
const generateKeyframeRules = (keyframes = []) => {
|
|
79
|
+
return keyframes
|
|
80
|
+
.map((keyframe) => {
|
|
81
|
+
const offset = keyframe.offset;
|
|
82
|
+
const frameString = [];
|
|
83
|
+
for (const property in keyframe) {
|
|
84
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
85
|
+
if (keyframe.hasOwnProperty(property) && property !== 'offset') {
|
|
86
|
+
frameString.push(`${property}: ${keyframe[property]};`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return `${offset * 100}% { ${frameString.join(' ')} }`;
|
|
90
|
+
})
|
|
91
|
+
.join(' ');
|
|
92
|
+
};
|
|
93
|
+
const keyframeIds = [];
|
|
94
|
+
const generateKeyframeName = (keyframeRules) => {
|
|
95
|
+
let index = keyframeIds.indexOf(keyframeRules);
|
|
96
|
+
if (index < 0) {
|
|
97
|
+
index = keyframeIds.push(keyframeRules) - 1;
|
|
98
|
+
}
|
|
99
|
+
return `ion-animation-${index}`;
|
|
100
|
+
};
|
|
101
|
+
const getStyleContainer = (element) => {
|
|
102
|
+
// getRootNode is not always available in SSR environments.
|
|
103
|
+
const rootNode = element.getRootNode !== undefined ? element.getRootNode() : element;
|
|
104
|
+
return rootNode.head || rootNode;
|
|
105
|
+
};
|
|
106
|
+
const createKeyframeStylesheet = (keyframeName, keyframeRules, element) => {
|
|
107
|
+
var _a;
|
|
108
|
+
const styleContainer = getStyleContainer(element);
|
|
109
|
+
const keyframePrefix = getAnimationPrefix(element);
|
|
110
|
+
const existingStylesheet = styleContainer.querySelector('#' + keyframeName);
|
|
111
|
+
if (existingStylesheet) {
|
|
112
|
+
return existingStylesheet;
|
|
113
|
+
}
|
|
114
|
+
const stylesheet = ((_a = element.ownerDocument) !== null && _a !== void 0 ? _a : document).createElement('style');
|
|
115
|
+
stylesheet.id = keyframeName;
|
|
116
|
+
stylesheet.textContent = `@${keyframePrefix}keyframes ${keyframeName} { ${keyframeRules} } @${keyframePrefix}keyframes ${keyframeName}-alt { ${keyframeRules} }`;
|
|
117
|
+
styleContainer.appendChild(stylesheet);
|
|
118
|
+
return stylesheet;
|
|
119
|
+
};
|
|
120
|
+
const addClassToArray = (classes = [], className) => {
|
|
121
|
+
if (className !== undefined) {
|
|
122
|
+
const classNameToAppend = Array.isArray(className) ? className : [className];
|
|
123
|
+
return [...classes, ...classNameToAppend];
|
|
124
|
+
}
|
|
125
|
+
return classes;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/*!
|
|
129
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
130
|
+
*/
|
|
131
|
+
const createAnimation = (animationId) => {
|
|
132
|
+
let _delay;
|
|
133
|
+
let _duration;
|
|
134
|
+
let _easing;
|
|
135
|
+
let _iterations;
|
|
136
|
+
let _fill;
|
|
137
|
+
let _direction;
|
|
138
|
+
let _keyframes = [];
|
|
139
|
+
let beforeAddClasses = [];
|
|
140
|
+
let beforeRemoveClasses = [];
|
|
141
|
+
let initialized = false;
|
|
142
|
+
let parentAnimation;
|
|
143
|
+
let beforeStylesValue = {};
|
|
144
|
+
let afterAddClasses = [];
|
|
145
|
+
let afterRemoveClasses = [];
|
|
146
|
+
let afterStylesValue = {};
|
|
147
|
+
let numAnimationsRunning = 0;
|
|
148
|
+
let shouldForceLinearEasing = false;
|
|
149
|
+
let shouldForceSyncPlayback = false;
|
|
150
|
+
let cssAnimationsTimerFallback;
|
|
151
|
+
let forceDirectionValue;
|
|
152
|
+
let forceDurationValue;
|
|
153
|
+
let forceDelayValue;
|
|
154
|
+
let willComplete = true;
|
|
155
|
+
let finished = false;
|
|
156
|
+
let shouldCalculateNumAnimations = true;
|
|
157
|
+
let keyframeName;
|
|
158
|
+
let ani;
|
|
159
|
+
let paused = false;
|
|
160
|
+
const id = animationId;
|
|
161
|
+
const onFinishCallbacks = [];
|
|
162
|
+
const onFinishOneTimeCallbacks = [];
|
|
163
|
+
const elements = [];
|
|
164
|
+
const childAnimations = [];
|
|
165
|
+
const stylesheets = [];
|
|
166
|
+
const _beforeAddReadFunctions = [];
|
|
167
|
+
const _beforeAddWriteFunctions = [];
|
|
168
|
+
const _afterAddReadFunctions = [];
|
|
169
|
+
const _afterAddWriteFunctions = [];
|
|
170
|
+
const webAnimations = [];
|
|
171
|
+
const supportsAnimationEffect = typeof AnimationEffect === 'function' ||
|
|
172
|
+
(win !== undefined && typeof win.AnimationEffect === 'function');
|
|
173
|
+
const supportsWebAnimations = typeof Element === 'function' &&
|
|
174
|
+
typeof Element.prototype.animate === 'function' &&
|
|
175
|
+
supportsAnimationEffect;
|
|
176
|
+
const ANIMATION_END_FALLBACK_PADDING_MS = 100;
|
|
177
|
+
const getWebAnimations = () => {
|
|
178
|
+
return webAnimations;
|
|
179
|
+
};
|
|
180
|
+
const destroy = (clearStyleSheets) => {
|
|
181
|
+
childAnimations.forEach((childAnimation) => {
|
|
182
|
+
childAnimation.destroy(clearStyleSheets);
|
|
183
|
+
});
|
|
184
|
+
cleanUp(clearStyleSheets);
|
|
185
|
+
elements.length = 0;
|
|
186
|
+
childAnimations.length = 0;
|
|
187
|
+
_keyframes.length = 0;
|
|
188
|
+
clearOnFinish();
|
|
189
|
+
initialized = false;
|
|
190
|
+
shouldCalculateNumAnimations = true;
|
|
191
|
+
return ani;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Cancels any Web Animations, removes
|
|
195
|
+
* any animation properties from the
|
|
196
|
+
* animation's elements, and removes the
|
|
197
|
+
* animation's stylesheets from the DOM.
|
|
198
|
+
*/
|
|
199
|
+
const cleanUp = (clearStyleSheets) => {
|
|
200
|
+
cleanUpElements();
|
|
201
|
+
if (clearStyleSheets) {
|
|
202
|
+
cleanUpStyleSheets();
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const resetFlags = () => {
|
|
206
|
+
shouldForceLinearEasing = false;
|
|
207
|
+
shouldForceSyncPlayback = false;
|
|
208
|
+
shouldCalculateNumAnimations = true;
|
|
209
|
+
forceDirectionValue = undefined;
|
|
210
|
+
forceDurationValue = undefined;
|
|
211
|
+
forceDelayValue = undefined;
|
|
212
|
+
numAnimationsRunning = 0;
|
|
213
|
+
finished = false;
|
|
214
|
+
willComplete = true;
|
|
215
|
+
paused = false;
|
|
216
|
+
};
|
|
217
|
+
const isRunning = () => {
|
|
218
|
+
return numAnimationsRunning !== 0 && !paused;
|
|
219
|
+
};
|
|
220
|
+
const onFinish = (callback, opts) => {
|
|
221
|
+
const callbacks = (opts === null || opts === void 0 ? void 0 : opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
|
|
222
|
+
callbacks.push({ c: callback, o: opts });
|
|
223
|
+
return ani;
|
|
224
|
+
};
|
|
225
|
+
const clearOnFinish = () => {
|
|
226
|
+
onFinishCallbacks.length = 0;
|
|
227
|
+
onFinishOneTimeCallbacks.length = 0;
|
|
228
|
+
return ani;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Cancels any Web Animations and removes
|
|
232
|
+
* any animation properties from the
|
|
233
|
+
* the animation's elements.
|
|
234
|
+
*/
|
|
235
|
+
const cleanUpElements = () => {
|
|
236
|
+
if (supportsWebAnimations) {
|
|
237
|
+
webAnimations.forEach((animation) => {
|
|
238
|
+
animation.cancel();
|
|
239
|
+
});
|
|
240
|
+
webAnimations.length = 0;
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
const elementsArray = elements.slice();
|
|
244
|
+
raf(() => {
|
|
245
|
+
elementsArray.forEach((element) => {
|
|
246
|
+
removeStyleProperty(element, 'animation-name');
|
|
247
|
+
removeStyleProperty(element, 'animation-duration');
|
|
248
|
+
removeStyleProperty(element, 'animation-timing-function');
|
|
249
|
+
removeStyleProperty(element, 'animation-iteration-count');
|
|
250
|
+
removeStyleProperty(element, 'animation-delay');
|
|
251
|
+
removeStyleProperty(element, 'animation-play-state');
|
|
252
|
+
removeStyleProperty(element, 'animation-fill-mode');
|
|
253
|
+
removeStyleProperty(element, 'animation-direction');
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Removes the animation's stylesheets
|
|
260
|
+
* from the DOM.
|
|
261
|
+
*/
|
|
262
|
+
const cleanUpStyleSheets = () => {
|
|
263
|
+
stylesheets.forEach((stylesheet) => {
|
|
264
|
+
/**
|
|
265
|
+
* When sharing stylesheets, it's possible
|
|
266
|
+
* for another animation to have already
|
|
267
|
+
* cleaned up a particular stylesheet
|
|
268
|
+
*/
|
|
269
|
+
if (stylesheet === null || stylesheet === void 0 ? void 0 : stylesheet.parentNode) {
|
|
270
|
+
stylesheet.parentNode.removeChild(stylesheet);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
stylesheets.length = 0;
|
|
274
|
+
};
|
|
275
|
+
const beforeAddRead = (readFn) => {
|
|
276
|
+
_beforeAddReadFunctions.push(readFn);
|
|
277
|
+
return ani;
|
|
278
|
+
};
|
|
279
|
+
const beforeAddWrite = (writeFn) => {
|
|
280
|
+
_beforeAddWriteFunctions.push(writeFn);
|
|
281
|
+
return ani;
|
|
282
|
+
};
|
|
283
|
+
const afterAddRead = (readFn) => {
|
|
284
|
+
_afterAddReadFunctions.push(readFn);
|
|
285
|
+
return ani;
|
|
286
|
+
};
|
|
287
|
+
const afterAddWrite = (writeFn) => {
|
|
288
|
+
_afterAddWriteFunctions.push(writeFn);
|
|
289
|
+
return ani;
|
|
290
|
+
};
|
|
291
|
+
const beforeAddClass = (className) => {
|
|
292
|
+
beforeAddClasses = addClassToArray(beforeAddClasses, className);
|
|
293
|
+
return ani;
|
|
294
|
+
};
|
|
295
|
+
const beforeRemoveClass = (className) => {
|
|
296
|
+
beforeRemoveClasses = addClassToArray(beforeRemoveClasses, className);
|
|
297
|
+
return ani;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Set CSS inline styles to the animation's
|
|
301
|
+
* elements before the animation begins.
|
|
302
|
+
*/
|
|
303
|
+
const beforeStyles = (styles = {}) => {
|
|
304
|
+
beforeStylesValue = styles;
|
|
305
|
+
return ani;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Clear CSS inline styles from the animation's
|
|
309
|
+
* elements before the animation begins.
|
|
310
|
+
*/
|
|
311
|
+
const beforeClearStyles = (propertyNames = []) => {
|
|
312
|
+
for (const property of propertyNames) {
|
|
313
|
+
beforeStylesValue[property] = '';
|
|
314
|
+
}
|
|
315
|
+
return ani;
|
|
316
|
+
};
|
|
317
|
+
const afterAddClass = (className) => {
|
|
318
|
+
afterAddClasses = addClassToArray(afterAddClasses, className);
|
|
319
|
+
return ani;
|
|
320
|
+
};
|
|
321
|
+
const afterRemoveClass = (className) => {
|
|
322
|
+
afterRemoveClasses = addClassToArray(afterRemoveClasses, className);
|
|
323
|
+
return ani;
|
|
324
|
+
};
|
|
325
|
+
const afterStyles = (styles = {}) => {
|
|
326
|
+
afterStylesValue = styles;
|
|
327
|
+
return ani;
|
|
328
|
+
};
|
|
329
|
+
const afterClearStyles = (propertyNames = []) => {
|
|
330
|
+
for (const property of propertyNames) {
|
|
331
|
+
afterStylesValue[property] = '';
|
|
332
|
+
}
|
|
333
|
+
return ani;
|
|
334
|
+
};
|
|
335
|
+
const getFill = () => {
|
|
336
|
+
if (_fill !== undefined) {
|
|
337
|
+
return _fill;
|
|
338
|
+
}
|
|
339
|
+
if (parentAnimation) {
|
|
340
|
+
return parentAnimation.getFill();
|
|
341
|
+
}
|
|
342
|
+
return 'both';
|
|
343
|
+
};
|
|
344
|
+
const getDirection = () => {
|
|
345
|
+
if (forceDirectionValue !== undefined) {
|
|
346
|
+
return forceDirectionValue;
|
|
347
|
+
}
|
|
348
|
+
if (_direction !== undefined) {
|
|
349
|
+
return _direction;
|
|
350
|
+
}
|
|
351
|
+
if (parentAnimation) {
|
|
352
|
+
return parentAnimation.getDirection();
|
|
353
|
+
}
|
|
354
|
+
return 'normal';
|
|
355
|
+
};
|
|
356
|
+
const getEasing = () => {
|
|
357
|
+
if (shouldForceLinearEasing) {
|
|
358
|
+
return 'linear';
|
|
359
|
+
}
|
|
360
|
+
if (_easing !== undefined) {
|
|
361
|
+
return _easing;
|
|
362
|
+
}
|
|
363
|
+
if (parentAnimation) {
|
|
364
|
+
return parentAnimation.getEasing();
|
|
365
|
+
}
|
|
366
|
+
return 'linear';
|
|
367
|
+
};
|
|
368
|
+
const getDuration = () => {
|
|
369
|
+
if (shouldForceSyncPlayback) {
|
|
370
|
+
return 0;
|
|
371
|
+
}
|
|
372
|
+
if (forceDurationValue !== undefined) {
|
|
373
|
+
return forceDurationValue;
|
|
374
|
+
}
|
|
375
|
+
if (_duration !== undefined) {
|
|
376
|
+
return _duration;
|
|
377
|
+
}
|
|
378
|
+
if (parentAnimation) {
|
|
379
|
+
return parentAnimation.getDuration();
|
|
380
|
+
}
|
|
381
|
+
return 0;
|
|
382
|
+
};
|
|
383
|
+
const getIterations = () => {
|
|
384
|
+
if (_iterations !== undefined) {
|
|
385
|
+
return _iterations;
|
|
386
|
+
}
|
|
387
|
+
if (parentAnimation) {
|
|
388
|
+
return parentAnimation.getIterations();
|
|
389
|
+
}
|
|
390
|
+
return 1;
|
|
391
|
+
};
|
|
392
|
+
const getDelay = () => {
|
|
393
|
+
if (forceDelayValue !== undefined) {
|
|
394
|
+
return forceDelayValue;
|
|
395
|
+
}
|
|
396
|
+
if (_delay !== undefined) {
|
|
397
|
+
return _delay;
|
|
398
|
+
}
|
|
399
|
+
if (parentAnimation) {
|
|
400
|
+
return parentAnimation.getDelay();
|
|
401
|
+
}
|
|
402
|
+
return 0;
|
|
403
|
+
};
|
|
404
|
+
const getKeyframes = () => {
|
|
405
|
+
return _keyframes;
|
|
406
|
+
};
|
|
407
|
+
const direction = (animationDirection) => {
|
|
408
|
+
_direction = animationDirection;
|
|
409
|
+
update(true);
|
|
410
|
+
return ani;
|
|
411
|
+
};
|
|
412
|
+
const fill = (animationFill) => {
|
|
413
|
+
_fill = animationFill;
|
|
414
|
+
update(true);
|
|
415
|
+
return ani;
|
|
416
|
+
};
|
|
417
|
+
const delay = (animationDelay) => {
|
|
418
|
+
_delay = animationDelay;
|
|
419
|
+
update(true);
|
|
420
|
+
return ani;
|
|
421
|
+
};
|
|
422
|
+
const easing = (animationEasing) => {
|
|
423
|
+
_easing = animationEasing;
|
|
424
|
+
update(true);
|
|
425
|
+
return ani;
|
|
426
|
+
};
|
|
427
|
+
const duration = (animationDuration) => {
|
|
428
|
+
/**
|
|
429
|
+
* CSS Animation Durations of 0ms work fine on Chrome
|
|
430
|
+
* but do not run on Safari, so force it to 1ms to
|
|
431
|
+
* get it to run on both platforms.
|
|
432
|
+
*/
|
|
433
|
+
if (!supportsWebAnimations && animationDuration === 0) {
|
|
434
|
+
animationDuration = 1;
|
|
435
|
+
}
|
|
436
|
+
_duration = animationDuration;
|
|
437
|
+
update(true);
|
|
438
|
+
return ani;
|
|
439
|
+
};
|
|
440
|
+
const iterations = (animationIterations) => {
|
|
441
|
+
_iterations = animationIterations;
|
|
442
|
+
update(true);
|
|
443
|
+
return ani;
|
|
444
|
+
};
|
|
445
|
+
const parent = (animation) => {
|
|
446
|
+
parentAnimation = animation;
|
|
447
|
+
return ani;
|
|
448
|
+
};
|
|
449
|
+
const addElement = (el) => {
|
|
450
|
+
if (el != null) {
|
|
451
|
+
if (el.nodeType === 1) {
|
|
452
|
+
elements.push(el);
|
|
453
|
+
}
|
|
454
|
+
else if (el.length >= 0) {
|
|
455
|
+
for (let i = 0; i < el.length; i++) {
|
|
456
|
+
elements.push(el[i]);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
console.error('Invalid addElement value');
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
return ani;
|
|
464
|
+
};
|
|
465
|
+
const addAnimation = (animationToAdd) => {
|
|
466
|
+
if (animationToAdd != null) {
|
|
467
|
+
if (Array.isArray(animationToAdd)) {
|
|
468
|
+
for (const animation of animationToAdd) {
|
|
469
|
+
animation.parent(ani);
|
|
470
|
+
childAnimations.push(animation);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
animationToAdd.parent(ani);
|
|
475
|
+
childAnimations.push(animationToAdd);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return ani;
|
|
479
|
+
};
|
|
480
|
+
const keyframes = (keyframeValues) => {
|
|
481
|
+
const different = _keyframes !== keyframeValues;
|
|
482
|
+
_keyframes = keyframeValues;
|
|
483
|
+
if (different) {
|
|
484
|
+
updateKeyframes(_keyframes);
|
|
485
|
+
}
|
|
486
|
+
return ani;
|
|
487
|
+
};
|
|
488
|
+
const updateKeyframes = (keyframeValues) => {
|
|
489
|
+
if (supportsWebAnimations) {
|
|
490
|
+
getWebAnimations().forEach((animation) => {
|
|
491
|
+
if (animation.effect.setKeyframes) {
|
|
492
|
+
animation.effect.setKeyframes(keyframeValues);
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
const newEffect = new KeyframeEffect(animation.effect.target, keyframeValues, animation.effect.getTiming());
|
|
496
|
+
animation.effect = newEffect;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
initializeCSSAnimation();
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
505
|
+
* Run all "before" animation hooks.
|
|
506
|
+
*/
|
|
507
|
+
const beforeAnimation = () => {
|
|
508
|
+
// Runs all before read callbacks
|
|
509
|
+
_beforeAddReadFunctions.forEach((callback) => callback());
|
|
510
|
+
// Runs all before write callbacks
|
|
511
|
+
_beforeAddWriteFunctions.forEach((callback) => callback());
|
|
512
|
+
// Updates styles and classes before animation runs
|
|
513
|
+
const addClasses = beforeAddClasses;
|
|
514
|
+
const removeClasses = beforeRemoveClasses;
|
|
515
|
+
const styles = beforeStylesValue;
|
|
516
|
+
elements.forEach((el) => {
|
|
517
|
+
const elementClassList = el.classList;
|
|
518
|
+
addClasses.forEach((c) => elementClassList.add(c));
|
|
519
|
+
removeClasses.forEach((c) => elementClassList.remove(c));
|
|
520
|
+
for (const property in styles) {
|
|
521
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
522
|
+
if (styles.hasOwnProperty(property)) {
|
|
523
|
+
setStyleProperty(el, property, styles[property]);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Run all "after" animation hooks.
|
|
530
|
+
*/
|
|
531
|
+
const afterAnimation = () => {
|
|
532
|
+
clearCSSAnimationsTimeout();
|
|
533
|
+
// Runs all after read callbacks
|
|
534
|
+
_afterAddReadFunctions.forEach((callback) => callback());
|
|
535
|
+
// Runs all after write callbacks
|
|
536
|
+
_afterAddWriteFunctions.forEach((callback) => callback());
|
|
537
|
+
// Updates styles and classes before animation ends
|
|
538
|
+
const currentStep = willComplete ? 1 : 0;
|
|
539
|
+
const addClasses = afterAddClasses;
|
|
540
|
+
const removeClasses = afterRemoveClasses;
|
|
541
|
+
const styles = afterStylesValue;
|
|
542
|
+
elements.forEach((el) => {
|
|
543
|
+
const elementClassList = el.classList;
|
|
544
|
+
addClasses.forEach((c) => elementClassList.add(c));
|
|
545
|
+
removeClasses.forEach((c) => elementClassList.remove(c));
|
|
546
|
+
for (const property in styles) {
|
|
547
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
548
|
+
if (styles.hasOwnProperty(property)) {
|
|
549
|
+
setStyleProperty(el, property, styles[property]);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
onFinishCallbacks.forEach((onFinishCallback) => {
|
|
554
|
+
return onFinishCallback.c(currentStep, ani);
|
|
555
|
+
});
|
|
556
|
+
onFinishOneTimeCallbacks.forEach((onFinishCallback) => {
|
|
557
|
+
return onFinishCallback.c(currentStep, ani);
|
|
558
|
+
});
|
|
559
|
+
onFinishOneTimeCallbacks.length = 0;
|
|
560
|
+
shouldCalculateNumAnimations = true;
|
|
561
|
+
if (willComplete) {
|
|
562
|
+
finished = true;
|
|
563
|
+
}
|
|
564
|
+
willComplete = true;
|
|
565
|
+
};
|
|
566
|
+
const animationFinish = () => {
|
|
567
|
+
if (numAnimationsRunning === 0) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
numAnimationsRunning--;
|
|
571
|
+
if (numAnimationsRunning === 0) {
|
|
572
|
+
afterAnimation();
|
|
573
|
+
if (parentAnimation) {
|
|
574
|
+
parentAnimation.animationFinish();
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
const initializeCSSAnimation = (toggleAnimationName = true) => {
|
|
579
|
+
cleanUpStyleSheets();
|
|
580
|
+
const processedKeyframes = processKeyframes(_keyframes);
|
|
581
|
+
elements.forEach((element) => {
|
|
582
|
+
if (processedKeyframes.length > 0) {
|
|
583
|
+
const keyframeRules = generateKeyframeRules(processedKeyframes);
|
|
584
|
+
keyframeName = animationId !== undefined ? animationId : generateKeyframeName(keyframeRules);
|
|
585
|
+
const stylesheet = createKeyframeStylesheet(keyframeName, keyframeRules, element);
|
|
586
|
+
stylesheets.push(stylesheet);
|
|
587
|
+
setStyleProperty(element, 'animation-duration', `${getDuration()}ms`);
|
|
588
|
+
setStyleProperty(element, 'animation-timing-function', getEasing());
|
|
589
|
+
setStyleProperty(element, 'animation-delay', `${getDelay()}ms`);
|
|
590
|
+
setStyleProperty(element, 'animation-fill-mode', getFill());
|
|
591
|
+
setStyleProperty(element, 'animation-direction', getDirection());
|
|
592
|
+
const iterationsCount = getIterations() === Infinity ? 'infinite' : getIterations().toString();
|
|
593
|
+
setStyleProperty(element, 'animation-iteration-count', iterationsCount);
|
|
594
|
+
setStyleProperty(element, 'animation-play-state', 'paused');
|
|
595
|
+
if (toggleAnimationName) {
|
|
596
|
+
setStyleProperty(element, 'animation-name', `${stylesheet.id}-alt`);
|
|
597
|
+
}
|
|
598
|
+
raf(() => {
|
|
599
|
+
setStyleProperty(element, 'animation-name', stylesheet.id || null);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
};
|
|
604
|
+
const initializeWebAnimation = () => {
|
|
605
|
+
elements.forEach((element) => {
|
|
606
|
+
const animation = element.animate(_keyframes, {
|
|
607
|
+
id,
|
|
608
|
+
delay: getDelay(),
|
|
609
|
+
duration: getDuration(),
|
|
610
|
+
easing: getEasing(),
|
|
611
|
+
iterations: getIterations(),
|
|
612
|
+
fill: getFill(),
|
|
613
|
+
direction: getDirection(),
|
|
614
|
+
});
|
|
615
|
+
animation.pause();
|
|
616
|
+
webAnimations.push(animation);
|
|
617
|
+
});
|
|
618
|
+
if (webAnimations.length > 0) {
|
|
619
|
+
webAnimations[0].onfinish = () => {
|
|
620
|
+
animationFinish();
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
const initializeAnimation = (toggleAnimationName = true) => {
|
|
625
|
+
beforeAnimation();
|
|
626
|
+
if (_keyframes.length > 0) {
|
|
627
|
+
if (supportsWebAnimations) {
|
|
628
|
+
initializeWebAnimation();
|
|
629
|
+
}
|
|
630
|
+
else {
|
|
631
|
+
initializeCSSAnimation(toggleAnimationName);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
initialized = true;
|
|
635
|
+
};
|
|
636
|
+
const setAnimationStep = (step) => {
|
|
637
|
+
step = Math.min(Math.max(step, 0), 0.9999);
|
|
638
|
+
if (supportsWebAnimations) {
|
|
639
|
+
webAnimations.forEach((animation) => {
|
|
640
|
+
animation.currentTime = animation.effect.getComputedTiming().delay + getDuration() * step;
|
|
641
|
+
animation.pause();
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
const animationDuration = `-${getDuration() * step}ms`;
|
|
646
|
+
elements.forEach((element) => {
|
|
647
|
+
if (_keyframes.length > 0) {
|
|
648
|
+
setStyleProperty(element, 'animation-delay', animationDuration);
|
|
649
|
+
setStyleProperty(element, 'animation-play-state', 'paused');
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
const updateWebAnimation = (step) => {
|
|
655
|
+
webAnimations.forEach((animation) => {
|
|
656
|
+
animation.effect.updateTiming({
|
|
657
|
+
delay: getDelay(),
|
|
658
|
+
duration: getDuration(),
|
|
659
|
+
easing: getEasing(),
|
|
660
|
+
iterations: getIterations(),
|
|
661
|
+
fill: getFill(),
|
|
662
|
+
direction: getDirection(),
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
if (step !== undefined) {
|
|
666
|
+
setAnimationStep(step);
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
const updateCSSAnimation = (toggleAnimationName = true, step) => {
|
|
670
|
+
raf(() => {
|
|
671
|
+
elements.forEach((element) => {
|
|
672
|
+
setStyleProperty(element, 'animation-name', keyframeName || null);
|
|
673
|
+
setStyleProperty(element, 'animation-duration', `${getDuration()}ms`);
|
|
674
|
+
setStyleProperty(element, 'animation-timing-function', getEasing());
|
|
675
|
+
setStyleProperty(element, 'animation-delay', step !== undefined ? `-${step * getDuration()}ms` : `${getDelay()}ms`);
|
|
676
|
+
setStyleProperty(element, 'animation-fill-mode', getFill() || null);
|
|
677
|
+
setStyleProperty(element, 'animation-direction', getDirection() || null);
|
|
678
|
+
const iterationsCount = getIterations() === Infinity ? 'infinite' : getIterations().toString();
|
|
679
|
+
setStyleProperty(element, 'animation-iteration-count', iterationsCount);
|
|
680
|
+
if (toggleAnimationName) {
|
|
681
|
+
setStyleProperty(element, 'animation-name', `${keyframeName}-alt`);
|
|
682
|
+
}
|
|
683
|
+
raf(() => {
|
|
684
|
+
setStyleProperty(element, 'animation-name', keyframeName || null);
|
|
685
|
+
});
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
const update = (deep = false, toggleAnimationName = true, step) => {
|
|
690
|
+
if (deep) {
|
|
691
|
+
childAnimations.forEach((animation) => {
|
|
692
|
+
animation.update(deep, toggleAnimationName, step);
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
if (supportsWebAnimations) {
|
|
696
|
+
updateWebAnimation(step);
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
updateCSSAnimation(toggleAnimationName, step);
|
|
700
|
+
}
|
|
701
|
+
return ani;
|
|
702
|
+
};
|
|
703
|
+
const progressStart = (forceLinearEasing = false, step) => {
|
|
704
|
+
childAnimations.forEach((animation) => {
|
|
705
|
+
animation.progressStart(forceLinearEasing, step);
|
|
706
|
+
});
|
|
707
|
+
pauseAnimation();
|
|
708
|
+
shouldForceLinearEasing = forceLinearEasing;
|
|
709
|
+
if (!initialized) {
|
|
710
|
+
initializeAnimation();
|
|
711
|
+
}
|
|
712
|
+
update(false, true, step);
|
|
713
|
+
return ani;
|
|
714
|
+
};
|
|
715
|
+
const progressStep = (step) => {
|
|
716
|
+
childAnimations.forEach((animation) => {
|
|
717
|
+
animation.progressStep(step);
|
|
718
|
+
});
|
|
719
|
+
setAnimationStep(step);
|
|
720
|
+
return ani;
|
|
721
|
+
};
|
|
722
|
+
const progressEnd = (playTo, step, dur) => {
|
|
723
|
+
shouldForceLinearEasing = false;
|
|
724
|
+
childAnimations.forEach((animation) => {
|
|
725
|
+
animation.progressEnd(playTo, step, dur);
|
|
726
|
+
});
|
|
727
|
+
if (dur !== undefined) {
|
|
728
|
+
forceDurationValue = dur;
|
|
729
|
+
}
|
|
730
|
+
finished = false;
|
|
731
|
+
willComplete = true;
|
|
732
|
+
if (playTo === 0) {
|
|
733
|
+
forceDirectionValue = getDirection() === 'reverse' ? 'normal' : 'reverse';
|
|
734
|
+
if (forceDirectionValue === 'reverse') {
|
|
735
|
+
willComplete = false;
|
|
736
|
+
}
|
|
737
|
+
if (supportsWebAnimations) {
|
|
738
|
+
update();
|
|
739
|
+
setAnimationStep(1 - step);
|
|
740
|
+
}
|
|
741
|
+
else {
|
|
742
|
+
forceDelayValue = (1 - step) * getDuration() * -1;
|
|
743
|
+
update(false, false);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
else if (playTo === 1) {
|
|
747
|
+
if (supportsWebAnimations) {
|
|
748
|
+
update();
|
|
749
|
+
setAnimationStep(step);
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
forceDelayValue = step * getDuration() * -1;
|
|
753
|
+
update(false, false);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
if (playTo !== undefined) {
|
|
757
|
+
onFinish(() => {
|
|
758
|
+
forceDurationValue = undefined;
|
|
759
|
+
forceDirectionValue = undefined;
|
|
760
|
+
forceDelayValue = undefined;
|
|
761
|
+
}, {
|
|
762
|
+
oneTimeCallback: true,
|
|
763
|
+
});
|
|
764
|
+
if (!parentAnimation) {
|
|
765
|
+
play();
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return ani;
|
|
769
|
+
};
|
|
770
|
+
const pauseAnimation = () => {
|
|
771
|
+
if (initialized) {
|
|
772
|
+
if (supportsWebAnimations) {
|
|
773
|
+
webAnimations.forEach((animation) => {
|
|
774
|
+
animation.pause();
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
elements.forEach((element) => {
|
|
779
|
+
setStyleProperty(element, 'animation-play-state', 'paused');
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
paused = true;
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
const pause = () => {
|
|
786
|
+
childAnimations.forEach((animation) => {
|
|
787
|
+
animation.pause();
|
|
788
|
+
});
|
|
789
|
+
pauseAnimation();
|
|
790
|
+
return ani;
|
|
791
|
+
};
|
|
792
|
+
const onAnimationEndFallback = () => {
|
|
793
|
+
cssAnimationsTimerFallback = undefined;
|
|
794
|
+
animationFinish();
|
|
795
|
+
};
|
|
796
|
+
const clearCSSAnimationsTimeout = () => {
|
|
797
|
+
if (cssAnimationsTimerFallback) {
|
|
798
|
+
clearTimeout(cssAnimationsTimerFallback);
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
const playCSSAnimations = () => {
|
|
802
|
+
clearCSSAnimationsTimeout();
|
|
803
|
+
raf(() => {
|
|
804
|
+
elements.forEach((element) => {
|
|
805
|
+
if (_keyframes.length > 0) {
|
|
806
|
+
setStyleProperty(element, 'animation-play-state', 'running');
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
if (_keyframes.length === 0 || elements.length === 0) {
|
|
811
|
+
animationFinish();
|
|
812
|
+
}
|
|
813
|
+
else {
|
|
814
|
+
/**
|
|
815
|
+
* This is a catchall in the event that a CSS Animation did not finish.
|
|
816
|
+
* The Web Animations API has mechanisms in place for preventing this.
|
|
817
|
+
* CSS Animations will not fire an `animationend` event
|
|
818
|
+
* for elements with `display: none`. The Web Animations API
|
|
819
|
+
* accounts for this, but using raw CSS Animations requires
|
|
820
|
+
* this workaround.
|
|
821
|
+
*/
|
|
822
|
+
const animationDelay = getDelay() || 0;
|
|
823
|
+
const animationDuration = getDuration() || 0;
|
|
824
|
+
const animationIterations = getIterations() || 1;
|
|
825
|
+
// No need to set a timeout when animation has infinite iterations
|
|
826
|
+
if (isFinite(animationIterations)) {
|
|
827
|
+
cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + animationDuration * animationIterations + ANIMATION_END_FALLBACK_PADDING_MS);
|
|
828
|
+
}
|
|
829
|
+
animationEnd(elements[0], () => {
|
|
830
|
+
clearCSSAnimationsTimeout();
|
|
831
|
+
/**
|
|
832
|
+
* Ensure that clean up
|
|
833
|
+
* is always done a frame
|
|
834
|
+
* before the onFinish handlers
|
|
835
|
+
* are fired. Otherwise, there
|
|
836
|
+
* may be flickering if a new
|
|
837
|
+
* animation is started on the same
|
|
838
|
+
* element too quickly
|
|
839
|
+
*/
|
|
840
|
+
raf(() => {
|
|
841
|
+
clearCSSAnimationPlayState();
|
|
842
|
+
raf(animationFinish);
|
|
843
|
+
});
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
const clearCSSAnimationPlayState = () => {
|
|
848
|
+
elements.forEach((element) => {
|
|
849
|
+
removeStyleProperty(element, 'animation-duration');
|
|
850
|
+
removeStyleProperty(element, 'animation-delay');
|
|
851
|
+
removeStyleProperty(element, 'animation-play-state');
|
|
852
|
+
});
|
|
853
|
+
};
|
|
854
|
+
const playWebAnimations = () => {
|
|
855
|
+
webAnimations.forEach((animation) => {
|
|
856
|
+
animation.play();
|
|
857
|
+
});
|
|
858
|
+
if (_keyframes.length === 0 || elements.length === 0) {
|
|
859
|
+
animationFinish();
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
const resetAnimation = () => {
|
|
863
|
+
if (supportsWebAnimations) {
|
|
864
|
+
setAnimationStep(0);
|
|
865
|
+
updateWebAnimation();
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
updateCSSAnimation();
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
const play = (opts) => {
|
|
872
|
+
return new Promise((resolve) => {
|
|
873
|
+
if (opts === null || opts === void 0 ? void 0 : opts.sync) {
|
|
874
|
+
shouldForceSyncPlayback = true;
|
|
875
|
+
onFinish(() => (shouldForceSyncPlayback = false), { oneTimeCallback: true });
|
|
876
|
+
}
|
|
877
|
+
if (!initialized) {
|
|
878
|
+
initializeAnimation();
|
|
879
|
+
}
|
|
880
|
+
if (finished) {
|
|
881
|
+
resetAnimation();
|
|
882
|
+
finished = false;
|
|
883
|
+
}
|
|
884
|
+
if (shouldCalculateNumAnimations) {
|
|
885
|
+
numAnimationsRunning = childAnimations.length + 1;
|
|
886
|
+
shouldCalculateNumAnimations = false;
|
|
887
|
+
}
|
|
888
|
+
onFinish(() => resolve(), { oneTimeCallback: true });
|
|
889
|
+
childAnimations.forEach((animation) => {
|
|
890
|
+
animation.play();
|
|
891
|
+
});
|
|
892
|
+
if (supportsWebAnimations) {
|
|
893
|
+
playWebAnimations();
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
playCSSAnimations();
|
|
897
|
+
}
|
|
898
|
+
paused = false;
|
|
899
|
+
});
|
|
900
|
+
};
|
|
901
|
+
const stop = () => {
|
|
902
|
+
childAnimations.forEach((animation) => {
|
|
903
|
+
animation.stop();
|
|
904
|
+
});
|
|
905
|
+
if (initialized) {
|
|
906
|
+
cleanUpElements();
|
|
907
|
+
initialized = false;
|
|
908
|
+
}
|
|
909
|
+
resetFlags();
|
|
910
|
+
};
|
|
911
|
+
const from = (property, value) => {
|
|
912
|
+
const firstFrame = _keyframes[0];
|
|
913
|
+
if (firstFrame !== undefined && (firstFrame.offset === undefined || firstFrame.offset === 0)) {
|
|
914
|
+
firstFrame[property] = value;
|
|
915
|
+
}
|
|
916
|
+
else {
|
|
917
|
+
_keyframes = [{ offset: 0, [property]: value }, ..._keyframes];
|
|
918
|
+
}
|
|
919
|
+
return ani;
|
|
920
|
+
};
|
|
921
|
+
const to = (property, value) => {
|
|
922
|
+
const lastFrame = _keyframes[_keyframes.length - 1];
|
|
923
|
+
if (lastFrame !== undefined && (lastFrame.offset === undefined || lastFrame.offset === 1)) {
|
|
924
|
+
lastFrame[property] = value;
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
_keyframes = [..._keyframes, { offset: 1, [property]: value }];
|
|
928
|
+
}
|
|
929
|
+
return ani;
|
|
930
|
+
};
|
|
931
|
+
const fromTo = (property, fromValue, toValue) => {
|
|
932
|
+
return from(property, fromValue).to(property, toValue);
|
|
933
|
+
};
|
|
934
|
+
return (ani = {
|
|
935
|
+
parentAnimation,
|
|
936
|
+
elements,
|
|
937
|
+
childAnimations,
|
|
938
|
+
id,
|
|
939
|
+
animationFinish,
|
|
940
|
+
from,
|
|
941
|
+
to,
|
|
942
|
+
fromTo,
|
|
943
|
+
parent,
|
|
944
|
+
play,
|
|
945
|
+
pause,
|
|
946
|
+
stop,
|
|
947
|
+
destroy,
|
|
948
|
+
keyframes,
|
|
949
|
+
addAnimation,
|
|
950
|
+
addElement,
|
|
951
|
+
update,
|
|
952
|
+
fill,
|
|
953
|
+
direction,
|
|
954
|
+
iterations,
|
|
955
|
+
duration,
|
|
956
|
+
easing,
|
|
957
|
+
delay,
|
|
958
|
+
getWebAnimations,
|
|
959
|
+
getKeyframes,
|
|
960
|
+
getFill,
|
|
961
|
+
getDirection,
|
|
962
|
+
getDelay,
|
|
963
|
+
getIterations,
|
|
964
|
+
getEasing,
|
|
965
|
+
getDuration,
|
|
966
|
+
afterAddRead,
|
|
967
|
+
afterAddWrite,
|
|
968
|
+
afterClearStyles,
|
|
969
|
+
afterStyles,
|
|
970
|
+
afterRemoveClass,
|
|
971
|
+
afterAddClass,
|
|
972
|
+
beforeAddRead,
|
|
973
|
+
beforeAddWrite,
|
|
974
|
+
beforeClearStyles,
|
|
975
|
+
beforeStyles,
|
|
976
|
+
beforeRemoveClass,
|
|
977
|
+
beforeAddClass,
|
|
978
|
+
onFinish,
|
|
979
|
+
isRunning,
|
|
980
|
+
progressStart,
|
|
981
|
+
progressStep,
|
|
982
|
+
progressEnd,
|
|
983
|
+
});
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
export { createAnimation as c };
|