clickgo 3.16.26 → 3.16.28

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.
Files changed (102) hide show
  1. package/README.md +1 -1
  2. package/dist/app/demo/app.js +4 -16
  3. package/dist/app/demo/config.json +4 -1
  4. package/dist/app/demo/form/control/arteditor/arteditor.js +7 -18
  5. package/dist/app/demo/form/control/button/button.js +2 -13
  6. package/dist/app/demo/form/control/check/check.js +3 -14
  7. package/dist/app/demo/form/control/content/content.js +3 -14
  8. package/dist/app/demo/form/control/daterange/daterange.js +1 -1
  9. package/dist/app/demo/form/control/delete/delete.js +3 -14
  10. package/dist/app/demo/form/control/dialog/dialog.js +2 -0
  11. package/dist/app/demo/form/control/dialog/dialog.xml +26 -12
  12. package/dist/app/demo/form/control/flow/flow.js +2 -13
  13. package/dist/app/demo/form/control/form/form.js +4 -15
  14. package/dist/app/demo/form/control/iconview/iconview.js +12 -29
  15. package/dist/app/demo/form/control/jodit/jodit.js +7 -18
  16. package/dist/app/demo/form/control/link/link.js +2 -13
  17. package/dist/app/demo/form/control/list/list.js +40 -52
  18. package/dist/app/demo/form/control/list/list.xml +20 -10
  19. package/dist/app/demo/form/control/map/map.js +17 -28
  20. package/dist/app/demo/form/control/menu/menu.js +6 -17
  21. package/dist/app/demo/form/control/mpegts/mpegts.js +1 -1
  22. package/dist/app/demo/form/control/nav/nav.js +6 -17
  23. package/dist/app/demo/form/control/novnc/novnc.js +75 -0
  24. package/dist/app/demo/form/control/novnc/novnc.xml +13 -0
  25. package/dist/app/demo/form/control/panel/panel.js +9 -20
  26. package/dist/app/demo/form/control/panel/test1.js +20 -41
  27. package/dist/app/demo/form/control/pdf/pdf.js +7 -20
  28. package/dist/app/demo/form/control/progress/progress.js +3 -12
  29. package/dist/app/demo/form/control/radio/radio.js +6 -17
  30. package/dist/app/demo/form/control/select/select.js +28 -41
  31. package/dist/app/demo/form/control/switch/switch.js +3 -14
  32. package/dist/app/demo/form/control/tab/tab.js +7 -18
  33. package/dist/app/demo/form/control/table/table.js +8 -23
  34. package/dist/app/demo/form/control/text/text.js +2 -13
  35. package/dist/app/demo/form/control/tuieditor/tuieditor.js +7 -18
  36. package/dist/app/demo/form/control/uploader/uploader.js +20 -31
  37. package/dist/app/demo/form/control/vflow/vflow.js +2 -13
  38. package/dist/app/demo/form/event/form/form.js +11 -22
  39. package/dist/app/demo/form/event/task/task.js +14 -29
  40. package/dist/app/demo/form/main.js +381 -387
  41. package/dist/app/demo/form/main.xml +3 -0
  42. package/dist/app/demo/form/method/acontrol/acontrol.js +2 -13
  43. package/dist/app/demo/form/method/aform/aform.js +41 -60
  44. package/dist/app/demo/form/method/aform/sd.js +3 -14
  45. package/dist/app/demo/form/method/core/core.js +25 -50
  46. package/dist/app/demo/form/method/dom/dom.js +35 -58
  47. package/dist/app/demo/form/method/form/form.js +106 -149
  48. package/dist/app/demo/form/method/fs/fs.js +126 -147
  49. package/dist/app/demo/form/method/native/native.js +44 -72
  50. package/dist/app/demo/form/method/storage/storage.js +9 -27
  51. package/dist/app/demo/form/method/system/system.js +16 -41
  52. package/dist/app/demo/form/method/task/task.js +18 -37
  53. package/dist/app/demo/form/method/theme/theme.js +39 -54
  54. package/dist/app/demo/form/method/tool/tool.js +22 -43
  55. package/dist/app/demo/form/method/tool/tool.xml +1 -1
  56. package/dist/app/demo/form/method/zip/zip.js +18 -29
  57. package/dist/app/demo/form/solution/backpanel/backpanel.js +10 -23
  58. package/dist/app/task/app.js +2 -13
  59. package/dist/app/task/form/bar/bar.js +32 -45
  60. package/dist/clickgo.js +1 -1
  61. package/dist/control/arteditor.cgc +0 -0
  62. package/dist/control/box.cgc +0 -0
  63. package/dist/control/captcha.cgc +0 -0
  64. package/dist/control/common.cgc +0 -0
  65. package/dist/control/desc.cgc +0 -0
  66. package/dist/control/drawer.cgc +0 -0
  67. package/dist/control/echarts.cgc +0 -0
  68. package/dist/control/form.cgc +0 -0
  69. package/dist/control/iconview.cgc +0 -0
  70. package/dist/control/jodit.cgc +0 -0
  71. package/dist/control/map.cgc +0 -0
  72. package/dist/control/monaco.cgc +0 -0
  73. package/dist/control/mpegts.cgc +0 -0
  74. package/dist/control/nav.cgc +0 -0
  75. package/dist/control/novnc.cgc +0 -0
  76. package/dist/control/page.cgc +0 -0
  77. package/dist/control/pdf.cgc +0 -0
  78. package/dist/control/property.cgc +0 -0
  79. package/dist/control/qrcode.cgc +0 -0
  80. package/dist/control/table.cgc +0 -0
  81. package/dist/control/task.cgc +0 -0
  82. package/dist/control/tplink.cgc +0 -0
  83. package/dist/control/tuieditor.cgc +0 -0
  84. package/dist/control/tuiviewer.cgc +0 -0
  85. package/dist/control/xterm.cgc +0 -0
  86. package/dist/index.js +59 -71
  87. package/dist/lib/control.js +213 -235
  88. package/dist/lib/core.js +356 -379
  89. package/dist/lib/dom.js +62 -91
  90. package/dist/lib/form.js +834 -906
  91. package/dist/lib/fs.js +834 -892
  92. package/dist/lib/native.js +32 -63
  93. package/dist/lib/storage.js +21 -33
  94. package/dist/lib/task.js +1054 -1098
  95. package/dist/lib/theme.js +102 -121
  96. package/dist/lib/tool.js +65 -98
  97. package/dist/lib/zip.js +27 -42
  98. package/dist/theme/blue.cgt +0 -0
  99. package/dist/theme/byterun.cgt +0 -0
  100. package/dist/theme/dark.cgt +0 -0
  101. package/dist/theme/light.cgt +0 -0
  102. package/package.json +1 -1
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
@@ -49,80 +40,61 @@ class default_1 extends clickgo.form.AbstractForm {
49
40
  this.val = 'test';
50
41
  this.activating = false;
51
42
  }
52
- getListenerList() {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- yield clickgo.form.dialog(JSON.stringify(clickgo.native.getListenerList()));
55
- });
43
+ async getListenerList() {
44
+ await clickgo.form.dialog(JSON.stringify(clickgo.native.getListenerList()));
56
45
  }
57
- max() {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- yield clickgo.native.max();
60
- });
46
+ async max() {
47
+ await clickgo.native.max();
61
48
  }
62
- min() {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- yield clickgo.native.min();
65
- });
49
+ async min() {
50
+ await clickgo.native.min();
66
51
  }
67
- activate() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- if (this.activating) {
70
- return;
71
- }
72
- this.activating = true;
73
- yield clickgo.tool.sleep(2000);
74
- yield clickgo.native.activate();
75
- this.activating = false;
76
- });
52
+ async activate() {
53
+ if (this.activating) {
54
+ return;
55
+ }
56
+ this.activating = true;
57
+ await clickgo.tool.sleep(2_000);
58
+ await clickgo.native.activate();
59
+ this.activating = false;
77
60
  }
78
- ping() {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- var _a;
81
- yield clickgo.form.dialog((_a = yield clickgo.native.ping(this.val)) !== null && _a !== void 0 ? _a : 'undefined');
82
- });
61
+ async ping() {
62
+ await clickgo.form.dialog(await clickgo.native.ping(this.val) ?? 'undefined');
83
63
  }
84
- isMax() {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- yield clickgo.form.dialog((yield clickgo.native.isMax()) ? 'true' : 'false');
87
- });
64
+ async isMax() {
65
+ await clickgo.form.dialog(await clickgo.native.isMax() ? 'true' : 'false');
88
66
  }
89
- open() {
90
- return __awaiter(this, void 0, void 0, function* () {
91
- const rtn = yield clickgo.native.open({
92
- 'filters': [
93
- {
94
- 'name': 'Image',
95
- 'accept': ['jpg', 'png'],
96
- },
97
- ],
98
- });
99
- yield clickgo.form.dialog(JSON.stringify(rtn));
67
+ async open() {
68
+ const rtn = await clickgo.native.open({
69
+ 'filters': [
70
+ {
71
+ 'name': 'Image',
72
+ 'accept': ['jpg', 'png'],
73
+ },
74
+ ],
100
75
  });
76
+ await clickgo.form.dialog(JSON.stringify(rtn));
101
77
  }
102
- save() {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- const rtn = yield clickgo.native.save({
105
- 'filters': [
106
- {
107
- 'name': 'Image',
108
- 'accept': ['jpg', 'png'],
109
- },
110
- ],
111
- });
112
- yield clickgo.form.dialog(JSON.stringify(rtn));
78
+ async save() {
79
+ const rtn = await clickgo.native.save({
80
+ 'filters': [
81
+ {
82
+ 'name': 'Image',
83
+ 'accept': ['jpg', 'png'],
84
+ },
85
+ ],
113
86
  });
87
+ await clickgo.form.dialog(JSON.stringify(rtn));
114
88
  }
115
- dialog(opts) {
116
- return __awaiter(this, void 0, void 0, function* () {
117
- const rtn = yield clickgo.native.dialog({
118
- 'title': opts.title,
119
- 'message': opts.message,
120
- 'type': opts.type,
121
- 'detail': opts.detail,
122
- 'buttons': opts.buttons,
123
- });
124
- yield clickgo.form.dialog(JSON.stringify(rtn));
89
+ async dialog(opts) {
90
+ const rtn = await clickgo.native.dialog({
91
+ 'title': opts.title,
92
+ 'message': opts.message,
93
+ 'type': opts.type,
94
+ 'detail': opts.detail,
95
+ 'buttons': opts.buttons,
125
96
  });
97
+ await clickgo.form.dialog(JSON.stringify(rtn));
126
98
  }
127
99
  }
128
100
  exports.default = default_1;
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
@@ -51,22 +42,15 @@ class default_1 extends clickgo.form.AbstractForm {
51
42
  this.list = [];
52
43
  this.ppath = '';
53
44
  }
54
- get() {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- var _a;
57
- yield clickgo.form.dialog((_a = clickgo.storage.get(this.key)) !== null && _a !== void 0 ? _a : 'null');
58
- });
45
+ async get() {
46
+ await clickgo.form.dialog(clickgo.storage.get(this.key) ?? 'null');
59
47
  }
60
- set() {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- clickgo.storage.set(this.key, this.val);
63
- yield clickgo.form.dialog('done');
64
- });
48
+ async set() {
49
+ clickgo.storage.set(this.key, this.val);
50
+ await clickgo.form.dialog('done');
65
51
  }
66
- remove() {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- yield clickgo.form.dialog(clickgo.storage.remove(this.key) ? 'true' : 'false');
69
- });
52
+ async remove() {
53
+ await clickgo.form.dialog(clickgo.storage.remove(this.key) ? 'true' : 'false');
70
54
  }
71
55
  getlist() {
72
56
  this.list.length = 0;
@@ -86,10 +70,8 @@ class default_1 extends clickgo.form.AbstractForm {
86
70
  this.list.push(key + ': ' + obj[key].toString() + ' Bytes');
87
71
  }
88
72
  }
89
- clear() {
90
- return __awaiter(this, void 0, void 0, function* () {
91
- yield clickgo.form.dialog('Removed ' + (yield clickgo.storage.clear(this.ppath)).toString() + ' items.');
92
- });
73
+ async clear() {
74
+ await clickgo.form.dialog('Removed ' + (await clickgo.storage.clear(this.ppath)).toString() + ' items.');
93
75
  }
94
76
  }
95
77
  exports.default = default_1;
@@ -32,57 +32,32 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
47
- getVersion() {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- yield clickgo.form.dialog('Version: ' + clickgo.getVersion());
50
- });
38
+ async getVersion() {
39
+ await clickgo.form.dialog('Version: ' + clickgo.getVersion());
51
40
  }
52
- isNative() {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- yield clickgo.form.dialog('Native: ' + (clickgo.isNative() ? 'true' : 'false'));
55
- });
41
+ async isNative() {
42
+ await clickgo.form.dialog('Native: ' + (clickgo.isNative() ? 'true' : 'false'));
56
43
  }
57
- getPlatform() {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- yield clickgo.form.dialog('Platform: ' + clickgo.getPlatform());
60
- });
44
+ async getPlatform() {
45
+ await clickgo.form.dialog('Platform: ' + clickgo.getPlatform());
61
46
  }
62
- getDevice() {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- yield clickgo.form.dialog('Device: ' + JSON.stringify(clickgo.getDevice()));
65
- });
47
+ async getDevice() {
48
+ await clickgo.form.dialog('Device: ' + JSON.stringify(clickgo.getDevice()));
66
49
  }
67
- isImmersion() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- yield clickgo.form.dialog('Immersion: ' + (clickgo.isImmersion() ? 'true' : 'false'));
70
- });
50
+ async isImmersion() {
51
+ await clickgo.form.dialog('Immersion: ' + (clickgo.isImmersion() ? 'true' : 'false'));
71
52
  }
72
- hasFrame() {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- yield clickgo.form.dialog('hasFrame: ' + (clickgo.hasFrame() ? 'true' : 'false'));
75
- });
53
+ async hasFrame() {
54
+ await clickgo.form.dialog('hasFrame: ' + (clickgo.hasFrame() ? 'true' : 'false'));
76
55
  }
77
- ls() {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- yield clickgo.form.dialog('typeof localStorage: ' + typeof localStorage);
80
- });
56
+ async ls() {
57
+ await clickgo.form.dialog('typeof localStorage: ' + typeof localStorage);
81
58
  }
82
- map() {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- yield clickgo.form.dialog('typeof Map: ' + typeof Map);
85
- });
59
+ async map() {
60
+ await clickgo.form.dialog('typeof Map: ' + typeof Map);
86
61
  }
87
62
  }
88
63
  exports.default = default_1;
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
@@ -132,34 +123,24 @@ class default_1 extends clickgo.form.AbstractForm {
132
123
  msg = msg.replace(/(data:image\/).+?"/g, '$1..."');
133
124
  clickgo.form.dialog(msg).catch((e) => { throw e; });
134
125
  }
135
- run() {
136
- return __awaiter(this, void 0, void 0, function* () {
137
- const tid = yield clickgo.task.run('/clickgo/app/demo/');
138
- yield clickgo.form.dialog('Task ID: ' + tid.toString());
139
- });
140
- }
141
- checkPermission(val) {
142
- return __awaiter(this, void 0, void 0, function* () {
143
- const rtn = yield clickgo.task.checkPermission(val, true);
144
- yield clickgo.form.dialog(rtn[0] ? 'Succeed' : 'Failed');
145
- });
146
- }
147
- end() {
148
- return __awaiter(this, void 0, void 0, function* () {
149
- yield clickgo.form.dialog('Result: ' + (clickgo.task.end(parseInt(this.tid)) ? 'true' : 'false'));
150
- });
151
- }
152
- loadLocale(lang, path) {
153
- return __awaiter(this, void 0, void 0, function* () {
154
- const r = yield clickgo.task.loadLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
155
- yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
156
- });
157
- }
158
- setLocale(lang, path) {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- const r = yield clickgo.task.setLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
161
- yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
162
- });
126
+ async run() {
127
+ const tid = await clickgo.task.run('/clickgo/app/demo/');
128
+ await clickgo.form.dialog('Task ID: ' + tid.toString());
129
+ }
130
+ async checkPermission(val) {
131
+ const rtn = await clickgo.task.checkPermission(val, true);
132
+ await clickgo.form.dialog(rtn[0] ? 'Succeed' : 'Failed');
133
+ }
134
+ async end() {
135
+ await clickgo.form.dialog('Result: ' + (clickgo.task.end(parseInt(this.tid)) ? 'true' : 'false'));
136
+ }
137
+ async loadLocale(lang, path) {
138
+ const r = await clickgo.task.loadLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
139
+ await clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
140
+ }
141
+ async setLocale(lang, path) {
142
+ const r = await clickgo.task.setLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
143
+ await clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
163
144
  }
164
145
  clearLocale() {
165
146
  clickgo.task.clearLocale();
@@ -32,50 +32,37 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
47
- get(name) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const f = yield clickgo.fs.getContent('/clickgo/theme/' + name + '.cgt');
50
- if (!f) {
51
- return null;
52
- }
53
- if (typeof f === 'string') {
54
- return null;
55
- }
56
- const t = yield clickgo.theme.read(f);
57
- if (!t) {
58
- return null;
59
- }
60
- return t;
61
- });
38
+ async get(name) {
39
+ const f = await clickgo.fs.getContent('/clickgo/theme/' + name + '.cgt');
40
+ if (!f) {
41
+ return null;
42
+ }
43
+ if (typeof f === 'string') {
44
+ return null;
45
+ }
46
+ const t = await clickgo.theme.read(f);
47
+ if (!t) {
48
+ return null;
49
+ }
50
+ return t;
62
51
  }
63
- load() {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- const n = clickgo.form.notify({
66
- 'title': 'Info',
67
- 'content': 'Theme loading...',
68
- 'type': 'info'
69
- });
70
- const t = yield this.get('blue');
71
- if (!t) {
72
- clickgo.form.hideNotify(n);
73
- return;
74
- }
75
- clickgo.form.hideNotify(n);
76
- const r = yield clickgo.theme.load(t);
77
- yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
52
+ async load() {
53
+ const n = clickgo.form.notify({
54
+ 'title': 'Info',
55
+ 'content': 'Theme loading...',
56
+ 'type': 'info'
78
57
  });
58
+ const t = await this.get('blue');
59
+ if (!t) {
60
+ clickgo.form.hideNotify(n);
61
+ return;
62
+ }
63
+ clickgo.form.hideNotify(n);
64
+ const r = await clickgo.theme.load(t);
65
+ await clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
79
66
  }
80
67
  remove() {
81
68
  clickgo.theme.remove('blue').catch((e) => { throw e; });
@@ -83,22 +70,20 @@ class default_1 extends clickgo.form.AbstractForm {
83
70
  clear() {
84
71
  clickgo.theme.clear().catch((e) => { throw e; });
85
72
  }
86
- setGlobal(name) {
87
- return __awaiter(this, void 0, void 0, function* () {
88
- const n = clickgo.form.notify({
89
- 'title': 'Info',
90
- 'content': 'Theme loading...',
91
- 'type': 'info'
92
- });
93
- const t = yield this.get(name);
94
- if (!t) {
95
- clickgo.form.hideNotify(n);
96
- return;
97
- }
98
- clickgo.form.hideNotify(n);
99
- yield clickgo.theme.setGlobal(t);
100
- yield clickgo.form.dialog('Done.');
73
+ async setGlobal(name) {
74
+ const n = clickgo.form.notify({
75
+ 'title': 'Info',
76
+ 'content': 'Theme loading...',
77
+ 'type': 'info'
101
78
  });
79
+ const t = await this.get(name);
80
+ if (!t) {
81
+ clickgo.form.hideNotify(n);
82
+ return;
83
+ }
84
+ clickgo.form.hideNotify(n);
85
+ await clickgo.theme.setGlobal(t);
86
+ await clickgo.form.dialog('Done.');
102
87
  }
103
88
  clearGlobal() {
104
89
  clickgo.theme.clearGlobal();
@@ -32,15 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  const clickgo = __importStar(require("clickgo"));
46
37
  class default_1 extends clickgo.form.AbstractForm {
@@ -80,15 +71,13 @@ class default_1 extends clickgo.form.AbstractForm {
80
71
  this.weight = '8761';
81
72
  this.qs = 'a=1&b=2&c=3';
82
73
  }
83
- sleep() {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- if (this.sleeping) {
86
- return;
87
- }
88
- this.sleeping = true;
89
- yield clickgo.tool.sleep(1000);
90
- this.sleeping = false;
91
- });
74
+ async sleep() {
75
+ if (this.sleeping) {
76
+ return;
77
+ }
78
+ this.sleeping = true;
79
+ await clickgo.tool.sleep(1000);
80
+ this.sleeping = false;
92
81
  }
93
82
  purify() {
94
83
  this.purifyTxt = clickgo.tool.purify(this.purifyTxt);
@@ -96,15 +85,13 @@ class default_1 extends clickgo.form.AbstractForm {
96
85
  rand() {
97
86
  clickgo.form.dialog(clickgo.tool.rand(parseInt(this.min), parseInt(this.max)).toString()).catch((e) => { throw e; });
98
87
  }
99
- random() {
100
- return __awaiter(this, void 0, void 0, function* () {
101
- yield clickgo.form.dialog({
102
- 'direction': 'v',
103
- 'content': '<text modelValue="' + clickgo.tool.random(parseInt(this.length), clickgo.tool.RANDOM_LUN, this.block) + '" readonly />',
104
- 'data': {
105
- 'txt': 'Text\nLine 2.'
106
- }
107
- });
88
+ async random() {
89
+ await clickgo.form.dialog({
90
+ 'direction': 'v',
91
+ 'content': '<text modelValue="' + clickgo.tool.random(parseInt(this.length), clickgo.tool.RANDOM_LUN, this.block) + '" readonly />',
92
+ 'data': {
93
+ 'txt': 'Text\nLine 2.'
94
+ }
108
95
  });
109
96
  }
110
97
  escapeHTML() {
@@ -119,25 +106,17 @@ class default_1 extends clickgo.form.AbstractForm {
119
106
  urlResolve() {
120
107
  clickgo.form.dialog(clickgo.tool.urlResolve(this.url1, this.url2)).catch((e) => { throw e; });
121
108
  }
122
- formatSecond() {
123
- return __awaiter(this, void 0, void 0, function* () {
124
- yield clickgo.form.dialog(clickgo.tool.formatSecond(parseInt(this.second) || 0));
125
- });
109
+ async formatSecond() {
110
+ await clickgo.form.dialog(clickgo.tool.formatSecond(parseInt(this.second) || 0));
126
111
  }
127
- weightFormat() {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- yield clickgo.form.dialog(clickgo.tool.weightFormat(parseInt(this.weight) || 0));
130
- });
112
+ async weightFormat() {
113
+ await clickgo.form.dialog(clickgo.tool.weightFormat(parseInt(this.weight) || 0));
131
114
  }
132
- queryParse() {
133
- return __awaiter(this, void 0, void 0, function* () {
134
- yield clickgo.form.dialog(JSON.stringify(clickgo.tool.queryParse(this.qs)));
135
- });
115
+ async queryParse() {
116
+ await clickgo.form.dialog(JSON.stringify(clickgo.tool.queryParse(this.qs)));
136
117
  }
137
- queryStringify() {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- yield clickgo.form.dialog(clickgo.tool.queryStringify({ 'a': 1, 'b': 'c' }));
140
- });
118
+ async queryStringify() {
119
+ await clickgo.form.dialog(clickgo.tool.queryStringify({ 'a': 1, 'b': 'c' }));
141
120
  }
142
121
  }
143
122
  exports.default = default_1;
@@ -10,7 +10,7 @@
10
10
  <button @click="rand">rand({{min}}, {{max}})</button>
11
11
  </layout>
12
12
  <layout gutter="10">
13
- <text v-model="length" style="width: 30px;"></text>
13
+ <text v-model="length" style="width: 60px;"></text>
14
14
  <text v-model="block" style="flex: 1;"></text>
15
15
  <button @click="random">random({{length}}, RANDOM_LUN, '{{block}}')</button>
16
16
  </layout>