@xihan-ui/vue 2.1.0 → 3.1.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 +1394 -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 +66 -3
- package/dist/components/cascader/cascader.d.ts.map +1 -1
- package/dist/components/cascader/cascader.js +110 -8
- 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 +48 -12
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/checkbox-group/use-checkbox-group.d.ts +6 -1
- package/dist/components/checkbox-group/use-checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/use-checkbox-group.js +7 -3
- package/dist/components/checkbox-group/use-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 +4 -2
- package/dist/components/color-field/color-field.d.ts.map +1 -1
- package/dist/components/color-field/color-field.js +4 -2
- package/dist/components/color-field/color-field.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +115 -10
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +119 -9
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/context.js +10 -1
- package/dist/components/color-picker/context.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 +20 -4
- 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/color-swatch-picker/color-swatch-picker.d.ts.map +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.js +21 -4
- package/dist/components/color-swatch-picker/color-swatch-picker.js.map +1 -1
- package/dist/components/color-swatch-picker/use-color-swatch-picker.d.ts +6 -1
- package/dist/components/color-swatch-picker/use-color-swatch-picker.d.ts.map +1 -1
- package/dist/components/color-swatch-picker/use-color-swatch-picker.js +7 -3
- package/dist/components/color-swatch-picker/use-color-swatch-picker.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +51 -4
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +76 -6
- 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.d.ts +3 -3
- 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 +58 -18
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +110 -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 +15 -3
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +7 -2
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/context.js +10 -1
- package/dist/components/date-picker/context.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +98 -3
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +91 -7
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +103 -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 +111 -6
- 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 +17 -2
- 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 +47 -2
- 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/context.d.ts +6 -1
- package/dist/components/field/context.d.ts.map +1 -1
- package/dist/components/field/context.js +10 -1
- package/dist/components/field/context.js.map +1 -1
- package/dist/components/field/field.d.ts +9 -1
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +14 -2
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/use-field-control.d.ts +8 -1
- package/dist/components/field/use-field-control.d.ts.map +1 -1
- package/dist/components/field/use-field-control.js +14 -1
- package/dist/components/field/use-field-control.js.map +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 +26 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +15 -3
- 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/float-button/float-button.d.ts +26 -1
- package/dist/components/float-button/float-button.d.ts.map +1 -1
- package/dist/components/float-button/float-button.js +17 -5
- package/dist/components/float-button/float-button.js.map +1 -1
- package/dist/components/float-button/use-float-button.js +7 -1
- package/dist/components/float-button/use-float-button.js.map +1 -1
- package/dist/components/form/context.js +5 -1
- package/dist/components/form/context.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-control.js +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 +21 -1
- 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 +132 -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 +47 -18
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +109 -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/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/pin-input/pin-input.js +7 -1
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/popconfirm/popconfirm.d.ts +20 -1
- package/dist/components/popconfirm/popconfirm.d.ts.map +1 -1
- package/dist/components/popconfirm/popconfirm.js +9 -2
- package/dist/components/popconfirm/popconfirm.js.map +1 -1
- package/dist/components/popconfirm/use-popconfirm.js +2 -0
- package/dist/components/popconfirm/use-popconfirm.js.map +1 -1
- package/dist/components/popover/popover.d.ts +12 -1
- 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 +74 -9
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/use-radio-group.d.ts +8 -1
- package/dist/components/radio-group/use-radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/use-radio-group.js +10 -3
- package/dist/components/radio-group/use-radio-group.js.map +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/rating/rating.js +7 -1
- package/dist/components/rating/rating.js.map +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 +9 -1
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +16 -5
- 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 +28 -4
- package/dist/components/signature-pad/signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/signature-pad.js +35 -5
- 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 +19 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/sortable/sortable.d.ts +18 -0
- 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 +52 -3
- 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 +12 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +14 -5
- 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/text-field/text-field.d.ts +2 -0
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/components/text-field/text-field.js +3 -1
- package/dist/components/text-field/text-field.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts +2 -0
- package/dist/components/time-field/time-field.d.ts.map +1 -1
- package/dist/components/time-field/time-field.js +3 -1
- package/dist/components/time-field/time-field.js.map +1 -1
- package/dist/components/time-picker/context.js +10 -1
- package/dist/components/time-picker/context.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +88 -15
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +92 -9
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.d.ts +13 -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 +7 -3
- 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/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +7 -1
- package/dist/components/toggle-group/toggle-group.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 +8 -0
- 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 +72 -6
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.js +112 -13
- 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 +25 -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 +64 -49
- package/dist/index.js +58 -43
- 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/portal.js +2 -0
- package/dist/runtime/portal.js.map +1 -1
- package/dist/runtime/use-overlay-exit.js +0 -1
- package/dist/runtime/use-overlay-exit.js.map +1 -1
- package/dist/runtime/with-handlers.js +25 -0
- package/dist/runtime/with-handlers.js.map +1 -0
- 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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { withXhConfig } from "../../config/config.js";
|
|
2
|
+
import { provideGridList, provideGridListRow, useGridListContext, useGridListRow } from "./context.js";
|
|
3
|
+
import { useGridList } from "./use-grid-list.js";
|
|
4
|
+
import { computed, defineComponent, h } from "vue";
|
|
5
|
+
//#region src/components/grid-list/grid-list.ts
|
|
6
|
+
const XhGridListRoot = defineComponent({
|
|
7
|
+
name: "XhGridListRoot",
|
|
8
|
+
props: {
|
|
9
|
+
collection: { type: Array },
|
|
10
|
+
value: { type: [String, Array] },
|
|
11
|
+
defaultValue: { type: [String, Array] },
|
|
12
|
+
selectionMode: { type: String },
|
|
13
|
+
disabled: Boolean,
|
|
14
|
+
readOnly: Boolean,
|
|
15
|
+
invalid: Boolean,
|
|
16
|
+
loading: Boolean,
|
|
17
|
+
loop: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
21
|
+
typeahead: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
dir: { type: String },
|
|
26
|
+
variant: { type: String },
|
|
27
|
+
tone: { type: String },
|
|
28
|
+
size: { type: String },
|
|
29
|
+
translations: { type: Object }
|
|
30
|
+
},
|
|
31
|
+
emits: {
|
|
32
|
+
"value-change": (_details) => true,
|
|
33
|
+
"update:value": (_value) => true,
|
|
34
|
+
"action": (_details) => true
|
|
35
|
+
},
|
|
36
|
+
slots: Object,
|
|
37
|
+
setup(props, { slots, emit }) {
|
|
38
|
+
const context = useGridList(withXhConfig("grid-list", props), (details) => {
|
|
39
|
+
emit("value-change", details);
|
|
40
|
+
emit("update:value", details.value);
|
|
41
|
+
}, (details) => emit("action", details));
|
|
42
|
+
provideGridList(context);
|
|
43
|
+
return () => {
|
|
44
|
+
const api = context.api.value;
|
|
45
|
+
return h("div", api.getRootProps(), slots.default?.());
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const XhGridListLabel = defineComponent({
|
|
50
|
+
name: "XhGridListLabel",
|
|
51
|
+
setup(_, { slots }) {
|
|
52
|
+
const context = useGridListContext();
|
|
53
|
+
return () => h("span", context.api.value.getLabelProps(), slots.default?.());
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const XhGridListRow = defineComponent({
|
|
57
|
+
name: "XhGridListRow",
|
|
58
|
+
props: {
|
|
59
|
+
value: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true
|
|
62
|
+
},
|
|
63
|
+
disabled: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: void 0
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
setup(props, { slots }) {
|
|
69
|
+
const context = useGridListContext();
|
|
70
|
+
const row = computed(() => ({
|
|
71
|
+
value: props.value,
|
|
72
|
+
disabled: props.disabled
|
|
73
|
+
}));
|
|
74
|
+
provideGridListRow(row);
|
|
75
|
+
return () => h("div", context.api.value.getRowProps(row.value), slots.default?.());
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
function rowPart(name, getter, tag = "div") {
|
|
79
|
+
return defineComponent({
|
|
80
|
+
name,
|
|
81
|
+
setup(_, { slots }) {
|
|
82
|
+
const context = useGridListContext();
|
|
83
|
+
const row = useGridListRow();
|
|
84
|
+
return () => h(tag, context.api.value[getter](row.value), slots.default?.());
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const XhGridListRowSelectionIndicator = rowPart("XhGridListRowSelectionIndicator", "getRowSelectionIndicatorProps", "span");
|
|
89
|
+
const XhGridListRowContent = rowPart("XhGridListRowContent", "getRowContentProps");
|
|
90
|
+
const XhGridListRowText = rowPart("XhGridListRowText", "getRowTextProps");
|
|
91
|
+
const XhGridListRowDescription = rowPart("XhGridListRowDescription", "getRowDescriptionProps");
|
|
92
|
+
const XhGridListRowActions = rowPart("XhGridListRowActions", "getRowActionsProps");
|
|
93
|
+
const XhGridListRowAction = defineComponent({
|
|
94
|
+
name: "XhGridListRowAction",
|
|
95
|
+
setup(_, { slots }) {
|
|
96
|
+
const context = useGridListContext();
|
|
97
|
+
const row = useGridListRow();
|
|
98
|
+
return () => h("button", context.api.value.getRowActionProps(row.value), slots.default?.());
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const XhGridListEmpty = defineComponent({
|
|
102
|
+
name: "XhGridListEmpty",
|
|
103
|
+
setup(_, { slots }) {
|
|
104
|
+
const context = useGridListContext();
|
|
105
|
+
return () => h("div", context.api.value.getEmptyProps(), slots.default?.());
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
const XhGridListLoading = defineComponent({
|
|
109
|
+
name: "XhGridListLoading",
|
|
110
|
+
setup(_, { slots }) {
|
|
111
|
+
const context = useGridListContext();
|
|
112
|
+
return () => h("div", context.api.value.getLoadingProps(), slots.default?.());
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
//#endregion
|
|
116
|
+
export { XhGridListEmpty, XhGridListLabel, XhGridListLoading, XhGridListRoot, XhGridListRow, XhGridListRowAction, XhGridListRowActions, XhGridListRowContent, XhGridListRowDescription, XhGridListRowSelectionIndicator, XhGridListRowText };
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=grid-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-list.js","names":[],"sources":["../../../src/components/grid-list/grid-list.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// 提供 grid list 相关实现。\n\nimport type { ControlVariant, Direction, Size, Tone } from '@xihan-ui/core'\nimport type { GridListNode, GridListRowProps, GridListSchema, GridListSelectionMode, GridListTranslations } 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 { provideGridList, provideGridListRow, useGridListContext, useGridListRow } from './context'\nimport { useGridList } from './use-grid-list'\n\ntype GridListProps = GridListSchema['props']\n\nexport const XhGridListRoot = defineComponent({\n name: 'XhGridListRoot',\n props: {\n collection: { type: Array as PropType<GridListNode[]> },\n value: { type: [String, Array] as PropType<string | string[]> },\n defaultValue: { type: [String, Array] as PropType<string | string[]> },\n selectionMode: { type: String as PropType<GridListSelectionMode> },\n disabled: Boolean,\n readOnly: Boolean,\n invalid: Boolean,\n loading: Boolean,\n loop: { type: Boolean, default: undefined },\n typeahead: { type: Boolean, default: undefined },\n dir: { type: String as PropType<Direction> },\n variant: { type: String as PropType<ControlVariant> },\n tone: { type: String as PropType<Tone> },\n size: { type: String as PropType<Size> },\n translations: { type: Object as PropType<Partial<GridListTranslations>> },\n },\n emits: {\n 'value-change': (_details: PayloadOf<GridListProps, 'onValueChange'>) => true,\n 'update:value': (_value: PayloadOf<GridListProps, 'onValueChange'>['value']) => true,\n 'action': (_details: PayloadOf<GridListProps, 'onAction'>) => true,\n },\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n setup(props, { slots, emit }) {\n const context = useGridList(\n withXhConfig('grid-list', props) as GridListProps,\n (details) => {\n emit('value-change', details)\n emit('update:value', details.value)\n },\n details => emit('action', details),\n )\n provideGridList(context)\n return () => {\n const api = context.api.value\n return h('div', api.getRootProps() as Record<string, unknown>, slots.default?.())\n }\n },\n})\n\nexport const XhGridListLabel = defineComponent({\n name: 'XhGridListLabel',\n setup(_, { slots }) {\n const context = useGridListContext()\n return () => h('span', context.api.value.getLabelProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhGridListRow = defineComponent({\n name: 'XhGridListRow',\n props: {\n value: { type: String, required: true },\n disabled: { type: Boolean, default: undefined },\n },\n setup(props, { slots }) {\n const context = useGridListContext()\n const row = computed<GridListRowProps>(() => ({ value: props.value, disabled: props.disabled }))\n provideGridListRow(row)\n return () => h('div', context.api.value.getRowProps(row.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nfunction rowPart(name: string, getter: keyof Pick<\n ReturnType<typeof useGridList>['api']['value'],\n 'getRowSelectionIndicatorProps' | 'getRowContentProps' | 'getRowTextProps' | 'getRowDescriptionProps' | 'getRowActionsProps'\n>, tag: 'div' | 'span' = 'div'): ReturnType<typeof defineComponent> {\n return defineComponent({\n name,\n setup(_, { slots }) {\n const context = useGridListContext()\n const row = useGridListRow()\n return () => h(tag, (context.api.value[getter] as (props: GridListRowProps) => Record<string, unknown>)(row.value), slots.default?.())\n },\n })\n}\n\n// 选择标记与同族条目指示器一样是 span,与 React 版同一个标签\nexport const XhGridListRowSelectionIndicator = rowPart('XhGridListRowSelectionIndicator', 'getRowSelectionIndicatorProps', 'span')\nexport const XhGridListRowContent = rowPart('XhGridListRowContent', 'getRowContentProps')\nexport const XhGridListRowText = rowPart('XhGridListRowText', 'getRowTextProps')\nexport const XhGridListRowDescription = rowPart('XhGridListRowDescription', 'getRowDescriptionProps')\nexport const XhGridListRowActions = rowPart('XhGridListRowActions', 'getRowActionsProps')\n\nexport const XhGridListRowAction = defineComponent({\n name: 'XhGridListRowAction',\n setup(_, { slots }) {\n const context = useGridListContext()\n const row = useGridListRow()\n return () => h('button', context.api.value.getRowActionProps(row.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhGridListEmpty = defineComponent({\n name: 'XhGridListEmpty',\n setup(_, { slots }) {\n const context = useGridListContext()\n return () => h('div', context.api.value.getEmptyProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\nexport const XhGridListLoading = defineComponent({\n name: 'XhGridListLoading',\n setup(_, { slots }) {\n const context = useGridListContext()\n return () => h('div', context.api.value.getLoadingProps() as Record<string, unknown>, slots.default?.())\n },\n})\n"],"mappings":";;;;;AAkBA,MAAa,iBAAiB,gBAAgB;CAC5C,MAAM;CACN,OAAO;EACL,YAAY,EAAE,MAAM,MAAkC;EACtD,OAAO,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EAC9D,cAAc,EAAE,MAAM,CAAC,QAAQ,KAAK,EAAiC;EACrE,eAAe,EAAE,MAAM,OAA0C;EACjE,UAAU;EACV,UAAU;EACV,SAAS;EACT,SAAS;EACT,MAAM;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC1C,WAAW;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC/C,KAAK,EAAE,MAAM,OAA8B;EAC3C,SAAS,EAAE,MAAM,OAAmC;EACpD,MAAM,EAAE,MAAM,OAAyB;EACvC,MAAM,EAAE,MAAM,OAAyB;EACvC,cAAc,EAAE,MAAM,OAAkD;CAC1E;CACA,OAAO;EACL,iBAAiB,aAAwD;EACzE,iBAAiB,WAA+D;EAChF,WAAW,aAAmD;CAChE;CACA,OAAO;CACP,MAAM,OAAO,EAAE,OAAO,QAAQ;EAC5B,MAAM,UAAU,YACd,aAAa,aAAa,KAAK,IAC9B,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,qBAAqB,iBAAiB;AAC/E,MAAa,2BAA2B,QAAQ,4BAA4B,wBAAwB;AACpG,MAAa,uBAAuB,QAAQ,wBAAwB,oBAAoB;AAExF,MAAa,sBAAsB,gBAAgB;CACjD,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,UAAU,mBAAmB;EACnC,MAAM,MAAM,eAAe;EAC3B,aAAa,EAAE,UAAU,QAAQ,IAAI,MAAM,kBAAkB,IAAI,KAAK,GAA8B,MAAM,UAAU,CAAC;CACvH;AACF,CAAC;AAED,MAAa,kBAAkB,gBAAgB;CAC7C,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,UAAU,mBAAmB;EACnC,aAAa,EAAE,OAAO,QAAQ,IAAI,MAAM,cAAc,GAA8B,MAAM,UAAU,CAAC;CACvG;AACF,CAAC;AAED,MAAa,oBAAoB,gBAAgB;CAC/C,MAAM;CACN,MAAM,GAAG,EAAE,SAAS;EAClB,MAAM,UAAU,mBAAmB;EACnC,aAAa,EAAE,OAAO,QAAQ,IAAI,MAAM,gBAAgB,GAA8B,MAAM,UAAU,CAAC;CACzG;AACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComputedRef } from "vue";
|
|
2
|
+
import { Service } from "@xihan-ui/core";
|
|
3
|
+
import { GridListApi, GridListSchema } from "@xihan-ui/headless";
|
|
4
|
+
//#region src/components/grid-list/use-grid-list.d.ts
|
|
5
|
+
interface GridListContext {
|
|
6
|
+
api: ComputedRef<GridListApi>;
|
|
7
|
+
service: Service<GridListSchema>;
|
|
8
|
+
}
|
|
9
|
+
declare function useGridList(props: GridListSchema['props'], onValueChange?: GridListSchema['props']['onValueChange'], onAction?: GridListSchema['props']['onAction']): GridListContext;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { GridListContext, useGridList };
|
|
12
|
+
//# sourceMappingURL=use-grid-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-grid-list.d.ts","names":[],"sources":["../../../src/components/grid-list/use-grid-list.ts"],"mappings":";;;;UAeiB;EACf,KAAK,YAAY;EACjB,SAAS,QAAQ;;iBAGH,YACd,OAAO,yBACP,gBAAgB,0CAChB,WAAW,sCACV"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
|
+
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { connectGridList, gridListMachine } from "@xihan-ui/headless";
|
|
5
|
+
//#region src/components/grid-list/use-grid-list.ts
|
|
6
|
+
function useGridList(props, onValueChange, onAction) {
|
|
7
|
+
const service = useMachine(gridListMachine, () => ({
|
|
8
|
+
...props,
|
|
9
|
+
onValueChange,
|
|
10
|
+
onAction
|
|
11
|
+
}));
|
|
12
|
+
return {
|
|
13
|
+
api: computed(() => connectGridList(service, vueNormalize)),
|
|
14
|
+
service
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useGridList };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=use-grid-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-grid-list.js","names":[],"sources":["../../../src/components/grid-list/use-grid-list.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 grid list 相关实现。\n\nimport type { Service } from '@xihan-ui/core'\nimport type { GridListApi, GridListSchema } from '@xihan-ui/headless'\nimport type { ComputedRef } from 'vue'\nimport { connectGridList, gridListMachine } from '@xihan-ui/headless'\nimport { computed } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface GridListContext {\n api: ComputedRef<GridListApi>\n service: Service<GridListSchema>\n}\n\nexport function useGridList(\n props: GridListSchema['props'],\n onValueChange?: GridListSchema['props']['onValueChange'],\n onAction?: GridListSchema['props']['onAction'],\n): GridListContext {\n const service = useMachine(gridListMachine, () => ({ ...props, onValueChange, onAction }))\n return { api: computed(() => connectGridList(service, vueNormalize)), service }\n}\n"],"mappings":";;;;;AAoBA,SAAgB,YACd,OACA,eACA,UACiB;CACjB,MAAM,UAAU,WAAW,wBAAwB;EAAE,GAAG;EAAO;EAAe;CAAS,EAAE;CACzF,OAAO;EAAE,KAAK,eAAe,gBAAgB,SAAS,YAAY,CAAC;EAAG;CAAQ;AAChF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
2
|
import { PropType, SlotsType, VNode } from "vue";
|
|
3
3
|
import { Direction, Size, Tone } from "@xihan-ui/core";
|
|
4
|
-
import { HeatmapApi, HeatmapAxisInput, HeatmapCellDetails, HeatmapCellMeta, HeatmapLegendBound, HeatmapMatrixCellMeta, HeatmapPalette, HeatmapSchema, HeatmapTranslations, HeatmapValue, HeatmapVariant } from "@xihan-ui/headless";
|
|
4
|
+
import { HeatmapApi, HeatmapAxisInput, HeatmapCellDetails, HeatmapCellMeta, HeatmapLegendBound, HeatmapMatrixCellMeta, HeatmapPalette, HeatmapPolarity, HeatmapScaleMode, HeatmapSchema, HeatmapTranslations, HeatmapValue, HeatmapVariant } from "@xihan-ui/headless";
|
|
5
5
|
//#region src/components/heatmap/heatmap.d.ts
|
|
6
6
|
type HeatmapProps = HeatmapSchema['props'];
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ type HeatmapProps = HeatmapSchema['props'];
|
|
|
9
9
|
* 三形态通用的一组(`focusedCell` / `anchorCell` / `setFocusedCell`)也包含在内:
|
|
10
10
|
* 矩阵形态下带 Date 的一组恒为 null,自行铺设矩阵时只有这一组能读取、移动锚点。
|
|
11
11
|
*/
|
|
12
|
-
type HeatmapRootSlotProps = Pick<HeatmapApi, 'variant' | 'grid' | 'monthGrid' | 'matrixGrid' | 'focusedCell' | 'focusedDate' | 'anchorCell' | 'anchorDate' | 'activeCell' | 'detailOpen' | 'cellAt' | 'setFocusedCell' | 'setFocusedDate'>;
|
|
12
|
+
type HeatmapRootSlotProps = Pick<HeatmapApi, 'variant' | 'grid' | 'monthGrid' | 'matrixGrid' | 'focusedCell' | 'focusedDate' | 'anchorCell' | 'anchorDate' | 'activeCell' | 'detailOpen' | 'scaleMode' | 'legendItems' | 'cellAt' | 'setFocusedCell' | 'setFocusedDate'>;
|
|
13
13
|
/**
|
|
14
14
|
* `cell` 插槽的载荷:日期形态给日历的格子,矩阵形态给矩阵的格子。
|
|
15
15
|
* 两者的坐标不同,用 `'date' in cell` 区分。
|
|
@@ -40,6 +40,16 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
40
40
|
thresholds: {
|
|
41
41
|
type: PropType<number[]>;
|
|
42
42
|
};
|
|
43
|
+
scale: {
|
|
44
|
+
type: PropType<HeatmapScaleMode>;
|
|
45
|
+
};
|
|
46
|
+
midpoint: {
|
|
47
|
+
type: NumberConstructor;
|
|
48
|
+
};
|
|
49
|
+
continuous: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
43
53
|
firstDayOfWeek: {
|
|
44
54
|
type: NumberConstructor;
|
|
45
55
|
};
|
|
@@ -58,6 +68,10 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
58
68
|
size: {
|
|
59
69
|
type: PropType<Size>;
|
|
60
70
|
};
|
|
71
|
+
animated: {
|
|
72
|
+
type: BooleanConstructor;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
61
75
|
translations: {
|
|
62
76
|
type: PropType<Partial<HeatmapTranslations>>;
|
|
63
77
|
};
|
|
@@ -66,6 +80,7 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
66
80
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
81
|
'cell-focus': (_details: PayloadOf<HeatmapProps, "onCellFocus">) => true;
|
|
68
82
|
'cell-active': (_details: PayloadOf<HeatmapProps, "onCellActive">) => true;
|
|
83
|
+
'cell-press': (_details: PayloadOf<HeatmapProps, "onCellPress">) => true;
|
|
69
84
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
85
|
variant: {
|
|
71
86
|
type: PropType<HeatmapVariant>;
|
|
@@ -91,6 +106,16 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
91
106
|
thresholds: {
|
|
92
107
|
type: PropType<number[]>;
|
|
93
108
|
};
|
|
109
|
+
scale: {
|
|
110
|
+
type: PropType<HeatmapScaleMode>;
|
|
111
|
+
};
|
|
112
|
+
midpoint: {
|
|
113
|
+
type: NumberConstructor;
|
|
114
|
+
};
|
|
115
|
+
continuous: {
|
|
116
|
+
type: BooleanConstructor;
|
|
117
|
+
default: undefined;
|
|
118
|
+
};
|
|
94
119
|
firstDayOfWeek: {
|
|
95
120
|
type: NumberConstructor;
|
|
96
121
|
};
|
|
@@ -109,13 +134,21 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
109
134
|
size: {
|
|
110
135
|
type: PropType<Size>;
|
|
111
136
|
};
|
|
137
|
+
animated: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: undefined;
|
|
140
|
+
};
|
|
112
141
|
translations: {
|
|
113
142
|
type: PropType<Partial<HeatmapTranslations>>;
|
|
114
143
|
};
|
|
115
144
|
}>> & Readonly<{
|
|
116
145
|
"onCell-focus"?: ((_details: HeatmapCellDetails) => any) | undefined;
|
|
117
146
|
"onCell-active"?: ((_details: HeatmapCellDetails | null) => any) | undefined;
|
|
118
|
-
|
|
147
|
+
"onCell-press"?: ((_details: HeatmapCellDetails) => any) | undefined;
|
|
148
|
+
}>, {
|
|
149
|
+
animated: boolean;
|
|
150
|
+
continuous: boolean;
|
|
151
|
+
}, SlotsType<{
|
|
119
152
|
default?: (props: HeatmapRootSlotProps) => VNode[];
|
|
120
153
|
/** 铺开网格时每一格的内容插槽,默认是空格子;三种形态都铺设。 */
|
|
121
154
|
cell?: (props: HeatmapCellSlotProps) => VNode[];
|
|
@@ -266,13 +299,17 @@ declare const XhHeatmapLegendLabel: import("vue").DefineComponent<import("vue").
|
|
|
266
299
|
required: true;
|
|
267
300
|
};
|
|
268
301
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
269
|
-
/**
|
|
302
|
+
/** 对照条中的一格,与网格中同档(发散色阶下同侧同档)的格子同色。 */
|
|
270
303
|
declare const XhHeatmapLegendItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
271
304
|
/** 档位,兼收字符串。 */
|
|
272
305
|
value: {
|
|
273
306
|
type: PropType<number | string>;
|
|
274
307
|
required: true;
|
|
275
308
|
};
|
|
309
|
+
/** 发散色阶下这一格在中点的哪一侧;顺序色阶与中点那一格不写。 */
|
|
310
|
+
polarity: {
|
|
311
|
+
type: PropType<HeatmapPolarity>;
|
|
312
|
+
};
|
|
276
313
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
277
314
|
[key: string]: any;
|
|
278
315
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -281,6 +318,10 @@ declare const XhHeatmapLegendItem: import("vue").DefineComponent<import("vue").E
|
|
|
281
318
|
type: PropType<number | string>;
|
|
282
319
|
required: true;
|
|
283
320
|
};
|
|
321
|
+
/** 发散色阶下这一格在中点的哪一侧;顺序色阶与中点那一格不写。 */
|
|
322
|
+
polarity: {
|
|
323
|
+
type: PropType<HeatmapPolarity>;
|
|
324
|
+
};
|
|
284
325
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
285
326
|
//#endregion
|
|
286
327
|
export { HeatmapCellSlotProps, HeatmapRootSlotProps, XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDay };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/heatmap.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/heatmap.ts"],"mappings":";;;;;KAyCK,eAAe;;;;;;KAOR,uBAAuB,KACjC;;;;;KAsBU,uBAAuB,kBAAkB;cAExC,6BAAa,8BAAA;;IAIK,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;IACV,MAAA,SAAS;;;IACN,MAAA,SAAS;;;;;;;;;;;;IAIN,MAAA;;;IACJ,MAAA,SAAS;;;;;;;;;;;;;;;;IAKX,MAAA,SAAS;;;IACR,MAAA,SAAS;;;IACN,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;;;;;IAED,MAAA,SAAS,QAAQ;;;;;EAIxB,eAAA,UAAA,UAAU;EACT,gBAAA,UAAA,UAAU;EACX,eAAA,UAAA,UAAU;;;IAxBR,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;IACV,MAAA,SAAS;;;IACN,MAAA,SAAS;;;;;;;;;;;;IAIN,MAAA;;;IACJ,MAAA,SAAS;;;;;;;;;;;;;;;;IAKX,MAAA,SAAS;;;IACR,MAAA,SAAS;;;IACN,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;;;;;IAED,MAAA,SAAS,QAAQ;;;;;;;;;;EASvC,WAAC,OAAO,yBAAyB;;EAEpC,QAAC,OAAO,yBAAyB;;EAE9B,WAAC,OAAO,8BAA8B;kCAsClD;;cAGW,6BAAa,0BAAA,oBAAA,4BAAA;;8BAMxB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,mCAAmB,8BAAA;;;;;;;;;;;;;;MAW9B,oDAAA;;;;;cAMW,4BAAY,8BAAA;;IAGc,MAAA;;;;;;;;;;IAAA,MAAA;;;;;;MAkBrC,oDAAA;;cAGW,gCAAgB,8BAAA;;IAGU,MAAA;;;;;;IAAA,MAAA;;MAOrC,oDAAA;;cAGW,mCAAmB,8BAAA;;;;;;;;;;;;MAS9B,oDAAA;;cAGW,iCAAiB,8BAAA;;;;;;;;;;MAS5B,oDAAA;;cAGW,oCAAoB,8BAAA;;;;;;;;;;;;MAS/B,oDAAA;;;;;cAMW,6BAAa,8BAAA;;;;;;;;;;;;;;;;;;;;MAexB,oDAAA;;cAGW,gCAAgB,0BAAA,oBAAA,4BAAA;;8BAM3B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,+BAAe,0BAAA,oBAAA,4BAAA;;8BAM1B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,oCAAoB,8BAAA;;;IAIJ,MAAA,SAAS;;;;;;;;IAAT,MAAA,SAAS;;;MAMpC,oDAAA;;cAGW,mCAAmB,8BAAA;;;IAIO,MAAA;;;;;IAEP,MAAA,SAAS;;;;;;;IAFF,MAAA;;;;;IAEP,MAAA,SAAS;;MAOvC,oDAAA"}
|
|
@@ -15,27 +15,44 @@ const XhHeatmapRoot = defineComponent({
|
|
|
15
15
|
endDate: { type: String },
|
|
16
16
|
levels: { type: Number },
|
|
17
17
|
thresholds: { type: Array },
|
|
18
|
+
scale: { type: String },
|
|
19
|
+
midpoint: { type: Number },
|
|
20
|
+
continuous: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
18
24
|
firstDayOfWeek: { type: Number },
|
|
19
25
|
locale: { type: String },
|
|
20
26
|
dir: { type: String },
|
|
21
27
|
tone: { type: String },
|
|
22
28
|
palette: { type: String },
|
|
23
29
|
size: { type: String },
|
|
30
|
+
animated: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
24
34
|
translations: { type: Object }
|
|
25
35
|
},
|
|
26
36
|
emits: {
|
|
27
37
|
"cell-focus": (_details) => true,
|
|
28
|
-
"cell-active": (_details) => true
|
|
38
|
+
"cell-active": (_details) => true,
|
|
39
|
+
"cell-press": (_details) => true
|
|
29
40
|
},
|
|
30
41
|
slots: Object,
|
|
31
42
|
setup(props, { slots, emit }) {
|
|
32
43
|
const notifyFocus = (details) => emit("cell-focus", details);
|
|
33
44
|
const notifyActive = (details) => emit("cell-active", details);
|
|
34
|
-
const
|
|
45
|
+
const notifyPress = (details) => emit("cell-press", details);
|
|
46
|
+
const ctx = useHeatmap(withXhConfig("heatmap", props), notifyFocus, notifyActive, notifyPress);
|
|
35
47
|
provideHeatmap(ctx);
|
|
36
48
|
return () => {
|
|
37
49
|
const api = ctx.api.value;
|
|
38
|
-
return h("div",
|
|
50
|
+
return h("div", {
|
|
51
|
+
...api.getRootProps(),
|
|
52
|
+
ref: (el) => {
|
|
53
|
+
ctx.rootRef.value = el;
|
|
54
|
+
}
|
|
55
|
+
}, slots.default ? slots.default({
|
|
39
56
|
variant: api.variant,
|
|
40
57
|
grid: api.grid,
|
|
41
58
|
monthGrid: api.monthGrid,
|
|
@@ -46,6 +63,8 @@ const XhHeatmapRoot = defineComponent({
|
|
|
46
63
|
anchorDate: api.anchorDate,
|
|
47
64
|
activeCell: api.activeCell,
|
|
48
65
|
detailOpen: api.detailOpen,
|
|
66
|
+
scaleMode: api.scaleMode,
|
|
67
|
+
legendItems: api.legendItems,
|
|
49
68
|
cellAt: api.cellAt,
|
|
50
69
|
setFocusedCell: api.setFocusedCell,
|
|
51
70
|
setFocusedDate: api.setFocusedDate
|
|
@@ -200,19 +219,25 @@ value: {
|
|
|
200
219
|
return () => h("span", ctx.api.value.getLegendLabelProps({ bound: props.value }), slots.default?.());
|
|
201
220
|
}
|
|
202
221
|
});
|
|
203
|
-
/**
|
|
222
|
+
/** 对照条中的一格,与网格中同档(发散色阶下同侧同档)的格子同色。 */
|
|
204
223
|
const XhHeatmapLegendItem = defineComponent({
|
|
205
224
|
name: "XhHeatmapLegendItem",
|
|
206
|
-
props: {
|
|
207
|
-
|
|
208
|
-
value: {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
225
|
+
props: {
|
|
226
|
+
/** 档位,兼收字符串。 */
|
|
227
|
+
value: {
|
|
228
|
+
type: [Number, String],
|
|
229
|
+
required: true
|
|
230
|
+
},
|
|
231
|
+
/** 发散色阶下这一格在中点的哪一侧;顺序色阶与中点那一格不写。 */
|
|
232
|
+
polarity: { type: String }
|
|
233
|
+
},
|
|
212
234
|
setup(props, { slots }) {
|
|
213
235
|
const ctx = useHeatmapContext();
|
|
214
236
|
const level = computed(() => Number(props.value) || 0);
|
|
215
|
-
return () => h("span", ctx.api.value.getLegendItemProps({
|
|
237
|
+
return () => h("span", ctx.api.value.getLegendItemProps({
|
|
238
|
+
level: level.value,
|
|
239
|
+
polarity: props.polarity ?? null
|
|
240
|
+
}), slots.default?.());
|
|
216
241
|
}
|
|
217
242
|
});
|
|
218
243
|
/**
|
|
@@ -223,9 +248,10 @@ value: {
|
|
|
223
248
|
function renderDefaultTree(api, cellSlot, tooltipSlot) {
|
|
224
249
|
const legend = h(XhHeatmapLegend, null, () => [
|
|
225
250
|
h(XhHeatmapLegendLabel, { value: "low" }, () => api.legendText.low),
|
|
226
|
-
...
|
|
227
|
-
key: level
|
|
228
|
-
value: level
|
|
251
|
+
...api.legendItems.map((item) => h(XhHeatmapLegendItem, {
|
|
252
|
+
key: `${item.polarity ?? "center"}-${item.level}`,
|
|
253
|
+
value: item.level,
|
|
254
|
+
polarity: item.polarity ?? void 0
|
|
229
255
|
})),
|
|
230
256
|
h(XhHeatmapLegendLabel, { value: "high" }, () => api.legendText.high)
|
|
231
257
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.js","names":[],"sources":["../../../src/components/heatmap/heatmap.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// 提供 heatmap 相关实现。\n\nimport type { Direction, Size, Tone } from '@xihan-ui/core'\nimport type {\n HeatmapApi,\n HeatmapAxisInput,\n HeatmapCellDetails,\n HeatmapCellMeta,\n HeatmapLegendBound,\n HeatmapMatrixCellMeta,\n HeatmapMatrixGrid,\n HeatmapMonthGrid,\n HeatmapPalette,\n HeatmapRowProps,\n HeatmapSchema,\n HeatmapTranslations,\n HeatmapValue,\n HeatmapVariant,\n} from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { heatmapMatrixKey, normalizeHeatmapNumber, normalizeHeatmapString } from '@xihan-ui/headless'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport {\n provideHeatmap,\n provideHeatmapMonth,\n provideHeatmapRow,\n useHeatmapContext,\n useHeatmapMonth,\n useHeatmapRow,\n} from './context'\nimport { useHeatmap } from './use-heatmap'\n\ntype HeatmapProps = HeatmapSchema['props']\n\n/**\n * 默认插槽的载荷:三张网格模型与锚点、当前详情,以及移动锚点的动作。\n * 三形态通用的一组(`focusedCell` / `anchorCell` / `setFocusedCell`)也包含在内:\n * 矩阵形态下带 Date 的一组恒为 null,自行铺设矩阵时只有这一组能读取、移动锚点。\n */\nexport type HeatmapRootSlotProps = Pick<\n HeatmapApi,\n | 'variant'\n | 'grid'\n | 'monthGrid'\n | 'matrixGrid'\n | 'focusedCell'\n | 'focusedDate'\n | 'anchorCell'\n | 'anchorDate'\n | 'activeCell'\n | 'detailOpen'\n | 'cellAt'\n | 'setFocusedCell'\n | 'setFocusedDate'\n>\n\n/**\n * `cell` 插槽的载荷:日期形态给日历的格子,矩阵形态给矩阵的格子。\n * 两者的坐标不同,用 `'date' in cell` 区分。\n */\nexport type HeatmapCellSlotProps = HeatmapCellMeta | HeatmapMatrixCellMeta\n\nexport const XhHeatmapRoot = defineComponent({\n name: 'XhHeatmapRoot',\n // 缺省值由机器与 connect 决定;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n variant: { type: String as PropType<HeatmapVariant> },\n value: { type: Array as PropType<HeatmapValue[]> },\n rows: { type: Array as PropType<HeatmapAxisInput[]> },\n columns: { type: Array as PropType<HeatmapAxisInput[]> },\n startDate: { type: String },\n endDate: { type: String },\n levels: { type: Number },\n thresholds: { type: Array as PropType<number[]> },\n firstDayOfWeek: { type: Number },\n locale: { type: String },\n dir: { type: String as PropType<Direction> },\n tone: { type: String as PropType<Tone> },\n palette: { type: String as PropType<HeatmapPalette> },\n size: { type: String as PropType<Size> },\n translations: { type: Object as PropType<Partial<HeatmapTranslations>> },\n },\n // 只读事件,没有双向绑定:热力图不产生值,只报焦点与详情落在哪一格\n emits: {\n 'cell-focus': (_details: PayloadOf<HeatmapProps, 'onCellFocus'>) => true,\n 'cell-active': (_details: PayloadOf<HeatmapProps, 'onCellActive'>) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: HeatmapRootSlotProps) => VNode[]\n /** 铺开网格时每一格的内容插槽,默认是空格子;三种形态都铺设。 */\n cell?: (props: HeatmapCellSlotProps) => VNode[]\n /** 详情条的内容插槽;写了它才会铺设 tooltip 部件。 */\n tooltip?: (props: HeatmapCellDetails | null) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notifyFocus: HeatmapProps['onCellFocus'] = details => emit('cell-focus', details)\n const notifyActive: HeatmapProps['onCellActive'] = details => emit('cell-active', details)\n const ctx = useHeatmap(withXhConfig('heatmap', props) as HeatmapProps, notifyFocus, notifyActive)\n provideHeatmap(ctx)\n return () => {\n const api = ctx.api.value\n return h(\n 'div',\n api.getRootProps() as Record<string, unknown>,\n slots.default\n ? slots.default({\n variant: api.variant,\n grid: api.grid,\n monthGrid: api.monthGrid,\n matrixGrid: api.matrixGrid,\n focusedCell: api.focusedCell,\n focusedDate: api.focusedDate,\n anchorCell: api.anchorCell,\n anchorDate: api.anchorDate,\n activeCell: api.activeCell,\n detailOpen: api.detailOpen,\n cellAt: api.cellAt,\n setFocusedCell: api.setFocusedCell,\n setFocusedDate: api.setFocusedDate,\n })\n : renderDefaultTree(api, slots.cell, slots.tooltip),\n )\n }\n },\n})\n\n/** role=grid 的容器:键盘在这里收口,可及名字也挂在它上面。 */\nexport const XhHeatmapGrid = defineComponent({\n name: 'XhHeatmapGrid',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getGridProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 月历形态中的一个自然月块,块内的行从这里取月份身份。 */\nexport const XhHeatmapMonthBlock = defineComponent({\n name: 'XhHeatmapMonthBlock',\n props: {\n /** 月份身份 YYYY-MM。 */\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n provideHeatmapMonth(computed(() => props.value))\n return () => h('div', ctx.api.value.getMonthBlockProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 一行。身份写在 value 上,解释方式由形态决定:\n * 日历形态是行序 0-6,月历形态是月内第几周,矩阵形态是行身份;未写即坐标轴行。\n */\nexport const XhHeatmapRow = defineComponent({\n name: 'XhHeatmapRow',\n props: {\n value: { type: [Number, String] as PropType<number | string> },\n /** 月历形态:所属月份 YYYY-MM;写在月块中时不必再写一遍。 */\n month: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const blockMonth = useHeatmapMonth()\n const row = computed<HeatmapRowProps>(() => {\n const variant = ctx.api.value.variant\n if (variant === 'matrix')\n return { row: normalizeHeatmapString(props.value) }\n if (variant === 'month')\n return { month: props.month ?? blockMonth?.value, week: normalizeHeatmapNumber(props.value) }\n return { weekDay: normalizeHeatmapNumber(props.value) }\n })\n provideHeatmapRow(computed(() => row.value.row))\n return () => h('div', ctx.api.value.getRowProps(row.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 行首的星期名。未提供行序即坐标轴行行首的占位,它只负责让月份与格子对齐。 */\nexport const XhHeatmapWeekDay = defineComponent({\n name: 'XhHeatmapWeekDay',\n props: {\n value: { type: [Number, String] as PropType<number | string> },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const weekDay = computed(() => normalizeHeatmapNumber(props.value))\n return () => h('span', ctx.api.value.getWeekDayProps({ weekDay: weekDay.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 月份名。日历形态中横跨该月所占的列,月历形态中是一块的标题。 */\nexport const XhHeatmapMonthLabel = defineComponent({\n name: 'XhHeatmapMonthLabel',\n props: {\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getMonthLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 矩阵的行名。未写 value 即表头行行首的角落占位。 */\nexport const XhHeatmapRowLabel = defineComponent({\n name: 'XhHeatmapRowLabel',\n props: {\n value: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getRowLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 矩阵的列名。 */\nexport const XhHeatmapColumnLabel = defineComponent({\n name: 'XhHeatmapColumnLabel',\n props: {\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getColumnLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 一格。日期形态中 value 是 ISO 日期,矩阵形态中 value 是列身份、\n * 行身份从所在的行取(也可以写在 row 上)。数值与档位由 connect 查询网格。\n */\nexport const XhHeatmapCell = defineComponent({\n name: 'XhHeatmapCell',\n props: {\n value: { type: String, required: true },\n /** 矩阵形态:行身份;写在行中时不必再写一遍。 */\n row: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const parentRow = useHeatmapRow()\n const cell = computed(() => ctx.api.value.variant === 'matrix'\n ? { row: props.row ?? parentRow?.value, column: props.value }\n : { date: props.value })\n return () => h('div', ctx.api.value.getCellProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 详情条:悬停或聚焦到某一格时显示,位置由连接层测量后写为内联样式。 */\nexport const XhHeatmapTooltip = defineComponent({\n name: 'XhHeatmapTooltip',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getTooltipProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 色阶对照条。 */\nexport const XhHeatmapLegend = defineComponent({\n name: 'XhHeatmapLegend',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getLegendProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 对照条一端的文字:value 写 low 或 high,文字从 api.legendText 取。 */\nexport const XhHeatmapLegendLabel = defineComponent({\n name: 'XhHeatmapLegendLabel',\n props: {\n /** 挂在哪一端:low 是色阶起点,high 是终点。 */\n value: { type: String as PropType<HeatmapLegendBound>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getLegendLabelProps({ bound: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 对照条中的一格,与网格中同档的格子同色。 */\nexport const XhHeatmapLegendItem = defineComponent({\n name: 'XhHeatmapLegendItem',\n props: {\n /** 档位,兼收字符串。 */\n value: { type: [Number, String] as PropType<number | string>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const level = computed(() => Number(props.value) || 0)\n return () => h('span', ctx.api.value.getLegendItemProps({ level: level.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 未写默认插槽时按网格模型铺开的整套结构,作者只提供数据。\n * 与手写部件产出的 DOM 完全一致,需要修改结构时写默认插槽,行为不变。\n * 详情条只有写了 tooltip 插槽才铺设,未写时整棵树与从前逐字一致。\n */\nfunction renderDefaultTree(\n api: HeatmapApi,\n cellSlot?: (node: HeatmapCellSlotProps) => VNode[],\n tooltipSlot?: (details: HeatmapCellDetails | null) => VNode[],\n): VNode[] {\n // 两端各一个字:一排色块自己说不出哪头是多\n const legend = h(\n XhHeatmapLegend,\n null,\n () => [\n h(XhHeatmapLegendLabel, { value: 'low' }, () => api.legendText.low),\n ...Array.from(\n { length: api.monthGrid?.levels ?? api.matrixGrid?.levels ?? api.grid.levels },\n (_, level) => h(XhHeatmapLegendItem, { key: level, value: level }),\n ),\n h(XhHeatmapLegendLabel, { value: 'high' }, () => api.legendText.high),\n ],\n )\n const tooltip = tooltipSlot\n ? [h(XhHeatmapTooltip, null, () => tooltipSlot(api.activeCell))]\n : []\n\n if (api.matrixGrid)\n return [...renderMatrixTree(api.matrixGrid, cellSlot), ...tooltip, legend]\n if (api.monthGrid)\n return [...renderMonthTree(api.monthGrid, cellSlot), ...tooltip, legend]\n\n // 月份行排在网格之外:它只是一条对齐用的坐标轴,进了网格就得冒充表格行\n const monthRow = h(XhHeatmapRow, null, () => [\n // 行首占位:与下面各行的星期名同宽,月份才对得上列\n h(XhHeatmapWeekDay),\n ...api.grid.months.map(month => h(XhHeatmapMonthLabel, { key: month.value, value: month.value }, () => month.label)),\n ])\n const weekRows = api.grid.rows.map(row => h(XhHeatmapRow, { key: row.weekDay, value: row.weekDay }, () => [\n h(XhHeatmapWeekDay, { value: row.weekDay }, () => api.grid.weekDays[row.weekDay]?.label ?? ''),\n ...row.cells.map(cell => h(XhHeatmapCell, { key: cell.date, value: cell.date }, () => cellSlot?.(cell) ?? [])),\n ]))\n return [monthRow, h(XhHeatmapGrid, null, () => weekRows), ...tooltip, legend]\n}\n\n/** 月历形态:网格中一个自然月一块,块内先一条星期名坐标轴,再逐周一行。 */\nfunction renderMonthTree(grid: HeatmapMonthGrid, cellSlot?: (node: HeatmapCellSlotProps) => VNode[]): VNode[] {\n const blocks = grid.blocks.map(block => h(XhHeatmapMonthBlock, { key: block.value, value: block.value }, () => [\n h(XhHeatmapMonthLabel, { value: block.value }, () => block.label),\n h(XhHeatmapRow, null, () => grid.weekDays.map(day =>\n h(XhHeatmapWeekDay, { key: day.weekDay, value: day.weekDay }, () => day.label))),\n ...block.weeks.map(row => h(XhHeatmapRow, { key: row.week, value: row.week }, () =>\n row.cells.map(cell => h(XhHeatmapCell, { key: cell.date, value: cell.date }, () => cellSlot?.(cell) ?? [])))),\n ]))\n return [h(XhHeatmapGrid, null, () => blocks)]\n}\n\n/** 矩阵形态:首行是列名,其余每行行首一个行名、其后逐列一格。 */\nfunction renderMatrixTree(grid: HeatmapMatrixGrid, cellSlot?: (node: HeatmapCellSlotProps) => VNode[]): VNode[] {\n const header = h(XhHeatmapRow, null, () => [\n // 角落占位:与下面各行的行名同宽,列名才对得上列\n h(XhHeatmapRowLabel),\n ...grid.columns.map(column => h(XhHeatmapColumnLabel, { key: column.value, value: column.value }, () => column.label)),\n ])\n const rows = grid.rows.map(row => h(XhHeatmapRow, { key: row.value, value: row.value }, () => [\n h(XhHeatmapRowLabel, { value: row.value }, () => row.label),\n ...grid.columns.map((column) => {\n const meta = grid.cells.get(heatmapMatrixKey(row.value, column.value))\n return h(\n XhHeatmapCell,\n { key: column.value, value: column.value },\n () => (meta == null ? [] : cellSlot?.(meta) ?? []),\n )\n }),\n ]))\n return [h(XhHeatmapGrid, null, () => [header, ...rows])]\n}\n"],"mappings":";;;;;;AAqEA,MAAa,gBAAgB,gBAAgB;CAC3C,MAAM;CAEN,OAAO;EACL,SAAS,EAAE,MAAM,OAAmC;EACpD,OAAO,EAAE,MAAM,MAAkC;EACjD,MAAM,EAAE,MAAM,MAAsC;EACpD,SAAS,EAAE,MAAM,MAAsC;EACvD,WAAW,EAAE,MAAM,OAAO;EAC1B,SAAS,EAAE,MAAM,OAAO;EACxB,QAAQ,EAAE,MAAM,OAAO;EACvB,YAAY,EAAE,MAAM,MAA4B;EAChD,gBAAgB,EAAE,MAAM,OAAO;EAC/B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CAAC,CAAC;AACzD"}
|
|
1
|
+
{"version":3,"file":"heatmap.js","names":[],"sources":["../../../src/components/heatmap/heatmap.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// 提供 heatmap 相关实现。\n\nimport type { Direction, Size, Tone } from '@xihan-ui/core'\nimport type {\n HeatmapApi,\n HeatmapAxisInput,\n HeatmapCellDetails,\n HeatmapCellMeta,\n HeatmapLegendBound,\n HeatmapMatrixCellMeta,\n HeatmapMatrixGrid,\n HeatmapMonthGrid,\n HeatmapPalette,\n HeatmapPolarity,\n HeatmapRowProps,\n HeatmapScaleMode,\n HeatmapSchema,\n HeatmapTranslations,\n HeatmapValue,\n HeatmapVariant,\n} from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { heatmapMatrixKey, normalizeHeatmapNumber, normalizeHeatmapString } from '@xihan-ui/headless'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport {\n provideHeatmap,\n provideHeatmapMonth,\n provideHeatmapRow,\n useHeatmapContext,\n useHeatmapMonth,\n useHeatmapRow,\n} from './context'\nimport { useHeatmap } from './use-heatmap'\n\ntype HeatmapProps = HeatmapSchema['props']\n\n/**\n * 默认插槽的载荷:三张网格模型与锚点、当前详情,以及移动锚点的动作。\n * 三形态通用的一组(`focusedCell` / `anchorCell` / `setFocusedCell`)也包含在内:\n * 矩阵形态下带 Date 的一组恒为 null,自行铺设矩阵时只有这一组能读取、移动锚点。\n */\nexport type HeatmapRootSlotProps = Pick<\n HeatmapApi,\n | 'variant'\n | 'grid'\n | 'monthGrid'\n | 'matrixGrid'\n | 'focusedCell'\n | 'focusedDate'\n | 'anchorCell'\n | 'anchorDate'\n | 'activeCell'\n | 'detailOpen'\n | 'scaleMode'\n | 'legendItems'\n | 'cellAt'\n | 'setFocusedCell'\n | 'setFocusedDate'\n>\n\n/**\n * `cell` 插槽的载荷:日期形态给日历的格子,矩阵形态给矩阵的格子。\n * 两者的坐标不同,用 `'date' in cell` 区分。\n */\nexport type HeatmapCellSlotProps = HeatmapCellMeta | HeatmapMatrixCellMeta\n\nexport const XhHeatmapRoot = defineComponent({\n name: 'XhHeatmapRoot',\n // 缺省值由机器与 connect 决定;普通类型省略 default,Boolean 显式保留 undefined\n props: {\n variant: { type: String as PropType<HeatmapVariant> },\n value: { type: Array as PropType<HeatmapValue[]> },\n rows: { type: Array as PropType<HeatmapAxisInput[]> },\n columns: { type: Array as PropType<HeatmapAxisInput[]> },\n startDate: { type: String },\n endDate: { type: String },\n levels: { type: Number },\n thresholds: { type: Array as PropType<number[]> },\n scale: { type: String as PropType<HeatmapScaleMode> },\n midpoint: { type: Number },\n continuous: { type: Boolean, default: undefined },\n firstDayOfWeek: { type: Number },\n locale: { type: String },\n dir: { type: String as PropType<Direction> },\n tone: { type: String as PropType<Tone> },\n palette: { type: String as PropType<HeatmapPalette> },\n size: { type: String as PropType<Size> },\n animated: { type: Boolean, default: undefined },\n translations: { type: Object as PropType<Partial<HeatmapTranslations>> },\n },\n // 只读事件,没有双向绑定:热力图不产生值,只报焦点、详情与按下落在哪一格\n emits: {\n 'cell-focus': (_details: PayloadOf<HeatmapProps, 'onCellFocus'>) => true,\n 'cell-active': (_details: PayloadOf<HeatmapProps, 'onCellActive'>) => true,\n 'cell-press': (_details: PayloadOf<HeatmapProps, 'onCellPress'>) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: HeatmapRootSlotProps) => VNode[]\n /** 铺开网格时每一格的内容插槽,默认是空格子;三种形态都铺设。 */\n cell?: (props: HeatmapCellSlotProps) => VNode[]\n /** 详情条的内容插槽;写了它才会铺设 tooltip 部件。 */\n tooltip?: (props: HeatmapCellDetails | null) => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const notifyFocus: HeatmapProps['onCellFocus'] = details => emit('cell-focus', details)\n const notifyActive: HeatmapProps['onCellActive'] = details => emit('cell-active', details)\n const notifyPress: HeatmapProps['onCellPress'] = details => emit('cell-press', details)\n const ctx = useHeatmap(withXhConfig('heatmap', props) as HeatmapProps, notifyFocus, notifyActive, notifyPress)\n provideHeatmap(ctx)\n return () => {\n const api = ctx.api.value\n return h(\n 'div',\n {\n ...api.getRootProps() as Record<string, unknown>,\n ref: (el: unknown) => { ctx.rootRef.value = el as HTMLElement },\n },\n slots.default\n ? slots.default({\n variant: api.variant,\n grid: api.grid,\n monthGrid: api.monthGrid,\n matrixGrid: api.matrixGrid,\n focusedCell: api.focusedCell,\n focusedDate: api.focusedDate,\n anchorCell: api.anchorCell,\n anchorDate: api.anchorDate,\n activeCell: api.activeCell,\n detailOpen: api.detailOpen,\n scaleMode: api.scaleMode,\n legendItems: api.legendItems,\n cellAt: api.cellAt,\n setFocusedCell: api.setFocusedCell,\n setFocusedDate: api.setFocusedDate,\n })\n : renderDefaultTree(api, slots.cell, slots.tooltip),\n )\n }\n },\n})\n\n/** role=grid 的容器:键盘在这里收口,可及名字也挂在它上面。 */\nexport const XhHeatmapGrid = defineComponent({\n name: 'XhHeatmapGrid',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getGridProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 月历形态中的一个自然月块,块内的行从这里取月份身份。 */\nexport const XhHeatmapMonthBlock = defineComponent({\n name: 'XhHeatmapMonthBlock',\n props: {\n /** 月份身份 YYYY-MM。 */\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n provideHeatmapMonth(computed(() => props.value))\n return () => h('div', ctx.api.value.getMonthBlockProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 一行。身份写在 value 上,解释方式由形态决定:\n * 日历形态是行序 0-6,月历形态是月内第几周,矩阵形态是行身份;未写即坐标轴行。\n */\nexport const XhHeatmapRow = defineComponent({\n name: 'XhHeatmapRow',\n props: {\n value: { type: [Number, String] as PropType<number | string> },\n /** 月历形态:所属月份 YYYY-MM;写在月块中时不必再写一遍。 */\n month: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const blockMonth = useHeatmapMonth()\n const row = computed<HeatmapRowProps>(() => {\n const variant = ctx.api.value.variant\n if (variant === 'matrix')\n return { row: normalizeHeatmapString(props.value) }\n if (variant === 'month')\n return { month: props.month ?? blockMonth?.value, week: normalizeHeatmapNumber(props.value) }\n return { weekDay: normalizeHeatmapNumber(props.value) }\n })\n provideHeatmapRow(computed(() => row.value.row))\n return () => h('div', ctx.api.value.getRowProps(row.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 行首的星期名。未提供行序即坐标轴行行首的占位,它只负责让月份与格子对齐。 */\nexport const XhHeatmapWeekDay = defineComponent({\n name: 'XhHeatmapWeekDay',\n props: {\n value: { type: [Number, String] as PropType<number | string> },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const weekDay = computed(() => normalizeHeatmapNumber(props.value))\n return () => h('span', ctx.api.value.getWeekDayProps({ weekDay: weekDay.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 月份名。日历形态中横跨该月所占的列,月历形态中是一块的标题。 */\nexport const XhHeatmapMonthLabel = defineComponent({\n name: 'XhHeatmapMonthLabel',\n props: {\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getMonthLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 矩阵的行名。未写 value 即表头行行首的角落占位。 */\nexport const XhHeatmapRowLabel = defineComponent({\n name: 'XhHeatmapRowLabel',\n props: {\n value: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getRowLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 矩阵的列名。 */\nexport const XhHeatmapColumnLabel = defineComponent({\n name: 'XhHeatmapColumnLabel',\n props: {\n value: { type: String, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getColumnLabelProps({ value: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 一格。日期形态中 value 是 ISO 日期,矩阵形态中 value 是列身份、\n * 行身份从所在的行取(也可以写在 row 上)。数值与档位由 connect 查询网格。\n */\nexport const XhHeatmapCell = defineComponent({\n name: 'XhHeatmapCell',\n props: {\n value: { type: String, required: true },\n /** 矩阵形态:行身份;写在行中时不必再写一遍。 */\n row: { type: String },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const parentRow = useHeatmapRow()\n const cell = computed(() => ctx.api.value.variant === 'matrix'\n ? { row: props.row ?? parentRow?.value, column: props.value }\n : { date: props.value })\n return () => h('div', ctx.api.value.getCellProps(cell.value) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 详情条:悬停或聚焦到某一格时显示,位置由连接层测量后写为内联样式。 */\nexport const XhHeatmapTooltip = defineComponent({\n name: 'XhHeatmapTooltip',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getTooltipProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 色阶对照条。 */\nexport const XhHeatmapLegend = defineComponent({\n name: 'XhHeatmapLegend',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getLegendProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 对照条一端的文字:value 写 low 或 high,文字从 api.legendText 取。 */\nexport const XhHeatmapLegendLabel = defineComponent({\n name: 'XhHeatmapLegendLabel',\n props: {\n /** 挂在哪一端:low 是色阶起点,high 是终点。 */\n value: { type: String as PropType<HeatmapLegendBound>, required: true },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('span', ctx.api.value.getLegendLabelProps({ bound: props.value }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 对照条中的一格,与网格中同档(发散色阶下同侧同档)的格子同色。 */\nexport const XhHeatmapLegendItem = defineComponent({\n name: 'XhHeatmapLegendItem',\n props: {\n /** 档位,兼收字符串。 */\n value: { type: [Number, String] as PropType<number | string>, required: true },\n /** 发散色阶下这一格在中点的哪一侧;顺序色阶与中点那一格不写。 */\n polarity: { type: String as PropType<HeatmapPolarity> },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const level = computed(() => Number(props.value) || 0)\n return () => h('span', ctx.api.value.getLegendItemProps({ level: level.value, polarity: props.polarity ?? null }) as Record<string, unknown>, slots.default?.())\n },\n})\n\n/**\n * 未写默认插槽时按网格模型铺开的整套结构,作者只提供数据。\n * 与手写部件产出的 DOM 完全一致,需要修改结构时写默认插槽,行为不变。\n * 详情条只有写了 tooltip 插槽才铺设,未写时整棵树与从前逐字一致。\n */\nfunction renderDefaultTree(\n api: HeatmapApi,\n cellSlot?: (node: HeatmapCellSlotProps) => VNode[],\n tooltipSlot?: (details: HeatmapCellDetails | null) => VNode[],\n): VNode[] {\n // 两端各一个字:一排色块自己说不出哪头是多\n const legend = h(\n XhHeatmapLegend,\n null,\n () => [\n h(XhHeatmapLegendLabel, { value: 'low' }, () => api.legendText.low),\n ...api.legendItems.map(item => h(XhHeatmapLegendItem, { key: `${item.polarity ?? 'center'}-${item.level}`, value: item.level, polarity: item.polarity ?? undefined })),\n h(XhHeatmapLegendLabel, { value: 'high' }, () => api.legendText.high),\n ],\n )\n const tooltip = tooltipSlot\n ? [h(XhHeatmapTooltip, null, () => tooltipSlot(api.activeCell))]\n : []\n\n if (api.matrixGrid)\n return [...renderMatrixTree(api.matrixGrid, cellSlot), ...tooltip, legend]\n if (api.monthGrid)\n return [...renderMonthTree(api.monthGrid, cellSlot), ...tooltip, legend]\n\n // 月份行排在网格之外:它只是一条对齐用的坐标轴,进了网格就得冒充表格行\n const monthRow = h(XhHeatmapRow, null, () => [\n // 行首占位:与下面各行的星期名同宽,月份才对得上列\n h(XhHeatmapWeekDay),\n ...api.grid.months.map(month => h(XhHeatmapMonthLabel, { key: month.value, value: month.value }, () => month.label)),\n ])\n const weekRows = api.grid.rows.map(row => h(XhHeatmapRow, { key: row.weekDay, value: row.weekDay }, () => [\n h(XhHeatmapWeekDay, { value: row.weekDay }, () => api.grid.weekDays[row.weekDay]?.label ?? ''),\n ...row.cells.map(cell => h(XhHeatmapCell, { key: cell.date, value: cell.date }, () => cellSlot?.(cell) ?? [])),\n ]))\n return [monthRow, h(XhHeatmapGrid, null, () => weekRows), ...tooltip, legend]\n}\n\n/** 月历形态:网格中一个自然月一块,块内先一条星期名坐标轴,再逐周一行。 */\nfunction renderMonthTree(grid: HeatmapMonthGrid, cellSlot?: (node: HeatmapCellSlotProps) => VNode[]): VNode[] {\n const blocks = grid.blocks.map(block => h(XhHeatmapMonthBlock, { key: block.value, value: block.value }, () => [\n h(XhHeatmapMonthLabel, { value: block.value }, () => block.label),\n h(XhHeatmapRow, null, () => grid.weekDays.map(day =>\n h(XhHeatmapWeekDay, { key: day.weekDay, value: day.weekDay }, () => day.label))),\n ...block.weeks.map(row => h(XhHeatmapRow, { key: row.week, value: row.week }, () =>\n row.cells.map(cell => h(XhHeatmapCell, { key: cell.date, value: cell.date }, () => cellSlot?.(cell) ?? [])))),\n ]))\n return [h(XhHeatmapGrid, null, () => blocks)]\n}\n\n/** 矩阵形态:首行是列名,其余每行行首一个行名、其后逐列一格。 */\nfunction renderMatrixTree(grid: HeatmapMatrixGrid, cellSlot?: (node: HeatmapCellSlotProps) => VNode[]): VNode[] {\n const header = h(XhHeatmapRow, null, () => [\n // 角落占位:与下面各行的行名同宽,列名才对得上列\n h(XhHeatmapRowLabel),\n ...grid.columns.map(column => h(XhHeatmapColumnLabel, { key: column.value, value: column.value }, () => column.label)),\n ])\n const rows = grid.rows.map(row => h(XhHeatmapRow, { key: row.value, value: row.value }, () => [\n h(XhHeatmapRowLabel, { value: row.value }, () => row.label),\n ...grid.columns.map((column) => {\n const meta = grid.cells.get(heatmapMatrixKey(row.value, column.value))\n return h(\n XhHeatmapCell,\n { key: column.value, value: column.value },\n () => (meta == null ? [] : cellSlot?.(meta) ?? []),\n )\n }),\n ]))\n return [h(XhHeatmapGrid, null, () => [header, ...rows])]\n}\n"],"mappings":";;;;;;AAyEA,MAAa,gBAAgB,gBAAgB;CAC3C,MAAM;CAEN,OAAO;EACL,SAAS,EAAE,MAAM,OAAmC;EACpD,OAAO,EAAE,MAAM,MAAkC;EACjD,MAAM,EAAE,MAAM,MAAsC;EACpD,SAAS,EAAE,MAAM,MAAsC;EACvD,WAAW,EAAE,MAAM,OAAO;EAC1B,SAAS,EAAE,MAAM,OAAO;EACxB,QAAQ,EAAE,MAAM,OAAO;EACvB,YAAY,EAAE,MAAM,MAA4B;EAChD,OAAO,EAAE,MAAM,OAAqC;EACpD,UAAU,EAAE,MAAM,OAAO;EACzB,YAAY;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAChD,gBAAgB,EAAE,MAAM,OAAO;EAC/B,QAAQ,EAAE,MAAM,OAAO;EACvB,KAAK,EAAE,MAAM,OAA8B;EAC3C,MAAM,EAAE,MAAM,OAAyB;EACvC,SAAS,EAAE,MAAM,OAAmC;EACpD,MAAM,EAAE,MAAM,OAAyB;EACvC,UAAU;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC9C,cAAc,EAAE,MAAM,OAAiD;CACzE;CAEA,OAAO;EACL,eAAe,aAAqD;EACpE,gBAAgB,aAAsD;EACtE,eAAe,aAAqD;CACtE;CACA,OAAO;CAOP,MAAM,OAAO,EAAE,OAAO,QAAQ;EAC5B,MAAM,eAA2C,YAAW,KAAK,cAAc,OAAO;EACtF,MAAM,gBAA6C,YAAW,KAAK,eAAe,OAAO;EACzF,MAAM,eAA2C,YAAW,KAAK,cAAc,OAAO;EACtF,MAAM,MAAM,WAAW,aAAa,WAAW,KAAK,GAAmB,aAAa,cAAc,WAAW;EAC7G,eAAe,GAAG;EAClB,aAAa;GACX,MAAM,MAAM,IAAI,IAAI;GACpB,OAAO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K,KAAK;GAAM,OAAO,KAAK;EAAK,SAAS,WAAW,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;CAChH,CAAC,CAAC;CACF,OAAO,CAAC,EAAE,eAAe,YAAY,MAAM,CAAC;AAC9C;;AAGA,SAAS,iBAAiB,MAAyB,UAA6D;CAC9G,MAAM,SAAS,EAAE,cAAc,YAAY,CAEzC,EAAE,iBAAiB,GACnB,GAAG,KAAK,QAAQ,KAAI,WAAU,EAAE,sBAAsB;EAAE,KAAK,OAAO;EAAO,OAAO,OAAO;CAAM,SAAS,OAAO,KAAK,CAAC,CACvH,CAAC;CACD,MAAM,OAAO,KAAK,KAAK,KAAI,QAAO,EAAE,cAAc;EAAE,KAAK,IAAI;EAAO,OAAO,IAAI;CAAM,SAAS,CAC5F,EAAE,mBAAmB,EAAE,OAAO,IAAI,MAAM,SAAS,IAAI,KAAK,GAC1D,GAAG,KAAK,QAAQ,KAAK,WAAW;EAC9B,MAAM,OAAO,KAAK,MAAM,IAAI,iBAAiB,IAAI,OAAO,OAAO,KAAK,CAAC;EACrE,OAAO,EACL,eACA;GAAE,KAAK,OAAO;GAAO,OAAO,OAAO;EAAM,SAClC,QAAQ,OAAO,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,CAClD;CACF,CAAC,CACH,CAAC,CAAC;CACF,OAAO,CAAC,EAAE,eAAe,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AACzD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComputedRef } from "vue";
|
|
1
|
+
import { ComputedRef, Ref } from "vue";
|
|
2
2
|
import { Service } from "@xihan-ui/core";
|
|
3
3
|
import { HeatmapApi, HeatmapSchema } from "@xihan-ui/headless";
|
|
4
4
|
//#region src/components/heatmap/use-heatmap.d.ts
|
|
@@ -6,8 +6,10 @@ interface HeatmapContext {
|
|
|
6
6
|
api: ComputedRef<HeatmapApi>;
|
|
7
7
|
/** 状态机实例,供部件上报 DOM 侧的事实。 */
|
|
8
8
|
service: Service<HeatmapSchema>;
|
|
9
|
+
/** 根:过渡的时长与减弱动效从它读。 */
|
|
10
|
+
rootRef: Ref<HTMLElement | null>;
|
|
9
11
|
}
|
|
10
|
-
declare function useHeatmap(props: HeatmapSchema['props'], onCellFocus?: HeatmapSchema['props']['onCellFocus'], onCellActive?: HeatmapSchema['props']['onCellActive']): HeatmapContext;
|
|
12
|
+
declare function useHeatmap(props: HeatmapSchema['props'], onCellFocus?: HeatmapSchema['props']['onCellFocus'], onCellActive?: HeatmapSchema['props']['onCellActive'], onCellPress?: HeatmapSchema['props']['onCellPress']): HeatmapContext;
|
|
11
13
|
//#endregion
|
|
12
14
|
export { HeatmapContext, useHeatmap };
|
|
13
15
|
//# sourceMappingURL=use-heatmap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/use-heatmap.ts"],"mappings":";;;;UAeiB;EACf,KAAK,YAAY;;EAEjB,SAAS,QAAQ;;
|
|
1
|
+
{"version":3,"file":"use-heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/use-heatmap.ts"],"mappings":";;;;UAeiB;EACf,KAAK,YAAY;;EAEjB,SAAS,QAAQ;;EAEjB,SAAS,IAAI;;iBAIC,WACd,OAAO,wBACP,cAAc,uCACd,eAAe,wCACf,cAAc,wCACb"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
2
|
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
-
import { computed } from "vue";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
4
|
import { connectHeatmap, heatmapMachine } from "@xihan-ui/headless";
|
|
5
5
|
//#region src/components/heatmap/use-heatmap.ts
|
|
6
|
-
function useHeatmap(props, onCellFocus, onCellActive) {
|
|
6
|
+
function useHeatmap(props, onCellFocus, onCellActive, onCellPress) {
|
|
7
|
+
const rootRef = ref(null);
|
|
7
8
|
const service = useMachine(heatmapMachine, () => ({
|
|
8
9
|
...props,
|
|
9
10
|
onCellFocus,
|
|
10
|
-
onCellActive
|
|
11
|
+
onCellActive,
|
|
12
|
+
onCellPress
|
|
11
13
|
}));
|
|
14
|
+
service.refs.set("getRootEl", () => rootRef.value);
|
|
12
15
|
return {
|
|
13
16
|
api: computed(() => connectHeatmap(service, vueNormalize)),
|
|
14
|
-
service
|
|
17
|
+
service,
|
|
18
|
+
rootRef
|
|
15
19
|
};
|
|
16
20
|
}
|
|
17
21
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-heatmap.js","names":[],"sources":["../../../src/components/heatmap/use-heatmap.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 heatmap 相关实现。\n\nimport type { Service } from '@xihan-ui/core'\nimport type { HeatmapApi, HeatmapSchema } from '@xihan-ui/headless'\nimport type { ComputedRef } from 'vue'\nimport { connectHeatmap, heatmapMachine } from '@xihan-ui/headless'\nimport { computed } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface HeatmapContext {\n api: ComputedRef<HeatmapApi>\n /** 状态机实例,供部件上报 DOM 侧的事实。 */\n service: Service<HeatmapSchema>\n}\n\n// 不建 scope:connect 不派生任何 id\nexport function useHeatmap(\n props: HeatmapSchema['props'],\n onCellFocus?: HeatmapSchema['props']['onCellFocus'],\n onCellActive?: HeatmapSchema['props']['onCellActive'],\n): HeatmapContext {\n const service = useMachine(heatmapMachine, () => ({ ...props, onCellFocus, onCellActive }))\n const api = computed(() => connectHeatmap(service, vueNormalize))\n return { api, service }\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"use-heatmap.js","names":[],"sources":["../../../src/components/heatmap/use-heatmap.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 heatmap 相关实现。\n\nimport type { Service } from '@xihan-ui/core'\nimport type { HeatmapApi, HeatmapSchema } from '@xihan-ui/headless'\nimport type { ComputedRef, Ref } from 'vue'\nimport { connectHeatmap, heatmapMachine } from '@xihan-ui/headless'\nimport { computed, ref } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface HeatmapContext {\n api: ComputedRef<HeatmapApi>\n /** 状态机实例,供部件上报 DOM 侧的事实。 */\n service: Service<HeatmapSchema>\n /** 根:过渡的时长与减弱动效从它读。 */\n rootRef: Ref<HTMLElement | null>\n}\n\n// 不建 scope:connect 不派生任何 id\nexport function useHeatmap(\n props: HeatmapSchema['props'],\n onCellFocus?: HeatmapSchema['props']['onCellFocus'],\n onCellActive?: HeatmapSchema['props']['onCellActive'],\n onCellPress?: HeatmapSchema['props']['onCellPress'],\n): HeatmapContext {\n const rootRef = ref<HTMLElement | null>(null)\n const service = useMachine(heatmapMachine, () => ({ ...props, onCellFocus, onCellActive, onCellPress }))\n service.refs.set('getRootEl', () => rootRef.value)\n const api = computed(() => connectHeatmap(service, vueNormalize))\n return { api, service, rootRef }\n}\n"],"mappings":";;;;;AAwBA,SAAgB,WACd,OACA,aACA,cACA,aACgB;CAChB,MAAM,UAAU,IAAwB,IAAI;CAC5C,MAAM,UAAU,WAAW,uBAAuB;EAAE,GAAG;EAAO;EAAa;EAAc;CAAY,EAAE;CACvG,QAAQ,KAAK,IAAI,mBAAmB,QAAQ,KAAK;CAEjD,OAAO;EAAE,KADG,eAAe,eAAe,SAAS,YAAY,CACpD;EAAG;EAAS;CAAQ;AACjC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
//#region src/components/hierarchy-chart/context.ts
|
|
3
|
+
const KEY = Symbol.for("xh-hierarchy-chart");
|
|
4
|
+
function provideHierarchyChart(ctx) {
|
|
5
|
+
provide(KEY, ctx);
|
|
6
|
+
}
|
|
7
|
+
function useHierarchyChartContext() {
|
|
8
|
+
const ctx = inject(KEY, null);
|
|
9
|
+
if (!ctx) throw new Error("[xh] HierarchyChart 部件必须用在 XhHierarchyChartRoot 内");
|
|
10
|
+
return ctx;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { provideHierarchyChart, useHierarchyChartContext };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../src/components/hierarchy-chart/context.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// 提供 context 相关实现。\n\nimport type { InjectionKey } from 'vue'\nimport type { HierarchyChartContext } from './use-hierarchy-chart'\nimport { inject, provide } from 'vue'\n\nconst KEY: InjectionKey<HierarchyChartContext> = Symbol.for('xh-hierarchy-chart')\n\nexport function provideHierarchyChart(ctx: HierarchyChartContext): void {\n provide(KEY, ctx)\n}\n\nexport function useHierarchyChartContext(): HierarchyChartContext {\n const ctx = inject(KEY, null)\n if (!ctx)\n throw new Error('[xh] HierarchyChart 部件必须用在 XhHierarchyChartRoot 内')\n return ctx\n}\n"],"mappings":";;AAWA,MAAM,MAA2C,OAAO,IAAI,oBAAoB;AAEhF,SAAgB,sBAAsB,KAAkC;CACtE,QAAQ,KAAK,GAAG;AAClB;AAEA,SAAgB,2BAAkD;CAChE,MAAM,MAAM,OAAO,KAAK,IAAI;CAC5B,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,mDAAmD;CACrE,OAAO;AACT"}
|