xframelib 0.6.4 → 0.6.8

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.
@@ -1,9 +1,9 @@
1
- export declare type EventType = string | symbol;
2
- export declare type Handler<T = any> = (event?: T) => void;
3
- export declare type WildcardHandler = (type: EventType, event?: any) => void;
4
- export declare type EventHandlerList = Array<Handler>;
5
- export declare type WildCardEventHandlerList = Array<WildcardHandler>;
6
- export declare type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
1
+ export type EventType = string | symbol;
2
+ export type Handler<T = any> = (event?: T) => void;
3
+ export type WildcardHandler = (type: EventType, event?: any) => void;
4
+ export type EventHandlerList = Array<Handler>;
5
+ export type WildCardEventHandlerList = Array<WildcardHandler>;
6
+ export type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>;
7
7
  export interface Emitter {
8
8
  all: EventHandlerMap;
9
9
  on<T = any>(type: EventType, handler: Handler<T>): void;
@@ -1,7 +1,7 @@
1
1
  import { RouteRecordRaw } from 'vue-router';
2
2
  import { IRoleFunction, ISysRoleRight } from '../model/IRole';
3
3
  import { IWidgetConfig } from '../model/Layout';
4
- declare type IWidgetMenu = any;
4
+ type IWidgetMenu = any;
5
5
  /**
6
6
  * 获得当前系统的授权信息
7
7
  * @returns
@@ -1,7 +1,7 @@
1
1
  import { RouteRecordRaw } from 'vue-router';
2
2
  import { ISysRoleRight, IRoleFunction } from '../model/IRole';
3
3
  import { IWidgetConfig } from '../model/Layout';
4
- declare type IWidgetMenu = any;
4
+ type IWidgetMenu = any;
5
5
  interface IPackage {
6
6
  name: string;
7
7
  version: string;
@@ -1,4 +1,4 @@
1
- export declare type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
1
+ export type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
2
2
  /**
3
3
  * Get服务请求
4
4
  * @param apiUrl API接口路径
@@ -11,7 +11,7 @@ export interface IFileMeta {
11
11
  /**
12
12
  * 文件下载事件
13
13
  */
14
- export declare type FileDownloadEvent = 'init' | 'info' | 'error' | 'downloadProgress' | 'saveProgress' | 'success';
14
+ export type FileDownloadEvent = 'init' | 'info' | 'error' | 'downloadProgress' | 'saveProgress' | 'success';
15
15
  /**
16
16
  * 大文件分片/断点续传下载
17
17
  */
@@ -1,6 +1,6 @@
1
1
  import { XhrHeaders } from 'xhr';
2
- export declare type FileEventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
3
- export declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
2
+ export type FileEventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
3
+ export type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
4
4
  /**
5
5
  * 文件上传配置
6
6
  */
@@ -100,10 +100,23 @@ export default class H5Tool {
100
100
  */
101
101
  static MD5(content: string, needRawHash?: boolean): string;
102
102
  /**
103
- * 复制文本
103
+ * 复制文本 old
104
104
  * @param text
105
105
  */
106
- static copyText: (text: string) => Promise<unknown>;
106
+ static copyTextByCommand(text: string): Promise<unknown>;
107
+ /**
108
+ * 复制文本,默认使用clipboard
109
+ * @param textContent
110
+ * @returns
111
+ */
112
+ static copyText: (textContent: string) => Promise<unknown>;
113
+ static copyElementTextByCommand(id: string): boolean;
114
+ /**
115
+ * 根据元素ID,复制元素里的内容,默认使用Clipboard
116
+ * @param elementID HTML元素ID
117
+ * @returns
118
+ */
119
+ static copyElementText(elementID: string): boolean | Promise<boolean>;
107
120
  /**
108
121
  * 设置是否开启网站灰模式
109
122
  * @param isGray 是否暗灰模式
@@ -17,7 +17,7 @@ export declare function isNullOrUnDef(val: unknown): val is null | undefined;
17
17
  /**
18
18
  * @description: 是否为对象
19
19
  */
20
- export declare const isObject: (val: any) => val is Record<any, any>;
20
+ export declare const isObjectX: (val: any) => val is Record<any, any>;
21
21
  /**
22
22
  * @description: 是否为时间
23
23
  */
@@ -1 +1,11 @@
1
- export declare function sleep(delay: any): void;
1
+ /**
2
+ * 阻塞方式等待多少毫秒
3
+ * @param milliseconds
4
+ */
5
+ export declare function sleep(milliseconds: number): void;
6
+ /**
7
+ * 异步等待多少毫秒
8
+ * @param milliseconds
9
+ * @returns
10
+ */
11
+ export declare function delay(milliseconds: number): Promise<unknown>;
@@ -10,9 +10,9 @@
10
10
  */
11
11
  export declare function ObjToUrlParams(baseUrl: string, obj: object): string;
12
12
  /**
13
- * 深入拷贝对象
14
- * @param src
15
- * @param target
16
- * @returns
13
+ * 深入拷贝对象, 将target合并到src里
14
+ * @param src 原始对象
15
+ * @param target 要合并的对象
16
+ * @returns 更新后的原始对象
17
17
  */
18
18
  export declare function deepMerge<T = any>(src?: any, target?: any): T;
@@ -5,7 +5,6 @@ import uuid, { newGuid } from './uuid';
5
5
  export * from './Color';
6
6
  export * from './FileDownload';
7
7
  export * from './Time';
8
- export { H5Tool, StringUtils, StorageHelper as Storage, storage, uuid, newGuid };
9
8
  export * from './AxiosHelper';
10
9
  export * from './TokenHelper';
11
10
  export * from './FileUpload';
@@ -15,4 +14,5 @@ export * from './BigFileDownload';
15
14
  export * from './IsTool';
16
15
  export * from './URLTool';
17
16
  export * from './CodeHelper';
18
- export * from './XXTEA';
17
+ import XXTEA from './XXTEA';
18
+ export { XXTEA, H5Tool, StringUtils, StorageHelper as Storage, storage, uuid, newGuid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xframelib",
3
- "version": "0.6.4",
3
+ "version": "0.6.8",
4
4
  "description": "积累的前端开发基础库",
5
5
  "main": "dist/index.js",
6
6
  "common": "dist/index.cjs",
@@ -26,34 +26,35 @@
26
26
  "@hprose/io": "^3.0.10",
27
27
  "@hprose/rpc-core": "^3.0.10",
28
28
  "@hprose/rpc-html5": "^3.0.10",
29
- "axios": "^0.27.2",
29
+ "axios": "^1.2.1",
30
30
  "localforage": "^1.10.0",
31
+ "qs": "^6.11.0",
31
32
  "spark-md5": "^3.0.2",
32
33
  "streamsaver": "^2.0.6",
33
34
  "xhr": "^2.6.0"
34
35
  },
35
36
  "devDependencies": {
36
- "@rollup/plugin-alias": "^3.1.9",
37
- "@rollup/plugin-commonjs": "^22.0.1",
38
- "@rollup/plugin-json": "^4.1.0",
39
- "@rollup/plugin-node-resolve": "^13.3.0",
40
- "@rollup/plugin-typescript": "^8.3.4",
37
+ "@rollup/plugin-alias": "^4.0.2",
38
+ "@rollup/plugin-commonjs": "^23.0.4",
39
+ "@rollup/plugin-json": "^5.0.2",
40
+ "@rollup/plugin-node-resolve": "^14.1.0",
41
+ "@rollup/plugin-typescript": "^10.0.1",
41
42
  "@types/streamsaver": "^2.0.1",
42
- "@vitejs/plugin-vue": "^3.0.1",
43
- "@vue/compiler-sfc": "^3.2.37",
44
- "esbuild": "^0.14.53",
43
+ "@vitejs/plugin-vue": "^4.0.0",
44
+ "@vue/compiler-sfc": "^3.2.45",
45
+ "esbuild": "^0.16.4",
45
46
  "rimraf": "^3.0.2",
46
47
  "rollup-plugin-copy": "^3.4.0",
47
- "rollup-plugin-esbuild": "^4.9.1",
48
- "rollup-plugin-scss": "^3.0.0",
48
+ "rollup-plugin-esbuild": "^5.0.0",
49
+ "rollup-plugin-scss": "^4.0.0",
49
50
  "rollup-plugin-terser": "^7.0.2",
50
- "rollup-plugin-typescript2": "^0.32.1",
51
+ "rollup-plugin-typescript2": "^0.34.1",
51
52
  "rollup-plugin-vue": "^6.0.0",
52
- "sass": "^1.54.1",
53
- "typescript": "^4.7.4",
54
- "vite": "^3.0.4",
55
- "vue": "^3.2.37",
56
- "vue-router": "^4.1.3",
57
- "vue-tsc": "^0.39.4"
53
+ "sass": "^1.56.2",
54
+ "typescript": "^4.9.4",
55
+ "vite": "^4.0.1",
56
+ "vue": "^3.2.45",
57
+ "vue-router": "^4.1.6",
58
+ "vue-tsc": "^1.0.13"
58
59
  }
59
60
  }