@xihan-ui/vue 4.2.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +788 -0
- package/dist/components/accordion/accordion.d.ts +7 -1
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/accordion.js +17 -10
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/accordion/use-accordion.d.ts +1 -1
- package/dist/components/accordion/use-accordion.js +1 -1
- package/dist/components/affix/affix.d.ts +1 -1
- package/dist/components/affix/use-affix.d.ts +1 -1
- package/dist/components/affix/use-affix.js +1 -1
- package/dist/components/alert/alert.d.ts +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/alert.js +7 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/use-alert.js +10 -3
- package/dist/components/alert/use-alert.js.map +1 -1
- package/dist/components/anchor/anchor.d.ts +1 -1
- package/dist/components/anchor/use-anchor.d.ts +1 -1
- package/dist/components/anchor/use-anchor.js +1 -1
- package/dist/components/approval/approval.d.ts +1 -1
- package/dist/components/approval/approval.d.ts.map +1 -1
- package/dist/components/approval/approval.js +7 -1
- package/dist/components/approval/approval.js.map +1 -1
- package/dist/components/approval/use-approval.d.ts +4 -1
- package/dist/components/approval/use-approval.d.ts.map +1 -1
- package/dist/components/approval/use-approval.js +10 -3
- package/dist/components/approval/use-approval.js.map +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/use-avatar.d.ts +1 -1
- package/dist/components/avatar/use-avatar.js +1 -1
- package/dist/components/avatar-group/avatar-group.js +1 -1
- package/dist/components/avatar-group/context.d.ts +1 -1
- package/dist/components/back-top/back-top.d.ts +1 -1
- package/dist/components/back-top/use-back-top.d.ts +1 -1
- package/dist/components/back-top/use-back-top.js +1 -1
- package/dist/components/badge/badge.d.ts +1 -1
- package/dist/components/badge/badge.js +1 -1
- package/dist/components/bar-code/bar-code.d.ts +2 -2
- package/dist/components/bar-code/bar-code.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +19 -23
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/use-breadcrumb.d.ts +1 -1
- package/dist/components/breadcrumb/use-breadcrumb.js +1 -1
- package/dist/components/button-group/button-group.js +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar-picker/calendar-picker.d.ts +2 -2
- package/dist/components/calendar-picker/calendar-picker.d.ts.map +1 -1
- package/dist/components/calendar-picker/calendar-picker.js +1 -0
- package/dist/components/calendar-picker/calendar-picker.js.map +1 -1
- package/dist/components/calendar-picker/use-calendar-picker.d.ts +1 -1
- package/dist/components/calendar-picker/use-calendar-picker.js +1 -1
- package/dist/components/calendar-range-picker/calendar-range-picker.d.ts +2 -2
- package/dist/components/calendar-range-picker/calendar-range-picker.d.ts.map +1 -1
- package/dist/components/calendar-range-picker/calendar-range-picker.js +1 -0
- package/dist/components/calendar-range-picker/calendar-range-picker.js.map +1 -1
- package/dist/components/calendar-range-picker/use-calendar-range-picker.d.ts +1 -1
- package/dist/components/calendar-range-picker/use-calendar-range-picker.js +1 -1
- package/dist/components/card/card.d.ts +15 -9
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +24 -2
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/context.d.ts +1 -1
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/use-carousel.d.ts +1 -1
- package/dist/components/carousel/use-carousel.js +1 -1
- package/dist/components/cartesian-chart/cartesian-chart.d.ts +6 -6
- package/dist/components/cartesian-chart/use-cartesian-chart.d.ts +1 -1
- package/dist/components/cartesian-chart/use-cartesian-chart.js +1 -1
- package/dist/components/cascader/cascader.d.ts +32 -1
- package/dist/components/cascader/cascader.d.ts.map +1 -1
- package/dist/components/cascader/cascader.js +105 -28
- package/dist/components/cascader/cascader.js.map +1 -1
- package/dist/components/cascader/use-cascader.d.ts +6 -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.d.ts +9 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.js +33 -2
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/use-checkbox.d.ts +1 -1
- package/dist/components/checkbox/use-checkbox.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts +18 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +46 -18
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/checkbox-group/use-checkbox-group.d.ts +1 -1
- package/dist/components/checkbox-group/use-checkbox-group.js +1 -1
- package/dist/components/citation/citation.d.ts +1 -1
- package/dist/components/citation/citation.js +1 -1
- package/dist/components/citation/context.d.ts +1 -1
- package/dist/components/citation/use-citation.d.ts +1 -1
- package/dist/components/citation/use-citation.js +1 -1
- package/dist/components/clipboard/clipboard.d.ts +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/clipboard.js +5 -1
- package/dist/components/clipboard/clipboard.js.map +1 -1
- package/dist/components/clipboard/use-clipboard.d.ts +6 -1
- package/dist/components/clipboard/use-clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/use-clipboard.js +7 -2
- package/dist/components/clipboard/use-clipboard.js.map +1 -1
- package/dist/components/code-view/code-view.d.ts +1 -1
- package/dist/components/code-view/code-view.js +1 -1
- package/dist/components/code-view/use-code-view.d.ts +1 -1
- package/dist/components/code-view/use-code-view.js +1 -1
- package/dist/components/collapsible/collapsible.d.ts +1 -1
- package/dist/components/collapsible/use-collapsible.d.ts +1 -1
- package/dist/components/collapsible/use-collapsible.js +1 -1
- package/dist/components/color-field/color-field.d.ts +19 -1
- package/dist/components/color-field/color-field.d.ts.map +1 -1
- package/dist/components/color-field/color-field.js +46 -13
- package/dist/components/color-field/color-field.js.map +1 -1
- package/dist/components/color-field/use-color-field.d.ts +6 -1
- package/dist/components/color-field/use-color-field.d.ts.map +1 -1
- package/dist/components/color-field/use-color-field.js +7 -2
- package/dist/components/color-field/use-color-field.js.map +1 -1
- package/dist/components/color-picker/color-picker.d.ts +51 -2
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/color-picker.js +116 -25
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/use-color-picker.d.ts +7 -2
- package/dist/components/color-picker/use-color-picker.d.ts.map +1 -1
- package/dist/components/color-picker/use-color-picker.js +15 -5
- package/dist/components/color-picker/use-color-picker.js.map +1 -1
- package/dist/components/color-slider/color-slider.d.ts +10 -1
- package/dist/components/color-slider/color-slider.d.ts.map +1 -1
- package/dist/components/color-slider/color-slider.js +7 -1
- package/dist/components/color-slider/color-slider.js.map +1 -1
- package/dist/components/color-slider/use-color-slider.d.ts +6 -1
- package/dist/components/color-slider/use-color-slider.d.ts.map +1 -1
- package/dist/components/color-slider/use-color-slider.js +4 -1
- package/dist/components/color-slider/use-color-slider.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.js +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts +9 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.d.ts.map +1 -1
- package/dist/components/color-swatch-picker/color-swatch-picker.js +36 -13
- package/dist/components/color-swatch-picker/color-swatch-picker.js.map +1 -1
- package/dist/components/color-swatch-picker/use-color-swatch-picker.d.ts +1 -1
- package/dist/components/color-swatch-picker/use-color-swatch-picker.js +1 -1
- package/dist/components/combobox/combobox.d.ts +18 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +68 -29
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/combobox/use-combobox.d.ts +6 -1
- package/dist/components/combobox/use-combobox.d.ts.map +1 -1
- package/dist/components/combobox/use-combobox.js +4 -1
- package/dist/components/combobox/use-combobox.js.map +1 -1
- package/dist/components/command/command.d.ts +6 -6
- package/dist/components/command/command.d.ts.map +1 -1
- package/dist/components/command/command.js +57 -28
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/command/use-command.d.ts +2 -2
- package/dist/components/command/use-command.d.ts.map +1 -1
- package/dist/components/command/use-command.js +1 -1
- package/dist/components/command/use-command.js.map +1 -1
- package/dist/components/context-menu/context-menu.d.ts +57 -7
- package/dist/components/context-menu/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/context-menu.js +110 -62
- package/dist/components/context-menu/context-menu.js.map +1 -1
- package/dist/components/context-menu/context.d.ts +1 -1
- package/dist/components/context-menu/use-context-menu.d.ts +2 -2
- package/dist/components/context-menu/use-context-menu.d.ts.map +1 -1
- package/dist/components/context-menu/use-context-menu.js +4 -4
- package/dist/components/context-menu/use-context-menu.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts +18 -1
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +45 -13
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-field/use-date-field.d.ts +6 -1
- package/dist/components/date-field/use-date-field.d.ts.map +1 -1
- package/dist/components/date-field/use-date-field.js +10 -4
- package/dist/components/date-field/use-date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +62 -3
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +108 -21
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-picker/use-date-picker.d.ts +6 -1
- package/dist/components/date-picker/use-date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/use-date-picker.js +4 -1
- package/dist/components/date-picker/use-date-picker.js.map +1 -1
- package/dist/components/date-range-picker/context.js +19 -1
- package/dist/components/date-range-picker/context.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts +93 -3
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +157 -40
- 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 +6 -1
- package/dist/components/date-range-picker/use-date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/use-date-range-picker.js +4 -1
- package/dist/components/date-range-picker/use-date-range-picker.js.map +1 -1
- package/dist/components/descriptions/context.d.ts +1 -1
- package/dist/components/descriptions/descriptions.d.ts +1 -1
- package/dist/components/descriptions/descriptions.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/dialog.js +7 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/dialog/use-dialog.d.ts +4 -1
- package/dist/components/dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/dialog/use-dialog.js +6 -2
- package/dist/components/dialog/use-dialog.js.map +1 -1
- package/dist/components/diff-view/diff-view.d.ts +1 -1
- package/dist/components/diff-view/diff-view.js +1 -1
- package/dist/components/diff-view/use-diff-view.d.ts +1 -1
- package/dist/components/diff-view/use-diff-view.js +1 -1
- package/dist/components/download-trigger/download-trigger.d.ts +1 -1
- package/dist/components/download-trigger/use-download-trigger.d.ts +1 -1
- package/dist/components/download-trigger/use-download-trigger.js +1 -1
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.js +7 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/drawer/use-drawer.d.ts +4 -1
- package/dist/components/drawer/use-drawer.d.ts.map +1 -1
- package/dist/components/drawer/use-drawer.js +6 -2
- package/dist/components/drawer/use-drawer.js.map +1 -1
- package/dist/components/editable/editable.d.ts +9 -1
- package/dist/components/editable/editable.d.ts.map +1 -1
- package/dist/components/editable/editable.js +7 -1
- package/dist/components/editable/editable.js.map +1 -1
- package/dist/components/editable/use-editable.d.ts +6 -1
- package/dist/components/editable/use-editable.d.ts.map +1 -1
- package/dist/components/editable/use-editable.js +6 -2
- package/dist/components/editable/use-editable.js.map +1 -1
- package/dist/components/empty-state/empty-state.d.ts +1 -1
- package/dist/components/empty-state/use-empty-state.js +1 -1
- package/dist/components/expression-input/context.d.ts +7 -0
- package/dist/components/expression-input/context.d.ts.map +1 -0
- package/dist/components/expression-input/context.js +15 -0
- package/dist/components/expression-input/context.js.map +1 -0
- package/dist/components/expression-input/expression-input.d.ts +294 -0
- package/dist/components/expression-input/expression-input.d.ts.map +1 -0
- package/dist/components/expression-input/expression-input.js +307 -0
- package/dist/components/expression-input/expression-input.js.map +1 -0
- package/dist/components/expression-input/use-expression-input.d.ts +26 -0
- package/dist/components/expression-input/use-expression-input.d.ts.map +1 -0
- package/dist/components/expression-input/use-expression-input.js +72 -0
- package/dist/components/expression-input/use-expression-input.js.map +1 -0
- package/dist/components/field/boundary.d.ts +12 -0
- package/dist/components/field/boundary.d.ts.map +1 -0
- package/dist/components/field/boundary.js +19 -0
- package/dist/components/field/boundary.js.map +1 -0
- package/dist/components/field/field.d.ts +32 -10
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +51 -20
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/field/use-field-control.d.ts.map +1 -1
- package/dist/components/field/use-field-control.js +5 -25
- package/dist/components/field/use-field-control.js.map +1 -1
- package/dist/components/field/use-field.d.ts +6 -2
- package/dist/components/field/use-field.d.ts.map +1 -1
- package/dist/components/field/use-field.js +45 -4
- package/dist/components/field/use-field.js.map +1 -1
- package/dist/components/field-array/context.d.ts +1 -1
- package/dist/components/field-array/field-array.d.ts +87 -2
- package/dist/components/field-array/field-array.d.ts.map +1 -1
- package/dist/components/field-array/field-array.js +107 -3
- package/dist/components/field-array/field-array.js.map +1 -1
- package/dist/components/field-array/use-field-array.d.ts +4 -2
- package/dist/components/field-array/use-field-array.d.ts.map +1 -1
- package/dist/components/field-array/use-field-array.js +6 -2
- package/dist/components/field-array/use-field-array.js.map +1 -1
- package/dist/components/fieldset/fieldset.d.ts +23 -8
- package/dist/components/fieldset/fieldset.d.ts.map +1 -1
- package/dist/components/fieldset/fieldset.js +39 -4
- package/dist/components/fieldset/fieldset.js.map +1 -1
- package/dist/components/fieldset/use-fieldset.d.ts +6 -2
- package/dist/components/fieldset/use-fieldset.d.ts.map +1 -1
- package/dist/components/fieldset/use-fieldset.js +38 -4
- package/dist/components/fieldset/use-fieldset.js.map +1 -1
- package/dist/components/file-upload/file-upload.d.ts +56 -2
- package/dist/components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/file-upload.js +81 -6
- package/dist/components/file-upload/file-upload.js.map +1 -1
- package/dist/components/file-upload/use-file-upload.d.ts +6 -1
- package/dist/components/file-upload/use-file-upload.d.ts.map +1 -1
- package/dist/components/file-upload/use-file-upload.js +10 -4
- package/dist/components/file-upload/use-file-upload.js.map +1 -1
- package/dist/components/filter-builder/context.js +35 -0
- package/dist/components/filter-builder/context.js.map +1 -0
- package/dist/components/filter-builder/filter-builder.d.ts +216 -0
- package/dist/components/filter-builder/filter-builder.d.ts.map +1 -0
- package/dist/components/filter-builder/filter-builder.js +322 -0
- package/dist/components/filter-builder/filter-builder.js.map +1 -0
- package/dist/components/filter-builder/use-filter-builder.d.ts +16 -0
- package/dist/components/filter-builder/use-filter-builder.d.ts.map +1 -0
- package/dist/components/filter-builder/use-filter-builder.js +27 -0
- package/dist/components/filter-builder/use-filter-builder.js.map +1 -0
- package/dist/components/flex/context.d.ts +1 -1
- package/dist/components/flex/flex.d.ts +1 -1
- package/dist/components/flex/flex.js +1 -1
- package/dist/components/float-button/float-button.d.ts +1 -1
- package/dist/components/float-button/use-float-button.d.ts +1 -1
- package/dist/components/float-button/use-float-button.js +1 -1
- package/dist/components/floating-panel/floating-panel.d.ts +5 -1
- package/dist/components/floating-panel/floating-panel.d.ts.map +1 -1
- package/dist/components/floating-panel/floating-panel.js +8 -2
- package/dist/components/floating-panel/floating-panel.js.map +1 -1
- package/dist/components/floating-panel/use-floating-panel.d.ts +6 -3
- package/dist/components/floating-panel/use-floating-panel.d.ts.map +1 -1
- package/dist/components/floating-panel/use-floating-panel.js +6 -2
- package/dist/components/floating-panel/use-floating-panel.js.map +1 -1
- package/dist/components/form/form.d.ts +1 -1
- package/dist/components/form/form.js +1 -1
- package/dist/components/form/use-form.d.ts +1 -1
- package/dist/components/form/use-form.js +1 -1
- package/dist/components/format-input/context.js +15 -0
- package/dist/components/format-input/context.js.map +1 -0
- package/dist/components/format-input/format-input.d.ts +189 -0
- package/dist/components/format-input/format-input.d.ts.map +1 -0
- package/dist/components/format-input/format-input.js +189 -0
- package/dist/components/format-input/format-input.js.map +1 -0
- package/dist/components/format-input/use-format-input.d.ts +16 -0
- package/dist/components/format-input/use-format-input.d.ts.map +1 -0
- package/dist/components/format-input/use-format-input.js +27 -0
- package/dist/components/format-input/use-format-input.js.map +1 -0
- package/dist/components/funnel-chart/funnel-chart.d.ts +6 -6
- package/dist/components/funnel-chart/use-funnel-chart.d.ts +1 -1
- package/dist/components/funnel-chart/use-funnel-chart.js +1 -1
- package/dist/components/graph-chart/graph-chart.d.ts +6 -6
- package/dist/components/graph-chart/use-graph-chart.d.ts +1 -1
- package/dist/components/graph-chart/use-graph-chart.js +1 -1
- package/dist/components/grid/context.d.ts +1 -1
- package/dist/components/grid/grid.d.ts +12 -2
- package/dist/components/grid/grid.d.ts.map +1 -1
- package/dist/components/grid/grid.js +8 -3
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid-list/context.d.ts +1 -1
- package/dist/components/grid-list/grid-list.d.ts +1 -1
- package/dist/components/grid-list/grid-list.d.ts.map +1 -1
- package/dist/components/grid-list/grid-list.js +5 -1
- package/dist/components/grid-list/grid-list.js.map +1 -1
- package/dist/components/grid-list/use-grid-list.d.ts +7 -2
- package/dist/components/grid-list/use-grid-list.d.ts.map +1 -1
- package/dist/components/grid-list/use-grid-list.js +4 -1
- package/dist/components/grid-list/use-grid-list.js.map +1 -1
- package/dist/components/heatmap/heatmap.d.ts +40 -11
- package/dist/components/heatmap/heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/heatmap.js +56 -90
- package/dist/components/heatmap/heatmap.js.map +1 -1
- package/dist/components/heatmap/use-heatmap.d.ts +2 -2
- package/dist/components/heatmap/use-heatmap.d.ts.map +1 -1
- package/dist/components/heatmap/use-heatmap.js +3 -5
- package/dist/components/heatmap/use-heatmap.js.map +1 -1
- package/dist/components/hierarchy-chart/hierarchy-chart.d.ts +4 -4
- package/dist/components/hierarchy-chart/use-hierarchy-chart.d.ts +1 -1
- package/dist/components/hierarchy-chart/use-hierarchy-chart.js +1 -1
- package/dist/components/highlight/highlight.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts +1 -1
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/hover-card.js +5 -9
- package/dist/components/hover-card/hover-card.js.map +1 -1
- package/dist/components/hover-card/use-hover-card.d.ts +4 -5
- package/dist/components/hover-card/use-hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/use-hover-card.js +5 -7
- package/dist/components/hover-card/use-hover-card.js.map +1 -1
- package/dist/components/icon/icon.d.ts +2 -2
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +10 -2
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/icon/use-icon.d.ts +1 -1
- package/dist/components/icon/use-icon.js +1 -1
- package/dist/components/image/image.d.ts +1 -1
- package/dist/components/image/use-image.d.ts +1 -1
- package/dist/components/image/use-image.js +1 -1
- package/dist/components/image-cropper/image-cropper.d.ts +9 -1
- package/dist/components/image-cropper/image-cropper.d.ts.map +1 -1
- package/dist/components/image-cropper/image-cropper.js +2 -0
- package/dist/components/image-cropper/image-cropper.js.map +1 -1
- package/dist/components/image-cropper/use-image-cropper.d.ts +1 -1
- package/dist/components/image-cropper/use-image-cropper.js +1 -1
- package/dist/components/image-viewer/image-viewer.d.ts +1 -1
- package/dist/components/image-viewer/image-viewer.js +1 -1
- package/dist/components/image-viewer/use-image-viewer.d.ts +1 -1
- package/dist/components/image-viewer/use-image-viewer.js +1 -1
- package/dist/components/infinite-scroll/infinite-scroll.d.ts +1 -1
- package/dist/components/infinite-scroll/use-infinite-scroll.d.ts +1 -1
- package/dist/components/infinite-scroll/use-infinite-scroll.js +1 -1
- package/dist/components/input-group/context.d.ts +1 -1
- package/dist/components/input-group/input-group.js +1 -1
- package/dist/components/json-viewer/json-viewer.d.ts +1 -1
- package/dist/components/json-viewer/json-viewer.d.ts.map +1 -1
- package/dist/components/json-viewer/json-viewer.js +2 -1
- package/dist/components/json-viewer/json-viewer.js.map +1 -1
- package/dist/components/json-viewer/use-json-viewer.d.ts +1 -1
- package/dist/components/json-viewer/use-json-viewer.js +1 -1
- package/dist/components/kbd/kbd.d.ts +2 -1
- package/dist/components/kbd/kbd.d.ts.map +1 -1
- package/dist/components/kbd/kbd.js +1 -1
- package/dist/components/kbd/kbd.js.map +1 -1
- package/dist/components/kbd/use-kbd-platform.js +1 -1
- package/dist/components/kbd/use-kbd-platform.js.map +1 -1
- package/dist/components/layout/layout.d.ts +1 -1
- package/dist/components/layout/use-layout.d.ts +1 -1
- package/dist/components/layout/use-layout.js +1 -1
- package/dist/components/list/context.d.ts +1 -1
- package/dist/components/list/list.js +1 -1
- package/dist/components/listbox/listbox.d.ts +17 -1
- package/dist/components/listbox/listbox.d.ts.map +1 -1
- package/dist/components/listbox/listbox.js +57 -18
- package/dist/components/listbox/listbox.js.map +1 -1
- package/dist/components/listbox/use-listbox.d.ts +7 -2
- package/dist/components/listbox/use-listbox.d.ts.map +1 -1
- package/dist/components/listbox/use-listbox.js +7 -3
- package/dist/components/listbox/use-listbox.js.map +1 -1
- package/dist/components/loading-bar/loading-bar.d.ts +1 -1
- package/dist/components/loading-bar/use-loading-bar.d.ts +1 -1
- package/dist/components/loading-bar/use-loading-bar.js +1 -1
- package/dist/components/log/log.d.ts +1 -1
- package/dist/components/log/log.js +1 -1
- package/dist/components/log/use-log.d.ts +1 -1
- package/dist/components/log/use-log.js +1 -1
- package/dist/components/markdown-stream/markdown-stream.d.ts +1 -1
- package/dist/components/markdown-stream/markdown-stream.js +1 -1
- package/dist/components/markdown-stream/use-markdown-stream.d.ts +1 -1
- package/dist/components/markdown-stream/use-markdown-stream.js +1 -1
- package/dist/components/marquee/context.d.ts +1 -1
- package/dist/components/marquee/marquee.d.ts +1 -1
- package/dist/components/marquee/marquee.js +1 -1
- package/dist/components/masonry/masonry.d.ts +1 -1
- package/dist/components/masonry/masonry.js +1 -1
- package/dist/components/matrix-code/context.d.ts +1 -1
- package/dist/components/matrix-code/matrix-code.d.ts +1 -1
- package/dist/components/matrix-code/matrix-code.js +1 -1
- package/dist/components/mention/context.d.ts +1 -1
- package/dist/components/mention/mention.d.ts +25 -3
- package/dist/components/mention/mention.d.ts.map +1 -1
- package/dist/components/mention/mention.js +70 -17
- package/dist/components/mention/mention.js.map +1 -1
- package/dist/components/mention/use-mention.d.ts +7 -2
- package/dist/components/mention/use-mention.d.ts.map +1 -1
- package/dist/components/mention/use-mention.js +4 -1
- package/dist/components/mention/use-mention.js.map +1 -1
- package/dist/components/menu/context.d.ts +1 -1
- package/dist/components/menu/menu.d.ts +64 -7
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/menu/menu.js +184 -72
- package/dist/components/menu/menu.js.map +1 -1
- package/dist/components/menu/use-menu.d.ts +6 -2
- package/dist/components/menu/use-menu.d.ts.map +1 -1
- package/dist/components/menu/use-menu.js +14 -8
- package/dist/components/menu/use-menu.js.map +1 -1
- package/dist/components/menubar/context.d.ts +1 -1
- package/dist/components/menubar/menubar.d.ts +57 -7
- package/dist/components/menubar/menubar.d.ts.map +1 -1
- package/dist/components/menubar/menubar.js +121 -74
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/menubar/use-menubar.d.ts +2 -2
- package/dist/components/menubar/use-menubar.d.ts.map +1 -1
- package/dist/components/menubar/use-menubar.js +4 -4
- package/dist/components/menubar/use-menubar.js.map +1 -1
- package/dist/components/message-feed/message-feed.d.ts +1 -1
- package/dist/components/message-feed/use-message-feed.d.ts +1 -1
- package/dist/components/message-feed/use-message-feed.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js +22 -24
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/navigation-menu/use-navigation-menu.d.ts +1 -1
- package/dist/components/navigation-menu/use-navigation-menu.js +1 -1
- package/dist/components/notification/context.d.ts +4 -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 +1 -1
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/notification/notification.js +7 -1
- package/dist/components/notification/notification.js.map +1 -1
- package/dist/components/notification/use-notification.d.ts +1 -1
- package/dist/components/notification/use-notification.d.ts.map +1 -1
- package/dist/components/notification/use-notification.js +6 -2
- package/dist/components/notification/use-notification.js.map +1 -1
- package/dist/components/number-animation/number-animation.d.ts +1 -1
- package/dist/components/number-animation/number-animation.js +1 -1
- package/dist/components/number-field/number-field.d.ts +24 -1
- package/dist/components/number-field/number-field.d.ts.map +1 -1
- package/dist/components/number-field/number-field.js +44 -12
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/number-field/use-number-field.d.ts +6 -1
- package/dist/components/number-field/use-number-field.d.ts.map +1 -1
- package/dist/components/number-field/use-number-field.js +7 -2
- package/dist/components/number-field/use-number-field.js.map +1 -1
- package/dist/components/page-header/context.d.ts +1 -1
- package/dist/components/page-header/page-header.js +1 -1
- package/dist/components/pagination/pagination.d.ts +1 -1
- package/dist/components/pagination/use-pagination.d.ts +1 -1
- package/dist/components/pagination/use-pagination.js +1 -1
- package/dist/components/password-input/password-input.d.ts +19 -1
- package/dist/components/password-input/password-input.d.ts.map +1 -1
- package/dist/components/password-input/password-input.js +45 -13
- package/dist/components/password-input/password-input.js.map +1 -1
- package/dist/components/password-input/use-password-input.d.ts +6 -1
- package/dist/components/password-input/use-password-input.d.ts.map +1 -1
- package/dist/components/password-input/use-password-input.js +10 -4
- package/dist/components/password-input/use-password-input.js.map +1 -1
- package/dist/components/pie-chart/pie-chart.d.ts +6 -6
- package/dist/components/pie-chart/use-pie-chart.d.ts +1 -1
- package/dist/components/pie-chart/use-pie-chart.js +1 -1
- package/dist/components/pin-input/pin-input.d.ts +19 -1
- package/dist/components/pin-input/pin-input.d.ts.map +1 -1
- package/dist/components/pin-input/pin-input.js +33 -3
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/pin-input/use-pin-input.d.ts +6 -1
- package/dist/components/pin-input/use-pin-input.d.ts.map +1 -1
- package/dist/components/pin-input/use-pin-input.js +10 -4
- package/dist/components/pin-input/use-pin-input.js.map +1 -1
- package/dist/components/popconfirm/popconfirm.d.ts +3 -3
- package/dist/components/popconfirm/popconfirm.d.ts.map +1 -1
- package/dist/components/popconfirm/popconfirm.js +10 -4
- package/dist/components/popconfirm/popconfirm.js.map +1 -1
- package/dist/components/popconfirm/use-popconfirm.d.ts +4 -1
- package/dist/components/popconfirm/use-popconfirm.d.ts.map +1 -1
- package/dist/components/popconfirm/use-popconfirm.js +8 -4
- package/dist/components/popconfirm/use-popconfirm.js.map +1 -1
- package/dist/components/popover/popover.d.ts +10 -2
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +10 -2
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/popover/use-popover.d.ts +8 -1
- package/dist/components/popover/use-popover.d.ts.map +1 -1
- package/dist/components/popover/use-popover.js +12 -3
- package/dist/components/popover/use-popover.js.map +1 -1
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.js +1 -1
- package/dist/components/prompt-input/prompt-input.d.ts +1 -1
- package/dist/components/prompt-input/use-prompt-input.d.ts +1 -1
- package/dist/components/prompt-input/use-prompt-input.js +1 -1
- package/dist/components/question-flow/question-flow.d.ts +1 -1
- package/dist/components/question-flow/use-question-flow.d.ts +1 -1
- package/dist/components/question-flow/use-question-flow.js +1 -1
- package/dist/components/radar-chart/radar-chart.d.ts +6 -6
- package/dist/components/radar-chart/use-radar-chart.d.ts +1 -1
- package/dist/components/radar-chart/use-radar-chart.js +1 -1
- package/dist/components/radio-group/radio-group.d.ts +9 -1
- package/dist/components/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group/radio-group.js +44 -22
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/use-radio-group.d.ts +1 -1
- package/dist/components/radio-group/use-radio-group.js +1 -1
- package/dist/components/rating/rating.d.ts +27 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/rating/rating.js +56 -12
- package/dist/components/rating/rating.js.map +1 -1
- package/dist/components/rating/use-rating.d.ts +7 -2
- package/dist/components/rating/use-rating.d.ts.map +1 -1
- package/dist/components/rating/use-rating.js +7 -3
- package/dist/components/rating/use-rating.js.map +1 -1
- package/dist/components/reasoning/reasoning.d.ts +1 -1
- package/dist/components/reasoning/use-reasoning.d.ts +1 -1
- package/dist/components/reasoning/use-reasoning.js +1 -1
- package/dist/components/resizable/resizable.d.ts +1 -1
- package/dist/components/resizable/use-resizable.d.ts +1 -1
- package/dist/components/resizable/use-resizable.js +1 -1
- package/dist/components/sankey-chart/sankey-chart.d.ts +6 -6
- package/dist/components/sankey-chart/use-sankey-chart.d.ts +1 -1
- package/dist/components/sankey-chart/use-sankey-chart.js +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/use-scroll-area.d.ts +1 -1
- package/dist/components/scroll-area/use-scroll-area.js +1 -1
- package/dist/components/scrollbar/scrollbar.d.ts +3 -3
- package/dist/components/scrollbar/use-scrollbar.d.ts +1 -1
- package/dist/components/scrollbar/use-scrollbar.js +1 -1
- package/dist/components/select/select.d.ts +33 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +115 -49
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/use-select.d.ts +6 -1
- package/dist/components/select/use-select.d.ts.map +1 -1
- package/dist/components/select/use-select.js +4 -1
- package/dist/components/select/use-select.js.map +1 -1
- package/dist/components/separator/separator.d.ts +3 -2
- package/dist/components/separator/separator.d.ts.map +1 -1
- package/dist/components/separator/separator.js +12 -8
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/side-nav/side-nav.d.ts +1 -1
- package/dist/components/side-nav/side-nav.js +1 -1
- package/dist/components/side-nav/use-side-nav.d.ts +1 -1
- package/dist/components/side-nav/use-side-nav.js +1 -1
- package/dist/components/signature-pad/signature-pad.d.ts +18 -1
- package/dist/components/signature-pad/signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/signature-pad.js +57 -17
- package/dist/components/signature-pad/signature-pad.js.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts +6 -1
- package/dist/components/signature-pad/use-signature-pad.d.ts.map +1 -1
- package/dist/components/signature-pad/use-signature-pad.js +6 -2
- package/dist/components/signature-pad/use-signature-pad.js.map +1 -1
- package/dist/components/skeleton/skeleton.d.ts +1 -1
- package/dist/components/skeleton/use-skeleton.js +1 -1
- package/dist/components/slider/slider.d.ts +27 -1
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +58 -9
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/slider/use-slider.d.ts +6 -1
- package/dist/components/slider/use-slider.d.ts.map +1 -1
- package/dist/components/slider/use-slider.js +6 -2
- package/dist/components/slider/use-slider.js.map +1 -1
- package/dist/components/sortable/sortable.d.ts +1 -1
- package/dist/components/sortable/use-sortable.d.ts +1 -1
- package/dist/components/sortable/use-sortable.js +1 -1
- package/dist/components/sparkline/sparkline.d.ts +1 -1
- package/dist/components/sparkline/use-sparkline.d.ts +1 -1
- package/dist/components/sparkline/use-sparkline.js +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/use-spinner.js +1 -1
- package/dist/components/splitter/splitter.d.ts +1 -1
- package/dist/components/splitter/use-splitter.d.ts +1 -1
- package/dist/components/splitter/use-splitter.js +1 -1
- package/dist/components/statistic/context.d.ts +1 -1
- package/dist/components/statistic/statistic.d.ts +1 -1
- package/dist/components/statistic/statistic.js +1 -1
- package/dist/components/steps/steps.d.ts +1 -1
- package/dist/components/steps/use-steps.d.ts +1 -1
- package/dist/components/steps/use-steps.js +1 -1
- package/dist/components/switch/switch.d.ts +9 -1
- package/dist/components/switch/switch.d.ts.map +1 -1
- package/dist/components/switch/switch.js +30 -2
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/switch/use-switch.d.ts +1 -1
- package/dist/components/switch/use-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 +44 -11
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +28 -7
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/use-table.d.ts +4 -2
- package/dist/components/table/use-table.d.ts.map +1 -1
- package/dist/components/table/use-table.js +10 -5
- package/dist/components/table/use-table.js.map +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/tabs/tabs.js +16 -15
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tabs/use-tabs.d.ts +1 -1
- package/dist/components/tabs/use-tabs.js +1 -1
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/tag/use-tag.d.ts +1 -1
- package/dist/components/tag/use-tag.js +1 -1
- package/dist/components/tag-group/context.d.ts +1 -1
- package/dist/components/tag-group/tag-group.d.ts +32 -2
- package/dist/components/tag-group/tag-group.d.ts.map +1 -1
- package/dist/components/tag-group/tag-group.js +55 -15
- package/dist/components/tag-group/tag-group.js.map +1 -1
- package/dist/components/tag-group/use-tag-group.d.ts +7 -2
- package/dist/components/tag-group/use-tag-group.d.ts.map +1 -1
- package/dist/components/tag-group/use-tag-group.js +7 -3
- package/dist/components/tag-group/use-tag-group.js.map +1 -1
- package/dist/components/tags-input/tags-input.d.ts +22 -1
- package/dist/components/tags-input/tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/tags-input.js +66 -19
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/tags-input/use-tags-input.d.ts +6 -1
- package/dist/components/tags-input/use-tags-input.d.ts.map +1 -1
- package/dist/components/tags-input/use-tags-input.js +6 -2
- package/dist/components/tags-input/use-tags-input.js.map +1 -1
- package/dist/components/text-field/text-field.d.ts +24 -2
- package/dist/components/text-field/text-field.d.ts.map +1 -1
- package/dist/components/text-field/text-field.js +60 -11
- package/dist/components/text-field/text-field.js.map +1 -1
- package/dist/components/text-field/use-text-field.d.ts +6 -1
- package/dist/components/text-field/use-text-field.d.ts.map +1 -1
- package/dist/components/text-field/use-text-field.js +7 -2
- package/dist/components/text-field/use-text-field.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts +9 -1
- package/dist/components/time-field/time-field.d.ts.map +1 -1
- package/dist/components/time-field/time-field.js +7 -1
- package/dist/components/time-field/time-field.js.map +1 -1
- package/dist/components/time-field/use-time-field.d.ts +6 -1
- package/dist/components/time-field/use-time-field.d.ts.map +1 -1
- package/dist/components/time-field/use-time-field.js +10 -4
- package/dist/components/time-field/use-time-field.js.map +1 -1
- package/dist/components/time-picker/time-picker.d.ts +25 -1
- package/dist/components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/time-picker.js +48 -4
- package/dist/components/time-picker/time-picker.js.map +1 -1
- package/dist/components/time-picker/use-time-picker.d.ts +6 -1
- package/dist/components/time-picker/use-time-picker.d.ts.map +1 -1
- package/dist/components/time-picker/use-time-picker.js +4 -1
- package/dist/components/time-picker/use-time-picker.js.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.d.ts +35 -1
- package/dist/components/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/components/time-range-picker/time-range-picker.js +47 -5
- package/dist/components/time-range-picker/time-range-picker.js.map +1 -1
- package/dist/components/time-range-picker/use-time-range-picker.d.ts +6 -1
- package/dist/components/time-range-picker/use-time-range-picker.d.ts.map +1 -1
- package/dist/components/time-range-picker/use-time-range-picker.js +4 -1
- package/dist/components/time-range-picker/use-time-range-picker.js.map +1 -1
- package/dist/components/timeline/context.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/timeline/timeline.js +1 -1
- package/dist/components/timer/timer.d.ts +1 -1
- package/dist/components/timer/use-timer.d.ts +1 -1
- package/dist/components/timer/use-timer.js +1 -1
- package/dist/components/timestamp/timestamp.d.ts +1 -1
- package/dist/components/timestamp/timestamp.js +1 -1
- package/dist/components/toggle/toggle.d.ts +1 -1
- package/dist/components/toggle/use-toggle.d.ts +1 -1
- package/dist/components/toggle/use-toggle.js +1 -1
- package/dist/components/toggle-group/toggle-group.d.ts +36 -1
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.js +30 -9
- package/dist/components/toggle-group/toggle-group.js.map +1 -1
- package/dist/components/toggle-group/use-toggle-group.d.ts +1 -1
- package/dist/components/toggle-group/use-toggle-group.js +1 -1
- package/dist/components/tool-call/tool-call.d.ts +1 -1
- package/dist/components/tool-call/tool-call.js +1 -1
- package/dist/components/tool-call/use-tool-call.d.ts +1 -1
- package/dist/components/tool-call/use-tool-call.js +1 -1
- package/dist/components/toolbar/toolbar.d.ts +13 -2
- package/dist/components/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/toolbar.js +7 -3
- package/dist/components/toolbar/toolbar.js.map +1 -1
- package/dist/components/toolbar/use-toolbar.d.ts +1 -1
- package/dist/components/toolbar/use-toolbar.js +1 -1
- package/dist/components/tooltip/context.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts +33 -2
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +33 -6
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/components/tooltip/use-tooltip.js +1 -1
- package/dist/components/tour/tour.d.ts +9 -1
- package/dist/components/tour/tour.d.ts.map +1 -1
- package/dist/components/tour/tour.js +13 -1
- package/dist/components/tour/tour.js.map +1 -1
- package/dist/components/tour/use-tour.d.ts +4 -1
- package/dist/components/tour/use-tour.d.ts.map +1 -1
- package/dist/components/tour/use-tour.js +14 -3
- package/dist/components/tour/use-tour.js.map +1 -1
- package/dist/components/transfer/transfer.d.ts +18 -1
- package/dist/components/transfer/transfer.d.ts.map +1 -1
- package/dist/components/transfer/transfer.js +65 -18
- package/dist/components/transfer/transfer.js.map +1 -1
- package/dist/components/transfer/use-transfer.d.ts +1 -1
- package/dist/components/transfer/use-transfer.js +1 -1
- package/dist/components/tree/tree.d.ts +12 -9
- package/dist/components/tree/tree.d.ts.map +1 -1
- package/dist/components/tree/tree.js +17 -6
- package/dist/components/tree/tree.js.map +1 -1
- package/dist/components/tree/use-tree.d.ts +7 -2
- package/dist/components/tree/use-tree.d.ts.map +1 -1
- package/dist/components/tree/use-tree.js +7 -3
- package/dist/components/tree/use-tree.js.map +1 -1
- package/dist/components/tree-select/tree-select.d.ts +19 -2
- package/dist/components/tree-select/tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/tree-select.js +54 -35
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/tree-select/use-tree-select.d.ts +6 -1
- package/dist/components/tree-select/use-tree-select.d.ts.map +1 -1
- package/dist/components/tree-select/use-tree-select.js +4 -1
- package/dist/components/tree-select/use-tree-select.js.map +1 -1
- package/dist/components/truncate/truncate.d.ts +2 -2
- package/dist/components/truncate/use-truncate.d.ts +1 -1
- package/dist/components/truncate/use-truncate.js +1 -1
- package/dist/components/typography/context.d.ts +1 -1
- package/dist/components/typography/typography.d.ts +1 -1
- package/dist/components/typography/typography.js +1 -1
- package/dist/components/virtualizer/use-virtualizer.d.ts +1 -1
- package/dist/components/virtualizer/use-virtualizer.js +1 -1
- package/dist/components/virtualizer/virtualizer.d.ts +10 -1
- package/dist/components/virtualizer/virtualizer.d.ts.map +1 -1
- package/dist/components/virtualizer/virtualizer.js +5 -1
- package/dist/components/virtualizer/virtualizer.js.map +1 -1
- package/dist/components/watermark/context.d.ts +1 -1
- package/dist/components/watermark/watermark.d.ts +1 -1
- package/dist/components/watermark/watermark.js +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.js +2 -2
- package/dist/config/config.js.map +1 -1
- package/dist/index.d.ts +22 -14
- package/dist/index.js +36 -28
- package/dist/package.js +1 -1
- package/dist/runtime/live-props.js +27 -0
- package/dist/runtime/live-props.js.map +1 -0
- package/dist/runtime/merge-props.js +23 -3
- package/dist/runtime/merge-props.js.map +1 -1
- package/dist/runtime/structure.js +36 -0
- package/dist/runtime/structure.js.map +1 -0
- package/dist/runtime/title-description.d.ts +13 -0
- package/dist/runtime/title-description.d.ts.map +1 -0
- package/dist/runtime/title-description.js +47 -0
- package/dist/runtime/title-description.js.map +1 -0
- package/dist/runtime/use-scrollbars.js +1 -1
- package/dist/services/dialog-service.d.ts +1 -1
- package/dist/services/dialog-service.js +1 -1
- package/dist/services/loading-bar-service.d.ts +1 -1
- package/dist/services/loading-bar-service.js +1 -1
- package/dist/services/notification-service.d.ts +1 -1
- package/dist/services/notification-service.js +1 -1
- package/package.json +16 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-grid-list.js","names":[],"sources":["../../../src/components/grid-list/use-grid-list.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 use grid list 相关实现。\n\nimport type { Service } from '@xihan-ui/core'\nimport type { GridListApi, GridListSchema } from '@xihan-ui/headless'\nimport type { ComputedRef } from 'vue'\nimport { connectGridList, gridListMachine } from '@xihan-ui/headless'\nimport { computed } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface GridListContext {\n api: ComputedRef<GridListApi>\n service: Service<GridListSchema>\n}\n\nexport function useGridList(\n props: GridListSchema['props'],\n onValueChange?: GridListSchema['props']['onValueChange'],\n onAction?: GridListSchema['props']['onAction'],\n): GridListContext {\n const service = useMachine(gridListMachine, () => ({ ...props, onValueChange, onAction }))\n return { api: computed(() => connectGridList(service, vueNormalize)), service }\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"use-grid-list.js","names":[],"sources":["../../../src/components/grid-list/use-grid-list.ts"],"sourcesContent":["/*\n * Copyright (c) 2021-Present XiHanFun and contributors.\n * Licensed under the MIT License. See LICENSE in the project root for license information.\n */\n\n// 提供 use grid list 相关实现。\n\nimport type { Service } from '@xihan-ui/core'\nimport type { GridListApi, GridListSchema } from '@xihan-ui/headless'\nimport type { ComputedRef, Ref } from 'vue'\nimport { connectGridList, gridListMachine } from '@xihan-ui/headless'\nimport { computed, ref } from 'vue'\nimport { vueNormalize } from '../../runtime/normalize-props'\nimport { useMachine } from '../../runtime/use-machine'\n\nexport interface GridListContext {\n /**\n * 已渲染的 label 部件数量,由 XhGridListLabel 在 setup 里同步登记、卸载时撤销。\n * 可聚焦部件的 aria-labelledby 据此决定指不指过去:label 排在输入之前时,首帧与服务端直出就带上名字。\n */\n labelCount: Ref<number>\n api: ComputedRef<GridListApi>\n service: Service<GridListSchema>\n}\n\nexport function useGridList(\n props: GridListSchema['props'],\n onValueChange?: GridListSchema['props']['onValueChange'],\n onAction?: GridListSchema['props']['onAction'],\n): GridListContext {\n const labelCount = ref(0)\n const service = useMachine(gridListMachine, () => ({ ...props, labelled: labelCount.value > 0, onValueChange, onAction }))\n return { labelCount, api: computed(() => connectGridList(service, vueNormalize)), service }\n}\n"],"mappings":";;;;;AAyBA,SAAgB,YACd,OACA,eACA,UACiB;CACjB,MAAM,aAAa,IAAI,CAAC;CACxB,MAAM,UAAU,WAAW,wBAAwB;EAAE,GAAG;EAAO,UAAU,WAAW,QAAQ;EAAG;EAAe;CAAS,EAAE;CACzH,OAAO;EAAE;EAAY,KAAK,eAAe,gBAAgB,SAAS,YAAY,CAAC;EAAG;CAAQ;AAC5F"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
+
import { HeatmapApi, HeatmapAxisInput, HeatmapCellMeta, HeatmapDatumDetails, HeatmapLegendBound, HeatmapMatrixCellMeta, HeatmapPalette, HeatmapPolarity, HeatmapScaleMode, HeatmapSchema, HeatmapTranslations, HeatmapValue, HeatmapVariant, NumberFormatSpec } from "@xihan-ui/headless";
|
|
2
3
|
import { PropType, SlotsType, VNode } from "vue";
|
|
3
4
|
import { Direction, Size, Tone } from "@xihan-ui/core";
|
|
4
|
-
import { HeatmapApi, HeatmapAxisInput, HeatmapCellDetails, HeatmapCellMeta, HeatmapLegendBound, HeatmapMatrixCellMeta, HeatmapPalette, HeatmapPolarity, HeatmapScaleMode, HeatmapSchema, HeatmapTranslations, HeatmapValue, HeatmapVariant } from "@xihan-ui/headless";
|
|
5
5
|
//#region src/components/heatmap/heatmap.d.ts
|
|
6
6
|
type HeatmapProps = HeatmapSchema['props'];
|
|
7
7
|
/**
|
|
@@ -9,7 +9,7 @@ type HeatmapProps = HeatmapSchema['props'];
|
|
|
9
9
|
* 三形态通用的一组(`focusedCell` / `anchorCell` / `setFocusedCell`)也包含在内:
|
|
10
10
|
* 矩阵形态下带 Date 的一组恒为 null,自行铺设矩阵时只有这一组能读取、移动锚点。
|
|
11
11
|
*/
|
|
12
|
-
type HeatmapRootSlotProps = Pick<HeatmapApi, 'variant' | 'grid' | 'monthGrid' | 'matrixGrid' | 'focusedCell' | 'focusedDate' | 'anchorCell' | 'anchorDate' | 'activeCell' | 'detailOpen' | 'scaleMode' | 'legendItems' | 'cellAt' | 'setFocusedCell' | 'setFocusedDate'>;
|
|
12
|
+
type HeatmapRootSlotProps = Pick<HeatmapApi, 'variant' | 'grid' | 'monthGrid' | 'matrixGrid' | 'focusedCell' | 'focusedDate' | 'anchorCell' | 'anchorDate' | 'activeCell' | 'activeKey' | 'empty' | 'detailOpen' | 'scaleMode' | 'legendItems' | 'cellAt' | 'setFocusedCell' | 'setFocusedDate'>;
|
|
13
13
|
/**
|
|
14
14
|
* `cell` 插槽的载荷:日期形态给日历的格子,矩阵形态给矩阵的格子。
|
|
15
15
|
* 两者的坐标不同,用 `'date' in cell` 区分。
|
|
@@ -72,15 +72,26 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
72
72
|
type: BooleanConstructor;
|
|
73
73
|
default: undefined;
|
|
74
74
|
};
|
|
75
|
+
format: {
|
|
76
|
+
type: PropType<NumberFormatSpec | ((value: number) => string)>;
|
|
77
|
+
};
|
|
78
|
+
pending: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
activeKey: {
|
|
83
|
+
type: PropType<string | null>;
|
|
84
|
+
};
|
|
75
85
|
translations: {
|
|
76
86
|
type: PropType<Partial<HeatmapTranslations>>;
|
|
77
87
|
};
|
|
78
88
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
79
89
|
[key: string]: any;
|
|
80
90
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'
|
|
91
|
+
'datum-active': (_details: PayloadOf<HeatmapProps, "onDatumActive">) => true;
|
|
92
|
+
'datum-press': (_details: PayloadOf<HeatmapProps, "onDatumPress">) => true;
|
|
93
|
+
'active-key-change': (_details: PayloadOf<HeatmapProps, "onActiveKeyChange">) => true;
|
|
94
|
+
'update:activeKey': (_key: PayloadOf<HeatmapProps, "onActiveKeyChange">["activeKey"]) => true;
|
|
84
95
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
85
96
|
variant: {
|
|
86
97
|
type: PropType<HeatmapVariant>;
|
|
@@ -138,22 +149,36 @@ declare const XhHeatmapRoot: import("vue").DefineComponent<import("vue").Extract
|
|
|
138
149
|
type: BooleanConstructor;
|
|
139
150
|
default: undefined;
|
|
140
151
|
};
|
|
152
|
+
format: {
|
|
153
|
+
type: PropType<NumberFormatSpec | ((value: number) => string)>;
|
|
154
|
+
};
|
|
155
|
+
pending: {
|
|
156
|
+
type: BooleanConstructor;
|
|
157
|
+
default: undefined;
|
|
158
|
+
};
|
|
159
|
+
activeKey: {
|
|
160
|
+
type: PropType<string | null>;
|
|
161
|
+
};
|
|
141
162
|
translations: {
|
|
142
163
|
type: PropType<Partial<HeatmapTranslations>>;
|
|
143
164
|
};
|
|
144
165
|
}>> & Readonly<{
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
166
|
+
"onDatum-active"?: ((_details: HeatmapDatumDetails | null) => any) | undefined;
|
|
167
|
+
"onDatum-press"?: ((_details: HeatmapDatumDetails) => any) | undefined;
|
|
168
|
+
"onActive-key-change"?: ((_details: import("@xihan-ui/headless").HeatmapActiveKeyChangeDetails) => any) | undefined;
|
|
169
|
+
"onUpdate:activeKey"?: ((_key: string | null) => any) | undefined;
|
|
148
170
|
}>, {
|
|
149
|
-
animated: boolean;
|
|
150
171
|
continuous: boolean;
|
|
172
|
+
animated: boolean;
|
|
173
|
+
pending: boolean;
|
|
151
174
|
}, SlotsType<{
|
|
152
175
|
default?: (props: HeatmapRootSlotProps) => VNode[];
|
|
153
176
|
/** 铺开网格时每一格的内容插槽,默认是空格子;三种形态都铺设。 */
|
|
154
177
|
cell?: (props: HeatmapCellSlotProps) => VNode[];
|
|
155
178
|
/** 详情条的内容插槽;写了它才会铺设 tooltip 部件。 */
|
|
156
|
-
tooltip?: (props:
|
|
179
|
+
tooltip?: (props: HeatmapDatumDetails | null) => VNode[];
|
|
180
|
+
/** 缺省结构里的空态内容;未写时是空态文案。 */
|
|
181
|
+
empty?: () => VNode[];
|
|
157
182
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
158
183
|
/** role=grid 的容器:键盘在这里收口,可及名字也挂在它上面。 */
|
|
159
184
|
declare const XhHeatmapGrid: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -323,6 +348,10 @@ declare const XhHeatmapLegendItem: import("vue").DefineComponent<import("vue").E
|
|
|
323
348
|
type: PropType<HeatmapPolarity>;
|
|
324
349
|
};
|
|
325
350
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
351
|
+
/** 空态:网格里一条数据都没有时叠在网格上,取数中改写加载文案。 */
|
|
352
|
+
declare const XhHeatmapEmpty: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
353
|
+
[key: string]: any;
|
|
354
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
326
355
|
//#endregion
|
|
327
|
-
export { HeatmapCellSlotProps, HeatmapRootSlotProps, XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDay };
|
|
356
|
+
export { HeatmapCellSlotProps, HeatmapRootSlotProps, XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapEmpty, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDay };
|
|
328
357
|
//# sourceMappingURL=heatmap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/heatmap.ts"],"mappings":";;;;;KAyCK,eAAe;;;;;;KAOR,uBAAuB,KACjC;;;;;
|
|
1
|
+
{"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/components/heatmap/heatmap.ts"],"mappings":";;;;;KAyCK,eAAe;;;;;;KAOR,uBAAuB,KACjC;;;;;KAwBU,uBAAuB,kBAAkB;cAExC,6BAAa,8BAAA;;IAIK,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;IACV,MAAA,SAAS;;;IACN,MAAA,SAAS;;;;;;;;;;;;IAIN,MAAA;;;IACJ,MAAA,SAAS;;;;;;;;;;;;;;;;IAKX,MAAA,SAAS;;;IACR,MAAA,SAAS;;;IACN,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;;;;;IAEK,MAAA,SAAS,qBAAqB;;;;;;;IAE/B,MAAA;;;IACL,MAAA,SAAS,QAAQ;;;;;EAItB,iBAAA,UAAA,UAAU;EACX,gBAAA,UAAA,UAAU;EACJ,sBAAA,UAAA,UAAU;EACf,qBAAA,MAAA,UAAU;;;IA5BV,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;IACV,MAAA,SAAS;;;IACN,MAAA,SAAS;;;;;;;;;;;;IAIN,MAAA;;;IACJ,MAAA,SAAS;;;;;;;;;;;;;;;;IAKX,MAAA,SAAS;;;IACR,MAAA,SAAS;;;IACN,MAAA,SAAS;;;IACZ,MAAA,SAAS;;;;;;;IAEK,MAAA,SAAS,qBAAqB;;;;;;;IAE/B,MAAA;;;IACL,MAAA,SAAS,QAAQ;;;;;;;;;;;;EAUvC,WAAC,OAAO,yBAAyB;;EAEpC,QAAC,OAAO,yBAAyB;;EAE9B,WAAC,OAAO,+BAA+B;;EAEzC,cAAM;kCA4ChB;;cAGW,6BAAa,0BAAA,oBAAA,4BAAA;;8BAMxB,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,mCAAmB,8BAAA;;;;;;;;;;;;;;MAW9B,oDAAA;;;;;cAMW,4BAAY,8BAAA;;IAGc,MAAA;;;;;;;;;;IAAA,MAAA;;;;;;MAkBrC,oDAAA;;cAGW,gCAAgB,8BAAA;;IAGU,MAAA;;;;;;IAAA,MAAA;;MAOrC,oDAAA;;cAGW,mCAAmB,8BAAA;;;;;;;;;;;;MAS9B,oDAAA;;cAGW,iCAAiB,8BAAA;;;;;;;;;;MAS5B,oDAAA;;cAGW,oCAAoB,8BAAA;;;;;;;;;;;;MAS/B,oDAAA;;;;;cAMW,6BAAa,8BAAA;;;;;;;;;;;;;;;;;;;;MAexB,oDAAA;;cAGW,gCAAgB,0BAAA,oBAAA,4BAAA;;8BAM3B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,+BAAe,0BAAA,oBAAA,4BAAA;;8BAM1B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;;cAGW,oCAAoB,8BAAA;;;IAIJ,MAAA,SAAS;;;;;;;;IAAT,MAAA,SAAS;;;MAMpC,oDAAA;;cAGW,mCAAmB,8BAAA;;;IAIO,MAAA;;;;;IAEP,MAAA,SAAS;;;;;;;IAFF,MAAA;;;;;IAEP,MAAA,SAAS;;MAOvC,oDAAA;;cAGW,8BAAc,0BAAA,oBAAA,4BAAA;;8BAMzB,qCAAA,iDAAA,aAAA,eAAA,oDAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { renderStructure } from "../../runtime/structure.js";
|
|
1
2
|
import { withXhConfig } from "../../config/config.js";
|
|
2
3
|
import { provideHeatmap, provideHeatmapMonth, provideHeatmapRow, useHeatmapContext, useHeatmapMonth, useHeatmapRow } from "./context.js";
|
|
3
4
|
import { useHeatmap } from "./use-heatmap.js";
|
|
5
|
+
import { heatmapStructure, normalizeHeatmapNumber, normalizeHeatmapString } from "@xihan-ui/headless";
|
|
4
6
|
import { computed, defineComponent, h } from "vue";
|
|
5
|
-
import { heatmapMatrixKey, normalizeHeatmapNumber, normalizeHeatmapString } from "@xihan-ui/headless";
|
|
6
7
|
//#region src/components/heatmap/heatmap.ts
|
|
7
8
|
const XhHeatmapRoot = defineComponent({
|
|
8
9
|
name: "XhHeatmapRoot",
|
|
@@ -31,19 +32,30 @@ const XhHeatmapRoot = defineComponent({
|
|
|
31
32
|
type: Boolean,
|
|
32
33
|
default: void 0
|
|
33
34
|
},
|
|
35
|
+
format: { type: [Object, Function] },
|
|
36
|
+
pending: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: void 0
|
|
39
|
+
},
|
|
40
|
+
activeKey: { type: [String, null] },
|
|
34
41
|
translations: { type: Object }
|
|
35
42
|
},
|
|
36
43
|
emits: {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
44
|
+
"datum-active": (_details) => true,
|
|
45
|
+
"datum-press": (_details) => true,
|
|
46
|
+
"active-key-change": (_details) => true,
|
|
47
|
+
"update:activeKey": (_key) => true
|
|
40
48
|
},
|
|
41
49
|
slots: Object,
|
|
42
50
|
setup(props, { slots, emit }) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
const ctx = useHeatmap(withXhConfig("heatmap", props), {
|
|
52
|
+
onDatumActive: (details) => emit("datum-active", details),
|
|
53
|
+
onDatumPress: (details) => emit("datum-press", details),
|
|
54
|
+
onActiveKeyChange: (details) => {
|
|
55
|
+
emit("active-key-change", details);
|
|
56
|
+
emit("update:activeKey", details.activeKey);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
47
59
|
provideHeatmap(ctx);
|
|
48
60
|
return () => {
|
|
49
61
|
const api = ctx.api.value;
|
|
@@ -62,13 +74,15 @@ const XhHeatmapRoot = defineComponent({
|
|
|
62
74
|
anchorCell: api.anchorCell,
|
|
63
75
|
anchorDate: api.anchorDate,
|
|
64
76
|
activeCell: api.activeCell,
|
|
77
|
+
activeKey: api.activeKey,
|
|
78
|
+
empty: api.empty,
|
|
65
79
|
detailOpen: api.detailOpen,
|
|
66
80
|
scaleMode: api.scaleMode,
|
|
67
81
|
legendItems: api.legendItems,
|
|
68
82
|
cellAt: api.cellAt,
|
|
69
83
|
setFocusedCell: api.setFocusedCell,
|
|
70
84
|
setFocusedDate: api.setFocusedDate
|
|
71
|
-
}) :
|
|
85
|
+
}) : renderDefaultStructure(api, slots.cell, slots.tooltip, slots.empty));
|
|
72
86
|
};
|
|
73
87
|
}
|
|
74
88
|
});
|
|
@@ -240,90 +254,42 @@ const XhHeatmapLegendItem = defineComponent({
|
|
|
240
254
|
}), slots.default?.());
|
|
241
255
|
}
|
|
242
256
|
});
|
|
257
|
+
/** 空态:网格里一条数据都没有时叠在网格上,取数中改写加载文案。 */
|
|
258
|
+
const XhHeatmapEmpty = defineComponent({
|
|
259
|
+
name: "XhHeatmapEmpty",
|
|
260
|
+
setup(_, { slots }) {
|
|
261
|
+
const ctx = useHeatmapContext();
|
|
262
|
+
return () => h("div", ctx.api.value.getEmptyProps(), slots.default?.());
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
/** 标准结构里各部件对应的组件。 */
|
|
266
|
+
const HEATMAP_PARTS = {
|
|
267
|
+
"grid": XhHeatmapGrid,
|
|
268
|
+
"month-block": XhHeatmapMonthBlock,
|
|
269
|
+
"row": XhHeatmapRow,
|
|
270
|
+
"week-day": XhHeatmapWeekDay,
|
|
271
|
+
"month-label": XhHeatmapMonthLabel,
|
|
272
|
+
"row-label": XhHeatmapRowLabel,
|
|
273
|
+
"column-label": XhHeatmapColumnLabel,
|
|
274
|
+
"cell": XhHeatmapCell,
|
|
275
|
+
"tooltip": XhHeatmapTooltip,
|
|
276
|
+
"legend": XhHeatmapLegend,
|
|
277
|
+
"legend-label": XhHeatmapLegendLabel,
|
|
278
|
+
"legend-item": XhHeatmapLegendItem,
|
|
279
|
+
"empty": XhHeatmapEmpty
|
|
280
|
+
};
|
|
243
281
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* 详情条只有写了 tooltip 插槽才铺设,未写时整棵树与从前逐字一致。
|
|
282
|
+
* 未写默认插槽时铺开的整套结构,作者只提供数据:照 headless 的 heatmapStructure 渲,
|
|
283
|
+
* 与 Web Components 只写 root 时元素生成的节点出自同一份。格子、详情条与空态的内容由对应插槽接管。
|
|
247
284
|
*/
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
polarity: item.polarity ?? void 0
|
|
255
|
-
})),
|
|
256
|
-
h(XhHeatmapLegendLabel, { value: "high" }, () => api.legendText.high)
|
|
257
|
-
]);
|
|
258
|
-
const tooltip = tooltipSlot ? [h(XhHeatmapTooltip, null, () => tooltipSlot(api.activeCell))] : [];
|
|
259
|
-
if (api.matrixGrid) return [
|
|
260
|
-
...renderMatrixTree(api.matrixGrid, cellSlot),
|
|
261
|
-
...tooltip,
|
|
262
|
-
legend
|
|
263
|
-
];
|
|
264
|
-
if (api.monthGrid) return [
|
|
265
|
-
...renderMonthTree(api.monthGrid, cellSlot),
|
|
266
|
-
...tooltip,
|
|
267
|
-
legend
|
|
268
|
-
];
|
|
269
|
-
const monthRow = h(XhHeatmapRow, null, () => [h(XhHeatmapWeekDay), ...api.grid.months.map((month) => h(XhHeatmapMonthLabel, {
|
|
270
|
-
key: month.value,
|
|
271
|
-
value: month.value
|
|
272
|
-
}, () => month.label))]);
|
|
273
|
-
const weekRows = api.grid.rows.map((row) => h(XhHeatmapRow, {
|
|
274
|
-
key: row.weekDay,
|
|
275
|
-
value: row.weekDay
|
|
276
|
-
}, () => [h(XhHeatmapWeekDay, { value: row.weekDay }, () => api.grid.weekDays[row.weekDay]?.label ?? ""), ...row.cells.map((cell) => h(XhHeatmapCell, {
|
|
277
|
-
key: cell.date,
|
|
278
|
-
value: cell.date
|
|
279
|
-
}, () => cellSlot?.(cell) ?? []))]));
|
|
280
|
-
return [
|
|
281
|
-
monthRow,
|
|
282
|
-
h(XhHeatmapGrid, null, () => weekRows),
|
|
283
|
-
...tooltip,
|
|
284
|
-
legend
|
|
285
|
-
];
|
|
286
|
-
}
|
|
287
|
-
/** 月历形态:网格中一个自然月一块,块内先一条星期名坐标轴,再逐周一行。 */
|
|
288
|
-
function renderMonthTree(grid, cellSlot) {
|
|
289
|
-
const blocks = grid.blocks.map((block) => h(XhHeatmapMonthBlock, {
|
|
290
|
-
key: block.value,
|
|
291
|
-
value: block.value
|
|
292
|
-
}, () => [
|
|
293
|
-
h(XhHeatmapMonthLabel, { value: block.value }, () => block.label),
|
|
294
|
-
h(XhHeatmapRow, null, () => grid.weekDays.map((day) => h(XhHeatmapWeekDay, {
|
|
295
|
-
key: day.weekDay,
|
|
296
|
-
value: day.weekDay
|
|
297
|
-
}, () => day.label))),
|
|
298
|
-
...block.weeks.map((row) => h(XhHeatmapRow, {
|
|
299
|
-
key: row.week,
|
|
300
|
-
value: row.week
|
|
301
|
-
}, () => row.cells.map((cell) => h(XhHeatmapCell, {
|
|
302
|
-
key: cell.date,
|
|
303
|
-
value: cell.date
|
|
304
|
-
}, () => cellSlot?.(cell) ?? []))))
|
|
305
|
-
]));
|
|
306
|
-
return [h(XhHeatmapGrid, null, () => blocks)];
|
|
307
|
-
}
|
|
308
|
-
/** 矩阵形态:首行是列名,其余每行行首一个行名、其后逐列一格。 */
|
|
309
|
-
function renderMatrixTree(grid, cellSlot) {
|
|
310
|
-
const header = h(XhHeatmapRow, null, () => [h(XhHeatmapRowLabel), ...grid.columns.map((column) => h(XhHeatmapColumnLabel, {
|
|
311
|
-
key: column.value,
|
|
312
|
-
value: column.value
|
|
313
|
-
}, () => column.label))]);
|
|
314
|
-
const rows = grid.rows.map((row) => h(XhHeatmapRow, {
|
|
315
|
-
key: row.value,
|
|
316
|
-
value: row.value
|
|
317
|
-
}, () => [h(XhHeatmapRowLabel, { value: row.value }, () => row.label), ...grid.columns.map((column) => {
|
|
318
|
-
const meta = grid.cells.get(heatmapMatrixKey(row.value, column.value));
|
|
319
|
-
return h(XhHeatmapCell, {
|
|
320
|
-
key: column.value,
|
|
321
|
-
value: column.value
|
|
322
|
-
}, () => meta == null ? [] : cellSlot?.(meta) ?? []);
|
|
323
|
-
})]));
|
|
324
|
-
return [h(XhHeatmapGrid, null, () => [header, ...rows])];
|
|
285
|
+
function renderDefaultStructure(api, cellSlot, tooltipSlot, emptySlot) {
|
|
286
|
+
return renderStructure(heatmapStructure(api, { tooltip: !!tooltipSlot }), HEATMAP_PARTS, (node) => {
|
|
287
|
+
if (node.part === "cell") return node.data == null ? [] : cellSlot?.(node.data) ?? [];
|
|
288
|
+
if (node.part === "tooltip") return tooltipSlot?.(api.activeCell);
|
|
289
|
+
if (node.part === "empty") return emptySlot?.() ?? api.emptyText;
|
|
290
|
+
});
|
|
325
291
|
}
|
|
326
292
|
//#endregion
|
|
327
|
-
export { XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDay };
|
|
293
|
+
export { XhHeatmapCell, XhHeatmapColumnLabel, XhHeatmapEmpty, XhHeatmapGrid, XhHeatmapLegend, XhHeatmapLegendItem, XhHeatmapLegendLabel, XhHeatmapMonthBlock, XhHeatmapMonthLabel, XhHeatmapRoot, XhHeatmapRow, XhHeatmapRowLabel, XhHeatmapTooltip, XhHeatmapWeekDay };
|
|
328
294
|
|
|
329
295
|
//# sourceMappingURL=heatmap.js.map
|
|
@@ -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 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(Xh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,CAAC;CACF,OAAO,CAAC,EAAE,eAAe,YAAY,MAAM,CAAC;AAC9C;;AAGA,SAAS,iBAAiB,MAAyB,UAA6D;CAC9G,MAAM,SAAS,EAAE,cAAc,YAAY,CAEzC,EAAE,iBAAiB,GACnB,GAAG,KAAK,QAAQ,KAAI,WAAU,EAAE,sBAAsB;EAAE,KAAK,OAAO;EAAO,OAAO,OAAO;CAAM,SAAS,OAAO,KAAK,CAAC,CACvH,CAAC;CACD,MAAM,OAAO,KAAK,KAAK,KAAI,QAAO,EAAE,cAAc;EAAE,KAAK,IAAI;EAAO,OAAO,IAAI;CAAM,SAAS,CAC5F,EAAE,mBAAmB,EAAE,OAAO,IAAI,MAAM,SAAS,IAAI,KAAK,GAC1D,GAAG,KAAK,QAAQ,KAAK,WAAW;EAC9B,MAAM,OAAO,KAAK,MAAM,IAAI,iBAAiB,IAAI,OAAO,OAAO,KAAK,CAAC;EACrE,OAAO,EACL,eACA;GAAE,KAAK,OAAO;GAAO,OAAO,OAAO;EAAM,SAClC,QAAQ,OAAO,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,CAClD;CACF,CAAC,CACH,CAAC,CAAC;CACF,OAAO,CAAC,EAAE,eAAe,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;AACzD"}
|
|
1
|
+
{"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 HeatmapCellMeta,\n HeatmapDatumDetails,\n HeatmapLegendBound,\n HeatmapMatrixCellMeta,\n HeatmapPalette,\n HeatmapPolarity,\n HeatmapRowProps,\n HeatmapScaleMode,\n HeatmapSchema,\n HeatmapTranslations,\n HeatmapValue,\n HeatmapVariant,\n NumberFormatSpec,\n} from '@xihan-ui/headless'\nimport type { PropType, SlotsType, VNode } from 'vue'\nimport type { PayloadOf } from '../../runtime/payload'\nimport { heatmapStructure, normalizeHeatmapNumber, normalizeHeatmapString } from '@xihan-ui/headless'\nimport { computed, defineComponent, h } from 'vue'\nimport { withXhConfig } from '../../config/config'\nimport { renderStructure } from '../../runtime/structure'\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 | 'activeKey'\n | 'empty'\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 format: { type: [Object, Function] as PropType<NumberFormatSpec | ((value: number) => string)> },\n pending: { type: Boolean, default: undefined },\n activeKey: { type: [String, null] as PropType<string | null> },\n translations: { type: Object as PropType<Partial<HeatmapTranslations>> },\n },\n // 热力图不产生值:报详情、按下与激活的键落在哪一格,激活的键可双向绑定\n emits: {\n 'datum-active': (_details: PayloadOf<HeatmapProps, 'onDatumActive'>) => true,\n 'datum-press': (_details: PayloadOf<HeatmapProps, 'onDatumPress'>) => true,\n 'active-key-change': (_details: PayloadOf<HeatmapProps, 'onActiveKeyChange'>) => true,\n 'update:activeKey': (_key: PayloadOf<HeatmapProps, 'onActiveKeyChange'>['activeKey']) => true,\n },\n slots: Object as SlotsType<{\n default?: (props: HeatmapRootSlotProps) => VNode[]\n /** 铺开网格时每一格的内容插槽,默认是空格子;三种形态都铺设。 */\n cell?: (props: HeatmapCellSlotProps) => VNode[]\n /** 详情条的内容插槽;写了它才会铺设 tooltip 部件。 */\n tooltip?: (props: HeatmapDatumDetails | null) => VNode[]\n /** 缺省结构里的空态内容;未写时是空态文案。 */\n empty?: () => VNode[]\n }>,\n setup(props, { slots, emit }) {\n const ctx = useHeatmap(withXhConfig('heatmap', props) as HeatmapProps, {\n onDatumActive: details => emit('datum-active', details),\n onDatumPress: details => emit('datum-press', details),\n onActiveKeyChange: (details) => {\n emit('active-key-change', details)\n emit('update:activeKey', details.activeKey)\n },\n })\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 activeKey: api.activeKey,\n empty: api.empty,\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 : renderDefaultStructure(api, slots.cell, slots.tooltip, slots.empty),\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/** 空态:网格里一条数据都没有时叠在网格上,取数中改写加载文案。 */\nexport const XhHeatmapEmpty = defineComponent({\n name: 'XhHeatmapEmpty',\n setup(_, { slots }) {\n const ctx = useHeatmapContext()\n return () => h('div', ctx.api.value.getEmptyProps() as Record<string, unknown>, slots.default?.())\n },\n})\n\n/** 标准结构里各部件对应的组件。 */\nconst HEATMAP_PARTS = {\n 'grid': XhHeatmapGrid,\n 'month-block': XhHeatmapMonthBlock,\n 'row': XhHeatmapRow,\n 'week-day': XhHeatmapWeekDay,\n 'month-label': XhHeatmapMonthLabel,\n 'row-label': XhHeatmapRowLabel,\n 'column-label': XhHeatmapColumnLabel,\n 'cell': XhHeatmapCell,\n 'tooltip': XhHeatmapTooltip,\n 'legend': XhHeatmapLegend,\n 'legend-label': XhHeatmapLegendLabel,\n 'legend-item': XhHeatmapLegendItem,\n 'empty': XhHeatmapEmpty,\n}\n\n/**\n * 未写默认插槽时铺开的整套结构,作者只提供数据:照 headless 的 heatmapStructure 渲,\n * 与 Web Components 只写 root 时元素生成的节点出自同一份。格子、详情条与空态的内容由对应插槽接管。\n */\nfunction renderDefaultStructure(\n api: HeatmapApi,\n cellSlot?: (node: HeatmapCellSlotProps) => VNode[],\n tooltipSlot?: (details: HeatmapDatumDetails | null) => VNode[],\n emptySlot?: () => VNode[],\n): VNode[] {\n return renderStructure(heatmapStructure(api, { tooltip: !!tooltipSlot }), HEATMAP_PARTS, (node) => {\n if (node.part === 'cell')\n return node.data == null ? [] : cellSlot?.(node.data as HeatmapCellSlotProps) ?? []\n if (node.part === 'tooltip')\n return tooltipSlot?.(api.activeCell)\n if (node.part === 'empty')\n return emptySlot?.() ?? api.emptyText\n return undefined\n })\n}\n"],"mappings":";;;;;;;AA2EA,MAAa,gBA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AS,CAAC,CAAC,YAAY,CAAC,GAAG,gBAAgB,SAAS;EACjG,IAAI,KAAK,SAAS,QAChB,OAAO,KAAK,QAAQ,OAAO,CAAC,IAAI,WAAW,KAAK,IAA4B,KAAK,CAAC;EACpF,IAAI,KAAK,SAAS,WAChB,OAAO,cAAc,IAAI,UAAU;EACrC,IAAI,KAAK,SAAS,SAChB,OAAO,YAAY,KAAK,IAAI;CAEhC,CAAC;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { HeatmapApi, HeatmapSchema } from "@xihan-ui/headless";
|
|
1
2
|
import { ComputedRef, Ref } from "vue";
|
|
2
3
|
import { Service } from "@xihan-ui/core";
|
|
3
|
-
import { HeatmapApi, HeatmapSchema } from "@xihan-ui/headless";
|
|
4
4
|
//#region src/components/heatmap/use-heatmap.d.ts
|
|
5
5
|
interface HeatmapContext {
|
|
6
6
|
api: ComputedRef<HeatmapApi>;
|
|
@@ -9,7 +9,7 @@ interface HeatmapContext {
|
|
|
9
9
|
/** 根:过渡的时长与减弱动效从它读。 */
|
|
10
10
|
rootRef: Ref<HTMLElement | null>;
|
|
11
11
|
}
|
|
12
|
-
declare function useHeatmap(props: HeatmapSchema['props'],
|
|
12
|
+
declare function useHeatmap(props: HeatmapSchema['props'], callbacks?: Pick<HeatmapSchema['props'], 'onDatumActive' | 'onDatumPress' | 'onActiveKeyChange'>): HeatmapContext;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { HeatmapContext, useHeatmap };
|
|
15
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;;EAEjB,SAAS,IAAI;;iBAIC,WACd,OAAO,wBACP,
|
|
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,YAAW,KAAK,kFACf"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
2
|
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
-
import { computed, ref } from "vue";
|
|
4
3
|
import { connectHeatmap, heatmapMachine } from "@xihan-ui/headless";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
5
|
//#region src/components/heatmap/use-heatmap.ts
|
|
6
|
-
function useHeatmap(props,
|
|
6
|
+
function useHeatmap(props, callbacks = {}) {
|
|
7
7
|
const rootRef = ref(null);
|
|
8
8
|
const service = useMachine(heatmapMachine, () => ({
|
|
9
9
|
...props,
|
|
10
|
-
|
|
11
|
-
onCellActive,
|
|
12
|
-
onCellPress
|
|
10
|
+
...callbacks
|
|
13
11
|
}));
|
|
14
12
|
service.refs.set("getRootEl", () => rootRef.value);
|
|
15
13
|
return {
|
|
@@ -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, 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
|
|
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 callbacks: Pick<HeatmapSchema['props'], 'onDatumActive' | 'onDatumPress' | 'onActiveKeyChange'> = {},\n): HeatmapContext {\n const rootRef = ref<HTMLElement | null>(null)\n const service = useMachine(heatmapMachine, () => ({ ...props, ...callbacks }))\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,YAAkG,CAAC,GACnF;CAChB,MAAM,UAAU,IAAwB,IAAI;CAC5C,MAAM,UAAU,WAAW,uBAAuB;EAAE,GAAG;EAAO,GAAG;CAAU,EAAE;CAC7E,QAAQ,KAAK,IAAI,mBAAmB,QAAQ,KAAK;CAEjD,OAAO;EAAE,KADG,eAAe,eAAe,SAAS,YAAY,CACpD;EAAG;EAAS;CAAQ;AACjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
-
import { PropType, SlotsType, VNode } from "vue";
|
|
3
2
|
import { ChartDatumDetails, ChartKey, ChartPalette, ChartRow, HierarchyChartApi, HierarchyChartSchema, HierarchyChartTranslations, HierarchyColorBy, HierarchyLayout, HierarchyTile, HierarchyTooltipModel, NumberFormatSpec } from "@xihan-ui/headless";
|
|
3
|
+
import { PropType, SlotsType, VNode } from "vue";
|
|
4
4
|
//#region src/components/hierarchy-chart/hierarchy-chart.d.ts
|
|
5
5
|
type HierarchyChartProps = HierarchyChartSchema['props'];
|
|
6
6
|
/** 默认插槽的载荷:自行摆放部件时用得上的状态与动作。 */
|
|
@@ -177,15 +177,15 @@ declare const XhHierarchyChartRoot: import("vue").DefineComponent<import("vue").
|
|
|
177
177
|
type: PropType<Partial<HierarchyChartTranslations>>;
|
|
178
178
|
};
|
|
179
179
|
}>> & Readonly<{
|
|
180
|
-
"onActive-key-change"?: ((_details: import("@xihan-ui/headless").ChartActiveKeyChangeDetails) => any) | undefined;
|
|
181
|
-
"onUpdate:activeKey"?: ((_key: ChartKey | null) => any) | undefined;
|
|
182
180
|
"onDatum-active"?: ((_details: ChartDatumDetails | null) => any) | undefined;
|
|
183
181
|
"onDatum-press"?: ((_details: ChartDatumDetails) => any) | undefined;
|
|
182
|
+
"onActive-key-change"?: ((_details: import("@xihan-ui/headless").ChartActiveKeyChangeDetails) => any) | undefined;
|
|
183
|
+
"onUpdate:activeKey"?: ((_key: ChartKey | null) => any) | undefined;
|
|
184
184
|
"onRoot-key-change"?: ((_details: import("@xihan-ui/headless").HierarchyRootKeyChangeDetails) => any) | undefined;
|
|
185
185
|
"onUpdate:rootKey"?: ((_key: string | null) => any) | undefined;
|
|
186
186
|
}>, {
|
|
187
|
-
pending: boolean;
|
|
188
187
|
animated: boolean;
|
|
188
|
+
pending: boolean;
|
|
189
189
|
}, SlotsType<{
|
|
190
190
|
/** 自行摆放部件;不写时铺开缺省结构:下钻路径、视口(绘图区与空态)、提示框。 */
|
|
191
191
|
default?: (props: HierarchyChartRootSlotProps) => VNode[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { HierarchyChartApi, HierarchyChartSchema } from "@xihan-ui/headless";
|
|
1
2
|
import { ComputedRef, Ref } from "vue";
|
|
2
3
|
import { Service } from "@xihan-ui/core";
|
|
3
|
-
import { HierarchyChartApi, HierarchyChartSchema } from "@xihan-ui/headless";
|
|
4
4
|
//#region src/components/hierarchy-chart/use-hierarchy-chart.d.ts
|
|
5
5
|
/** 对外的回调:由外壳(emit)或组合式调用方提供,随 props 一并喂给机器。 */
|
|
6
6
|
type HierarchyChartNotifiers = Pick<HierarchyChartSchema['props'], 'onRootKeyChange' | 'onActiveKeyChange' | 'onDatumActive' | 'onDatumPress'>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
2
|
import { useMachine } from "../../runtime/use-machine.js";
|
|
3
|
-
import { computed, ref } from "vue";
|
|
4
3
|
import { connectHierarchyChart, hierarchyChartMachine } from "@xihan-ui/headless";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
5
|
//#region src/components/hierarchy-chart/use-hierarchy-chart.ts
|
|
6
6
|
/** 量测、度量与文字度量器都在状态机的效应里做,DOM 取值口经 refs 交入。 */
|
|
7
7
|
function useHierarchyChart(props, notify) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vueNormalize } from "../../runtime/normalize-props.js";
|
|
2
|
-
import { computed, defineComponent, h } from "vue";
|
|
3
2
|
import { connectHighlight } from "@xihan-ui/headless";
|
|
3
|
+
import { computed, defineComponent, h } from "vue";
|
|
4
4
|
//#region src/components/highlight/highlight.ts
|
|
5
5
|
/**
|
|
6
6
|
* 把 text 按 keyword 切段铺进一个 `<span>`:命中的片段渲染为 `<mark>`,其余是纯文本节点。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PayloadOf } from "../../runtime/payload.js";
|
|
2
|
+
import { HoverCardApi, HoverCardSchema } from "@xihan-ui/headless";
|
|
2
3
|
import { PropType, SlotsType, VNode } from "vue";
|
|
3
4
|
import { Direction, Placement, Size } from "@xihan-ui/core";
|
|
4
|
-
import { HoverCardApi, HoverCardSchema } from "@xihan-ui/headless";
|
|
5
5
|
//#region src/components/hover-card/hover-card.d.ts
|
|
6
6
|
type HoverCardProps = HoverCardSchema['props'];
|
|
7
7
|
/** 默认插槽的载荷:浮层的开合状态与程序化开合的方法。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","names":[],"sources":["../../../src/components/hover-card/hover-card.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","names":[],"sources":["../../../src/components/hover-card/hover-card.ts"],"mappings":";;;;;KAoBK,iBAAiB;;KAGV,yBAAyB,KAAK;cAE7B,+BAAe,8BAAA;;;;;;;IAMK,MAAA,SAAS;;;;;;;;;;;;IAIf,MAAA,SAAS;;;;IAER,MAAA,SAAS;;;;;EAIP,gBAAA,UAAA,UAAU;EACb,gBAAA,OAAA,UAAU;;;;;;;;IAXJ,MAAA,SAAS;;;;;;;;;;;;IAIf,MAAA,SAAS;;;;IAER,MAAA,SAAS;;;;;;;;;;EAQvB,WAAC,OAAO,2BAA2B;kCAc/C;cAEW,kCAAkB,8BAAA;;;;;;;;;;qCAyB7B;cAEW,qCAAqB,8BAAA;;;IAID,MAAA,SAAS;;;;;;;IAAT,MAAA,SAAS;;MAgBxC,oDAAA;cAEW,kCAAkB,0BAAA,oBAAA,4BAAA;;8BAY7B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,gCAAgB,0BAAA,oBAAA,4BAAA;;8BAO3B,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,sCAAsB,0BAAA,oBAAA,4BAAA;;8BAQjC,qCAAA,iDAAA,aAAA,eAAA,oDAAA;cAEW,gCAAgB,0BAAA,oBAAA,4BAAA;;8BAM3B,qCAAA,iDAAA,aAAA,eAAA,oDAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDescriptionPart, useTitleDescriptionPart } from "../../runtime/title-description.js";
|
|
1
2
|
import { mergePartProps } from "../../runtime/merge-props.js";
|
|
2
3
|
import { mergeIntoChild } from "../../runtime/as-child.js";
|
|
3
4
|
import { XhPortal } from "../../runtime/portal.js";
|
|
@@ -105,23 +106,18 @@ const XhHoverCardTitle = defineComponent({
|
|
|
105
106
|
name: "XhHoverCardTitle",
|
|
106
107
|
setup(_, { slots }) {
|
|
107
108
|
const ctx = useHoverCardContext();
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
ref: (el) => {
|
|
111
|
-
ctx.titleRef.value = el;
|
|
112
|
-
}
|
|
113
|
-
}, slots.default?.());
|
|
109
|
+
useTitleDescriptionPart(ctx.presence, "title");
|
|
110
|
+
return () => h("h2", ctx.api.value.getTitleProps(), slots.default?.());
|
|
114
111
|
}
|
|
115
112
|
});
|
|
116
113
|
const XhHoverCardDescription = defineComponent({
|
|
117
114
|
name: "XhHoverCardDescription",
|
|
118
115
|
setup(_, { slots }) {
|
|
119
116
|
const ctx = useHoverCardContext();
|
|
117
|
+
const el = useDescriptionPart(ctx.presence);
|
|
120
118
|
return () => h("p", {
|
|
121
119
|
...ctx.api.value.getDescriptionProps(),
|
|
122
|
-
ref:
|
|
123
|
-
ctx.descriptionRef.value = el;
|
|
124
|
-
}
|
|
120
|
+
ref: el
|
|
125
121
|
}, slots.default?.());
|
|
126
122
|
}
|
|
127
123
|
});
|