clickgo 3.0.0-dev

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 (145) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +75 -0
  3. package/dist/app/demo/config.json +106 -0
  4. package/dist/app/demo/form/control/block/block.css +1 -0
  5. package/dist/app/demo/form/control/block/block.scss +17 -0
  6. package/dist/app/demo/form/control/block/block.xml +7 -0
  7. package/dist/app/demo/form/control/button/button.css +1 -0
  8. package/dist/app/demo/form/control/button/button.js +27 -0
  9. package/dist/app/demo/form/control/button/button.scss +18 -0
  10. package/dist/app/demo/form/control/button/button.xml +126 -0
  11. package/dist/app/demo/form/control/check/check.js +12 -0
  12. package/dist/app/demo/form/control/check/check.xml +13 -0
  13. package/dist/app/demo/form/control/dialog/dialog.js +8 -0
  14. package/dist/app/demo/form/control/dialog/dialog.xml +26 -0
  15. package/dist/app/demo/form/control/file/file.js +23 -0
  16. package/dist/app/demo/form/control/file/file.xml +25 -0
  17. package/dist/app/demo/form/control/form/form.css +1 -0
  18. package/dist/app/demo/form/control/form/form.js +38 -0
  19. package/dist/app/demo/form/control/form/form.scss +9 -0
  20. package/dist/app/demo/form/control/form/form.xml +28 -0
  21. package/dist/app/demo/form/control/greatview/greatview.css +1 -0
  22. package/dist/app/demo/form/control/greatview/greatview.js +92 -0
  23. package/dist/app/demo/form/control/greatview/greatview.scss +22 -0
  24. package/dist/app/demo/form/control/greatview/greatview.xml +89 -0
  25. package/dist/app/demo/form/control/img/img.xml +16 -0
  26. package/dist/app/demo/form/control/label/label.xml +11 -0
  27. package/dist/app/demo/form/control/list/list.css +1 -0
  28. package/dist/app/demo/form/control/list/list.js +194 -0
  29. package/dist/app/demo/form/control/list/list.scss +7 -0
  30. package/dist/app/demo/form/control/list/list.xml +91 -0
  31. package/dist/app/demo/form/control/loading/loading.xml +8 -0
  32. package/dist/app/demo/form/control/marquee/marquee.js +30 -0
  33. package/dist/app/demo/form/control/marquee/marquee.xml +36 -0
  34. package/dist/app/demo/form/control/menu/menu.js +8 -0
  35. package/dist/app/demo/form/control/menu/menu.xml +122 -0
  36. package/dist/app/demo/form/control/monaco/monaco.js +113 -0
  37. package/dist/app/demo/form/control/monaco/monaco.xml +27 -0
  38. package/dist/app/demo/form/control/overflow/overflow.css +1 -0
  39. package/dist/app/demo/form/control/overflow/overflow.js +70 -0
  40. package/dist/app/demo/form/control/overflow/overflow.scss +18 -0
  41. package/dist/app/demo/form/control/overflow/overflow.xml +98 -0
  42. package/dist/app/demo/form/control/property/property.js +129 -0
  43. package/dist/app/demo/form/control/property/property.xml +6 -0
  44. package/dist/app/demo/form/control/radio/radio.js +7 -0
  45. package/dist/app/demo/form/control/radio/radio.xml +12 -0
  46. package/dist/app/demo/form/control/scroll/scroll.js +14 -0
  47. package/dist/app/demo/form/control/scroll/scroll.xml +35 -0
  48. package/dist/app/demo/form/control/select/select.js +91 -0
  49. package/dist/app/demo/form/control/select/select.xml +74 -0
  50. package/dist/app/demo/form/control/tab/tab.js +75 -0
  51. package/dist/app/demo/form/control/tab/tab.xml +22 -0
  52. package/dist/app/demo/form/control/text/text.js +53 -0
  53. package/dist/app/demo/form/control/text/text.xml +37 -0
  54. package/dist/app/demo/form/control/view/view.css +1 -0
  55. package/dist/app/demo/form/control/view/view.js +73 -0
  56. package/dist/app/demo/form/control/view/view.scss +18 -0
  57. package/dist/app/demo/form/control/view/view.xml +94 -0
  58. package/dist/app/demo/form/event/form/form.css +1 -0
  59. package/dist/app/demo/form/event/form/form.js +129 -0
  60. package/dist/app/demo/form/event/form/form.scss +24 -0
  61. package/dist/app/demo/form/event/form/form.xml +16 -0
  62. package/dist/app/demo/form/event/screen/screen.js +51 -0
  63. package/dist/app/demo/form/event/screen/screen.xml +9 -0
  64. package/dist/app/demo/form/event/task/task.js +78 -0
  65. package/dist/app/demo/form/event/task/task.xml +20 -0
  66. package/dist/app/demo/form/main.css +1 -0
  67. package/dist/app/demo/form/main.js +25 -0
  68. package/dist/app/demo/form/main.scss +9 -0
  69. package/dist/app/demo/form/main.xml +49 -0
  70. package/dist/app/demo/form/method/core/core.js +25 -0
  71. package/dist/app/demo/form/method/core/core.xml +7 -0
  72. package/dist/app/demo/form/method/dom/dom.css +1 -0
  73. package/dist/app/demo/form/method/dom/dom.js +163 -0
  74. package/dist/app/demo/form/method/dom/dom.scss +10 -0
  75. package/dist/app/demo/form/method/dom/dom.xml +55 -0
  76. package/dist/app/demo/form/method/form/form.css +1 -0
  77. package/dist/app/demo/form/method/form/form.js +217 -0
  78. package/dist/app/demo/form/method/form/form.scss +3 -0
  79. package/dist/app/demo/form/method/form/form.xml +56 -0
  80. package/dist/app/demo/form/method/form/test.xml +5 -0
  81. package/dist/app/demo/form/method/fs/fs.js +88 -0
  82. package/dist/app/demo/form/method/fs/fs.xml +8 -0
  83. package/dist/app/demo/form/method/fs/text.js +15 -0
  84. package/dist/app/demo/form/method/fs/text.xml +3 -0
  85. package/dist/app/demo/form/method/task/locale1.json +3 -0
  86. package/dist/app/demo/form/method/task/locale2.json +3 -0
  87. package/dist/app/demo/form/method/task/task.js +153 -0
  88. package/dist/app/demo/form/method/task/task.xml +57 -0
  89. package/dist/app/demo/form/method/theme/theme.js +74 -0
  90. package/dist/app/demo/form/method/theme/theme.xml +9 -0
  91. package/dist/app/demo/form/method/tool/tool.js +64 -0
  92. package/dist/app/demo/form/method/tool/tool.xml +26 -0
  93. package/dist/app/demo/form/method/zip/zip.js +99 -0
  94. package/dist/app/demo/form/method/zip/zip.xml +12 -0
  95. package/dist/app/demo/global.css +3 -0
  96. package/dist/app/demo/res/icon.svg +1 -0
  97. package/dist/app/demo/res/img.jpg +0 -0
  98. package/dist/app/demo/res/r-1.svg +1 -0
  99. package/dist/app/demo/res/r-2.svg +1 -0
  100. package/dist/app/demo/res/sql.svg +1 -0
  101. package/dist/app/demo/res/txt.svg +1 -0
  102. package/dist/app/demo/res/zip.svg +1 -0
  103. package/dist/app/task/config.json +29 -0
  104. package/dist/app/task/form/bar/bar.js +299 -0
  105. package/dist/app/task/form/bar/bar.xml +47 -0
  106. package/dist/app/task/form/desktop/desktop.xml +1 -0
  107. package/dist/app/task/locale/en.json +11 -0
  108. package/dist/app/task/locale/ja.json +11 -0
  109. package/dist/app/task/locale/sc.json +11 -0
  110. package/dist/app/task/locale/tc.json +11 -0
  111. package/dist/clickgo.js +41 -0
  112. package/dist/clickgo.ts +51 -0
  113. package/dist/control/common.cgc +0 -0
  114. package/dist/control/form.cgc +0 -0
  115. package/dist/control/monaco.cgc +0 -0
  116. package/dist/control/property.cgc +0 -0
  117. package/dist/control/task.cgc +0 -0
  118. package/dist/global.css +1 -0
  119. package/dist/icon.png +0 -0
  120. package/dist/index.js +88 -0
  121. package/dist/index.ts +92 -0
  122. package/dist/lib/control.js +365 -0
  123. package/dist/lib/control.ts +428 -0
  124. package/dist/lib/core.js +668 -0
  125. package/dist/lib/core.ts +732 -0
  126. package/dist/lib/dom.js +1471 -0
  127. package/dist/lib/dom.ts +1785 -0
  128. package/dist/lib/form.js +2101 -0
  129. package/dist/lib/form.ts +2496 -0
  130. package/dist/lib/fs.js +849 -0
  131. package/dist/lib/fs.ts +995 -0
  132. package/dist/lib/native.js +138 -0
  133. package/dist/lib/native.ts +219 -0
  134. package/dist/lib/task.js +686 -0
  135. package/dist/lib/task.ts +842 -0
  136. package/dist/lib/theme.js +159 -0
  137. package/dist/lib/theme.ts +196 -0
  138. package/dist/lib/tool.js +501 -0
  139. package/dist/lib/tool.ts +620 -0
  140. package/dist/lib/zip.js +352 -0
  141. package/dist/lib/zip.ts +434 -0
  142. package/dist/theme/familiar.cgt +0 -0
  143. package/package.json +27 -0
  144. package/types/dev.d.ts +30 -0
  145. package/types/index.d.ts +673 -0
@@ -0,0 +1,18 @@
1
+ .border {
2
+ border: 1px solid rgba(0, 0, 0, .1);
3
+ }
4
+
5
+ .custom {
6
+ margin: auto; background: #07c160; width: 60%; height: 30px; color: #FFF; text-align: center; line-height: 30px;
7
+ }
8
+
9
+ .rightborder {
10
+ border-right: 1px solid rgba(0, 0, 0, .1);
11
+ }
12
+
13
+ .block {
14
+ width: 200px; height: 200px; padding: 0 10px 10px 0;
15
+ }
16
+ .block block {
17
+ background: #07c160; color: #FFF; display: flex; align-items: center; justify-content: center; flex: 1;
18
+ }
@@ -0,0 +1,94 @@
1
+ <form title="View" width="450" height="450" min-width="300" min-height="400" padding="10">
2
+ <tab v-model="ntab" :tabs="['normal', 'adaptation', 'beyond', 'nest']" style="flex: 1; width: 0;">
3
+ <!-- 默认 -->
4
+ <layout v-if="ntab === 'normal'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
5
+ <!-- v -->
6
+ <layout gutter="10" style="flex: 1; height: 0;">
7
+ <view v-model:scroll-left="sLeft1" v-model:scroll-top="sTop1" direction="v" :selection="selection" @select="area = $event" @resize="c1 = $event" @change="l1 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; width: 0;">
8
+ <block v-for="(line, index) of lineCount">
9
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;">test</button>
10
+ <block v-else>Line {{line}}, index: {{index}}.</block>
11
+ </block>
12
+ </view>
13
+ <layout class="border" style="flex: 1; width: 0;">
14
+ <view v-model:scroll-left="sLeft2" v-model:scroll-top="sTop2" direction="v" :selection="selection" @select="area = $event" @resize="c2 = $event" @change="l2 = $event" @scrollborder="scrollborder($event, 'v')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" style="flex: 1; width: 0;">
15
+ <block v-for="(line, index) of lineCount">
16
+ <block v-if="index > 0 && index % 10 === 0" class="custom">Custom</block>
17
+ <block v-else>Line {{line}}, index: {{index}}.</block>
18
+ </block>
19
+ </view>
20
+ <scroll :length="l2" :client="c2" v-model:scroll-offset="sTop2" style="width: 20px;"></scroll>
21
+ </layout>
22
+ </layout>
23
+ <label>Scroll Left: {{sLeft1}}, Scroll Top: {{sTop1}}, Length: {{l1}}, Client: {{c1}}.</label>
24
+ <label>Scroll Left: {{sLeft2}}, Scroll Top: {{sTop2}}, Length: {{l2}}, Client: {{c2}}.</label>
25
+ <!-- h -->
26
+ <view v-model:scroll-left="sLeft3" v-model:scroll-top="sTop3" :selection="selection" @select="area = $event" @resize="c3 = $event" @change="l3 = $event" @scrollborder="scrollborder($event, 'h')" :style="{'line-height': style ? '1.5' : undefined, 'padding': style ? '10px' : undefined}" class="border" style="flex: 1; height: 0;">
27
+ <layout v-for="(line, index) of lineCount" align-v="center" align-h="center" direction="v" class="rightborder" style="width: 80px;">
28
+ <label>Col {{line}}.</label>
29
+ <label>index: {{index}}.</label>
30
+ </layout>
31
+ </view>
32
+ <label>Scroll Left: {{sLeft3}}, Scroll Top: {{sTop3}}, Length: {{l3}}, Client: {{c3}}.</label>
33
+ <label>Selection area: {{area}}</label>
34
+ <!-- button list -->
35
+ <layout gutter="10">
36
+ <select v-model="lineValue" :data="[10, 50]" style="flex: 1; width: 0;"></select>
37
+ <button @click="lineCount += lineValue" style="height: 30px; padding: 0 10px;">Add lines</button>
38
+ <button @click="lineCount -= lineValue;if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
39
+ </layout>
40
+ <layout gutter="10">
41
+ <button @click="gesture = !gesture" style="flex: 1; width: 0; height: 30px;">{{gesture ? '' : '!'}}gesture</button>
42
+ <button @click="selection = !selection" style="flex: 1; width: 0; height: 30px;">{{selection ? '' : '!'}}selection</button>
43
+ <button @click="style = !style" style="flex: 1; width: 0; height: 30px;">{{style ? '' : '!'}}style</button>
44
+ </layout>
45
+ </layout>
46
+ <!-- 自适应 -->
47
+ <layout v-else-if="ntab === 'adaptation'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
48
+ <layout :direction="direction ? 'h' : 'v'" style="flex: 1; height: 0;">
49
+ <view class="border" v-model:scroll-left="sLeft4" v-model:scroll-top="sTop4" :direction="direction ? 'h' : 'v'" @resize="c4 = $event" @change="l4 = $event" @scrollborder="scrollborder($event, 'v')">
50
+ <layout v-for="(line, index) of lineCount" align-v="center" direction="v" :class="[direction && 'rightborder']">
51
+ <button v-if="index > 0 && index % 10 === 0" style="height: 30px;" :style="{'width': direction ? '30px' : undefined}">test</button>
52
+ <block v-else :style="{'width': direction ? '80px' : undefined, 'text-align': direction ? 'center' : undefined}">Line {{line}}</block>
53
+ </layout>
54
+ </view>
55
+ </layout>
56
+ <label>Scroll Left: {{sLeft4}}, Scroll Top: {{sTop4}}, Length: {{l4}}, Client: {{c4}}.</label>
57
+ <layout gutter="10">
58
+ <button @click="lineCount += 10" style="flex: 1; width: 0; height: 30px;">Add 10 lines</button>
59
+ <button @click="lineCount -= 10;if(lineCount < 0) {lineCount = 0;}" style="flex: 1; width: 0; height: 30px;">Remove 10 lines</button>
60
+ <button @click="direction = !direction" style="flex: 1; height: 30px;">Direction</button>
61
+ </layout>
62
+ </layout>
63
+ <!-- 内容超出 -->
64
+ <layout v-else-if="ntab === 'beyond'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
65
+ <layout gutter="10" align-v="center">
66
+ <button @click="dir5 = (dir5 === 'h' ? 'v' : 'h')" style="flex: 1; width: 0; height: 30px;">Change direction</button>
67
+ <button @click="line5 = (line5 === 10 ? 1 : 10)" style="flex: 1; width: 0; height: 30px;">Change data</button>
68
+ <label>Direction: {{dir5}}</label>
69
+ </layout>
70
+ <view v-model:scroll-left="sLeft5" v-model:scroll-top="sTop5" content="max" @resize="c5 = $event" @change="l5 = $event" :direction="dir5" class="border" style="flex: 1; height: 0; padding: 10px 0 0 10px;">
71
+ <layout v-for="i of line5" :direction="dir5 === 'h' ? 'v' : 'h'">
72
+ <layout v-for="j of 10" class="block">
73
+ <block>{{i}}-{{j}}</block>
74
+ </layout>
75
+ </layout>
76
+ </view>
77
+ <label>Scroll Left: {{sLeft5}}, Scroll Top: {{sTop5}}, Length: {{l5}}, Client: {{c5}}.</label>
78
+ </layout>
79
+ <!-- 嵌套 -->
80
+ <layout v-else style="flex: 1; width: 0; padding: 10px;">
81
+ <view class="border" direction="v" @resizen="c6 = $event" solo="false" style="flex: 1; width: 0;">
82
+ <template v-for="i of 100">
83
+ <view v-if="i === 30" class="border" direction="v" solo="false" style="height: 50px;">
84
+ <label v-for="k of 50">Line {{k}}</label>
85
+ </view>
86
+ <view v-else-if="i === 40" class="border" solo="false" style="height: 50px;" :style="{'width': c6 + 'px'}">
87
+ <label v-for="k of 50" class="rightborder" style="width: 80px;">Line {{k}}</label>
88
+ </view>
89
+ <label v-else>Line {{i}}</label>
90
+ </template>
91
+ </view>
92
+ </layout>
93
+ </tab>
94
+ </form>
@@ -0,0 +1 @@
1
+ @keyframes flash{0%,50%{border:solid 1px rgba(0,0,0,.8);color:initial}51%,100%{border-color:#000;background-color:#333;color:#fff}}.item{border:solid 1px #333;padding:5px;min-height:30px;min-width:150px}.item.focus{background-color:#fff;color:#333}.item:hover{background-color:rgba(0,0,0,.1)}.item:active{background-color:#333;color:#fff}.item.flash{animation:flash .2s linear infinite}
@@ -0,0 +1,129 @@
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
+ exports.mounted = exports.methods = exports.data = void 0;
13
+ const clickgo = require("clickgo");
14
+ exports.data = {
15
+ 'flist': {},
16
+ 'list': []
17
+ };
18
+ exports.methods = {
19
+ 'pushConsole': function (name, text) {
20
+ const date = new Date();
21
+ this.list.unshift({
22
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
23
+ 'name': name,
24
+ 'text': text
25
+ });
26
+ },
27
+ 'changeFocus': function (fid) {
28
+ clickgo.form.changeFocus(parseInt(fid));
29
+ }
30
+ };
31
+ const mounted = function () {
32
+ const list = clickgo.task.getList();
33
+ for (const taskId in list) {
34
+ const flist = clickgo.form.getList(parseInt(taskId));
35
+ for (const fid in flist) {
36
+ this.flist[fid] = {
37
+ 'title': flist[fid].title,
38
+ 'icon': flist[fid].icon,
39
+ 'stateMax': flist[fid].stateMax,
40
+ 'stateMin': flist[fid].stateMin,
41
+ 'show': flist[fid].show,
42
+ 'focus': flist[fid].focus,
43
+ 'flash': false
44
+ };
45
+ }
46
+ }
47
+ clickgo.core.setSystemEventListener('formCreated', (taskId, formId, title, icon) => {
48
+ this.flist[formId] = {
49
+ 'title': title,
50
+ 'icon': icon,
51
+ 'stateMax': false,
52
+ 'stateMin': false,
53
+ 'show': false,
54
+ 'focus': false,
55
+ 'flash': false
56
+ };
57
+ this.pushConsole('formCreated', `taskId: ${taskId}, formId: ${formId}, title: ${title}, icon: ${icon ? icon.slice(0, 10) + '...' : 'null'}`);
58
+ });
59
+ clickgo.core.setSystemEventListener('formRemoved', (taskId, formId, title, icon) => {
60
+ if (!this.flist[formId]) {
61
+ return;
62
+ }
63
+ this.flist[formId] = undefined;
64
+ delete this.flist[formId];
65
+ this.pushConsole('formRemoved', `taskId: ${taskId}, formId: ${formId}, title: ${title}, icon: ${icon ? icon.slice(0, 10) + '...' : 'null'}`);
66
+ });
67
+ clickgo.core.setSystemEventListener('formTitleChanged', (taskId, formId, title) => {
68
+ if (!this.flist[formId]) {
69
+ return;
70
+ }
71
+ this.flist[formId].title = title;
72
+ this.pushConsole('formTitleChanged', `taskId: ${taskId}, formId: ${formId}, title: ${title}`);
73
+ });
74
+ clickgo.core.setSystemEventListener('formIconChanged', (taskId, formId, icon) => {
75
+ if (!this.flist[formId]) {
76
+ return;
77
+ }
78
+ this.flist[formId].icon = icon;
79
+ this.pushConsole('formIconChanged', `taskId: ${taskId}, formId: ${formId}, icon: ${icon ? icon.slice(0, 10) + '...' : 'null'}`);
80
+ });
81
+ clickgo.core.setSystemEventListener('formStateMinChanged', (taskId, formId, state) => {
82
+ if (!this.flist[formId]) {
83
+ return;
84
+ }
85
+ this.flist[formId].min = state;
86
+ this.pushConsole('formStateMinChanged', `taskId: ${taskId}, formId: ${formId}, state: ${state ? 'true' : 'false'}`);
87
+ });
88
+ clickgo.core.setSystemEventListener('formStateMaxChanged', (taskId, formId, state) => {
89
+ if (!this.flist[formId]) {
90
+ return;
91
+ }
92
+ this.flist[formId].max = state;
93
+ this.pushConsole('formStateMaxChanged', `taskId: ${taskId}, formId: ${formId}, state: ${state ? 'true' : 'false'}`);
94
+ });
95
+ clickgo.core.setSystemEventListener('formShowChanged', (taskId, formId, state) => {
96
+ if (!this.flist[formId]) {
97
+ return;
98
+ }
99
+ this.flist[formId].show = state;
100
+ this.pushConsole('formShowChanged', `taskId: ${taskId}, formId: ${formId}, state: ${state ? 'true' : 'false'}`);
101
+ });
102
+ clickgo.core.setSystemEventListener('formFocused', (taskId, formId) => {
103
+ if (!this.flist[formId]) {
104
+ return;
105
+ }
106
+ this.flist[formId].focus = true;
107
+ this.pushConsole('formFocused', `taskId: ${taskId}, formId: ${formId}`);
108
+ });
109
+ clickgo.core.setSystemEventListener('formBlurred', (taskId, formId) => {
110
+ if (!this.flist[formId]) {
111
+ return;
112
+ }
113
+ this.flist[formId].focus = false;
114
+ this.pushConsole('formBlurred', `taskId: ${taskId}, formId: ${formId}`);
115
+ });
116
+ clickgo.core.setSystemEventListener('formFlash', (taskId, formId) => __awaiter(this, void 0, void 0, function* () {
117
+ if (!this.flist[formId]) {
118
+ return;
119
+ }
120
+ if (this.flist[formId].flash) {
121
+ clickgo.task.removeTimer(this.flist[formId].flash);
122
+ }
123
+ this.pushConsole('formFlash', `taskId: ${taskId}, formId: ${formId}`);
124
+ this.flist[formId].flash = true;
125
+ yield clickgo.tool.sleep(1000);
126
+ this.flist[formId].flash = false;
127
+ }));
128
+ };
129
+ exports.mounted = mounted;
@@ -0,0 +1,24 @@
1
+ @keyframes flash {
2
+ 0%, 50% {
3
+ border: solid 1px rgba(0, 0, 0, .8); color: initial;
4
+ }
5
+ 51%, 100% {
6
+ border-color: rgba(0, 0, 0, 1); background-color: hsl(0, 0%, 20%); color: #FFF;
7
+ }
8
+ }
9
+
10
+ .item {
11
+ border: solid 1px hsl(0, 0%, 20%); padding: 5px; min-height: 30px; min-width: 150px;
12
+ &.focus {
13
+ background-color: #FFF; color: hsl(0, 0%, 20%);
14
+ }
15
+ &:hover {
16
+ background-color: rgba(0, 0, 0, .1);
17
+ }
18
+ &:active {
19
+ background-color: hsl(0, 0%, 20%); color: #FFF;
20
+ }
21
+ &.flash {
22
+ animation: flash .2s linear infinite;
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ <form width="450" height="550" title="About form" padding="10" direction="v">
2
+ <label>The form list:</label>
3
+ <layout align-h="center" align-v="center" style="margin-top: 10px; flex: 1; height: 0;">
4
+ <layout gutter="10" direction="v">
5
+ <layout align-v="center" v-for="(form, fid) of flist" gutter="5" @click="changeFocus(fid)" class="item" :class="{'flash': form.flash, 'focus': form.focus}">
6
+ <img v-if="form.icon" :src="form.icon" width="16" height="16" /><label>{{form.title}}{{form.max ? ' (max)' : ''}}{{form.min ? ' (min)' : ''}}</label>
7
+ </layout>
8
+ </layout>
9
+ </layout>
10
+ <layout gutter="10" style="margin-top: 10px; height: 80px;">
11
+ <list :data="['formCreated', 'formRemoved', 'formTitleChanged', 'formIconChanged', 'formStateMinChanged', 'formStateMaxChanged', 'formShowChanged', 'formFocused', 'formBlurred', 'formFlash']" style="width: 150px;"></list>
12
+ <greatview v-slot="data" :data="list" direction="v" style="color: #FFF; background: hsl(0, 0%, 20%); line-height: 1.5; flex: 1; width: 0; padding: 10px;" same>
13
+ <label>[{{data.row.time}}] {{data.row.name}}, {{data.row.text}}.</label>
14
+ </greatview>
15
+ </layout>
16
+ </form>
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mounted = exports.data = void 0;
4
+ const clickgo = require("clickgo");
5
+ exports.data = {
6
+ 'width': 0,
7
+ 'height': 0,
8
+ 'scale': 4,
9
+ 'list': []
10
+ };
11
+ const mounted = function () {
12
+ clickgo.core.setSystemEventListener('screenResize', () => {
13
+ const area = clickgo.core.getAvailArea();
14
+ this.width = area.width;
15
+ this.height = area.height;
16
+ if (this.width > 1100 || this.height > 1100) {
17
+ this.scale = 5;
18
+ }
19
+ else if (this.width < 420 || this.height < 420) {
20
+ this.scale = 3;
21
+ }
22
+ else {
23
+ this.scale = 4;
24
+ }
25
+ const date = new Date();
26
+ this.list.unshift({
27
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
28
+ 'width': area.width,
29
+ 'height': area.height
30
+ });
31
+ });
32
+ const area = clickgo.core.getAvailArea();
33
+ this.width = area.width;
34
+ this.height = area.height;
35
+ if (this.width > 1100 || this.height > 1100) {
36
+ this.scale = 5;
37
+ }
38
+ else if (this.width < 420 || this.height < 420) {
39
+ this.scale = 3;
40
+ }
41
+ else {
42
+ this.scale = 4;
43
+ }
44
+ const date = new Date();
45
+ this.list.unshift({
46
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
47
+ 'width': this.width,
48
+ 'height': this.height
49
+ });
50
+ };
51
+ exports.mounted = mounted;
@@ -0,0 +1,9 @@
1
+ <form width="400" height="550" title="About screen" padding="10" direction="v">
2
+ <label>The screen size:</label>
3
+ <layout align-h="center" align-v="center" style="margin-top: 10px; flex: 1; height: 0;">
4
+ <block style="border: solid 1px hsl(0, 0%, 20%); display: flex; align-items: center; justify-content: center; font-size: 20px;" :style="{'width': width / scale + 'px', 'height': height / scale + 'px'}">{{width}} x {{height}}</block>
5
+ </layout>
6
+ <greatview v-slot="data" :data="list" direction="v" style="margin-top: 10px; color: #FFF; background: hsl(0, 0%, 20%); line-height: 1.5; height: 80px; padding: 10px;" same>
7
+ <label>[{{data.row.time}}] screenResize, width: {{data.row.width}}, height: {{data.row.height}}.</label>
8
+ </greatview>
9
+ </form>
@@ -0,0 +1,78 @@
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
+ exports.mounted = exports.methods = exports.data = void 0;
13
+ const clickgo = require("clickgo");
14
+ exports.data = {
15
+ 'tlist': [],
16
+ 'list': [],
17
+ 'tid': 0
18
+ };
19
+ exports.methods = {
20
+ 'pushConsole': function (name, text) {
21
+ const date = new Date();
22
+ this.list.unshift({
23
+ 'time': date.getHours().toString() + ':' + date.getMinutes().toString() + ':' + date.getSeconds().toString(),
24
+ 'name': name,
25
+ 'text': text
26
+ });
27
+ },
28
+ 'run': function () {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const taskId = yield clickgo.task.run('/clickgo/app/demo/');
31
+ yield clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
32
+ });
33
+ },
34
+ 'end': function () {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ if (yield clickgo.form.confirm(`Are you sure to end Task ${this.tid}?`)) {
37
+ clickgo.task.end(parseInt(this.tid));
38
+ }
39
+ });
40
+ },
41
+ 'runTask': function () {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ if (clickgo.task.systemTaskInfo.taskId > 0) {
44
+ yield clickgo.form.dialog('The Task APP is already running.');
45
+ return;
46
+ }
47
+ const taskId = yield clickgo.task.run('/clickgo/app/task/');
48
+ yield clickgo.form.dialog(`Successfully run, task id is: ${taskId}.`);
49
+ });
50
+ }
51
+ };
52
+ const mounted = function () {
53
+ const list = clickgo.task.getList();
54
+ for (const tid in list) {
55
+ this.tlist.push({
56
+ 'label': 'Task ' + tid,
57
+ 'value': parseInt(tid)
58
+ });
59
+ }
60
+ clickgo.core.setSystemEventListener('taskStarted', (taskId) => {
61
+ this.tlist.push({
62
+ 'label': 'Task ' + taskId.toString(),
63
+ 'value': taskId
64
+ });
65
+ this.pushConsole('taskStarted', `taskId: ${taskId}`);
66
+ });
67
+ clickgo.core.setSystemEventListener('taskEnded', (taskId) => {
68
+ for (let i = 0; i < this.tlist.length; ++i) {
69
+ if (this.tlist[i].value !== taskId) {
70
+ continue;
71
+ }
72
+ this.tlist.splice(i, 1);
73
+ break;
74
+ }
75
+ this.pushConsole('taskEnded', `taskId: ${taskId}`);
76
+ });
77
+ };
78
+ exports.mounted = mounted;
@@ -0,0 +1,20 @@
1
+ <form width="400" height="550" title="About task" padding="10" direction="v">
2
+ <label>The task list:</label>
3
+ <layout align-h="center" align-v="center" style="margin-top: 10px; flex: 1; height: 0;">
4
+ <layout direction="v" gutter="10">
5
+ <label>Select task id: {{tid}}</label>
6
+ <list v-model="tid" :data="tlist" style="width: 200px; height: 200px;"></list>
7
+ <button @click="runTask" style="height: 30px;">Run task app</button>
8
+ <layout gutter="10">
9
+ <button @click="run" style="flex: 1; width: 0; height: 30px;">Run self</button>
10
+ <button @click="end" style="flex: 1; width: 0; height: 30px;">End</button>
11
+ </layout>
12
+ </layout>
13
+ </layout>
14
+ <layout gutter="10" style="margin-top: 10px; height: 80px;">
15
+ <list :data="['taskStarted', 'taskEnded']" width="150" style="width: 150px;"></list>
16
+ <greatview v-slot="data" :data="list" direction="v" style="color: #FFF; background: hsl(0, 0%, 20%); line-height: 1.5; flex: 1; width: 0; padding: 10px;" same>
17
+ <label>[{{data.row.time}}] {{data.row.name}}, {{data.row.text}}.</label>
18
+ </greatview>
19
+ </layout>
20
+ </form>
@@ -0,0 +1 @@
1
+ .inner{padding:10px;flex:1}.buttons button{height:30px}
@@ -0,0 +1,25 @@
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
+ exports.methods = exports.data = void 0;
13
+ const clickgo = require("clickgo");
14
+ exports.data = {
15
+ 'ntab': ''
16
+ };
17
+ exports.methods = {
18
+ openForm: function (type, name) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ yield clickgo.form.create({
21
+ 'file': `${type}/${name}/${name}`
22
+ });
23
+ });
24
+ }
25
+ };
@@ -0,0 +1,9 @@
1
+ .inner {
2
+ padding: 10px; flex: 1;
3
+ }
4
+
5
+ .buttons {
6
+ button {
7
+ height: 30px;
8
+ }
9
+ }
@@ -0,0 +1,49 @@
1
+ <form width="400" height="550" title="ClickGo demo" icon="/package/res/icon.svg">
2
+ <tab v-model="ntab" :tabs="['control', 'method', 'event']" style="margin: 10px; flex: 1;">
3
+ <overflow v-if="ntab === 'control'" class="inner" direction="v">
4
+ <layout class="buttons" gutter="10" direction="v">
5
+ <button @click="openForm('control', 'form')">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>
14
+ <button @click="openForm('control', 'dialog')">Dialog</button>
15
+ <button @click="openForm('control', 'file')">File</button>
16
+ <button @click="openForm('control', 'block')">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>
27
+ </layout>
28
+ </overflow>
29
+ <overflow v-else-if="ntab === 'method'" class="inner" direction="v">
30
+ <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>
33
+ <button @click="openForm('method', 'form')">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>
39
+ </layout>
40
+ </overflow>
41
+ <overflow v-else class="inner" direction="v">
42
+ <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>
46
+ </layout>
47
+ </overflow>
48
+ </tab>
49
+ </form>
@@ -0,0 +1,25 @@
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
+ exports.methods = exports.computed = void 0;
13
+ const clickgo = require("clickgo");
14
+ exports.computed = {
15
+ 'config': function () {
16
+ return JSON.stringify(clickgo.core.config, null, 4);
17
+ }
18
+ };
19
+ exports.methods = {
20
+ getAvailArea: function () {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ yield clickgo.form.dialog(JSON.stringify(clickgo.core.getAvailArea()));
23
+ });
24
+ }
25
+ };
@@ -0,0 +1,7 @@
1
+ <form width="350" height="400" title="Library task" padding="10">
2
+ <layout direction="v" gutter="10" style="flex: 1;">
3
+ <button @click="getAvailArea" style="height: 30px;">getAvailArea()</button>
4
+ <label>config:</label>
5
+ <text v-model="config" readonly multi style="flex: 1;"></text>
6
+ </layout>
7
+ </form>
@@ -0,0 +1 @@
1
+ .dropLine{display:flex;flex:1;margin-bottom:5px}.dropLine>block{border:1px solid rgba(0,0,0,.3);background-color:#fff;flex:1;margin-right:5px;display:flex;justify-content:center;align-items:center}.dropLine>block[data-cg-hover]{background-color:#333;color:#fff}