clickgo 3.11.31 → 3.11.33
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 +2 -5
- package/dist/app/demo/form/control/list/list.js +17 -0
- package/dist/app/demo/form/control/list/list.xml +4 -0
- package/dist/app/demo/form/control/select/select.xml +1 -1
- package/dist/app/demo/form/control/switch/switch.js +1 -0
- package/dist/app/demo/form/control/switch/switch.xml +4 -0
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/common.cgc +0 -0
- package/dist/lib/control.js +12 -9
- package/dist/lib/control.ts +17 -25
- package/dist/lib/tool.js +7 -1
- package/dist/lib/tool.ts +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,12 +7,9 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/clickgo">
|
|
9
9
|
<img alt="NPM stable version" src="https://img.shields.io/npm/v/clickgo?color=brightgreen&logo=npm" />
|
|
10
|
-
|
|
11
|
-
<img alt="NPM development version" src="https://img.shields.io/npm/v/clickgo/dev?color=yellow&logo=npm" />
|
|
12
|
-
</a><br>
|
|
10
|
+
</a>
|
|
13
11
|
<a href="https://github.com/maiyun/clickgo/releases">
|
|
14
12
|
<img alt="GitHub releases" src="https://img.shields.io/github/v/release/maiyun/clickgo?color=brightgreen&logo=github" />
|
|
15
|
-
<img alt="GitHub pre-releases" src="https://img.shields.io/github/v/release/maiyun/clickgo?color=yellow&logo=github&include_prereleases" />
|
|
16
13
|
</a>
|
|
17
14
|
<a href="https://github.com/maiyun/clickgo/issues">
|
|
18
15
|
<img alt="GitHub issues" src="https://img.shields.io/github/issues/maiyun/clickgo?color=blue&logo=github" />
|
|
@@ -28,7 +25,7 @@ Load the module loader first, and then load it using the module loader.
|
|
|
28
25
|
**index.html**
|
|
29
26
|
|
|
30
27
|
```html
|
|
31
|
-
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.33'}"></script>
|
|
32
29
|
```
|
|
33
30
|
|
|
34
31
|
**index.js**
|
|
@@ -68,6 +68,23 @@ class default_1 extends clickgo.form.AbstractForm {
|
|
|
68
68
|
this.select = [];
|
|
69
69
|
this.select2 = ['Appraise'];
|
|
70
70
|
this.label2 = [''];
|
|
71
|
+
this.listData5 = [
|
|
72
|
+
{
|
|
73
|
+
'name': 'hi',
|
|
74
|
+
'id': '1'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
'name': 'hi2',
|
|
78
|
+
'id': '2',
|
|
79
|
+
'sub': [
|
|
80
|
+
{
|
|
81
|
+
'name': 'hi3',
|
|
82
|
+
'id': '3'
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
this.listMap5 = undefined;
|
|
71
88
|
this.selectObject = ['test'];
|
|
72
89
|
this.listDataObject = {
|
|
73
90
|
'test': 'This is test',
|
|
@@ -64,6 +64,10 @@
|
|
|
64
64
|
</layout>
|
|
65
65
|
</template>
|
|
66
66
|
</list>
|
|
67
|
+
<layout direction="v" gutter="10" style="flex: 1; width: 0;">
|
|
68
|
+
<list :disabled="disabled" :must="must" :multi="multi" :ctrl="ctrl" :selection="selection" :gesture="gesture ? ['top', 'bottom'] : []" @gesture="onGesture" :scroll="scroll" :virtual="virtual":data="listData5" :check="check" :map="listMap5" style="flex: 1;"></list>
|
|
69
|
+
<button v-if="listMap5===undefined" @click="listMap5={'label':'name','value':'id','children':'sub'}">Set map</button>
|
|
70
|
+
</layout>
|
|
67
71
|
</layout>
|
|
68
72
|
<label class="tip">Right-click (computer) or press and hold (phone) to open the universal menu.</label>
|
|
69
73
|
</layout>
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
<select :data="['1','2','3','4','5']" :disabled="disabled" :editable="editable" :multi="multi" :plain="plain" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" style="height: 60px;" @load="onLoad" @remote="onRemote" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
52
52
|
<label>Always editable: {{aemodel}}</label>
|
|
53
53
|
<layout gutter="10">
|
|
54
|
-
<select v-model="aemodel" :data="editableData ? ['1','2','3','4','5'] : ['6','7','8','9','10']" :disabled="disabled" editable :multi="multi" :plain="plain" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" placeholder="Please enter" @load="onLoad" @remote="onRemote" style="flex: 1;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
54
|
+
<select v-model="aemodel" :data="editableData ? ['1','2','3',{'label':'is 4','value':'4'},'5'] : ['6','7','8','9','10']" :disabled="disabled" editable editablelabel :multi="multi" :plain="plain" :tree="tree" :async="async" :search="search" :remote="remote" :remote-delay="remoteDelay[0]" :icon="icon" icon-default="../../../res/txt.svg" placeholder="Please enter" @load="onLoad" @remote="onRemote" style="flex: 1;" :style="{'font-size': fontSize ? '16px' : undefined, 'padding': padding ? '15px' : undefined, 'background': background ? 'red' : undefined, 'color': background ? '#FFF' : undefined}"></select>
|
|
55
55
|
<button @click="aemodel.length=0">clear</button>
|
|
56
56
|
<button @click="aemodel[0] = '4'">4</button>
|
|
57
57
|
<button @click="aemodel[0] = '22'">22</button>
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
<switch :disabled="disabled" @change="onChange" />
|
|
14
14
|
<label style="flex: 1;">not</label>
|
|
15
15
|
</layout>
|
|
16
|
+
<layout gutter="10" align-v="center">
|
|
17
|
+
<switch v-model="checked4" :disabled="disabled" :map="{'true':0,'false':1}"></switch>
|
|
18
|
+
<label style="flex: 1;">{{checked4}}</label>
|
|
19
|
+
</layout>
|
|
16
20
|
<button @click="disabled = !disabled">{{disabled ? 'Remove' : 'Set'}} disabled</button>
|
|
17
21
|
</layout>
|
|
18
22
|
</form>
|
package/dist/clickgo.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.zip = exports.tool = exports.theme = exports.task = exports.storage = exports.native = exports.fs = exports.form = exports.dom = exports.core = exports.control = exports.vue = exports.hasFrame = exports.isImmersion = exports.getPlatform = exports.isNative = exports.getVersion = void 0;
|
|
27
|
-
const version = '3.11.
|
|
27
|
+
const version = '3.11.33';
|
|
28
28
|
function getVersion() {
|
|
29
29
|
return version;
|
|
30
30
|
}
|
package/dist/clickgo.ts
CHANGED
package/dist/control/common.cgc
CHANGED
|
Binary file
|
package/dist/lib/control.js
CHANGED
|
@@ -92,16 +92,19 @@ class AbstractControl {
|
|
|
92
92
|
}
|
|
93
93
|
get l() {
|
|
94
94
|
return (key, data) => {
|
|
95
|
-
var _a, _b
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
else if (this.localeData) {
|
|
100
|
-
return (_f = (_e = (_d = this.localeData[this.locale]) === null || _d === void 0 ? void 0 : _d[key]) !== null && _e !== void 0 ? _e : this.localeData['en'][key]) !== null && _f !== void 0 ? _f : '[LocaleError]' + key;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
return '[LocaleError]' + key;
|
|
95
|
+
var _a, _b;
|
|
96
|
+
const loc = (_b = (_a = this.localeData) === null || _a === void 0 ? void 0 : _a[this.locale][key]) !== null && _b !== void 0 ? _b : '[LocaleError]' + key;
|
|
97
|
+
if (!data) {
|
|
98
|
+
return loc;
|
|
104
99
|
}
|
|
100
|
+
let i = -1;
|
|
101
|
+
return loc.replace(/\?/g, function () {
|
|
102
|
+
++i;
|
|
103
|
+
if (!data[i]) {
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
return data[i];
|
|
107
|
+
});
|
|
105
108
|
};
|
|
106
109
|
}
|
|
107
110
|
get classPrepend() {
|
package/dist/lib/control.ts
CHANGED
|
@@ -102,20 +102,20 @@ export abstract class AbstractControl {
|
|
|
102
102
|
/**
|
|
103
103
|
* --- 获取语言内容 ---
|
|
104
104
|
*/
|
|
105
|
-
public get l(): (
|
|
106
|
-
key: string,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (data) {
|
|
111
|
-
return data[this.locale]?.[key] ?? data['en'][key] ?? '[LocaleError]' + key;
|
|
112
|
-
}
|
|
113
|
-
else if ((this as any).localeData) {
|
|
114
|
-
return (this as any).localeData[this.locale]?.[key] ?? (this as any).localeData['en'][key] ?? '[LocaleError]' + key;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return '[LocaleError]' + key;
|
|
105
|
+
public get l(): (key: string, data?: string[]) => string {
|
|
106
|
+
return (key: string, data?: string[]): string => {
|
|
107
|
+
const loc = (this as any).localeData?.[this.locale][key] ?? '[LocaleError]' + key;
|
|
108
|
+
if (!data) {
|
|
109
|
+
return loc;
|
|
118
110
|
}
|
|
111
|
+
let i: number = -1;
|
|
112
|
+
return loc.replace(/\?/g, function() {
|
|
113
|
+
++i;
|
|
114
|
+
if (!data[i]) {
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
return data[i];
|
|
118
|
+
});
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -219,36 +219,28 @@ export abstract class AbstractControl {
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
/**
|
|
223
|
-
* --- 获取 props 中的 boolean 类型的值 ----
|
|
224
|
-
*/
|
|
222
|
+
/** --- 获取 props 中的 boolean 类型的值 --- */
|
|
225
223
|
public get propBoolean() {
|
|
226
224
|
return (name: keyof this['props']): boolean => {
|
|
227
225
|
return tool.getBoolean((this.props as any)[name]);
|
|
228
226
|
};
|
|
229
227
|
}
|
|
230
228
|
|
|
231
|
-
/**
|
|
232
|
-
* --- 获取 props 中的 number 类型的值 ----
|
|
233
|
-
*/
|
|
229
|
+
/** --- 获取 props 中的 number 类型的值 --- */
|
|
234
230
|
public get propNumber() {
|
|
235
231
|
return (name: keyof this['props']): number => {
|
|
236
232
|
return tool.getNumber((this.props as any)[name]);
|
|
237
233
|
};
|
|
238
234
|
}
|
|
239
235
|
|
|
240
|
-
/**
|
|
241
|
-
* --- 获取 props 中的 int 类型的值 ----
|
|
242
|
-
*/
|
|
236
|
+
/** --- 获取 props 中的 int 类型的值 --- */
|
|
243
237
|
public get propInt() {
|
|
244
238
|
return (name: keyof this['props']): number => {
|
|
245
239
|
return Math.round(this.propNumber(name));
|
|
246
240
|
};
|
|
247
241
|
}
|
|
248
242
|
|
|
249
|
-
/**
|
|
250
|
-
* --- 获取 props 中的 array 类型的值 ----
|
|
251
|
-
*/
|
|
243
|
+
/** --- 获取 props 中的 array 类型的值 --- */
|
|
252
244
|
public get propArray() {
|
|
253
245
|
return (name: keyof this['props']): any[] => {
|
|
254
246
|
return tool.getArray((this.props as any)[name]);
|
package/dist/lib/tool.js
CHANGED
|
@@ -470,9 +470,15 @@ function getArray(param) {
|
|
|
470
470
|
if (typeof param !== 'string') {
|
|
471
471
|
return param;
|
|
472
472
|
}
|
|
473
|
+
param = param.trim();
|
|
473
474
|
let rtn = [];
|
|
474
475
|
if (param.startsWith('[')) {
|
|
475
|
-
|
|
476
|
+
try {
|
|
477
|
+
rtn = JSON.parse(param);
|
|
478
|
+
}
|
|
479
|
+
catch (_a) {
|
|
480
|
+
return [];
|
|
481
|
+
}
|
|
476
482
|
}
|
|
477
483
|
else {
|
|
478
484
|
param = param.replace(/ /g, '');
|
package/dist/lib/tool.ts
CHANGED
|
@@ -627,16 +627,22 @@ export function getNumber(param: string | number): number {
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
/**
|
|
630
|
-
* ---
|
|
630
|
+
* --- 根据参数获取最终的数组型,可传入类似 [1,2,3] 或 1,2,3 ---
|
|
631
631
|
* @param param 参数
|
|
632
632
|
*/
|
|
633
633
|
export function getArray(param: string | any[]): any[] {
|
|
634
634
|
if (typeof param !== 'string') {
|
|
635
635
|
return param;
|
|
636
636
|
}
|
|
637
|
+
param = param.trim();
|
|
637
638
|
let rtn: any[] = [];
|
|
638
639
|
if (param.startsWith('[')) {
|
|
639
|
-
|
|
640
|
+
try {
|
|
641
|
+
rtn = JSON.parse(param);
|
|
642
|
+
}
|
|
643
|
+
catch {
|
|
644
|
+
return [];
|
|
645
|
+
}
|
|
640
646
|
}
|
|
641
647
|
else {
|
|
642
648
|
param = param.replace(/ /g, '');
|