lew-ui 2.7.71 → 2.7.77
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/dist/_components/CloseButton.vue.d.ts +20 -0
- package/dist/_components/CloseIcon.vue.d.ts +18 -0
- package/dist/_components/CommonInput.vue.d.ts +12 -49
- package/dist/auto-imports.d.ts +86 -0
- package/dist/components/data/collapse/index.d.ts +1 -0
- package/dist/components/data/collapse/src/model.d.ts +14 -0
- package/dist/components/data/collapse/src/props.d.ts +0 -11
- package/dist/components/data/expand/src/LewExpand.vue.d.ts +8 -2
- package/dist/components/data/pagination/index.d.ts +1 -0
- package/dist/components/data/pagination/src/model.d.ts +16 -0
- package/dist/components/data/pagination/src/props.d.ts +0 -18
- package/dist/components/data/table/src/LewTable.vue.d.ts +11 -2
- package/dist/components/data/table/src/props.d.ts +5 -0
- package/dist/components/feedback/alert/src/LewAlert.vue.d.ts +2 -6
- package/dist/components/feedback/alert/src/emits.d.ts +1 -3
- package/dist/components/feedback/drawer/index.d.ts +1 -0
- package/dist/components/feedback/drawer/src/LewDrawer.vue.d.ts +10 -11
- package/dist/components/feedback/drawer/src/model.d.ts +8 -0
- package/dist/components/feedback/drawer/src/props.d.ts +5 -7
- package/dist/components/feedback/modal/index.d.ts +1 -0
- package/dist/components/feedback/modal/src/LewModal.vue.d.ts +5 -5
- package/dist/components/feedback/modal/src/model.d.ts +8 -0
- package/dist/components/feedback/modal/src/props.d.ts +5 -6
- package/dist/components/form/cascader/src/LewCascader.vue.d.ts +100 -100
- package/dist/components/form/cascader/src/emits.d.ts +4 -3
- package/dist/components/form/cascader/src/model.d.ts +2 -1
- package/dist/components/form/cascader/src/props.d.ts +80 -80
- package/dist/components/form/checkbox/src/LewCheckbox.vue.d.ts +54 -54
- package/dist/components/form/checkbox/src/LewCheckboxGroup.vue.d.ts +52 -52
- package/dist/components/form/checkbox/src/props.d.ts +83 -83
- package/dist/components/form/color-picker/src/LewColorPicker.vue.d.ts +32 -32
- package/dist/components/form/color-picker/src/props.d.ts +21 -21
- package/dist/components/form/date-picker/src/LewDatePicker.vue.d.ts +4 -4
- package/dist/components/form/input/src/LewInput.vue.d.ts +4 -35
- package/dist/components/form/input/src/props.d.ts +0 -17
- package/dist/components/form/input-number/src/LewInputNumber.vue.d.ts +6 -10
- package/dist/components/form/input-number/src/emits.d.ts +1 -1
- package/dist/components/form/input-number/src/props.d.ts +0 -4
- package/dist/components/form/input-tag/src/LewInputTag.vue.d.ts +4 -53
- package/dist/components/form/input-tag/src/props.d.ts +0 -5
- package/dist/components/form/select/src/LewSelect.vue.d.ts +33 -88
- package/dist/components/form/tree-select/src/LewTreeSelect.vue.d.ts +12 -88
- package/dist/components/general/tag/src/LewTag.vue.d.ts +47 -8
- package/dist/components/general/tag/src/emits.d.ts +3 -0
- package/dist/components/general/tag/src/props.d.ts +9 -0
- package/dist/components/general/text-trim/index.d.ts +7 -2
- package/dist/components/general/text-trim/src/emits.d.ts +2 -0
- package/dist/components/general/text-trim/src/text-trim.d.ts +1 -1
- package/dist/components/navigation/action-box/index.d.ts +7 -3
- package/dist/components/navigation/action-box/src/LewActionBox.vue.d.ts +6 -2
- package/dist/components/navigation/action-box/src/emits.d.ts +1 -0
- package/dist/components/navigation/back-top/index.d.ts +7 -2
- package/dist/components/navigation/back-top/src/emits.d.ts +2 -0
- package/dist/components/navigation/breadcrumb/index.d.ts +7 -3
- package/dist/components/navigation/breadcrumb/src/LewBreadcrumb.vue.d.ts +2 -2
- package/dist/components/navigation/breadcrumb/src/emits.d.ts +3 -1
- package/dist/components/navigation/dropdown/index.d.ts +8 -3
- package/dist/components/navigation/dropdown/src/emits.d.ts +1 -0
- package/dist/components/navigation/dropdown/src/model.d.ts +8 -0
- package/dist/components/navigation/dropdown/src/props.d.ts +0 -6
- package/dist/components/navigation/menu/index.d.ts +8 -3
- package/dist/components/navigation/menu/src/LewMenu.vue.d.ts +4 -4
- package/dist/components/navigation/menu/src/emits.d.ts +1 -0
- package/dist/components/navigation/menu/src/model.d.ts +7 -0
- package/dist/components/navigation/menu/src/props.d.ts +0 -5
- package/dist/components/navigation/menu-tree/index.d.ts +9 -4
- package/dist/components/navigation/menu-tree/src/emits.d.ts +1 -0
- package/dist/components/navigation/menu-tree/src/model.d.ts +16 -0
- package/dist/components/navigation/menu-tree/src/props.d.ts +0 -13
- package/dist/components/navigation/steps/index.d.ts +8 -3
- package/dist/components/navigation/steps/src/LewSteps.vue.d.ts +10 -6
- package/dist/components/navigation/steps/src/emits.d.ts +1 -0
- package/dist/components/navigation/steps/src/model.d.ts +7 -0
- package/dist/components/navigation/steps/src/props.d.ts +3 -6
- package/dist/directives/context-menu/src/LewContextMenu.vue.d.ts +2 -2
- package/dist/directives/context-menu/src/emits.d.ts +3 -1
- package/dist/env.d.ts +37 -0
- package/dist/global.d.ts +13 -0
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/usePopupManager.d.ts +98 -0
- package/dist/index.css +1 -1
- package/dist/index.js +3108 -2415
- package/dist/index.umd.cjs +1 -1
- package/dist/methods/dialog/src/LewDialog.vue.d.ts +1 -1
- package/dist/methods/notification/src/NotificationContainer.vue.d.ts +6 -0
- package/dist/methods/notification/src/index.d.ts +4 -0
- package/package.json +4 -2
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { LewBackTopEmits, backTopEmits } from './src/emits';
|
|
2
|
+
import { LewBackTopProps, backTopProps } from './src/props';
|
|
3
|
+
import { default as LewBackTop } from './src/LewBackTop.vue';
|
|
4
|
+
export { LewBackTop };
|
|
5
|
+
export type { LewBackTopEmits, LewBackTopProps };
|
|
6
|
+
export { backTopEmits, backTopProps };
|
|
7
|
+
export default LewBackTop;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LewBreadcrumbEmits, breadcrumbEmits } from './src/emits';
|
|
2
|
+
import { LewBreadcrumbProps, breadcrumbProps } from './src/props';
|
|
3
|
+
import { default as LewBreadcrumb } from './src/LewBreadcrumb.vue';
|
|
4
|
+
export { LewBreadcrumb };
|
|
5
|
+
export type { LewBreadcrumbEmits, LewBreadcrumbProps };
|
|
6
|
+
export { breadcrumbEmits, breadcrumbProps };
|
|
7
|
+
export default LewBreadcrumb;
|
|
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
13
13
|
validator: (value: any) => boolean;
|
|
14
14
|
};
|
|
15
15
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
-
change: (item:
|
|
16
|
+
change: (item: LewBreadcrumbOption, index: number) => void;
|
|
17
17
|
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
18
18
|
options: {
|
|
19
19
|
type: PropType<LewBreadcrumbOption[]>;
|
|
@@ -28,7 +28,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
28
28
|
validator: (value: any) => boolean;
|
|
29
29
|
};
|
|
30
30
|
}>> & Readonly<{
|
|
31
|
-
onChange?: ((item:
|
|
31
|
+
onChange?: ((item: LewBreadcrumbOption, index: number) => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
33
|
separator: import('../../../../types').LewBreadcrumbSeparator;
|
|
34
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LewBreadcrumbOption } from '../../../../types';
|
|
1
2
|
export declare const breadcrumbEmits: {
|
|
2
|
-
readonly change: (item:
|
|
3
|
+
readonly change: (item: LewBreadcrumbOption, index: number) => (number | LewBreadcrumbOption)[];
|
|
3
4
|
};
|
|
5
|
+
export type LewBreadcrumbEmits = typeof breadcrumbEmits;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LewDropdownEmits, dropdownEmits } from './src/emits';
|
|
2
|
+
import { DropdownModel, dropdownModel } from './src/model';
|
|
3
|
+
import { LewDropdownProps, dropdownProps } from './src/props';
|
|
4
|
+
import { default as LewDropdown } from './src/LewDropdown.vue';
|
|
5
|
+
export { LewDropdown };
|
|
6
|
+
export type { DropdownModel, LewDropdownEmits, LewDropdownProps };
|
|
7
|
+
export { dropdownEmits, dropdownModel, dropdownProps };
|
|
8
|
+
export default LewDropdown;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { LewContextMenusOption } from '../../../..';
|
|
2
2
|
import { LewPlacement, LewTrigger } from '../../../../types';
|
|
3
3
|
import { ExtractPublicPropTypes, PropType } from 'vue';
|
|
4
|
-
export declare const dropdownModel: {
|
|
5
|
-
selectedKeys: {
|
|
6
|
-
type: PropType<string[]>;
|
|
7
|
-
default: () => never[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
4
|
export declare const dropdownProps: {
|
|
11
5
|
trigger: {
|
|
12
6
|
type: PropType<LewTrigger>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LewMenuEmits, menuEmits } from './src/emits';
|
|
2
|
+
import { MenuModel, menuModel } from './src/model';
|
|
3
|
+
import { LewMenuProps, menuProps } from './src/props';
|
|
4
|
+
import { default as LewMenu } from './src/LewMenu.vue';
|
|
5
|
+
export { LewMenu };
|
|
6
|
+
export type { LewMenuEmits, LewMenuProps, MenuModel };
|
|
7
|
+
export { menuEmits, menuModel, menuProps };
|
|
8
|
+
export default LewMenu;
|
|
@@ -7,11 +7,11 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
7
7
|
validator: (value: any[] | undefined) => boolean;
|
|
8
8
|
};
|
|
9
9
|
modelValue: {
|
|
10
|
-
type: globalThis.PropType<
|
|
10
|
+
type: globalThis.PropType<string>;
|
|
11
11
|
};
|
|
12
12
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
13
|
change: (item: LewMenuOption) => void;
|
|
14
|
-
"update:modelValue": (value:
|
|
14
|
+
"update:modelValue": (value: string) => void;
|
|
15
15
|
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
16
16
|
options: {
|
|
17
17
|
type: PropType<LewMenuOption[]>;
|
|
@@ -20,10 +20,10 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
20
20
|
validator: (value: any[] | undefined) => boolean;
|
|
21
21
|
};
|
|
22
22
|
modelValue: {
|
|
23
|
-
type: globalThis.PropType<
|
|
23
|
+
type: globalThis.PropType<string>;
|
|
24
24
|
};
|
|
25
25
|
}>> & Readonly<{
|
|
26
26
|
onChange?: ((item: LewMenuOption) => any) | undefined;
|
|
27
|
-
"onUpdate:modelValue"?: ((value:
|
|
27
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
29
29
|
export default _default;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { LewMenuOption } from '../../../../types';
|
|
2
2
|
import { ExtractPublicPropTypes, PropType } from 'vue';
|
|
3
|
-
export declare const menuModel: {
|
|
4
|
-
modelValue: {
|
|
5
|
-
type: StringConstructor;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
3
|
export declare const menuProps: {
|
|
9
4
|
options: {
|
|
10
5
|
type: PropType<LewMenuOption[]>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { LewMenuTreeEmits, menuTreeEmits } from './src/emits';
|
|
2
|
+
import { MenuTreeModel, menuTreeModel } from './src/model';
|
|
3
|
+
import { LewMenuTreeItemProps, LewMenuTreeProps, menuTreeItemProps, menuTreeProps } from './src/props';
|
|
4
|
+
import { default as LewMenuTree } from './src/LewMenuTree.vue';
|
|
5
|
+
import { default as LewMenuTreeItem } from './src/LewMenuTreeItem.vue';
|
|
6
|
+
export { LewMenuTree, LewMenuTreeItem };
|
|
7
|
+
export type { LewMenuTreeEmits, LewMenuTreeItemProps, LewMenuTreeProps, MenuTreeModel };
|
|
8
|
+
export { menuTreeEmits, menuTreeItemProps, menuTreeModel, menuTreeProps };
|
|
9
|
+
export default LewMenuTree;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
export declare const menuTreeModel: {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: undefined;
|
|
6
|
+
};
|
|
7
|
+
expandKeys: {
|
|
8
|
+
type: PropType<string[]>;
|
|
9
|
+
default: () => never[];
|
|
10
|
+
};
|
|
11
|
+
collapsed: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type MenuTreeModel = typeof menuTreeModel;
|
|
@@ -2,19 +2,6 @@ import { Property } from 'csstype';
|
|
|
2
2
|
import { LewTagProps } from '../../../..';
|
|
3
3
|
import { LewMenuTreeOption } from '../../../../types';
|
|
4
4
|
import { ExtractPublicPropTypes, PropType } from 'vue';
|
|
5
|
-
export declare const menuTreeModel: {
|
|
6
|
-
modelValue: {
|
|
7
|
-
type: StringConstructor;
|
|
8
|
-
};
|
|
9
|
-
expandKeys: {
|
|
10
|
-
type: PropType<string[]>;
|
|
11
|
-
default: () => never[];
|
|
12
|
-
};
|
|
13
|
-
collapsed: {
|
|
14
|
-
type: BooleanConstructor;
|
|
15
|
-
default: boolean;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
5
|
export declare const menuTreeProps: {
|
|
19
6
|
options: {
|
|
20
7
|
type: PropType<LewMenuTreeOption[]>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { LewStepsEmits, stepsEmits } from './src/emits';
|
|
2
|
+
import { StepsModel, stepsModel } from './src/model';
|
|
3
|
+
import { LewStepsProps, stepsProps } from './src/props';
|
|
4
|
+
import { default as LewSteps } from './src/LewSteps.vue';
|
|
5
|
+
export { LewSteps };
|
|
6
|
+
export type { LewStepsEmits, LewStepsProps, StepsModel };
|
|
7
|
+
export { stepsEmits, stepsModel, stepsProps };
|
|
8
|
+
export default LewSteps;
|
|
@@ -19,17 +19,19 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
19
19
|
canClickItem: {
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
|
+
validator: (value: any) => boolean;
|
|
22
23
|
};
|
|
23
24
|
canCrossSteps: {
|
|
24
25
|
type: BooleanConstructor;
|
|
25
26
|
default: boolean;
|
|
27
|
+
validator: (value: any) => boolean;
|
|
26
28
|
};
|
|
27
29
|
modelValue: {
|
|
28
|
-
type: globalThis.PropType<
|
|
30
|
+
type: globalThis.PropType<number>;
|
|
29
31
|
};
|
|
30
32
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
-
change: (
|
|
32
|
-
"update:modelValue": (value:
|
|
33
|
+
change: (value: number) => void;
|
|
34
|
+
"update:modelValue": (value: number | undefined) => void;
|
|
33
35
|
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
34
36
|
options: {
|
|
35
37
|
type: PropType<import('../../../..').LewStepsOption[]>;
|
|
@@ -51,17 +53,19 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
51
53
|
canClickItem: {
|
|
52
54
|
type: BooleanConstructor;
|
|
53
55
|
default: boolean;
|
|
56
|
+
validator: (value: any) => boolean;
|
|
54
57
|
};
|
|
55
58
|
canCrossSteps: {
|
|
56
59
|
type: BooleanConstructor;
|
|
57
60
|
default: boolean;
|
|
61
|
+
validator: (value: any) => boolean;
|
|
58
62
|
};
|
|
59
63
|
modelValue: {
|
|
60
|
-
type: globalThis.PropType<
|
|
64
|
+
type: globalThis.PropType<number>;
|
|
61
65
|
};
|
|
62
66
|
}>> & Readonly<{
|
|
63
|
-
onChange?: ((
|
|
64
|
-
"onUpdate:modelValue"?: ((value:
|
|
67
|
+
onChange?: ((value: number) => any) | undefined;
|
|
68
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
65
69
|
}>, {
|
|
66
70
|
minWidth: import("csstype").Property.Width<0 | (string & {})>;
|
|
67
71
|
status: import('../../../..').LewStepsStatus;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
2
|
import { LewStepsOption, LewStepsStatus } from '../../../../types';
|
|
3
|
-
import { ExtractPublicPropTypes } from 'vue';
|
|
4
|
-
export declare const stepsModel: {
|
|
5
|
-
modelValue: {
|
|
6
|
-
type: NumberConstructor;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
3
|
+
import { ExtractPublicPropTypes, PropType } from 'vue';
|
|
9
4
|
export declare const stepsProps: {
|
|
10
5
|
options: {
|
|
11
6
|
type: PropType<LewStepsOption[]>;
|
|
@@ -27,10 +22,12 @@ export declare const stepsProps: {
|
|
|
27
22
|
canClickItem: {
|
|
28
23
|
type: BooleanConstructor;
|
|
29
24
|
default: boolean;
|
|
25
|
+
validator: (value: any) => boolean;
|
|
30
26
|
};
|
|
31
27
|
canCrossSteps: {
|
|
32
28
|
type: BooleanConstructor;
|
|
33
29
|
default: boolean;
|
|
30
|
+
validator: (value: any) => boolean;
|
|
34
31
|
};
|
|
35
32
|
};
|
|
36
33
|
export type LewStepsProps = ExtractPublicPropTypes<typeof stepsProps>;
|
|
@@ -23,7 +23,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
23
23
|
validator: (value: any) => boolean;
|
|
24
24
|
};
|
|
25
25
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
-
change: (item:
|
|
26
|
+
change: (item: LewContextMenusOption) => void;
|
|
27
27
|
}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
28
28
|
options: {
|
|
29
29
|
type: PropType<LewContextMenusOption[]>;
|
|
@@ -48,7 +48,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
48
48
|
validator: (value: any) => boolean;
|
|
49
49
|
};
|
|
50
50
|
}>> & Readonly<{
|
|
51
|
-
onChange?: ((item:
|
|
51
|
+
onChange?: ((item: LewContextMenusOption) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
53
|
disabled: boolean;
|
|
54
54
|
options: LewContextMenusOption[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LewContextMenusOption } from '../../../types';
|
|
1
2
|
export declare const contextMenuEmits: {
|
|
2
|
-
readonly change: (item:
|
|
3
|
+
readonly change: (item: LewContextMenusOption) => LewContextMenusOption;
|
|
3
4
|
};
|
|
5
|
+
export type LewContextMenuEmits = typeof contextMenuEmits;
|
package/dist/env.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.vue' {
|
|
4
|
+
import type { DefineComponent } from 'vue'
|
|
5
|
+
|
|
6
|
+
const component: DefineComponent<object, object, any>
|
|
7
|
+
export default component
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare module 'lib/components/collapse/src/LewCollapseTransition.vue' {
|
|
11
|
+
import type { DefineComponent } from 'vue'
|
|
12
|
+
|
|
13
|
+
const component: DefineComponent<object, object, any>
|
|
14
|
+
export default component
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module './src/LewCollapseTransition.vue' {
|
|
18
|
+
import type { DefineComponent } from 'vue'
|
|
19
|
+
|
|
20
|
+
const component: DefineComponent<object, object, any>
|
|
21
|
+
export default component
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module './LewCollapseTransition.vue' {
|
|
25
|
+
import type { DefineComponent } from 'vue'
|
|
26
|
+
|
|
27
|
+
const component: DefineComponent<object, object, any>
|
|
28
|
+
export default component
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// dayjs types are handled by the package itself
|
|
32
|
+
|
|
33
|
+
declare module '@vueuse/core'
|
|
34
|
+
declare module 'lodash-es'
|
|
35
|
+
|
|
36
|
+
// 引入指令的全局类型声明
|
|
37
|
+
/// <reference path="./directives/global.d.ts" />
|
package/dist/global.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LewDirectiveBindings } from './types';
|
|
2
|
+
declare module 'vue' {
|
|
3
|
+
interface ComponentCustomProperties {}
|
|
4
|
+
|
|
5
|
+
interface GlobalDirectives {
|
|
6
|
+
vTooltip: LewDirectiveBindings['tooltip']
|
|
7
|
+
vLoading: LewDirectiveBindings['loading']
|
|
8
|
+
vBacktop: LewDirectiveBindings['backtop']
|
|
9
|
+
vContextMenu: LewDirectiveBindings['context-menu']
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useDOMCreate } from './useDOMCreate';
|
|
2
2
|
import { useEventListener } from './useEventListener';
|
|
3
|
+
import { usePopupManager } from './usePopupManager';
|
|
3
4
|
import { useTreeSelection } from './useTreeSelection';
|
|
4
|
-
export { useDOMCreate, useEventListener, useTreeSelection };
|
|
5
|
+
export { useDOMCreate, useEventListener, usePopupManager, useTreeSelection };
|
|
6
|
+
export type { PopupInstance } from './usePopupManager';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 弹出层实例信息
|
|
4
|
+
*/
|
|
5
|
+
export interface PopupInstance {
|
|
6
|
+
/** 唯一标识 */
|
|
7
|
+
id: string;
|
|
8
|
+
/** 类型:modal 或 drawer */
|
|
9
|
+
type: 'modal' | 'drawer';
|
|
10
|
+
/** 分配的 z-index */
|
|
11
|
+
zIndex: number;
|
|
12
|
+
/** 关闭回调 */
|
|
13
|
+
close: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 全局弹出层管理器
|
|
17
|
+
* 统一管理 Modal 和 Drawer 的 z-index,确保后打开的组件层级更高
|
|
18
|
+
* 支持 ESC 键按最顶层依次关闭
|
|
19
|
+
*/
|
|
20
|
+
declare class PopupManager {
|
|
21
|
+
/** 基础 z-index,从 2001 开始 */
|
|
22
|
+
private static readonly BASE_Z_INDEX;
|
|
23
|
+
/** 当前 z-index 计数器 */
|
|
24
|
+
private currentZIndex;
|
|
25
|
+
/** 弹出层栈,按打开顺序排列,最后一个是最顶层 */
|
|
26
|
+
private stack;
|
|
27
|
+
/** 是否已初始化 ESC 监听 */
|
|
28
|
+
private escInitialized;
|
|
29
|
+
/**
|
|
30
|
+
* 注册弹出层,返回分配的 z-index
|
|
31
|
+
* @param id 唯一标识
|
|
32
|
+
* @param type 类型
|
|
33
|
+
* @param close 关闭回调
|
|
34
|
+
* @returns 分配的 z-index
|
|
35
|
+
*/
|
|
36
|
+
register(id: string, type: 'modal' | 'drawer', close: () => void): number;
|
|
37
|
+
/**
|
|
38
|
+
* 注销弹出层
|
|
39
|
+
* @param id 唯一标识
|
|
40
|
+
*/
|
|
41
|
+
unregister(id: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* 关闭最顶层弹出层
|
|
44
|
+
* @returns 是否成功关闭
|
|
45
|
+
*/
|
|
46
|
+
closeTop(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 检查是否是最顶层弹出层
|
|
49
|
+
* @param id 唯一标识
|
|
50
|
+
* @returns 是否是最顶层
|
|
51
|
+
*/
|
|
52
|
+
isTop(id: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 获取当前栈的长度
|
|
55
|
+
* @returns 栈长度
|
|
56
|
+
*/
|
|
57
|
+
getStackLength(): number;
|
|
58
|
+
/**
|
|
59
|
+
* 获取指定弹出层的信息
|
|
60
|
+
* @param id 唯一标识
|
|
61
|
+
* @returns 弹出层信息或 undefined
|
|
62
|
+
*/
|
|
63
|
+
getPopup(id: string): PopupInstance | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* 初始化全局 ESC 监听(内部使用)
|
|
66
|
+
*/
|
|
67
|
+
initEscListener(escape: Ref<boolean>): void;
|
|
68
|
+
}
|
|
69
|
+
declare const popupManager: PopupManager;
|
|
70
|
+
/**
|
|
71
|
+
* 弹出层管理器 Hook
|
|
72
|
+
* 用于 Modal 和 Drawer 组件管理 z-index 和 ESC 关闭
|
|
73
|
+
*
|
|
74
|
+
* @param options 配置选项
|
|
75
|
+
* @returns 管理器方法和响应式 z-index
|
|
76
|
+
*/
|
|
77
|
+
export declare function usePopupManager(options: {
|
|
78
|
+
/** 唯一标识 */
|
|
79
|
+
id: string;
|
|
80
|
+
/** 类型:modal 或 drawer */
|
|
81
|
+
type: 'modal' | 'drawer';
|
|
82
|
+
/** 可见性 v-model */
|
|
83
|
+
visible: Ref<boolean>;
|
|
84
|
+
/** 是否支持 ESC 关闭 */
|
|
85
|
+
closeByEsc?: boolean;
|
|
86
|
+
/** 关闭时的自定义回调 */
|
|
87
|
+
onClose?: () => void;
|
|
88
|
+
}): {
|
|
89
|
+
/** 响应式 z-index */
|
|
90
|
+
zIndex: Ref<number, number>;
|
|
91
|
+
/** 检查是否是最顶层 */
|
|
92
|
+
isTop: () => boolean;
|
|
93
|
+
/** 关闭方法 */
|
|
94
|
+
close: () => void;
|
|
95
|
+
/** 获取当前栈长度 */
|
|
96
|
+
getStackLength: () => number;
|
|
97
|
+
};
|
|
98
|
+
export { popupManager };
|