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,309 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, VNodeChild } from "vue";
|
|
2
|
+
import type { Placement } from "./useFloating";
|
|
3
|
+
export type HysTableKey = string | number;
|
|
4
|
+
export type HysTableDirection = "asc" | "desc";
|
|
5
|
+
export type HysTableFilterValue = string | number | boolean;
|
|
6
|
+
export type HysTableFilters = Record<string, readonly HysTableFilterValue[]>;
|
|
7
|
+
export interface HysTableSort {
|
|
8
|
+
key: string;
|
|
9
|
+
direction: HysTableDirection;
|
|
10
|
+
}
|
|
11
|
+
export interface HysTableSelectionProps {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
label?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface HysTableSelectionColumn {
|
|
17
|
+
label?: string;
|
|
18
|
+
width?: number;
|
|
19
|
+
fixed?: boolean | "left" | "right";
|
|
20
|
+
align?: "left" | "center" | "right";
|
|
21
|
+
}
|
|
22
|
+
export interface HysTableFilterConfirmOptions {
|
|
23
|
+
closeDropdown?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface HysTableFilterResetOptions extends HysTableFilterConfirmOptions {
|
|
26
|
+
confirm?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface HysTableScrollRowOptions {
|
|
29
|
+
behavior?: ScrollBehavior;
|
|
30
|
+
block?: "start" | "center" | "end" | "nearest";
|
|
31
|
+
}
|
|
32
|
+
export interface HysTableFilter {
|
|
33
|
+
label: string;
|
|
34
|
+
value: HysTableFilterValue;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
children?: readonly HysTableFilter[];
|
|
37
|
+
}
|
|
38
|
+
export type HysTableElementAttrs = HTMLAttributes & Record<string, unknown>;
|
|
39
|
+
export type HysTablePaginationPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
40
|
+
export interface HysTableCellContext<T extends object = Record<string, unknown>> {
|
|
41
|
+
row: T;
|
|
42
|
+
column: HysTableColumn<T>;
|
|
43
|
+
value: unknown;
|
|
44
|
+
rowIndex: number;
|
|
45
|
+
columnIndex: number;
|
|
46
|
+
}
|
|
47
|
+
export interface HysTableColumn<T extends object = any> {
|
|
48
|
+
key: string;
|
|
49
|
+
label: string;
|
|
50
|
+
dataIndex?: string | readonly (string | number)[];
|
|
51
|
+
type?: "default" | "selection" | "index" | "expand";
|
|
52
|
+
children?: readonly HysTableColumn<T>[];
|
|
53
|
+
width?: string | number;
|
|
54
|
+
minWidth?: number;
|
|
55
|
+
maxWidth?: number;
|
|
56
|
+
fixed?: boolean | "left" | "right";
|
|
57
|
+
align?: "left" | "center" | "right";
|
|
58
|
+
headerAlign?: "left" | "center" | "right";
|
|
59
|
+
sortable?: boolean | "custom";
|
|
60
|
+
sorter?: (a: T, b: T) => number;
|
|
61
|
+
sortBy?: string | ((row: T) => unknown) | readonly (string | ((row: T) => unknown))[];
|
|
62
|
+
sortOrders?: readonly (HysTableDirection | null)[];
|
|
63
|
+
defaultSortOrder?: HysTableDirection;
|
|
64
|
+
sortPriority?: number;
|
|
65
|
+
filters?: readonly HysTableFilter[];
|
|
66
|
+
filterable?: boolean;
|
|
67
|
+
filterMultiple?: boolean;
|
|
68
|
+
filterMode?: "menu" | "tree";
|
|
69
|
+
filterSearch?: boolean | ((query: string, option: HysTableFilter) => boolean);
|
|
70
|
+
defaultFilterValue?: readonly HysTableFilterValue[];
|
|
71
|
+
filterResetToDefault?: boolean;
|
|
72
|
+
filterMethod?: (value: HysTableFilterValue, row: T, column: HysTableColumn<T>) => boolean;
|
|
73
|
+
formatter?: (row: T, column: HysTableColumn<T>, value: unknown, index: number) => VNodeChild;
|
|
74
|
+
ellipsis?: boolean;
|
|
75
|
+
showOverflowTooltip?: boolean;
|
|
76
|
+
tooltipFormatter?: (context: HysTableCellContext<T>) => VNodeChild;
|
|
77
|
+
className?: string;
|
|
78
|
+
headerClassName?: string;
|
|
79
|
+
cellStyle?: CSSProperties | ((context: HysTableCellContext<T>) => CSSProperties);
|
|
80
|
+
summary?: "sum" | "avg" | "min" | "max" | "count";
|
|
81
|
+
index?: number | ((index: number, row: T) => VNodeChild);
|
|
82
|
+
hidden?: boolean;
|
|
83
|
+
responsive?: readonly ("xs" | "sm" | "md" | "lg" | "xl" | "xxl")[];
|
|
84
|
+
resizable?: boolean;
|
|
85
|
+
rowScope?: "row" | "rowgroup";
|
|
86
|
+
customCell?: (context: HysTableCellContext<T>) => HysTableElementAttrs;
|
|
87
|
+
customHeaderCell?: (column: HysTableColumn<T>, index: number) => HysTableElementAttrs;
|
|
88
|
+
}
|
|
89
|
+
export interface HysTablePagination {
|
|
90
|
+
position?: readonly HysTablePaginationPosition[];
|
|
91
|
+
page?: number;
|
|
92
|
+
pageSize?: number;
|
|
93
|
+
total?: number;
|
|
94
|
+
pageSizeOptions?: number[];
|
|
95
|
+
showSizeChanger?: boolean;
|
|
96
|
+
showQuickJumper?: boolean;
|
|
97
|
+
showTotal?: boolean;
|
|
98
|
+
compact?: boolean;
|
|
99
|
+
hideOnSinglePage?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface HysTableQuery<T extends object = Record<string, unknown>> {
|
|
102
|
+
action: "sort" | "filter" | "page" | "pageSize";
|
|
103
|
+
page: number;
|
|
104
|
+
pageSize: number;
|
|
105
|
+
sorts: HysTableSort[];
|
|
106
|
+
filters: HysTableFilters;
|
|
107
|
+
currentData: T[];
|
|
108
|
+
}
|
|
109
|
+
export interface HysTableLoadContext {
|
|
110
|
+
signal: AbortSignal;
|
|
111
|
+
key: HysTableKey;
|
|
112
|
+
depth: number;
|
|
113
|
+
}
|
|
114
|
+
export interface HysTableLocale {
|
|
115
|
+
emptyText: string;
|
|
116
|
+
loadingText: string;
|
|
117
|
+
selectAll: string;
|
|
118
|
+
selectRow: string;
|
|
119
|
+
expandRow: string;
|
|
120
|
+
collapseRow: string;
|
|
121
|
+
expand: string;
|
|
122
|
+
collapse: string;
|
|
123
|
+
filter: string;
|
|
124
|
+
filterPlaceholder: string;
|
|
125
|
+
reset: string;
|
|
126
|
+
apply: string;
|
|
127
|
+
retry: string;
|
|
128
|
+
retryLabel: string;
|
|
129
|
+
scrollLabel: string;
|
|
130
|
+
resizeColumn: string;
|
|
131
|
+
sortAsc: string;
|
|
132
|
+
sortDesc: string;
|
|
133
|
+
filterSearch?: string;
|
|
134
|
+
noFilterMatch?: string;
|
|
135
|
+
invertSelection?: string;
|
|
136
|
+
clearSelection?: string;
|
|
137
|
+
selected?: string;
|
|
138
|
+
paginationLabels?: Partial<{
|
|
139
|
+
total: string;
|
|
140
|
+
perPage: string;
|
|
141
|
+
jump: string;
|
|
142
|
+
page: string;
|
|
143
|
+
first: string;
|
|
144
|
+
previous: string;
|
|
145
|
+
next: string;
|
|
146
|
+
last: string;
|
|
147
|
+
}>;
|
|
148
|
+
}
|
|
149
|
+
export interface HysTableProps<T extends object> {
|
|
150
|
+
locale?: Partial<HysTableLocale>;
|
|
151
|
+
columns: readonly HysTableColumn<T>[];
|
|
152
|
+
rows: readonly T[];
|
|
153
|
+
rowKey?: string | ((row: T) => HysTableKey);
|
|
154
|
+
emptyText?: string;
|
|
155
|
+
loading?: boolean;
|
|
156
|
+
disabled?: boolean;
|
|
157
|
+
striped?: boolean;
|
|
158
|
+
bordered?: boolean;
|
|
159
|
+
size?: "sm" | "md" | "lg";
|
|
160
|
+
tableLayout?: "auto" | "fixed";
|
|
161
|
+
caption?: string;
|
|
162
|
+
height?: number | string;
|
|
163
|
+
maxHeight?: number | string;
|
|
164
|
+
stickyHeader?: boolean;
|
|
165
|
+
showHeader?: boolean;
|
|
166
|
+
fit?: boolean;
|
|
167
|
+
scrollbarAlwaysOn?: boolean;
|
|
168
|
+
scrollbarTabindex?: number | string;
|
|
169
|
+
headerRowClassName?: string | ((columns: readonly HysTableColumn<T>[], level: number) => string);
|
|
170
|
+
headerRowStyle?: CSSProperties | ((columns: readonly HysTableColumn<T>[], level: number) => CSSProperties);
|
|
171
|
+
rowClassName?: string | ((row: T, index: number) => string);
|
|
172
|
+
rowStyle?: CSSProperties | ((row: T, index: number) => CSSProperties);
|
|
173
|
+
cellClassName?: string | ((context: HysTableCellContext<T>) => string);
|
|
174
|
+
cellStyle?: CSSProperties | ((context: HysTableCellContext<T>) => CSSProperties);
|
|
175
|
+
headerCellClassName?: string | ((column: HysTableColumn<T>, index: number) => string);
|
|
176
|
+
headerCellStyle?: CSSProperties | ((column: HysTableColumn<T>, index: number) => CSSProperties);
|
|
177
|
+
customRow?: (row: T, index: number) => HysTableElementAttrs;
|
|
178
|
+
customHeaderRow?: (columns: readonly HysTableColumn<T>[], index: number) => HysTableElementAttrs;
|
|
179
|
+
customCell?: (context: HysTableCellContext<T>) => HysTableElementAttrs;
|
|
180
|
+
customHeaderCell?: (column: HysTableColumn<T>, index: number) => HysTableElementAttrs;
|
|
181
|
+
selectable?: boolean | ((row: T, index: number) => boolean);
|
|
182
|
+
selectionType?: "checkbox" | "radio";
|
|
183
|
+
selectedRowKeys?: readonly HysTableKey[];
|
|
184
|
+
defaultSelectedRowKeys?: readonly HysTableKey[];
|
|
185
|
+
reserveSelection?: boolean;
|
|
186
|
+
checkStrictly?: boolean;
|
|
187
|
+
selectOnIndeterminate?: boolean;
|
|
188
|
+
selectionActions?: boolean;
|
|
189
|
+
rangeSelection?: boolean;
|
|
190
|
+
hideSelectAll?: boolean;
|
|
191
|
+
selectionColumn?: HysTableSelectionColumn;
|
|
192
|
+
getSelectionProps?: (row: T, index: number) => HysTableSelectionProps;
|
|
193
|
+
highlightCurrentRow?: boolean;
|
|
194
|
+
currentRowKey?: HysTableKey | null;
|
|
195
|
+
defaultCurrentRowKey?: HysTableKey;
|
|
196
|
+
showIndex?: boolean;
|
|
197
|
+
indexMethod?: (index: number, row: T) => VNodeChild;
|
|
198
|
+
sort?: HysTableSort | null;
|
|
199
|
+
sorts?: readonly HysTableSort[];
|
|
200
|
+
defaultSort?: HysTableSort | readonly HysTableSort[] | null;
|
|
201
|
+
multiSort?: boolean;
|
|
202
|
+
sortOrders?: readonly (HysTableDirection | null)[];
|
|
203
|
+
filters?: HysTableFilters;
|
|
204
|
+
defaultFilters?: HysTableFilters;
|
|
205
|
+
filterColumnKey?: string | null;
|
|
206
|
+
filterPlacement?: Placement;
|
|
207
|
+
appendFilterTo?: string | HTMLElement | false;
|
|
208
|
+
pagination?: boolean | HysTablePagination;
|
|
209
|
+
page?: number;
|
|
210
|
+
pageSize?: number;
|
|
211
|
+
total?: number;
|
|
212
|
+
serverMode?: boolean;
|
|
213
|
+
scrollToFirstRowOnChange?: boolean;
|
|
214
|
+
expandable?: boolean;
|
|
215
|
+
expandedRowKeys?: readonly HysTableKey[];
|
|
216
|
+
defaultExpandedRowKeys?: readonly HysTableKey[];
|
|
217
|
+
defaultExpandAll?: boolean;
|
|
218
|
+
rowExpandable?: (row: T) => boolean;
|
|
219
|
+
expandOnClickRow?: boolean;
|
|
220
|
+
showExpandColumn?: boolean;
|
|
221
|
+
expandColumnTitle?: string;
|
|
222
|
+
expandFixed?: boolean | "left" | "right";
|
|
223
|
+
preserveExpandedContent?: boolean;
|
|
224
|
+
treeMode?: boolean;
|
|
225
|
+
childrenKey?: string;
|
|
226
|
+
hasChildrenKey?: string;
|
|
227
|
+
indent?: number;
|
|
228
|
+
loadChildren?: (row: T, context: HysTableLoadContext) => readonly T[] | Promise<readonly T[]>;
|
|
229
|
+
showSummary?: boolean;
|
|
230
|
+
sumText?: string;
|
|
231
|
+
summaryMethod?: (context: {
|
|
232
|
+
columns: readonly HysTableColumn<T>[];
|
|
233
|
+
rows: T[];
|
|
234
|
+
}) => readonly VNodeChild[] | Record<string, VNodeChild>;
|
|
235
|
+
spanMethod?: (context: HysTableCellContext<T>) => {
|
|
236
|
+
rowspan?: number;
|
|
237
|
+
colspan?: number;
|
|
238
|
+
} | readonly [number, number] | undefined;
|
|
239
|
+
showOverflowTooltip?: boolean;
|
|
240
|
+
tooltipFormatter?: (context: HysTableCellContext<T>) => VNodeChild;
|
|
241
|
+
resizable?: boolean;
|
|
242
|
+
columnWidths?: Readonly<Record<string, number>>;
|
|
243
|
+
allowDragLastColumn?: boolean;
|
|
244
|
+
}
|
|
245
|
+
export interface HysTableInstance<T extends object = Record<string, unknown>> {
|
|
246
|
+
readonly element: HTMLElement | undefined;
|
|
247
|
+
readonly viewport: HTMLElement | undefined;
|
|
248
|
+
readonly selectedKeys: HysTableKey[];
|
|
249
|
+
readonly currentRow: T | undefined;
|
|
250
|
+
readonly expandedKeys: HysTableKey[];
|
|
251
|
+
readonly query: HysTableQuery<T>;
|
|
252
|
+
readonly columns: HysTableColumn<T>[];
|
|
253
|
+
clearSelection: () => Promise<boolean>;
|
|
254
|
+
getSelectionRows: () => T[];
|
|
255
|
+
getHalfSelectionRows: () => T[];
|
|
256
|
+
toggleRowSelection: (row: T | HysTableKey, selected?: boolean, range?: boolean) => Promise<boolean>;
|
|
257
|
+
toggleAllSelection: (selected?: boolean) => Promise<boolean>;
|
|
258
|
+
invertSelection: () => Promise<boolean>;
|
|
259
|
+
setCurrentRow: (row?: T | HysTableKey | null) => Promise<boolean>;
|
|
260
|
+
toggleRowExpansion: (row: T | HysTableKey, expanded?: boolean) => Promise<boolean>;
|
|
261
|
+
loadRow: (row: T | HysTableKey, force?: boolean) => Promise<boolean>;
|
|
262
|
+
updateKeyChildren: (row: T | HysTableKey, children: readonly T[]) => Promise<boolean>;
|
|
263
|
+
clearSort: () => void;
|
|
264
|
+
setSort: (sort: HysTableSort | readonly HysTableSort[] | null) => void;
|
|
265
|
+
clearFilter: (keys?: readonly string[]) => void;
|
|
266
|
+
setFilter: (key: string, values: readonly HysTableFilterValue[]) => void;
|
|
267
|
+
showFilter: (key: string) => Promise<boolean>;
|
|
268
|
+
hideFilter: () => Promise<boolean>;
|
|
269
|
+
setPage: (page: number) => void;
|
|
270
|
+
resizeColumn: (key: string, width: number) => void;
|
|
271
|
+
resetColumnWidths: () => void;
|
|
272
|
+
doLayout: () => Promise<void>;
|
|
273
|
+
scrollTo: (options: ScrollToOptions) => void;
|
|
274
|
+
setScrollTop: (top: number) => void;
|
|
275
|
+
setScrollLeft: (left: number) => void;
|
|
276
|
+
scrollToRow: (row: T | HysTableKey, options?: HysTableScrollRowOptions) => Promise<boolean>;
|
|
277
|
+
}
|
|
278
|
+
export interface TableNode<T extends object> {
|
|
279
|
+
row: T;
|
|
280
|
+
key: HysTableKey;
|
|
281
|
+
token: string;
|
|
282
|
+
index: number;
|
|
283
|
+
depth: number;
|
|
284
|
+
rootToken: string;
|
|
285
|
+
parent?: TableNode<T>;
|
|
286
|
+
children: TableNode<T>[];
|
|
287
|
+
lazy: boolean;
|
|
288
|
+
}
|
|
289
|
+
export interface TableHeader<T extends object> {
|
|
290
|
+
column: HysTableColumn<T>;
|
|
291
|
+
key: string;
|
|
292
|
+
leaves: HysTableColumn<T>[];
|
|
293
|
+
colspan: number;
|
|
294
|
+
rowspan: number;
|
|
295
|
+
fixed?: "left" | "right";
|
|
296
|
+
}
|
|
297
|
+
export declare const tableToken: (key: HysTableKey) => string;
|
|
298
|
+
export declare function tableValue(row: object, path: string | readonly (string | number)[]): unknown;
|
|
299
|
+
export declare const tableBreakpoint: (width: number) => "sm" | "md" | "lg" | "xs" | "xl" | "xxl";
|
|
300
|
+
export declare function tableColumns<T extends object>(input: readonly HysTableColumn<T>[], breakpoint: ReturnType<typeof tableBreakpoint>, showExpandColumn?: boolean): {
|
|
301
|
+
leaves: HysTableColumn<T>[];
|
|
302
|
+
headers: TableHeader<T>[][];
|
|
303
|
+
};
|
|
304
|
+
export declare function tableCompare<T extends object>(sorts: readonly HysTableSort[], columns: readonly HysTableColumn<T>[]): (a: T, b: T) => number;
|
|
305
|
+
export declare function tableMatches<T extends object>(row: T, filters: HysTableFilters, columns: readonly HysTableColumn<T>[]): boolean;
|
|
306
|
+
export declare function tableFilterPredicate<T extends object>(filters: HysTableFilters, columns: readonly HysTableColumn<T>[]): (row: T) => boolean;
|
|
307
|
+
/** Iterative traversal also tolerates accidentally cyclic filter definitions. */
|
|
308
|
+
export declare function tableFilterOptions(filters: readonly HysTableFilter[]): HysTableFilter[];
|
|
309
|
+
export declare function tableSummary<T extends object>(rows: readonly T[], column: HysTableColumn<T>): number | "" | "—";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Component, InputHTMLAttributes, TextareaHTMLAttributes } from "vue";
|
|
2
|
+
export interface HysInputFormatInfo {
|
|
3
|
+
userTyping: boolean;
|
|
4
|
+
input: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HysInputCountInfo {
|
|
7
|
+
value: string;
|
|
8
|
+
count: number;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
}
|
|
11
|
+
export type HysInputCountStrategy = boolean | ((value: string) => number);
|
|
12
|
+
export interface HysInputProps {
|
|
13
|
+
modelValue?: string | number | null;
|
|
14
|
+
defaultValue?: string | number | null;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
readonly?: boolean;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
status?: "error" | "warning" | "success";
|
|
23
|
+
clearable?: boolean;
|
|
24
|
+
clearIcon?: Component;
|
|
25
|
+
prefixIcon?: Component;
|
|
26
|
+
suffixIcon?: Component;
|
|
27
|
+
showPassword?: boolean;
|
|
28
|
+
showPasswordOn?: "click" | "mousedown";
|
|
29
|
+
passwordVisible?: boolean;
|
|
30
|
+
defaultPasswordVisible?: boolean;
|
|
31
|
+
showCount?: boolean | {
|
|
32
|
+
formatter: (info: HysInputCountInfo) => string;
|
|
33
|
+
};
|
|
34
|
+
showWordLimit?: boolean;
|
|
35
|
+
countPosition?: "inside" | "outside";
|
|
36
|
+
wordLimitPosition?: "inside" | "outside";
|
|
37
|
+
countGraphemes?: HysInputCountStrategy;
|
|
38
|
+
maxlength?: number | string;
|
|
39
|
+
minlength?: number | string;
|
|
40
|
+
formatter?: (value: string, info: HysInputFormatInfo) => string;
|
|
41
|
+
parser?: (value: string) => string | number;
|
|
42
|
+
allowInput?: (value: string) => boolean;
|
|
43
|
+
autocomplete?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
size?: "sm" | "md" | "lg";
|
|
46
|
+
rows?: number;
|
|
47
|
+
autosize?: boolean | {
|
|
48
|
+
minRows?: number;
|
|
49
|
+
maxRows?: number;
|
|
50
|
+
};
|
|
51
|
+
resize?: "none" | "both" | "horizontal" | "vertical";
|
|
52
|
+
inputProps?: InputHTMLAttributes | TextareaHTMLAttributes;
|
|
53
|
+
autofocus?: boolean;
|
|
54
|
+
selectOnFocus?: boolean;
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
round?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface HysInputInstance {
|
|
59
|
+
input: HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
60
|
+
textarea: HTMLTextAreaElement | undefined;
|
|
61
|
+
isComposing: boolean;
|
|
62
|
+
focus: (options?: FocusOptions) => void;
|
|
63
|
+
blur: () => void;
|
|
64
|
+
select: () => void;
|
|
65
|
+
clear: () => void;
|
|
66
|
+
resize: () => Promise<void>;
|
|
67
|
+
setSelectionRange: (start: number, end: number, direction?: "forward" | "backward" | "none") => void;
|
|
68
|
+
scrollTo: (options: ScrollToOptions) => void;
|
|
69
|
+
}
|
|
70
|
+
export type HysTextareaProps = Omit<HysInputProps, 'type' | 'showPassword' | 'showPasswordOn' | 'passwordVisible' | 'defaultPasswordVisible'>;
|
|
71
|
+
export interface HysTextareaInstance extends Omit<HysInputInstance, 'input'> {
|
|
72
|
+
input: HTMLTextAreaElement | undefined;
|
|
73
|
+
}
|
|
74
|
+
export declare function textCount(value: string, strategy?: HysInputCountStrategy): number;
|
|
75
|
+
export declare function textLimit(value: string, max: number | undefined, strategy?: HysInputCountStrategy): string;
|
|
76
|
+
export declare function textLengthLimit(value?: string | number): number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerToastEscape(close: () => void): () => void;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { CSSProperties, VNodeChild } from "vue";
|
|
2
|
+
export type HysTransferKey = string | number;
|
|
3
|
+
export type HysTransferSide = "left" | "right";
|
|
4
|
+
export interface HysTransferOption<K extends HysTransferKey = HysTransferKey> {
|
|
5
|
+
value: K;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface HysTransferFieldNames {
|
|
10
|
+
value?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
disabled?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface HysTransferPagination {
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
pageSizeOptions?: number[];
|
|
17
|
+
showSizeChanger?: boolean;
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface HysTransferLocale {
|
|
21
|
+
leftTitle: string;
|
|
22
|
+
rightTitle: string;
|
|
23
|
+
search: string;
|
|
24
|
+
emptyLeft: string;
|
|
25
|
+
emptyRight: string;
|
|
26
|
+
noMatch: string;
|
|
27
|
+
loading: string;
|
|
28
|
+
selectAll: string;
|
|
29
|
+
invert: string;
|
|
30
|
+
remove: string;
|
|
31
|
+
moveRight: string;
|
|
32
|
+
moveLeft: string;
|
|
33
|
+
dragRight: string;
|
|
34
|
+
dragLeft: string;
|
|
35
|
+
dragCount: string;
|
|
36
|
+
moved: string;
|
|
37
|
+
added: string;
|
|
38
|
+
removed: string;
|
|
39
|
+
firstPage: string;
|
|
40
|
+
previousPage: string;
|
|
41
|
+
nextPage: string;
|
|
42
|
+
lastPage: string;
|
|
43
|
+
perPage: string;
|
|
44
|
+
}
|
|
45
|
+
export interface HysTransferHeaderInfo {
|
|
46
|
+
side: HysTransferSide;
|
|
47
|
+
total: number;
|
|
48
|
+
filtered: number;
|
|
49
|
+
checked: number;
|
|
50
|
+
}
|
|
51
|
+
export interface HysTransferRecord<T extends object, K extends HysTransferKey> {
|
|
52
|
+
key: K;
|
|
53
|
+
label: string;
|
|
54
|
+
disabled: boolean;
|
|
55
|
+
option: T;
|
|
56
|
+
}
|
|
57
|
+
export interface HysTransferProps<T extends object, K extends HysTransferKey> {
|
|
58
|
+
options: readonly T[];
|
|
59
|
+
modelValue?: readonly K[];
|
|
60
|
+
defaultValue?: readonly K[];
|
|
61
|
+
fieldNames?: HysTransferFieldNames;
|
|
62
|
+
rowKey?: (option: T) => K;
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
loading?: boolean;
|
|
65
|
+
filterable?: boolean;
|
|
66
|
+
filterMethod?: (query: string, option: T, side: HysTransferSide) => boolean;
|
|
67
|
+
filterPlaceholder?: string | readonly [string, string];
|
|
68
|
+
searchValues?: Partial<Record<HysTransferSide, string>>;
|
|
69
|
+
titles?: readonly [string, string];
|
|
70
|
+
buttonTexts?: readonly [string, string];
|
|
71
|
+
showSelectAll?: boolean;
|
|
72
|
+
showInvert?: boolean;
|
|
73
|
+
checkedKeys?: readonly K[];
|
|
74
|
+
defaultCheckedKeys?: readonly K[];
|
|
75
|
+
leftDefaultChecked?: readonly K[];
|
|
76
|
+
rightDefaultChecked?: readonly K[];
|
|
77
|
+
targetOrder?: "original" | "push" | "unshift";
|
|
78
|
+
oneWay?: boolean;
|
|
79
|
+
draggable?: boolean;
|
|
80
|
+
dragChecked?: boolean;
|
|
81
|
+
animated?: boolean;
|
|
82
|
+
size?: "sm" | "md" | "lg";
|
|
83
|
+
listHeight?: number;
|
|
84
|
+
listStyle?: CSSProperties;
|
|
85
|
+
operationStyle?: CSSProperties;
|
|
86
|
+
status?: "error" | "warning";
|
|
87
|
+
pagination?: boolean | HysTransferPagination;
|
|
88
|
+
pages?: Partial<Record<HysTransferSide, number>>;
|
|
89
|
+
pageSizes?: Partial<Record<HysTransferSide, number>>;
|
|
90
|
+
virtual?: boolean;
|
|
91
|
+
itemHeight?: number;
|
|
92
|
+
overscan?: number;
|
|
93
|
+
locale?: Partial<HysTransferLocale>;
|
|
94
|
+
format?: (info: HysTransferHeaderInfo) => string;
|
|
95
|
+
renderContent?: (option: T, side: HysTransferSide) => VNodeChild;
|
|
96
|
+
ariaLabel?: string;
|
|
97
|
+
validateEvent?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface HysTransferPanelContext<T extends object, K extends HysTransferKey> {
|
|
100
|
+
side: HysTransferSide;
|
|
101
|
+
items: T[];
|
|
102
|
+
filteredItems: T[];
|
|
103
|
+
checkedKeys: K[];
|
|
104
|
+
disabled: boolean;
|
|
105
|
+
query: string;
|
|
106
|
+
check: (key: K, checked?: boolean) => Promise<boolean>;
|
|
107
|
+
setCheckedKeys: (keys: readonly K[]) => Promise<boolean>;
|
|
108
|
+
checkAll: (checked?: boolean) => Promise<boolean>;
|
|
109
|
+
remove: (keys: readonly K[]) => Promise<boolean>;
|
|
110
|
+
}
|
|
111
|
+
export interface HysTransferInstance<T extends object = HysTransferOption, K extends HysTransferKey = HysTransferKey> {
|
|
112
|
+
readonly element: HTMLElement | undefined;
|
|
113
|
+
readonly targetKeys: K[];
|
|
114
|
+
readonly checkedKeys: K[];
|
|
115
|
+
getCheckedKeys: (side?: HysTransferSide) => K[];
|
|
116
|
+
getTargetItems: () => T[];
|
|
117
|
+
move: (direction: HysTransferSide, keys?: readonly K[]) => Promise<boolean>;
|
|
118
|
+
remove: (keys: readonly K[]) => Promise<boolean>;
|
|
119
|
+
setCheckedKeys: (keys: readonly K[]) => Promise<boolean>;
|
|
120
|
+
clearChecked: (side?: HysTransferSide) => Promise<boolean>;
|
|
121
|
+
checkAll: (side: HysTransferSide, checked?: boolean, scope?: "page" | "filtered" | "all") => Promise<boolean>;
|
|
122
|
+
invertSelection: (side: HysTransferSide, scope?: "page" | "filtered" | "all") => Promise<boolean>;
|
|
123
|
+
setSearch: (side: HysTransferSide, value: string) => void;
|
|
124
|
+
clearSearch: (side?: HysTransferSide) => void;
|
|
125
|
+
setPage: (side: HysTransferSide, page: number) => void;
|
|
126
|
+
setPageSize: (side: HysTransferSide, size: number) => void;
|
|
127
|
+
scrollTo: (side: HysTransferSide, options: {
|
|
128
|
+
key?: K;
|
|
129
|
+
top?: number;
|
|
130
|
+
behavior?: ScrollBehavior;
|
|
131
|
+
}) => Promise<void>;
|
|
132
|
+
focus: (side?: HysTransferSide) => void;
|
|
133
|
+
}
|
|
134
|
+
export declare const transferToken: (key: HysTransferKey) => string;
|
|
135
|
+
export interface HysTransferSlots<T extends object, K extends HysTransferKey> {
|
|
136
|
+
default?: (props: {
|
|
137
|
+
option: T;
|
|
138
|
+
label: string;
|
|
139
|
+
side: HysTransferSide;
|
|
140
|
+
checked: boolean;
|
|
141
|
+
disabled: boolean;
|
|
142
|
+
}) => any;
|
|
143
|
+
option?: (props: {
|
|
144
|
+
option: T;
|
|
145
|
+
label: string;
|
|
146
|
+
side: HysTransferSide;
|
|
147
|
+
checked: boolean;
|
|
148
|
+
disabled: boolean;
|
|
149
|
+
}) => any;
|
|
150
|
+
panel?: (props: HysTransferPanelContext<T, K>) => any;
|
|
151
|
+
header?: (props: {
|
|
152
|
+
info: HysTransferHeaderInfo;
|
|
153
|
+
side: HysTransferSide;
|
|
154
|
+
allChecked: boolean;
|
|
155
|
+
indeterminate: boolean;
|
|
156
|
+
checkAll: (checked?: boolean) => Promise<boolean>;
|
|
157
|
+
}) => any;
|
|
158
|
+
footer?: (props: HysTransferPanelContext<T, K>) => any;
|
|
159
|
+
"left-footer"?: (props: HysTransferPanelContext<T, K>) => any;
|
|
160
|
+
"right-footer"?: (props: HysTransferPanelContext<T, K>) => any;
|
|
161
|
+
empty?: (props: HysTransferPanelContext<T, K>) => any;
|
|
162
|
+
"left-empty"?: (props: HysTransferPanelContext<T, K>) => any;
|
|
163
|
+
"right-empty"?: (props: HysTransferPanelContext<T, K>) => any;
|
|
164
|
+
loading?: (props: {
|
|
165
|
+
side: HysTransferSide;
|
|
166
|
+
}) => any;
|
|
167
|
+
operations?: (props: {
|
|
168
|
+
move: (side: HysTransferSide, keys?: readonly K[]) => Promise<boolean>;
|
|
169
|
+
disabled: boolean;
|
|
170
|
+
leftChecked: K[];
|
|
171
|
+
rightChecked: K[];
|
|
172
|
+
}) => any;
|
|
173
|
+
}
|
|
174
|
+
export declare function transferValue(option: object, path: string): unknown;
|
|
175
|
+
export declare function transferRows<T extends object, K extends HysTransferKey>(props: Pick<HysTransferProps<T, K>, "options" | "fieldNames" | "rowKey">): {
|
|
176
|
+
rows: HysTransferRecord<T, K>[];
|
|
177
|
+
map: Map<K, HysTransferRecord<T, K>>;
|
|
178
|
+
};
|
|
179
|
+
export declare const transferWords: (locale?: Partial<HysTransferLocale>) => HysTransferLocale;
|
|
180
|
+
export declare const transferLabel: (text: string, values: Record<string, string | number>) => string;
|