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 {
@@ -131,6 +122,7 @@ class default_1 extends clickgo.form.AbstractForm {
131
122
  ]
132
123
  }
133
124
  ];
125
+ this.listData6 = ['1', '2', '3', '4', '5'];
134
126
  this.listMap5 = undefined;
135
127
  this.listData5Index = false;
136
128
  this.disabledList = [];
@@ -178,19 +170,17 @@ class default_1 extends clickgo.form.AbstractForm {
178
170
  return rtn;
179
171
  }
180
172
  get adData() {
181
- var _a;
182
173
  const data = [];
183
174
  for (let i = 0; i < this.slist.length; ++i) {
184
175
  const item = this.slist[i];
185
176
  data.push({
186
- 'type': (_a = item.type) !== null && _a !== void 0 ? _a : 'split',
177
+ 'type': item.type ?? 'split',
187
178
  'menu': i === 20 ? true : false
188
179
  });
189
180
  }
190
181
  return data;
191
182
  }
192
183
  get listData() {
193
- var _a;
194
184
  const data = ['Item1', {
195
185
  'label': 'Tip',
196
186
  'color': 'tip',
@@ -222,7 +212,7 @@ class default_1 extends clickgo.form.AbstractForm {
222
212
  for (let k = 0; k < this.slist.length; ++k) {
223
213
  if (this.slist[k].name) {
224
214
  data.push({
225
- 'label': `index: ${k}, value: ${(_a = this.slist[k].name) !== null && _a !== void 0 ? _a : ''}${(k === 20 ? ' long test long test long test long test long test' : '')}`,
215
+ 'label': `index: ${k}, value: ${this.slist[k].name ?? ''}${(k === 20 ? ' long test long test long test long test long test' : '')}`,
226
216
  'value': this.slist[k].name,
227
217
  'disabled': this.slist[k].disabled
228
218
  });
@@ -277,21 +267,23 @@ class default_1 extends clickgo.form.AbstractForm {
277
267
  selectButtonList() {
278
268
  this.select2 = ['Sub3'];
279
269
  }
280
- onSelectLoad(value, resolve) {
281
- return __awaiter(this, void 0, void 0, function* () {
282
- if (value !== 'Sub6') {
283
- yield clickgo.tool.sleep(100);
284
- if (value === 'Sub8') {
285
- resolve(['Sub9', 'Sub10']);
286
- }
287
- else {
288
- resolve();
289
- }
290
- return;
270
+ async onSelectLoad(value, resolve) {
271
+ if (value !== 'Sub6') {
272
+ await clickgo.tool.sleep(100);
273
+ if (value === 'Sub8') {
274
+ resolve(['Sub9', 'Sub10']);
291
275
  }
292
- yield clickgo.tool.sleep(300);
293
- this.sub6children = ['Sub7', 'Sub8'];
294
- });
276
+ else {
277
+ resolve();
278
+ }
279
+ return;
280
+ }
281
+ await clickgo.tool.sleep(300);
282
+ this.sub6children = ['Sub7', 'Sub8'];
283
+ }
284
+ async onList6Load(value, resolve) {
285
+ await clickgo.tool.sleep(300);
286
+ resolve();
295
287
  }
296
288
  onSelect(area) {
297
289
  this.selectionArea = area;
@@ -311,10 +303,8 @@ class default_1 extends clickgo.form.AbstractForm {
311
303
  }
312
304
  }
313
305
  }
314
- onGesture(dir) {
315
- return __awaiter(this, void 0, void 0, function* () {
316
- yield clickgo.form.dialog('onGesture: ' + dir);
317
- });
306
+ async onGesture(dir) {
307
+ await clickgo.form.dialog('onGesture: ' + dir);
318
308
  }
319
309
  onGAdd(e) {
320
310
  clickgo.form.notify({
@@ -359,27 +349,25 @@ class default_1 extends clickgo.form.AbstractForm {
359
349
  this.listMap5 = { 'label': 'name', 'value': 'id', 'children': 'sub', 'disabled': 'disabled1' };
360
350
  }
361
351
  }
362
- onlist5Load(value, resolve) {
363
- return __awaiter(this, void 0, void 0, function* () {
364
- if (value === '4') {
365
- yield clickgo.tool.sleep(100);
366
- resolve([
367
- {
368
- 'name': 'hi5',
369
- 'name2': 'xhi5',
370
- 'id': '5'
371
- },
372
- {
373
- 'name': 'hi6',
374
- 'name2': 'xhi6',
375
- 'id': '6'
376
- }
377
- ]);
378
- return;
379
- }
380
- yield clickgo.tool.sleep(300);
381
- resolve();
382
- });
352
+ async onlist5Load(value, resolve) {
353
+ if (value === '4') {
354
+ await clickgo.tool.sleep(100);
355
+ resolve([
356
+ {
357
+ 'name': 'hi5',
358
+ 'name2': 'xhi5',
359
+ 'id': '5'
360
+ },
361
+ {
362
+ 'name': 'hi6',
363
+ 'name2': 'xhi6',
364
+ 'id': '6'
365
+ }
366
+ ]);
367
+ return;
368
+ }
369
+ await clickgo.tool.sleep(300);
370
+ resolve();
383
371
  }
384
372
  onMounted() {
385
373
  }
@@ -75,16 +75,26 @@
75
75
  <label v-else>{{disabledList}}</label>
76
76
  </layout>
77
77
  <layout direction="v" gutter="10" style="flex: 1; width: 0;">
78
- <list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" :mode="mode[0]" :data="listData5" :check="check" :map="listMap5" :tree="tree" :async="async" @load="onlist5Load" style="flex: 1;">
79
- <template v-slot:row="data">
80
- <layout gutter="10" align-v="center">
81
- <label style="flex: 1;">{{data.row.label}}</label>
82
- <button v-if="data.index === 1" @click="++data.row.data.count">abc({{data.row.data.count}})</button>
83
- </layout>
84
- </template>
85
- </list>
86
- <button v-if="listMap5===undefined" @click="listMap5={'label':'name','value':'id','children':'sub','disabled':'disabled1'}">Set map</button>
87
- <button v-if="listMap5!==undefined" @click="changelistData5Index">{{listData5Index ? '' : '!'}}index</button>
78
+ <layout direction="v" gutter="10" style="flex: 1; height: 0;">
79
+ <list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" :mode="mode[0]" :data="listData5" :check="check" :map="listMap5" :tree="tree" :async="async" @load="onlist5Load" style="flex: 1;">
80
+ <template v-slot:row="data">
81
+ <layout gutter="10" align-v="center">
82
+ <label style="flex: 1;">{{data.row.label}}</label>
83
+ <button v-if="data.index === 1" @click="++data.row.data.count">abc({{data.row.data.count}})</button>
84
+ </layout>
85
+ </template>
86
+ </list>
87
+ <button v-if="listMap5===undefined" @click="listMap5={'label':'name','value':'id','children':'sub','disabled':'disabled1'}">Set map</button>
88
+ <button v-if="listMap5!==undefined" @click="changelistData5Index">{{listData5Index ? '' : '!'}}index</button>
89
+ </layout>
90
+ <layout direction="v" gutter="10" style="flex: 1; height: 0;">
91
+ <list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" :mode="mode[0]" :data="listData6" :check="check" :tree="tree" :async="async" @load="onList6Load" style="flex: 1; height: 0;">
92
+ <template v-slot:row="data">
93
+ <label>{{data.row.label}}</label>
94
+ </template>
95
+ </list>
96
+ <button @click="listData6=['1','2','3','4','5']">Set data</button>
97
+ </layout>
88
98
  </layout>
89
99
  </layout>
90
100
  <label class="mtip">Right-click (computer) or press and hold (phone) to open the universal menu.</label>
@@ -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 {
@@ -97,25 +88,23 @@ class default_1 extends clickgo.form.AbstractForm {
97
88
  this.keyReal = this.key;
98
89
  this.factoryReal = this.factory[0];
99
90
  }
100
- markerAddGaoqiao(wgs) {
101
- return __awaiter(this, void 0, void 0, function* () {
102
- if (this.markers.length < 3) {
103
- yield clickgo.form.dialog('Please create at least 3 markers first.');
104
- return;
105
- }
106
- const lat = wgs ? 31.354737 : 31.352569;
107
- const lng = wgs ? 121.558717 : 121.56302;
108
- this.markers.push({
109
- 'lat': lat,
110
- 'lng': lng,
111
- 'title': 'Gaoqiao',
112
- 'drag': true
113
- });
114
- this.overlays.push({
115
- 'lat': lat,
116
- 'lng': lng,
117
- 'html': '<div class="label">Gaoqiao' + this.markers.length.toString() + '</div>'
118
- });
91
+ async markerAddGaoqiao(wgs) {
92
+ if (this.markers.length < 3) {
93
+ await clickgo.form.dialog('Please create at least 3 markers first.');
94
+ return;
95
+ }
96
+ const lat = wgs ? 31.354737 : 31.352569;
97
+ const lng = wgs ? 121.558717 : 121.56302;
98
+ this.markers.push({
99
+ 'lat': lat,
100
+ 'lng': lng,
101
+ 'title': 'Gaoqiao',
102
+ 'drag': true
103
+ });
104
+ this.overlays.push({
105
+ 'lat': lat,
106
+ 'lng': lng,
107
+ 'html': '<div class="label">Gaoqiao' + this.markers.length.toString() + '</div>'
119
108
  });
120
109
  }
121
110
  markerAdd() {
@@ -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,14 +45,12 @@ class default_1 extends clickgo.form.AbstractForm {
54
45
  onCheck(event) {
55
46
  event.preventDefault();
56
47
  }
57
- onRadio(event, o, n) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- if (o !== 'radio2') {
60
- return;
61
- }
62
- event.preventDefault();
63
- yield clickgo.form.dialog('When the value is set to "radio2," this option cannot be selected. Now is: ' + n);
64
- });
48
+ async onRadio(event, o, n) {
49
+ if (o !== 'radio2') {
50
+ return;
51
+ }
52
+ event.preventDefault();
53
+ await clickgo.form.dialog('When the value is set to "radio2," this option cannot be selected. Now is: ' + n);
65
54
  }
66
55
  }
67
56
  exports.default = default_1;
@@ -60,7 +60,7 @@ class default_1 extends clickgo.form.AbstractForm {
60
60
  }
61
61
  changed(e) {
62
62
  const found = this.list.find(item => item.value === e.detail.value[0]);
63
- if (found && found.fval) {
63
+ if (found?.fval) {
64
64
  this.fsrc = found.fval;
65
65
  return;
66
66
  }
@@ -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,18 +45,16 @@ class default_1 extends clickgo.form.AbstractForm {
54
45
  this.slogo = false;
55
46
  this.hash = false;
56
47
  }
57
- onSelect(e) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- e.preventDefault();
60
- yield clickgo.form.dialog('Not nav, selected: ' + e.detail.selected + ', name: ' + e.detail.name);
61
- });
48
+ async onSelect(e) {
49
+ e.preventDefault();
50
+ await clickgo.form.dialog('Not nav, selected: ' + e.detail.selected + ', name: ' + e.detail.name);
62
51
  }
63
52
  onMounted() {
64
- this.watch('name', () => __awaiter(this, void 0, void 0, function* () {
53
+ this.watch('name', async () => {
65
54
  this.loading = true;
66
- yield clickgo.tool.sleep(300);
55
+ await clickgo.tool.sleep(300);
67
56
  this.loading = false;
68
- }));
57
+ });
69
58
  }
70
59
  }
71
60
  exports.default = default_1;
@@ -0,0 +1,75 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const clickgo = __importStar(require("clickgo"));
37
+ class default_1 extends clickgo.form.AbstractForm {
38
+ constructor() {
39
+ super(...arguments);
40
+ this.url = '';
41
+ this.pwd = '';
42
+ this.config = {
43
+ 'url': '',
44
+ 'pwd': '',
45
+ };
46
+ this.list = [];
47
+ }
48
+ toConnect() {
49
+ this.config.url = this.url;
50
+ this.config.pwd = this.pwd;
51
+ }
52
+ date() {
53
+ const d = new Date();
54
+ return `[${d.getHours().toString().padStart(2, '0')}:${d.getMinutes().toString().padStart(2, '0')}:${d.getSeconds().toString().padStart(2, '0')}] `;
55
+ }
56
+ connect() {
57
+ this.list.unshift(this.date() + 'connect');
58
+ }
59
+ disconnect() {
60
+ this.list.unshift(this.date() + 'disconnect');
61
+ }
62
+ password() {
63
+ this.list.unshift(this.date() + 'password');
64
+ }
65
+ fail() {
66
+ this.list.unshift(this.date() + 'fail');
67
+ }
68
+ desktopresize(e) {
69
+ this.list.unshift(this.date() + 'desktopresize: ' + e.width + 'x' + e.height);
70
+ }
71
+ clipboard(text) {
72
+ this.list.unshift(this.date() + 'clipboard: ' + text);
73
+ }
74
+ }
75
+ exports.default = default_1;
@@ -0,0 +1,13 @@
1
+ <form width="450" height="600" title="Novnc" padding="10">
2
+ <layout direction="v" gutter="10" style="flex: 1;">
3
+ <novnc v-model="config" @connect="connect" @disconnect="disconnect" @password="password" @fail="fail" @desktopresize="desktopresize" @clipboard="clipboard" style="flex: 1; height: 0;"></novnc>
4
+ <layout gutter="10">
5
+ <text v-model="url" placeholder="ws:// | wss://" style="flex: 1;" />
6
+ <text v-model="pwd" placeholder="Password" style="flex: 1;" />
7
+ <button @click="toConnect">connect</button>
8
+ </layout>
9
+ <flow direction="v" style="background: oklch(0 0 0); color: oklch(1 0 0); height: 70px;">
10
+ <label v-for="item of list">{{ item }}</label>
11
+ </flow>
12
+ </layout>
13
+ </form>
@@ -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
  };
@@ -56,14 +47,12 @@ class default_1 extends clickgo.form.AbstractForm {
56
47
  this.plain = false;
57
48
  this.map = null;
58
49
  }
59
- go() {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- this.loading = true;
62
- yield this.refs.panel.go(test1_1.default, {
63
- 'type': 'show'
64
- });
65
- this.loading = false;
50
+ async go() {
51
+ this.loading = true;
52
+ await this.refs.panel.go(test1_1.default, {
53
+ 'type': 'show'
66
54
  });
55
+ this.loading = false;
67
56
  }
68
57
  ssend() {
69
58
  this.refs.panel.send({
@@ -77,7 +66,7 @@ class default_1 extends clickgo.form.AbstractForm {
77
66
  };
78
67
  }
79
68
  onMounted() {
80
- this.watch('selected', () => __awaiter(this, void 0, void 0, function* () {
69
+ this.watch('selected', async () => {
81
70
  switch (this.selected[0]) {
82
71
  case 'none': {
83
72
  if (this.map) {
@@ -91,7 +80,7 @@ class default_1 extends clickgo.form.AbstractForm {
91
80
  }
92
81
  else {
93
82
  this.loading = true;
94
- yield this.refs.panel.go(test1_1.default);
83
+ await this.refs.panel.go(test1_1.default);
95
84
  this.loading = false;
96
85
  }
97
86
  break;
@@ -102,13 +91,13 @@ class default_1 extends clickgo.form.AbstractForm {
102
91
  }
103
92
  else {
104
93
  this.loading = true;
105
- yield this.refs.panel.go('./test2');
94
+ await this.refs.panel.go('./test2');
106
95
  this.loading = false;
107
96
  }
108
97
  break;
109
98
  }
110
99
  }
111
- }), {
100
+ }, {
112
101
  'deep': true,
113
102
  'immediate': true
114
103
  });
@@ -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.AbstractPanel {
@@ -50,23 +41,17 @@ class default_1 extends clickgo.form.AbstractPanel {
50
41
  this.data = {};
51
42
  this.rootMountData = 'none';
52
43
  }
53
- onShow(e) {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- yield clickgo.tool.sleep(1000);
56
- ++this.scount;
57
- this.data = e;
58
- });
44
+ async onShow(e) {
45
+ await clickgo.tool.sleep(1000);
46
+ ++this.scount;
47
+ this.data = e;
59
48
  }
60
- onHide() {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- yield clickgo.tool.sleep(1000);
63
- });
49
+ async onHide() {
50
+ await clickgo.tool.sleep(1000);
64
51
  }
65
- onReceive(data) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- this.data = data;
68
- yield clickgo.form.dialog('test1 got data.');
69
- });
52
+ async onReceive(data) {
53
+ this.data = data;
54
+ await clickgo.form.dialog('test1 got data.');
70
55
  }
71
56
  onQsChange() {
72
57
  clickgo.form.notify({
@@ -74,26 +59,20 @@ class default_1 extends clickgo.form.AbstractPanel {
74
59
  'content': 'onQsChange: ' + Object.keys(this.qs).length.toString()
75
60
  });
76
61
  }
77
- onQsChangeShow(e) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- yield clickgo.tool.sleep(500);
80
- clickgo.form.notify({
81
- 'title': 'Test1 Panel',
82
- 'content': 'onQsChangeShow'
83
- });
84
- console.log('onQsChangeShow', e);
62
+ async onQsChangeShow(e) {
63
+ await clickgo.tool.sleep(500);
64
+ clickgo.form.notify({
65
+ 'title': 'Test1 Panel',
66
+ 'content': 'onQsChangeShow'
85
67
  });
68
+ console.log('onQsChangeShow', e);
86
69
  }
87
- click() {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- yield clickgo.form.dialog('Hello panel!');
90
- });
70
+ async click() {
71
+ await clickgo.form.dialog('Hello panel!');
91
72
  }
92
- clearQss() {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- this.clearQs();
95
- yield clickgo.form.dialog('cleard.');
96
- });
73
+ async clearQss() {
74
+ this.clearQs();
75
+ await clickgo.form.dialog('cleard.');
97
76
  }
98
77
  jump() {
99
78
  this.rootForm.formHash = 'test1?a=1&b=3';
@@ -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 {
@@ -55,10 +46,8 @@ class default_1 extends clickgo.form.AbstractForm {
55
46
  onLoaded(pdf) {
56
47
  this.access.pdf = pdf;
57
48
  }
58
- onView(e) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- yield clickgo.form.dialog(JSON.stringify(e.detail));
61
- });
49
+ async onView(e) {
50
+ await clickgo.form.dialog(JSON.stringify(e.detail));
62
51
  }
63
52
  load() {
64
53
  this.src = '/package/form/control/pdf/test.pdf';
@@ -66,13 +55,11 @@ class default_1 extends clickgo.form.AbstractForm {
66
55
  select() {
67
56
  this.refs.file.select();
68
57
  }
69
- change(files) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- if (!files) {
72
- return;
73
- }
74
- yield this.refs.pdf.load(files[0]);
75
- });
58
+ async change(files) {
59
+ if (!files) {
60
+ return;
61
+ }
62
+ await this.refs.pdf.load(files[0]);
76
63
  }
77
64
  }
78
65
  exports.default = default_1;