clickgo 3.11.13 → 3.11.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +1 -1
  2. package/dist/app/demo/app.js +1 -1
  3. package/dist/app/demo/form/control/drawer/drawer.xml +9 -0
  4. package/dist/app/demo/form/control/form/form.js +2 -3
  5. package/dist/app/demo/form/control/form/form.xml +1 -1
  6. package/dist/app/demo/form/control/group/group.js +2 -0
  7. package/dist/app/demo/form/control/group/group.xml +16 -1
  8. package/dist/app/demo/form/control/list/list.js +1 -1
  9. package/dist/app/demo/form/control/list/list.xml +16 -8
  10. package/dist/app/demo/form/control/page/page.js +1 -0
  11. package/dist/app/demo/form/control/page/page.xml +14 -8
  12. package/dist/app/demo/form/control/select/select.js +1 -0
  13. package/dist/app/demo/form/control/select/select.xml +5 -4
  14. package/dist/app/demo/form/control/table/table.js +55 -11
  15. package/dist/app/demo/form/control/table/table.xml +51 -42
  16. package/dist/app/demo/form/main.xml +1 -1
  17. package/dist/app/demo/form/method/native/native.js +1 -1
  18. package/dist/app/demo/form/method/storage/storage.js +1 -1
  19. package/dist/clickgo.js +1 -1
  20. package/dist/clickgo.ts +1 -1
  21. package/dist/control/arteditor.cgc +0 -0
  22. package/dist/control/box.cgc +0 -0
  23. package/dist/control/common.cgc +0 -0
  24. package/dist/control/desc.cgc +0 -0
  25. package/dist/control/drawer.cgc +0 -0
  26. package/dist/control/echarts.cgc +0 -0
  27. package/dist/control/form.cgc +0 -0
  28. package/dist/control/html.cgc +0 -0
  29. package/dist/control/iconview.cgc +0 -0
  30. package/dist/control/map.cgc +0 -0
  31. package/dist/control/monaco.cgc +0 -0
  32. package/dist/control/nav.cgc +0 -0
  33. package/dist/control/page.cgc +0 -0
  34. package/dist/control/property.cgc +0 -0
  35. package/dist/control/table.cgc +0 -0
  36. package/dist/control/task.cgc +0 -0
  37. package/dist/control/tuieditor.cgc +0 -0
  38. package/dist/control/xterm.cgc +0 -0
  39. package/dist/global.css +1 -1
  40. package/dist/index.js +1 -1
  41. package/dist/lib/control.js +1 -1
  42. package/dist/lib/core.js +2 -2
  43. package/dist/lib/dom.js +15 -1
  44. package/dist/lib/dom.ts +18 -0
  45. package/dist/lib/form.js +52 -51
  46. package/dist/lib/form.ts +52 -51
  47. package/dist/lib/fs.js +19 -19
  48. package/dist/lib/storage.js +1 -1
  49. package/dist/lib/task.js +10 -7
  50. package/dist/lib/task.ts +4 -1
  51. package/dist/lib/zip.js +2 -2
  52. package/dist/theme/byterun.cgt +0 -0
  53. package/dist/theme/familiar.cgt +0 -0
  54. package/dist/theme/light.cgt +0 -0
  55. package/package.json +6 -6
  56. package/types/index.d.ts +19 -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.13'}"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.15'}"></script>
32
32
  ```
33
33
 
34
34
  **index.js**
@@ -39,8 +39,8 @@ const clickgo = __importStar(require("clickgo"));
39
39
  const main_1 = __importDefault(require("./form/main"));
40
40
  class default_1 extends clickgo.core.AbstractApp {
41
41
  main(data) {
42
- var _a;
43
42
  return __awaiter(this, void 0, void 0, function* () {
43
+ var _a;
44
44
  this.run(yield clickgo.form.create(main_1.default, {
45
45
  'param': (_a = data.param) !== null && _a !== void 0 ? _a : 'none'
46
46
  }));
@@ -11,6 +11,15 @@
11
11
  <drawer title="Drawer2" gutter="10" v-model="drawer2" direction="v">
12
12
  <label>789</label>
13
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>
14
23
  <template v-slot:footer>
15
24
  <layout align-h="end" style="flex: 1;">
16
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.floading = true;
56
+ this.loading = true;
58
57
  yield clickgo.tool.sleep(1000);
59
- this.floading = false;
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" :loading="floading" :border="border" direction="v" @close="onClose">
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>
@@ -28,6 +28,8 @@ class default_1 extends clickgo.form.AbstractForm {
28
28
  constructor() {
29
29
  super(...arguments);
30
30
  this.title = 'The title';
31
+ this.slotTitle = false;
32
+ this.slotFooter = false;
31
33
  }
32
34
  }
33
35
  exports.default = default_1;
@@ -1,7 +1,13 @@
1
- <form title="Group" width="450" height="500" padding="10" background="hsl(0, 0%, 90%)">
1
+ <form title="Group" width="450" height="550" padding="10" background="hsl(0, 0%, 90%)">
2
2
  <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
3
  <flow direction="v" style="flex: 1; height: 0;">
4
4
  <group :title="title" direction="v" gutter="10">
5
+ <template v-if="slotTitle" v-slot:title>
6
+ <layout align-v="center" style="flex: 1;">
7
+ <label style="flex: 1;">slot title</label>
8
+ <button>test</button>
9
+ </layout>
10
+ </template>
5
11
  <label>123</label>
6
12
  <button>abc</button>
7
13
  <title>Small title</title>
@@ -14,11 +20,20 @@
14
20
  <label>123</label>
15
21
  <title type="danger">Danger title</title>
16
22
  <label>123</label>
23
+ <template v-if="slotFooter" v-slot:footer>
24
+ <layout align-h="end" style="flex: 1;">
25
+ <button>OK</button>
26
+ </layout>
27
+ </template>
17
28
  </group>
18
29
  </flow>
19
30
  <layout gutter="10">
20
31
  <button style="flex: 1;" @click="title = title === 'The title' ? 'Changed title' : 'The title'">Change title</button>
21
32
  <button style="flex: 1;" @click="title = ''">Set empty</button>
22
33
  </layout>
34
+ <layout gutter="10">
35
+ <button style="flex: 1;" @click="slotTitle = !slotTitle">{{slotTitle ? '' : '!'}}slotTitle</button>
36
+ <button style="flex: 1;" @click="slotFooter = !slottFooter">{{slottFooter ? '' : '!'}}slotFooter</button>
37
+ </layout>
23
38
  </layout>
24
39
  </form>
@@ -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;"></list>
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>
@@ -33,6 +33,7 @@ class default_1 extends clickgo.form.AbstractForm {
33
33
  this.p4 = 50;
34
34
  this.p5 = 1;
35
35
  this.total5 = 0;
36
+ this.control = 2;
36
37
  }
37
38
  }
38
39
  exports.default = default_1;
@@ -1,11 +1,17 @@
1
- <form width="650" height="400" title="Page">
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
- <button @click="total5 = total5 ? 0 : 300">Set total = {{total5 ? 0 : 300}}</button>
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>
@@ -122,6 +122,7 @@ class default_1 extends clickgo.form.AbstractForm {
122
122
  this.remote = false;
123
123
  this.remoteDelay = [0];
124
124
  this.plain = false;
125
+ this.virtual = false;
125
126
  }
126
127
  get sizes() {
127
128
  const rtn = {};
@@ -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 &amp; color</button>
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>
@@ -49,9 +49,50 @@ class default_1 extends clickgo.form.AbstractForm {
49
49
  this.selectionArea = {};
50
50
  this.scroll = 'auto';
51
51
  this.sort = undefined;
52
- this.nowSort = [];
53
52
  this.index = false;
54
53
  this.split = false;
54
+ this.virtual = false;
55
+ this.slot = false;
56
+ this.checkinfo = {
57
+ 'total': 0,
58
+ 'selected': 0
59
+ };
60
+ this.sortinfo = {
61
+ 'index': -1,
62
+ 'sort': 'desc'
63
+ };
64
+ }
65
+ refreshCheckinfo() {
66
+ this.checkinfo.total = 0;
67
+ this.checkinfo.selected = 0;
68
+ for (const item of this.data) {
69
+ if (item.check === undefined) {
70
+ continue;
71
+ }
72
+ ++this.checkinfo.total;
73
+ if (item.check) {
74
+ ++this.checkinfo.selected;
75
+ }
76
+ }
77
+ }
78
+ onHeaderCheck(e) {
79
+ if (e.detail.value && !e.detail.indeterminate) {
80
+ for (const item of this.data) {
81
+ if (item.check === undefined) {
82
+ continue;
83
+ }
84
+ item.check = false;
85
+ }
86
+ this.checkinfo.selected = 0;
87
+ return;
88
+ }
89
+ for (const item of this.data) {
90
+ if (item.check === undefined) {
91
+ continue;
92
+ }
93
+ item.check = true;
94
+ }
95
+ this.checkinfo.selected = this.checkinfo.total;
55
96
  }
56
97
  get sizes() {
57
98
  const rtn = {};
@@ -71,22 +112,21 @@ class default_1 extends clickgo.form.AbstractForm {
71
112
  onSelect(area) {
72
113
  this.selectionArea = area;
73
114
  }
74
- onSort(label, sort) {
75
- this.nowSort.length = 0;
76
- if (!label) {
77
- return;
78
- }
79
- this.nowSort.push(label);
80
- this.nowSort.push(sort !== null && sort !== void 0 ? sort : 'asc');
115
+ onSort(e) {
116
+ this.sortinfo.index = e.detail.index;
117
+ this.sortinfo.sort = e.detail.sort;
81
118
  this.refreshSort();
82
119
  }
83
120
  refreshSort() {
84
- if (this.nowSort[0] === 'name') {
121
+ if (this.sortinfo.index === -1) {
122
+ return;
123
+ }
124
+ if (this.sortinfo.index === (this.index ? 1 : 0)) {
85
125
  this.data.sort((a, b) => {
86
126
  var _a, _b;
87
127
  const aname = (_a = a.name) !== null && _a !== void 0 ? _a : 'name';
88
128
  const bname = (_b = b.name) !== null && _b !== void 0 ? _b : 'name';
89
- if (this.nowSort[1] === 'asc') {
129
+ if (this.sortinfo.sort === 'asc') {
90
130
  return aname.localeCompare(bname);
91
131
  }
92
132
  else {
@@ -99,7 +139,7 @@ class default_1 extends clickgo.form.AbstractForm {
99
139
  var _a, _b;
100
140
  const atype = (_a = a.type) !== null && _a !== void 0 ? _a : 0;
101
141
  const btype = (_b = b.type) !== null && _b !== void 0 ? _b : 0;
102
- if (this.nowSort[1] === 'asc') {
142
+ if (this.sortinfo.sort === 'asc') {
103
143
  return atype - btype;
104
144
  }
105
145
  else {
@@ -145,14 +185,17 @@ class default_1 extends clickgo.form.AbstractForm {
145
185
  load() {
146
186
  this.data = [
147
187
  {
188
+ 'check': false,
148
189
  'type': 0,
149
190
  'name': 'Appraise'
150
191
  },
151
192
  {
193
+ 'check': false,
152
194
  'type': 0,
153
195
  'name': 'Card',
154
196
  },
155
197
  {
198
+ 'check': false,
156
199
  'type': 0,
157
200
  'name': 'Appraise2',
158
201
  'disabled': true
@@ -161,6 +204,7 @@ class default_1 extends clickgo.form.AbstractForm {
161
204
  'control': 'split'
162
205
  },
163
206
  {
207
+ 'check': false,
164
208
  'type': 1
165
209
  }
166
210
  ];
@@ -1,45 +1,54 @@
1
- <form width="400" height="500" title="Table" padding="10">
2
- <flow direction="v" style="flex: 1; width: 0;">
3
- <layout direction="v" gutter="10" style="flex: 1;">
4
- <label>Value: {{val}}</label>
5
- <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" @select="onSelect" @sort="onSort">
6
- <template v-slot="d">
7
- <table-item v-if="index" label="index" width="80" sort="false">{{d.index}}</table-item>
8
- <table-item label="name">{{d.row.name ?? 'name'}}</table-item>
9
- <table-item label="size" width="50" align-v="center" align-h="center">{{d.row.type ?? '0'}}</table-item>
10
- <table-item label="col" width="100" direction="v" gutter="5">
11
- <label>line1</label>
12
- <button>line2</button>
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>
1
+ <form width="500" 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" width="100" sort="false" align-h="center" align-v="center">
7
+ <check v-model="d.row.check" @changed="refreshCheckinfo">{{d.index}}</check>
8
+ </table-item>
9
+ <table-item label="name">{{d.row.name ?? 'name'}}</table-item>
10
+ <table-item label="size" width="80" align-v="center" align-h="center">{{d.row.type ?? '0'}}</table-item>
11
+ <table-item label="col" width="100" direction="v" gutter="5" sort="false">
12
+ <label>line1</label>
13
+ <button>line2</button>
14
+ </table-item>
15
+ </template>
16
+ <template v-slot:pop>
17
+ <menulist>
18
+ <menulist-item alt="S" @click="showIndex">Show select</menulist-item>
19
+ </menulist>
20
+ </template>
21
+ <template v-if="slot" v-slot:label="d">
22
+ <layout align-h="center" style="flex: 1;">
23
+ <check :modelValue="checkinfo.selected > 0" @change="onHeaderCheck" :indeterminate="checkinfo.selected > 0 && checkinfo.selected < checkinfo.total">index</check>
40
24
  </layout>
41
25
  </template>
42
- <button v-else @click="load">Load</button>
43
- </layout>
44
- </flow>
26
+ </table>
27
+ <template v-if="loadFirst">
28
+ <layout gutter="10">
29
+ <button style="flex: 1;" @click="data.splice(-2, 0, {'type': 0, 'name': 'Card' + data.length, 'disabled': false});refreshSort()">Add</button>
30
+ <button style="flex: 1;" @click="data.splice(-3, 1);refreshSort()">Remove</button>
31
+ <button style="flex: 1;" @click="scrollChange">Scroll {{scroll}}</button>
32
+ <button style="flex: 1;" @click="adaptation = !adaptation">{{adaptation ? '' : '!'}}adaptation</button>
33
+ </layout>
34
+ <layout gutter="10">
35
+ <button style="flex: 1;" @click="sortChange">sort {{sort ? 'true' : (sort === false ? 'false' : 'undefined')}}</button>
36
+ <button style="flex: 1;" @click="selection = !selection">{{selection ? '' : '!'}}selection</button>
37
+ <button style="flex: 1;" @click="gesture = !gesture">{{gesture ? '' : '!'}}gesture</button>
38
+ <button style="flex: 1;" @click="split = !split">{{split ? '' : '!'}}split</button>
39
+ </layout>
40
+ <layout gutter="10">
41
+ <button style="flex: 1;" @click="disabled = !disabled">{{disabled ? '' : '!'}}disabled</button>
42
+ <button style="flex: 1;" @click="multi = !multi">{{multi ? '' : '!'}}multi</button>
43
+ <button style="flex: 1;" @click="ctrl = !ctrl">{{ctrl ? '' : '!'}}ctrl</button>
44
+ </layout>
45
+ <layout gutter="10">
46
+ <button style="flex: 1;" @click="must = !must">{{must ? '' : '!'}}must</button>
47
+ <button style="flex: 1;" @click="index = !index">{{index ? '' : '!'}}index</button>
48
+ <button style="flex: 1;" @click="virtual = !virtual">{{virtual ? '' : '!'}}virtual</button>
49
+ <button style="flex: 1;" @click="slot = !slot">{{slot ? '' : '!'}}slot</button>
50
+ </layout>
51
+ </template>
52
+ <button v-else @click="load">Load</button>
53
+ </layout>
45
54
  </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')">switch</button>
17
+ <button @click="openForm('cswitch')">Switch</button>
18
18
  </layout>
19
19
  <layout gutter="10">
20
20
  <button @click="openForm('ctext')">Text</button>
@@ -59,8 +59,8 @@ class default_1 extends clickgo.form.AbstractForm {
59
59
  });
60
60
  }
61
61
  ping() {
62
- var _a;
63
62
  return __awaiter(this, void 0, void 0, function* () {
63
+ var _a;
64
64
  yield clickgo.form.dialog((_a = yield clickgo.native.ping(this.val)) !== null && _a !== void 0 ? _a : 'undefined');
65
65
  });
66
66
  }
@@ -42,8 +42,8 @@ class default_1 extends clickgo.form.AbstractForm {
42
42
  this.ppath = '';
43
43
  }
44
44
  get() {
45
- var _a;
46
45
  return __awaiter(this, void 0, void 0, function* () {
46
+ var _a;
47
47
  yield clickgo.form.dialog((_a = clickgo.storage.get(this.key)) !== null && _a !== void 0 ? _a : 'null');
48
48
  });
49
49
  }
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.13';
27
+ const version = '3.11.15';
28
28
  function getVersion() {
29
29
  return version;
30
30
  }
package/dist/clickgo.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- const version = '3.11.13';
16
+ const version = '3.11.15';
17
17
  export function getVersion(): string {
18
18
  return version;
19
19
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file