clickgo 3.1.2-dev11 → 3.1.4-dev13
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 +0 -73
- package/dist/app/demo/config.json +113 -0
- package/dist/app/demo/form/control/button/button.js +12 -11
- package/dist/app/demo/form/control/button/button.xml +6 -6
- package/dist/app/demo/form/control/check/check.js +14 -10
- package/dist/app/demo/form/control/file/file.js +15 -13
- package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
- package/dist/app/demo/form/control/flow/flow.js +64 -0
- package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
- package/dist/app/demo/form/control/flow/flow.xml +101 -0
- package/dist/app/demo/form/control/form/form.js +1 -1
- package/dist/app/demo/form/control/form/form.xml +3 -3
- package/dist/app/demo/form/control/img/img.xml +2 -2
- package/dist/app/demo/form/control/list/list.js +95 -75
- package/dist/app/demo/form/control/list/list.xml +15 -11
- package/dist/app/demo/form/control/marquee/marquee.js +12 -10
- package/dist/app/demo/form/control/menu/menu.js +10 -6
- package/dist/app/demo/form/control/monaco/monaco.js +50 -60
- package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
- package/dist/app/demo/form/control/property/property.js +131 -127
- package/dist/app/demo/form/control/radio/radio.js +9 -5
- package/dist/app/demo/form/control/scroll/scroll.js +16 -12
- package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
- package/dist/app/demo/form/control/select/select.js +132 -71
- package/dist/app/demo/form/control/select/select.xml +69 -67
- package/dist/app/demo/form/control/tab/tab.js +21 -20
- package/dist/app/demo/form/control/tab/tab.xml +2 -2
- package/dist/app/demo/form/control/text/text.js +53 -45
- package/dist/app/demo/form/control/text/text.xml +3 -3
- package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
- package/dist/app/demo/form/control/vflow/vflow.js +79 -0
- package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
- package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
- package/dist/app/demo/form/event/form/form.js +58 -56
- package/dist/app/demo/form/event/form/form.xml +3 -3
- package/dist/app/demo/form/event/other/other.js +29 -0
- package/dist/app/demo/form/event/other/other.xml +5 -0
- package/dist/app/demo/form/event/screen/screen.js +30 -28
- package/dist/app/demo/form/event/screen/screen.xml +2 -2
- package/dist/app/demo/form/event/task/task.js +31 -31
- package/dist/app/demo/form/event/task/task.xml +3 -3
- package/dist/app/demo/form/main.js +166 -5
- package/dist/app/demo/form/main.xml +37 -35
- package/dist/app/demo/form/method/aform/aform.js +2 -1
- package/dist/app/demo/form/method/aform/aform.xml +3 -2
- package/dist/app/demo/form/method/aform/sd.js +28 -0
- package/dist/app/demo/form/method/aform/sd.xml +7 -0
- package/dist/app/demo/form/method/aform/test.xml +4 -5
- package/dist/app/demo/form/method/core/core.js +23 -8
- package/dist/app/demo/form/method/core/core.xml +6 -1
- package/dist/app/demo/form/method/dom/dom.js +91 -99
- package/dist/app/demo/form/method/dom/dom.xml +6 -7
- package/dist/app/demo/form/method/form/form.js +8 -8
- package/dist/app/demo/form/method/form/form.xml +4 -4
- package/dist/app/demo/form/method/fs/fs.js +34 -33
- package/dist/app/demo/form/method/fs/fs.xml +1 -1
- package/dist/app/demo/form/method/fs/text.js +12 -12
- package/dist/app/demo/form/method/native/native.js +50 -0
- package/dist/app/demo/form/method/native/native.xml +12 -0
- package/dist/app/demo/form/method/system/system.js +50 -0
- package/dist/app/demo/form/method/system/system.xml +11 -0
- package/dist/app/demo/form/method/task/task.js +68 -62
- package/dist/app/demo/form/method/task/task.xml +5 -6
- package/dist/app/demo/form/method/theme/theme.js +14 -14
- package/dist/app/demo/form/method/tool/tool.js +29 -28
- package/dist/app/demo/form/method/tool/tool.xml +3 -3
- package/dist/app/demo/form/method/zip/zip.js +46 -41
- package/dist/app/demo/form/method/zip/zip.xml +1 -1
- package/dist/app/task/app.js +0 -25
- package/dist/app/task/config.json +29 -0
- package/dist/app/task/form/bar/bar.js +1 -1
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- 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/global.css +1 -1
- package/dist/index.js +6 -3
- package/dist/index.ts +9 -3
- package/dist/lib/control.js +70 -104
- package/dist/lib/control.ts +97 -123
- package/dist/lib/core.js +163 -253
- package/dist/lib/core.ts +185 -268
- package/dist/lib/dom.js +565 -484
- package/dist/lib/dom.ts +704 -547
- package/dist/lib/form.js +211 -159
- package/dist/lib/form.ts +196 -121
- package/dist/lib/fs.js +107 -12
- package/dist/lib/fs.ts +111 -20
- package/dist/lib/native.js +142 -8
- package/dist/lib/native.ts +181 -11
- package/dist/lib/task.js +526 -164
- package/dist/lib/task.ts +598 -179
- package/dist/lib/tool.js +48 -1
- package/dist/lib/tool.ts +61 -0
- package/dist/lib/zip.ts +2 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +2 -2
- package/types/index.d.ts +83 -39
- package/dist/app/demo/form/control/greatview/greatview.js +0 -92
- package/dist/app/demo/form/control/overflow/overflow.js +0 -70
- package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
- package/dist/app/demo/form/control/view/view.css +0 -1
- package/dist/app/demo/form/control/view/view.js +0 -73
- package/dist/app/demo/form/control/view/view.scss +0 -18
- package/dist/app/demo/form/control/view/view.xml +0 -94
package/dist/lib/tool.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.execCommand = exports.blob2DataUrl = exports.blob2Text = exports.urlResolve = exports.parseUrl = exports.request = exports.escapeHTML = exports.getNumber = exports.getBoolean = exports.random = exports.RANDOM_LUNS = exports.RANDOM_V = exports.RANDOM_LUN = exports.RANDOM_LU = exports.RANDOM_LN = exports.RANDOM_UN = exports.RANDOM_L = exports.RANDOM_U = exports.RANDOM_N = exports.rand = exports.getMimeByPath = exports.stylePrepend = exports.eventsAttrWrap = exports.layoutClassPrepend = exports.layoutInsertAttr = exports.layoutAddTagClassAndReTagName = exports.styleUrl2DataUrl = exports.purify = exports.sleep = exports.clone = exports.blob2ArrayBuffer = exports.getClassPrototype = void 0;
|
|
12
|
+
exports.execCommand = exports.blob2DataUrl = exports.blob2Text = exports.urlResolve = exports.parseUrl = exports.request = exports.escapeHTML = exports.getArray = exports.getNumber = exports.getBoolean = exports.random = exports.RANDOM_LUNS = exports.RANDOM_V = exports.RANDOM_LUN = exports.RANDOM_LU = exports.RANDOM_LN = exports.RANDOM_UN = exports.RANDOM_L = exports.RANDOM_U = exports.RANDOM_N = exports.rand = exports.getMimeByPath = exports.stylePrepend = exports.teleportGlue = exports.eventsAttrWrap = exports.layoutClassPrepend = exports.layoutInsertAttr = exports.layoutAddTagClassAndReTagName = exports.styleUrl2DataUrl = exports.purify = exports.sleepFrame = exports.nextFrame = exports.sleep = exports.clone = exports.blob2ArrayBuffer = exports.getClassPrototype = void 0;
|
|
13
13
|
function getClassPrototype(obj, over = [], level = 0) {
|
|
14
14
|
if (level === 0) {
|
|
15
15
|
return getClassPrototype(Object.getPrototypeOf(obj), over, level + 1);
|
|
@@ -93,6 +93,25 @@ function sleep(ms = 0) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
exports.sleep = sleep;
|
|
96
|
+
function nextFrame() {
|
|
97
|
+
return new Promise(function (resolve) {
|
|
98
|
+
requestAnimationFrame(() => {
|
|
99
|
+
resolve();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
exports.nextFrame = nextFrame;
|
|
104
|
+
function sleepFrame(count) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (count > 10) {
|
|
107
|
+
count = 10;
|
|
108
|
+
}
|
|
109
|
+
for (let i = 0; i < count; ++i) {
|
|
110
|
+
yield nextFrame();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
exports.sleepFrame = sleepFrame;
|
|
96
115
|
function purify(text) {
|
|
97
116
|
text = '>' + text + '<';
|
|
98
117
|
text = text.replace(/<!--([\s\S]*?)-->/g, '').replace(/>([\s\S]*?)</g, function (t, t1) {
|
|
@@ -255,6 +274,19 @@ function eventsAttrWrap(layout) {
|
|
|
255
274
|
});
|
|
256
275
|
}
|
|
257
276
|
exports.eventsAttrWrap = eventsAttrWrap;
|
|
277
|
+
function teleportGlue(layout, formId) {
|
|
278
|
+
if (typeof formId !== 'string') {
|
|
279
|
+
formId = formId.toString();
|
|
280
|
+
}
|
|
281
|
+
const fid = formId;
|
|
282
|
+
return layout.replace(/<teleport([\s\S]+?)to="(.+?)"([\s\S]+?<[\w-]+)/g, (v, v1, v2, v3) => {
|
|
283
|
+
if (v2 !== 'system') {
|
|
284
|
+
return v;
|
|
285
|
+
}
|
|
286
|
+
return '<teleport' + v1 + 'to="#cg-pop-list > [data-form-id=\'' + fid + '\']"' + v3 + ' data-cg-pop';
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
exports.teleportGlue = teleportGlue;
|
|
258
290
|
function stylePrepend(style, prep = '') {
|
|
259
291
|
if (prep === '') {
|
|
260
292
|
prep = 'cg-scope' + Math.round(Math.random() * 1000000000000000).toString() + '_';
|
|
@@ -379,6 +411,21 @@ function getNumber(param) {
|
|
|
379
411
|
return parseFloat(param);
|
|
380
412
|
}
|
|
381
413
|
exports.getNumber = getNumber;
|
|
414
|
+
function getArray(param) {
|
|
415
|
+
if (typeof param !== 'string') {
|
|
416
|
+
return param;
|
|
417
|
+
}
|
|
418
|
+
let rtn = [];
|
|
419
|
+
if (param.startsWith('[')) {
|
|
420
|
+
rtn = JSON.parse(param);
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
param = param.replace(/ /g, '');
|
|
424
|
+
rtn = param.split(',');
|
|
425
|
+
}
|
|
426
|
+
return rtn;
|
|
427
|
+
}
|
|
428
|
+
exports.getArray = getArray;
|
|
382
429
|
function escapeHTML(html) {
|
|
383
430
|
return html.replace(/</g, '<').replace(/>/g, '>');
|
|
384
431
|
}
|
package/dist/lib/tool.ts
CHANGED
|
@@ -126,6 +126,30 @@ export function sleep(ms: number = 0): Promise<boolean> {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* --- 等待浏览器帧 ---
|
|
131
|
+
*/
|
|
132
|
+
export function nextFrame(): Promise<void> {
|
|
133
|
+
return new Promise(function(resolve) {
|
|
134
|
+
requestAnimationFrame(() => {
|
|
135
|
+
resolve();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* --- 等待浏览器帧 ---
|
|
142
|
+
* @param count 等待帧数最高 10 帧
|
|
143
|
+
*/
|
|
144
|
+
export async function sleepFrame(count: number): Promise<void> {
|
|
145
|
+
if (count > 10) {
|
|
146
|
+
count = 10;
|
|
147
|
+
}
|
|
148
|
+
for (let i = 0; i < count; ++i) {
|
|
149
|
+
await nextFrame();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
129
153
|
/**
|
|
130
154
|
* --- 去除 html 的空白符、换行以及注释 ---
|
|
131
155
|
* @param text 要纯净的字符串
|
|
@@ -338,6 +362,24 @@ export function eventsAttrWrap(layout: string): string {
|
|
|
338
362
|
});
|
|
339
363
|
}
|
|
340
364
|
|
|
365
|
+
/**
|
|
366
|
+
* --- 对 layout 的 teleport 做转义处理为 vue 识别的内容 ---
|
|
367
|
+
* @param layout 要处理的窗体或控件的 layout
|
|
368
|
+
* @param formId 要加入的 formId
|
|
369
|
+
*/
|
|
370
|
+
export function teleportGlue(layout: string, formId: number | string): string {
|
|
371
|
+
if (typeof formId !== 'string') {
|
|
372
|
+
formId = formId.toString();
|
|
373
|
+
}
|
|
374
|
+
const fid = formId;
|
|
375
|
+
return layout.replace(/<teleport([\s\S]+?)to="(.+?)"([\s\S]+?<[\w-]+)/g, (v, v1, v2, v3): string => {
|
|
376
|
+
if (v2 !== 'system') {
|
|
377
|
+
return v;
|
|
378
|
+
}
|
|
379
|
+
return '<teleport' + v1 + 'to="#cg-pop-list > [data-form-id=\'' + fid + '\']"' + v3 + ' data-cg-pop';
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
341
383
|
/**
|
|
342
384
|
* --- 给 class 前部增加唯一标识符 ---
|
|
343
385
|
* @param style 样式内容
|
|
@@ -504,6 +546,25 @@ export function getNumber(param: string | number): number {
|
|
|
504
546
|
return parseFloat(param);
|
|
505
547
|
}
|
|
506
548
|
|
|
549
|
+
/**
|
|
550
|
+
* --- 根据参数获取最终的数组型 ---
|
|
551
|
+
* @param param 参数
|
|
552
|
+
*/
|
|
553
|
+
export function getArray(param: string | any[]): any[] {
|
|
554
|
+
if (typeof param !== 'string') {
|
|
555
|
+
return param;
|
|
556
|
+
}
|
|
557
|
+
let rtn: any[] = [];
|
|
558
|
+
if (param.startsWith('[')) {
|
|
559
|
+
rtn = JSON.parse(param);
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
param = param.replace(/ /g, '');
|
|
563
|
+
rtn = param.split(',');
|
|
564
|
+
}
|
|
565
|
+
return rtn;
|
|
566
|
+
}
|
|
567
|
+
|
|
507
568
|
/**
|
|
508
569
|
* --- 转义 HTML ---
|
|
509
570
|
* @param html HTML 字符
|
package/dist/lib/zip.ts
CHANGED
|
@@ -142,6 +142,7 @@ export class Zip {
|
|
|
142
142
|
return pstats;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/** --- 读取目录,hasChildren: false, hasDir: true, pathAsKey: false --- */
|
|
145
146
|
public readDir(path?: string, opt?: { 'hasChildren'?: boolean; 'hasDir'?: boolean; 'pathAsKey'?: false; }): types.IZipItem[];
|
|
146
147
|
public readDir(path?: string, opt?: { 'hasChildren'?: boolean; 'hasDir'?: boolean; 'pathAsKey': true; }): Record<string, types.IZipItem>;
|
|
147
148
|
/**
|
|
@@ -278,6 +279,7 @@ export class Zip {
|
|
|
278
279
|
*/
|
|
279
280
|
private _refreshList(): void {
|
|
280
281
|
const list: Record<string, Record<string, types.IZipItem>> = {};
|
|
282
|
+
// eslint-disable-next-line @litert/rules/disable-for-each-method
|
|
281
283
|
this._zip.forEach(function(relativePath: string, item: jszip.JSZipObject) {
|
|
282
284
|
if (relativePath.startsWith('/')) {
|
|
283
285
|
relativePath = relativePath.slice(1);
|
package/dist/theme/familiar.cgt
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clickgo",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4-dev13",
|
|
4
4
|
"description": "Background interface, software interface, mobile phone APP interface operation library.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deskrt",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@litert/eslint-plugin-rules": "^0.1.0",
|
|
22
22
|
"@litert/loader": "^3.4.3",
|
|
23
|
-
"@types/node": "^
|
|
23
|
+
"@types/node": "^18.11.14",
|
|
24
24
|
"electron": "^19.1.3",
|
|
25
25
|
"typescript": "^4.8.4"
|
|
26
26
|
},
|
package/types/index.d.ts
CHANGED
|
@@ -35,9 +35,6 @@ export interface IControlConfig {
|
|
|
35
35
|
'layout': string;
|
|
36
36
|
/** --- 不带扩展名,系统会在末尾添加 .css --- */
|
|
37
37
|
'style': string;
|
|
38
|
-
|
|
39
|
-
/** --- 将要加载的文件 --- */
|
|
40
|
-
'files': string[];
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
/** --- 控件对象 --- */
|
|
@@ -86,7 +83,7 @@ export interface IAvailArea {
|
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
/** --- 全局事件类型 --- */
|
|
89
|
-
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged';
|
|
86
|
+
export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCreated' | 'formRemoved' | 'formTitleChanged' | 'formIconChanged' | 'formStateMinChanged' | 'formStateMaxChanged' | 'formShowChanged' | 'formFocused' | 'formBlurred' | 'formFlash' | 'taskStarted' | 'taskEnded' | 'launcherFolderNameChanged' | 'hashChanged';
|
|
90
87
|
|
|
91
88
|
/** --- 现场下载 app 的参数 --- */
|
|
92
89
|
export interface ICoreFetchAppOptions {
|
|
@@ -97,17 +94,13 @@ export interface ICoreFetchAppOptions {
|
|
|
97
94
|
|
|
98
95
|
/** --- 应用包解包后对象 --- */
|
|
99
96
|
export interface IApp {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
'url': string;
|
|
104
|
-
'notify'?: number;
|
|
105
|
-
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
106
|
-
};
|
|
107
|
-
/** --- 应用图标,net 模式下可能为空 --- */
|
|
108
|
-
'icon': string;
|
|
97
|
+
'type': 'app';
|
|
98
|
+
/** --- 控件对象配置文件 --- */
|
|
99
|
+
'config': IAppConfig;
|
|
109
100
|
/** --- 所有已加载的文件内容 --- */
|
|
110
101
|
'files': Record<string, Blob | string>;
|
|
102
|
+
/** --- 应用图标 --- */
|
|
103
|
+
'icon': string;
|
|
111
104
|
}
|
|
112
105
|
|
|
113
106
|
/** --- 应用文件包 config --- */
|
|
@@ -126,7 +119,7 @@ export interface IAppConfig {
|
|
|
126
119
|
/** --- 将自动加载的主题 --- */
|
|
127
120
|
'themes'?: string[];
|
|
128
121
|
/** --- 将自动申请的权限 --- */
|
|
129
|
-
'permissions'?:
|
|
122
|
+
'permissions'?: string[];
|
|
130
123
|
/** --- 将自动加载的语言包,path: lang --- */
|
|
131
124
|
'locales'?: Record<string, string>;
|
|
132
125
|
/** --- 全局样式,不带扩展名,系统会在末尾添加 .css --- */
|
|
@@ -134,7 +127,7 @@ export interface IAppConfig {
|
|
|
134
127
|
/** --- 图标路径,需包含扩展名 --- */
|
|
135
128
|
'icon'?: string;
|
|
136
129
|
|
|
137
|
-
/** --- 将要加载的非 js
|
|
130
|
+
/** --- 将要加载的非 js 文件列表,打包为 cga 模式下此配置可省略 --- */
|
|
138
131
|
'files'?: string[];
|
|
139
132
|
}
|
|
140
133
|
|
|
@@ -187,12 +180,20 @@ export interface IBindDownOptions {
|
|
|
187
180
|
'end'?: (e: MouseEvent | TouchEvent) => void;
|
|
188
181
|
}
|
|
189
182
|
|
|
190
|
-
/** ---
|
|
191
|
-
export interface
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
|
|
183
|
+
/** --- 绑定拖动选项 move 回调的回调参数 --- */
|
|
184
|
+
export interface IBindMoveMoveOptions {
|
|
185
|
+
'ox': number;
|
|
186
|
+
'oy': number;
|
|
187
|
+
'x': number;
|
|
188
|
+
'y': number;
|
|
189
|
+
'border': TDomBorder;
|
|
190
|
+
'inBorder': {
|
|
191
|
+
'top': boolean;
|
|
192
|
+
'right': boolean;
|
|
193
|
+
'bottom': boolean;
|
|
194
|
+
'left': boolean;
|
|
195
|
+
};
|
|
196
|
+
'dir': 'top' | 'right' | 'bottom' | 'left';
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
/** --- 绑定拖动选项 --- */
|
|
@@ -213,7 +214,7 @@ export interface IBindMoveOptions {
|
|
|
213
214
|
'object'?: HTMLElement | IVue;
|
|
214
215
|
'showRect'?: boolean;
|
|
215
216
|
'start'?: (x: number, y: number) => any;
|
|
216
|
-
'move'?: (
|
|
217
|
+
'move'?: (e: MouseEvent | TouchEvent, opt: IBindMoveMoveOptions) => void;
|
|
217
218
|
'up'?: (moveTimes: Array<{ 'time': number; 'ox': number; 'oy': number; }>, e: MouseEvent | TouchEvent) => void;
|
|
218
219
|
'end'?: (moveTimes: Array<{ 'time': number; 'ox': number; 'oy': number; }>, e: MouseEvent | TouchEvent) => void;
|
|
219
220
|
'borderIn'?: (x: number, y: number, border: TDomBorder, e: MouseEvent | TouchEvent) => void;
|
|
@@ -248,7 +249,7 @@ export interface IBindResizeOptions {
|
|
|
248
249
|
/** --- 监视大小中的元素 --- */
|
|
249
250
|
export interface IWatchSizeItem {
|
|
250
251
|
'el': HTMLElement;
|
|
251
|
-
'
|
|
252
|
+
'handler': () => void | Promise<void>;
|
|
252
253
|
'taskId'?: number;
|
|
253
254
|
}
|
|
254
255
|
|
|
@@ -300,6 +301,7 @@ export interface IFormCreateOptions {
|
|
|
300
301
|
/** --- 窗体的 code 参数 --- */
|
|
301
302
|
export interface IFormCreateCode {
|
|
302
303
|
'data'?: Record<string, any>;
|
|
304
|
+
'access'?: Record<string, any>;
|
|
303
305
|
'methods'?: Record<string, any>;
|
|
304
306
|
'computed'?: Record<string, {
|
|
305
307
|
'get'?: any;
|
|
@@ -319,21 +321,64 @@ export interface IFormCreateCode {
|
|
|
319
321
|
// --------- fs lib ---------
|
|
320
322
|
// --------------------------
|
|
321
323
|
|
|
324
|
+
export interface IMountHandler {
|
|
325
|
+
'taskId'?: number;
|
|
326
|
+
getContent?: (path: string, options?: BufferEncoding | {
|
|
327
|
+
'encoding'?: BufferEncoding;
|
|
328
|
+
'start'?: number;
|
|
329
|
+
'end'?: number;
|
|
330
|
+
'files'?: Record<string, Blob | string>;
|
|
331
|
+
'current'?: string;
|
|
332
|
+
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
333
|
+
}) => Promise<Blob | string | null>;
|
|
334
|
+
putContent?: (path: string, data: string | Blob, options?: {
|
|
335
|
+
'encoding'?: BufferEncoding | null;
|
|
336
|
+
'mode'?: string | number;
|
|
337
|
+
'flag'?: string | number;
|
|
338
|
+
'current'?: string;
|
|
339
|
+
}) => Promise<boolean>;
|
|
340
|
+
readLink?: (path: string, options?: BufferEncoding | {
|
|
341
|
+
'encoding'?: BufferEncoding;
|
|
342
|
+
/** --- 不以 / 结尾的路径 --- */
|
|
343
|
+
'current'?: string;
|
|
344
|
+
}) => Promise<string | null>;
|
|
345
|
+
symlink?: (filePath: string, linkPath: string, options?: {
|
|
346
|
+
'type'?: 'dir' | 'file' | 'junction';
|
|
347
|
+
'current'?: string;
|
|
348
|
+
}) => Promise<boolean>;
|
|
349
|
+
unlink?: (path: string, options?: {
|
|
350
|
+
'current'?: string;
|
|
351
|
+
}) => Promise<boolean>;
|
|
352
|
+
stats: (path: string, options?: {
|
|
353
|
+
'files'?: Record<string, Blob | string>;
|
|
354
|
+
'current'?: string;
|
|
355
|
+
}) => Promise<IStats | null>;
|
|
356
|
+
mkdir: (path: string, mode?: number, options?: {
|
|
357
|
+
'current'?: string;
|
|
358
|
+
}) => Promise<boolean>;
|
|
359
|
+
rmdir: (path: string, options?: {
|
|
360
|
+
'current'?: string;
|
|
361
|
+
}) => Promise<boolean>;
|
|
362
|
+
chmod: (path: string, mod: string | number, options?: {
|
|
363
|
+
'current'?: string;
|
|
364
|
+
}) => Promise<boolean>;
|
|
365
|
+
}
|
|
366
|
+
|
|
322
367
|
/** --- 文件/文件夹信息对象 --- */
|
|
323
368
|
export interface IStats {
|
|
324
369
|
isFile(): boolean;
|
|
325
370
|
isDirectory(): boolean;
|
|
326
371
|
isSymbolicLink(): boolean;
|
|
327
|
-
size: number;
|
|
328
|
-
blksize: number;
|
|
329
|
-
atimeMs: number;
|
|
330
|
-
mtimeMs: number;
|
|
331
|
-
ctimeMs: number;
|
|
332
|
-
birthtimeMs: number;
|
|
333
|
-
atime: Date;
|
|
334
|
-
mtime: Date;
|
|
335
|
-
ctime: Date;
|
|
336
|
-
birthtime: Date;
|
|
372
|
+
'size': number;
|
|
373
|
+
'blksize': number;
|
|
374
|
+
'atimeMs': number;
|
|
375
|
+
'mtimeMs': number;
|
|
376
|
+
'ctimeMs': number;
|
|
377
|
+
'birthtimeMs': number;
|
|
378
|
+
'atime': Date;
|
|
379
|
+
'mtime': Date;
|
|
380
|
+
'ctime': Date;
|
|
381
|
+
'birthtime': Date;
|
|
337
382
|
}
|
|
338
383
|
|
|
339
384
|
/** --- 目录下项目 --- */
|
|
@@ -341,7 +386,7 @@ export interface IDirent {
|
|
|
341
386
|
isFile(): boolean;
|
|
342
387
|
isDirectory(): boolean;
|
|
343
388
|
isSymbolicLink(): boolean;
|
|
344
|
-
name: string;
|
|
389
|
+
'name': string;
|
|
345
390
|
}
|
|
346
391
|
|
|
347
392
|
// --------------------------
|
|
@@ -353,7 +398,6 @@ export interface ITask {
|
|
|
353
398
|
'id': number;
|
|
354
399
|
'app': IApp;
|
|
355
400
|
'class': import('../dist/lib/core').AbstractApp;
|
|
356
|
-
'config': IAppConfig;
|
|
357
401
|
'customTheme': boolean;
|
|
358
402
|
'locale': {
|
|
359
403
|
'lang': string;
|
|
@@ -369,7 +413,7 @@ export interface ITask {
|
|
|
369
413
|
/** --- 独占窗体序列 --- */
|
|
370
414
|
'dialogFormIds': number[];
|
|
371
415
|
/** --- 已申请的权限列表 --- */
|
|
372
|
-
'permissions':
|
|
416
|
+
'permissions': string[];
|
|
373
417
|
};
|
|
374
418
|
/** --- 窗体对象列表 --- */
|
|
375
419
|
'forms': Record<string, IForm>;
|
|
@@ -385,8 +429,6 @@ export interface ITask {
|
|
|
385
429
|
}>;
|
|
386
430
|
/** --- 任务中的 timer 列表 --- */
|
|
387
431
|
'timers': Record<string, number>;
|
|
388
|
-
/** --- 用于初始化 control 时 invoke 用 --- */
|
|
389
|
-
'invoke'?: Record<string, any>;
|
|
390
432
|
}
|
|
391
433
|
|
|
392
434
|
/** --- 系统任务信息 --- */
|
|
@@ -404,8 +446,10 @@ export interface ITaskRunOptions {
|
|
|
404
446
|
'notify'?: boolean;
|
|
405
447
|
/** --- 所属任务,App 模式无法设置 --- */
|
|
406
448
|
'taskId'?: number;
|
|
407
|
-
/** --- 不禁止某些浏览器对象,App
|
|
449
|
+
/** --- 不禁止某些浏览器对象,App 模式下仅能设置基任务中已经 unblock 的值 --- */
|
|
408
450
|
'unblock'?: string[];
|
|
451
|
+
/** --- 直接赋予此任务相应权限,App 模式下有 "root" 权限的应用才能设置 --- */
|
|
452
|
+
'permissions'?: string[];
|
|
409
453
|
}
|
|
410
454
|
|
|
411
455
|
export interface ICreateTimerOptions {
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methods = exports.mounted = exports.computed = exports.data = void 0;
|
|
4
|
-
const clickgo = require("clickgo");
|
|
5
|
-
exports.data = {
|
|
6
|
-
'ntab': '',
|
|
7
|
-
'lineValue': 100,
|
|
8
|
-
'lineCount': 2,
|
|
9
|
-
'sLeft1': 0,
|
|
10
|
-
'sTop1': 0,
|
|
11
|
-
'l1': 0,
|
|
12
|
-
'c1': 0,
|
|
13
|
-
'sLeft2': 0,
|
|
14
|
-
'sTop2': 0,
|
|
15
|
-
'l2': 0,
|
|
16
|
-
'c2': 0,
|
|
17
|
-
'sLeft3': 0,
|
|
18
|
-
'sTop3': 0,
|
|
19
|
-
'l3': 0,
|
|
20
|
-
'c3': 0,
|
|
21
|
-
'sLeft4': 0,
|
|
22
|
-
'sTop4': 0,
|
|
23
|
-
'l4': 0,
|
|
24
|
-
'c4': 0,
|
|
25
|
-
'direction': false,
|
|
26
|
-
'dir5': 'v',
|
|
27
|
-
'sLeft5': 0,
|
|
28
|
-
'sTop5': 0,
|
|
29
|
-
'l5': 0,
|
|
30
|
-
'c5': 0,
|
|
31
|
-
'line5': 10,
|
|
32
|
-
'c6': 0,
|
|
33
|
-
'is6': [],
|
|
34
|
-
'gesture': false,
|
|
35
|
-
'style': false,
|
|
36
|
-
'selection': false,
|
|
37
|
-
'content': false,
|
|
38
|
-
'area': {}
|
|
39
|
-
};
|
|
40
|
-
exports.computed = {
|
|
41
|
-
'is': function () {
|
|
42
|
-
const is = [];
|
|
43
|
-
for (let i = 0; i < this.lineCount; ++i) {
|
|
44
|
-
if (i > 0 && i % 10 === 0) {
|
|
45
|
-
is[i] = 30;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return is;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const mounted = function () {
|
|
53
|
-
this.is6[29] = 50;
|
|
54
|
-
this.is6[39] = 50;
|
|
55
|
-
};
|
|
56
|
-
exports.mounted = mounted;
|
|
57
|
-
exports.methods = {
|
|
58
|
-
scrollborder: function (e, dir) {
|
|
59
|
-
if (!this.gesture) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
let dirs = [];
|
|
63
|
-
switch (dir) {
|
|
64
|
-
case 'h': {
|
|
65
|
-
dirs = ['left', 'right'];
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
default: {
|
|
69
|
-
dirs = ['top', 'bottom'];
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
clickgo.dom.bindGesture(e, {
|
|
74
|
-
'dirs': dirs,
|
|
75
|
-
'handler': (dir) => {
|
|
76
|
-
switch (dir) {
|
|
77
|
-
case 'left':
|
|
78
|
-
case 'top': {
|
|
79
|
-
this.lineCount -= 10;
|
|
80
|
-
if (this.lineCount < 0) {
|
|
81
|
-
this.lineCount = 0;
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
default: {
|
|
86
|
-
this.lineCount += this.lineValue;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methods = exports.data = void 0;
|
|
4
|
-
const clickgo = require("clickgo");
|
|
5
|
-
exports.data = {
|
|
6
|
-
'ntab': '',
|
|
7
|
-
'lineValue': 10,
|
|
8
|
-
'lineCount': 2,
|
|
9
|
-
'sLeft1': 0,
|
|
10
|
-
'sTop1': 0,
|
|
11
|
-
'l1': 0,
|
|
12
|
-
'c1': 0,
|
|
13
|
-
'sLeft2': 0,
|
|
14
|
-
'sTop2': 0,
|
|
15
|
-
'l2': 0,
|
|
16
|
-
'c2': 0,
|
|
17
|
-
'sLeft3': 0,
|
|
18
|
-
'sTop3': 0,
|
|
19
|
-
'l3': 0,
|
|
20
|
-
'c3': 0,
|
|
21
|
-
'sLeft4': 0,
|
|
22
|
-
'sTop4': 0,
|
|
23
|
-
'l4': 0,
|
|
24
|
-
'c4': 0,
|
|
25
|
-
'direction': false,
|
|
26
|
-
'dir5': 'v',
|
|
27
|
-
'sLeft5': 0,
|
|
28
|
-
'sTop5': 0,
|
|
29
|
-
'l5': 0,
|
|
30
|
-
'c5': 0,
|
|
31
|
-
'line5': 10,
|
|
32
|
-
'gesture': false,
|
|
33
|
-
'style': false
|
|
34
|
-
};
|
|
35
|
-
exports.methods = {
|
|
36
|
-
scrollborder: function (e, dir) {
|
|
37
|
-
if (!this.gesture) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
let dirs = [];
|
|
41
|
-
switch (dir) {
|
|
42
|
-
case 'h': {
|
|
43
|
-
dirs = ['left', 'right'];
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
default: {
|
|
47
|
-
dirs = ['top', 'bottom'];
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
clickgo.dom.bindGesture(e, {
|
|
52
|
-
'dirs': dirs,
|
|
53
|
-
'handler': (dir) => {
|
|
54
|
-
switch (dir) {
|
|
55
|
-
case 'left':
|
|
56
|
-
case 'top': {
|
|
57
|
-
this.lineCount -= 10;
|
|
58
|
-
if (this.lineCount < 0) {
|
|
59
|
-
this.lineCount = 0;
|
|
60
|
-
}
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
default: {
|
|
64
|
-
this.lineCount += this.lineValue;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
};
|