@qw-ui/core 0.3.0-next.4 → 0.3.0-next.42
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/README.md +21 -37
- package/dist/action-sheet/action-sheet.d.ts +110 -0
- package/dist/action-sheet/index.d.ts +2 -0
- package/dist/action-sheet/index.js +2 -0
- package/dist/action-sheet-Cvcr1S_m.js +183 -0
- package/dist/action-sheet-Cvcr1S_m.js.map +1 -0
- package/dist/area-picker/area-picker.d.ts +113 -0
- package/dist/area-picker/index.d.ts +1 -0
- package/dist/area-picker/index.js +348 -0
- package/dist/area-picker/index.js.map +1 -0
- package/dist/aria-description-CimD2M_C.js +13 -0
- package/dist/aria-description-CimD2M_C.js.map +1 -0
- package/dist/aria-description.d.ts +2 -0
- package/dist/avatar/avatar-load.d.ts +76 -0
- package/dist/avatar/avatar.d.ts +22 -5
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +57 -18
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar-load-w9dq05oV.js +139 -0
- package/dist/avatar-load-w9dq05oV.js.map +1 -0
- package/dist/back-top/back-top.d.ts +77 -0
- package/dist/back-top/index.d.ts +1 -0
- package/dist/back-top/index.js +189 -0
- package/dist/back-top/index.js.map +1 -0
- package/dist/badge/badge.d.ts +85 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +88 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/button/button.d.ts +13 -0
- package/dist/button/index.js +3 -5
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/calendar.d.ts +100 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar-CmpK3stz.js +363 -0
- package/dist/calendar-CmpK3stz.js.map +1 -0
- package/dist/card/card.d.ts +68 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +2 -0
- package/dist/card-DRtWa6Cr.js +107 -0
- package/dist/card-DRtWa6Cr.js.map +1 -0
- package/dist/cascader/cascader.d.ts +115 -0
- package/dist/cascader/index.d.ts +1 -0
- package/dist/cascader/index.js +2 -0
- package/dist/cascader-D-xMjs7P.js +333 -0
- package/dist/cascader-D-xMjs7P.js.map +1 -0
- package/dist/cell/cell.d.ts +41 -0
- package/dist/cell/index.d.ts +1 -0
- package/dist/cell/index.js +43 -0
- package/dist/cell/index.js.map +1 -0
- package/dist/check-list/check-list.d.ts +78 -0
- package/dist/check-list/index.d.ts +2 -0
- package/dist/check-list/index.js +2 -0
- package/dist/check-list-BvZHQt5w.js +60 -0
- package/dist/check-list-BvZHQt5w.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +59 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-BlndJrz5.js +127 -0
- package/dist/checkbox-BlndJrz5.js.map +1 -0
- package/dist/checkbox-group/checkbox-group.d.ts +86 -0
- package/dist/checkbox-group/index.d.ts +3 -0
- package/dist/checkbox-group/index.js +2 -0
- package/dist/checkbox-group-gGfsTv-e.js +223 -0
- package/dist/checkbox-group-gGfsTv-e.js.map +1 -0
- package/dist/choice-group-C4c9m0qe.js +373 -0
- package/dist/choice-group-C4c9m0qe.js.map +1 -0
- package/dist/circle/circle.d.ts +97 -0
- package/dist/circle/index.d.ts +1 -0
- package/dist/circle/index.js +119 -0
- package/dist/circle/index.js.map +1 -0
- package/dist/collapse/collapse.d.ts +98 -0
- package/dist/collapse/index.d.ts +2 -0
- package/dist/collapse/index.js +2 -0
- package/dist/collapse-B969h7-H.js +226 -0
- package/dist/collapse-B969h7-H.js.map +1 -0
- package/dist/countdown/countdown.d.ts +114 -0
- package/dist/countdown/index.d.ts +1 -0
- package/dist/countdown/index.js +309 -0
- package/dist/countdown/index.js.map +1 -0
- package/dist/date-picker/date-picker.d.ts +168 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +401 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/descriptions/descriptions.d.ts +69 -0
- package/dist/descriptions/index.d.ts +1 -0
- package/dist/descriptions/index.js +86 -0
- package/dist/descriptions/index.js.map +1 -0
- package/dist/dialog/dialog.d.ts +61 -43
- package/dist/dialog/index.js +73 -19
- package/dist/dialog/index.js.map +1 -1
- package/dist/divider/divider.d.ts +18 -2
- package/dist/divider/index.js +20 -2
- package/dist/divider/index.js.map +1 -1
- package/dist/dropdown/dropdown.d.ts +172 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +467 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/ellipsis/ellipsis-layout.d.ts +34 -0
- package/dist/ellipsis/ellipsis.d.ts +88 -0
- package/dist/ellipsis/index.d.ts +2 -0
- package/dist/ellipsis/index.js +320 -0
- package/dist/ellipsis/index.js.map +1 -0
- package/dist/empty/empty-illustration.d.ts +3 -0
- package/dist/empty/empty.d.ts +43 -1
- package/dist/empty/index.js +2 -21
- package/dist/empty-CAgyvhUI.js +166 -0
- package/dist/empty-CAgyvhUI.js.map +1 -0
- package/dist/field/field.d.ts +95 -0
- package/dist/field/index.d.ts +2 -0
- package/dist/field/index.js +2 -0
- package/dist/field-DMHGIMZF.js +241 -0
- package/dist/field-DMHGIMZF.js.map +1 -0
- package/dist/floating-bubble/floating-bubble.d.ts +116 -0
- package/dist/floating-bubble/index.d.ts +1 -0
- package/dist/floating-bubble/index.js +333 -0
- package/dist/floating-bubble/index.js.map +1 -0
- package/dist/floating-panel/floating-panel.d.ts +80 -0
- package/dist/floating-panel/index.d.ts +2 -0
- package/dist/floating-panel/index.js +2 -0
- package/dist/floating-panel-Cbm5njBJ.js +363 -0
- package/dist/floating-panel-Cbm5njBJ.js.map +1 -0
- package/dist/footer/footer.d.ts +94 -0
- package/dist/footer/index.d.ts +1 -0
- package/dist/footer/index.js +154 -0
- package/dist/footer/index.js.map +1 -0
- package/dist/form/connect.d.ts +6 -0
- package/dist/form/form.d.ts +100 -0
- package/dist/form/ids.d.ts +14 -0
- package/dist/form/index.d.ts +13 -0
- package/dist/form/index.js +3 -0
- package/dist/form/methods.d.ts +5 -0
- package/dist/form/model.d.ts +24 -0
- package/dist/form/native.d.ts +25 -0
- package/dist/form/rules.d.ts +40 -0
- package/dist/form/ssr.d.ts +7 -0
- package/dist/form/types.d.ts +150 -0
- package/dist/form-BAGkIEMY.js +1354 -0
- package/dist/form-BAGkIEMY.js.map +1 -0
- package/dist/format-BDUY0C_c.js +89 -0
- package/dist/format-BDUY0C_c.js.map +1 -0
- package/dist/gesture-_SRHIvBm.js +30 -0
- package/dist/gesture-_SRHIvBm.js.map +1 -0
- package/dist/grid/grid-item.d.ts +22 -0
- package/dist/grid/grid.d.ts +42 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +73 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/icon/icon.d.ts +37 -1
- package/dist/icon/identity.d.ts +3 -0
- package/dist/icon/index.js +2 -20
- package/dist/icon-Cgdbnk1u.js +77 -0
- package/dist/icon-Cgdbnk1u.js.map +1 -0
- package/dist/image/image-load.d.ts +24 -0
- package/dist/image/image.d.ts +45 -8
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +116 -14
- package/dist/image/index.js.map +1 -1
- package/dist/image-preview/image-preview.d.ts +124 -0
- package/dist/image-preview/index.d.ts +1 -0
- package/dist/image-preview/index.js +450 -0
- package/dist/image-preview/index.js.map +1 -0
- package/dist/index-bar/index-bar.d.ts +121 -0
- package/dist/index-bar/index.d.ts +1 -0
- package/dist/index-bar/index.js +386 -0
- package/dist/index-bar/index.js.map +1 -0
- package/dist/index.d.ts +115 -10
- package/dist/index.js +151 -11
- package/dist/index.js.map +1 -0
- package/dist/infinite-scroll/index.d.ts +1 -0
- package/dist/infinite-scroll/index.js +248 -0
- package/dist/infinite-scroll/index.js.map +1 -0
- package/dist/infinite-scroll/infinite-scroll.d.ts +95 -0
- package/dist/input/index.js +181 -22
- package/dist/input/index.js.map +1 -1
- package/dist/input/input.d.ts +44 -1
- package/dist/layer-IpFrl5--.js +414 -0
- package/dist/layer-IpFrl5--.js.map +1 -0
- package/dist/layout-BRSqi4AQ.js +43 -0
- package/dist/layout-BRSqi4AQ.js.map +1 -0
- package/dist/layout.d.ts +13 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/list.d.ts +30 -0
- package/dist/list-6-iz-Irh.js +28 -0
- package/dist/list-6-iz-Irh.js.map +1 -0
- package/dist/loading/index.js +45 -2
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/loading.d.ts +45 -2
- package/dist/modal-dialog-machine-CF9_z3Dm.js +487 -0
- package/dist/modal-dialog-machine-CF9_z3Dm.js.map +1 -0
- package/dist/modal-dialog-machine.d.ts +21 -0
- package/dist/modal-dismissable-lifetime.d.ts +21 -0
- package/dist/modal-registry.d.ts +24 -0
- package/dist/modal-render-hydration.d.ts +35 -0
- package/dist/modal-render-runtime.d.ts +19 -0
- package/dist/modal-render-scope.d.ts +63 -0
- package/dist/nav-bar/index.d.ts +1 -0
- package/dist/nav-bar/index.js +115 -0
- package/dist/nav-bar/index.js.map +1 -0
- package/dist/nav-bar/nav-bar.d.ts +76 -0
- package/dist/notice-bar/index.d.ts +2 -0
- package/dist/notice-bar/index.js +2 -0
- package/dist/notice-bar/notice-bar.d.ts +103 -0
- package/dist/notice-bar-DMpwLvRb.js +231 -0
- package/dist/notice-bar-DMpwLvRb.js.map +1 -0
- package/dist/notify/index.d.ts +1 -0
- package/dist/notify/index.js +251 -0
- package/dist/notify/index.js.map +1 -0
- package/dist/notify/notify.d.ts +123 -0
- package/dist/number-keyboard/index.d.ts +1 -0
- package/dist/number-keyboard/index.js +333 -0
- package/dist/number-keyboard/index.js.map +1 -0
- package/dist/number-keyboard/number-keyboard.d.ts +141 -0
- package/dist/overlay-panel/index.d.ts +2 -0
- package/dist/overlay-panel/index.js +2 -0
- package/dist/overlay-panel/overlay-panel.d.ts +20 -0
- package/dist/overlay-panel-Z_qdKeBj.js +26 -0
- package/dist/overlay-panel-Z_qdKeBj.js.map +1 -0
- package/dist/page-indicator/index.d.ts +1 -0
- package/dist/page-indicator/index.js +138 -0
- package/dist/page-indicator/index.js.map +1 -0
- package/dist/page-indicator/page-indicator.d.ts +93 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +198 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/pagination.d.ts +125 -0
- package/dist/password-input/index.d.ts +1 -0
- package/dist/password-input/index.js +317 -0
- package/dist/password-input/index.js.map +1 -0
- package/dist/password-input/password-input.d.ts +144 -0
- package/dist/picker/index.d.ts +8 -0
- package/dist/picker/index.js +2 -0
- package/dist/picker/picker-machine.d.ts +80 -0
- package/dist/picker/picker.d.ts +121 -0
- package/dist/picker/platform.d.ts +84 -0
- package/dist/picker/selection-connect.d.ts +90 -0
- package/dist/picker/selection-model.d.ts +211 -0
- package/dist/picker-BykFntQN.js +1675 -0
- package/dist/picker-BykFntQN.js.map +1 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +253 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/layer.d.ts +44 -0
- package/dist/popover/popover.d.ts +104 -0
- package/dist/popover/positioning.d.ts +132 -0
- package/dist/popup/index.d.ts +2 -0
- package/dist/popup/index.js +2 -0
- package/dist/popup/popup.d.ts +60 -0
- package/dist/popup-z5d8IYCt.js +576 -0
- package/dist/popup-z5d8IYCt.js.map +1 -0
- package/dist/portal-BHCNTWhg.js +78 -0
- package/dist/portal-BHCNTWhg.js.map +1 -0
- package/dist/portal.d.ts +61 -0
- package/dist/price/format.d.ts +19 -0
- package/dist/price/index.d.ts +1 -0
- package/dist/price/index.js +154 -0
- package/dist/price/index.js.map +1 -0
- package/dist/price/price.d.ts +88 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/progress.d.ts +32 -0
- package/dist/progress-f3iYEfdA.js +37 -0
- package/dist/progress-f3iYEfdA.js.map +1 -0
- package/dist/pull-refresh/index.d.ts +1 -0
- package/dist/pull-refresh/index.js +414 -0
- package/dist/pull-refresh/index.js.map +1 -0
- package/dist/pull-refresh/pull-refresh.d.ts +118 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/radio-group/radio-group.d.ts +78 -0
- package/dist/radio-group-BOIMuqnS.js +230 -0
- package/dist/radio-group-BOIMuqnS.js.map +1 -0
- package/dist/rate/index.d.ts +1 -0
- package/dist/rate/index.js +2 -0
- package/dist/rate/rate-form.d.ts +28 -0
- package/dist/rate/rate.d.ts +144 -0
- package/dist/rate-5XsU2QkY.js +631 -0
- package/dist/rate-5XsU2QkY.js.map +1 -0
- package/dist/reorder/index.d.ts +1 -0
- package/dist/reorder/index.js +720 -0
- package/dist/reorder/index.js.map +1 -0
- package/dist/reorder/reorder.d.ts +190 -0
- package/dist/result/index.d.ts +1 -0
- package/dist/result/index.js +123 -0
- package/dist/result/index.js.map +1 -0
- package/dist/result/result.d.ts +88 -0
- package/dist/safe-area/index.d.ts +1 -0
- package/dist/safe-area/index.js +42 -0
- package/dist/safe-area/index.js.map +1 -0
- package/dist/safe-area/safe-area.d.ts +28 -0
- package/dist/search-bar/index.js +4 -2
- package/dist/search-bar/index.js.map +1 -1
- package/dist/search-bar/search-bar.d.ts +6 -0
- package/dist/segmented/index.d.ts +2 -0
- package/dist/segmented/index.js +2 -0
- package/dist/segmented/segmented.d.ts +127 -0
- package/dist/segmented-BaU38_L4.js +367 -0
- package/dist/segmented-BaU38_L4.js.map +1 -0
- package/dist/selection-form-BOM_odUk.js +88 -0
- package/dist/selection-form-BOM_odUk.js.map +1 -0
- package/dist/selection-form.d.ts +27 -0
- package/dist/selection-ivXqO1eu.js +55 -0
- package/dist/selection-ivXqO1eu.js.map +1 -0
- package/dist/selection.d.ts +29 -0
- package/dist/selector/choice-group.d.ts +114 -0
- package/dist/selector/index.d.ts +2 -0
- package/dist/selector/index.js +2 -0
- package/dist/selector/selector.d.ts +90 -0
- package/dist/selector-BU2MMJ4N.js +93 -0
- package/dist/selector-BU2MMJ4N.js.map +1 -0
- package/dist/share-sheet/index.d.ts +1 -0
- package/dist/share-sheet/index.js +138 -0
- package/dist/share-sheet/index.js.map +1 -0
- package/dist/share-sheet/share-sheet.d.ts +139 -0
- package/dist/side-nav/index.d.ts +1 -0
- package/dist/side-nav/index.js +99 -0
- package/dist/side-nav/index.js.map +1 -0
- package/dist/side-nav/side-nav.d.ts +94 -0
- package/dist/skeleton/index.js +51 -2
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/skeleton.d.ts +34 -3
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +482 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +174 -0
- package/dist/space/index.d.ts +1 -0
- package/dist/space/index.js +52 -0
- package/dist/space/index.js.map +1 -0
- package/dist/space/space.d.ts +46 -0
- package/dist/statistic/index.d.ts +1 -0
- package/dist/statistic/index.js +152 -0
- package/dist/statistic/index.js.map +1 -0
- package/dist/statistic/statistic.d.ts +101 -0
- package/dist/stepper/index.d.ts +1 -0
- package/dist/stepper/index.js +172 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/stepper.d.ts +161 -0
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +72 -0
- package/dist/steps/index.js.map +1 -0
- package/dist/steps/steps.d.ts +67 -0
- package/dist/sticky/index.d.ts +1 -0
- package/dist/sticky/index.js +145 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.d.ts +70 -0
- package/dist/swipe-action/index.d.ts +1 -0
- package/dist/swipe-action/index.js +417 -0
- package/dist/swipe-action/index.js.map +1 -0
- package/dist/swipe-action/swipe-action.d.ts +148 -0
- package/dist/swiper/gesture.d.ts +32 -0
- package/dist/swiper/index.d.ts +1 -0
- package/dist/swiper/index.js +2 -0
- package/dist/swiper/swiper.d.ts +177 -0
- package/dist/swiper-BKivDkHp.js +550 -0
- package/dist/swiper-BKivDkHp.js.map +1 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +168 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/switch.d.ts +142 -0
- package/dist/tabbar/index.d.ts +1 -0
- package/dist/tabbar/index.js +95 -0
- package/dist/tabbar/index.js.map +1 -0
- package/dist/tabbar/tabbar.d.ts +119 -0
- package/dist/tabs/index.js +22 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/tabs.d.ts +12 -8
- package/dist/tag/index.js +123 -2
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/tag.d.ts +67 -1
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +2 -242
- package/dist/textarea/platform.d.ts +22 -0
- package/dist/textarea/textarea.d.ts +169 -46
- package/dist/textarea-qbnruDUG.js +775 -0
- package/dist/textarea-qbnruDUG.js.map +1 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +228 -0
- package/dist/time-picker/index.js.map +1 -0
- package/dist/time-picker/time-picker.d.ts +83 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +131 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline.d.ts +79 -0
- package/dist/toast/index.js +47 -4
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/toast.d.ts +26 -3
- package/dist/top-bar/index.js +16 -2
- package/dist/top-bar/index.js.map +1 -1
- package/dist/top-bar/top-bar.d.ts +13 -2
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +512 -0
- package/dist/tree-select/index.js.map +1 -0
- package/dist/tree-select/tree-select.d.ts +215 -0
- package/dist/typography/index.d.ts +1 -0
- package/dist/typography/index.js +82 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/typography.d.ts +54 -0
- package/dist/upload/index.d.ts +1 -0
- package/dist/upload/index.js +458 -0
- package/dist/upload/index.js.map +1 -0
- package/dist/upload/upload.d.ts +172 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +445 -0
- package/dist/virtual-list/index.js.map +1 -0
- package/dist/virtual-list/virtual-list.d.ts +160 -0
- package/dist/visual-manifest.d.ts +27 -0
- package/dist/watermark/index.d.ts +1 -0
- package/dist/watermark/index.js +260 -0
- package/dist/watermark/index.js.map +1 -0
- package/dist/watermark/watermark.d.ts +106 -0
- package/package.json +417 -44
- package/dist/empty/index.js.map +0 -1
- package/dist/icon/index.js.map +0 -1
- package/dist/textarea/index.js.map +0 -1
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import { n as resolveSwipeIntent, r as sampleVelocity, t as lockGestureAxis } from "./gesture-_SRHIvBm.js";
|
|
2
|
+
import { o as resolveIconState } from "./icon-Cgdbnk1u.js";
|
|
3
|
+
import { createMachine } from "@zag-js/core";
|
|
4
|
+
//#region src/swiper/swiper.ts
|
|
5
|
+
/** Main axis of the slides. */
|
|
6
|
+
const SWIPER_DIRECTIONS = ["horizontal", "vertical"];
|
|
7
|
+
/** Stable DOM parts shared by every adapter. */
|
|
8
|
+
const SWIPER_PARTS = [
|
|
9
|
+
"root",
|
|
10
|
+
"viewport",
|
|
11
|
+
"track",
|
|
12
|
+
"slide",
|
|
13
|
+
"prev",
|
|
14
|
+
"next",
|
|
15
|
+
"autoplay-toggle",
|
|
16
|
+
"indicator"
|
|
17
|
+
];
|
|
18
|
+
/** Slides beyond this count are ignored (keeps labels and indicator bounded). */
|
|
19
|
+
const SWIPER_MAX_SLIDES = 100;
|
|
20
|
+
/** Gesture contract: share of the viewport that commits a page; flicks commit earlier (see gesture.ts). */
|
|
21
|
+
const SWIPER_DISTANCE_RATIO = .25;
|
|
22
|
+
/** Drag resistance past a non-loop boundary. */
|
|
23
|
+
const SWIPER_EDGE_RESISTANCE = .35;
|
|
24
|
+
const SWIPER_DEFAULT_AUTOPLAY_INTERVAL = 3e3;
|
|
25
|
+
const SWIPER_MIN_AUTOPLAY_INTERVAL = 1e3;
|
|
26
|
+
const whole = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;
|
|
27
|
+
const text = (value, fallback) => typeof value === "string" && value.trim() ? value : fallback;
|
|
28
|
+
const fill = (template, page, total) => template.replace(/\{page\}/g, String(page)).replace(/\{total\}/g, String(total));
|
|
29
|
+
function resolveSwiperState(props = {}) {
|
|
30
|
+
const interval = props.autoplayInterval;
|
|
31
|
+
return {
|
|
32
|
+
count: Math.min(100, whole(props.count, 0)),
|
|
33
|
+
loop: !!props.loop,
|
|
34
|
+
direction: SWIPER_DIRECTIONS.includes(props.direction) ? props.direction : "horizontal",
|
|
35
|
+
allowTouchMove: props.allowTouchMove !== false,
|
|
36
|
+
label: text(props.label, "轮播"),
|
|
37
|
+
slideLabelTemplate: text(props.slideLabelTemplate, "第 {page} 张,共 {total} 张"),
|
|
38
|
+
indicator: props.indicator !== false,
|
|
39
|
+
indicatorTone: props.indicatorTone === "inverse" ? "inverse" : "default",
|
|
40
|
+
navigation: !!props.navigation,
|
|
41
|
+
prevLabel: text(props.prevLabel, "上一张"),
|
|
42
|
+
nextLabel: text(props.nextLabel, "下一张"),
|
|
43
|
+
autoplay: !!props.autoplay,
|
|
44
|
+
autoplayInterval: typeof interval === "number" && Number.isFinite(interval) ? Math.max(SWIPER_MIN_AUTOPLAY_INTERVAL, interval) : SWIPER_DEFAULT_AUTOPLAY_INTERVAL,
|
|
45
|
+
pauseLabel: text(props.pauseLabel, "停止自动播放"),
|
|
46
|
+
playLabel: text(props.playLabel, "开始自动播放")
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Any requested index rendered against the live count: empty is 0, otherwise clamped. */
|
|
50
|
+
function clampSwiperIndex(state, index) {
|
|
51
|
+
return state.count ? Math.min(state.count - 1, whole(index, 0)) : 0;
|
|
52
|
+
}
|
|
53
|
+
/** One step forward/back. Loop wraps; otherwise the boundary holds (returns the same index). */
|
|
54
|
+
function stepSwiperIndex(state, current, delta) {
|
|
55
|
+
if (state.count < 2) return clampSwiperIndex(state, current);
|
|
56
|
+
const next = clampSwiperIndex(state, current) + delta;
|
|
57
|
+
if (state.loop) return (next + state.count) % state.count;
|
|
58
|
+
return Math.min(state.count - 1, Math.max(0, next));
|
|
59
|
+
}
|
|
60
|
+
/** Physical drag offset with resistance when pulling past a non-loop boundary. `progress` is the logical forward distance. */
|
|
61
|
+
function resolveSwiperDragOffset(state, current, delta, progress) {
|
|
62
|
+
const index = clampSwiperIndex(state, current), pastStart = index === 0 && progress < 0, pastEnd = index >= state.count - 1 && progress > 0;
|
|
63
|
+
return !state.loop && (pastStart || pastEnd) ? delta * SWIPER_EDGE_RESISTANCE : delta;
|
|
64
|
+
}
|
|
65
|
+
function getSwiperSlides(state, current) {
|
|
66
|
+
const index = clampSwiperIndex(state, current);
|
|
67
|
+
return Array.from({ length: state.count }, (_, slide) => ({
|
|
68
|
+
index: slide,
|
|
69
|
+
key: `slide-${slide}`,
|
|
70
|
+
label: fill(state.slideLabelTemplate, slide + 1, state.count),
|
|
71
|
+
current: slide === index
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
function createSwiperProps(props = {}) {
|
|
75
|
+
if (props.id !== void 0 && (typeof props.id !== "string" || !props.id.trim())) throw new TypeError("Swiper requires a nonempty instance id when provided");
|
|
76
|
+
return {
|
|
77
|
+
...props,
|
|
78
|
+
defaultIndex: whole(props.defaultIndex, 0),
|
|
79
|
+
index: props.index === void 0 ? void 0 : whole(props.index, 0)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const ids = (scope) => ({
|
|
83
|
+
root: `swiper:${scope.id}`,
|
|
84
|
+
viewport: `swiper:${scope.id}:viewport`,
|
|
85
|
+
track: `swiper:${scope.id}:track`
|
|
86
|
+
});
|
|
87
|
+
const live = (service) => resolveSwiperState({
|
|
88
|
+
count: service.prop("count"),
|
|
89
|
+
loop: service.prop("loop"),
|
|
90
|
+
direction: service.prop("direction"),
|
|
91
|
+
allowTouchMove: service.prop("allowTouchMove"),
|
|
92
|
+
label: service.prop("label"),
|
|
93
|
+
slideLabelTemplate: service.prop("slideLabelTemplate"),
|
|
94
|
+
indicator: service.prop("indicator"),
|
|
95
|
+
indicatorTone: service.prop("indicatorTone"),
|
|
96
|
+
navigation: service.prop("navigation"),
|
|
97
|
+
prevLabel: service.prop("prevLabel"),
|
|
98
|
+
nextLabel: service.prop("nextLabel"),
|
|
99
|
+
autoplay: service.prop("autoplay"),
|
|
100
|
+
autoplayInterval: service.prop("autoplayInterval"),
|
|
101
|
+
pauseLabel: service.prop("pauseLabel"),
|
|
102
|
+
playLabel: service.prop("playLabel")
|
|
103
|
+
});
|
|
104
|
+
/** Rotation is armed (autoplay on, not stopped by the user, more than one slide). */
|
|
105
|
+
const rotating = (params) => {
|
|
106
|
+
const state = live(params);
|
|
107
|
+
return state.autoplay && state.count > 1 && !params.context.get("stopped");
|
|
108
|
+
};
|
|
109
|
+
/** Armed and not paused by hover, focus or a drag. */
|
|
110
|
+
const running = (params) => rotating(params) && !params.context.get("hovered") && !params.context.get("focused") && !params.context.get("dragging");
|
|
111
|
+
/** Core owns paging, gestures, measurement, autoplay timers and cleanup; adapters only render parts. */
|
|
112
|
+
const swiperMachine = createMachine({
|
|
113
|
+
props: ({ props }) => createSwiperProps(props),
|
|
114
|
+
initialState: () => "ready",
|
|
115
|
+
states: { ready: {} },
|
|
116
|
+
context: ({ bindable, prop }) => ({
|
|
117
|
+
index: bindable(() => ({
|
|
118
|
+
defaultValue: prop("defaultIndex") ?? 0,
|
|
119
|
+
value: prop("index"),
|
|
120
|
+
onChange(index) {
|
|
121
|
+
prop("onIndexChange")?.({ index });
|
|
122
|
+
}
|
|
123
|
+
})),
|
|
124
|
+
offset: bindable(() => ({ defaultValue: 0 })),
|
|
125
|
+
dragging: bindable(() => ({ defaultValue: false })),
|
|
126
|
+
size: bindable(() => ({ defaultValue: 0 })),
|
|
127
|
+
rtl: bindable(() => ({ defaultValue: false })),
|
|
128
|
+
hovered: bindable(() => ({ defaultValue: false })),
|
|
129
|
+
focused: bindable(() => ({ defaultValue: false })),
|
|
130
|
+
stopped: bindable(() => ({ defaultValue: false }))
|
|
131
|
+
}),
|
|
132
|
+
refs: () => ({ reschedule: null }),
|
|
133
|
+
watch({ track, prop, context, action }) {
|
|
134
|
+
track([() => prop("count")], () => action(["clampIndex"]));
|
|
135
|
+
track([
|
|
136
|
+
() => context.get("index"),
|
|
137
|
+
() => context.get("hovered"),
|
|
138
|
+
() => context.get("focused"),
|
|
139
|
+
() => context.get("dragging"),
|
|
140
|
+
() => context.get("stopped"),
|
|
141
|
+
() => prop("autoplay"),
|
|
142
|
+
() => prop("autoplayInterval"),
|
|
143
|
+
() => prop("count"),
|
|
144
|
+
() => prop("loop")
|
|
145
|
+
], () => action(["reschedule"]));
|
|
146
|
+
},
|
|
147
|
+
on: {
|
|
148
|
+
"INDEX.SET": { actions: ["setIndex"] },
|
|
149
|
+
STEP: { actions: ["step"] },
|
|
150
|
+
"DRAG.MOVE": { actions: ["dragMove"] },
|
|
151
|
+
"DRAG.END": { actions: ["dragEnd"] },
|
|
152
|
+
MEASURE: { actions: ["measure"] },
|
|
153
|
+
"HOVER.SET": { actions: ["setHovered"] },
|
|
154
|
+
"FOCUS.SET": { actions: ["setFocused"] },
|
|
155
|
+
"AUTOPLAY.TOGGLE": { actions: ["toggleAutoplay"] },
|
|
156
|
+
"AUTOPLAY.STOP": { actions: ["setStopped"] },
|
|
157
|
+
"AUTOPLAY.TICK": { actions: ["tick"] }
|
|
158
|
+
},
|
|
159
|
+
effects: ["trackGestures", "autoplay"],
|
|
160
|
+
implementations: {
|
|
161
|
+
actions: {
|
|
162
|
+
setIndex({ event, context, prop }) {
|
|
163
|
+
if (event.type !== "INDEX.SET") return;
|
|
164
|
+
const state = live({ prop });
|
|
165
|
+
if (!state.count) return;
|
|
166
|
+
const next = clampSwiperIndex(state, event.value);
|
|
167
|
+
if (next !== clampSwiperIndex(state, context.get("index"))) context.set("index", next);
|
|
168
|
+
},
|
|
169
|
+
step({ event, context, prop }) {
|
|
170
|
+
if (event.type !== "STEP") return;
|
|
171
|
+
const state = live({ prop }), current = clampSwiperIndex(state, context.get("index")), next = stepSwiperIndex(state, current, event.delta);
|
|
172
|
+
if (next !== current) context.set("index", next);
|
|
173
|
+
},
|
|
174
|
+
dragMove({ event, context }) {
|
|
175
|
+
if (event.type === "DRAG.MOVE") {
|
|
176
|
+
context.set("dragging", true);
|
|
177
|
+
context.set("offset", event.offset);
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
dragEnd({ event, context, prop }) {
|
|
181
|
+
if (event.type !== "DRAG.END") return;
|
|
182
|
+
context.set("dragging", false);
|
|
183
|
+
context.set("offset", 0);
|
|
184
|
+
if (!event.intent) return;
|
|
185
|
+
const state = live({ prop }), current = clampSwiperIndex(state, context.get("index")), next = stepSwiperIndex(state, current, event.intent);
|
|
186
|
+
if (next !== current) context.set("index", next);
|
|
187
|
+
},
|
|
188
|
+
measure({ event, context }) {
|
|
189
|
+
if (event.type === "MEASURE") {
|
|
190
|
+
context.set("size", event.size);
|
|
191
|
+
context.set("rtl", event.rtl);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
setHovered({ event, context }) {
|
|
195
|
+
if (event.type === "HOVER.SET") context.set("hovered", event.value);
|
|
196
|
+
},
|
|
197
|
+
setFocused({ event, context }) {
|
|
198
|
+
if (event.type === "FOCUS.SET") context.set("focused", event.value);
|
|
199
|
+
},
|
|
200
|
+
toggleAutoplay({ context }) {
|
|
201
|
+
context.set("stopped", !context.get("stopped"));
|
|
202
|
+
},
|
|
203
|
+
setStopped({ context }) {
|
|
204
|
+
context.set("stopped", true);
|
|
205
|
+
},
|
|
206
|
+
tick(params) {
|
|
207
|
+
if (!running(params)) return;
|
|
208
|
+
const state = live(params), current = clampSwiperIndex(state, params.context.get("index"));
|
|
209
|
+
if (!state.loop && current >= state.count - 1) return;
|
|
210
|
+
params.context.set("index", stepSwiperIndex(state, current, 1));
|
|
211
|
+
},
|
|
212
|
+
clampIndex({ context, prop }) {
|
|
213
|
+
const state = live({ prop }), current = context.get("index");
|
|
214
|
+
if (state.count && current > state.count - 1) context.set("index", state.count - 1);
|
|
215
|
+
},
|
|
216
|
+
reschedule({ refs }) {
|
|
217
|
+
refs.get("reschedule")?.();
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
effects: {
|
|
221
|
+
trackGestures({ scope, prop, context, send }) {
|
|
222
|
+
const root = scope.getById(ids(scope).root), viewport = scope.getById(ids(scope).viewport), win = viewport?.ownerDocument.defaultView;
|
|
223
|
+
if (!root || !viewport || !win) return;
|
|
224
|
+
const vertical = () => live({ prop }).direction === "vertical";
|
|
225
|
+
const measure = () => {
|
|
226
|
+
const size = vertical() ? viewport.clientHeight : viewport.clientWidth, rtl = win.getComputedStyle(viewport).direction === "rtl";
|
|
227
|
+
if (size !== context.get("size") || rtl !== context.get("rtl")) send({
|
|
228
|
+
type: "MEASURE",
|
|
229
|
+
size,
|
|
230
|
+
rtl
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
if (live({ prop }).autoplay && win.matchMedia?.("(prefers-reduced-motion: reduce)").matches) send({ type: "AUTOPLAY.STOP" });
|
|
234
|
+
let gesture = null;
|
|
235
|
+
let suppressClick = false;
|
|
236
|
+
const progressOf = (dx, dy, rtl) => vertical() ? -dy : rtl ? dx : -dx;
|
|
237
|
+
const onDown = (event) => {
|
|
238
|
+
const state = live({ prop });
|
|
239
|
+
gesture = null;
|
|
240
|
+
if (!state.allowTouchMove || state.count < 2 || event.pointerType === "mouse" && event.button !== 0) return;
|
|
241
|
+
const rtl = win.getComputedStyle(viewport).direction === "rtl";
|
|
242
|
+
gesture = {
|
|
243
|
+
id: event.pointerId,
|
|
244
|
+
x: event.clientX,
|
|
245
|
+
y: event.clientY,
|
|
246
|
+
axis: "pending",
|
|
247
|
+
rtl,
|
|
248
|
+
samples: [],
|
|
249
|
+
captured: false
|
|
250
|
+
};
|
|
251
|
+
suppressClick = false;
|
|
252
|
+
measure();
|
|
253
|
+
};
|
|
254
|
+
const onMove = (event) => {
|
|
255
|
+
if (!gesture || event.pointerId !== gesture.id) return;
|
|
256
|
+
const dx = event.clientX - gesture.x, dy = event.clientY - gesture.y;
|
|
257
|
+
if (gesture.axis === "pending") gesture.axis = lockGestureAxis(dx, dy, vertical());
|
|
258
|
+
if (gesture.axis === "cross") {
|
|
259
|
+
gesture = null;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (gesture.axis !== "main") return;
|
|
263
|
+
if (!gesture.captured) {
|
|
264
|
+
gesture.captured = true;
|
|
265
|
+
try {
|
|
266
|
+
viewport.setPointerCapture?.(event.pointerId);
|
|
267
|
+
} catch {}
|
|
268
|
+
}
|
|
269
|
+
const progress = progressOf(dx, dy, gesture.rtl);
|
|
270
|
+
gesture.samples.push({
|
|
271
|
+
position: progress,
|
|
272
|
+
time: event.timeStamp
|
|
273
|
+
});
|
|
274
|
+
send({
|
|
275
|
+
type: "DRAG.MOVE",
|
|
276
|
+
offset: resolveSwiperDragOffset(live({ prop }), context.get("index"), vertical() ? dy : dx, progress)
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
const onUp = (event) => {
|
|
280
|
+
if (!gesture || event.pointerId !== gesture.id) return;
|
|
281
|
+
const done = gesture;
|
|
282
|
+
gesture = null;
|
|
283
|
+
if (done.axis !== "main") return;
|
|
284
|
+
suppressClick = true;
|
|
285
|
+
const progress = progressOf(event.clientX - done.x, event.clientY - done.y, done.rtl);
|
|
286
|
+
done.samples.push({
|
|
287
|
+
position: progress,
|
|
288
|
+
time: event.timeStamp
|
|
289
|
+
});
|
|
290
|
+
send({
|
|
291
|
+
type: "DRAG.END",
|
|
292
|
+
intent: resolveSwipeIntent({
|
|
293
|
+
distance: progress,
|
|
294
|
+
velocity: sampleVelocity(done.samples, event.timeStamp),
|
|
295
|
+
size: context.get("size"),
|
|
296
|
+
ratio: SWIPER_DISTANCE_RATIO
|
|
297
|
+
})
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
const onCancel = (event) => {
|
|
301
|
+
if (!gesture || event.pointerId !== gesture.id) return;
|
|
302
|
+
const done = gesture;
|
|
303
|
+
gesture = null;
|
|
304
|
+
if (done.axis === "main") send({
|
|
305
|
+
type: "DRAG.END",
|
|
306
|
+
intent: 0
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
const onClick = (event) => {
|
|
310
|
+
if (suppressClick) {
|
|
311
|
+
suppressClick = false;
|
|
312
|
+
event.preventDefault();
|
|
313
|
+
event.stopPropagation();
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
const onFocusIn = () => {
|
|
317
|
+
if (!context.get("focused")) send({
|
|
318
|
+
type: "FOCUS.SET",
|
|
319
|
+
value: true
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
const onFocusOut = (event) => {
|
|
323
|
+
const next = event.relatedTarget;
|
|
324
|
+
if (!next || !root.contains(next)) send({
|
|
325
|
+
type: "FOCUS.SET",
|
|
326
|
+
value: false
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
const onEnter = (event) => {
|
|
330
|
+
if (event.pointerType === "mouse") send({
|
|
331
|
+
type: "HOVER.SET",
|
|
332
|
+
value: true
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
const onLeave = (event) => {
|
|
336
|
+
if (event.pointerType === "mouse") send({
|
|
337
|
+
type: "HOVER.SET",
|
|
338
|
+
value: false
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
viewport.addEventListener("pointerdown", onDown);
|
|
342
|
+
viewport.addEventListener("pointermove", onMove);
|
|
343
|
+
viewport.addEventListener("pointerup", onUp);
|
|
344
|
+
viewport.addEventListener("pointercancel", onCancel);
|
|
345
|
+
viewport.addEventListener("click", onClick, true);
|
|
346
|
+
root.addEventListener("focusin", onFocusIn);
|
|
347
|
+
root.addEventListener("focusout", onFocusOut);
|
|
348
|
+
root.addEventListener("pointerenter", onEnter);
|
|
349
|
+
root.addEventListener("pointerleave", onLeave);
|
|
350
|
+
const Observer = win.ResizeObserver, observer = Observer ? new Observer(measure) : null;
|
|
351
|
+
observer?.observe(viewport);
|
|
352
|
+
win.addEventListener("resize", measure);
|
|
353
|
+
measure();
|
|
354
|
+
return () => {
|
|
355
|
+
gesture = null;
|
|
356
|
+
observer?.disconnect();
|
|
357
|
+
win.removeEventListener("resize", measure);
|
|
358
|
+
viewport.removeEventListener("pointerdown", onDown);
|
|
359
|
+
viewport.removeEventListener("pointermove", onMove);
|
|
360
|
+
viewport.removeEventListener("pointerup", onUp);
|
|
361
|
+
viewport.removeEventListener("pointercancel", onCancel);
|
|
362
|
+
viewport.removeEventListener("click", onClick, true);
|
|
363
|
+
root.removeEventListener("focusin", onFocusIn);
|
|
364
|
+
root.removeEventListener("focusout", onFocusOut);
|
|
365
|
+
root.removeEventListener("pointerenter", onEnter);
|
|
366
|
+
root.removeEventListener("pointerleave", onLeave);
|
|
367
|
+
};
|
|
368
|
+
},
|
|
369
|
+
autoplay({ prop, context, send, refs }) {
|
|
370
|
+
let timer, disposed = false;
|
|
371
|
+
const schedule = () => {
|
|
372
|
+
if (timer !== void 0) {
|
|
373
|
+
clearTimeout(timer);
|
|
374
|
+
timer = void 0;
|
|
375
|
+
}
|
|
376
|
+
if (disposed || !running({
|
|
377
|
+
prop,
|
|
378
|
+
context
|
|
379
|
+
})) return;
|
|
380
|
+
timer = setTimeout(() => {
|
|
381
|
+
timer = void 0;
|
|
382
|
+
send({ type: "AUTOPLAY.TICK" });
|
|
383
|
+
}, live({ prop }).autoplayInterval);
|
|
384
|
+
};
|
|
385
|
+
refs.set("reschedule", schedule);
|
|
386
|
+
schedule();
|
|
387
|
+
return () => {
|
|
388
|
+
disposed = true;
|
|
389
|
+
refs.set("reschedule", null);
|
|
390
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
const callKeyDown = (handler, event) => {
|
|
397
|
+
for (const item of Array.isArray(handler) ? handler : [handler]) if (typeof item === "function") item(event);
|
|
398
|
+
};
|
|
399
|
+
function connectSwiper(service, normalize, options = {}) {
|
|
400
|
+
const state = live(service), id = ids(service.scope), index = clampSwiperIndex(state, service.context.get("index"));
|
|
401
|
+
const dragging = service.context.get("dragging"), offset = service.context.get("offset"), rtl = service.context.get("rtl");
|
|
402
|
+
const armed = rotating(service), active = running(service), vertical = state.direction === "vertical";
|
|
403
|
+
const swipeTo = (value) => service.send({
|
|
404
|
+
type: "INDEX.SET",
|
|
405
|
+
value
|
|
406
|
+
});
|
|
407
|
+
const swipeNext = () => service.send({
|
|
408
|
+
type: "STEP",
|
|
409
|
+
delta: 1
|
|
410
|
+
}), swipePrev = () => service.send({
|
|
411
|
+
type: "STEP",
|
|
412
|
+
delta: -1
|
|
413
|
+
});
|
|
414
|
+
const toggleAutoplay = () => service.send({ type: "AUTOPLAY.TOGGLE" });
|
|
415
|
+
const part = (name) => ({
|
|
416
|
+
"data-scope": "swiper",
|
|
417
|
+
"data-part": name
|
|
418
|
+
});
|
|
419
|
+
const atStart = !state.loop && index === 0, atEnd = !state.loop && index >= state.count - 1;
|
|
420
|
+
const keys = {
|
|
421
|
+
[vertical ? "ArrowUp" : rtl ? "ArrowRight" : "ArrowLeft"]: swipePrev,
|
|
422
|
+
[vertical ? "ArrowDown" : rtl ? "ArrowLeft" : "ArrowRight"]: swipeNext,
|
|
423
|
+
Home: () => swipeTo(0),
|
|
424
|
+
End: () => swipeTo(state.count - 1)
|
|
425
|
+
};
|
|
426
|
+
const toggleLabel = armed ? state.pauseLabel : state.playLabel;
|
|
427
|
+
return {
|
|
428
|
+
index,
|
|
429
|
+
count: state.count,
|
|
430
|
+
dragging,
|
|
431
|
+
direction: state.direction,
|
|
432
|
+
autoplaying: armed,
|
|
433
|
+
slides: getSwiperSlides(state, index),
|
|
434
|
+
autoplayToggleLabel: toggleLabel,
|
|
435
|
+
indicatorProps: {
|
|
436
|
+
total: state.count,
|
|
437
|
+
current: index,
|
|
438
|
+
tone: state.indicatorTone,
|
|
439
|
+
direction: vertical ? "vertical" : "horizontal"
|
|
440
|
+
},
|
|
441
|
+
swipeTo,
|
|
442
|
+
swipeNext,
|
|
443
|
+
swipePrev,
|
|
444
|
+
toggleAutoplay,
|
|
445
|
+
getRootProps: () => normalize.element({
|
|
446
|
+
...part("root"),
|
|
447
|
+
id: id.root,
|
|
448
|
+
role: "region",
|
|
449
|
+
"aria-roledescription": "carousel",
|
|
450
|
+
"aria-label": state.label,
|
|
451
|
+
tabIndex: 0,
|
|
452
|
+
"data-direction": state.direction,
|
|
453
|
+
"data-dragging": dragging ? "true" : void 0,
|
|
454
|
+
"data-empty": state.count ? void 0 : "true",
|
|
455
|
+
onKeyDown(event) {
|
|
456
|
+
callKeyDown(options.onKeyDown, event);
|
|
457
|
+
if (event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
458
|
+
const run = keys[event.key];
|
|
459
|
+
if (run && state.count > 1) {
|
|
460
|
+
event.preventDefault();
|
|
461
|
+
run();
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}),
|
|
465
|
+
getViewportProps: () => normalize.element({
|
|
466
|
+
...part("viewport"),
|
|
467
|
+
id: id.viewport,
|
|
468
|
+
"data-direction": state.direction,
|
|
469
|
+
"data-touch": state.allowTouchMove ? "true" : void 0
|
|
470
|
+
}),
|
|
471
|
+
getTrackProps: () => normalize.element({
|
|
472
|
+
...part("track"),
|
|
473
|
+
id: id.track,
|
|
474
|
+
"aria-live": active ? "off" : "polite",
|
|
475
|
+
"aria-atomic": false,
|
|
476
|
+
"data-direction": state.direction,
|
|
477
|
+
"data-dragging": dragging ? "true" : void 0,
|
|
478
|
+
style: {
|
|
479
|
+
"--qw-swiper-index": String(index),
|
|
480
|
+
"--qw-swiper-offset": `${offset}px`
|
|
481
|
+
}
|
|
482
|
+
}),
|
|
483
|
+
getSlideProps: (slide) => normalize.element({
|
|
484
|
+
...part("slide"),
|
|
485
|
+
id: `swiper:${service.scope.id}:slide:${slide.index}`,
|
|
486
|
+
role: "group",
|
|
487
|
+
"aria-roledescription": "slide",
|
|
488
|
+
"aria-label": slide.label,
|
|
489
|
+
"data-index": slide.index,
|
|
490
|
+
"data-current": slide.current ? "true" : void 0,
|
|
491
|
+
"aria-hidden": slide.current ? void 0 : true,
|
|
492
|
+
inert: slide.current ? void 0 : true
|
|
493
|
+
}),
|
|
494
|
+
getPrevProps: () => normalize.button({
|
|
495
|
+
...part("prev"),
|
|
496
|
+
type: "button",
|
|
497
|
+
"aria-label": state.prevLabel,
|
|
498
|
+
"aria-controls": id.track,
|
|
499
|
+
hidden: !state.navigation || void 0,
|
|
500
|
+
disabled: atStart || state.count < 2,
|
|
501
|
+
onClick(event) {
|
|
502
|
+
if (!event.defaultPrevented) swipePrev();
|
|
503
|
+
}
|
|
504
|
+
}),
|
|
505
|
+
getNextProps: () => normalize.button({
|
|
506
|
+
...part("next"),
|
|
507
|
+
type: "button",
|
|
508
|
+
"aria-label": state.nextLabel,
|
|
509
|
+
"aria-controls": id.track,
|
|
510
|
+
hidden: !state.navigation || void 0,
|
|
511
|
+
disabled: atEnd || state.count < 2,
|
|
512
|
+
onClick(event) {
|
|
513
|
+
if (!event.defaultPrevented) swipeNext();
|
|
514
|
+
}
|
|
515
|
+
}),
|
|
516
|
+
getAutoplayToggleProps: () => normalize.button({
|
|
517
|
+
...part("autoplay-toggle"),
|
|
518
|
+
type: "button",
|
|
519
|
+
"aria-label": toggleLabel,
|
|
520
|
+
"aria-controls": id.track,
|
|
521
|
+
hidden: !state.autoplay || void 0,
|
|
522
|
+
"data-state": armed ? "playing" : "stopped",
|
|
523
|
+
onClick(event) {
|
|
524
|
+
if (!event.defaultPrevented) toggleAutoplay();
|
|
525
|
+
}
|
|
526
|
+
}),
|
|
527
|
+
getIndicatorProps: () => normalize.element({
|
|
528
|
+
...part("indicator"),
|
|
529
|
+
"aria-hidden": true,
|
|
530
|
+
hidden: !state.indicator || state.count < 2 || void 0,
|
|
531
|
+
"data-direction": state.direction
|
|
532
|
+
}),
|
|
533
|
+
getPrevIconState: () => resolveIconState({
|
|
534
|
+
id: `${id.root}:prev-icon`,
|
|
535
|
+
name: vertical ? "up" : "left"
|
|
536
|
+
}),
|
|
537
|
+
getNextIconState: () => resolveIconState({
|
|
538
|
+
id: `${id.root}:next-icon`,
|
|
539
|
+
name: vertical ? "down" : "right"
|
|
540
|
+
}),
|
|
541
|
+
getAutoplayIconState: () => resolveIconState({
|
|
542
|
+
id: `${id.root}:autoplay-icon`,
|
|
543
|
+
name: armed ? "pause" : "play-fill"
|
|
544
|
+
})
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
//#endregion
|
|
548
|
+
export { SWIPER_MAX_SLIDES as a, clampSwiperIndex as c, getSwiperSlides as d, resolveSwiperDragOffset as f, swiperMachine as h, SWIPER_EDGE_RESISTANCE as i, connectSwiper as l, stepSwiperIndex as m, SWIPER_DIRECTIONS as n, SWIPER_MIN_AUTOPLAY_INTERVAL as o, resolveSwiperState as p, SWIPER_DISTANCE_RATIO as r, SWIPER_PARTS as s, SWIPER_DEFAULT_AUTOPLAY_INTERVAL as t, createSwiperProps as u };
|
|
549
|
+
|
|
550
|
+
//# sourceMappingURL=swiper-BKivDkHp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swiper-BKivDkHp.js","names":[],"sources":["../src/swiper/swiper.ts"],"sourcesContent":["import { createMachine, type Machine, type Service } from \"@zag-js/core\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport { resolveIconState, type IconState } from \"../icon/index.js\";\nimport type { PageIndicatorTone, QwPageIndicatorProps } from \"../page-indicator/index.js\";\nimport { lockGestureAxis, resolveSwipeIntent, sampleVelocity, type GestureAxis, type GestureSample } from \"./gesture.js\";\n\n/** Main axis of the slides. */\nexport const SWIPER_DIRECTIONS = [\"horizontal\", \"vertical\"] as const;\n/** Stable DOM parts shared by every adapter. */\nexport const SWIPER_PARTS = [\"root\", \"viewport\", \"track\", \"slide\", \"prev\", \"next\", \"autoplay-toggle\", \"indicator\"] as const;\n/** Slides beyond this count are ignored (keeps labels and indicator bounded). */\nexport const SWIPER_MAX_SLIDES = 100;\n/** Gesture contract: share of the viewport that commits a page; flicks commit earlier (see gesture.ts). */\nexport const SWIPER_DISTANCE_RATIO = 0.25;\n/** Drag resistance past a non-loop boundary. */\nexport const SWIPER_EDGE_RESISTANCE = 0.35;\nexport const SWIPER_DEFAULT_AUTOPLAY_INTERVAL = 3000;\nexport const SWIPER_MIN_AUTOPLAY_INTERVAL = 1000;\nexport type SwiperDirection = (typeof SWIPER_DIRECTIONS)[number];\n/** Requested 0-based slide; controlled owners accept by updating `index`. */\nexport interface SwiperIndexChangeDetails { index: number }\n\n/** Scalar, SSR-safe contract. Slide content stays caller-owned; adapters pass the slide count. */\nexport interface QwSwiperProps {\n /** Page-unique instance identity; adapters generate one when omitted. */\n id?: string;\n /** Number of slides rendered by the adapter (children / slots / slide channels). */\n count?: number;\n /** Controlled 0-based slide. Undefined enables Core-owned state. */\n index?: number;\n /** Initial Core-owned slide; defaults to 0. */\n defaultIndex?: number;\n /** Wrap from the last slide to the first (and back). Off by default. */\n loop?: boolean;\n direction?: SwiperDirection;\n /** Pointer/touch dragging; defaults to true. Keyboard and buttons keep working when false. */\n allowTouchMove?: boolean;\n /** Carousel name; defaults to 轮播. */\n label?: string;\n /** Slide name with {page}/{total}; defaults to 第 {page} 张,共 {total} 张. */\n slideLabelTemplate?: string;\n /** Render the shared PageIndicator; defaults to true. */\n indicator?: boolean;\n indicatorTone?: PageIndicatorTone;\n /** Render previous/next buttons (recommended when screen-reader users must browse slides). */\n navigation?: boolean;\n prevLabel?: string;\n nextLabel?: string;\n /** Rotate automatically; pauses on hover/focus/drag, starts stopped under reduced motion, with a stop/start button. */\n autoplay?: boolean;\n /** Milliseconds between rotations; defaults to 3000, minimum 1000. */\n autoplayInterval?: number;\n pauseLabel?: string;\n playLabel?: string;\n onIndexChange?: (details: SwiperIndexChangeDetails) => void;\n}\nexport interface ResolvedSwiperState {\n count: number; loop: boolean; direction: SwiperDirection; allowTouchMove: boolean;\n label: string; slideLabelTemplate: string; indicator: boolean; indicatorTone: PageIndicatorTone;\n navigation: boolean; prevLabel: string; nextLabel: string;\n autoplay: boolean; autoplayInterval: number; pauseLabel: string; playLabel: string;\n}\nexport interface SwiperSlide { index: number; key: string; label: string; current: boolean }\n\nconst whole = (value: number | undefined, fallback: number): number => typeof value === \"number\" && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;\nconst text = (value: string | undefined, fallback: string): string => typeof value === \"string\" && value.trim() ? value : fallback;\nconst fill = (template: string, page: number, total: number): string => template.replace(/\\{page\\}/g, String(page)).replace(/\\{total\\}/g, String(total));\n\nexport function resolveSwiperState(props: QwSwiperProps = {}): ResolvedSwiperState {\n const interval = props.autoplayInterval;\n return {\n count: Math.min(SWIPER_MAX_SLIDES, whole(props.count, 0)), loop: !!props.loop,\n direction: SWIPER_DIRECTIONS.includes(props.direction!) ? props.direction! : \"horizontal\", allowTouchMove: props.allowTouchMove !== false,\n label: text(props.label, \"轮播\"), slideLabelTemplate: text(props.slideLabelTemplate, \"第 {page} 张,共 {total} 张\"),\n indicator: props.indicator !== false, indicatorTone: props.indicatorTone === \"inverse\" ? \"inverse\" : \"default\",\n navigation: !!props.navigation, prevLabel: text(props.prevLabel, \"上一张\"), nextLabel: text(props.nextLabel, \"下一张\"),\n autoplay: !!props.autoplay, autoplayInterval: typeof interval === \"number\" && Number.isFinite(interval) ? Math.max(SWIPER_MIN_AUTOPLAY_INTERVAL, interval) : SWIPER_DEFAULT_AUTOPLAY_INTERVAL,\n pauseLabel: text(props.pauseLabel, \"停止自动播放\"), playLabel: text(props.playLabel, \"开始自动播放\"),\n };\n}\n/** Any requested index rendered against the live count: empty is 0, otherwise clamped. */\nexport function clampSwiperIndex(state: Pick<ResolvedSwiperState, \"count\">, index: number): number {\n return state.count ? Math.min(state.count - 1, whole(index, 0)) : 0;\n}\n/** One step forward/back. Loop wraps; otherwise the boundary holds (returns the same index). */\nexport function stepSwiperIndex(state: Pick<ResolvedSwiperState, \"count\" | \"loop\">, current: number, delta: -1 | 1): number {\n if (state.count < 2) return clampSwiperIndex(state, current);\n const next = clampSwiperIndex(state, current) + delta;\n if (state.loop) return (next + state.count) % state.count;\n return Math.min(state.count - 1, Math.max(0, next));\n}\n/** Physical drag offset with resistance when pulling past a non-loop boundary. `progress` is the logical forward distance. */\nexport function resolveSwiperDragOffset(state: Pick<ResolvedSwiperState, \"count\" | \"loop\">, current: number, delta: number, progress: number): number {\n const index = clampSwiperIndex(state, current), pastStart = index === 0 && progress < 0, pastEnd = index >= state.count - 1 && progress > 0;\n return !state.loop && (pastStart || pastEnd) ? delta * SWIPER_EDGE_RESISTANCE : delta;\n}\nexport function getSwiperSlides(state: ResolvedSwiperState, current: number): SwiperSlide[] {\n const index = clampSwiperIndex(state, current);\n return Array.from({ length: state.count }, (_, slide) => ({ index: slide, key: `slide-${slide}`, label: fill(state.slideLabelTemplate, slide + 1, state.count), current: slide === index }));\n}\nexport function createSwiperProps(props: QwSwiperProps = {}): QwSwiperProps {\n if (props.id !== undefined && (typeof props.id !== \"string\" || !props.id.trim())) throw new TypeError(\"Swiper requires a nonempty instance id when provided\");\n return { ...props, defaultIndex: whole(props.defaultIndex, 0), index: props.index === undefined ? undefined : whole(props.index, 0) };\n}\n\nexport interface QwSwiperSchema {\n props: QwSwiperProps;\n context: { index: number; offset: number; dragging: boolean; size: number; rtl: boolean; hovered: boolean; focused: boolean; stopped: boolean };\n refs: { reschedule: (() => void) | null };\n state: \"ready\";\n action: \"setIndex\" | \"step\" | \"dragMove\" | \"dragEnd\" | \"measure\" | \"setHovered\" | \"setFocused\" | \"toggleAutoplay\" | \"setStopped\" | \"tick\" | \"clampIndex\" | \"reschedule\";\n effect: \"trackGestures\" | \"autoplay\";\n event:\n | { type: \"INDEX.SET\"; value: number }\n | { type: \"STEP\"; delta: -1 | 1 }\n | { type: \"DRAG.MOVE\"; offset: number }\n | { type: \"DRAG.END\"; intent: -1 | 0 | 1 }\n | { type: \"MEASURE\"; size: number; rtl: boolean }\n | { type: \"HOVER.SET\"; value: boolean }\n | { type: \"FOCUS.SET\"; value: boolean }\n | { type: \"AUTOPLAY.TOGGLE\" }\n | { type: \"AUTOPLAY.STOP\" }\n | { type: \"AUTOPLAY.TICK\" };\n}\nexport type QwSwiperMachine = Machine<QwSwiperSchema>;\nexport type QwSwiperService = Service<QwSwiperSchema>;\nconst ids = (scope: QwSwiperService[\"scope\"]) => ({ root: `swiper:${scope.id}`, viewport: `swiper:${scope.id}:viewport`, track: `swiper:${scope.id}:track` });\nconst live = (service: Pick<QwSwiperService, \"prop\">): ResolvedSwiperState => resolveSwiperState({\n count: service.prop(\"count\"), loop: service.prop(\"loop\"), direction: service.prop(\"direction\"), allowTouchMove: service.prop(\"allowTouchMove\"),\n label: service.prop(\"label\"), slideLabelTemplate: service.prop(\"slideLabelTemplate\"), indicator: service.prop(\"indicator\"), indicatorTone: service.prop(\"indicatorTone\"),\n navigation: service.prop(\"navigation\"), prevLabel: service.prop(\"prevLabel\"), nextLabel: service.prop(\"nextLabel\"),\n autoplay: service.prop(\"autoplay\"), autoplayInterval: service.prop(\"autoplayInterval\"), pauseLabel: service.prop(\"pauseLabel\"), playLabel: service.prop(\"playLabel\"),\n});\ntype Ctx = Pick<QwSwiperService, \"prop\"> & { context: Pick<QwSwiperService[\"context\"], \"get\"> };\n/** Rotation is armed (autoplay on, not stopped by the user, more than one slide). */\nconst rotating = (params: Ctx): boolean => { const state = live(params); return state.autoplay && state.count > 1 && !params.context.get(\"stopped\"); };\n/** Armed and not paused by hover, focus or a drag. */\nconst running = (params: Ctx): boolean => rotating(params) && !params.context.get(\"hovered\") && !params.context.get(\"focused\") && !params.context.get(\"dragging\");\n\n/** Core owns paging, gestures, measurement, autoplay timers and cleanup; adapters only render parts. */\nexport const swiperMachine: QwSwiperMachine = createMachine<QwSwiperSchema>({\n props: ({ props }) => createSwiperProps(props), initialState: () => \"ready\", states: { ready: {} },\n context: ({ bindable, prop }) => ({\n index: bindable(() => ({ defaultValue: prop(\"defaultIndex\") ?? 0, value: prop(\"index\"), onChange(index) { prop(\"onIndexChange\")?.({ index }); } })),\n offset: bindable(() => ({ defaultValue: 0 })), dragging: bindable(() => ({ defaultValue: false })), size: bindable(() => ({ defaultValue: 0 })),\n rtl: bindable(() => ({ defaultValue: false })), hovered: bindable(() => ({ defaultValue: false })), focused: bindable(() => ({ defaultValue: false })),\n stopped: bindable(() => ({ defaultValue: false })),\n }),\n refs: () => ({ reschedule: null }),\n watch({ track, prop, context, action }) {\n track([() => prop(\"count\")], () => action([\"clampIndex\"]));\n track([() => context.get(\"index\"), () => context.get(\"hovered\"), () => context.get(\"focused\"), () => context.get(\"dragging\"), () => context.get(\"stopped\"),\n () => prop(\"autoplay\"), () => prop(\"autoplayInterval\"), () => prop(\"count\"), () => prop(\"loop\")], () => action([\"reschedule\"]));\n },\n on: {\n \"INDEX.SET\": { actions: [\"setIndex\"] }, STEP: { actions: [\"step\"] }, \"DRAG.MOVE\": { actions: [\"dragMove\"] }, \"DRAG.END\": { actions: [\"dragEnd\"] },\n MEASURE: { actions: [\"measure\"] }, \"HOVER.SET\": { actions: [\"setHovered\"] }, \"FOCUS.SET\": { actions: [\"setFocused\"] },\n \"AUTOPLAY.TOGGLE\": { actions: [\"toggleAutoplay\"] }, \"AUTOPLAY.STOP\": { actions: [\"setStopped\"] }, \"AUTOPLAY.TICK\": { actions: [\"tick\"] },\n },\n effects: [\"trackGestures\", \"autoplay\"],\n implementations: {\n actions: {\n setIndex({ event, context, prop }) {\n if (event.type !== \"INDEX.SET\") return;\n const state = live({ prop });\n if (!state.count) return;\n const next = clampSwiperIndex(state, event.value);\n if (next !== clampSwiperIndex(state, context.get(\"index\"))) context.set(\"index\", next);\n },\n step({ event, context, prop }) {\n if (event.type !== \"STEP\") return;\n const state = live({ prop }), current = clampSwiperIndex(state, context.get(\"index\")), next = stepSwiperIndex(state, current, event.delta);\n if (next !== current) context.set(\"index\", next);\n },\n dragMove({ event, context }) { if (event.type === \"DRAG.MOVE\") { context.set(\"dragging\", true); context.set(\"offset\", event.offset); } },\n dragEnd({ event, context, prop }) {\n if (event.type !== \"DRAG.END\") return;\n context.set(\"dragging\", false); context.set(\"offset\", 0);\n if (!event.intent) return;\n const state = live({ prop }), current = clampSwiperIndex(state, context.get(\"index\")), next = stepSwiperIndex(state, current, event.intent);\n if (next !== current) context.set(\"index\", next);\n },\n measure({ event, context }) { if (event.type === \"MEASURE\") { context.set(\"size\", event.size); context.set(\"rtl\", event.rtl); } },\n setHovered({ event, context }) { if (event.type === \"HOVER.SET\") context.set(\"hovered\", event.value); },\n setFocused({ event, context }) { if (event.type === \"FOCUS.SET\") context.set(\"focused\", event.value); },\n toggleAutoplay({ context }) { context.set(\"stopped\", !context.get(\"stopped\")); },\n setStopped({ context }) { context.set(\"stopped\", true); },\n tick(params) {\n if (!running(params)) return;\n const state = live(params), current = clampSwiperIndex(state, params.context.get(\"index\"));\n // Without loop the rotation ends on the last slide instead of jumping back.\n if (!state.loop && current >= state.count - 1) return;\n params.context.set(\"index\", stepSwiperIndex(state, current, 1));\n },\n clampIndex({ context, prop }) {\n const state = live({ prop }), current = context.get(\"index\");\n if (state.count && current > state.count - 1) context.set(\"index\", state.count - 1);\n },\n reschedule({ refs }) { refs.get(\"reschedule\")?.(); },\n },\n effects: {\n trackGestures({ scope, prop, context, send }) {\n const root = scope.getById<HTMLElement>(ids(scope).root), viewport = scope.getById<HTMLElement>(ids(scope).viewport), win = viewport?.ownerDocument.defaultView;\n if (!root || !viewport || !win) return;\n const vertical = () => live({ prop }).direction === \"vertical\";\n const measure = () => {\n const size = vertical() ? viewport.clientHeight : viewport.clientWidth, rtl = win.getComputedStyle(viewport).direction === \"rtl\";\n if (size !== context.get(\"size\") || rtl !== context.get(\"rtl\")) send({ type: \"MEASURE\", size, rtl });\n };\n if (live({ prop }).autoplay && win.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) send({ type: \"AUTOPLAY.STOP\" });\n let gesture: { id: number; x: number; y: number; axis: GestureAxis; rtl: boolean; samples: GestureSample[]; captured: boolean } | null = null;\n let suppressClick = false;\n const progressOf = (dx: number, dy: number, rtl: boolean) => vertical() ? -dy : rtl ? dx : -dx;\n const onDown = (event: PointerEvent) => {\n const state = live({ prop });\n gesture = null;\n if (!state.allowTouchMove || state.count < 2 || (event.pointerType === \"mouse\" && event.button !== 0)) return;\n const rtl = win.getComputedStyle(viewport).direction === \"rtl\";\n gesture = { id: event.pointerId, x: event.clientX, y: event.clientY, axis: \"pending\", rtl, samples: [], captured: false };\n suppressClick = false; measure();\n };\n const onMove = (event: PointerEvent) => {\n if (!gesture || event.pointerId !== gesture.id) return;\n const dx = event.clientX - gesture.x, dy = event.clientY - gesture.y;\n if (gesture.axis === \"pending\") gesture.axis = lockGestureAxis(dx, dy, vertical());\n if (gesture.axis === \"cross\") { gesture = null; return; }\n if (gesture.axis !== \"main\") return;\n if (!gesture.captured) { gesture.captured = true; try { viewport.setPointerCapture?.(event.pointerId); } catch { /* pointer already released */ } }\n const progress = progressOf(dx, dy, gesture.rtl);\n gesture.samples.push({ position: progress, time: event.timeStamp });\n send({ type: \"DRAG.MOVE\", offset: resolveSwiperDragOffset(live({ prop }), context.get(\"index\"), vertical() ? dy : dx, progress) });\n };\n const onUp = (event: PointerEvent) => {\n if (!gesture || event.pointerId !== gesture.id) return;\n const done = gesture; gesture = null;\n if (done.axis !== \"main\") return;\n suppressClick = true;\n const progress = progressOf(event.clientX - done.x, event.clientY - done.y, done.rtl);\n done.samples.push({ position: progress, time: event.timeStamp });\n send({ type: \"DRAG.END\", intent: resolveSwipeIntent({ distance: progress, velocity: sampleVelocity(done.samples, event.timeStamp), size: context.get(\"size\"), ratio: SWIPER_DISTANCE_RATIO }) });\n };\n const onCancel = (event: PointerEvent) => {\n if (!gesture || event.pointerId !== gesture.id) return;\n const done = gesture; gesture = null;\n if (done.axis === \"main\") send({ type: \"DRAG.END\", intent: 0 });\n };\n // A drag must not activate a link or button inside the slide it started on.\n const onClick = (event: Event) => { if (suppressClick) { suppressClick = false; event.preventDefault(); event.stopPropagation(); } };\n const onFocusIn = () => { if (!context.get(\"focused\")) send({ type: \"FOCUS.SET\", value: true }); };\n const onFocusOut = (event: FocusEvent) => { const next = event.relatedTarget as Node | null; if (!next || !root.contains(next)) send({ type: \"FOCUS.SET\", value: false }); };\n const onEnter = (event: PointerEvent) => { if (event.pointerType === \"mouse\") send({ type: \"HOVER.SET\", value: true }); };\n const onLeave = (event: PointerEvent) => { if (event.pointerType === \"mouse\") send({ type: \"HOVER.SET\", value: false }); };\n viewport.addEventListener(\"pointerdown\", onDown); viewport.addEventListener(\"pointermove\", onMove); viewport.addEventListener(\"pointerup\", onUp);\n viewport.addEventListener(\"pointercancel\", onCancel); viewport.addEventListener(\"click\", onClick, true);\n root.addEventListener(\"focusin\", onFocusIn); root.addEventListener(\"focusout\", onFocusOut);\n root.addEventListener(\"pointerenter\", onEnter); root.addEventListener(\"pointerleave\", onLeave);\n const Observer = win.ResizeObserver, observer = Observer ? new Observer(measure) : null;\n observer?.observe(viewport); win.addEventListener(\"resize\", measure); measure();\n return () => {\n gesture = null; observer?.disconnect(); win.removeEventListener(\"resize\", measure);\n viewport.removeEventListener(\"pointerdown\", onDown); viewport.removeEventListener(\"pointermove\", onMove); viewport.removeEventListener(\"pointerup\", onUp);\n viewport.removeEventListener(\"pointercancel\", onCancel); viewport.removeEventListener(\"click\", onClick, true);\n root.removeEventListener(\"focusin\", onFocusIn); root.removeEventListener(\"focusout\", onFocusOut);\n root.removeEventListener(\"pointerenter\", onEnter); root.removeEventListener(\"pointerleave\", onLeave);\n };\n },\n autoplay({ prop, context, send, refs }) {\n let timer: ReturnType<typeof setTimeout> | undefined, disposed = false;\n const schedule = () => {\n if (timer !== undefined) { clearTimeout(timer); timer = undefined; }\n if (disposed || !running({ prop, context })) return;\n timer = setTimeout(() => { timer = undefined; send({ type: \"AUTOPLAY.TICK\" }); }, live({ prop }).autoplayInterval);\n };\n refs.set(\"reschedule\", schedule); schedule();\n return () => { disposed = true; refs.set(\"reschedule\", null); if (timer !== undefined) clearTimeout(timer); };\n },\n },\n },\n});\n\nexport interface QwSwiperApi<T extends PropTypes = PropTypes> {\n index: number; count: number; dragging: boolean; direction: SwiperDirection;\n /** Autoplay is armed (not stopped by the user). */\n autoplaying: boolean;\n slides: SwiperSlide[];\n /** Ready-made PageIndicator input; adapters spread it on the shared PageIndicator component/element. */\n indicatorProps: QwPageIndicatorProps;\n autoplayToggleLabel: string;\n swipeTo(index: number): void; swipeNext(): void; swipePrev(): void; toggleAutoplay(): void;\n getRootProps(): T[\"element\"];\n getViewportProps(): T[\"element\"];\n getTrackProps(): T[\"element\"];\n getSlideProps(slide: SwiperSlide): T[\"element\"];\n getPrevProps(): T[\"button\"];\n getNextProps(): T[\"button\"];\n getAutoplayToggleProps(): T[\"button\"];\n getIndicatorProps(): T[\"element\"];\n getPrevIconState(): IconState;\n getNextIconState(): IconState;\n getAutoplayIconState(): IconState;\n}\nexport interface SwiperDomEvent { key: string; target: unknown; currentTarget: unknown; defaultPrevented: boolean; preventDefault(): void }\ntype SwiperCallerHandler = (event: SwiperDomEvent) => void;\nexport interface SwiperConnectOptions { onKeyDown?(event: SwiperDomEvent): void }\nconst callKeyDown = (handler: unknown, event: SwiperDomEvent) => {\n for (const item of Array.isArray(handler) ? handler : [handler]) if (typeof item === \"function\") (item as SwiperCallerHandler)(event);\n};\n\nexport function connectSwiper<T extends PropTypes>(service: QwSwiperService, normalize: NormalizeProps<T>, options: SwiperConnectOptions = {}): QwSwiperApi<T> {\n const state = live(service), id = ids(service.scope), index = clampSwiperIndex(state, service.context.get(\"index\"));\n const dragging = service.context.get(\"dragging\"), offset = service.context.get(\"offset\"), rtl = service.context.get(\"rtl\");\n const armed = rotating(service), active = running(service), vertical = state.direction === \"vertical\";\n const swipeTo = (value: number) => service.send({ type: \"INDEX.SET\", value });\n const swipeNext = () => service.send({ type: \"STEP\", delta: 1 }), swipePrev = () => service.send({ type: \"STEP\", delta: -1 });\n const toggleAutoplay = () => service.send({ type: \"AUTOPLAY.TOGGLE\" });\n const part = (name: string) => ({ \"data-scope\": \"swiper\", \"data-part\": name });\n const atStart = !state.loop && index === 0, atEnd = !state.loop && index >= state.count - 1;\n const keys: Record<string, () => void> = {\n [vertical ? \"ArrowUp\" : rtl ? \"ArrowRight\" : \"ArrowLeft\"]: swipePrev,\n [vertical ? \"ArrowDown\" : rtl ? \"ArrowLeft\" : \"ArrowRight\"]: swipeNext,\n Home: () => swipeTo(0), End: () => swipeTo(state.count - 1),\n };\n const toggleLabel = armed ? state.pauseLabel : state.playLabel;\n return {\n index, count: state.count, dragging, direction: state.direction, autoplaying: armed,\n slides: getSwiperSlides(state, index), autoplayToggleLabel: toggleLabel,\n indicatorProps: { total: state.count, current: index, tone: state.indicatorTone, direction: vertical ? \"vertical\" : \"horizontal\" },\n swipeTo, swipeNext, swipePrev, toggleAutoplay,\n getRootProps: () => normalize.element({ ...part(\"root\"), id: id.root, role: \"region\", \"aria-roledescription\": \"carousel\", \"aria-label\": state.label, tabIndex: 0,\n \"data-direction\": state.direction, \"data-dragging\": dragging ? \"true\" : undefined, \"data-empty\": state.count ? undefined : \"true\",\n onKeyDown(event: SwiperDomEvent) {\n callKeyDown(options.onKeyDown, event);\n // Only the focused region itself pages; keys inside slide content stay with that content.\n if (event.defaultPrevented || event.target !== event.currentTarget) return;\n const run = keys[event.key];\n if (run && state.count > 1) { event.preventDefault(); run(); }\n } }),\n getViewportProps: () => normalize.element({ ...part(\"viewport\"), id: id.viewport, \"data-direction\": state.direction, \"data-touch\": state.allowTouchMove ? \"true\" : undefined }),\n getTrackProps: () => normalize.element({ ...part(\"track\"), id: id.track, \"aria-live\": active ? \"off\" : \"polite\", \"aria-atomic\": false, \"data-direction\": state.direction, \"data-dragging\": dragging ? \"true\" : undefined,\n style: { \"--qw-swiper-index\": String(index), \"--qw-swiper-offset\": `${offset}px` } }),\n getSlideProps: (slide) => normalize.element({ ...part(\"slide\"), id: `swiper:${service.scope.id}:slide:${slide.index}`, role: \"group\", \"aria-roledescription\": \"slide\", \"aria-label\": slide.label,\n \"data-index\": slide.index, \"data-current\": slide.current ? \"true\" : undefined, \"aria-hidden\": slide.current ? undefined : true, inert: slide.current ? undefined : true }),\n getPrevProps: () => normalize.button({ ...part(\"prev\"), type: \"button\", \"aria-label\": state.prevLabel, \"aria-controls\": id.track, hidden: !state.navigation || undefined, disabled: atStart || state.count < 2,\n onClick(event: { defaultPrevented: boolean }) { if (!event.defaultPrevented) swipePrev(); } }),\n getNextProps: () => normalize.button({ ...part(\"next\"), type: \"button\", \"aria-label\": state.nextLabel, \"aria-controls\": id.track, hidden: !state.navigation || undefined, disabled: atEnd || state.count < 2,\n onClick(event: { defaultPrevented: boolean }) { if (!event.defaultPrevented) swipeNext(); } }),\n getAutoplayToggleProps: () => normalize.button({ ...part(\"autoplay-toggle\"), type: \"button\", \"aria-label\": toggleLabel, \"aria-controls\": id.track, hidden: !state.autoplay || undefined,\n \"data-state\": armed ? \"playing\" : \"stopped\", onClick(event: { defaultPrevented: boolean }) { if (!event.defaultPrevented) toggleAutoplay(); } }),\n getIndicatorProps: () => normalize.element({ ...part(\"indicator\"), \"aria-hidden\": true, hidden: !state.indicator || state.count < 2 || undefined, \"data-direction\": state.direction }),\n getPrevIconState: () => resolveIconState({ id: `${id.root}:prev-icon`, name: vertical ? \"up\" : \"left\" }),\n getNextIconState: () => resolveIconState({ id: `${id.root}:next-icon`, name: vertical ? \"down\" : \"right\" }),\n getAutoplayIconState: () => resolveIconState({ id: `${id.root}:autoplay-icon`, name: armed ? \"pause\" : \"play-fill\" }),\n };\n}\n"],"mappings":";;;;;AAOA,MAAa,oBAAoB,CAAC,cAAc,UAAU;;AAE1D,MAAa,eAAe;CAAC;CAAQ;CAA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