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,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.data = void 0;
4
+ exports.data = {
5
+ 'data': [
6
+ {
7
+ 'kind': 'Design',
8
+ 'title': 'Name',
9
+ 'desc': 'The control name.',
10
+ 'type': 'property',
11
+ 'control': 'text',
12
+ 'default': 'Control1',
13
+ 'value': 'Control1'
14
+ },
15
+ {
16
+ 'kind': 'Design',
17
+ 'title': 'Locked',
18
+ 'desc': 'Locked the control.',
19
+ 'type': 'property',
20
+ 'control': 'check',
21
+ 'default': 'false',
22
+ 'value': 'false'
23
+ },
24
+ {
25
+ 'kind': 'Layout',
26
+ 'title': 'Like',
27
+ 'desc': 'The like desc.',
28
+ 'type': 'property',
29
+ 'control': 'select',
30
+ 'default': 'Button',
31
+ 'value': 'Button',
32
+ 'data': ['Button', 'Select', 'Check']
33
+ },
34
+ {
35
+ 'kind': 'Layout',
36
+ 'title': 'Dock',
37
+ 'desc': 'The dock.',
38
+ 'type': 'property',
39
+ 'control': 'dock',
40
+ 'default': 'none',
41
+ 'value': 'none'
42
+ },
43
+ {
44
+ 'kind': 'Layout',
45
+ 'title': 'Location',
46
+ 'desc': 'Location of parent layout.',
47
+ 'type': 'property',
48
+ 'control': 'text',
49
+ 'default': '100, 1000',
50
+ 'value': '100, 1000',
51
+ 'sub': [
52
+ {
53
+ 'title': 'X',
54
+ 'desc': 'X of location.',
55
+ 'control': 'text'
56
+ },
57
+ {
58
+ 'title': 'Y',
59
+ 'desc': 'Y of location.',
60
+ 'control': 'text'
61
+ },
62
+ {
63
+ 'title': 'Z',
64
+ 'desc': 'Z of location.',
65
+ 'control': 'text'
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ 'kind': 'Other',
71
+ 'title': 'Sub',
72
+ 'desc': 'Children.',
73
+ 'type': 'property',
74
+ 'control': 'text',
75
+ 'default': '',
76
+ 'value': '',
77
+ 'sub': [
78
+ {
79
+ 'title': 'Dock',
80
+ 'desc': 'Dock of sub.',
81
+ 'control': 'dock'
82
+ },
83
+ {
84
+ 'title': 'Check',
85
+ 'desc': 'Check of sub.',
86
+ 'control': 'check'
87
+ },
88
+ {
89
+ 'title': 'Select',
90
+ 'desc': 'Select of sub.',
91
+ 'control': 'select',
92
+ 'data': ['', 'A', 'B', 'C']
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ 'kind': 'Mouse',
98
+ 'title': 'MouseDown',
99
+ 'desc': 'On mouse down.',
100
+ 'type': 'event',
101
+ 'default': '',
102
+ 'value': 'mousedown'
103
+ },
104
+ {
105
+ 'kind': 'Mouse',
106
+ 'title': 'MouseUp',
107
+ 'desc': 'On mouse up.',
108
+ 'type': 'event',
109
+ 'default': '',
110
+ 'value': 'mouseup'
111
+ },
112
+ {
113
+ 'kind': 'Key',
114
+ 'title': 'KeyDown',
115
+ 'desc': 'On key down.',
116
+ 'type': 'event',
117
+ 'default': '',
118
+ 'value': 'kedown'
119
+ },
120
+ {
121
+ 'kind': 'Key',
122
+ 'title': 'KeyUp',
123
+ 'desc': 'On key up.',
124
+ 'type': 'event',
125
+ 'default': '',
126
+ 'value': 'keyup'
127
+ }
128
+ ]
129
+ };
@@ -0,0 +1,6 @@
1
+ <form title="Property" width="450" height="400" min-width="300" min-height="400" padding="10">
2
+ <layout gutter="10" style="flex: 1; width: 0;">
3
+ <text :modelValue="JSON.stringify(data, null, 4)" style="flex: 1; width: 0;" multi readonly wrap></text>
4
+ <property v-model="data" style="flex: 1; width: 0;"></property>
5
+ </layout>
6
+ </form>
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.data = void 0;
4
+ exports.data = {
5
+ 'value': 'radio1',
6
+ 'disabled': false
7
+ };
@@ -0,0 +1,12 @@
1
+ <form title="Radio" width="300" height="300" padding="10">
2
+ <layout direction="v" gutter="10" style="flex: 1; width: 1;">
3
+ <label>Selected value: {{value}}</label>
4
+ <layout gutter="10">
5
+ <radio v-model="value" :disabled="disabled" value="radio1" style="flex: 1; width: 0;">radio1</radio>
6
+ <radio v-model="value" :disabled="disabled" value="radio2" style="flex: 1; width: 0;">radio2</radio>
7
+ <radio v-model="value" :disabled="disabled" value="radio3" style="flex: 1; width: 0;">radio3</radio>
8
+ </layout>
9
+ <button @click="value = 'radio2'" style="height: 30px;">Set value to "radio2"</button>
10
+ <button @click="disabled = !disabled" style="height: 30px;">{{disabled ? 'Remove' : 'Set'}} disabled</button>
11
+ </layout>
12
+ </form>
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.data = void 0;
4
+ exports.data = {
5
+ 'l1': 1000,
6
+ 'c1': 100,
7
+ 'so1': 500,
8
+ 'l2': 0,
9
+ 'c2': 0,
10
+ 'so2': 0,
11
+ 'count': 3,
12
+ 'float': false,
13
+ 'disabled': false
14
+ };
@@ -0,0 +1,35 @@
1
+ <form title="Scroll" width="400" min-width="300" height="400" min-height="390" padding="10" background="#FFF">
2
+ <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
+ <layout gutter="10" style="flex: 1; height: 0;">
4
+ <layout gutter="10" direction="v" style="flex: 1;">
5
+ <label>Scroll offset: {{so1}}</label>
6
+ <layout gutter="10">
7
+ <button @click="l1 = (l1 === 1000 ? 2000 : 1000)" style="height: 30px; flex: 1;">Set length {{l1 === 1000 ? '2000' : '1000'}}</button>
8
+ <button @click="c1 = (c1 === 100 ? 200 : 100)" style="height: 30px; flex: 1;">Set client {{c1 === 100 ? '200' : '100'}}</button>
9
+ </layout>
10
+ <layout gutter="10">
11
+ <button @click="disabled = !disabled" style="height: 30px; flex: 1;">{{disabled ? 'Remove' : 'Set'}} disabled</button>
12
+ <button @click="l1 = 1000;c1 = 2000" style="height: 30px; flex: 1;">Set client > length</button>
13
+ </layout>
14
+ </layout>
15
+ <scroll :length="l1" :client="c1" v-model:scroll-offset="so1" :disabled="disabled" style="width: 20px;"></scroll>
16
+ <scroll scroll-offset="200" :disabled="disabled" style="width: 30px;"></scroll>
17
+ <scroll :disabled="disabled" style="width: 30px;"></scroll>
18
+ </layout>
19
+ <scroll direction="h" :disabled="disabled" style="height: 30px;"></scroll>
20
+ <layout style="border: solid 1px rgba(0, 0, 0, .3); flex: 1; height: 0;">
21
+ <overflow v-model:scroll-top="so2" direction="v" @resize="c2 = $event" @change="l2 = $event" style="line-height: 1.5; flex: 1;">
22
+ <block style="padding: 10px;">
23
+ <block>Length: {{l2}}, Client: {{c2}}.</block>
24
+ <block v-for="line of count">Line {{line}}.</block>
25
+ </block>
26
+ </overflow>
27
+ <scroll :length="l2" :client="c2" v-model:scroll-offset="so2" :float="float" :disabled="disabled" style="width: 20px;"></scroll>
28
+ </layout>
29
+ <layout gutter="10" align-v="center">
30
+ <label style="flex: 1;">On the left is the overflow control.</label>
31
+ <button @click="float = !float" style="padding: 0 10px; height: 30px;">{{float ? 'Remove' : 'Set'}} float</button>
32
+ <button @click="count += 10" style="padding: 0 10px; height: 30px;">Add 10 lines</button>
33
+ </layout>
34
+ </layout>
35
+ </form>
@@ -0,0 +1,91 @@
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.watch = exports.data = void 0;
13
+ exports.data = {
14
+ 'ntab': '',
15
+ 'area': 'all',
16
+ 'slist': [
17
+ {
18
+ 'type': 0,
19
+ 'name': 'Appraise',
20
+ 'path': 'Bob >> folder >> Appraise',
21
+ 'src': '/package/res/r-1.svg'
22
+ },
23
+ {
24
+ 'type': 0,
25
+ 'name': 'Card',
26
+ 'path': 'Bob >> folder >> Card',
27
+ 'src': '/package/res/r-2.svg',
28
+ 'menu': true
29
+ },
30
+ {
31
+ 'type': 0,
32
+ 'name': 'Appraise2',
33
+ 'path': 'Bob >> folder >> Appraise2',
34
+ 'src': '/package/res/r-1.svg',
35
+ 'disabled': true
36
+ },
37
+ {
38
+ 'control': 'split'
39
+ },
40
+ {
41
+ 'type': 1
42
+ }
43
+ ],
44
+ 'select': 0,
45
+ 'disabled': false,
46
+ 'slist2': [
47
+ 'haha1', 'haha2', 'haha3', 'haha4', {
48
+ 'value': 'ha5',
49
+ 'label': 'The value is ha5'
50
+ }, {
51
+ 'value': 'ha6',
52
+ 'label': 'Can not be selected',
53
+ 'disabled': true
54
+ }, {
55
+ 'value': 'title',
56
+ 'children': [
57
+ {
58
+ 'label': 'sub1label'
59
+ }, {
60
+ 'label': 'sub2'
61
+ }, {
62
+ 'label': 'Sub title',
63
+ 'children': ['1', '2']
64
+ }
65
+ ]
66
+ }, {
67
+ 'label': 'happy',
68
+ 'children': ['xixi', 'xixida', 'gogogo']
69
+ }
70
+ ],
71
+ 'select2': 'haha2',
72
+ 'editable': false,
73
+ 'padding': false,
74
+ 'fontSize': false,
75
+ 'background': false
76
+ };
77
+ exports.watch = {
78
+ 'select': function (n, o) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ if (this.slist[n].type === 0) {
81
+ return;
82
+ }
83
+ yield this.$nextTick();
84
+ if (this.slist[o].type === 0) {
85
+ this.select = o;
86
+ return;
87
+ }
88
+ this.select = 0;
89
+ });
90
+ }
91
+ };
@@ -0,0 +1,74 @@
1
+ <form title="Select" width="400" height="450" min-width="300" min-height="400" padding="10">
2
+ <tab v-model="ntab" :tabs="['greatselect', 'select']" style="flex: 1; width: 0;">
3
+ <!-- greatselect -->
4
+ <layout v-if="ntab === 'greatselect'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
5
+ <label>Now select value is {{select}}:</label>
6
+ <greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
7
+ <layout align-v="center" gutter="5" style="line-height: 1.3; flex: 1;">
8
+ <img :src="slist[select].src" style="width: 32px; height: 32px;"></img>
9
+ <block>
10
+ <block>{{slist[select].name}}</block>
11
+ <block style="opacity: .7;">{{slist[select].path}}</block>
12
+ </block>
13
+ </layout>
14
+ <template v-slot:pop="data">
15
+ <layout v-if="data.row.type === 0" align-v="center" gutter="5" style="flex: 1; line-height: 1.3;">
16
+ <img :src="data.row.src" style="width: 32px; height: 32px;"></img>
17
+ <block style="flex: 1;">
18
+ <block>{{data.row.name}}</block>
19
+ <block style="opacity: .7;">{{data.row.path}}</block>
20
+ </block>
21
+ </layout>
22
+ <template v-else>Other</template>
23
+ </template>
24
+ <template v-slot:itempop>
25
+ <menulist>
26
+ <menulist-item alt="S">Set the default</menulist-item>
27
+ </menulist>
28
+ </template>
29
+ </greatselect>
30
+ <label>Custom pop:</label>
31
+ <greatselect pop="custom" :area="area" :disabled="disabled" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
32
+ <label>Pop is button.</label>
33
+ <template v-slot:pop>
34
+ <button style="height: 30px;">Nothing</button>
35
+ </template>
36
+ </greatselect>
37
+ <layout gutter="10">
38
+ <button @click="slist.splice(-2, 0, {'type': 0, 'name': 'Card' + slist.length, 'path': 'Bob >> folder >> Card', 'src': '/package/res/r-2.svg','disabled': false})" style="flex: 1; height: 30px;">Add item</button>
39
+ <button @click="slist.splice(-3, 1)" style="flex: 1; height: 30px;">Remove item</button>
40
+ </layout>
41
+ <layout gutter="10">
42
+ <button @click="disabled = !disabled" style="flex: 1; height: 30px;">Disabled: {{disabled}}</button>
43
+ <button @click="area = area === 'all' ? 'arrow' : 'all'" style="flex: 1; height: 30px;">Area: {{area}}</button>
44
+ </layout>
45
+ <layout gutter="10">
46
+ <button @click="fontSize = !fontSize" style="flex: 1; height: 30px;">Change font size</button>
47
+ <button @click="padding = !padding" style="flex: 1; height: 30px;">Change padding</button>
48
+ </layout>
49
+ <layout gutter="10">
50
+ <button @click="background = !background" style="flex: 1; height: 30px;">Change background and color</button>
51
+ </layout>
52
+ </layout>
53
+ <!-- select -->
54
+ <layout v-else-if="ntab === 'select'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
55
+ <label>Now select value is {{select2}}:</label>
56
+ <select v-model="select2" :data="slist2" :disabled="disabled" :editable="editable" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
57
+ <label>Custom height:</label>
58
+ <select :data="['1','2','3','4','5']" :disabled="disabled" :editable="editable" style="height: 60px;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
59
+ <label>Always editable:</label>
60
+ <select :data="['1','2','3','4','5']" :disabled="disabled" editable :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
61
+ <layout gutter="10">
62
+ <button @click="disabled = !disabled" style="flex: 1; height: 30px;">Disabled: {{disabled}}</button>
63
+ <button @click="editable = !editable" style="flex: 1; height: 30px;">Editable: {{editable}}</button>
64
+ </layout>
65
+ <layout gutter="10">
66
+ <button @click="fontSize = !fontSize" style="flex: 1; height: 30px;">Change font size</button>
67
+ <button @click="padding = !padding" style="flex: 1; height: 30px;">Change padding</button>
68
+ </layout>
69
+ <layout gutter="10">
70
+ <button @click="background = !background" style="flex: 1; height: 30px;">Change background and color</button>
71
+ </layout>
72
+ </layout>
73
+ </tab>
74
+ </form>
@@ -0,0 +1,75 @@
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
+ 'tabs': ['tab1'],
17
+ 'tindex': 1,
18
+ 'tabPosition': 'top',
19
+ 'color': undefined,
20
+ 'size': undefined,
21
+ 'drag': false,
22
+ 'close': false
23
+ };
24
+ exports.methods = {
25
+ onClose: function (e, i) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ if (i !== 10) {
28
+ return;
29
+ }
30
+ e.preventDefault();
31
+ yield clickgo.form.dialog('The tab can not be close.');
32
+ });
33
+ },
34
+ add: function () {
35
+ const len = this.tabs.length;
36
+ const val = 'tab' + (++this.tindex).toString();
37
+ if (len === 15) {
38
+ this.tabs.push({
39
+ 'value': val,
40
+ 'drag': false,
41
+ 'close': false
42
+ });
43
+ }
44
+ else if (len === 16) {
45
+ this.tabs.push({
46
+ 'value': val,
47
+ 'drag': true,
48
+ 'close': true
49
+ });
50
+ }
51
+ else {
52
+ this.tabs.push(val);
53
+ }
54
+ },
55
+ remove: function () {
56
+ if (this.tabs.length > 0) {
57
+ this.tabs.splice(this.tabs.length - 1);
58
+ }
59
+ },
60
+ position: function () {
61
+ switch (this.tabPosition) {
62
+ case 'top':
63
+ this.tabPosition = 'right';
64
+ break;
65
+ case 'right':
66
+ this.tabPosition = 'bottom';
67
+ break;
68
+ case 'bottom':
69
+ this.tabPosition = 'left';
70
+ break;
71
+ default:
72
+ this.tabPosition = 'top';
73
+ }
74
+ }
75
+ };
@@ -0,0 +1,22 @@
1
+ <form title="Tab" width="400" height="450" min-width="300" min-height="400" padding="10" direction="v">
2
+ <label>Now tab: {{ntab}}.</label>
3
+ <tab v-model="ntab" v-model:tabs="tabs" :tabPosition="tabPosition" :drag="drag" :close="close" @close="onClose" style="margin-top: 10px; flex: 1; height: 0;" :style="{'font-size': size, 'color': color}">
4
+ <!-- 默认 -->
5
+ <layout style="padding: 10px;">
6
+ <button v-if="ntab === 'tab2'" style="padding: 0 10px; height: 30px;">Test button</button>
7
+ <label v-else>The tab's value is "{{ntab}}";</label>
8
+ </layout>
9
+ </tab>
10
+ <layout gutter="10" style="margin-top: 10px;">
11
+ <button @click="add" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">Add</button>
12
+ <button @click="remove" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">Remove</button>
13
+ <button @click="position" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">Position</button>
14
+ <button @click="ntab = 'tab2'" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">Tab2</button>
15
+ </layout>
16
+ <layout gutter="10" style="margin-top: 10px;">
17
+ <button @click="color = color ? undefined : 'red'" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{color ? '' : '!'}}red</button>
18
+ <button @click="size = size ? undefined : '18px'" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{size ? '' : '!'}}18px</button>
19
+ <button @click="drag = !drag" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{drag ? '' : '!'}}drag</button>
20
+ <button @click="close = !close" style="padding: 0 10px; flex: 1; width: 0; height: 30px;">{{close ? '' : '!'}}close</button>
21
+ </layout>
22
+ </form>
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.methods = exports.data = void 0;
4
+ const clickgo = require("clickgo");
5
+ exports.data = {
6
+ 'value': '',
7
+ 'selectionStart': 0,
8
+ 'selectionEnd': 0,
9
+ 'multi': false,
10
+ 'disabled': false,
11
+ 'readonly': false,
12
+ 'long': false,
13
+ 'password': false,
14
+ 'wrap': true,
15
+ 'menu': false,
16
+ 'gesture': false,
17
+ 'lineHeight': 1,
18
+ 'fontSize': 12,
19
+ 'border': 'solid',
20
+ 'background': undefined,
21
+ 'scrollLeft': 0,
22
+ 'scrollTop': 0,
23
+ 'length': 0,
24
+ 'clientHeight': 0,
25
+ 'clientWidth': 0
26
+ };
27
+ exports.methods = {
28
+ longClick: function () {
29
+ this.value = this.long ? 'short\nshort\nshort\nshort\nshort\nshort\nshort\nshort\nshort' : 'long\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong\nlong';
30
+ this.long = !this.long;
31
+ this.scrollTop = 0;
32
+ },
33
+ scrollborder: function (e) {
34
+ if (!this.gesture) {
35
+ return;
36
+ }
37
+ clickgo.dom.bindGesture(e, {
38
+ 'dirs': this.multi ? ['top', 'bottom'] : ['left', 'right'],
39
+ 'handler': (dir) => {
40
+ switch (dir) {
41
+ case 'left':
42
+ case 'top': {
43
+ this.value = this.value.slice(0, -1);
44
+ break;
45
+ }
46
+ default: {
47
+ this.value += 'A';
48
+ }
49
+ }
50
+ }
51
+ });
52
+ }
53
+ };
@@ -0,0 +1,37 @@
1
+ <form width="350" height="350" title="Textbox">
2
+ <layout direction="v" gutter="10" style="padding: 10px; flex: 1; width: 0;">
3
+ <label>Text Length: {{value.length}}, Selection Start: {{selectionStart}}, Selection End: {{selectionEnd}}</label>
4
+ <label>Scroll Left: {{scrollLeft}}, Scroll Top: {{scrollTop}}, Length: {{length}}, Client Height: {{clientHeight}}, Client Width: {{clientWidth}}</label>
5
+ <text v-model="value" :multi="multi" :disabled="disabled" :readonly="readonly" :password="password" :wrap="wrap" :border="border" v-model:scroll-left="scrollLeft" v-model:scroll-top="scrollTop" v-model:selection-start="selectionStart" v-model:selection-end="selectionEnd" @resize="clientHeight = $event" @resizen="clientWidth = $event" @change="length = $event" @scrollborder="scrollborder" :style="{'flex': multi ? '1' : undefined, 'line-height': lineHeight, 'font-size': fontSize + 'px', 'background': background, 'color': background ? '#FFF' : undefined, 'height': multi ? undefined : '30px'}">
6
+ <menulist v-if="menu">
7
+ <menulist-item>Custom</menulist-item>
8
+ </menulist>
9
+ </text>
10
+ <layout gutter="10">
11
+ <button @click="multi = !multi" style="flex: 1; height: 30px;">{{multi ? '' : '!'}}multi</button>
12
+ <button @click="disabled = !disabled" style="flex: 1; height: 30px;">{{disabled ? '' : '!'}}disabled</button>
13
+ <button @click="readonly = !readonly" style="flex: 1; height: 30px;">{{readonly ? '' : '!'}}readonly</button>
14
+ <button @click="longClick" style="flex: 1; height: 30px;">{{long ? '' : '!'}}long</button>
15
+ </layout>
16
+ <layout gutter="10">
17
+ <button @click="password = !password" style="flex: 1; height: 30px;">{{password ? '' : '!'}}password</button>
18
+ <button @click="wrap = !wrap" style="flex: 1; height: 30px;">{{wrap ? '' : '!'}}wrap</button>
19
+ <button @click="menu = !menu" style="flex: 1; height: 30px;">{{menu ? '' : '!'}}menu</button>
20
+ <button @click="gesture = !gesture" style="flex: 1; height: 30px;">{{gesture ? '' : '!'}}gesture</button>
21
+ </layout>
22
+ <layout gutter="10">
23
+ <button @click="lineHeight = lineHeight === 1 ? 1.5 : 1" style="flex: 1; height: 30px;">Set line-height {{lineHeight === 1 ? 1.5 : 1}}</button>
24
+ <button @click="fontSize = fontSize === 12 ? 16 : 12" style="flex: 1; height: 30px;">Set font-size {{fontSize === 12 ? 16 : 12}}</button>
25
+ </layout>
26
+ <layout gutter="10">
27
+ <button @click="border = 'solid'" style="flex: 2; height: 30px;">Set border solid</button>
28
+ <button @click="border = 'underline'" style="flex: 1; height: 30px;">Underline</button>
29
+ <button @click="border = 'none'" style="flex: 1; height: 30px;">None</button>
30
+ </layout>
31
+ <layout gutter="10">
32
+ <button @click="background = 'red'" style="flex: 2; height: 30px;">Set background red</button>
33
+ <button @click="background = 'green'" style="flex: 1; height: 30px;">Green</button>
34
+ <button @click="background = undefined" style="flex: 1; height: 30px;">Remove</button>
35
+ </layout>
36
+ </layout>
37
+ </form>
@@ -0,0 +1 @@
1
+ .border{border:1px solid rgba(0,0,0,.1)}.custom{margin:auto;background:#07c160;width:60%;height:30px;color:#fff;text-align:center;line-height:30px}.rightborder{border-right:1px solid rgba(0,0,0,.1)}.block{width:200px;height:200px;padding:0 10px 10px 0}.block block{background:#07c160;color:#fff;display:flex;align-items:center;justify-content:center;flex:1}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.methods = exports.data = void 0;
4
+ const clickgo = require("clickgo");
5
+ exports.data = {
6
+ 'ntab': '',
7
+ 'lineValue': 10,
8
+ 'lineCount': 2,
9
+ 'sLeft1': 0,
10
+ 'sTop1': 0,
11
+ 'l1': 0,
12
+ 'c1': 0,
13
+ 'sLeft2': 0,
14
+ 'sTop2': 0,
15
+ 'l2': 0,
16
+ 'c2': 0,
17
+ 'sLeft3': 0,
18
+ 'sTop3': 0,
19
+ 'l3': 0,
20
+ 'c3': 0,
21
+ 'sLeft4': 0,
22
+ 'sTop4': 0,
23
+ 'l4': 0,
24
+ 'c4': 0,
25
+ 'direction': false,
26
+ 'dir5': 'v',
27
+ 'sLeft5': 0,
28
+ 'sTop5': 0,
29
+ 'l5': 0,
30
+ 'c5': 0,
31
+ 'line5': 10,
32
+ 'c6': 0,
33
+ 'gesture': false,
34
+ 'style': false,
35
+ 'selection': false,
36
+ 'area': {}
37
+ };
38
+ exports.methods = {
39
+ scrollborder: function (e, dir) {
40
+ if (!this.gesture) {
41
+ return;
42
+ }
43
+ let dirs = [];
44
+ switch (dir) {
45
+ case 'h': {
46
+ dirs = ['left', 'right'];
47
+ break;
48
+ }
49
+ default: {
50
+ dirs = ['top', 'bottom'];
51
+ break;
52
+ }
53
+ }
54
+ clickgo.dom.bindGesture(e, {
55
+ 'dirs': dirs,
56
+ 'handler': (dir) => {
57
+ switch (dir) {
58
+ case 'left':
59
+ case 'top': {
60
+ this.lineCount -= 10;
61
+ if (this.lineCount < 0) {
62
+ this.lineCount = 0;
63
+ }
64
+ break;
65
+ }
66
+ default: {
67
+ this.lineCount += this.lineValue;
68
+ }
69
+ }
70
+ }
71
+ });
72
+ }
73
+ };