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 {
@@ -52,11 +43,11 @@ class default_1 extends clickgo.form.AbstractForm {
52
43
  this.v4 = ['default'];
53
44
  }
54
45
  onMounted() {
55
- clickgo.tool.sleep(500).then(() => __awaiter(this, void 0, void 0, function* () {
46
+ clickgo.tool.sleep(500).then(async () => {
56
47
  this.v2 = 40;
57
- yield clickgo.tool.sleep(500);
48
+ await clickgo.tool.sleep(500);
58
49
  this.v2 = 70;
59
- })).catch(() => {
50
+ }).catch(() => {
60
51
  });
61
52
  }
62
53
  }
@@ -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,14 +40,12 @@ class default_1 extends clickgo.form.AbstractForm {
49
40
  this.value = 'radio1';
50
41
  this.disabled = false;
51
42
  }
52
- onChange(e) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- if (e.detail.selected !== 'radio2') {
55
- return;
56
- }
57
- e.preventDefault();
58
- yield clickgo.form.dialog('selected: ' + e.detail.selected + ', value: ' + e.detail.value);
59
- });
43
+ async onChange(e) {
44
+ if (e.detail.selected !== 'radio2') {
45
+ return;
46
+ }
47
+ e.preventDefault();
48
+ await clickgo.form.dialog('selected: ' + e.detail.selected + ', value: ' + e.detail.value);
60
49
  }
61
50
  }
62
51
  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 {
@@ -82,8 +73,8 @@ class default_1 extends clickgo.form.AbstractForm {
82
73
  'label': 'tip',
83
74
  'color': 'tip'
84
75
  }, 'haha4', {
85
- 'value': 'ha5',
86
- 'label': 'The value is ha5'
76
+ 'value': 'hA5',
77
+ 'label': 'The value is hA5'
87
78
  }, {
88
79
  'value': 'ha6',
89
80
  'label': 'Can not be selected',
@@ -160,21 +151,19 @@ class default_1 extends clickgo.form.AbstractForm {
160
151
  }
161
152
  return rtn;
162
153
  }
163
- onLoad(value, resolve) {
164
- return __awaiter(this, void 0, void 0, function* () {
165
- if (value !== 'haha4') {
166
- yield clickgo.tool.sleep(100);
167
- if (value === 'haha2') {
168
- resolve(['60']);
169
- }
170
- else {
171
- resolve();
172
- }
173
- return;
154
+ async onLoad(value, resolve) {
155
+ if (value !== 'haha4') {
156
+ await clickgo.tool.sleep(100);
157
+ if (value === 'haha2') {
158
+ resolve(['60']);
174
159
  }
175
- yield clickgo.tool.sleep(300);
176
- resolve(['he', 'ha']);
177
- });
160
+ else {
161
+ resolve();
162
+ }
163
+ return;
164
+ }
165
+ await clickgo.tool.sleep(300);
166
+ resolve(['he', 'ha']);
178
167
  }
179
168
  onLoaded() {
180
169
  clickgo.form.notify({
@@ -183,21 +172,19 @@ class default_1 extends clickgo.form.AbstractForm {
183
172
  'content': 'Done'
184
173
  });
185
174
  }
186
- onRemote(e) {
187
- return __awaiter(this, void 0, void 0, function* () {
188
- yield clickgo.tool.sleep(300);
189
- if (!e.detail.value || e.detail.value === '8') {
190
- yield e.detail.callback();
191
- return;
192
- }
193
- yield e.detail.callback(['test', e.detail.value, 'remote', {
194
- 'label': 'label',
195
- 'value': 'ok'
196
- }, {
197
- 'label': 'label2',
198
- 'value': 2
199
- }]);
200
- });
175
+ async onRemote(e) {
176
+ await clickgo.tool.sleep(300);
177
+ if (!e.detail.value || e.detail.value === '8') {
178
+ await e.detail.callback();
179
+ return;
180
+ }
181
+ await e.detail.callback(['test', e.detail.value, 'remote', {
182
+ 'label': 'label',
183
+ 'value': 'ok'
184
+ }, {
185
+ 'label': 'label2',
186
+ 'value': 2
187
+ }]);
201
188
  }
202
189
  onGAdd(e) {
203
190
  clickgo.form.notify({
@@ -241,7 +228,7 @@ class default_1 extends clickgo.form.AbstractForm {
241
228
  }
242
229
  }
243
230
  onChanged(e) {
244
- console.log('onChanged', e);
231
+ console.log('onChanged', JSON.stringify(e, null, 4));
245
232
  }
246
233
  onTagclick(e) {
247
234
  this.addRemoveList.unshift('@tagclick, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
@@ -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 {
@@ -54,11 +45,9 @@ class default_1 extends clickgo.form.AbstractForm {
54
45
  this.disabled = false;
55
46
  this.size = ['m'];
56
47
  }
57
- onChange(e) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- e.preventDefault();
60
- yield clickgo.form.dialog('v: ' + (e.detail.value ? 'true' : 'false'));
61
- });
48
+ async onChange(e) {
49
+ e.preventDefault();
50
+ await clickgo.form.dialog('v: ' + (e.detail.value ? 'true' : 'false'));
62
51
  }
63
52
  }
64
53
  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 {
@@ -58,15 +49,13 @@ class default_1 extends clickgo.form.AbstractForm {
58
49
  this.drag = false;
59
50
  this.cclose = false;
60
51
  }
61
- onClose(e) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- if (e.detail.index !== 10) {
64
- yield clickgo.form.dialog('Closed, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
65
- return;
66
- }
67
- e.preventDefault();
68
- yield clickgo.form.dialog('The tab can not be close.');
69
- });
52
+ async onClose(e) {
53
+ if (e.detail.index !== 10) {
54
+ await clickgo.form.dialog('Closed, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
55
+ return;
56
+ }
57
+ e.preventDefault();
58
+ await clickgo.form.dialog('The tab can not be close.');
70
59
  }
71
60
  add() {
72
61
  const len = this.tabs.length;
@@ -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 {
@@ -118,10 +109,8 @@ class default_1 extends clickgo.form.AbstractForm {
118
109
  }
119
110
  return rtn;
120
111
  }
121
- onGesture(dir) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- yield clickgo.form.dialog('onGesture: ' + dir);
124
- });
112
+ async onGesture(dir) {
113
+ await clickgo.form.dialog('onGesture: ' + dir);
125
114
  }
126
115
  onSelect(area) {
127
116
  this.selectionArea = area;
@@ -137,9 +126,8 @@ class default_1 extends clickgo.form.AbstractForm {
137
126
  }
138
127
  if (this.sortinfo.index === (this.index ? 1 : 0)) {
139
128
  this.data.sort((a, b) => {
140
- var _a, _b;
141
- const aname = (_a = a.name) !== null && _a !== void 0 ? _a : 'name';
142
- const bname = (_b = b.name) !== null && _b !== void 0 ? _b : 'name';
129
+ const aname = a.name ?? 'name';
130
+ const bname = b.name ?? 'name';
143
131
  if (this.sortinfo.sort === 'asc') {
144
132
  return aname.localeCompare(bname);
145
133
  }
@@ -150,9 +138,8 @@ class default_1 extends clickgo.form.AbstractForm {
150
138
  return;
151
139
  }
152
140
  this.data.sort((a, b) => {
153
- var _a, _b;
154
- const atype = (_a = a.type) !== null && _a !== void 0 ? _a : 0;
155
- const btype = (_b = b.type) !== null && _b !== void 0 ? _b : 0;
141
+ const atype = a.type ?? 0;
142
+ const btype = b.type ?? 0;
156
143
  if (this.sortinfo.sort === 'asc') {
157
144
  return atype - btype;
158
145
  }
@@ -161,10 +148,8 @@ class default_1 extends clickgo.form.AbstractForm {
161
148
  }
162
149
  });
163
150
  }
164
- showIndex() {
165
- return __awaiter(this, void 0, void 0, function* () {
166
- yield clickgo.form.dialog('Index is ' + this.val[0].toString() + '.');
167
- });
151
+ async showIndex() {
152
+ await clickgo.form.dialog('Index is ' + this.val[0].toString() + '.');
168
153
  }
169
154
  scrollChange() {
170
155
  switch (this.scroll) {
@@ -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 {
@@ -103,10 +94,8 @@ long`;
103
94
  this.long = !this.long;
104
95
  this.scrollTop = 0;
105
96
  }
106
- onGesture(dir) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- yield clickgo.form.dialog('onGesture: ' + dir);
109
- });
97
+ async onGesture(dir) {
98
+ await clickgo.form.dialog('onGesture: ' + dir);
110
99
  }
111
100
  onBeforechange(e) {
112
101
  if (!this.beforechange) {
@@ -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
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
37
  };
@@ -59,15 +50,13 @@ class default_1 extends clickgo.form.AbstractForm {
59
50
  this.text = 'a**b**c';
60
51
  this.html = '';
61
52
  }
62
- imgselect(cb) {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- const frm = yield clickgo.form.create(img_1.default);
65
- const path = yield frm.showDialog();
66
- if (!path) {
67
- return;
68
- }
69
- cb('https://cdn.jsdelivr.net/npm/clickgo@3.7.0/dist/app/demo/' + path);
70
- });
53
+ async imgselect(cb) {
54
+ const frm = await clickgo.form.create(img_1.default);
55
+ const path = await frm.showDialog();
56
+ if (!path) {
57
+ return;
58
+ }
59
+ cb('https://cdn.jsdelivr.net/npm/clickgo@3.7.0/dist/app/demo/' + path);
71
60
  }
72
61
  }
73
62
  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
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
37
  };
@@ -62,30 +53,28 @@ class default_1 extends clickgo.form.AbstractForm {
62
53
  this.length = ['7'];
63
54
  this.progress = undefined;
64
55
  }
65
- select() {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const frm = yield clickgo.form.create(img_1.default);
68
- const path = yield frm.showDialog();
69
- if (!path) {
56
+ async select() {
57
+ const frm = await clickgo.form.create(img_1.default);
58
+ const path = await frm.showDialog();
59
+ if (!path) {
60
+ return;
61
+ }
62
+ this.progress = 0;
63
+ const timer = clickgo.task.createTimer(async () => {
64
+ if (this.progress === undefined) {
65
+ clickgo.task.removeTimer(timer);
70
66
  return;
71
67
  }
72
- this.progress = 0;
73
- const timer = clickgo.task.createTimer(() => __awaiter(this, void 0, void 0, function* () {
74
- if (this.progress === undefined) {
75
- clickgo.task.removeTimer(timer);
76
- return;
77
- }
78
- this.progress += clickgo.tool.rand(0, 70);
79
- if (this.progress < 100) {
80
- return;
81
- }
82
- this.progress = 100;
83
- clickgo.task.removeTimer(timer);
84
- yield clickgo.tool.sleep(500);
85
- this.progress = undefined;
86
- this.list.push(path);
87
- }), 500);
88
- });
68
+ this.progress += clickgo.tool.rand(0, 70);
69
+ if (this.progress < 100) {
70
+ return;
71
+ }
72
+ this.progress = 100;
73
+ clickgo.task.removeTimer(timer);
74
+ await clickgo.tool.sleep(500);
75
+ this.progress = undefined;
76
+ this.list.push(path);
77
+ }, 500);
89
78
  }
90
79
  }
91
80
  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 {
@@ -103,10 +94,8 @@ class default_1 extends clickgo.form.AbstractForm {
103
94
  }
104
95
  return is;
105
96
  }
106
- onGesture(dir) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- yield clickgo.form.dialog('onGesture: ' + dir);
109
- });
97
+ async onGesture(dir) {
98
+ await clickgo.form.dialog('onGesture: ' + dir);
110
99
  }
111
100
  }
112
101
  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 {
@@ -148,19 +139,17 @@ class default_1 extends clickgo.form.AbstractForm {
148
139
  this.flist[formId].focus = false;
149
140
  this.pushConsole('formBlurred', `taskId: ${taskId}, formId: ${formId}`);
150
141
  }
151
- onFormFlash(taskId, formId) {
152
- return __awaiter(this, void 0, void 0, function* () {
153
- if (!this.flist[formId]) {
154
- return;
155
- }
156
- if (this.flist[formId].flash) {
157
- clickgo.task.removeTimer(this.flist[formId].flash);
158
- }
159
- this.pushConsole('formFlash', `taskId: ${taskId}, formId: ${formId}`);
160
- this.flist[formId].flash = true;
161
- yield clickgo.tool.sleep(1000);
162
- this.flist[formId].flash = false;
163
- });
142
+ async onFormFlash(taskId, formId) {
143
+ if (!this.flist[formId]) {
144
+ return;
145
+ }
146
+ if (this.flist[formId].flash) {
147
+ clickgo.task.removeTimer(this.flist[formId].flash);
148
+ }
149
+ this.pushConsole('formFlash', `taskId: ${taskId}, formId: ${formId}`);
150
+ this.flist[formId].flash = true;
151
+ await clickgo.tool.sleep(1000);
152
+ this.flist[formId].flash = false;
164
153
  }
165
154
  onFormShowInSystemTaskChange(taskId, formId, value) {
166
155
  if (!this.flist[formId]) {
@@ -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 {
@@ -58,28 +49,22 @@ class default_1 extends clickgo.form.AbstractForm {
58
49
  'text': text
59
50
  });
60
51
  }
61
- run() {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const taskId = yield clickgo.task.run('/clickgo/app/demo/');
64
- yield clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
65
- });
52
+ async run() {
53
+ const taskId = await clickgo.task.run('/clickgo/app/demo/');
54
+ await clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
66
55
  }
67
- end() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- if (yield clickgo.form.confirm(`Are you sure to end Task ${this.tid[0]}?`)) {
70
- clickgo.task.end(this.tid[0]);
71
- }
72
- });
56
+ async end() {
57
+ if (await clickgo.form.confirm(`Are you sure to end Task ${this.tid[0]}?`)) {
58
+ clickgo.task.end(this.tid[0]);
59
+ }
73
60
  }
74
- runTask() {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- if (clickgo.task.systemTaskInfo.taskId > 0) {
77
- yield clickgo.form.dialog('The Task APP is already running.');
78
- return;
79
- }
80
- const taskId = yield clickgo.task.run('/clickgo/app/task/');
81
- yield clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
82
- });
61
+ async runTask() {
62
+ if (clickgo.task.systemTaskInfo.taskId > 0) {
63
+ await clickgo.form.dialog('The Task APP is already running.');
64
+ return;
65
+ }
66
+ const taskId = await clickgo.task.run('/clickgo/app/task/');
67
+ await clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
83
68
  }
84
69
  onTaskStarted(taskId) {
85
70
  this.tlist.push({