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
|
@@ -1,92 +1,159 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
checkedKeys?: string[];
|
|
17
|
-
expandedKeys?: string[];
|
|
18
|
-
multiple?: boolean;
|
|
19
|
-
checkable?: boolean;
|
|
20
|
-
searchable?: boolean;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
defaultExpandAll?: boolean;
|
|
23
|
-
showLine?: boolean;
|
|
24
|
-
virtual?: boolean;
|
|
25
|
-
rowHeight?: number;
|
|
26
|
-
viewportHeight?: number;
|
|
27
|
-
draggable?: boolean;
|
|
28
|
-
contextMenu?: boolean;
|
|
29
|
-
checkStrictly?: boolean;
|
|
30
|
-
filterNode?: (query: string, node: TreeNode) => boolean;
|
|
31
|
-
loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;
|
|
32
|
-
} & {
|
|
33
|
-
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
34
|
-
onSelect?: ((node: TreeNode) => any) | undefined;
|
|
35
|
-
"onUpdate:checkedKeys"?: ((value: string[]) => any) | undefined;
|
|
36
|
-
"onUpdate:expandedKeys"?: ((value: string[]) => any) | undefined;
|
|
37
|
-
onCheck?: ((keys: string[]) => any) | undefined;
|
|
38
|
-
"onNode-drop"?: ((payload: {
|
|
39
|
-
dragId: string;
|
|
40
|
-
targetId: string;
|
|
41
|
-
position: "before" | "inside" | "after";
|
|
1
|
+
import { type HysTreeProps, type HysTreeKey, type HysTreeValue, type TreeNode, type HysTreeRecord, type HysTreeCheckInfo, type HysTreeSelectInfo, type HysTreeDropInfo, type HysTreeNodeContext } from "../../composables/tree";
|
|
2
|
+
export type { TreeNode } from "../../composables/tree";
|
|
3
|
+
declare const __VLS_export: <V extends HysTreeValue = string, N extends object = TreeNode, K extends HysTreeKey = N extends {
|
|
4
|
+
id: infer I extends HysTreeKey;
|
|
5
|
+
} ? I : HysTreeKey>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
6
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<HysTreeProps<N, V> & {
|
|
7
|
+
"onUpdate:modelValue"?: ((value: V) => any) | undefined;
|
|
8
|
+
onSearch?: ((query: string) => any) | undefined;
|
|
9
|
+
onSelect?: ((node: N, info: HysTreeSelectInfo<N>) => any) | undefined;
|
|
10
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
11
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
12
|
+
onLoad?: ((info: {
|
|
13
|
+
node: N;
|
|
14
|
+
children: readonly N[];
|
|
15
|
+
loadedKeys: HysTreeKey[];
|
|
42
16
|
}) => any) | undefined;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
17
|
+
onScroll?: ((event: Event) => any) | undefined;
|
|
18
|
+
"onUpdate:searchValue"?: ((query: string) => any) | undefined;
|
|
19
|
+
onCheck?: ((keys: HysTreeKey[], info: HysTreeCheckInfo<N>) => any) | undefined;
|
|
20
|
+
"onUpdate:checkedKeys"?: ((keys: HysTreeKey[]) => any) | undefined;
|
|
21
|
+
"onCheck-change"?: ((info: HysTreeCheckInfo<N>) => any) | undefined;
|
|
22
|
+
"onSelection-change"?: ((info: HysTreeSelectInfo<N>) => any) | undefined;
|
|
23
|
+
"onUpdate:expandedKeys"?: ((keys: HysTreeKey[]) => any) | undefined;
|
|
24
|
+
"onNode-expand"?: ((node: N, info: {
|
|
25
|
+
key: HysTreeKey;
|
|
26
|
+
expanded: boolean;
|
|
27
|
+
expandedKeys: HysTreeKey[];
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
"onNode-collapse"?: ((node: N, info: {
|
|
30
|
+
key: HysTreeKey;
|
|
31
|
+
expanded: boolean;
|
|
32
|
+
expandedKeys: HysTreeKey[];
|
|
33
|
+
}) => any) | undefined;
|
|
34
|
+
"onUpdate:nodes"?: ((nodes: readonly N[]) => any) | undefined;
|
|
35
|
+
"onData-change"?: ((info: {
|
|
36
|
+
nodes: readonly N[];
|
|
37
|
+
action: string;
|
|
38
|
+
key?: HysTreeKey;
|
|
47
39
|
}) => any) | undefined;
|
|
48
|
-
"
|
|
49
|
-
|
|
40
|
+
"onUpdate:loadedKeys"?: ((keys: HysTreeKey[]) => any) | undefined;
|
|
41
|
+
"onChildren-loaded"?: ((info: {
|
|
42
|
+
node: N;
|
|
43
|
+
children: readonly N[];
|
|
44
|
+
}) => any) | undefined;
|
|
45
|
+
"onLoad-error"?: ((info: {
|
|
46
|
+
node: N;
|
|
50
47
|
error: unknown;
|
|
51
48
|
}) => any) | undefined;
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
"onNode-click"?: ((node: N, event: MouseEvent) => any) | undefined;
|
|
50
|
+
"onNode-drop"?: ((info: HysTreeDropInfo<N, K>) => any) | undefined;
|
|
51
|
+
"onNode-drag-start"?: ((info: {
|
|
52
|
+
node: N;
|
|
53
|
+
event: DragEvent;
|
|
54
|
+
}) => any) | undefined;
|
|
55
|
+
"onNode-drag-over"?: ((info: HysTreeDropInfo<N, K>) => any) | undefined;
|
|
56
|
+
"onNode-drag-end"?: ((info: {
|
|
57
|
+
node: N;
|
|
58
|
+
event?: Event;
|
|
59
|
+
}) => any) | undefined;
|
|
60
|
+
"onNode-contextmenu"?: ((info: {
|
|
61
|
+
node: N;
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
event: MouseEvent;
|
|
55
65
|
}) => any) | undefined;
|
|
56
66
|
}> & (typeof globalThis extends {
|
|
57
67
|
__VLS_PROPS_FALLBACK: infer P;
|
|
58
68
|
} ? P : {});
|
|
59
69
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
element: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
71
|
+
getNode: (key: HysTreeKey | N) => N | undefined;
|
|
72
|
+
getNodeInfo: (key: HysTreeKey | N) => HysTreeRecord<N> | undefined;
|
|
73
|
+
getCheckedKeys: (leafOnly?: boolean) => HysTreeKey[];
|
|
74
|
+
getCheckedNodes: (leafOnly?: boolean, includeHalf?: boolean) => N[];
|
|
75
|
+
getHalfCheckedKeys: () => HysTreeKey[];
|
|
76
|
+
getHalfCheckedNodes: () => N[];
|
|
77
|
+
setCheckedKeys: (keys: readonly HysTreeKey[], leafOnly?: boolean) => Promise<boolean>;
|
|
78
|
+
setCheckedNodes: (nodes: readonly N[], leafOnly?: boolean) => Promise<boolean>;
|
|
79
|
+
setChecked: (key: HysTreeKey | N, on: boolean, deep?: boolean, event?: Event) => Promise<boolean>;
|
|
80
|
+
getCurrentKey: () => HysTreeKey;
|
|
81
|
+
getCurrentNode: () => N | null;
|
|
82
|
+
getSelectedKeys: () => HysTreeKey[];
|
|
83
|
+
setCurrentKey: (key: HysTreeKey | null, expandParents?: boolean) => Promise<boolean>;
|
|
84
|
+
setCurrentNode: (node: N | null, expandParents?: boolean) => Promise<boolean>;
|
|
85
|
+
setSelectedKeys: (keys: readonly HysTreeKey[], node?: N | null, event?: Event) => Promise<boolean>;
|
|
86
|
+
getExpandedKeys: () => HysTreeKey[];
|
|
87
|
+
setExpandedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
88
|
+
expandNode: (key: HysTreeKey, on?: boolean) => Promise<boolean>;
|
|
89
|
+
expandAll: () => Promise<boolean>;
|
|
90
|
+
collapseAll: () => Promise<boolean>;
|
|
91
|
+
filter: (q: string) => void;
|
|
92
|
+
reloadNode: (key: HysTreeKey) => Promise<boolean>;
|
|
93
|
+
updateKeyChildren: (key: HysTreeKey, children: readonly N[]) => Promise<boolean>;
|
|
94
|
+
append: (node: N, parent?: HysTreeKey | N | undefined) => Promise<boolean>;
|
|
95
|
+
insertBefore: (node: N, key: HysTreeKey | N) => Promise<boolean>;
|
|
96
|
+
insertAfter: (node: N, key: HysTreeKey | N) => Promise<boolean>;
|
|
97
|
+
remove: (key: HysTreeKey | N) => Promise<boolean>;
|
|
98
|
+
scrollTo: (options: {
|
|
99
|
+
key?: HysTreeKey;
|
|
100
|
+
top?: number;
|
|
101
|
+
align?: "top" | "bottom" | "auto";
|
|
102
|
+
offset?: number;
|
|
103
|
+
behavior?: ScrollBehavior;
|
|
104
|
+
}) => Promise<void>;
|
|
105
|
+
focus: (key?: HysTreeKey) => Promise<void>;
|
|
66
106
|
}>) => void;
|
|
67
107
|
attrs: any;
|
|
68
108
|
slots: {
|
|
69
|
-
node?: (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
109
|
+
node?: (context: HysTreeNodeContext<N>) => any;
|
|
110
|
+
default?: (context: HysTreeNodeContext<N>) => any;
|
|
111
|
+
icon?: (context: HysTreeNodeContext<N>) => any;
|
|
112
|
+
switcher?: (context: HysTreeNodeContext<N>) => any;
|
|
113
|
+
actions?: (context: HysTreeNodeContext<N>) => any;
|
|
114
|
+
empty?: (context: {
|
|
115
|
+
query: string;
|
|
116
|
+
}) => any;
|
|
117
|
+
loading?: () => any;
|
|
118
|
+
contextmenu?: (context: {
|
|
119
|
+
node: N;
|
|
120
|
+
key: HysTreeKey;
|
|
121
|
+
close: () => void;
|
|
74
122
|
}) => any;
|
|
75
123
|
};
|
|
76
|
-
emit: ((evt: "update:modelValue", value:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}) => void) & ((evt: "node-
|
|
81
|
-
|
|
124
|
+
emit: ((evt: "update:modelValue", value: V) => void) & ((evt: "search", query: string) => void) & ((evt: "select", node: N, info: HysTreeSelectInfo<N>) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "load", info: {
|
|
125
|
+
node: N;
|
|
126
|
+
children: readonly N[];
|
|
127
|
+
loadedKeys: HysTreeKey[];
|
|
128
|
+
}) => void) & ((evt: "scroll", event: Event) => void) & ((evt: "update:searchValue", query: string) => void) & ((evt: "check", keys: HysTreeKey[], info: HysTreeCheckInfo<N>) => void) & ((evt: "update:checkedKeys", keys: HysTreeKey[]) => void) & ((evt: "check-change", info: HysTreeCheckInfo<N>) => void) & ((evt: "selection-change", info: HysTreeSelectInfo<N>) => void) & ((evt: "update:expandedKeys", keys: HysTreeKey[]) => void) & ((evt: "node-expand", node: N, info: {
|
|
129
|
+
key: HysTreeKey;
|
|
130
|
+
expanded: boolean;
|
|
131
|
+
expandedKeys: HysTreeKey[];
|
|
132
|
+
}) => void) & ((evt: "node-collapse", node: N, info: {
|
|
133
|
+
key: HysTreeKey;
|
|
134
|
+
expanded: boolean;
|
|
135
|
+
expandedKeys: HysTreeKey[];
|
|
136
|
+
}) => void) & ((evt: "update:nodes", nodes: readonly N[]) => void) & ((evt: "data-change", info: {
|
|
137
|
+
nodes: readonly N[];
|
|
138
|
+
action: string;
|
|
139
|
+
key?: HysTreeKey;
|
|
140
|
+
}) => void) & ((evt: "update:loadedKeys", keys: HysTreeKey[]) => void) & ((evt: "children-loaded", info: {
|
|
141
|
+
node: N;
|
|
142
|
+
children: readonly N[];
|
|
143
|
+
}) => void) & ((evt: "load-error", info: {
|
|
144
|
+
node: N;
|
|
145
|
+
error: unknown;
|
|
146
|
+
}) => void) & ((evt: "node-click", node: N, event: MouseEvent) => void) & ((evt: "node-drop", info: HysTreeDropInfo<N, K>) => void) & ((evt: "node-drag-start", info: {
|
|
147
|
+
node: N;
|
|
148
|
+
event: DragEvent;
|
|
149
|
+
}) => void) & ((evt: "node-drag-over", info: HysTreeDropInfo<N, K>) => void) & ((evt: "node-drag-end", info: {
|
|
150
|
+
node: N;
|
|
151
|
+
event?: Event;
|
|
152
|
+
}) => void) & ((evt: "node-contextmenu", info: {
|
|
153
|
+
node: N;
|
|
82
154
|
x: number;
|
|
83
155
|
y: number;
|
|
84
|
-
|
|
85
|
-
node: TreeNode;
|
|
86
|
-
error: unknown;
|
|
87
|
-
}) => void) & ((evt: "children-loaded", payload: {
|
|
88
|
-
node: TreeNode;
|
|
89
|
-
children: TreeNode[];
|
|
156
|
+
event: MouseEvent;
|
|
90
157
|
}) => void);
|
|
91
158
|
}>) => import("vue").VNode & {
|
|
92
159
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
@@ -1,34 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
modelValue: T;
|
|
10
|
-
nodes: HysTreeSelectNode[];
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
multiple?: boolean;
|
|
14
|
-
clearable?: boolean;
|
|
15
|
-
searchable?: boolean;
|
|
16
|
-
leafOnly?: boolean;
|
|
17
|
-
} & {
|
|
18
|
-
"onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
19
|
-
onChange?: ((value: T) => any) | undefined;
|
|
1
|
+
import type { HysTreeKey, HysTreeCheckInfo, HysTreeNodeContext } from "../../composables/tree";
|
|
2
|
+
import type { HysTreeSelectProps, HysTreeSelectValue, HysTreeSelectNode, HysTreeSelectItem, HysTreeSelectChange } from "../../composables/treeSelect";
|
|
3
|
+
export type { HysTreeSelectNode } from "../../composables/treeSelect";
|
|
4
|
+
declare const __VLS_export: <V extends HysTreeSelectValue = string, N extends object = HysTreeSelectNode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<HysTreeSelectProps<N, V> & {
|
|
6
|
+
onChange?: ((value: V, info: HysTreeSelectChange<N>) => any) | undefined;
|
|
7
|
+
"onUpdate:modelValue"?: ((value: V) => any) | undefined;
|
|
8
|
+
onSearch?: ((query: string) => any) | undefined;
|
|
20
9
|
onClear?: (() => any) | undefined;
|
|
10
|
+
onSelect?: ((key: HysTreeKey, node: N, info: unknown) => any) | undefined;
|
|
11
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
12
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
13
|
+
onLoad?: ((info: {
|
|
14
|
+
node: N;
|
|
15
|
+
children: readonly N[];
|
|
16
|
+
loadedKeys: HysTreeKey[];
|
|
17
|
+
}) => any) | undefined;
|
|
18
|
+
onScroll?: ((event: Event) => any) | undefined;
|
|
19
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
20
|
+
"onUpdate:searchValue"?: ((value: string) => any) | undefined;
|
|
21
|
+
onDeselect?: ((key: HysTreeKey, node: N, info: unknown) => any) | undefined;
|
|
22
|
+
onLimit?: ((limit: number) => any) | undefined;
|
|
23
|
+
onCheck?: ((info: HysTreeCheckInfo<N>) => any) | undefined;
|
|
24
|
+
"onUpdate:expandedKeys"?: ((keys: HysTreeKey[]) => any) | undefined;
|
|
25
|
+
"onNode-expand"?: ((node: N, info: unknown) => any) | undefined;
|
|
26
|
+
"onNode-collapse"?: ((node: N, info: unknown) => any) | undefined;
|
|
27
|
+
"onUpdate:loadedKeys"?: ((keys: HysTreeKey[]) => any) | undefined;
|
|
28
|
+
"onChildren-loaded"?: ((info: {
|
|
29
|
+
node: N;
|
|
30
|
+
children: readonly N[];
|
|
31
|
+
}) => any) | undefined;
|
|
32
|
+
"onLoad-error"?: ((info: {
|
|
33
|
+
node: N;
|
|
34
|
+
error: unknown;
|
|
35
|
+
}) => any) | undefined;
|
|
36
|
+
"onValue-change"?: ((value: V, info: HysTreeSelectChange<N>) => any) | undefined;
|
|
37
|
+
"onRemove-tag"?: ((key: HysTreeKey, node: N | undefined) => any) | undefined;
|
|
38
|
+
"onSearch-complete"?: ((query: string) => any) | undefined;
|
|
39
|
+
"onSearch-error"?: ((error: unknown, query: string) => any) | undefined;
|
|
40
|
+
"onVisible-change"?: ((value: boolean) => any) | undefined;
|
|
21
41
|
}> & (typeof globalThis extends {
|
|
22
42
|
__VLS_PROPS_FALLBACK: infer P;
|
|
23
43
|
} ? P : {});
|
|
24
|
-
expose: (exposed: {
|
|
44
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
45
|
+
element: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
46
|
+
open: import("vue").Ref<boolean, boolean>;
|
|
47
|
+
focus: () => void;
|
|
48
|
+
blur: () => void;
|
|
49
|
+
show: () => Promise<boolean>;
|
|
50
|
+
hide: (restore?: boolean) => void;
|
|
51
|
+
clear: () => Promise<boolean>;
|
|
52
|
+
removeTag: (key: HysTreeKey) => Promise<boolean>;
|
|
53
|
+
setValue: (value: HysTreeSelectValue) => Promise<boolean>;
|
|
54
|
+
filter: (text: string) => void;
|
|
55
|
+
getSelectedKeys: () => HysTreeKey[];
|
|
56
|
+
getSelectedItems: () => HysTreeSelectItem<N>[];
|
|
57
|
+
getCheckedKeys: (leafOnly?: boolean) => HysTreeKey[];
|
|
58
|
+
getHalfCheckedKeys: () => HysTreeKey[];
|
|
59
|
+
getNode: (key: HysTreeKey) => N | undefined;
|
|
60
|
+
getExpandedKeys: () => HysTreeKey[];
|
|
61
|
+
setExpandedKeys: (keys: readonly HysTreeKey[]) => Promise<boolean>;
|
|
62
|
+
expandNode: (key: HysTreeKey, on?: boolean) => Promise<boolean>;
|
|
63
|
+
reloadNode: (key: HysTreeKey) => Promise<boolean>;
|
|
64
|
+
scrollTo: (options: {
|
|
65
|
+
key?: HysTreeKey;
|
|
66
|
+
top?: number;
|
|
67
|
+
align?: "top" | "bottom" | "auto";
|
|
68
|
+
}) => Promise<void>;
|
|
69
|
+
}>) => void;
|
|
25
70
|
attrs: any;
|
|
26
71
|
slots: {
|
|
27
|
-
option?: (
|
|
28
|
-
|
|
72
|
+
option?: (scope: HysTreeNodeContext<N>) => any;
|
|
73
|
+
icon?: (scope: HysTreeNodeContext<N>) => any;
|
|
74
|
+
switcher?: (scope: HysTreeNodeContext<N>) => any;
|
|
75
|
+
tag?: (scope: {
|
|
76
|
+
item: HysTreeSelectItem<N>;
|
|
77
|
+
remove: () => Promise<boolean>;
|
|
78
|
+
}) => any;
|
|
79
|
+
"max-tag-placeholder"?: (scope: {
|
|
80
|
+
items: HysTreeSelectItem<N>[];
|
|
81
|
+
count: number;
|
|
82
|
+
}) => any;
|
|
83
|
+
prefix?: () => any;
|
|
84
|
+
suffix?: () => any;
|
|
85
|
+
header?: () => any;
|
|
86
|
+
footer?: (scope: {
|
|
87
|
+
items: HysTreeSelectItem<N>[];
|
|
88
|
+
clear: () => Promise<boolean>;
|
|
89
|
+
close: () => void;
|
|
90
|
+
}) => any;
|
|
91
|
+
empty?: (scope: {
|
|
92
|
+
query: string;
|
|
93
|
+
}) => any;
|
|
94
|
+
loading?: () => any;
|
|
95
|
+
error?: (scope: {
|
|
96
|
+
error: unknown;
|
|
97
|
+
retry: () => Promise<void>;
|
|
29
98
|
}) => any;
|
|
30
99
|
};
|
|
31
|
-
emit: ((evt: "update:modelValue", value:
|
|
100
|
+
emit: ((evt: "change", value: V, info: HysTreeSelectChange<N>) => void) & ((evt: "update:modelValue", value: V) => void) & ((evt: "search", query: string) => void) & ((evt: "clear") => void) & ((evt: "select", key: HysTreeKey, node: N, info: unknown) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "load", info: {
|
|
101
|
+
node: N;
|
|
102
|
+
children: readonly N[];
|
|
103
|
+
loadedKeys: HysTreeKey[];
|
|
104
|
+
}) => void) & ((evt: "scroll", event: Event) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:searchValue", value: string) => void) & ((evt: "deselect", key: HysTreeKey, node: N, info: unknown) => void) & ((evt: "limit", limit: number) => void) & ((evt: "check", info: HysTreeCheckInfo<N>) => void) & ((evt: "update:expandedKeys", keys: HysTreeKey[]) => void) & ((evt: "node-expand", node: N, info: unknown) => void) & ((evt: "node-collapse", node: N, info: unknown) => void) & ((evt: "update:loadedKeys", keys: HysTreeKey[]) => void) & ((evt: "children-loaded", info: {
|
|
105
|
+
node: N;
|
|
106
|
+
children: readonly N[];
|
|
107
|
+
}) => void) & ((evt: "load-error", info: {
|
|
108
|
+
node: N;
|
|
109
|
+
error: unknown;
|
|
110
|
+
}) => void) & ((evt: "value-change", value: V, info: HysTreeSelectChange<N>) => void) & ((evt: "remove-tag", key: HysTreeKey, node: N | undefined) => void) & ((evt: "search-complete", query: string) => void) & ((evt: "search-error", error: unknown, query: string) => void) & ((evt: "visible-change", value: boolean) => void);
|
|
32
111
|
}>) => import("vue").VNode & {
|
|
33
112
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
34
113
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { HysTreeSelectStore } from "../../composables/useTreeSelect";
|
|
2
|
+
import type { HysTreeSelectNode } from "../../composables/treeSelect";
|
|
3
|
+
import type { HysTreeKey, HysTreeNodeContext } from "../../composables/tree";
|
|
4
|
+
declare const __VLS_export: <N extends object = HysTreeSelectNode>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
6
|
+
store: HysTreeSelectStore<N>;
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
treeId: string;
|
|
9
|
+
checkable?: boolean;
|
|
10
|
+
checkStrictly?: boolean;
|
|
11
|
+
leafOnly?: boolean;
|
|
12
|
+
expandOnClickNode?: boolean;
|
|
13
|
+
showLine?: boolean;
|
|
14
|
+
showIcon?: boolean;
|
|
15
|
+
indent?: number;
|
|
16
|
+
listHeight?: number;
|
|
17
|
+
virtual?: boolean;
|
|
18
|
+
itemHeight?: number;
|
|
19
|
+
overscan?: number;
|
|
20
|
+
} & {
|
|
21
|
+
onScroll?: ((event: Event) => any) | undefined;
|
|
22
|
+
onChoose?: ((key: HysTreeKey) => any) | undefined;
|
|
23
|
+
}> & (typeof globalThis extends {
|
|
24
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
25
|
+
} ? P : {});
|
|
26
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
27
|
+
focus: (key?: HysTreeKey) => Promise<void>;
|
|
28
|
+
scrollTo: (options: {
|
|
29
|
+
key?: HysTreeKey;
|
|
30
|
+
top?: number;
|
|
31
|
+
align?: "top" | "bottom" | "auto";
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
searchKeys: (event: KeyboardEvent) => Promise<void>;
|
|
34
|
+
activeId: import("vue").ComputedRef<string | undefined>;
|
|
35
|
+
setActive: (key: HysTreeKey) => HysTreeKey;
|
|
36
|
+
}>) => void;
|
|
37
|
+
attrs: any;
|
|
38
|
+
slots: {
|
|
39
|
+
option?: (scope: HysTreeNodeContext<N>) => any;
|
|
40
|
+
icon?: (scope: HysTreeNodeContext<N>) => any;
|
|
41
|
+
switcher?: (scope: HysTreeNodeContext<N>) => any;
|
|
42
|
+
empty?: (scope: {
|
|
43
|
+
query: string;
|
|
44
|
+
}) => any;
|
|
45
|
+
};
|
|
46
|
+
emit: ((evt: "scroll", event: Event) => void) & ((evt: "choose", key: HysTreeKey) => void);
|
|
47
|
+
}>) => import("vue").VNode & {
|
|
48
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
49
|
+
};
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
53
|
+
[K in keyof T]: T[K];
|
|
54
|
+
} : {
|
|
55
|
+
[K in keyof T as K]: T[K];
|
|
56
|
+
}) & {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Component, CSSProperties } from "vue";
|
|
2
|
+
import type { Placement } from "./useFloating";
|
|
3
|
+
import type { HysInputProps } from "./textInput";
|
|
4
|
+
export interface HysAutocompleteOption {
|
|
5
|
+
value?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export type HysAutocompleteItem = string | HysAutocompleteOption;
|
|
11
|
+
export interface HysAutocompleteGroup {
|
|
12
|
+
label: string;
|
|
13
|
+
options?: readonly HysAutocompleteDataOption[];
|
|
14
|
+
children?: readonly HysAutocompleteDataOption[];
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
key?: string | number;
|
|
17
|
+
type?: "group";
|
|
18
|
+
}
|
|
19
|
+
export type HysAutocompleteDataOption = HysAutocompleteItem | HysAutocompleteGroup;
|
|
20
|
+
export interface HysAutocompleteContext {
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
}
|
|
23
|
+
export type HysAutocompleteCallback = (options: readonly HysAutocompleteDataOption[]) => void;
|
|
24
|
+
export type HysAutocompleteFetch = (query: string, callback: HysAutocompleteCallback, context: HysAutocompleteContext) => void | readonly HysAutocompleteDataOption[] | Promise<void | readonly HysAutocompleteDataOption[]>;
|
|
25
|
+
export interface HysAutocompleteProps {
|
|
26
|
+
modelValue?: string;
|
|
27
|
+
defaultValue?: string;
|
|
28
|
+
options?: readonly HysAutocompleteDataOption[];
|
|
29
|
+
fetchSuggestions?: HysAutocompleteFetch | readonly HysAutocompleteDataOption[];
|
|
30
|
+
valueKey?: string;
|
|
31
|
+
labelKey?: string;
|
|
32
|
+
filterOption?: boolean | ((query: string, item: HysAutocompleteItem) => boolean);
|
|
33
|
+
caseSensitive?: boolean;
|
|
34
|
+
debounce?: number;
|
|
35
|
+
minQueryLength?: number;
|
|
36
|
+
triggerOnFocus?: boolean;
|
|
37
|
+
highlightFirst?: boolean;
|
|
38
|
+
loopNavigation?: boolean;
|
|
39
|
+
backfill?: boolean;
|
|
40
|
+
selectWhenUnmatched?: boolean;
|
|
41
|
+
selectOnTab?: boolean;
|
|
42
|
+
append?: boolean;
|
|
43
|
+
clearAfterSelect?: boolean;
|
|
44
|
+
blurAfterSelect?: boolean;
|
|
45
|
+
getShow?: (query: string) => boolean;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
hideLoading?: boolean;
|
|
50
|
+
clearable?: boolean;
|
|
51
|
+
clearIcon?: Component;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
ariaLabel?: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
status?: "error" | "warning" | "success";
|
|
57
|
+
error?: string;
|
|
58
|
+
size?: "sm" | "md" | "lg";
|
|
59
|
+
bordered?: boolean;
|
|
60
|
+
autofocus?: boolean;
|
|
61
|
+
inputProps?: Omit<HysInputProps, "modelValue" | "defaultValue">;
|
|
62
|
+
open?: boolean;
|
|
63
|
+
defaultOpen?: boolean;
|
|
64
|
+
placement?: Placement;
|
|
65
|
+
popupMatchWidth?: boolean;
|
|
66
|
+
popupWidth?: number | string;
|
|
67
|
+
popupClass?: string;
|
|
68
|
+
popupStyle?: CSSProperties;
|
|
69
|
+
appendTo?: string | HTMLElement | false;
|
|
70
|
+
listHeight?: number;
|
|
71
|
+
emptyText?: string;
|
|
72
|
+
loadingText?: string;
|
|
73
|
+
errorText?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface HysAutocompleteInstance {
|
|
76
|
+
input: HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
77
|
+
isOpen: boolean;
|
|
78
|
+
loading: boolean;
|
|
79
|
+
highlightedIndex: number;
|
|
80
|
+
suggestions: readonly HysAutocompleteDataOption[];
|
|
81
|
+
focus: (options?: FocusOptions) => void;
|
|
82
|
+
blur: () => void;
|
|
83
|
+
open: () => Promise<void>;
|
|
84
|
+
close: () => void;
|
|
85
|
+
clear: () => void;
|
|
86
|
+
getData: () => Promise<void>;
|
|
87
|
+
retry: () => Promise<void>;
|
|
88
|
+
highlight: (index: number) => void;
|
|
89
|
+
select: (option: HysAutocompleteItem) => Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
export interface HysAutocompleteRow {
|
|
92
|
+
key: string;
|
|
93
|
+
kind: "group" | "option";
|
|
94
|
+
label: string;
|
|
95
|
+
value: string;
|
|
96
|
+
disabled: boolean;
|
|
97
|
+
item: HysAutocompleteItem;
|
|
98
|
+
group?: HysAutocompleteGroup;
|
|
99
|
+
}
|
|
100
|
+
export declare function autocompleteValue(item: HysAutocompleteItem, key?: string, labelKey?: string): string;
|
|
101
|
+
export declare function normalizeAutocomplete(data: readonly HysAutocompleteDataOption[], query: string, settings: {
|
|
102
|
+
valueKey: string;
|
|
103
|
+
labelKey: string;
|
|
104
|
+
filter: boolean | ((query: string, item: HysAutocompleteItem) => boolean);
|
|
105
|
+
caseSensitive: boolean;
|
|
106
|
+
}): HysAutocompleteRow[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type Component, type ComputedRef, type CSSProperties, type ImgHTMLAttributes, type InjectionKey } from "vue";
|
|
2
|
+
import type { Placement } from "./useFloating";
|
|
3
|
+
export type HysAvatarBreakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
4
|
+
export type HysAvatarSize = number | "sm" | "md" | "lg" | "small" | "medium" | "default" | "large" | Partial<Record<HysAvatarBreakpoint, number>>;
|
|
5
|
+
export type HysAvatarFit = "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
6
|
+
export interface HysAvatarProps {
|
|
7
|
+
name?: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
srcset?: string;
|
|
10
|
+
srcSet?: string;
|
|
11
|
+
sizes?: string;
|
|
12
|
+
size?: HysAvatarSize;
|
|
13
|
+
shape?: "circle" | "square";
|
|
14
|
+
fit?: HysAvatarFit;
|
|
15
|
+
alt?: string;
|
|
16
|
+
icon?: Component;
|
|
17
|
+
gap?: number;
|
|
18
|
+
autoFit?: boolean;
|
|
19
|
+
color?: string;
|
|
20
|
+
textColor?: string;
|
|
21
|
+
bordered?: boolean;
|
|
22
|
+
radius?: number | string;
|
|
23
|
+
fallbackSrc?: string;
|
|
24
|
+
loadError?: (event: Event) => boolean | void;
|
|
25
|
+
draggable?: boolean;
|
|
26
|
+
crossOrigin?: "" | "anonymous" | "use-credentials";
|
|
27
|
+
lazy?: boolean;
|
|
28
|
+
imgProps?: ImgHTMLAttributes;
|
|
29
|
+
}
|
|
30
|
+
export interface HysAvatarLoadInfo {
|
|
31
|
+
src: string;
|
|
32
|
+
fallback: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface HysAvatarInstance {
|
|
35
|
+
element: HTMLElement | undefined;
|
|
36
|
+
image: HTMLImageElement | undefined;
|
|
37
|
+
loaded: boolean;
|
|
38
|
+
failed: boolean;
|
|
39
|
+
reload: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface HysAvatarOption extends HysAvatarProps {
|
|
42
|
+
key?: string | number;
|
|
43
|
+
}
|
|
44
|
+
export interface HysAvatarGroupInstance {
|
|
45
|
+
open: () => Promise<void>;
|
|
46
|
+
close: () => void;
|
|
47
|
+
}
|
|
48
|
+
export interface HysAvatarGroupProps {
|
|
49
|
+
options?: readonly HysAvatarOption[];
|
|
50
|
+
size?: HysAvatarSize;
|
|
51
|
+
shape?: "circle" | "square";
|
|
52
|
+
gap?: number;
|
|
53
|
+
maxCount?: number;
|
|
54
|
+
vertical?: boolean;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
maxStyle?: CSSProperties;
|
|
57
|
+
maxClass?: string;
|
|
58
|
+
placement?: Placement;
|
|
59
|
+
trigger?: "hover" | "focus" | "click";
|
|
60
|
+
showOverflow?: boolean;
|
|
61
|
+
expandOnHover?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface AvatarGroupContext {
|
|
64
|
+
size: ComputedRef<HysAvatarSize | undefined>;
|
|
65
|
+
shape: ComputedRef<"circle" | "square" | undefined>;
|
|
66
|
+
bordered: ComputedRef<boolean>;
|
|
67
|
+
}
|
|
68
|
+
export declare const avatarGroupKey: InjectionKey<AvatarGroupContext>;
|
|
69
|
+
export declare function resolveAvatarSize(size: HysAvatarSize | undefined, viewport: number): number;
|
|
70
|
+
export declare function useAvatarSize(size: ComputedRef<HysAvatarSize | undefined>): ComputedRef<number>;
|