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.
Files changed (103) hide show
  1. package/dist/app/demo/app.js +0 -73
  2. package/dist/app/demo/config.json +109 -0
  3. package/dist/app/demo/form/control/button/button.js +12 -11
  4. package/dist/app/demo/form/control/button/button.xml +6 -6
  5. package/dist/app/demo/form/control/check/check.js +14 -10
  6. package/dist/app/demo/form/control/file/file.js +15 -13
  7. package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
  8. package/dist/app/demo/form/control/flow/flow.js +64 -0
  9. package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
  10. package/dist/app/demo/form/control/flow/flow.xml +101 -0
  11. package/dist/app/demo/form/control/form/form.js +1 -1
  12. package/dist/app/demo/form/control/form/form.xml +3 -3
  13. package/dist/app/demo/form/control/img/img.xml +2 -2
  14. package/dist/app/demo/form/control/list/list.js +95 -75
  15. package/dist/app/demo/form/control/list/list.xml +15 -11
  16. package/dist/app/demo/form/control/marquee/marquee.js +12 -10
  17. package/dist/app/demo/form/control/menu/menu.js +10 -6
  18. package/dist/app/demo/form/control/monaco/monaco.js +50 -60
  19. package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
  20. package/dist/app/demo/form/control/property/property.js +131 -127
  21. package/dist/app/demo/form/control/radio/radio.js +9 -5
  22. package/dist/app/demo/form/control/scroll/scroll.js +16 -12
  23. package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
  24. package/dist/app/demo/form/control/select/select.js +132 -71
  25. package/dist/app/demo/form/control/select/select.xml +69 -67
  26. package/dist/app/demo/form/control/tab/tab.js +21 -20
  27. package/dist/app/demo/form/control/tab/tab.xml +2 -2
  28. package/dist/app/demo/form/control/text/text.js +53 -45
  29. package/dist/app/demo/form/control/text/text.xml +3 -3
  30. package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
  31. package/dist/app/demo/form/control/vflow/vflow.js +79 -0
  32. package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
  33. package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
  34. package/dist/app/demo/form/event/form/form.js +58 -56
  35. package/dist/app/demo/form/event/form/form.xml +3 -3
  36. package/dist/app/demo/form/event/screen/screen.js +30 -28
  37. package/dist/app/demo/form/event/screen/screen.xml +2 -2
  38. package/dist/app/demo/form/event/task/task.js +31 -31
  39. package/dist/app/demo/form/event/task/task.xml +3 -3
  40. package/dist/app/demo/form/main.js +161 -5
  41. package/dist/app/demo/form/main.xml +36 -35
  42. package/dist/app/demo/form/method/aform/aform.xml +3 -2
  43. package/dist/app/demo/form/method/core/core.js +11 -8
  44. package/dist/app/demo/form/method/core/core.xml +2 -1
  45. package/dist/app/demo/form/method/dom/dom.js +91 -99
  46. package/dist/app/demo/form/method/dom/dom.xml +6 -7
  47. package/dist/app/demo/form/method/form/form.js +8 -8
  48. package/dist/app/demo/form/method/form/form.xml +4 -4
  49. package/dist/app/demo/form/method/fs/fs.js +34 -33
  50. package/dist/app/demo/form/method/fs/fs.xml +1 -1
  51. package/dist/app/demo/form/method/fs/text.js +12 -12
  52. package/dist/app/demo/form/method/native/native.js +50 -0
  53. package/dist/app/demo/form/method/native/native.xml +12 -0
  54. package/dist/app/demo/form/method/system/system.js +50 -0
  55. package/dist/app/demo/form/method/system/system.xml +11 -0
  56. package/dist/app/demo/form/method/task/task.js +59 -61
  57. package/dist/app/demo/form/method/task/task.xml +4 -6
  58. package/dist/app/demo/form/method/theme/theme.js +14 -14
  59. package/dist/app/demo/form/method/tool/tool.js +29 -28
  60. package/dist/app/demo/form/method/tool/tool.xml +3 -3
  61. package/dist/app/demo/form/method/zip/zip.js +46 -41
  62. package/dist/app/demo/form/method/zip/zip.xml +1 -1
  63. package/dist/app/task/app.js +0 -25
  64. package/dist/app/task/config.json +29 -0
  65. package/dist/app/task/form/bar/bar.js +1 -1
  66. package/dist/app/task/form/bar/bar.xml +1 -1
  67. package/dist/clickgo.js +1 -1
  68. package/dist/clickgo.ts +1 -1
  69. package/dist/control/common.cgc +0 -0
  70. package/dist/control/form.cgc +0 -0
  71. package/dist/control/monaco.cgc +0 -0
  72. package/dist/control/property.cgc +0 -0
  73. package/dist/control/task.cgc +0 -0
  74. package/dist/global.css +1 -1
  75. package/dist/index.js +3 -3
  76. package/dist/index.ts +3 -3
  77. package/dist/lib/control.js +70 -104
  78. package/dist/lib/control.ts +97 -123
  79. package/dist/lib/core.js +108 -252
  80. package/dist/lib/core.ts +122 -268
  81. package/dist/lib/dom.js +564 -483
  82. package/dist/lib/dom.ts +703 -546
  83. package/dist/lib/form.js +146 -138
  84. package/dist/lib/form.ts +108 -86
  85. package/dist/lib/fs.js +1 -1
  86. package/dist/lib/fs.ts +1 -1
  87. package/dist/lib/native.js +135 -8
  88. package/dist/lib/native.ts +175 -11
  89. package/dist/lib/task.js +294 -158
  90. package/dist/lib/task.ts +326 -172
  91. package/dist/lib/tool.js +48 -1
  92. package/dist/lib/tool.ts +61 -0
  93. package/dist/lib/zip.ts +2 -0
  94. package/dist/theme/familiar.cgt +0 -0
  95. package/package.json +1 -1
  96. package/types/index.d.ts +23 -24
  97. package/dist/app/demo/form/control/greatview/greatview.js +0 -92
  98. package/dist/app/demo/form/control/overflow/overflow.js +0 -70
  99. package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
  100. package/dist/app/demo/form/control/view/view.css +0 -1
  101. package/dist/app/demo/form/control/view/view.js +0 -73
  102. package/dist/app/demo/form/control/view/view.scss +0 -18
  103. package/dist/app/demo/form/control/view/view.xml +0 -94
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.receive = exports.data = void 0;
4
- exports.data = {
5
- 'title': 'Text viewer',
6
- 'content': ''
7
- };
8
- const receive = function (obj) {
9
- if (obj.taskId !== this.taskId) {
10
- return;
3
+ const clickgo = require("clickgo");
4
+ class default_1 extends clickgo.form.AbstractForm {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.title = 'Text viewer';
8
+ this.content = '';
11
9
  }
12
- this.title = obj.title + ' - Text viewer';
13
- this.content = obj.content;
14
- };
15
- exports.receive = receive;
10
+ onMounted(obj) {
11
+ this.title = obj.title + ' - Text viewer';
12
+ this.content = obj.content;
13
+ }
14
+ }
15
+ exports.default = default_1;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const clickgo = require("clickgo");
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.val = 'test';
17
+ }
18
+ getListenerList() {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ yield clickgo.form.dialog(JSON.stringify(clickgo.native.getListenerList()));
21
+ });
22
+ }
23
+ max() {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ yield clickgo.native.max();
26
+ });
27
+ }
28
+ min() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ yield clickgo.native.min();
31
+ });
32
+ }
33
+ restore() {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ yield clickgo.native.restore();
36
+ });
37
+ }
38
+ ping() {
39
+ var _a;
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ yield clickgo.form.dialog((_a = yield clickgo.native.ping(this.val)) !== null && _a !== void 0 ? _a : 'undefined');
42
+ });
43
+ }
44
+ isMax() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ yield clickgo.form.dialog((yield clickgo.native.isMax()) ? 'true' : 'false');
47
+ });
48
+ }
49
+ }
50
+ exports.default = default_1;
@@ -0,0 +1,12 @@
1
+ <form width="350" height="400" title="Library native" padding="10">
2
+ <layout gutter="10" direction="v" style="flex: 1;">
3
+ <button @click="getListenerList" style="height: 30px;">getListenerList</button>
4
+ <button @click="max" style="height: 30px;">max</button>
5
+ <button @click="min" style="height: 30px;">min</button>
6
+ <layout gutter="10" align-v="center">
7
+ <text style="flex: 1;" v-model="val"></text>
8
+ <button @click="ping" style="height: 30px; padding: 0 10px;">ping("{{val}}")</button>
9
+ </layout>
10
+ <button @click="isMax" style="height: 30px;">isMax</button>
11
+ </layout>
12
+ </form>
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const clickgo = require("clickgo");
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ getVersion() {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ yield clickgo.form.dialog('Version: ' + clickgo.getVersion());
17
+ });
18
+ }
19
+ isNative() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ yield clickgo.form.dialog('Native: ' + (clickgo.isNative() ? 'true' : 'false'));
22
+ });
23
+ }
24
+ getPlatform() {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ yield clickgo.form.dialog('Platform: ' + clickgo.getPlatform());
27
+ });
28
+ }
29
+ isImmersion() {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ yield clickgo.form.dialog('Immersion: ' + (clickgo.isImmersion() ? 'true' : 'false'));
32
+ });
33
+ }
34
+ hasFrame() {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ yield clickgo.form.dialog('hasFrame: ' + (clickgo.hasFrame() ? 'true' : 'false'));
37
+ });
38
+ }
39
+ unblock() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ yield clickgo.form.dialog('typeof sessionStorage: ' + typeof sessionStorage);
42
+ });
43
+ }
44
+ ls() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ yield clickgo.form.dialog('typeof localStorage: ' + typeof localStorage);
47
+ });
48
+ }
49
+ }
50
+ exports.default = default_1;
@@ -0,0 +1,11 @@
1
+ <form width="350" height="400" title="System">
2
+ <layout direction="v" gutter="10" style="flex: 1; padding: 10px;">
3
+ <button @click="getVersion" style="height: 30px;">clickgo.getVersion()</button>
4
+ <button @click="isNative" style="height: 30px;">clickgo.isNative()</button>
5
+ <button @click="getPlatform" style="height: 30px;">clickgo.getPlatform()</button>
6
+ <button @click="isImmersion" style="height: 30px;">clickgo.isImmersion()</button>
7
+ <button @click="hasFrame" style="height: 30px;">clickgo.hasFrame()</button>
8
+ <button @click="unblock" style="height: 30px;">unblock: ['sessionStorage']</button>
9
+ <button @click="ls" style="height: 30px;">typeof localStorage</button>
10
+ </layout>
11
+ </form>
@@ -9,24 +9,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.mounted = exports.methods = exports.computed = exports.data = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.data = {
15
- 'tid': '0',
16
- 'frameTimer': 0,
17
- 'frameCount': 0,
18
- 'timer': 0,
19
- 'timerCount': 0,
20
- 'select': '',
21
- 'sleeping': false
22
- };
23
- exports.computed = {
24
- globalLocale: function () {
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.tid = '0';
17
+ this.frameTimer = 0;
18
+ this.frameCount = 0;
19
+ this.timer = 0;
20
+ this.timerCount = 0;
21
+ this.select = [];
22
+ this.sleeping = false;
23
+ }
24
+ get globalLocale() {
25
25
  return clickgo.core.config.locale;
26
26
  }
27
- };
28
- exports.methods = {
29
- frameStart: function (v) {
27
+ frameStart(v) {
30
28
  let opt = {};
31
29
  switch (v) {
32
30
  case 0: {
@@ -41,9 +39,9 @@ exports.methods = {
41
39
  };
42
40
  break;
43
41
  }
44
- case 3: {
42
+ case 2: {
45
43
  opt = {
46
- 'scope': 'task'
44
+ 'formId': this.formId
47
45
  };
48
46
  break;
49
47
  }
@@ -51,13 +49,13 @@ exports.methods = {
51
49
  this.frameTimer = clickgo.task.onFrame(() => {
52
50
  ++this.frameCount;
53
51
  }, opt);
54
- },
55
- frameEnd: function () {
52
+ }
53
+ frameEnd() {
56
54
  clickgo.task.offFrame(this.frameTimer);
57
55
  this.frameCount = 0;
58
56
  this.frameTimer = 0;
59
- },
60
- timerStart: function (v) {
57
+ }
58
+ timerStart(v) {
61
59
  let opt = {};
62
60
  switch (v) {
63
61
  case 0: {
@@ -74,7 +72,7 @@ exports.methods = {
74
72
  }
75
73
  case 3: {
76
74
  opt = {
77
- 'scope': 'task'
75
+ 'formId': this.formId
78
76
  };
79
77
  break;
80
78
  }
@@ -82,58 +80,58 @@ exports.methods = {
82
80
  this.timer = clickgo.task.createTimer(() => {
83
81
  ++this.timerCount;
84
82
  }, 1, opt);
85
- },
86
- timerEnd: function () {
83
+ }
84
+ timerEnd() {
87
85
  clickgo.task.removeTimer(this.timer);
88
86
  this.timerCount = 0;
89
87
  this.timer = 0;
90
- },
91
- get: function () {
92
- const r = clickgo.task.get(this.tid);
88
+ }
89
+ get() {
90
+ const r = clickgo.task.get(parseInt(this.tid));
93
91
  clickgo.form.dialog(r ? JSON.stringify(r) : 'null').catch((e) => { throw e; });
94
- },
95
- getList: function () {
92
+ }
93
+ getList() {
96
94
  clickgo.form.dialog(JSON.stringify(clickgo.task.getList())).catch((e) => { throw e; });
97
- },
98
- run: function () {
95
+ }
96
+ run() {
99
97
  return __awaiter(this, void 0, void 0, function* () {
100
98
  const tid = yield clickgo.task.run('/clickgo/app/demo/');
101
99
  yield clickgo.form.dialog('Task ID: ' + tid.toString());
102
100
  });
103
- },
104
- end: function () {
101
+ }
102
+ end() {
105
103
  return __awaiter(this, void 0, void 0, function* () {
106
- yield clickgo.form.dialog('Result: ' + (clickgo.task.end(this.tid) ? 'true' : 'false'));
104
+ yield clickgo.form.dialog('Result: ' + (clickgo.task.end(parseInt(this.tid)) ? 'true' : 'false'));
107
105
  });
108
- },
109
- loadLocale: function (lang, path) {
106
+ }
107
+ loadLocale(lang, path) {
110
108
  return __awaiter(this, void 0, void 0, function* () {
111
- const r = yield clickgo.task.loadLocale(lang, path);
109
+ const r = yield clickgo.task.loadLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
112
110
  yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
113
111
  });
114
- },
115
- setLocale: function (lang, path) {
112
+ }
113
+ setLocale(lang, path) {
116
114
  return __awaiter(this, void 0, void 0, function* () {
117
- const r = yield clickgo.task.setLocale(lang, path);
115
+ const r = yield clickgo.task.setLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
118
116
  yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
119
117
  });
120
- },
121
- clearLocale: function () {
118
+ }
119
+ clearLocale() {
122
120
  clickgo.task.clearLocale();
123
- },
124
- loadLocaleData: function (lang, data) {
121
+ }
122
+ loadLocaleData(lang, data) {
125
123
  clickgo.task.loadLocaleData(lang, data);
126
- },
127
- setLocaleLang: function (lang) {
124
+ }
125
+ setLocaleLang(lang) {
128
126
  clickgo.task.setLocaleLang(lang);
129
- },
130
- clearLocaleLang: function () {
127
+ }
128
+ clearLocaleLang() {
131
129
  clickgo.task.clearLocaleLang();
132
- },
133
- changeLocaleLang: function () {
134
- clickgo.core.config.locale = this.select;
135
- },
136
- sleep: function () {
130
+ }
131
+ changeLocaleLang() {
132
+ clickgo.core.config.locale = this.select[0];
133
+ }
134
+ sleep() {
137
135
  if (this.sleeping) {
138
136
  return;
139
137
  }
@@ -141,13 +139,13 @@ exports.methods = {
141
139
  clickgo.task.sleep(() => {
142
140
  this.sleeping = false;
143
141
  }, 1000);
144
- },
145
- systemTaskInfo: function () {
142
+ }
143
+ systemTaskInfo() {
146
144
  clickgo.form.dialog(JSON.stringify(clickgo.task.systemTaskInfo)).catch((e) => { throw e; });
147
145
  }
148
- };
149
- const mounted = function () {
150
- this.tid = this.taskId;
151
- this.select = clickgo.core.config.locale;
152
- };
153
- exports.mounted = mounted;
146
+ onMounted() {
147
+ this.tid = this.taskId.toString();
148
+ this.select = [clickgo.core.config.locale];
149
+ }
150
+ }
151
+ exports.default = default_1;
@@ -1,5 +1,5 @@
1
- <form width="350" height="400" title="Library task" padding="10">
2
- <overflow direction="v" style="flex: 1;">
1
+ <form width="350" height="400" title="Library task">
2
+ <flow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout direction="v" gutter="10">
4
4
  <label>onFrame(): timer: {{frameTimer}}, count: {{frameCount}}</label>
5
5
  <layout gutter="10">
@@ -7,7 +7,6 @@
7
7
  <button @click="frameStart(0)" style="height: 30px; flex: 1;">Once</button>
8
8
  <button @click="frameStart(1)" style="height: 30px; flex: 1;">Count 100</button>
9
9
  <button @click="frameStart(2)" style="height: 30px; flex: 1;">Form</button>
10
- <button @click="frameStart(3)" style="height: 30px; flex: 1;">Task</button>
11
10
  </template>
12
11
  <template v-else>
13
12
  <button @click="frameEnd" style="height: 30px; flex: 1;">End</button>
@@ -19,7 +18,6 @@
19
18
  <button @click="timerStart(0)" style="height: 30px; flex: 1;">Once</button>
20
19
  <button @click="timerStart(1)" style="height: 30px; flex: 1;">Count 100</button>
21
20
  <button @click="timerStart(2)" style="height: 30px; flex: 1;">Form</button>
22
- <button @click="timerStart(3)" style="height: 30px; flex: 1;">Task</button>
23
21
  </template>
24
22
  <template v-else>
25
23
  <button @click="timerEnd" style="height: 30px; flex: 1;">End</button>
@@ -33,7 +31,7 @@
33
31
  <button @click="getList" style="height: 30px;">getList()</button>
34
32
  <button @click="run" style="height: 30px;">run('/clickgo/app/demo/')</button>
35
33
  <button @click="end" style="height: 30px;">end('{{tid}}')</button>
36
- <label>Now locale: {{cgLocale}}, Global locale: {{globalLocale}}</label>
34
+ <label>Now locale: {{locale}}, Global locale: {{globalLocale}}</label>
37
35
  <label>l('File name'): {{l('File name')}}</label>
38
36
  <label>l('File size'): {{l('File size')}}</label>
39
37
  <button @click="loadLocale('en', 'locale1')" style="height: 30px;">loadLocale('en', 'locale1')</button>
@@ -53,5 +51,5 @@
53
51
  <button @click="sleep" style="height: 30px;">{{sleeping ? 'Waiting...' : 'sleep(() => { ... }, 1000)'}}</button>
54
52
  <button @click="systemTaskInfo()" style="height: 30px;">systemTaskInfo</button>
55
53
  </layout>
56
- </overflow>
54
+ </flow>
57
55
  </form>
@@ -9,10 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.methods = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.methods = {
15
- get: function () {
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ get() {
16
15
  return __awaiter(this, void 0, void 0, function* () {
17
16
  const f = yield clickgo.fs.getContent('/clickgo/theme/familiar.cgt');
18
17
  if (!f) {
@@ -27,8 +26,8 @@ exports.methods = {
27
26
  }
28
27
  return t;
29
28
  });
30
- },
31
- load: function () {
29
+ }
30
+ load() {
32
31
  return __awaiter(this, void 0, void 0, function* () {
33
32
  const n = clickgo.form.notify({
34
33
  'title': 'Info',
@@ -44,14 +43,14 @@ exports.methods = {
44
43
  const r = yield clickgo.theme.load(t);
45
44
  yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
46
45
  });
47
- },
48
- remove: function () {
46
+ }
47
+ remove() {
49
48
  clickgo.theme.remove('familiar').catch((e) => { throw e; });
50
- },
51
- clear: function () {
49
+ }
50
+ clear() {
52
51
  clickgo.theme.clear().catch((e) => { throw e; });
53
- },
54
- setGlobal: function () {
52
+ }
53
+ setGlobal() {
55
54
  return __awaiter(this, void 0, void 0, function* () {
56
55
  const n = clickgo.form.notify({
57
56
  'title': 'Info',
@@ -67,8 +66,9 @@ exports.methods = {
67
66
  yield clickgo.theme.setGlobal(t);
68
67
  yield clickgo.form.dialog('Done.');
69
68
  });
70
- },
71
- clearGlobal: function () {
69
+ }
70
+ clearGlobal() {
72
71
  clickgo.theme.clearGlobal();
73
72
  }
74
- };
73
+ }
74
+ exports.default = default_1;
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.methods = exports.data = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.data = {
15
- 'sleeping': false,
16
- 'purifyTxt': `<html>
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.sleeping = false;
17
+ this.purifyTxt = `<html>
17
18
  <head>
18
19
  <title>Hello world!</title>
19
20
  </head>
@@ -23,17 +24,16 @@ exports.data = {
23
24
  <!-- content -->
24
25
  <div>content</div>
25
26
  </body>
26
- </html>`,
27
- 'min': '10',
28
- 'max': '30',
29
- 'length': '8',
30
- 'block': '',
31
- 'url': 'HtTp://uSer:pAss@sUBDom.TopdOm23.CoM:29819/Admxw2Ksiz/dszas?Mdi=KdiMs1&a=JDd#hehHe',
32
- 'url1': '/abc/def/hehe',
33
- 'url2': '../bb.index'
34
- };
35
- exports.methods = {
36
- sleep: function () {
27
+ </html>`;
28
+ this.min = '10';
29
+ this.max = '30';
30
+ this.length = '8';
31
+ this.block = '';
32
+ this.url = 'HtTp://uSer:pAss@sUBDom.TopdOm23.CoM:29819/Admxw2Ksiz/dszas?Mdi=KdiMs1&a=JDd#hehHe';
33
+ this.url1 = '/abc/def/hehe';
34
+ this.url2 = '../bb.index';
35
+ }
36
+ sleep() {
37
37
  return __awaiter(this, void 0, void 0, function* () {
38
38
  if (this.sleeping) {
39
39
  return;
@@ -42,23 +42,24 @@ exports.methods = {
42
42
  yield clickgo.tool.sleep(1000);
43
43
  this.sleeping = false;
44
44
  });
45
- },
46
- purify: function () {
45
+ }
46
+ purify() {
47
47
  this.purifyTxt = clickgo.tool.purify(this.purifyTxt);
48
- },
49
- rand: function () {
48
+ }
49
+ rand() {
50
50
  clickgo.form.dialog(clickgo.tool.rand(parseInt(this.min), parseInt(this.max)).toString()).catch((e) => { throw e; });
51
- },
52
- random: function () {
51
+ }
52
+ random() {
53
53
  clickgo.form.dialog(clickgo.tool.random(parseInt(this.length), clickgo.tool.RANDOM_LN, this.block)).catch((e) => { throw e; });
54
- },
55
- escapeHTML: function () {
54
+ }
55
+ escapeHTML() {
56
56
  clickgo.form.dialog(clickgo.tool.escapeHTML(this.purifyTxt)).catch((e) => { throw e; });
57
- },
58
- parseUrl: function () {
57
+ }
58
+ parseUrl() {
59
59
  clickgo.form.dialog(JSON.stringify(clickgo.tool.parseUrl(this.url))).catch((e) => { throw e; });
60
- },
61
- urlResolve: function () {
60
+ }
61
+ urlResolve() {
62
62
  clickgo.form.dialog(clickgo.tool.urlResolve(this.url1, this.url2)).catch((e) => { throw e; });
63
63
  }
64
- };
64
+ }
65
+ exports.default = default_1;
@@ -1,5 +1,5 @@
1
- <form width="350" height="400" title="Library tool" padding="10">
2
- <overflow direction="v" style="flex: 1;">
1
+ <form width="350" height="400" title="Library tool">
2
+ <flow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout direction="v" gutter="10">
4
4
  <button @click="sleep" style="height: 30px;">{{sleeping ? 'Waiting...' : 'sleep(1000)'}}</button>
5
5
  <text v-model="purifyTxt" multi style="height: 100px;"></text>
@@ -22,5 +22,5 @@
22
22
  <text v-model="url2" style="height: 30px;"></text>
23
23
  <button @click="urlResolve" style="height: 30px;">urlResolve('{{url1.slice(0, 5)}}...', '{{url2.slice(0, 5)}}...')</button>
24
24
  </layout>
25
- </overflow>
25
+ </flow>
26
26
  </form>