@cloudbase/weda-ui 3.24.1 → 3.25.0
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/dataView.js +1 -0
- package/dist/configs/components/listView.js +1 -0
- package/dist/configs/components/wd-form-arr.js +4 -1
- package/dist/configs/components/wd-select-multiple.js +1 -0
- package/dist/configs/components/wd-select.js +1 -0
- package/dist/configs/components/wd-table.js +1 -0
- package/dist/configs/components/wd-text.js +2 -2
- package/dist/configs/type-utils/type-form.js +6 -4
- package/dist/configs/utils/field.d.ts +1 -0
- package/dist/configs/utils/field.js +151 -0
- package/dist/style/index.css +6 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form-input-hooks/index.js +12 -4
- package/dist/web/components/formdetail/index.js +1 -0
- package/dist/web/components/wd-button/wd-button.js +5 -5
- package/dist/web/components/wd-form/hoc/form-container-decorator.js +2 -2
- package/dist/web/components/wd-form-item/wd-form-item.js +9 -11
- package/dist/web/components/wd-table/table-with-form.js +28 -14
- package/dist/web/components/wd-table/wd-table.js +12 -2
- package/dist/web/utils/hooks/useCanPreview.js +1 -1
- package/package.json +4 -3
|
@@ -2,7 +2,7 @@ import { defineConfig, Type } from '../type-utils';
|
|
|
2
2
|
import { FORM_ITEM_DATA, FORM_ITEM_META, ItemData, FORM_ITEM_DATA_TITLE } from '../type-utils/type-form';
|
|
3
3
|
import { getClasses } from '../type-utils/classes';
|
|
4
4
|
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
5
|
-
import { $attached_template, $custom_template, $table_template, $field_template } from '../utils/field';
|
|
5
|
+
import { $attached_template, $custom_template, $table_template, $field_template, $web_table_template, } from '../utils/field';
|
|
6
6
|
const $mode_template = `
|
|
7
7
|
{{#with $self as |$self|}}
|
|
8
8
|
{{#if (helper_utils '===' $self.attributes.mode 'obj')}}
|
|
@@ -18,6 +18,9 @@ ${$table_template}
|
|
|
18
18
|
{{else if (helper_utils '===' $self.attributes.mode 'custom')}}
|
|
19
19
|
|
|
20
20
|
${$custom_template}
|
|
21
|
+
{{else if (helper_utils '===' $self.attributes.mode 'web-table')}}
|
|
22
|
+
|
|
23
|
+
${$web_table_template}
|
|
21
24
|
{{/if}}
|
|
22
25
|
{{/with}}
|
|
23
26
|
`;
|
|
@@ -62,8 +62,8 @@ const data = Type.Object({
|
|
|
62
62
|
type: 'boolean',
|
|
63
63
|
'x-runtime-default': true,
|
|
64
64
|
'x-category': '高级属性',
|
|
65
|
-
description: '
|
|
66
|
-
'x-helper-text': '
|
|
65
|
+
description: '关闭时多个空格会自动转换成单个空格,web端文本内容的换行以空格展示,换行不生效。',
|
|
66
|
+
'x-helper-text': '关闭时多个空格会自动转换成单个空格,web端文本内容的换行以空格展示,换行不生效。',
|
|
67
67
|
'x-index': 60,
|
|
68
68
|
})),
|
|
69
69
|
userSelect: Type.Optional(Type.Boolean({
|
|
@@ -661,14 +661,16 @@ export const FORM_ITEM_DATA = {
|
|
|
661
661
|
type: 'string',
|
|
662
662
|
default: 'obj',
|
|
663
663
|
enum: [
|
|
664
|
-
{ label: '
|
|
665
|
-
{ label: '
|
|
666
|
-
{ label: '
|
|
667
|
-
{ label: '
|
|
664
|
+
{ label: '卡片(对象数组)', value: 'obj' },
|
|
665
|
+
{ label: '多端表格(对象数组)', value: 'table' },
|
|
666
|
+
{ label: '自定义(对象数组)', value: 'custom' },
|
|
667
|
+
{ label: 'web表格(对象数组)', value: 'web-table' },
|
|
668
|
+
{ label: '表单项(值数组)', value: 'field' },
|
|
668
669
|
],
|
|
669
670
|
'x-category': X_CATEGORY.COMMON,
|
|
670
671
|
'x-component': 'string',
|
|
671
672
|
'x-index': 21,
|
|
673
|
+
'x-helper-text': '切换web表格、表单项模版,不支持保留数据模型的字段配置,需重新配置',
|
|
672
674
|
}),
|
|
673
675
|
_addDefaultValue: Type.Unknown({
|
|
674
676
|
title: '新增表单项初始值',
|
|
@@ -2,4 +2,5 @@ export declare const $table_template: string;
|
|
|
2
2
|
export declare const $attached_template: string;
|
|
3
3
|
export declare const $custom_template: string;
|
|
4
4
|
export declare const $field_template: string;
|
|
5
|
+
export declare const $web_table_template: string;
|
|
5
6
|
export declare const $upload_image_template = "\n[attributes]\nlabelVisible = false\n[[template]]\ncomponent = \"Container\"\n\n [[template.items]]\n component = \"WdButton\"\n [template.items.attributes]\n icon = \"td:upload\"\n iconType = \"text-with-icon\"\n text = \"\u4E0A\u4F20\"\n variant = \"outline\"\n\n [[template.items.listeners]]\n eventName = \"tap\"\n type = \"platform\"\n [template.items.listeners.handler]\n name = \"invoke\"\n module = \"platform\"\n [template.items.listeners.handler.params]\n component = \"{{$self.id}}\"\n method = \"upload\"\n\n [[template.items]]\n component = \"Container\"\n [template.items.attributes.style]\n marginTop = \"10px\"\n display = \"flex\"\n flexWrap = \"wrap\"\n\n [[template.items.items]]\n component = \"Repeater\"\n\n [template.items.items.attributes]\n \":data\" = \"$w.{{$self.id}}?.previewFile||[]\"\n\n suffix = '{{$self.id}}'\n forItem = 'item_{{$self.id}}'\n forIndex = 'index_{{$self.id}}'\n\n [[template.items.items.items]]\n component = \"Container\"\n\n [template.items.items.items.attributes.style]\n margin = \"5px\"\n padding = \"10px\"\n border = \"1px solid #d9d9d9\"\n flexShrink = 0\n width = \"102px\"\n height = \"102px\"\n position = \"relative\"\n\n [[template.items.items.items.items]]\n component = \"WdImage\"\n\n [template.items.items.items.items.attributes]\n alt = \"[\u56FE\u7247]\"\n fit = \"contain\"\n imgPreview = true\n \":src\" = '$w.item_{{$self.id}}.tempUrl||$w.item_{{$self.id}}.cloudId'\n\n [template.items.items.items.items.attributes.style]\n width = \"80px\"\n height = \"80px\"\n\n [[template.items.items.items.items]]\n component = \"WdIcon\"\n\n [template.items.items.items.items.attributes]\n name = \"delete\"\n size = \"sm\"\n\n [template.items.items.items.items.attributes.style]\n position = \"absolute\"\n right = \"5px\"\n top = \"5px\"\n\n [[template.items.items.items.items.listeners]]\n eventName = \"tap\"\n type = \"platform\"\n\n [template.items.items.items.items.listeners.handler]\n name = \"invoke\"\n module = \"platform\"\n\n [template.items.items.items.items.listeners.handler.params]\n component = \"{{$self.id}}\"\n method = \"delete\"\n\n [template.items.items.items.items.listeners.handler.params.params]\n \":cloudId\" = '$w.item_{{$self.id}}.cloudId'\n\n";
|
|
@@ -436,6 +436,7 @@ label= "表单子项"
|
|
|
436
436
|
[template.items.attributes.style]
|
|
437
437
|
display = "flex"
|
|
438
438
|
alignItems = "center"
|
|
439
|
+
width = "100%"
|
|
439
440
|
|
|
440
441
|
[[template.items.items]]
|
|
441
442
|
component = 'WdFormObj'
|
|
@@ -509,6 +510,156 @@ method = "remove"
|
|
|
509
510
|
":index" = "$w.index_{{$self.id}}"
|
|
510
511
|
|
|
511
512
|
${$add_button_template}
|
|
513
|
+
`;
|
|
514
|
+
// web表格模板
|
|
515
|
+
export const $web_table_template = `
|
|
516
|
+
[attributes]
|
|
517
|
+
value = [{}]
|
|
518
|
+
":addDefaultValue"="{}"
|
|
519
|
+
[[template]]
|
|
520
|
+
component = "WdTable"
|
|
521
|
+
[template.attributes]
|
|
522
|
+
":dataSourceData" = "$w.{{$self.id}}.value"
|
|
523
|
+
dataSourceType = "expression"
|
|
524
|
+
recordKey = "_id"
|
|
525
|
+
enableCellCustomOption = false
|
|
526
|
+
enableGlobalButton = false
|
|
527
|
+
enablePagination = false
|
|
528
|
+
enableRefreshBtn = false
|
|
529
|
+
enableTableHeightSizeBtn = false
|
|
530
|
+
enableTotal = false
|
|
531
|
+
isOrderBy = true
|
|
532
|
+
supportManyRelated = true
|
|
533
|
+
isSupportMultipleSort = true
|
|
534
|
+
isSupportApis = false
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
[[template.attributes.columnSets]]
|
|
538
|
+
key = "name"
|
|
539
|
+
slotKey = "name"
|
|
540
|
+
header = "姓名"
|
|
541
|
+
genre = "slot"
|
|
542
|
+
align = "left"
|
|
543
|
+
isSort = false
|
|
544
|
+
isExport = false
|
|
545
|
+
visible = true
|
|
546
|
+
widthType = "auto"
|
|
547
|
+
hidden = false
|
|
548
|
+
format = ""
|
|
549
|
+
[template.attributes.columnSets.schema]
|
|
550
|
+
type = "string"
|
|
551
|
+
name = "name"
|
|
552
|
+
title = "name"
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
[[template.attributes.columnSets]]
|
|
556
|
+
key = "age"
|
|
557
|
+
slotKey = "age"
|
|
558
|
+
header = "年龄"
|
|
559
|
+
genre = "slot"
|
|
560
|
+
align = "left"
|
|
561
|
+
isSort = false
|
|
562
|
+
isExport = false
|
|
563
|
+
visible = true
|
|
564
|
+
widthType = "auto"
|
|
565
|
+
hidden = false
|
|
566
|
+
format = ""
|
|
567
|
+
[template.attributes.columnSets.schema]
|
|
568
|
+
type = "number"
|
|
569
|
+
name = "age"
|
|
570
|
+
title = "age"
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
[[template.items]]
|
|
574
|
+
id = "globalButton"
|
|
575
|
+
component = ""
|
|
576
|
+
extra = { }
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
[[template.items]]
|
|
580
|
+
id = "cell_name"
|
|
581
|
+
component = ""
|
|
582
|
+
extra = { }
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
[[template.items.items]]
|
|
586
|
+
component = "WdInput"
|
|
587
|
+
|
|
588
|
+
[template.items.items.attributes]
|
|
589
|
+
inputValue = ""
|
|
590
|
+
label = "标题"
|
|
591
|
+
labelVisible = false
|
|
592
|
+
name = "name"
|
|
593
|
+
placeholder = "请输入"
|
|
594
|
+
prefixIcon = "success"
|
|
595
|
+
prefixType = ""
|
|
596
|
+
requiredMsg = "该项为必填项"
|
|
597
|
+
status = "edit"
|
|
598
|
+
suffixIcon = "success"
|
|
599
|
+
suffixType = ""
|
|
600
|
+
template = "inputBox"
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
[[template.items]]
|
|
605
|
+
id = "cell_age"
|
|
606
|
+
component = ""
|
|
607
|
+
extra = { }
|
|
608
|
+
|
|
609
|
+
[[template.items.items]]
|
|
610
|
+
component = "WdInput"
|
|
611
|
+
|
|
612
|
+
[template.items.items.attributes]
|
|
613
|
+
inputValue = ""
|
|
614
|
+
label = "标题"
|
|
615
|
+
labelVisible = false
|
|
616
|
+
name = "age"
|
|
617
|
+
placeholder = "请输入"
|
|
618
|
+
prefixIcon = "success"
|
|
619
|
+
prefixType = ""
|
|
620
|
+
requiredMsg = "该项为必填项"
|
|
621
|
+
status = "edit"
|
|
622
|
+
suffixIcon = "success"
|
|
623
|
+
suffixType = ""
|
|
624
|
+
template = "inputBox"
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
[[template.items]]
|
|
628
|
+
id = "cell__custom__option"
|
|
629
|
+
component = ""
|
|
630
|
+
extra = { }
|
|
631
|
+
|
|
632
|
+
[[template.items.items]]
|
|
633
|
+
component = "WdButton"
|
|
634
|
+
|
|
635
|
+
[template.items.items.attributes]
|
|
636
|
+
content = "删除"
|
|
637
|
+
size = "md"
|
|
638
|
+
text = "删除"
|
|
639
|
+
theme = "error"
|
|
640
|
+
variant = "link"
|
|
641
|
+
|
|
642
|
+
[template.items.items.attributes.style]
|
|
643
|
+
marginRight = 8
|
|
644
|
+
|
|
645
|
+
[[template.items.items.listeners]]
|
|
646
|
+
id = "wn9nx03j9"
|
|
647
|
+
eventName = "tap"
|
|
648
|
+
type = "platform"
|
|
649
|
+
isCapturePhase = false
|
|
650
|
+
noPropagation = false
|
|
651
|
+
|
|
652
|
+
[template.items.items.listeners.handler]
|
|
653
|
+
name = "invoke"
|
|
654
|
+
module = "platform"
|
|
655
|
+
|
|
656
|
+
[template.items.items.listeners.handler.params]
|
|
657
|
+
component = "{{$self.id}}"
|
|
658
|
+
method = "remove"
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
${$add_button_template}
|
|
662
|
+
|
|
512
663
|
`;
|
|
513
664
|
// 自定义图片上传模板
|
|
514
665
|
export const $upload_image_template = `
|
package/dist/style/index.css
CHANGED
|
@@ -10529,6 +10529,7 @@ page,
|
|
|
10529
10529
|
}
|
|
10530
10530
|
|
|
10531
10531
|
.wd-form-obj-root {
|
|
10532
|
+
--wd-card-heder-pd-bordered: 1rem;
|
|
10532
10533
|
display: flex;
|
|
10533
10534
|
}
|
|
10534
10535
|
.wd-form-obj-root .wd-form-obj {
|
|
@@ -10557,6 +10558,11 @@ page,
|
|
|
10557
10558
|
.wd-form-obj-root .wd-form-item-wrap {
|
|
10558
10559
|
width: 100%;
|
|
10559
10560
|
}
|
|
10561
|
+
.wd-form-obj-root .wd-form-item-wrap.wd-form-item-wrap__vertical {
|
|
10562
|
+
display: flex;
|
|
10563
|
+
flex-direction: column;
|
|
10564
|
+
width: 100%;
|
|
10565
|
+
}
|
|
10560
10566
|
.wd-form-obj-root .wd-form-item-wrap .wd-form-item-wrap__control {
|
|
10561
10567
|
overflow: unset;
|
|
10562
10568
|
}
|