@xihan-ui/vue 1.0.0-alpha.2 → 1.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 +2615 -0
- package/README.md +1 -1
- package/dist/backgrounds.d.ts.map +1 -1
- package/dist/backgrounds.js +1 -5
- package/dist/backgrounds.js.map +1 -1
- package/dist/behavior.d.ts +38 -0
- package/dist/behavior.d.ts.map +1 -0
- package/dist/behavior.js +74 -0
- package/dist/behavior.js.map +1 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +15 -2
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/accordion/context.js +2 -2
- package/dist/components/accordion/context.js.map +1 -1
- package/dist/components/accordion/use-accordion.d.ts +3 -0
- package/dist/components/accordion/use-accordion.d.ts.map +1 -1
- package/dist/components/accordion/use-accordion.js +14 -3
- package/dist/components/accordion/use-accordion.js.map +1 -1
- package/dist/components/affix/context.js +1 -1
- package/dist/components/affix/context.js.map +1 -1
- package/dist/components/alert/context.js +1 -1
- package/dist/components/alert/context.js.map +1 -1
- package/dist/components/anchor/anchor.d.ts +1 -1
- package/dist/components/anchor/context.js +1 -1
- package/dist/components/anchor/context.js.map +1 -1
- package/dist/components/avatar/context.js +1 -1
- package/dist/components/avatar/context.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/avatar-group/context.js +1 -1
- package/dist/components/avatar-group/context.js.map +1 -1
- package/dist/components/back-top/back-top.d.ts +1 -1
- package/dist/components/back-top/context.js +1 -1
- package/dist/components/back-top/context.js.map +1 -1
- package/dist/components/badge/badge.d.ts +159 -11
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +68 -8
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/context.js +15 -0
- package/dist/components/badge/context.js.map +1 -0
- package/dist/components/breadcrumb/context.js +1 -1
- package/dist/components/breadcrumb/context.js.map +1 -1
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/button-group.js +2 -1
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/button.d.ts +13 -6
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +11 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar/calendar.d.ts +167 -7
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/calendar.js +125 -16
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/calendar/context.js +2 -2
- package/dist/components/calendar/context.js.map +1 -1
- package/dist/components/calendar/use-calendar.d.ts +1 -1
- package/dist/components/calendar/use-calendar.d.ts.map +1 -1
- package/dist/components/calendar/use-calendar.js +3 -2
- package/dist/components/calendar/use-calendar.js.map +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +2 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/context.js +1 -1
- package/dist/components/card/context.js.map +1 -1
- package/dist/components/carousel/context.js +1 -1
- package/dist/components/carousel/context.js.map +1 -1
- package/dist/components/cascader/cascader.d.ts +7 -4
- package/dist/components/cascader/cascader.d.ts.map +1 -1
- package/dist/components/cascader/cascader.js +28 -9
- package/dist/components/cascader/cascader.js.map +1 -1
- package/dist/components/cascader/context.js +2 -2
- package/dist/components/cascader/context.js.map +1 -1
- package/dist/components/cascader/use-cascader.d.ts +4 -0
- package/dist/components/cascader/use-cascader.d.ts.map +1 -1
- package/dist/components/cascader/use-cascader.js +15 -4
- package/dist/components/cascader/use-cascader.js.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts +17 -3
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +12 -2
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox-group/context.js +2 -2
- package/dist/components/checkbox-group/context.js.map +1 -1
- package/dist/components/clipboard/context.js +1 -1
- package/dist/components/clipboard/context.js.map +1 -1
- package/dist/components/code-block/code-block.d.ts +3 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/code-block.js +2 -0
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/collapsible/collapsible.d.ts +10 -2
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/collapsible.js +21 -3
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/collapsible/context.js +1 -1
- package/dist/components/collapsible/context.js.map +1 -1
- package/dist/components/collapsible/use-collapsible.d.ts +4 -1
- package/dist/components/collapsible/use-collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/use-collapsible.js +22 -4
- package/dist/components/collapsible/use-collapsible.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +16 -4
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +21 -6
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/context.js +2 -2
- package/dist/components/color-picker/context.js.map +1 -1
- package/dist/components/color-picker/use-color-picker.d.ts +4 -0
- package/dist/components/color-picker/use-color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/use-color-picker.js +14 -3
- package/dist/components/color-picker/use-color-picker.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts +15 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +26 -12
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/combobox/context.js +3 -3
- package/dist/components/combobox/context.js.map +1 -1
- package/dist/components/combobox/use-combobox.d.ts +4 -0
- package/dist/components/combobox/use-combobox.d.ts.map +1 -1
- package/dist/components/combobox/use-combobox.js +15 -4
- package/dist/components/combobox/use-combobox.js.map +1 -1
- package/dist/components/composer/context.js +1 -1
- package/dist/components/composer/context.js.map +1 -1
- package/dist/components/context-menu/context-menu.d.ts +45 -4
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +63 -17
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context.js +5 -5
- package/dist/components/context-menu/context.js.map +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts +4 -0
- package/dist/components/context-menu/use-context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/use-context-menu.js +15 -4
- package/dist/components/context-menu/use-context-menu.js.map +1 -1
- package/dist/components/date-field/context.js +1 -1
- package/dist/components/date-field/context.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts +38 -10
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +35 -9
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/context.js +17 -8
- package/dist/components/date-picker/context.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +291 -16
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +248 -36
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-picker/use-date-picker.d.ts +5 -1
- package/dist/components/date-picker/use-date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/use-date-picker.js +15 -4
- package/dist/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/components/descriptions/context.js +1 -1
- package/dist/components/descriptions/context.js.map +1 -1
- package/dist/components/descriptions/descriptions.d.ts.map +1 -1
- package/dist/components/descriptions/descriptions.js +6 -4
- package/dist/components/descriptions/descriptions.js.map +1 -1
- package/dist/components/dialog/context.js +1 -1
- package/dist/components/dialog/context.js.map +1 -1
- package/dist/components/dialog/dialog.d.ts +20 -3
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +23 -6
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/use-dialog.d.ts +2 -0
- package/dist/components/dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/dialog/use-dialog.js +9 -4
- package/dist/components/dialog/use-dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.d.ts +66 -0
- package/dist/components/download-trigger/download-trigger.d.ts.map +1 -0
- package/dist/components/download-trigger/download-trigger.js +56 -0
- package/dist/components/download-trigger/download-trigger.js.map +1 -0
- package/dist/components/download-trigger/use-download-trigger.d.ts +10 -0
- package/dist/components/download-trigger/use-download-trigger.d.ts.map +1 -0
- package/dist/components/download-trigger/use-download-trigger.js +16 -0
- package/dist/components/download-trigger/use-download-trigger.js.map +1 -0
- package/dist/components/drawer/context.js +1 -1
- package/dist/components/drawer/context.js.map +1 -1
- package/dist/components/drawer/drawer.d.ts +52 -4
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +39 -7
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/use-drawer.d.ts +3 -1
- package/dist/components/drawer/use-drawer.d.ts.map +1 -1
- package/dist/components/drawer/use-drawer.js +11 -5
- package/dist/components/drawer/use-drawer.js.map +1 -1
- package/dist/components/dynamic-input/context.js +2 -2
- package/dist/components/dynamic-input/context.js.map +1 -1
- package/dist/components/dynamic-input/dynamic-input.d.ts +2 -2
- package/dist/components/dynamic-input/dynamic-input.d.ts.map +1 -1
- package/dist/components/dynamic-input/dynamic-input.js +4 -4
- package/dist/components/dynamic-input/dynamic-input.js.map +1 -1
- package/dist/components/editable/context.js +1 -1
- package/dist/components/editable/context.js.map +1 -1
- package/dist/components/ellipsis/ellipsis.d.ts +1 -1
- package/dist/components/empty-state/context.js +1 -1
- package/dist/components/empty-state/context.js.map +1 -1
- package/dist/components/empty-state/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state/empty-state.js +2 -1
- package/dist/components/empty-state/empty-state.js.map +1 -1
- package/dist/components/field/context.d.ts +9 -0
- package/dist/components/field/context.d.ts.map +1 -0
- package/dist/components/field/context.js +6 -2
- package/dist/components/field/context.js.map +1 -1
- package/dist/components/field/field.d.ts +35 -2
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +31 -4
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/use-field-control.d.ts +41 -0
- package/dist/components/field/use-field-control.d.ts.map +1 -0
- package/dist/components/field/use-field-control.js +77 -0
- package/dist/components/field/use-field-control.js.map +1 -0
- package/dist/components/fieldset/context.d.ts +6 -0
- package/dist/components/fieldset/context.d.ts.map +1 -0
- package/dist/components/fieldset/context.js +15 -0
- package/dist/components/fieldset/context.js.map +1 -0
- package/dist/components/fieldset/fieldset.d.ts +57 -0
- package/dist/components/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/fieldset.js +56 -0
- package/dist/components/fieldset/fieldset.js.map +1 -0
- package/dist/components/fieldset/use-fieldset.d.ts +10 -0
- package/dist/components/fieldset/use-fieldset.d.ts.map +1 -0
- package/dist/components/fieldset/use-fieldset.js +14 -0
- package/dist/components/fieldset/use-fieldset.js.map +1 -0
- package/dist/components/file-upload/context.js +2 -2
- package/dist/components/file-upload/context.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +11 -3
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +15 -3
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/flex/flex.d.ts +10 -1
- package/dist/components/flex/flex.d.ts.map +1 -1
- package/dist/components/flex/flex.js +4 -0
- package/dist/components/flex/flex.js.map +1 -1
- package/dist/components/float-button/context.js +1 -1
- package/dist/components/float-button/context.js.map +1 -1
- package/dist/components/float-button/float-button.d.ts +2 -2
- package/dist/components/floating-panel/context.d.ts +6 -0
- package/dist/components/floating-panel/context.d.ts.map +1 -0
- package/dist/components/floating-panel/context.js +15 -0
- package/dist/components/floating-panel/context.js.map +1 -0
- package/dist/components/floating-panel/floating-panel.d.ts +216 -0
- package/dist/components/floating-panel/floating-panel.d.ts.map +1 -0
- package/dist/components/floating-panel/floating-panel.js +202 -0
- package/dist/components/floating-panel/floating-panel.js.map +1 -0
- package/dist/components/floating-panel/use-floating-panel.d.ts +18 -0
- package/dist/components/floating-panel/use-floating-panel.d.ts.map +1 -0
- package/dist/components/floating-panel/use-floating-panel.js +28 -0
- package/dist/components/floating-panel/use-floating-panel.js.map +1 -0
- package/dist/components/form/context.js +2 -2
- package/dist/components/form/context.js.map +1 -1
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/grid/context.js +1 -1
- package/dist/components/grid/context.js.map +1 -1
- package/dist/components/heatmap/context.d.ts +7 -0
- package/dist/components/heatmap/context.d.ts.map +1 -0
- package/dist/components/heatmap/context.js +32 -0
- package/dist/components/heatmap/context.js.map +1 -0
- package/dist/components/heatmap/heatmap.d.ts +352 -0
- package/dist/components/heatmap/heatmap.d.ts.map +1 -0
- package/dist/components/heatmap/heatmap.js +374 -0
- package/dist/components/heatmap/heatmap.js.map +1 -0
- package/dist/components/heatmap/use-heatmap.d.ts +13 -0
- package/dist/components/heatmap/use-heatmap.d.ts.map +1 -0
- package/dist/components/heatmap/use-heatmap.js +20 -0
- package/dist/components/heatmap/use-heatmap.js.map +1 -0
- package/dist/components/hotkeys/hotkeys.d.ts +89 -0
- package/dist/components/hotkeys/hotkeys.d.ts.map +1 -0
- package/dist/components/hotkeys/hotkeys.js +83 -0
- package/dist/components/hotkeys/hotkeys.js.map +1 -0
- package/dist/components/hotkeys/use-hotkeys.d.ts +31 -0
- package/dist/components/hotkeys/use-hotkeys.d.ts.map +1 -0
- package/dist/components/hotkeys/use-hotkeys.js +60 -0
- package/dist/components/hotkeys/use-hotkeys.js.map +1 -0
- package/dist/components/hover-card/context.js +1 -1
- package/dist/components/hover-card/context.js.map +1 -1
- package/dist/components/hover-card/hover-card.d.ts +11 -3
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.js +27 -11
- package/dist/components/hover-card/hover-card.js.map +1 -1
- package/dist/components/hover-card/use-hover-card.d.ts +4 -0
- package/dist/components/hover-card/use-hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/use-hover-card.js +15 -4
- package/dist/components/hover-card/use-hover-card.js.map +1 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +2 -1
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/icon-wrapper/icon-wrapper.d.ts.map +1 -1
- package/dist/components/icon-wrapper/icon-wrapper.js +2 -1
- package/dist/components/icon-wrapper/icon-wrapper.js.map +1 -1
- package/dist/components/image/context.js +1 -1
- package/dist/components/image/context.js.map +1 -1
- package/dist/components/image-cropper/context.d.ts +6 -0
- package/dist/components/image-cropper/context.d.ts.map +1 -0
- package/dist/components/image-cropper/context.js +15 -0
- package/dist/components/image-cropper/context.js.map +1 -0
- package/dist/components/image-cropper/image-cropper.d.ts +195 -0
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -0
- package/dist/components/image-cropper/image-cropper.js +165 -0
- package/dist/components/image-cropper/image-cropper.js.map +1 -0
- package/dist/components/image-cropper/use-image-cropper.d.ts +15 -0
- package/dist/components/image-cropper/use-image-cropper.d.ts.map +1 -0
- package/dist/components/image-cropper/use-image-cropper.js +22 -0
- package/dist/components/image-cropper/use-image-cropper.js.map +1 -0
- package/dist/components/image-viewer/context.js +1 -1
- package/dist/components/image-viewer/context.js.map +1 -1
- package/dist/components/image-viewer/image-viewer.d.ts +13 -5
- package/dist/components/image-viewer/image-viewer.d.ts.map +1 -1
- package/dist/components/image-viewer/image-viewer.js +29 -16
- package/dist/components/image-viewer/image-viewer.js.map +1 -1
- package/dist/components/image-viewer/use-image-viewer.d.ts +2 -0
- package/dist/components/image-viewer/use-image-viewer.d.ts.map +1 -1
- package/dist/components/image-viewer/use-image-viewer.js +9 -4
- package/dist/components/image-viewer/use-image-viewer.js.map +1 -1
- package/dist/components/infinite-scroll/context.js +1 -1
- package/dist/components/infinite-scroll/context.js.map +1 -1
- package/dist/components/json-viewer/json-viewer.d.ts +129 -0
- package/dist/components/json-viewer/json-viewer.d.ts.map +1 -0
- package/dist/components/json-viewer/json-viewer.js +132 -0
- package/dist/components/json-viewer/json-viewer.js.map +1 -0
- package/dist/components/json-viewer/use-json-viewer.d.ts +13 -0
- package/dist/components/json-viewer/use-json-viewer.d.ts.map +1 -0
- package/dist/components/json-viewer/use-json-viewer.js +19 -0
- package/dist/components/json-viewer/use-json-viewer.js.map +1 -0
- package/dist/components/layout/context.js +1 -1
- package/dist/components/layout/context.js.map +1 -1
- package/dist/components/list/context.js +1 -1
- package/dist/components/list/context.js.map +1 -1
- package/dist/components/list/list.d.ts +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.js +6 -4
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/listbox/context.js +3 -3
- package/dist/components/listbox/context.js.map +1 -1
- package/dist/components/loading-bar/context.js +1 -1
- package/dist/components/loading-bar/context.js.map +1 -1
- package/dist/components/log/context.js +1 -1
- package/dist/components/log/context.js.map +1 -1
- package/dist/components/marquee/context.js +1 -1
- package/dist/components/marquee/context.js.map +1 -1
- package/dist/components/masonry/masonry.d.ts +41 -0
- package/dist/components/masonry/masonry.d.ts.map +1 -0
- package/dist/components/masonry/masonry.js +159 -0
- package/dist/components/masonry/masonry.js.map +1 -0
- package/dist/components/mention/context.js +2 -2
- package/dist/components/mention/context.js.map +1 -1
- package/dist/components/mention/mention.d.ts +7 -1
- package/dist/components/mention/mention.d.ts.map +1 -1
- package/dist/components/mention/mention.js +18 -8
- package/dist/components/mention/mention.js.map +1 -1
- package/dist/components/mention/use-mention.d.ts +4 -0
- package/dist/components/mention/use-mention.d.ts.map +1 -1
- package/dist/components/mention/use-mention.js +14 -3
- package/dist/components/mention/use-mention.js.map +1 -1
- package/dist/components/menu/context.d.ts +9 -1
- package/dist/components/menu/context.d.ts.map +1 -1
- package/dist/components/menu/context.js +13 -4
- package/dist/components/menu/context.js.map +1 -1
- package/dist/components/menu/menu.d.ts +72 -4
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +80 -20
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menu/use-menu.d.ts +4 -0
- package/dist/components/menu/use-menu.d.ts.map +1 -1
- package/dist/components/menu/use-menu.js +15 -4
- package/dist/components/menu/use-menu.js.map +1 -1
- package/dist/components/menubar/context.d.ts +21 -0
- package/dist/components/menubar/context.d.ts.map +1 -0
- package/dist/components/menubar/context.js +23 -5
- package/dist/components/menubar/context.js.map +1 -1
- package/dist/components/menubar/menubar.d.ts +128 -1
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +152 -16
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/menubar/use-menubar.d.ts +2 -0
- package/dist/components/menubar/use-menubar.d.ts.map +1 -1
- package/dist/components/menubar/use-menubar.js +9 -3
- package/dist/components/menubar/use-menubar.js.map +1 -1
- package/dist/components/navigation-menu/context.js +1 -1
- package/dist/components/navigation-menu/context.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +22 -3
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/navigation-menu/use-navigation-menu.d.ts +2 -0
- package/dist/components/navigation-menu/use-navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu/use-navigation-menu.js +22 -2
- package/dist/components/navigation-menu/use-navigation-menu.js.map +1 -1
- package/dist/components/notification/context.d.ts +23 -0
- package/dist/components/notification/context.d.ts.map +1 -0
- package/dist/components/notification/context.js +28 -0
- package/dist/components/notification/context.js.map +1 -0
- package/dist/components/notification/notification.d.ts +249 -0
- package/dist/components/notification/notification.d.ts.map +1 -0
- package/dist/components/notification/notification.js +179 -0
- package/dist/components/notification/notification.js.map +1 -0
- package/dist/components/notification/use-notification.d.ts +14 -0
- package/dist/components/notification/use-notification.d.ts.map +1 -0
- package/dist/components/notification/use-notification.js +42 -0
- package/dist/components/notification/use-notification.js.map +1 -0
- package/dist/components/number-animation/number-animation.d.ts +1 -1
- package/dist/components/number-field/context.js +1 -1
- package/dist/components/number-field/context.js.map +1 -1
- package/dist/components/number-field/number-field.d.ts +23 -2
- package/dist/components/number-field/number-field.d.ts.map +1 -1
- package/dist/components/number-field/number-field.js +23 -2
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/page-header/context.js +1 -1
- package/dist/components/page-header/context.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/context.js +1 -1
- package/dist/components/pagination/context.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts +58 -4
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +85 -5
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pagination/use-pagination.d.ts +12 -2
- package/dist/components/pagination/use-pagination.d.ts.map +1 -1
- package/dist/components/pagination/use-pagination.js +50 -5
- package/dist/components/pagination/use-pagination.js.map +1 -1
- package/dist/components/password-input/context.d.ts +6 -0
- package/dist/components/password-input/context.d.ts.map +1 -0
- package/dist/components/password-input/context.js +15 -0
- package/dist/components/password-input/context.js.map +1 -0
- package/dist/components/password-input/password-input.d.ts +179 -0
- package/dist/components/password-input/password-input.d.ts.map +1 -0
- package/dist/components/password-input/password-input.js +147 -0
- package/dist/components/password-input/password-input.js.map +1 -0
- package/dist/components/password-input/use-password-input.d.ts +10 -0
- package/dist/components/password-input/use-password-input.d.ts.map +1 -0
- package/dist/components/password-input/use-password-input.js +18 -0
- package/dist/components/password-input/use-password-input.js.map +1 -0
- package/dist/components/pin-input/context.js +1 -1
- package/dist/components/pin-input/context.js.map +1 -1
- package/dist/components/pin-input/pin-input.d.ts +9 -0
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/pin-input/pin-input.js +4 -0
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/popconfirm/context.js +1 -1
- package/dist/components/popconfirm/context.js.map +1 -1
- package/dist/components/popconfirm/popconfirm.d.ts +11 -3
- package/dist/components/popconfirm/popconfirm.d.ts.map +1 -1
- package/dist/components/popconfirm/popconfirm.js +25 -11
- package/dist/components/popconfirm/popconfirm.js.map +1 -1
- package/dist/components/popconfirm/use-popconfirm.d.ts +4 -0
- package/dist/components/popconfirm/use-popconfirm.d.ts.map +1 -1
- package/dist/components/popconfirm/use-popconfirm.js +14 -3
- package/dist/components/popconfirm/use-popconfirm.js.map +1 -1
- package/dist/components/popover/context.js +1 -1
- package/dist/components/popover/context.js.map +1 -1
- package/dist/components/popover/popover.d.ts +12 -4
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +27 -11
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/popover/use-popover.d.ts +4 -0
- package/dist/components/popover/use-popover.d.ts.map +1 -1
- package/dist/components/popover/use-popover.js +15 -4
- package/dist/components/popover/use-popover.js.map +1 -1
- package/dist/components/popselect/context.js +2 -2
- package/dist/components/popselect/context.js.map +1 -1
- package/dist/components/popselect/popselect.d.ts +30 -5
- package/dist/components/popselect/popselect.d.ts.map +1 -1
- package/dist/components/popselect/popselect.js +51 -13
- package/dist/components/popselect/popselect.js.map +1 -1
- package/dist/components/popselect/use-popselect.d.ts +6 -1
- package/dist/components/popselect/use-popselect.d.ts.map +1 -1
- package/dist/components/popselect/use-popselect.js +24 -12
- package/dist/components/popselect/use-popselect.js.map +1 -1
- package/dist/components/progress/progress.d.ts +5 -2
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/progress/progress.js +4 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/qr-code/context.js +1 -1
- package/dist/components/qr-code/context.js.map +1 -1
- package/dist/components/radio-group/context.js +2 -2
- package/dist/components/radio-group/context.js.map +1 -1
- package/dist/components/radio-group/radio-group.d.ts +9 -0
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +3 -0
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/rating/context.js +1 -1
- package/dist/components/rating/context.js.map +1 -1
- package/dist/components/result/context.js +1 -1
- package/dist/components/result/context.js.map +1 -1
- package/dist/components/result/result.d.ts.map +1 -1
- package/dist/components/result/result.js +3 -1
- package/dist/components/result/result.js.map +1 -1
- package/dist/components/scroll-area/context.js +2 -2
- package/dist/components/scroll-area/context.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts +28 -9
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +24 -4
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-area/use-scroll-area.d.ts +10 -8
- package/dist/components/scroll-area/use-scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area/use-scroll-area.js +24 -10
- package/dist/components/scroll-area/use-scroll-area.js.map +1 -1
- package/dist/components/scrollbar/context.d.ts +7 -0
- package/dist/components/scrollbar/context.d.ts.map +1 -0
- package/dist/components/scrollbar/context.js +15 -0
- package/dist/components/scrollbar/context.js.map +1 -0
- package/dist/components/scrollbar/scrollbar.d.ts +162 -0
- package/dist/components/scrollbar/scrollbar.d.ts.map +1 -0
- package/dist/components/scrollbar/scrollbar.js +129 -0
- package/dist/components/scrollbar/scrollbar.js.map +1 -0
- package/dist/components/scrollbar/use-scrollbar.d.ts +23 -0
- package/dist/components/scrollbar/use-scrollbar.d.ts.map +1 -0
- package/dist/components/scrollbar/use-scrollbar.js +43 -0
- package/dist/components/scrollbar/use-scrollbar.js.map +1 -0
- package/dist/components/segmented/context.d.ts +13 -0
- package/dist/components/segmented/context.d.ts.map +1 -0
- package/dist/components/segmented/context.js +24 -0
- package/dist/components/segmented/context.js.map +1 -0
- package/dist/components/segmented/segmented.d.ts +185 -0
- package/dist/components/segmented/segmented.d.ts.map +1 -0
- package/dist/components/segmented/segmented.js +165 -0
- package/dist/components/segmented/segmented.js.map +1 -0
- package/dist/components/segmented/use-segmented.d.ts +15 -0
- package/dist/components/segmented/use-segmented.d.ts.map +1 -0
- package/dist/components/segmented/use-segmented.js +22 -0
- package/dist/components/segmented/use-segmented.js.map +1 -0
- package/dist/components/select/context.js +3 -3
- package/dist/components/select/context.js.map +1 -1
- package/dist/components/select/select.d.ts +26 -4
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +45 -17
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/use-select.d.ts +4 -0
- package/dist/components/select/use-select.d.ts.map +1 -1
- package/dist/components/select/use-select.js +14 -3
- package/dist/components/select/use-select.js.map +1 -1
- package/dist/components/separator/separator.d.ts.map +1 -1
- package/dist/components/separator/separator.js +11 -2
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/side-nav/context.js +2 -2
- package/dist/components/side-nav/context.js.map +1 -1
- package/dist/components/side-nav/side-nav.d.ts +6 -3
- package/dist/components/side-nav/side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/side-nav.js +32 -4
- package/dist/components/side-nav/side-nav.js.map +1 -1
- package/dist/components/side-nav/use-side-nav.d.ts +5 -0
- package/dist/components/side-nav/use-side-nav.d.ts.map +1 -1
- package/dist/components/side-nav/use-side-nav.js +12 -1
- package/dist/components/side-nav/use-side-nav.js.map +1 -1
- package/dist/components/signature-pad/context.d.ts +6 -0
- package/dist/components/signature-pad/context.d.ts.map +1 -0
- package/dist/components/signature-pad/context.js +15 -0
- package/dist/components/signature-pad/context.js.map +1 -0
- package/dist/components/signature-pad/signature-pad.d.ts +108 -0
- package/dist/components/signature-pad/signature-pad.d.ts.map +1 -0
- package/dist/components/signature-pad/signature-pad.js +118 -0
- package/dist/components/signature-pad/signature-pad.js.map +1 -0
- package/dist/components/signature-pad/use-signature-pad.d.ts +14 -0
- package/dist/components/signature-pad/use-signature-pad.d.ts.map +1 -0
- package/dist/components/signature-pad/use-signature-pad.js +24 -0
- package/dist/components/signature-pad/use-signature-pad.js.map +1 -0
- package/dist/components/skeleton/context.js +1 -1
- package/dist/components/skeleton/context.js.map +1 -1
- package/dist/components/slider/context.js +2 -2
- package/dist/components/slider/context.js.map +1 -1
- package/dist/components/space/context.d.ts +10 -0
- package/dist/components/space/context.d.ts.map +1 -0
- package/dist/components/space/context.js +15 -0
- package/dist/components/space/context.js.map +1 -0
- package/dist/components/space/space.d.ts +75 -0
- package/dist/components/space/space.d.ts.map +1 -0
- package/dist/components/space/space.js +91 -0
- package/dist/components/space/space.js.map +1 -0
- package/dist/components/spinner/context.js +1 -1
- package/dist/components/spinner/context.js.map +1 -1
- package/dist/components/splitter/context.js +1 -1
- package/dist/components/splitter/context.js.map +1 -1
- package/dist/components/splitter/splitter.d.ts +1 -1
- package/dist/components/statistic/context.js +1 -1
- package/dist/components/statistic/context.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/context.js +2 -2
- package/dist/components/steps/context.js.map +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/switch/switch.d.ts +9 -0
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +11 -2
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/context.js +4 -4
- package/dist/components/table/context.js.map +1 -1
- package/dist/components/table/table.d.ts +70 -2
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +40 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-table.d.ts +1 -1
- package/dist/components/table/use-table.d.ts.map +1 -1
- package/dist/components/table/use-table.js +3 -2
- package/dist/components/table/use-table.js.map +1 -1
- package/dist/components/tabs/context.js +1 -1
- package/dist/components/tabs/context.js.map +1 -1
- package/dist/components/tag/context.d.ts +6 -0
- package/dist/components/tag/context.d.ts.map +1 -0
- package/dist/components/tag/context.js +15 -0
- package/dist/components/tag/context.js.map +1 -0
- package/dist/components/tag/tag.d.ts +71 -0
- package/dist/components/tag/tag.d.ts.map +1 -0
- package/dist/components/tag/tag.js +61 -0
- package/dist/components/tag/tag.js.map +1 -0
- package/dist/components/tag/use-tag.d.ts +10 -0
- package/dist/components/tag/use-tag.d.ts.map +1 -0
- package/dist/components/tag/use-tag.js +28 -0
- package/dist/components/tag/use-tag.js.map +1 -0
- package/dist/components/tags-input/context.js +2 -2
- package/dist/components/tags-input/context.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +2 -2
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +7 -1
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/text-field/context.js +1 -1
- package/dist/components/text-field/context.js.map +1 -1
- package/dist/components/text-field/text-field.d.ts +24 -3
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/components/text-field/text-field.js +23 -4
- package/dist/components/text-field/text-field.js.map +1 -1
- package/dist/components/thread/context.d.ts +7 -0
- package/dist/components/thread/context.d.ts.map +1 -0
- package/dist/components/thread/context.js +1 -1
- package/dist/components/thread/context.js.map +1 -1
- package/dist/components/time/time.d.ts +4 -4
- package/dist/components/time/time.d.ts.map +1 -1
- package/dist/components/time/time.js.map +1 -1
- package/dist/components/time-field/context.js +1 -1
- package/dist/components/time-field/context.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts +18 -3
- package/dist/components/time-field/time-field.d.ts.map +1 -1
- package/dist/components/time-field/time-field.js +20 -1
- package/dist/components/time-field/time-field.js.map +1 -1
- package/dist/components/time-picker/context.js +2 -2
- package/dist/components/time-picker/context.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +93 -6
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +89 -9
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/time-picker/use-time-picker.d.ts +5 -0
- package/dist/components/time-picker/use-time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/use-time-picker.js +17 -3
- package/dist/components/time-picker/use-time-picker.js.map +1 -1
- package/dist/components/timeline/context.js +2 -2
- package/dist/components/timeline/context.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/timer/context.d.ts +6 -0
- package/dist/components/timer/context.d.ts.map +1 -0
- package/dist/components/timer/context.js +15 -0
- package/dist/components/timer/context.js.map +1 -0
- package/dist/components/timer/timer.d.ts +110 -0
- package/dist/components/timer/timer.d.ts.map +1 -0
- package/dist/components/timer/timer.js +139 -0
- package/dist/components/timer/timer.js.map +1 -0
- package/dist/components/timer/use-timer.d.ts +13 -0
- package/dist/components/timer/use-timer.d.ts.map +1 -0
- package/dist/components/timer/use-timer.js +19 -0
- package/dist/components/timer/use-timer.js.map +1 -0
- package/dist/components/toast/context.js +1 -1
- package/dist/components/toast/context.js.map +1 -1
- package/dist/components/toast/toast.d.ts +3 -15
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/components/toast/toast.js +1 -12
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toast/use-toast.d.ts.map +1 -1
- package/dist/components/toast/use-toast.js +1 -7
- package/dist/components/toast/use-toast.js.map +1 -1
- package/dist/components/toggle-group/context.js +1 -1
- package/dist/components/toggle-group/context.js.map +1 -1
- package/dist/components/toggle-group/toggle-group.d.ts +10 -1
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +4 -0
- package/dist/components/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/toolbar/context.js +1 -1
- package/dist/components/toolbar/context.js.map +1 -1
- package/dist/components/tooltip/context.js +1 -1
- package/dist/components/tooltip/context.js.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +11 -3
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +31 -12
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tooltip/use-tooltip.d.ts +6 -0
- package/dist/components/tooltip/use-tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/use-tooltip.js +36 -5
- package/dist/components/tooltip/use-tooltip.js.map +1 -1
- package/dist/components/tour/context.js +1 -1
- package/dist/components/tour/context.js.map +1 -1
- package/dist/components/tour/tour.d.ts +3 -3
- package/dist/components/tour/tour.d.ts.map +1 -1
- package/dist/components/tour/tour.js +20 -11
- package/dist/components/tour/tour.js.map +1 -1
- package/dist/components/tour/use-tour.d.ts +6 -0
- package/dist/components/tour/use-tour.d.ts.map +1 -1
- package/dist/components/tour/use-tour.js +18 -3
- package/dist/components/tour/use-tour.js.map +1 -1
- package/dist/components/transfer/context.js +3 -3
- package/dist/components/transfer/context.js.map +1 -1
- package/dist/components/transfer/transfer.d.ts +10 -10
- package/dist/components/transfer/transfer.d.ts.map +1 -1
- package/dist/components/transfer/transfer.js +8 -8
- package/dist/components/transfer/transfer.js.map +1 -1
- package/dist/components/tree/context.js +2 -2
- package/dist/components/tree/context.js.map +1 -1
- package/dist/components/tree/tree.d.ts +36 -10
- package/dist/components/tree/tree.d.ts.map +1 -1
- package/dist/components/tree/tree.js +31 -6
- package/dist/components/tree/tree.js.map +1 -1
- package/dist/components/tree-select/context.js +2 -2
- package/dist/components/tree-select/context.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +23 -3
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.js +60 -12
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/tree-select/use-tree-select.d.ts +4 -0
- package/dist/components/tree-select/use-tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/use-tree-select.js +15 -4
- package/dist/components/tree-select/use-tree-select.js.map +1 -1
- package/dist/components/typography/context.js +1 -1
- package/dist/components/typography/context.js.map +1 -1
- package/dist/components/typography/typography.d.ts.map +1 -1
- package/dist/components/typography/typography.js +2 -1
- package/dist/components/typography/typography.js.map +1 -1
- package/dist/components/virtualizer/context.js +1 -1
- package/dist/components/virtualizer/context.js.map +1 -1
- package/dist/components/watermark/context.js +1 -1
- package/dist/components/watermark/context.js.map +1 -1
- package/dist/config/config.d.ts +26 -10
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +42 -15
- package/dist/config/config.js.map +1 -1
- package/dist/index.d.ts +75 -29
- package/dist/index.js +74 -28
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/dist/runtime/as-child.js +66 -0
- package/dist/runtime/as-child.js.map +1 -0
- package/dist/runtime/config-defaults.js +19 -0
- package/dist/runtime/config-defaults.js.map +1 -0
- package/dist/runtime/normalize-props.d.ts.map +1 -1
- package/dist/runtime/normalize-props.js +5 -1
- package/dist/runtime/normalize-props.js.map +1 -1
- package/dist/runtime/use-machine.d.ts.map +1 -1
- package/dist/runtime/use-machine.js +17 -1
- package/dist/runtime/use-machine.js.map +1 -1
- package/dist/runtime/use-overlay-exit.js +40 -0
- package/dist/runtime/use-overlay-exit.js.map +1 -0
- package/dist/runtime/use-scrollbars.js +66 -0
- package/dist/runtime/use-scrollbars.js.map +1 -0
- package/dist/services/dialog-service.d.ts +43 -8
- package/dist/services/dialog-service.d.ts.map +1 -1
- package/dist/services/dialog-service.js +47 -20
- package/dist/services/dialog-service.js.map +1 -1
- package/dist/services/glyph.js +93 -20
- package/dist/services/glyph.js.map +1 -1
- package/dist/services/loading-bar-service.d.ts +46 -0
- package/dist/services/loading-bar-service.d.ts.map +1 -0
- package/dist/services/loading-bar-service.js +70 -0
- package/dist/services/loading-bar-service.js.map +1 -0
- package/dist/services/mount-host.js +35 -0
- package/dist/services/mount-host.js.map +1 -0
- package/dist/services/notification-service.d.ts +46 -0
- package/dist/services/notification-service.d.ts.map +1 -0
- package/dist/services/notification-service.js +91 -0
- package/dist/services/notification-service.js.map +1 -0
- package/dist/services/service-config.js +16 -0
- package/dist/services/service-config.js.map +1 -0
- package/dist/services/toast-service.d.ts +23 -9
- package/dist/services/toast-service.d.ts.map +1 -1
- package/dist/services/toast-service.js +103 -48
- package/dist/services/toast-service.js.map +1 -1
- package/package.json +18 -14
- package/dist/components/toaster/context.js +0 -19
- package/dist/components/toaster/context.js.map +0 -1
- package/dist/components/toaster/toaster.d.ts +0 -135
- package/dist/components/toaster/toaster.d.ts.map +0 -1
- package/dist/components/toaster/toaster.js +0 -91
- package/dist/components/toaster/toaster.js.map +0 -1
- package/dist/components/toaster/use-toaster.d.ts +0 -15
- package/dist/components/toaster/use-toaster.d.ts.map +0 -1
- package/dist/components/toaster/use-toaster.js +0 -23
- package/dist/components/toaster/use-toaster.js.map +0 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { withXhConfig } from "../../config/config.js";
|
|
2
|
+
import { provideHeatmap, provideHeatmapMonth, provideHeatmapRow, useHeatmapContext, useHeatmapMonth, useHeatmapRow } from "./context.js";
|
|
3
|
+
import { useHeatmap } from "./use-heatmap.js";
|
|
4
|
+
import { computed, defineComponent, h } from "vue";
|
|
5
|
+
import { heatmapMatrixKey } from "@xihan-ui/headless";
|
|
6
|
+
//#region src/components/heatmap/heatmap.ts
|
|
7
|
+
const XhHeatmapRoot = defineComponent({
|
|
8
|
+
name: "XhHeatmapRoot",
|
|
9
|
+
props: {
|
|
10
|
+
variant: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
value: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
rows: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: void 0
|
|
21
|
+
},
|
|
22
|
+
columns: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: void 0
|
|
25
|
+
},
|
|
26
|
+
startDate: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
endDate: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
levels: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
thresholds: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
firstDayOfWeek: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: void 0
|
|
45
|
+
},
|
|
46
|
+
locale: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: void 0
|
|
49
|
+
},
|
|
50
|
+
dir: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
tone: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: void 0
|
|
57
|
+
},
|
|
58
|
+
palette: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
size: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
translations: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: void 0
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
emits: {
|
|
72
|
+
"cell-focus": (_details) => true,
|
|
73
|
+
"cell-active": (_details) => true
|
|
74
|
+
},
|
|
75
|
+
slots: Object,
|
|
76
|
+
setup(props, { slots, emit }) {
|
|
77
|
+
const notifyFocus = (details) => emit("cell-focus", details);
|
|
78
|
+
const notifyActive = (details) => emit("cell-active", details);
|
|
79
|
+
const ctx = useHeatmap(withXhConfig("heatmap", props), notifyFocus, notifyActive);
|
|
80
|
+
provideHeatmap(ctx);
|
|
81
|
+
return () => {
|
|
82
|
+
const api = ctx.api.value;
|
|
83
|
+
return h("div", api.getRootProps(), slots.default ? slots.default({
|
|
84
|
+
variant: api.variant,
|
|
85
|
+
grid: api.grid,
|
|
86
|
+
monthGrid: api.monthGrid,
|
|
87
|
+
matrixGrid: api.matrixGrid,
|
|
88
|
+
focusedCell: api.focusedCell,
|
|
89
|
+
focusedDate: api.focusedDate,
|
|
90
|
+
anchorCell: api.anchorCell,
|
|
91
|
+
anchorDate: api.anchorDate,
|
|
92
|
+
activeCell: api.activeCell,
|
|
93
|
+
detailOpen: api.detailOpen,
|
|
94
|
+
cellAt: api.cellAt,
|
|
95
|
+
setFocusedCell: api.setFocusedCell,
|
|
96
|
+
setFocusedDate: api.setFocusedDate
|
|
97
|
+
}) : renderDefaultTree(api, slots.cell, slots.tooltip));
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
/** role=grid 的容器:键盘在这里收口,可及名字也长在它身上。 */
|
|
102
|
+
const XhHeatmapGrid = defineComponent({
|
|
103
|
+
name: "XhHeatmapGrid",
|
|
104
|
+
setup(_, { slots }) {
|
|
105
|
+
const ctx = useHeatmapContext();
|
|
106
|
+
return () => h("div", ctx.api.value.getGridProps(), slots.default?.());
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
/** 月历形态里的一个自然月块,块内的行从这里取月份身份。 */
|
|
110
|
+
const XhHeatmapMonthBlock = defineComponent({
|
|
111
|
+
name: "XhHeatmapMonthBlock",
|
|
112
|
+
props: {
|
|
113
|
+
/** 月份身份 YYYY-MM。 */
|
|
114
|
+
value: {
|
|
115
|
+
type: String,
|
|
116
|
+
required: true
|
|
117
|
+
} },
|
|
118
|
+
setup(props, { slots }) {
|
|
119
|
+
const ctx = useHeatmapContext();
|
|
120
|
+
provideHeatmapMonth(computed(() => props.value));
|
|
121
|
+
return () => h("div", ctx.api.value.getMonthBlockProps({ value: props.value }), slots.default?.());
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* 一行。身份写在 value 上,怎么解释由形态决定:
|
|
126
|
+
* 日历形态是行序 0-6,月历形态是月内第几周,矩阵形态是行身份;不写即坐标轴那一行。
|
|
127
|
+
*/
|
|
128
|
+
const XhHeatmapRow = defineComponent({
|
|
129
|
+
name: "XhHeatmapRow",
|
|
130
|
+
props: {
|
|
131
|
+
value: {
|
|
132
|
+
type: [Number, String],
|
|
133
|
+
default: void 0
|
|
134
|
+
},
|
|
135
|
+
/** 月历形态:所属月份 YYYY-MM;写在月块里就不必再写一遍。 */
|
|
136
|
+
month: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: void 0
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
setup(props, { slots }) {
|
|
142
|
+
const ctx = useHeatmapContext();
|
|
143
|
+
const blockMonth = useHeatmapMonth();
|
|
144
|
+
const row = computed(() => {
|
|
145
|
+
const variant = ctx.api.value.variant;
|
|
146
|
+
if (variant === "matrix") return { row: stringOf(props.value) };
|
|
147
|
+
if (variant === "month") return {
|
|
148
|
+
month: props.month ?? blockMonth?.value,
|
|
149
|
+
week: numberOf(props.value)
|
|
150
|
+
};
|
|
151
|
+
return { weekDay: numberOf(props.value) };
|
|
152
|
+
});
|
|
153
|
+
provideHeatmapRow(computed(() => row.value.row));
|
|
154
|
+
return () => h("div", ctx.api.value.getRowProps(row.value), slots.default?.());
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
/** 行首的星期名。不给行序即坐标轴那一行行首的占位,它只负责让月份与格子对齐。 */
|
|
158
|
+
const XhHeatmapWeekDayLabel = defineComponent({
|
|
159
|
+
name: "XhHeatmapWeekDayLabel",
|
|
160
|
+
props: { value: {
|
|
161
|
+
type: [Number, String],
|
|
162
|
+
default: void 0
|
|
163
|
+
} },
|
|
164
|
+
setup(props, { slots }) {
|
|
165
|
+
const ctx = useHeatmapContext();
|
|
166
|
+
const weekDay = computed(() => numberOf(props.value));
|
|
167
|
+
return () => h("span", ctx.api.value.getWeekDayLabelProps({ weekDay: weekDay.value }), slots.default?.());
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
/** 月份名。日历形态里横跨这个月占的那几列,月历形态里是一块的标题。 */
|
|
171
|
+
const XhHeatmapMonthLabel = defineComponent({
|
|
172
|
+
name: "XhHeatmapMonthLabel",
|
|
173
|
+
props: { value: {
|
|
174
|
+
type: String,
|
|
175
|
+
required: true
|
|
176
|
+
} },
|
|
177
|
+
setup(props, { slots }) {
|
|
178
|
+
const ctx = useHeatmapContext();
|
|
179
|
+
return () => h("span", ctx.api.value.getMonthLabelProps({ value: props.value }), slots.default?.());
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
/** 矩阵的行名。不写 value 即表头行行首那个角落占位。 */
|
|
183
|
+
const XhHeatmapRowLabel = defineComponent({
|
|
184
|
+
name: "XhHeatmapRowLabel",
|
|
185
|
+
props: { value: {
|
|
186
|
+
type: String,
|
|
187
|
+
default: void 0
|
|
188
|
+
} },
|
|
189
|
+
setup(props, { slots }) {
|
|
190
|
+
const ctx = useHeatmapContext();
|
|
191
|
+
return () => h("span", ctx.api.value.getRowLabelProps({ value: props.value }), slots.default?.());
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
/** 矩阵的列名。 */
|
|
195
|
+
const XhHeatmapColumnLabel = defineComponent({
|
|
196
|
+
name: "XhHeatmapColumnLabel",
|
|
197
|
+
props: { value: {
|
|
198
|
+
type: String,
|
|
199
|
+
required: true
|
|
200
|
+
} },
|
|
201
|
+
setup(props, { slots }) {
|
|
202
|
+
const ctx = useHeatmapContext();
|
|
203
|
+
return () => h("span", ctx.api.value.getColumnLabelProps({ value: props.value }), slots.default?.());
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
/**
|
|
207
|
+
* 一格。日期形态里 value 是 ISO 日期,矩阵形态里 value 是列身份、
|
|
208
|
+
* 行身份从所在的行取(也可以写在 row 上)。数值与档位由 connect 回网格里查。
|
|
209
|
+
*/
|
|
210
|
+
const XhHeatmapCell = defineComponent({
|
|
211
|
+
name: "XhHeatmapCell",
|
|
212
|
+
props: {
|
|
213
|
+
value: {
|
|
214
|
+
type: String,
|
|
215
|
+
required: true
|
|
216
|
+
},
|
|
217
|
+
/** 矩阵形态:行身份;写在行里就不必再写一遍。 */
|
|
218
|
+
row: {
|
|
219
|
+
type: String,
|
|
220
|
+
default: void 0
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
setup(props, { slots }) {
|
|
224
|
+
const ctx = useHeatmapContext();
|
|
225
|
+
const parentRow = useHeatmapRow();
|
|
226
|
+
const cell = computed(() => ctx.api.value.variant === "matrix" ? {
|
|
227
|
+
row: props.row ?? parentRow?.value,
|
|
228
|
+
column: props.value
|
|
229
|
+
} : { date: props.value });
|
|
230
|
+
return () => h("div", ctx.api.value.getCellProps(cell.value), slots.default?.());
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
/** 详情条:悬停或聚焦到某一格时显示,位置由连接层量好写成内联样式。 */
|
|
234
|
+
const XhHeatmapTooltip = defineComponent({
|
|
235
|
+
name: "XhHeatmapTooltip",
|
|
236
|
+
setup(_, { slots }) {
|
|
237
|
+
const ctx = useHeatmapContext();
|
|
238
|
+
return () => h("div", ctx.api.value.getTooltipProps(), slots.default?.());
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
/** 色阶对照条。 */
|
|
242
|
+
const XhHeatmapLegend = defineComponent({
|
|
243
|
+
name: "XhHeatmapLegend",
|
|
244
|
+
setup(_, { slots }) {
|
|
245
|
+
const ctx = useHeatmapContext();
|
|
246
|
+
return () => h("div", ctx.api.value.getLegendProps(), slots.default?.());
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
/** 对照条一端的那个字:value 写 low 或 high,文字从 api.legendText 取。 */
|
|
250
|
+
const XhHeatmapLegendLabel = defineComponent({
|
|
251
|
+
name: "XhHeatmapLegendLabel",
|
|
252
|
+
props: {
|
|
253
|
+
/** 挂在哪一端:low 是色阶起点,high 是终点。 */
|
|
254
|
+
value: {
|
|
255
|
+
type: String,
|
|
256
|
+
required: true
|
|
257
|
+
} },
|
|
258
|
+
setup(props, { slots }) {
|
|
259
|
+
const ctx = useHeatmapContext();
|
|
260
|
+
return () => h("span", ctx.api.value.getLegendLabelProps({ bound: props.value }), slots.default?.());
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
/** 对照条里的一格,与网格里同档的格子同色。 */
|
|
264
|
+
const XhHeatmapLegendItem = defineComponent({
|
|
265
|
+
name: "XhHeatmapLegendItem",
|
|
266
|
+
props: {
|
|
267
|
+
/** 档位,兼收字符串。 */
|
|
268
|
+
value: {
|
|
269
|
+
type: [Number, String],
|
|
270
|
+
required: true
|
|
271
|
+
} },
|
|
272
|
+
setup(props, { slots }) {
|
|
273
|
+
const ctx = useHeatmapContext();
|
|
274
|
+
const level = computed(() => Number(props.value) || 0);
|
|
275
|
+
return () => h("span", ctx.api.value.getLegendItemProps({ level: level.value }), slots.default?.());
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
/**
|
|
279
|
+
* 没写默认插槽时按网格模型铺开的整套结构,作者只交数据。
|
|
280
|
+
* 与手写部件产出的 DOM 完全一致,要改结构就写默认插槽,行为不变。
|
|
281
|
+
* 详情条只有写了 tooltip 插槽才铺,不写时整棵树与从前逐字一致。
|
|
282
|
+
*/
|
|
283
|
+
function renderDefaultTree(api, cellSlot, tooltipSlot) {
|
|
284
|
+
const legend = h(XhHeatmapLegend, null, () => [
|
|
285
|
+
h(XhHeatmapLegendLabel, { value: "low" }, () => api.legendText.low),
|
|
286
|
+
...Array.from({ length: api.monthGrid?.levels ?? api.matrixGrid?.levels ?? api.grid.levels }, (_, level) => h(XhHeatmapLegendItem, {
|
|
287
|
+
key: level,
|
|
288
|
+
value: level
|
|
289
|
+
})),
|
|
290
|
+
h(XhHeatmapLegendLabel, { value: "high" }, () => api.legendText.high)
|
|
291
|
+
]);
|
|
292
|
+
const tooltip = tooltipSlot ? [h(XhHeatmapTooltip, null, () => tooltipSlot(api.activeCell))] : [];
|
|
293
|
+
if (api.matrixGrid) return [
|
|
294
|
+
...renderMatrixTree(api.matrixGrid, cellSlot),
|
|
295
|
+
...tooltip,
|
|
296
|
+
legend
|
|
297
|
+
];
|
|
298
|
+
if (api.monthGrid) return [
|
|
299
|
+
...renderMonthTree(api.monthGrid, cellSlot),
|
|
300
|
+
...tooltip,
|
|
301
|
+
legend
|
|
302
|
+
];
|
|
303
|
+
const monthRow = h(XhHeatmapRow, null, () => [h(XhHeatmapWeekDayLabel), ...api.grid.months.map((month) => h(XhHeatmapMonthLabel, {
|
|
304
|
+
key: month.value,
|
|
305
|
+
value: month.value
|
|
306
|
+
}, () => month.label))]);
|
|
307
|
+
const weekRows = api.grid.rows.map((row) => h(XhHeatmapRow, {
|
|
308
|
+
key: row.weekDay,
|
|
309
|
+
value: row.weekDay
|
|
310
|
+
}, () => [h(XhHeatmapWeekDayLabel, { value: row.weekDay }, () => api.grid.weekDays[row.weekDay]?.label ?? ""), ...row.cells.map((cell) => h(XhHeatmapCell, {
|
|
311
|
+
key: cell.date,
|
|
312
|
+
value: cell.date
|
|
313
|
+
}, () => cellSlot?.(cell) ?? []))]));
|
|
314
|
+
return [
|
|
315
|
+
monthRow,
|
|
316
|
+
h(XhHeatmapGrid, null, () => weekRows),
|
|
317
|
+
...tooltip,
|
|
318
|
+
legend
|
|
319
|
+
];
|
|
320
|
+
}
|
|
321
|
+
/** 月历形态:网格里一个自然月一块,块内先一条星期名坐标轴,再逐周一行。 */
|
|
322
|
+
function renderMonthTree(grid, cellSlot) {
|
|
323
|
+
const blocks = grid.blocks.map((block) => h(XhHeatmapMonthBlock, {
|
|
324
|
+
key: block.value,
|
|
325
|
+
value: block.value
|
|
326
|
+
}, () => [
|
|
327
|
+
h(XhHeatmapMonthLabel, { value: block.value }, () => block.label),
|
|
328
|
+
h(XhHeatmapRow, null, () => grid.weekDays.map((day) => h(XhHeatmapWeekDayLabel, {
|
|
329
|
+
key: day.weekDay,
|
|
330
|
+
value: day.weekDay
|
|
331
|
+
}, () => day.label))),
|
|
332
|
+
...block.weeks.map((row) => h(XhHeatmapRow, {
|
|
333
|
+
key: row.week,
|
|
334
|
+
value: row.week
|
|
335
|
+
}, () => row.cells.map((cell) => h(XhHeatmapCell, {
|
|
336
|
+
key: cell.date,
|
|
337
|
+
value: cell.date
|
|
338
|
+
}, () => cellSlot?.(cell) ?? []))))
|
|
339
|
+
]));
|
|
340
|
+
return [h(XhHeatmapGrid, null, () => blocks)];
|
|
341
|
+
}
|
|
342
|
+
/** 矩阵形态:头一行是列名,其余每行行首一个行名、其后逐列一格。 */
|
|
343
|
+
function renderMatrixTree(grid, cellSlot) {
|
|
344
|
+
const header = h(XhHeatmapRow, null, () => [h(XhHeatmapRowLabel), ...grid.columns.map((column) => h(XhHeatmapColumnLabel, {
|
|
345
|
+
key: column.value,
|
|
346
|
+
value: column.value
|
|
347
|
+
}, () => column.label))]);
|
|
348
|
+
const rows = grid.rows.map((row) => h(XhHeatmapRow, {
|
|
349
|
+
key: row.value,
|
|
350
|
+
value: row.value
|
|
351
|
+
}, () => [h(XhHeatmapRowLabel, { value: row.value }, () => row.label), ...grid.columns.map((column) => {
|
|
352
|
+
const meta = grid.cells.get(heatmapMatrixKey(row.value, column.value));
|
|
353
|
+
return h(XhHeatmapCell, {
|
|
354
|
+
key: column.value,
|
|
355
|
+
value: column.value
|
|
356
|
+
}, () => meta == null ? [] : cellSlot?.(meta) ?? []);
|
|
357
|
+
})]));
|
|
358
|
+
return [h(XhHeatmapGrid, null, () => [header, ...rows])];
|
|
359
|
+
}
|
|
360
|
+
/** 作者写的数字身份,兼收字符串;没写即 undefined。 */
|
|
361
|
+
function numberOf(value) {
|
|
362
|
+
if (value == null || value === "") return void 0;
|
|
363
|
+
const parsed = Number(value);
|
|
364
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
365
|
+
}
|
|
366
|
+
/** 作者写的串身份;没写即 undefined。 */
|
|
367
|
+
function stringOf(value) {
|
|
368
|
+
if (value == null || value === "") return void 0;
|
|
369
|
+
return String(value);
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
export { XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDayLabel };
|
|
373
|
+
|
|
374
|
+
//# sourceMappingURL=heatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.js","names":[],"sources":["../../../src/components/heatmap/heatmap.ts"],"sourcesContent":["import 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 { Direction, Size, Tone } from '@xihan-ui/kernel'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { heatmapMatrixKey } 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 // 全部 default: undefined,缺省值由机器与 connect 决定\n props: {\n variant: { type: String as PropType<HeatmapVariant>, default: undefined },\n value: { type: Array as PropType<HeatmapValue[]>, default: undefined },\n rows: { type: Array as PropType<HeatmapAxisInput[]>, default: undefined },\n columns: { type: Array as PropType<HeatmapAxisInput[]>, default: undefined },\n startDate: { type: String, default: undefined },\n endDate: { type: String, default: undefined },\n levels: { type: Number, default: undefined },\n thresholds: { type: Array as PropType<number[]>, default: undefined },\n firstDayOfWeek: { type: Number, default: undefined },\n locale: { type: String, default: undefined },\n dir: { type: String as PropType<Direction>, default: undefined },\n tone: { type: String as PropType<Tone>, default: undefined },\n palette: { type: String as PropType<HeatmapPalette>, default: undefined },\n size: { type: String as PropType<Size>, default: undefined },\n translations: { type: Object as PropType<Partial<HeatmapTranslations>>, default: undefined },\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>, default: undefined },\n /** 月历形态:所属月份 YYYY-MM;写在月块里就不必再写一遍。 */\n month: { type: String, default: undefined },\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: stringOf(props.value) }\n if (variant === 'month')\n return { month: props.month ?? blockMonth?.value, week: numberOf(props.value) }\n return { weekDay: numberOf(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 XhHeatmapWeekDayLabel = defineComponent({\n name: 'XhHeatmapWeekDayLabel',\n props: {\n value: { type: [Number, String] as PropType<number | string>, default: undefined },\n },\n setup(props, { slots }) {\n const ctx = useHeatmapContext()\n const weekDay = computed(() => numberOf(props.value))\n return () => h('span', ctx.api.value.getWeekDayLabelProps({ 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, default: undefined },\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, default: undefined },\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(XhHeatmapWeekDayLabel),\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(XhHeatmapWeekDayLabel, { 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(XhHeatmapWeekDayLabel, { 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\n/** 作者写的数字身份,兼收字符串;没写即 undefined。 */\nfunction numberOf(value: number | string | undefined): number | undefined {\n if (value == null || value === '')\n return undefined\n const parsed = Number(value)\n return Number.isFinite(parsed) ? parsed : undefined\n}\n\n/** 作者写的串身份;没写即 undefined。 */\nfunction stringOf(value: number | string | undefined): string | undefined {\n if (value == null || value === '')\n return undefined\n return String(value)\n}\n"],"mappings":";;;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GA,SAAS,iBAAiB,MAAyB,UAA6D;CAC9G,MAAM,SAAS,EAAE,cAAc,YAAY,CAEzC,EAAE,iBAAiB,GACnB,GAAG,KAAK,QAAQ,KAAI,WAAU,EAAE,sBAAsB;EAAE,KAAK,OAAO;EAAO,OAAO,OAAO;CAAM,SAAS,OAAO,KAAK,CAAC,CACvH,CAAC;CACD,MAAM,OAAO,KAAK,KAAK,KAAI,QAAO,EAAE,cAAc;EAAE,KAAK,IAAI;EAAO,OAAO,IAAI;CAAM,SAAS,CAC5F,EAAE,mBAAmB,EAAE,OAAO,IAAI,MAAM,SAAS,IAAI,KAAK,GAC1D,GAAG,KAAK,QAAQ,KAAK,WAAW;EAC9B,MAAM,OAAO,KAAK,MAAM,IAAI,iBAAiB,IAAI,OAAO,OAAO,KAAK,CAAC;EACrE,OAAO,EACL,eACA;GAAE,KAAK,OAAO;GAAO,OAAO,OAAO;EAAM,SAClC,QAAQ,OAAO,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,CAClD;CACF,CAAC,CACH,CAAC,CAAC;CACF,OAAO,CAAC,EAAE,eAAe,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AACzD;;AAGA,SAAS,SAAS,OAAwD;CACxE,IAAI,SAAS,QAAQ,UAAU,IAC7B,OAAO,KAAA;CACT,MAAM,SAAS,OAAO,KAAK;CAC3B,OAAO,OAAO,SAAS,MAAM,IAAI,SAAS,KAAA;AAC5C;;AAGA,SAAS,SAAS,OAAwD;CACxE,IAAI,SAAS,QAAQ,UAAU,IAC7B,OAAO,KAAA;CACT,OAAO,OAAO,KAAK;AACrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComputedRef } from "vue";
|
|
2
|
+
import { HeatmapApi, HeatmapSchema } from "@xihan-ui/headless";
|
|
3
|
+
import { Service } from "@xihan-ui/machine";
|
|
4
|
+
//#region src/components/heatmap/use-heatmap.d.ts
|
|
5
|
+
interface HeatmapContext {
|
|
6
|
+
api: ComputedRef<HeatmapApi>;
|
|
7
|
+
/** 机器实例,供部件上报 DOM 侧的事实。 */
|
|
8
|
+
service: Service<HeatmapSchema>;
|
|
9
|
+
}
|
|
10
|
+
declare function useHeatmap(props: HeatmapSchema['props'], onCellFocus?: HeatmapSchema['props']['onCellFocus'], onCellActive?: HeatmapSchema['props']['onCellActive']): HeatmapContext;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { HeatmapContext, useHeatmap };
|
|
13
|
+
//# sourceMappingURL=use-heatmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/use-heatmap.ts"],"mappings":";;;;UAQiB;EACf,KAAK,YAAY;;EAEjB,SAAS,QAAQ;;iBAIH,WACd,OAAO,wBACP,cAAc,uCACd,eAAe,yCACd"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
|
+
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
+
import { computed } from "vue";
|
|
4
|
+
import { connectHeatmap, heatmapMachine } from "@xihan-ui/headless";
|
|
5
|
+
//#region src/components/heatmap/use-heatmap.ts
|
|
6
|
+
function useHeatmap(props, onCellFocus, onCellActive) {
|
|
7
|
+
const service = useMachine(heatmapMachine, () => ({
|
|
8
|
+
...props,
|
|
9
|
+
onCellFocus,
|
|
10
|
+
onCellActive
|
|
11
|
+
}));
|
|
12
|
+
return {
|
|
13
|
+
api: computed(() => connectHeatmap(service, vueNormalize)),
|
|
14
|
+
service
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useHeatmap };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=use-heatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-heatmap.js","names":[],"sources":["../../../src/components/heatmap/use-heatmap.ts"],"sourcesContent":["import type { HeatmapApi, HeatmapSchema } from '@xihan-ui/headless'\nimport type { Service } from '@xihan-ui/machine'\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":";;;;;AAeA,SAAgB,WACd,OACA,aACA,cACgB;CAChB,MAAM,UAAU,WAAW,uBAAuB;EAAE,GAAG;EAAO;EAAa;CAAa,EAAE;CAE1F,OAAO;EAAE,KADG,eAAe,eAAe,SAAS,YAAY,CACpD;EAAG;CAAQ;AACxB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
+
import { PropType, VNode } from "vue";
|
|
3
|
+
import { HotkeysPlatform, HotkeysProps, HotkeysTarget, HotkeysTranslations } from "@xihan-ui/headless";
|
|
4
|
+
import { Size } from "@xihan-ui/kernel";
|
|
5
|
+
//#region src/components/hotkeys/hotkeys.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 把一组键铺成一排键帽,并按 target 指定的节点接住这次组合。
|
|
8
|
+
*
|
|
9
|
+
* 内容整份由 keys 与平台算出,组件不收默认插槽——键帽上写什么、连接符出不出,
|
|
10
|
+
* 两个平台的答案不一样,内容另有来源就对不上了。
|
|
11
|
+
*
|
|
12
|
+
* 注册与渲染是两件事:只要注册不要键帽就直接用 useHotkeys。
|
|
13
|
+
*/
|
|
14
|
+
declare const XhHotkeys: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
keys: {
|
|
16
|
+
type: PropType<string[]>;
|
|
17
|
+
default: undefined;
|
|
18
|
+
};
|
|
19
|
+
platform: {
|
|
20
|
+
type: PropType<HotkeysPlatform>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
target: {
|
|
24
|
+
type: PropType<HotkeysTarget>;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
preventDefault: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
enabled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
size: {
|
|
36
|
+
type: PropType<Size>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
translations: {
|
|
40
|
+
type: PropType<Partial<HotkeysTranslations>>;
|
|
41
|
+
default: undefined;
|
|
42
|
+
};
|
|
43
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
44
|
+
[key: string]: any;
|
|
45
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
+
'hot-key': (_details: PayloadOf<HotkeysProps, "onHotKey">) => true;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
+
keys: {
|
|
49
|
+
type: PropType<string[]>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
platform: {
|
|
53
|
+
type: PropType<HotkeysPlatform>;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
target: {
|
|
57
|
+
type: PropType<HotkeysTarget>;
|
|
58
|
+
default: undefined;
|
|
59
|
+
};
|
|
60
|
+
preventDefault: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
default: undefined;
|
|
63
|
+
};
|
|
64
|
+
enabled: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: undefined;
|
|
67
|
+
};
|
|
68
|
+
size: {
|
|
69
|
+
type: PropType<Size>;
|
|
70
|
+
default: undefined;
|
|
71
|
+
};
|
|
72
|
+
translations: {
|
|
73
|
+
type: PropType<Partial<HotkeysTranslations>>;
|
|
74
|
+
default: undefined;
|
|
75
|
+
};
|
|
76
|
+
}>> & Readonly<{
|
|
77
|
+
"onHot-key"?: ((_details: import("@xihan-ui/headless").HotkeysTriggerDetails) => any) | undefined;
|
|
78
|
+
}>, {
|
|
79
|
+
keys: string[];
|
|
80
|
+
size: Size;
|
|
81
|
+
translations: Partial<HotkeysTranslations>;
|
|
82
|
+
target: HotkeysTarget;
|
|
83
|
+
platform: HotkeysPlatform;
|
|
84
|
+
preventDefault: boolean;
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { XhHotkeys };
|
|
89
|
+
//# sourceMappingURL=hotkeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotkeys.d.ts","names":[],"sources":["../../../src/components/hotkeys/hotkeys.ts"],"mappings":";;;;;;;;;;;;;cAgBa,yBAAS,8BAAA;;IAIK,MAAA;;;;IACK,MAAA,SAAS;;;;IACX,MAAA,SAAS;;;;;;;;;;;;IAGX,MAAA,SAAS;;;;IACD,MAAA,SAAS,QAAQ;;;;;;EAI3B,YAAA,UAAA,UAAU;;;IAVT,MAAA;;;;IACK,MAAA,SAAS;;;;IACX,MAAA,SAAS;;;;;;;;;;;;IAGX,MAAA,SAAS;;;;IACD,MAAA,SAAS,QAAQ;;;;;;;;;;;;;qCAqCnD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { withXhConfig } from "../../config/config.js";
|
|
2
|
+
import { useHotkeys } from "./use-hotkeys.js";
|
|
3
|
+
import { defineComponent, h, ref } from "vue";
|
|
4
|
+
//#region src/components/hotkeys/hotkeys.ts
|
|
5
|
+
/**
|
|
6
|
+
* 把一组键铺成一排键帽,并按 target 指定的节点接住这次组合。
|
|
7
|
+
*
|
|
8
|
+
* 内容整份由 keys 与平台算出,组件不收默认插槽——键帽上写什么、连接符出不出,
|
|
9
|
+
* 两个平台的答案不一样,内容另有来源就对不上了。
|
|
10
|
+
*
|
|
11
|
+
* 注册与渲染是两件事:只要注册不要键帽就直接用 useHotkeys。
|
|
12
|
+
*/
|
|
13
|
+
const XhHotkeys = defineComponent({
|
|
14
|
+
name: "XhHotkeys",
|
|
15
|
+
props: {
|
|
16
|
+
keys: {
|
|
17
|
+
type: Array,
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
platform: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
target: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: void 0
|
|
27
|
+
},
|
|
28
|
+
preventDefault: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
enabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: void 0
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
translations: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: void 0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
emits: { "hot-key": (_details) => true },
|
|
46
|
+
setup(props, { emit }) {
|
|
47
|
+
const rootEl = ref(null);
|
|
48
|
+
const merged = withXhConfig("hotkeys", props);
|
|
49
|
+
const { api } = useHotkeys(() => ({
|
|
50
|
+
keys: props.keys,
|
|
51
|
+
platform: props.platform,
|
|
52
|
+
target: props.target,
|
|
53
|
+
preventDefault: props.preventDefault,
|
|
54
|
+
enabled: props.enabled,
|
|
55
|
+
size: props.size,
|
|
56
|
+
translations: merged.translations,
|
|
57
|
+
onHotKey: (details) => emit("hot-key", details)
|
|
58
|
+
}), rootEl);
|
|
59
|
+
return () => {
|
|
60
|
+
const current = api.value;
|
|
61
|
+
const separatorProps = current.getSeparatorProps();
|
|
62
|
+
const children = [];
|
|
63
|
+
current.segments.forEach((segment, index) => {
|
|
64
|
+
if (index > 0) children.push(h("span", {
|
|
65
|
+
...separatorProps,
|
|
66
|
+
key: `xh-hotkeys-separator-${index}`
|
|
67
|
+
}, current.separator));
|
|
68
|
+
children.push(h("kbd", {
|
|
69
|
+
...current.getKeyProps({ value: segment.source }),
|
|
70
|
+
key: `xh-hotkeys-key-${index}`
|
|
71
|
+
}, segment.label));
|
|
72
|
+
});
|
|
73
|
+
return h("span", {
|
|
74
|
+
...current.getRootProps(),
|
|
75
|
+
ref: rootEl
|
|
76
|
+
}, children);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
export { XhHotkeys };
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=hotkeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hotkeys.js","names":[],"sources":["../../../src/components/hotkeys/hotkeys.ts"],"sourcesContent":["import type { HotkeysPlatform, HotkeysProps, HotkeysTarget, HotkeysTranslations } from '@xihan-ui/headless'\nimport type { Size } from '@xihan-ui/kernel'\nimport type { PropType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { defineComponent, h, ref } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { useHotkeys } from './use-hotkeys'\n\n/**\n * 把一组键铺成一排键帽,并按 target 指定的节点接住这次组合。\n *\n * 内容整份由 keys 与平台算出,组件不收默认插槽——键帽上写什么、连接符出不出,\n * 两个平台的答案不一样,内容另有来源就对不上了。\n *\n * 注册与渲染是两件事:只要注册不要键帽就直接用 useHotkeys。\n */\nexport const XhHotkeys = defineComponent({\n name: 'XhHotkeys',\n // 缺省值由 connect 给出,这里一律 default: undefined\n props: {\n keys: { type: Array as PropType<string[]>, default: undefined },\n platform: { type: String as PropType<HotkeysPlatform>, default: undefined },\n target: { type: String as PropType<HotkeysTarget>, default: undefined },\n preventDefault: { type: Boolean, default: undefined },\n enabled: { type: Boolean, default: undefined },\n size: { type: String as PropType<Size>, default: undefined },\n translations: { type: Object as PropType<Partial<HotkeysTranslations>>, default: undefined },\n },\n // 只读事件:组合没有可双向绑定的值\n emits: {\n 'hot-key': (_details: PayloadOf<HotkeysProps, 'onHotKey'>) => true,\n },\n setup(props, { emit }) {\n const rootEl = ref<HTMLElement | null>(null)\n const merged = withXhConfig('hotkeys', props)\n\n const { api } = useHotkeys(() => ({\n keys: props.keys,\n platform: props.platform,\n target: props.target,\n preventDefault: props.preventDefault,\n enabled: props.enabled,\n size: props.size,\n translations: merged.translations,\n onHotKey: details => emit('hot-key', details),\n }), rootEl)\n\n return () => {\n const current = api.value\n const separatorProps = current.getSeparatorProps() as Record<string, unknown>\n const children: VNode[] = []\n current.segments.forEach((segment, index) => {\n if (index > 0)\n children.push(h('span', { ...separatorProps, key: `xh-hotkeys-separator-${index}` }, current.separator))\n children.push(h(\n 'kbd',\n { ...current.getKeyProps({ value: segment.source }) as Record<string, unknown>, key: `xh-hotkeys-key-${index}` },\n segment.label,\n ))\n })\n return h('span', { ...current.getRootProps() as Record<string, unknown>, ref: rootEl }, children)\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAa,YAAY,gBAAgB;CACvC,MAAM;CAEN,OAAO;EACL,MAAM;GAAE,MAAM;GAA6B,SAAS,KAAA;EAAU;EAC9D,UAAU;GAAE,MAAM;GAAqC,SAAS,KAAA;EAAU;EAC1E,QAAQ;GAAE,MAAM;GAAmC,SAAS,KAAA;EAAU;EACtE,gBAAgB;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EACpD,SAAS;GAAE,MAAM;GAAS,SAAS,KAAA;EAAU;EAC7C,MAAM;GAAE,MAAM;GA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