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,49 +1,51 @@
1
1
  <form width="400" height="550" title="ClickGo demo" icon="/package/res/icon.svg">
2
2
  <tab v-model="ntab" :tabs="['control', 'method', 'event']" style="margin: 10px; flex: 1;">
3
- <overflow v-if="ntab === 'control'" class="inner" direction="v">
3
+ <flow v-if="ntab === 'control'" class="inner" direction="v">
4
4
  <layout class="buttons" gutter="10" direction="v">
5
5
  <button @click="openForm('cform')">Form</button>
6
- <button @click="openForm('control', 'img')">Img</button>
7
- <button @click="openForm('control', 'button')">Button</button>
8
- <button @click="openForm('control', 'check')">Check</button>
9
- <button @click="openForm('control', 'radio')">Radio</button>
10
- <button @click="openForm('control', 'text')">Text</button>
11
- <button @click="openForm('control', 'tab')">Tab</button>
12
- <button @click="openForm('control', 'label')">Label</button>
13
- <button @click="openForm('control', 'loading')">Loading</button>
6
+ <button @click="openForm('cimg')">Img</button>
7
+ <button @click="openForm('cbutton')">Button</button>
8
+ <button @click="openForm('ccheck')">Check</button>
9
+ <button @click="openForm('cradio')">Radio</button>
10
+ <button @click="openForm('ctext')">Text</button>
11
+ <button @click="openForm('ctab')">Tab</button>
12
+ <button @click="openForm('clabel')">Label</button>
13
+ <button @click="openForm('cloading')">Loading</button>
14
14
  <button @click="openForm('cdialog')">Dialog</button>
15
- <button @click="openForm('control', 'file')">File</button>
15
+ <button @click="openForm('cfile')">File</button>
16
16
  <button @click="openForm('cblock')">Block</button>
17
- <button @click="openForm('control', 'overflow')">Overflow</button>
18
- <button @click="openForm('control', 'view')">View</button>
19
- <button @click="openForm('control', 'greatview')">Greatview</button>
20
- <button @click="openForm('control', 'marquee')">Marquee</button>
21
- <button @click="openForm('control', 'scroll')">Scroll</button>
22
- <button @click="openForm('control', 'menu')">Menu</button>
23
- <button @click="openForm('control', 'list')">List</button>
24
- <button @click="openForm('control', 'select')">Select</button>
25
- <button @click="openForm('control', 'property')">Property</button>
26
- <button @click="openForm('control', 'monaco')">Monaco</button>
17
+ <button @click="openForm('cflow')">Flow</button>
18
+ <button @click="openForm('cvflow')">Vflow</button>
19
+ <button @click="openForm('cmarquee')">Marquee</button>
20
+ <button @click="openForm('cscroll')">Scroll</button>
21
+ <button @click="openForm('cmenu')">Menu</button>
22
+ <button @click="openForm('clist')">List</button>
23
+ <button @click="openForm('cselect')">Select</button>
24
+ <button @click="openForm('cproperty')">Property</button>
25
+ <button @click="openForm('cmonaco')">Monaco</button>
27
26
  </layout>
28
- </overflow>
29
- <overflow v-else-if="ntab === 'method'" class="inner" direction="v">
27
+ </flow>
28
+ <flow v-else-if="ntab === 'method'" class="inner" direction="v">
30
29
  <layout class="buttons" gutter="10" direction="v">
31
- <button @click="openForm('method', 'core')">Library core</button>
32
- <button @click="openForm('method', 'dom')">Library dom</button>
30
+ <button @click="openForm('mcore')">Library core</button>
31
+ <button @click="openForm('mdom')">Library dom</button>
33
32
  <button @click="openForm('mform')">Library form</button>
34
- <button @click="openForm('method', 'fs')">Library fs</button>
35
- <button @click="openForm('method', 'task')">Library task</button>
36
- <button @click="openForm('method', 'theme')">Library theme</button>
37
- <button @click="openForm('method', 'tool')">Library tool</button>
38
- <button @click="openForm('method', 'zip')">Library zip</button>
33
+ <button @click="openForm('mfs')">Library fs</button>
34
+ <button @click="openForm('mnative')">Library native</button>
35
+ <button @click="openForm('mtask')">Library task</button>
36
+ <button @click="openForm('mtheme')">Library theme</button>
37
+ <button @click="openForm('mtool')">Library tool</button>
38
+ <button @click="openForm('mzip')">Library zip</button>
39
+ <button @click="openForm('aform')">Abstract Form</button>
40
+ <button @click="openForm('msystem')">System</button>
39
41
  </layout>
40
- </overflow>
41
- <overflow v-else class="inner" direction="v">
42
+ </flow>
43
+ <flow v-else class="inner" direction="v">
42
44
  <layout class="buttons" gutter="10" direction="v">
43
- <button @click="openForm('event', 'screen')">About screen</button>
44
- <button @click="openForm('event', 'form')">About form</button>
45
- <button @click="openForm('event', 'task')">About task</button>
45
+ <button @click="openForm('escreen')">About screen</button>
46
+ <button @click="openForm('eform')">About form</button>
47
+ <button @click="openForm('etask')">About task</button>
46
48
  </layout>
47
- </overflow>
49
+ </flow>
48
50
  </tab>
49
51
  </form>
@@ -0,0 +1,57 @@
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.fid = '0';
17
+ this.sendValue = 'sendValue';
18
+ this.test = 'A';
19
+ this.dr = '';
20
+ }
21
+ ccreateForm() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const frm = yield this.createForm('test');
24
+ if (typeof frm === 'number') {
25
+ return;
26
+ }
27
+ frm.show();
28
+ });
29
+ }
30
+ ssend() {
31
+ this.send(parseInt(this.fid), {
32
+ 'key': this.sendValue
33
+ });
34
+ }
35
+ hhide() {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ this.hide();
38
+ yield clickgo.tool.sleep(1000);
39
+ this.show();
40
+ });
41
+ }
42
+ sshowDialog() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const frm = yield this.createForm('test');
45
+ if (typeof frm === 'number') {
46
+ return;
47
+ }
48
+ this.dr = yield frm.showDialog();
49
+ });
50
+ }
51
+ onMounted() {
52
+ this.watch('test', () => __awaiter(this, void 0, void 0, function* () {
53
+ yield clickgo.form.dialog('test changed.');
54
+ }));
55
+ }
56
+ }
57
+ exports.default = default_1;
@@ -0,0 +1,35 @@
1
+ <form width="350" height="400" title="Abstract Form">
2
+ <flow direction="v" style="flex: 1; padding: 10px;">
3
+ <layout gutter="10" direction="v" style="flex: 1;">
4
+ <label>filename: {{filename}}</label>
5
+ <label>controlName: {{controlName}}</label>
6
+ <label>taskId: {{taskId}}</label>
7
+ <label>formId: {{formId}}</label>
8
+ <label>formFocus: {{formFocus}}</label>
9
+ <label>path: {{path}}</label>
10
+ <label>locale: {{locale}}</label>
11
+ <label>isMask: {{isMask}}</label>
12
+ <layout gutter="10" align-v="center">
13
+ <label>test: {{test}}</label>
14
+ <button @click="test = test === 'A' ? 'B' : 'A'" style="height: 30px; flex: 1;">watch('test', () => { dialog })</button>
15
+ </layout>
16
+ <button @click="ccreateForm" style="height: 30px;">createForm('test')</button>
17
+ <button @click="topMost = !topMost" style="height: 30px;">topMost: {{topMost ? 'true' : 'false'}}</button>
18
+ <layout gutter="10" align-v="center">
19
+ <label>Form ID:</label>
20
+ <text v-model="fid" style="flex: 1; width: 0; height: 30px;"></text>
21
+ </layout>
22
+ <layout gutter="10" align-v="center">
23
+ <label>Send: </label>
24
+ <text v-model="sendValue" style="flex: 1; width: 0; height: 30px;"></text>
25
+ <button @click="ssend" style="padding: 0 10px; height: 30px;">send({{fid}}, { 'key': '{{sendValue}}' })</button>
26
+ </layout>
27
+ <button @click="hhide" style="height: 30px;">hide() and show()</button>
28
+ <layout gutter="10" align-v="center">
29
+ <button @click="sshowDialog" style="height: 30px; flex: 1;">showDialog()</button>
30
+ <label>result: {{dr}}</label>
31
+ </layout>
32
+ <button @click="close" style="height: 30px;">close()</button>
33
+ </layout>
34
+ </flow>
35
+ </form>
@@ -0,0 +1,6 @@
1
+ <form width="200" height="200" title="From path">
2
+ <layout align-v="center" align-h="center" direction="v" gutter="10" style="flex: 1; width: 0;">
3
+ <label>Haha!</label>
4
+ <button @click="dialogResult = dialogResult ? '' : 'Done'" style="padding: 10px;">{{dialogResult ? 'Remove' : 'Set'}} dialogResult</button>
5
+ </layout>
6
+ </form>
@@ -9,17 +9,20 @@ 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.computed = void 0;
13
12
  const clickgo = require("clickgo");
14
- exports.computed = {
15
- 'config': function () {
16
- return JSON.stringify(clickgo.core.config, null, 4);
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ get config() {
15
+ return JSON.stringify(clickgo.core.config, null, 4).replace(/"icon": "([\s\S]+?)"/g, '"icon": "data:image/..."');
17
16
  }
18
- };
19
- exports.methods = {
20
- getAvailArea: function () {
17
+ getCdn() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield clickgo.form.dialog(clickgo.core.getCdn());
20
+ });
21
+ }
22
+ getAvailArea() {
21
23
  return __awaiter(this, void 0, void 0, function* () {
22
24
  yield clickgo.form.dialog(JSON.stringify(clickgo.core.getAvailArea()));
23
25
  });
24
26
  }
25
- };
27
+ }
28
+ exports.default = default_1;
@@ -1,7 +1,8 @@
1
1
  <form width="350" height="400" title="Library task" padding="10">
2
2
  <layout direction="v" gutter="10" style="flex: 1;">
3
- <button @click="getAvailArea" style="height: 30px;">getAvailArea()</button>
4
3
  <label>config:</label>
5
4
  <text v-model="config" readonly multi style="flex: 1;"></text>
5
+ <button @click="getCdn" style="height: 30px;">getCdn()</button>
6
+ <button @click="getAvailArea" style="height: 30px;">getAvailArea()</button>
6
7
  </layout>
7
8
  </form>
@@ -9,155 +9,147 @@ 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
- 'watchSizeText': false,
16
- 'watchSizeHeight': true,
17
- 'watchText': false,
18
- 'watchInner': true,
19
- 'watchStyleChange': true,
20
- 'bindGestureText': '',
21
- 'bindGestureWheelText': '',
22
- 'bindLongText': false,
23
- 'moveLeft': 0,
24
- 'moveTop': 0,
25
- 'moveWidth': 25,
26
- 'moveHeight': 25,
27
- };
28
- exports.computed = {
29
- 'isMove': function () {
13
+ class default_1 extends clickgo.form.AbstractForm {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.watchSizeText = false;
17
+ this.watchSizeHeight = true;
18
+ this.watchText = false;
19
+ this.watchInner = true;
20
+ this.watchStyleChange = true;
21
+ this.bindGestureText = '';
22
+ this.bindGestureWheelText = '';
23
+ this.bindLongText = false;
24
+ this.moveLeft = 0;
25
+ this.moveTop = 0;
26
+ this.moveWidth = 25;
27
+ this.moveHeight = 25;
28
+ }
29
+ get isMove() {
30
30
  return clickgo.dom.is.move;
31
- },
32
- 'isShift': function () {
31
+ }
32
+ get isShift() {
33
33
  return clickgo.dom.is.shift;
34
- },
35
- 'isCtrl': function () {
34
+ }
35
+ get isCtrl() {
36
36
  return clickgo.dom.is.ctrl;
37
37
  }
38
- };
39
- exports.methods = {
40
- setGlobalCursor: function (type) {
38
+ setGlobalCursor(type) {
41
39
  clickgo.dom.setGlobalCursor(type);
42
- },
43
- hasTouchButMouse: function (e) {
40
+ }
41
+ hasTouchButMouse(e) {
44
42
  clickgo.form.dialog(clickgo.dom.hasTouchButMouse(e) ? 'true' : 'false').catch((e) => { throw e; });
45
- },
46
- getStyleCount: function () {
43
+ }
44
+ getStyleCount() {
47
45
  clickgo.form.dialog(clickgo.dom.getStyleCount(this.taskId, 'form').toString()).catch((e) => { throw e; });
48
- },
49
- getSize: function () {
50
- clickgo.form.dialog(JSON.stringify(clickgo.dom.getSize(this.$refs.getSize.$el))).catch((e) => { throw e; });
51
- },
52
- watchSize: function () {
46
+ }
47
+ watchSize() {
53
48
  this.watchSizeText = !this.watchSizeText;
54
49
  if (this.watchSizeText) {
55
- clickgo.dom.watchSize(this.$refs.watchSize.$el, (size) => {
56
- clickgo.form.dialog(JSON.stringify(size)).catch((e) => { throw e; });
50
+ clickgo.dom.watchSize(this.refs.watchSize.$el, () => {
51
+ clickgo.form.dialog(JSON.stringify({
52
+ 'width': this.refs.watchSize.$el.offsetWidth,
53
+ 'height': this.refs.watchSize.$el.offsetHeight
54
+ })).catch((e) => { throw e; });
57
55
  });
58
56
  }
59
57
  else {
60
- clickgo.dom.unwatchSize(this.$refs.watchSize.$el);
58
+ clickgo.dom.unwatchSize(this.refs.watchSize.$el);
61
59
  }
62
- },
63
- watch: function () {
60
+ }
61
+ wwatch() {
64
62
  this.watchText = !this.watchText;
65
63
  if (this.watchText) {
66
- clickgo.dom.watch(this.$refs.watch.$el, () => {
64
+ clickgo.dom.watch(this.refs.watch.$el, () => {
67
65
  clickgo.form.dialog('Changed.').catch((e) => { throw e; });
68
66
  });
69
67
  }
70
68
  else {
71
- clickgo.dom.unwatch(this.$refs.watch.$el);
69
+ clickgo.dom.unwatch(this.refs.watch.$el);
72
70
  }
73
- },
74
- isWatchStyle: function () {
75
- clickgo.form.dialog(clickgo.dom.isWatchStyle(this.$refs.watchStyle.$el) ? 'true' : 'false').catch((e) => { throw e; });
76
- },
77
- bindGesture: function (e) {
78
- clickgo.dom.bindGesture(e, {
79
- 'dirs': ['top', 'bottom'],
80
- handler: (dir) => {
81
- this.bindGestureText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
82
- const handler = () => __awaiter(this, void 0, void 0, function* () {
83
- yield clickgo.tool.sleep(500);
84
- this.bindGestureText = '';
85
- });
86
- handler().catch((e) => {
87
- console.log(e);
88
- });
71
+ }
72
+ isWatchStyle() {
73
+ clickgo.form.dialog(clickgo.dom.isWatchStyle(this.refs.watchStyle.$el) ? 'true' : 'false').catch((e) => { throw e; });
74
+ }
75
+ bindGesture(e) {
76
+ clickgo.dom.bindGesture(e, (ne, dir) => {
77
+ if (['top', 'bottom'].includes(dir)) {
78
+ return true;
89
79
  }
90
- });
91
- },
92
- bindGestureWheel: function (e) {
93
- clickgo.dom.bindGesture(e, {
94
- 'dirs': ['top', 'bottom', 'left', 'right'],
95
- handler: (dir) => {
96
- this.bindGestureWheelText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
97
- const handler = () => __awaiter(this, void 0, void 0, function* () {
98
- yield clickgo.tool.sleep(500);
99
- this.bindGestureWheelText = '';
100
- });
101
- handler().catch((e) => {
102
- console.log(e);
103
- });
80
+ return false;
81
+ }, (dir) => __awaiter(this, void 0, void 0, function* () {
82
+ this.bindGestureText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
83
+ yield clickgo.tool.sleep(500);
84
+ this.bindGestureText = '';
85
+ }));
86
+ }
87
+ bindGestureWheel(e) {
88
+ clickgo.dom.bindGesture(e, (ne, dir) => {
89
+ if (['top', 'bottom', 'left', 'right'].includes(dir)) {
90
+ return true;
104
91
  }
105
- });
106
- },
107
- bindLong: function () {
92
+ return false;
93
+ }, (dir) => __awaiter(this, void 0, void 0, function* () {
94
+ this.bindGestureWheelText = dir.slice(0, 1).toUpperCase() + dir.slice(1);
95
+ yield clickgo.tool.sleep(500);
96
+ this.bindGestureWheelText = '';
97
+ }));
98
+ }
99
+ bindLong() {
108
100
  clickgo.form.dialog('Press and hold this button.').catch((e) => { throw e; });
109
- },
110
- bindLongDown: function (e) {
101
+ }
102
+ bindLongDown(e) {
111
103
  clickgo.dom.bindLong(e, () => __awaiter(this, void 0, void 0, function* () {
112
104
  this.bindLongText = true;
113
105
  yield clickgo.tool.sleep(500);
114
106
  this.bindLongText = false;
115
107
  }));
116
- },
117
- bindDragDown: function (e) {
108
+ }
109
+ bindDragDown(e) {
118
110
  clickgo.dom.bindDrag(e, {
119
- 'el': this.$refs.bindDrag,
111
+ 'el': this.refs.bindDrag,
120
112
  'data': 'bindDragDownTest'
121
113
  });
122
- },
123
- dragEnter: function (e) {
114
+ }
115
+ dragEnter(e) {
124
116
  return __awaiter(this, void 0, void 0, function* () {
125
117
  e.target.innerText = 'enter';
126
118
  yield clickgo.tool.sleep(200);
127
119
  e.target.innerText = '';
128
120
  });
129
- },
130
- dragLeave: function (e) {
121
+ }
122
+ dragLeave(e) {
131
123
  return __awaiter(this, void 0, void 0, function* () {
132
124
  e.target.innerText = 'leave';
133
125
  yield clickgo.tool.sleep(200);
134
126
  e.target.innerText = '';
135
127
  });
136
- },
137
- drop: function (e) {
128
+ }
129
+ drop(e) {
138
130
  return __awaiter(this, void 0, void 0, function* () {
139
131
  e.target.innerText = 'drop';
140
132
  yield clickgo.tool.sleep(500);
141
133
  e.target.innerText = '';
142
134
  });
143
- },
144
- bindMoveDown: function (e) {
135
+ }
136
+ bindMoveDown(e) {
145
137
  clickgo.dom.bindMove(e, {
146
138
  'areaObject': e.currentTarget,
147
- 'object': this.$refs.move,
148
- move: (ox, oy) => {
149
- this.moveLeft += ox;
150
- this.moveTop += oy;
139
+ 'object': this.refs.move,
140
+ move: (e, o) => {
141
+ this.moveLeft += o.ox;
142
+ this.moveTop += o.oy;
151
143
  }
152
144
  });
153
- },
154
- fullscreen: function () {
145
+ }
146
+ fullscreen() {
155
147
  clickgo.dom.fullscreen();
156
148
  }
157
- };
158
- const mounted = function () {
159
- clickgo.dom.watchStyle(this.$refs.watchStyle.$el, 'font-size', (n, v) => {
160
- clickgo.form.dialog('name: ' + n + ', value: ' + v).catch((e) => { throw e; });
161
- });
162
- };
163
- exports.mounted = mounted;
149
+ onMounted() {
150
+ clickgo.dom.watchStyle(this.refs.watchStyle.$el, 'font-size', (n, v) => {
151
+ clickgo.form.dialog('name: ' + n + ', value: ' + v).catch((e) => { throw e; });
152
+ });
153
+ }
154
+ }
155
+ exports.default = default_1;
@@ -1,22 +1,21 @@
1
- <form width="400" height="450" title="Library dom" padding="10">
2
- <overflow direction="v" style="flex: 1;">
1
+ <form width="400" height="450" title="Library dom">
2
+ <flow direction="v" style="flex: 1; padding: 10px;">
3
3
  <layout gutter="10" direction="v" style="flex: 1;">
4
4
  <button @click="setGlobalCursor('wait')" style="height: 30px;">setGlobalCursor('wait')</button>
5
5
  <button @click="setGlobalCursor" style="height: 30px;">setGlobalCursor()</button>
6
6
  <button @click="hasTouchButMouse" style="height: 30px;">hasTouchButMouse()</button>
7
7
  <button @click="getStyleCount" style="height: 30px;">getStyleCount({{taskId}}, 'form')</button>
8
- <button @click="getSize" ref="getSize" style="height: 30px;">getSize(this.$refs.getSize)</button>
9
8
  <layout gutter="10">
10
9
  <button @click="watchSize" ref="watchSize" :style="{'height': (watchSizeHeight ? 30 : 50) + 'px'}" style="padding: 0 5px; flex: 1;">{{watchSizeText ? '' : '!'}}watchSize</button>
11
10
  <button @click="watchSizeHeight = !watchSizeHeight" style="padding: 0 5px; flex: 1;">Change</button>
12
11
  </layout>
13
12
  <layout gutter="10">
14
13
  <layout ref="watch" align-v="center" align-h="center" style="flex: 1; background: #FFF;">{{watchInner ? 'inner' : 'Inner'}}</layout>
15
- <button @click="watch" style="height: 30px; padding: 0 5px;">{{watchText ? '' : '!'}}watch</button>
14
+ <button @click="wwatch" style="height: 30px; padding: 0 5px;">{{watchText ? '' : '!'}}watch</button>
16
15
  <button @click="watchInner = !watchInner" style="padding: 0 5px;">Change</button>
17
16
  </layout>
18
- <button @click="watchStyleChange = !watchStyleChange" ref="watchStyle" style="height: 30px;" :style="{'font-size': watchStyleChange ? 'inherit' : '16px'}">watchStyle(this.$refs.watchStyle.$el, 'font-size', (n, v) => { ... })</button>
19
- <button @click="isWatchStyle" style="height: 30px;">isWatchStyle(this.$refs.watchStyle.$el)</button>
17
+ <button @click="watchStyleChange = !watchStyleChange" ref="watchStyle" style="height: 30px;" :style="{'font-size': watchStyleChange ? 'inherit' : '16px'}">watchStyle(this.refs.watchStyle.$el, 'font-size', (n, v) => { ... })</button>
18
+ <button @click="isWatchStyle" style="height: 30px;">isWatchStyle(this.refs.watchStyle.$el)</button>
20
19
  <block @mousedown="bindGesture" @touchstart="bindGesture" style="height: 50px; background: #FFF; display: flex; justify-content: center; align-items: center; color: rgba(0, 0, 0, .5); font-size: 14px;">{{bindGestureText ? bindGestureText : 'bindGesture(e: Touch | Mouse, { ... })'}}</block>
21
20
  <block @wheel="bindGestureWheel" style="height: 50px; background: #FFF; display: flex; justify-content: center; align-items: center; color: rgba(0, 0, 0, .5); font-size: 14px;">{{bindGestureWheelText ? bindGestureWheelText : 'bindGesture(e: Wheel, { ... })'}}</block>
22
21
  <button @click="bindLong" ref="bindLong" @mousedown="bindLongDown" @touchstart="bindLongDown" style="height: 30px;">{{bindLongText ? 'Yeah!' : 'bindLong(e, () => { ... })'}}</button>
@@ -51,5 +50,5 @@
51
50
  <label>clickgo.form.is.shift: {{isShift ? 'true' : 'false'}}</label>
52
51
  <label>clickgo.form.is.ctrl: {{isCtrl ? 'true' : 'false'}}</label>
53
52
  </layout>
54
- </overflow>
53
+ </flow>
55
54
  </form>
@@ -14,10 +14,9 @@ class default_1 extends clickgo.form.AbstractForm {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this.fid = '0';
17
- this.sendValue = 'sendValue';
18
17
  this.tid = '0';
19
- this.type = 'primary';
20
- this.progress = 'noraml';
18
+ this.type = ['primary'];
19
+ this.progress = ['noraml'];
21
20
  this.dr = '';
22
21
  this.setTopMostValue = false;
23
22
  }
@@ -42,20 +41,15 @@ class default_1 extends clickgo.form.AbstractForm {
42
41
  get() {
43
42
  clickgo.form.dialog(JSON.stringify(clickgo.form.get(parseInt(this.fid)))).catch((e) => { throw e; });
44
43
  }
45
- send() {
46
- clickgo.form.send(parseInt(this.fid), {
47
- 'key': this.sendValue
48
- });
49
- }
50
44
  changeFocus() {
51
45
  clickgo.form.changeFocus(parseInt(this.fid));
52
46
  }
53
47
  getList() {
54
- let str = JSON.stringify(clickgo.form.getList(this.taskId));
48
+ let str = JSON.stringify(clickgo.form.getList(parseInt(this.tid)));
55
49
  str = str.replace(/"icon":"(.*?)"/g, function (t, t1) {
56
50
  return `"icon":"${t1 ? (t1.slice(0, 10) + '...') : t1}"`;
57
51
  });
58
- clickgo.form.dialog(`<overflow direction="v" style="width: 200px; height: 80px;">${str}</overflow>`).catch((e) => { throw e; });
52
+ clickgo.form.dialog(`<flow direction="v" style="width: 200px; height: 80px;">${str}</flow>`).catch((e) => { throw e; });
59
53
  }
60
54
  getMaxZIndexID() {
61
55
  const fid = clickgo.form.getMaxZIndexID();
@@ -92,7 +86,7 @@ class default_1 extends clickgo.form.AbstractForm {
92
86
  notify() {
93
87
  return __awaiter(this, void 0, void 0, function* () {
94
88
  let icon = null;
95
- if (this.progress === 'progress + icon') {
89
+ if (this.progress[0] === 'progress + icon') {
96
90
  icon = yield clickgo.fs.getContent('/package/res/icon.svg');
97
91
  }
98
92
  if (icon instanceof Blob) {
@@ -101,11 +95,11 @@ class default_1 extends clickgo.form.AbstractForm {
101
95
  const nid = clickgo.form.notify({
102
96
  'title': 'Notify',
103
97
  'content': 'Content',
104
- 'type': this.type,
105
- 'progress': (this.progress === 'progress + icon') ? true : false,
98
+ 'type': this.type[0],
99
+ 'progress': (this.progress[0] === 'progress + icon') ? true : false,
106
100
  'icon': icon
107
101
  });
108
- if (this.progress === 'progress + icon') {
102
+ if (this.progress[0] === 'progress + icon') {
109
103
  clickgo.form.notifyProgress(nid, 12);
110
104
  yield clickgo.tool.sleep(1000);
111
105
  clickgo.form.notifyProgress(nid, 30);
@@ -124,14 +118,6 @@ class default_1 extends clickgo.form.AbstractForm {
124
118
  }
125
119
  clickgo.form.showPop(e.currentTarget, this.refs.pop, 'v');
126
120
  }
127
- createParam() {
128
- clickgo.form.create({
129
- 'layout': '<form width=\'300\' height=\'300\' title=\'normal\'></form>'
130
- }).catch((e) => { throw e; });
131
- }
132
- createPath() {
133
- this.createForm('test').then((e) => { console.log(e); }).catch((e) => { throw e; });
134
- }
135
121
  createTop() {
136
122
  return __awaiter(this, void 0, void 0, function* () {
137
123
  const frm = yield this.createForm('test');
@@ -201,12 +187,8 @@ class default_1 extends clickgo.form.AbstractForm {
201
187
  flash() {
202
188
  clickgo.form.flash(this.formId);
203
189
  }
204
- hhide() {
205
- return __awaiter(this, void 0, void 0, function* () {
206
- this.hide();
207
- yield clickgo.tool.sleep(1000);
208
- this.show();
209
- });
190
+ showLauncher() {
191
+ clickgo.form.showLauncher();
210
192
  }
211
193
  onReceive(obj) {
212
194
  clickgo.form.dialog(JSON.stringify(obj)).catch((e) => { throw e; });