@xihan-ui/vue 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1593 -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/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/avatar-group/avatar-group.js +2 -1
- package/dist/components/avatar-group/avatar-group.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 +42 -3
- 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 +72 -3
- package/dist/components/cascader/cascader.d.ts.map +1 -1
- package/dist/components/cascader/cascader.js +125 -7
- package/dist/components/cascader/cascader.js.map +1 -1
- package/dist/components/cascader/context.js +10 -1
- package/dist/components/cascader/context.js.map +1 -1
- package/dist/components/cascader/use-cascader.d.ts +2 -1
- package/dist/components/cascader/use-cascader.d.ts.map +1 -1
- package/dist/components/cascader/use-cascader.js +4 -1
- package/dist/components/cascader/use-cascader.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +24 -3
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +20 -3
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/citation/citation.d.ts +211 -0
- package/dist/components/citation/citation.d.ts.map +1 -0
- package/dist/components/citation/citation.js +222 -0
- package/dist/components/citation/citation.js.map +1 -0
- package/dist/components/citation/context.d.ts +11 -0
- package/dist/components/citation/context.d.ts.map +1 -0
- package/dist/components/citation/context.js +24 -0
- package/dist/components/citation/context.js.map +1 -0
- package/dist/components/citation/use-citation.d.ts +19 -0
- package/dist/components/citation/use-citation.d.ts.map +1 -0
- package/dist/components/citation/use-citation.js +51 -0
- package/dist/components/citation/use-citation.js.map +1 -0
- package/dist/components/code-view/code-view.d.ts +21 -0
- package/dist/components/code-view/code-view.d.ts.map +1 -1
- package/dist/components/code-view/code-view.js +23 -4
- package/dist/components/code-view/code-view.js.map +1 -1
- package/dist/components/collapsible/collapsible.d.ts +6 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.js +4 -2
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-field/color-field.d.ts +2 -2
- package/dist/components/color-field/color-field.js +1 -1
- package/dist/components/color-field/color-field.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +41 -3
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +33 -4
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/use-color-picker.d.ts +3 -1
- package/dist/components/color-picker/use-color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/use-color-picker.js +8 -2
- package/dist/components/color-picker/use-color-picker.js.map +1 -1
- package/dist/components/color-slider/color-slider.d.ts +2 -2
- package/dist/components/color-slider/color-slider.js +1 -1
- package/dist/components/color-slider/color-slider.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +66 -4
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +107 -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 +23 -2
- package/dist/components/command/command.d.ts.map +1 -1
- package/dist/components/command/command.js +48 -6
- package/dist/components/command/command.js.map +1 -1
- 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 +63 -18
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +141 -57
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context.js +1 -1
- package/dist/components/context-menu/context.js.map +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/use-context-menu.js +4 -2
- package/dist/components/context-menu/use-context-menu.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts +9 -1
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +2 -0
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +41 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +16 -3
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +77 -2
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +102 -5
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/use-date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker/use-date-range-picker.js.map +1 -1
- package/dist/components/descriptions/descriptions.d.ts +38 -7
- package/dist/components/descriptions/descriptions.d.ts.map +1 -1
- package/dist/components/descriptions/descriptions.js +38 -4
- package/dist/components/descriptions/descriptions.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +16 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +15 -2
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/dialog/use-dialog.js +9 -27
- package/dist/components/dialog/use-dialog.js.map +1 -1
- package/dist/components/diff-view/diff-view.d.ts +22 -2
- package/dist/components/diff-view/diff-view.d.ts.map +1 -1
- package/dist/components/diff-view/diff-view.js +37 -14
- package/dist/components/diff-view/diff-view.js.map +1 -1
- package/dist/components/diff-view/use-diff-view.d.ts +7 -2
- package/dist/components/diff-view/use-diff-view.d.ts.map +1 -1
- package/dist/components/diff-view/use-diff-view.js +12 -5
- package/dist/components/diff-view/use-diff-view.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +46 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +28 -4
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/use-drawer.d.ts +1 -1
- package/dist/components/drawer/use-drawer.d.ts.map +1 -1
- package/dist/components/drawer/use-drawer.js +12 -29
- package/dist/components/drawer/use-drawer.js.map +1 -1
- package/dist/components/empty-state/empty-state.js +4 -1
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/empty-state/use-empty-state.js +12 -3
- package/dist/components/empty-state/use-empty-state.js.map +1 -1
- package/dist/components/field/field.js +1 -1
- package/dist/components/field-array/field-array.d.ts +1 -1
- package/dist/components/field-array/field-array.d.ts.map +1 -1
- package/dist/components/field-array/field-array.js +5 -1
- package/dist/components/field-array/field-array.js.map +1 -1
- package/dist/components/field-array/use-field-array.d.ts +3 -1
- package/dist/components/field-array/use-field-array.d.ts.map +1 -1
- package/dist/components/field-array/use-field-array.js +5 -2
- package/dist/components/field-array/use-field-array.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +24 -1
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +12 -2
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/file-upload/use-file-upload.d.ts +1 -1
- package/dist/components/file-upload/use-file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/use-file-upload.js.map +1 -1
- package/dist/components/flex/flex.d.ts +1 -1
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/flex.js +4 -4
- package/dist/components/flex/flex.js.map +1 -1
- package/dist/components/form/form.d.ts +18 -4
- package/dist/components/form/form.d.ts.map +1 -1
- package/dist/components/form/form.js +21 -7
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/use-form.d.ts +6 -0
- package/dist/components/form/use-form.d.ts.map +1 -1
- package/dist/components/form/use-form.js +4 -0
- package/dist/components/form/use-form.js.map +1 -1
- package/dist/components/funnel-chart/context.js +15 -0
- package/dist/components/funnel-chart/context.js.map +1 -0
- package/dist/components/funnel-chart/funnel-chart.d.ts +175 -0
- package/dist/components/funnel-chart/funnel-chart.d.ts.map +1 -0
- package/dist/components/funnel-chart/funnel-chart.js +188 -0
- package/dist/components/funnel-chart/funnel-chart.js.map +1 -0
- package/dist/components/funnel-chart/use-funnel-chart.d.ts +19 -0
- package/dist/components/funnel-chart/use-funnel-chart.d.ts.map +1 -0
- package/dist/components/funnel-chart/use-funnel-chart.js +26 -0
- package/dist/components/funnel-chart/use-funnel-chart.js.map +1 -0
- package/dist/components/graph-chart/context.js +15 -0
- package/dist/components/graph-chart/context.js.map +1 -0
- package/dist/components/graph-chart/graph-chart.d.ts +194 -0
- package/dist/components/graph-chart/graph-chart.d.ts.map +1 -0
- package/dist/components/graph-chart/graph-chart.js +219 -0
- package/dist/components/graph-chart/graph-chart.js.map +1 -0
- package/dist/components/graph-chart/use-graph-chart.d.ts +19 -0
- package/dist/components/graph-chart/use-graph-chart.d.ts.map +1 -0
- package/dist/components/graph-chart/use-graph-chart.js +26 -0
- package/dist/components/graph-chart/use-graph-chart.js.map +1 -0
- package/dist/components/grid/grid.d.ts +7 -0
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +7 -1
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid-list/context.d.ts +9 -0
- package/dist/components/grid-list/context.d.ts.map +1 -0
- package/dist/components/grid-list/context.js +24 -0
- package/dist/components/grid-list/context.js.map +1 -0
- package/dist/components/grid-list/grid-list.d.ts +149 -0
- package/dist/components/grid-list/grid-list.d.ts.map +1 -0
- package/dist/components/grid-list/grid-list.js +118 -0
- package/dist/components/grid-list/grid-list.js.map +1 -0
- package/dist/components/grid-list/use-grid-list.d.ts +12 -0
- package/dist/components/grid-list/use-grid-list.d.ts.map +1 -0
- package/dist/components/grid-list/use-grid-list.js +20 -0
- package/dist/components/grid-list/use-grid-list.js.map +1 -0
- package/dist/components/heatmap/heatmap.d.ts +45 -4
- package/dist/components/heatmap/heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap.js +40 -14
- package/dist/components/heatmap/heatmap.js.map +1 -1
- package/dist/components/heatmap/use-heatmap.d.ts +4 -2
- package/dist/components/heatmap/use-heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/use-heatmap.js +8 -4
- package/dist/components/heatmap/use-heatmap.js.map +1 -1
- package/dist/components/hierarchy-chart/context.js +15 -0
- package/dist/components/hierarchy-chart/context.js.map +1 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.d.ts +201 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.d.ts.map +1 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.js +228 -0
- package/dist/components/hierarchy-chart/hierarchy-chart.js.map +1 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.d.ts +19 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.d.ts.map +1 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.js +26 -0
- package/dist/components/hierarchy-chart/use-hierarchy-chart.js.map +1 -0
- package/dist/components/hover-card/hover-card.js +2 -2
- package/dist/components/icon/icon.d.ts +7 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +1 -0
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/image/use-image.d.ts.map +1 -1
- package/dist/components/image/use-image.js +3 -1
- package/dist/components/image/use-image.js.map +1 -1
- package/dist/components/image-cropper/image-cropper.d.ts +35 -4
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -1
- package/dist/components/image-cropper/image-cropper.js +34 -5
- package/dist/components/image-cropper/image-cropper.js.map +1 -1
- package/dist/components/image-cropper/use-image-cropper.d.ts +3 -1
- package/dist/components/image-cropper/use-image-cropper.d.ts.map +1 -1
- package/dist/components/image-cropper/use-image-cropper.js +4 -1
- package/dist/components/image-cropper/use-image-cropper.js.map +1 -1
- package/dist/components/image-viewer/image-viewer.js +1 -1
- package/dist/components/image-viewer/use-image-viewer.d.ts.map +1 -1
- package/dist/components/image-viewer/use-image-viewer.js +9 -27
- package/dist/components/image-viewer/use-image-viewer.js.map +1 -1
- package/dist/components/infinite-scroll/infinite-scroll.d.ts +9 -1
- package/dist/components/infinite-scroll/infinite-scroll.d.ts.map +1 -1
- package/dist/components/infinite-scroll/infinite-scroll.js +2 -0
- package/dist/components/infinite-scroll/infinite-scroll.js.map +1 -1
- package/dist/components/input-group/input-group.d.ts.map +1 -1
- package/dist/components/input-group/input-group.js +2 -1
- package/dist/components/input-group/input-group.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/kbd/kbd.d.ts.map +1 -1
- package/dist/components/kbd/kbd.js +27 -10
- package/dist/components/kbd/kbd.js.map +1 -1
- package/dist/components/listbox/listbox.d.ts +25 -2
- package/dist/components/listbox/listbox.d.ts.map +1 -1
- package/dist/components/listbox/listbox.js +39 -4
- package/dist/components/listbox/listbox.js.map +1 -1
- package/dist/components/loading-bar/use-loading-bar.d.ts.map +1 -1
- package/dist/components/loading-bar/use-loading-bar.js +3 -1
- package/dist/components/loading-bar/use-loading-bar.js.map +1 -1
- package/dist/components/log/log.d.ts +41 -2
- package/dist/components/log/log.d.ts.map +1 -1
- package/dist/components/log/log.js +25 -3
- package/dist/components/log/log.js.map +1 -1
- package/dist/components/log/use-log.d.ts +1 -1
- package/dist/components/log/use-log.d.ts.map +1 -1
- package/dist/components/log/use-log.js +4 -1
- package/dist/components/log/use-log.js.map +1 -1
- package/dist/components/markdown-stream/markdown-stream.d.ts +22 -2
- package/dist/components/markdown-stream/markdown-stream.d.ts.map +1 -1
- package/dist/components/markdown-stream/markdown-stream.js +43 -4
- package/dist/components/markdown-stream/markdown-stream.js.map +1 -1
- package/dist/components/marquee/marquee.d.ts +68 -12
- package/dist/components/marquee/marquee.d.ts.map +1 -1
- package/dist/components/marquee/marquee.js +52 -7
- package/dist/components/marquee/marquee.js.map +1 -1
- package/dist/components/mention/mention.d.ts +43 -7
- package/dist/components/mention/mention.d.ts.map +1 -1
- package/dist/components/mention/mention.js +50 -8
- 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 +92 -28
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +162 -54
- 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 +52 -19
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +137 -56
- 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/page-header/page-header.d.ts.map +1 -1
- package/dist/components/page-header/page-header.js +2 -1
- package/dist/components/page-header/page-header.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts +22 -2
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +22 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.js +1 -0
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/pie-chart/context.js +15 -0
- package/dist/components/pie-chart/context.js.map +1 -0
- package/dist/components/pie-chart/pie-chart.d.ts +203 -0
- package/dist/components/pie-chart/pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/pie-chart.js +236 -0
- package/dist/components/pie-chart/pie-chart.js.map +1 -0
- package/dist/components/pie-chart/use-pie-chart.d.ts +19 -0
- package/dist/components/pie-chart/use-pie-chart.d.ts.map +1 -0
- package/dist/components/pie-chart/use-pie-chart.js +26 -0
- package/dist/components/pie-chart/use-pie-chart.js.map +1 -0
- package/dist/components/popconfirm/popconfirm.js +2 -2
- package/dist/components/popover/popover.d.ts +11 -0
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +7 -2
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.d.ts +63 -3
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +55 -3
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/question-flow/question-flow.d.ts +40 -1
- package/dist/components/question-flow/question-flow.d.ts.map +1 -1
- package/dist/components/question-flow/question-flow.js +37 -1
- package/dist/components/question-flow/question-flow.js.map +1 -1
- package/dist/components/radar-chart/context.js +15 -0
- package/dist/components/radar-chart/context.js.map +1 -0
- package/dist/components/radar-chart/radar-chart.d.ts +189 -0
- package/dist/components/radar-chart/radar-chart.d.ts.map +1 -0
- package/dist/components/radar-chart/radar-chart.js +220 -0
- package/dist/components/radar-chart/radar-chart.js.map +1 -0
- package/dist/components/radar-chart/use-radar-chart.d.ts +19 -0
- package/dist/components/radar-chart/use-radar-chart.d.ts.map +1 -0
- package/dist/components/radar-chart/use-radar-chart.js +26 -0
- package/dist/components/radar-chart/use-radar-chart.js.map +1 -0
- package/dist/components/radio-group/radio-group.d.ts +37 -2
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +54 -8
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/use-radio-group.d.ts +3 -1
- package/dist/components/radio-group/use-radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/use-radio-group.js +7 -3
- package/dist/components/radio-group/use-radio-group.js.map +1 -1
- package/dist/components/reasoning/reasoning.d.ts.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 +25 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +48 -6
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/use-select.js +2 -1
- package/dist/components/select/use-select.js.map +1 -1
- package/dist/components/side-nav/context.js +17 -1
- package/dist/components/side-nav/context.js.map +1 -1
- package/dist/components/side-nav/side-nav.d.ts +51 -7
- package/dist/components/side-nav/side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/side-nav.js +152 -13
- package/dist/components/side-nav/side-nav.js.map +1 -1
- package/dist/components/side-nav/use-side-nav.d.ts +4 -2
- package/dist/components/side-nav/use-side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/use-side-nav.js +5 -3
- package/dist/components/side-nav/use-side-nav.js.map +1 -1
- package/dist/components/signature-pad/signature-pad.d.ts +26 -4
- package/dist/components/signature-pad/signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/signature-pad.js +32 -4
- package/dist/components/signature-pad/signature-pad.js.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts +1 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.js.map +1 -1
- package/dist/components/skeleton/use-skeleton.js +6 -2
- package/dist/components/skeleton/use-skeleton.js.map +1 -1
- package/dist/components/slider/slider.d.ts +27 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +12 -0
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/sortable/sortable.d.ts +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/statistic/statistic.d.ts.map +1 -1
- package/dist/components/statistic/statistic.js +2 -1
- package/dist/components/statistic/statistic.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/tag-group/tag-group.js +1 -1
- package/dist/components/tag-group/tag-group.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +10 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +11 -4
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/tags-input/use-tags-input.d.ts +4 -2
- package/dist/components/tags-input/use-tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/use-tags-input.js +5 -2
- package/dist/components/tags-input/use-tags-input.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +11 -7
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +4 -2
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.d.ts +11 -7
- package/dist/components/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.js +4 -2
- package/dist/components/time-range-picker/time-range-picker.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/timeline/timeline.js +2 -1
- package/dist/components/timeline/timeline.js.map +1 -1
- package/dist/components/timestamp/timestamp.d.ts +20 -1
- package/dist/components/timestamp/timestamp.d.ts.map +1 -1
- package/dist/components/timestamp/timestamp.js +16 -5
- package/dist/components/timestamp/timestamp.js.map +1 -1
- package/dist/components/toolbar/toolbar.d.ts +17 -2
- package/dist/components/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/toolbar.js +31 -4
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/toolbar/use-toolbar.d.ts +4 -2
- package/dist/components/toolbar/use-toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/use-toolbar.js +5 -2
- package/dist/components/toolbar/use-toolbar.js.map +1 -1
- package/dist/components/tooltip/context.d.ts +21 -0
- package/dist/components/tooltip/context.d.ts.map +1 -0
- package/dist/components/tooltip/context.js +10 -1
- package/dist/components/tooltip/context.js.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +53 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +34 -3
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tooltip/use-tooltip.d.ts +3 -18
- package/dist/components/tooltip/use-tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/use-tooltip.js +2 -0
- package/dist/components/tooltip/use-tooltip.js.map +1 -1
- package/dist/components/tour/tour.d.ts +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 +30 -2
- package/dist/components/transfer/transfer.d.ts.map +1 -1
- package/dist/components/transfer/transfer.js +29 -3
- package/dist/components/transfer/transfer.js.map +1 -1
- package/dist/components/tree/tree.d.ts +43 -8
- package/dist/components/tree/tree.d.ts.map +1 -1
- package/dist/components/tree/tree.js +28 -15
- 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 +78 -6
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.js +127 -12
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/tree-select/use-tree-select.d.ts +3 -0
- package/dist/components/tree-select/use-tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/use-tree-select.js +6 -1
- package/dist/components/tree-select/use-tree-select.js.map +1 -1
- package/dist/components/truncate/truncate.d.ts +25 -4
- package/dist/components/truncate/truncate.d.ts.map +1 -1
- package/dist/components/truncate/truncate.js +29 -14
- package/dist/components/truncate/truncate.js.map +1 -1
- package/dist/components/truncate/use-truncate.d.ts.map +1 -1
- package/dist/components/truncate/use-truncate.js +3 -1
- package/dist/components/truncate/use-truncate.js.map +1 -1
- package/dist/components/typography/typography.d.ts +35 -2
- package/dist/components/typography/typography.d.ts.map +1 -1
- package/dist/components/typography/typography.js +23 -4
- 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 +65 -50
- package/dist/index.js +59 -44
- package/dist/package.js +1 -1
- package/dist/runtime/as-child.js +3 -2
- package/dist/runtime/as-child.js.map +1 -1
- package/dist/runtime/hydration.js +14 -0
- package/dist/runtime/hydration.js.map +1 -0
- package/dist/runtime/use-machine.js +3 -2
- package/dist/runtime/use-machine.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/use-scrollbars.js +3 -1
- package/dist/runtime/use-scrollbars.js.map +1 -1
- package/dist/services/notification-service.d.ts +26 -7
- package/dist/services/notification-service.d.ts.map +1 -1
- package/dist/services/notification-service.js +35 -8
- package/dist/services/notification-service.js.map +1 -1
- package/dist/sound.d.ts +6 -7
- package/dist/sound.d.ts.map +1 -1
- package/dist/sound.js +6 -6
- package/dist/sound.js.map +1 -1
- package/package.json +15 -14
- package/dist/components/gradient-text/gradient-text.d.ts +0 -36
- package/dist/components/gradient-text/gradient-text.d.ts.map +0 -1
- package/dist/components/gradient-text/gradient-text.js +0 -20
- package/dist/components/gradient-text/gradient-text.js.map +0 -1
- package/dist/components/icon-wrapper/icon-wrapper.d.ts +0 -29
- package/dist/components/icon-wrapper/icon-wrapper.d.ts.map +0 -1
- package/dist/components/icon-wrapper/icon-wrapper.js +0 -20
- package/dist/components/icon-wrapper/icon-wrapper.js.map +0 -1
- package/dist/components/segmented/context.d.ts +0 -13
- package/dist/components/segmented/context.d.ts.map +0 -1
- package/dist/components/segmented/context.js +0 -24
- package/dist/components/segmented/context.js.map +0 -1
- package/dist/components/segmented/segmented.d.ts +0 -161
- package/dist/components/segmented/segmented.d.ts.map +0 -1
- package/dist/components/segmented/segmented.js +0 -142
- package/dist/components/segmented/segmented.js.map +0 -1
- package/dist/components/segmented/use-segmented.d.ts +0 -15
- package/dist/components/segmented/use-segmented.d.ts.map +0 -1
- package/dist/components/segmented/use-segmented.js +0 -22
- package/dist/components/segmented/use-segmented.js.map +0 -1
- package/dist/components/toast/context.js +0 -15
- package/dist/components/toast/context.js.map +0 -1
- package/dist/components/toast/toast.d.ts +0 -123
- package/dist/components/toast/toast.d.ts.map +0 -1
- package/dist/components/toast/toast.js +0 -112
- package/dist/components/toast/toast.js.map +0 -1
- package/dist/components/toast/use-toast.d.ts +0 -10
- package/dist/components/toast/use-toast.d.ts.map +0 -1
- package/dist/components/toast/use-toast.js +0 -17
- package/dist/components/toast/use-toast.js.map +0 -1
- package/dist/services/toast-service.d.ts +0 -69
- package/dist/services/toast-service.d.ts.map +0 -1
- package/dist/services/toast-service.js +0 -161
- package/dist/services/toast-service.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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,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,cAAc,EAAE,MAAM,OAAiD;CACzE;CAEA,OAAO;EACL,eAAe,aAAqD;EACpE,gBAAgB,aAAsD;CACxE;CACA,OAAO;CAOP,MAAM,OAAO,EAAE,OAAO,QAAQ;EAC5B,MAAM,eAA2C,YAAW,KAAK,cAAc,OAAO;EACtF,MAAM,gBAA6C,YAAW,KAAK,eAAe,OAAO;EACzF,MAAM,MAAM,WAAW,aAAa,WAAW,KAAK,GAAmB,aAAa,YAAY;EAChG,eAAe,GAAG;EAClB,aAAa;GACX,MAAM,MAAM,IAAI,IAAI;GACpB,OAAO,EACL,OACA,IAAI,aAAa,GACjB,MAA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D;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
|
+
{"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,KA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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"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
+
import { PropType, SlotsType, VNode } from "vue";
|
|
3
|
+
import { ChartDatumDetails, ChartKey, ChartPalette, ChartRow, HierarchyChartApi, HierarchyChartSchema, HierarchyChartTranslations, HierarchyColorBy, HierarchyLayout, HierarchyTile, HierarchyTooltipModel, NumberFormatSpec } from "@xihan-ui/headless";
|
|
4
|
+
//#region src/components/hierarchy-chart/hierarchy-chart.d.ts
|
|
5
|
+
type HierarchyChartProps = HierarchyChartSchema['props'];
|
|
6
|
+
/** 默认插槽的载荷:自行摆放部件时用得上的状态与动作。 */
|
|
7
|
+
type HierarchyChartRootSlotProps = Pick<HierarchyChartApi, 'active' | 'tooltip' | 'empty' | 'path' | 'rootKey' | 'activeKey' | 'drillTo' | 'drillUp' | 'setFocusedDatum' | 'table'>;
|
|
8
|
+
/** 提示框插槽的载荷:激活的节点与缺省的内容模型。 */
|
|
9
|
+
interface HierarchyChartTooltipSlotProps {
|
|
10
|
+
active: ChartDatumDetails | null;
|
|
11
|
+
tooltip: HierarchyTooltipModel | null;
|
|
12
|
+
}
|
|
13
|
+
/** 标题:图表的可及名来源。 */
|
|
14
|
+
declare const XhHierarchyChartCaption: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
/** 下钻路径:从最顶层到当前的根,每一项是一个按钮;还在最顶层时收起。 */
|
|
18
|
+
declare const XhHierarchyChartPath: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
21
|
+
/** 图例:按值着色时每个看得见的层一条色阶(名字、低端的值、渐变条、高端的值);其余着色方式收起。 */
|
|
22
|
+
declare const XhHierarchyChartLegend: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
/** 视口:尺寸观测的宿主,块尺寸由组件槽决定。 */
|
|
26
|
+
declare const XhHierarchyChartViewport: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
/** 绘图区:节点由浅到深,名字与分组标题在上,焦点环最上。 */
|
|
30
|
+
declare const XhHierarchyChartPlot: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
/** 提示框:缺省内容按激活的节点生成,作用域插槽可替换。 */
|
|
34
|
+
declare const XhHierarchyChartTooltip: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
37
|
+
default?: (props: HierarchyChartTooltipSlotProps) => VNode[];
|
|
38
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
|
+
/** 空态:没有可画的数据时显示,缺省文字取文案。 */
|
|
40
|
+
declare const XhHierarchyChartEmpty: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
|
+
/** 根:铺开缺省结构或交给默认插槽,并在末尾追加摘要与数据表。 */
|
|
44
|
+
declare const XhHierarchyChartRoot: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
45
|
+
data: {
|
|
46
|
+
type: PropType<ChartRow | readonly ChartRow[]>;
|
|
47
|
+
};
|
|
48
|
+
childrenField: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
};
|
|
51
|
+
idField: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
parentField: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
nameField: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
};
|
|
60
|
+
valueField: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
};
|
|
63
|
+
layout: {
|
|
64
|
+
type: PropType<HierarchyLayout>;
|
|
65
|
+
};
|
|
66
|
+
tile: {
|
|
67
|
+
type: PropType<HierarchyTile>;
|
|
68
|
+
};
|
|
69
|
+
depth: {
|
|
70
|
+
type: NumberConstructor;
|
|
71
|
+
};
|
|
72
|
+
colorBy: {
|
|
73
|
+
type: PropType<HierarchyColorBy>;
|
|
74
|
+
};
|
|
75
|
+
palette: {
|
|
76
|
+
type: PropType<ChartPalette>;
|
|
77
|
+
};
|
|
78
|
+
orientation: {
|
|
79
|
+
type: PropType<"vertical" | "horizontal">;
|
|
80
|
+
};
|
|
81
|
+
rootKey: {
|
|
82
|
+
type: PropType<string | null>;
|
|
83
|
+
};
|
|
84
|
+
defaultRootKey: {
|
|
85
|
+
type: PropType<string | null>;
|
|
86
|
+
};
|
|
87
|
+
format: {
|
|
88
|
+
type: PropType<NumberFormatSpec | ((value: number) => string)>;
|
|
89
|
+
};
|
|
90
|
+
activeKey: {
|
|
91
|
+
type: PropType<ChartKey | null>;
|
|
92
|
+
};
|
|
93
|
+
pending: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
default: undefined;
|
|
96
|
+
};
|
|
97
|
+
animated: {
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
default: undefined;
|
|
100
|
+
};
|
|
101
|
+
locale: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
};
|
|
104
|
+
translations: {
|
|
105
|
+
type: PropType<Partial<HierarchyChartTranslations>>;
|
|
106
|
+
};
|
|
107
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
108
|
+
[key: string]: any;
|
|
109
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
110
|
+
'root-key-change': (_details: PayloadOf<HierarchyChartProps, "onRootKeyChange">) => true;
|
|
111
|
+
'update:rootKey': (_key: PayloadOf<HierarchyChartProps, "onRootKeyChange">["rootKey"]) => true;
|
|
112
|
+
'active-key-change': (_details: PayloadOf<HierarchyChartProps, "onActiveKeyChange">) => true;
|
|
113
|
+
'update:activeKey': (_key: PayloadOf<HierarchyChartProps, "onActiveKeyChange">["activeKey"]) => true;
|
|
114
|
+
'datum-active': (_details: PayloadOf<HierarchyChartProps, "onDatumActive">) => true;
|
|
115
|
+
'datum-press': (_details: PayloadOf<HierarchyChartProps, "onDatumPress">) => true;
|
|
116
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
117
|
+
data: {
|
|
118
|
+
type: PropType<ChartRow | readonly ChartRow[]>;
|
|
119
|
+
};
|
|
120
|
+
childrenField: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
};
|
|
123
|
+
idField: {
|
|
124
|
+
type: StringConstructor;
|
|
125
|
+
};
|
|
126
|
+
parentField: {
|
|
127
|
+
type: StringConstructor;
|
|
128
|
+
};
|
|
129
|
+
nameField: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
};
|
|
132
|
+
valueField: {
|
|
133
|
+
type: StringConstructor;
|
|
134
|
+
};
|
|
135
|
+
layout: {
|
|
136
|
+
type: PropType<HierarchyLayout>;
|
|
137
|
+
};
|
|
138
|
+
tile: {
|
|
139
|
+
type: PropType<HierarchyTile>;
|
|
140
|
+
};
|
|
141
|
+
depth: {
|
|
142
|
+
type: NumberConstructor;
|
|
143
|
+
};
|
|
144
|
+
colorBy: {
|
|
145
|
+
type: PropType<HierarchyColorBy>;
|
|
146
|
+
};
|
|
147
|
+
palette: {
|
|
148
|
+
type: PropType<ChartPalette>;
|
|
149
|
+
};
|
|
150
|
+
orientation: {
|
|
151
|
+
type: PropType<"vertical" | "horizontal">;
|
|
152
|
+
};
|
|
153
|
+
rootKey: {
|
|
154
|
+
type: PropType<string | null>;
|
|
155
|
+
};
|
|
156
|
+
defaultRootKey: {
|
|
157
|
+
type: PropType<string | null>;
|
|
158
|
+
};
|
|
159
|
+
format: {
|
|
160
|
+
type: PropType<NumberFormatSpec | ((value: number) => string)>;
|
|
161
|
+
};
|
|
162
|
+
activeKey: {
|
|
163
|
+
type: PropType<ChartKey | null>;
|
|
164
|
+
};
|
|
165
|
+
pending: {
|
|
166
|
+
type: BooleanConstructor;
|
|
167
|
+
default: undefined;
|
|
168
|
+
};
|
|
169
|
+
animated: {
|
|
170
|
+
type: BooleanConstructor;
|
|
171
|
+
default: undefined;
|
|
172
|
+
};
|
|
173
|
+
locale: {
|
|
174
|
+
type: StringConstructor;
|
|
175
|
+
};
|
|
176
|
+
translations: {
|
|
177
|
+
type: PropType<Partial<HierarchyChartTranslations>>;
|
|
178
|
+
};
|
|
179
|
+
}>> & Readonly<{
|
|
180
|
+
"onActive-key-change"?: ((_details: import("@xihan-ui/headless").ChartActiveKeyChangeDetails) => any) | undefined;
|
|
181
|
+
"onUpdate:activeKey"?: ((_key: ChartKey | null) => any) | undefined;
|
|
182
|
+
"onDatum-active"?: ((_details: ChartDatumDetails | null) => any) | undefined;
|
|
183
|
+
"onDatum-press"?: ((_details: ChartDatumDetails) => any) | undefined;
|
|
184
|
+
"onRoot-key-change"?: ((_details: import("@xihan-ui/headless").HierarchyRootKeyChangeDetails) => any) | undefined;
|
|
185
|
+
"onUpdate:rootKey"?: ((_key: string | null) => any) | undefined;
|
|
186
|
+
}>, {
|
|
187
|
+
pending: boolean;
|
|
188
|
+
animated: boolean;
|
|
189
|
+
}, SlotsType<{
|
|
190
|
+
/** 自行摆放部件;不写时铺开缺省结构:下钻路径、视口(绘图区与空态)、提示框。 */
|
|
191
|
+
default?: (props: HierarchyChartRootSlotProps) => VNode[];
|
|
192
|
+
/** 缺省结构里的标题内容。 */
|
|
193
|
+
caption?: () => VNode[];
|
|
194
|
+
/** 缺省结构里的提示框内容。 */
|
|
195
|
+
tooltip?: (props: HierarchyChartTooltipSlotProps) => VNode[];
|
|
196
|
+
/** 缺省结构里的空态内容。 */
|
|
197
|
+
empty?: () => VNode[];
|
|
198
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
199
|
+
//#endregion
|
|
200
|
+
export { HierarchyChartRootSlotProps, HierarchyChartTooltipSlotProps, XhHierarchyChartCaption, XhHierarchyChartEmpty, XhHierarchyChartLegend, XhHierarchyChartPath, XhHierarchyChartPlot, XhHierarchyChartRoot, XhHierarchyChartTooltip, XhHierarchyChartViewport };
|
|
201
|
+
//# sourceMappingURL=hierarchy-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hierarchy-chart.d.ts","names":[],"sources":["../../../src/components/hierarchy-chart/hierarchy-chart.ts"],"mappings":";;;;KA6BK,sBAAsB;;KAGf,8BAA8B,KAAK;;UAG9B;EACf,QAAQ;EACR,SAAS;;;cA2CE,uCAAuB,0BAAA,oBAAA,4BAAA;;8BAMlC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,oCAAoB,0BAAA,oBAAA,4BAAA;;8BAU/B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,sCAAsB,0BAAA,oBAAA,4BAAA;;8BAejC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,wCAAwB,0BAAA,oBAAA,4BAAA;;8BASnC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,oCAAoB,0BAAA,oBAAA,4BAAA;;8BAU/B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,uCAAuB,0BAAA,oBAAA,4BAAA;;;EAGtB,WAAC,OAAO,mCAAmC;kCAWvD;;cAGW,qCAAqB,0BAAA,oBAAA,4BAAA;;8BAMhC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,oCAAoB,8BAAA;;IAII,MAAA,SAAS,oBAAoB;;;;;;;;;;;;;;;;;;IAMpC,MAAA,SAAS;;;IACX,MAAA,SAAS;;;;;;IAEN,MAAA,SAAS;;;IACT,MAAA,SAAS;;;IACL,MAAA;;;IACI,MAAA;;;IACO,MAAA;;;IACJ,MAAA,SAAS,qBAAqB;;;IACjB,MAAA,SAAS;;;;;;;;;;;;;;IAI5B,MAAA,SAAS,QAAQ;;;;;EAInB,oBAAA,UAAA,UAAU;EACf,mBAAA,MAAA,UAAU;EACH,sBAAA,UAAA,UAAU;EACf,qBAAA,MAAA,UAAU;EACV,iBAAA,UAAA,UAAU;EACX,gBAAA,UAAA,UAAU;;;IA5BH,MAAA,SAAS,oBAAoB;;;;;;;;;;;;;;;;;;IAMpC,MAAA,SAAS;;;IACX,MAAA,SAAS;;;;;;IAEN,MAAA,SAAS;;;IACT,MAAA,SAAS;;;IACL,MAAA;;;IACI,MAAA;;;IACO,MAAA;;;IACJ,MAAA,SAAS,qBAAqB;;;IACjB,MAAA,SAAS;;;;;;;;;;;;;;IAI5B,MAAA,SAAS,QAAQ;;;;;;;;;;;;;;EAavC,WAAC,OAAO,gCAAgC;;EAExC,gBAAM;;EAEN,WAAC,OAAO,mCAAmC;;EAE7C,cAAM;kCAgDhB"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { withXhConfig } from "../../config/config.js";
|
|
2
|
+
import { provideHierarchyChart, useHierarchyChartContext } from "./context.js";
|
|
3
|
+
import { useHierarchyChart } from "./use-hierarchy-chart.js";
|
|
4
|
+
import { defineComponent, h } from "vue";
|
|
5
|
+
//#region src/components/hierarchy-chart/hierarchy-chart.ts
|
|
6
|
+
/** 一个场景标记画成 SVG 元素;文字标记带文字。 */
|
|
7
|
+
function renderMark(api, mark) {
|
|
8
|
+
const props = {
|
|
9
|
+
...api.getMarkProps(mark),
|
|
10
|
+
key: mark.key
|
|
11
|
+
};
|
|
12
|
+
if (mark.kind === "group") return h("g", props, mark.children.map((child) => renderMark(api, child)));
|
|
13
|
+
if (mark.kind === "text") return h("text", props, mark.text);
|
|
14
|
+
return h("path", props);
|
|
15
|
+
}
|
|
16
|
+
/** 缺省的提示框内容:头部是从当前的根到节点的路径,下面是数值与两种占比。 */
|
|
17
|
+
function renderTooltipContent(api) {
|
|
18
|
+
const tooltip = api.tooltip;
|
|
19
|
+
if (!tooltip) return [];
|
|
20
|
+
return [h("div", api.getTooltipHeaderProps(), tooltip.header), ...tooltip.rows.map((row) => h("div", {
|
|
21
|
+
...api.getTooltipRowProps(row),
|
|
22
|
+
key: row.key
|
|
23
|
+
}, [
|
|
24
|
+
h("span", api.getTooltipSwatchProps(row)),
|
|
25
|
+
h("span", api.getTooltipValueProps(row), row.value),
|
|
26
|
+
h("span", api.getTooltipNameProps(row), row.name)
|
|
27
|
+
]))];
|
|
28
|
+
}
|
|
29
|
+
/** 摘要与数据表:由根自动生成、视觉隐藏,保证无障碍等价物始终存在。 */
|
|
30
|
+
function renderA11y(api) {
|
|
31
|
+
const { columns, rows } = api.table;
|
|
32
|
+
return [h("p", api.getSummaryProps(), api.summary), h("table", api.getTableProps(), [
|
|
33
|
+
h("caption", api.tableCaption),
|
|
34
|
+
h("thead", [h("tr", columns.map((column) => h("th", {
|
|
35
|
+
key: column.id,
|
|
36
|
+
scope: "col"
|
|
37
|
+
}, column.label)))]),
|
|
38
|
+
h("tbody", rows.map((row, i) => h("tr", { key: i }, row.cells.map((cell, c) => c === 0 ? h("th", {
|
|
39
|
+
key: c,
|
|
40
|
+
scope: "row"
|
|
41
|
+
}, cell.text) : h("td", { key: c }, cell.text)))))
|
|
42
|
+
])];
|
|
43
|
+
}
|
|
44
|
+
/** 标题:图表的可及名来源。 */
|
|
45
|
+
const XhHierarchyChartCaption = defineComponent({
|
|
46
|
+
name: "XhHierarchyChartCaption",
|
|
47
|
+
setup(_, { slots }) {
|
|
48
|
+
const ctx = useHierarchyChartContext();
|
|
49
|
+
return () => h("figcaption", ctx.api.value.getCaptionProps(), slots.default?.());
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
/** 下钻路径:从最顶层到当前的根,每一项是一个按钮;还在最顶层时收起。 */
|
|
53
|
+
const XhHierarchyChartPath = defineComponent({
|
|
54
|
+
name: "XhHierarchyChartPath",
|
|
55
|
+
setup() {
|
|
56
|
+
const ctx = useHierarchyChartContext();
|
|
57
|
+
return () => {
|
|
58
|
+
const api = ctx.api.value;
|
|
59
|
+
return h("nav", api.getPathProps(), api.path.map((item) => h("button", {
|
|
60
|
+
...api.getPathItemProps(item),
|
|
61
|
+
key: item.key ?? ""
|
|
62
|
+
}, item.name)));
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
/** 图例:按值着色时每个看得见的层一条色阶(名字、低端的值、渐变条、高端的值);其余着色方式收起。 */
|
|
67
|
+
const XhHierarchyChartLegend = defineComponent({
|
|
68
|
+
name: "XhHierarchyChartLegend",
|
|
69
|
+
setup() {
|
|
70
|
+
const ctx = useHierarchyChartContext();
|
|
71
|
+
return () => {
|
|
72
|
+
const api = ctx.api.value;
|
|
73
|
+
return h("div", api.getLegendProps(), api.legendScales.map((scale) => h("div", {
|
|
74
|
+
...api.getLegendScaleProps(scale),
|
|
75
|
+
key: scale.level
|
|
76
|
+
}, [
|
|
77
|
+
h("span", api.getLegendScaleNameProps(), scale.name),
|
|
78
|
+
h("span", api.getLegendScaleValueProps("min"), scale.min),
|
|
79
|
+
h("span", api.getLegendScaleBarProps()),
|
|
80
|
+
h("span", api.getLegendScaleValueProps("max"), scale.max)
|
|
81
|
+
])));
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
/** 视口:尺寸观测的宿主,块尺寸由组件槽决定。 */
|
|
86
|
+
const XhHierarchyChartViewport = defineComponent({
|
|
87
|
+
name: "XhHierarchyChartViewport",
|
|
88
|
+
setup(_, { slots }) {
|
|
89
|
+
const ctx = useHierarchyChartContext();
|
|
90
|
+
return () => h("div", {
|
|
91
|
+
...ctx.api.value.getViewportProps(),
|
|
92
|
+
ref: (el) => {
|
|
93
|
+
ctx.viewportRef.value = el;
|
|
94
|
+
}
|
|
95
|
+
}, slots.default?.());
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
/** 绘图区:节点由浅到深,名字与分组标题在上,焦点环最上。 */
|
|
99
|
+
const XhHierarchyChartPlot = defineComponent({
|
|
100
|
+
name: "XhHierarchyChartPlot",
|
|
101
|
+
setup() {
|
|
102
|
+
const ctx = useHierarchyChartContext();
|
|
103
|
+
return () => {
|
|
104
|
+
const api = ctx.api.value;
|
|
105
|
+
const marks = [
|
|
106
|
+
...api.scene.layers.data,
|
|
107
|
+
...api.scene.layers.front,
|
|
108
|
+
...api.overlay.over
|
|
109
|
+
];
|
|
110
|
+
return h("svg", api.getPlotProps(), marks.map((mark) => renderMark(api, mark)));
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
/** 提示框:缺省内容按激活的节点生成,作用域插槽可替换。 */
|
|
115
|
+
const XhHierarchyChartTooltip = defineComponent({
|
|
116
|
+
name: "XhHierarchyChartTooltip",
|
|
117
|
+
slots: Object,
|
|
118
|
+
setup(_, { slots }) {
|
|
119
|
+
const ctx = useHierarchyChartContext();
|
|
120
|
+
return () => {
|
|
121
|
+
const api = ctx.api.value;
|
|
122
|
+
return h("div", api.getTooltipProps(), slots.default ? slots.default({
|
|
123
|
+
active: api.active,
|
|
124
|
+
tooltip: api.tooltip
|
|
125
|
+
}) : renderTooltipContent(api));
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
/** 空态:没有可画的数据时显示,缺省文字取文案。 */
|
|
130
|
+
const XhHierarchyChartEmpty = defineComponent({
|
|
131
|
+
name: "XhHierarchyChartEmpty",
|
|
132
|
+
setup(_, { slots }) {
|
|
133
|
+
const ctx = useHierarchyChartContext();
|
|
134
|
+
return () => h("div", ctx.api.value.getEmptyProps(), slots.default?.() ?? ctx.api.value.emptyText);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
/** 根:铺开缺省结构或交给默认插槽,并在末尾追加摘要与数据表。 */
|
|
138
|
+
const XhHierarchyChartRoot = defineComponent({
|
|
139
|
+
name: "XhHierarchyChartRoot",
|
|
140
|
+
props: {
|
|
141
|
+
data: { type: [Object, Array] },
|
|
142
|
+
childrenField: { type: String },
|
|
143
|
+
idField: { type: String },
|
|
144
|
+
parentField: { type: String },
|
|
145
|
+
nameField: { type: String },
|
|
146
|
+
valueField: { type: String },
|
|
147
|
+
layout: { type: String },
|
|
148
|
+
tile: { type: String },
|
|
149
|
+
depth: { type: Number },
|
|
150
|
+
colorBy: { type: String },
|
|
151
|
+
palette: { type: String },
|
|
152
|
+
orientation: { type: String },
|
|
153
|
+
rootKey: { type: [String, null] },
|
|
154
|
+
defaultRootKey: { type: [String, null] },
|
|
155
|
+
format: { type: [Object, Function] },
|
|
156
|
+
activeKey: { type: [
|
|
157
|
+
String,
|
|
158
|
+
Number,
|
|
159
|
+
Date,
|
|
160
|
+
null
|
|
161
|
+
] },
|
|
162
|
+
pending: {
|
|
163
|
+
type: Boolean,
|
|
164
|
+
default: void 0
|
|
165
|
+
},
|
|
166
|
+
animated: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
default: void 0
|
|
169
|
+
},
|
|
170
|
+
locale: { type: String },
|
|
171
|
+
translations: { type: Object }
|
|
172
|
+
},
|
|
173
|
+
emits: {
|
|
174
|
+
"root-key-change": (_details) => true,
|
|
175
|
+
"update:rootKey": (_key) => true,
|
|
176
|
+
"active-key-change": (_details) => true,
|
|
177
|
+
"update:activeKey": (_key) => true,
|
|
178
|
+
"datum-active": (_details) => true,
|
|
179
|
+
"datum-press": (_details) => true
|
|
180
|
+
},
|
|
181
|
+
slots: Object,
|
|
182
|
+
setup(props, { slots, emit }) {
|
|
183
|
+
const ctx = useHierarchyChart(withXhConfig("hierarchy-chart", props), {
|
|
184
|
+
onRootKeyChange: (details) => {
|
|
185
|
+
emit("root-key-change", details);
|
|
186
|
+
emit("update:rootKey", details.rootKey);
|
|
187
|
+
},
|
|
188
|
+
onActiveKeyChange: (details) => {
|
|
189
|
+
emit("active-key-change", details);
|
|
190
|
+
emit("update:activeKey", details.activeKey);
|
|
191
|
+
},
|
|
192
|
+
onDatumActive: (details) => emit("datum-active", details),
|
|
193
|
+
onDatumPress: (details) => emit("datum-press", details)
|
|
194
|
+
});
|
|
195
|
+
provideHierarchyChart(ctx);
|
|
196
|
+
return () => {
|
|
197
|
+
const api = ctx.api.value;
|
|
198
|
+
const content = slots.default ? slots.default({
|
|
199
|
+
active: api.active,
|
|
200
|
+
tooltip: api.tooltip,
|
|
201
|
+
empty: api.empty,
|
|
202
|
+
table: api.table,
|
|
203
|
+
path: api.path,
|
|
204
|
+
rootKey: api.rootKey,
|
|
205
|
+
activeKey: api.activeKey,
|
|
206
|
+
drillTo: api.drillTo,
|
|
207
|
+
drillUp: api.drillUp,
|
|
208
|
+
setFocusedDatum: api.setFocusedDatum
|
|
209
|
+
}) : [
|
|
210
|
+
...slots.caption ? [h(XhHierarchyChartCaption, null, () => slots.caption?.())] : [],
|
|
211
|
+
h(XhHierarchyChartPath),
|
|
212
|
+
h(XhHierarchyChartLegend),
|
|
213
|
+
h(XhHierarchyChartViewport, null, () => [h(XhHierarchyChartPlot), h(XhHierarchyChartEmpty, null, slots.empty ? () => slots.empty?.() : void 0)]),
|
|
214
|
+
h(XhHierarchyChartTooltip, null, slots.tooltip ? { default: slots.tooltip } : void 0)
|
|
215
|
+
];
|
|
216
|
+
return h("figure", {
|
|
217
|
+
...api.getRootProps(),
|
|
218
|
+
ref: (el) => {
|
|
219
|
+
ctx.rootRef.value = el;
|
|
220
|
+
}
|
|
221
|
+
}, [...content, ...renderA11y(api)]);
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
//#endregion
|
|
226
|
+
export { XhHierarchyChartCaption, XhHierarchyChartEmpty, XhHierarchyChartLegend, XhHierarchyChartPath, XhHierarchyChartPlot, XhHierarchyChartRoot, XhHierarchyChartTooltip, XhHierarchyChartViewport };
|
|
227
|
+
|
|
228
|
+
//# sourceMappingURL=hierarchy-chart.js.map
|