xframelib 0.4.1 → 0.4.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.
- package/README.md +1 -0
- package/dist/api/Token.d.ts +20 -0
- package/dist/api/User.d.ts +45 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/controls/collapsepanel/VCollapsiblePanel.vue.d.ts +26 -0
- package/dist/controls/collapsepanel/VCollapsiblePanelGroup.vue.d.ts +30 -0
- package/dist/controls/collapsepanel/color.util.d.ts +1 -0
- package/dist/controls/collapsepanel/composables/store.d.ts +7 -0
- package/dist/controls/collapsepanel/constant.d.ts +1 -0
- package/dist/controls/collapsepanel/index.d.ts +3 -0
- package/dist/controls/layoutcontainer/LayoutManager.d.ts +107 -0
- package/dist/controls/layoutcontainer/index.d.ts +3 -0
- package/dist/controls/layoutcontainer/layout.vue.d.ts +37 -0
- package/dist/controls/splitpanes/index.d.ts +3 -0
- package/dist/controls/vuewindow/SinglePointerEvent.d.ts +23 -0
- package/dist/controls/vuewindow/dom.d.ts +16 -0
- package/dist/controls/vuewindow/draggable_helper.d.ts +20 -0
- package/dist/controls/vuewindow/index.d.ts +6 -0
- package/dist/controls/vuewindow/resizable_helper.d.ts +16 -0
- package/dist/controls/vuewindow/style.d.ts +77 -0
- package/dist/controls/vuewindow/window/Button.vue.d.ts +26 -0
- package/dist/controls/vuewindow/window/index.vue.d.ts +160 -0
- package/dist/controls/vuewindow/window/utils.d.ts +17 -0
- package/dist/controls/vuewindow/z_element.d.ts +11 -0
- package/dist/core/Global.d.ts +26 -0
- package/dist/core/IModel.d.ts +34 -0
- package/dist/core/MsgHelper.d.ts +12 -0
- package/dist/core/SysEvents.d.ts +16 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/hprose/HproseClient.d.ts +20 -0
- package/dist/hprose/ProxyClient.d.ts +22 -0
- package/dist/hprose/index.d.ts +11 -0
- package/dist/index.cjs +4 -4
- package/dist/index.css +146 -76
- package/dist/index.d.ts +10 -1116
- package/dist/index.js +4 -4
- package/dist/mitt/index.d.ts +25 -0
- package/dist/model/Config.d.ts +94 -0
- package/dist/model/Constants.d.ts +15 -0
- package/dist/model/Layout.d.ts +36 -0
- package/dist/model/Token.d.ts +66 -0
- package/dist/model/index.d.ts +4 -0
- package/dist/utils/AxiosHelper.d.ts +51 -0
- package/dist/utils/BigFileDownload.d.ts +106 -0
- package/dist/utils/Color.d.ts +74 -0
- package/dist/utils/FileDownload.d.ts +36 -0
- package/dist/utils/FileUpload.d.ts +90 -0
- package/dist/utils/H5Tool.d.ts +98 -0
- package/dist/utils/IsTool.d.ts +101 -0
- package/dist/utils/JQuery.d.ts +35 -0
- package/dist/utils/LockHelper.d.ts +17 -0
- package/dist/utils/Storage.d.ts +57 -0
- package/dist/utils/StringUtils.d.ts +15 -0
- package/dist/utils/Time.d.ts +1 -0
- package/dist/utils/TokenHelper.d.ts +18 -0
- package/dist/utils/URLTool.d.ts +18 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/uuid.d.ts +3 -0
- package/package.json +3 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 判断值是否未某个类型
|
|
3
|
+
*/
|
|
4
|
+
export declare function is(val: unknown, type: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* @description: 是否为函数
|
|
7
|
+
*/
|
|
8
|
+
export declare function isFunction<T = Function>(val: unknown): val is T;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 是否已定义
|
|
11
|
+
*/
|
|
12
|
+
export declare const isDef: <T = unknown>(val?: T | undefined) => val is T;
|
|
13
|
+
export declare const isUnDef: <T = unknown>(val?: T | undefined) => val is T;
|
|
14
|
+
export declare function isNull(val: unknown): val is null;
|
|
15
|
+
export declare function isNullAndUnDef(val: unknown): val is null | undefined;
|
|
16
|
+
export declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* @description: 是否为对象
|
|
19
|
+
*/
|
|
20
|
+
export declare const isObject: (val: any) => val is Record<any, any>;
|
|
21
|
+
/**
|
|
22
|
+
* @description: 是否为时间
|
|
23
|
+
*/
|
|
24
|
+
export declare function isDate(val: unknown): val is Date;
|
|
25
|
+
/**
|
|
26
|
+
* @description: 是否为数值
|
|
27
|
+
*/
|
|
28
|
+
export declare function isNumber(val: unknown): val is number;
|
|
29
|
+
/**
|
|
30
|
+
* @description: 是否为AsyncFunction
|
|
31
|
+
*/
|
|
32
|
+
export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* @description: 是否为promise
|
|
35
|
+
*/
|
|
36
|
+
export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
37
|
+
/**
|
|
38
|
+
* @description: 是否为字符串
|
|
39
|
+
*/
|
|
40
|
+
export declare function isString(val: unknown): val is string;
|
|
41
|
+
/**
|
|
42
|
+
* @description: 是否为boolean类型
|
|
43
|
+
*/
|
|
44
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description: 是否为数组
|
|
47
|
+
*/
|
|
48
|
+
export declare function isArray(val: any): val is Array<any>;
|
|
49
|
+
/**
|
|
50
|
+
* @description: 是否客户端
|
|
51
|
+
*/
|
|
52
|
+
export declare const isClient: () => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @description: 是否为浏览器
|
|
55
|
+
*/
|
|
56
|
+
export declare const isWindow: (val: any) => val is Window;
|
|
57
|
+
export declare const isElement: (val: unknown) => val is Element;
|
|
58
|
+
export declare const isServer: boolean;
|
|
59
|
+
export declare function isImageDom(o: Element): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* 是否为空
|
|
62
|
+
* @param source
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
export declare function isEmpty(source: unknown): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 是否是异常
|
|
68
|
+
* @param val
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
export declare function isError(val: unknown): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* 判断元素是否为WeakSet
|
|
74
|
+
* @param source
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
77
|
+
export declare function isWeakSet(source: unknown): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @description 判断元素是否为WeakMap
|
|
80
|
+
* @param {*} source 元素
|
|
81
|
+
* @return {Boolen}
|
|
82
|
+
*/
|
|
83
|
+
export declare function isWeakMap(source: unknown): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @description 判断元素是否为Symbol
|
|
86
|
+
* @param {*} source 元素
|
|
87
|
+
* @return {Boolen}
|
|
88
|
+
*/
|
|
89
|
+
export declare function isSymbol(source: unknown): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @description 判断元素是否为Map
|
|
92
|
+
* @param {*} source 元素
|
|
93
|
+
* @return {Boolen}
|
|
94
|
+
*/
|
|
95
|
+
export declare function isMap(source: unknown): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* 是否有效的URL地址
|
|
98
|
+
* @param url
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
export declare const isValidURL: (url: string) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模仿JQuery相关方法
|
|
3
|
+
*/
|
|
4
|
+
declare class JQuery {
|
|
5
|
+
/**
|
|
6
|
+
* 是否有Style类名
|
|
7
|
+
* @param ele HTML元素
|
|
8
|
+
* @param className 类名
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
hasClass(ele: HTMLElement, className: string): RegExpMatchArray | null;
|
|
12
|
+
/**
|
|
13
|
+
* 为元素添加Style类名
|
|
14
|
+
* @param ele HTML元素
|
|
15
|
+
* @param className 类名
|
|
16
|
+
*/
|
|
17
|
+
addClass(ele: HTMLElement, className: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* 移除元素的Style类名
|
|
20
|
+
* @param ele HTML元素
|
|
21
|
+
* @param className 类名
|
|
22
|
+
*/
|
|
23
|
+
removeClass(ele: HTMLElement, className: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* 切换Style类名
|
|
26
|
+
* @param ele HTML元素
|
|
27
|
+
* @param className 类名
|
|
28
|
+
*/
|
|
29
|
+
toggleClass(ele: HTMLElement, className: string): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* jquery对象
|
|
33
|
+
*/
|
|
34
|
+
export declare const jquery: JQuery;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ILockState {
|
|
2
|
+
isLock: boolean;
|
|
3
|
+
lockTime: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 获取当前Lock状态
|
|
7
|
+
* @returns 是否Locked
|
|
8
|
+
*/
|
|
9
|
+
export declare function getLockState(): any;
|
|
10
|
+
/**
|
|
11
|
+
* 全局监听Lock
|
|
12
|
+
*/
|
|
13
|
+
export declare function onLockListener(): void;
|
|
14
|
+
/**
|
|
15
|
+
* 取消全局监听Lock
|
|
16
|
+
*/
|
|
17
|
+
export declare function unLockListener(): void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建本地缓存对象
|
|
3
|
+
*/
|
|
4
|
+
declare class StorageHelper {
|
|
5
|
+
private prefixKey;
|
|
6
|
+
private storage;
|
|
7
|
+
constructor(prefixKey?: string, storage?: Storage);
|
|
8
|
+
private getKey;
|
|
9
|
+
/**
|
|
10
|
+
* @description 设置缓存
|
|
11
|
+
* @param {string} key 缓存键
|
|
12
|
+
* @param {*} value 缓存值
|
|
13
|
+
* @param expire
|
|
14
|
+
*/
|
|
15
|
+
set(key: string, value: any, expire?: number | null): void;
|
|
16
|
+
/**
|
|
17
|
+
* 读取缓存
|
|
18
|
+
* @param {string} key 缓存键
|
|
19
|
+
* @param {*=} def 默认值
|
|
20
|
+
*/
|
|
21
|
+
get(key: string, def?: any): any;
|
|
22
|
+
/**
|
|
23
|
+
* 从缓存删除某项
|
|
24
|
+
* @param {string} key
|
|
25
|
+
*/
|
|
26
|
+
remove(key: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* 清空所有缓存
|
|
29
|
+
* @memberOf Cache
|
|
30
|
+
*/
|
|
31
|
+
clear(): void;
|
|
32
|
+
/**
|
|
33
|
+
* 设置cookie
|
|
34
|
+
* @param {string} name cookie 名称
|
|
35
|
+
* @param {*} value cookie 值
|
|
36
|
+
* @param {number=} expire 过期时间
|
|
37
|
+
* 如果过期时间为设置,默认关闭浏览器自动删除
|
|
38
|
+
* @example
|
|
39
|
+
*/
|
|
40
|
+
setCookie(name: string, value: any, expire?: number | null): void;
|
|
41
|
+
/**
|
|
42
|
+
* 根据名字获取cookie值
|
|
43
|
+
* @param name
|
|
44
|
+
*/
|
|
45
|
+
getCookie(name: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* 根据名字删除指定的cookie
|
|
48
|
+
* @param {string} key
|
|
49
|
+
*/
|
|
50
|
+
removeCookie(key: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* 清空cookie,使所有cookie失效
|
|
53
|
+
*/
|
|
54
|
+
clearCookie(): void;
|
|
55
|
+
}
|
|
56
|
+
export declare const storage: StorageHelper;
|
|
57
|
+
export default StorageHelper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare class StringUtils {
|
|
2
|
+
/**
|
|
3
|
+
* 判断字符串是否为空或undefined,不判断为0,不判断为false
|
|
4
|
+
* @param str
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/
|
|
7
|
+
static isNullOrEmpty: (str: any) => boolean;
|
|
8
|
+
static isNotEmpty: (str: any) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* / _ - 转换成驼峰并将view替换成空字符串
|
|
11
|
+
* @param {*} name name
|
|
12
|
+
*/
|
|
13
|
+
static toHump(name: any): any;
|
|
14
|
+
}
|
|
15
|
+
export default StringUtils;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sleep(delay: any): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ITokenInfo } from '../model/Token';
|
|
2
|
+
import StorageHelper from '../utils/Storage';
|
|
3
|
+
export declare const storageHelper: StorageHelper;
|
|
4
|
+
/**
|
|
5
|
+
* 获取token中的授权Key
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function getLocalToken(): ITokenInfo;
|
|
9
|
+
/**
|
|
10
|
+
* 清除本地Token
|
|
11
|
+
*/
|
|
12
|
+
declare function clearLocalToken(): void;
|
|
13
|
+
/**
|
|
14
|
+
* 获得RefreshToken
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
declare function getRefreshToken(): string;
|
|
18
|
+
export { getLocalToken, getRefreshToken, clearLocalToken };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将对象添加当作参数拼接到URL上面
|
|
3
|
+
* @param baseUrl 需要拼接的url
|
|
4
|
+
* @param obj 参数对象
|
|
5
|
+
* @returns {string} 拼接后的对象
|
|
6
|
+
* 例子:
|
|
7
|
+
* let obj = {a: '3', b: '4'}
|
|
8
|
+
* setObjToUrlParams('www.baidu.com', obj)
|
|
9
|
+
* ==>www.baidu.com?a=3&b=4
|
|
10
|
+
*/
|
|
11
|
+
export declare function ObjToUrlParams(baseUrl: string, obj: object): string;
|
|
12
|
+
/**
|
|
13
|
+
* 深入拷贝对象
|
|
14
|
+
* @param src
|
|
15
|
+
* @param target
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare function deepMerge<T = any>(src?: any, target?: any): T;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import H5Tool from './H5Tool';
|
|
2
|
+
import StringUtils from './StringUtils';
|
|
3
|
+
import StorageHelper, { storage } from './Storage';
|
|
4
|
+
import uuid, { newGuid } from './uuid';
|
|
5
|
+
export * from './Color';
|
|
6
|
+
export * from './FileDownload';
|
|
7
|
+
export * from './Time';
|
|
8
|
+
export { H5Tool, StringUtils, StorageHelper as Storage, storage, uuid, newGuid };
|
|
9
|
+
export * from './AxiosHelper';
|
|
10
|
+
export * from './TokenHelper';
|
|
11
|
+
export * from './FileUpload';
|
|
12
|
+
export * from './JQuery';
|
|
13
|
+
export * from './LockHelper';
|
|
14
|
+
export * from './BigFileDownload';
|
|
15
|
+
export * from './IsTool';
|
|
16
|
+
export * from './URLTool';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xframelib",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "积累的前端开发基础库",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"common": "dist/index.cjs",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite",
|
|
10
10
|
"build": "vite build",
|
|
11
|
-
"lib": "rollup -c",
|
|
11
|
+
"lib": "rollup -c ",
|
|
12
12
|
"serve": "vite preview"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"axios": "^0.23.0",
|
|
43
43
|
"esbuild": "^0.13.9",
|
|
44
44
|
"node-sass": "^6.0.1",
|
|
45
|
-
"rollup-plugin-dts": "^4.0.0",
|
|
46
45
|
"rollup-plugin-esbuild": "^4.6.0",
|
|
47
46
|
"rollup-plugin-scss": "^3.0.0",
|
|
48
47
|
"rollup-plugin-terser": "^7.0.2",
|
|
48
|
+
"rollup-plugin-typescript2": "^0.31.1",
|
|
49
49
|
"rollup-plugin-vue": "^6.0.0",
|
|
50
50
|
"sass": "^1.43.3",
|
|
51
51
|
"typescript": "^4.4.4",
|