lew-ui 2.7.76 → 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/auto-imports.d.ts +86 -0
- package/dist/components/feedback/drawer/src/LewDrawer.vue.d.ts +1 -1
- package/dist/components/feedback/drawer/src/props.d.ts +5 -0
- package/dist/components/feedback/modal/src/LewModal.vue.d.ts +1 -1
- package/dist/components/feedback/modal/src/props.d.ts +5 -0
- 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 +358 -214
- package/dist/index.umd.cjs +1 -1
- package/dist/methods/dialog/src/LewDialog.vue.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// Generated by unplugin-auto-import
|
|
6
|
+
export {}
|
|
7
|
+
declare global {
|
|
8
|
+
const EffectScope: (typeof import('vue'))['EffectScope'];
|
|
9
|
+
const computed: (typeof import('vue'))['computed'];
|
|
10
|
+
const createApp: (typeof import('vue'))['createApp'];
|
|
11
|
+
const customRef: (typeof import('vue'))['customRef'];
|
|
12
|
+
const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent'];
|
|
13
|
+
const defineComponent: (typeof import('vue'))['defineComponent'];
|
|
14
|
+
const effectScope: (typeof import('vue'))['effectScope'];
|
|
15
|
+
const getCurrentInstance: (typeof import('vue'))['getCurrentInstance'];
|
|
16
|
+
const getCurrentScope: (typeof import('vue'))['getCurrentScope'];
|
|
17
|
+
const h: (typeof import('vue'))['h'];
|
|
18
|
+
const inject: (typeof import('vue'))['inject'];
|
|
19
|
+
const isProxy: (typeof import('vue'))['isProxy'];
|
|
20
|
+
const isReactive: (typeof import('vue'))['isReactive'];
|
|
21
|
+
const isReadonly: (typeof import('vue'))['isReadonly'];
|
|
22
|
+
const isRef: (typeof import('vue'))['isRef'];
|
|
23
|
+
const markRaw: (typeof import('vue'))['markRaw'];
|
|
24
|
+
const nextTick: (typeof import('vue'))['nextTick'];
|
|
25
|
+
const onActivated: (typeof import('vue'))['onActivated'];
|
|
26
|
+
const onBeforeMount: (typeof import('vue'))['onBeforeMount'];
|
|
27
|
+
const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave'];
|
|
28
|
+
const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate'];
|
|
29
|
+
const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount'];
|
|
30
|
+
const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate'];
|
|
31
|
+
const onDeactivated: (typeof import('vue'))['onDeactivated'];
|
|
32
|
+
const onErrorCaptured: (typeof import('vue'))['onErrorCaptured'];
|
|
33
|
+
const onMounted: (typeof import('vue'))['onMounted'];
|
|
34
|
+
const onRenderTracked: (typeof import('vue'))['onRenderTracked'];
|
|
35
|
+
const onRenderTriggered: (typeof import('vue'))['onRenderTriggered'];
|
|
36
|
+
const onScopeDispose: (typeof import('vue'))['onScopeDispose'];
|
|
37
|
+
const onServerPrefetch: (typeof import('vue'))['onServerPrefetch'];
|
|
38
|
+
const onUnmounted: (typeof import('vue'))['onUnmounted'];
|
|
39
|
+
const onUpdated: (typeof import('vue'))['onUpdated'];
|
|
40
|
+
const provide: (typeof import('vue'))['provide'];
|
|
41
|
+
const reactive: (typeof import('vue'))['reactive'];
|
|
42
|
+
const readonly: (typeof import('vue'))['readonly'];
|
|
43
|
+
const ref: (typeof import('vue'))['ref'];
|
|
44
|
+
const resolveComponent: (typeof import('vue'))['resolveComponent'];
|
|
45
|
+
const shallowReactive: (typeof import('vue'))['shallowReactive'];
|
|
46
|
+
const shallowReadonly: (typeof import('vue'))['shallowReadonly'];
|
|
47
|
+
const shallowRef: (typeof import('vue'))['shallowRef'];
|
|
48
|
+
const toRaw: (typeof import('vue'))['toRaw'];
|
|
49
|
+
const toRef: (typeof import('vue'))['toRef'];
|
|
50
|
+
const toRefs: (typeof import('vue'))['toRefs'];
|
|
51
|
+
const toValue: (typeof import('vue'))['toValue'];
|
|
52
|
+
const triggerRef: (typeof import('vue'))['triggerRef'];
|
|
53
|
+
const unref: (typeof import('vue'))['unref'];
|
|
54
|
+
const useAttrs: (typeof import('vue'))['useAttrs'];
|
|
55
|
+
const useCssModule: (typeof import('vue'))['useCssModule'];
|
|
56
|
+
const useCssVars: (typeof import('vue'))['useCssVars'];
|
|
57
|
+
const useLink: (typeof import('vue-router'))['useLink'];
|
|
58
|
+
const useRoute: (typeof import('vue-router'))['useRoute'];
|
|
59
|
+
const useRouter: (typeof import('vue-router'))['useRouter'];
|
|
60
|
+
const useSlots: (typeof import('vue'))['useSlots'];
|
|
61
|
+
const watch: (typeof import('vue'))['watch'];
|
|
62
|
+
const watchEffect: (typeof import('vue'))['watchEffect'];
|
|
63
|
+
const watchPostEffect: (typeof import('vue'))['watchPostEffect'];
|
|
64
|
+
const watchSyncEffect: (typeof import('vue'))['watchSyncEffect'];
|
|
65
|
+
const resolveDirective: (typeof import('vue'))['resolveDirective'];
|
|
66
|
+
const withDirectives: (typeof import('vue'))['withDirectives'];
|
|
67
|
+
const CSSProperties: (typeof import('vue'))['CSSProperties'];
|
|
68
|
+
}
|
|
69
|
+
// for type re-export
|
|
70
|
+
declare global {
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
export type {
|
|
73
|
+
Component,
|
|
74
|
+
ComponentPublicInstance,
|
|
75
|
+
ComputedRef,
|
|
76
|
+
ExtractDefaultPropTypes,
|
|
77
|
+
ExtractPropTypes,
|
|
78
|
+
ExtractPublicPropTypes,
|
|
79
|
+
InjectionKey,
|
|
80
|
+
PropType,
|
|
81
|
+
Ref,
|
|
82
|
+
VNode,
|
|
83
|
+
WritableComputedRef,
|
|
84
|
+
} from 'vue';
|
|
85
|
+
import('vue');
|
|
86
|
+
}
|
|
@@ -146,8 +146,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
|
|
|
146
146
|
height: import("csstype").Property.Height<0 | (string & {})>;
|
|
147
147
|
position: import('../../../..').LewDrawerPosition;
|
|
148
148
|
zIndex: number;
|
|
149
|
-
closeOnClickOverlay: boolean;
|
|
150
149
|
closeByEsc: boolean;
|
|
150
|
+
closeOnClickOverlay: boolean;
|
|
151
151
|
hideFooter: boolean;
|
|
152
152
|
hideOkButton: boolean;
|
|
153
153
|
hideCloseButton: boolean;
|
|
@@ -56,6 +56,11 @@ export declare const drawerProps: {
|
|
|
56
56
|
default: boolean;
|
|
57
57
|
validator: (value: any) => boolean;
|
|
58
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* z-index 层级
|
|
61
|
+
* 默认值 2001 表示使用全局弹出层管理器自动分配层级(从 2001 开始递增)
|
|
62
|
+
* 如果手动设置其他值,则使用用户指定的值(不推荐,可能导致层级冲突)
|
|
63
|
+
*/
|
|
59
64
|
zIndex: {
|
|
60
65
|
type: NumberConstructor;
|
|
61
66
|
default: number;
|
|
@@ -160,8 +160,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
|
|
|
160
160
|
width: import("csstype").Property.Width<0 | (string & {})>;
|
|
161
161
|
maxHeight: number | "none" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "fit-content" | "intrinsic" | "max-content" | "min-content" | (string & {}) | "-webkit-min-content";
|
|
162
162
|
zIndex: number;
|
|
163
|
-
closeOnClickOverlay: boolean;
|
|
164
163
|
closeByEsc: boolean;
|
|
164
|
+
closeOnClickOverlay: boolean;
|
|
165
165
|
hideFooter: boolean;
|
|
166
166
|
hideOkButton: boolean;
|
|
167
167
|
hideCloseButton: boolean;
|
|
@@ -62,6 +62,11 @@ export declare const modalProps: {
|
|
|
62
62
|
default: boolean;
|
|
63
63
|
validator: (value: any) => boolean;
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* z-index 层级
|
|
67
|
+
* 默认值 2001 表示使用全局弹出层管理器自动分配层级(从 2001 开始递增)
|
|
68
|
+
* 如果手动设置其他值,则使用用户指定的值(不推荐,可能导致层级冲突)
|
|
69
|
+
*/
|
|
65
70
|
zIndex: {
|
|
66
71
|
type: NumberConstructor;
|
|
67
72
|
default: number;
|
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 };
|