@cloudbase/weda-ui 3.4.11 → 3.4.13
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/dist/configs/components/common/form-input-required.js +3 -3
- package/dist/configs/components/customer-service.js +3 -0
- package/dist/configs/components/dataView.js +20 -10
- package/dist/configs/components/form-checkbox.js +15 -2
- package/dist/configs/components/form-date.js +1 -1
- package/dist/configs/components/form-depart-tree-select.js +1 -1
- package/dist/configs/components/form-email.js +17 -2
- package/dist/configs/components/form-input.js +17 -2
- package/dist/configs/components/form-location.js +1 -1
- package/dist/configs/components/form-multi-region.js +1 -1
- package/dist/configs/components/form-phone.js +17 -2
- package/dist/configs/components/form-radio.js +15 -2
- package/dist/configs/components/form-rich-text.js +1 -1
- package/dist/configs/components/form-select-multiple.js +362 -0
- package/dist/configs/components/form-select.js +1 -1
- package/dist/configs/components/form-switch.js +16 -3
- package/dist/configs/components/form-text-area.js +15 -2
- package/dist/configs/components/form-time.js +1 -1
- package/dist/configs/components/form-url.js +17 -2
- package/dist/configs/components/form-user-tree-select.js +14 -1
- package/dist/configs/components/listView.js +32 -49
- package/dist/configs/components/table.json +1 -54
- package/dist/configs/components/wd-bubble.js +46 -8
- package/dist/configs/components/wd-button.js +3 -0
- package/dist/configs/components/wd-checkbox.js +464 -0
- package/dist/configs/components/wd-form.js +66 -10
- package/dist/configs/components/wd-input-email.js +37 -0
- package/dist/configs/components/wd-input-phone.js +43 -0
- package/dist/configs/components/wd-input-url.js +37 -0
- package/dist/configs/components/wd-input.js +94 -0
- package/dist/configs/components/wd-official-account.js +87 -0
- package/dist/configs/components/wd-radio.js +443 -0
- package/dist/configs/components/wd-switch.js +315 -0
- package/dist/configs/components/wd-table.js +11 -59
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/components/web-view.js +3 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/json-schema-view.js +1 -1
- package/dist/docs/common/components/methods-view.js +1 -1
- package/dist/docs/common/components/properties-view.js +3 -1
- package/dist/docs/common/format.js +7 -7
- package/dist/docs/common/tableView.js +3 -1
- package/dist/enum/index.js +196 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/actions/showMessage/index.js +4 -1
- package/dist/web/components/carousel/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +19 -2
- package/dist/web/components/dataView/index.js +16 -3
- package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
- package/dist/web/components/flow/common/request.js +5 -5
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +90 -0
- package/dist/web/components/form/formcell/index.css +13 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- package/dist/web/components/form/select/dropdown-select/index.js +9 -3
- package/dist/web/components/form/select/h5.js +18 -8
- package/dist/web/components/form/select/index.js +9 -10
- package/dist/web/components/form/select/region/index.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
- package/dist/web/components/form/selectMultiple/h5.js +40 -0
- package/dist/web/components/form/selectMultiple/index.js +94 -0
- package/dist/web/components/form/selectMultiple/request.js +76 -0
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
- package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
- package/dist/web/components/form/selectMultiple/status/index.css +63 -0
- package/dist/web/components/form/selectMultiple/status/index.js +7 -0
- package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
- package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
- package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
- package/dist/web/components/form/tips/index.css +9 -3
- package/dist/web/components/form/uploader/index.css +10 -0
- package/dist/web/components/form/uploader/uploader.h5.js +60 -62
- package/dist/web/components/form/uploader/uploader.pc.js +48 -41
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +8 -33
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -37
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +76 -50
- package/dist/web/components/form/userOrgSelect/common/utils.js +24 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/depart-select-pc.js +3 -8
- package/dist/web/components/form/userOrgSelect/component/depart-select/index.js +14 -18
- package/dist/web/components/form/userOrgSelect/component/depart-select/org-modal-pc.js +20 -14
- package/dist/web/components/form/userOrgSelect/component/modal-select-h5.js +1 -1
- package/dist/web/components/form/userOrgSelect/component/org-tree.js +21 -9
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +76 -15
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +2 -7
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-select-pc.js +6 -4
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +25 -51
- package/dist/web/components/form/userOrgSelect/hooks/use-depart-data.js +10 -6
- package/dist/web/components/form-input-hooks/index.js +41 -15
- package/dist/web/components/form-select-multiple/index.js +26 -0
- package/dist/web/components/form-upload-file/index.js +0 -1
- package/dist/web/components/form-user-tree-select/index.js +2 -2
- package/dist/web/components/formdetail/index.css +31 -1
- package/dist/web/components/formdetail/index.js +33 -1
- package/dist/web/components/index.js +27 -11
- package/dist/web/components/listView/index.js +20 -5
- package/dist/web/components/navigationBar/common.js +1 -1
- package/dist/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/web/components/navigationBar/index.css +11 -0
- package/dist/web/components/navigationBar/index.js +8 -1
- package/dist/web/components/phone/index.js +26 -1
- package/dist/web/components/phoneCode/index.js +3 -1
- package/dist/web/components/richText/index.css +70 -67
- package/dist/web/components/richText/index.js +311 -251
- package/dist/web/components/richText/richtext.module.css +1 -0
- package/dist/web/components/richTextView/index.css +39 -0
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/share/index.js +26 -1
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +1 -1
- package/dist/web/components/wd-checkbox/checkbox.js +34 -0
- package/dist/web/components/wd-checkbox/index.js +3 -0
- package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
- package/dist/web/components/wd-checkbox-list/index.js +3 -0
- package/dist/web/components/wd-form/hooks/use-remote-value.js +9 -2
- package/dist/web/components/wd-form/index.js +69 -34
- package/dist/web/components/wd-form/wd-form.js +42 -0
- package/dist/web/components/wd-form-cell/index.js +3 -0
- package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
- package/dist/web/components/wd-form-item/index.js +4 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
- package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
- package/dist/web/components/wd-icon/wd-icon.js +10 -2
- package/dist/web/components/wd-input/index.js +3 -0
- package/dist/web/components/wd-input/wd-input.js +155 -0
- package/dist/web/components/wd-input-email/index.js +3 -0
- package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
- package/dist/web/components/wd-input-group/index.js +3 -0
- package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
- package/dist/web/components/wd-input-phone/index.js +3 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
- package/dist/web/components/wd-input-url/index.js +3 -0
- package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
- package/dist/web/components/wd-input-wrap/index.js +3 -0
- package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
- package/dist/web/components/wd-official-account/index.css +29 -0
- package/dist/web/components/wd-official-account/index.js +36 -0
- package/dist/web/components/wd-radio/index.js +3 -0
- package/dist/web/components/wd-radio/wd-radio.js +30 -0
- package/dist/web/components/wd-radio-list/index.js +3 -0
- package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
- package/dist/web/components/wd-switch/index.js +3 -0
- package/dist/web/components/wd-switch/wd-switch.js +52 -0
- package/dist/web/components/wd-table/components/FieldRender/index.js +5 -4
- package/dist/web/components/wd-table/components/FilterFieldsPanel/FilterFieldItem.js +4 -0
- package/dist/web/components/wd-table/components/Table/index.js +40 -9
- package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
- package/dist/web/components/wd-table/hooks/useTableData.js +6 -1
- package/dist/web/components/wd-table/hooks/useViewFields.js +1 -1
- package/dist/web/components/wd-table/utils/index.js +6 -2
- package/dist/web/components/wd-table/wd-table.js +125 -99
- package/dist/web/components/wd-textarea/index.js +3 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
- package/dist/web/components/wd-tree/index.js +3 -0
- package/dist/web/components/wd-tree/utils.js +291 -0
- package/dist/web/components/wd-tree/wd-tree.js +193 -0
- package/dist/web/utils/constant.js +16 -0
- package/dist/web/utils/datasource.js +2 -2
- package/dist/web/utils/date.js +3 -3
- package/dist/web/utils/hooks/useFormLegacy.js +112 -0
- package/dist/web/utils/tool.js +12 -2
- package/dist/web/weda-ui.css +197 -3
- package/package.json +6 -5
|
@@ -411,65 +411,12 @@
|
|
|
411
411
|
"paramsSchema": {
|
|
412
412
|
"type": "object",
|
|
413
413
|
"properties": {
|
|
414
|
-
"inParams": {
|
|
415
|
-
"type": "object",
|
|
416
|
-
"properties": {
|
|
417
|
-
"properties": {
|
|
418
|
-
"type": "object",
|
|
419
|
-
"properties": {
|
|
420
|
-
"pageNo": {
|
|
421
|
-
"type": "object",
|
|
422
|
-
"properties": {
|
|
423
|
-
"type": {
|
|
424
|
-
"const": "number"
|
|
425
|
-
}
|
|
426
|
-
},
|
|
427
|
-
"required": ["type"]
|
|
428
|
-
},
|
|
429
|
-
"pageSize": {
|
|
430
|
-
"type": "object",
|
|
431
|
-
"properties": {
|
|
432
|
-
"type": {
|
|
433
|
-
"const": "number"
|
|
434
|
-
}
|
|
435
|
-
},
|
|
436
|
-
"required": ["type"]
|
|
437
|
-
},
|
|
438
|
-
"orderBy": {
|
|
439
|
-
"type": "object",
|
|
440
|
-
"properties": {
|
|
441
|
-
"type": {
|
|
442
|
-
"const": "string"
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
"orderType": {
|
|
447
|
-
"type": "object",
|
|
448
|
-
"properties": {
|
|
449
|
-
"type": {
|
|
450
|
-
"const": "string"
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
"required": ["pageNo", "pageSize"]
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
414
|
"outParams": {
|
|
460
415
|
"type": "object",
|
|
461
416
|
"properties": {
|
|
462
417
|
"properties": {
|
|
463
418
|
"type": "object",
|
|
464
419
|
"properties": {
|
|
465
|
-
"total": {
|
|
466
|
-
"type": "object",
|
|
467
|
-
"properties": {
|
|
468
|
-
"type": {
|
|
469
|
-
"const": "number"
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
},
|
|
473
420
|
"records": {
|
|
474
421
|
"type": "object",
|
|
475
422
|
"properties": {
|
|
@@ -500,7 +447,7 @@
|
|
|
500
447
|
}
|
|
501
448
|
}
|
|
502
449
|
},
|
|
503
|
-
"required": ["
|
|
450
|
+
"required": ["records"]
|
|
504
451
|
}
|
|
505
452
|
}
|
|
506
453
|
}
|
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
import { defineConfig, Tuple, Type } from '../type-utils';
|
|
2
|
+
const bubbleContentTemplate = `
|
|
3
|
+
[[template]]
|
|
4
|
+
component = "Container"
|
|
5
|
+
attributes = { }
|
|
6
|
+
|
|
7
|
+
[[template.items]]
|
|
8
|
+
component = "QrCode"
|
|
9
|
+
|
|
10
|
+
[template.items.attributes]
|
|
11
|
+
text = "https://cloud.tencent.com/product/weda"
|
|
12
|
+
|
|
13
|
+
[[template.items]]
|
|
14
|
+
component = "WdText"
|
|
15
|
+
|
|
16
|
+
[template.items.attributes]
|
|
17
|
+
text = "扫码添加客服"
|
|
18
|
+
|
|
19
|
+
[template.extra]
|
|
20
|
+
|
|
21
|
+
[template.extra.commonStyle]
|
|
22
|
+
custom = [ ]
|
|
23
|
+
|
|
24
|
+
[template.extra.commonStyle.self]
|
|
25
|
+
textAlign = "center"
|
|
26
|
+
|
|
27
|
+
[template.extra.commonStyle.text]
|
|
28
|
+
textAlign = "center"
|
|
29
|
+
`;
|
|
30
|
+
const bubbleChildrenTemplate = `
|
|
31
|
+
[[template]]
|
|
32
|
+
component = "WdText"
|
|
33
|
+
|
|
34
|
+
[template.attributes]
|
|
35
|
+
text = "联系我们"
|
|
36
|
+
`;
|
|
2
37
|
// 属性类型定义
|
|
3
38
|
const data = Type.Object({
|
|
4
39
|
trigger: Type.StringEnum({
|
|
@@ -109,7 +144,7 @@ const data = Type.Object({
|
|
|
109
144
|
}),
|
|
110
145
|
closeDelay: Type.Number({
|
|
111
146
|
title: '关闭时延(毫秒)',
|
|
112
|
-
default:
|
|
147
|
+
default: 200,
|
|
113
148
|
type: 'number',
|
|
114
149
|
description: '气泡提示的关闭时延(毫秒)',
|
|
115
150
|
'x-category': '高级属性',
|
|
@@ -198,13 +233,16 @@ const config = defineConfig({
|
|
|
198
233
|
shortcut: {
|
|
199
234
|
props: ['trigger', 'placement'],
|
|
200
235
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
236
|
+
templates: [
|
|
237
|
+
{
|
|
238
|
+
to: 'bubbleContent',
|
|
239
|
+
body: bubbleContentTemplate,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
to: 'bubbleChildren',
|
|
243
|
+
body: bubbleChildrenTemplate,
|
|
244
|
+
},
|
|
245
|
+
],
|
|
208
246
|
},
|
|
209
247
|
});
|
|
210
248
|
export default config;
|
|
@@ -374,12 +374,15 @@ const config = defineConfig({
|
|
|
374
374
|
'x-platforms': ['MP'],
|
|
375
375
|
detail: {
|
|
376
376
|
errMsg: Type.String({
|
|
377
|
+
title: '错误信息',
|
|
377
378
|
description: '错误信息',
|
|
378
379
|
}),
|
|
379
380
|
path: Type.String({
|
|
381
|
+
title: '小程序消息指定的路径',
|
|
380
382
|
description: '小程序消息指定的路径',
|
|
381
383
|
}),
|
|
382
384
|
query: Type.Object({}, {
|
|
385
|
+
title: '小程序消息指定的查询参数',
|
|
383
386
|
description: '小程序消息指定的查询参数',
|
|
384
387
|
}),
|
|
385
388
|
},
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { defineConfig, Type, Tuple } from '../type-utils';
|
|
2
|
+
import { FORM_ITEM_DATA_TITLE, FORM_ITEM_METHODS, FORM_ITEM_META, ItemData, } from '../type-utils/type-form';
|
|
3
|
+
const WD_CHECKBOX_DIRECTION = [
|
|
4
|
+
{
|
|
5
|
+
label: '纵向',
|
|
6
|
+
value: 'vertical',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
label: '横向',
|
|
10
|
+
value: 'inline',
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
const WD_CKECKBOX_SIZE = [
|
|
14
|
+
{
|
|
15
|
+
label: '默认',
|
|
16
|
+
value: '',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: '大',
|
|
20
|
+
value: 'lg',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: '中',
|
|
24
|
+
value: 'md',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: '小',
|
|
28
|
+
value: 'sm',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
// 输入组件状态
|
|
32
|
+
export const WD_CHECKBOX_STATUS = [
|
|
33
|
+
{
|
|
34
|
+
label: '编辑',
|
|
35
|
+
value: 'edit',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: '禁用',
|
|
39
|
+
value: 'disabled',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: '只读',
|
|
43
|
+
value: 'readOnly',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
// 属性分类
|
|
47
|
+
const X_CATEGORY = {
|
|
48
|
+
COMMON: '通用',
|
|
49
|
+
TITLE: '标题',
|
|
50
|
+
OPTION: '选项',
|
|
51
|
+
VERIFY: '状态/校验',
|
|
52
|
+
};
|
|
53
|
+
// 属性类型定义
|
|
54
|
+
const data = Type.Object({
|
|
55
|
+
name: Type.String({
|
|
56
|
+
title: '绑定字段',
|
|
57
|
+
type: 'string',
|
|
58
|
+
'x-index': 10,
|
|
59
|
+
default: 'formCheckbox',
|
|
60
|
+
remarks: '提交表单时会将组件值提交保存到所配置的字段中',
|
|
61
|
+
'x-category': X_CATEGORY.COMMON,
|
|
62
|
+
'x-rules': [
|
|
63
|
+
{
|
|
64
|
+
message: '该字段必填',
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
message: '必须以字母开头,仅能输入字母或下划线或数字',
|
|
69
|
+
pattern: '^[a-zA-Z][0-9a-zA-Z_]*$',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
required: true,
|
|
73
|
+
description: '表单字段的Key值,用于提交数据时,匹配数据模型字段标识。页面内需保证唯一。',
|
|
74
|
+
}),
|
|
75
|
+
range: Type.Array(Type.Object({
|
|
76
|
+
label: Type.String({
|
|
77
|
+
type: 'string',
|
|
78
|
+
title: '选项名称',
|
|
79
|
+
default: '选项1',
|
|
80
|
+
}),
|
|
81
|
+
value: Type.String({
|
|
82
|
+
type: 'string',
|
|
83
|
+
title: '选项值',
|
|
84
|
+
default: '1',
|
|
85
|
+
}),
|
|
86
|
+
}, {
|
|
87
|
+
type: 'object',
|
|
88
|
+
default: {
|
|
89
|
+
label: '选项1',
|
|
90
|
+
value: '1',
|
|
91
|
+
},
|
|
92
|
+
display: 'label',
|
|
93
|
+
}), {
|
|
94
|
+
type: 'array',
|
|
95
|
+
title: '选项',
|
|
96
|
+
default: [
|
|
97
|
+
{
|
|
98
|
+
label: '选项1',
|
|
99
|
+
value: '1',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: '选项2',
|
|
103
|
+
value: '2',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
remarks: '供用户进行选择的选项列表',
|
|
107
|
+
'x-category': X_CATEGORY.COMMON,
|
|
108
|
+
'x-index': 20,
|
|
109
|
+
'x-props': {
|
|
110
|
+
'data-withBindMeta': true,
|
|
111
|
+
},
|
|
112
|
+
'x-component': 'list',
|
|
113
|
+
'x-linkages': [
|
|
114
|
+
{
|
|
115
|
+
type: 'value:schema',
|
|
116
|
+
schema: {
|
|
117
|
+
items: {
|
|
118
|
+
path: 'range.*',
|
|
119
|
+
type: 'object',
|
|
120
|
+
default: {
|
|
121
|
+
label: "{{'选项' + ($self.value.length+1)}}",
|
|
122
|
+
value: "{{($self.value.length+1) + ''}}",
|
|
123
|
+
},
|
|
124
|
+
display: 'label',
|
|
125
|
+
properties: {
|
|
126
|
+
label: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
title: '选项名称',
|
|
129
|
+
default: '选项1',
|
|
130
|
+
},
|
|
131
|
+
value: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
title: '选项值',
|
|
134
|
+
default: '1',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
target: 'range',
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
}),
|
|
143
|
+
value: Type.Array(Type.String({
|
|
144
|
+
title: 'value',
|
|
145
|
+
}), {
|
|
146
|
+
title: '选中值',
|
|
147
|
+
'x-index': 30,
|
|
148
|
+
default: [],
|
|
149
|
+
remarks: '默认选中的选项',
|
|
150
|
+
'x-category': X_CATEGORY.COMMON,
|
|
151
|
+
}),
|
|
152
|
+
size: Type.StringEnum({
|
|
153
|
+
title: '组件尺寸',
|
|
154
|
+
type: 'string',
|
|
155
|
+
'x-index': 40,
|
|
156
|
+
default: '',
|
|
157
|
+
description: '多选组件的尺寸宽度,仅在PC端生效',
|
|
158
|
+
enum: Tuple(WD_CKECKBOX_SIZE),
|
|
159
|
+
'x-category': X_CATEGORY.COMMON,
|
|
160
|
+
'x-platforms': ['PCWEB'],
|
|
161
|
+
}),
|
|
162
|
+
...FORM_ITEM_DATA_TITLE,
|
|
163
|
+
extra: Type.String({
|
|
164
|
+
title: '下方提示',
|
|
165
|
+
type: 'string',
|
|
166
|
+
description: '配置后提示内容常显在组件下方',
|
|
167
|
+
'x-index': 120,
|
|
168
|
+
'x-category': X_CATEGORY.OPTION,
|
|
169
|
+
}),
|
|
170
|
+
direction: Type.StringEnum({
|
|
171
|
+
title: '选项排列方式',
|
|
172
|
+
type: 'string',
|
|
173
|
+
'x-index': 130,
|
|
174
|
+
default: 'vertical',
|
|
175
|
+
enum: Tuple(WD_CHECKBOX_DIRECTION),
|
|
176
|
+
'x-category': X_CATEGORY.OPTION,
|
|
177
|
+
}),
|
|
178
|
+
borderedH5: Type.Boolean({
|
|
179
|
+
title: '移动端显示下划线',
|
|
180
|
+
type: 'boolean',
|
|
181
|
+
default: true,
|
|
182
|
+
description: '关闭后移动端不显示底部下划线',
|
|
183
|
+
'x-index': 140,
|
|
184
|
+
'x-category': X_CATEGORY.OPTION,
|
|
185
|
+
}),
|
|
186
|
+
// 新增且需兼容 disabled
|
|
187
|
+
status: Type.StringEnum({
|
|
188
|
+
title: '状态',
|
|
189
|
+
enum: Tuple(WD_CHECKBOX_STATUS),
|
|
190
|
+
default: 'edit',
|
|
191
|
+
type: 'string',
|
|
192
|
+
'x-index': 170,
|
|
193
|
+
'x-category': X_CATEGORY.VERIFY,
|
|
194
|
+
}),
|
|
195
|
+
required: Type.Boolean({
|
|
196
|
+
title: '必填',
|
|
197
|
+
type: 'boolean',
|
|
198
|
+
'x-index': 180,
|
|
199
|
+
default: false,
|
|
200
|
+
remarks: '启用后该组件强制必填,值不可为空',
|
|
201
|
+
'x-category': X_CATEGORY.VERIFY,
|
|
202
|
+
'x-linkages': [
|
|
203
|
+
{
|
|
204
|
+
type: 'value:visible',
|
|
205
|
+
target: '*(requiredFlag,requiredMsg)',
|
|
206
|
+
condition: '{{$self.value}}',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
}),
|
|
210
|
+
requiredFlag: Type.Boolean({
|
|
211
|
+
title: '必填标识',
|
|
212
|
+
type: 'boolean',
|
|
213
|
+
'x-index': 190,
|
|
214
|
+
default: true,
|
|
215
|
+
remarks: '启用后,组件若要求必填,则会显示必填星号标记',
|
|
216
|
+
'x-category': X_CATEGORY.VERIFY,
|
|
217
|
+
}),
|
|
218
|
+
requiredMsg: Type.String({
|
|
219
|
+
title: '必填校验提示',
|
|
220
|
+
type: 'string',
|
|
221
|
+
'x-index': 200,
|
|
222
|
+
default: '该项为必填项',
|
|
223
|
+
'x-category': X_CATEGORY.VERIFY,
|
|
224
|
+
remarks: '启用必填,但组件值为空时的提示信息',
|
|
225
|
+
}),
|
|
226
|
+
format: Type.String({
|
|
227
|
+
title: '字段类型',
|
|
228
|
+
type: 'string',
|
|
229
|
+
'x-index': 210,
|
|
230
|
+
default: '',
|
|
231
|
+
display: false,
|
|
232
|
+
'x-category': X_CATEGORY.COMMON,
|
|
233
|
+
'x-platforms': [],
|
|
234
|
+
'x-linkages': [
|
|
235
|
+
{
|
|
236
|
+
type: 'value:visible',
|
|
237
|
+
target: 'range',
|
|
238
|
+
condition: "{{$self.value!='x-enum'}}",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: 'value:visible',
|
|
242
|
+
target: 'tipBlock',
|
|
243
|
+
condition: "{{$self.value=='x-enum'}}",
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
}),
|
|
247
|
+
enumName: Type.String({
|
|
248
|
+
title: '通用选项集名称',
|
|
249
|
+
type: 'string',
|
|
250
|
+
'x-index': 220,
|
|
251
|
+
default: '',
|
|
252
|
+
'x-category': X_CATEGORY.COMMON,
|
|
253
|
+
display: false,
|
|
254
|
+
'x-platforms': [],
|
|
255
|
+
}),
|
|
256
|
+
tipBlock: Type.String({
|
|
257
|
+
title: '选项',
|
|
258
|
+
type: 'string',
|
|
259
|
+
'x-index': 230,
|
|
260
|
+
default: '',
|
|
261
|
+
'x-category': X_CATEGORY.COMMON,
|
|
262
|
+
'x-props': {
|
|
263
|
+
'data-hidebind': true,
|
|
264
|
+
},
|
|
265
|
+
'x-component': 'selection-tip',
|
|
266
|
+
}),
|
|
267
|
+
});
|
|
268
|
+
const properties = Type.Pick(ItemData, [
|
|
269
|
+
'name',
|
|
270
|
+
'value',
|
|
271
|
+
'label',
|
|
272
|
+
'required',
|
|
273
|
+
'visible',
|
|
274
|
+
'disabled',
|
|
275
|
+
'readOnly',
|
|
276
|
+
]);
|
|
277
|
+
// export default
|
|
278
|
+
const config = defineConfig({
|
|
279
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
280
|
+
// 属性定义
|
|
281
|
+
data,
|
|
282
|
+
// 只读属性定义
|
|
283
|
+
properties,
|
|
284
|
+
// 样式API
|
|
285
|
+
classes: [
|
|
286
|
+
{
|
|
287
|
+
name: '根元素',
|
|
288
|
+
selector: `.wd-checkbox-root`,
|
|
289
|
+
description: '组件最外层元素',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: 'H5 端根元素',
|
|
293
|
+
selector: `.wd-h5-checkbox-root`,
|
|
294
|
+
description: '可设定 H5 端的根元素样式',
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
name: 'PC 端根元素',
|
|
298
|
+
selector: `.wd-pc-checkbox-root`,
|
|
299
|
+
description: '可设定 PC 端的根元素样式',
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: '小程序端根元素',
|
|
303
|
+
selector: `.wd-mp-checkbox-root`,
|
|
304
|
+
description: '可设定小程序端的根元素样式',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: '无边框状态',
|
|
308
|
+
selector: `.wd-checkbox-root.is-borderless`,
|
|
309
|
+
description: '设置组件无边框状态样式',
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: '必填状态',
|
|
313
|
+
selector: `.wd-checkbox-root.is-required`,
|
|
314
|
+
description: '设置组件必填状态样式',
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: '标题',
|
|
318
|
+
selector: `.wd-checkbox__label`,
|
|
319
|
+
description: '组件标题元素',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: '标题禁用状态',
|
|
323
|
+
selector: `.wd-checkbox__label.is-disabled`,
|
|
324
|
+
description: '设置组件标题禁用状态样式',
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
name: '标题不换行',
|
|
328
|
+
selector: `.wd-checkbox__label.is-nowrap`,
|
|
329
|
+
description: '设置组件标题不换行时状态样式',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: '提示文字',
|
|
333
|
+
selector: `.wd-checkbox__help`,
|
|
334
|
+
description: '设置组件提示文字样式',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: '校验信息',
|
|
338
|
+
selector: `.wd-checkbox__error`,
|
|
339
|
+
description: '设置组件校验信息样式',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: '组件本身',
|
|
343
|
+
selector: '.wd-checkbox-group',
|
|
344
|
+
description: '组件本身元素',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: '行内排版',
|
|
348
|
+
selector: '.wd-checkbox-group--inline',
|
|
349
|
+
description: '组件行内排版样式',
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: '选项样式',
|
|
353
|
+
selector: '.wd-checkbox-wrap',
|
|
354
|
+
description: '选项样式',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
name: '选项禁用状态',
|
|
358
|
+
selector: '.wd-checkbox-wrap.is-disabled',
|
|
359
|
+
description: '选项禁用状态',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: '选项只读状态',
|
|
363
|
+
selector: '.wd-checkbox-wrap.is-disabled',
|
|
364
|
+
description: '选项只读状态',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: '小尺寸',
|
|
368
|
+
selector: '.wd-checkbox-wrap.size-sm',
|
|
369
|
+
description: '小尺寸样式(仅PC端有效)',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: '默认尺寸',
|
|
373
|
+
selector: '.wd-checkbox-wrap.size-md',
|
|
374
|
+
description: '默认、中尺寸样式(仅PC端有效)',
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
name: '大尺寸',
|
|
378
|
+
selector: '.wd-checkbox-wrap.size-lg',
|
|
379
|
+
description: '大尺寸样式',
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: '勾选状态',
|
|
383
|
+
selector: '.wd-checkbox-wrap.is-checked',
|
|
384
|
+
description: '选项勾选状态',
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
name: '所有状态',
|
|
388
|
+
selector: '.wd-checkbox-wrap.is-indeterminate',
|
|
389
|
+
description: '选项所有状态',
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: '按钮背景样式',
|
|
393
|
+
selector: '.wd-checkbox-inner',
|
|
394
|
+
description: '选项按钮背景样式',
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: '按钮样式',
|
|
398
|
+
selector: '.wd-checkbox-inner::after',
|
|
399
|
+
description: '选项按钮样式',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: '文本样式',
|
|
403
|
+
selector: '.wd-checkbox-label',
|
|
404
|
+
description: '选项内部文本样式',
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
// 组件方法
|
|
408
|
+
methods: [
|
|
409
|
+
{
|
|
410
|
+
...FORM_ITEM_METHODS.setValue,
|
|
411
|
+
params: {
|
|
412
|
+
properties: {
|
|
413
|
+
value: Type.Array(Type.String({
|
|
414
|
+
title: 'value',
|
|
415
|
+
}), {
|
|
416
|
+
title: '值',
|
|
417
|
+
default: [],
|
|
418
|
+
description: '使用多选组件的设置值方法时,值需要为数组格式。示例:[1,2],其中1和2对应多选组件的选项值',
|
|
419
|
+
'x-helper-text': '使用多选组件的设置值方法时,值需要为数组格式。示例:[1,2],其中1和2对应多选组件的选项值',
|
|
420
|
+
}),
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
FORM_ITEM_METHODS.setVisible,
|
|
425
|
+
FORM_ITEM_METHODS.setDisabled,
|
|
426
|
+
FORM_ITEM_METHODS.clearValue,
|
|
427
|
+
FORM_ITEM_METHODS.setReadOnly,
|
|
428
|
+
FORM_ITEM_METHODS.handleValidate,
|
|
429
|
+
FORM_ITEM_METHODS.clearValidate,
|
|
430
|
+
],
|
|
431
|
+
// 组件对外暴露事件
|
|
432
|
+
events: [
|
|
433
|
+
{
|
|
434
|
+
title: '值改变',
|
|
435
|
+
name: 'change',
|
|
436
|
+
detail: {
|
|
437
|
+
value: Type.BasicTypeUnion({
|
|
438
|
+
type: 'array',
|
|
439
|
+
description: '多选组件选中值',
|
|
440
|
+
}),
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
],
|
|
444
|
+
// 组件元信息
|
|
445
|
+
meta: {
|
|
446
|
+
name: 'WdCheckboxList',
|
|
447
|
+
title: '多选',
|
|
448
|
+
// 组件别名,用于生成组件 id,例如 Icon1
|
|
449
|
+
componentName: 'Checkbox',
|
|
450
|
+
description: '页面中平铺选项,用户可进行多项选择操作。',
|
|
451
|
+
icon: '../../icons/Checkbox.svg',
|
|
452
|
+
categoryOrder: 500,
|
|
453
|
+
componentOrder: 390,
|
|
454
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdCheckbox',
|
|
455
|
+
category: FORM_ITEM_META.category,
|
|
456
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
457
|
+
group: FORM_ITEM_META.group,
|
|
458
|
+
visible: FORM_ITEM_META.visible,
|
|
459
|
+
},
|
|
460
|
+
compConfig: {
|
|
461
|
+
componentType: 'formField',
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
export default config;
|