clickgo 3.1.13 → 3.1.15-dev
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/config.json +4 -1
- package/dist/app/demo/form/control/desc/desc.js +34 -0
- package/dist/app/demo/form/control/desc/desc.xml +26 -0
- package/dist/app/demo/form/main.js +5 -0
- package/dist/app/demo/form/main.xml +1 -0
- package/dist/control/box.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/lib/core.js +24 -3
- package/dist/lib/core.ts +26 -3
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/task.js +53 -37
- package/dist/lib/task.ts +57 -41
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +3 -2
- package/types/index.d.ts +4 -0
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.4.9/dist/loader.min.js?path=index&npm={'clickgo':'3.1.14'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"/clickgo/control/monaco",
|
|
12
12
|
"/clickgo/control/property",
|
|
13
13
|
"/clickgo/control/table",
|
|
14
|
-
"/clickgo/control/nav"
|
|
14
|
+
"/clickgo/control/nav",
|
|
15
|
+
"/clickgo/control/desc"
|
|
15
16
|
],
|
|
16
17
|
"style": "/package/global",
|
|
17
18
|
|
|
@@ -25,6 +26,8 @@
|
|
|
25
26
|
"/form/control/button/button.xml",
|
|
26
27
|
"/form/control/check/check.js",
|
|
27
28
|
"/form/control/check/check.xml",
|
|
29
|
+
"/form/control/desc/desc.js",
|
|
30
|
+
"/form/control/desc/desc.xml",
|
|
28
31
|
"/form/control/dialog/dialog.js",
|
|
29
32
|
"/form/control/dialog/dialog.xml",
|
|
30
33
|
"/form/control/file/file.js",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const clickgo = __importStar(require("clickgo"));
|
|
27
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.border = true;
|
|
31
|
+
this.collapse = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<form title="Desc" width="300" height="300" padding="10">
|
|
2
|
+
<layout gutter="10" direction="v" style="flex: 1;">
|
|
3
|
+
<desc :border="border" :collapse="collapse">
|
|
4
|
+
<desc-row>
|
|
5
|
+
<desc-head>HEAD1</desc-head>
|
|
6
|
+
<desc-head>HEAD2</desc-head>
|
|
7
|
+
<desc-head>HEAD3</desc-head>
|
|
8
|
+
<desc-head>HEAD4</desc-head>
|
|
9
|
+
</desc-row>
|
|
10
|
+
<desc-row>
|
|
11
|
+
<desc-head>HEAD5</desc-head>
|
|
12
|
+
<desc-cell>CELL1</desc-cell>
|
|
13
|
+
<desc-head>HEAD6</desc-head>
|
|
14
|
+
<desc-cell>CELL2</desc-cell>
|
|
15
|
+
</desc-row>
|
|
16
|
+
<desc-row>
|
|
17
|
+
<desc-head>HEAD7</desc-head>
|
|
18
|
+
<desc-cell colspan="3">CELL1</desc-cell>
|
|
19
|
+
</desc-row>
|
|
20
|
+
</desc>
|
|
21
|
+
<layout gutter="10">
|
|
22
|
+
<button @click="border = !border" style="flex: 1; padding: 10px 0;">border: {{border ? 'true' : 'false'}}</button>
|
|
23
|
+
<button @click="collapse = !collapse" style="flex: 1; padding: 10px 0;">collapse: {{collapse ? 'true' : 'false'}}</button>
|
|
24
|
+
</layout>
|
|
25
|
+
</layout>
|
|
26
|
+
</form>
|
|
@@ -47,6 +47,7 @@ const list_1 = __importDefault(require("./control/list/list"));
|
|
|
47
47
|
const marquee_1 = __importDefault(require("./control/marquee/marquee"));
|
|
48
48
|
const menu_1 = __importDefault(require("./control/menu/menu"));
|
|
49
49
|
const monaco_1 = __importDefault(require("./control/monaco/monaco"));
|
|
50
|
+
const desc_1 = __importDefault(require("./control/desc/desc"));
|
|
50
51
|
const nav_1 = __importDefault(require("./control/nav/nav"));
|
|
51
52
|
const panel_1 = __importDefault(require("./control/panel/panel"));
|
|
52
53
|
const flow_1 = __importDefault(require("./control/flow/flow"));
|
|
@@ -101,6 +102,10 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
101
102
|
frm = yield clickgo.form.create(check_1.default);
|
|
102
103
|
break;
|
|
103
104
|
}
|
|
105
|
+
case 'cdesc': {
|
|
106
|
+
frm = yield clickgo.form.create(desc_1.default);
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
104
109
|
case 'cdialog': {
|
|
105
110
|
frm = yield clickgo.form.create(dialog_1.default);
|
|
106
111
|
break;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
<button @click="openForm('cnav')">Nav</button>
|
|
30
30
|
<button @click="openForm('cbox')">Box</button>
|
|
31
31
|
<button @click="openForm('cmonaco')">Monaco</button>
|
|
32
|
+
<button @click="openForm('cdesc')">Desc</button>
|
|
32
33
|
</layout>
|
|
33
34
|
</flow>
|
|
34
35
|
<flow v-else-if="ntab === 'method'" class="inner" direction="v">
|
package/dist/control/box.cgc
CHANGED
|
Binary file
|
package/dist/control/common.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/form.cgc
CHANGED
|
Binary file
|
package/dist/control/monaco.cgc
CHANGED
|
Binary file
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/table.cgc
CHANGED
|
Binary file
|
package/dist/control/task.cgc
CHANGED
|
Binary file
|
package/dist/lib/core.js
CHANGED
|
@@ -449,9 +449,19 @@ function trigger(name, taskId = 0, formId = 0, param1 = '', param2 = '') {
|
|
|
449
449
|
exports.trigger = trigger;
|
|
450
450
|
function readApp(blob) {
|
|
451
451
|
return __awaiter(this, void 0, void 0, function* () {
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
452
|
+
const head = yield tool.blob2Text(blob.slice(0, 5));
|
|
453
|
+
if (head !== '-CGA-') {
|
|
454
|
+
return false;
|
|
455
|
+
}
|
|
456
|
+
const iconLength = parseInt(yield blob.slice(21, 28).text());
|
|
457
|
+
if (Number.isNaN(iconLength)) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
const icon = iconLength ? yield tool.blob2DataUrl(blob.slice(28, 28 + iconLength)) : '';
|
|
461
|
+
const nb = new Blob([blob.slice(5, 21), blob.slice(28 + iconLength)], {
|
|
462
|
+
'type': blob.type
|
|
463
|
+
});
|
|
464
|
+
const z = yield zip.get(nb);
|
|
455
465
|
if (!z) {
|
|
456
466
|
return false;
|
|
457
467
|
}
|
|
@@ -502,6 +512,17 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
502
512
|
return null;
|
|
503
513
|
}
|
|
504
514
|
}
|
|
515
|
+
if (!taskId &&
|
|
516
|
+
!url.startsWith('/clickgo/') &&
|
|
517
|
+
!url.startsWith('/storage/') &&
|
|
518
|
+
!url.startsWith('/mounted/') &&
|
|
519
|
+
!url.startsWith('/package/') &&
|
|
520
|
+
!url.startsWith('/current/') &&
|
|
521
|
+
!url.startsWith('http:') &&
|
|
522
|
+
!url.startsWith('https:') &&
|
|
523
|
+
!url.startsWith('file:')) {
|
|
524
|
+
url = tool.urlResolve(location.href, url);
|
|
525
|
+
}
|
|
505
526
|
if (cga) {
|
|
506
527
|
try {
|
|
507
528
|
const blob = yield fs.getContent(url, {
|
package/dist/lib/core.ts
CHANGED
|
@@ -533,9 +533,19 @@ export function trigger(name: types.TGlobalEvent, taskId: number | string | bool
|
|
|
533
533
|
* @param blob blob 对象
|
|
534
534
|
*/
|
|
535
535
|
export async function readApp(blob: Blob): Promise<false | types.IApp> {
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
536
|
+
const head = await tool.blob2Text(blob.slice(0, 5));
|
|
537
|
+
if (head !== '-CGA-') {
|
|
538
|
+
return false;
|
|
539
|
+
}
|
|
540
|
+
const iconLength = parseInt(await blob.slice(21, 28).text());
|
|
541
|
+
if (Number.isNaN(iconLength)) {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
const icon = iconLength ? await tool.blob2DataUrl(blob.slice(28, 28 + iconLength)) : '';
|
|
545
|
+
const nb = new Blob([blob.slice(5, 21), blob.slice(28 + iconLength)], {
|
|
546
|
+
'type': blob.type
|
|
547
|
+
});
|
|
548
|
+
const z = await zip.get(nb);
|
|
539
549
|
if (!z) {
|
|
540
550
|
return false;
|
|
541
551
|
}
|
|
@@ -598,6 +608,19 @@ export async function fetchApp(
|
|
|
598
608
|
return null;
|
|
599
609
|
}
|
|
600
610
|
}
|
|
611
|
+
// --- 非 taskId 模式下 current 以 location 为准 ---
|
|
612
|
+
if (!taskId &&
|
|
613
|
+
!url.startsWith('/clickgo/') &&
|
|
614
|
+
!url.startsWith('/storage/') &&
|
|
615
|
+
!url.startsWith('/mounted/') &&
|
|
616
|
+
!url.startsWith('/package/') &&
|
|
617
|
+
!url.startsWith('/current/') &&
|
|
618
|
+
!url.startsWith('http:') &&
|
|
619
|
+
!url.startsWith('https:') &&
|
|
620
|
+
!url.startsWith('file:')
|
|
621
|
+
) {
|
|
622
|
+
url = tool.urlResolve(location.href, url);
|
|
623
|
+
}
|
|
601
624
|
// --- 如果是 cga 文件,直接读取并交给 readApp 函数处理 ---
|
|
602
625
|
if (cga) {
|
|
603
626
|
try {
|
package/dist/lib/fs.js
CHANGED
|
@@ -38,7 +38,7 @@ const task = __importStar(require("./task"));
|
|
|
38
38
|
const form = __importStar(require("./form"));
|
|
39
39
|
const core = __importStar(require("./core"));
|
|
40
40
|
const native = __importStar(require("./native"));
|
|
41
|
-
const clickgoFiles = ['/app/', '/app/demo/', '/app/demo/app.js', '/app/demo/config.json', '/app/demo/form/', '/app/demo/form/control/', '/app/demo/form/control/block/', '/app/demo/form/control/block/block.css', '/app/demo/form/control/block/block.xml', '/app/demo/form/control/box/', '/app/demo/form/control/box/box.js', '/app/demo/form/control/box/box.xml', '/app/demo/form/control/button/', '/app/demo/form/control/button/button.css', '/app/demo/form/control/button/button.js', '/app/demo/form/control/button/button.xml', '/app/demo/form/control/check/', '/app/demo/form/control/check/check.js', '/app/demo/form/control/check/check.xml', '/app/demo/form/control/dialog/', '/app/demo/form/control/dialog/dialog.js', '/app/demo/form/control/dialog/dialog.xml', '/app/demo/form/control/file/', '/app/demo/form/control/file/file.js', '/app/demo/form/control/file/file.xml', '/app/demo/form/control/flow/', '/app/demo/form/control/flow/flow.css', '/app/demo/form/control/flow/flow.js', '/app/demo/form/control/flow/flow.xml', '/app/demo/form/control/form/', '/app/demo/form/control/form/form.css', '/app/demo/form/control/form/form.js', '/app/demo/form/control/form/form.xml', '/app/demo/form/control/img/', '/app/demo/form/control/img/img.xml', '/app/demo/form/control/label/', '/app/demo/form/control/label/label.xml', '/app/demo/form/control/layout/', '/app/demo/form/control/layout/layout.js', '/app/demo/form/control/layout/layout.xml', '/app/demo/form/control/list/', '/app/demo/form/control/list/list.css', '/app/demo/form/control/list/list.js', '/app/demo/form/control/list/list.xml', '/app/demo/form/control/loading/', '/app/demo/form/control/loading/loading.xml', '/app/demo/form/control/marquee/', '/app/demo/form/control/marquee/marquee.js', '/app/demo/form/control/marquee/marquee.xml', '/app/demo/form/control/menu/', '/app/demo/form/control/menu/menu.js', '/app/demo/form/control/menu/menu.xml', '/app/demo/form/control/monaco/', '/app/demo/form/control/monaco/monaco.js', '/app/demo/form/control/monaco/monaco.xml', '/app/demo/form/control/nav/', '/app/demo/form/control/nav/nav.js', '/app/demo/form/control/nav/nav.xml', '/app/demo/form/control/panel/', '/app/demo/form/control/panel/panel.js', '/app/demo/form/control/panel/panel.xml', '/app/demo/form/control/panel/test1.js', '/app/demo/form/control/panel/test1.xml', '/app/demo/form/control/panel/test2.xml', '/app/demo/form/control/property/', '/app/demo/form/control/property/property.js', '/app/demo/form/control/property/property.xml', '/app/demo/form/control/radio/', '/app/demo/form/control/radio/radio.js', '/app/demo/form/control/radio/radio.xml', '/app/demo/form/control/scroll/', '/app/demo/form/control/scroll/scroll.js', '/app/demo/form/control/scroll/scroll.xml', '/app/demo/form/control/select/', '/app/demo/form/control/select/select.js', '/app/demo/form/control/select/select.xml', '/app/demo/form/control/tab/', '/app/demo/form/control/tab/tab.js', '/app/demo/form/control/tab/tab.xml', '/app/demo/form/control/table/', '/app/demo/form/control/table/table.js', '/app/demo/form/control/table/table.xml', '/app/demo/form/control/text/', '/app/demo/form/control/text/text.js', '/app/demo/form/control/text/text.xml', '/app/demo/form/control/vflow/', '/app/demo/form/control/vflow/vflow.css', '/app/demo/form/control/vflow/vflow.js', '/app/demo/form/control/vflow/vflow.xml', '/app/demo/form/event/', '/app/demo/form/event/form/', '/app/demo/form/event/form/form.css', '/app/demo/form/event/form/form.js', '/app/demo/form/event/form/form.xml', '/app/demo/form/event/other/', '/app/demo/form/event/other/other.js', '/app/demo/form/event/other/other.xml', '/app/demo/form/event/screen/', '/app/demo/form/event/screen/screen.js', '/app/demo/form/event/screen/screen.xml', '/app/demo/form/event/task/', '/app/demo/form/event/task/task.js', '/app/demo/form/event/task/task.xml', '/app/demo/form/main.css', '/app/demo/form/main.js', '/app/demo/form/main.xml', '/app/demo/form/method/', '/app/demo/form/method/aform/', '/app/demo/form/method/aform/aform.js', '/app/demo/form/method/aform/aform.xml', '/app/demo/form/method/aform/sd.js', '/app/demo/form/method/aform/sd.xml', '/app/demo/form/method/core/', '/app/demo/form/method/core/core.js', '/app/demo/form/method/core/core.xml', '/app/demo/form/method/dom/', '/app/demo/form/method/dom/dom.css', '/app/demo/form/method/dom/dom.js', '/app/demo/form/method/dom/dom.xml', '/app/demo/form/method/form/', '/app/demo/form/method/form/form.css', '/app/demo/form/method/form/form.js', '/app/demo/form/method/form/form.xml', '/app/demo/form/method/form/test.xml', '/app/demo/form/method/fs/', '/app/demo/form/method/fs/fs.js', '/app/demo/form/method/fs/fs.xml', '/app/demo/form/method/fs/text.js', '/app/demo/form/method/fs/text.xml', '/app/demo/form/method/native/', '/app/demo/form/method/native/native.js', '/app/demo/form/method/native/native.xml', '/app/demo/form/method/system/', '/app/demo/form/method/system/system.js', '/app/demo/form/method/system/system.xml', '/app/demo/form/method/task/', '/app/demo/form/method/task/locale1.json', '/app/demo/form/method/task/locale2.json', '/app/demo/form/method/task/task.js', '/app/demo/form/method/task/task.xml', '/app/demo/form/method/theme/', '/app/demo/form/method/theme/theme.js', '/app/demo/form/method/theme/theme.xml', '/app/demo/form/method/tool/', '/app/demo/form/method/tool/tool.js', '/app/demo/form/method/tool/tool.xml', '/app/demo/form/method/zip/', '/app/demo/form/method/zip/zip.js', '/app/demo/form/method/zip/zip.xml', '/app/demo/global.css', '/app/demo/res/', '/app/demo/res/icon.svg', '/app/demo/res/img.jpg', '/app/demo/res/r-1.svg', '/app/demo/res/r-2.svg', '/app/demo/res/sql.svg', '/app/demo/res/txt.svg', '/app/demo/res/zip.svg', '/app/task/', '/app/task/app.js', '/app/task/config.json', '/app/task/form/', '/app/task/form/bar/', '/app/task/form/bar/bar.js', '/app/task/form/bar/bar.xml', '/app/task/form/desktop/', '/app/task/form/desktop/desktop.xml', '/app/task/locale/', '/app/task/locale/en.json', '/app/task/locale/ja.json', '/app/task/locale/sc.json', '/app/task/locale/tc.json', '/clickgo.js', '/clickgo.ts', '/control/', '/control/box.cgc', '/control/common.cgc', '/control/form.cgc', '/control/monaco.cgc', '/control/nav.cgc', '/control/property.cgc', '/control/table.cgc', '/control/task.cgc', '/global.css', '/icon.png', '/index.js', '/index.ts', '/lib/', '/lib/control.js', '/lib/control.ts', '/lib/core.js', '/lib/core.ts', '/lib/dom.js', '/lib/dom.ts', '/lib/form.js', '/lib/form.ts', '/lib/fs.js', '/lib/fs.ts', '/lib/native.js', '/lib/native.ts', '/lib/task.js', '/lib/task.ts', '/lib/theme.js', '/lib/theme.ts', '/lib/tool.js', '/lib/tool.ts', '/lib/zip.js', '/lib/zip.ts', '/theme/', '/theme/familiar.cgt'];
|
|
41
|
+
const clickgoFiles = ['/app/', '/app/demo/', '/app/demo/app.js', '/app/demo/config.json', '/app/demo/form/', '/app/demo/form/control/', '/app/demo/form/control/block/', '/app/demo/form/control/block/block.css', '/app/demo/form/control/block/block.xml', '/app/demo/form/control/box/', '/app/demo/form/control/box/box.js', '/app/demo/form/control/box/box.xml', '/app/demo/form/control/button/', '/app/demo/form/control/button/button.css', '/app/demo/form/control/button/button.js', '/app/demo/form/control/button/button.xml', '/app/demo/form/control/check/', '/app/demo/form/control/check/check.js', '/app/demo/form/control/check/check.xml', '/app/demo/form/control/desc/', '/app/demo/form/control/desc/desc.js', '/app/demo/form/control/desc/desc.xml', '/app/demo/form/control/dialog/', '/app/demo/form/control/dialog/dialog.js', '/app/demo/form/control/dialog/dialog.xml', '/app/demo/form/control/file/', '/app/demo/form/control/file/file.js', '/app/demo/form/control/file/file.xml', '/app/demo/form/control/flow/', '/app/demo/form/control/flow/flow.css', '/app/demo/form/control/flow/flow.js', '/app/demo/form/control/flow/flow.xml', '/app/demo/form/control/form/', '/app/demo/form/control/form/form.css', '/app/demo/form/control/form/form.js', '/app/demo/form/control/form/form.xml', '/app/demo/form/control/img/', '/app/demo/form/control/img/img.xml', '/app/demo/form/control/label/', '/app/demo/form/control/label/label.xml', '/app/demo/form/control/layout/', '/app/demo/form/control/layout/layout.js', '/app/demo/form/control/layout/layout.xml', '/app/demo/form/control/list/', '/app/demo/form/control/list/list.css', '/app/demo/form/control/list/list.js', '/app/demo/form/control/list/list.xml', '/app/demo/form/control/loading/', '/app/demo/form/control/loading/loading.xml', '/app/demo/form/control/marquee/', '/app/demo/form/control/marquee/marquee.js', '/app/demo/form/control/marquee/marquee.xml', '/app/demo/form/control/menu/', '/app/demo/form/control/menu/menu.js', '/app/demo/form/control/menu/menu.xml', '/app/demo/form/control/monaco/', '/app/demo/form/control/monaco/monaco.js', '/app/demo/form/control/monaco/monaco.xml', '/app/demo/form/control/nav/', '/app/demo/form/control/nav/nav.js', '/app/demo/form/control/nav/nav.xml', '/app/demo/form/control/panel/', '/app/demo/form/control/panel/panel.js', '/app/demo/form/control/panel/panel.xml', '/app/demo/form/control/panel/test1.js', '/app/demo/form/control/panel/test1.xml', '/app/demo/form/control/panel/test2.xml', '/app/demo/form/control/property/', '/app/demo/form/control/property/property.js', '/app/demo/form/control/property/property.xml', '/app/demo/form/control/radio/', '/app/demo/form/control/radio/radio.js', '/app/demo/form/control/radio/radio.xml', '/app/demo/form/control/scroll/', '/app/demo/form/control/scroll/scroll.js', '/app/demo/form/control/scroll/scroll.xml', '/app/demo/form/control/select/', '/app/demo/form/control/select/select.js', '/app/demo/form/control/select/select.xml', '/app/demo/form/control/tab/', '/app/demo/form/control/tab/tab.js', '/app/demo/form/control/tab/tab.xml', '/app/demo/form/control/table/', '/app/demo/form/control/table/table.js', '/app/demo/form/control/table/table.xml', '/app/demo/form/control/text/', '/app/demo/form/control/text/text.js', '/app/demo/form/control/text/text.xml', '/app/demo/form/control/vflow/', '/app/demo/form/control/vflow/vflow.css', '/app/demo/form/control/vflow/vflow.js', '/app/demo/form/control/vflow/vflow.xml', '/app/demo/form/event/', '/app/demo/form/event/form/', '/app/demo/form/event/form/form.css', '/app/demo/form/event/form/form.js', '/app/demo/form/event/form/form.xml', '/app/demo/form/event/other/', '/app/demo/form/event/other/other.js', '/app/demo/form/event/other/other.xml', '/app/demo/form/event/screen/', '/app/demo/form/event/screen/screen.js', '/app/demo/form/event/screen/screen.xml', '/app/demo/form/event/task/', '/app/demo/form/event/task/task.js', '/app/demo/form/event/task/task.xml', '/app/demo/form/main.css', '/app/demo/form/main.js', '/app/demo/form/main.xml', '/app/demo/form/method/', '/app/demo/form/method/aform/', '/app/demo/form/method/aform/aform.js', '/app/demo/form/method/aform/aform.xml', '/app/demo/form/method/aform/sd.js', '/app/demo/form/method/aform/sd.xml', '/app/demo/form/method/core/', '/app/demo/form/method/core/core.js', '/app/demo/form/method/core/core.xml', '/app/demo/form/method/dom/', '/app/demo/form/method/dom/dom.css', '/app/demo/form/method/dom/dom.js', '/app/demo/form/method/dom/dom.xml', '/app/demo/form/method/form/', '/app/demo/form/method/form/form.css', '/app/demo/form/method/form/form.js', '/app/demo/form/method/form/form.xml', '/app/demo/form/method/form/test.xml', '/app/demo/form/method/fs/', '/app/demo/form/method/fs/fs.js', '/app/demo/form/method/fs/fs.xml', '/app/demo/form/method/fs/text.js', '/app/demo/form/method/fs/text.xml', '/app/demo/form/method/native/', '/app/demo/form/method/native/native.js', '/app/demo/form/method/native/native.xml', '/app/demo/form/method/system/', '/app/demo/form/method/system/system.js', '/app/demo/form/method/system/system.xml', '/app/demo/form/method/task/', '/app/demo/form/method/task/locale1.json', '/app/demo/form/method/task/locale2.json', '/app/demo/form/method/task/task.js', '/app/demo/form/method/task/task.xml', '/app/demo/form/method/theme/', '/app/demo/form/method/theme/theme.js', '/app/demo/form/method/theme/theme.xml', '/app/demo/form/method/tool/', '/app/demo/form/method/tool/tool.js', '/app/demo/form/method/tool/tool.xml', '/app/demo/form/method/zip/', '/app/demo/form/method/zip/zip.js', '/app/demo/form/method/zip/zip.xml', '/app/demo/global.css', '/app/demo/res/', '/app/demo/res/icon.svg', '/app/demo/res/img.jpg', '/app/demo/res/r-1.svg', '/app/demo/res/r-2.svg', '/app/demo/res/sql.svg', '/app/demo/res/txt.svg', '/app/demo/res/zip.svg', '/app/task/', '/app/task/app.js', '/app/task/config.json', '/app/task/form/', '/app/task/form/bar/', '/app/task/form/bar/bar.js', '/app/task/form/bar/bar.xml', '/app/task/form/desktop/', '/app/task/form/desktop/desktop.xml', '/app/task/locale/', '/app/task/locale/en.json', '/app/task/locale/ja.json', '/app/task/locale/sc.json', '/app/task/locale/tc.json', '/clickgo.js', '/clickgo.ts', '/compcga.js', '/compcga.ts', '/control/', '/control/box.cgc', '/control/common.cgc', '/control/desc.cgc', '/control/form.cgc', '/control/monaco.cgc', '/control/nav.cgc', '/control/property.cgc', '/control/table.cgc', '/control/task.cgc', '/global.css', '/icon.png', '/index.js', '/index.ts', '/lib/', '/lib/control.js', '/lib/control.ts', '/lib/core.js', '/lib/core.ts', '/lib/dom.js', '/lib/dom.ts', '/lib/form.js', '/lib/form.ts', '/lib/fs.js', '/lib/fs.ts', '/lib/native.js', '/lib/native.ts', '/lib/task.js', '/lib/task.ts', '/lib/theme.js', '/lib/theme.ts', '/lib/tool.js', '/lib/tool.ts', '/lib/zip.js', '/lib/zip.ts', '/theme/', '/theme/familiar.cgt'];
|
|
42
42
|
const localeData = {
|
|
43
43
|
'en': {
|
|
44
44
|
'apply-unmount': 'Are you sure to unmount the "?" mount point?',
|
package/dist/lib/fs.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as form from './form';
|
|
|
12
12
|
import * as core from './core';
|
|
13
13
|
import * as native from './native';
|
|
14
14
|
|
|
15
|
-
const clickgoFiles = ['/app/', '/app/demo/', '/app/demo/app.js', '/app/demo/config.json', '/app/demo/form/', '/app/demo/form/control/', '/app/demo/form/control/block/', '/app/demo/form/control/block/block.css', '/app/demo/form/control/block/block.xml', '/app/demo/form/control/box/', '/app/demo/form/control/box/box.js', '/app/demo/form/control/box/box.xml', '/app/demo/form/control/button/', '/app/demo/form/control/button/button.css', '/app/demo/form/control/button/button.js', '/app/demo/form/control/button/button.xml', '/app/demo/form/control/check/', '/app/demo/form/control/check/check.js', '/app/demo/form/control/check/check.xml', '/app/demo/form/control/dialog/', '/app/demo/form/control/dialog/dialog.js', '/app/demo/form/control/dialog/dialog.xml', '/app/demo/form/control/file/', '/app/demo/form/control/file/file.js', '/app/demo/form/control/file/file.xml', '/app/demo/form/control/flow/', '/app/demo/form/control/flow/flow.css', '/app/demo/form/control/flow/flow.js', '/app/demo/form/control/flow/flow.xml', '/app/demo/form/control/form/', '/app/demo/form/control/form/form.css', '/app/demo/form/control/form/form.js', '/app/demo/form/control/form/form.xml', '/app/demo/form/control/img/', '/app/demo/form/control/img/img.xml', '/app/demo/form/control/label/', '/app/demo/form/control/label/label.xml', '/app/demo/form/control/layout/', '/app/demo/form/control/layout/layout.js', '/app/demo/form/control/layout/layout.xml', '/app/demo/form/control/list/', '/app/demo/form/control/list/list.css', '/app/demo/form/control/list/list.js', '/app/demo/form/control/list/list.xml', '/app/demo/form/control/loading/', '/app/demo/form/control/loading/loading.xml', '/app/demo/form/control/marquee/', '/app/demo/form/control/marquee/marquee.js', '/app/demo/form/control/marquee/marquee.xml', '/app/demo/form/control/menu/', '/app/demo/form/control/menu/menu.js', '/app/demo/form/control/menu/menu.xml', '/app/demo/form/control/monaco/', '/app/demo/form/control/monaco/monaco.js', '/app/demo/form/control/monaco/monaco.xml', '/app/demo/form/control/nav/', '/app/demo/form/control/nav/nav.js', '/app/demo/form/control/nav/nav.xml', '/app/demo/form/control/panel/', '/app/demo/form/control/panel/panel.js', '/app/demo/form/control/panel/panel.xml', '/app/demo/form/control/panel/test1.js', '/app/demo/form/control/panel/test1.xml', '/app/demo/form/control/panel/test2.xml', '/app/demo/form/control/property/', '/app/demo/form/control/property/property.js', '/app/demo/form/control/property/property.xml', '/app/demo/form/control/radio/', '/app/demo/form/control/radio/radio.js', '/app/demo/form/control/radio/radio.xml', '/app/demo/form/control/scroll/', '/app/demo/form/control/scroll/scroll.js', '/app/demo/form/control/scroll/scroll.xml', '/app/demo/form/control/select/', '/app/demo/form/control/select/select.js', '/app/demo/form/control/select/select.xml', '/app/demo/form/control/tab/', '/app/demo/form/control/tab/tab.js', '/app/demo/form/control/tab/tab.xml', '/app/demo/form/control/table/', '/app/demo/form/control/table/table.js', '/app/demo/form/control/table/table.xml', '/app/demo/form/control/text/', '/app/demo/form/control/text/text.js', '/app/demo/form/control/text/text.xml', '/app/demo/form/control/vflow/', '/app/demo/form/control/vflow/vflow.css', '/app/demo/form/control/vflow/vflow.js', '/app/demo/form/control/vflow/vflow.xml', '/app/demo/form/event/', '/app/demo/form/event/form/', '/app/demo/form/event/form/form.css', '/app/demo/form/event/form/form.js', '/app/demo/form/event/form/form.xml', '/app/demo/form/event/other/', '/app/demo/form/event/other/other.js', '/app/demo/form/event/other/other.xml', '/app/demo/form/event/screen/', '/app/demo/form/event/screen/screen.js', '/app/demo/form/event/screen/screen.xml', '/app/demo/form/event/task/', '/app/demo/form/event/task/task.js', '/app/demo/form/event/task/task.xml', '/app/demo/form/main.css', '/app/demo/form/main.js', '/app/demo/form/main.xml', '/app/demo/form/method/', '/app/demo/form/method/aform/', '/app/demo/form/method/aform/aform.js', '/app/demo/form/method/aform/aform.xml', '/app/demo/form/method/aform/sd.js', '/app/demo/form/method/aform/sd.xml', '/app/demo/form/method/core/', '/app/demo/form/method/core/core.js', '/app/demo/form/method/core/core.xml', '/app/demo/form/method/dom/', '/app/demo/form/method/dom/dom.css', '/app/demo/form/method/dom/dom.js', '/app/demo/form/method/dom/dom.xml', '/app/demo/form/method/form/', '/app/demo/form/method/form/form.css', '/app/demo/form/method/form/form.js', '/app/demo/form/method/form/form.xml', '/app/demo/form/method/form/test.xml', '/app/demo/form/method/fs/', '/app/demo/form/method/fs/fs.js', '/app/demo/form/method/fs/fs.xml', '/app/demo/form/method/fs/text.js', '/app/demo/form/method/fs/text.xml', '/app/demo/form/method/native/', '/app/demo/form/method/native/native.js', '/app/demo/form/method/native/native.xml', '/app/demo/form/method/system/', '/app/demo/form/method/system/system.js', '/app/demo/form/method/system/system.xml', '/app/demo/form/method/task/', '/app/demo/form/method/task/locale1.json', '/app/demo/form/method/task/locale2.json', '/app/demo/form/method/task/task.js', '/app/demo/form/method/task/task.xml', '/app/demo/form/method/theme/', '/app/demo/form/method/theme/theme.js', '/app/demo/form/method/theme/theme.xml', '/app/demo/form/method/tool/', '/app/demo/form/method/tool/tool.js', '/app/demo/form/method/tool/tool.xml', '/app/demo/form/method/zip/', '/app/demo/form/method/zip/zip.js', '/app/demo/form/method/zip/zip.xml', '/app/demo/global.css', '/app/demo/res/', '/app/demo/res/icon.svg', '/app/demo/res/img.jpg', '/app/demo/res/r-1.svg', '/app/demo/res/r-2.svg', '/app/demo/res/sql.svg', '/app/demo/res/txt.svg', '/app/demo/res/zip.svg', '/app/task/', '/app/task/app.js', '/app/task/config.json', '/app/task/form/', '/app/task/form/bar/', '/app/task/form/bar/bar.js', '/app/task/form/bar/bar.xml', '/app/task/form/desktop/', '/app/task/form/desktop/desktop.xml', '/app/task/locale/', '/app/task/locale/en.json', '/app/task/locale/ja.json', '/app/task/locale/sc.json', '/app/task/locale/tc.json', '/clickgo.js', '/clickgo.ts', '/control/', '/control/box.cgc', '/control/common.cgc', '/control/form.cgc', '/control/monaco.cgc', '/control/nav.cgc', '/control/property.cgc', '/control/table.cgc', '/control/task.cgc', '/global.css', '/icon.png', '/index.js', '/index.ts', '/lib/', '/lib/control.js', '/lib/control.ts', '/lib/core.js', '/lib/core.ts', '/lib/dom.js', '/lib/dom.ts', '/lib/form.js', '/lib/form.ts', '/lib/fs.js', '/lib/fs.ts', '/lib/native.js', '/lib/native.ts', '/lib/task.js', '/lib/task.ts', '/lib/theme.js', '/lib/theme.ts', '/lib/tool.js', '/lib/tool.ts', '/lib/zip.js', '/lib/zip.ts', '/theme/', '/theme/familiar.cgt'];
|
|
15
|
+
const clickgoFiles = ['/app/', '/app/demo/', '/app/demo/app.js', '/app/demo/config.json', '/app/demo/form/', '/app/demo/form/control/', '/app/demo/form/control/block/', '/app/demo/form/control/block/block.css', '/app/demo/form/control/block/block.xml', '/app/demo/form/control/box/', '/app/demo/form/control/box/box.js', '/app/demo/form/control/box/box.xml', '/app/demo/form/control/button/', '/app/demo/form/control/button/button.css', '/app/demo/form/control/button/button.js', '/app/demo/form/control/button/button.xml', '/app/demo/form/control/check/', '/app/demo/form/control/check/check.js', '/app/demo/form/control/check/check.xml', '/app/demo/form/control/desc/', '/app/demo/form/control/desc/desc.js', '/app/demo/form/control/desc/desc.xml', '/app/demo/form/control/dialog/', '/app/demo/form/control/dialog/dialog.js', '/app/demo/form/control/dialog/dialog.xml', '/app/demo/form/control/file/', '/app/demo/form/control/file/file.js', '/app/demo/form/control/file/file.xml', '/app/demo/form/control/flow/', '/app/demo/form/control/flow/flow.css', '/app/demo/form/control/flow/flow.js', '/app/demo/form/control/flow/flow.xml', '/app/demo/form/control/form/', '/app/demo/form/control/form/form.css', '/app/demo/form/control/form/form.js', '/app/demo/form/control/form/form.xml', '/app/demo/form/control/img/', '/app/demo/form/control/img/img.xml', '/app/demo/form/control/label/', '/app/demo/form/control/label/label.xml', '/app/demo/form/control/layout/', '/app/demo/form/control/layout/layout.js', '/app/demo/form/control/layout/layout.xml', '/app/demo/form/control/list/', '/app/demo/form/control/list/list.css', '/app/demo/form/control/list/list.js', '/app/demo/form/control/list/list.xml', '/app/demo/form/control/loading/', '/app/demo/form/control/loading/loading.xml', '/app/demo/form/control/marquee/', '/app/demo/form/control/marquee/marquee.js', '/app/demo/form/control/marquee/marquee.xml', '/app/demo/form/control/menu/', '/app/demo/form/control/menu/menu.js', '/app/demo/form/control/menu/menu.xml', '/app/demo/form/control/monaco/', '/app/demo/form/control/monaco/monaco.js', '/app/demo/form/control/monaco/monaco.xml', '/app/demo/form/control/nav/', '/app/demo/form/control/nav/nav.js', '/app/demo/form/control/nav/nav.xml', '/app/demo/form/control/panel/', '/app/demo/form/control/panel/panel.js', '/app/demo/form/control/panel/panel.xml', '/app/demo/form/control/panel/test1.js', '/app/demo/form/control/panel/test1.xml', '/app/demo/form/control/panel/test2.xml', '/app/demo/form/control/property/', '/app/demo/form/control/property/property.js', '/app/demo/form/control/property/property.xml', '/app/demo/form/control/radio/', '/app/demo/form/control/radio/radio.js', '/app/demo/form/control/radio/radio.xml', '/app/demo/form/control/scroll/', '/app/demo/form/control/scroll/scroll.js', '/app/demo/form/control/scroll/scroll.xml', '/app/demo/form/control/select/', '/app/demo/form/control/select/select.js', '/app/demo/form/control/select/select.xml', '/app/demo/form/control/tab/', '/app/demo/form/control/tab/tab.js', '/app/demo/form/control/tab/tab.xml', '/app/demo/form/control/table/', '/app/demo/form/control/table/table.js', '/app/demo/form/control/table/table.xml', '/app/demo/form/control/text/', '/app/demo/form/control/text/text.js', '/app/demo/form/control/text/text.xml', '/app/demo/form/control/vflow/', '/app/demo/form/control/vflow/vflow.css', '/app/demo/form/control/vflow/vflow.js', '/app/demo/form/control/vflow/vflow.xml', '/app/demo/form/event/', '/app/demo/form/event/form/', '/app/demo/form/event/form/form.css', '/app/demo/form/event/form/form.js', '/app/demo/form/event/form/form.xml', '/app/demo/form/event/other/', '/app/demo/form/event/other/other.js', '/app/demo/form/event/other/other.xml', '/app/demo/form/event/screen/', '/app/demo/form/event/screen/screen.js', '/app/demo/form/event/screen/screen.xml', '/app/demo/form/event/task/', '/app/demo/form/event/task/task.js', '/app/demo/form/event/task/task.xml', '/app/demo/form/main.css', '/app/demo/form/main.js', '/app/demo/form/main.xml', '/app/demo/form/method/', '/app/demo/form/method/aform/', '/app/demo/form/method/aform/aform.js', '/app/demo/form/method/aform/aform.xml', '/app/demo/form/method/aform/sd.js', '/app/demo/form/method/aform/sd.xml', '/app/demo/form/method/core/', '/app/demo/form/method/core/core.js', '/app/demo/form/method/core/core.xml', '/app/demo/form/method/dom/', '/app/demo/form/method/dom/dom.css', '/app/demo/form/method/dom/dom.js', '/app/demo/form/method/dom/dom.xml', '/app/demo/form/method/form/', '/app/demo/form/method/form/form.css', '/app/demo/form/method/form/form.js', '/app/demo/form/method/form/form.xml', '/app/demo/form/method/form/test.xml', '/app/demo/form/method/fs/', '/app/demo/form/method/fs/fs.js', '/app/demo/form/method/fs/fs.xml', '/app/demo/form/method/fs/text.js', '/app/demo/form/method/fs/text.xml', '/app/demo/form/method/native/', '/app/demo/form/method/native/native.js', '/app/demo/form/method/native/native.xml', '/app/demo/form/method/system/', '/app/demo/form/method/system/system.js', '/app/demo/form/method/system/system.xml', '/app/demo/form/method/task/', '/app/demo/form/method/task/locale1.json', '/app/demo/form/method/task/locale2.json', '/app/demo/form/method/task/task.js', '/app/demo/form/method/task/task.xml', '/app/demo/form/method/theme/', '/app/demo/form/method/theme/theme.js', '/app/demo/form/method/theme/theme.xml', '/app/demo/form/method/tool/', '/app/demo/form/method/tool/tool.js', '/app/demo/form/method/tool/tool.xml', '/app/demo/form/method/zip/', '/app/demo/form/method/zip/zip.js', '/app/demo/form/method/zip/zip.xml', '/app/demo/global.css', '/app/demo/res/', '/app/demo/res/icon.svg', '/app/demo/res/img.jpg', '/app/demo/res/r-1.svg', '/app/demo/res/r-2.svg', '/app/demo/res/sql.svg', '/app/demo/res/txt.svg', '/app/demo/res/zip.svg', '/app/task/', '/app/task/app.js', '/app/task/config.json', '/app/task/form/', '/app/task/form/bar/', '/app/task/form/bar/bar.js', '/app/task/form/bar/bar.xml', '/app/task/form/desktop/', '/app/task/form/desktop/desktop.xml', '/app/task/locale/', '/app/task/locale/en.json', '/app/task/locale/ja.json', '/app/task/locale/sc.json', '/app/task/locale/tc.json', '/clickgo.js', '/clickgo.ts', '/compcga.js', '/compcga.ts', '/control/', '/control/box.cgc', '/control/common.cgc', '/control/desc.cgc', '/control/form.cgc', '/control/monaco.cgc', '/control/nav.cgc', '/control/property.cgc', '/control/table.cgc', '/control/task.cgc', '/global.css', '/icon.png', '/index.js', '/index.ts', '/lib/', '/lib/control.js', '/lib/control.ts', '/lib/core.js', '/lib/core.ts', '/lib/dom.js', '/lib/dom.ts', '/lib/form.js', '/lib/form.ts', '/lib/fs.js', '/lib/fs.ts', '/lib/native.js', '/lib/native.ts', '/lib/task.js', '/lib/task.ts', '/lib/theme.js', '/lib/theme.ts', '/lib/tool.js', '/lib/tool.ts', '/lib/zip.js', '/lib/zip.ts', '/theme/', '/theme/familiar.cgt'];
|
|
16
16
|
|
|
17
17
|
/** --- fs lib 用到的语言包 --- */
|
|
18
18
|
const localeData: Record<string, {
|
package/dist/lib/task.js
CHANGED
|
@@ -193,41 +193,50 @@ function getList() {
|
|
|
193
193
|
}
|
|
194
194
|
exports.getList = getList;
|
|
195
195
|
function run(url, opt = {}, ntid) {
|
|
196
|
-
var _a, _b, _c, _d, _e;
|
|
196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
197
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
icon =
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
198
|
+
let app = null;
|
|
199
|
+
if (typeof url === 'string') {
|
|
200
|
+
if (!url.endsWith('/') && !url.endsWith('.cga')) {
|
|
201
|
+
return 0;
|
|
202
|
+
}
|
|
203
|
+
let icon = __dirname + '/../icon.png';
|
|
204
|
+
if (opt.icon) {
|
|
205
|
+
icon = opt.icon;
|
|
206
|
+
}
|
|
207
|
+
if (opt.notify === undefined) {
|
|
208
|
+
opt.notify = true;
|
|
209
|
+
}
|
|
210
|
+
const notifyId = opt.notify ? form.notify({
|
|
211
|
+
'title': (_b = (_a = localeData[core.config.locale]) === null || _a === void 0 ? void 0 : _a.loading) !== null && _b !== void 0 ? _b : localeData['en'].loading,
|
|
212
|
+
'content': url,
|
|
213
|
+
'icon': icon,
|
|
214
|
+
'timeout': 0,
|
|
215
|
+
'progress': true
|
|
216
|
+
}) : undefined;
|
|
217
|
+
if (!ntid &&
|
|
218
|
+
!url.startsWith('/clickgo/') &&
|
|
219
|
+
!url.startsWith('/storage/') &&
|
|
220
|
+
!url.startsWith('/mounted/') &&
|
|
221
|
+
!url.startsWith('/package/') &&
|
|
222
|
+
!url.startsWith('/current/')) {
|
|
223
|
+
url = tool.urlResolve(location.href, url);
|
|
224
|
+
}
|
|
225
|
+
app = yield core.fetchApp(url, {
|
|
226
|
+
'notifyId': notifyId,
|
|
227
|
+
'progress': opt.progress
|
|
228
|
+
}, ntid);
|
|
229
|
+
if (notifyId) {
|
|
230
|
+
setTimeout(function () {
|
|
231
|
+
form.hideNotify(notifyId);
|
|
232
|
+
}, 2000);
|
|
233
|
+
}
|
|
207
234
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
'content': url,
|
|
211
|
-
'icon': icon,
|
|
212
|
-
'timeout': 0,
|
|
213
|
-
'progress': true
|
|
214
|
-
}) : undefined;
|
|
215
|
-
if (!ntid &&
|
|
216
|
-
!url.startsWith('/clickgo/') &&
|
|
217
|
-
!url.startsWith('/storage/') &&
|
|
218
|
-
!url.startsWith('/mounted/') &&
|
|
219
|
-
!url.startsWith('/package/') &&
|
|
220
|
-
!url.startsWith('/current/')) {
|
|
221
|
-
url = tool.urlResolve(location.href, url);
|
|
235
|
+
else if (url.type !== 'app') {
|
|
236
|
+
return -1;
|
|
222
237
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
'progress': opt.progress
|
|
226
|
-
}, ntid);
|
|
227
|
-
if (notifyId) {
|
|
228
|
-
setTimeout(function () {
|
|
229
|
-
form.hideNotify(notifyId);
|
|
230
|
-
}, 2000);
|
|
238
|
+
else {
|
|
239
|
+
app = url;
|
|
231
240
|
}
|
|
232
241
|
if (!app) {
|
|
233
242
|
return -1;
|
|
@@ -966,7 +975,7 @@ function run(url, opt = {}, ntid) {
|
|
|
966
975
|
return code;
|
|
967
976
|
};
|
|
968
977
|
app.files['/invoke/clickgo.js'] = `module.exports = invokeClickgo;`;
|
|
969
|
-
const path = url;
|
|
978
|
+
const path = (_c = opt.path) !== null && _c !== void 0 ? _c : ((typeof url === 'string') ? url : '/runtime/' + tool.random(8, tool.RANDOM_LUN) + '.cga');
|
|
970
979
|
const lio = path.endsWith('.cga') ? path.lastIndexOf('/') : path.slice(0, -1).lastIndexOf('/');
|
|
971
980
|
const current = path.slice(0, lio);
|
|
972
981
|
exports.list[taskId] = {
|
|
@@ -981,7 +990,7 @@ function run(url, opt = {}, ntid) {
|
|
|
981
990
|
'current': current,
|
|
982
991
|
'runtime': clickgo.vue.reactive({
|
|
983
992
|
'dialogFormIds': [],
|
|
984
|
-
'permissions': (
|
|
993
|
+
'permissions': (_d = opt.permissions) !== null && _d !== void 0 ? _d : []
|
|
985
994
|
}),
|
|
986
995
|
'forms': {},
|
|
987
996
|
'controls': {},
|
|
@@ -994,6 +1003,7 @@ function run(url, opt = {}, ntid) {
|
|
|
994
1003
|
if (!path.endsWith('.json')) {
|
|
995
1004
|
path += '.json';
|
|
996
1005
|
}
|
|
1006
|
+
yield ((_e = opt.initProgress) === null || _e === void 0 ? void 0 : _e.call(opt, 'Load local ' + path + ' ...'));
|
|
997
1007
|
const lcontent = yield fs.getContent(path, {
|
|
998
1008
|
'encoding': 'utf8'
|
|
999
1009
|
}, taskId);
|
|
@@ -1004,7 +1014,7 @@ function run(url, opt = {}, ntid) {
|
|
|
1004
1014
|
const data = JSON.parse(lcontent);
|
|
1005
1015
|
loadLocaleData(locale, data, '', taskId);
|
|
1006
1016
|
}
|
|
1007
|
-
catch (
|
|
1017
|
+
catch (_p) {
|
|
1008
1018
|
}
|
|
1009
1019
|
}
|
|
1010
1020
|
}
|
|
@@ -1033,16 +1043,18 @@ function run(url, opt = {}, ntid) {
|
|
|
1033
1043
|
return -3;
|
|
1034
1044
|
}
|
|
1035
1045
|
dom.createToStyleList(taskId);
|
|
1046
|
+
yield ((_f = opt.initProgress) === null || _f === void 0 ? void 0 : _f.call(opt, 'Control initialization ...'));
|
|
1036
1047
|
const r = yield control.init(taskId, invoke);
|
|
1037
1048
|
if (r < 0) {
|
|
1038
1049
|
dom.removeFromStyleList(taskId);
|
|
1039
1050
|
delete exports.list[taskId];
|
|
1040
1051
|
return -400 + r;
|
|
1041
1052
|
}
|
|
1042
|
-
if ((
|
|
1053
|
+
if ((_g = app.config.themes) === null || _g === void 0 ? void 0 : _g.length) {
|
|
1043
1054
|
for (let path of app.config.themes) {
|
|
1044
1055
|
path += '.cgt';
|
|
1045
1056
|
path = tool.urlResolve('/', path);
|
|
1057
|
+
yield ((_h = opt.initProgress) === null || _h === void 0 ? void 0 : _h.call(opt, 'Load theme ' + path + ' ...'));
|
|
1046
1058
|
const file = yield fs.getContent(path, undefined, taskId);
|
|
1047
1059
|
if (file && typeof file !== 'string') {
|
|
1048
1060
|
const th = yield theme.read(file);
|
|
@@ -1054,6 +1066,7 @@ function run(url, opt = {}, ntid) {
|
|
|
1054
1066
|
}
|
|
1055
1067
|
else {
|
|
1056
1068
|
if (theme.global) {
|
|
1069
|
+
yield ((_j = opt.initProgress) === null || _j === void 0 ? void 0 : _j.call(opt, 'Load global theme ...'));
|
|
1057
1070
|
yield theme.load(undefined, taskId);
|
|
1058
1071
|
}
|
|
1059
1072
|
}
|
|
@@ -1063,16 +1076,19 @@ function run(url, opt = {}, ntid) {
|
|
|
1063
1076
|
}, taskId);
|
|
1064
1077
|
if (style) {
|
|
1065
1078
|
const r = tool.stylePrepend(style, 'cg-task' + taskId.toString() + '_');
|
|
1079
|
+
yield ((_k = opt.initProgress) === null || _k === void 0 ? void 0 : _k.call(opt, 'Style initialization ...'));
|
|
1066
1080
|
dom.pushStyle(taskId, yield tool.styleUrl2DataUrl(app.config.style, r.style, app.files));
|
|
1067
1081
|
}
|
|
1068
1082
|
}
|
|
1069
1083
|
core.trigger('taskStarted', taskId);
|
|
1070
1084
|
if (app.config.permissions) {
|
|
1085
|
+
yield ((_l = opt.initProgress) === null || _l === void 0 ? void 0 : _l.call(opt, 'Style initialization ...'));
|
|
1071
1086
|
yield checkPermission(app.config.permissions, true, undefined, taskId);
|
|
1072
1087
|
}
|
|
1073
1088
|
const appCls = new expo.default();
|
|
1074
1089
|
exports.list[taskId].class = appCls;
|
|
1075
|
-
yield
|
|
1090
|
+
yield ((_m = opt.initProgress) === null || _m === void 0 ? void 0 : _m.call(opt, 'Starting ...'));
|
|
1091
|
+
yield appCls.main((_o = opt.data) !== null && _o !== void 0 ? _o : {});
|
|
1076
1092
|
return taskId;
|
|
1077
1093
|
});
|
|
1078
1094
|
}
|
package/dist/lib/task.ts
CHANGED
|
@@ -227,50 +227,59 @@ export function getList(): Record<string, types.ITaskInfo> {
|
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* --- 运行一个应用,cga 直接文件全部正常加载,url 则静态文件需要去 config 里加载 ---
|
|
230
|
-
* @param url app 路径(以 / 为结尾的路径或以 .cga
|
|
230
|
+
* @param url app 路径(以 / 为结尾的路径或以 .cga 结尾的文件),或 APP 包对象
|
|
231
231
|
* @param opt 选项
|
|
232
232
|
* @param ntid App 模式下无效
|
|
233
233
|
*/
|
|
234
|
-
export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: number): Promise<number> {
|
|
235
|
-
|
|
236
|
-
if (
|
|
237
|
-
|
|
234
|
+
export async function run(url: string | types.IApp, opt: types.ITaskRunOptions = {}, ntid?: number): Promise<number> {
|
|
235
|
+
let app: types.IApp | null = null;
|
|
236
|
+
if (typeof url === 'string') {
|
|
237
|
+
// --- 检测 url 是否合法 ---
|
|
238
|
+
if (!url.endsWith('/') && !url.endsWith('.cga')) {
|
|
239
|
+
return 0;
|
|
240
|
+
}
|
|
241
|
+
/** --- 要显示的应用图标 --- */
|
|
242
|
+
let icon = __dirname + '/../icon.png';
|
|
243
|
+
if (opt.icon) {
|
|
244
|
+
icon = opt.icon;
|
|
245
|
+
}
|
|
246
|
+
if (opt.notify === undefined) {
|
|
247
|
+
opt.notify = true;
|
|
248
|
+
}
|
|
249
|
+
const notifyId: number | undefined = opt.notify ? form.notify({
|
|
250
|
+
'title': localeData[core.config.locale]?.loading ?? localeData['en'].loading,
|
|
251
|
+
'content': url,
|
|
252
|
+
'icon': icon,
|
|
253
|
+
'timeout': 0,
|
|
254
|
+
'progress': true
|
|
255
|
+
}) : undefined;
|
|
256
|
+
// --- 非 ntid 模式下 current 以 location 为准 ---
|
|
257
|
+
if (!ntid &&
|
|
258
|
+
!url.startsWith('/clickgo/') &&
|
|
259
|
+
!url.startsWith('/storage/') &&
|
|
260
|
+
!url.startsWith('/mounted/') &&
|
|
261
|
+
!url.startsWith('/package/') &&
|
|
262
|
+
!url.startsWith('/current/')
|
|
263
|
+
) {
|
|
264
|
+
url = tool.urlResolve(location.href, url);
|
|
265
|
+
}
|
|
266
|
+
// --- 获取并加载 app 对象 ---
|
|
267
|
+
app = await core.fetchApp(url, {
|
|
268
|
+
'notifyId': notifyId,
|
|
269
|
+
'progress': opt.progress
|
|
270
|
+
}, ntid);
|
|
271
|
+
// --- 无论是否成功,都可以先隐藏 notify 了 ---
|
|
272
|
+
if (notifyId) {
|
|
273
|
+
setTimeout(function(): void {
|
|
274
|
+
form.hideNotify(notifyId);
|
|
275
|
+
}, 2000);
|
|
276
|
+
}
|
|
238
277
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if (opt.notify === undefined) {
|
|
245
|
-
opt.notify = true;
|
|
246
|
-
}
|
|
247
|
-
const notifyId: number | undefined = opt.notify ? form.notify({
|
|
248
|
-
'title': localeData[core.config.locale]?.loading ?? localeData['en'].loading,
|
|
249
|
-
'content': url,
|
|
250
|
-
'icon': icon,
|
|
251
|
-
'timeout': 0,
|
|
252
|
-
'progress': true
|
|
253
|
-
}) : undefined;
|
|
254
|
-
// --- 非 ntid 模式下 current 以 location 为准 ---
|
|
255
|
-
if (!ntid &&
|
|
256
|
-
!url.startsWith('/clickgo/') &&
|
|
257
|
-
!url.startsWith('/storage/') &&
|
|
258
|
-
!url.startsWith('/mounted/') &&
|
|
259
|
-
!url.startsWith('/package/') &&
|
|
260
|
-
!url.startsWith('/current/')
|
|
261
|
-
) {
|
|
262
|
-
url = tool.urlResolve(location.href, url);
|
|
263
|
-
}
|
|
264
|
-
// --- 获取并加载 app 对象 ---
|
|
265
|
-
const app = await core.fetchApp(url, {
|
|
266
|
-
'notifyId': notifyId,
|
|
267
|
-
'progress': opt.progress
|
|
268
|
-
}, ntid);
|
|
269
|
-
// --- 无论是否成功,都可以先隐藏 notify 了 ---
|
|
270
|
-
if (notifyId) {
|
|
271
|
-
setTimeout(function(): void {
|
|
272
|
-
form.hideNotify(notifyId);
|
|
273
|
-
}, 2000);
|
|
278
|
+
else if (url.type !== 'app') {
|
|
279
|
+
return -1;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
app = url;
|
|
274
283
|
}
|
|
275
284
|
if (!app) {
|
|
276
285
|
return -1;
|
|
@@ -1076,7 +1085,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1076
1085
|
};
|
|
1077
1086
|
app.files['/invoke/clickgo.js'] = `module.exports = invokeClickgo;`;
|
|
1078
1087
|
/** --- .cga 文件,或者不含 / 结尾的路径 --- */
|
|
1079
|
-
const path = url;
|
|
1088
|
+
const path = opt.path ?? ((typeof url === 'string') ? url : '/runtime/' + tool.random(8, tool.RANDOM_LUN) + '.cga');
|
|
1080
1089
|
const lio = path.endsWith('.cga') ? path.lastIndexOf('/') : path.slice(0, -1).lastIndexOf('/');
|
|
1081
1090
|
const current = path.slice(0, lio);
|
|
1082
1091
|
// --- 创建任务对象 ---
|
|
@@ -1108,6 +1117,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1108
1117
|
if (!path.endsWith('.json')) {
|
|
1109
1118
|
path += '.json';
|
|
1110
1119
|
}
|
|
1120
|
+
await opt.initProgress?.('Load local ' + path + ' ...');
|
|
1111
1121
|
const lcontent = await fs.getContent(path, {
|
|
1112
1122
|
'encoding': 'utf8'
|
|
1113
1123
|
}, taskId);
|
|
@@ -1150,6 +1160,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1150
1160
|
// --- 创建 Task 总 style ---
|
|
1151
1161
|
dom.createToStyleList(taskId);
|
|
1152
1162
|
// --- 加载 control ---
|
|
1163
|
+
await opt.initProgress?.('Control initialization ...');
|
|
1153
1164
|
const r = await control.init(taskId, invoke);
|
|
1154
1165
|
if (r < 0) {
|
|
1155
1166
|
dom.removeFromStyleList(taskId);
|
|
@@ -1161,6 +1172,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1161
1172
|
for (let path of app.config.themes) {
|
|
1162
1173
|
path += '.cgt';
|
|
1163
1174
|
path = tool.urlResolve('/', path);
|
|
1175
|
+
await opt.initProgress?.('Load theme ' + path + ' ...');
|
|
1164
1176
|
const file = await fs.getContent(path, undefined, taskId);
|
|
1165
1177
|
if (file && typeof file !== 'string') {
|
|
1166
1178
|
const th = await theme.read(file);
|
|
@@ -1173,6 +1185,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1173
1185
|
else {
|
|
1174
1186
|
// --- 加载全局主题 ---
|
|
1175
1187
|
if (theme.global) {
|
|
1188
|
+
await opt.initProgress?.('Load global theme ...');
|
|
1176
1189
|
await theme.load(undefined, taskId);
|
|
1177
1190
|
}
|
|
1178
1191
|
}
|
|
@@ -1183,6 +1196,7 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1183
1196
|
}, taskId);
|
|
1184
1197
|
if (style) {
|
|
1185
1198
|
const r = tool.stylePrepend(style, 'cg-task' + taskId.toString() + '_');
|
|
1199
|
+
await opt.initProgress?.('Style initialization ...');
|
|
1186
1200
|
dom.pushStyle(taskId, await tool.styleUrl2DataUrl(app.config.style, r.style, app.files));
|
|
1187
1201
|
}
|
|
1188
1202
|
}
|
|
@@ -1190,11 +1204,13 @@ export async function run(url: string, opt: types.ITaskRunOptions = {}, ntid?: n
|
|
|
1190
1204
|
core.trigger('taskStarted', taskId);
|
|
1191
1205
|
// --- 请求权限 ---
|
|
1192
1206
|
if (app.config.permissions) {
|
|
1207
|
+
await opt.initProgress?.('Style initialization ...');
|
|
1193
1208
|
await checkPermission(app.config.permissions, true, undefined, taskId);
|
|
1194
1209
|
}
|
|
1195
1210
|
// --- 执行 app ---
|
|
1196
1211
|
const appCls: core.AbstractApp = new expo.default();
|
|
1197
1212
|
list[taskId].class = appCls;
|
|
1213
|
+
await opt.initProgress?.('Starting ...');
|
|
1198
1214
|
await appCls.main(opt.data ?? {});
|
|
1199
1215
|
return taskId;
|
|
1200
1216
|
}
|
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.15-dev",
|
|
4
4
|
"description": "Background interface, software interface, mobile phone APP interface operation library.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deskrt",
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
"@litert/eslint-plugin-rules": "^0.1.2",
|
|
22
22
|
"@litert/loader": "^3.4.9",
|
|
23
23
|
"@types/node": "^18.11.14",
|
|
24
|
-
"electron": "^22.0
|
|
24
|
+
"electron": "^22.2.0",
|
|
25
25
|
"jszip": "^3.10.1",
|
|
26
|
+
"terser": "^5.16.3",
|
|
26
27
|
"typescript": "^4.9.4"
|
|
27
28
|
}
|
|
28
29
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -421,6 +421,8 @@ export interface ITaskRunOptions {
|
|
|
421
421
|
'icon'?: string;
|
|
422
422
|
/** --- 加载进度回调 --- */
|
|
423
423
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
424
|
+
/** --- 初始化进度回调 --- */
|
|
425
|
+
'initProgress'?: (state: string) => void | Promise<void>;
|
|
424
426
|
/** --- 显示 notify 窗口 --- */
|
|
425
427
|
'notify'?: boolean;
|
|
426
428
|
/** --- 不禁止某些浏览器对象,App 模式下仅能设置基任务中已经 unblock 的值 --- */
|
|
@@ -429,6 +431,8 @@ export interface ITaskRunOptions {
|
|
|
429
431
|
'permissions'?: string[];
|
|
430
432
|
/** --- 给 task 传值 --- */
|
|
431
433
|
'data'?: Record<string, any>;
|
|
434
|
+
/** --- 执行文件的基路径,一般在传入 APP 包时使用,以 .cga 结尾或不以 / 结尾的路径 --- */
|
|
435
|
+
'path'?: string;
|
|
432
436
|
}
|
|
433
437
|
|
|
434
438
|
export interface ICreateTimerOptions {
|