clickgo 3.11.12 → 3.11.14
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 +1 -1
- package/dist/app/demo/form/control/drawer/drawer.xml +10 -0
- package/dist/app/demo/form/control/form/form.js +2 -3
- package/dist/app/demo/form/control/form/form.xml +1 -1
- package/dist/app/demo/form/control/list/list.js +1 -1
- package/dist/app/demo/form/control/list/list.xml +16 -8
- package/dist/app/demo/form/control/page/page.js +1 -0
- package/dist/app/demo/form/control/page/page.xml +14 -8
- package/dist/app/demo/form/control/select/select.js +1 -0
- package/dist/app/demo/form/control/select/select.xml +5 -4
- package/dist/app/demo/form/control/table/table.js +1 -0
- package/dist/app/demo/form/control/table/table.xml +44 -43
- package/dist/app/demo/form/main.xml +1 -1
- package/dist/app/demo/form/solution/backpanel/backpanel.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/arteditor.cgc +0 -0
- package/dist/control/box.cgc +0 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/desc.cgc +0 -0
- package/dist/control/drawer.cgc +0 -0
- package/dist/control/echarts.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/html.cgc +0 -0
- package/dist/control/iconview.cgc +0 -0
- package/dist/control/map.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/nav.cgc +0 -0
- package/dist/control/page.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/table.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/control/tuieditor.cgc +0 -0
- package/dist/control/xterm.cgc +0 -0
- package/dist/global.css +1 -1
- package/dist/lib/control.js +4 -2
- package/dist/lib/control.ts +5 -2
- package/dist/lib/core.js +8 -3
- package/dist/lib/core.ts +8 -3
- package/dist/lib/form.js +45 -44
- package/dist/lib/form.ts +52 -51
- package/dist/lib/fs.js +6 -6
- package/dist/lib/fs.ts +7 -3
- package/dist/lib/task.js +3 -2
- package/dist/lib/task.ts +3 -2
- package/dist/theme/byterun.cgt +0 -0
- package/dist/theme/familiar.cgt +0 -0
- package/dist/theme/light.cgt +0 -0
- package/package.json +1 -1
- package/types/index.d.ts +6 -0
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.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.14'}"></script>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**index.js**
|
|
@@ -6,10 +6,20 @@
|
|
|
6
6
|
<drawer title="Drawer" gutter="10" v-model="drawer" direction="v" width="50%">
|
|
7
7
|
<label>123</label>
|
|
8
8
|
<button @click="drawer2 = true">456</button>
|
|
9
|
+
<tuieditor style="height: 200px;"></tuieditor>
|
|
9
10
|
</drawer>
|
|
10
11
|
<drawer title="Drawer2" gutter="10" v-model="drawer2" direction="v">
|
|
11
12
|
<label>789</label>
|
|
12
13
|
<button>012</button>
|
|
14
|
+
<button>012</button>
|
|
15
|
+
<button>012</button>
|
|
16
|
+
<button>012</button>
|
|
17
|
+
<button>012</button>
|
|
18
|
+
<button>012</button>
|
|
19
|
+
<button>012</button>
|
|
20
|
+
<button>012</button>
|
|
21
|
+
<button>012</button>
|
|
22
|
+
<button>012</button>
|
|
13
23
|
<template v-slot:footer>
|
|
14
24
|
<layout align-h="end" style="flex: 1;">
|
|
15
25
|
<button type="info" @click="drawer2 = false">OK</button>
|
|
@@ -48,15 +48,14 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
48
48
|
this.minWidth = 200;
|
|
49
49
|
this.minHeight = 100;
|
|
50
50
|
this.resize = true;
|
|
51
|
-
this.floading = false;
|
|
52
51
|
this.border = 'normal';
|
|
53
52
|
this.banClose = false;
|
|
54
53
|
}
|
|
55
54
|
showLoading() {
|
|
56
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
this.
|
|
56
|
+
this.loading = true;
|
|
58
57
|
yield clickgo.tool.sleep(1000);
|
|
59
|
-
this.
|
|
58
|
+
this.loading = false;
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
61
|
onClose(e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<form v-model:width="width" v-model:height="height" :icon="icon" :title="title" :min="min" :max="max" :close="close" v-model:state-max="stateMax" v-model:state-min="stateMin" :min-width="minWidth" :min-height="minHeight" :resize="resize" :
|
|
1
|
+
<form v-model:width="width" v-model:height="height" :icon="icon" :title="title" :min="min" :max="max" :close="close" v-model:state-max="stateMax" v-model:state-min="stateMin" :min-width="minWidth" :min-height="minHeight" :resize="resize" :border="border" direction="v" @close="onClose">
|
|
2
2
|
<flow direction="v">
|
|
3
3
|
<layout direction="v" gutter="10" style="padding: 10px;">
|
|
4
4
|
<label>focus: {{formFocus}}, width: {{width}}, height: {{height}}, state-max: {{stateMax}}, state-min: {{stateMin}}.</label>
|
|
@@ -91,6 +91,7 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
91
91
|
this.async = false;
|
|
92
92
|
this.icon = false;
|
|
93
93
|
this.scroll = 'auto';
|
|
94
|
+
this.virtual = false;
|
|
94
95
|
}
|
|
95
96
|
get sizes() {
|
|
96
97
|
const rtn = {};
|
|
@@ -253,7 +254,6 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
253
254
|
});
|
|
254
255
|
}
|
|
255
256
|
onLAdd(e) {
|
|
256
|
-
console.log('x', e.detail);
|
|
257
257
|
clickgo.form.notify({
|
|
258
258
|
'type': 'info',
|
|
259
259
|
'title': 'List @add',
|
|
@@ -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" @add="onGAdd" @Remove="onGRemove" :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'] : []" :virtual="virtual" @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>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</layout>
|
|
32
32
|
<!-- 自适应 -->
|
|
33
33
|
<layout v-else-if="ntab === 'adaptation'" direction="v" style="flex: 1; width: 0; padding: 10px;">
|
|
34
|
-
<greatlist :data="adData" v-model="select" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll">
|
|
34
|
+
<greatlist :data="adData" v-model="select" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual">
|
|
35
35
|
<template v-slot="data">type: {{data.row.type}}, index: {{data.index}}. {{(data.index === 20) ? 'long test long test long test long test long test' : ''}}</template>
|
|
36
36
|
<template v-slot:itempop>
|
|
37
37
|
<menulist>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</layout>
|
|
43
43
|
<!-- beyond -->
|
|
44
44
|
<layout v-else-if="ntab === 'beyond'" gutter="10" style="flex: 1; width: 0; padding: 10px;">
|
|
45
|
-
<greatlist :data="adData" v-model="select" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" content-width="max" style="flex: 1; width: 0; white-space: nowrap;">
|
|
45
|
+
<greatlist :data="adData" v-model="select" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" content-width="max" style="flex: 1; width: 0; white-space: nowrap;">
|
|
46
46
|
<template v-slot="data">index: {{data.index}}. long long long long long long long long long long long.</template>
|
|
47
47
|
</greatlist>
|
|
48
48
|
</layout>
|
|
@@ -51,12 +51,19 @@
|
|
|
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" @add="onLAdd" @Remove="onLRemove">
|
|
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" :virtual="virtual" @load="onSelectLoad" @add="onLAdd" @Remove="onLRemove">
|
|
55
55
|
<menulist>
|
|
56
56
|
<menulist-item alt="I" @click="showIndex2">Show select</menulist-item>
|
|
57
57
|
</menulist>
|
|
58
58
|
</list>
|
|
59
|
-
<list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData2" style="flex: 1; width: 0;"
|
|
59
|
+
<list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" :data="listData2" style="flex: 1; width: 0;">
|
|
60
|
+
<template v-slot:row="data">
|
|
61
|
+
<layout gutter="10" align-v="center">
|
|
62
|
+
<label style="flex: 1;">{{data.row.label}}</label>
|
|
63
|
+
<button v-if="data.index === 4">abc</button>
|
|
64
|
+
</layout>
|
|
65
|
+
</template>
|
|
66
|
+
</list>
|
|
60
67
|
</layout>
|
|
61
68
|
<label class="tip">Right-click (computer) or press and hold (phone) to open the universal menu.</label>
|
|
62
69
|
</layout>
|
|
@@ -65,20 +72,20 @@
|
|
|
65
72
|
<label>Select value: {{selectObject}}</label>
|
|
66
73
|
<label>Raw data:</label>
|
|
67
74
|
<flow direction="v" style="border: solid 1px #b3b3b3; line-height: 1.5; height: 50px; padding: 5px;">{{listDataObject}}</flow>
|
|
68
|
-
<list v-model="selectObject" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listDataObject" style="flex: 1;"></list>
|
|
75
|
+
<list v-model="selectObject" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listDataObject" :virtual="virtual" style="flex: 1;"></list>
|
|
69
76
|
</layout>
|
|
70
77
|
<!-- async -->
|
|
71
78
|
<layout v-else gutter="10" style="flex: 1; width: 0; padding: 10px;">
|
|
72
79
|
<layout direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
73
80
|
<label>greatlist: {{select3}}</label>
|
|
74
|
-
<greatlist v-model="select3" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData3" v-slot="data" style="flex: 1; height: 0;">
|
|
81
|
+
<greatlist v-model="select3" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData3" :virtual="virtual" v-slot="data" style="flex: 1; height: 0;">
|
|
75
82
|
{{data.row.value ? data.row.value : data.row}}
|
|
76
83
|
</greatlist>
|
|
77
84
|
<button v-if="listData3.length === 0" @click="listData3 = [{'value': 'A', disabled: true}, 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];select3 = [12]">Load data</button>
|
|
78
85
|
</layout>
|
|
79
86
|
<layout direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
80
87
|
<label>list: {{select4}}</label>
|
|
81
|
-
<list v-model="select4" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :data="listData4" style="flex: 1; height: 0;"></list>
|
|
88
|
+
<list v-model="select4" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual" :data="listData4" style="flex: 1; height: 0;"></list>
|
|
82
89
|
<button v-if="listData4.length === 0" @click="listData4 = [{'value': 'A', disabled: true}, 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'];select4 = ['M']">Load data</button>
|
|
83
90
|
</layout>
|
|
84
91
|
</layout>
|
|
@@ -104,5 +111,6 @@
|
|
|
104
111
|
<button @click="must = !must">{{must ? '' : '!'}}must</button>
|
|
105
112
|
<button @click="selection = !selection">{{selection ? '' : '!'}}selection</button>
|
|
106
113
|
<button @click="gesture = !gesture">{{gesture ? '' : '!'}}gesture</button>
|
|
114
|
+
<button @click="virtual = !virtual">{{virtual ? '' : '!'}}virtual</button>
|
|
107
115
|
</layout>
|
|
108
116
|
</form>
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
<form width="
|
|
1
|
+
<form width="700" height="400" title="Page">
|
|
2
2
|
<layout direction="v" gutter="10" style="flex: 1; padding: 10px;">
|
|
3
|
-
<page max="10" />
|
|
4
|
-
<page v-model="p1" max="10" />
|
|
5
|
-
<page v-model="p2" max="30" />
|
|
6
|
-
<page v-model="p3" total="1282" />
|
|
7
|
-
<page v-model="p4" total="1282" count="20" />
|
|
8
|
-
<page v-model="p5" :total="total5" count="20" />
|
|
9
|
-
<
|
|
3
|
+
<page max="10" :control="control" />
|
|
4
|
+
<page v-model="p1" max="10" :control="control" />
|
|
5
|
+
<page v-model="p2" max="30" :control="control" />
|
|
6
|
+
<page v-model="p3" total="1282" :control="control" />
|
|
7
|
+
<page v-model="p4" total="1282" count="20" :control="control" />
|
|
8
|
+
<page v-model="p5" :total="total5" count="20" :control="control" />
|
|
9
|
+
<layout gutter="10">
|
|
10
|
+
<button @click="total5 = total5 ? 0 : 300" style="flex: 2;">total to {{total5 ? 0 : 300}}</button>
|
|
11
|
+
<button @click="control=2" style="flex: 2;">control to 2</button>
|
|
12
|
+
<button @click="control=5" style="flex: 1;">to 5</button>
|
|
13
|
+
<button @click="control=0" style="flex: 1;">to 0</button>
|
|
14
|
+
<button @click="control=1" style="flex: 1;">to 1</button>
|
|
15
|
+
</layout>
|
|
10
16
|
</layout>
|
|
11
17
|
</form>
|
|
@@ -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" :plain="plain" :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">
|
|
7
|
+
<greatselect v-model="select" :data="slist" :area="area" :disabled="disabled" :multi="multi" :plain="plain" :sizes="sizes" :virtual="virtual" :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>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
</greatselect>
|
|
31
31
|
<label>Custom pop:</label>
|
|
32
|
-
<greatselect pop="custom" :area="area" :plain="plain" :disabled="disabled" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
|
|
32
|
+
<greatselect pop="custom" :area="area" :plain="plain" :disabled="disabled" :virtual="virtual" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}">
|
|
33
33
|
<label>Pop is button.</label>
|
|
34
34
|
<template v-slot:pop>
|
|
35
35
|
<button>Nothing</button>
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
<label>Now select value is {{select3}}</label>
|
|
82
82
|
<label>Label: {{label3}}</label>
|
|
83
83
|
<label>Level: {{level3}}</label>
|
|
84
|
-
<levelselect ref="lese" v-model="select3" @label="label3 = $event" @level="level3 = $event" :data="s3other ? slist3r : slist2" :disabled="disabled" :plain="plain" :async="async" placeholder="Please enter" @load="onLoad" @loaded="onLoaded" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></levelselect>
|
|
84
|
+
<levelselect ref="lese" v-model="select3" @label="label3 = $event" @level="level3 = $event" :data="s3other ? slist3r : slist2" :disabled="disabled" :plain="plain" :async="async" :virtual="virtual" placeholder="Please enter" @load="onLoad" @loaded="onLoaded" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></levelselect>
|
|
85
85
|
<button @click="async = !async">{{async ? '' : '!'}}async</button>
|
|
86
86
|
<layout gutter="10">
|
|
87
87
|
<button @click="select3 = 'title'" style="flex: 1;">Set: 'title'</button>
|
|
@@ -110,8 +110,9 @@
|
|
|
110
110
|
<button @click="padding = !padding" style="flex: 1;">Change padding</button>
|
|
111
111
|
</layout>
|
|
112
112
|
<layout gutter="10">
|
|
113
|
-
<button @click="background = !background" style="flex: 1;">Change bg
|
|
113
|
+
<button @click="background = !background" style="flex: 1;">Change bg color</button>
|
|
114
114
|
<button v-if="ntab !== 'levelselect'" @click="multi = !multi" style="flex: 1;">{{multi ? '' : '!'}}multi</button>
|
|
115
|
+
<button @click="virtual = !virtual" style="flex: 1;">{{virtual ? '' : '!'}}virtual</button>
|
|
115
116
|
</layout>
|
|
116
117
|
</layout>
|
|
117
118
|
</form>
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
<form width="
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</table-item>
|
|
14
|
-
</template>
|
|
15
|
-
<template v-slot:pop>
|
|
16
|
-
<menulist>
|
|
17
|
-
<menulist-item alt="S" @click="showIndex">Show select</menulist-item>
|
|
18
|
-
</menulist>
|
|
19
|
-
</template>
|
|
20
|
-
</table>
|
|
21
|
-
<template v-if="loadFirst">
|
|
22
|
-
<layout gutter="10">
|
|
23
|
-
<button style="flex: 1;" @click="data.splice(-2, 0, {'type': 0, 'name': 'Card' + data.length, 'disabled': false});refreshSort()">Add</button>
|
|
24
|
-
<button style="flex: 1;" @click="data.splice(-3, 1);refreshSort()">Remove</button>
|
|
25
|
-
<button style="flex: 1;" @click="scrollChange">Scroll {{scroll}}</button>
|
|
26
|
-
<button style="flex: 1;" @click="adaptation = !adaptation">{{adaptation ? '' : '!'}}adaptation</button>
|
|
27
|
-
</layout>
|
|
28
|
-
<layout gutter="10">
|
|
29
|
-
<button style="flex: 1;" @click="disabled = !disabled">{{disabled ? '' : '!'}}disabled</button>
|
|
30
|
-
<button style="flex: 1;" @click="multi = !multi">{{multi ? '' : '!'}}multi</button>
|
|
31
|
-
<button style="flex: 1;" @click="ctrl = !ctrl">{{ctrl ? '' : '!'}}ctrl</button>
|
|
32
|
-
<button style="flex: 1;" @click="must = !must">{{must ? '' : '!'}}must</button>
|
|
33
|
-
<button style="flex: 1;" @click="index = !index">{{index ? '' : '!'}}index</button>
|
|
34
|
-
</layout>
|
|
35
|
-
<layout gutter="10">
|
|
36
|
-
<button style="flex: 1;" @click="sortChange">sort {{sort ? 'true' : (sort === false ? 'false' : 'undefined')}}</button>
|
|
37
|
-
<button style="flex: 1;" @click="selection = !selection">{{selection ? '' : '!'}}selection</button>
|
|
38
|
-
<button style="flex: 1;" @click="gesture = !gesture">{{gesture ? '' : '!'}}gesture</button>
|
|
39
|
-
<button style="flex: 1;" @click="split = !split">{{split ? '' : '!'}}split</button>
|
|
40
|
-
</layout>
|
|
1
|
+
<form width="450" height="500" title="Table" padding="10">
|
|
2
|
+
<layout direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
3
|
+
<label>Value: {{val}}</label>
|
|
4
|
+
<table :data="data" :style="{'flex': adaptation ? undefined : '1'}" v-model="val" :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" :split="split" @gesture="onGesture" :scroll="scroll" :sizes="sizes" :sort="sort" :virtual="virtual" @select="onSelect" @sort="onSort">
|
|
5
|
+
<template v-slot="d">
|
|
6
|
+
<table-item v-if="index" label="index" width="80" sort="false">{{d.index}}</table-item>
|
|
7
|
+
<table-item label="name">{{d.row.name ?? 'name'}}</table-item>
|
|
8
|
+
<table-item label="size" width="50" align-v="center" align-h="center">{{d.row.type ?? '0'}}</table-item>
|
|
9
|
+
<table-item label="col" width="100" direction="v" gutter="5">
|
|
10
|
+
<label>line1</label>
|
|
11
|
+
<button>line2</button>
|
|
12
|
+
</table-item>
|
|
41
13
|
</template>
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
14
|
+
<template v-slot:pop>
|
|
15
|
+
<menulist>
|
|
16
|
+
<menulist-item alt="S" @click="showIndex">Show select</menulist-item>
|
|
17
|
+
</menulist>
|
|
18
|
+
</template>
|
|
19
|
+
</table>
|
|
20
|
+
<template v-if="loadFirst">
|
|
21
|
+
<layout gutter="10">
|
|
22
|
+
<button style="flex: 1;" @click="data.splice(-2, 0, {'type': 0, 'name': 'Card' + data.length, 'disabled': false});refreshSort()">Add</button>
|
|
23
|
+
<button style="flex: 1;" @click="data.splice(-3, 1);refreshSort()">Remove</button>
|
|
24
|
+
<button style="flex: 1;" @click="scrollChange">Scroll {{scroll}}</button>
|
|
25
|
+
<button style="flex: 1;" @click="adaptation = !adaptation">{{adaptation ? '' : '!'}}adaptation</button>
|
|
26
|
+
</layout>
|
|
27
|
+
<layout gutter="10">
|
|
28
|
+
<button style="flex: 1;" @click="sortChange">sort {{sort ? 'true' : (sort === false ? 'false' : 'undefined')}}</button>
|
|
29
|
+
<button style="flex: 1;" @click="selection = !selection">{{selection ? '' : '!'}}selection</button>
|
|
30
|
+
<button style="flex: 1;" @click="gesture = !gesture">{{gesture ? '' : '!'}}gesture</button>
|
|
31
|
+
<button style="flex: 1;" @click="split = !split">{{split ? '' : '!'}}split</button>
|
|
32
|
+
</layout>
|
|
33
|
+
<layout gutter="10">
|
|
34
|
+
<button style="flex: 1;" @click="disabled = !disabled">{{disabled ? '' : '!'}}disabled</button>
|
|
35
|
+
<button style="flex: 1;" @click="multi = !multi">{{multi ? '' : '!'}}multi</button>
|
|
36
|
+
<button style="flex: 1;" @click="ctrl = !ctrl">{{ctrl ? '' : '!'}}ctrl</button>
|
|
37
|
+
</layout>
|
|
38
|
+
<layout gutter="10">
|
|
39
|
+
<button style="flex: 1;" @click="must = !must">{{must ? '' : '!'}}must</button>
|
|
40
|
+
<button style="flex: 1;" @click="index = !index">{{index ? '' : '!'}}index</button>
|
|
41
|
+
<button style="flex: 1;" @click="virtual = !virtual">{{virtual ? '' : '!'}}virtual</button>
|
|
42
|
+
</layout>
|
|
43
|
+
</template>
|
|
44
|
+
<button v-else @click="load">Load</button>
|
|
45
|
+
</layout>
|
|
45
46
|
</form>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<layout gutter="10">
|
|
15
15
|
<button @click="openForm('ccheck')">Check</button>
|
|
16
16
|
<button @click="openForm('cradio')">Radio</button>
|
|
17
|
-
<button @click="openForm('cswitch')">
|
|
17
|
+
<button @click="openForm('cswitch')">Switch</button>
|
|
18
18
|
</layout>
|
|
19
19
|
<layout gutter="10">
|
|
20
20
|
<button @click="openForm('ctext')">Text</button>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<button @click="formHash = fh">Change</button>
|
|
7
7
|
<button @click="formHashBack">Back</button>
|
|
8
8
|
</layout>
|
|
9
|
-
<nav v-model="name" default="list" hash style="flex: 1;">
|
|
9
|
+
<nav v-model="name" default="list" hash style="flex: 1; height: 0;">
|
|
10
10
|
<nav-item label="User">
|
|
11
11
|
<nav-item label="All list" name="list"></nav-item>
|
|
12
12
|
<nav-item label="Available" name="list?avail=1"></nav-item>
|
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.11.
|
|
27
|
+
const version = '3.11.14';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
|
Binary file
|
package/dist/control/box.cgc
CHANGED
|
Binary file
|
package/dist/control/common.cgc
CHANGED
|
Binary file
|
package/dist/control/desc.cgc
CHANGED
|
Binary file
|
package/dist/control/drawer.cgc
CHANGED
|
Binary file
|
package/dist/control/echarts.cgc
CHANGED
|
Binary file
|
package/dist/control/form.cgc
CHANGED
|
Binary file
|
package/dist/control/html.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/map.cgc
CHANGED
|
Binary file
|
package/dist/control/monaco.cgc
CHANGED
|
Binary file
|
package/dist/control/nav.cgc
CHANGED
|
Binary file
|
package/dist/control/page.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/table.cgc
CHANGED
|
Binary file
|
package/dist/control/task.cgc
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/control/xterm.cgc
CHANGED
|
Binary file
|
package/dist/global.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
#cg-wrap{position:fixed;left:0;top:0;--g-padding:7px;--g-bpadding:18px;--g-margin:2px;--g-radius:0;--g-size:12px;--g-family:"Lucida Sans Unicode", "Helvetica Neue","Helvetica","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans CJK","Source Han Sans","WenQuanYi Micro Hei","Microsoft YaHei",sans-serif;--g-line:1;--g-cubic:cubic-bezier(0.39, 0.575, 0.565, 1);--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--success-bg:hsl(150, 100%, 98%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--success-bg:hsl(210, 100%, 98%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--warning-bg:hsl(20, 100%, 98%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--danger-bg:hsl(350, 100%, 98%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .35);--system-control-background:hsla(0, 0%, 100%, .03);--system-background-hover:hsla(0, 0%, 100%, .06);--system-background-active:hsla(0, 0%, 100%, .1);--system-border-color:hsla(0, 0%, 100%, .03);--system-border-color-hover:hsla(0, 0%, 100%, .06);--system-placeholder-color: hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-focusbox-border-color:var(--g-plain-border-color);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%);--g-block-background:hsl(0, 0%, 85%);--g-block-background-hover:hsl(0, 0%, 75%)}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:absolute;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-gesture.ani{transition:all .3s var(--g-cubic);transition-property:left,top,transform}#cg-drag{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;pointer-events:none;background:rgba(255,255,255,.1);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 3px 5px rgba(0,0,0,.1);opacity:0;display:flex;justify-content:center;align-items:center;border:solid 1px #fff;transition:all .3s var(--g-cubic);transition-property:transform,border;transform:initial}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .3s var(--g-cubic);transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;appearance:none;padding:15px;border:solid 1px rgba(0,0,0,0);background:var(--system-control-background);width:60%;border-radius:5px;color:var(--system-color);transition:all .3s var(--g-cubic)}.cg-launcher-sinput::placeholder{color:var(--system-placeholder-color)}.cg-launcher-sinput::selection{background-color:var(--system-background-hover)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-border-color-hover)}.cg-launcher-foldername{-webkit-appearance:none;appearance:none;height:50px;font-size:28px !important;border:none;background:rgba(0,0,0,0);width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-background-hover)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .3s var(--g-cubic);transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .3s var(--g-cubic);transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .3s var(--g-cubic)}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:absolute;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.3s var(--g-cubic);transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-notify{z-index:20020005}.cg-notify-wrap{background:var(--system-background);position:fixed;padding:15px;border-radius:5px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.3s var(--g-cubic);transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5)}.cg-notify-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-notify-icon.cg-primary{background:var(--success)}.cg-notify-icon.cg-info{background:var(--info)}.cg-notify-icon.cg-warning{background:var(--warning)}.cg-notify-icon.cg-danger{background:var(--danger)}.cg-notify-icon.cg-progress{background:var(--cg)}.cg-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-notify-content{line-height:1.5;word-break:break-word}.cg-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .3s var(--g-cubic);overflow-x:auto;position:fixed}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}#cg-confirm{z-index:20020006;position:fixed;left:0;top:0;width:100%;height:100%;background:var(--system-background);-webkit-backdrop-filter:blur(150px) saturate(1.5);backdrop-filter:blur(150px) saturate(1.5);justify-content:center;align-items:center}#cg-confirm .cg-confirm-box{background:var(--system-background);width:60%;box-shadow:0 5px 20px rgba(0,0,0,.25);font-size:14px;border-radius:3px;overflow:hidden;color:var(--system-color)}#cg-confirm .cg-confirm-box #cg-confirm-content{padding:25px;line-height:1.5}#cg-confirm .cg-confirm-box .cg-confirm-controls{border-top:solid .5px var(--system-border-color);display:flex}#cg-confirm .cg-confirm-box .cg-confirm-controls>div{padding:20px;flex:1;text-align:center}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:last-child{border-left:solid .5px var(--system-border-color)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:hover{background:var(--system-background-hover)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:active{background:var(--system-background-active)}
|
|
1
|
+
#cg-wrap{position:fixed;left:0;top:0;--g-padding:7px;--g-bpadding:18px;--g-margin:2px;--g-radius:0;--g-size:12px;--g-family:"Lucida Sans Unicode", "Helvetica Neue","Helvetica","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Noto Sans CJK","Source Han Sans","WenQuanYi Micro Hei","Microsoft YaHei",sans-serif;--g-line:1;--g-cubic:cubic-bezier(0.39, 0.575, 0.565, 1);--cg:hsl(20, 100%, 65%);--success:hsl(150, 100%, 40%);--success-hover:hsl(150, 100%, 45%);--success-active:hsl(150, 100%, 30%);--success-focus:hsl(150, 100%, 35%);--success-disabled:hsl(150, 0%, 40%);--success-bg:hsl(150, 100%, 98%);--info:hsl(210, 100%, 50%);--info-hover:hsl(210, 100%, 60%);--info-active:hsl(210, 100%, 40%);--info-focus:hsl(210, 100%, 45%);--info-disabled:hsl(210, 0%, 50%);--success-bg:hsl(210, 100%, 98%);--warning:hsl(20, 100%, 70%);--warning-hover:hsl(20, 100%, 80%);--warning-active:hsl(20, 100%, 60%);--warning-focus:hsl(20, 100%, 65%);--warning-disabled:hsl(20, 0%, 70%);--warning-bg:hsl(20, 100%, 98%);--danger:hsl(350, 100%, 50%);--danger-hover:hsl(350, 100%, 70%);--danger-active:hsl(350, 100%, 40%);--danger-focus:hsl(350, 100%, 45%);--danger-disabled:hsl(350, 0%, 50%);--danger-bg:hsl(350, 100%, 98%);--system-color:hsl(0, 0%, 95%);--system-background:hsla(0, 0%, 0%, .35);--system-control-background:hsla(0, 0%, 100%, .03);--system-background-hover:hsla(0, 0%, 100%, .06);--system-background-active:hsla(0, 0%, 100%, .1);--system-border-color:hsla(0, 0%, 100%, .03);--system-border-color-hover:hsla(0, 0%, 100%, .06);--system-placeholder-color: hsla(0, 0%, 100%, .2);--face:hsl(0, 0%, 95%);--g-color:hsl(0, 0%, 20%);--g-color-hover:hsl(0, 0%, 30%);--g-color-active:hsl(0, 0%, 10%);--g-color-focus:hsl(0, 0%, 15%);--g-color-disabled:hsl(0, 0%, 60%);--g-background:hsl(0, 0%, 95%);--g-background-hover:hsl(0, 0%, 100%);--g-background-active:hsl(0, 0%, 85%);--g-background-kp:hsl(0, 0%, 80%);--g-background-opacity:hsl(0, 0%, 50%, .2);--g-background-focus:hsl(0, 0%, 97.5%);--g-background-disabled:hsl(0, 0%, 75%);--g-border-color:hsl(0, 0%, 40%);--g-border-color-hover:hsl(0, 0%, 50%);--g-border-color-active:hsl(0, 0%, 30%);--g-border-color-focus:hsl(0, 0%, 35%);--g-border-color-disabled:hsl(0, 0%, 60%);--g-focusbox-border-color:var(--g-plain-border-color);--g-plain-color:var(--g-color);--g-plain-color-hover:var(--g-color-hover);--g-plain-color-active:var(--g-color-active);--g-plain-color-focus:var(--g-color-focus);--g-plain-color-disabled:var(--g-color-disabled);--g-plain-background:hsl(0, 0%, 100%);--g-plain-background-hover:hsl(0, 0%, 98%);--g-plain-background-active:hsl(0, 0%, 95%);--g-plain-background-focus:var(--g-plain-background);--g-plain-background-disabled:hsl(0, 0%, 95%);--g-plain-border-color:hsl(0, 0%, 70%);--g-plain-border-color-hover:hsl(0, 0%, 80%);--g-plain-border-color-active:hsl(0, 0%, 60%);--g-plain-border-color-focus:hsl(0, 0%, 65%);--g-plain-border-color-disabled:hsl(0, 0%, 60%);--g-block-background:hsl(0, 0%, 85%);--g-block-background-hover:hsl(0, 0%, 75%)}[data-cg-disabled]{cursor:not-allowed}#cg-form-list{z-index:20020000}#cg-pop-list{z-index:20020001}#cg-simpletask{z-index:20020002}#cg-rectangle{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;box-shadow:0 0 10px rgba(0,0,0,.25);background:rgba(255,255,255,.05);pointer-events:none;opacity:0}#cg-circular{z-index:20020003;box-sizing:border-box;position:absolute;border:solid 3px var(--cg);border-radius:50%;filter:drop-shadow(0 0 3px var(--cg));pointer-events:none;opacity:0}#cg-gesture{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:50%;pointer-events:none;opacity:0;background:var(--system-background);box-shadow:0 5px 20px rgba(0,0,0,.25);transform:scale(0);width:20px;height:20px}#cg-gesture.done{background:rgba(255,255,255,.3);border:solid 3px rgba(0,0,0,.3)}#cg-gesture.ani{transition:all .3s var(--g-cubic);transition-property:left,top,transform}#cg-drag{z-index:20020003;box-sizing:border-box;position:absolute;border-radius:3px;pointer-events:none;background:rgba(255,255,255,.1);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);box-shadow:0 3px 5px rgba(0,0,0,.1);opacity:0;display:flex;justify-content:center;align-items:center;border:solid 1px #fff;transition:all .3s var(--g-cubic);transition-property:transform,border;transform:initial}#cg-launcher{z-index:20020004;box-sizing:border-box;position:fixed;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);width:100%;height:100%;left:0;top:0;color:var(--system-color);display:none;flex-direction:column;transition:all .3s var(--g-cubic);transform:scale(1.2);opacity:0}#cg-launcher:not(.cg-show){pointer-events:none}#cg-launcher.cg-show{transform:scale(1);opacity:1}.cg-launcher-search{text-align:center;padding:50px}.cg-launcher-sinput{-webkit-appearance:none;appearance:none;padding:15px;border:solid 1px rgba(0,0,0,0);background:var(--system-control-background);width:60%;border-radius:5px;color:var(--system-color);transition:all .3s var(--g-cubic)}.cg-launcher-sinput::placeholder{color:var(--system-placeholder-color)}.cg-launcher-sinput::selection{background-color:var(--system-background-hover)}.cg-launcher-sinput:focus{outline:none;border-color:var(--system-border-color-hover)}.cg-launcher-foldername{-webkit-appearance:none;appearance:none;height:50px;font-size:28px !important;border:none;background:rgba(0,0,0,0);width:50%;color:var(--system-color);text-align:center}.cg-launcher-foldername::selection{background-color:var(--system-background-hover)}.cg-launcher-foldername:focus{outline:none}.cg-launcher-item{width:190px;display:inline-flex;vertical-align:middle;margin-bottom:50px}.cg-launcher-inner{flex:1;width:0}.cg-launcher-icon{background-position:center;background-size:80px;height:80px;background-repeat:no-repeat}.cg-launcher-icon:active{filter:brightness(0.6)}.cg-launcher-name{font-size:13px;font-weight:bold;text-shadow:0 0 3px rgba(0,0,0,.6);text-align:center;margin-top:20px}.cg-launcher-icon,.cg-launcher-name{transition:all .3s var(--g-cubic);transition-property:opacity}.cg-launcher-space{width:50px}.cg-launcher-folder{display:flex;justify-content:center;height:80px}.cg-launcher-folder>div{height:80px;width:80px;background:rgba(255,255,255,.3);border-radius:20px;padding:10px 4px 4px 10px;transition:all .3s var(--g-cubic);transition-property:left,top,width,height,opacity;overflow-y:auto}.cg-launcher-folder>div::-webkit-scrollbar{display:none}.cg-launcher-folder>div .cg-launcher-item,.cg-launcher-folder>div .cg-launcher-space{transition:all .3s var(--g-cubic)}.cg-launcher-folder>div.cg-show{padding:50px 0 0 50px}.cg-launcher-folder>div:not(.cg-show):active{filter:brightness(0.6)}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-item{width:22px;margin-bottom:6px}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-icon{background-size:16px;height:16px;pointer-events:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-name{display:none}.cg-launcher-folder>div:not(.cg-show) .cg-launcher-space{width:6px}.cg-launcher-list{flex:1;height:0;overflow-y:auto;padding:0 0 0 50px}.cg-launcher-list::-webkit-scrollbar{display:none}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-icon,.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-name{opacity:0}.cg-launcher-list.cg-folder-open>.cg-launcher-item>.cg-launcher-inner>.cg-launcher-folder>div:not(.cg-show){opacity:0}[data-cg-pop]{position:absolute;box-shadow:0px 5px 20px rgba(0,0,0,.25);transition:.3s var(--g-cubic);transition-property:transform,opacity;transform:translateY(-10px);opacity:0}[data-cg-pop]:not([data-cg-open]){pointer-events:none}[data-cg-pop][data-cg-open]{transform:translateY(0px);opacity:1}#cg-notify{z-index:20020005}.cg-notify-wrap{background:var(--system-background);position:fixed;padding:15px;border-radius:5px;right:0;top:0;width:280px;font-size:14px;display:flex;transition:.3s var(--g-cubic);transition-property:transform,opacity;overflow:hidden;color:var(--system-color);box-shadow:0 5px 20px rgba(0,0,0,.25);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5)}.cg-notify-icon{margin-right:10px;width:16px;height:16px;border-radius:50%}.cg-notify-icon.cg-primary{background:var(--success)}.cg-notify-icon.cg-info{background:var(--info)}.cg-notify-icon.cg-warning{background:var(--warning)}.cg-notify-icon.cg-danger{background:var(--danger)}.cg-notify-icon.cg-progress{background:var(--cg)}.cg-notify-title{font-size:16px;font-weight:bold;padding-bottom:10px}.cg-notify-content{line-height:1.5;word-break:break-word}.cg-notify-progress{position:absolute;bottom:0;left:0;border-radius:1px;background:var(--cg);transition:width 1s ease-out;width:0%;height:2px}#cg-simpletask{left:0;bottom:-46px;width:100%;height:46px;top:initial;background:var(--system-background);-webkit-backdrop-filter:blur(30px) saturate(1.5);backdrop-filter:blur(30px) saturate(1.5);padding:5px 0 5px 5px;display:flex;color:var(--system-color);transition:bottom .3s var(--g-cubic);overflow-x:auto;position:fixed}#cg-simpletask::-webkit-scrollbar{display:none}.cg-simpletask-item{background:rgba(0,0,0,.05);border-radius:3px;padding:10px;display:flex;align-items:center;margin-right:5px}.cg-simpletask-item:hover{background:rgba(0,0,0,.1)}.cg-simpletask-item:active{background:rgba(0,0,0,.2)}.cg-simpletask-icon{margin-right:5px;background-size:cover;width:16px;height:16px}#cg-confirm{z-index:20020006;position:fixed;left:0;top:0;width:100%;height:100%;background:var(--system-background);-webkit-backdrop-filter:blur(150px) saturate(1.5);backdrop-filter:blur(150px) saturate(1.5);justify-content:center;align-items:center}#cg-confirm .cg-confirm-box{background:var(--system-background);width:60%;box-shadow:0 5px 20px rgba(0,0,0,.25);font-size:14px;border-radius:3px;overflow:hidden;color:var(--system-color)}#cg-confirm .cg-confirm-box #cg-confirm-content{padding:25px;line-height:1.5}#cg-confirm .cg-confirm-box .cg-confirm-controls{border-top:solid .5px var(--system-border-color);display:flex}#cg-confirm .cg-confirm-box .cg-confirm-controls>div{padding:20px;flex:1;text-align:center}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:last-child{border-left:solid .5px var(--system-border-color)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:hover{background:var(--system-background-hover)}#cg-confirm .cg-confirm-box .cg-confirm-controls>div:active{background:var(--system-background-active)}
|
package/dist/lib/control.js
CHANGED
|
@@ -288,7 +288,7 @@ function read(blob) {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
exports.read = read;
|
|
291
|
-
function init(taskId, invoke) {
|
|
291
|
+
function init(taskId, invoke, cache) {
|
|
292
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
293
|
const t = task.list[taskId];
|
|
294
294
|
if (!t) {
|
|
@@ -299,7 +299,9 @@ function init(taskId, invoke) {
|
|
|
299
299
|
path += '.cgc';
|
|
300
300
|
}
|
|
301
301
|
path = tool.urlResolve('/', path);
|
|
302
|
-
const file = yield fs.getContent(path,
|
|
302
|
+
const file = yield fs.getContent(path, {
|
|
303
|
+
'cache': cache
|
|
304
|
+
}, taskId);
|
|
303
305
|
if (file && typeof file !== 'string') {
|
|
304
306
|
const c = yield read(file);
|
|
305
307
|
if (c) {
|
package/dist/lib/control.ts
CHANGED
|
@@ -415,7 +415,8 @@ export async function read(blob: Blob): Promise<false | types.TControlPackage> {
|
|
|
415
415
|
*/
|
|
416
416
|
export async function init(
|
|
417
417
|
taskId: number,
|
|
418
|
-
invoke: Record<string, any
|
|
418
|
+
invoke: Record<string, any>,
|
|
419
|
+
cache?: string
|
|
419
420
|
): Promise<number> {
|
|
420
421
|
const t = task.list[taskId];
|
|
421
422
|
if (!t) {
|
|
@@ -426,7 +427,9 @@ export async function init(
|
|
|
426
427
|
path += '.cgc';
|
|
427
428
|
}
|
|
428
429
|
path = tool.urlResolve('/', path);
|
|
429
|
-
const file = await fs.getContent(path,
|
|
430
|
+
const file = await fs.getContent(path, {
|
|
431
|
+
'cache': cache
|
|
432
|
+
}, taskId);
|
|
430
433
|
if (file && typeof file !== 'string') {
|
|
431
434
|
const c = await read(file);
|
|
432
435
|
if (c) {
|
package/dist/lib/core.js
CHANGED
|
@@ -633,7 +633,8 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
633
633
|
if (opt.progress) {
|
|
634
634
|
opt.progress(loaded, total);
|
|
635
635
|
}
|
|
636
|
-
}
|
|
636
|
+
},
|
|
637
|
+
'cache': opt.cache
|
|
637
638
|
}, taskId);
|
|
638
639
|
if ((blob === null) || typeof blob === 'string') {
|
|
639
640
|
return null;
|
|
@@ -650,7 +651,9 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
650
651
|
let config;
|
|
651
652
|
const files = {};
|
|
652
653
|
try {
|
|
653
|
-
const blob = yield fs.getContent(url + 'config.json',
|
|
654
|
+
const blob = yield fs.getContent(url + 'config.json', {
|
|
655
|
+
'cache': opt.cache
|
|
656
|
+
}, taskId);
|
|
654
657
|
if (blob === null || typeof blob === 'string') {
|
|
655
658
|
return null;
|
|
656
659
|
}
|
|
@@ -665,7 +668,9 @@ function fetchApp(url, opt = {}, taskId) {
|
|
|
665
668
|
opt.progress(loaded + 1, total + 1);
|
|
666
669
|
}
|
|
667
670
|
for (const file of config.files) {
|
|
668
|
-
fs.getContent(url + file.slice(1),
|
|
671
|
+
fs.getContent(url + file.slice(1), {
|
|
672
|
+
'cache': opt.cache
|
|
673
|
+
}, taskId).then(function (blob) {
|
|
669
674
|
return __awaiter(this, void 0, void 0, function* () {
|
|
670
675
|
if (blob === null || typeof blob === 'string') {
|
|
671
676
|
clickgo.form.notify({
|
package/dist/lib/core.ts
CHANGED
|
@@ -735,7 +735,8 @@ export async function fetchApp(
|
|
|
735
735
|
if (opt.progress) {
|
|
736
736
|
opt.progress(loaded, total) as unknown;
|
|
737
737
|
}
|
|
738
|
-
}
|
|
738
|
+
},
|
|
739
|
+
'cache': opt.cache
|
|
739
740
|
}, taskId);
|
|
740
741
|
if ((blob === null) || typeof blob === 'string') {
|
|
741
742
|
return null;
|
|
@@ -754,7 +755,9 @@ export async function fetchApp(
|
|
|
754
755
|
/** --- 已加载的 files --- */
|
|
755
756
|
const files: Record<string, Blob | string> = {};
|
|
756
757
|
try {
|
|
757
|
-
const blob = await fs.getContent(url + 'config.json',
|
|
758
|
+
const blob = await fs.getContent(url + 'config.json', {
|
|
759
|
+
'cache': opt.cache
|
|
760
|
+
}, taskId);
|
|
758
761
|
if (blob === null || typeof blob === 'string') {
|
|
759
762
|
return null;
|
|
760
763
|
}
|
|
@@ -769,7 +772,9 @@ export async function fetchApp(
|
|
|
769
772
|
opt.progress(loaded + 1, total + 1) as unknown;
|
|
770
773
|
}
|
|
771
774
|
for (const file of config.files) {
|
|
772
|
-
fs.getContent(url + file.slice(1),
|
|
775
|
+
fs.getContent(url + file.slice(1), {
|
|
776
|
+
'cache': opt.cache
|
|
777
|
+
}, taskId).then(async function(blob) {
|
|
773
778
|
if (blob === null || typeof blob === 'string') {
|
|
774
779
|
clickgo.form.notify({
|
|
775
780
|
'title': 'File not found',
|
package/dist/lib/form.js
CHANGED
|
@@ -1816,52 +1816,52 @@ window.addEventListener('touchstart', doFocusAndPopEvent, {
|
|
|
1816
1816
|
window.addEventListener('mousedown', doFocusAndPopEvent);
|
|
1817
1817
|
function remove(formId) {
|
|
1818
1818
|
const taskId = getTaskId(formId);
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
if (task.list[taskId].forms[formId]) {
|
|
1822
|
-
title = task.list[taskId].forms[formId].vroot.$refs.form.title;
|
|
1823
|
-
icon = task.list[taskId].forms[formId].vroot.$refs.form.iconDataUrl;
|
|
1824
|
-
const io = task.list[taskId].runtime.dialogFormIds.indexOf(formId);
|
|
1825
|
-
if (io > -1) {
|
|
1826
|
-
task.list[taskId].runtime.dialogFormIds.splice(io, 1);
|
|
1827
|
-
}
|
|
1828
|
-
task.list[taskId].forms[formId].vroot.$refs.form.$data.isShow = false;
|
|
1829
|
-
setTimeout(function () {
|
|
1830
|
-
var _a;
|
|
1831
|
-
const fid = getMaxZIndexID({
|
|
1832
|
-
'formIds': [formId]
|
|
1833
|
-
});
|
|
1834
|
-
if (fid) {
|
|
1835
|
-
changeFocus(fid);
|
|
1836
|
-
}
|
|
1837
|
-
else {
|
|
1838
|
-
changeFocus();
|
|
1839
|
-
}
|
|
1840
|
-
if (!task.list[taskId]) {
|
|
1841
|
-
return true;
|
|
1842
|
-
}
|
|
1843
|
-
task.list[taskId].forms[formId].vapp.unmount();
|
|
1844
|
-
task.list[taskId].forms[formId].vapp._container.remove();
|
|
1845
|
-
(_a = exports.elements.popList.querySelector('[data-form-id="' + formId.toString() + '"]')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
1846
|
-
if (io > -1) {
|
|
1847
|
-
task.list[taskId].forms[formId].vroot.cgDialogCallback();
|
|
1848
|
-
}
|
|
1849
|
-
delete task.list[taskId].forms[formId];
|
|
1850
|
-
dom.removeStyle(taskId, 'form', formId);
|
|
1851
|
-
core.trigger('formRemoved', taskId, formId, title, icon);
|
|
1852
|
-
dom.clearWatchStyle(formId);
|
|
1853
|
-
dom.clearWatchProperty(formId);
|
|
1854
|
-
native.clear(formId, taskId);
|
|
1855
|
-
delete exports.activePanels[formId];
|
|
1856
|
-
if (Object.keys(task.list[taskId].forms).length === 0) {
|
|
1857
|
-
task.end(taskId);
|
|
1858
|
-
}
|
|
1859
|
-
}, 300);
|
|
1860
|
-
return true;
|
|
1819
|
+
if (!task.list[taskId].forms[formId]) {
|
|
1820
|
+
return false;
|
|
1861
1821
|
}
|
|
1862
|
-
|
|
1822
|
+
if (task.list[taskId].forms[formId].closed) {
|
|
1863
1823
|
return false;
|
|
1864
1824
|
}
|
|
1825
|
+
task.list[taskId].forms[formId].closed = true;
|
|
1826
|
+
const title = task.list[taskId].forms[formId].vroot.$refs.form.title;
|
|
1827
|
+
const icon = task.list[taskId].forms[formId].vroot.$refs.form.iconDataUrl;
|
|
1828
|
+
const io = task.list[taskId].runtime.dialogFormIds.indexOf(formId);
|
|
1829
|
+
if (io > -1) {
|
|
1830
|
+
task.list[taskId].runtime.dialogFormIds.splice(io, 1);
|
|
1831
|
+
}
|
|
1832
|
+
task.list[taskId].forms[formId].vroot.$refs.form.$data.isShow = false;
|
|
1833
|
+
setTimeout(function () {
|
|
1834
|
+
var _a;
|
|
1835
|
+
const fid = getMaxZIndexID({
|
|
1836
|
+
'formIds': [formId]
|
|
1837
|
+
});
|
|
1838
|
+
if (fid) {
|
|
1839
|
+
changeFocus(fid);
|
|
1840
|
+
}
|
|
1841
|
+
else {
|
|
1842
|
+
changeFocus();
|
|
1843
|
+
}
|
|
1844
|
+
if (!task.list[taskId]) {
|
|
1845
|
+
return true;
|
|
1846
|
+
}
|
|
1847
|
+
task.list[taskId].forms[formId].vapp.unmount();
|
|
1848
|
+
task.list[taskId].forms[formId].vapp._container.remove();
|
|
1849
|
+
(_a = exports.elements.popList.querySelector('[data-form-id="' + formId.toString() + '"]')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
1850
|
+
if (io > -1) {
|
|
1851
|
+
task.list[taskId].forms[formId].vroot.cgDialogCallback();
|
|
1852
|
+
}
|
|
1853
|
+
delete task.list[taskId].forms[formId];
|
|
1854
|
+
dom.removeStyle(taskId, 'form', formId);
|
|
1855
|
+
core.trigger('formRemoved', taskId, formId, title, icon);
|
|
1856
|
+
dom.clearWatchStyle(formId);
|
|
1857
|
+
dom.clearWatchProperty(formId);
|
|
1858
|
+
native.clear(formId, taskId);
|
|
1859
|
+
delete exports.activePanels[formId];
|
|
1860
|
+
if (Object.keys(task.list[taskId].forms).length === 0) {
|
|
1861
|
+
task.end(taskId);
|
|
1862
|
+
}
|
|
1863
|
+
}, 300);
|
|
1864
|
+
return true;
|
|
1865
1865
|
}
|
|
1866
1866
|
exports.remove = remove;
|
|
1867
1867
|
function removePanel(id, vapp, el) {
|
|
@@ -2562,7 +2562,8 @@ function create(cls, data, opt = {}, taskId) {
|
|
|
2562
2562
|
const nform = {
|
|
2563
2563
|
'id': formId,
|
|
2564
2564
|
'vapp': rtn.vapp,
|
|
2565
|
-
'vroot': rtn.vroot
|
|
2565
|
+
'vroot': rtn.vroot,
|
|
2566
|
+
'closed': false
|
|
2566
2567
|
};
|
|
2567
2568
|
t.forms[formId] = nform;
|
|
2568
2569
|
yield tool.sleep(34);
|
package/dist/lib/form.ts
CHANGED
|
@@ -2370,59 +2370,59 @@ window.addEventListener('mousedown', doFocusAndPopEvent);
|
|
|
2370
2370
|
*/
|
|
2371
2371
|
export function remove(formId: number): boolean {
|
|
2372
2372
|
const taskId: number = getTaskId(formId);
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
if (task.list[taskId].forms[formId]) {
|
|
2376
|
-
title = task.list[taskId].forms[formId].vroot.$refs.form.title;
|
|
2377
|
-
icon = task.list[taskId].forms[formId].vroot.$refs.form.iconDataUrl;
|
|
2378
|
-
const io = task.list[taskId].runtime.dialogFormIds.indexOf(formId);
|
|
2379
|
-
if (io > -1) {
|
|
2380
|
-
// --- 取消 dialog mask 记录 ---
|
|
2381
|
-
task.list[taskId].runtime.dialogFormIds.splice(io, 1);
|
|
2382
|
-
}
|
|
2383
|
-
task.list[taskId].forms[formId].vroot.$refs.form.$data.isShow = false;
|
|
2384
|
-
setTimeout(function() {
|
|
2385
|
-
// --- 获取最大的 z index 窗体,并让他获取焦点 ---
|
|
2386
|
-
const fid = getMaxZIndexID({
|
|
2387
|
-
'formIds': [formId]
|
|
2388
|
-
});
|
|
2389
|
-
if (fid) {
|
|
2390
|
-
changeFocus(fid);
|
|
2391
|
-
}
|
|
2392
|
-
else {
|
|
2393
|
-
changeFocus();
|
|
2394
|
-
}
|
|
2395
|
-
// --- 延长 100 秒是为了响应 100 毫秒的动画 ---
|
|
2396
|
-
if (!task.list[taskId]) {
|
|
2397
|
-
// --- 可能这时候 task 已经被结束了 ---
|
|
2398
|
-
return true;
|
|
2399
|
-
}
|
|
2400
|
-
task.list[taskId].forms[formId].vapp.unmount();
|
|
2401
|
-
task.list[taskId].forms[formId].vapp._container.remove();
|
|
2402
|
-
elements.popList.querySelector('[data-form-id="' + formId.toString() + '"]')?.remove();
|
|
2403
|
-
if (io > -1) {
|
|
2404
|
-
// --- 如果是 dialog 则要执行回调 ---
|
|
2405
|
-
task.list[taskId].forms[formId].vroot.cgDialogCallback();
|
|
2406
|
-
}
|
|
2407
|
-
delete task.list[taskId].forms[formId];
|
|
2408
|
-
// --- 移除 form 的 style ---
|
|
2409
|
-
dom.removeStyle(taskId, 'form', formId);
|
|
2410
|
-
// --- 触发 formRemoved 事件 ---
|
|
2411
|
-
core.trigger('formRemoved', taskId, formId, title, icon);
|
|
2412
|
-
dom.clearWatchStyle(formId);
|
|
2413
|
-
dom.clearWatchProperty(formId);
|
|
2414
|
-
native.clear(formId, taskId);
|
|
2415
|
-
delete activePanels[formId];
|
|
2416
|
-
// --- 检测是否已经没有窗体了,如果没有了的话就要结束任务了 ---
|
|
2417
|
-
if (Object.keys(task.list[taskId].forms).length === 0) {
|
|
2418
|
-
task.end(taskId);
|
|
2419
|
-
}
|
|
2420
|
-
}, 300);
|
|
2421
|
-
return true;
|
|
2373
|
+
if (!task.list[taskId].forms[formId]) {
|
|
2374
|
+
return false;
|
|
2422
2375
|
}
|
|
2423
|
-
|
|
2376
|
+
if (task.list[taskId].forms[formId].closed) {
|
|
2424
2377
|
return false;
|
|
2425
2378
|
}
|
|
2379
|
+
task.list[taskId].forms[formId].closed = true;
|
|
2380
|
+
const title = task.list[taskId].forms[formId].vroot.$refs.form.title;
|
|
2381
|
+
const icon = task.list[taskId].forms[formId].vroot.$refs.form.iconDataUrl;
|
|
2382
|
+
const io = task.list[taskId].runtime.dialogFormIds.indexOf(formId);
|
|
2383
|
+
if (io > -1) {
|
|
2384
|
+
// --- 取消 dialog mask 记录 ---
|
|
2385
|
+
task.list[taskId].runtime.dialogFormIds.splice(io, 1);
|
|
2386
|
+
}
|
|
2387
|
+
task.list[taskId].forms[formId].vroot.$refs.form.$data.isShow = false;
|
|
2388
|
+
setTimeout(function() {
|
|
2389
|
+
// --- 获取最大的 z index 窗体,并让他获取焦点 ---
|
|
2390
|
+
const fid = getMaxZIndexID({
|
|
2391
|
+
'formIds': [formId]
|
|
2392
|
+
});
|
|
2393
|
+
if (fid) {
|
|
2394
|
+
changeFocus(fid);
|
|
2395
|
+
}
|
|
2396
|
+
else {
|
|
2397
|
+
changeFocus();
|
|
2398
|
+
}
|
|
2399
|
+
// --- 延长 100 秒是为了响应 100 毫秒的动画 ---
|
|
2400
|
+
if (!task.list[taskId]) {
|
|
2401
|
+
// --- 可能这时候 task 已经被结束了 ---
|
|
2402
|
+
return true;
|
|
2403
|
+
}
|
|
2404
|
+
task.list[taskId].forms[formId].vapp.unmount();
|
|
2405
|
+
task.list[taskId].forms[formId].vapp._container.remove();
|
|
2406
|
+
elements.popList.querySelector('[data-form-id="' + formId.toString() + '"]')?.remove();
|
|
2407
|
+
if (io > -1) {
|
|
2408
|
+
// --- 如果是 dialog 则要执行回调 ---
|
|
2409
|
+
task.list[taskId].forms[formId].vroot.cgDialogCallback();
|
|
2410
|
+
}
|
|
2411
|
+
delete task.list[taskId].forms[formId];
|
|
2412
|
+
// --- 移除 form 的 style ---
|
|
2413
|
+
dom.removeStyle(taskId, 'form', formId);
|
|
2414
|
+
// --- 触发 formRemoved 事件 ---
|
|
2415
|
+
core.trigger('formRemoved', taskId, formId, title, icon);
|
|
2416
|
+
dom.clearWatchStyle(formId);
|
|
2417
|
+
dom.clearWatchProperty(formId);
|
|
2418
|
+
native.clear(formId, taskId);
|
|
2419
|
+
delete activePanels[formId];
|
|
2420
|
+
// --- 检测是否已经没有窗体了,如果没有了的话就要结束任务了 ---
|
|
2421
|
+
if (Object.keys(task.list[taskId].forms).length === 0) {
|
|
2422
|
+
task.end(taskId);
|
|
2423
|
+
}
|
|
2424
|
+
}, 300);
|
|
2425
|
+
return true;
|
|
2426
2426
|
}
|
|
2427
2427
|
|
|
2428
2428
|
/**
|
|
@@ -3265,7 +3265,8 @@ export async function create<T extends AbstractForm>(
|
|
|
3265
3265
|
const nform: types.IForm = {
|
|
3266
3266
|
'id': formId,
|
|
3267
3267
|
'vapp': rtn.vapp,
|
|
3268
|
-
'vroot': rtn.vroot
|
|
3268
|
+
'vroot': rtn.vroot,
|
|
3269
|
+
'closed': false
|
|
3269
3270
|
};
|
|
3270
3271
|
// --- 挂载 form ---
|
|
3271
3272
|
t.forms[formId] = nform;
|
package/dist/lib/fs.js
CHANGED
|
@@ -119,7 +119,7 @@ function unmount(name) {
|
|
|
119
119
|
}
|
|
120
120
|
exports.unmount = unmount;
|
|
121
121
|
function getContent(path, options, taskId) {
|
|
122
|
-
var _a, _b;
|
|
122
|
+
var _a, _b, _c;
|
|
123
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
124
|
path = tool.urlResolve('/', path);
|
|
125
125
|
const fpath = path.slice(8);
|
|
@@ -146,21 +146,21 @@ function getContent(path, options, taskId) {
|
|
|
146
146
|
ourl = path;
|
|
147
147
|
}
|
|
148
148
|
try {
|
|
149
|
-
const rand = Math.random().toString();
|
|
149
|
+
const rand = '?' + ((_a = options.cache) !== null && _a !== void 0 ? _a : Math.random().toString());
|
|
150
150
|
let blob = null;
|
|
151
151
|
const headers = {};
|
|
152
152
|
if (start || end) {
|
|
153
153
|
headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
|
|
154
154
|
}
|
|
155
155
|
if (options.progress) {
|
|
156
|
-
blob = yield tool.request(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
156
|
+
blob = yield tool.request(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
157
157
|
'headers': headers,
|
|
158
158
|
'progress': options.progress,
|
|
159
159
|
'responseType': 'blob'
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
|
-
blob = yield (yield fetch(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
163
|
+
blob = yield (yield fetch(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
164
164
|
'headers': headers
|
|
165
165
|
})).blob();
|
|
166
166
|
}
|
|
@@ -178,7 +178,7 @@ function getContent(path, options, taskId) {
|
|
|
178
178
|
fr.readAsText(blob, encoding);
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
catch (
|
|
181
|
+
catch (_d) {
|
|
182
182
|
return null;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -193,7 +193,7 @@ function getContent(path, options, taskId) {
|
|
|
193
193
|
if (!hanlder) {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
196
|
-
return (
|
|
196
|
+
return (_c = (_b = hanlder.getContent) === null || _b === void 0 ? void 0 : _b.call(hanlder, path.slice(9 + name.length), options)) !== null && _c !== void 0 ? _c : null;
|
|
197
197
|
}
|
|
198
198
|
if (options.progress) {
|
|
199
199
|
delete options.progress;
|
package/dist/lib/fs.ts
CHANGED
|
@@ -113,12 +113,14 @@ export async function getContent(path: string, options?: {
|
|
|
113
113
|
'start'?: number;
|
|
114
114
|
'end'?: number;
|
|
115
115
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
116
|
+
'cache'?: string;
|
|
116
117
|
}, taskId?: number): Promise<string | Blob | null>;
|
|
117
118
|
export async function getContent(path: string, options: BufferEncoding | {
|
|
118
119
|
'encoding': BufferEncoding;
|
|
119
120
|
'start'?: number;
|
|
120
121
|
'end'?: number;
|
|
121
122
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
123
|
+
'cache'?: string;
|
|
122
124
|
}, taskId?: number): Promise<string | null>;
|
|
123
125
|
/**
|
|
124
126
|
* --- 读取完整文件或一段 ---
|
|
@@ -131,6 +133,7 @@ export async function getContent(path: string, options?: BufferEncoding | {
|
|
|
131
133
|
'start'?: number;
|
|
132
134
|
'end'?: number;
|
|
133
135
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
136
|
+
'cache'?: string;
|
|
134
137
|
}, taskId?: number): Promise<Blob | string | null> {
|
|
135
138
|
path = tool.urlResolve('/', path);
|
|
136
139
|
const fpath = path.slice(8);
|
|
@@ -157,21 +160,22 @@ export async function getContent(path: string, options?: BufferEncoding | {
|
|
|
157
160
|
ourl = path;
|
|
158
161
|
}
|
|
159
162
|
try {
|
|
160
|
-
|
|
163
|
+
/** --- 后缀 --- */
|
|
164
|
+
const rand = '?' + (options.cache ?? Math.random().toString());
|
|
161
165
|
let blob: Blob | null = null;
|
|
162
166
|
const headers: Record<string, string> = {};
|
|
163
167
|
if (start || end) {
|
|
164
168
|
headers['range'] = `bytes=${start === undefined ? '0' : start}-${end === undefined ? '' : end}`;
|
|
165
169
|
}
|
|
166
170
|
if (options.progress) {
|
|
167
|
-
blob = await tool.request(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
171
|
+
blob = await tool.request(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
168
172
|
'headers': headers,
|
|
169
173
|
'progress': options.progress,
|
|
170
174
|
'responseType': 'blob'
|
|
171
175
|
});
|
|
172
176
|
}
|
|
173
177
|
else {
|
|
174
|
-
blob = await (await fetch(ourl + (!ourl.startsWith(loader.cdn) ?
|
|
178
|
+
blob = await (await fetch(ourl + (!ourl.startsWith(loader.cdn) ? rand : ''), {
|
|
175
179
|
'headers': headers
|
|
176
180
|
})).blob();
|
|
177
181
|
}
|
package/dist/lib/task.js
CHANGED
|
@@ -248,7 +248,8 @@ function run(url, opt = {}, ntid) {
|
|
|
248
248
|
}
|
|
249
249
|
app = yield core.fetchApp(url, {
|
|
250
250
|
'notifyId': notifyId,
|
|
251
|
-
'progress': opt.progress
|
|
251
|
+
'progress': opt.progress,
|
|
252
|
+
'cache': opt.cache
|
|
252
253
|
}, ntid);
|
|
253
254
|
if (notifyId) {
|
|
254
255
|
setTimeout(function () {
|
|
@@ -1159,7 +1160,7 @@ function run(url, opt = {}, ntid) {
|
|
|
1159
1160
|
}
|
|
1160
1161
|
dom.createToStyleList(taskId);
|
|
1161
1162
|
yield ((_f = opt.initProgress) === null || _f === void 0 ? void 0 : _f.call(opt, 'Control initialization ...'));
|
|
1162
|
-
const r = yield control.init(taskId, invoke);
|
|
1163
|
+
const r = yield control.init(taskId, invoke, opt.cache);
|
|
1163
1164
|
if (r < 0) {
|
|
1164
1165
|
dom.removeFromStyleList(taskId);
|
|
1165
1166
|
delete exports.list[taskId];
|
package/dist/lib/task.ts
CHANGED
|
@@ -290,7 +290,8 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
290
290
|
// --- 获取并加载 app 对象 ---
|
|
291
291
|
app = await core.fetchApp(url, {
|
|
292
292
|
'notifyId': notifyId,
|
|
293
|
-
'progress': opt.progress
|
|
293
|
+
'progress': opt.progress,
|
|
294
|
+
'cache': opt.cache
|
|
294
295
|
}, ntid);
|
|
295
296
|
// --- 无论是否成功,都可以先隐藏 notify 了 ---
|
|
296
297
|
if (notifyId) {
|
|
@@ -1305,7 +1306,7 @@ export async function run(url: string | types.IApp, opt: types.ITaskRunOptions =
|
|
|
1305
1306
|
dom.createToStyleList(taskId);
|
|
1306
1307
|
// --- 加载 control ---
|
|
1307
1308
|
await opt.initProgress?.('Control initialization ...');
|
|
1308
|
-
const r = await control.init(taskId, invoke);
|
|
1309
|
+
const r = await control.init(taskId, invoke, opt.cache);
|
|
1309
1310
|
if (r < 0) {
|
|
1310
1311
|
dom.removeFromStyleList(taskId);
|
|
1311
1312
|
delete list[taskId];
|
package/dist/theme/byterun.cgt
CHANGED
|
Binary file
|
package/dist/theme/familiar.cgt
CHANGED
|
Binary file
|
package/dist/theme/light.cgt
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export type TGlobalEvent = 'error' | 'screenResize' | 'configChanged' | 'formCre
|
|
|
92
92
|
export interface ICoreFetchAppOptions {
|
|
93
93
|
'notifyId'?: number;
|
|
94
94
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
95
|
+
'cache'?: string;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/** --- 应用包解包后对象 --- */
|
|
@@ -303,6 +304,8 @@ export interface IForm {
|
|
|
303
304
|
'id': number;
|
|
304
305
|
'vapp': IVApp;
|
|
305
306
|
'vroot': IVue;
|
|
307
|
+
/** --- 是否已经执行过了关闭窗体方法,此处加判断为了防止重复执行 close 导致的 bug --- */
|
|
308
|
+
'closed': boolean;
|
|
306
309
|
}
|
|
307
310
|
|
|
308
311
|
/** --- Form 的简略情况,通常在 list 当中 --- */
|
|
@@ -329,6 +332,7 @@ export interface IMountHandler {
|
|
|
329
332
|
'start'?: number;
|
|
330
333
|
'end'?: number;
|
|
331
334
|
'progress'?: (loaded: number, total: number) => void | Promise<void>;
|
|
335
|
+
'cache'?: string;
|
|
332
336
|
}) => Blob | string | null | Promise<Blob | string | null>;
|
|
333
337
|
putContent?: (path: string, data: string | Blob, options?: {
|
|
334
338
|
'encoding'?: BufferEncoding | null;
|
|
@@ -439,6 +443,8 @@ export interface ITaskRunOptions {
|
|
|
439
443
|
'data'?: Record<string, any>;
|
|
440
444
|
/** --- 执行文件的基路径,一般在传入 APP 包时使用,以 .cga 结尾或以 / 结尾的路径 --- */
|
|
441
445
|
'path'?: string;
|
|
446
|
+
/** --- 是否禁用缓存加载,默认禁用 --- */
|
|
447
|
+
'cache'?: string;
|
|
442
448
|
}
|
|
443
449
|
|
|
444
450
|
export interface ICreateTimerOptions {
|