clickgo 3.1.1-dev10 → 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 (106) hide show
  1. package/dist/app/demo/app.js +0 -72
  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 +166 -5
  41. package/dist/app/demo/form/main.xml +37 -35
  42. package/dist/app/demo/form/method/aform/aform.js +57 -0
  43. package/dist/app/demo/form/method/aform/aform.xml +35 -0
  44. package/dist/app/demo/form/method/aform/test.xml +6 -0
  45. package/dist/app/demo/form/method/core/core.js +11 -8
  46. package/dist/app/demo/form/method/core/core.xml +2 -1
  47. package/dist/app/demo/form/method/dom/dom.js +91 -99
  48. package/dist/app/demo/form/method/dom/dom.xml +6 -7
  49. package/dist/app/demo/form/method/form/form.js +10 -28
  50. package/dist/app/demo/form/method/form/form.xml +8 -15
  51. package/dist/app/demo/form/method/fs/fs.js +34 -33
  52. package/dist/app/demo/form/method/fs/fs.xml +1 -1
  53. package/dist/app/demo/form/method/fs/text.js +12 -12
  54. package/dist/app/demo/form/method/native/native.js +50 -0
  55. package/dist/app/demo/form/method/native/native.xml +12 -0
  56. package/dist/app/demo/form/method/system/system.js +50 -0
  57. package/dist/app/demo/form/method/system/system.xml +11 -0
  58. package/dist/app/demo/form/method/task/task.js +59 -61
  59. package/dist/app/demo/form/method/task/task.xml +4 -6
  60. package/dist/app/demo/form/method/theme/theme.js +14 -14
  61. package/dist/app/demo/form/method/tool/tool.js +29 -28
  62. package/dist/app/demo/form/method/tool/tool.xml +3 -3
  63. package/dist/app/demo/form/method/zip/zip.js +46 -41
  64. package/dist/app/demo/form/method/zip/zip.xml +1 -1
  65. package/dist/app/task/app.js +0 -25
  66. package/dist/app/task/config.json +29 -0
  67. package/dist/app/task/form/bar/bar.js +2 -2
  68. package/dist/app/task/form/bar/bar.xml +1 -1
  69. package/dist/clickgo.js +17 -5
  70. package/dist/clickgo.ts +22 -3
  71. package/dist/control/common.cgc +0 -0
  72. package/dist/control/form.cgc +0 -0
  73. package/dist/control/monaco.cgc +0 -0
  74. package/dist/control/property.cgc +0 -0
  75. package/dist/control/task.cgc +0 -0
  76. package/dist/global.css +1 -1
  77. package/dist/index.js +28 -8
  78. package/dist/index.ts +33 -7
  79. package/dist/lib/control.js +75 -105
  80. package/dist/lib/control.ts +102 -124
  81. package/dist/lib/core.js +108 -252
  82. package/dist/lib/core.ts +122 -268
  83. package/dist/lib/dom.js +564 -483
  84. package/dist/lib/dom.ts +703 -546
  85. package/dist/lib/form.js +170 -153
  86. package/dist/lib/form.ts +132 -99
  87. package/dist/lib/fs.js +1 -1
  88. package/dist/lib/fs.ts +1 -1
  89. package/dist/lib/native.js +135 -8
  90. package/dist/lib/native.ts +176 -12
  91. package/dist/lib/task.js +301 -175
  92. package/dist/lib/task.ts +330 -207
  93. package/dist/lib/tool.js +48 -1
  94. package/dist/lib/tool.ts +61 -0
  95. package/dist/lib/zip.ts +2 -0
  96. package/dist/theme/familiar.cgt +0 -0
  97. package/package.json +1 -1
  98. package/types/index.d.ts +26 -29
  99. package/dist/app/demo/form/control/greatview/greatview.js +0 -92
  100. package/dist/app/demo/form/control/overflow/overflow.js +0 -70
  101. package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
  102. package/dist/app/demo/form/control/view/view.css +0 -1
  103. package/dist/app/demo/form/control/view/view.js +0 -73
  104. package/dist/app/demo/form/control/view/view.scss +0 -18
  105. package/dist/app/demo/form/control/view/view.xml +0 -94
  106. package/dist/app/demo/form/method/form/test.xml +0 -5
@@ -1,6 +1,7 @@
1
1
  <form width="350" height="400" title="Library form">
2
- <overflow direction="v" style="flex: 1; padding: 10px;">
2
+ <flow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout gutter="10" direction="v" style="flex: 1;">
4
+ <label>This form id: {{formId}}</label>
4
5
  <button @click="min" style="height: 30px;">min({{formId}})</button>
5
6
  <button @click="max" style="height: 30px;">max({{formId}})</button>
6
7
  <button @click="close" style="height: 30px;">close({{formId}})</button>
@@ -12,17 +13,12 @@
12
13
  </layout>
13
14
  <button @click="getTaskId" style="height: 30px;">getTaskId({{fid}})</button>
14
15
  <button @click="get" style="height: 30px;">get({{fid}})</button>
15
- <layout gutter="10" align-v="center">
16
- <label>Send: </label>
17
- <text v-model="sendValue" style="flex: 1; width: 0; height: 30px;"></text>
18
- <button @click="send" style="padding: 0 10px;">send({{fid}}, {'key': '{{sendValue}}'})</button>
19
- </layout>
20
- <button @click="changeFocus" style="height: 30px;">changeFocus({{fid}})</button>
21
16
  <layout gutter="10" align-v="center">
22
17
  <label>Task ID:</label>
23
18
  <text v-model="tid" style="flex: 1; width: 0; height: 30px;"></text>
24
19
  <button @click="getList" style="padding: 0 10px;">getList({{tid}})</button>
25
20
  </layout>
21
+ <button @click="changeFocus" style="height: 30px;">changeFocus({{fid}})</button>
26
22
  <button @click="getMaxZIndexID" style="height: 30px;">getMaxZIndexID()</button>
27
23
  <button @click="getRectByBorder" style="height: 30px;">getRectByBorder('rb')</button>
28
24
  <button @click="showCircular" style="height: 30px;">showCircular(x, y)</button>
@@ -33,12 +29,10 @@
33
29
  <select v-model="progress" :data="['normal', 'progress + icon']" style="flex: 1; width: 0;"></select>
34
30
  <button @click="notify" style="padding: 0 10px;">notify({ ... })</button>
35
31
  </layout>
36
- <button @click="showPop" style="height: 30px;">showPop(e.currentTarget, this.$refs.pop)</button>
37
- <teleport to="#cg-pop-list">
38
- <block ref="pop" data-cg-pop style="border: solid 1px #000; background: #FFF; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center;">$refs.pop</block>
32
+ <button @click="showPop" style="height: 30px;">showPop(e.currentTarget, this.refs.pop)</button>
33
+ <teleport to="system">
34
+ <block ref="pop" style="border: solid 1px #000; background: #FFF; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center;">refs.pop</block>
39
35
  </teleport>
40
- <button @click="createPath" style="height: 30px;">create('test')</button>
41
- <button @click="createTop" style="height: 30px;">create({'layout':'xxx','topMost':true})</button>
42
36
  <label>Dialog result: {{dr}}.</label>
43
37
  <button @click="dialog" style="height: 30px;">dialog('Hello world!')</button>
44
38
  <button @click="dialogLong">dialog('long...')</button>
@@ -47,9 +41,8 @@
47
41
  <button @click="dialogCannot" style="height: 30px;">Dialog can not be close</button>
48
42
  <button @click="confirm(false)" style="height: 30px;">confirm('confirm')</button>
49
43
  <button @click="confirm(true)" style="height: 30px;">confirm({'content':'confirm','cancel':true})</button>
50
- <button @click="setTopMost" style="height: 30px;">setTopMost({{setTopMostValue ? 'false' : 'true'}})</button>
51
44
  <button @click="flash" style="height: 30px;">flash({{formId}})</button>
52
- <button @click="hhide" style="height: 30px;">hide({{formId}}) and show({{formId}})</button>
45
+ <button @click="showLauncher" style="height: 30px;">showLauncher()</button>
53
46
  </layout>
54
- </overflow>
47
+ </flow>
55
48
  </form>
@@ -9,15 +9,16 @@ 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.data = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.data = {
15
- 'path': '/',
16
- 'list': [],
17
- 'val': ''
18
- };
19
- exports.methods = {
20
- open: function (path) {
13
+ const text_1 = require("./text");
14
+ class default_1 extends clickgo.form.AbstractForm {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.ppath = '/';
18
+ this.list = [];
19
+ this.val = [];
20
+ }
21
+ open(path) {
21
22
  return __awaiter(this, void 0, void 0, function* () {
22
23
  if (!path.endsWith('/')) {
23
24
  path += '/';
@@ -30,21 +31,21 @@ exports.methods = {
30
31
  'value': path + item.name
31
32
  });
32
33
  }
33
- this.path = path;
34
+ this.ppath = path;
34
35
  });
35
- },
36
- dblclick: function () {
36
+ }
37
+ dblclick() {
37
38
  return __awaiter(this, void 0, void 0, function* () {
38
- const r = yield clickgo.fs.isFile(this.val);
39
+ const r = yield clickgo.fs.isFile(this.val[0]);
39
40
  if (r) {
40
- const extlio = this.val.lastIndexOf('.');
41
+ const extlio = this.val[0].lastIndexOf('.');
41
42
  if (extlio === -1) {
42
43
  yield clickgo.form.dialog('This extension is not supported.');
43
44
  return;
44
45
  }
45
- const ext = this.val.toLowerCase().slice(extlio + 1);
46
+ const ext = this.val[0].toLowerCase().slice(extlio + 1);
46
47
  if (['xml', 'js', 'ts', 'json', 'css', 'html', 'php'].includes(ext)) {
47
- let content = yield clickgo.fs.getContent(this.val);
48
+ let content = yield clickgo.fs.getContent(this.val[0]);
48
49
  if (!content) {
49
50
  yield clickgo.form.dialog('This file cannot be opened.');
50
51
  return;
@@ -52,37 +53,37 @@ exports.methods = {
52
53
  if (content instanceof Blob) {
53
54
  content = yield clickgo.tool.blob2Text(content);
54
55
  }
55
- const f = yield clickgo.form.create('text');
56
+ const f = yield text_1.default.create({
57
+ 'title': this.val[0].slice(this.val[0].lastIndexOf('/') + 1),
58
+ 'content': content
59
+ });
56
60
  if (typeof f === 'number') {
57
61
  return;
58
62
  }
59
- clickgo.form.send(f.id, {
60
- 'title': this.val.slice(this.val.lastIndexOf('/') + 1),
61
- 'content': content
62
- });
63
+ f.show();
63
64
  return;
64
65
  }
65
- yield clickgo.form.dialog('This extension is not supported.');
66
+ yield clickgo.form.dialog('The extension "' + ext + '" is not supported.');
66
67
  return;
67
68
  }
68
- yield this.open(this.val);
69
+ yield this.open(this.val[0]);
69
70
  });
70
- },
71
- up: function () {
71
+ }
72
+ up() {
72
73
  return __awaiter(this, void 0, void 0, function* () {
73
- if (this.path === '/') {
74
+ if (this.ppath === '/') {
74
75
  return;
75
76
  }
76
- const path = this.path.slice(0, -1);
77
+ const path = this.ppath.slice(0, -1);
77
78
  const lif = path.lastIndexOf('/');
78
79
  const npath = path.slice(0, lif + 1);
79
80
  yield this.open(npath);
80
81
  });
81
82
  }
82
- };
83
- const mounted = function () {
84
- return __awaiter(this, void 0, void 0, function* () {
85
- yield this.open('/');
86
- });
87
- };
88
- exports.mounted = mounted;
83
+ onMounted() {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ yield this.open('/');
86
+ });
87
+ }
88
+ }
89
+ exports.default = default_1;
@@ -1,7 +1,7 @@
1
1
  <form width="350" height="400" title="Library fs" padding="10">
2
2
  <layout gutter="10" direction="v" style="flex: 1;">
3
3
  <label>Double click the item below:</label>
4
- <block style="background: #000; color: #FFF; padding: 5px;">{{path}}</block>
4
+ <block style="background: #000; color: #FFF; padding: 5px;">{{ppath}}</block>
5
5
  <list v-model="val" :data="list" @dblclick="dblclick" style="flex: 1; height: 0;"></list>
6
6
  <button style="height: 30px;" @click="up">Up</button>
7
7
  </layout>
@@ -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;