@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
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
import { defineConfig, Tuple, Type } from '../type-utils';
|
|
1
|
+
import { defineConfig, Tuple, Type, } from '../type-utils';
|
|
2
|
+
const events = [
|
|
3
|
+
{
|
|
4
|
+
title: '提交',
|
|
5
|
+
name: 'submit',
|
|
6
|
+
},
|
|
7
|
+
];
|
|
8
|
+
// const WD_FORM_LABEL_DIRECTION = [
|
|
9
|
+
// {
|
|
10
|
+
// label: '水平左对齐',
|
|
11
|
+
// value: 'horizontal-left',
|
|
12
|
+
// },
|
|
13
|
+
// {
|
|
14
|
+
// label: '水平右对齐',
|
|
15
|
+
// value: 'horizontal-right',
|
|
16
|
+
// },
|
|
17
|
+
// {
|
|
18
|
+
// label: '垂直左对齐',
|
|
19
|
+
// value: 'vertical-left',
|
|
20
|
+
// },
|
|
21
|
+
// {
|
|
22
|
+
// label: '垂直右对齐',
|
|
23
|
+
// value: 'vertical-right',
|
|
24
|
+
// },
|
|
25
|
+
// ];
|
|
2
26
|
const data = Type.Object({
|
|
3
27
|
contentSlot: Type.Slot({
|
|
4
28
|
description: '内容插槽',
|
|
@@ -243,6 +267,14 @@ const data = Type.Object({
|
|
|
243
267
|
},
|
|
244
268
|
]),
|
|
245
269
|
}),
|
|
270
|
+
// labelPosition: Type.StringEnum({
|
|
271
|
+
// title: '标题位置',
|
|
272
|
+
// type: 'string',
|
|
273
|
+
// 'x-index': 62,
|
|
274
|
+
// default: 'vertical-left',
|
|
275
|
+
// enum: Tuple(WD_FORM_LABEL_DIRECTION),
|
|
276
|
+
// 'x-category': '基础属性',
|
|
277
|
+
// }),
|
|
246
278
|
methodCreate: Type.String({
|
|
247
279
|
type: 'string',
|
|
248
280
|
title: '新增方法',
|
|
@@ -330,15 +362,21 @@ const properties = Type.Intersect([
|
|
|
330
362
|
format: Type.String(),
|
|
331
363
|
message: Type.String(),
|
|
332
364
|
}), {
|
|
365
|
+
title: '错误信息',
|
|
333
366
|
description: '提交的校验错误信息对象',
|
|
334
367
|
}),
|
|
335
368
|
remoteValue: Type.Record(Type.String(), Type.Any(), {
|
|
369
|
+
title: '数据源初始值',
|
|
336
370
|
description: '数据源初始化请求的初始值',
|
|
337
371
|
}),
|
|
338
372
|
value: Type.Record(Type.String(), Type.Any(), {
|
|
373
|
+
title: '表单前端值',
|
|
339
374
|
description: '当前前端表单状态值',
|
|
340
375
|
}),
|
|
341
|
-
dataSourceProfile: Type.Any({
|
|
376
|
+
dataSourceProfile: Type.Any({
|
|
377
|
+
title: '数据源类型信息',
|
|
378
|
+
description: '数据源信息',
|
|
379
|
+
}),
|
|
342
380
|
// TODO:
|
|
343
381
|
// clearValidate: Type.Function([], Type.Void()),
|
|
344
382
|
}),
|
|
@@ -351,21 +389,39 @@ export default defineConfig({
|
|
|
351
389
|
isDataContainer: true,
|
|
352
390
|
componentType: 'form',
|
|
353
391
|
},
|
|
354
|
-
|
|
392
|
+
defaultStyles: {
|
|
393
|
+
display: 'block',
|
|
394
|
+
},
|
|
395
|
+
properties,
|
|
396
|
+
classes: [
|
|
355
397
|
{
|
|
356
|
-
name: '
|
|
357
|
-
|
|
398
|
+
name: '根元素',
|
|
399
|
+
selector: '.wd-form',
|
|
400
|
+
description: '分割线组件根元素',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'PC 端分割线根元素',
|
|
404
|
+
selector: '.wd-pc-form',
|
|
405
|
+
description: '可以为 PC 端的分割线编写样式',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: 'H5 端分割线根元素',
|
|
409
|
+
selector: '.wd-h5-form',
|
|
410
|
+
description: '可以为 H5 端的分割线编写样式',
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
name: '小程序端分割线根元素',
|
|
414
|
+
selector: '.wd-mp-form',
|
|
415
|
+
description: '可以为小程序端的分割线编写样式',
|
|
358
416
|
},
|
|
359
417
|
],
|
|
360
|
-
|
|
418
|
+
methods: [
|
|
361
419
|
{
|
|
362
|
-
title: '提交',
|
|
363
420
|
name: 'submit',
|
|
421
|
+
label: '提交',
|
|
364
422
|
},
|
|
365
423
|
],
|
|
366
|
-
|
|
367
|
-
display: 'block',
|
|
368
|
-
},
|
|
424
|
+
events,
|
|
369
425
|
meta: {
|
|
370
426
|
description: '作为单行输入、下拉选择等各项表单类组件的父级容器,实现数据提交。',
|
|
371
427
|
title: '表单容器',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { omit, getFormItemClasses, FORM_ITEM_META, } from '../type-utils/type-form';
|
|
3
|
+
import wdInputConfig, { WD_INPUT_DATA } from './wd-input';
|
|
4
|
+
// 属性类型定义
|
|
5
|
+
const data = Type.Partial(Type.Object(Object.assign(omit(WD_INPUT_DATA, ['password', 'type', 'isNickNameType', 'rules']), {
|
|
6
|
+
name: { ...WD_INPUT_DATA.name, default: 'formEmail' },
|
|
7
|
+
label: { ...WD_INPUT_DATA.label, default: '邮箱' },
|
|
8
|
+
placeholder: { ...WD_INPUT_DATA.placeholder, default: '请输入邮箱' },
|
|
9
|
+
})));
|
|
10
|
+
const classes = getFormItemClasses('input-email');
|
|
11
|
+
// export default
|
|
12
|
+
const config = defineConfig({
|
|
13
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
14
|
+
data,
|
|
15
|
+
properties: wdInputConfig.properties,
|
|
16
|
+
classes,
|
|
17
|
+
methods: wdInputConfig.methods,
|
|
18
|
+
events: wdInputConfig.events,
|
|
19
|
+
meta: {
|
|
20
|
+
description: '用于输入邮箱地址,会强制校验输入内容是否符合邮箱格式。',
|
|
21
|
+
icon: '../../icons/OfficialAccount.svg',
|
|
22
|
+
title: '邮箱输入',
|
|
23
|
+
name: 'WdInputEmail',
|
|
24
|
+
componentName: 'InputEmail',
|
|
25
|
+
categoryOrder: 500,
|
|
26
|
+
componentOrder: 520,
|
|
27
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdInputEmail',
|
|
28
|
+
category: FORM_ITEM_META.category,
|
|
29
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
30
|
+
group: FORM_ITEM_META.group,
|
|
31
|
+
visible: FORM_ITEM_META.visible,
|
|
32
|
+
},
|
|
33
|
+
compConfig: {
|
|
34
|
+
componentType: 'formField',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export default config;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { getFormItemClasses, omit, FORM_ITEM_META, } from '../type-utils/type-form';
|
|
3
|
+
import wdInputConfig, { WD_INPUT_DATA } from './wd-input';
|
|
4
|
+
// 属性类型定义
|
|
5
|
+
const data = Type.Partial(Type.Object(Object.assign(omit(WD_INPUT_DATA, [
|
|
6
|
+
'password',
|
|
7
|
+
'type',
|
|
8
|
+
'isNickNameType',
|
|
9
|
+
'rules',
|
|
10
|
+
'maxLength',
|
|
11
|
+
]), {
|
|
12
|
+
name: { ...WD_INPUT_DATA.name, default: 'formPhone' },
|
|
13
|
+
label: { ...WD_INPUT_DATA.label, default: '手机' },
|
|
14
|
+
placeholder: { ...WD_INPUT_DATA.placeholder, default: '请输入手机号' },
|
|
15
|
+
})));
|
|
16
|
+
const classes = getFormItemClasses('input-phone');
|
|
17
|
+
// export default
|
|
18
|
+
const config = defineConfig({
|
|
19
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
20
|
+
data,
|
|
21
|
+
properties: wdInputConfig.properties,
|
|
22
|
+
classes,
|
|
23
|
+
methods: wdInputConfig.methods,
|
|
24
|
+
events: wdInputConfig.events,
|
|
25
|
+
meta: {
|
|
26
|
+
description: '用于输入电话号码,会强制校验输入内容是否符合电话格式。',
|
|
27
|
+
icon: '../../icons/PhoneCode.svg',
|
|
28
|
+
title: '电话输入',
|
|
29
|
+
name: 'WdInputPhone',
|
|
30
|
+
componentName: 'InputPhone',
|
|
31
|
+
categoryOrder: 500,
|
|
32
|
+
componentOrder: 500,
|
|
33
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdInputPhone',
|
|
34
|
+
category: FORM_ITEM_META.category,
|
|
35
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
36
|
+
group: FORM_ITEM_META.group,
|
|
37
|
+
visible: FORM_ITEM_META.visible,
|
|
38
|
+
},
|
|
39
|
+
compConfig: {
|
|
40
|
+
componentType: 'formField',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export default config;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { getFormItemClasses, omit, FORM_ITEM_META, } from '../type-utils/type-form';
|
|
3
|
+
import wdInputConfig, { WD_INPUT_DATA } from './wd-input';
|
|
4
|
+
// 属性类型定义
|
|
5
|
+
const data = Type.Partial(Type.Object(Object.assign(omit(WD_INPUT_DATA, ['password', 'type', 'isNickNameType', 'rules']), {
|
|
6
|
+
name: { ...WD_INPUT_DATA.name, default: 'formUrl' },
|
|
7
|
+
label: { ...WD_INPUT_DATA.label, default: '网址' },
|
|
8
|
+
placeholder: { ...WD_INPUT_DATA.placeholder, default: '请输入网址' },
|
|
9
|
+
})));
|
|
10
|
+
const classes = getFormItemClasses('input-url');
|
|
11
|
+
// export default
|
|
12
|
+
const config = defineConfig({
|
|
13
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
14
|
+
data,
|
|
15
|
+
properties: wdInputConfig.properties,
|
|
16
|
+
classes,
|
|
17
|
+
methods: wdInputConfig.methods,
|
|
18
|
+
events: wdInputConfig.events,
|
|
19
|
+
meta: {
|
|
20
|
+
description: '用于输入URL地址,会强制校验输入内容是否符合URL格式。',
|
|
21
|
+
icon: '../../icons/Badge.svg',
|
|
22
|
+
title: 'URL输入',
|
|
23
|
+
name: 'WdInputUrl',
|
|
24
|
+
componentName: 'InputUrl',
|
|
25
|
+
categoryOrder: 500,
|
|
26
|
+
componentOrder: 510,
|
|
27
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdInputUrl',
|
|
28
|
+
category: FORM_ITEM_META.category,
|
|
29
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
30
|
+
group: FORM_ITEM_META.group,
|
|
31
|
+
visible: FORM_ITEM_META.visible,
|
|
32
|
+
},
|
|
33
|
+
compConfig: {
|
|
34
|
+
componentType: 'formField',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export default config;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { FORM_ITEM_DATA, FORM_ITEM_DATA_TITLE, FORM_ITEM_EVENTS, FORM_ITEM_METHODS, FORM_ITEM_META, getFormItemClasses, ItemData, } from '../type-utils/type-form';
|
|
3
|
+
// 属性类型定义,同时提供给 url/phone/email 三个组件使用
|
|
4
|
+
const WD_INPUT_DATA = {
|
|
5
|
+
// 通用
|
|
6
|
+
name: FORM_ITEM_DATA.name,
|
|
7
|
+
inputValue: FORM_ITEM_DATA.inputValue,
|
|
8
|
+
placeholder: FORM_ITEM_DATA.placeholder,
|
|
9
|
+
size: FORM_ITEM_DATA.size,
|
|
10
|
+
block: FORM_ITEM_DATA.block,
|
|
11
|
+
// 标题
|
|
12
|
+
...FORM_ITEM_DATA_TITLE,
|
|
13
|
+
// 输入框
|
|
14
|
+
clearable: FORM_ITEM_DATA.clearable,
|
|
15
|
+
before: FORM_ITEM_DATA.before,
|
|
16
|
+
after: FORM_ITEM_DATA.after,
|
|
17
|
+
prefixType: FORM_ITEM_DATA.prefixType,
|
|
18
|
+
prefixIcon: FORM_ITEM_DATA.prefixIcon,
|
|
19
|
+
prefixSrc: FORM_ITEM_DATA.prefixSrc,
|
|
20
|
+
suffixType: FORM_ITEM_DATA.suffixType,
|
|
21
|
+
suffixIcon: FORM_ITEM_DATA.suffixIcon,
|
|
22
|
+
suffixSrc: FORM_ITEM_DATA.suffixSrc,
|
|
23
|
+
extra: FORM_ITEM_DATA.extra,
|
|
24
|
+
password: FORM_ITEM_DATA.password,
|
|
25
|
+
type: FORM_ITEM_DATA.type,
|
|
26
|
+
counterVisible: FORM_ITEM_DATA.counterVisible,
|
|
27
|
+
focus: FORM_ITEM_DATA.focus,
|
|
28
|
+
borderedH5: FORM_ITEM_DATA.borderedH5,
|
|
29
|
+
borderedPc: FORM_ITEM_DATA.borderedPc,
|
|
30
|
+
// 小程序开放能力
|
|
31
|
+
isNickNameType: FORM_ITEM_DATA.isNickNameType,
|
|
32
|
+
// 状态校验
|
|
33
|
+
maxLength: FORM_ITEM_DATA.maxLength,
|
|
34
|
+
rules: FORM_ITEM_DATA.rules,
|
|
35
|
+
status: FORM_ITEM_DATA.status,
|
|
36
|
+
required: FORM_ITEM_DATA.required,
|
|
37
|
+
requiredFlag: FORM_ITEM_DATA.requiredFlag,
|
|
38
|
+
requiredMsg: FORM_ITEM_DATA.requiredMsg,
|
|
39
|
+
};
|
|
40
|
+
const data = Type.Partial(Type.Object(WD_INPUT_DATA));
|
|
41
|
+
const properties = Type.Pick(ItemData, [
|
|
42
|
+
'name',
|
|
43
|
+
'label',
|
|
44
|
+
'required',
|
|
45
|
+
'before',
|
|
46
|
+
'after',
|
|
47
|
+
'visible',
|
|
48
|
+
'disabled',
|
|
49
|
+
'readOnly',
|
|
50
|
+
'value',
|
|
51
|
+
]);
|
|
52
|
+
const classes = getFormItemClasses('input');
|
|
53
|
+
// 组件配置
|
|
54
|
+
const config = defineConfig({
|
|
55
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
56
|
+
data,
|
|
57
|
+
properties,
|
|
58
|
+
classes,
|
|
59
|
+
methods: [
|
|
60
|
+
FORM_ITEM_METHODS.setValue,
|
|
61
|
+
FORM_ITEM_METHODS.setVisible,
|
|
62
|
+
FORM_ITEM_METHODS.setDisabled,
|
|
63
|
+
FORM_ITEM_METHODS.clearValue,
|
|
64
|
+
FORM_ITEM_METHODS.setReadOnly,
|
|
65
|
+
FORM_ITEM_METHODS.handleValidate,
|
|
66
|
+
FORM_ITEM_METHODS.clearValidate,
|
|
67
|
+
],
|
|
68
|
+
events: [
|
|
69
|
+
FORM_ITEM_EVENTS.change,
|
|
70
|
+
FORM_ITEM_EVENTS.focus,
|
|
71
|
+
FORM_ITEM_EVENTS.blur,
|
|
72
|
+
FORM_ITEM_EVENTS.confirm,
|
|
73
|
+
FORM_ITEM_EVENTS.clear,
|
|
74
|
+
],
|
|
75
|
+
meta: {
|
|
76
|
+
description: '用于单行内容的输入。',
|
|
77
|
+
icon: '../../icons/Input.svg',
|
|
78
|
+
title: '单行输入',
|
|
79
|
+
name: 'WdInput',
|
|
80
|
+
componentName: 'Input',
|
|
81
|
+
categoryOrder: 500,
|
|
82
|
+
componentOrder: 350,
|
|
83
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdInput',
|
|
84
|
+
category: FORM_ITEM_META.category,
|
|
85
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
86
|
+
group: FORM_ITEM_META.group,
|
|
87
|
+
visible: FORM_ITEM_META.visible,
|
|
88
|
+
},
|
|
89
|
+
compConfig: {
|
|
90
|
+
componentType: 'formField',
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
export default config;
|
|
94
|
+
export { WD_INPUT_DATA };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Date: 2023-04-18 19:14:39
|
|
3
|
+
* @LastEditTime: 2023-05-11 15:56:50
|
|
4
|
+
* @Description:
|
|
5
|
+
*/
|
|
6
|
+
import { defineConfig, Type } from '../type-utils';
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
9
|
+
data: {
|
|
10
|
+
properties: {},
|
|
11
|
+
},
|
|
12
|
+
events: [
|
|
13
|
+
{
|
|
14
|
+
title: '公众号加载成功',
|
|
15
|
+
name: 'load',
|
|
16
|
+
'x-platforms': ['MP'],
|
|
17
|
+
remarks: '公众号加载成功时触发',
|
|
18
|
+
detail: {
|
|
19
|
+
status: Type.Number({
|
|
20
|
+
description: '状态码',
|
|
21
|
+
}),
|
|
22
|
+
errMsg: Type.String({
|
|
23
|
+
description: '错误信息',
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '公众号加载失败',
|
|
29
|
+
name: 'error',
|
|
30
|
+
'x-platforms': ['MP'],
|
|
31
|
+
remarks: '公众号加载失败时触发',
|
|
32
|
+
detail: {
|
|
33
|
+
status: Type.Number({
|
|
34
|
+
description: '状态码',
|
|
35
|
+
}),
|
|
36
|
+
errMsg: Type.String({
|
|
37
|
+
description: '错误信息',
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
classes: [
|
|
43
|
+
{
|
|
44
|
+
name: '根元素',
|
|
45
|
+
selector: '.wd-official-account',
|
|
46
|
+
description: '公众号关注组件根元素',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: '小程序端根元素',
|
|
50
|
+
selector: '.wd-mp-official-account',
|
|
51
|
+
description: '可以为小程序端的组件编写样式',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
meta: {
|
|
55
|
+
name: 'WdOfficialAccount',
|
|
56
|
+
title: '公众号关注组件',
|
|
57
|
+
description: '可在小程序内展示公众号关注入口,方便用户快捷关注或访问公众号。',
|
|
58
|
+
category: '小程序',
|
|
59
|
+
icon: '../icons/OfficialAccount.svg',
|
|
60
|
+
platform: ['MP'],
|
|
61
|
+
visible: ['APP'],
|
|
62
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/wxOpen/WdOfficialAccount',
|
|
63
|
+
inlineStyleForm: {
|
|
64
|
+
$blockedAll: true,
|
|
65
|
+
},
|
|
66
|
+
categoryOrder: 700,
|
|
67
|
+
componentOrder: 590,
|
|
68
|
+
validate: [
|
|
69
|
+
{
|
|
70
|
+
rule: 'checkSameComponentInOnePage',
|
|
71
|
+
options: {
|
|
72
|
+
allowFailure: true,
|
|
73
|
+
title: '$POSITION$使用了多个微信公众号组件,发布后将仅展示第一个。',
|
|
74
|
+
description: '使用了多个微信公众号组件,发布后将仅展示第一个。',
|
|
75
|
+
type: 'mp',
|
|
76
|
+
version: '',
|
|
77
|
+
matchedPublishedPlatform: ['miniprogram'],
|
|
78
|
+
extra: {
|
|
79
|
+
usePositionTemplate: true,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
propertyPanelTips: '当前组件不支持PC或H5构建,发布后将默认隐藏,请注意页面布局 \n请先前往[微信公众平台](https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html),在设置-关注公众号模块绑定公众号',
|
|
85
|
+
stylePanelTips: '该组件高度固定为84px,宽度不小于300px,可通过调整外层普通容器的宽度调整组件宽度。',
|
|
86
|
+
},
|
|
87
|
+
});
|