@content-blocks/js 0.7.7 → 0.8.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/LICENSE +1 -1
- package/README.md +111 -3
- package/THIRD-PARTY-NOTICES.md +21 -0
- package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -2
- package/dist/cjs/content-accordion.cjs.entry.js +87 -0
- package/dist/cjs/content-blocks.cjs.js +35 -11
- package/dist/cjs/content-button.cjs.entry.js +113 -0
- package/dist/cjs/content-carousel.cjs.entry.js +153 -47
- package/dist/cjs/content-grid-formatter.cjs.entry.js +102 -0
- package/dist/cjs/content-hero-block.cjs.entry.js +45 -0
- package/dist/cjs/content-image.cjs.entry.js +153 -0
- package/dist/cjs/content-line.cjs.entry.js +61 -0
- package/dist/cjs/content-navigation-block.cjs.entry.js +51 -34
- package/dist/cjs/content-overlay.cjs.entry.js +641 -0
- package/dist/cjs/content-spacer.cjs.entry.js +75 -0
- package/dist/cjs/content-split-block.cjs.entry.js +22 -19
- package/dist/cjs/content-tabs.cjs.entry.js +38 -21
- package/dist/cjs/content-text-block.cjs.entry.js +63 -0
- package/dist/cjs/content-tout-block.cjs.entry.js +34 -0
- package/dist/cjs/{content-accordion_11.cjs.entry.js → content-video.cjs.entry.js} +14541 -12905
- package/dist/cjs/{focus-trap.esm-7bc384a0.js → focus-trap.esm-ZwN-anf1.js} +484 -190
- package/dist/cjs/{index-2e0ce692.js → index-B1U6Gweq.js} +348 -246
- package/dist/cjs/index-ClnpH9XB.js +2170 -0
- package/dist/cjs/index-CyalvZJn.js +1719 -0
- package/dist/cjs/index-DUvWvBDN.js +290 -0
- package/dist/cjs/index-voGY4Tkl.js +4705 -0
- package/dist/cjs/index.cjs.js +2 -5
- package/dist/cjs/loader.cjs.js +3 -8
- package/dist/cjs/responsive-component-C5eJS82z.js +171 -0
- package/dist/cjs/responsive-component-DMdnQIPV.js +171 -0
- package/dist/cjs/swiper-KLYbvU1K.js +3931 -0
- package/dist/cjs/{swiper-8221f4e8.js → swiper-_Z8Y4IJI.js} +269 -236
- package/dist/cjs/utils-BCHaRGm_.js +462 -0
- package/dist/cjs/{utils-df044337.js → utils-C3gXIS2t.js} +51 -49
- package/dist/cjs/utils-DUvWvBDN.js +290 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.css +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +33 -48
- package/dist/collection/blocks/content-split-block/content-split-block.css +16 -5
- package/dist/collection/blocks/content-split-block/content-split-block.js +29 -48
- package/dist/collection/blocks/content-text-block/content-text-block.js +65 -59
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +3 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.js +22 -47
- package/dist/collection/collection-manifest.json +8 -5
- package/dist/collection/components/content-accordion/content-accordion.css +20 -1
- package/dist/collection/components/content-accordion/content-accordion.js +67 -33
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +0 -1
- package/dist/collection/components/content-carousel/content-carousel.css +60 -4
- package/dist/collection/components/content-carousel/content-carousel.js +294 -44
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +15 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +86 -42
- package/dist/collection/components/content-overlay/content-overlay.css +36 -5
- package/dist/collection/components/content-overlay/content-overlay.js +181 -120
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js +7 -49
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js +0 -1
- package/dist/collection/elements/content-button/content-button.css +8 -7
- package/dist/collection/elements/content-button/content-button.js +103 -84
- package/dist/collection/elements/content-image/content-image.css +3 -1
- package/dist/collection/elements/content-image/content-image.js +176 -95
- package/dist/collection/elements/content-line/content-line.js +63 -54
- package/dist/collection/elements/content-video/content-video.css +1 -1
- package/dist/collection/elements/content-video/content-video.js +123 -73
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +8 -2
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +167 -89
- package/dist/collection/formatters/content-spacer/content-spacer.js +86 -209
- package/dist/collection/global/content-blocks-reset.css +77 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/sass/_mixins.scss +21 -5
- package/dist/collection/sass/_variables.scss +15 -15
- package/dist/collection/setupFiles.js +0 -1
- package/dist/collection/site/site.js +67 -0
- package/dist/collection/utils/breakpoints.js +162 -0
- package/dist/collection/utils/responsive-component.js +249 -0
- package/dist/collection/utils/utils.js +32 -42
- package/dist/components/content-accordion.js +65 -44
- package/dist/components/content-button.js +89 -43
- package/dist/components/content-carousel.js +172 -55
- package/dist/components/content-grid-formatter.js +127 -3
- package/dist/components/content-hero-block.js +33 -26
- package/dist/components/content-image.js +127 -71
- package/dist/components/content-line.js +56 -35
- package/dist/components/content-navigation-block.js +62 -39
- package/dist/components/content-overlay.js +128 -67
- package/dist/components/content-spacer.js +70 -54
- package/dist/components/content-split-block.js +33 -32
- package/dist/components/content-tabs.js +46 -25
- package/dist/components/content-text-block.js +55 -35
- package/dist/components/content-tout-block.js +29 -27
- package/dist/components/content-video.js +14605 -11951
- package/dist/{esm/focus-trap.esm-8fb54175.js → components/focus-trap.esm.js} +484 -190
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -3
- package/dist/components/{p-5a91aa1b.js → index2.js} +348 -246
- package/dist/components/p-BWRCeMvO.js +1 -0
- package/dist/components/p-CYF5GU_q.js +1 -0
- package/dist/components/p-DXUoPIwl.js +10 -0
- package/dist/components/p-D_Ll4QNj.js +1 -0
- package/dist/components/p-DhIoW7H3.js +1 -0
- package/dist/components/responsive-component.js +168 -0
- package/dist/components/{p-e5dc4ea4.js → swiper.js} +268 -235
- package/dist/components/utils.js +4969 -0
- package/dist/{esm/utils-1c9f0ec1.js → components/utils2.js} +51 -50
- package/dist/content-blocks/content-accordion.entry.js +85 -0
- package/dist/content-blocks/content-blocks.esm.js +47 -2
- package/dist/content-blocks/content-button.entry.js +111 -0
- package/dist/content-blocks/content-carousel.entry.js +188 -0
- package/dist/content-blocks/content-grid-formatter.entry.js +100 -0
- package/dist/content-blocks/content-hero-block.entry.js +43 -0
- package/dist/content-blocks/content-image.entry.js +151 -0
- package/dist/content-blocks/content-line.entry.js +59 -0
- package/dist/content-blocks/content-navigation-block.entry.js +105 -0
- package/dist/content-blocks/content-overlay.entry.js +639 -0
- package/dist/content-blocks/content-spacer.entry.js +73 -0
- package/dist/content-blocks/content-split-block.entry.js +34 -0
- package/dist/content-blocks/content-tabs.entry.js +245 -0
- package/dist/content-blocks/content-text-block.entry.js +61 -0
- package/dist/content-blocks/content-tout-block.entry.js +32 -0
- package/dist/{esm/content-accordion_11.entry.js → content-blocks/content-video.entry.js} +14516 -12868
- package/dist/{components/p-a2fedf8a.js → content-blocks/focus-trap.esm-DXUoPIwl.js} +484 -190
- package/dist/content-blocks/global/content-blocks-reset.css +77 -0
- package/dist/content-blocks/index-BFDJMblF.js +4690 -0
- package/dist/{esm/index-f45a9c45.js → content-blocks/index-P1YnSd-O.js} +348 -246
- package/dist/content-blocks/index.esm.js +1 -2
- package/dist/content-blocks/p-008457f0.entry.js +1 -0
- package/dist/content-blocks/p-052692f1.entry.js +1 -0
- package/dist/content-blocks/p-0f71bd32.entry.js +1 -0
- package/dist/content-blocks/p-1f154617.entry.js +1 -0
- package/dist/content-blocks/p-2554ebd8.entry.js +1 -0
- package/dist/content-blocks/p-4afd6511.entry.js +1 -0
- package/dist/content-blocks/p-78d5de9f.entry.js +1 -0
- package/dist/content-blocks/p-7bcf7e7e.entry.js +1 -0
- package/dist/content-blocks/p-9058031c.entry.js +1 -0
- package/dist/content-blocks/p-9c41ac23.entry.js +17 -0
- package/dist/content-blocks/p-CLwOzPEO.js +3 -0
- package/dist/content-blocks/p-CYF5GU_q.js +1 -0
- package/dist/content-blocks/p-CjR_4mPu.js +1 -0
- package/dist/content-blocks/p-DQuL1Twl.js +1 -0
- package/dist/content-blocks/p-DXUoPIwl.js +10 -0
- package/dist/content-blocks/p-D_Ll4QNj.js +1 -0
- package/dist/content-blocks/p-DhIoW7H3.js +1 -0
- package/dist/content-blocks/p-DzYwy_62.js +1 -0
- package/dist/content-blocks/p-b2e6358a.entry.js +1 -0
- package/dist/content-blocks/p-c783bc68.entry.js +1 -0
- package/dist/content-blocks/p-e3d81e15.entry.js +1 -0
- package/dist/content-blocks/p-f23b4aae.entry.js +1 -0
- package/dist/content-blocks/p-f75c9094.entry.js +1 -0
- package/dist/content-blocks/responsive-component-BsLrcKbS.js +169 -0
- package/dist/content-blocks/sass/_mixins.scss +21 -5
- package/dist/content-blocks/sass/_variables.scss +15 -15
- package/dist/{esm/swiper-e9621adb.js → content-blocks/swiper-nBv069TB.js} +268 -235
- package/dist/{components/p-b85cfa86.js → content-blocks/utils--SDsQnWS.js} +51 -50
- package/dist/content-blocks/utils-Bak__24s.js +280 -0
- package/dist/docs.d.ts +480 -0
- package/dist/docs.json +5312 -0
- package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -2
- package/dist/esm/content-accordion.entry.js +85 -0
- package/dist/esm/content-blocks.js +33 -8
- package/dist/esm/content-button.entry.js +111 -0
- package/dist/esm/content-carousel.entry.js +153 -45
- package/dist/esm/content-grid-formatter.entry.js +100 -0
- package/dist/esm/content-hero-block.entry.js +43 -0
- package/dist/esm/content-image.entry.js +151 -0
- package/dist/esm/content-line.entry.js +59 -0
- package/dist/esm/content-navigation-block.entry.js +51 -32
- package/dist/esm/content-overlay.entry.js +639 -0
- package/dist/esm/content-spacer.entry.js +73 -0
- package/dist/esm/content-split-block.entry.js +22 -17
- package/dist/esm/content-tabs.entry.js +38 -19
- package/dist/esm/content-text-block.entry.js +61 -0
- package/dist/esm/content-tout-block.entry.js +32 -0
- package/dist/esm/content-video.entry.js +72033 -0
- package/dist/esm/focus-trap.esm-DXUoPIwl.js +1801 -0
- package/dist/esm/index-BASCLGuP.js +1713 -0
- package/dist/esm/index-BFDJMblF.js +4690 -0
- package/dist/esm/index-CLwOzPEO.js +2161 -0
- package/dist/esm/index-CjR_4mPu.js +280 -0
- package/dist/esm/index-P1YnSd-O.js +5397 -0
- package/dist/esm/index.js +1 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/responsive-component-BsLrcKbS.js +169 -0
- package/dist/esm/responsive-component-D7dJHMp0.js +169 -0
- package/dist/esm/swiper-CtypHPwF.js +3928 -0
- package/dist/esm/swiper-nBv069TB.js +3941 -0
- package/dist/esm/utils--SDsQnWS.js +460 -0
- package/dist/esm/utils-Bak__24s.js +280 -0
- package/dist/esm/utils-CYF5GU_q.js +438 -0
- package/dist/node_modules/video.js/dist/video-js.min.css +1 -0
- package/dist/test/axe.js +60 -0
- package/dist/types/Users/shahrukceo/Developer/content-blocks/packages/js/.stencil/test/axe.d.ts +16 -0
- package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +7 -11
- package/dist/types/blocks/content-split-block/content-split-block.d.ts +5 -9
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +4 -9
- package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +5 -10
- package/dist/types/components/content-accordion/content-accordion.d.ts +4 -3
- package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +0 -1
- package/dist/types/components/content-carousel/content-carousel.d.ts +44 -7
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +14 -8
- package/dist/types/components/content-overlay/content-overlay.d.ts +15 -16
- package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +0 -1
- package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +0 -1
- package/dist/types/components/content-tabs/content-tabs.d.ts +4 -10
- package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +0 -1
- package/dist/types/components.d.ts +892 -198
- package/dist/types/elements/content-button/content-button.d.ts +8 -13
- package/dist/types/elements/content-image/content-image.d.ts +15 -9
- package/dist/types/elements/content-line/content-line.d.ts +5 -12
- package/dist/types/elements/content-video/content-video.d.ts +6 -11
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +14 -9
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +4 -36
- package/dist/types/index.d.ts +3 -1
- package/dist/types/setupFiles.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +265 -60
- package/dist/types/typings.d.ts +10 -0
- package/dist/types/utils/breakpoints.d.ts +57 -0
- package/dist/types/utils/responsive-component.d.ts +49 -0
- package/dist/types/utils/utils.d.ts +11 -8
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +74 -64
- package/dist/cjs/BehaviorSubject-12116537.js +0 -655
- package/dist/cjs/BehaviorSubject-12116537.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +0 -1
- package/dist/cjs/content-blocks.cjs.js.map +0 -1
- package/dist/cjs/content-carousel.cjs.entry.js.map +0 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-split-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-tabs.cjs.entry.js.map +0 -1
- package/dist/cjs/focus-trap.esm-7bc384a0.js.map +0 -1
- package/dist/cjs/index-2e0ce692.js.map +0 -1
- package/dist/cjs/index-8af2820a.js +0 -1650
- package/dist/cjs/index-8af2820a.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/swiper-8221f4e8.js.map +0 -1
- package/dist/cjs/utils-df044337.js.map +0 -1
- package/dist/cjs/utils-f8ccab0a.js +0 -126
- package/dist/cjs/utils-f8ccab0a.js.map +0 -1
- package/dist/cjs/window-resize-service-65a5a370.js +0 -37
- package/dist/cjs/window-resize-service-65a5a370.js.map +0 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +0 -1
- package/dist/collection/blocks/content-split-block/content-split-block.js.map +0 -1
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +0 -1
- package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +0 -1
- package/dist/collection/components/content-accordion/content-accordion.js.map +0 -1
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +0 -1
- package/dist/collection/components/content-carousel/content-carousel.js.map +0 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +0 -1
- package/dist/collection/components/content-overlay/content-overlay.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js.map +0 -1
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +0 -1
- package/dist/collection/elements/content-button/content-button.js.map +0 -1
- package/dist/collection/elements/content-image/content-image.js.map +0 -1
- package/dist/collection/elements/content-line/content-line.js.map +0 -1
- package/dist/collection/elements/content-video/content-video.js.map +0 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +0 -1
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +0 -1
- package/dist/collection/globalScript.js +0 -15
- package/dist/collection/globalScript.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/content-events-service.js +0 -23
- package/dist/collection/services/content-events-service.js.map +0 -1
- package/dist/collection/services/window-resize-service.js +0 -31
- package/dist/collection/services/window-resize-service.js.map +0 -1
- package/dist/collection/setupFiles.js.map +0 -1
- package/dist/collection/stories/ContentHeroBlock.stories.js +0 -51
- package/dist/collection/stories/ContentHeroBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js +0 -33
- package/dist/collection/stories/ContentNavigationBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentSpacer.stories.js +0 -20
- package/dist/collection/stories/ContentSpacer.stories.js.map +0 -1
- package/dist/collection/stories/ContentTextBlock.stories.js +0 -17
- package/dist/collection/stories/ContentTextBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentToutBlock.stories.js +0 -17
- package/dist/collection/stories/ContentToutBlock.stories.js.map +0 -1
- package/dist/collection/stories/FullPageExample.stories.js +0 -432
- package/dist/collection/stories/FullPageExample.stories.js.map +0 -1
- package/dist/collection/stories/assets/accessibility.svg +0 -5
- package/dist/collection/stories/assets/discord.svg +0 -15
- package/dist/collection/stories/assets/github.svg +0 -3
- package/dist/collection/stories/assets/tutorials.svg +0 -12
- package/dist/collection/stories/assets/youtube.svg +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/content-accordion.js.map +0 -1
- package/dist/components/content-button.js.map +0 -1
- package/dist/components/content-carousel.js.map +0 -1
- package/dist/components/content-grid-formatter.js.map +0 -1
- package/dist/components/content-hero-block.js.map +0 -1
- package/dist/components/content-image.js.map +0 -1
- package/dist/components/content-line.js.map +0 -1
- package/dist/components/content-navigation-block.js.map +0 -1
- package/dist/components/content-overlay.js.map +0 -1
- package/dist/components/content-spacer.js.map +0 -1
- package/dist/components/content-split-block.js.map +0 -1
- package/dist/components/content-tabs.js.map +0 -1
- package/dist/components/content-text-block.js.map +0 -1
- package/dist/components/content-tout-block.js.map +0 -1
- package/dist/components/content-video.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-26483b46.js +0 -35
- package/dist/components/p-26483b46.js.map +0 -1
- package/dist/components/p-5a91aa1b.js.map +0 -1
- package/dist/components/p-74be971f.js +0 -652
- package/dist/components/p-74be971f.js.map +0 -1
- package/dist/components/p-7a436263.js +0 -122
- package/dist/components/p-7a436263.js.map +0 -1
- package/dist/components/p-a2fedf8a.js.map +0 -1
- package/dist/components/p-b85cfa86.js.map +0 -1
- package/dist/components/p-e28db040.js +0 -1452
- package/dist/components/p-e28db040.js.map +0 -1
- package/dist/components/p-e5dc4ea4.js.map +0 -1
- package/dist/components/p-e9bce2ab.js +0 -88
- package/dist/components/p-e9bce2ab.js.map +0 -1
- package/dist/content-blocks/content-blocks.esm.js.map +0 -1
- package/dist/content-blocks/index.esm.js.map +0 -1
- package/dist/content-blocks/p-13c3cc4f.js +0 -3
- package/dist/content-blocks/p-13c3cc4f.js.map +0 -1
- package/dist/content-blocks/p-398760b3.entry.js +0 -26
- package/dist/content-blocks/p-398760b3.entry.js.map +0 -1
- package/dist/content-blocks/p-5422c25b.entry.js +0 -2
- package/dist/content-blocks/p-5422c25b.entry.js.map +0 -1
- package/dist/content-blocks/p-5a91aa1b.js +0 -2
- package/dist/content-blocks/p-5a91aa1b.js.map +0 -1
- package/dist/content-blocks/p-650d1757.js +0 -2
- package/dist/content-blocks/p-650d1757.js.map +0 -1
- package/dist/content-blocks/p-74be971f.js +0 -2
- package/dist/content-blocks/p-74be971f.js.map +0 -1
- package/dist/content-blocks/p-a2fedf8a.js +0 -10
- package/dist/content-blocks/p-a2fedf8a.js.map +0 -1
- package/dist/content-blocks/p-b305392e.entry.js +0 -2
- package/dist/content-blocks/p-b305392e.entry.js.map +0 -1
- package/dist/content-blocks/p-b85cfa86.js +0 -2
- package/dist/content-blocks/p-b85cfa86.js.map +0 -1
- package/dist/content-blocks/p-cc7397cf.js +0 -2
- package/dist/content-blocks/p-cc7397cf.js.map +0 -1
- package/dist/content-blocks/p-d62775d7.entry.js +0 -2
- package/dist/content-blocks/p-d62775d7.entry.js.map +0 -1
- package/dist/content-blocks/p-e1255160.js +0 -2
- package/dist/content-blocks/p-e1255160.js.map +0 -1
- package/dist/content-blocks/p-e5dc4ea4.js +0 -2
- package/dist/content-blocks/p-e5dc4ea4.js.map +0 -1
- package/dist/content-blocks/p-f73f934a.entry.js +0 -2
- package/dist/content-blocks/p-f73f934a.entry.js.map +0 -1
- package/dist/esm/BehaviorSubject-f7a12fd8.js +0 -652
- package/dist/esm/BehaviorSubject-f7a12fd8.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/content-accordion_11.entry.js.map +0 -1
- package/dist/esm/content-blocks.js.map +0 -1
- package/dist/esm/content-carousel.entry.js.map +0 -1
- package/dist/esm/content-navigation-block.entry.js.map +0 -1
- package/dist/esm/content-split-block.entry.js.map +0 -1
- package/dist/esm/content-tabs.entry.js.map +0 -1
- package/dist/esm/focus-trap.esm-8fb54175.js.map +0 -1
- package/dist/esm/index-ec24af7a.js +0 -1621
- package/dist/esm/index-ec24af7a.js.map +0 -1
- package/dist/esm/index-f45a9c45.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/swiper-e9621adb.js.map +0 -1
- package/dist/esm/utils-1c9f0ec1.js.map +0 -1
- package/dist/esm/utils-9a901aa9.js +0 -122
- package/dist/esm/utils-9a901aa9.js.map +0 -1
- package/dist/esm/window-resize-service-354f2ac5.js +0 -35
- package/dist/esm/window-resize-service-354f2ac5.js.map +0 -1
- package/dist/types/globalScript.d.ts +0 -1
- package/dist/types/old-components.d.ts +0 -1239
- package/dist/types/services/content-events-service.d.ts +0 -11
- package/dist/types/services/window-resize-service.d.ts +0 -11
- package/dist/types/stories/ContentHeroBlock.stories.d.ts +0 -11
- package/dist/types/stories/ContentNavigationBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentSpacer.stories.d.ts +0 -15
- package/dist/types/stories/ContentTextBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentToutBlock.stories.d.ts +0 -9
- package/dist/types/stories/FullPageExample.stories.d.ts +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getWindow, a as getDocument, e as elementParents, b as elementStyle, c as elementChildren, s as setCSSProperty, d as elementOuterSize, f as elementNextAll, h as elementPrevAll, i as getTranslate, j as animateCSSModeScroll, n as nextTick, k as createElement, l as showWarning, m as elementIsChildOf, o as now, p as extend, q as elementIndex, r as deleteProps } from './utils--SDsQnWS.js';
|
|
2
2
|
|
|
3
3
|
let support;
|
|
4
4
|
function calcSupport() {
|
|
@@ -17,10 +17,9 @@ function getSupport() {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
let deviceCached;
|
|
20
|
-
function calcDevice(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} = _temp === void 0 ? {} : _temp;
|
|
20
|
+
function calcDevice({
|
|
21
|
+
userAgent
|
|
22
|
+
} = {}) {
|
|
24
23
|
const support = getSupport();
|
|
25
24
|
const window = getWindow();
|
|
26
25
|
const platform = window.navigator.platform;
|
|
@@ -32,7 +31,7 @@ function calcDevice(_temp) {
|
|
|
32
31
|
const screenWidth = window.screen.width;
|
|
33
32
|
const screenHeight = window.screen.height;
|
|
34
33
|
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
|
|
35
|
-
let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
34
|
+
let ipad = ua.match(/(iPad)(?!\1).*OS\s([\d_]+)/);
|
|
36
35
|
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
37
36
|
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
|
38
37
|
const windows = platform === 'Win32';
|
|
@@ -59,10 +58,7 @@ function calcDevice(_temp) {
|
|
|
59
58
|
// Export object
|
|
60
59
|
return device;
|
|
61
60
|
}
|
|
62
|
-
function getDevice(overrides) {
|
|
63
|
-
if (overrides === void 0) {
|
|
64
|
-
overrides = {};
|
|
65
|
-
}
|
|
61
|
+
function getDevice(overrides = {}) {
|
|
66
62
|
if (!deviceCached) {
|
|
67
63
|
deviceCached = calcDevice(overrides);
|
|
68
64
|
}
|
|
@@ -102,12 +98,11 @@ function getBrowser() {
|
|
|
102
98
|
return browser;
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
function Resize(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} = _ref;
|
|
101
|
+
function Resize({
|
|
102
|
+
swiper,
|
|
103
|
+
on,
|
|
104
|
+
emit
|
|
105
|
+
}) {
|
|
111
106
|
const window = getWindow();
|
|
112
107
|
let observer = null;
|
|
113
108
|
let animationFrame = null;
|
|
@@ -126,12 +121,11 @@ function Resize(_ref) {
|
|
|
126
121
|
} = swiper;
|
|
127
122
|
let newWidth = width;
|
|
128
123
|
let newHeight = height;
|
|
129
|
-
entries.forEach(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
} = _ref2;
|
|
124
|
+
entries.forEach(({
|
|
125
|
+
contentBoxSize,
|
|
126
|
+
contentRect,
|
|
127
|
+
target
|
|
128
|
+
}) => {
|
|
135
129
|
if (target && target !== swiper.el) return;
|
|
136
130
|
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
|
137
131
|
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
|
@@ -171,19 +165,15 @@ function Resize(_ref) {
|
|
|
171
165
|
});
|
|
172
166
|
}
|
|
173
167
|
|
|
174
|
-
function Observer(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
} = _ref;
|
|
168
|
+
function Observer({
|
|
169
|
+
swiper,
|
|
170
|
+
extendParams,
|
|
171
|
+
on,
|
|
172
|
+
emit
|
|
173
|
+
}) {
|
|
181
174
|
const observers = [];
|
|
182
175
|
const window = getWindow();
|
|
183
|
-
const attach =
|
|
184
|
-
if (options === void 0) {
|
|
185
|
-
options = {};
|
|
186
|
-
}
|
|
176
|
+
const attach = (target, options = {}) => {
|
|
187
177
|
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
|
188
178
|
const observer = new ObserverFunc(mutations => {
|
|
189
179
|
// The observerUpdate event should only be triggered
|
|
@@ -261,14 +251,11 @@ var eventsEmitter = {
|
|
|
261
251
|
const self = this;
|
|
262
252
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
263
253
|
if (typeof handler !== 'function') return self;
|
|
264
|
-
function onceHandler() {
|
|
254
|
+
function onceHandler(...args) {
|
|
265
255
|
self.off(events, onceHandler);
|
|
266
256
|
if (onceHandler.__emitterProxy) {
|
|
267
257
|
delete onceHandler.__emitterProxy;
|
|
268
258
|
}
|
|
269
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
270
|
-
args[_key] = arguments[_key];
|
|
271
|
-
}
|
|
272
259
|
handler.apply(self, args);
|
|
273
260
|
}
|
|
274
261
|
onceHandler.__emitterProxy = handler;
|
|
@@ -311,16 +298,13 @@ var eventsEmitter = {
|
|
|
311
298
|
});
|
|
312
299
|
return self;
|
|
313
300
|
},
|
|
314
|
-
emit() {
|
|
301
|
+
emit(...args) {
|
|
315
302
|
const self = this;
|
|
316
303
|
if (!self.eventsListeners || self.destroyed) return self;
|
|
317
304
|
if (!self.eventsListeners) return self;
|
|
318
305
|
let events;
|
|
319
306
|
let data;
|
|
320
307
|
let context;
|
|
321
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
322
|
-
args[_key2] = arguments[_key2];
|
|
323
|
-
}
|
|
324
308
|
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
|
325
309
|
events = args[0];
|
|
326
310
|
data = args.slice(1, args.length);
|
|
@@ -388,7 +372,6 @@ function updateSlides() {
|
|
|
388
372
|
const {
|
|
389
373
|
wrapperEl,
|
|
390
374
|
slidesEl,
|
|
391
|
-
size: swiperSize,
|
|
392
375
|
rtlTranslate: rtl,
|
|
393
376
|
wrongRTL
|
|
394
377
|
} = swiper;
|
|
@@ -409,6 +392,7 @@ function updateSlides() {
|
|
|
409
392
|
}
|
|
410
393
|
const previousSnapGridLength = swiper.snapGrid.length;
|
|
411
394
|
const previousSlidesGridLength = swiper.slidesGrid.length;
|
|
395
|
+
const swiperSize = swiper.size - offsetBefore - offsetAfter;
|
|
412
396
|
let spaceBetween = params.spaceBetween;
|
|
413
397
|
let slidePosition = -offsetBefore;
|
|
414
398
|
let prevSlideSize = 0;
|
|
@@ -421,7 +405,7 @@ function updateSlides() {
|
|
|
421
405
|
} else if (typeof spaceBetween === 'string') {
|
|
422
406
|
spaceBetween = parseFloat(spaceBetween);
|
|
423
407
|
}
|
|
424
|
-
swiper.virtualSize = -spaceBetween;
|
|
408
|
+
swiper.virtualSize = -spaceBetween - offsetBefore - offsetAfter;
|
|
425
409
|
|
|
426
410
|
// reset margins
|
|
427
411
|
slides.forEach(slideEl => {
|
|
@@ -439,6 +423,12 @@ function updateSlides() {
|
|
|
439
423
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');
|
|
440
424
|
setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');
|
|
441
425
|
}
|
|
426
|
+
|
|
427
|
+
// set cssMode offsets
|
|
428
|
+
if (params.cssMode) {
|
|
429
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-before', `${offsetBefore}px`);
|
|
430
|
+
setCSSProperty(wrapperEl, '--swiper-slides-offset-after', `${offsetAfter}px`);
|
|
431
|
+
}
|
|
442
432
|
const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
|
|
443
433
|
if (gridEnabled) {
|
|
444
434
|
swiper.grid.initSlides(slides);
|
|
@@ -453,16 +443,25 @@ function updateSlides() {
|
|
|
453
443
|
}).length > 0;
|
|
454
444
|
for (let i = 0; i < slidesLength; i += 1) {
|
|
455
445
|
slideSize = 0;
|
|
456
|
-
|
|
457
|
-
if (
|
|
458
|
-
|
|
459
|
-
|
|
446
|
+
const slide = slides[i];
|
|
447
|
+
if (slide) {
|
|
448
|
+
if (gridEnabled) {
|
|
449
|
+
swiper.grid.updateSlide(i, slide, slides);
|
|
450
|
+
}
|
|
451
|
+
if (elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
460
452
|
}
|
|
461
|
-
if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line
|
|
462
453
|
|
|
463
|
-
if (params.slidesPerView === 'auto') {
|
|
454
|
+
if (isVirtual && params.slidesPerView === 'auto') {
|
|
455
|
+
if (params.virtual.slidesPerViewAutoSlideSize) {
|
|
456
|
+
slideSize = params.virtual.slidesPerViewAutoSlideSize;
|
|
457
|
+
}
|
|
458
|
+
if (slideSize && slide) {
|
|
459
|
+
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
460
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
461
|
+
}
|
|
462
|
+
} else if (params.slidesPerView === 'auto') {
|
|
464
463
|
if (shouldResetSlideSize) {
|
|
465
|
-
|
|
464
|
+
slide.style[swiper.getDirectionLabel('width')] = ``;
|
|
466
465
|
}
|
|
467
466
|
const slideStyles = getComputedStyle(slide);
|
|
468
467
|
const currentTransform = slide.style.transform;
|
|
@@ -503,12 +502,12 @@ function updateSlides() {
|
|
|
503
502
|
} else {
|
|
504
503
|
slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
|
|
505
504
|
if (params.roundLengths) slideSize = Math.floor(slideSize);
|
|
506
|
-
if (
|
|
507
|
-
|
|
505
|
+
if (slide) {
|
|
506
|
+
slide.style[swiper.getDirectionLabel('width')] = `${slideSize}px`;
|
|
508
507
|
}
|
|
509
508
|
}
|
|
510
|
-
if (
|
|
511
|
-
|
|
509
|
+
if (slide) {
|
|
510
|
+
slide.swiperSlideSize = slideSize;
|
|
512
511
|
}
|
|
513
512
|
slidesSizesGrid.push(slideSize);
|
|
514
513
|
if (params.centeredSlides) {
|
|
@@ -542,17 +541,52 @@ function updateSlides() {
|
|
|
542
541
|
|
|
543
542
|
// Remove last grid elements depending on width
|
|
544
543
|
if (!params.centeredSlides) {
|
|
544
|
+
// Check if snapToSlideEdge should be applied
|
|
545
|
+
const isFractionalSlidesPerView = params.slidesPerView !== 'auto' && params.slidesPerView % 1 !== 0;
|
|
546
|
+
const shouldSnapToSlideEdge = params.snapToSlideEdge && !params.loop && (params.slidesPerView === 'auto' || isFractionalSlidesPerView);
|
|
547
|
+
|
|
548
|
+
// Calculate the last allowed snap index when snapToSlideEdge is enabled
|
|
549
|
+
// This ensures minimum slides are visible at the end
|
|
550
|
+
let lastAllowedSnapIndex = snapGrid.length;
|
|
551
|
+
if (shouldSnapToSlideEdge) {
|
|
552
|
+
let minVisibleSlides;
|
|
553
|
+
if (params.slidesPerView === 'auto') {
|
|
554
|
+
// For 'auto' mode, calculate how many slides fit based on actual sizes
|
|
555
|
+
minVisibleSlides = 1;
|
|
556
|
+
let accumulatedSize = 0;
|
|
557
|
+
for (let i = slidesSizesGrid.length - 1; i >= 0; i -= 1) {
|
|
558
|
+
accumulatedSize += slidesSizesGrid[i] + (i < slidesSizesGrid.length - 1 ? spaceBetween : 0);
|
|
559
|
+
if (accumulatedSize <= swiperSize) {
|
|
560
|
+
minVisibleSlides = slidesSizesGrid.length - i;
|
|
561
|
+
} else {
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
} else {
|
|
566
|
+
minVisibleSlides = Math.floor(params.slidesPerView);
|
|
567
|
+
}
|
|
568
|
+
lastAllowedSnapIndex = Math.max(slidesLength - minVisibleSlides, 0);
|
|
569
|
+
}
|
|
545
570
|
const newSlidesGrid = [];
|
|
546
571
|
for (let i = 0; i < snapGrid.length; i += 1) {
|
|
547
572
|
let slidesGridItem = snapGrid[i];
|
|
548
573
|
if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
|
549
|
-
if (
|
|
574
|
+
if (shouldSnapToSlideEdge) {
|
|
575
|
+
// When snapToSlideEdge is enabled, only keep snaps up to lastAllowedSnapIndex
|
|
576
|
+
if (i <= lastAllowedSnapIndex) {
|
|
577
|
+
newSlidesGrid.push(slidesGridItem);
|
|
578
|
+
}
|
|
579
|
+
} else if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
|
580
|
+
// When snapToSlideEdge is disabled, keep snaps that fit within scrollable area
|
|
550
581
|
newSlidesGrid.push(slidesGridItem);
|
|
551
582
|
}
|
|
552
583
|
}
|
|
553
584
|
snapGrid = newSlidesGrid;
|
|
554
585
|
if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
|
555
|
-
|
|
586
|
+
// Only add edge-aligned snap if snapToSlideEdge is not enabled
|
|
587
|
+
if (!shouldSnapToSlideEdge) {
|
|
588
|
+
snapGrid.push(swiper.virtualSize - swiperSize);
|
|
589
|
+
}
|
|
556
590
|
}
|
|
557
591
|
}
|
|
558
592
|
if (isVirtual && params.loop) {
|
|
@@ -591,7 +625,7 @@ function updateSlides() {
|
|
|
591
625
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
592
626
|
});
|
|
593
627
|
allSlidesSize -= spaceBetween;
|
|
594
|
-
const maxSnap = allSlidesSize - swiperSize;
|
|
628
|
+
const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
|
|
595
629
|
snapGrid = snapGrid.map(snap => {
|
|
596
630
|
if (snap <= 0) return -offsetBefore;
|
|
597
631
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -604,9 +638,8 @@ function updateSlides() {
|
|
|
604
638
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
605
639
|
});
|
|
606
640
|
allSlidesSize -= spaceBetween;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
|
|
641
|
+
if (allSlidesSize < swiperSize) {
|
|
642
|
+
const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
|
610
643
|
snapGrid.forEach((snap, snapIndex) => {
|
|
611
644
|
snapGrid[snapIndex] = snap - allSlidesOffset;
|
|
612
645
|
});
|
|
@@ -717,10 +750,7 @@ const toggleSlideClasses$1 = (slideEl, condition, className) => {
|
|
|
717
750
|
slideEl.classList.remove(className);
|
|
718
751
|
}
|
|
719
752
|
};
|
|
720
|
-
function updateSlidesProgress(translate) {
|
|
721
|
-
if (translate === void 0) {
|
|
722
|
-
translate = this && this.translate || 0;
|
|
723
|
-
}
|
|
753
|
+
function updateSlidesProgress(translate = this && this.translate || 0) {
|
|
724
754
|
const swiper = this;
|
|
725
755
|
const params = swiper.params;
|
|
726
756
|
const {
|
|
@@ -860,9 +890,9 @@ function updateSlidesClasses() {
|
|
|
860
890
|
}
|
|
861
891
|
} else {
|
|
862
892
|
if (gridEnabled) {
|
|
863
|
-
activeSlide = slides.
|
|
864
|
-
nextSlide = slides.
|
|
865
|
-
prevSlide = slides.
|
|
893
|
+
activeSlide = slides.find(slideEl => slideEl.column === activeIndex);
|
|
894
|
+
nextSlide = slides.find(slideEl => slideEl.column === activeIndex + 1);
|
|
895
|
+
prevSlide = slides.find(slideEl => slideEl.column === activeIndex - 1);
|
|
866
896
|
} else {
|
|
867
897
|
activeSlide = slides[activeIndex];
|
|
868
898
|
}
|
|
@@ -904,12 +934,13 @@ const processLazyPreloader = (swiper, imageEl) => {
|
|
|
904
934
|
requestAnimationFrame(() => {
|
|
905
935
|
if (slideEl.shadowRoot) {
|
|
906
936
|
lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
|
|
907
|
-
if (lazyEl) lazyEl.remove();
|
|
937
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
908
938
|
}
|
|
909
939
|
});
|
|
910
940
|
}
|
|
911
941
|
}
|
|
912
|
-
if
|
|
942
|
+
// Skip removal if managed by React/Vue component
|
|
943
|
+
if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
|
|
913
944
|
}
|
|
914
945
|
};
|
|
915
946
|
const unlazy = (swiper, index) => {
|
|
@@ -1024,10 +1055,14 @@ function updateActiveIndex(newActiveIndex) {
|
|
|
1024
1055
|
|
|
1025
1056
|
// Get real index
|
|
1026
1057
|
let realIndex;
|
|
1027
|
-
if (swiper.virtual && params.virtual.enabled
|
|
1028
|
-
|
|
1058
|
+
if (swiper.virtual && params.virtual.enabled) {
|
|
1059
|
+
if (params.loop) {
|
|
1060
|
+
realIndex = getVirtualRealIndex(activeIndex);
|
|
1061
|
+
} else {
|
|
1062
|
+
realIndex = activeIndex;
|
|
1063
|
+
}
|
|
1029
1064
|
} else if (gridEnabled) {
|
|
1030
|
-
const firstSlideInColumn = swiper.slides.
|
|
1065
|
+
const firstSlideInColumn = swiper.slides.find(slideEl => slideEl.column === activeIndex);
|
|
1031
1066
|
let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);
|
|
1032
1067
|
if (Number.isNaN(activeSlideIndex)) {
|
|
1033
1068
|
activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
|
|
@@ -1115,10 +1150,7 @@ var update = {
|
|
|
1115
1150
|
updateClickedSlide
|
|
1116
1151
|
};
|
|
1117
1152
|
|
|
1118
|
-
function getSwiperTranslate(axis) {
|
|
1119
|
-
if (axis === void 0) {
|
|
1120
|
-
axis = this.isHorizontal() ? 'x' : 'y';
|
|
1121
|
-
}
|
|
1153
|
+
function getSwiperTranslate(axis = this.isHorizontal() ? 'x' : 'y') {
|
|
1122
1154
|
const swiper = this;
|
|
1123
1155
|
const {
|
|
1124
1156
|
params,
|
|
@@ -1193,19 +1225,7 @@ function maxTranslate() {
|
|
|
1193
1225
|
return -this.snapGrid[this.snapGrid.length - 1];
|
|
1194
1226
|
}
|
|
1195
1227
|
|
|
1196
|
-
function translateTo(translate, speed, runCallbacks, translateBounds, internal) {
|
|
1197
|
-
if (translate === void 0) {
|
|
1198
|
-
translate = 0;
|
|
1199
|
-
}
|
|
1200
|
-
if (speed === void 0) {
|
|
1201
|
-
speed = this.params.speed;
|
|
1202
|
-
}
|
|
1203
|
-
if (runCallbacks === void 0) {
|
|
1204
|
-
runCallbacks = true;
|
|
1205
|
-
}
|
|
1206
|
-
if (translateBounds === void 0) {
|
|
1207
|
-
translateBounds = true;
|
|
1208
|
-
}
|
|
1228
|
+
function translateTo(translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
|
|
1209
1229
|
const swiper = this;
|
|
1210
1230
|
const {
|
|
1211
1231
|
params,
|
|
@@ -1293,13 +1313,12 @@ function setTransition(duration, byController) {
|
|
|
1293
1313
|
swiper.emit('setTransition', duration, byController);
|
|
1294
1314
|
}
|
|
1295
1315
|
|
|
1296
|
-
function transitionEmit(
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
} = _ref;
|
|
1316
|
+
function transitionEmit({
|
|
1317
|
+
swiper,
|
|
1318
|
+
runCallbacks,
|
|
1319
|
+
direction,
|
|
1320
|
+
step
|
|
1321
|
+
}) {
|
|
1303
1322
|
const {
|
|
1304
1323
|
activeIndex,
|
|
1305
1324
|
previousIndex
|
|
@@ -1309,11 +1328,9 @@ function transitionEmit(_ref) {
|
|
|
1309
1328
|
if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
|
|
1310
1329
|
}
|
|
1311
1330
|
swiper.emit(`transition${step}`);
|
|
1312
|
-
if (runCallbacks &&
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
return;
|
|
1316
|
-
}
|
|
1331
|
+
if (runCallbacks && dir === 'reset') {
|
|
1332
|
+
swiper.emit(`slideResetTransition${step}`);
|
|
1333
|
+
} else if (runCallbacks && activeIndex !== previousIndex) {
|
|
1317
1334
|
swiper.emit(`slideChangeTransition${step}`);
|
|
1318
1335
|
if (dir === 'next') {
|
|
1319
1336
|
swiper.emit(`slideNextTransition${step}`);
|
|
@@ -1323,10 +1340,7 @@ function transitionEmit(_ref) {
|
|
|
1323
1340
|
}
|
|
1324
1341
|
}
|
|
1325
1342
|
|
|
1326
|
-
function transitionStart(runCallbacks, direction) {
|
|
1327
|
-
if (runCallbacks === void 0) {
|
|
1328
|
-
runCallbacks = true;
|
|
1329
|
-
}
|
|
1343
|
+
function transitionStart(runCallbacks = true, direction) {
|
|
1330
1344
|
const swiper = this;
|
|
1331
1345
|
const {
|
|
1332
1346
|
params
|
|
@@ -1343,10 +1357,7 @@ function transitionStart(runCallbacks, direction) {
|
|
|
1343
1357
|
});
|
|
1344
1358
|
}
|
|
1345
1359
|
|
|
1346
|
-
function transitionEnd(runCallbacks, direction) {
|
|
1347
|
-
if (runCallbacks === void 0) {
|
|
1348
|
-
runCallbacks = true;
|
|
1349
|
-
}
|
|
1360
|
+
function transitionEnd(runCallbacks = true, direction) {
|
|
1350
1361
|
const swiper = this;
|
|
1351
1362
|
const {
|
|
1352
1363
|
params
|
|
@@ -1368,13 +1379,7 @@ var transition = {
|
|
|
1368
1379
|
transitionEnd
|
|
1369
1380
|
};
|
|
1370
1381
|
|
|
1371
|
-
function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
1372
|
-
if (index === void 0) {
|
|
1373
|
-
index = 0;
|
|
1374
|
-
}
|
|
1375
|
-
if (runCallbacks === void 0) {
|
|
1376
|
-
runCallbacks = true;
|
|
1377
|
-
}
|
|
1382
|
+
function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
|
|
1378
1383
|
if (typeof index === 'string') {
|
|
1379
1384
|
index = parseInt(index, 10);
|
|
1380
1385
|
}
|
|
@@ -1438,8 +1443,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
1438
1443
|
let direction;
|
|
1439
1444
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
1440
1445
|
|
|
1446
|
+
// initial virtual
|
|
1447
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
1448
|
+
const isInitialVirtual = isVirtual && initial;
|
|
1441
1449
|
// Update Index
|
|
1442
|
-
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
1450
|
+
if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) {
|
|
1443
1451
|
swiper.updateActiveIndex(slideIndex);
|
|
1444
1452
|
// Update Height
|
|
1445
1453
|
if (params.autoHeight) {
|
|
@@ -1459,7 +1467,6 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
1459
1467
|
const isH = swiper.isHorizontal();
|
|
1460
1468
|
const t = rtl ? translate : -translate;
|
|
1461
1469
|
if (speed === 0) {
|
|
1462
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
1463
1470
|
if (isVirtual) {
|
|
1464
1471
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
1465
1472
|
swiper._immediateVirtual = true;
|
|
@@ -1494,6 +1501,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
1494
1501
|
}
|
|
1495
1502
|
return true;
|
|
1496
1503
|
}
|
|
1504
|
+
const browser = getBrowser();
|
|
1505
|
+
const isSafari = browser.isSafari;
|
|
1506
|
+
if (isVirtual && !initial && isSafari && swiper.isElement) {
|
|
1507
|
+
swiper.virtual.update(false, false, slideIndex);
|
|
1508
|
+
}
|
|
1497
1509
|
swiper.setTransition(speed);
|
|
1498
1510
|
swiper.setTranslate(translate);
|
|
1499
1511
|
swiper.updateActiveIndex(slideIndex);
|
|
@@ -1519,13 +1531,7 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
1519
1531
|
return true;
|
|
1520
1532
|
}
|
|
1521
1533
|
|
|
1522
|
-
function slideToLoop(index, speed, runCallbacks, internal) {
|
|
1523
|
-
if (index === void 0) {
|
|
1524
|
-
index = 0;
|
|
1525
|
-
}
|
|
1526
|
-
if (runCallbacks === void 0) {
|
|
1527
|
-
runCallbacks = true;
|
|
1528
|
-
}
|
|
1534
|
+
function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
|
|
1529
1535
|
if (typeof index === 'string') {
|
|
1530
1536
|
const indexAsNumber = parseInt(index, 10);
|
|
1531
1537
|
index = indexAsNumber;
|
|
@@ -1545,32 +1551,35 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
1545
1551
|
let targetSlideIndex;
|
|
1546
1552
|
if (gridEnabled) {
|
|
1547
1553
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
1548
|
-
targetSlideIndex = swiper.slides.
|
|
1554
|
+
targetSlideIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
1549
1555
|
} else {
|
|
1550
1556
|
targetSlideIndex = swiper.getSlideIndexByData(newIndex);
|
|
1551
1557
|
}
|
|
1552
1558
|
const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
|
|
1553
1559
|
const {
|
|
1554
|
-
centeredSlides
|
|
1560
|
+
centeredSlides,
|
|
1561
|
+
slidesOffsetBefore,
|
|
1562
|
+
slidesOffsetAfter
|
|
1555
1563
|
} = swiper.params;
|
|
1564
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
1556
1565
|
let slidesPerView = swiper.params.slidesPerView;
|
|
1557
1566
|
if (slidesPerView === 'auto') {
|
|
1558
1567
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
1559
1568
|
} else {
|
|
1560
1569
|
slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
|
|
1561
|
-
if (
|
|
1570
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
1562
1571
|
slidesPerView = slidesPerView + 1;
|
|
1563
1572
|
}
|
|
1564
1573
|
}
|
|
1565
1574
|
let needLoopFix = cols - targetSlideIndex < slidesPerView;
|
|
1566
|
-
if (
|
|
1575
|
+
if (bothDirections) {
|
|
1567
1576
|
needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
|
|
1568
1577
|
}
|
|
1569
|
-
if (internal &&
|
|
1578
|
+
if (internal && bothDirections && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
|
|
1570
1579
|
needLoopFix = false;
|
|
1571
1580
|
}
|
|
1572
1581
|
if (needLoopFix) {
|
|
1573
|
-
const direction =
|
|
1582
|
+
const direction = bothDirections ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
|
|
1574
1583
|
swiper.loopFix({
|
|
1575
1584
|
direction,
|
|
1576
1585
|
slideTo: true,
|
|
@@ -1580,7 +1589,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
1580
1589
|
}
|
|
1581
1590
|
if (gridEnabled) {
|
|
1582
1591
|
const slideIndex = newIndex * swiper.params.grid.rows;
|
|
1583
|
-
newIndex = swiper.slides.
|
|
1592
|
+
newIndex = swiper.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex).column;
|
|
1584
1593
|
} else {
|
|
1585
1594
|
newIndex = swiper.getSlideIndexByData(newIndex);
|
|
1586
1595
|
}
|
|
@@ -1593,10 +1602,7 @@ function slideToLoop(index, speed, runCallbacks, internal) {
|
|
|
1593
1602
|
}
|
|
1594
1603
|
|
|
1595
1604
|
/* eslint no-unused-vars: "off" */
|
|
1596
|
-
function slideNext(speed, runCallbacks, internal) {
|
|
1597
|
-
if (runCallbacks === void 0) {
|
|
1598
|
-
runCallbacks = true;
|
|
1599
|
-
}
|
|
1605
|
+
function slideNext(speed, runCallbacks = true, internal) {
|
|
1600
1606
|
const swiper = this;
|
|
1601
1607
|
const {
|
|
1602
1608
|
enabled,
|
|
@@ -1634,10 +1640,7 @@ function slideNext(speed, runCallbacks, internal) {
|
|
|
1634
1640
|
}
|
|
1635
1641
|
|
|
1636
1642
|
/* eslint no-unused-vars: "off" */
|
|
1637
|
-
function slidePrev(speed, runCallbacks, internal) {
|
|
1638
|
-
if (runCallbacks === void 0) {
|
|
1639
|
-
runCallbacks = true;
|
|
1640
|
-
}
|
|
1643
|
+
function slidePrev(speed, runCallbacks = true, internal) {
|
|
1641
1644
|
const swiper = this;
|
|
1642
1645
|
const {
|
|
1643
1646
|
params,
|
|
@@ -1667,8 +1670,9 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
1667
1670
|
}
|
|
1668
1671
|
const normalizedTranslate = normalize(translate);
|
|
1669
1672
|
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
|
1673
|
+
const isFreeMode = params.freeMode && params.freeMode.enabled;
|
|
1670
1674
|
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
|
1671
|
-
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
|
1675
|
+
if (typeof prevSnap === 'undefined' && (params.cssMode || isFreeMode)) {
|
|
1672
1676
|
let prevSnapIndex;
|
|
1673
1677
|
snapGrid.forEach((snap, snapIndex) => {
|
|
1674
1678
|
if (normalizedTranslate >= snap) {
|
|
@@ -1677,7 +1681,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
1677
1681
|
}
|
|
1678
1682
|
});
|
|
1679
1683
|
if (typeof prevSnapIndex !== 'undefined') {
|
|
1680
|
-
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
1684
|
+
prevSnap = isFreeMode ? snapGrid[prevSnapIndex] : snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
|
1681
1685
|
}
|
|
1682
1686
|
}
|
|
1683
1687
|
let prevIndex = 0;
|
|
@@ -1702,10 +1706,7 @@ function slidePrev(speed, runCallbacks, internal) {
|
|
|
1702
1706
|
}
|
|
1703
1707
|
|
|
1704
1708
|
/* eslint no-unused-vars: "off" */
|
|
1705
|
-
function slideReset(speed, runCallbacks, internal) {
|
|
1706
|
-
if (runCallbacks === void 0) {
|
|
1707
|
-
runCallbacks = true;
|
|
1708
|
-
}
|
|
1709
|
+
function slideReset(speed, runCallbacks = true, internal) {
|
|
1709
1710
|
const swiper = this;
|
|
1710
1711
|
if (swiper.destroyed) return;
|
|
1711
1712
|
if (typeof speed === 'undefined') {
|
|
@@ -1715,13 +1716,7 @@ function slideReset(speed, runCallbacks, internal) {
|
|
|
1715
1716
|
}
|
|
1716
1717
|
|
|
1717
1718
|
/* eslint no-unused-vars: "off" */
|
|
1718
|
-
function slideToClosest(speed, runCallbacks, internal, threshold) {
|
|
1719
|
-
if (runCallbacks === void 0) {
|
|
1720
|
-
runCallbacks = true;
|
|
1721
|
-
}
|
|
1722
|
-
if (threshold === void 0) {
|
|
1723
|
-
threshold = 0.5;
|
|
1724
|
-
}
|
|
1719
|
+
function slideToClosest(speed, runCallbacks = true, internal, threshold = 0.5) {
|
|
1725
1720
|
const swiper = this;
|
|
1726
1721
|
if (swiper.destroyed) return;
|
|
1727
1722
|
if (typeof speed === 'undefined') {
|
|
@@ -1761,23 +1756,16 @@ function slideToClickedSlide() {
|
|
|
1761
1756
|
slidesEl
|
|
1762
1757
|
} = swiper;
|
|
1763
1758
|
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
|
1764
|
-
let slideToIndex = swiper.clickedIndex;
|
|
1759
|
+
let slideToIndex = swiper.getSlideIndexWhenGrid(swiper.clickedIndex);
|
|
1765
1760
|
let realIndex;
|
|
1766
1761
|
const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
|
|
1762
|
+
const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
|
|
1767
1763
|
if (params.loop) {
|
|
1768
1764
|
if (swiper.animating) return;
|
|
1769
1765
|
realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);
|
|
1770
1766
|
if (params.centeredSlides) {
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
1774
|
-
nextTick(() => {
|
|
1775
|
-
swiper.slideTo(slideToIndex);
|
|
1776
|
-
});
|
|
1777
|
-
} else {
|
|
1778
|
-
swiper.slideTo(slideToIndex);
|
|
1779
|
-
}
|
|
1780
|
-
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
|
1767
|
+
swiper.slideToLoop(realIndex);
|
|
1768
|
+
} else if (slideToIndex > (isGrid ? (swiper.slides.length - slidesPerView) / 2 - (swiper.params.grid.rows - 1) : swiper.slides.length - slidesPerView)) {
|
|
1781
1769
|
swiper.loopFix();
|
|
1782
1770
|
slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
|
|
1783
1771
|
nextTick(() => {
|
|
@@ -1801,7 +1789,7 @@ var slide = {
|
|
|
1801
1789
|
slideToClickedSlide
|
|
1802
1790
|
};
|
|
1803
1791
|
|
|
1804
|
-
function loopCreate(slideRealIndex) {
|
|
1792
|
+
function loopCreate(slideRealIndex, initial) {
|
|
1805
1793
|
const swiper = this;
|
|
1806
1794
|
const {
|
|
1807
1795
|
params,
|
|
@@ -1814,7 +1802,20 @@ function loopCreate(slideRealIndex) {
|
|
|
1814
1802
|
el.setAttribute('data-swiper-slide-index', index);
|
|
1815
1803
|
});
|
|
1816
1804
|
};
|
|
1805
|
+
const clearBlankSlides = () => {
|
|
1806
|
+
const slides = elementChildren(slidesEl, `.${params.slideBlankClass}`);
|
|
1807
|
+
slides.forEach(el => {
|
|
1808
|
+
el.remove();
|
|
1809
|
+
});
|
|
1810
|
+
if (slides.length > 0) {
|
|
1811
|
+
swiper.recalcSlides();
|
|
1812
|
+
swiper.updateSlides();
|
|
1813
|
+
}
|
|
1814
|
+
};
|
|
1817
1815
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
1816
|
+
if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
|
|
1817
|
+
clearBlankSlides();
|
|
1818
|
+
}
|
|
1818
1819
|
const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
|
|
1819
1820
|
const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
|
|
1820
1821
|
const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
|
|
@@ -1847,22 +1848,24 @@ function loopCreate(slideRealIndex) {
|
|
|
1847
1848
|
} else {
|
|
1848
1849
|
initSlides();
|
|
1849
1850
|
}
|
|
1851
|
+
const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
|
|
1850
1852
|
swiper.loopFix({
|
|
1851
1853
|
slideRealIndex,
|
|
1852
|
-
direction:
|
|
1854
|
+
direction: bothDirections ? undefined : 'next',
|
|
1855
|
+
initial
|
|
1853
1856
|
});
|
|
1854
1857
|
}
|
|
1855
1858
|
|
|
1856
|
-
function loopFix(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1859
|
+
function loopFix({
|
|
1860
|
+
slideRealIndex,
|
|
1861
|
+
slideTo = true,
|
|
1862
|
+
direction,
|
|
1863
|
+
setTranslate,
|
|
1864
|
+
activeSlideIndex,
|
|
1865
|
+
initial,
|
|
1866
|
+
byController,
|
|
1867
|
+
byMousewheel
|
|
1868
|
+
} = {}) {
|
|
1866
1869
|
const swiper = this;
|
|
1867
1870
|
if (!swiper.params.loop) return;
|
|
1868
1871
|
swiper.emit('beforeLoopFix');
|
|
@@ -1874,15 +1877,19 @@ function loopFix(_temp) {
|
|
|
1874
1877
|
params
|
|
1875
1878
|
} = swiper;
|
|
1876
1879
|
const {
|
|
1877
|
-
centeredSlides
|
|
1880
|
+
centeredSlides,
|
|
1881
|
+
slidesOffsetBefore,
|
|
1882
|
+
slidesOffsetAfter,
|
|
1883
|
+
initialSlide
|
|
1878
1884
|
} = params;
|
|
1885
|
+
const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
|
|
1879
1886
|
swiper.allowSlidePrev = true;
|
|
1880
1887
|
swiper.allowSlideNext = true;
|
|
1881
1888
|
if (swiper.virtual && params.virtual.enabled) {
|
|
1882
1889
|
if (slideTo) {
|
|
1883
|
-
if (!
|
|
1890
|
+
if (!bothDirections && swiper.snapIndex === 0) {
|
|
1884
1891
|
swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
|
|
1885
|
-
} else if (
|
|
1892
|
+
} else if (bothDirections && swiper.snapIndex < params.slidesPerView) {
|
|
1886
1893
|
swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
|
|
1887
1894
|
} else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
|
|
1888
1895
|
swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
|
|
@@ -1898,28 +1905,30 @@ function loopFix(_temp) {
|
|
|
1898
1905
|
slidesPerView = swiper.slidesPerViewDynamic();
|
|
1899
1906
|
} else {
|
|
1900
1907
|
slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
|
|
1901
|
-
if (
|
|
1908
|
+
if (bothDirections && slidesPerView % 2 === 0) {
|
|
1902
1909
|
slidesPerView = slidesPerView + 1;
|
|
1903
1910
|
}
|
|
1904
1911
|
}
|
|
1905
1912
|
const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
|
|
1906
|
-
let loopedSlides = slidesPerGroup;
|
|
1913
|
+
let loopedSlides = bothDirections ? Math.max(slidesPerGroup, Math.ceil(slidesPerView / 2)) : slidesPerGroup;
|
|
1907
1914
|
if (loopedSlides % slidesPerGroup !== 0) {
|
|
1908
1915
|
loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
|
|
1909
1916
|
}
|
|
1910
1917
|
loopedSlides += params.loopAdditionalSlides;
|
|
1911
1918
|
swiper.loopedSlides = loopedSlides;
|
|
1912
1919
|
const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
|
|
1913
|
-
if (slides.length < slidesPerView + loopedSlides) {
|
|
1914
|
-
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled
|
|
1920
|
+
if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
1921
|
+
showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
|
|
1915
1922
|
} else if (gridEnabled && params.grid.fill === 'row') {
|
|
1916
1923
|
showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
|
|
1917
1924
|
}
|
|
1918
1925
|
const prependSlidesIndexes = [];
|
|
1919
1926
|
const appendSlidesIndexes = [];
|
|
1920
|
-
|
|
1927
|
+
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
1928
|
+
const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
|
|
1929
|
+
let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
|
|
1921
1930
|
if (typeof activeSlideIndex === 'undefined') {
|
|
1922
|
-
activeSlideIndex = swiper.getSlideIndex(slides.
|
|
1931
|
+
activeSlideIndex = swiper.getSlideIndex(slides.find(el => el.classList.contains(params.slideActiveClass)));
|
|
1923
1932
|
} else {
|
|
1924
1933
|
activeIndex = activeSlideIndex;
|
|
1925
1934
|
}
|
|
@@ -1927,9 +1936,8 @@ function loopFix(_temp) {
|
|
|
1927
1936
|
const isPrev = direction === 'prev' || !direction;
|
|
1928
1937
|
let slidesPrepended = 0;
|
|
1929
1938
|
let slidesAppended = 0;
|
|
1930
|
-
const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
|
|
1931
1939
|
const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
|
|
1932
|
-
const activeColIndexWithShift = activeColIndex + (
|
|
1940
|
+
const activeColIndexWithShift = activeColIndex + (bothDirections && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
|
|
1933
1941
|
// prepend last slides before start
|
|
1934
1942
|
if (activeColIndexWithShift < loopedSlides) {
|
|
1935
1943
|
slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
|
|
@@ -1949,6 +1957,9 @@ function loopFix(_temp) {
|
|
|
1949
1957
|
}
|
|
1950
1958
|
} else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
|
|
1951
1959
|
slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
|
|
1960
|
+
if (isInitialOverflow) {
|
|
1961
|
+
slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
|
|
1962
|
+
}
|
|
1952
1963
|
for (let i = 0; i < slidesAppended; i += 1) {
|
|
1953
1964
|
const index = i - Math.floor(i / cols) * cols;
|
|
1954
1965
|
if (gridEnabled) {
|
|
@@ -1964,6 +1975,14 @@ function loopFix(_temp) {
|
|
|
1964
1975
|
requestAnimationFrame(() => {
|
|
1965
1976
|
swiper.__preventObserver__ = false;
|
|
1966
1977
|
});
|
|
1978
|
+
if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
|
|
1979
|
+
if (appendSlidesIndexes.includes(activeSlideIndex)) {
|
|
1980
|
+
appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
1981
|
+
}
|
|
1982
|
+
if (prependSlidesIndexes.includes(activeSlideIndex)) {
|
|
1983
|
+
prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1967
1986
|
if (isPrev) {
|
|
1968
1987
|
prependSlidesIndexes.forEach(index => {
|
|
1969
1988
|
slides[index].swiperLoopMoveDOM = true;
|
|
@@ -2064,7 +2083,7 @@ function loopDestroy() {
|
|
|
2064
2083
|
params,
|
|
2065
2084
|
slidesEl
|
|
2066
2085
|
} = swiper;
|
|
2067
|
-
if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
2086
|
+
if (!params.loop || !slidesEl || swiper.virtual && swiper.params.virtual.enabled) return;
|
|
2068
2087
|
swiper.recalcSlides();
|
|
2069
2088
|
const newSlidesOrder = [];
|
|
2070
2089
|
swiper.slides.forEach(slideEl => {
|
|
@@ -2125,10 +2144,7 @@ var grabCursor = {
|
|
|
2125
2144
|
};
|
|
2126
2145
|
|
|
2127
2146
|
// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
|
2128
|
-
function closestElement(selector, base) {
|
|
2129
|
-
if (base === void 0) {
|
|
2130
|
-
base = this;
|
|
2131
|
-
}
|
|
2147
|
+
function closestElement(selector, base = this) {
|
|
2132
2148
|
function __closestFrom(el) {
|
|
2133
2149
|
if (!el || el === getDocument() || el === getWindow()) return null;
|
|
2134
2150
|
if (el.assignedSlot) el = el.assignedSlot;
|
|
@@ -2158,6 +2174,7 @@ function preventEdgeSwipe(swiper, event, startX) {
|
|
|
2158
2174
|
}
|
|
2159
2175
|
function onTouchStart(event) {
|
|
2160
2176
|
const swiper = this;
|
|
2177
|
+
if (swiper.destroyed) return;
|
|
2161
2178
|
const document = getDocument();
|
|
2162
2179
|
let e = event;
|
|
2163
2180
|
if (e.originalEvent) e = e.originalEvent;
|
|
@@ -2245,7 +2262,7 @@ function onTouchStart(event) {
|
|
|
2245
2262
|
data.isTouched = false;
|
|
2246
2263
|
}
|
|
2247
2264
|
}
|
|
2248
|
-
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {
|
|
2265
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl && (e.pointerType === 'mouse' || e.pointerType !== 'mouse' && !targetEl.matches(data.focusableElements))) {
|
|
2249
2266
|
document.activeElement.blur();
|
|
2250
2267
|
}
|
|
2251
2268
|
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
|
@@ -2261,6 +2278,7 @@ function onTouchStart(event) {
|
|
|
2261
2278
|
function onTouchMove(event) {
|
|
2262
2279
|
const document = getDocument();
|
|
2263
2280
|
const swiper = this;
|
|
2281
|
+
if (swiper.destroyed) return;
|
|
2264
2282
|
const data = swiper.touchEventsData;
|
|
2265
2283
|
const {
|
|
2266
2284
|
params,
|
|
@@ -2279,7 +2297,7 @@ function onTouchMove(event) {
|
|
|
2279
2297
|
}
|
|
2280
2298
|
let targetTouch;
|
|
2281
2299
|
if (e.type === 'touchmove') {
|
|
2282
|
-
targetTouch = [...e.changedTouches].
|
|
2300
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
2283
2301
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
2284
2302
|
} else {
|
|
2285
2303
|
targetTouch = e;
|
|
@@ -2320,10 +2338,15 @@ function onTouchMove(event) {
|
|
|
2320
2338
|
data.isMoved = false;
|
|
2321
2339
|
return;
|
|
2322
2340
|
}
|
|
2323
|
-
} else if (pageX
|
|
2341
|
+
} else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
|
|
2342
|
+
return;
|
|
2343
|
+
} else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
|
|
2324
2344
|
return;
|
|
2325
2345
|
}
|
|
2326
2346
|
}
|
|
2347
|
+
if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== e.target && e.pointerType !== 'mouse') {
|
|
2348
|
+
document.activeElement.blur();
|
|
2349
|
+
}
|
|
2327
2350
|
if (document.activeElement) {
|
|
2328
2351
|
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
|
|
2329
2352
|
data.isMoved = true;
|
|
@@ -2419,7 +2442,7 @@ function onTouchMove(event) {
|
|
|
2419
2442
|
}
|
|
2420
2443
|
let loopFixed;
|
|
2421
2444
|
new Date().getTime();
|
|
2422
|
-
if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
2445
|
+
if (params._loopSwapReset !== false && data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
|
|
2423
2446
|
Object.assign(touches, {
|
|
2424
2447
|
startX: pageX,
|
|
2425
2448
|
startY: pageY,
|
|
@@ -2517,6 +2540,7 @@ function onTouchMove(event) {
|
|
|
2517
2540
|
|
|
2518
2541
|
function onTouchEnd(event) {
|
|
2519
2542
|
const swiper = this;
|
|
2543
|
+
if (swiper.destroyed) return;
|
|
2520
2544
|
const data = swiper.touchEventsData;
|
|
2521
2545
|
let e = event;
|
|
2522
2546
|
if (e.originalEvent) e = e.originalEvent;
|
|
@@ -2527,7 +2551,7 @@ function onTouchEnd(event) {
|
|
|
2527
2551
|
if (e.pointerId !== data.pointerId) return;
|
|
2528
2552
|
targetTouch = e;
|
|
2529
2553
|
} else {
|
|
2530
|
-
targetTouch = [...e.changedTouches].
|
|
2554
|
+
targetTouch = [...e.changedTouches].find(t => t.identifier === data.touchId);
|
|
2531
2555
|
if (!targetTouch || targetTouch.identifier !== data.touchId) return;
|
|
2532
2556
|
}
|
|
2533
2557
|
if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {
|
|
@@ -2704,7 +2728,8 @@ function onResize() {
|
|
|
2704
2728
|
swiper.updateSlidesClasses();
|
|
2705
2729
|
const isVirtualLoop = isVirtual && params.loop;
|
|
2706
2730
|
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
|
|
2707
|
-
swiper.
|
|
2731
|
+
const slides = isVirtual ? swiper.virtual.slides : swiper.slides;
|
|
2732
|
+
swiper.slideTo(slides.length - 1, 0, false, true);
|
|
2708
2733
|
} else {
|
|
2709
2734
|
if (swiper.params.loop && !isVirtual) {
|
|
2710
2735
|
swiper.slideToLoop(swiper.realIndex, 0, false, true);
|
|
@@ -2730,6 +2755,7 @@ function onResize() {
|
|
|
2730
2755
|
|
|
2731
2756
|
function onClick(e) {
|
|
2732
2757
|
const swiper = this;
|
|
2758
|
+
if (swiper.destroyed) return;
|
|
2733
2759
|
if (!swiper.enabled) return;
|
|
2734
2760
|
if (!swiper.allowClick) {
|
|
2735
2761
|
if (swiper.params.preventClicks) e.preventDefault();
|
|
@@ -2742,6 +2768,7 @@ function onClick(e) {
|
|
|
2742
2768
|
|
|
2743
2769
|
function onScroll() {
|
|
2744
2770
|
const swiper = this;
|
|
2771
|
+
if (swiper.destroyed) return;
|
|
2745
2772
|
const {
|
|
2746
2773
|
wrapperEl,
|
|
2747
2774
|
rtlTranslate,
|
|
@@ -2773,6 +2800,7 @@ function onScroll() {
|
|
|
2773
2800
|
|
|
2774
2801
|
function onLoad(e) {
|
|
2775
2802
|
const swiper = this;
|
|
2803
|
+
if (swiper.destroyed) return;
|
|
2776
2804
|
processLazyPreloader(swiper, e.target);
|
|
2777
2805
|
if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {
|
|
2778
2806
|
return;
|
|
@@ -2782,6 +2810,7 @@ function onLoad(e) {
|
|
|
2782
2810
|
|
|
2783
2811
|
function onDocumentTouchStart() {
|
|
2784
2812
|
const swiper = this;
|
|
2813
|
+
if (swiper.destroyed) return;
|
|
2785
2814
|
if (swiper.documentTouchHandlerProceeded) return;
|
|
2786
2815
|
swiper.documentTouchHandlerProceeded = true;
|
|
2787
2816
|
if (swiper.params.touchReleaseOnEdges) {
|
|
@@ -2901,9 +2930,12 @@ function setBreakpoint() {
|
|
|
2901
2930
|
} = swiper;
|
|
2902
2931
|
const breakpoints = params.breakpoints;
|
|
2903
2932
|
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;
|
|
2933
|
+
const document = getDocument();
|
|
2904
2934
|
|
|
2905
|
-
// Get breakpoint for window width and update parameters
|
|
2906
|
-
const
|
|
2935
|
+
// Get breakpoint for window/container width and update parameters
|
|
2936
|
+
const breakpointsBase = params.breakpointsBase === 'window' || !params.breakpointsBase ? params.breakpointsBase : 'container';
|
|
2937
|
+
const breakpointContainer = ['window', 'container'].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document.querySelector(params.breakpointsBase);
|
|
2938
|
+
const breakpoint = swiper.getBreakpoint(breakpoints, breakpointsBase, breakpointContainer);
|
|
2907
2939
|
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
|
2908
2940
|
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
|
2909
2941
|
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
|
@@ -2976,10 +3008,7 @@ function setBreakpoint() {
|
|
|
2976
3008
|
swiper.emit('breakpoint', breakpointParams);
|
|
2977
3009
|
}
|
|
2978
3010
|
|
|
2979
|
-
function getBreakpoint(breakpoints, base, containerEl) {
|
|
2980
|
-
if (base === void 0) {
|
|
2981
|
-
base = 'window';
|
|
2982
|
-
}
|
|
3011
|
+
function getBreakpoint(breakpoints, base = 'window', containerEl) {
|
|
2983
3012
|
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
|
2984
3013
|
let breakpoint = false;
|
|
2985
3014
|
const window = getWindow();
|
|
@@ -3174,6 +3203,7 @@ var defaults = {
|
|
|
3174
3203
|
// in px
|
|
3175
3204
|
normalizeSlideIndex: true,
|
|
3176
3205
|
centerInsufficientSlides: false,
|
|
3206
|
+
snapToSlideEdge: false,
|
|
3177
3207
|
// Disable swiper and hide navigation when container not overflow
|
|
3178
3208
|
watchOverflow: true,
|
|
3179
3209
|
// Round length
|
|
@@ -3244,10 +3274,7 @@ var defaults = {
|
|
|
3244
3274
|
};
|
|
3245
3275
|
|
|
3246
3276
|
function moduleExtendParams(params, allModulesParams) {
|
|
3247
|
-
return function extendParams(obj) {
|
|
3248
|
-
if (obj === void 0) {
|
|
3249
|
-
obj = {};
|
|
3250
|
-
}
|
|
3277
|
+
return function extendParams(obj = {}) {
|
|
3251
3278
|
const moduleParamName = Object.keys(obj)[0];
|
|
3252
3279
|
const moduleParams = obj[moduleParamName];
|
|
3253
3280
|
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
|
@@ -3295,12 +3322,9 @@ const prototypes = {
|
|
|
3295
3322
|
};
|
|
3296
3323
|
const extendedDefaults = {};
|
|
3297
3324
|
class Swiper {
|
|
3298
|
-
constructor() {
|
|
3325
|
+
constructor(...args) {
|
|
3299
3326
|
let el;
|
|
3300
3327
|
let params;
|
|
3301
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3302
|
-
args[_key] = arguments[_key];
|
|
3303
|
-
}
|
|
3304
3328
|
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
|
3305
3329
|
params = args[0];
|
|
3306
3330
|
} else {
|
|
@@ -3334,7 +3358,11 @@ class Swiper {
|
|
|
3334
3358
|
swiper.eventsAnyListeners = [];
|
|
3335
3359
|
swiper.modules = [...swiper.__modules__];
|
|
3336
3360
|
if (params.modules && Array.isArray(params.modules)) {
|
|
3337
|
-
|
|
3361
|
+
params.modules.forEach(mod => {
|
|
3362
|
+
if (typeof mod === 'function' && swiper.modules.indexOf(mod) < 0) {
|
|
3363
|
+
swiper.modules.push(mod);
|
|
3364
|
+
}
|
|
3365
|
+
});
|
|
3338
3366
|
}
|
|
3339
3367
|
const allModulesParams = {};
|
|
3340
3368
|
swiper.modules.forEach(mod => {
|
|
@@ -3479,7 +3507,17 @@ class Swiper {
|
|
|
3479
3507
|
return elementIndex(slideEl) - firstSlideIndex;
|
|
3480
3508
|
}
|
|
3481
3509
|
getSlideIndexByData(index) {
|
|
3482
|
-
return this.getSlideIndex(this.slides.
|
|
3510
|
+
return this.getSlideIndex(this.slides.find(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index));
|
|
3511
|
+
}
|
|
3512
|
+
getSlideIndexWhenGrid(index) {
|
|
3513
|
+
if (this.grid && this.params.grid && this.params.grid.rows > 1) {
|
|
3514
|
+
if (this.params.grid.fill === 'column') {
|
|
3515
|
+
index = Math.floor(index / this.params.grid.rows);
|
|
3516
|
+
} else if (this.params.grid.fill === 'row') {
|
|
3517
|
+
index = index % Math.ceil(this.slides.length / this.params.grid.rows);
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
return index;
|
|
3483
3521
|
}
|
|
3484
3522
|
recalcSlides() {
|
|
3485
3523
|
const swiper = this;
|
|
@@ -3546,13 +3584,7 @@ class Swiper {
|
|
|
3546
3584
|
});
|
|
3547
3585
|
swiper.emit('_slideClasses', updates);
|
|
3548
3586
|
}
|
|
3549
|
-
slidesPerViewDynamic(view, exact) {
|
|
3550
|
-
if (view === void 0) {
|
|
3551
|
-
view = 'current';
|
|
3552
|
-
}
|
|
3553
|
-
if (exact === void 0) {
|
|
3554
|
-
exact = false;
|
|
3555
|
-
}
|
|
3587
|
+
slidesPerViewDynamic(view = 'current', exact = false) {
|
|
3556
3588
|
const swiper = this;
|
|
3557
3589
|
const {
|
|
3558
3590
|
params,
|
|
@@ -3651,10 +3683,7 @@ class Swiper {
|
|
|
3651
3683
|
}
|
|
3652
3684
|
swiper.emit('update');
|
|
3653
3685
|
}
|
|
3654
|
-
changeDirection(newDirection, needUpdate) {
|
|
3655
|
-
if (needUpdate === void 0) {
|
|
3656
|
-
needUpdate = true;
|
|
3657
|
-
}
|
|
3686
|
+
changeDirection(newDirection, needUpdate = true) {
|
|
3658
3687
|
const swiper = this;
|
|
3659
3688
|
const currentDirection = swiper.params.direction;
|
|
3660
3689
|
if (!newDirection) {
|
|
@@ -3780,7 +3809,7 @@ class Swiper {
|
|
|
3780
3809
|
|
|
3781
3810
|
// Create loop
|
|
3782
3811
|
if (swiper.params.loop) {
|
|
3783
|
-
swiper.loopCreate();
|
|
3812
|
+
swiper.loopCreate(undefined, true);
|
|
3784
3813
|
}
|
|
3785
3814
|
|
|
3786
3815
|
// Attach events
|
|
@@ -3809,13 +3838,7 @@ class Swiper {
|
|
|
3809
3838
|
swiper.emit('afterInit');
|
|
3810
3839
|
return swiper;
|
|
3811
3840
|
}
|
|
3812
|
-
destroy(deleteInstance, cleanStyles) {
|
|
3813
|
-
if (deleteInstance === void 0) {
|
|
3814
|
-
deleteInstance = true;
|
|
3815
|
-
}
|
|
3816
|
-
if (cleanStyles === void 0) {
|
|
3817
|
-
cleanStyles = true;
|
|
3818
|
-
}
|
|
3841
|
+
destroy(deleteInstance = true, cleanStyles = true) {
|
|
3819
3842
|
const swiper = this;
|
|
3820
3843
|
const {
|
|
3821
3844
|
params,
|
|
@@ -3903,6 +3926,16 @@ Object.keys(prototypes).forEach(prototypeGroup => {
|
|
|
3903
3926
|
});
|
|
3904
3927
|
Swiper.use([Resize, Observer]);
|
|
3905
3928
|
|
|
3906
|
-
|
|
3929
|
+
/**
|
|
3930
|
+
* Swiper 12.2.0
|
|
3931
|
+
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
3932
|
+
* https://swiperjs.com
|
|
3933
|
+
*
|
|
3934
|
+
* Copyright 2014-2026 Vladimir Kharlampidi
|
|
3935
|
+
*
|
|
3936
|
+
* Released under the MIT License
|
|
3937
|
+
*
|
|
3938
|
+
* Released on: May 27, 2026
|
|
3939
|
+
*/
|
|
3907
3940
|
|
|
3908
|
-
|
|
3941
|
+
export { Swiper, Swiper as default };
|