@xihan-ui/vue 2.1.0 → 3.0.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/CHANGELOG.md +1335 -0
- package/README.md +1 -1
- package/dist/components/accordion/accordion.d.ts +6 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +4 -2
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert/alert.d.ts +9 -0
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +4 -0
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/anchor/anchor.d.ts +2 -2
- package/dist/components/anchor/anchor.d.ts.map +1 -1
- package/dist/components/anchor/anchor.js +2 -2
- package/dist/components/anchor/anchor.js.map +1 -1
- package/dist/components/anchor/use-anchor.d.ts +2 -2
- package/dist/components/anchor/use-anchor.js +3 -3
- package/dist/components/anchor/use-anchor.js.map +1 -1
- package/dist/components/approval/approval.d.ts +8 -1
- package/dist/components/approval/approval.d.ts.map +1 -1
- package/dist/components/approval/approval.js +10 -1
- package/dist/components/approval/approval.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +8 -0
- package/dist/components/avatar/avatar.d.ts.map +1 -1
- package/dist/components/avatar/avatar.js +3 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/avatar/use-avatar.d.ts.map +1 -1
- package/dist/components/avatar/use-avatar.js +3 -1
- package/dist/components/avatar/use-avatar.js.map +1 -1
- package/dist/components/back-top/use-back-top.d.ts.map +1 -1
- package/dist/components/back-top/use-back-top.js +3 -1
- package/dist/components/back-top/use-back-top.js.map +1 -1
- package/dist/components/badge/badge.d.ts +22 -0
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +11 -2
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +11 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +28 -9
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/calendar-picker/calendar-picker.d.ts +16 -0
- package/dist/components/calendar-picker/calendar-picker.d.ts.map +1 -1
- package/dist/components/calendar-picker/calendar-picker.js +4 -0
- package/dist/components/calendar-picker/calendar-picker.js.map +1 -1
- package/dist/components/calendar-range-picker/calendar-range-picker.d.ts +16 -0
- package/dist/components/calendar-range-picker/calendar-range-picker.d.ts.map +1 -1
- package/dist/components/calendar-range-picker/calendar-range-picker.js +4 -0
- package/dist/components/calendar-range-picker/calendar-range-picker.js.map +1 -1
- package/dist/components/card/card.d.ts +37 -2
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +40 -2
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/carousel/carousel.d.ts +7 -1
- package/dist/components/carousel/carousel.d.ts.map +1 -1
- package/dist/components/carousel/carousel.js +1 -0
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/carousel/use-carousel.d.ts.map +1 -1
- package/dist/components/carousel/use-carousel.js +3 -1
- package/dist/components/carousel/use-carousel.js.map +1 -1
- package/dist/components/cartesian-chart/cartesian-chart.d.ts +262 -0
- package/dist/components/cartesian-chart/cartesian-chart.d.ts.map +1 -0
- package/dist/components/cartesian-chart/cartesian-chart.js +293 -0
- package/dist/components/cartesian-chart/cartesian-chart.js.map +1 -0
- package/dist/components/cartesian-chart/context.js +15 -0
- package/dist/components/cartesian-chart/context.js.map +1 -0
- package/dist/components/cartesian-chart/use-cartesian-chart.d.ts +21 -0
- package/dist/components/cartesian-chart/use-cartesian-chart.d.ts.map +1 -0
- package/dist/components/cartesian-chart/use-cartesian-chart.js +29 -0
- package/dist/components/cartesian-chart/use-cartesian-chart.js.map +1 -0
- package/dist/components/cascader/cascader.d.ts +64 -3
- package/dist/components/cascader/cascader.d.ts.map +1 -1
- package/dist/components/cascader/cascader.js +107 -7
- package/dist/components/cascader/cascader.js.map +1 -1
- package/dist/components/cascader/context.js +10 -1
- package/dist/components/cascader/context.js.map +1 -1
- package/dist/components/cascader/use-cascader.d.ts +2 -1
- package/dist/components/cascader/use-cascader.d.ts.map +1 -1
- package/dist/components/cascader/use-cascader.js +4 -1
- package/dist/components/cascader/use-cascader.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +24 -3
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +20 -3
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/citation/citation.d.ts +211 -0
- package/dist/components/citation/citation.d.ts.map +1 -0
- package/dist/components/citation/citation.js +222 -0
- package/dist/components/citation/citation.js.map +1 -0
- package/dist/components/citation/context.d.ts +11 -0
- package/dist/components/citation/context.d.ts.map +1 -0
- package/dist/components/citation/context.js +24 -0
- package/dist/components/citation/context.js.map +1 -0
- package/dist/components/citation/use-citation.d.ts +19 -0
- package/dist/components/citation/use-citation.d.ts.map +1 -0
- package/dist/components/citation/use-citation.js +51 -0
- package/dist/components/citation/use-citation.js.map +1 -0
- package/dist/components/code-view/code-view.d.ts +21 -0
- package/dist/components/code-view/code-view.d.ts.map +1 -1
- package/dist/components/code-view/code-view.js +23 -4
- package/dist/components/code-view/code-view.js.map +1 -1
- package/dist/components/collapsible/collapsible.d.ts +6 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.js +4 -2
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-field/color-field.d.ts +2 -2
- package/dist/components/color-field/color-field.js +1 -1
- package/dist/components/color-field/color-field.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +41 -3
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +33 -4
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/use-color-picker.d.ts +3 -1
- package/dist/components/color-picker/use-color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/use-color-picker.js +8 -2
- package/dist/components/color-picker/use-color-picker.js.map +1 -1
- package/dist/components/color-slider/color-slider.d.ts +2 -2
- package/dist/components/color-slider/color-slider.js +1 -1
- package/dist/components/color-slider/color-slider.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +49 -4
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +73 -5
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/combobox/context.js +10 -1
- package/dist/components/combobox/context.js.map +1 -1
- package/dist/components/command/command.js +2 -2
- package/dist/components/command/use-command.d.ts.map +1 -1
- package/dist/components/command/use-command.js +9 -30
- package/dist/components/command/use-command.js.map +1 -1
- package/dist/components/context-menu/context-menu.d.ts +50 -18
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +101 -47
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context.js +1 -1
- package/dist/components/context-menu/context.js.map +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/use-context-menu.js +4 -2
- package/dist/components/context-menu/use-context-menu.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts +9 -1
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +2 -0
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +41 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +16 -3
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +77 -2
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +102 -5
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/use-date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker/use-date-range-picker.js.map +1 -1
- package/dist/components/descriptions/descriptions.d.ts +38 -7
- package/dist/components/descriptions/descriptions.d.ts.map +1 -1
- package/dist/components/descriptions/descriptions.js +38 -4
- package/dist/components/descriptions/descriptions.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +16 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +15 -2
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/dialog/use-dialog.js +9 -27
- package/dist/components/dialog/use-dialog.js.map +1 -1
- package/dist/components/diff-view/diff-view.d.ts +22 -2
- package/dist/components/diff-view/diff-view.d.ts.map +1 -1
- package/dist/components/diff-view/diff-view.js +37 -14
- package/dist/components/diff-view/diff-view.js.map +1 -1
- package/dist/components/diff-view/use-diff-view.d.ts +7 -2
- package/dist/components/diff-view/use-diff-view.d.ts.map +1 -1
- package/dist/components/diff-view/use-diff-view.js +12 -5
- package/dist/components/diff-view/use-diff-view.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +46 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +28 -4
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/use-drawer.d.ts +1 -1
- package/dist/components/drawer/use-drawer.d.ts.map +1 -1
- package/dist/components/drawer/use-drawer.js +12 -29
- package/dist/components/drawer/use-drawer.js.map +1 -1
- package/dist/components/empty-state/empty-state.js +4 -1
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/use-empty-state.js +12 -3
- package/dist/components/empty-state/use-empty-state.js.map +1 -1
- package/dist/components/field/field.js +1 -1
- package/dist/components/field-array/field-array.d.ts +1 -1
- package/dist/components/field-array/field-array.d.ts.map +1 -1
- package/dist/components/field-array/field-array.js +5 -1
- package/dist/components/field-array/field-array.js.map +1 -1
- package/dist/components/field-array/use-field-array.d.ts +3 -1
- package/dist/components/field-array/use-field-array.d.ts.map +1 -1
- package/dist/components/field-array/use-field-array.js +5 -2
- package/dist/components/field-array/use-field-array.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +24 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +12 -2
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/file-upload/use-file-upload.d.ts +1 -1
- package/dist/components/file-upload/use-file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/use-file-upload.js.map +1 -1
- package/dist/components/flex/flex.d.ts +1 -1
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/flex.js +4 -4
- package/dist/components/flex/flex.js.map +1 -1
- package/dist/components/form/form.d.ts +18 -4
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +21 -7
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/use-form.d.ts +6 -0
- package/dist/components/form/use-form.d.ts.map +1 -1
- package/dist/components/form/use-form.js +4 -0
- package/dist/components/form/use-form.js.map +1 -1
- package/dist/components/funnel-chart/context.js +15 -0
- package/dist/components/funnel-chart/context.js.map +1 -0
- package/dist/components/funnel-chart/funnel-chart.d.ts +175 -0
- package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -0
- package/dist/components/funnel-chart/funnel-chart.js +188 -0
- package/dist/components/funnel-chart/funnel-chart.js.map +1 -0
- package/dist/components/funnel-chart/use-funnel-chart.d.ts +19 -0
- package/dist/components/funnel-chart/use-funnel-chart.d.ts.map +1 -0
- package/dist/components/funnel-chart/use-funnel-chart.js +26 -0
- package/dist/components/funnel-chart/use-funnel-chart.js.map +1 -0
- package/dist/components/graph-chart/context.js +15 -0
- package/dist/components/graph-chart/context.js.map +1 -0
- package/dist/components/graph-chart/graph-chart.d.ts +194 -0
- package/dist/components/graph-chart/graph-chart.d.ts.map +1 -0
- package/dist/components/graph-chart/graph-chart.js +219 -0
- package/dist/components/graph-chart/graph-chart.js.map +1 -0
- package/dist/components/graph-chart/use-graph-chart.d.ts +19 -0
- package/dist/components/graph-chart/use-graph-chart.d.ts.map +1 -0
- package/dist/components/graph-chart/use-graph-chart.js +26 -0
- package/dist/components/graph-chart/use-graph-chart.js.map +1 -0
- package/dist/components/grid/grid.d.ts +7 -0
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +7 -1
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid-list/context.d.ts +9 -0
- package/dist/components/grid-list/context.d.ts.map +1 -0
- package/dist/components/grid-list/context.js +24 -0
- package/dist/components/grid-list/context.js.map +1 -0
- package/dist/components/grid-list/grid-list.d.ts +149 -0
- package/dist/components/grid-list/grid-list.d.ts.map +1 -0
- package/dist/components/grid-list/grid-list.js +118 -0
- package/dist/components/grid-list/grid-list.js.map +1 -0
- package/dist/components/grid-list/use-grid-list.d.ts +12 -0
- package/dist/components/grid-list/use-grid-list.d.ts.map +1 -0
- package/dist/components/grid-list/use-grid-list.js +20 -0
- package/dist/components/grid-list/use-grid-list.js.map +1 -0
- package/dist/components/heatmap/heatmap.d.ts +45 -4
- package/dist/components/heatmap/heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap.js +40 -14
- package/dist/components/heatmap/heatmap.js.map +1 -1
- package/dist/components/heatmap/use-heatmap.d.ts +4 -2
- package/dist/components/heatmap/use-heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/use-heatmap.js +8 -4
- package/dist/components/heatmap/use-heatmap.js.map +1 -1
- package/dist/components/hierarchy-chart/context.js +15 -0
- package/dist/components/hierarchy-chart/context.js.map +1 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.d.ts +201 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.d.ts.map +1 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.js +228 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.js.map +1 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.d.ts +19 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.d.ts.map +1 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.js +26 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.js.map +1 -0
- package/dist/components/hover-card/hover-card.js +2 -2
- package/dist/components/icon/icon.d.ts +7 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +1 -0
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/image/use-image.d.ts.map +1 -1
- package/dist/components/image/use-image.js +3 -1
- package/dist/components/image/use-image.js.map +1 -1
- package/dist/components/image-cropper/image-cropper.d.ts +35 -4
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -1
- package/dist/components/image-cropper/image-cropper.js +34 -5
- package/dist/components/image-cropper/image-cropper.js.map +1 -1
- package/dist/components/image-cropper/use-image-cropper.d.ts +3 -1
- package/dist/components/image-cropper/use-image-cropper.d.ts.map +1 -1
- package/dist/components/image-cropper/use-image-cropper.js +4 -1
- package/dist/components/image-cropper/use-image-cropper.js.map +1 -1
- package/dist/components/image-viewer/image-viewer.js +1 -1
- package/dist/components/image-viewer/use-image-viewer.d.ts.map +1 -1
- package/dist/components/image-viewer/use-image-viewer.js +9 -27
- package/dist/components/image-viewer/use-image-viewer.js.map +1 -1
- package/dist/components/infinite-scroll/infinite-scroll.d.ts +9 -1
- package/dist/components/infinite-scroll/infinite-scroll.d.ts.map +1 -1
- package/dist/components/infinite-scroll/infinite-scroll.js +2 -0
- package/dist/components/infinite-scroll/infinite-scroll.js.map +1 -1
- package/dist/components/json-viewer/json-viewer.d.ts +17 -2
- package/dist/components/json-viewer/json-viewer.d.ts.map +1 -1
- package/dist/components/json-viewer/json-viewer.js +26 -8
- package/dist/components/json-viewer/json-viewer.js.map +1 -1
- package/dist/components/listbox/listbox.d.ts +7 -1
- package/dist/components/listbox/listbox.d.ts.map +1 -1
- package/dist/components/listbox/listbox.js +2 -0
- package/dist/components/listbox/listbox.js.map +1 -1
- package/dist/components/loading-bar/use-loading-bar.d.ts.map +1 -1
- package/dist/components/loading-bar/use-loading-bar.js +3 -1
- package/dist/components/loading-bar/use-loading-bar.js.map +1 -1
- package/dist/components/log/log.d.ts +41 -2
- package/dist/components/log/log.d.ts.map +1 -1
- package/dist/components/log/log.js +25 -3
- package/dist/components/log/log.js.map +1 -1
- package/dist/components/log/use-log.d.ts +1 -1
- package/dist/components/log/use-log.d.ts.map +1 -1
- package/dist/components/log/use-log.js +4 -1
- package/dist/components/log/use-log.js.map +1 -1
- package/dist/components/markdown-stream/markdown-stream.d.ts +22 -2
- package/dist/components/markdown-stream/markdown-stream.d.ts.map +1 -1
- package/dist/components/markdown-stream/markdown-stream.js +43 -4
- package/dist/components/markdown-stream/markdown-stream.js.map +1 -1
- package/dist/components/marquee/marquee.d.ts +68 -12
- package/dist/components/marquee/marquee.d.ts.map +1 -1
- package/dist/components/marquee/marquee.js +52 -7
- package/dist/components/marquee/marquee.js.map +1 -1
- package/dist/components/mention/mention.d.ts +26 -6
- package/dist/components/mention/mention.d.ts.map +1 -1
- package/dist/components/mention/mention.js +14 -4
- package/dist/components/mention/mention.js.map +1 -1
- package/dist/components/menu/context.js +1 -1
- package/dist/components/menu/context.js.map +1 -1
- package/dist/components/menu/menu.d.ts +79 -28
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +104 -51
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menu/use-menu.d.ts +1 -1
- package/dist/components/menu/use-menu.d.ts.map +1 -1
- package/dist/components/menu/use-menu.js +8 -6
- package/dist/components/menu/use-menu.js.map +1 -1
- package/dist/components/menubar/context.js +1 -1
- package/dist/components/menubar/context.js.map +1 -1
- package/dist/components/menubar/menubar.d.ts +39 -18
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +96 -47
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/menubar/use-menubar.d.ts +1 -1
- package/dist/components/menubar/use-menubar.d.ts.map +1 -1
- package/dist/components/menubar/use-menubar.js +4 -2
- package/dist/components/menubar/use-menubar.js.map +1 -1
- package/dist/components/message-feed/message-feed.d.ts +13 -1
- package/dist/components/message-feed/message-feed.d.ts.map +1 -1
- package/dist/components/message-feed/message-feed.js +25 -1
- package/dist/components/message-feed/message-feed.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +58 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +82 -10
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/notification/context.d.ts +5 -1
- package/dist/components/notification/context.d.ts.map +1 -1
- package/dist/components/notification/context.js.map +1 -1
- package/dist/components/notification/notification.d.ts +39 -23
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/notification/notification.js +27 -9
- package/dist/components/notification/notification.js.map +1 -1
- package/dist/components/notification/use-item-exit.js +22 -0
- package/dist/components/notification/use-item-exit.js.map +1 -0
- package/dist/components/notification/use-notification.d.ts +3 -3
- package/dist/components/notification/use-notification.d.ts.map +1 -1
- package/dist/components/notification/use-notification.js +20 -5
- package/dist/components/notification/use-notification.js.map +1 -1
- package/dist/components/number-animation/number-animation.d.ts +14 -2
- package/dist/components/number-animation/number-animation.d.ts.map +1 -1
- package/dist/components/number-animation/number-animation.js +5 -1
- package/dist/components/number-animation/number-animation.js.map +1 -1
- package/dist/components/number-field/number-field.d.ts +16 -1
- package/dist/components/number-field/number-field.d.ts.map +1 -1
- package/dist/components/number-field/number-field.js +6 -0
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts +22 -2
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +22 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.js +1 -0
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/pie-chart/context.js +15 -0
- package/dist/components/pie-chart/context.js.map +1 -0
- package/dist/components/pie-chart/pie-chart.d.ts +203 -0
- package/dist/components/pie-chart/pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/pie-chart.js +236 -0
- package/dist/components/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/pie-chart/use-pie-chart.d.ts +19 -0
- package/dist/components/pie-chart/use-pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/use-pie-chart.js +26 -0
- package/dist/components/pie-chart/use-pie-chart.js.map +1 -0
- package/dist/components/popconfirm/popconfirm.js +2 -2
- package/dist/components/popover/popover.d.ts +11 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +7 -2
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.d.ts +63 -3
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +55 -3
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/question-flow/question-flow.d.ts +40 -1
- package/dist/components/question-flow/question-flow.d.ts.map +1 -1
- package/dist/components/question-flow/question-flow.js +37 -1
- package/dist/components/question-flow/question-flow.js.map +1 -1
- package/dist/components/radar-chart/context.js +15 -0
- package/dist/components/radar-chart/context.js.map +1 -0
- package/dist/components/radar-chart/radar-chart.d.ts +189 -0
- package/dist/components/radar-chart/radar-chart.d.ts.map +1 -0
- package/dist/components/radar-chart/radar-chart.js +220 -0
- package/dist/components/radar-chart/radar-chart.js.map +1 -0
- package/dist/components/radar-chart/use-radar-chart.d.ts +19 -0
- package/dist/components/radar-chart/use-radar-chart.d.ts.map +1 -0
- package/dist/components/radar-chart/use-radar-chart.js +26 -0
- package/dist/components/radar-chart/use-radar-chart.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +37 -2
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +54 -8
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/use-radio-group.d.ts +3 -1
- package/dist/components/radio-group/use-radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/use-radio-group.js +7 -3
- package/dist/components/radio-group/use-radio-group.js.map +1 -1
- package/dist/components/reasoning/reasoning.d.ts +1 -1
- package/dist/components/reasoning/reasoning.d.ts.map +1 -1
- package/dist/components/reasoning/reasoning.js +1 -0
- package/dist/components/reasoning/reasoning.js.map +1 -1
- package/dist/components/sankey-chart/context.js +15 -0
- package/dist/components/sankey-chart/context.js.map +1 -0
- package/dist/components/sankey-chart/sankey-chart.d.ts +161 -0
- package/dist/components/sankey-chart/sankey-chart.d.ts.map +1 -0
- package/dist/components/sankey-chart/sankey-chart.js +208 -0
- package/dist/components/sankey-chart/sankey-chart.js.map +1 -0
- package/dist/components/sankey-chart/use-sankey-chart.d.ts +19 -0
- package/dist/components/sankey-chart/use-sankey-chart.d.ts.map +1 -0
- package/dist/components/sankey-chart/use-sankey-chart.js +26 -0
- package/dist/components/sankey-chart/use-sankey-chart.js.map +1 -0
- package/dist/components/scroll-area/scroll-area.d.ts +13 -5
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +17 -3
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/select/select.d.ts +7 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +13 -4
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/use-select.js +2 -1
- package/dist/components/select/use-select.js.map +1 -1
- package/dist/components/side-nav/context.js +17 -1
- package/dist/components/side-nav/context.js.map +1 -1
- package/dist/components/side-nav/side-nav.d.ts +51 -7
- package/dist/components/side-nav/side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/side-nav.js +152 -13
- package/dist/components/side-nav/side-nav.js.map +1 -1
- package/dist/components/side-nav/use-side-nav.d.ts +4 -2
- package/dist/components/side-nav/use-side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/use-side-nav.js +5 -3
- package/dist/components/side-nav/use-side-nav.js.map +1 -1
- package/dist/components/signature-pad/signature-pad.d.ts +26 -4
- package/dist/components/signature-pad/signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/signature-pad.js +32 -4
- package/dist/components/signature-pad/signature-pad.js.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts +1 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.js.map +1 -1
- package/dist/components/skeleton/use-skeleton.js +6 -2
- package/dist/components/skeleton/use-skeleton.js.map +1 -1
- package/dist/components/slider/slider.d.ts +27 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +12 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/sortable/sortable.d.ts +19 -1
- package/dist/components/sortable/sortable.d.ts.map +1 -1
- package/dist/components/sortable/sortable.js +7 -2
- package/dist/components/sortable/sortable.js.map +1 -1
- package/dist/components/sortable/use-sortable.d.ts +1 -1
- package/dist/components/sortable/use-sortable.d.ts.map +1 -1
- package/dist/components/sortable/use-sortable.js +2 -1
- package/dist/components/sortable/use-sortable.js.map +1 -1
- package/dist/components/sparkline/sparkline.d.ts +101 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -0
- package/dist/components/sparkline/sparkline.js +54 -0
- package/dist/components/sparkline/sparkline.js.map +1 -0
- package/dist/components/sparkline/use-sparkline.d.ts +15 -0
- package/dist/components/sparkline/use-sparkline.d.ts.map +1 -0
- package/dist/components/sparkline/use-sparkline.js +21 -0
- package/dist/components/sparkline/use-sparkline.js.map +1 -0
- package/dist/components/spinner/spinner.d.ts +8 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +2 -0
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/use-spinner.js +4 -2
- package/dist/components/spinner/use-spinner.js.map +1 -1
- package/dist/components/steps/steps.d.ts +28 -1
- package/dist/components/steps/steps.d.ts.map +1 -1
- package/dist/components/steps/steps.js +11 -2
- package/dist/components/steps/steps.js.map +1 -1
- package/dist/components/switch/switch.js +1 -1
- package/dist/components/table/context.js +9 -1
- package/dist/components/table/context.js.map +1 -1
- package/dist/components/table/table.d.ts +54 -5
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +40 -11
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-table.d.ts +3 -1
- package/dist/components/table/use-table.d.ts.map +1 -1
- package/dist/components/table/use-table.js +5 -2
- package/dist/components/table/use-table.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +51 -3
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +60 -8
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tag/use-tag.d.ts.map +1 -1
- package/dist/components/tag/use-tag.js +3 -1
- package/dist/components/tag/use-tag.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +10 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +11 -4
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/tags-input/use-tags-input.d.ts +4 -2
- package/dist/components/tags-input/use-tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/use-tags-input.js +5 -2
- package/dist/components/tags-input/use-tags-input.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +11 -7
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +4 -2
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.d.ts +11 -7
- package/dist/components/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.js +4 -2
- package/dist/components/time-range-picker/time-range-picker.js.map +1 -1
- package/dist/components/timer/timer.d.ts +1 -1
- package/dist/components/timestamp/timestamp.d.ts +20 -1
- package/dist/components/timestamp/timestamp.d.ts.map +1 -1
- package/dist/components/timestamp/timestamp.js +16 -5
- package/dist/components/timestamp/timestamp.js.map +1 -1
- package/dist/components/toolbar/toolbar.d.ts +17 -2
- package/dist/components/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/toolbar.js +31 -4
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/toolbar/use-toolbar.d.ts +4 -2
- package/dist/components/toolbar/use-toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/use-toolbar.js +5 -2
- package/dist/components/toolbar/use-toolbar.js.map +1 -1
- package/dist/components/tooltip/context.d.ts +21 -0
- package/dist/components/tooltip/context.d.ts.map +1 -0
- package/dist/components/tooltip/context.js +10 -1
- package/dist/components/tooltip/context.js.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +53 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +34 -3
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tooltip/use-tooltip.d.ts +3 -18
- package/dist/components/tooltip/use-tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/use-tooltip.js +2 -0
- package/dist/components/tooltip/use-tooltip.js.map +1 -1
- package/dist/components/tour/tour.d.ts +9 -1
- package/dist/components/tour/tour.d.ts.map +1 -1
- package/dist/components/tour/tour.js +2 -0
- package/dist/components/tour/tour.js.map +1 -1
- package/dist/components/transfer/transfer.d.ts +21 -1
- package/dist/components/transfer/transfer.d.ts.map +1 -1
- package/dist/components/transfer/transfer.js +10 -2
- package/dist/components/transfer/transfer.js.map +1 -1
- package/dist/components/tree/tree.d.ts +34 -1
- package/dist/components/tree/tree.d.ts.map +1 -1
- package/dist/components/tree/tree.js +11 -0
- package/dist/components/tree/tree.js.map +1 -1
- package/dist/components/tree-select/context.js +10 -1
- package/dist/components/tree-select/context.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +70 -6
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.js +109 -12
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/tree-select/use-tree-select.d.ts +3 -0
- package/dist/components/tree-select/use-tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/use-tree-select.js +6 -1
- package/dist/components/tree-select/use-tree-select.js.map +1 -1
- package/dist/components/truncate/truncate.d.ts +25 -4
- package/dist/components/truncate/truncate.d.ts.map +1 -1
- package/dist/components/truncate/truncate.js +29 -14
- package/dist/components/truncate/truncate.js.map +1 -1
- package/dist/components/truncate/use-truncate.d.ts.map +1 -1
- package/dist/components/truncate/use-truncate.js +3 -1
- package/dist/components/truncate/use-truncate.js.map +1 -1
- package/dist/components/typography/typography.d.ts +35 -2
- package/dist/components/typography/typography.d.ts.map +1 -1
- package/dist/components/typography/typography.js +21 -3
- package/dist/components/typography/typography.js.map +1 -1
- package/dist/components/virtualizer/virtualizer.d.ts +26 -2
- package/dist/components/virtualizer/virtualizer.d.ts.map +1 -1
- package/dist/components/virtualizer/virtualizer.js +20 -3
- package/dist/components/virtualizer/virtualizer.js.map +1 -1
- package/dist/components/watermark/watermark.d.ts +14 -1
- package/dist/components/watermark/watermark.d.ts.map +1 -1
- package/dist/components/watermark/watermark.js +20 -5
- package/dist/components/watermark/watermark.js.map +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +2 -1
- package/dist/config/config.js.map +1 -1
- package/dist/index.d.ts +59 -44
- package/dist/index.js +53 -38
- package/dist/package.js +1 -1
- package/dist/runtime/as-child.js +3 -2
- package/dist/runtime/as-child.js.map +1 -1
- package/dist/runtime/hydration.js +14 -0
- package/dist/runtime/hydration.js.map +1 -0
- package/dist/runtime/use-overlay-exit.js +0 -1
- package/dist/runtime/use-overlay-exit.js.map +1 -1
- package/dist/services/notification-service.d.ts +26 -7
- package/dist/services/notification-service.d.ts.map +1 -1
- package/dist/services/notification-service.js +35 -8
- package/dist/services/notification-service.js.map +1 -1
- package/dist/sound.d.ts +6 -7
- package/dist/sound.d.ts.map +1 -1
- package/dist/sound.js +6 -6
- package/dist/sound.js.map +1 -1
- package/package.json +15 -14
- package/dist/components/gradient-text/gradient-text.d.ts +0 -36
- package/dist/components/gradient-text/gradient-text.d.ts.map +0 -1
- package/dist/components/gradient-text/gradient-text.js +0 -20
- package/dist/components/gradient-text/gradient-text.js.map +0 -1
- package/dist/components/icon-wrapper/icon-wrapper.d.ts +0 -29
- package/dist/components/icon-wrapper/icon-wrapper.d.ts.map +0 -1
- package/dist/components/icon-wrapper/icon-wrapper.js +0 -20
- package/dist/components/icon-wrapper/icon-wrapper.js.map +0 -1
- package/dist/components/segmented/context.d.ts +0 -13
- package/dist/components/segmented/context.d.ts.map +0 -1
- package/dist/components/segmented/context.js +0 -24
- package/dist/components/segmented/context.js.map +0 -1
- package/dist/components/segmented/segmented.d.ts +0 -161
- package/dist/components/segmented/segmented.d.ts.map +0 -1
- package/dist/components/segmented/segmented.js +0 -142
- package/dist/components/segmented/segmented.js.map +0 -1
- package/dist/components/segmented/use-segmented.d.ts +0 -15
- package/dist/components/segmented/use-segmented.d.ts.map +0 -1
- package/dist/components/segmented/use-segmented.js +0 -22
- package/dist/components/segmented/use-segmented.js.map +0 -1
- package/dist/components/toast/context.js +0 -15
- package/dist/components/toast/context.js.map +0 -1
- package/dist/components/toast/toast.d.ts +0 -123
- package/dist/components/toast/toast.d.ts.map +0 -1
- package/dist/components/toast/toast.js +0 -112
- package/dist/components/toast/toast.js.map +0 -1
- package/dist/components/toast/use-toast.d.ts +0 -10
- package/dist/components/toast/use-toast.d.ts.map +0 -1
- package/dist/components/toast/use-toast.js +0 -17
- package/dist/components/toast/use-toast.js.map +0 -1
- package/dist/services/toast-service.d.ts +0 -69
- package/dist/services/toast-service.d.ts.map +0 -1
- package/dist/services/toast-service.js +0 -161
- package/dist/services/toast-service.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-range-picker.js","names":[],"sources":["../../../src/components/calendar-range-picker/calendar-range-picker.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 calendar range picker 相关实现。\n\nimport type { CalendarCellProps, CalendarGranularity, CalendarRangePickerApi, CalendarRangePickerSchema, CalendarRangePickerTranslations, CalendarView, CalendarWeekdayFormat } from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { provideCalendarRangePicker, provideCalendarRangePickerCell, useCalendarRangePickerCellContext, useCalendarRangePickerContext } from './context'\nimport { useCalendarRangePicker } from './use-calendar-range-picker'\n\ntype CalendarRangePickerProps = CalendarRangePickerSchema['props']\n\n/** 默认插槽的载荷:区间两端与聚焦日、展示月的日期矩阵与表头、选择到一半的起点,以及选中、聚焦、翻月的动作。 */\nexport type CalendarRangePickerRootSlotProps = Pick<\n CalendarRangePickerApi,\n | 'value'\n | 'focusedValue'\n | 'visibleMonth'\n | 'panels'\n | 'periods'\n | 'weeks'\n | 'weekDays'\n | 'headingLabel'\n | 'canGoPrev'\n | 'canGoNext'\n | 'isSelected'\n | 'isUnavailable'\n | 'rangeAnchor'\n | 'setValue'\n | 'select'\n | 'focus'\n | 'goToPrevMonth'\n | 'goToNextMonth'\n>\n\nexport const XhCalendarRangePickerRoot = defineComponent({\n name: 'XhCalendarRangePickerRoot',\n // 缺省值由 connect 与机器给出;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n value: { type: [String, Array] as PropType<string | string[]> },\n defaultValue: { type: [String, Array] as PropType<string | string[]> },\n focusedValue: { type: String },\n defaultFocusedValue: { type: String },\n min: { type: String },\n max: { type: String },\n isDateUnavailable: { type: Function as PropType<(value: string, anchor: string | null) => boolean> },\n /** 区间允许跨过不可用的日期;默认关闭,落下起点后只能选到两侧最近的不可用日为止。 */\n allowsNonContiguousRanges: Boolean,\n /** 校验失败:根带 data-invalid,区间内的格子报告 aria-invalid。 */\n invalid: Boolean,\n locale: { type: String },\n timeZone: { type: String },\n disabled: Boolean,\n readOnly: Boolean,\n weekdayFormat: { type: String as PropType<CalendarWeekdayFormat> },\n fixedWeeks: Boolean,\n /** 选择粒度。 */\n granularity: { type: String as PropType<CalendarGranularity> },\n /** 面板当前所处的层级;给定即受控,默认跟随 granularity。 */\n activeView: { type: String as PropType<CalendarView> },\n /** 非受控初值,默认同 granularity。 */\n defaultActiveView: { type: String as PropType<CalendarView> },\n /** 并排展示几页,默认 1。 */\n visibleCount: { type: Number },\n translations: { type: Object as PropType<Partial<CalendarRangePickerTranslations>> },\n },\n // *-change 携带 details 对象,update:* 携带裸值;选中值恒为两端升序的数组\n emits: {\n 'value-change': (_details: PayloadOf<CalendarRangePickerProps, 'onValueChange'>) => true,\n 'update:value': (_value: PayloadOf<CalendarRangePickerProps, 'onValueChange'>['value']) => true,\n 'focused-value-change': (_details: PayloadOf<CalendarRangePickerProps, 'onFocusedValueChange'>) => true,\n 'update:focusedValue': (_focusedValue: PayloadOf<CalendarRangePickerProps, 'onFocusedValueChange'>['focusedValue']) => true,\n 'active-view-change': (_details: PayloadOf<CalendarRangePickerProps, 'onActiveViewChange'>) => true,\n 'update:activeView': (_activeView: PayloadOf<CalendarRangePickerProps, 'onActiveViewChange'>['activeView']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: CalendarRangePickerRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notifyValue: CalendarRangePickerProps['onValueChange'] = (details) => {\n emit('value-change', details)\n emit('update:value', details.value)\n }\n const notifyFocus: CalendarRangePickerProps['onFocusedValueChange'] = (details) => {\n emit('focused-value-change', details)\n emit('update:focusedValue', details.focusedValue)\n }\n const notifyActiveView: CalendarRangePickerProps['onActiveViewChange'] = (details) => {\n emit('active-view-change', details)\n emit('update:activeView', details.activeView)\n }\n const ctx = useCalendarRangePicker(withXhConfig('calendar-range-picker', props) as CalendarRangePickerProps, notifyValue, notifyFocus, notifyActiveView)\n provideCalendarRangePicker(ctx)\n // 网格与表头由作者照插槽里的 weeks / weekDays 自行渲染\n return () => h('div', { ...ctx.api.value.getRootProps() as Record<string, unknown>, ref: ctx.rootRef }, slots.default?.({\n value: ctx.api.value.value,\n focusedValue: ctx.api.value.focusedValue,\n visibleMonth: ctx.api.value.visibleMonth,\n panels: ctx.api.value.panels,\n periods: ctx.api.value.periods,\n weeks: ctx.api.value.weeks,\n weekDays: ctx.api.value.weekDays,\n headingLabel: ctx.api.value.headingLabel,\n canGoPrev: ctx.api.value.canGoPrev,\n canGoNext: ctx.api.value.canGoNext,\n isSelected: ctx.api.value.isSelected,\n isUnavailable: ctx.api.value.isUnavailable,\n rangeAnchor: ctx.api.value.rangeAnchor,\n setValue: ctx.api.value.setValue,\n select: ctx.api.value.select,\n focus: ctx.api.value.focus,\n goToPrevMonth: ctx.api.value.goToPrevMonth,\n goToNextMonth: ctx.api.value.goToNextMonth,\n }))\n },\n})\n\nexport const XhCalendarRangePickerHeader = defineComponent({\n name: 'XhCalendarRangePickerHeader',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getHeaderProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerPrevYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerPrevYearTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getPrevYearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerPrevTrigger = defineComponent({\n name: 'XhCalendarRangePickerPrevTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getPrevTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerNextTrigger = defineComponent({\n name: 'XhCalendarRangePickerNextTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getNextTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerNextYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerNextYearTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getNextYearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerHeading = defineComponent({\n name: 'XhCalendarRangePickerHeading',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则渲染本面板的标题\n return () => h(\n 'div',\n ctx.api.value.getHeadingProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? (ctx.api.value.panels[props.index]?.headingLabel ?? ctx.api.value.headingLabel),\n )\n },\n})\n\nexport const XhCalendarRangePickerHeadingYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerHeadingYearTrigger',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则渲染标题里年那一截;年视图下它是整个十年跨度\n return () => h(\n 'button',\n ctx.api.value.getHeadingYearTriggerProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.panels[props.index]?.headingYear,\n )\n },\n})\n\nexport const XhCalendarRangePickerHeadingMonthTrigger = defineComponent({\n name: 'XhCalendarRangePickerHeadingMonthTrigger',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h(\n 'button',\n ctx.api.value.getHeadingMonthTriggerProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.panels[props.index]?.headingMonth,\n )\n },\n})\n\nexport const XhCalendarRangePickerGrid = defineComponent({\n name: 'XhCalendarRangePickerGrid',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h(\n 'div',\n {\n ...ctx.api.value.getGridProps({ index: props.index }) as Record<string, unknown>,\n // 键盘在首个网格上收口;其余面板只渲染,方向键仍能跨面板走(落点按值现查)\n ref: props.index === 0 ? ctx.gridRef : undefined,\n },\n slots.default?.(),\n )\n },\n})\n\nexport const XhCalendarRangePickerGridHead = defineComponent({\n name: 'XhCalendarRangePickerGridHead',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getGridHeadProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerGridBody = defineComponent({\n name: 'XhCalendarRangePickerGridBody',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getGridBodyProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n// 表头行与日期行共用同一个 role=row\nexport const XhCalendarRangePickerWeekRow = defineComponent({\n name: 'XhCalendarRangePickerWeekRow',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getWeekRowProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerWeekNumber = defineComponent({\n name: 'XhCalendarRangePickerWeekNumber',\n props: {\n /** 该行行首那一天的 ISO 串。 */\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则显示这一行的周序号\n return () => h(\n 'span',\n ctx.api.value.getWeekNumberProps({ value: props.value }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.getWeekNumberText({ value: props.value }),\n )\n },\n})\n\nexport const XhCalendarRangePickerWeekDay = defineComponent({\n name: 'XhCalendarRangePickerWeekDay',\n props: {\n // 列序 0-6,兼收字符串\n value: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const index = computed(() => Number(props.value))\n return () => h(\n 'span',\n ctx.api.value.getWeekDayProps({ value: index.value }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.weekDays[index.value]?.label,\n )\n },\n})\n\nexport const XhCalendarRangePickerCell = defineComponent({\n name: 'XhCalendarRangePickerCell',\n props: {\n /** ISO 日期串。 */\n value: { type: String, required: true },\n /**\n * 属于第几个面板,默认 0。多面板时必须提供:同一天会同时出现在两个面板中\n * (8 月末的几天也铺在 9 月的首行),是否为本月只有连同面板一起看才能判定。\n */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const cell = computed<CalendarCellProps>(() => ({ value: props.value, index: props.index }))\n provideCalendarRangePickerCell({ cell })\n // 不上报格子卸载,翻月后由机器按聚焦日重新落点\n return () => h('div', ctx.api.value.getCellProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerCellTrigger = defineComponent({\n name: 'XhCalendarRangePickerCellTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const { cell } = useCalendarRangePickerCellContext()\n return () => h('div', ctx.api.value.getCellTriggerProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n"],"mappings":";;;;;AAwCA,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CAEN,OAAO;EACL,OAAO,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EAC9D,cAAc,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EACrE,cAAc,EAAE,MAAM,OAAO;EAC7B,qBAAqB,EAAE,MAAM,OAAO;EACpC,KAAK,EAAE,MAAM,OAAO;EACpB,KAAK,EAAE,MAAM,OAAO;EACpB,mBAAmB,EAAE,MAAM,SAAwE;;EAEnG,2BAA2B;;EAE3B,SAAS;EACT,QAAQ,EAAE,MAAM,OAAO;EACvB,UAAU,EAAE,MAAM,OAAO;EACzB,UAAU;EACV,UA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,QACA,IAAI,IAAI,MAAM,gBAAgB,EAAE,OAAO,MAAM,MAAM,CAAC,GACpD,MAAM,UAAU,KAAK,IAAI,IAAI,MAAM,SAAS,MAAM,MAAM,EAAE,KAC5D;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CACN,OAAO;;EAEL,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;;;;;EAKtC,OAAO;GAAE,MAAM;GAAQ,SAAS;EAAE;CACpC;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,MAAM,8BAA8B;EAC1C,MAAM,OAAO,gBAAmC;GAAE,OAAO,MAAM;GAAO,OAAO,MAAM;EAAM,EAAE;EAC3F,+BAA+B,EAAE,KAAK,CAAC;EAEvC,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,aAAa,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;AAED,MAAa,mCAAmC,gBAAgB;CAC9D,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,8BAA8B;EAC1C,MAAM,EAAE,SAAS,kCAAkC;EACnD,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,oBAAoB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACnH;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"calendar-range-picker.js","names":[],"sources":["../../../src/components/calendar-range-picker/calendar-range-picker.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 calendar range picker 相关实现。\n\nimport type { CalendarCellProps, CalendarGranularity, CalendarRangePickerApi, CalendarRangePickerSchema, CalendarRangePickerTranslations, CalendarView, CalendarWeekdayFormat } from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { provideCalendarRangePicker, provideCalendarRangePickerCell, useCalendarRangePickerCellContext, useCalendarRangePickerContext } from './context'\nimport { useCalendarRangePicker } from './use-calendar-range-picker'\n\ntype CalendarRangePickerProps = CalendarRangePickerSchema['props']\n\n/** 默认插槽的载荷:区间两端与聚焦日、展示月的日期矩阵与表头、选择到一半的起点,以及选中、聚焦、翻月的动作。 */\nexport type CalendarRangePickerRootSlotProps = Pick<\n CalendarRangePickerApi,\n | 'value'\n | 'focusedValue'\n | 'visibleMonth'\n | 'panels'\n | 'periods'\n | 'weeks'\n | 'weekDays'\n | 'headingLabel'\n | 'canGoPrev'\n | 'canGoNext'\n | 'isSelected'\n | 'isUnavailable'\n | 'rangeAnchor'\n | 'setValue'\n | 'select'\n | 'focus'\n | 'goToPrevMonth'\n | 'goToNextMonth'\n>\n\nexport const XhCalendarRangePickerRoot = defineComponent({\n name: 'XhCalendarRangePickerRoot',\n // 缺省值由 connect 与机器给出;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n value: { type: [String, Array] as PropType<string | string[]> },\n defaultValue: { type: [String, Array] as PropType<string | string[]> },\n focusedValue: { type: String },\n defaultFocusedValue: { type: String },\n min: { type: String },\n max: { type: String },\n isDateUnavailable: { type: Function as PropType<(value: string, anchor: string | null) => boolean> },\n /** 区间允许跨过不可用的日期;默认关闭,落下起点后只能选到两侧最近的不可用日为止。 */\n allowsNonContiguousRanges: Boolean,\n /** 下一次点选落在哪一端;为 1 且已有起点时只改终点。 */\n activeIndex: { type: Number as PropType<0 | 1> },\n /** 校验失败:根带 data-invalid,区间内的格子报告 aria-invalid。 */\n invalid: Boolean,\n locale: { type: String },\n /** 周首日,0 = 星期日 … 6 = 星期六;不给按 locale。 */\n firstDayOfWeek: { type: Number },\n timeZone: { type: String },\n disabled: Boolean,\n readOnly: Boolean,\n weekdayFormat: { type: String as PropType<CalendarWeekdayFormat> },\n fixedWeeks: Boolean,\n /** 选择粒度。 */\n granularity: { type: String as PropType<CalendarGranularity> },\n /** 面板当前所处的层级;给定即受控,默认跟随 granularity。 */\n activeView: { type: String as PropType<CalendarView> },\n /** 非受控初值,默认同 granularity。 */\n defaultActiveView: { type: String as PropType<CalendarView> },\n /** 并排展示几页,默认 1。 */\n visibleCount: { type: Number },\n translations: { type: Object as PropType<Partial<CalendarRangePickerTranslations>> },\n },\n // *-change 携带 details 对象,update:* 携带裸值;选中值恒为两端升序的数组\n emits: {\n 'value-change': (_details: PayloadOf<CalendarRangePickerProps, 'onValueChange'>) => true,\n 'update:value': (_value: PayloadOf<CalendarRangePickerProps, 'onValueChange'>['value']) => true,\n 'focused-value-change': (_details: PayloadOf<CalendarRangePickerProps, 'onFocusedValueChange'>) => true,\n 'update:focusedValue': (_focusedValue: PayloadOf<CalendarRangePickerProps, 'onFocusedValueChange'>['focusedValue']) => true,\n 'active-view-change': (_details: PayloadOf<CalendarRangePickerProps, 'onActiveViewChange'>) => true,\n 'update:activeView': (_activeView: PayloadOf<CalendarRangePickerProps, 'onActiveViewChange'>['activeView']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: CalendarRangePickerRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notifyValue: CalendarRangePickerProps['onValueChange'] = (details) => {\n emit('value-change', details)\n emit('update:value', details.value)\n }\n const notifyFocus: CalendarRangePickerProps['onFocusedValueChange'] = (details) => {\n emit('focused-value-change', details)\n emit('update:focusedValue', details.focusedValue)\n }\n const notifyActiveView: CalendarRangePickerProps['onActiveViewChange'] = (details) => {\n emit('active-view-change', details)\n emit('update:activeView', details.activeView)\n }\n const ctx = useCalendarRangePicker(withXhConfig('calendar-range-picker', props) as CalendarRangePickerProps, notifyValue, notifyFocus, notifyActiveView)\n provideCalendarRangePicker(ctx)\n // 网格与表头由作者照插槽里的 weeks / weekDays 自行渲染\n return () => h('div', { ...ctx.api.value.getRootProps() as Record<string, unknown>, ref: ctx.rootRef }, slots.default?.({\n value: ctx.api.value.value,\n focusedValue: ctx.api.value.focusedValue,\n visibleMonth: ctx.api.value.visibleMonth,\n panels: ctx.api.value.panels,\n periods: ctx.api.value.periods,\n weeks: ctx.api.value.weeks,\n weekDays: ctx.api.value.weekDays,\n headingLabel: ctx.api.value.headingLabel,\n canGoPrev: ctx.api.value.canGoPrev,\n canGoNext: ctx.api.value.canGoNext,\n isSelected: ctx.api.value.isSelected,\n isUnavailable: ctx.api.value.isUnavailable,\n rangeAnchor: ctx.api.value.rangeAnchor,\n setValue: ctx.api.value.setValue,\n select: ctx.api.value.select,\n focus: ctx.api.value.focus,\n goToPrevMonth: ctx.api.value.goToPrevMonth,\n goToNextMonth: ctx.api.value.goToNextMonth,\n }))\n },\n})\n\nexport const XhCalendarRangePickerHeader = defineComponent({\n name: 'XhCalendarRangePickerHeader',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getHeaderProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerPrevYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerPrevYearTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getPrevYearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerPrevTrigger = defineComponent({\n name: 'XhCalendarRangePickerPrevTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getPrevTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerNextTrigger = defineComponent({\n name: 'XhCalendarRangePickerNextTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getNextTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerNextYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerNextYearTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('button', ctx.api.value.getNextYearTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerHeading = defineComponent({\n name: 'XhCalendarRangePickerHeading',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则渲染本面板的标题\n return () => h(\n 'div',\n ctx.api.value.getHeadingProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? (ctx.api.value.panels[props.index]?.headingLabel ?? ctx.api.value.headingLabel),\n )\n },\n})\n\nexport const XhCalendarRangePickerHeadingYearTrigger = defineComponent({\n name: 'XhCalendarRangePickerHeadingYearTrigger',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则渲染标题里年那一截;年视图下它是整个十年跨度\n return () => h(\n 'button',\n ctx.api.value.getHeadingYearTriggerProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.panels[props.index]?.headingYear,\n )\n },\n})\n\nexport const XhCalendarRangePickerHeadingMonthTrigger = defineComponent({\n name: 'XhCalendarRangePickerHeadingMonthTrigger',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h(\n 'button',\n ctx.api.value.getHeadingMonthTriggerProps({ index: props.index }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.panels[props.index]?.headingMonth,\n )\n },\n})\n\nexport const XhCalendarRangePickerGrid = defineComponent({\n name: 'XhCalendarRangePickerGrid',\n props: {\n /** 属于第几个面板,默认 0。单面板时不必写。 */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h(\n 'div',\n {\n ...ctx.api.value.getGridProps({ index: props.index }) as Record<string, unknown>,\n // 键盘在首个网格上收口;其余面板只渲染,方向键仍能跨面板走(落点按值现查)\n ref: props.index === 0 ? ctx.gridRef : undefined,\n },\n slots.default?.(),\n )\n },\n})\n\nexport const XhCalendarRangePickerGridHead = defineComponent({\n name: 'XhCalendarRangePickerGridHead',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getGridHeadProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerGridBody = defineComponent({\n name: 'XhCalendarRangePickerGridBody',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getGridBodyProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n// 表头行与日期行共用同一个 role=row\nexport const XhCalendarRangePickerWeekRow = defineComponent({\n name: 'XhCalendarRangePickerWeekRow',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n return () => h('div', ctx.api.value.getWeekRowProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerWeekNumber = defineComponent({\n name: 'XhCalendarRangePickerWeekNumber',\n props: {\n /** 该行行首那一天的 ISO 串。 */\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n // 有插槽用插槽,否则显示这一行的周序号\n return () => h(\n 'span',\n ctx.api.value.getWeekNumberProps({ value: props.value }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.getWeekNumberText({ value: props.value }),\n )\n },\n})\n\nexport const XhCalendarRangePickerWeekDay = defineComponent({\n name: 'XhCalendarRangePickerWeekDay',\n props: {\n // 列序 0-6,兼收字符串\n value: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const index = computed(() => Number(props.value))\n return () => h(\n 'span',\n ctx.api.value.getWeekDayProps({ value: index.value }) as Record<string, unknown>,\n slots.default?.() ?? ctx.api.value.weekDays[index.value]?.label,\n )\n },\n})\n\nexport const XhCalendarRangePickerCell = defineComponent({\n name: 'XhCalendarRangePickerCell',\n props: {\n /** ISO 日期串。 */\n value: { type: String, required: true },\n /**\n * 属于第几个面板,默认 0。多面板时必须提供:同一天会同时出现在两个面板中\n * (8 月末的几天也铺在 9 月的首行),是否为本月只有连同面板一起看才能判定。\n */\n index: { type: Number, default: 0 },\n },\n setup(props, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const cell = computed<CalendarCellProps>(() => ({ value: props.value, index: props.index }))\n provideCalendarRangePickerCell({ cell })\n // 不上报格子卸载,翻月后由机器按聚焦日重新落点\n return () => h('div', ctx.api.value.getCellProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCalendarRangePickerCellTrigger = defineComponent({\n name: 'XhCalendarRangePickerCellTrigger',\n setup(_, { slots }) {\n const ctx = useCalendarRangePickerContext()\n const { cell } = useCalendarRangePickerCellContext()\n return () => h('div', ctx.api.value.getCellTriggerProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n"],"mappings":";;;;;AAwCA,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CAEN,OAAO;EACL,OAAO,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EAC9D,cAAc,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EACrE,cAAc,EAAE,MAAM,OAAO;EAC7B,qBAAqB,EAAE,MAAM,OAAO;EACpC,KAAK,EAAE,MAAM,OAAO;EACpB,KAAK,EAAE,MAAM,OAAO;EACpB,mBAAmB,EAAE,MAAM,SAAwE;;EAEnG,2BAA2B;;EAE3B,aAAa,EAAE,MAAM,OAA0B;;EAE/C,SAAS;EACT,QAAQ,EAAE,MAAM,OAAO;;EAEvB,gBAAgB,EAAE,MAAM,OAAO;EAC/B,UAAU,EAAE,MAAM,OAAO;EACzB,UAAU;EACV,UAAU;EACV,eAAe,EAAE,MAAM,OAA0C;EACjE,YAAY;;EAEZ,aAAa,EAAE,MAAM,OAAwC;;EAE7D,YAAY,EAAE,MAAM,OAAiC;;E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,MAAM,EAAE,KAC5D;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CACN,OAAO;;EAEL,OAAO;GAAE,MAAM;GAAQ,UAAU;EAAK;;;;;EAKtC,OAAO;GAAE,MAAM;GAAQ,SAAS;EAAE;CACpC;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,MAAM,8BAA8B;EAC1C,MAAM,OAAO,gBAAmC;GAAE,OAAO,MAAM;GAAO,OAAO,MAAM;EAAM,EAAE;EAC3F,+BAA+B,EAAE,KAAK,CAAC;EAEvC,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,aAAa,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;AAED,MAAa,mCAAmC,gBAAgB;CAC9D,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,8BAA8B;EAC1C,MAAM,EAAE,SAAS,kCAAkC;EACnD,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,oBAAoB,KAAK,KAAK,GAA8B,MAAM,UAAU,CAAC;CACnH;AACF,CAAC"}
|
|
@@ -5,19 +5,54 @@ declare const XhCardRoot: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
5
5
|
variant: {
|
|
6
6
|
type: PropType<ControlVariant>;
|
|
7
7
|
};
|
|
8
|
+
/** 整卡可交互:标题里的 trigger 把点击区铺满整张卡片。 */
|
|
9
|
+
interactive: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
8
13
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
14
|
[key: string]: any;
|
|
10
15
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
16
|
variant: {
|
|
12
17
|
type: PropType<ControlVariant>;
|
|
13
18
|
};
|
|
14
|
-
|
|
19
|
+
/** 整卡可交互:标题里的 trigger 把点击区铺满整张卡片。 */
|
|
20
|
+
interactive: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {
|
|
25
|
+
interactive: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
15
27
|
declare const XhCardHeader: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
28
|
[key: string]: any;
|
|
17
29
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
18
30
|
declare const XhCardTitle: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
31
|
[key: string]: any;
|
|
20
32
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
/**
|
|
34
|
+
* 整卡的触发器,放在 title 里:给了 href 渲染链接,不给渲染 `<button type="button">`;
|
|
35
|
+
* 路由链接等作者自己的节点用 asChild。卡片 interactive 时它的点击区铺满整张卡片。
|
|
36
|
+
*/
|
|
37
|
+
declare const XhCardTrigger: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
38
|
+
/** 链接地址;给了渲染 `<a>`,不给渲染按钮。 */
|
|
39
|
+
href: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
};
|
|
42
|
+
/** 借用作者的子节点作为触发器,不再渲染自己的元素;子节点须恰好一个。 */
|
|
43
|
+
asChild: BooleanConstructor;
|
|
44
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
/** 链接地址;给了渲染 `<a>`,不给渲染按钮。 */
|
|
48
|
+
href: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
/** 借用作者的子节点作为触发器,不再渲染自己的元素;子节点须恰好一个。 */
|
|
52
|
+
asChild: BooleanConstructor;
|
|
53
|
+
}>> & Readonly<{}>, {
|
|
54
|
+
asChild: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
21
56
|
declare const XhCardDescription: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
22
57
|
[key: string]: any;
|
|
23
58
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -28,5 +63,5 @@ declare const XhCardFooter: import("vue").DefineComponent<{}, () => import("vue"
|
|
|
28
63
|
[key: string]: any;
|
|
29
64
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
65
|
//#endregion
|
|
31
|
-
export { XhCardContent, XhCardDescription, XhCardFooter, XhCardHeader, XhCardRoot, XhCardTitle };
|
|
66
|
+
export { XhCardContent, XhCardDescription, XhCardFooter, XhCardHeader, XhCardRoot, XhCardTitle, XhCardTrigger };
|
|
32
67
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","names":[],"sources":["../../../src/components/card/card.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"card.d.ts","names":[],"sources":["../../../src/components/card/card.ts"],"mappings":";;;cAkBa,0BAAU,8BAAA;;IAIQ,MAAA,SAAS;;;;;;;;;;;IAAT,MAAA,SAAS;;;;;;;;;qCAWtC;cAEW,4BAAY,wCAAA,oBAAA,4BAAA;;8BAMvB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,2BAAW,wCAAA,oBAAA,4BAAA;;8BAMtB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;;;;cAMW,6BAAa,8BAAA;;;;;;;;;;;;;;;;;;qCAsBxB;cAEW,iCAAiB,wCAAA,oBAAA,4BAAA;;8BAM5B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,6BAAa,wCAAA,oBAAA,4BAAA;;8BAMxB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,4BAAY,wCAAA,oBAAA,4BAAA;;8BAMvB,qCAAA,iDAAA,aAAA,eAAA,oDAAA"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
2
|
import { withXhConfig } from "../../config/config.js";
|
|
3
|
+
import { mergePartProps } from "../../runtime/merge-props.js";
|
|
4
|
+
import { mergeIntoChild } from "../../runtime/as-child.js";
|
|
3
5
|
import { provideCard, useCardContext } from "./context.js";
|
|
4
6
|
import { computed, defineComponent, h } from "vue";
|
|
5
7
|
import { connectCard } from "@xihan-ui/headless";
|
|
6
8
|
//#region src/components/card/card.ts
|
|
7
9
|
const XhCardRoot = defineComponent({
|
|
8
10
|
name: "XhCardRoot",
|
|
9
|
-
props: {
|
|
11
|
+
props: {
|
|
12
|
+
variant: { type: String },
|
|
13
|
+
/** 整卡可交互:标题里的 trigger 把点击区铺满整张卡片。 */
|
|
14
|
+
interactive: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
}
|
|
18
|
+
},
|
|
10
19
|
setup(props, { slots }) {
|
|
11
20
|
const configured = withXhConfig("card", props);
|
|
12
21
|
const api = computed(() => connectCard(configured, vueNormalize));
|
|
@@ -28,6 +37,35 @@ const XhCardTitle = defineComponent({
|
|
|
28
37
|
return () => h("h3", ctx.api.value.getTitleProps(), slots.default?.());
|
|
29
38
|
}
|
|
30
39
|
});
|
|
40
|
+
/**
|
|
41
|
+
* 整卡的触发器,放在 title 里:给了 href 渲染链接,不给渲染 `<button type="button">`;
|
|
42
|
+
* 路由链接等作者自己的节点用 asChild。卡片 interactive 时它的点击区铺满整张卡片。
|
|
43
|
+
*/
|
|
44
|
+
const XhCardTrigger = defineComponent({
|
|
45
|
+
name: "XhCardTrigger",
|
|
46
|
+
inheritAttrs: false,
|
|
47
|
+
props: {
|
|
48
|
+
/** 链接地址;给了渲染 `<a>`,不给渲染按钮。 */
|
|
49
|
+
href: { type: String },
|
|
50
|
+
/** 借用作者的子节点作为触发器,不再渲染自己的元素;子节点须恰好一个。 */
|
|
51
|
+
asChild: Boolean
|
|
52
|
+
},
|
|
53
|
+
setup(props, { slots, attrs }) {
|
|
54
|
+
const ctx = useCardContext();
|
|
55
|
+
return () => {
|
|
56
|
+
const part = mergePartProps(ctx.api.value.getTriggerProps(), attrs);
|
|
57
|
+
const children = slots.default?.();
|
|
58
|
+
if (props.asChild) return mergeIntoChild(children, part, "card");
|
|
59
|
+
return props.href == null ? h("button", {
|
|
60
|
+
type: "button",
|
|
61
|
+
...part
|
|
62
|
+
}, children) : h("a", {
|
|
63
|
+
...part,
|
|
64
|
+
href: props.href
|
|
65
|
+
}, children);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
31
69
|
const XhCardDescription = defineComponent({
|
|
32
70
|
name: "XhCardDescription",
|
|
33
71
|
setup(_, { slots }) {
|
|
@@ -50,6 +88,6 @@ const XhCardFooter = defineComponent({
|
|
|
50
88
|
}
|
|
51
89
|
});
|
|
52
90
|
//#endregion
|
|
53
|
-
export { XhCardContent, XhCardDescription, XhCardFooter, XhCardHeader, XhCardRoot, XhCardTitle };
|
|
91
|
+
export { XhCardContent, XhCardDescription, XhCardFooter, XhCardHeader, XhCardRoot, XhCardTitle, XhCardTrigger };
|
|
54
92
|
|
|
55
93
|
//# sourceMappingURL=card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/card/card.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 card 相关实现。\n\nimport type { ControlVariant } from '@xihan-ui/core'\nimport type { CardProps } from '@xihan-ui/headless'\nimport type { PropType } from 'vue'\nimport { connectCard } from '@xihan-ui/headless'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { provideCard, useCardContext } from './context'\n\nexport const XhCardRoot = defineComponent({\n name: 'XhCardRoot',\n // 缺省值由 connect 给出。\n props: {\n variant: { type: String as PropType<ControlVariant> },\n },\n setup(props, { slots }) {\n // withXhConfig 只能在 setup 期调,连接层在渲染期读这份代理\n const configured = withXhConfig('card', props)\n const api = computed(() => connectCard(configured as CardProps, vueNormalize))\n provideCard({ api })\n return () => h('div', api.value.getRootProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardHeader = defineComponent({\n name: 'XhCardHeader',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getHeaderProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardTitle = defineComponent({\n name: 'XhCardTitle',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('h3', ctx.api.value.getTitleProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardDescription = defineComponent({\n name: 'XhCardDescription',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('p', ctx.api.value.getDescriptionProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardContent = defineComponent({\n name: 'XhCardContent',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getContentProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardFooter = defineComponent({\n name: 'XhCardFooter',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getFooterProps() as Record<string, unknown>, slots.default?.())\n },\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/card/card.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 card 相关实现。\n\nimport type { ControlVariant } from '@xihan-ui/core'\nimport type { CardProps } from '@xihan-ui/headless'\nimport type { PropType } from 'vue'\nimport { connectCard } from '@xihan-ui/headless'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { mergeIntoChild } from '../../runtime/as-child'\nimport { mergePartProps } from '../../runtime/merge-props'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { provideCard, useCardContext } from './context'\n\nexport const XhCardRoot = defineComponent({\n name: 'XhCardRoot',\n // 缺省值由 connect 给出。\n props: {\n variant: { type: String as PropType<ControlVariant> },\n /** 整卡可交互:标题里的 trigger 把点击区铺满整张卡片。 */\n interactive: { type: Boolean, default: undefined },\n },\n setup(props, { slots }) {\n // withXhConfig 只能在 setup 期调,连接层在渲染期读这份代理\n const configured = withXhConfig('card', props)\n const api = computed(() => connectCard(configured as CardProps, vueNormalize))\n provideCard({ api })\n return () => h('div', api.value.getRootProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardHeader = defineComponent({\n name: 'XhCardHeader',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getHeaderProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardTitle = defineComponent({\n name: 'XhCardTitle',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('h3', ctx.api.value.getTitleProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 整卡的触发器,放在 title 里:给了 href 渲染链接,不给渲染 `<button type=\"button\">`;\n * 路由链接等作者自己的节点用 asChild。卡片 interactive 时它的点击区铺满整张卡片。\n */\nexport const XhCardTrigger = defineComponent({\n name: 'XhCardTrigger',\n // 直通属性自己合:Vue 默认把作者的处理器排在部件的后面,这里改成作者先跑\n inheritAttrs: false,\n props: {\n /** 链接地址;给了渲染 `<a>`,不给渲染按钮。 */\n href: { type: String },\n /** 借用作者的子节点作为触发器,不再渲染自己的元素;子节点须恰好一个。 */\n asChild: Boolean,\n },\n setup(props, { slots, attrs }) {\n const ctx = useCardContext()\n return () => {\n const part = mergePartProps(ctx.api.value.getTriggerProps() as Record<string, unknown>, attrs)\n const children = slots.default?.()\n if (props.asChild)\n return mergeIntoChild(children, part, 'card')\n return props.href == null\n ? h('button', { type: 'button', ...part }, children)\n : h('a', { ...part, href: props.href }, children)\n }\n },\n})\n\nexport const XhCardDescription = defineComponent({\n name: 'XhCardDescription',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('p', ctx.api.value.getDescriptionProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardContent = defineComponent({\n name: 'XhCardContent',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getContentProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCardFooter = defineComponent({\n name: 'XhCardFooter',\n setup(_, { slots }) {\n const ctx = useCardContext()\n return () => h('div', ctx.api.value.getFooterProps() as Record<string, unknown>, slots.default?.())\n },\n})\n"],"mappings":";;;;;;;;AAkBA,MAAa,aAAa,gBAAgB;CACxC,MAAM;CAEN,OAAO;EACL,SAAS,EAAE,MAAM,OAAmC;;EAEpD,aAAa;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;CACnD;CACA,M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I,IAAI,MAAM,oBAAoB,GAA8B,MAAM,UAAU,CAAC;CACvG;AACF,CAAC;AAED,MAAa,gBAAgB,gBAAgB;CAC3C,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,eAAe;EAC3B,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,gBAAgB,GAA8B,MAAM,UAAU,CAAC;CACrG;AACF,CAAC;AAED,MAAa,eAAe,gBAAgB;CAC1C,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,eAAe;EAC3B,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,eAAe,GAA8B,MAAM,UAAU,CAAC;CACpG;AACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
2
|
import { PropType, SlotsType, VNode } from "vue";
|
|
3
3
|
import { Direction, Orientation } from "@xihan-ui/core";
|
|
4
|
-
import { CarouselApi, CarouselSchema, CarouselTranslations } from "@xihan-ui/headless";
|
|
4
|
+
import { CarouselApi, CarouselEffect, CarouselSchema, CarouselTranslations } from "@xihan-ui/headless";
|
|
5
5
|
//#region src/components/carousel/carousel.d.ts
|
|
6
6
|
type CarouselProps = CarouselSchema['props'];
|
|
7
7
|
/** 默认插槽的载荷:当前页与翻页区间、自动播放与拖拽状态,以及翻页、播放的命令。 */
|
|
@@ -43,6 +43,9 @@ declare const XhCarouselRoot: import("vue").DefineComponent<import("vue").Extrac
|
|
|
43
43
|
spacing: {
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
};
|
|
46
|
+
effect: {
|
|
47
|
+
type: PropType<CarouselEffect>;
|
|
48
|
+
};
|
|
46
49
|
translations: {
|
|
47
50
|
type: PropType<Partial<CarouselTranslations>>;
|
|
48
51
|
};
|
|
@@ -88,6 +91,9 @@ declare const XhCarouselRoot: import("vue").DefineComponent<import("vue").Extrac
|
|
|
88
91
|
spacing: {
|
|
89
92
|
type: StringConstructor;
|
|
90
93
|
};
|
|
94
|
+
effect: {
|
|
95
|
+
type: PropType<CarouselEffect>;
|
|
96
|
+
};
|
|
91
97
|
translations: {
|
|
92
98
|
type: PropType<Partial<CarouselTranslations>>;
|
|
93
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","names":[],"sources":["../../../src/components/carousel/carousel.ts"],"mappings":";;;;;KAgBK,gBAAgB;;KAGT,wBAAwB,KAClC;cAqBW,8BAAc,8BAAA;;;;;;;;;;;;;;;;;IASQ,MAAA,SAAS;;;IACjB,MAAA,SAAS;;;;;;;IAGO,MAAA;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","names":[],"sources":["../../../src/components/carousel/carousel.ts"],"mappings":";;;;;KAgBK,gBAAgB;;KAGT,wBAAwB,KAClC;cAqBW,8BAAc,8BAAA;;;;;;;;;;;;;;;;;IASQ,MAAA,SAAS;;;IACjB,MAAA,SAAS;;;;;;;IAGO,MAAA;;;;;;;;;;;IAGb,MAAA,SAAS;;;IACH,MAAA,SAAS,QAAQ;;;;;EAIvB,gBAAA,UAAA,UAAU;EACb,gBAAA,OAAA,UAAU;;;;;;;;;;;;;;;;;;IAbF,MAAA,SAAS;;;IACjB,MAAA,SAAS;;;;;;;IAGO,MAAA;;;;;;;;;;;IAGb,MAAA,SAAS;;;IACH,MAAA,SAAS,QAAQ;;;;;;;;;;EAQvC,WAAC,OAAO,0BAA0B;kCA8B9C;cAEW,kCAAkB,0BAAA,oBAAA,4BAAA;;8BAM7B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,8BAAc,0BAAA,oBAAA,4BAAA;;8BAMzB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,8BAAc,8BAAA;;IAIY,MAAA;;;;;;;IAAA,MAAA;;;MAUrC,oDAAA;cAEW,qCAAqB,0BAAA,oBAAA,4BAAA;;8BAMhC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,qCAAqB,0BAAA,oBAAA,4BAAA;;8BAMhC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;;;;;;cAQW,yCAAyB,0BAAA,oBAAA,4BAAA;;;EAGxB,WAAC;IAAS;QAAuB;kCAU7C;cAEW,wCAAwB,0BAAA,oBAAA,4BAAA;;8BAMnC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,mCAAmB,8BAAA;;IAIO,MAAA;;;;;;;IAAA,MAAA;;;MAUrC,oDAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.js","names":[],"sources":["../../../src/components/carousel/carousel.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 carousel 相关实现。\n\nimport type { Direction, Orientation } from '@xihan-ui/core'\nimport type { CarouselApi, CarouselSchema, CarouselTranslations } from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { provideCarousel, useCarouselContext } from './context'\nimport { useCarousel } from './use-carousel'\n\ntype CarouselProps = CarouselSchema['props']\n\n/** 默认插槽的载荷:当前页与翻页区间、自动播放与拖拽状态,以及翻页、播放的命令。 */\nexport type CarouselRootSlotProps = Pick<\n CarouselApi,\n | 'page'\n | 'totalPages'\n | 'slideCount'\n | 'slideRange'\n | 'pageSnapPoints'\n | 'canScrollPrev'\n | 'canScrollNext'\n | 'autoplaying'\n | 'paused'\n | 'autoplayStopped'\n | 'dragging'\n | 'isInView'\n | 'setPage'\n | 'goToPrev'\n | 'goToNext'\n | 'play'\n | 'pause'\n | 'resume'\n>\n\nexport const XhCarouselRoot = defineComponent({\n name: 'XhCarouselRoot',\n // 缺省值由 connect 给出;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n page: { type: Number },\n defaultPage: { type: Number },\n slideCount: { type: Number },\n slidesPerPage: { type: Number },\n slidesPerMove: { type: Number },\n orientation: { type: String as PropType<Orientation> },\n dir: { type: String as PropType<Direction> },\n loop: { type: Boolean, default: undefined },\n // 布尔或毫秒:true 用默认间隔,数值即间隔\n autoplay: { type: [Boolean, Number] as PropType<boolean | number>, default: undefined },\n allowPointerDrag: { type: Boolean, default: undefined },\n spacing: { type: String },\n translations: { type: Object as PropType<Partial<CarouselTranslations>> },\n },\n // page-change 携带 { page },update:page 携带裸页码\n emits: {\n 'page-change': (_details: PayloadOf<CarouselProps, 'onPageChange'>) => true,\n 'update:page': (_page: PayloadOf<CarouselProps, 'onPageChange'>['page']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: CarouselRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notify: CarouselProps['onPageChange'] = (details) => {\n emit('page-change', details)\n emit('update:page', details.page)\n }\n const ctx = useCarousel(withXhConfig('carousel', props) as CarouselProps, notify)\n provideCarousel(ctx)\n return () => h('div', ctx.api.value.getRootProps() as Record<string, unknown>, slots.default?.({\n page: ctx.api.value.page,\n totalPages: ctx.api.value.totalPages,\n slideCount: ctx.api.value.slideCount,\n slideRange: ctx.api.value.slideRange,\n pageSnapPoints: ctx.api.value.pageSnapPoints,\n canScrollPrev: ctx.api.value.canScrollPrev,\n canScrollNext: ctx.api.value.canScrollNext,\n autoplaying: ctx.api.value.autoplaying,\n paused: ctx.api.value.paused,\n autoplayStopped: ctx.api.value.autoplayStopped,\n dragging: ctx.api.value.dragging,\n isInView: ctx.api.value.isInView,\n setPage: ctx.api.value.setPage,\n goToPrev: ctx.api.value.goToPrev,\n goToNext: ctx.api.value.goToNext,\n play: ctx.api.value.play,\n pause: ctx.api.value.pause,\n resume: ctx.api.value.resume,\n }))\n },\n})\n\nexport const XhCarouselViewport = defineComponent({\n name: 'XhCarouselViewport',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getViewportProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselList = defineComponent({\n name: 'XhCarouselList',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getListProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselItem = defineComponent({\n name: 'XhCarouselItem',\n props: {\n // 下标由作者声明,兼收字符串以支持模板里写 index=\"0\"\n index: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'div',\n ctx.api.value.getItemProps({ index: Number(props.index) }) as Record<string, unknown>,\n slots.default?.(),\n )\n },\n})\n\nexport const XhCarouselPrevTrigger = defineComponent({\n name: 'XhCarouselPrevTrigger',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('button', ctx.api.value.getPrevTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselNextTrigger = defineComponent({\n name: 'XhCarouselNextTrigger',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('button', ctx.api.value.getNextTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 播放 / 暂停开关。开启 autoplay 后应当渲染它:\n * 自动翻页必须有一处能够停止,且停止之后不会被其他交互重新启动。\n *\n * 插槽得到的 `stopped` 是用户是否已按下停止,不含悬停与焦点两路的临时暂停。\n */\nexport const XhCarouselAutoplayTrigger = defineComponent({\n name: 'XhCarouselAutoplayTrigger',\n slots: Object as SlotsType<{\n default?: (props: { stopped: boolean }) => VNode[]\n }>,\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'button',\n ctx.api.value.getAutoplayTriggerProps() as Record<string, unknown>,\n slots.default?.({ stopped: ctx.api.value.autoplayStopped }),\n )\n },\n})\n\nexport const XhCarouselIndicatorGroup = defineComponent({\n name: 'XhCarouselIndicatorGroup',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getIndicatorGroupProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselIndicator = defineComponent({\n name: 'XhCarouselIndicator',\n props: {\n // 指示点对应的页码,0 基;兼收字符串\n index: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'button',\n ctx.api.value.getIndicatorProps({ index: Number(props.index) }) as Record<string, unknown>,\n slots.default?.(),\n )\n },\n})\n"],"mappings":";;;;;AAyCA,MAAa,iBAAiB,gBAAgB;CAC5C,MAAM;CAEN,OAAO;EACL,MAAM,EAAE,MAAM,OAAO;EACrB,aAAa,EAAE,MAAM,OAAO;EAC5B,YAAY,EAAE,MAAM,OAAO;EAC3B,eAAe,EAAE,MAAM,OAAO;EAC9B,eAAe,EAAE,MAAM,OAAO;EAC9B,aAAa,EAAE,MAAM,OAAgC;EACrD,KAAK,EAAE,MAAM,OAA8B;EAC3C,MAAM;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAE1C,UAAU;GAAE,MAAM,CAAC,SAAS,MAAM;GAAiC,SAAS,KAAA;EAAU;EACtF,kBAAkB;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EACtD,SAAS,EAAE,MAAM,OAAO;EACxB,cAAc,EAAE,MAAM,OAAkD;CAC1E;CAEA,OAAO;EACL,gBAAgB,aAAuD;EACvE,gBAAgB,UAA4D;CAC9E;CACA,OAAO;CAGP,MAAM,OAAO,EAAE,OAAO,QAAQ;EAC5B,MAAM,UAAyC,YAAY;GACzD,KAAK,eAAe,OAAO;GAC3B,KAAK,eAAe,QAAQ,IAAI;EAClC;EACA,MAAM,MAAM,YAAY,aAAa,YAAY,KAAK,GAAoB,MAAM;EAChF,gBAAgB,GAAG;EACnB,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,aAAa,GAA8B,MAAM,UAAU;GAC7F,MAAM,IAAI,IAAI,MAAM;GACpB,YAAY,IAAI,IAAI,MAAM;GAC1B,YAAY,IAAI,IAAI,MAAM;GAC1B,YAAY,IAAI,IAAI,MAAM;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,MAAM,mBAAmB;EAC/B,aAAa,EAAE,UAAU,IAAI,IAAI,MAAM,oBAAoB,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;AAED,MAAa,wBAAwB,gBAAgB;CACnD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EAAE,UAAU,IAAI,IAAI,MAAM,oBAAoB,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;;;;;;;AAQD,MAAa,4BAA4B,gBAAgB;CACvD,MAAM;CACN,OAAO;CAGP,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EACX,UACA,IAAI,IAAI,MAAM,wBAAwB,GACtC,MAAM,UAAU,EAAE,SAAS,IAAI,IAAI,MAAM,gBAAgB,CAAC,CAC5D;CACF;AACF,CAAC;AAED,MAAa,2BAA2B,gBAAgB;CACtD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,uBAAuB,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;AAED,MAAa,sBAAsB,gBAAgB;CACjD,MAAM;CACN,OAAO,EAEL,OAAO;EAAE,MAAM,CAAC,QAAQ,MAAM;EAAgC,UAAU;CAAK,EAC/E;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EACX,UACA,IAAI,IAAI,MAAM,kBAAkB,EAAE,OAAO,OAAO,MAAM,KAAK,EAAE,CAAC,GAC9D,MAAM,UAAU,CAClB;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"carousel.js","names":[],"sources":["../../../src/components/carousel/carousel.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 carousel 相关实现。\n\nimport type { Direction, Orientation } from '@xihan-ui/core'\nimport type { CarouselApi, CarouselEffect, CarouselSchema, CarouselTranslations } from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { provideCarousel, useCarouselContext } from './context'\nimport { useCarousel } from './use-carousel'\n\ntype CarouselProps = CarouselSchema['props']\n\n/** 默认插槽的载荷:当前页与翻页区间、自动播放与拖拽状态,以及翻页、播放的命令。 */\nexport type CarouselRootSlotProps = Pick<\n CarouselApi,\n | 'page'\n | 'totalPages'\n | 'slideCount'\n | 'slideRange'\n | 'pageSnapPoints'\n | 'canScrollPrev'\n | 'canScrollNext'\n | 'autoplaying'\n | 'paused'\n | 'autoplayStopped'\n | 'dragging'\n | 'isInView'\n | 'setPage'\n | 'goToPrev'\n | 'goToNext'\n | 'play'\n | 'pause'\n | 'resume'\n>\n\nexport const XhCarouselRoot = defineComponent({\n name: 'XhCarouselRoot',\n // 缺省值由 connect 给出;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n page: { type: Number },\n defaultPage: { type: Number },\n slideCount: { type: Number },\n slidesPerPage: { type: Number },\n slidesPerMove: { type: Number },\n orientation: { type: String as PropType<Orientation> },\n dir: { type: String as PropType<Direction> },\n loop: { type: Boolean, default: undefined },\n // 布尔或毫秒:true 用默认间隔,数值即间隔\n autoplay: { type: [Boolean, Number] as PropType<boolean | number>, default: undefined },\n allowPointerDrag: { type: Boolean, default: undefined },\n spacing: { type: String },\n effect: { type: String as PropType<CarouselEffect> },\n translations: { type: Object as PropType<Partial<CarouselTranslations>> },\n },\n // page-change 携带 { page },update:page 携带裸页码\n emits: {\n 'page-change': (_details: PayloadOf<CarouselProps, 'onPageChange'>) => true,\n 'update:page': (_page: PayloadOf<CarouselProps, 'onPageChange'>['page']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: CarouselRootSlotProps) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notify: CarouselProps['onPageChange'] = (details) => {\n emit('page-change', details)\n emit('update:page', details.page)\n }\n const ctx = useCarousel(withXhConfig('carousel', props) as CarouselProps, notify)\n provideCarousel(ctx)\n return () => h('div', ctx.api.value.getRootProps() as Record<string, unknown>, slots.default?.({\n page: ctx.api.value.page,\n totalPages: ctx.api.value.totalPages,\n slideCount: ctx.api.value.slideCount,\n slideRange: ctx.api.value.slideRange,\n pageSnapPoints: ctx.api.value.pageSnapPoints,\n canScrollPrev: ctx.api.value.canScrollPrev,\n canScrollNext: ctx.api.value.canScrollNext,\n autoplaying: ctx.api.value.autoplaying,\n paused: ctx.api.value.paused,\n autoplayStopped: ctx.api.value.autoplayStopped,\n dragging: ctx.api.value.dragging,\n isInView: ctx.api.value.isInView,\n setPage: ctx.api.value.setPage,\n goToPrev: ctx.api.value.goToPrev,\n goToNext: ctx.api.value.goToNext,\n play: ctx.api.value.play,\n pause: ctx.api.value.pause,\n resume: ctx.api.value.resume,\n }))\n },\n})\n\nexport const XhCarouselViewport = defineComponent({\n name: 'XhCarouselViewport',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getViewportProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselList = defineComponent({\n name: 'XhCarouselList',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getListProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselItem = defineComponent({\n name: 'XhCarouselItem',\n props: {\n // 下标由作者声明,兼收字符串以支持模板里写 index=\"0\"\n index: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'div',\n ctx.api.value.getItemProps({ index: Number(props.index) }) as Record<string, unknown>,\n slots.default?.(),\n )\n },\n})\n\nexport const XhCarouselPrevTrigger = defineComponent({\n name: 'XhCarouselPrevTrigger',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('button', ctx.api.value.getPrevTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselNextTrigger = defineComponent({\n name: 'XhCarouselNextTrigger',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('button', ctx.api.value.getNextTriggerProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 播放 / 暂停开关。开启 autoplay 后应当渲染它:\n * 自动翻页必须有一处能够停止,且停止之后不会被其他交互重新启动。\n *\n * 插槽得到的 `stopped` 是用户是否已按下停止,不含悬停与焦点两路的临时暂停。\n */\nexport const XhCarouselAutoplayTrigger = defineComponent({\n name: 'XhCarouselAutoplayTrigger',\n slots: Object as SlotsType<{\n default?: (props: { stopped: boolean }) => VNode[]\n }>,\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'button',\n ctx.api.value.getAutoplayTriggerProps() as Record<string, unknown>,\n slots.default?.({ stopped: ctx.api.value.autoplayStopped }),\n )\n },\n})\n\nexport const XhCarouselIndicatorGroup = defineComponent({\n name: 'XhCarouselIndicatorGroup',\n setup(_, { slots }) {\n const ctx = useCarouselContext()\n return () => h('div', ctx.api.value.getIndicatorGroupProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhCarouselIndicator = defineComponent({\n name: 'XhCarouselIndicator',\n props: {\n // 指示点对应的页码,0 基;兼收字符串\n index: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useCarouselContext()\n return () => h(\n 'button',\n ctx.api.value.getIndicatorProps({ index: Number(props.index) }) as Record<string, unknown>,\n slots.default?.(),\n )\n },\n})\n"],"mappings":";;;;;AAyCA,MAAa,iBAAiB,gBAAgB;CAC5C,MAAM;CAEN,OAAO;EACL,MAAM,EAAE,MAAM,OAAO;EACrB,aAAa,EAAE,MAAM,OAAO;EAC5B,YAAY,EAAE,MAAM,OAAO;EAC3B,eAAe,EAAE,MAAM,OAAO;EAC9B,eAAe,EAAE,MAAM,OA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ACX,UACA,IAAI,IAAI,MAAM,wBAAwB,GACtC,MAAM,UAAU,EAAE,SAAS,IAAI,IAAI,MAAM,gBAAgB,CAAC,CAC5D;CACF;AACF,CAAC;AAED,MAAa,2BAA2B,gBAAgB;CACtD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EAAE,OAAO,IAAI,IAAI,MAAM,uBAAuB,GAA8B,MAAM,UAAU,CAAC;CAC5G;AACF,CAAC;AAED,MAAa,sBAAsB,gBAAgB;CACjD,MAAM;CACN,OAAO,EAEL,OAAO;EAAE,MAAM,CAAC,QAAQ,MAAM;EAAgC,UAAU;CAAK,EAC/E;CACA,MAAM,OAAO,EAAE,SAAS;EACtB,MAAM,MAAM,mBAAmB;EAC/B,aAAa,EACX,UACA,IAAI,IAAI,MAAM,kBAAkB,EAAE,OAAO,OAAO,MAAM,KAAK,EAAE,CAAC,GAC9D,MAAM,UAAU,CAClB;CACF;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-carousel.d.ts","names":[],"sources":["../../../src/components/carousel/use-carousel.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"use-carousel.d.ts","names":[],"sources":["../../../src/components/carousel/use-carousel.ts"],"mappings":";;;UAgBiB;EACf,KAAK,YAAY;;iBAGH,YACd,OAAO,yBACP,eAAe,0CACd"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
2
|
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
+
import { createVueIdGenerator } from "../../runtime/vue-id.js";
|
|
3
4
|
import { computed } from "vue";
|
|
5
|
+
import { createScope } from "@xihan-ui/core";
|
|
4
6
|
import { carouselMachine, connectCarousel } from "@xihan-ui/headless";
|
|
5
7
|
//#region src/components/carousel/use-carousel.ts
|
|
6
8
|
function useCarousel(props, onPageChange) {
|
|
7
9
|
const service = useMachine(carouselMachine, () => ({
|
|
8
10
|
...props,
|
|
9
11
|
onPageChange
|
|
10
|
-
}));
|
|
12
|
+
}), createScope(null, createVueIdGenerator()));
|
|
11
13
|
return { api: computed(() => connectCarousel(service, vueNormalize)) };
|
|
12
14
|
}
|
|
13
15
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-carousel.js","names":[],"sources":["../../../src/components/carousel/use-carousel.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 use carousel 相关实现。\n\nimport type { CarouselApi, CarouselSchema } from '@xihan-ui/headless'\nimport type { ComputedRef } from 'vue'\nimport { carouselMachine, connectCarousel } from '@xihan-ui/headless'\nimport { computed } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface CarouselContext {\n api: ComputedRef<CarouselApi>\n}\n\nexport function useCarousel(\n props: CarouselSchema['props'],\n onPageChange?: CarouselSchema['props']['onPageChange'],\n): CarouselContext {\n const service = useMachine(carouselMachine, () => ({ ...props, onPageChange }))\n const api = computed(() => connectCarousel(service, vueNormalize))\n return { api }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-carousel.js","names":[],"sources":["../../../src/components/carousel/use-carousel.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 use carousel 相关实现。\n\nimport type { CarouselApi, CarouselSchema } from '@xihan-ui/headless'\nimport type { ComputedRef } from 'vue'\nimport { createScope } from '@xihan-ui/core'\nimport { carouselMachine, connectCarousel } from '@xihan-ui/headless'\nimport { computed } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\nimport { createVueIdGenerator } from '../../runtime/vue-id'\n\nexport interface CarouselContext {\n api: ComputedRef<CarouselApi>\n}\n\nexport function useCarousel(\n props: CarouselSchema['props'],\n onPageChange?: CarouselSchema['props']['onPageChange'],\n): CarouselContext {\n // 根与视口带 id:用 Vue 的 useId 派生的 scope,服务端与水合两侧同号\n const service = useMachine(carouselMachine, () => ({ ...props, onPageChange }), createScope(null, createVueIdGenerator()))\n const api = computed(() => connectCarousel(service, vueNormalize))\n return { api }\n}\n"],"mappings":";;;;;;;AAoBA,SAAgB,YACd,OACA,cACiB;CAEjB,MAAM,UAAU,WAAW,wBAAwB;EAAE,GAAG;EAAO;CAAa,IAAI,YAAY,MAAM,qBAAqB,CAAC,CAAC;CAEzH,OAAO,EAAE,KADG,eAAe,gBAAgB,SAAS,YAAY,CACrD,EAAE;AACf"}
|