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,50 +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
39
  <button @click="openForm('aform')">Abstract Form</button>
40
+ <button @click="openForm('msystem')">System</button>
40
41
  </layout>
41
- </overflow>
42
- <overflow v-else class="inner" direction="v">
42
+ </flow>
43
+ <flow v-else class="inner" direction="v">
43
44
  <layout class="buttons" gutter="10" direction="v">
44
- <button @click="openForm('event', 'screen')">About screen</button>
45
- <button @click="openForm('event', 'form')">About form</button>
46
- <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>
47
48
  </layout>
48
- </overflow>
49
+ </flow>
49
50
  </tab>
50
51
  </form>
@@ -1,5 +1,5 @@
1
1
  <form width="350" height="400" title="Abstract 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
4
  <label>filename: {{filename}}</label>
5
5
  <label>controlName: {{controlName}}</label>
@@ -29,6 +29,7 @@
29
29
  <button @click="sshowDialog" style="height: 30px; flex: 1;">showDialog()</button>
30
30
  <label>result: {{dr}}</label>
31
31
  </layout>
32
+ <button @click="close" style="height: 30px;">close()</button>
32
33
  </layout>
33
- </overflow>
34
+ </flow>
34
35
  </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>
@@ -15,8 +15,8 @@ class default_1 extends clickgo.form.AbstractForm {
15
15
  super(...arguments);
16
16
  this.fid = '0';
17
17
  this.tid = '0';
18
- this.type = 'primary';
19
- this.progress = 'noraml';
18
+ this.type = ['primary'];
19
+ this.progress = ['noraml'];
20
20
  this.dr = '';
21
21
  this.setTopMostValue = false;
22
22
  }
@@ -45,11 +45,11 @@ class default_1 extends clickgo.form.AbstractForm {
45
45
  clickgo.form.changeFocus(parseInt(this.fid));
46
46
  }
47
47
  getList() {
48
- let str = JSON.stringify(clickgo.form.getList(this.taskId));
48
+ let str = JSON.stringify(clickgo.form.getList(parseInt(this.tid)));
49
49
  str = str.replace(/"icon":"(.*?)"/g, function (t, t1) {
50
50
  return `"icon":"${t1 ? (t1.slice(0, 10) + '...') : t1}"`;
51
51
  });
52
- 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; });
53
53
  }
54
54
  getMaxZIndexID() {
55
55
  const fid = clickgo.form.getMaxZIndexID();
@@ -86,7 +86,7 @@ class default_1 extends clickgo.form.AbstractForm {
86
86
  notify() {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  let icon = null;
89
- if (this.progress === 'progress + icon') {
89
+ if (this.progress[0] === 'progress + icon') {
90
90
  icon = yield clickgo.fs.getContent('/package/res/icon.svg');
91
91
  }
92
92
  if (icon instanceof Blob) {
@@ -95,11 +95,11 @@ class default_1 extends clickgo.form.AbstractForm {
95
95
  const nid = clickgo.form.notify({
96
96
  'title': 'Notify',
97
97
  'content': 'Content',
98
- 'type': this.type,
99
- 'progress': (this.progress === 'progress + icon') ? true : false,
98
+ 'type': this.type[0],
99
+ 'progress': (this.progress[0] === 'progress + icon') ? true : false,
100
100
  'icon': icon
101
101
  });
102
- if (this.progress === 'progress + icon') {
102
+ if (this.progress[0] === 'progress + icon') {
103
103
  clickgo.form.notifyProgress(nid, 12);
104
104
  yield clickgo.tool.sleep(1000);
105
105
  clickgo.form.notifyProgress(nid, 30);
@@ -1,5 +1,5 @@
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
4
  <label>This form id: {{formId}}</label>
5
5
  <button @click="min" style="height: 30px;">min({{formId}})</button>
@@ -30,8 +30,8 @@
30
30
  <button @click="notify" style="padding: 0 10px;">notify({ ... })</button>
31
31
  </layout>
32
32
  <button @click="showPop" style="height: 30px;">showPop(e.currentTarget, this.refs.pop)</button>
33
- <teleport to="#cg-pop-list">
34
- <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>
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>
35
35
  </teleport>
36
36
  <label>Dialog result: {{dr}}.</label>
37
37
  <button @click="dialog" style="height: 30px;">dialog('Hello world!')</button>
@@ -44,5 +44,5 @@
44
44
  <button @click="flash" style="height: 30px;">flash({{formId}})</button>
45
45
  <button @click="showLauncher" style="height: 30px;">showLauncher()</button>
46
46
  </layout>
47
- </overflow>
47
+ </flow>
48
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>