clickgo 3.9.0 → 3.10.0
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.
- package/README.md +3 -2
- package/dist/app/demo/config.json +2 -0
- package/dist/app/demo/form/control/desc/desc.js +36 -0
- package/dist/app/demo/form/control/desc/desc.xml +17 -1
- package/dist/app/demo/form/control/file/file.js +2 -0
- package/dist/app/demo/form/control/list/list.js +29 -0
- package/dist/app/demo/form/control/list/list.xml +2 -2
- package/dist/app/demo/form/control/nav/nav.xml +2 -0
- package/dist/app/demo/form/control/select/select.js +35 -26
- package/dist/app/demo/form/control/select/select.xml +4 -4
- package/dist/app/demo/form/control/step/step.js +51 -0
- package/dist/app/demo/form/control/step/step.xml +16 -0
- package/dist/app/demo/form/control/tab/tab.js +3 -3
- package/dist/app/demo/form/control/video/video.xml +1 -1
- package/dist/app/demo/form/main.js +5 -0
- package/dist/app/demo/form/main.xml +4 -1
- package/dist/app/demo/form/method/dom/dom.js +9 -1
- package/dist/app/demo/form/method/dom/dom.xml +2 -0
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/common.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/index.js +1 -1
- package/dist/index.ts +1 -1
- package/dist/lib/control.js +11 -0
- package/dist/lib/control.ts +13 -0
- package/dist/lib/dom.js +45 -14
- package/dist/lib/dom.ts +58 -28
- package/dist/lib/form.js +14 -0
- package/dist/lib/form.ts +32 -0
- package/dist/lib/fs.js +1 -1
- package/dist/lib/fs.ts +1 -1
- package/dist/lib/task.js +7 -1
- package/dist/lib/task.ts +9 -3
- package/dist/lib/tool.js +26 -4
- package/dist/lib/tool.ts +28 -4
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +124 -6
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
28
|
**index.html**
|
|
29
29
|
|
|
30
30
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.0/dist/loader.min.js?path=index&npm={'clickgo':'3.10.0'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -114,7 +114,8 @@ This library is published under [Apache-2.0](./LICENSE) license.
|
|
|
114
114
|
|
|
115
115
|
[Play SVG Vector](https://www.svgrepo.com/svg/447035/play)
|
|
116
116
|
[Pause SVG Vector](https://www.svgrepo.com/svg/447033/pause)
|
|
117
|
-
[Border Radius SVG Vector](https://www.svgrepo.com/svg/446973/border-radius)
|
|
117
|
+
[Border Radius SVG Vector](https://www.svgrepo.com/svg/446973/border-radius)
|
|
118
|
+
[Copy SVG Vector](https://www.svgrepo.com/svg/446994/copy)
|
|
118
119
|
|
|
119
120
|
### **LICENSE:** MIT License **AUTHOR:** developmentseed
|
|
120
121
|
|
|
@@ -97,6 +97,8 @@
|
|
|
97
97
|
"/form/control/scroll/scroll.xml",
|
|
98
98
|
"/form/control/select/select.js",
|
|
99
99
|
"/form/control/select/select.xml",
|
|
100
|
+
"/form/control/step/step.js",
|
|
101
|
+
"/form/control/step/step.xml",
|
|
100
102
|
"/form/control/svg/svg.js",
|
|
101
103
|
"/form/control/svg/svg.xml",
|
|
102
104
|
"/form/control/tab/tab.js",
|
|
@@ -29,6 +29,42 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
29
29
|
super(...arguments);
|
|
30
30
|
this.border = true;
|
|
31
31
|
this.collapse = true;
|
|
32
|
+
this.data = [
|
|
33
|
+
{
|
|
34
|
+
'name': 'name1',
|
|
35
|
+
'child': ['val1', 'val2']
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
'name': 'name2',
|
|
39
|
+
'child': ['val1', 'val2', 'val3']
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
'name': 'name3',
|
|
43
|
+
'child': ['val1', 'val2', 'val3', 'val4']
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
get maxLine() {
|
|
48
|
+
let len = 0;
|
|
49
|
+
for (const item of this.data) {
|
|
50
|
+
if (!len) {
|
|
51
|
+
len = item.child.length;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
len *= item.child.length;
|
|
55
|
+
}
|
|
56
|
+
return len;
|
|
57
|
+
}
|
|
58
|
+
get cols() {
|
|
59
|
+
const cols = [];
|
|
60
|
+
for (let i = 0; i < this.data.length; ++i) {
|
|
61
|
+
if (i === 0) {
|
|
62
|
+
cols.push(this.maxLine / this.data[i].child.length);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
cols.push(cols[i - 1] / this.data[i].child.length);
|
|
66
|
+
}
|
|
67
|
+
return cols;
|
|
32
68
|
}
|
|
33
69
|
}
|
|
34
70
|
exports.default = default_1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<form title="Desc" width="
|
|
1
|
+
<form title="Desc" width="500" height="500" padding="10">
|
|
2
2
|
<layout gutter="10" direction="v" style="flex: 1;">
|
|
3
3
|
<desc :border="border" :collapse="collapse">
|
|
4
4
|
<desc-row>
|
|
@@ -22,5 +22,21 @@
|
|
|
22
22
|
<button @click="border = !border" style="flex: 1; padding: 10px 0;">border: {{border ? 'true' : 'false'}}</button>
|
|
23
23
|
<button @click="collapse = !collapse" style="flex: 1; padding: 10px 0;">collapse: {{collapse ? 'true' : 'false'}}</button>
|
|
24
24
|
</layout>
|
|
25
|
+
<label>Test: {{cols}}</label>
|
|
26
|
+
<flow style="flex: 1;">
|
|
27
|
+
<desc :border="border" :collapse="collapse" style="flex: 1;">
|
|
28
|
+
<desc-row v-for="line of maxLine">
|
|
29
|
+
<!-- 行 1 - max -->
|
|
30
|
+
<template v-for="col of data.length">
|
|
31
|
+
<!-- 列 1 - max -->
|
|
32
|
+
<desc-cell v-if="col===data.length">{{data[col-1].child[(line-1)%cols[col-2]]}}</desc-cell>
|
|
33
|
+
<desc-cell v-else-if="line%cols[col-1]===1" :rowspan="cols[col-1]">{{data[col-1].child[Math.floor((line-1)/cols[col-1])%data[col-1].child.length]}}</desc-cell>
|
|
34
|
+
</template>
|
|
35
|
+
<desc-cell>LINE-{{line}}</desc-cell>
|
|
36
|
+
<desc-cell>DATA1</desc-cell>
|
|
37
|
+
<desc-cell>DATA2</desc-cell>
|
|
38
|
+
</desc-row>
|
|
39
|
+
</desc>
|
|
40
|
+
</flow>
|
|
25
41
|
</layout>
|
|
26
42
|
</form>
|
|
@@ -31,6 +31,7 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
31
31
|
this.multi = 'false';
|
|
32
32
|
this.dir = 'false';
|
|
33
33
|
this.list = [];
|
|
34
|
+
this.fd = new FormData();
|
|
34
35
|
}
|
|
35
36
|
select() {
|
|
36
37
|
this.refs.file.select();
|
|
@@ -42,6 +43,7 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
42
43
|
}
|
|
43
44
|
for (const file of files) {
|
|
44
45
|
this.list.push((file.webkitRelativePath || file.name) + ' (' + file.size.toString() + ')');
|
|
46
|
+
this.fd.append('file', file, file.name);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -235,5 +235,34 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
235
235
|
yield clickgo.form.dialog('onGesture: ' + dir);
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
|
+
onGAdd(e) {
|
|
239
|
+
clickgo.form.notify({
|
|
240
|
+
'type': 'info',
|
|
241
|
+
'title': 'Greatlist @add',
|
|
242
|
+
'content': 'value: ' + e.detail.value.toString()
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
onGRemove(e) {
|
|
246
|
+
clickgo.form.notify({
|
|
247
|
+
'type': 'info',
|
|
248
|
+
'title': 'Greatlist @remove',
|
|
249
|
+
'content': 'value: ' + e.detail.value.toString()
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
onLAdd(e) {
|
|
253
|
+
console.log('x', e.detail);
|
|
254
|
+
clickgo.form.notify({
|
|
255
|
+
'type': 'info',
|
|
256
|
+
'title': 'List @add',
|
|
257
|
+
'content': 'value: ' + e.detail.value
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
onLRemove(e) {
|
|
261
|
+
clickgo.form.notify({
|
|
262
|
+
'type': 'info',
|
|
263
|
+
'title': 'List @remove',
|
|
264
|
+
'content': 'value: ' + e.detail.value
|
|
265
|
+
});
|
|
266
|
+
}
|
|
238
267
|
}
|
|
239
268
|
exports.default = default_1;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<tab v-model="ntab" :tabs="['greatlist', 'adaptation', 'beyond', 'list', 'object', 'async']" style="flex: 1; height: 0;">
|
|
4
4
|
<!-- 默认 -->
|
|
5
5
|
<layout v-if="ntab === 'greatlist'" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
6
|
-
<greatlist v-model="select" :data="slist" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :sizes="sizes" @select="onSelect" style="line-height: 1.3; flex: 1; height: 0;">
|
|
6
|
+
<greatlist v-model="select" :data="slist" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" @add="onGAdd" @Remove="onGRemove" :scroll="scroll" :sizes="sizes" @select="onSelect" style="line-height: 1.3; flex: 1; height: 0;">
|
|
7
7
|
<template v-slot="data">
|
|
8
8
|
<layout v-if="data.row.type === 0" align-v="center" gutter="5" style="flex: 1;">
|
|
9
9
|
<img :src="data.row.src" style="width: 32px; height: 32px;"></img>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<label>Raw data:</label>
|
|
52
52
|
<flow direction="v" style="border: solid 1px #b3b3b3; line-height: 1.5; height: 50px; padding: 5px;">{{listData}}</flow>
|
|
53
53
|
<layout gutter="10" style="flex: 1; height: 0;">
|
|
54
|
-
<list v-model="select2" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData" @label="label2 = $event" style="flex: 2; width: 0;" :tree="tree" :async="async" :icon="icon" icon-default="../../../res/txt.svg" @load="onSelectLoad">
|
|
54
|
+
<list v-model="select2" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData" @label="label2 = $event" style="flex: 2; width: 0;" :tree="tree" :async="async" :icon="icon" icon-default="../../../res/txt.svg" @load="onSelectLoad" @add="onLAdd" @Remove="onLRemove">
|
|
55
55
|
<menulist>
|
|
56
56
|
<menulist-item alt="I" @click="showIndex2">Show select</menulist-item>
|
|
57
57
|
</menulist>
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
</nav-item>
|
|
38
38
|
<nav-item label="Root1"></nav-item>
|
|
39
39
|
<nav-item label="Root2"></nav-item>
|
|
40
|
+
<nav-item label="Root3" name="root?id=1"></nav-item>
|
|
41
|
+
<nav-item label="Root4" name="root?id=2"></nav-item>
|
|
40
42
|
<nav-item label="Event" @select="onSelect"></nav-item>
|
|
41
43
|
<nav-item label="Root3" icon="/package/res/icon.svg"></nav-item>
|
|
42
44
|
<nav-item label="Root4" icon="/package/res/marker.svg"></nav-item>
|
|
@@ -92,7 +92,6 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
92
92
|
'children': ['xixi', 'xixida', 'gogogo']
|
|
93
93
|
}
|
|
94
94
|
];
|
|
95
|
-
this.slist2r = [];
|
|
96
95
|
this.addRemoveList = [];
|
|
97
96
|
this.select2 = ['haha2'];
|
|
98
97
|
this.aemodel = [];
|
|
@@ -154,11 +153,7 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
154
153
|
onRemote(value, resolve) {
|
|
155
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
155
|
yield clickgo.tool.sleep(300);
|
|
157
|
-
if (value === '') {
|
|
158
|
-
resolve(['1', '3', '5']);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (value === '8') {
|
|
156
|
+
if (!value || value === '8') {
|
|
162
157
|
resolve();
|
|
163
158
|
return;
|
|
164
159
|
}
|
|
@@ -171,11 +166,37 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
171
166
|
}]);
|
|
172
167
|
});
|
|
173
168
|
}
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
onGAdd(e) {
|
|
170
|
+
clickgo.form.notify({
|
|
171
|
+
'type': 'info',
|
|
172
|
+
'title': 'Greatselect @add',
|
|
173
|
+
'content': 'value: ' + e.detail.value.toString()
|
|
174
|
+
});
|
|
175
|
+
if (this.slist[e.detail.value].type === 1) {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
onGRemove(e) {
|
|
180
|
+
clickgo.form.notify({
|
|
181
|
+
'type': 'info',
|
|
182
|
+
'title': 'Greaselect @remove',
|
|
183
|
+
'content': 'value: ' + e.detail.value.toString()
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
onAdd(e) {
|
|
187
|
+
this.addRemoveList.unshift('@add, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
|
|
176
188
|
}
|
|
177
|
-
|
|
178
|
-
this.addRemoveList.unshift('@
|
|
189
|
+
onAdded(e) {
|
|
190
|
+
this.addRemoveList.unshift('@added, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
|
|
191
|
+
}
|
|
192
|
+
onRemove(e) {
|
|
193
|
+
this.addRemoveList.unshift('@remove, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value + ', mode: ' + e.detail.mode);
|
|
194
|
+
}
|
|
195
|
+
onRemoved(e) {
|
|
196
|
+
this.addRemoveList.unshift('@removed, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value + ', mode: ' + e.detail.mode);
|
|
197
|
+
}
|
|
198
|
+
onTagclick(e) {
|
|
199
|
+
this.addRemoveList.unshift('@tagclick, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
|
|
179
200
|
}
|
|
180
201
|
changeArea() {
|
|
181
202
|
switch (this.area) {
|
|
@@ -203,25 +224,13 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
203
224
|
}
|
|
204
225
|
onMounted() {
|
|
205
226
|
this.watch(() => this.select.join(','), (n, o) => {
|
|
206
|
-
|
|
207
|
-
const now = n.split(',');
|
|
208
|
-
const old = o.split(',');
|
|
209
|
-
for (const item of now) {
|
|
210
|
-
if (this.slist[parseInt(item)].type !== 0) {
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
select.push(parseInt(item));
|
|
214
|
-
}
|
|
215
|
-
if (select.length === now.length) {
|
|
227
|
+
if (this.multi) {
|
|
216
228
|
return;
|
|
217
229
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
select.push(parseInt(item));
|
|
230
|
+
if (this.slist[parseInt(n)].type === 0) {
|
|
231
|
+
return;
|
|
221
232
|
}
|
|
222
|
-
this.select =
|
|
223
|
-
}, {
|
|
224
|
-
'deep': true
|
|
233
|
+
this.select = [parseInt(o)];
|
|
225
234
|
});
|
|
226
235
|
}
|
|
227
236
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<!-- greatselect -->
|
|
5
5
|
<layout v-if="ntab === 'greatselect'" gutter="10" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
6
6
|
<label>Now select value is {{select}}:</label>
|
|
7
|
-
<greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :multi="multi" :sizes="sizes" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}" style="line-height: 1.3;">
|
|
7
|
+
<greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :multi="multi" :sizes="sizes" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}" style="line-height: 1.3;" @add="onGAdd" @remove="onGRemove">
|
|
8
8
|
<layout align-v="center" gutter="5" style="flex: 1;">
|
|
9
9
|
<img :src="slist[select[0]] ? slist[select[0]].src : ''" style="width: 32px; height: 32px;"></img>
|
|
10
10
|
<block>
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
<layout gutter="10" direction="v" style="padding: 10px;">
|
|
46
46
|
<label>Now select value is {{select2}}</label>
|
|
47
47
|
<label>Label: {{label2}}</label>
|
|
48
|
-
<select v-model="select2" @label="label2 = $event" :data="
|
|
48
|
+
<select v-model="select2" @label="label2 = $event" :data="slist2" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" @load="onLoad" @remote="onRemote" @add="onAdd" @remove="onRemove" @added="onAdded" @removed="onRemoved" @tagclick="onTagclick" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
49
49
|
<list :data="addRemoveList" style="height: 100px;"></list>
|
|
50
50
|
<label>Custom height:</label>
|
|
51
|
-
<select :data="
|
|
51
|
+
<select :data="['1','2','3','4','5']" :disabled="disabled" :editable="editable" :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" style="height: 60px;" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
52
52
|
<label>Always editable: {{aemodel}}</label>
|
|
53
53
|
<layout gutter="10">
|
|
54
|
-
<select v-model="aemodel" :data="
|
|
54
|
+
<select v-model="aemodel" :data="['1','2','3','4','5']" :disabled="disabled" editable :multi="multi" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" placeholder="Please enter" @load="onLoad" @remote="onRemote" style="flex: 1;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
55
55
|
<button @click="aemodel.length=0">clear</button>
|
|
56
56
|
<button @click="aemodel[0] = '4'">4</button>
|
|
57
57
|
</layout>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const clickgo = __importStar(require("clickgo"));
|
|
27
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
this.data = [
|
|
31
|
+
{
|
|
32
|
+
'label': 'step1'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
'value': 'step2'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
'icon': '/package/res/marker.svg',
|
|
39
|
+
'value': 'icon'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
'label': 'successful',
|
|
43
|
+
'value': 'step3',
|
|
44
|
+
'desc': 'qq'
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
this.plain = false;
|
|
48
|
+
this.step1 = '';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<form title="Step" width="500" height="500" min-width="300" min-height="400" padding="10">
|
|
2
|
+
<layout direction="v" gutter="10" style="flex: 1;">
|
|
3
|
+
<label>value: {{step1}}</label>
|
|
4
|
+
<step :data="data" :plain="plain" v-model="step1"></step>
|
|
5
|
+
<layout gutter="10">
|
|
6
|
+
<button style="flex: 1;" @click="step1 = 'step1'">step1</button>
|
|
7
|
+
<button style="flex: 1;" @click="step1 = 'step2'">step2</button>
|
|
8
|
+
<button style="flex: 1;" @click="step1 = 'icon'">icon</button>
|
|
9
|
+
</layout>
|
|
10
|
+
<layout gutter="10">
|
|
11
|
+
<button style="flex: 1;" @click="step1 = 'step3'">step3</button>
|
|
12
|
+
<button style="flex: 1;" @click="step1 = '#'">done</button>
|
|
13
|
+
<button style="flex: 1;" @click="plain = !plain">{{plain ? '' : '!'}}plain</button>
|
|
14
|
+
</layout>
|
|
15
|
+
</layout>
|
|
16
|
+
</form>
|
|
@@ -48,10 +48,10 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
48
48
|
this.drag = false;
|
|
49
49
|
this.cclose = false;
|
|
50
50
|
}
|
|
51
|
-
onClose(e
|
|
51
|
+
onClose(e) {
|
|
52
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
if (
|
|
54
|
-
yield clickgo.form.dialog('Closed, index: ' +
|
|
53
|
+
if (e.detail.index !== 10) {
|
|
54
|
+
yield clickgo.form.dialog('Closed, index: ' + e.detail.index.toString() + ', value: ' + e.detail.value);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
e.preventDefault();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<label>volume: {{volume}}</label>
|
|
4
4
|
<video src="/package/res/video.mp4" :controls="controls" :loop="loop" :muted="muted" v-model:volume="volume" v-model:play="play" style="flex: 1; height: 0;"></video>
|
|
5
5
|
<layout gutter="10">
|
|
6
|
-
|
|
6
|
+
<button @click="controls = !controls" style="flex: 1;">{{controls ? '' : '!'}}controls</button>
|
|
7
7
|
<button @click="loop = !loop" style="flex: 1;">{{loop ? '' : '!'}}loop</button>
|
|
8
8
|
<button @click="muted = !muted" style="flex: 1;">{{muted ? '' : '!'}}muted</button>
|
|
9
9
|
</layout>
|
|
@@ -69,6 +69,7 @@ const table_1 = __importDefault(require("./control/table/table"));
|
|
|
69
69
|
const text_1 = __importDefault(require("./control/text/text"));
|
|
70
70
|
const vflow_1 = __importDefault(require("./control/vflow/vflow"));
|
|
71
71
|
const video_1 = __importDefault(require("./control/video/video"));
|
|
72
|
+
const step_1 = __importDefault(require("./control/step/step"));
|
|
72
73
|
const xterm_1 = __importDefault(require("./control/xterm/xterm"));
|
|
73
74
|
const echarts_1 = __importDefault(require("./control/echarts/echarts"));
|
|
74
75
|
const tuieditor_1 = __importDefault(require("./control/tuieditor/tuieditor"));
|
|
@@ -161,6 +162,10 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
161
162
|
frm = yield clickgo.form.create(video_1.default);
|
|
162
163
|
break;
|
|
163
164
|
}
|
|
165
|
+
case 'cstep': {
|
|
166
|
+
frm = yield clickgo.form.create(step_1.default);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
164
169
|
case 'cxterm': {
|
|
165
170
|
frm = yield clickgo.form.create(xterm_1.default);
|
|
166
171
|
break;
|
|
@@ -69,7 +69,10 @@
|
|
|
69
69
|
</layout>
|
|
70
70
|
<layout gutter="10">
|
|
71
71
|
<button @click="openForm('ciconview')">Iconview</button>
|
|
72
|
-
<button @click="openForm('cvideo')">Video
|
|
72
|
+
<button @click="openForm('cvideo')">Video</button>
|
|
73
|
+
</layout>
|
|
74
|
+
<layout gutter="10">
|
|
75
|
+
<button @click="openForm('cstep')">Step</button>
|
|
73
76
|
</layout>
|
|
74
77
|
<layout gutter="10">
|
|
75
78
|
<button @click="openForm('cmonaco')">Monaco</button>
|
|
@@ -60,6 +60,12 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
60
60
|
get isCtrl() {
|
|
61
61
|
return clickgo.dom.is.ctrl;
|
|
62
62
|
}
|
|
63
|
+
get isMeta() {
|
|
64
|
+
return clickgo.dom.is.meta;
|
|
65
|
+
}
|
|
66
|
+
get isFull() {
|
|
67
|
+
return clickgo.dom.is.full;
|
|
68
|
+
}
|
|
63
69
|
setGlobalCursor(type) {
|
|
64
70
|
clickgo.dom.setGlobalCursor(type);
|
|
65
71
|
}
|
|
@@ -196,7 +202,9 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
196
202
|
});
|
|
197
203
|
}
|
|
198
204
|
fullscreen() {
|
|
199
|
-
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
yield clickgo.dom.fullscreen();
|
|
207
|
+
});
|
|
200
208
|
}
|
|
201
209
|
onMounted() {
|
|
202
210
|
clickgo.dom.watchStyle(this.refs.watchStyle.$el, 'font-size', (n, v) => {
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
<label>clickgo.dom.is.move: {{isMove ? 'true' : 'false'}}</label>
|
|
61
61
|
<label>clickgo.dom.is.shift: {{isShift ? 'true' : 'false'}}</label>
|
|
62
62
|
<label>clickgo.dom.is.ctrl: {{isCtrl ? 'true' : 'false'}}</label>
|
|
63
|
+
<label>clickgo.dom.is.meta: {{isMeta ? 'true' : 'false'}}</label>
|
|
64
|
+
<label>clickgo.dom.is.full: {{isFull ? 'true' : 'false'}}</label>
|
|
63
65
|
</layout>
|
|
64
66
|
</flow>
|
|
65
67
|
</form>
|
package/dist/clickgo.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.zip = exports.tool = exports.theme = exports.task = exports.storage = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
|
|
27
|
-
const version = '3.
|
|
27
|
+
const version = '3.10.0';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
package/dist/control/common.cgc
CHANGED
|
Binary file
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function launcher(boot) {
|
|
|
101
101
|
var _a;
|
|
102
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
103
|
const paths = [
|
|
104
|
-
loader.cdn + '/npm/vue@3.
|
|
104
|
+
loader.cdn + '/npm/vue@3.4.15/dist/vue.global.prod.min.js'
|
|
105
105
|
];
|
|
106
106
|
let ro = true;
|
|
107
107
|
if (!(window.ResizeObserver)) {
|
package/dist/index.ts
CHANGED
|
@@ -176,7 +176,7 @@ export function launcher(boot: AbstractBoot): void {
|
|
|
176
176
|
(async function() {
|
|
177
177
|
// --- 通过标签加载库 ---
|
|
178
178
|
const paths: string[] = [
|
|
179
|
-
loader.cdn + '/npm/vue@3.
|
|
179
|
+
loader.cdn + '/npm/vue@3.4.15/dist/vue.global.prod.min.js'
|
|
180
180
|
];
|
|
181
181
|
// --- 判断 ResizeObserver 是否存在 ---
|
|
182
182
|
let ro = true;
|
package/dist/lib/control.js
CHANGED
|
@@ -44,6 +44,7 @@ class AbstractControl {
|
|
|
44
44
|
constructor() {
|
|
45
45
|
this.packageFiles = {};
|
|
46
46
|
this.props = {};
|
|
47
|
+
this.emits = {};
|
|
47
48
|
this.slots = {};
|
|
48
49
|
}
|
|
49
50
|
get filename() {
|
|
@@ -272,6 +273,7 @@ function init(taskId, invoke) {
|
|
|
272
273
|
'layout': '',
|
|
273
274
|
'files': item.files,
|
|
274
275
|
'props': {},
|
|
276
|
+
'emits': {},
|
|
275
277
|
'data': {},
|
|
276
278
|
'access': {},
|
|
277
279
|
'methods': {},
|
|
@@ -353,6 +355,11 @@ function init(taskId, invoke) {
|
|
|
353
355
|
};
|
|
354
356
|
}
|
|
355
357
|
}
|
|
358
|
+
if (cls.emits) {
|
|
359
|
+
for (const key in cls.emits) {
|
|
360
|
+
t.controls[name].emits[key] = cls.emits[key];
|
|
361
|
+
}
|
|
362
|
+
}
|
|
356
363
|
const cdata = Object.entries(cls);
|
|
357
364
|
for (const item of cdata) {
|
|
358
365
|
if (item[0] === 'files') {
|
|
@@ -445,11 +452,15 @@ function buildComponents(taskId, formId, path) {
|
|
|
445
452
|
components['cg-' + name] = {
|
|
446
453
|
'template': control.layout.replace(/{{{formId}}}/g, formId.toString()),
|
|
447
454
|
'props': control.props,
|
|
455
|
+
'emits': control.emits,
|
|
448
456
|
'data': function () {
|
|
449
457
|
const data = tool.clone(control.data);
|
|
450
458
|
if (data.props) {
|
|
451
459
|
delete data.props;
|
|
452
460
|
}
|
|
461
|
+
if (data.emits) {
|
|
462
|
+
delete data.emits;
|
|
463
|
+
}
|
|
453
464
|
return data;
|
|
454
465
|
},
|
|
455
466
|
'methods': control.methods,
|
package/dist/lib/control.ts
CHANGED
|
@@ -164,6 +164,9 @@ export abstract class AbstractControl {
|
|
|
164
164
|
/** --- 组件参数,由用户定义重写 --- */
|
|
165
165
|
public readonly props = {};
|
|
166
166
|
|
|
167
|
+
/** --- 组件参数,由用户定义重写 --- */
|
|
168
|
+
public readonly emits: Record<string, null | ((payload: any) => boolean)> = {};
|
|
169
|
+
|
|
167
170
|
/** --- 组件的子插槽 --- */
|
|
168
171
|
public readonly slots: Record<string, any> = {};
|
|
169
172
|
|
|
@@ -390,6 +393,7 @@ export async function init(
|
|
|
390
393
|
|
|
391
394
|
'files': item.files,
|
|
392
395
|
'props': {},
|
|
396
|
+
'emits': {},
|
|
393
397
|
'data': {},
|
|
394
398
|
'access': {},
|
|
395
399
|
'methods': {},
|
|
@@ -493,6 +497,11 @@ export async function init(
|
|
|
493
497
|
};
|
|
494
498
|
}
|
|
495
499
|
}
|
|
500
|
+
if (cls.emits) {
|
|
501
|
+
for (const key in cls.emits) {
|
|
502
|
+
t.controls[name].emits[key] = cls.emits[key];
|
|
503
|
+
}
|
|
504
|
+
}
|
|
496
505
|
// --- DATA ---
|
|
497
506
|
const cdata = Object.entries(cls);
|
|
498
507
|
for (const item of cdata) {
|
|
@@ -598,12 +607,16 @@ export function buildComponents(
|
|
|
598
607
|
components['cg-' + name] = {
|
|
599
608
|
'template': control.layout.replace(/{{{formId}}}/g, formId.toString()),
|
|
600
609
|
'props': control.props,
|
|
610
|
+
'emits': control.emits,
|
|
601
611
|
|
|
602
612
|
'data': function() {
|
|
603
613
|
const data = tool.clone(control.data);
|
|
604
614
|
if (data.props) {
|
|
605
615
|
delete data.props;
|
|
606
616
|
}
|
|
617
|
+
if (data.emits) {
|
|
618
|
+
delete data.emits;
|
|
619
|
+
}
|
|
607
620
|
return data;
|
|
608
621
|
},
|
|
609
622
|
'methods': control.methods,
|