lew-ui 2.7.76 → 2.7.81

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.
@@ -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;
@@ -39,10 +39,10 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
39
39
  type: globalThis.PropType<string[]>;
40
40
  };
41
41
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
+ remove: (tag: string, index: number) => void;
42
43
  change: (value?: string[] | undefined) => void;
43
44
  clear: () => void;
44
45
  add: (tag: string) => void;
45
- remove: (tag: string, index: number) => void;
46
46
  "update:modelValue": (value: string[] | undefined) => void;
47
47
  }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
48
48
  size: {
@@ -85,11 +85,11 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
85
85
  type: globalThis.PropType<string[]>;
86
86
  };
87
87
  }>> & Readonly<{
88
+ onRemove?: ((tag: string, index: number) => any) | undefined;
88
89
  onChange?: ((value?: string[] | undefined) => any) | undefined;
89
90
  onClear?: (() => any) | undefined;
90
91
  onAdd?: ((tag: string) => any) | undefined;
91
92
  "onUpdate:modelValue"?: ((value: string[] | undefined) => any) | undefined;
92
- onRemove?: ((tag: string, index: number) => any) | undefined;
93
93
  }>, {
94
94
  maxLength: number;
95
95
  size: import('../../../..').LewSize;
@@ -766,10 +766,11 @@ declare function __VLS_template(): {
766
766
  type: (StringConstructor | NumberConstructor)[];
767
767
  required: true;
768
768
  };
769
+ itemPreSize: {
770
+ type: NumberConstructor;
771
+ };
769
772
  minSize: {
770
773
  type: NumberConstructor;
771
- default: number;
772
- required: true;
773
774
  };
774
775
  itemGap: {
775
776
  type: NumberConstructor;
@@ -873,7 +874,6 @@ declare function __VLS_template(): {
873
874
  itemStyle: string | Function | Record<string, any> | unknown[];
874
875
  itemClass: string | Function | Record<string, any> | unknown[];
875
876
  list: any[];
876
- minSize: number;
877
877
  itemGap: number;
878
878
  scrollDistance: number;
879
879
  headerClass: string | Record<string, any> | unknown[];
@@ -913,10 +913,11 @@ declare function __VLS_template(): {
913
913
  type: (StringConstructor | NumberConstructor)[];
914
914
  required: true;
915
915
  };
916
+ itemPreSize: {
917
+ type: NumberConstructor;
918
+ };
916
919
  minSize: {
917
920
  type: NumberConstructor;
918
- default: number;
919
- required: true;
920
921
  };
921
922
  itemGap: {
922
923
  type: NumberConstructor;
@@ -1020,7 +1021,6 @@ declare function __VLS_template(): {
1020
1021
  itemStyle: string | Function | Record<string, any> | unknown[];
1021
1022
  itemClass: string | Function | Record<string, any> | unknown[];
1022
1023
  list: any[];
1023
- minSize: number;
1024
1024
  itemGap: number;
1025
1025
  scrollDistance: number;
1026
1026
  headerClass: string | Record<string, any> | unknown[];
@@ -2029,10 +2029,11 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
2029
2029
  type: (StringConstructor | NumberConstructor)[];
2030
2030
  required: true;
2031
2031
  };
2032
+ itemPreSize: {
2033
+ type: NumberConstructor;
2034
+ };
2032
2035
  minSize: {
2033
2036
  type: NumberConstructor;
2034
- default: number;
2035
- required: true;
2036
2037
  };
2037
2038
  itemGap: {
2038
2039
  type: NumberConstructor;
@@ -2136,7 +2137,6 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
2136
2137
  itemStyle: string | Function | Record<string, any> | unknown[];
2137
2138
  itemClass: string | Function | Record<string, any> | unknown[];
2138
2139
  list: any[];
2139
- minSize: number;
2140
2140
  itemGap: number;
2141
2141
  scrollDistance: number;
2142
2142
  headerClass: string | Record<string, any> | unknown[];
@@ -2176,10 +2176,11 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
2176
2176
  type: (StringConstructor | NumberConstructor)[];
2177
2177
  required: true;
2178
2178
  };
2179
+ itemPreSize: {
2180
+ type: NumberConstructor;
2181
+ };
2179
2182
  minSize: {
2180
2183
  type: NumberConstructor;
2181
- default: number;
2182
- required: true;
2183
2184
  };
2184
2185
  itemGap: {
2185
2186
  type: NumberConstructor;
@@ -2283,7 +2284,6 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
2283
2284
  itemStyle: string | Function | Record<string, any> | unknown[];
2284
2285
  itemClass: string | Function | Record<string, any> | unknown[];
2285
2286
  list: any[];
2286
- minSize: number;
2287
2287
  itemGap: number;
2288
2288
  scrollDistance: number;
2289
2289
  headerClass: string | Record<string, any> | unknown[];
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" />
@@ -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 {}
@@ -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,103 @@
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
+ * @param options.id - 唯一标识
76
+ * @param options.type - 类型:modal 或 drawer
77
+ * @param options.visible - 可见性 v-model
78
+ * @param options.closeByEsc - 是否支持 ESC 关闭
79
+ * @param options.onClose - 关闭时的自定义回调
80
+ * @returns 管理器方法和响应式 z-index
81
+ */
82
+ export declare function usePopupManager(options: {
83
+ /** 唯一标识 */
84
+ id: string;
85
+ /** 类型:modal 或 drawer */
86
+ type: 'modal' | 'drawer';
87
+ /** 可见性 v-model */
88
+ visible: Ref<boolean>;
89
+ /** 是否支持 ESC 关闭 */
90
+ closeByEsc?: boolean;
91
+ /** 关闭时的自定义回调 */
92
+ onClose?: () => void;
93
+ }): {
94
+ /** 响应式 z-index */
95
+ zIndex: Ref<number, number>;
96
+ /** 检查是否是最顶层 */
97
+ isTop: () => boolean;
98
+ /** 关闭方法 */
99
+ close: () => void;
100
+ /** 获取当前栈长度 */
101
+ getStackLength: () => number;
102
+ };
103
+ export { popupManager };