clickgo 3.0.7-dev8 → 3.1.0-dev9
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 -1
- package/dist/app/demo/app.js +93 -0
- package/dist/app/demo/form/control/form/form.js +21 -20
- package/dist/app/demo/form/control/form/form.xml +3 -3
- package/dist/app/demo/form/main.js +20 -10
- package/dist/app/demo/form/main.xml +1 -1
- package/dist/app/task/app.js +46 -0
- package/dist/app/task/form/bar/bar.js +84 -88
- package/dist/app/task/form/bar/bar.xml +4 -5
- package/dist/clickgo.js +1 -10
- package/dist/clickgo.ts +0 -8
- package/dist/control/common.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/index.js +105 -56
- package/dist/index.ts +164 -59
- package/dist/lib/control.js +363 -240
- package/dist/lib/control.ts +497 -284
- package/dist/lib/core.js +313 -228
- package/dist/lib/core.ts +400 -255
- package/dist/lib/dom.ts +1 -3
- package/dist/lib/form.js +398 -928
- package/dist/lib/form.ts +630 -1075
- package/dist/lib/fs.js +42 -39
- package/dist/lib/fs.ts +45 -41
- package/dist/lib/native.ts +3 -0
- package/dist/lib/task.js +705 -182
- package/dist/lib/task.ts +775 -200
- package/dist/lib/theme.ts +2 -2
- package/dist/lib/tool.js +58 -48
- package/dist/lib/tool.ts +79 -64
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +5 -7
- package/types/index.d.ts +274 -325
- package/dist/app/demo/config.json +0 -106
- package/dist/app/task/config.json +0 -32
package/types/index.d.ts
CHANGED
|
@@ -12,61 +12,47 @@ export let zip: typeof import('../dist/lib/zip');
|
|
|
12
12
|
export function getVersion(): string;
|
|
13
13
|
export function getNative(): boolean;
|
|
14
14
|
export function getPlatform(): NodeJS.Platform | 'web';
|
|
15
|
-
|
|
16
|
-
export
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
+
export const AbstractBoot: typeof import('../dist/index').AbstractBoot;
|
|
17
|
+
export function launcher(boot: import('../dist/index').AbstractBoot): void;
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
// -------------------------
|
|
20
|
+
// ------ control lib ------
|
|
21
|
+
// -------------------------
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
/** --- 控件文件包的 config --- */
|
|
24
|
+
export interface IControlConfig {
|
|
25
|
+
'name': string;
|
|
26
|
+
'ver': number;
|
|
27
|
+
'version': string;
|
|
28
|
+
'author': string;
|
|
21
29
|
|
|
22
|
-
/** ---
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'
|
|
26
|
-
|
|
27
|
-
'
|
|
30
|
+
/** --- 不带扩展名,系统会在末尾添加 .js --- */
|
|
31
|
+
'code': string;
|
|
32
|
+
/** --- 不带扩展名,系统会在末尾添加 .html --- */
|
|
33
|
+
'layout': string;
|
|
34
|
+
/** --- 不带扩展名,系统会在末尾添加 .css --- */
|
|
35
|
+
'style': string;
|
|
36
|
+
|
|
37
|
+
/** --- 将要加载的文件 --- */
|
|
38
|
+
'files': string[];
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
/** ---
|
|
31
|
-
export interface
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
formTitleChangedHandler: null | ((taskId: number, formId: number, title: string) => void | Promise<void>);
|
|
46
|
-
/** --- 窗体图标被改变后触发 --- */
|
|
47
|
-
formIconChangedHandler: null | ((taskId: number, formId: number, icon: string) => void | Promise<void>);
|
|
48
|
-
/** --- 窗体最小化状态改变后触发 --- */
|
|
49
|
-
formStateMinChangedHandler: null | ((taskId: number, formId: number, state: boolean) => void | Promise<void>);
|
|
50
|
-
/** --- 窗体最大化状态改变后触发 --- */
|
|
51
|
-
formStateMaxChangedHandler: null | ((taskId: number, formId: number, state: boolean) => void | Promise<void>);
|
|
52
|
-
/** --- 窗体显示状态改变后触发 */
|
|
53
|
-
formShowChangedHandler: null | ((taskId: number, formId: number, state: boolean) => void | Promise<void>);
|
|
54
|
-
/** --- 窗体获得焦点后触发 --- */
|
|
55
|
-
formFocusedHandler: null | ((taskId: number, formId: number) => void | Promise<void>);
|
|
56
|
-
/** --- 窗体丢失焦点后触发 --- */
|
|
57
|
-
formBlurredHandler: null | ((taskId: number, formId: number) => void | Promise<void>);
|
|
58
|
-
/** --- 窗体闪烁时触发 --- */
|
|
59
|
-
formFlashHandler: null | ((taskId: number, formId: number) => void | Promise<void>);
|
|
60
|
-
/** --- 任务开始后触发 --- */
|
|
61
|
-
taskStartedHandler: null | ((taskId: number) => void | Promise<void>);
|
|
62
|
-
/** --- 任务结束后触发 --- */
|
|
63
|
-
taskEndedHandler: null | ((taskId: number) => void | Promise<void>);
|
|
64
|
-
/** --- launcher 的文件夹名称被修改后触发 --- */
|
|
65
|
-
launcherFolderNameChangedHandler: null | ((id: string, name: string) => void | Promise<void>);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** --- Core Config 属性列表 --- */
|
|
69
|
-
export type TConfigName = 'locale' | 'task.position' | 'task.pin' | 'desktop.icon.storage' | 'desktop.icon.recycler' | 'desktop.wallpaper' | 'desktop.path' | 'launcher.list';
|
|
41
|
+
/** --- 控件对象 --- */
|
|
42
|
+
export interface IControl {
|
|
43
|
+
'type': 'control';
|
|
44
|
+
/** --- 控件对象配置文件 --- */
|
|
45
|
+
'config': IControlConfig;
|
|
46
|
+
/** --- 所有已加载的文件内容 --- */
|
|
47
|
+
'files': Record<string, Blob | string>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** --- 控件文件包 --- */
|
|
51
|
+
export type TControlPackage = Record<string, IControl>;
|
|
52
|
+
|
|
53
|
+
// --------------------------
|
|
54
|
+
// -------- core lib --------
|
|
55
|
+
// --------------------------
|
|
70
56
|
|
|
71
57
|
/** --- Config 对象 --- */
|
|
72
58
|
export interface IConfig {
|
|
@@ -89,31 +75,48 @@ export interface IConfigLauncherItem {
|
|
|
89
75
|
'list'?: Array<{ 'id'?: string; 'name': string; 'path': string; 'icon': string; }>;
|
|
90
76
|
}
|
|
91
77
|
|
|
78
|
+
/** --- 屏幕可用区域 --- */
|
|
79
|
+
export interface IAvailArea {
|
|
80
|
+
'left': number;
|
|
81
|
+
'top': number;
|
|
82
|
+
'width': number;
|
|
83
|
+
'height': number;
|
|
84
|
+
}
|
|
85
|
+
|
|
92
86
|
/** --- 全局事件类型 --- */
|
|
93
87
|
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged';
|
|
94
88
|
|
|
89
|
+
/** --- 现场下载 app 的参数 --- */
|
|
95
90
|
export interface ICoreFetchAppOptions {
|
|
96
91
|
'notifyId'?: number;
|
|
97
92
|
'current'?: string;
|
|
98
93
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
99
94
|
}
|
|
100
95
|
|
|
101
|
-
/** ---
|
|
96
|
+
/** --- 应用包解包后对象 --- */
|
|
102
97
|
export interface IApp {
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
/** --- net 模式将包含 net 属性,否则是 app 解包模式 --- */
|
|
99
|
+
'net'?: {
|
|
100
|
+
'current': string;
|
|
101
|
+
'url': string;
|
|
102
|
+
'notify'?: number;
|
|
103
|
+
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
104
|
+
};
|
|
105
|
+
/** --- 应用图标,net 模式下可能为空 --- */
|
|
105
106
|
'icon': string;
|
|
106
|
-
/** --- 应用对象配置文件 --- */
|
|
107
|
-
'config': IAppConfig;
|
|
108
107
|
/** --- 所有已加载的文件内容 --- */
|
|
109
108
|
'files': Record<string, Blob | string>;
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
/** --- 应用文件包 config --- */
|
|
113
112
|
export interface IAppConfig {
|
|
113
|
+
/** --- 应用名 --- */
|
|
114
114
|
'name': string;
|
|
115
|
+
/** --- 发行版本 --- */
|
|
115
116
|
'ver': number;
|
|
117
|
+
/** --- 发行版本字符串 --- */
|
|
116
118
|
'version': string;
|
|
119
|
+
/** --- 作者 --- */
|
|
117
120
|
'author': string;
|
|
118
121
|
|
|
119
122
|
/** --- 将要加载的控件 --- */
|
|
@@ -124,18 +127,23 @@ export interface IAppConfig {
|
|
|
124
127
|
'permissions'?: Record<string, any>;
|
|
125
128
|
/** --- 将自动加载的语言包,path: lang --- */
|
|
126
129
|
'locales'?: Record<string, string>;
|
|
127
|
-
/** ---
|
|
130
|
+
/** --- 全局样式,不带扩展名,系统会在末尾添加 .css --- */
|
|
128
131
|
'style'?: string;
|
|
129
|
-
/** ---
|
|
130
|
-
'
|
|
131
|
-
/** --- 图标路径,需包含扩张名 --- */
|
|
132
|
-
'icon': string;
|
|
132
|
+
/** --- 图标路径,需包含扩展名 --- */
|
|
133
|
+
'icon'?: string;
|
|
133
134
|
|
|
134
|
-
/** ---
|
|
135
|
-
'files'
|
|
135
|
+
/** --- 将要加载的非 js 文件列表,仅 net 模式有用 --- */
|
|
136
|
+
'files'?: string[];
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
//
|
|
139
|
+
// -------------------------
|
|
140
|
+
// -------- dom lib --------
|
|
141
|
+
// -------------------------
|
|
142
|
+
|
|
143
|
+
/** --- 方向类型,从左上开始 --- */
|
|
144
|
+
export type TDomBorder = 'lt' | 't' | 'tr' | 'r' | 'rb' | 'b' | 'bl' | 'l' | '';
|
|
145
|
+
|
|
146
|
+
export type TDomBorderCustom = TDomBorder | { 'left': number; 'top'?: number; 'width': number; 'height'?: number; };
|
|
139
147
|
|
|
140
148
|
/** --- Element 的大小 --- */
|
|
141
149
|
export interface IDomSize {
|
|
@@ -203,10 +211,10 @@ export interface IBindMoveOptions {
|
|
|
203
211
|
'object'?: HTMLElement | IVue;
|
|
204
212
|
'showRect'?: boolean;
|
|
205
213
|
'start'?: (x: number, y: number) => any;
|
|
206
|
-
'move'?: (ox: number, oy: number, x: number, y: number, border:
|
|
214
|
+
'move'?: (ox: number, oy: number, x: number, y: number, border: TDomBorder, dir: 'top' | 'right' | 'bottom' | 'left', e: MouseEvent | TouchEvent) => void;
|
|
207
215
|
'up'?: (moveTimes: Array<{ 'time': number; 'ox': number; 'oy': number; }>, e: MouseEvent | TouchEvent) => void;
|
|
208
216
|
'end'?: (moveTimes: Array<{ 'time': number; 'ox': number; 'oy': number; }>, e: MouseEvent | TouchEvent) => void;
|
|
209
|
-
'borderIn'?: (x: number, y: number, border:
|
|
217
|
+
'borderIn'?: (x: number, y: number, border: TDomBorder, e: MouseEvent | TouchEvent) => void;
|
|
210
218
|
'borderOut'?: () => void;
|
|
211
219
|
}
|
|
212
220
|
|
|
@@ -218,6 +226,23 @@ export interface IBindMoveResult {
|
|
|
218
226
|
'bottom': number;
|
|
219
227
|
}
|
|
220
228
|
|
|
229
|
+
/** --- 绑定改变大小选项 --- */
|
|
230
|
+
export interface IBindResizeOptions {
|
|
231
|
+
'objectLeft'?: number;
|
|
232
|
+
'objectTop'?: number;
|
|
233
|
+
'objectWidth'?: number;
|
|
234
|
+
'objectHeight'?: number;
|
|
235
|
+
'object'?: HTMLElement | IVue;
|
|
236
|
+
'minWidth'?: number;
|
|
237
|
+
'minHeight'?: number;
|
|
238
|
+
'maxWidth'?: number;
|
|
239
|
+
'maxHeight'?: number;
|
|
240
|
+
'border': TDomBorder;
|
|
241
|
+
'start'?: (x: number, y: number) => any;
|
|
242
|
+
'move'?: (left: number, top: number, width: number, height: number, x: number, y: number, border: TDomBorder) => void;
|
|
243
|
+
'end'?: () => void;
|
|
244
|
+
}
|
|
245
|
+
|
|
221
246
|
/** --- 监视大小中的元素 --- */
|
|
222
247
|
export interface IWatchSizeItem {
|
|
223
248
|
'el': HTMLElement;
|
|
@@ -232,43 +257,65 @@ export interface IWatchItem {
|
|
|
232
257
|
'taskId'?: number;
|
|
233
258
|
}
|
|
234
259
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
'
|
|
244
|
-
'
|
|
245
|
-
'
|
|
246
|
-
'border': TBorder;
|
|
247
|
-
'start'?: (x: number, y: number) => any;
|
|
248
|
-
'move'?: (left: number, top: number, width: number, height: number, x: number, y: number, border: TBorder) => void;
|
|
249
|
-
'end'?: () => void;
|
|
260
|
+
// --------------------------
|
|
261
|
+
// -------- form lib --------
|
|
262
|
+
// --------------------------
|
|
263
|
+
|
|
264
|
+
export type AbstractForm = import('../dist/lib/form').AbstractForm;
|
|
265
|
+
|
|
266
|
+
/** --- 运行时 task 中的 form 对象 --- */
|
|
267
|
+
export interface IForm {
|
|
268
|
+
'id': number;
|
|
269
|
+
'vapp': IVApp;
|
|
270
|
+
'vroot': IVue;
|
|
250
271
|
}
|
|
251
272
|
|
|
252
|
-
|
|
273
|
+
/** --- Form 的简略情况,通常在 list 当中 --- */
|
|
274
|
+
export interface IFormInfo {
|
|
275
|
+
'taskId': number;
|
|
276
|
+
'title': string;
|
|
277
|
+
'icon': string;
|
|
278
|
+
'stateMax': boolean;
|
|
279
|
+
'stateMin': boolean;
|
|
280
|
+
'show': boolean;
|
|
281
|
+
'focus': boolean;
|
|
282
|
+
}
|
|
253
283
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
'
|
|
257
|
-
'
|
|
258
|
-
'
|
|
259
|
-
'headers'?: HeadersInit;
|
|
284
|
+
/** --- 窗体创建选项 --- */
|
|
285
|
+
export interface IFormCreateOptions {
|
|
286
|
+
'code'?: IFormCreateCode;
|
|
287
|
+
'layout': string;
|
|
288
|
+
'style'?: string;
|
|
260
289
|
|
|
261
|
-
|
|
262
|
-
'
|
|
263
|
-
|
|
264
|
-
'
|
|
265
|
-
|
|
266
|
-
'
|
|
267
|
-
'load'?: (res: any) => void | Promise<void>;
|
|
268
|
-
'error'?: () => void | Promise<void>;
|
|
290
|
+
/** --- 当前窗体的基准路径,不以 / 结尾,仅用作传值,App 内无法填写 --- */
|
|
291
|
+
'path'?: string;
|
|
292
|
+
/** --- 传递到 onMounted 的数据 --- */
|
|
293
|
+
'data'?: Record<string, any>;
|
|
294
|
+
/** --- APP 内无法填写 --- */
|
|
295
|
+
'taskId'?: number;
|
|
269
296
|
}
|
|
270
297
|
|
|
271
|
-
|
|
298
|
+
/** --- 窗体的 code 参数 --- */
|
|
299
|
+
export interface IFormCreateCode {
|
|
300
|
+
'data'?: Record<string, any>;
|
|
301
|
+
'methods'?: Record<string, any>;
|
|
302
|
+
'computed'?: Record<string, {
|
|
303
|
+
'get'?: any;
|
|
304
|
+
'set'?: any;
|
|
305
|
+
}>;
|
|
306
|
+
'beforeCreate'?: any;
|
|
307
|
+
'created'?: any;
|
|
308
|
+
'beforeMount'?: any;
|
|
309
|
+
'mounted'?: any;
|
|
310
|
+
'beforeUpdate'?: any;
|
|
311
|
+
'updated'?: any;
|
|
312
|
+
'beforeUnmount'?: any;
|
|
313
|
+
'unmounted'?: any;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// --------------------------
|
|
317
|
+
// --------- fs lib ---------
|
|
318
|
+
// --------------------------
|
|
272
319
|
|
|
273
320
|
/** --- 文件/文件夹信息对象 --- */
|
|
274
321
|
export interface IStats {
|
|
@@ -295,55 +342,51 @@ export interface IDirent {
|
|
|
295
342
|
name: string;
|
|
296
343
|
}
|
|
297
344
|
|
|
298
|
-
//
|
|
299
|
-
|
|
300
|
-
|
|
345
|
+
// --------------------------
|
|
346
|
+
// -------- task lib --------
|
|
347
|
+
// --------------------------
|
|
301
348
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
'
|
|
305
|
-
'
|
|
306
|
-
'
|
|
349
|
+
/** --- 运行中的任务对象 --- */
|
|
350
|
+
export interface ITask {
|
|
351
|
+
'id': number;
|
|
352
|
+
'app': IApp;
|
|
353
|
+
'class': import('../dist/lib/core').AbstractApp;
|
|
354
|
+
'config': IAppConfig;
|
|
355
|
+
'customTheme': boolean;
|
|
356
|
+
'locale': {
|
|
357
|
+
'lang': string;
|
|
358
|
+
'data': Record<string, Record<string, string>>;
|
|
359
|
+
};
|
|
360
|
+
/** --- 当前 app 自己的完整路径,如 /x/xx.cga,或 /x/x,末尾不含 / --- */
|
|
307
361
|
'path': string;
|
|
362
|
+
/** --- 当前 app 运行路径,末尾不含 / --- */
|
|
363
|
+
'current': string;
|
|
364
|
+
|
|
365
|
+
/** --- 运行时的一些参数 --- */
|
|
366
|
+
'runtime': {
|
|
367
|
+
/** --- 独占窗体序列 --- */
|
|
368
|
+
'dialogFormIds': number[];
|
|
369
|
+
/** --- 已申请的权限列表 --- */
|
|
370
|
+
'permissions': Record<string, any>;
|
|
371
|
+
};
|
|
372
|
+
/** --- 窗体对象列表 --- */
|
|
373
|
+
'forms': Record<string, IForm>;
|
|
374
|
+
/** --- 已解析的控件处理后的对象,任务启动时解析,窗体创建时部分复用 --- */
|
|
375
|
+
'controls': Record<string, {
|
|
376
|
+
'layout': string;
|
|
377
|
+
|
|
378
|
+
'props': Record<string, any>;
|
|
379
|
+
'data': Record<string, any>;
|
|
380
|
+
'access': Record<string, any>;
|
|
381
|
+
'methods': Record<string, any>;
|
|
382
|
+
'computed': Record<string, any>;
|
|
383
|
+
}>;
|
|
384
|
+
/** --- 任务中的 timer 列表 --- */
|
|
385
|
+
'timers': Record<string, number>;
|
|
386
|
+
/** --- 用于初始化 control 时 invoke 用 --- */
|
|
387
|
+
'invoke'?: Record<string, any>;
|
|
308
388
|
}
|
|
309
389
|
|
|
310
|
-
export interface IZipStats {
|
|
311
|
-
'date': Date;
|
|
312
|
-
'isFile': boolean;
|
|
313
|
-
'isDirectory': boolean;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export interface IZipOutputByType {
|
|
317
|
-
'base64': string;
|
|
318
|
-
'string': string;
|
|
319
|
-
'array': number[];
|
|
320
|
-
'uint8array': Uint8Array;
|
|
321
|
-
'arraybuffer': ArrayBuffer;
|
|
322
|
-
'blob': Blob;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export type TZipOutputType = keyof IZipOutputByType;
|
|
326
|
-
|
|
327
|
-
export interface IZipInputByType {
|
|
328
|
-
'base64': string;
|
|
329
|
-
'string': string;
|
|
330
|
-
'array': number[];
|
|
331
|
-
'uint8array': Uint8Array;
|
|
332
|
-
'arraybuffer': ArrayBuffer;
|
|
333
|
-
'blob': Blob;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export type TZipInputType = keyof IZipInputByType;
|
|
337
|
-
|
|
338
|
-
export type TZipInputFileFormat = IZipInputByType[keyof IZipInputByType];
|
|
339
|
-
|
|
340
|
-
export interface IZipMetadata {
|
|
341
|
-
percent: number;
|
|
342
|
-
currentFile: string | null;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// --- task ---
|
|
346
|
-
|
|
347
390
|
/** --- 系统任务信息 --- */
|
|
348
391
|
export interface ISystemTaskInfo {
|
|
349
392
|
'taskId': number;
|
|
@@ -353,11 +396,18 @@ export interface ISystemTaskInfo {
|
|
|
353
396
|
|
|
354
397
|
export interface ITaskRunOptions {
|
|
355
398
|
'icon'?: string;
|
|
399
|
+
/** --- 加载进度回调 --- */
|
|
356
400
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
401
|
+
/** --- 显示 notify 窗口 --- */
|
|
357
402
|
'notify'?: boolean;
|
|
403
|
+
/** --- 设置为主应用,整个运行时只能设置一次,因此 App 下不可能被设置 --- */
|
|
358
404
|
'main'?: boolean;
|
|
405
|
+
/** --- native 下窗体与实体窗体大小同步,App 模式下无法设置 --- */
|
|
359
406
|
'sync'?: boolean;
|
|
407
|
+
/** --- 所属任务,App 模式无法设置 --- */
|
|
360
408
|
'taskId'?: number;
|
|
409
|
+
/** --- 不禁止某些浏览器对象,App 模式下无法设置 --- */
|
|
410
|
+
'unblock'?: string[];
|
|
361
411
|
}
|
|
362
412
|
|
|
363
413
|
export interface ICreateTimerOptions {
|
|
@@ -365,39 +415,9 @@ export interface ICreateTimerOptions {
|
|
|
365
415
|
'formId'?: number;
|
|
366
416
|
|
|
367
417
|
'immediate'?: boolean;
|
|
368
|
-
'scope'?: 'form' | 'task';
|
|
369
418
|
'count'?: number;
|
|
370
419
|
}
|
|
371
420
|
|
|
372
|
-
/** --- 运行中的任务对象 --- */
|
|
373
|
-
export interface ITask {
|
|
374
|
-
'id': number;
|
|
375
|
-
'app': IApp;
|
|
376
|
-
'customTheme': boolean;
|
|
377
|
-
'locale': {
|
|
378
|
-
'lang': string;
|
|
379
|
-
'data': Record<string, Record<string, string>>;
|
|
380
|
-
};
|
|
381
|
-
'icon': string;
|
|
382
|
-
/** --- 当前 app 运行路径,末尾包含 / --- */
|
|
383
|
-
'path': string;
|
|
384
|
-
'files': Record<string, Blob | string>;
|
|
385
|
-
'main': boolean;
|
|
386
|
-
|
|
387
|
-
/** --- 已申请的权限列表 --- */
|
|
388
|
-
'permissions': Record<string, any>;
|
|
389
|
-
'forms': Record<number, IForm>;
|
|
390
|
-
'objectURLs': string[];
|
|
391
|
-
/** --- 已解析的控件 path 映射控件对象 --- */
|
|
392
|
-
'controls': {
|
|
393
|
-
'loaded': Record<string, TControl | undefined>;
|
|
394
|
-
'layout': Record<string, string>;
|
|
395
|
-
'prep': Record<string, string>;
|
|
396
|
-
};
|
|
397
|
-
/** --- 任务重的 timer 列表 --- */
|
|
398
|
-
'timers': Record<string, number>;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
421
|
/** --- Task 的简略情况,通常在 list 当中 --- */
|
|
402
422
|
export interface ITaskInfo {
|
|
403
423
|
'name': string;
|
|
@@ -406,9 +426,12 @@ export interface ITaskInfo {
|
|
|
406
426
|
'formCount': number;
|
|
407
427
|
'icon': string;
|
|
408
428
|
'path': string;
|
|
429
|
+
'current': string;
|
|
409
430
|
}
|
|
410
431
|
|
|
411
|
-
//
|
|
432
|
+
// ---------------------------
|
|
433
|
+
// -------- theme lib --------
|
|
434
|
+
// ---------------------------
|
|
412
435
|
|
|
413
436
|
/** --- 主题对象 --- */
|
|
414
437
|
export interface ITheme {
|
|
@@ -433,43 +456,82 @@ export interface IThemeConfig {
|
|
|
433
456
|
'files': string[];
|
|
434
457
|
}
|
|
435
458
|
|
|
436
|
-
//
|
|
459
|
+
// --------------------------
|
|
460
|
+
// -------- tool lib --------
|
|
461
|
+
// --------------------------
|
|
437
462
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
'
|
|
441
|
-
'
|
|
442
|
-
'
|
|
443
|
-
'
|
|
463
|
+
export interface IRequestOptions {
|
|
464
|
+
'method'?: 'GET' | 'POST';
|
|
465
|
+
'body'?: FormData;
|
|
466
|
+
'timeout'?: number;
|
|
467
|
+
'responseType'?: XMLHttpRequestResponseType;
|
|
468
|
+
'headers'?: HeadersInit;
|
|
469
|
+
|
|
470
|
+
'uploadStart'?: (total: number) => void | Promise<void>;
|
|
471
|
+
'uploadProgress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
472
|
+
'uploadEnd'?: () => void | Promise<void>;
|
|
473
|
+
'start'?: (total: number) => void | Promise<void>;
|
|
474
|
+
'end'?: () => void | Promise<void>;
|
|
475
|
+
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
476
|
+
'load'?: (res: any) => void | Promise<void>;
|
|
477
|
+
'error'?: () => void | Promise<void>;
|
|
444
478
|
}
|
|
445
479
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
'taskId'?: number;
|
|
450
|
-
/** --- 当前的 formId,App 模式下无效 --- */
|
|
451
|
-
'formId'?: number;
|
|
480
|
+
// -------------------------
|
|
481
|
+
// -------- zip lib --------
|
|
482
|
+
// -------------------------
|
|
452
483
|
|
|
453
|
-
|
|
484
|
+
export type TZip = import('../dist/lib/zip').Zip;
|
|
454
485
|
|
|
455
|
-
|
|
456
|
-
'
|
|
457
|
-
'
|
|
458
|
-
'
|
|
459
|
-
'
|
|
486
|
+
export interface IZipItem {
|
|
487
|
+
'name': string;
|
|
488
|
+
'date': Date;
|
|
489
|
+
'isFile': boolean;
|
|
490
|
+
'isDirectory': boolean;
|
|
491
|
+
'path': string;
|
|
492
|
+
}
|
|
460
493
|
|
|
461
|
-
|
|
462
|
-
'
|
|
463
|
-
|
|
464
|
-
'
|
|
465
|
-
/** --- 传输的数据 --- */
|
|
466
|
-
'data'?: Record<string, any>;
|
|
494
|
+
export interface IZipStats {
|
|
495
|
+
'date': Date;
|
|
496
|
+
'isFile': boolean;
|
|
497
|
+
'isDirectory': boolean;
|
|
467
498
|
}
|
|
468
499
|
|
|
500
|
+
export interface IZipOutputByType {
|
|
501
|
+
'base64': string;
|
|
502
|
+
'string': string;
|
|
503
|
+
'array': number[];
|
|
504
|
+
'uint8array': Uint8Array;
|
|
505
|
+
'arraybuffer': ArrayBuffer;
|
|
506
|
+
'blob': Blob;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export type TZipOutputType = keyof IZipOutputByType;
|
|
510
|
+
|
|
511
|
+
export interface IZipInputByType {
|
|
512
|
+
'base64': string;
|
|
513
|
+
'string': string;
|
|
514
|
+
'array': number[];
|
|
515
|
+
'uint8array': Uint8Array;
|
|
516
|
+
'arraybuffer': ArrayBuffer;
|
|
517
|
+
'blob': Blob;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export type TZipInputType = keyof IZipInputByType;
|
|
521
|
+
|
|
522
|
+
export type TZipInputFileFormat = IZipInputByType[keyof IZipInputByType];
|
|
523
|
+
|
|
524
|
+
export interface IZipMetadata {
|
|
525
|
+
percent: number;
|
|
526
|
+
currentFile: string | null;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// --- form ---
|
|
530
|
+
|
|
469
531
|
/** --- Dialog 选项 --- */
|
|
470
532
|
export interface IFormDialogOptions {
|
|
471
|
-
/** --- 当前的
|
|
472
|
-
'
|
|
533
|
+
/** --- 当前的 taskId,App 模式下无效 --- */
|
|
534
|
+
'taskId'?: number;
|
|
473
535
|
|
|
474
536
|
'title'?: string;
|
|
475
537
|
'content': string;
|
|
@@ -481,8 +543,8 @@ export interface IFormDialogOptions {
|
|
|
481
543
|
|
|
482
544
|
/** --- Confirm 选项 --- */
|
|
483
545
|
export interface IFormConfirmOptions {
|
|
484
|
-
/** --- 当前的
|
|
485
|
-
'
|
|
546
|
+
/** --- 当前的 taskId,App 模式下无效 --- */
|
|
547
|
+
'taskId'?: number;
|
|
486
548
|
|
|
487
549
|
'content': string;
|
|
488
550
|
'cancel'?: boolean;
|
|
@@ -495,17 +557,6 @@ export interface IFormSetTopMostOptions {
|
|
|
495
557
|
'formId'?: number;
|
|
496
558
|
}
|
|
497
559
|
|
|
498
|
-
/** --- Form 的简略情况,通常在 list 当中 --- */
|
|
499
|
-
export interface IFormInfo {
|
|
500
|
-
'taskId': number;
|
|
501
|
-
'title': string;
|
|
502
|
-
'icon': string;
|
|
503
|
-
'stateMax': boolean;
|
|
504
|
-
'stateMin': boolean;
|
|
505
|
-
'show': boolean;
|
|
506
|
-
'focus': boolean;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
560
|
/** --- 移动 drag 到新位置函数的选项 --- */
|
|
510
561
|
export interface IMoveDragOptions {
|
|
511
562
|
'top'?: number;
|
|
@@ -524,114 +575,12 @@ export interface INotifyOptions {
|
|
|
524
575
|
'progress'?: boolean;
|
|
525
576
|
}
|
|
526
577
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
export interface IVForm extends IVue {
|
|
531
|
-
/** --- 当前任务 id --- */
|
|
532
|
-
'taskId': number;
|
|
533
|
-
/** --- 当前窗体 id --- */
|
|
534
|
-
'formId': number;
|
|
535
|
-
/** --- 控件名 --- */
|
|
536
|
-
'controlName': 'root';
|
|
537
|
-
/** --- 当前窗体是否有焦点 --- */
|
|
538
|
-
'cgFocus': boolean;
|
|
539
|
-
/** --- 当前窗体的路径 --- */
|
|
540
|
-
'cgPath': string;
|
|
541
|
-
/** --- 前导 --- */
|
|
542
|
-
'cgPrep': string;
|
|
543
|
-
/** --- 是否 form 自定义的 zindex --- */
|
|
544
|
-
'cgCustomZIndex': boolean;
|
|
545
|
-
/** --- 是否在顶层 --- */
|
|
546
|
-
'cgTopMost': boolean;
|
|
547
|
-
/** --- 当前的 locale name --- */
|
|
548
|
-
'cgLocale': string;
|
|
549
|
-
/** --- 获取语言内容 --- */
|
|
550
|
-
'l': (key: string) => string;
|
|
551
|
-
/**
|
|
552
|
-
* --- layout 中 :class 的转义 ---
|
|
553
|
-
* @param cla class 内容对象
|
|
554
|
-
*/
|
|
555
|
-
cgClassPrepend(cla: any): string;
|
|
556
|
-
/**
|
|
557
|
-
* --- 检测事件是否可被执行 ---
|
|
558
|
-
* @param e 事件
|
|
559
|
-
*/
|
|
560
|
-
cgAllowEvent(e: MouseEvent | TouchEvent | KeyboardEvent): boolean;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// --- 控件 --- control ---
|
|
564
|
-
|
|
565
|
-
/** --- 控件文件包 --- */
|
|
566
|
-
export type TControl = Record<string, IControlItem>;
|
|
567
|
-
|
|
568
|
-
/** --- 控件对象 --- */
|
|
569
|
-
export interface IControlItem {
|
|
570
|
-
'type': 'control';
|
|
571
|
-
/** --- 控件对象配置文件 --- */
|
|
572
|
-
'config': IControlConfig;
|
|
573
|
-
/** --- 所有已加载的文件内容 --- */
|
|
574
|
-
'files': Record<string, Blob | string>;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/** --- 控件文件包的 config --- */
|
|
578
|
-
export interface IControlConfig {
|
|
579
|
-
'name': string;
|
|
580
|
-
'ver': number;
|
|
581
|
-
'version': string;
|
|
582
|
-
'author': string;
|
|
583
|
-
|
|
584
|
-
/** --- 不带扩展名,系统会在末尾添加 .js --- */
|
|
585
|
-
'code': string;
|
|
586
|
-
/** --- 不带扩展名,系统会在末尾添加 .html --- */
|
|
587
|
-
'layout': string;
|
|
588
|
-
/** --- 不带扩展名,系统会在末尾添加 .css --- */
|
|
589
|
-
'style': string;
|
|
590
|
-
|
|
591
|
-
/** --- 将要加载的文件 --- */
|
|
592
|
-
'files': string[];
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
export interface IVControl extends IVue {
|
|
596
|
-
'$parent': IVControl | null;
|
|
597
|
-
|
|
598
|
-
/** --- 当前窗体是否有焦点 --- */
|
|
599
|
-
'cgFocus': boolean;
|
|
600
|
-
/** --- 当前任务 id --- */
|
|
601
|
-
'taskId': number;
|
|
602
|
-
/** --- 当前窗体 id --- */
|
|
603
|
-
'formId': number;
|
|
604
|
-
/** --- 控件名 --- */
|
|
605
|
-
'controlName': string;
|
|
606
|
-
/** --- 窗体基目录 --- */
|
|
607
|
-
'cgPath': string;
|
|
608
|
-
/** --- 控件前导 --- */
|
|
609
|
-
'cgPrep': string;
|
|
610
|
-
/** --- 获取目前现存的子 slots --- */
|
|
611
|
-
'cgSlots': (name?: string) => IVueVNode[];
|
|
612
|
-
/** --- 当前 task 的 locale 值 --- */
|
|
613
|
-
'cgLocale': string;
|
|
614
|
-
/** --- 获取语言内容 --- */
|
|
615
|
-
'l': (key: string, data?: Record<string, Record<string, string>>) => string;
|
|
616
|
-
/** --- 根据 control name 来寻找上级 --- */
|
|
617
|
-
'cgParentByName': (controlName: string) => IVControl | null;
|
|
618
|
-
/**
|
|
619
|
-
* --- layout 中 :class 的转义 ---
|
|
620
|
-
* @param cla class 内容对象
|
|
621
|
-
*/
|
|
622
|
-
cgClassPrepend(cla: any): string;
|
|
623
|
-
/**
|
|
624
|
-
* --- 检测事件是否可被执行 ---
|
|
625
|
-
* @param e 事件
|
|
626
|
-
*/
|
|
627
|
-
cgAllowEvent(e: MouseEvent | TouchEvent | KeyboardEvent): boolean;
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
// --- vue ---
|
|
578
|
+
// -------------------------
|
|
579
|
+
// ---------- vue ----------
|
|
580
|
+
// -------------------------
|
|
632
581
|
|
|
633
582
|
export interface IVueObject {
|
|
634
|
-
createApp(opt: any):
|
|
583
|
+
createApp(opt: any): IVApp;
|
|
635
584
|
ref<T extends number | string>(obj: T): { 'value': T; };
|
|
636
585
|
reactive<T>(obj: T): T;
|
|
637
586
|
watch(
|
|
@@ -653,7 +602,7 @@ export interface IVueConfig {
|
|
|
653
602
|
warnHandler?(msg: string, instance: IVue | null, trace: string): void;
|
|
654
603
|
}
|
|
655
604
|
|
|
656
|
-
export interface
|
|
605
|
+
export interface IVApp {
|
|
657
606
|
component(name: string): any | undefined;
|
|
658
607
|
component(name: string, config: any): this;
|
|
659
608
|
'config': IVueConfig;
|
|
@@ -681,19 +630,19 @@ export interface IVue {
|
|
|
681
630
|
'$refs': Record<string, HTMLElement & IVue>;
|
|
682
631
|
'$root': IVue;
|
|
683
632
|
'$slots': {
|
|
684
|
-
'default': undefined | ((o?: any) =>
|
|
685
|
-
[key: string]: undefined | ((o?: any) =>
|
|
633
|
+
'default': undefined | ((o?: any) => IVNode[]);
|
|
634
|
+
[key: string]: undefined | ((o?: any) => IVNode[]);
|
|
686
635
|
};
|
|
687
636
|
'$watch': (o: any, cb: (n: any, o: any) => void) => void;
|
|
688
637
|
|
|
689
638
|
[key: string]: any;
|
|
690
639
|
}
|
|
691
640
|
|
|
692
|
-
export interface
|
|
641
|
+
export interface IVNode {
|
|
693
642
|
'children': {
|
|
694
|
-
'default': undefined | (() =>
|
|
695
|
-
[key: string]: undefined | (() =>
|
|
696
|
-
} &
|
|
643
|
+
'default': undefined | (() => IVNode[]);
|
|
644
|
+
[key: string]: undefined | (() => IVNode[]);
|
|
645
|
+
} & IVNode[];
|
|
697
646
|
'props': Record<string, any>;
|
|
698
647
|
'type': symbol | Record<string, any>;
|
|
699
648
|
|