hys-ui 0.2.0 → 0.4.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 +59 -0
- package/README.md +68 -59
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -142
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +491 -85
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +291 -63
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +118 -80
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/config.js +11 -11
- package/dist/index.js +175 -153
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +185 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +7 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +119 -6
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +22 -3
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import type { StyleValue, VNodeChild } from "vue";
|
|
2
|
+
import type { Placement } from "./useFloating";
|
|
3
|
+
import type { HysPopupMotionProps } from "../motion/popup";
|
|
4
|
+
export interface HysMentionUser {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface HysMentionOption {
|
|
10
|
+
id?: string | number;
|
|
11
|
+
value: string | number;
|
|
12
|
+
label?: string | ((option: HysMentionOption) => VNodeChild);
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
prefix?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
avatar?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
group?: string;
|
|
19
|
+
keywords?: readonly string[];
|
|
20
|
+
recommended?: boolean;
|
|
21
|
+
class?: string;
|
|
22
|
+
style?: StyleValue;
|
|
23
|
+
payload?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface HysMentionContext {
|
|
26
|
+
prefix: string;
|
|
27
|
+
query: string;
|
|
28
|
+
start: number;
|
|
29
|
+
end: number;
|
|
30
|
+
manual?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface HysMentionFieldNames {
|
|
33
|
+
value?: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
disabled?: string;
|
|
36
|
+
id?: string;
|
|
37
|
+
group?: string;
|
|
38
|
+
avatar?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
}
|
|
42
|
+
export type HysMentionDataOption = HysMentionOption | Record<string, unknown>;
|
|
43
|
+
export interface HysMentionLoadContext extends HysMentionContext {
|
|
44
|
+
signal: AbortSignal;
|
|
45
|
+
text: string;
|
|
46
|
+
page: number;
|
|
47
|
+
pageSize: number;
|
|
48
|
+
cursor?: string | number;
|
|
49
|
+
}
|
|
50
|
+
export interface HysMentionPage {
|
|
51
|
+
items: readonly HysMentionDataOption[];
|
|
52
|
+
hasMore?: boolean;
|
|
53
|
+
nextCursor?: string | number | null;
|
|
54
|
+
total?: number;
|
|
55
|
+
}
|
|
56
|
+
export type HysMentionLoader = (context: HysMentionLoadContext) => readonly HysMentionDataOption[] | HysMentionPage | Promise<readonly HysMentionDataOption[] | HysMentionPage>;
|
|
57
|
+
export type HysMentionFilter = boolean | ((query: string, option: HysMentionOption, prefix: string) => boolean);
|
|
58
|
+
export type HysMentionSearchField = string | ((option: HysMentionOption) => unknown);
|
|
59
|
+
export type HysMentionSearchMode = "includes" | "fuzzy" | "pinyin" | "initials";
|
|
60
|
+
export type HysMentionMatch = (context: {
|
|
61
|
+
text: string;
|
|
62
|
+
caret: number;
|
|
63
|
+
prefix: string;
|
|
64
|
+
}) => {
|
|
65
|
+
start: number;
|
|
66
|
+
query: string;
|
|
67
|
+
} | null | undefined;
|
|
68
|
+
export interface HysMentionTrigger {
|
|
69
|
+
prefix: string;
|
|
70
|
+
minQueryLength?: number;
|
|
71
|
+
boundary?: "any" | "word" | ((text: string, index: number) => boolean);
|
|
72
|
+
allowSpaces?: boolean;
|
|
73
|
+
match?: HysMentionMatch;
|
|
74
|
+
split?: string;
|
|
75
|
+
type?: string;
|
|
76
|
+
options?: readonly HysMentionDataOption[];
|
|
77
|
+
loadOptions?: HysMentionLoader;
|
|
78
|
+
filterOption?: HysMentionFilter;
|
|
79
|
+
searchMode?: HysMentionSearchMode | readonly HysMentionSearchMode[];
|
|
80
|
+
formatMention?: HysMentionProps["formatMention"];
|
|
81
|
+
allowCreate?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface HysMentionSource {
|
|
84
|
+
key: string;
|
|
85
|
+
prefixes?: readonly string[];
|
|
86
|
+
group?: string;
|
|
87
|
+
options?: readonly HysMentionDataOption[];
|
|
88
|
+
loadOptions?: HysMentionLoader;
|
|
89
|
+
fieldNames?: HysMentionFieldNames;
|
|
90
|
+
}
|
|
91
|
+
export interface HysMentionEntity {
|
|
92
|
+
id: string | number;
|
|
93
|
+
value: string | number;
|
|
94
|
+
label: string;
|
|
95
|
+
type: string;
|
|
96
|
+
prefix: string;
|
|
97
|
+
text: string;
|
|
98
|
+
start: number;
|
|
99
|
+
end: number;
|
|
100
|
+
payload?: unknown;
|
|
101
|
+
}
|
|
102
|
+
export interface HysMentionDocument {
|
|
103
|
+
text: string;
|
|
104
|
+
entities: HysMentionEntity[];
|
|
105
|
+
}
|
|
106
|
+
export interface HysMentionOpenOptions {
|
|
107
|
+
prefix?: string;
|
|
108
|
+
query?: string;
|
|
109
|
+
position?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface HysMentionInsertOptions {
|
|
112
|
+
prefix?: string;
|
|
113
|
+
start?: number;
|
|
114
|
+
end?: number;
|
|
115
|
+
focus?: boolean;
|
|
116
|
+
}
|
|
117
|
+
export interface HysMentionAutosize {
|
|
118
|
+
minRows?: number;
|
|
119
|
+
maxRows?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface HysMentionLocale {
|
|
122
|
+
input: string;
|
|
123
|
+
list: string;
|
|
124
|
+
placeholder: string;
|
|
125
|
+
loading: string;
|
|
126
|
+
empty: string;
|
|
127
|
+
error: string;
|
|
128
|
+
retry: string;
|
|
129
|
+
more: string;
|
|
130
|
+
recent: string;
|
|
131
|
+
recommended: string;
|
|
132
|
+
clear: string;
|
|
133
|
+
create: string;
|
|
134
|
+
}
|
|
135
|
+
export interface HysMentionSlots {
|
|
136
|
+
prefix?: () => VNodeChild;
|
|
137
|
+
suffix?: () => VNodeChild;
|
|
138
|
+
"clear-icon"?: () => VNodeChild;
|
|
139
|
+
count?: (props: {
|
|
140
|
+
count: number;
|
|
141
|
+
max?: number;
|
|
142
|
+
}) => VNodeChild;
|
|
143
|
+
option?: (props: {
|
|
144
|
+
user: HysMentionUser;
|
|
145
|
+
option: HysMentionOption;
|
|
146
|
+
context?: HysMentionContext;
|
|
147
|
+
created: boolean;
|
|
148
|
+
}) => VNodeChild;
|
|
149
|
+
avatar?: (props: {
|
|
150
|
+
option: HysMentionOption;
|
|
151
|
+
}) => VNodeChild;
|
|
152
|
+
group?: (props: {
|
|
153
|
+
label: string;
|
|
154
|
+
context?: HysMentionContext;
|
|
155
|
+
}) => VNodeChild;
|
|
156
|
+
header?: (props: {
|
|
157
|
+
context?: HysMentionContext;
|
|
158
|
+
}) => VNodeChild;
|
|
159
|
+
footer?: (props: {
|
|
160
|
+
context?: HysMentionContext;
|
|
161
|
+
hasMore: boolean;
|
|
162
|
+
loadMore: () => Promise<boolean>;
|
|
163
|
+
}) => VNodeChild;
|
|
164
|
+
loading?: () => VNodeChild;
|
|
165
|
+
empty?: () => VNodeChild;
|
|
166
|
+
error?: (props: {
|
|
167
|
+
error: unknown;
|
|
168
|
+
retry: () => void;
|
|
169
|
+
context?: HysMentionContext;
|
|
170
|
+
}) => VNodeChild;
|
|
171
|
+
}
|
|
172
|
+
export type HysMentionAction = "next" | "previous" | "first" | "last" | "select" | "close" | "open" | "retry";
|
|
173
|
+
export interface HysMentionInstance {
|
|
174
|
+
readonly input: HTMLElement | undefined;
|
|
175
|
+
readonly dropdownVisible: boolean;
|
|
176
|
+
focus: () => void;
|
|
177
|
+
blur: () => void;
|
|
178
|
+
open: (options?: HysMentionOpenOptions) => boolean;
|
|
179
|
+
close: () => void;
|
|
180
|
+
update: () => void;
|
|
181
|
+
retry: () => void;
|
|
182
|
+
loadMore: () => Promise<boolean>;
|
|
183
|
+
insertMention: (option: HysMentionOption, options?: HysMentionInsertOptions) => Promise<boolean>;
|
|
184
|
+
removeMention: (target: HysMentionEntity | string | number) => Promise<boolean>;
|
|
185
|
+
getEntities: () => HysMentionEntity[];
|
|
186
|
+
getDocument: () => HysMentionDocument;
|
|
187
|
+
setDocument: (document: HysMentionDocument | string) => Promise<boolean>;
|
|
188
|
+
serialize: () => string;
|
|
189
|
+
clear: () => Promise<boolean>;
|
|
190
|
+
undo: () => Promise<boolean>;
|
|
191
|
+
redo: () => Promise<boolean>;
|
|
192
|
+
}
|
|
193
|
+
export interface HysMentionProps extends HysPopupMotionProps {
|
|
194
|
+
modelValue?: string;
|
|
195
|
+
users?: readonly HysMentionUser[];
|
|
196
|
+
/** 候选选项。提供时优先于 users。 */
|
|
197
|
+
options?: readonly HysMentionDataOption[];
|
|
198
|
+
fieldNames?: HysMentionFieldNames;
|
|
199
|
+
/** 输入触发词后按当前关键字加载候选。过期请求会被取消。 */
|
|
200
|
+
loadOptions?: HysMentionLoader;
|
|
201
|
+
sources?: readonly HysMentionSource[];
|
|
202
|
+
debounce?: number;
|
|
203
|
+
throttle?: number;
|
|
204
|
+
pageSize?: number;
|
|
205
|
+
cache?: boolean | {
|
|
206
|
+
ttl?: number;
|
|
207
|
+
maxEntries?: number;
|
|
208
|
+
};
|
|
209
|
+
historyKey?: string;
|
|
210
|
+
recentLimit?: number;
|
|
211
|
+
recommendations?: readonly HysMentionOption[];
|
|
212
|
+
recommendOnFocus?: boolean;
|
|
213
|
+
minQueryLength?: number;
|
|
214
|
+
defaultValue?: string;
|
|
215
|
+
/** 提及触发词,可传多个前缀。 */
|
|
216
|
+
prefix?: string | readonly string[];
|
|
217
|
+
triggers?: readonly HysMentionTrigger[];
|
|
218
|
+
boundary?: HysMentionTrigger["boundary"];
|
|
219
|
+
allowSpaces?: boolean;
|
|
220
|
+
matchTrigger?: HysMentionMatch;
|
|
221
|
+
/** 选择候选后插入的分隔符。 */
|
|
222
|
+
split?: string;
|
|
223
|
+
filterOption?: HysMentionFilter;
|
|
224
|
+
searchMode?: HysMentionTrigger["searchMode"];
|
|
225
|
+
searchFields?: readonly HysMentionSearchField[];
|
|
226
|
+
sortOptions?: boolean | ((a: HysMentionOption, b: HysMentionOption, context: HysMentionContext) => number);
|
|
227
|
+
groupBy?: (option: HysMentionOption, context: HysMentionContext) => string | undefined;
|
|
228
|
+
validateSearch?: (query: string, context: HysMentionContext) => boolean;
|
|
229
|
+
whole?: boolean;
|
|
230
|
+
checkIsWhole?: (value: string, prefix: string) => boolean;
|
|
231
|
+
validateEntity?: (entity: HysMentionEntity) => boolean;
|
|
232
|
+
invalidEntity?: "mark" | "text" | "remove";
|
|
233
|
+
canSelect?: (option: HysMentionOption, context: HysMentionContext) => boolean;
|
|
234
|
+
beforeRemove?: (entity: HysMentionEntity) => boolean;
|
|
235
|
+
parseEntities?: (text: string) => readonly HysMentionEntity[];
|
|
236
|
+
highlightMentions?: boolean;
|
|
237
|
+
entityClass?: string | ((entity: HysMentionEntity) => string);
|
|
238
|
+
allowCreate?: boolean;
|
|
239
|
+
createOption?: (context: HysMentionContext) => HysMentionOption | false;
|
|
240
|
+
/** 自定义写入的提及文本,包含所需前缀。组件会追加 split。 */
|
|
241
|
+
formatMention?: (option: HysMentionOption, context: HysMentionContext) => string;
|
|
242
|
+
/** 替换光标后的同一提及词尾。默认保留光标后的文本。 */
|
|
243
|
+
replaceRest?: boolean;
|
|
244
|
+
selectOnTab?: boolean;
|
|
245
|
+
highlightMatch?: boolean;
|
|
246
|
+
loading?: boolean;
|
|
247
|
+
notFoundText?: string;
|
|
248
|
+
errorText?: string;
|
|
249
|
+
maxOptions?: number;
|
|
250
|
+
placement?: Placement;
|
|
251
|
+
showArrow?: boolean;
|
|
252
|
+
offset?: number;
|
|
253
|
+
autoAdjustOverflow?: boolean;
|
|
254
|
+
popupWidth?: string | number;
|
|
255
|
+
popupMaxHeight?: string | number;
|
|
256
|
+
zIndex?: number;
|
|
257
|
+
virtual?: boolean;
|
|
258
|
+
itemHeight?: number;
|
|
259
|
+
overscan?: number;
|
|
260
|
+
appendTo?: string | HTMLElement | false;
|
|
261
|
+
popupClass?: string;
|
|
262
|
+
popupStyle?: StyleValue;
|
|
263
|
+
type?: "text" | "textarea" | "rich";
|
|
264
|
+
rows?: number;
|
|
265
|
+
name?: string;
|
|
266
|
+
autofocus?: boolean;
|
|
267
|
+
placeholder?: string;
|
|
268
|
+
disabled?: boolean;
|
|
269
|
+
readonly?: boolean;
|
|
270
|
+
maxlength?: number;
|
|
271
|
+
minlength?: number;
|
|
272
|
+
required?: boolean;
|
|
273
|
+
clearable?: boolean;
|
|
274
|
+
showCount?: boolean;
|
|
275
|
+
autosize?: boolean | HysMentionAutosize;
|
|
276
|
+
restoreFocus?: boolean;
|
|
277
|
+
shortcuts?: Partial<Record<string, HysMentionAction>>;
|
|
278
|
+
locale?: Partial<HysMentionLocale>;
|
|
279
|
+
defaultEntities?: readonly HysMentionEntity[];
|
|
280
|
+
entities?: readonly HysMentionEntity[];
|
|
281
|
+
ariaLabel?: string;
|
|
282
|
+
status?: "error" | "warning";
|
|
283
|
+
size?: "sm" | "md" | "lg";
|
|
284
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HysMentionContext, HysMentionDocument, HysMentionEntity, HysMentionProps, HysMentionTrigger } from "./mention";
|
|
2
|
+
export declare function mentionTriggers(props: HysMentionProps): HysMentionTrigger[];
|
|
3
|
+
export declare function matchMention(text: string, caret: number, rules: readonly HysMentionTrigger[], defaults: Pick<HysMentionProps, "boundary" | "allowSpaces" | "matchTrigger" | "split">): HysMentionContext | undefined;
|
|
4
|
+
export declare function normalizeMentionEntities(text: string, input: readonly HysMentionEntity[]): HysMentionEntity[];
|
|
5
|
+
export declare function serializeMentionDocument(document: HysMentionDocument): string;
|
|
6
|
+
export declare function deserializeMentionDocument(source: string): HysMentionDocument;
|
|
7
|
+
export declare function rebaseMentionEntities(before: HysMentionDocument, text: string, range?: {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
}): HysMentionEntity[];
|
|
11
|
+
export declare function mentionSegments(text: string, entities: readonly HysMentionEntity[]): {
|
|
12
|
+
text: string;
|
|
13
|
+
start: number;
|
|
14
|
+
entity?: HysMentionEntity;
|
|
15
|
+
}[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MentionSelection {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function isNativeMentionInput(element: HTMLElement): element is HTMLInputElement | HTMLTextAreaElement;
|
|
6
|
+
export declare function readMentionSelection(element: HTMLElement, fallback: number): MentionSelection;
|
|
7
|
+
export declare function writeMentionSelection(element: HTMLElement, selection: MentionSelection): void;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { HysPopupMotionProps } from "../motion/popup";
|
|
2
|
+
import { type Component, type CSSProperties, type VNodeChild } from "vue";
|
|
3
|
+
import type { Placement } from "./useFloating";
|
|
4
|
+
export type HysMenuKey = string | number;
|
|
5
|
+
export type HysContextMenuTrigger = "contextmenu" | "click" | "hover" | "focus";
|
|
6
|
+
export interface HysContextMenuItem {
|
|
7
|
+
label: string;
|
|
8
|
+
value?: HysMenuKey;
|
|
9
|
+
type?: "item" | "divider" | "group" | "checkbox" | "radio";
|
|
10
|
+
children?: readonly HysContextMenuItem[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
icon?: Component;
|
|
15
|
+
description?: string;
|
|
16
|
+
shortcut?: string;
|
|
17
|
+
href?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
rel?: string;
|
|
20
|
+
checked?: boolean;
|
|
21
|
+
radioGroup?: HysMenuKey;
|
|
22
|
+
closeOnSelect?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface HysMenuFieldNames {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
children: string;
|
|
28
|
+
disabled: string;
|
|
29
|
+
hidden: string;
|
|
30
|
+
type: string;
|
|
31
|
+
icon: string;
|
|
32
|
+
description: string;
|
|
33
|
+
shortcut: string;
|
|
34
|
+
href: string;
|
|
35
|
+
target: string;
|
|
36
|
+
rel: string;
|
|
37
|
+
danger: string;
|
|
38
|
+
checked: string;
|
|
39
|
+
radioGroup: string;
|
|
40
|
+
closeOnSelect: string;
|
|
41
|
+
}
|
|
42
|
+
export interface HysMenuSelectInfo<N extends object = HysContextMenuItem> {
|
|
43
|
+
item: N;
|
|
44
|
+
path: readonly N[];
|
|
45
|
+
keys: readonly HysMenuKey[];
|
|
46
|
+
event: MouseEvent | KeyboardEvent | undefined;
|
|
47
|
+
checked?: boolean;
|
|
48
|
+
checkedKeys: readonly HysMenuKey[];
|
|
49
|
+
selectedKeys: readonly HysMenuKey[];
|
|
50
|
+
}
|
|
51
|
+
export interface HysMenuShowOptions {
|
|
52
|
+
x?: number;
|
|
53
|
+
y?: number;
|
|
54
|
+
focus?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface HysContextMenuProps<N extends object = HysContextMenuItem> extends HysPopupMotionProps {
|
|
57
|
+
items: readonly N[];
|
|
58
|
+
fieldNames?: Partial<HysMenuFieldNames>;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
loading?: boolean;
|
|
61
|
+
size?: "sm" | "md" | "lg";
|
|
62
|
+
trigger?: HysContextMenuTrigger | readonly HysContextMenuTrigger[];
|
|
63
|
+
open?: boolean;
|
|
64
|
+
defaultOpen?: boolean;
|
|
65
|
+
openPath?: readonly HysMenuKey[];
|
|
66
|
+
defaultOpenPath?: readonly HysMenuKey[];
|
|
67
|
+
checkedKeys?: readonly HysMenuKey[];
|
|
68
|
+
defaultCheckedKeys?: readonly HysMenuKey[];
|
|
69
|
+
selectedKeys?: readonly HysMenuKey[];
|
|
70
|
+
defaultSelectedKeys?: readonly HysMenuKey[];
|
|
71
|
+
selectable?: boolean;
|
|
72
|
+
multiple?: boolean;
|
|
73
|
+
hideOnClick?: boolean;
|
|
74
|
+
autofocus?: boolean;
|
|
75
|
+
loopNavigation?: boolean;
|
|
76
|
+
showDelay?: number;
|
|
77
|
+
hideDelay?: number;
|
|
78
|
+
submenuDelay?: number;
|
|
79
|
+
submenuTrigger?: "hover" | "click";
|
|
80
|
+
placement?: Placement;
|
|
81
|
+
appendTo?: string | HTMLElement | false;
|
|
82
|
+
width?: string | number;
|
|
83
|
+
minWidth?: number;
|
|
84
|
+
maxWidth?: number;
|
|
85
|
+
maxHeight?: number;
|
|
86
|
+
arrow?: boolean;
|
|
87
|
+
popupClass?: string;
|
|
88
|
+
popupStyle?: CSSProperties;
|
|
89
|
+
direction?: "ltr" | "rtl";
|
|
90
|
+
ariaLabel?: string;
|
|
91
|
+
emptyText?: string;
|
|
92
|
+
loadingText?: string;
|
|
93
|
+
backText?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface HysContextMenuInstance<N extends object = HysContextMenuItem> {
|
|
96
|
+
readonly element: HTMLElement | undefined;
|
|
97
|
+
readonly open: boolean;
|
|
98
|
+
readonly checkedKeys: HysMenuKey[];
|
|
99
|
+
readonly selectedKeys: HysMenuKey[];
|
|
100
|
+
readonly openPath: HysMenuKey[];
|
|
101
|
+
focus: () => void;
|
|
102
|
+
blur: () => void;
|
|
103
|
+
show: (event?: MouseEvent | KeyboardEvent | HysMenuShowOptions) => Promise<boolean>;
|
|
104
|
+
showAt: (x: number, y: number, focus?: boolean) => Promise<boolean>;
|
|
105
|
+
hide: (restoreFocus?: boolean) => Promise<boolean>;
|
|
106
|
+
handleOpen: () => Promise<boolean>;
|
|
107
|
+
handleClose: () => Promise<boolean>;
|
|
108
|
+
toggle: () => Promise<boolean>;
|
|
109
|
+
focusItem: (key: HysMenuKey) => Promise<boolean>;
|
|
110
|
+
openSubmenu: (key: HysMenuKey) => Promise<boolean>;
|
|
111
|
+
closeSubmenus: () => Promise<boolean>;
|
|
112
|
+
setCheckedKeys: (keys: readonly HysMenuKey[]) => Promise<boolean>;
|
|
113
|
+
setSelectedKeys: (keys: readonly HysMenuKey[]) => Promise<boolean>;
|
|
114
|
+
getItems: () => N[];
|
|
115
|
+
}
|
|
116
|
+
export interface HysMenuItemContext<N extends object = HysContextMenuItem> {
|
|
117
|
+
item: N;
|
|
118
|
+
value: HysMenuKey | undefined;
|
|
119
|
+
label: string;
|
|
120
|
+
path: readonly N[];
|
|
121
|
+
keys: readonly HysMenuKey[];
|
|
122
|
+
level: number;
|
|
123
|
+
disabled: boolean;
|
|
124
|
+
checked: boolean;
|
|
125
|
+
selected: boolean;
|
|
126
|
+
expanded: boolean;
|
|
127
|
+
submenu: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface HysContextMenuSlots<N extends object = HysContextMenuItem> {
|
|
130
|
+
default?: (scope: {
|
|
131
|
+
open: boolean;
|
|
132
|
+
show: HysContextMenuInstance<N>["show"];
|
|
133
|
+
hide: HysContextMenuInstance<N>["hide"];
|
|
134
|
+
toggle: HysContextMenuInstance<N>["toggle"];
|
|
135
|
+
attrs: Record<string, unknown>;
|
|
136
|
+
}) => VNodeChild;
|
|
137
|
+
item?: (scope: HysMenuItemContext<N>) => VNodeChild;
|
|
138
|
+
icon?: (scope: HysMenuItemContext<N>) => VNodeChild;
|
|
139
|
+
link?: (scope: HysMenuItemContext<N> & {
|
|
140
|
+
attrs: Record<string, unknown>;
|
|
141
|
+
}) => VNodeChild;
|
|
142
|
+
header?: (scope: {
|
|
143
|
+
close: () => Promise<boolean>;
|
|
144
|
+
}) => VNodeChild;
|
|
145
|
+
footer?: (scope: {
|
|
146
|
+
close: () => Promise<boolean>;
|
|
147
|
+
}) => VNodeChild;
|
|
148
|
+
empty?: () => VNodeChild;
|
|
149
|
+
loading?: () => VNodeChild;
|
|
150
|
+
}
|
|
151
|
+
export interface MenuRow<N extends object> {
|
|
152
|
+
id: string;
|
|
153
|
+
raw: N;
|
|
154
|
+
key?: HysMenuKey;
|
|
155
|
+
label: string;
|
|
156
|
+
type: NonNullable<HysContextMenuItem["type"]>;
|
|
157
|
+
disabled: boolean;
|
|
158
|
+
danger: boolean;
|
|
159
|
+
icon?: Component;
|
|
160
|
+
description: string;
|
|
161
|
+
shortcut: string;
|
|
162
|
+
href?: string;
|
|
163
|
+
target?: string;
|
|
164
|
+
rel?: string;
|
|
165
|
+
radioGroup?: HysMenuKey;
|
|
166
|
+
checked: boolean;
|
|
167
|
+
closeOnSelect?: boolean;
|
|
168
|
+
children: MenuRow<N>[];
|
|
169
|
+
parents: MenuRow<N>[];
|
|
170
|
+
path: N[];
|
|
171
|
+
keys: HysMenuKey[];
|
|
172
|
+
level: number;
|
|
173
|
+
}
|
|
174
|
+
export declare const menuToken: (key: HysMenuKey) => string;
|
|
175
|
+
export declare function menuKeys(keys: readonly HysMenuKey[] | undefined): HysMenuKey[];
|
|
176
|
+
export declare const menuKeysEqual: (a: readonly HysMenuKey[], b: readonly HysMenuKey[]) => boolean;
|
|
177
|
+
export declare function menuField(item: object, path: string): unknown;
|
|
178
|
+
export declare const menuSafeRel: (target?: string, rel?: string) => string | undefined;
|
|
179
|
+
export declare function menuRows<N extends object>(items: readonly N[], fields?: Partial<HysMenuFieldNames>): {
|
|
180
|
+
roots: MenuRow<N>[];
|
|
181
|
+
all: MenuRow<N>[];
|
|
182
|
+
byKey: Map<string, MenuRow<N>>;
|
|
183
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import type { Component, CSSProperties, TransitionProps, VNodeChild } from "vue";
|
|
2
|
+
import type { HysButtonProps, HysButtonVariant } from "../components/HysButton/HysButton.vue";
|
|
3
|
+
export type HysModalCloseReason = "mask" | "escape" | "button" | "cancel" | "confirm" | "api";
|
|
4
|
+
export type HysModalType = "default" | "confirm" | "info" | "success" | "warning" | "error";
|
|
5
|
+
export type HysModalInitialFocus = "auto" | "dialog" | "confirm" | "cancel" | false | string | InstanceType<typeof HTMLElement>;
|
|
6
|
+
export type HysModalSizeName = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
7
|
+
export declare const modalWidths: {
|
|
8
|
+
readonly xs: 360;
|
|
9
|
+
readonly sm: 440;
|
|
10
|
+
readonly md: 560;
|
|
11
|
+
readonly lg: 720;
|
|
12
|
+
readonly xl: 960;
|
|
13
|
+
readonly "2xl": 1200;
|
|
14
|
+
readonly full: "100%";
|
|
15
|
+
};
|
|
16
|
+
export declare const modalWidth: (props: HysModalProps) => string | number;
|
|
17
|
+
export type HysModalSectionSize = "sm" | "md" | "lg";
|
|
18
|
+
export type HysModalDragEffect = "lift" | "outline" | "glow" | "shadow" | "ghost" | "none";
|
|
19
|
+
export interface HysModalActionContext {
|
|
20
|
+
reason: HysModalCloseReason;
|
|
21
|
+
event?: Event;
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
}
|
|
24
|
+
export interface HysModalPosition {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
28
|
+
export interface HysModalSize {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
export type HysModalBeforeClose = {
|
|
33
|
+
invoke(reason: HysModalCloseReason, context: HysModalActionContext): boolean | void | Promise<boolean | void>;
|
|
34
|
+
}["invoke"];
|
|
35
|
+
export interface HysModalProps {
|
|
36
|
+
open?: boolean;
|
|
37
|
+
modelValue?: boolean;
|
|
38
|
+
defaultOpen?: boolean;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
type?: HysModalType;
|
|
42
|
+
showIcon?: boolean;
|
|
43
|
+
/** Background opacity from 0 to 1; does not fade text or controls. */
|
|
44
|
+
opacity?: number;
|
|
45
|
+
/** Mask opacity from 0 to 1; omitted keeps the default mask style. */
|
|
46
|
+
maskOpacity?: number;
|
|
47
|
+
icon?: Component;
|
|
48
|
+
width?: string | number;
|
|
49
|
+
height?: string | number;
|
|
50
|
+
maxHeight?: string | number;
|
|
51
|
+
minWidth?: number;
|
|
52
|
+
minHeight?: number;
|
|
53
|
+
maxWidth?: number;
|
|
54
|
+
size?: HysModalSizeName;
|
|
55
|
+
centered?: boolean;
|
|
56
|
+
top?: string | number;
|
|
57
|
+
center?: boolean;
|
|
58
|
+
fullscreen?: boolean;
|
|
59
|
+
defaultFullscreen?: boolean;
|
|
60
|
+
showFullscreen?: boolean;
|
|
61
|
+
closeOnMask?: boolean;
|
|
62
|
+
closeOnEscape?: boolean;
|
|
63
|
+
showClose?: boolean;
|
|
64
|
+
destroyOnClose?: boolean;
|
|
65
|
+
forceRender?: boolean;
|
|
66
|
+
modal?: boolean;
|
|
67
|
+
modalPenetrable?: boolean;
|
|
68
|
+
appendTo?: string | InstanceType<typeof HTMLElement> | false;
|
|
69
|
+
lockScroll?: boolean;
|
|
70
|
+
trapFocus?: boolean;
|
|
71
|
+
restoreFocus?: boolean;
|
|
72
|
+
initialFocus?: HysModalInitialFocus;
|
|
73
|
+
openDelay?: number;
|
|
74
|
+
closeDelay?: number;
|
|
75
|
+
transition?: string | TransitionProps | false;
|
|
76
|
+
transitionDuration?: number;
|
|
77
|
+
zIndex?: number;
|
|
78
|
+
headerClass?: string;
|
|
79
|
+
headerSize?: HysModalSectionSize;
|
|
80
|
+
footerSize?: HysModalSectionSize;
|
|
81
|
+
/** Minimum height. Content may expand the region to avoid clipping. */
|
|
82
|
+
headerHeight?: string | number;
|
|
83
|
+
footerHeight?: string | number;
|
|
84
|
+
titleFontSize?: string | number;
|
|
85
|
+
bodyClass?: string;
|
|
86
|
+
footerClass?: string;
|
|
87
|
+
overlayClass?: string;
|
|
88
|
+
modalClass?: string;
|
|
89
|
+
headerStyle?: CSSProperties;
|
|
90
|
+
bodyStyle?: CSSProperties;
|
|
91
|
+
footerStyle?: CSSProperties;
|
|
92
|
+
maskStyle?: CSSProperties;
|
|
93
|
+
modalStyle?: CSSProperties;
|
|
94
|
+
ariaLabel?: string;
|
|
95
|
+
ariaLabelledby?: string;
|
|
96
|
+
ariaDescribedby?: string;
|
|
97
|
+
role?: "dialog" | "alertdialog";
|
|
98
|
+
headerAriaLevel?: number;
|
|
99
|
+
closeText?: string;
|
|
100
|
+
fullscreenText?: string;
|
|
101
|
+
restoreText?: string;
|
|
102
|
+
footer?: boolean;
|
|
103
|
+
footerAlign?: "start" | "center" | "end";
|
|
104
|
+
showCancel?: boolean;
|
|
105
|
+
okText?: string;
|
|
106
|
+
cancelText?: string;
|
|
107
|
+
okVariant?: HysButtonVariant;
|
|
108
|
+
okButtonProps?: HysButtonProps;
|
|
109
|
+
cancelButtonProps?: HysButtonProps;
|
|
110
|
+
confirmLoading?: boolean;
|
|
111
|
+
confirmDisabled?: boolean;
|
|
112
|
+
cancelDisabled?: boolean;
|
|
113
|
+
closeWhileConfirming?: boolean;
|
|
114
|
+
loading?: boolean;
|
|
115
|
+
loadingText?: string;
|
|
116
|
+
showError?: boolean;
|
|
117
|
+
errorText?: string | ((error: unknown, action: "confirm" | "close") => string);
|
|
118
|
+
confirmOnCtrlEnter?: boolean;
|
|
119
|
+
closeOnConfirm?: boolean;
|
|
120
|
+
beforeClose?(reason: HysModalCloseReason, context: HysModalActionContext): boolean | void | Promise<boolean | void>;
|
|
121
|
+
beforeConfirm?: (context: HysModalActionContext) => boolean | void | Promise<boolean | void>;
|
|
122
|
+
draggable?: boolean;
|
|
123
|
+
dragHandlePosition?: "center" | "left" | "right" | "both";
|
|
124
|
+
dragMode?: "live" | "preview";
|
|
125
|
+
/** Pointer movement in pixels before a header press becomes a drag. */
|
|
126
|
+
dragThreshold?: number;
|
|
127
|
+
/** Lightweight gesture feedback, activated only at drag start/end. */
|
|
128
|
+
dragEffect?: HysModalDragEffect;
|
|
129
|
+
overflow?: boolean;
|
|
130
|
+
/** Keep the move handle reachable even when the panel may overflow. */
|
|
131
|
+
keepHandleVisible?: boolean;
|
|
132
|
+
resizable?: boolean;
|
|
133
|
+
resetPositionOnClose?: boolean;
|
|
134
|
+
resetSizeOnClose?: boolean;
|
|
135
|
+
/** Retained legacy setting; position in a modal is controlled by centered/top. */
|
|
136
|
+
placement?: "left" | "right" | "top" | "bottom";
|
|
137
|
+
}
|
|
138
|
+
export interface HysModalSlotContext {
|
|
139
|
+
close: (reason?: HysModalCloseReason | Event) => Promise<boolean>;
|
|
140
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
141
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
142
|
+
closing: boolean;
|
|
143
|
+
confirming: boolean;
|
|
144
|
+
busy: boolean;
|
|
145
|
+
error: string;
|
|
146
|
+
titleId: string;
|
|
147
|
+
descriptionId: string;
|
|
148
|
+
fullscreen: boolean;
|
|
149
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
150
|
+
}
|
|
151
|
+
export interface HysModalSlots {
|
|
152
|
+
default?: (context: HysModalSlotContext) => VNodeChild;
|
|
153
|
+
/** Content placed between the overlay and the dialog panel. */
|
|
154
|
+
backdrop?: (context: HysModalSlotContext) => VNodeChild;
|
|
155
|
+
header?: (context: HysModalSlotContext) => VNodeChild;
|
|
156
|
+
footer?: (context: HysModalSlotContext) => VNodeChild;
|
|
157
|
+
icon?: (context: HysModalSlotContext) => VNodeChild;
|
|
158
|
+
loading?: (context: HysModalSlotContext) => VNodeChild;
|
|
159
|
+
"close-icon"?: (context: HysModalSlotContext) => VNodeChild;
|
|
160
|
+
"fullscreen-icon"?: (context: HysModalSlotContext) => VNodeChild;
|
|
161
|
+
}
|
|
162
|
+
export interface HysModalInstance {
|
|
163
|
+
readonly element: HTMLElement | undefined;
|
|
164
|
+
readonly open: boolean;
|
|
165
|
+
readonly closing: boolean;
|
|
166
|
+
readonly confirming: boolean;
|
|
167
|
+
readonly fullscreen: boolean;
|
|
168
|
+
readonly position: HysModalPosition;
|
|
169
|
+
readonly dimensions: HysModalSize | undefined;
|
|
170
|
+
show: () => Promise<boolean>;
|
|
171
|
+
hide: () => Promise<boolean>;
|
|
172
|
+
close: (reason?: HysModalCloseReason) => Promise<boolean>;
|
|
173
|
+
handleOpen: () => Promise<boolean>;
|
|
174
|
+
handleClose: () => Promise<boolean>;
|
|
175
|
+
confirm: (event?: Event) => Promise<boolean>;
|
|
176
|
+
cancel: (event?: Event) => Promise<boolean>;
|
|
177
|
+
focus: () => void;
|
|
178
|
+
toggleFullscreen: () => Promise<boolean>;
|
|
179
|
+
setFullscreen: (value: boolean) => Promise<boolean>;
|
|
180
|
+
resetPosition: () => void;
|
|
181
|
+
resetSize: () => void;
|
|
182
|
+
setPosition: (position: HysModalPosition) => void;
|
|
183
|
+
setSize: (size: HysModalSize) => void;
|
|
184
|
+
}
|
|
185
|
+
export declare const modalLength: (value: string | number | undefined) => string | undefined;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
/** Shared, deterministic overlay stack. Only the topmost layer responds to Escape. */
|
|
2
|
+
import { type InjectionKey, type Ref } from "vue";
|
|
3
|
+
export declare const overlayOwnerKey: InjectionKey<Readonly<Ref<boolean>>>;
|
|
4
|
+
export type OverlayKind = "floating" | "dialog";
|
|
5
|
+
export declare const overlayCount: Ref<number, number>;
|
|
6
|
+
export declare function registerOverlay(kind: OverlayKind, dismiss: () => void, base?: () => number | undefined): {
|
|
4
7
|
id: symbol;
|
|
8
|
+
zIndex: import("vue").ComputedRef<number>;
|
|
5
9
|
isTop: () => boolean;
|
|
6
10
|
unregister: () => void;
|
|
7
11
|
};
|