hys-ui 0.1.0 → 0.2.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 +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
export type HysTreeKey = string | number;
|
|
3
|
+
export type HysTreeValue = HysTreeKey | readonly HysTreeKey[] | null;
|
|
4
|
+
export interface HysTreeNode<K extends HysTreeKey = HysTreeKey> {
|
|
5
|
+
id: K;
|
|
6
|
+
label: string;
|
|
7
|
+
children?: HysTreeNode<K>[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
disableCheckbox?: boolean;
|
|
10
|
+
selectable?: boolean;
|
|
11
|
+
checkable?: boolean;
|
|
12
|
+
icon?: string;
|
|
13
|
+
hasChildren?: boolean;
|
|
14
|
+
isLeaf?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Existing string-key node type remains available. */
|
|
18
|
+
export type TreeNode = HysTreeNode<string>;
|
|
19
|
+
export type HysTreeDropPosition = "before" | "inside" | "after";
|
|
20
|
+
export interface HysTreeFieldNames {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
children: string;
|
|
24
|
+
disabled: string;
|
|
25
|
+
disableCheckbox: string;
|
|
26
|
+
selectable: string;
|
|
27
|
+
checkable: string;
|
|
28
|
+
icon: string;
|
|
29
|
+
hasChildren: string;
|
|
30
|
+
isLeaf: string;
|
|
31
|
+
}
|
|
32
|
+
export interface HysTreeLoadContext {
|
|
33
|
+
signal: AbortSignal;
|
|
34
|
+
key: HysTreeKey;
|
|
35
|
+
}
|
|
36
|
+
export interface HysTreeLocale {
|
|
37
|
+
search: string;
|
|
38
|
+
empty: string;
|
|
39
|
+
noMatch: string;
|
|
40
|
+
loading: string;
|
|
41
|
+
retry: string;
|
|
42
|
+
loadError: string;
|
|
43
|
+
expand: string;
|
|
44
|
+
collapse: string;
|
|
45
|
+
check: string;
|
|
46
|
+
select: string;
|
|
47
|
+
clear: string;
|
|
48
|
+
close: string;
|
|
49
|
+
tree: string;
|
|
50
|
+
}
|
|
51
|
+
export interface HysTreeRecord<N extends object> {
|
|
52
|
+
key: HysTreeKey;
|
|
53
|
+
node: N;
|
|
54
|
+
label: string;
|
|
55
|
+
parent?: HysTreeKey;
|
|
56
|
+
children: HysTreeKey[];
|
|
57
|
+
depth: number;
|
|
58
|
+
index: number;
|
|
59
|
+
pos: number;
|
|
60
|
+
size: number;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
checkboxDisabled: boolean;
|
|
63
|
+
selectable: boolean;
|
|
64
|
+
checkable: boolean;
|
|
65
|
+
leaf: boolean;
|
|
66
|
+
hasChildren: boolean;
|
|
67
|
+
icon: unknown;
|
|
68
|
+
}
|
|
69
|
+
export interface HysTreeCheckInfo<N extends object> {
|
|
70
|
+
node?: N;
|
|
71
|
+
checked?: boolean;
|
|
72
|
+
checkedKeys: HysTreeKey[];
|
|
73
|
+
checkedNodes: N[];
|
|
74
|
+
halfCheckedKeys: HysTreeKey[];
|
|
75
|
+
halfCheckedNodes: N[];
|
|
76
|
+
event?: Event;
|
|
77
|
+
}
|
|
78
|
+
export interface HysTreeSelectInfo<N extends object> {
|
|
79
|
+
node: N | null;
|
|
80
|
+
selected: boolean;
|
|
81
|
+
selectedKeys: HysTreeKey[];
|
|
82
|
+
selectedNodes: N[];
|
|
83
|
+
event?: Event;
|
|
84
|
+
}
|
|
85
|
+
export interface HysTreeDropInfo<N extends object, K extends HysTreeKey = HysTreeKey> {
|
|
86
|
+
dragId: K;
|
|
87
|
+
targetId: K;
|
|
88
|
+
position: HysTreeDropPosition;
|
|
89
|
+
dragNode: N;
|
|
90
|
+
targetNode: N;
|
|
91
|
+
event: DragEvent;
|
|
92
|
+
}
|
|
93
|
+
export interface HysTreeNodeContext<N extends object> {
|
|
94
|
+
node: N;
|
|
95
|
+
key: HysTreeKey;
|
|
96
|
+
label: string;
|
|
97
|
+
depth: number;
|
|
98
|
+
expanded: boolean;
|
|
99
|
+
selected: boolean;
|
|
100
|
+
checked: boolean;
|
|
101
|
+
indeterminate: boolean;
|
|
102
|
+
disabled: boolean;
|
|
103
|
+
loading: boolean;
|
|
104
|
+
leaf: boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface HysTreeProps<N extends object = TreeNode, V extends HysTreeValue = HysTreeValue> {
|
|
107
|
+
nodes: readonly N[];
|
|
108
|
+
modelValue?: V;
|
|
109
|
+
defaultValue?: V;
|
|
110
|
+
checkedKeys?: readonly HysTreeKey[];
|
|
111
|
+
defaultCheckedKeys?: readonly HysTreeKey[];
|
|
112
|
+
halfCheckedKeys?: readonly HysTreeKey[];
|
|
113
|
+
expandedKeys?: readonly HysTreeKey[];
|
|
114
|
+
defaultExpandedKeys?: readonly HysTreeKey[];
|
|
115
|
+
loadedKeys?: readonly HysTreeKey[];
|
|
116
|
+
multiple?: boolean;
|
|
117
|
+
selectable?: boolean;
|
|
118
|
+
checkable?: boolean;
|
|
119
|
+
searchable?: boolean;
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
inheritDisabled?: boolean;
|
|
122
|
+
loading?: boolean;
|
|
123
|
+
size?: "sm" | "md" | "lg";
|
|
124
|
+
defaultExpandAll?: boolean;
|
|
125
|
+
autoExpandParent?: boolean;
|
|
126
|
+
accordion?: boolean;
|
|
127
|
+
expandOnClickNode?: boolean;
|
|
128
|
+
expandOnDoubleClick?: boolean;
|
|
129
|
+
checkOnClickNode?: boolean;
|
|
130
|
+
checkOnClickLeaf?: boolean;
|
|
131
|
+
selectOnClickNode?: boolean;
|
|
132
|
+
allowDeselect?: boolean;
|
|
133
|
+
highlightCurrent?: boolean;
|
|
134
|
+
fieldNames?: Partial<HysTreeFieldNames>;
|
|
135
|
+
nodeKey?: string | ((node: N) => HysTreeKey);
|
|
136
|
+
showLine?: boolean;
|
|
137
|
+
showIcon?: boolean;
|
|
138
|
+
indent?: number;
|
|
139
|
+
blockNode?: boolean;
|
|
140
|
+
virtual?: boolean;
|
|
141
|
+
rowHeight?: number;
|
|
142
|
+
viewportHeight?: number;
|
|
143
|
+
overscan?: number;
|
|
144
|
+
draggable?: boolean;
|
|
145
|
+
dragExpandDelay?: number;
|
|
146
|
+
allowDrag?: (node: N) => boolean;
|
|
147
|
+
allowDrop?: (drag: N, target: N, position: HysTreeDropPosition) => boolean;
|
|
148
|
+
contextMenu?: boolean;
|
|
149
|
+
checkStrictly?: boolean;
|
|
150
|
+
searchValue?: string;
|
|
151
|
+
defaultSearchValue?: string;
|
|
152
|
+
searchPlaceholder?: string;
|
|
153
|
+
filterNode?: (query: string, node: N) => boolean;
|
|
154
|
+
filterMode?: "hide" | "highlight";
|
|
155
|
+
showMatchedChildren?: boolean;
|
|
156
|
+
emptyText?: string;
|
|
157
|
+
ariaLabel?: string;
|
|
158
|
+
locale?: Partial<HysTreeLocale>;
|
|
159
|
+
loadChildren?: (node: N, context: HysTreeLoadContext) => Promise<readonly N[]>;
|
|
160
|
+
renderContent?: (context: HysTreeNodeContext<N>) => VNodeChild;
|
|
161
|
+
nodeClass?: string | ((node: N) => string | undefined);
|
|
162
|
+
nodeStyle?: CSSProperties | ((node: N) => CSSProperties | undefined);
|
|
163
|
+
validateEvent?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface HysTreeInstance<N extends object = TreeNode> {
|
|
166
|
+
readonly element: HTMLElement | undefined;
|
|
167
|
+
getNode: (key: HysTreeKey | N) => N | undefined;
|
|
168
|
+
getNodeInfo: (key: HysTreeKey | N) => HysTreeRecord<N> | undefined;
|
|
169
|
+
getCheckedKeys: (leafOnly?: boolean) => HysTreeKey[];
|
|
170
|
+
getCheckedNodes: (leafOnly?: boolean, includeHalfChecked?: boolean) => N[];
|
|
171
|
+
getHalfCheckedKeys: () => HysTreeKey[];
|
|
172
|
+
getHalfCheckedNodes: () => N[];
|
|
173
|
+
setCheckedKeys: (keys: readonly HysTreeKey[], leafOnly?: boolean) => Promise<boolean>;
|
|
174
|
+
setCheckedNodes: (nodes: readonly N[], leafOnly?: boolean) => Promise<boolean>;
|
|
175
|
+
setChecked: (key: HysTreeKey | N, checked: boolean, deep?: boolean) => Promise<boolean>;
|
|
176
|
+
getCurrentKey: () => HysTreeKey | null;
|
|
177
|
+
getCurrentNode: () => N | null;
|
|
178
|
+
getSelectedKeys: () => HysTreeKey[];
|
|
179
|
+
setCurrentKey: (key: HysTreeKey | null, expandParents?: boolean) => Promise<boolean>;
|
|
180
|
+
setCurrentNode: (node: N | null, expandParents?: boolean) => Promise<boolean>;
|
|
181
|
+
setSelectedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
182
|
+
getExpandedKeys: () => HysTreeKey[];
|
|
183
|
+
setExpandedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
184
|
+
expandNode: (key: HysTreeKey, expanded?: boolean) => Promise<boolean>;
|
|
185
|
+
expandAll: () => Promise<boolean>;
|
|
186
|
+
collapseAll: () => Promise<boolean>;
|
|
187
|
+
filter: (value: string) => void;
|
|
188
|
+
reloadNode: (key: HysTreeKey) => Promise<boolean>;
|
|
189
|
+
updateKeyChildren: (key: HysTreeKey, children: readonly N[]) => Promise<boolean>;
|
|
190
|
+
append: (node: N, parent?: HysTreeKey | N) => Promise<boolean>;
|
|
191
|
+
insertBefore: (node: N, reference: HysTreeKey | N) => Promise<boolean>;
|
|
192
|
+
insertAfter: (node: N, reference: HysTreeKey | N) => Promise<boolean>;
|
|
193
|
+
remove: (key: HysTreeKey | N) => Promise<boolean>;
|
|
194
|
+
scrollTo: (options: {
|
|
195
|
+
key?: HysTreeKey;
|
|
196
|
+
top?: number;
|
|
197
|
+
align?: "top" | "bottom" | "auto";
|
|
198
|
+
offset?: number;
|
|
199
|
+
behavior?: ScrollBehavior;
|
|
200
|
+
}) => Promise<void>;
|
|
201
|
+
focus: (key?: HysTreeKey) => Promise<void>;
|
|
202
|
+
}
|
|
203
|
+
export declare const treeLocale: HysTreeLocale;
|
|
204
|
+
export declare const treeKey: (v: unknown) => v is HysTreeKey;
|
|
205
|
+
export declare const treeKeys: (v: readonly HysTreeKey[]) => HysTreeKey[];
|
|
206
|
+
export declare function treeField(value: unknown, path: string): unknown;
|
|
207
|
+
export declare function treeAssign<N extends object>(node: N, path: string, value: unknown): N;
|
|
208
|
+
export declare function treeFields<N extends object>(props: HysTreeProps<N>): {
|
|
209
|
+
id: string;
|
|
210
|
+
label: string;
|
|
211
|
+
children: string;
|
|
212
|
+
disabled: string;
|
|
213
|
+
disableCheckbox: string;
|
|
214
|
+
selectable: string;
|
|
215
|
+
checkable: string;
|
|
216
|
+
icon: string;
|
|
217
|
+
hasChildren: string;
|
|
218
|
+
isLeaf: string;
|
|
219
|
+
};
|
|
220
|
+
export declare function treeIndex<N extends object>(nodes: readonly N[], props: HysTreeProps<N>, asyncChildren?: Map<HysTreeKey, readonly N[]>): {
|
|
221
|
+
map: Map<HysTreeKey, HysTreeRecord<N>>;
|
|
222
|
+
rows: HysTreeRecord<N>[];
|
|
223
|
+
roots: HysTreeKey[];
|
|
224
|
+
fields: {
|
|
225
|
+
id: string;
|
|
226
|
+
label: string;
|
|
227
|
+
children: string;
|
|
228
|
+
disabled: string;
|
|
229
|
+
disableCheckbox: string;
|
|
230
|
+
selectable: string;
|
|
231
|
+
checkable: string;
|
|
232
|
+
icon: string;
|
|
233
|
+
hasChildren: string;
|
|
234
|
+
isLeaf: string;
|
|
235
|
+
};
|
|
236
|
+
invalid: boolean;
|
|
237
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
import { type HysTreeKey, type HysTreeFieldNames, type HysTreeLoadContext, type HysTreeLocale } from "./tree";
|
|
3
|
+
import type { Placement } from "./useFloating";
|
|
4
|
+
export interface HysTreeSelectDataNode<K extends HysTreeKey = HysTreeKey> {
|
|
5
|
+
value: K;
|
|
6
|
+
label: string;
|
|
7
|
+
children?: HysTreeSelectDataNode<K>[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
disableCheckbox?: boolean;
|
|
10
|
+
checkable?: boolean;
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
hasChildren?: boolean;
|
|
13
|
+
isLeaf?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type HysTreeSelectNode = HysTreeSelectDataNode<string>;
|
|
16
|
+
export interface HysTreeSelectLabelValue {
|
|
17
|
+
value: HysTreeKey;
|
|
18
|
+
label?: VNodeChild;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type HysTreeSelectValue = HysTreeKey | HysTreeSelectLabelValue | readonly (HysTreeKey | HysTreeSelectLabelValue)[] | null;
|
|
22
|
+
export interface HysTreeSelectFieldNames extends Omit<HysTreeFieldNames, "id"> {
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HysTreeSelectSimpleMode {
|
|
26
|
+
id?: string;
|
|
27
|
+
parentId?: string;
|
|
28
|
+
rootParentId?: HysTreeKey | null;
|
|
29
|
+
}
|
|
30
|
+
export type HysTreeSelectStrategy = "all" | "parent" | "child";
|
|
31
|
+
export interface HysTreeSelectItem<N extends object = HysTreeSelectNode> {
|
|
32
|
+
value: HysTreeKey;
|
|
33
|
+
label: VNodeChild;
|
|
34
|
+
node?: N;
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
missing: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface HysTreeSelectChange<N extends object = HysTreeSelectNode> {
|
|
39
|
+
reason: "select" | "check" | "remove" | "clear" | "api";
|
|
40
|
+
node?: N;
|
|
41
|
+
values: HysTreeKey[];
|
|
42
|
+
items: HysTreeSelectItem<N>[];
|
|
43
|
+
halfCheckedKeys: HysTreeKey[];
|
|
44
|
+
event?: Event;
|
|
45
|
+
}
|
|
46
|
+
export interface HysTreeSelectProps<N extends object = HysTreeSelectNode, V extends HysTreeSelectValue = HysTreeSelectValue> {
|
|
47
|
+
modelValue?: V;
|
|
48
|
+
defaultValue?: V;
|
|
49
|
+
nodes: readonly N[];
|
|
50
|
+
cacheData?: readonly N[];
|
|
51
|
+
fieldNames?: Partial<HysTreeSelectFieldNames>;
|
|
52
|
+
nodeKey?: string | ((node: N) => HysTreeKey);
|
|
53
|
+
simpleMode?: boolean | HysTreeSelectSimpleMode;
|
|
54
|
+
labelInValue?: boolean;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
readonly?: boolean;
|
|
57
|
+
loading?: boolean;
|
|
58
|
+
size?: "sm" | "md" | "lg";
|
|
59
|
+
status?: "error" | "warning" | "success";
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
ariaLabel?: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
multiple?: boolean;
|
|
64
|
+
leafOnly?: boolean;
|
|
65
|
+
checkable?: boolean;
|
|
66
|
+
checkStrictly?: boolean;
|
|
67
|
+
showCheckedStrategy?: HysTreeSelectStrategy;
|
|
68
|
+
clearable?: boolean;
|
|
69
|
+
clearValue?: HysTreeKey | null;
|
|
70
|
+
removable?: boolean;
|
|
71
|
+
multipleLimit?: number;
|
|
72
|
+
maxTagCount?: number;
|
|
73
|
+
maxTagTextLength?: number;
|
|
74
|
+
searchable?: boolean;
|
|
75
|
+
searchValue?: string;
|
|
76
|
+
defaultSearchValue?: string;
|
|
77
|
+
searchPlaceholder?: string;
|
|
78
|
+
filterNode?: (query: string, node: N) => boolean;
|
|
79
|
+
filterMode?: "hide" | "highlight";
|
|
80
|
+
showMatchedChildren?: boolean;
|
|
81
|
+
retainSearch?: boolean;
|
|
82
|
+
clearSearchAfterSelect?: boolean;
|
|
83
|
+
remote?: boolean;
|
|
84
|
+
remoteMethod?: (query: string, context: {
|
|
85
|
+
signal: AbortSignal;
|
|
86
|
+
}) => void | readonly N[] | Promise<void | readonly N[]>;
|
|
87
|
+
debounce?: number;
|
|
88
|
+
expandedKeys?: readonly HysTreeKey[];
|
|
89
|
+
defaultExpandedKeys?: readonly HysTreeKey[];
|
|
90
|
+
defaultExpandAll?: boolean;
|
|
91
|
+
autoExpandParent?: boolean;
|
|
92
|
+
accordion?: boolean;
|
|
93
|
+
expandOnClickNode?: boolean;
|
|
94
|
+
expandSelected?: boolean;
|
|
95
|
+
loadedKeys?: readonly HysTreeKey[];
|
|
96
|
+
loadChildren?: (node: N, context: HysTreeLoadContext) => Promise<readonly N[]>;
|
|
97
|
+
showLine?: boolean;
|
|
98
|
+
showIcon?: boolean;
|
|
99
|
+
indent?: number;
|
|
100
|
+
open?: boolean;
|
|
101
|
+
defaultOpen?: boolean;
|
|
102
|
+
showOnFocus?: boolean;
|
|
103
|
+
popupMatchWidth?: boolean;
|
|
104
|
+
popupWidth?: number | string;
|
|
105
|
+
popupClass?: string;
|
|
106
|
+
popupStyle?: CSSProperties;
|
|
107
|
+
appendTo?: string | HTMLElement | false;
|
|
108
|
+
placement?: Placement;
|
|
109
|
+
listHeight?: number;
|
|
110
|
+
virtual?: boolean;
|
|
111
|
+
itemHeight?: number;
|
|
112
|
+
overscan?: number;
|
|
113
|
+
emptyText?: string;
|
|
114
|
+
noMatchText?: string;
|
|
115
|
+
loadingText?: string;
|
|
116
|
+
locale?: Partial<HysTreeLocale>;
|
|
117
|
+
validateEvent?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface HysTreeSelectInstance<N extends object = HysTreeSelectNode> {
|
|
120
|
+
readonly element: HTMLElement | undefined;
|
|
121
|
+
readonly open: boolean;
|
|
122
|
+
focus: () => void;
|
|
123
|
+
blur: () => void;
|
|
124
|
+
show: () => Promise<boolean>;
|
|
125
|
+
hide: (restoreFocus?: boolean) => void;
|
|
126
|
+
clear: () => Promise<boolean>;
|
|
127
|
+
removeTag: (key: HysTreeKey) => Promise<boolean>;
|
|
128
|
+
setValue: (value: HysTreeSelectValue) => Promise<boolean>;
|
|
129
|
+
filter: (query: string) => void;
|
|
130
|
+
getSelectedKeys: () => HysTreeKey[];
|
|
131
|
+
getSelectedItems: () => HysTreeSelectItem<N>[];
|
|
132
|
+
getCheckedKeys: (leafOnly?: boolean) => HysTreeKey[];
|
|
133
|
+
getHalfCheckedKeys: () => HysTreeKey[];
|
|
134
|
+
getNode: (key: HysTreeKey) => N | undefined;
|
|
135
|
+
getExpandedKeys: () => HysTreeKey[];
|
|
136
|
+
setExpandedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
137
|
+
expandNode: (key: HysTreeKey, expanded?: boolean) => Promise<boolean>;
|
|
138
|
+
reloadNode: (key: HysTreeKey) => Promise<boolean>;
|
|
139
|
+
scrollTo: (options: {
|
|
140
|
+
key?: HysTreeKey;
|
|
141
|
+
top?: number;
|
|
142
|
+
align?: "top" | "bottom" | "auto";
|
|
143
|
+
}) => Promise<void>;
|
|
144
|
+
}
|
|
145
|
+
export declare function treeSelectFields<N extends object>(props: HysTreeSelectProps<N>): Partial<HysTreeFieldNames>;
|
|
146
|
+
export declare function treeSelectForest<N extends object>(nodes: readonly N[], props: HysTreeSelectProps<N>): {
|
|
147
|
+
nodes: readonly N[];
|
|
148
|
+
raw: Map<HysTreeKey, N>;
|
|
149
|
+
};
|
|
150
|
+
export declare const selectTreeIndex: <N extends object>(nodes: readonly N[], props: HysTreeSelectProps<N>) => {
|
|
151
|
+
map: Map<HysTreeKey, import("./tree").HysTreeRecord<N>>;
|
|
152
|
+
rows: import("./tree").HysTreeRecord<N>[];
|
|
153
|
+
roots: HysTreeKey[];
|
|
154
|
+
fields: {
|
|
155
|
+
id: string;
|
|
156
|
+
label: string;
|
|
157
|
+
children: string;
|
|
158
|
+
disabled: string;
|
|
159
|
+
disableCheckbox: string;
|
|
160
|
+
selectable: string;
|
|
161
|
+
checkable: string;
|
|
162
|
+
icon: string;
|
|
163
|
+
hasChildren: string;
|
|
164
|
+
isLeaf: string;
|
|
165
|
+
};
|
|
166
|
+
invalid: boolean;
|
|
167
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
import { type HysTreeKey, type HysTreeRecord } from "./tree";
|
|
3
|
+
import type { HysTreeSelectValue } from "./treeSelect";
|
|
4
|
+
import { type CascaderEntry, type HysCascaderProps, type HysCascaderValue, type HysCascaderKey, type HysCascaderPath, type HysCascaderItem } from "./cascader";
|
|
5
|
+
export declare function useCascader<N extends object>(props: HysCascaderProps<N>, disabled: ComputedRef<boolean>, active: ComputedRef<boolean>, emit: (name: string, ...args: any[]) => void, validate: () => void): {
|
|
6
|
+
engine: {
|
|
7
|
+
tree: {
|
|
8
|
+
live: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
busy: ComputedRef<boolean>;
|
|
10
|
+
index: ComputedRef<{
|
|
11
|
+
map: Map<HysTreeKey, HysTreeRecord<CascaderEntry<N>>>;
|
|
12
|
+
rows: HysTreeRecord<CascaderEntry<N>>[];
|
|
13
|
+
roots: HysTreeKey[];
|
|
14
|
+
fields: {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
children: string;
|
|
18
|
+
disabled: string;
|
|
19
|
+
disableCheckbox: string;
|
|
20
|
+
selectable: string;
|
|
21
|
+
checkable: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
hasChildren: string;
|
|
24
|
+
isLeaf: string;
|
|
25
|
+
};
|
|
26
|
+
invalid: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
words: ComputedRef<{
|
|
29
|
+
search: string;
|
|
30
|
+
empty: string;
|
|
31
|
+
noMatch: string;
|
|
32
|
+
loading: string;
|
|
33
|
+
retry: string;
|
|
34
|
+
loadError: string;
|
|
35
|
+
expand: string;
|
|
36
|
+
collapse: string;
|
|
37
|
+
check: string;
|
|
38
|
+
select: string;
|
|
39
|
+
clear: string;
|
|
40
|
+
close: string;
|
|
41
|
+
tree: string;
|
|
42
|
+
}>;
|
|
43
|
+
query: ComputedRef<string>;
|
|
44
|
+
expanded: ComputedRef<Set<HysTreeKey>>;
|
|
45
|
+
rawExpanded: ComputedRef<HysTreeKey[]>;
|
|
46
|
+
selected: ComputedRef<HysTreeKey[]>;
|
|
47
|
+
selection: ComputedRef<Set<HysTreeKey>>;
|
|
48
|
+
multiple: ComputedRef<boolean>;
|
|
49
|
+
visible: ComputedRef<HysTreeRecord<CascaderEntry<N>>[]>;
|
|
50
|
+
matches: ComputedRef<Set<HysTreeKey>>;
|
|
51
|
+
checked: ComputedRef<Set<HysTreeKey>>;
|
|
52
|
+
halfChecked: ComputedRef<Set<HysTreeKey>>;
|
|
53
|
+
loadingKeys: import("vue").ShallowRef<Set<HysTreeKey>, Set<HysTreeKey>>;
|
|
54
|
+
failures: import("vue").ShallowRef<Map<HysTreeKey, unknown>, Map<HysTreeKey, unknown>>;
|
|
55
|
+
ancestors: (key: HysTreeKey) => HysTreeKey[];
|
|
56
|
+
getNode: (key: HysTreeKey | CascaderEntry<N>) => CascaderEntry<N> | undefined;
|
|
57
|
+
getNodeInfo: (key: HysTreeKey | CascaderEntry<N>) => HysTreeRecord<CascaderEntry<N>> | undefined;
|
|
58
|
+
getCheckedKeys: (leafOnly?: boolean) => HysTreeKey[];
|
|
59
|
+
getCheckedNodes: (leafOnly?: boolean, includeHalf?: boolean) => CascaderEntry<N>[];
|
|
60
|
+
getHalfCheckedKeys: () => HysTreeKey[];
|
|
61
|
+
checkInfo: (node?: CascaderEntry<N> | undefined, on?: boolean, event?: Event) => import("./tree").HysTreeCheckInfo<CascaderEntry<N>>;
|
|
62
|
+
setCheckedKeys: (keys: readonly HysTreeKey[], leafOnly?: boolean) => Promise<boolean>;
|
|
63
|
+
setChecked: (key: HysTreeKey | CascaderEntry<N>, on: boolean, deep?: boolean, event?: Event) => Promise<boolean>;
|
|
64
|
+
selectNode: (row: HysTreeRecord<CascaderEntry<N>>, event?: Event) => Promise<boolean>;
|
|
65
|
+
setSelectedKeys: (keys: readonly HysTreeKey[], node?: CascaderEntry<N> | null, event?: Event) => Promise<boolean>;
|
|
66
|
+
setCurrentKey: (key: HysTreeKey | null, expandParents?: boolean) => Promise<boolean>;
|
|
67
|
+
getCurrentKey: () => HysTreeKey;
|
|
68
|
+
getCurrentNode: () => CascaderEntry<N> | null;
|
|
69
|
+
setExpandedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
70
|
+
expandNode: (key: HysTreeKey, on?: boolean) => Promise<boolean>;
|
|
71
|
+
filter: (q: string) => void;
|
|
72
|
+
reloadNode: (key: HysTreeKey) => Promise<boolean>;
|
|
73
|
+
load: (key: HysTreeKey, force?: boolean) => Promise<boolean>;
|
|
74
|
+
append: (node: CascaderEntry<N>, parent?: HysTreeKey | CascaderEntry<N> | undefined) => Promise<boolean>;
|
|
75
|
+
remove: (key: HysTreeKey | CascaderEntry<N>) => Promise<boolean>;
|
|
76
|
+
insertBefore: (node: CascaderEntry<N>, key: HysTreeKey | CascaderEntry<N>) => Promise<boolean>;
|
|
77
|
+
insertAfter: (node: CascaderEntry<N>, key: HysTreeKey | CascaderEntry<N>) => Promise<boolean>;
|
|
78
|
+
updateKeyChildren: (key: HysTreeKey, children: readonly CascaderEntry<N>[]) => Promise<boolean>;
|
|
79
|
+
};
|
|
80
|
+
live: import("vue").Ref<boolean, boolean>;
|
|
81
|
+
current: ComputedRef<HysTreeSelectValue>;
|
|
82
|
+
values: ComputedRef<HysTreeKey[]>;
|
|
83
|
+
multiple: ComputedRef<boolean>;
|
|
84
|
+
query: ComputedRef<string>;
|
|
85
|
+
items: ComputedRef<import("./treeSelect").HysTreeSelectItem<CascaderEntry<N>>[]>;
|
|
86
|
+
displayKeys: ComputedRef<HysTreeKey[]>;
|
|
87
|
+
busy: ComputedRef<boolean>;
|
|
88
|
+
blocked: ComputedRef<boolean>;
|
|
89
|
+
words: ComputedRef<{
|
|
90
|
+
search: string;
|
|
91
|
+
empty: string;
|
|
92
|
+
noMatch: string;
|
|
93
|
+
loading: string;
|
|
94
|
+
retry: string;
|
|
95
|
+
loadError: string;
|
|
96
|
+
expand: string;
|
|
97
|
+
collapse: string;
|
|
98
|
+
check: string;
|
|
99
|
+
select: string;
|
|
100
|
+
clear: string;
|
|
101
|
+
close: string;
|
|
102
|
+
tree: string;
|
|
103
|
+
}>;
|
|
104
|
+
remotePending: import("vue").Ref<boolean, boolean>;
|
|
105
|
+
remoteError: import("vue").ShallowRef<unknown, unknown>;
|
|
106
|
+
rawNode: (node: CascaderEntry<N>) => CascaderEntry<N>;
|
|
107
|
+
keyOf: (node: CascaderEntry<N>) => HysTreeKey;
|
|
108
|
+
item: (key: HysTreeKey) => import("./treeSelect").HysTreeSelectItem<CascaderEntry<N>>;
|
|
109
|
+
pick: (row: HysTreeRecord<CascaderEntry<N>>, event?: Event) => Promise<boolean>;
|
|
110
|
+
filter: (text: string) => void;
|
|
111
|
+
clear: () => Promise<boolean>;
|
|
112
|
+
removeTag: (key: HysTreeKey) => Promise<boolean>;
|
|
113
|
+
request: (keys: readonly HysTreeKey[], reason: "clear" | "select" | "check" | "remove" | "api", node?: CascaderEntry<N> | undefined, event?: Event, provided?: HysTreeSelectValue, halfKeys?: HysTreeKey[]) => Promise<boolean>;
|
|
114
|
+
project: (keys: readonly HysTreeKey[]) => HysTreeKey[];
|
|
115
|
+
retrySearch: () => Promise<void>;
|
|
116
|
+
setValue: (value: HysTreeSelectValue) => Promise<boolean>;
|
|
117
|
+
};
|
|
118
|
+
entries: ComputedRef<Map<string, CascaderEntry<N>>>;
|
|
119
|
+
current: ComputedRef<HysCascaderValue>;
|
|
120
|
+
multiple: ComputedRef<boolean>;
|
|
121
|
+
items: ComputedRef<HysCascaderItem<N>[]>;
|
|
122
|
+
columns: ComputedRef<CascaderEntry<N>[][]>;
|
|
123
|
+
browsing: ComputedRef<HysTreeKey[]>;
|
|
124
|
+
anyLevel: ComputedRef<boolean>;
|
|
125
|
+
blocked: ComputedRef<boolean>;
|
|
126
|
+
words: ComputedRef<{
|
|
127
|
+
search: string;
|
|
128
|
+
empty: string;
|
|
129
|
+
noMatch: string;
|
|
130
|
+
loading: string;
|
|
131
|
+
panel: string;
|
|
132
|
+
loadError: string;
|
|
133
|
+
retry: string;
|
|
134
|
+
clear: string;
|
|
135
|
+
close: string;
|
|
136
|
+
level: string;
|
|
137
|
+
expand: string;
|
|
138
|
+
remove: string;
|
|
139
|
+
more: string;
|
|
140
|
+
limit: string;
|
|
141
|
+
}>;
|
|
142
|
+
checking: import("vue").Ref<boolean, boolean>;
|
|
143
|
+
selectedPaths: ComputedRef<HysTreeKey[][]>;
|
|
144
|
+
modelKeys: ComputedRef<string[]>;
|
|
145
|
+
rootPending: import("vue").Ref<boolean, boolean>;
|
|
146
|
+
rootError: import("vue").ShallowRef<unknown, unknown>;
|
|
147
|
+
filterPending: import("vue").Ref<boolean, boolean>;
|
|
148
|
+
filterError: import("vue").ShallowRef<unknown, unknown>;
|
|
149
|
+
searchResults: ComputedRef<CascaderEntry<N>[]>;
|
|
150
|
+
item: (key: string) => HysCascaderItem<N>;
|
|
151
|
+
pick: (key: string, event?: Event, checked?: boolean) => Promise<boolean>;
|
|
152
|
+
expandPath: (path: HysCascaderPath) => Promise<boolean>;
|
|
153
|
+
removeTag: (value: HysCascaderPath | HysCascaderKey) => Promise<boolean>;
|
|
154
|
+
setValue: (value: HysCascaderValue) => Promise<boolean>;
|
|
155
|
+
clear: () => Promise<boolean>;
|
|
156
|
+
filter: (text: string) => void;
|
|
157
|
+
reloadRoot: (force?: boolean) => Promise<boolean>;
|
|
158
|
+
retrySearch: () => Promise<void>;
|
|
159
|
+
reloadNode: (path: HysCascaderPath) => Promise<boolean>;
|
|
160
|
+
getCheckedNodes: (leafOnly?: boolean) => N[];
|
|
161
|
+
};
|
|
162
|
+
export type HysCascaderStore<N extends object> = ReturnType<typeof useCascader<N>>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
import { type HysDatePoint, type HysDatePickerProps, type HysDatePickerValue, type HysDatePickerView, type HysDatePickerChange } from "./datePicker";
|
|
3
|
+
export declare function useDatePicker(props: HysDatePickerProps, range: ComputedRef<boolean>, blocked: ComputedRef<boolean>, emit: (name: string, ...args: any[]) => void, validate: () => void): {
|
|
4
|
+
current: ComputedRef<HysDatePickerValue>;
|
|
5
|
+
selected: ComputedRef<(HysDatePoint | null)[]>;
|
|
6
|
+
draft: import("vue").ShallowRef<(HysDatePoint | null)[], (HysDatePoint | null)[]>;
|
|
7
|
+
stage: import("vue").Ref<"end" | "start", "end" | "start">;
|
|
8
|
+
preview: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
error: import("vue").Ref<string, string>;
|
|
10
|
+
view: ComputedRef<HysDatePickerView>;
|
|
11
|
+
rightView: import("vue").Ref<HysDatePickerView, HysDatePickerView>;
|
|
12
|
+
panels: ComputedRef<number[]>;
|
|
13
|
+
first: ComputedRef<number>;
|
|
14
|
+
weekContains: ComputedRef<number>;
|
|
15
|
+
time: ComputedRef<boolean>;
|
|
16
|
+
unit: ComputedRef<import("./datePicker").HysDatePickerUnit>;
|
|
17
|
+
multiple: ComputedRef<boolean>;
|
|
18
|
+
pattern: ComputedRef<string>;
|
|
19
|
+
displayPattern: ComputedRef<string>;
|
|
20
|
+
words: ComputedRef<{
|
|
21
|
+
today: string;
|
|
22
|
+
now: string;
|
|
23
|
+
clear: string;
|
|
24
|
+
cancel: string;
|
|
25
|
+
close: string;
|
|
26
|
+
confirm: string;
|
|
27
|
+
start: string;
|
|
28
|
+
end: string;
|
|
29
|
+
chooseStart: string;
|
|
30
|
+
chooseEnd: string;
|
|
31
|
+
invalid: string;
|
|
32
|
+
week: string;
|
|
33
|
+
year: string;
|
|
34
|
+
month: string;
|
|
35
|
+
back: string;
|
|
36
|
+
prevMonth: string;
|
|
37
|
+
nextMonth: string;
|
|
38
|
+
prevYear: string;
|
|
39
|
+
nextYear: string;
|
|
40
|
+
hour: string;
|
|
41
|
+
minute: string;
|
|
42
|
+
second: string;
|
|
43
|
+
empty: string;
|
|
44
|
+
limit: string;
|
|
45
|
+
}>;
|
|
46
|
+
needsConfirm: ComputedRef<boolean>;
|
|
47
|
+
today: ComputedRef<HysDatePoint>;
|
|
48
|
+
model: {
|
|
49
|
+
current: ComputedRef<HysDatePickerValue>;
|
|
50
|
+
commit: (value: HysDatePickerValue, update: (value: HysDatePickerValue) => void, change: (value: HysDatePickerValue) => void, notifyOnRequest?: boolean) => Promise<boolean>;
|
|
51
|
+
reset: () => void;
|
|
52
|
+
invalidate: () => void;
|
|
53
|
+
isLive: () => boolean;
|
|
54
|
+
};
|
|
55
|
+
outputType: ComputedRef<"string" | "date" | "timestamp">;
|
|
56
|
+
parse: (value: unknown) => HysDatePoint | undefined;
|
|
57
|
+
boundary: (value: unknown) => HysDatePoint | undefined;
|
|
58
|
+
points: (value?: HysDatePickerValue | undefined) => (HysDatePoint | null)[];
|
|
59
|
+
available: (day: number, endpoint?: number, rangeLimit?: boolean) => boolean;
|
|
60
|
+
periodAvailable: (start: number, end: number, endpoint?: number, rangeLimit?: boolean) => boolean;
|
|
61
|
+
validTime: (point: HysDatePoint, endpoint: number) => boolean;
|
|
62
|
+
valid: (list: readonly (HysDatePoint | null)[], enforceLocks?: boolean) => boolean;
|
|
63
|
+
timeDisabled: (point: HysDatePoint, endpoint: number) => import("./datePicker").HysDateDisabledTime;
|
|
64
|
+
encode: (list: readonly (HysDatePoint | null)[]) => HysDatePickerValue;
|
|
65
|
+
describe: (list?: (HysDatePoint | null)[]) => string[];
|
|
66
|
+
empty: () => HysDatePickerValue;
|
|
67
|
+
request: (value: HysDatePickerValue, source: HysDatePickerChange["source"], allowClear?: boolean) => Promise<boolean>;
|
|
68
|
+
begin: () => void;
|
|
69
|
+
setPanel: (day: number, index?: number) => boolean;
|
|
70
|
+
setMode: (mode: HysDatePickerView, index?: number) => boolean;
|
|
71
|
+
choose: (day: number) => Promise<boolean>;
|
|
72
|
+
clear: () => Promise<boolean>;
|
|
73
|
+
confirm: () => Promise<boolean>;
|
|
74
|
+
setValue: (value: HysDatePickerValue) => Promise<boolean>;
|
|
75
|
+
setTime: (index: number, second: number) => boolean;
|
|
76
|
+
input: (value: string, index?: number) => Promise<boolean>;
|
|
77
|
+
pickShortcut: (index: number) => boolean;
|
|
78
|
+
locked: (endpoint: number) => boolean;
|
|
79
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Ref } from
|
|
2
|
-
export type Placement =
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
export type Placement = "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right" | "left";
|
|
3
3
|
export interface FloatingAnchor {
|
|
4
4
|
getBoundingClientRect(): DOMRect;
|
|
5
5
|
contains(node: Node | null): boolean;
|
|
@@ -10,14 +10,17 @@ export declare function useFloating(anchor: Readonly<Ref<FloatingAnchor | undefi
|
|
|
10
10
|
placement?: Placement;
|
|
11
11
|
gap?: number;
|
|
12
12
|
padding?: number;
|
|
13
|
-
matchWidth?: boolean;
|
|
13
|
+
matchWidth?: boolean | "min" | (() => boolean | "min");
|
|
14
|
+
width?: () => number | string | undefined;
|
|
15
|
+
requestOpen?: (open: boolean, restoreFocus?: boolean) => boolean | void;
|
|
16
|
+
closeOnTab?: boolean;
|
|
14
17
|
}): {
|
|
15
18
|
open: Ref<boolean, boolean>;
|
|
16
19
|
style: Ref<Record<string, string>, Record<string, string>>;
|
|
17
20
|
placement: Ref<Placement, Placement>;
|
|
18
21
|
update: () => void;
|
|
19
|
-
show: () => Promise<void>;
|
|
20
|
-
close: (restore?: boolean) => void;
|
|
22
|
+
show: (force?: boolean) => Promise<void>;
|
|
23
|
+
close: (restore?: boolean, force?: boolean) => void;
|
|
21
24
|
toggle: () => void | Promise<void>;
|
|
22
25
|
restoringFocus: Ref<boolean, boolean>;
|
|
23
26
|
};
|