clickgo 3.1.2-dev11 → 3.1.3-dev12
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/dist/app/demo/app.js +0 -73
- package/dist/app/demo/config.json +109 -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/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 +161 -5
- package/dist/app/demo/form/main.xml +36 -35
- package/dist/app/demo/form/method/aform/aform.xml +3 -2
- package/dist/app/demo/form/method/core/core.js +11 -8
- package/dist/app/demo/form/method/core/core.xml +2 -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 +59 -61
- package/dist/app/demo/form/method/task/task.xml +4 -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 +3 -3
- package/dist/index.ts +3 -3
- package/dist/lib/control.js +70 -104
- package/dist/lib/control.ts +97 -123
- package/dist/lib/core.js +108 -252
- package/dist/lib/core.ts +122 -268
- package/dist/lib/dom.js +564 -483
- package/dist/lib/dom.ts +703 -546
- package/dist/lib/form.js +146 -138
- package/dist/lib/form.ts +108 -86
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/native.js +135 -8
- package/dist/lib/native.ts +175 -11
- package/dist/lib/task.js +294 -158
- package/dist/lib/task.ts +326 -172
- 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 +1 -1
- package/types/index.d.ts +23 -24
- 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/core.js
CHANGED
|
@@ -9,16 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.
|
|
12
|
+
exports.getAvailArea = exports.fetchApp = exports.readApp = exports.trigger = exports.getModule = exports.regModule = exports.boot = exports.getCdn = exports.AbstractApp = exports.config = void 0;
|
|
13
13
|
const clickgo = require("../clickgo");
|
|
14
14
|
const fs = require("./fs");
|
|
15
15
|
const form = require("./form");
|
|
16
16
|
const task = require("./task");
|
|
17
17
|
const tool = require("./tool");
|
|
18
|
-
const control = require("./control");
|
|
19
|
-
const theme = require("./theme");
|
|
20
18
|
const zip = require("./zip");
|
|
21
|
-
const dom = require("./dom");
|
|
22
19
|
const configOrigin = {
|
|
23
20
|
'locale': 'en',
|
|
24
21
|
'task.position': 'bottom',
|
|
@@ -53,147 +50,6 @@ class AbstractApp {
|
|
|
53
50
|
'type': 'danger'
|
|
54
51
|
});
|
|
55
52
|
}
|
|
56
|
-
config(config) {
|
|
57
|
-
var _a;
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
const t = task.list[this.taskId];
|
|
60
|
-
if (!t) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
t.config = config;
|
|
64
|
-
if (t.app.net) {
|
|
65
|
-
if (!t.config.files) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
const files = t.config.files;
|
|
69
|
-
const net = t.app.net;
|
|
70
|
-
yield new Promise(function (resolve) {
|
|
71
|
-
var _a;
|
|
72
|
-
let loaded = 0;
|
|
73
|
-
const total = files.length;
|
|
74
|
-
const beforeTotal = Object.keys(t.app.files).length;
|
|
75
|
-
(_a = net.progress) === null || _a === void 0 ? void 0 : _a.call(net, loaded + beforeTotal, total + beforeTotal);
|
|
76
|
-
for (const file of files) {
|
|
77
|
-
fs.getContent(net.url + file.slice(1), {
|
|
78
|
-
'current': net.current
|
|
79
|
-
}).then(function (blob) {
|
|
80
|
-
var _a;
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
if (blob === null || typeof blob === 'string') {
|
|
83
|
-
clickgo.form.notify({
|
|
84
|
-
'title': 'File not found',
|
|
85
|
-
'content': net.url + file.slice(1),
|
|
86
|
-
'type': 'danger'
|
|
87
|
-
});
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const mime = tool.getMimeByPath(file);
|
|
91
|
-
if (['txt', 'json', 'js', 'css', 'xml', 'html'].includes(mime.ext)) {
|
|
92
|
-
t.app.files[file] = (yield tool.blob2Text(blob)).replace(/^\ufeff/, '');
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
t.app.files[file] = blob;
|
|
96
|
-
}
|
|
97
|
-
++loaded;
|
|
98
|
-
(_a = net.progress) === null || _a === void 0 ? void 0 : _a.call(net, loaded + beforeTotal, total + beforeTotal);
|
|
99
|
-
if (net.notify) {
|
|
100
|
-
form.notifyProgress(net.notify, (loaded / total) / 2 + 0.5);
|
|
101
|
-
}
|
|
102
|
-
if (loaded < total) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
resolve();
|
|
106
|
-
});
|
|
107
|
-
}).catch(function () {
|
|
108
|
-
var _a;
|
|
109
|
-
++loaded;
|
|
110
|
-
(_a = net.progress) === null || _a === void 0 ? void 0 : _a.call(net, loaded + beforeTotal, total + beforeTotal);
|
|
111
|
-
if (net.notify) {
|
|
112
|
-
form.notifyProgress(net.notify, (loaded / total) / 2 + 0.5);
|
|
113
|
-
}
|
|
114
|
-
if (loaded < total) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
resolve();
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
if (net.notify) {
|
|
122
|
-
setTimeout(function () {
|
|
123
|
-
form.hideNotify(net.notify);
|
|
124
|
-
}, 2000);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (!(yield control.init(this.taskId))) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
if ((_a = config.themes) === null || _a === void 0 ? void 0 : _a.length) {
|
|
131
|
-
for (let path of config.themes) {
|
|
132
|
-
path += '.cgt';
|
|
133
|
-
path = tool.urlResolve('/', path);
|
|
134
|
-
const file = yield fs.getContent(path, {
|
|
135
|
-
'files': t.app.files,
|
|
136
|
-
'current': t.current
|
|
137
|
-
});
|
|
138
|
-
if (file && typeof file !== 'string') {
|
|
139
|
-
const th = yield theme.read(file);
|
|
140
|
-
if (th) {
|
|
141
|
-
yield theme.load(th, t.id);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
if (theme.global) {
|
|
148
|
-
yield theme.load(undefined, this.taskId);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (config.locales) {
|
|
152
|
-
for (let path in config.locales) {
|
|
153
|
-
const locale = config.locales[path];
|
|
154
|
-
if (!path.endsWith('.json')) {
|
|
155
|
-
path += '.json';
|
|
156
|
-
}
|
|
157
|
-
const lcontent = yield fs.getContent(path, {
|
|
158
|
-
'encoding': 'utf8',
|
|
159
|
-
'files': t.app.files,
|
|
160
|
-
'current': t.current
|
|
161
|
-
});
|
|
162
|
-
if (!lcontent) {
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
const data = JSON.parse(lcontent);
|
|
167
|
-
task.loadLocaleData(locale, data, '', t.id);
|
|
168
|
-
}
|
|
169
|
-
catch (_b) {
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (config.style) {
|
|
174
|
-
const style = yield fs.getContent(config.style + '.css', {
|
|
175
|
-
'encoding': 'utf8',
|
|
176
|
-
'files': t.app.files,
|
|
177
|
-
'current': t.current
|
|
178
|
-
});
|
|
179
|
-
if (style) {
|
|
180
|
-
const r = tool.stylePrepend(style, 'cg-task' + this.taskId.toString() + '_');
|
|
181
|
-
dom.pushStyle(this.taskId, yield tool.styleUrl2DataUrl(config.style, r.style, t.app.files));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
if (config.icon) {
|
|
185
|
-
const icon = yield fs.getContent(config.icon, {
|
|
186
|
-
'files': t.app.files,
|
|
187
|
-
'current': t.current
|
|
188
|
-
});
|
|
189
|
-
if (icon && typeof icon !== 'string') {
|
|
190
|
-
t.app.icon = yield tool.blob2DataUrl(icon);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
t.class = this;
|
|
194
|
-
return true;
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
53
|
run(form) {
|
|
198
54
|
if (typeof form === 'number') {
|
|
199
55
|
const msg = 'Application run error, Form creation failed (' + form.toString() + ').';
|
|
@@ -322,7 +178,8 @@ const modules = {
|
|
|
322
178
|
});
|
|
323
179
|
},
|
|
324
180
|
'obj': null,
|
|
325
|
-
'loading': false
|
|
181
|
+
'loading': false,
|
|
182
|
+
'resolve': []
|
|
326
183
|
}
|
|
327
184
|
};
|
|
328
185
|
function regModule(name, func) {
|
|
@@ -332,87 +189,53 @@ function regModule(name, func) {
|
|
|
332
189
|
modules[name] = {
|
|
333
190
|
func: func,
|
|
334
191
|
'obj': null,
|
|
335
|
-
'loading': false
|
|
192
|
+
'loading': false,
|
|
193
|
+
'resolve': []
|
|
336
194
|
};
|
|
337
195
|
return true;
|
|
338
196
|
}
|
|
339
197
|
exports.regModule = regModule;
|
|
340
|
-
function
|
|
341
|
-
return new Promise(
|
|
342
|
-
if (
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
if (names.length === 0) {
|
|
346
|
-
resolve(0);
|
|
347
|
-
return;
|
|
198
|
+
function getModule(name) {
|
|
199
|
+
return new Promise((resolve) => {
|
|
200
|
+
if (!modules[name]) {
|
|
201
|
+
return null;
|
|
348
202
|
}
|
|
349
|
-
|
|
350
|
-
let successful = 0;
|
|
351
|
-
for (const name of names) {
|
|
352
|
-
if (!modules[name]) {
|
|
353
|
-
++loaded;
|
|
354
|
-
if (loaded === names.length) {
|
|
355
|
-
resolve(successful);
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
if (modules[name].obj) {
|
|
361
|
-
++loaded;
|
|
362
|
-
++successful;
|
|
363
|
-
if (loaded === names.length) {
|
|
364
|
-
resolve(successful);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
203
|
+
if (!modules[name].obj) {
|
|
369
204
|
if (modules[name].loading) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
resolve(successful);
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
continue;
|
|
376
|
-
}
|
|
377
|
-
modules[name].loading = true;
|
|
378
|
-
const rtn = modules[name].func();
|
|
379
|
-
if (rtn instanceof Promise) {
|
|
380
|
-
rtn.then(function (obj) {
|
|
381
|
-
modules[name].obj = obj;
|
|
382
|
-
modules[name].loading = false;
|
|
383
|
-
++loaded;
|
|
384
|
-
++successful;
|
|
385
|
-
if (loaded === names.length) {
|
|
386
|
-
resolve(successful);
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
}).catch(function () {
|
|
390
|
-
modules[name].loading = false;
|
|
391
|
-
++loaded;
|
|
392
|
-
if (loaded === names.length) {
|
|
393
|
-
resolve(successful);
|
|
394
|
-
}
|
|
205
|
+
modules[name].resolve.push(() => {
|
|
206
|
+
resolve(modules[name].obj);
|
|
395
207
|
});
|
|
396
208
|
}
|
|
397
209
|
else {
|
|
398
|
-
modules[name].
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
210
|
+
const rtn = modules[name].func();
|
|
211
|
+
if (rtn instanceof Promise) {
|
|
212
|
+
modules[name].loading = true;
|
|
213
|
+
rtn.then(function (obj) {
|
|
214
|
+
modules[name].obj = obj;
|
|
215
|
+
modules[name].loading = false;
|
|
216
|
+
resolve(obj);
|
|
217
|
+
for (const r of modules[name].resolve) {
|
|
218
|
+
r();
|
|
219
|
+
}
|
|
220
|
+
}).catch(function () {
|
|
221
|
+
modules[name].loading = false;
|
|
222
|
+
resolve(null);
|
|
223
|
+
for (const r of modules[name].resolve) {
|
|
224
|
+
r();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
modules[name].obj = rtn;
|
|
230
|
+
resolve(rtn);
|
|
404
231
|
}
|
|
405
232
|
}
|
|
233
|
+
return;
|
|
406
234
|
}
|
|
235
|
+
resolve(modules[name].obj);
|
|
236
|
+
return;
|
|
407
237
|
});
|
|
408
238
|
}
|
|
409
|
-
exports.initModules = initModules;
|
|
410
|
-
function getModule(name) {
|
|
411
|
-
if (!modules[name]) {
|
|
412
|
-
return null;
|
|
413
|
-
}
|
|
414
|
-
return modules[name].obj;
|
|
415
|
-
}
|
|
416
239
|
exports.getModule = getModule;
|
|
417
240
|
const globalEvents = {
|
|
418
241
|
screenResize: function () {
|
|
@@ -598,6 +421,11 @@ function readApp(blob) {
|
|
|
598
421
|
return false;
|
|
599
422
|
}
|
|
600
423
|
const files = {};
|
|
424
|
+
const configContent = yield z.getContent('/config.json');
|
|
425
|
+
if (!configContent) {
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
const config = JSON.parse(configContent);
|
|
601
429
|
const list = z.readDir('/', {
|
|
602
430
|
'hasChildren': true
|
|
603
431
|
});
|
|
@@ -621,8 +449,10 @@ function readApp(blob) {
|
|
|
621
449
|
}
|
|
622
450
|
}
|
|
623
451
|
return {
|
|
624
|
-
'
|
|
625
|
-
'
|
|
452
|
+
'type': 'app',
|
|
453
|
+
'config': config,
|
|
454
|
+
'files': files,
|
|
455
|
+
'icon': icon
|
|
626
456
|
};
|
|
627
457
|
});
|
|
628
458
|
}
|
|
@@ -679,50 +509,76 @@ function fetchApp(url, opt = {}) {
|
|
|
679
509
|
return null;
|
|
680
510
|
}
|
|
681
511
|
}
|
|
682
|
-
let
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
if (loaded === total) {
|
|
696
|
-
++total;
|
|
697
|
-
}
|
|
698
|
-
if (opt.notifyId) {
|
|
699
|
-
form.notifyProgress(opt.notifyId, (loaded / total) / 2);
|
|
512
|
+
let config;
|
|
513
|
+
const files = {};
|
|
514
|
+
try {
|
|
515
|
+
const blob = yield fs.getContent(url + 'config.json', {
|
|
516
|
+
'current': current
|
|
517
|
+
});
|
|
518
|
+
if (blob === null || typeof blob === 'string') {
|
|
519
|
+
return null;
|
|
520
|
+
}
|
|
521
|
+
config = JSON.parse(yield tool.blob2Text(blob));
|
|
522
|
+
yield new Promise(function (resolve) {
|
|
523
|
+
if (!config.files) {
|
|
524
|
+
return;
|
|
700
525
|
}
|
|
701
|
-
|
|
702
|
-
|
|
526
|
+
const total = config.files.length;
|
|
527
|
+
let loaded = 0;
|
|
528
|
+
for (const file of config.files) {
|
|
529
|
+
fs.getContent(url + file.slice(1), {
|
|
530
|
+
'current': current
|
|
531
|
+
}).then(function (blob) {
|
|
532
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
+
if (blob === null || typeof blob === 'string') {
|
|
534
|
+
clickgo.form.notify({
|
|
535
|
+
'title': 'File not found',
|
|
536
|
+
'content': url + file.slice(1),
|
|
537
|
+
'type': 'danger'
|
|
538
|
+
});
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
const mime = tool.getMimeByPath(file);
|
|
542
|
+
if (['txt', 'json', 'js', 'css', 'xml', 'html'].includes(mime.ext)) {
|
|
543
|
+
files[file] = (yield tool.blob2Text(blob)).replace(/^\ufeff/, '');
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
files[file] = blob;
|
|
547
|
+
}
|
|
548
|
+
++loaded;
|
|
549
|
+
if (opt.notifyId) {
|
|
550
|
+
form.notifyProgress(opt.notifyId, loaded / total);
|
|
551
|
+
}
|
|
552
|
+
if (loaded < total) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
resolve();
|
|
556
|
+
});
|
|
557
|
+
}).catch(function () {
|
|
558
|
+
++loaded;
|
|
559
|
+
if (opt.notifyId) {
|
|
560
|
+
form.notifyProgress(opt.notifyId, loaded / total);
|
|
561
|
+
}
|
|
562
|
+
if (loaded < total) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
resolve();
|
|
566
|
+
});
|
|
703
567
|
}
|
|
704
|
-
}
|
|
705
|
-
});
|
|
706
|
-
if (opt.notifyId) {
|
|
707
|
-
form.notifyProgress(opt.notifyId, 0.5);
|
|
568
|
+
});
|
|
708
569
|
}
|
|
709
|
-
|
|
570
|
+
catch (_b) {
|
|
710
571
|
return null;
|
|
711
572
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
delete files[fn];
|
|
573
|
+
let icon = '/clickgo/icon.png';
|
|
574
|
+
if (config.icon && (files[config.icon] instanceof Blob)) {
|
|
575
|
+
icon = yield tool.blob2DataUrl(files[config.icon]);
|
|
716
576
|
}
|
|
717
577
|
return {
|
|
718
|
-
'
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
'progress': opt.progress
|
|
723
|
-
},
|
|
724
|
-
'icon': '',
|
|
725
|
-
'files': files
|
|
578
|
+
'type': 'app',
|
|
579
|
+
'config': config,
|
|
580
|
+
'files': files,
|
|
581
|
+
'icon': icon
|
|
726
582
|
};
|
|
727
583
|
});
|
|
728
584
|
}
|