@cloudbase/weda-ui 3.6.3 → 3.7.1
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/form-location.d.ts +2 -2
- package/dist/configs/components/wd-card.d.ts +14 -14
- package/dist/configs/components/wd-card.js +38 -32
- package/dist/configs/components/wd-cascader.d.ts +276 -0
- package/dist/configs/components/wd-cascader.js +183 -0
- package/dist/configs/components/wd-code-editor.d.ts +245 -0
- package/dist/configs/components/wd-code-editor.js +92 -0
- package/dist/configs/components/wd-form-arr.d.ts +193 -0
- package/dist/configs/components/wd-form-arr.js +206 -0
- package/dist/configs/components/wd-form-obj.d.ts +181 -0
- package/dist/configs/components/wd-form-obj.js +107 -0
- package/dist/configs/components/wd-form.d.ts +2 -2
- package/dist/configs/components/wd-image.js +1 -1
- package/dist/configs/components/wd-table.d.ts +3 -3
- package/dist/configs/components/wd-upload-file.d.ts +1 -0
- package/dist/configs/components/wd-upload-file.js +4 -1
- package/dist/configs/components/wd-upload-image.d.ts +2 -0
- package/dist/configs/components/wd-upload-image.js +4 -1
- package/dist/configs/components/web-view.d.ts +20 -1
- package/dist/configs/components/web-view.js +22 -1
- package/dist/configs/index.d.ts +1604 -28
- package/dist/configs/index.js +8 -0
- package/dist/configs/type-utils/type-form.d.ts +22 -0
- package/dist/configs/type-utils/type-form.js +58 -1
- package/dist/configs/type-utils/x-runtime-default.d.ts +3 -0
- package/dist/configs/type-utils/x-runtime-default.js +3 -0
- package/dist/enum/index.d.ts +8 -0
- package/dist/enum/index.js +11 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/components/container/index.js +49 -1
- package/dist/web/components/form/uploader/uploader.h5.js +3 -3
- package/dist/web/components/form/uploader/uploader.pc.js +3 -3
- package/dist/web/components/form-input-hooks/index.js +14 -7
- package/dist/web/components/form-input-hooks/validator.js +2 -2
- package/dist/web/components/form-location/index.d.ts +1 -1
- package/dist/web/components/index.d.ts +4 -0
- package/dist/web/components/index.js +6 -0
- package/dist/web/components/richTextView/index.css +2 -1
- package/dist/web/components/wd-cascader/cascader.d.ts +6 -0
- package/dist/web/components/wd-cascader/cascader.h5.d.ts +2 -0
- package/dist/web/components/wd-cascader/cascader.h5.js +132 -0
- package/dist/web/components/wd-cascader/cascader.js +97 -0
- package/dist/web/components/wd-cascader/index.d.ts +4 -0
- package/dist/web/components/wd-cascader/index.js +3 -0
- package/dist/web/components/wd-cascader/interface.d.ts +26 -0
- package/dist/web/components/wd-cascader/interface.js +1 -0
- package/dist/web/components/wd-cascader/utils.d.ts +6 -0
- package/dist/web/components/wd-cascader/utils.js +63 -0
- package/dist/web/components/wd-code-editor/index.d.ts +3 -0
- package/dist/web/components/wd-code-editor/index.js +3 -0
- package/dist/web/components/wd-code-editor/lang/index.d.ts +17 -0
- package/dist/web/components/wd-code-editor/lang/index.js +21 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/complete.d.ts +8 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/complete.js +222 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/index.d.ts +2 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/index.js +60 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/snippets.d.ts +6 -0
- package/dist/web/components/wd-code-editor/lang/mongodb/snippets.js +189 -0
- package/dist/web/components/wd-code-editor/theme.d.ts +4 -0
- package/dist/web/components/wd-code-editor/theme.js +5 -0
- package/dist/web/components/wd-code-editor/wd-code-editor.d.ts +9 -0
- package/dist/web/components/wd-code-editor/wd-code-editor.js +66 -0
- package/dist/web/components/wd-date/elements/Modal.h5.d.ts +2 -0
- package/dist/web/components/wd-date/elements/Modal.h5.js +4 -2
- package/dist/web/components/wd-form/form-utils.js +1 -1
- package/dist/web/components/wd-form/index.d.ts +4 -4
- package/dist/web/components/wd-form-arr/index.d.ts +4 -0
- package/dist/web/components/wd-form-arr/index.js +3 -0
- package/dist/web/components/wd-form-arr/wd-form-arr.d.ts +8 -0
- package/dist/web/components/wd-form-arr/wd-form-arr.js +6 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +3 -3
- package/dist/web/components/wd-form-obj/base-form-obj.d.ts +13 -0
- package/dist/web/components/wd-form-obj/base-form-obj.js +351 -0
- package/dist/web/components/wd-form-obj/index.d.ts +4 -0
- package/dist/web/components/wd-form-obj/index.js +3 -0
- package/dist/web/components/wd-form-obj/wd-form-obj.d.ts +9 -0
- package/dist/web/components/wd-form-obj/wd-form-obj.js +7 -0
- package/dist/web/components/wd-input/wd-input.d.ts +2 -2
- package/dist/web/components/wd-input-phone/wd-input-phone.js +2 -2
- package/dist/web/components/wd-table/utils/index.js +20 -8
- package/dist/web/components/wd-table/wd-table.js +4 -2
- package/dist/web/components/wd-tabs/tabs.d.ts +1 -1
- package/dist/web/components/wd-textarea/calcTextareaHeight.d.ts +1 -0
- package/dist/web/components/wd-textarea/calcTextareaHeight.js +45 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +4 -6
- package/dist/web/components/wd-unified-link/index.js +2 -2
- package/dist/web/components/web-view/web-view.js +15 -4
- package/dist/web/utils/tool.d.ts +1 -0
- package/dist/web/utils/tool.js +4 -1
- package/dist/web/utils/widget-api/index.d.ts +20 -0
- package/dist/web/utils/widget-api/index.js +14 -0
- package/package.json +8 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { FORM_ITEM_DATA, FORM_ITEM_META, ItemData, FORM_ITEM_DATA_TITLE, } from '../type-utils/type-form';
|
|
3
|
+
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
4
|
+
const $attached_template = `
|
|
5
|
+
{{#with $self as |$self|}}
|
|
6
|
+
[attributes]
|
|
7
|
+
value = [{}]
|
|
8
|
+
|
|
9
|
+
[[template]]
|
|
10
|
+
component = "Repeater"
|
|
11
|
+
[template.attributes]
|
|
12
|
+
":data" = "($w.{{$self.id}}.value || [])"
|
|
13
|
+
suffix = '{{$self.id}}'
|
|
14
|
+
forItem = 'item_{{$self.id}}'
|
|
15
|
+
forIndex = 'index_{{$self.id}}'
|
|
16
|
+
[[template.items]]
|
|
17
|
+
component = "Container"
|
|
18
|
+
scopedStyle = ":scope {\n position: relative;\n}"
|
|
19
|
+
[[template.items.items]]
|
|
20
|
+
component = 'WdFormObj'
|
|
21
|
+
[template.items.items.attributes]
|
|
22
|
+
":label" = "\`\${$w.{{$self.id}}.label}[\${$w.index_{{$self.id}} + 1}]\`"
|
|
23
|
+
":name" = "$w.index_{{$self.id}}"
|
|
24
|
+
value = {}
|
|
25
|
+
[[template.items.items]]
|
|
26
|
+
component = 'WdIcon'
|
|
27
|
+
scopedStyle = ":scope {\n position: absolute;\n right: var(--wd-card-heder-pd-bordered);\n top: var(--wd-card-heder-pd-bordered);\n color: var(--wd-color-brand);\n}\n\n:scope.wd-mp-icon {\n top: calc(10px + var(--wd-card-heder-pd-bordered));\n}"
|
|
28
|
+
[template.items.items.attributes]
|
|
29
|
+
name = "td:delete"
|
|
30
|
+
[[template.items.items.listeners]]
|
|
31
|
+
eventName = "tap"
|
|
32
|
+
type = "platform"
|
|
33
|
+
[template.items.items.listeners.handler]
|
|
34
|
+
module = "platform"
|
|
35
|
+
name = "invoke"
|
|
36
|
+
[template.items.items.listeners.handler.params]
|
|
37
|
+
component = "{{$self.id}}"
|
|
38
|
+
method = "remove"
|
|
39
|
+
[template.items.items.listeners.handler.params.params]
|
|
40
|
+
":index" = "$w.index_{{$self.id}}"
|
|
41
|
+
|
|
42
|
+
[[template]]
|
|
43
|
+
component = 'Grid'
|
|
44
|
+
scopedStyle = ":scope {\n margin-top: 10px;\n width: 100%;\n}"
|
|
45
|
+
[[template.listeners]]
|
|
46
|
+
eventName = "tap"
|
|
47
|
+
type = "platform"
|
|
48
|
+
[template.listeners.handler]
|
|
49
|
+
module = "platform"
|
|
50
|
+
name = "invoke"
|
|
51
|
+
[template.listeners.handler.params]
|
|
52
|
+
component = "{{$self.id}}"
|
|
53
|
+
method = "add"
|
|
54
|
+
[[template.items]]
|
|
55
|
+
component = 'Row'
|
|
56
|
+
[template.items.attributes]
|
|
57
|
+
alignItems = "center"
|
|
58
|
+
[[template.items.items]]
|
|
59
|
+
component = 'Col'
|
|
60
|
+
scopedStyle = ":scope {\n flex: 0;\n}"
|
|
61
|
+
[template.items.items.attributes]
|
|
62
|
+
lgWidthType = "fit-content"
|
|
63
|
+
widthType = "fit-content"
|
|
64
|
+
[[template.items.items.items]]
|
|
65
|
+
component = 'WdIcon'
|
|
66
|
+
scopedStyle = ":scope {\n color: var(--wd-color-brand);\n}"
|
|
67
|
+
[template.items.items.items.attributes]
|
|
68
|
+
name = "td:add-circle"
|
|
69
|
+
|
|
70
|
+
[[template.items.items]]
|
|
71
|
+
component = 'Col'
|
|
72
|
+
scopedStyle = ":scope {\n flex: 0;\n}"
|
|
73
|
+
[template.items.items.attributes]
|
|
74
|
+
lgWidthType = "fit-content"
|
|
75
|
+
widthType = "fit-content"
|
|
76
|
+
[[template.items.items.items]]
|
|
77
|
+
component = 'WdText'
|
|
78
|
+
scopedStyle = ":scope {\n color: var(--wd-color-brand);\n white-space: nowrap;\n}"
|
|
79
|
+
[template.items.items.items.attributes]
|
|
80
|
+
text = "新增"
|
|
81
|
+
{{/with}}
|
|
82
|
+
`;
|
|
83
|
+
// 属性类型定义
|
|
84
|
+
const data = Type.Partial(Type.Object({
|
|
85
|
+
// 通用
|
|
86
|
+
name: Object.assign({}, FORM_ITEM_DATA.name, {
|
|
87
|
+
'x-rules': [
|
|
88
|
+
{
|
|
89
|
+
message: '必须以字母开头,仅能输入字母或下划线或点或数字',
|
|
90
|
+
pattern: '^[a-zA-Z][0-9a-zA-Z_.]*$',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
}),
|
|
94
|
+
value: FORM_ITEM_DATA._valueInFormArr,
|
|
95
|
+
size: FORM_ITEM_DATA.size,
|
|
96
|
+
// // 标题
|
|
97
|
+
...{
|
|
98
|
+
...FORM_ITEM_DATA_TITLE,
|
|
99
|
+
layout: Object.assign({}, FORM_ITEM_DATA_TITLE.layout, {
|
|
100
|
+
title: 'PC端标题位置',
|
|
101
|
+
}),
|
|
102
|
+
},
|
|
103
|
+
// 状态校验
|
|
104
|
+
status: FORM_ITEM_DATA.status,
|
|
105
|
+
}));
|
|
106
|
+
const properties = Type.Composite([
|
|
107
|
+
Type.Pick(data, ['name', 'label', 'value']),
|
|
108
|
+
Type.Pick(ItemData, ['visible', 'disabled', 'readOnly']),
|
|
109
|
+
]);
|
|
110
|
+
// export default
|
|
111
|
+
const config = defineConfig({
|
|
112
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
113
|
+
// 属性定义
|
|
114
|
+
data,
|
|
115
|
+
// 只读属性定义
|
|
116
|
+
properties,
|
|
117
|
+
// 样式API
|
|
118
|
+
classes: [
|
|
119
|
+
{
|
|
120
|
+
name: '根元素',
|
|
121
|
+
selector: '.form-obj-wrap',
|
|
122
|
+
description: '嵌套表单根元素',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'PC 端嵌套表单根元素',
|
|
126
|
+
selector: '.pc-form-obj-wrap',
|
|
127
|
+
description: '可以为 PC 端的嵌套表单编写样式',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'H5 端嵌套表单根元素',
|
|
131
|
+
selector: '.h5-form-obj-wrap',
|
|
132
|
+
description: '可以为 H5 端的嵌套表单编写样式',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: '小程序端嵌套表单根元素',
|
|
136
|
+
selector: '.mp-form-obj-wrap',
|
|
137
|
+
description: '可以为小程序端的嵌套表单编写样式',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
// 组件方法
|
|
141
|
+
methods: [
|
|
142
|
+
{
|
|
143
|
+
name: 'add',
|
|
144
|
+
label: '新增一行',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'remove',
|
|
148
|
+
label: '删除该行',
|
|
149
|
+
params: Type.Object({
|
|
150
|
+
index: Type.Number({
|
|
151
|
+
title: '删除数据的标识',
|
|
152
|
+
default: -1,
|
|
153
|
+
}),
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'change',
|
|
158
|
+
label: '值改变',
|
|
159
|
+
params: Type.Object({
|
|
160
|
+
name: Type.String({
|
|
161
|
+
title: '改变值的标识,如果name为空,则会将嵌套表单值直接赋值为进value。例如0.input1表示改变数组下标为0的对象内input1的值',
|
|
162
|
+
default: '',
|
|
163
|
+
}),
|
|
164
|
+
value: Type.Any({
|
|
165
|
+
title: '改变值的value',
|
|
166
|
+
default: '',
|
|
167
|
+
}),
|
|
168
|
+
}),
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
// 组件对外暴露事件
|
|
172
|
+
events: [
|
|
173
|
+
{
|
|
174
|
+
name: 'onDataChange',
|
|
175
|
+
title: '值改变',
|
|
176
|
+
description: '组件中的数据内容发生改变时触发',
|
|
177
|
+
detail: Type.Object({ data: Type.Array(Type.Unknown()) }),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
compConfig: {
|
|
181
|
+
isDataContainer: true,
|
|
182
|
+
componentType: 'formField',
|
|
183
|
+
},
|
|
184
|
+
isContainer: true,
|
|
185
|
+
// 组件元信息
|
|
186
|
+
meta: {
|
|
187
|
+
name: 'WdFormArr',
|
|
188
|
+
componentName: 'formArr',
|
|
189
|
+
title: '数组嵌套表单',
|
|
190
|
+
description: '数组嵌套表单',
|
|
191
|
+
icon: '../icons/Text.svg',
|
|
192
|
+
category: '表单',
|
|
193
|
+
group: FORM_ITEM_META.group,
|
|
194
|
+
visible: ['APP'],
|
|
195
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdFormArr',
|
|
196
|
+
inlineStyleForm: FORM_ITEM_META.inlineStyleForm,
|
|
197
|
+
templates: [
|
|
198
|
+
templateInitNameWithId,
|
|
199
|
+
{
|
|
200
|
+
when: '$attached',
|
|
201
|
+
body: $attached_template,
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
export default config;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Static } from '../type-utils';
|
|
2
|
+
import type { Simplify } from 'type-fest';
|
|
3
|
+
declare const data: import("@sinclair/typebox").TObject<{
|
|
4
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
5
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string> & {
|
|
6
|
+
title: string;
|
|
7
|
+
}>;
|
|
8
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
9
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
10
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
11
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
12
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
13
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
14
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
15
|
+
'x-rules': {
|
|
16
|
+
message: string;
|
|
17
|
+
pattern: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{}>, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>]>>;
|
|
21
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
22
|
+
}>;
|
|
23
|
+
export type DataType = Simplify<Static<typeof data>>;
|
|
24
|
+
declare const config: {
|
|
25
|
+
readonly $schema: "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json";
|
|
26
|
+
readonly data: import("@sinclair/typebox").TObject<{
|
|
27
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
28
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string> & {
|
|
29
|
+
title: string;
|
|
30
|
+
}>;
|
|
31
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
33
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
34
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
35
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
36
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
37
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
38
|
+
'x-rules': {
|
|
39
|
+
message: string;
|
|
40
|
+
pattern: string;
|
|
41
|
+
}[];
|
|
42
|
+
}>;
|
|
43
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{}>, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>]>>;
|
|
44
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
45
|
+
}>;
|
|
46
|
+
readonly properties: import("@sinclair/typebox").TObject<{
|
|
47
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
48
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
49
|
+
'x-rules': {
|
|
50
|
+
message: string;
|
|
51
|
+
pattern: string;
|
|
52
|
+
}[];
|
|
53
|
+
}>;
|
|
54
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{}>, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>]>>;
|
|
55
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
56
|
+
visible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
57
|
+
readOnly: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
58
|
+
}>;
|
|
59
|
+
readonly classes: readonly [{
|
|
60
|
+
readonly name: "根元素";
|
|
61
|
+
readonly selector: ".form-obj-wrap";
|
|
62
|
+
readonly description: "嵌套表单根元素";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "PC 端嵌套表单根元素";
|
|
65
|
+
readonly selector: ".pc-form-obj-wrap";
|
|
66
|
+
readonly description: "可以为 PC 端的嵌套表单编写样式";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "H5 端嵌套表单根元素";
|
|
69
|
+
readonly selector: ".h5-form-obj-wrap";
|
|
70
|
+
readonly description: "可以为 H5 端的嵌套表单编写样式";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "小程序端嵌套表单根元素";
|
|
73
|
+
readonly selector: ".mp-form-obj-wrap";
|
|
74
|
+
readonly description: "可以为小程序端的嵌套表单编写样式";
|
|
75
|
+
}];
|
|
76
|
+
readonly methods: readonly [{
|
|
77
|
+
readonly name: "change";
|
|
78
|
+
readonly label: "值改变";
|
|
79
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
80
|
+
name: import("@sinclair/typebox").TString;
|
|
81
|
+
value: import("@sinclair/typebox").TAny;
|
|
82
|
+
}>;
|
|
83
|
+
}];
|
|
84
|
+
readonly events: readonly [{
|
|
85
|
+
readonly name: "onDataChange";
|
|
86
|
+
readonly title: "值改变";
|
|
87
|
+
readonly description: "组件中的数据内容发生改变时触发";
|
|
88
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
89
|
+
data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
|
|
90
|
+
}>;
|
|
91
|
+
}];
|
|
92
|
+
readonly compConfig: {
|
|
93
|
+
readonly isDataContainer: true;
|
|
94
|
+
readonly componentType: "formField";
|
|
95
|
+
};
|
|
96
|
+
readonly isContainer: true;
|
|
97
|
+
readonly meta: {
|
|
98
|
+
readonly name: "WdFormObj";
|
|
99
|
+
readonly componentName: "formObj";
|
|
100
|
+
readonly title: "对象嵌套表单";
|
|
101
|
+
readonly description: "对象嵌套表单";
|
|
102
|
+
readonly icon: "../icons/Text.svg";
|
|
103
|
+
readonly category: "表单";
|
|
104
|
+
readonly group: {
|
|
105
|
+
标签项: {
|
|
106
|
+
'x-index': number;
|
|
107
|
+
expand: boolean;
|
|
108
|
+
};
|
|
109
|
+
通用: {
|
|
110
|
+
'x-index': number;
|
|
111
|
+
expand: boolean;
|
|
112
|
+
};
|
|
113
|
+
标题风格: {
|
|
114
|
+
'x-index': number;
|
|
115
|
+
expand: boolean;
|
|
116
|
+
};
|
|
117
|
+
输入框: {
|
|
118
|
+
'x-index': number;
|
|
119
|
+
expand: boolean;
|
|
120
|
+
};
|
|
121
|
+
标签风格: {
|
|
122
|
+
'x-index': number;
|
|
123
|
+
expand: boolean;
|
|
124
|
+
};
|
|
125
|
+
选择框: {
|
|
126
|
+
'x-index': number;
|
|
127
|
+
expand: boolean;
|
|
128
|
+
};
|
|
129
|
+
内容: {
|
|
130
|
+
'x-index': number;
|
|
131
|
+
expand: boolean;
|
|
132
|
+
};
|
|
133
|
+
图片内容: {
|
|
134
|
+
'x-index': number;
|
|
135
|
+
expand: boolean;
|
|
136
|
+
};
|
|
137
|
+
文件内容: {
|
|
138
|
+
'x-index': number;
|
|
139
|
+
expand: boolean;
|
|
140
|
+
};
|
|
141
|
+
地图内容: {
|
|
142
|
+
'x-index': number;
|
|
143
|
+
expand: boolean;
|
|
144
|
+
};
|
|
145
|
+
开关按钮: {
|
|
146
|
+
'x-index': number;
|
|
147
|
+
expand: boolean;
|
|
148
|
+
};
|
|
149
|
+
小程序能力: {
|
|
150
|
+
'x-index': number;
|
|
151
|
+
expand: boolean;
|
|
152
|
+
};
|
|
153
|
+
'\u72B6\u6001/\u6821\u9A8C': {
|
|
154
|
+
'x-index': number;
|
|
155
|
+
expand: boolean;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
readonly visible: readonly ["APP"];
|
|
159
|
+
readonly docsUrl: "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdFormObj";
|
|
160
|
+
readonly inlineStyleForm: {
|
|
161
|
+
$text: {
|
|
162
|
+
visible: boolean;
|
|
163
|
+
};
|
|
164
|
+
justifyContent: {
|
|
165
|
+
visible: boolean;
|
|
166
|
+
};
|
|
167
|
+
flexDirection: {
|
|
168
|
+
visible: boolean;
|
|
169
|
+
};
|
|
170
|
+
alignItems: {
|
|
171
|
+
visible: boolean;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly templates: readonly [{
|
|
175
|
+
readonly when: "$attached";
|
|
176
|
+
readonly body: "\n [attributes]\n name = \"{{$self.id}}\"\n ";
|
|
177
|
+
readonly __k: "init-name-with-id";
|
|
178
|
+
}];
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export default config;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { FORM_ITEM_DATA, FORM_ITEM_META, ItemData, FORM_ITEM_DATA_TITLE, } from '../type-utils/type-form';
|
|
3
|
+
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
4
|
+
// 属性类型定义
|
|
5
|
+
const data = Type.Partial(Type.Object({
|
|
6
|
+
// 通用
|
|
7
|
+
name: Object.assign({}, FORM_ITEM_DATA.name, {
|
|
8
|
+
'x-rules': [
|
|
9
|
+
{
|
|
10
|
+
message: '必须以字母开头,仅能输入字母或下划线或点或数字',
|
|
11
|
+
pattern: '^[a-zA-Z][0-9a-zA-Z_.]*$',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}),
|
|
15
|
+
value: FORM_ITEM_DATA._valueInFormObj,
|
|
16
|
+
size: FORM_ITEM_DATA.size,
|
|
17
|
+
// 标题
|
|
18
|
+
...{
|
|
19
|
+
...FORM_ITEM_DATA_TITLE,
|
|
20
|
+
layout: Object.assign({}, FORM_ITEM_DATA_TITLE.layout, {
|
|
21
|
+
title: 'PC端标题位置',
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
// 状态校验
|
|
25
|
+
status: FORM_ITEM_DATA.status,
|
|
26
|
+
}));
|
|
27
|
+
const properties = Type.Composite([
|
|
28
|
+
Type.Pick(data, ['name', 'label', 'value']),
|
|
29
|
+
Type.Pick(ItemData, ['visible', 'disabled', 'readOnly']),
|
|
30
|
+
]);
|
|
31
|
+
// export default
|
|
32
|
+
const config = defineConfig({
|
|
33
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
34
|
+
// 属性定义
|
|
35
|
+
data,
|
|
36
|
+
// 只读属性定义
|
|
37
|
+
properties,
|
|
38
|
+
// 样式API
|
|
39
|
+
classes: [
|
|
40
|
+
{
|
|
41
|
+
name: '根元素',
|
|
42
|
+
selector: '.form-obj-wrap',
|
|
43
|
+
description: '嵌套表单根元素',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'PC 端嵌套表单根元素',
|
|
47
|
+
selector: '.pc-form-obj-wrap',
|
|
48
|
+
description: '可以为 PC 端的嵌套表单编写样式',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'H5 端嵌套表单根元素',
|
|
52
|
+
selector: '.h5-form-obj-wrap',
|
|
53
|
+
description: '可以为 H5 端的嵌套表单编写样式',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: '小程序端嵌套表单根元素',
|
|
57
|
+
selector: '.mp-form-obj-wrap',
|
|
58
|
+
description: '可以为小程序端的嵌套表单编写样式',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
// 组件方法
|
|
62
|
+
methods: [
|
|
63
|
+
{
|
|
64
|
+
name: 'change',
|
|
65
|
+
label: '值改变',
|
|
66
|
+
params: Type.Object({
|
|
67
|
+
name: Type.String({
|
|
68
|
+
title: '改变值的标识,如果name为空,则会将嵌套表单值直接赋值为进value',
|
|
69
|
+
default: '',
|
|
70
|
+
}),
|
|
71
|
+
value: Type.Any({
|
|
72
|
+
title: '改变值的value',
|
|
73
|
+
default: '',
|
|
74
|
+
}),
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
// 组件对外暴露事件
|
|
79
|
+
events: [
|
|
80
|
+
{
|
|
81
|
+
name: 'onDataChange',
|
|
82
|
+
title: '值改变',
|
|
83
|
+
description: '组件中的数据内容发生改变时触发',
|
|
84
|
+
detail: Type.Object({ data: Type.Array(Type.Unknown()) }),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
compConfig: {
|
|
88
|
+
isDataContainer: true,
|
|
89
|
+
componentType: 'formField',
|
|
90
|
+
},
|
|
91
|
+
isContainer: true,
|
|
92
|
+
// 组件元信息
|
|
93
|
+
meta: {
|
|
94
|
+
name: 'WdFormObj',
|
|
95
|
+
componentName: 'formObj',
|
|
96
|
+
title: '对象嵌套表单',
|
|
97
|
+
description: '对象嵌套表单',
|
|
98
|
+
icon: '../icons/Text.svg',
|
|
99
|
+
category: '表单',
|
|
100
|
+
group: FORM_ITEM_META.group,
|
|
101
|
+
visible: ['APP'],
|
|
102
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdFormObj',
|
|
103
|
+
inlineStyleForm: FORM_ITEM_META.inlineStyleForm,
|
|
104
|
+
templates: [templateInitNameWithId],
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
export default config;
|
|
@@ -42,7 +42,7 @@ declare const data: import("@sinclair/typebox").TObject<{
|
|
|
42
42
|
isDisabledSubmit: import("@sinclair/typebox").TBoolean;
|
|
43
43
|
formType: import("@sinclair/typebox").TUnsafe<"create" | "edit" | "read">;
|
|
44
44
|
formType_bind: import("@sinclair/typebox").TBoolean;
|
|
45
|
-
datasourceType: import("@sinclair/typebox").TUnsafe<"connector" | "
|
|
45
|
+
datasourceType: import("@sinclair/typebox").TUnsafe<"connector" | "model" | "expression" | "custom-connector">;
|
|
46
46
|
dataSourceName: import("@sinclair/typebox").TString;
|
|
47
47
|
value: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
|
|
48
48
|
_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -84,7 +84,7 @@ declare const _default: {
|
|
|
84
84
|
isDisabledSubmit: import("@sinclair/typebox").TBoolean;
|
|
85
85
|
formType: import("@sinclair/typebox").TUnsafe<"create" | "edit" | "read">;
|
|
86
86
|
formType_bind: import("@sinclair/typebox").TBoolean;
|
|
87
|
-
datasourceType: import("@sinclair/typebox").TUnsafe<"connector" | "
|
|
87
|
+
datasourceType: import("@sinclair/typebox").TUnsafe<"connector" | "model" | "expression" | "custom-connector">;
|
|
88
88
|
dataSourceName: import("@sinclair/typebox").TString;
|
|
89
89
|
value: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
|
|
90
90
|
_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
@@ -81,7 +81,7 @@ const data = Type.Object({
|
|
|
81
81
|
type: 'boolean',
|
|
82
82
|
'x-runtime-default': true,
|
|
83
83
|
description: '仅小程序端有效',
|
|
84
|
-
'x-helper-text': '
|
|
84
|
+
'x-helper-text': '长按图片显示发送给朋友、收藏、保存图片、搜一搜、识别码菜单。支持识别:小程序码、微信/企微个人码、微信群码、公众号二维码。注:该功能需要直接长按图片组件,若开启了“点击预览大图”并且弹出大图,长按大图无效',
|
|
85
85
|
'x-category': '高级属性',
|
|
86
86
|
'x-index': 6,
|
|
87
87
|
})),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Static } from '../type-utils';
|
|
2
2
|
import type { Simplify } from 'type-fest';
|
|
3
3
|
declare const data: import("@sinclair/typebox").TObject<{
|
|
4
|
-
dataSourceType: import("@sinclair/typebox").TUnsafe<"custom-connector" | "data-model"
|
|
4
|
+
dataSourceType: import("@sinclair/typebox").TUnsafe<"expression" | "custom-connector" | "data-model">;
|
|
5
5
|
bindMetadata: import("@sinclair/typebox").TObject<{
|
|
6
6
|
datasource: import("@sinclair/typebox").TObject<{
|
|
7
7
|
title: import("@sinclair/typebox").TString;
|
|
@@ -98,7 +98,7 @@ export type DataType = Simplify<Static<typeof data>>;
|
|
|
98
98
|
declare const config: {
|
|
99
99
|
readonly $schema: "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json";
|
|
100
100
|
readonly data: import("@sinclair/typebox").TObject<{
|
|
101
|
-
dataSourceType: import("@sinclair/typebox").TUnsafe<"custom-connector" | "data-model"
|
|
101
|
+
dataSourceType: import("@sinclair/typebox").TUnsafe<"expression" | "custom-connector" | "data-model">;
|
|
102
102
|
bindMetadata: import("@sinclair/typebox").TObject<{
|
|
103
103
|
datasource: import("@sinclair/typebox").TObject<{
|
|
104
104
|
title: import("@sinclair/typebox").TString;
|
|
@@ -200,7 +200,7 @@ declare const config: {
|
|
|
200
200
|
}>;
|
|
201
201
|
sort: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>;
|
|
202
202
|
pageNo: import("@sinclair/typebox").TNumber;
|
|
203
|
-
dataSourceType: import("@sinclair/typebox").TUnsafe<"custom-connector" | "data-model"
|
|
203
|
+
dataSourceType: import("@sinclair/typebox").TUnsafe<"expression" | "custom-connector" | "data-model">;
|
|
204
204
|
pageSize: import("@sinclair/typebox").TNumber;
|
|
205
205
|
dataSourceData: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{}>>>;
|
|
206
206
|
total: import("@sinclair/typebox").TNumber;
|
|
@@ -109,6 +109,7 @@ declare const config: {
|
|
|
109
109
|
} | {
|
|
110
110
|
detail: import("@sinclair/typebox").TObject<{
|
|
111
111
|
value: import("@sinclair/typebox").TUnknown;
|
|
112
|
+
isDelete: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
112
113
|
}>;
|
|
113
114
|
name: string;
|
|
114
115
|
title: string;
|
|
@@ -76,7 +76,10 @@ const classes = [
|
|
|
76
76
|
CLASSES.item_error,
|
|
77
77
|
CLASSES.item_help,
|
|
78
78
|
];
|
|
79
|
-
const paramValueType = Type.Object({
|
|
79
|
+
const paramValueType = Type.Object({
|
|
80
|
+
value: Type.Unknown({ title: '值' }),
|
|
81
|
+
isDelete: Type.Optional(Type.Boolean({ title: '是否删除动作' })),
|
|
82
|
+
});
|
|
80
83
|
// export default
|
|
81
84
|
const config = defineConfig({
|
|
82
85
|
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
@@ -49,6 +49,7 @@ export type EventsType = {
|
|
|
49
49
|
}) => void;
|
|
50
50
|
change: (arg: {
|
|
51
51
|
value: unknown;
|
|
52
|
+
isDelete?: boolean;
|
|
52
53
|
}) => void;
|
|
53
54
|
error: (err: unknown) => void;
|
|
54
55
|
}>;
|
|
@@ -119,6 +120,7 @@ declare const config: {
|
|
|
119
120
|
} | {
|
|
120
121
|
detail: import("@sinclair/typebox").TObject<{
|
|
121
122
|
value: import("@sinclair/typebox").TUnknown;
|
|
123
|
+
isDelete: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
122
124
|
}>;
|
|
123
125
|
name: string;
|
|
124
126
|
title: string;
|
|
@@ -105,7 +105,10 @@ const data = Type.Partial(Type.Object({
|
|
|
105
105
|
},
|
|
106
106
|
}),
|
|
107
107
|
}));
|
|
108
|
-
const paramValueType = Type.Object({
|
|
108
|
+
const paramValueType = Type.Object({
|
|
109
|
+
value: Type.Unknown({ title: '值' }),
|
|
110
|
+
isDelete: Type.Optional(Type.Boolean({ title: '是否删除动作' })),
|
|
111
|
+
});
|
|
109
112
|
const events = [
|
|
110
113
|
{ ...{}, ...FORM_ITEM_EVENTS.change, detail: paramValueType },
|
|
111
114
|
FORM_ITEM_EVENTS.success,
|
|
@@ -48,7 +48,26 @@ declare const config: {
|
|
|
48
48
|
readonly selector: ".wd-mp-web-view";
|
|
49
49
|
readonly description: "可以为小程序端的网页嵌套编写样式";
|
|
50
50
|
}];
|
|
51
|
-
readonly methods: readonly [
|
|
51
|
+
readonly methods: readonly [{
|
|
52
|
+
readonly name: "postMessage";
|
|
53
|
+
readonly label: "发送消息";
|
|
54
|
+
readonly description: "向页面发送消息";
|
|
55
|
+
readonly params: {
|
|
56
|
+
readonly properties: {
|
|
57
|
+
readonly message: {
|
|
58
|
+
readonly title: "消息内容";
|
|
59
|
+
};
|
|
60
|
+
readonly targetorigin: {
|
|
61
|
+
readonly title: "targetorigin";
|
|
62
|
+
readonly description: "web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件";
|
|
63
|
+
};
|
|
64
|
+
readonly transfer: {
|
|
65
|
+
readonly title: "transfer";
|
|
66
|
+
readonly description: "是一串和 message 同时传递的 Transferable 对象。web端参数。";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}];
|
|
52
71
|
readonly events: [{
|
|
53
72
|
readonly name: "load";
|
|
54
73
|
readonly title: "网页加载成功";
|
|
@@ -78,7 +78,28 @@ const config = defineConfig({
|
|
|
78
78
|
},
|
|
79
79
|
],
|
|
80
80
|
// 组件方法
|
|
81
|
-
methods: [
|
|
81
|
+
methods: [
|
|
82
|
+
{
|
|
83
|
+
name: 'postMessage',
|
|
84
|
+
label: '发送消息',
|
|
85
|
+
description: '向页面发送消息',
|
|
86
|
+
params: {
|
|
87
|
+
properties: {
|
|
88
|
+
message: {
|
|
89
|
+
title: '消息内容',
|
|
90
|
+
},
|
|
91
|
+
targetorigin: {
|
|
92
|
+
title: 'targetorigin',
|
|
93
|
+
description: 'web端通过窗口的 origin 属性来指定哪些窗口能接收到消息事件',
|
|
94
|
+
},
|
|
95
|
+
transfer: {
|
|
96
|
+
title: 'transfer',
|
|
97
|
+
description: '是一串和 message 同时传递的 Transferable 对象。web端参数。',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
82
103
|
// 组件对外暴露事件
|
|
83
104
|
events,
|
|
84
105
|
// 组件元信息
|