@kengic/vue 0.27.2-beta.1 → 0.27.2-beta.2

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.
Files changed (54) hide show
  1. package/dist/kengic-vue.js +8483 -6575
  2. package/dist/src/component/KgWarehouse/KgWarehouse.hooks.d.ts +1 -7
  3. package/dist/src/project/src/components/Application/src/useAppContext.d.ts +9 -0
  4. package/dist/src/project/src/components/index.d.ts +1 -0
  5. package/dist/src/project/src/hooks/component/useFormItem.d.ts +2 -0
  6. package/dist/src/project/src/hooks/component/usePageContext.d.ts +10 -0
  7. package/dist/src/project/src/hooks/core/onMountedOrActivated.d.ts +1 -0
  8. package/dist/src/project/src/hooks/core/useAttrs.d.ts +9 -0
  9. package/dist/src/project/src/hooks/core/useContext.d.ts +11 -0
  10. package/dist/src/project/src/hooks/core/useRefs.d.ts +2 -0
  11. package/dist/src/project/src/hooks/core/useTimeout.d.ts +10 -0
  12. package/dist/src/project/src/hooks/event/useBreakpoint.d.ts +22 -0
  13. package/dist/src/project/src/hooks/event/useEventListener.d.ts +14 -0
  14. package/dist/src/project/src/hooks/event/useIntersectionObserver.d.ts +13 -0
  15. package/dist/src/project/src/hooks/event/useScrollTo.d.ts +10 -0
  16. package/dist/src/project/src/hooks/event/useWindowSizeFn.d.ts +7 -0
  17. package/dist/src/project/src/hooks/index.d.ts +20 -0
  18. package/dist/src/project/src/hooks/jeecg/useAdaptiveWidth.d.ts +18 -0
  19. package/dist/src/project/src/hooks/web/useAppInject.d.ts +3 -0
  20. package/dist/src/project/src/hooks/web/useContentHeight.d.ts +24 -0
  21. package/dist/src/project/src/hooks/web/useCopyToClipboard.d.ts +10 -0
  22. package/dist/src/project/src/hooks/web/useDesign.d.ts +4 -0
  23. package/dist/src/project/src/hooks/web/usePage.d.ts +10 -0
  24. package/dist/src/project/src/hooks/web/usePagination.d.ts +7 -0
  25. package/dist/src/project/src/hooks/web/useWebSocket.d.ts +18 -0
  26. package/dist/src/project/src/index.d.ts +3 -8
  27. package/dist/src/project/src/layouts/default/content/useContentContext.d.ts +9 -0
  28. package/dist/src/project/src/layouts/default/content/useContentViewHeight.d.ts +7 -0
  29. package/dist/src/project/src/layouts/index.d.ts +2 -0
  30. package/dist/src/project/src/router/constant2.d.ts +3 -0
  31. package/dist/src/project/src/router/index.d.ts +2 -0
  32. package/dist/src/project/src/settings/index.d.ts +1 -0
  33. package/dist/src/project/src/settings/projectSetting.d.ts +3 -0
  34. package/dist/src/project/src/utils/auth/index.d.ts +19 -0
  35. package/dist/src/project/src/utils/bem.d.ts +15 -0
  36. package/dist/src/project/src/utils/color.d.ts +29 -0
  37. package/dist/src/project/src/utils/common/compUtils.d.ts +87 -0
  38. package/dist/src/project/src/utils/common/functionUtils.d.ts +6 -0
  39. package/dist/src/project/src/utils/dateUtil.d.ts +4 -0
  40. package/dist/src/project/src/utils/domUtils.d.ts +28 -0
  41. package/dist/src/project/src/utils/encryption/signMd5Utils.d.ts +29 -0
  42. package/dist/src/project/src/utils/event/index.d.ts +3 -0
  43. package/dist/src/project/src/utils/factory/createAsyncComponent.d.ts +9 -0
  44. package/dist/src/project/src/utils/file/base64Conver.d.ts +4 -0
  45. package/dist/src/project/src/utils/file/download.d.ts +9 -0
  46. package/dist/src/project/src/utils/helper/treeHelper.d.ts +34 -0
  47. package/dist/src/project/src/utils/helper/tsxHelper.d.ts +13 -0
  48. package/dist/src/project/src/utils/index.d.ts +26 -0
  49. package/dist/src/project/src/utils/index.index.d.ts +42 -0
  50. package/dist/src/project/src/utils/is.d.ts +17 -0
  51. package/dist/src/project/src/utils/mitt.d.ts +26 -0
  52. package/dist/src/project/src/utils/props.d.ts +68 -0
  53. package/dist/src/project/src/utils/uuid.d.ts +2 -0
  54. package/package.json +4 -1
@@ -0,0 +1,34 @@
1
+ interface TreeHelperConfig {
2
+ id: string;
3
+ children: string;
4
+ pid: string;
5
+ }
6
+ export declare function treeToList<T = any>(tree: any, config?: Partial<TreeHelperConfig>): T;
7
+ export declare function findNodeAll<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T[];
8
+ export declare function findPath<T = any>(tree: any, func: Fn, config?: Partial<TreeHelperConfig>): T | T[] | null;
9
+ export declare function filter<T = any>(tree: T[], func: (n: T) => boolean, config?: Partial<TreeHelperConfig>): T[];
10
+ export declare function forEach<T = any>(tree: T[], func: (n: T) => any, config?: Partial<TreeHelperConfig>): void;
11
+ /**
12
+ * @description: Extract tree specified structure
13
+ * @description: 提取树指定结构
14
+ */
15
+ export declare function treeMap<T = any>(treeData: T[], opt: {
16
+ children?: string;
17
+ conversion: Fn;
18
+ }): T[];
19
+ /**
20
+ * @description: Extract tree specified structure
21
+ * @description: 提取树指定结构
22
+ */
23
+ export declare function treeMapEach(data: any, { children, conversion }: {
24
+ children?: string;
25
+ conversion: Fn;
26
+ }): any;
27
+ /**
28
+ * 递归遍历树结构
29
+ * @param treeDatas 树
30
+ * @param callBack 回调
31
+ * @param parentNode 父节点
32
+ */
33
+ export declare function eachTree(treeDatas: any[], callBack: Fn, parentNode?: {}): void;
34
+ export {};
@@ -0,0 +1,13 @@
1
+ import { Slots } from 'vue';
2
+ /**
3
+ * @description: Get slot to prevent empty error
4
+ */
5
+ export declare function getSlot(slots: Slots, slot?: string, data?: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
6
+ [key: string]: any;
7
+ }>[] | null;
8
+ /**
9
+ * extends slots
10
+ * @param slots
11
+ * @param excludeKeys
12
+ */
13
+ export declare function extendSlots(slots: Slots, excludeKeys?: string[]): any;
@@ -0,0 +1,26 @@
1
+ export * from './auth';
2
+ export * from './cache/index';
3
+ export * from './cache/memory';
4
+ export * from './cache/persistent';
5
+ export * from './cache/storageCache';
6
+ export * from './common/compUtils';
7
+ export * from './common/functionUtils';
8
+ export * from './encryption/signMd5Utils';
9
+ export * from './event';
10
+ export * from './bem';
11
+ export * from './cipher';
12
+ export * from './color';
13
+ export * from './dateUtil';
14
+ export * from './domUtils';
15
+ export * from './env';
16
+ export * from './index.index';
17
+ export * from './factory/createAsyncComponent';
18
+ export * from './file/base64Conver';
19
+ export * from './file/download';
20
+ export * from './helper/treeHelper';
21
+ export * from './helper/tsxHelper';
22
+ export * from './is';
23
+ export * from './mitt';
24
+ export * from './props';
25
+ export * from './propTypes';
26
+ export * from './uuid';
@@ -0,0 +1,42 @@
1
+ import type { Plugin } from 'vue';
2
+ import type { RouteLocationNormalized } from 'vue-router';
3
+ export declare const URL_HASH_TAB = "__AGWE4H__HASH__TAG__PWHRG__";
4
+ export declare const noop: () => void;
5
+ /**
6
+ * @description: Set ui mount node
7
+ */
8
+ export declare function getPopupContainer(node?: HTMLElement): HTMLElement;
9
+ /**
10
+ * Add the object as a parameter to the URL
11
+ * @param baseUrl url
12
+ * @param obj
13
+ * @returns {string}
14
+ * eg:
15
+ * let obj = {a: '3', b: '4'}
16
+ * setObjToUrlParams('www.baidu.com', obj)
17
+ * ==>www.baidu.com?a=3&b=4
18
+ */
19
+ export declare function setObjToUrlParams(baseUrl: string, obj: any): string;
20
+ export declare function deepMerge<T = any>(src?: any, target?: any): T;
21
+ export declare function openWindow(url: string, opt?: {
22
+ target?: TargetContext | string;
23
+ noopener?: boolean;
24
+ noreferrer?: boolean;
25
+ }): void;
26
+ export declare function getDynamicProps<T, U>(props: T): Partial<U>;
27
+ /**
28
+ * 获取表单字段值数据类型
29
+ * @param props
30
+ * @param field
31
+ * @updateBy:zyf
32
+ */
33
+ export declare function getValueType(props: any, field: any): string;
34
+ export declare function getRawRoute(route: RouteLocationNormalized): RouteLocationNormalized;
35
+ /**
36
+ * 深度克隆对象、数组
37
+ * @param obj 被克隆的对象
38
+ * @return 克隆后的对象
39
+ */
40
+ export declare function cloneObject(obj: any): any;
41
+ export declare const withInstall: <T>(component: T, alias?: string) => T & Plugin;
42
+ export declare function importViewsFile(path: any): Promise<any>;
@@ -0,0 +1,17 @@
1
+ export declare function is(val: unknown, type: string): boolean;
2
+ export declare function isDef<T = unknown>(val?: T): val is T;
3
+ export declare function isUnDef<T = unknown>(val?: T): val is T;
4
+ export declare function isObject(val: any): val is Record<any, any>;
5
+ export declare function isEmpty<T = unknown>(val: T): val is T;
6
+ export declare function isNull(val: unknown): val is null;
7
+ export declare function isNullAndUnDef(val: unknown): val is null | undefined;
8
+ export declare function isNullOrUnDef(val: unknown): val is null | undefined;
9
+ export declare function isNumber(val: unknown): val is number;
10
+ export declare function isPromise<T = any>(val: any): val is Promise<T>;
11
+ export declare function isString(val: unknown): val is string;
12
+ export declare function isJsonObjectString(val: string): val is string;
13
+ export declare function isFunction(val: unknown): val is Function;
14
+ export declare function isBoolean(val: unknown): val is boolean;
15
+ export declare function isArray(val: any): val is Array<any>;
16
+ export declare function isMap(val: unknown): val is Map<any, any>;
17
+ export declare function isUrl(path: string): boolean;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * copy to https://github.com/developit/mitt
3
+ * Expand clear method
4
+ */
5
+ export declare type EventType = string | symbol;
6
+ export declare type Handler<T = any> = (event?: T) => void;
7
+ export declare type WildcardHandler = (type: EventType, event?: any) => void;
8
+ export declare type EventHandlerList = Array<Handler>;
9
+ export declare type WildCardEventHandlerList = Array<WildcardHandler>;
10
+ export declare type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
11
+ export interface Emitter {
12
+ all: EventHandlerMap;
13
+ on<T = any>(type: EventType, handler: Handler<T>): void;
14
+ on(type: '*', handler: WildcardHandler): void;
15
+ off<T = any>(type: EventType, handler: Handler<T>): void;
16
+ off(type: '*', handler: WildcardHandler): void;
17
+ emit<T = any>(type: EventType, event?: T): void;
18
+ emit(type: '*', event?: any): void;
19
+ clear(): void;
20
+ }
21
+ /**
22
+ * Mitt: Tiny (~200b) functional event emitter / pubsub.
23
+ * @name mitt
24
+ * @returns {Mitt}
25
+ */
26
+ export declare function mitt(all?: EventHandlerMap): Emitter;
@@ -0,0 +1,68 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ declare const wrapperKey: unique symbol;
3
+ export declare type PropWrapper<T> = {
4
+ [wrapperKey]: T;
5
+ };
6
+ export declare const propKey: unique symbol;
7
+ declare type ResolveProp<T> = ExtractPropTypes<{
8
+ key: {
9
+ type: T;
10
+ required: true;
11
+ };
12
+ }>['key'];
13
+ declare type ResolvePropType<T> = ResolveProp<T> extends {
14
+ type: infer V;
15
+ } ? V : ResolveProp<T>;
16
+ declare type ResolvePropTypeWithReadonly<T> = Readonly<T> extends Readonly<Array<infer A>> ? ResolvePropType<A[]> : ResolvePropType<T>;
17
+ declare type IfUnknown<T, V> = [unknown] extends [T] ? V : T;
18
+ export declare type BuildPropOption<T, D extends BuildPropType<T, V, C>, R, V, C> = {
19
+ type?: T;
20
+ values?: readonly V[];
21
+ required?: R;
22
+ default?: R extends true ? never : D extends Record<string, unknown> | Array<any> ? () => D : (() => D) | D;
23
+ validator?: ((val: any) => val is C) | ((val: any) => boolean);
24
+ };
25
+ declare type _BuildPropType<T, V, C> = (T extends PropWrapper<unknown> ? T[typeof wrapperKey] : [V] extends [never] ? ResolvePropTypeWithReadonly<T> : never) | V | C;
26
+ export declare type BuildPropType<T, V, C> = _BuildPropType<IfUnknown<T, never>, IfUnknown<V, never>, IfUnknown<C, never>>;
27
+ declare type _BuildPropDefault<T, D> = [T] extends [
28
+ Record<string, unknown> | Array<any> | Function
29
+ ] ? D : D extends () => T ? ReturnType<D> : D;
30
+ export declare type BuildPropDefault<T, D, R> = R extends true ? {
31
+ readonly default?: undefined;
32
+ } : {
33
+ readonly default: Exclude<D, undefined> extends never ? undefined : Exclude<_BuildPropDefault<T, D>, undefined>;
34
+ };
35
+ export declare type BuildPropReturn<T, D, R, V, C> = {
36
+ readonly type: PropType<BuildPropType<T, V, C>>;
37
+ readonly required: IfUnknown<R, false>;
38
+ readonly validator: ((val: unknown) => boolean) | undefined;
39
+ [propKey]: true;
40
+ } & BuildPropDefault<BuildPropType<T, V, C>, IfUnknown<D, never>, IfUnknown<R, false>>;
41
+ /**
42
+ * @description Build prop. It can better optimize prop types
43
+ * @description 生成 prop,能更好地优化类型
44
+ * @example
45
+ // limited options
46
+ // the type will be PropType<'light' | 'dark'>
47
+ buildProp({
48
+ type: String,
49
+ values: ['light', 'dark'],
50
+ } as const)
51
+ * @example
52
+ // limited options and other types
53
+ // the type will be PropType<'small' | 'medium' | number>
54
+ buildProp({
55
+ type: [String, Number],
56
+ values: ['small', 'medium'],
57
+ validator: (val: unknown): val is number => typeof val === 'number',
58
+ } as const)
59
+ @link see more: https://github.com/element-plus/element-plus/pull/3341
60
+ */
61
+ export declare function buildProp<T = never, D extends BuildPropType<T, V, C> = never, R extends boolean = false, V = never, C = never>(option: BuildPropOption<T, D, R, V, C>, key?: string): BuildPropReturn<T, D, R, V, C>;
62
+ declare type NativePropType = [((...args: any) => any) | {
63
+ new (...args: any): any;
64
+ } | undefined | null];
65
+ export declare const buildProps: <O extends { [K in keyof O]: O[K] extends BuildPropReturn<any, any, any, any, any> ? O[K] : [O[K]] extends NativePropType ? O[K] : O[K] extends BuildPropOption<infer T, infer D extends BuildPropType<infer T, infer V, infer C>, infer R, infer V, infer C> ? D extends BuildPropType<T, V, C> ? BuildPropOption<T, D, R, V, C> : never : never; }>(props: O) => { [K_1 in keyof O]: O[K_1] extends {
66
+ [propKey]: boolean;
67
+ } ? O[K_1] : [O[K_1]] extends NativePropType ? O[K_1] : O[K_1] extends BuildPropOption<infer T_1, infer _D extends BuildPropType<infer T_1, infer V_1, infer C_1>, infer R_1, infer V_1, infer C_1> ? BuildPropReturn<T_1, O[K_1]["default"], R_1, V_1, C_1> : never; };
68
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function buildUUID(): string;
2
+ export declare function buildShortUUID(prefix?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.27.2-beta.1",
3
+ "version": "0.27.2-beta.2",
4
4
  "scripts": {
5
5
  "build": "npm run use-node && rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "npm run use-node && rimraf dist && vue-tsc && vite build --mode development",
@@ -47,6 +47,7 @@
47
47
  "@types/fs-extra": "9.0.13",
48
48
  "@types/inquirer": "8.2.5",
49
49
  "@types/lodash-es": "4.17.9",
50
+ "@types/md5": "2.3.5",
50
51
  "@types/node": "18.18.4",
51
52
  "@types/semver": "7.5.3",
52
53
  "@types/store": "2.0.3",
@@ -68,9 +69,11 @@
68
69
  "inquirer": "8.2.5",
69
70
  "less": "4.1.3",
70
71
  "lodash-es": "4.17.21",
72
+ "md5": "2.3.0",
71
73
  "picocolors": "1.0.0",
72
74
  "pinia": "2.0.12",
73
75
  "prettier": "3.3.3",
76
+ "resize-observer-polyfill": "1.5.1",
74
77
  "rimraf": "3.0.2",
75
78
  "rollup": "2.79.1",
76
79
  "rollup-plugin-visualizer": "5.8.3",