@cloudbase/weda-ui 3.6.2 → 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,245 @@
|
|
|
1
|
+
import { Static } from '../type-utils';
|
|
2
|
+
import type { Simplify } from 'type-fest';
|
|
3
|
+
declare const data: import("@sinclair/typebox").TObject<{
|
|
4
|
+
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
|
+
focus: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
6
|
+
borderedH5: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
7
|
+
rules: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
8
|
+
format: import("@sinclair/typebox").TString;
|
|
9
|
+
message: import("@sinclair/typebox").TString;
|
|
10
|
+
pattern: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
}>>>;
|
|
12
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
13
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
14
|
+
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
16
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
18
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
19
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
20
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
21
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
22
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
23
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
24
|
+
default: string;
|
|
25
|
+
}>;
|
|
26
|
+
language: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
27
|
+
theme: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
28
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
30
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
31
|
+
}>;
|
|
32
|
+
declare const config: {
|
|
33
|
+
readonly $schema: "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json";
|
|
34
|
+
readonly data: import("@sinclair/typebox").TObject<{
|
|
35
|
+
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
36
|
+
focus: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
37
|
+
borderedH5: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
38
|
+
rules: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
39
|
+
format: import("@sinclair/typebox").TString;
|
|
40
|
+
message: import("@sinclair/typebox").TString;
|
|
41
|
+
pattern: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
42
|
+
}>>>;
|
|
43
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
44
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
45
|
+
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
46
|
+
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
47
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
48
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
49
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
50
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
51
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
52
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
53
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
54
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
55
|
+
default: string;
|
|
56
|
+
}>;
|
|
57
|
+
language: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
58
|
+
theme: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
59
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
60
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
61
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly properties: import("@sinclair/typebox").TObject<{
|
|
64
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
65
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
66
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
67
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
68
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
69
|
+
visible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
70
|
+
readOnly: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
71
|
+
}>;
|
|
72
|
+
readonly classes: readonly {
|
|
73
|
+
name: string;
|
|
74
|
+
selector: string;
|
|
75
|
+
description: string;
|
|
76
|
+
}[];
|
|
77
|
+
readonly methods: readonly [{
|
|
78
|
+
name: string;
|
|
79
|
+
label: string;
|
|
80
|
+
params: {
|
|
81
|
+
properties: {
|
|
82
|
+
value: {
|
|
83
|
+
title: string;
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
description: string;
|
|
89
|
+
}, {
|
|
90
|
+
name: string;
|
|
91
|
+
label: string;
|
|
92
|
+
params: {
|
|
93
|
+
properties: {
|
|
94
|
+
value: {
|
|
95
|
+
title: string;
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
description: string;
|
|
101
|
+
}, {
|
|
102
|
+
name: string;
|
|
103
|
+
label: string;
|
|
104
|
+
params: {
|
|
105
|
+
properties: {
|
|
106
|
+
value: {
|
|
107
|
+
title: string;
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
description: string;
|
|
113
|
+
}, {
|
|
114
|
+
name: string;
|
|
115
|
+
label: string;
|
|
116
|
+
description: string;
|
|
117
|
+
}, {
|
|
118
|
+
name: string;
|
|
119
|
+
label: string;
|
|
120
|
+
params: {
|
|
121
|
+
properties: {
|
|
122
|
+
value: {
|
|
123
|
+
title: string;
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
description: string;
|
|
129
|
+
}, {
|
|
130
|
+
name: string;
|
|
131
|
+
label: string;
|
|
132
|
+
description: string;
|
|
133
|
+
}, {
|
|
134
|
+
name: string;
|
|
135
|
+
label: string;
|
|
136
|
+
description: string;
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "format";
|
|
139
|
+
readonly label: "js格式化";
|
|
140
|
+
readonly description: "目前仅支持js格式化组件值";
|
|
141
|
+
}];
|
|
142
|
+
readonly events: readonly [{
|
|
143
|
+
name: string;
|
|
144
|
+
title: string;
|
|
145
|
+
detail: import("@sinclair/typebox").TObject<{
|
|
146
|
+
value: import("@sinclair/typebox").TString;
|
|
147
|
+
}>;
|
|
148
|
+
description: string;
|
|
149
|
+
}];
|
|
150
|
+
readonly meta: {
|
|
151
|
+
readonly description: "用于代码编辑。";
|
|
152
|
+
readonly figureIcon: "../figureIcons/WdTextarea.svg";
|
|
153
|
+
readonly icon: "../icons/TextArea.svg";
|
|
154
|
+
readonly title: "代码编辑器";
|
|
155
|
+
readonly name: "WdCodeEditor";
|
|
156
|
+
readonly componentName: "CodeEditor";
|
|
157
|
+
readonly categoryOrder: 500;
|
|
158
|
+
readonly componentOrder: 360;
|
|
159
|
+
readonly docsUrl: "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdCodeEditor";
|
|
160
|
+
readonly category: string;
|
|
161
|
+
readonly shortcut: {
|
|
162
|
+
props: string[];
|
|
163
|
+
};
|
|
164
|
+
readonly group: {
|
|
165
|
+
标签项: {
|
|
166
|
+
'x-index': number;
|
|
167
|
+
expand: boolean;
|
|
168
|
+
};
|
|
169
|
+
通用: {
|
|
170
|
+
'x-index': number;
|
|
171
|
+
expand: boolean;
|
|
172
|
+
};
|
|
173
|
+
标题风格: {
|
|
174
|
+
'x-index': number;
|
|
175
|
+
expand: boolean;
|
|
176
|
+
};
|
|
177
|
+
输入框: {
|
|
178
|
+
'x-index': number;
|
|
179
|
+
expand: boolean;
|
|
180
|
+
};
|
|
181
|
+
标签风格: {
|
|
182
|
+
'x-index': number;
|
|
183
|
+
expand: boolean;
|
|
184
|
+
};
|
|
185
|
+
选择框: {
|
|
186
|
+
'x-index': number;
|
|
187
|
+
expand: boolean;
|
|
188
|
+
};
|
|
189
|
+
内容: {
|
|
190
|
+
'x-index': number;
|
|
191
|
+
expand: boolean;
|
|
192
|
+
};
|
|
193
|
+
图片内容: {
|
|
194
|
+
'x-index': number;
|
|
195
|
+
expand: boolean;
|
|
196
|
+
};
|
|
197
|
+
文件内容: {
|
|
198
|
+
'x-index': number;
|
|
199
|
+
expand: boolean;
|
|
200
|
+
};
|
|
201
|
+
地图内容: {
|
|
202
|
+
'x-index': number;
|
|
203
|
+
expand: boolean;
|
|
204
|
+
};
|
|
205
|
+
开关按钮: {
|
|
206
|
+
'x-index': number;
|
|
207
|
+
expand: boolean;
|
|
208
|
+
};
|
|
209
|
+
小程序能力: {
|
|
210
|
+
'x-index': number;
|
|
211
|
+
expand: boolean;
|
|
212
|
+
};
|
|
213
|
+
'\u72B6\u6001/\u6821\u9A8C': {
|
|
214
|
+
'x-index': number;
|
|
215
|
+
expand: boolean;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
readonly visible: any;
|
|
219
|
+
readonly inlineStyleForm: {
|
|
220
|
+
$text: {
|
|
221
|
+
visible: boolean;
|
|
222
|
+
};
|
|
223
|
+
justifyContent: {
|
|
224
|
+
visible: boolean;
|
|
225
|
+
};
|
|
226
|
+
flexDirection: {
|
|
227
|
+
visible: boolean;
|
|
228
|
+
};
|
|
229
|
+
alignItems: {
|
|
230
|
+
visible: boolean;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly templates: readonly [{
|
|
234
|
+
readonly when: "$attached";
|
|
235
|
+
readonly body: "\n [attributes]\n name = \"{{$self.id}}\"\n ";
|
|
236
|
+
readonly __k: "init-name-with-id";
|
|
237
|
+
}];
|
|
238
|
+
readonly platform: readonly ["MOBILEWEB", "PCWEB"];
|
|
239
|
+
};
|
|
240
|
+
readonly compConfig: {
|
|
241
|
+
readonly componentType: "formField";
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
export default config;
|
|
245
|
+
export type DataType = Simplify<Static<typeof data>>;
|
|
@@ -0,0 +1,92 @@
|
|
|
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, ItemData, } from '../type-utils/type-form';
|
|
3
|
+
import { getClasses } from '../type-utils/classes';
|
|
4
|
+
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
5
|
+
// 属性类型定义
|
|
6
|
+
const data = Type.Partial(Type.Object({
|
|
7
|
+
// 通用
|
|
8
|
+
name: Object.assign({}, FORM_ITEM_DATA.name, { default: 'formCodeEditor' }),
|
|
9
|
+
language: FORM_ITEM_DATA.language,
|
|
10
|
+
theme: FORM_ITEM_DATA.theme,
|
|
11
|
+
value: FORM_ITEM_DATA.value,
|
|
12
|
+
placeholder: FORM_ITEM_DATA.placeholder,
|
|
13
|
+
size: FORM_ITEM_DATA.size,
|
|
14
|
+
// 标题
|
|
15
|
+
...FORM_ITEM_DATA_TITLE,
|
|
16
|
+
// 输入框
|
|
17
|
+
extra: FORM_ITEM_DATA.extra,
|
|
18
|
+
focus: FORM_ITEM_DATA.focus,
|
|
19
|
+
borderedH5: FORM_ITEM_DATA.borderedH5,
|
|
20
|
+
// 状态校验
|
|
21
|
+
rules: FORM_ITEM_DATA.rules,
|
|
22
|
+
status: FORM_ITEM_DATA.status,
|
|
23
|
+
required: FORM_ITEM_DATA.required,
|
|
24
|
+
requiredMsg: FORM_ITEM_DATA.requiredMsg,
|
|
25
|
+
requiredFlag: FORM_ITEM_DATA.requiredFlag,
|
|
26
|
+
}));
|
|
27
|
+
const properties = Type.Pick(ItemData, [
|
|
28
|
+
'name',
|
|
29
|
+
'label',
|
|
30
|
+
'required',
|
|
31
|
+
'value',
|
|
32
|
+
'visible',
|
|
33
|
+
'disabled',
|
|
34
|
+
'readOnly',
|
|
35
|
+
]);
|
|
36
|
+
const CLASSES = getClasses('codeEditor');
|
|
37
|
+
const classes = [
|
|
38
|
+
CLASSES.root,
|
|
39
|
+
CLASSES.root_h5,
|
|
40
|
+
CLASSES.root_pc,
|
|
41
|
+
CLASSES.item_label,
|
|
42
|
+
CLASSES.item_control,
|
|
43
|
+
CLASSES.input_edit,
|
|
44
|
+
CLASSES.item_error,
|
|
45
|
+
CLASSES.item_help,
|
|
46
|
+
CLASSES.input_disabled,
|
|
47
|
+
CLASSES.item_readonly,
|
|
48
|
+
];
|
|
49
|
+
// export default
|
|
50
|
+
const config = defineConfig({
|
|
51
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
52
|
+
data,
|
|
53
|
+
properties,
|
|
54
|
+
classes: [...classes],
|
|
55
|
+
methods: [
|
|
56
|
+
FORM_ITEM_METHODS.setValue,
|
|
57
|
+
FORM_ITEM_METHODS.setVisible,
|
|
58
|
+
FORM_ITEM_METHODS.setDisabled,
|
|
59
|
+
FORM_ITEM_METHODS.clearValue,
|
|
60
|
+
FORM_ITEM_METHODS.setReadOnly,
|
|
61
|
+
FORM_ITEM_METHODS.handleValidate,
|
|
62
|
+
FORM_ITEM_METHODS.clearValidate,
|
|
63
|
+
{
|
|
64
|
+
name: 'format',
|
|
65
|
+
label: 'js格式化',
|
|
66
|
+
description: '目前仅支持js格式化组件值',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
events: [FORM_ITEM_EVENTS.change],
|
|
70
|
+
meta: {
|
|
71
|
+
description: '用于代码编辑。',
|
|
72
|
+
figureIcon: '../figureIcons/WdTextarea.svg',
|
|
73
|
+
icon: '../icons/TextArea.svg',
|
|
74
|
+
title: '代码编辑器',
|
|
75
|
+
name: 'WdCodeEditor',
|
|
76
|
+
componentName: 'CodeEditor',
|
|
77
|
+
categoryOrder: 500,
|
|
78
|
+
componentOrder: 360,
|
|
79
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdCodeEditor',
|
|
80
|
+
category: FORM_ITEM_META.category,
|
|
81
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
82
|
+
group: FORM_ITEM_META.group,
|
|
83
|
+
visible: FORM_ITEM_META.visible,
|
|
84
|
+
inlineStyleForm: FORM_ITEM_META.inlineStyleForm,
|
|
85
|
+
templates: [templateInitNameWithId],
|
|
86
|
+
platform: ['MOBILEWEB', 'PCWEB'],
|
|
87
|
+
},
|
|
88
|
+
compConfig: {
|
|
89
|
+
componentType: 'formField',
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
export default config;
|
|
@@ -0,0 +1,193 @@
|
|
|
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").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").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").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: "add";
|
|
78
|
+
readonly label: "新增一行";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "remove";
|
|
81
|
+
readonly label: "删除该行";
|
|
82
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
83
|
+
index: import("@sinclair/typebox").TNumber;
|
|
84
|
+
}>;
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "change";
|
|
87
|
+
readonly label: "值改变";
|
|
88
|
+
readonly params: import("@sinclair/typebox").TObject<{
|
|
89
|
+
name: import("@sinclair/typebox").TString;
|
|
90
|
+
value: import("@sinclair/typebox").TAny;
|
|
91
|
+
}>;
|
|
92
|
+
}];
|
|
93
|
+
readonly events: readonly [{
|
|
94
|
+
readonly name: "onDataChange";
|
|
95
|
+
readonly title: "值改变";
|
|
96
|
+
readonly description: "组件中的数据内容发生改变时触发";
|
|
97
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
98
|
+
data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>;
|
|
99
|
+
}>;
|
|
100
|
+
}];
|
|
101
|
+
readonly compConfig: {
|
|
102
|
+
readonly isDataContainer: true;
|
|
103
|
+
readonly componentType: "formField";
|
|
104
|
+
};
|
|
105
|
+
readonly isContainer: true;
|
|
106
|
+
readonly meta: {
|
|
107
|
+
readonly name: "WdFormArr";
|
|
108
|
+
readonly componentName: "formArr";
|
|
109
|
+
readonly title: "数组嵌套表单";
|
|
110
|
+
readonly description: "数组嵌套表单";
|
|
111
|
+
readonly icon: "../icons/Text.svg";
|
|
112
|
+
readonly category: "表单";
|
|
113
|
+
readonly group: {
|
|
114
|
+
标签项: {
|
|
115
|
+
'x-index': number;
|
|
116
|
+
expand: boolean;
|
|
117
|
+
};
|
|
118
|
+
通用: {
|
|
119
|
+
'x-index': number;
|
|
120
|
+
expand: boolean;
|
|
121
|
+
};
|
|
122
|
+
标题风格: {
|
|
123
|
+
'x-index': number;
|
|
124
|
+
expand: boolean;
|
|
125
|
+
};
|
|
126
|
+
输入框: {
|
|
127
|
+
'x-index': number;
|
|
128
|
+
expand: boolean;
|
|
129
|
+
};
|
|
130
|
+
标签风格: {
|
|
131
|
+
'x-index': number;
|
|
132
|
+
expand: boolean;
|
|
133
|
+
};
|
|
134
|
+
选择框: {
|
|
135
|
+
'x-index': number;
|
|
136
|
+
expand: boolean;
|
|
137
|
+
};
|
|
138
|
+
内容: {
|
|
139
|
+
'x-index': number;
|
|
140
|
+
expand: boolean;
|
|
141
|
+
};
|
|
142
|
+
图片内容: {
|
|
143
|
+
'x-index': number;
|
|
144
|
+
expand: boolean;
|
|
145
|
+
};
|
|
146
|
+
文件内容: {
|
|
147
|
+
'x-index': number;
|
|
148
|
+
expand: boolean;
|
|
149
|
+
};
|
|
150
|
+
地图内容: {
|
|
151
|
+
'x-index': number;
|
|
152
|
+
expand: boolean;
|
|
153
|
+
};
|
|
154
|
+
开关按钮: {
|
|
155
|
+
'x-index': number;
|
|
156
|
+
expand: boolean;
|
|
157
|
+
};
|
|
158
|
+
小程序能力: {
|
|
159
|
+
'x-index': number;
|
|
160
|
+
expand: boolean;
|
|
161
|
+
};
|
|
162
|
+
'\u72B6\u6001/\u6821\u9A8C': {
|
|
163
|
+
'x-index': number;
|
|
164
|
+
expand: boolean;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
readonly visible: readonly ["APP"];
|
|
168
|
+
readonly docsUrl: "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdFormArr";
|
|
169
|
+
readonly inlineStyleForm: {
|
|
170
|
+
$text: {
|
|
171
|
+
visible: boolean;
|
|
172
|
+
};
|
|
173
|
+
justifyContent: {
|
|
174
|
+
visible: boolean;
|
|
175
|
+
};
|
|
176
|
+
flexDirection: {
|
|
177
|
+
visible: boolean;
|
|
178
|
+
};
|
|
179
|
+
alignItems: {
|
|
180
|
+
visible: boolean;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
readonly templates: readonly [{
|
|
184
|
+
readonly when: "$attached";
|
|
185
|
+
readonly body: "\n [attributes]\n name = \"{{$self.id}}\"\n ";
|
|
186
|
+
readonly __k: "init-name-with-id";
|
|
187
|
+
}, {
|
|
188
|
+
readonly when: "$attached";
|
|
189
|
+
readonly body: "\n{{#with $self as |$self|}}\n[attributes]\nvalue = [{}]\n\n[[template]]\ncomponent = \"Repeater\"\n[template.attributes]\n\":data\" = \"($w.{{$self.id}}.value || [])\"\nsuffix = '{{$self.id}}'\nforItem = 'item_{{$self.id}}'\nforIndex = 'index_{{$self.id}}'\n[[template.items]]\ncomponent = \"Container\"\nscopedStyle = \":scope {\n position: relative;\n}\"\n[[template.items.items]]\ncomponent = 'WdFormObj'\n[template.items.items.attributes]\n\":label\" = \"`${$w.{{$self.id}}.label}[${$w.index_{{$self.id}} + 1}]`\"\n\":name\" = \"$w.index_{{$self.id}}\"\nvalue = {}\n[[template.items.items]]\ncomponent = 'WdIcon'\nscopedStyle = \":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}\"\n[template.items.items.attributes]\nname = \"td:delete\"\n[[template.items.items.listeners]]\neventName = \"tap\"\ntype = \"platform\"\n[template.items.items.listeners.handler]\nmodule = \"platform\"\nname = \"invoke\"\n[template.items.items.listeners.handler.params]\ncomponent = \"{{$self.id}}\"\nmethod = \"remove\"\n[template.items.items.listeners.handler.params.params]\n\":index\" = \"$w.index_{{$self.id}}\"\n\n[[template]]\ncomponent = 'Grid'\nscopedStyle = \":scope {\n margin-top: 10px;\n width: 100%;\n}\"\n[[template.listeners]]\neventName = \"tap\"\ntype = \"platform\"\n[template.listeners.handler]\nmodule = \"platform\"\nname = \"invoke\"\n[template.listeners.handler.params]\ncomponent = \"{{$self.id}}\"\nmethod = \"add\"\n[[template.items]]\ncomponent = 'Row'\n[template.items.attributes]\nalignItems = \"center\"\n[[template.items.items]]\ncomponent = 'Col'\nscopedStyle = \":scope {\n flex: 0;\n}\"\n[template.items.items.attributes]\nlgWidthType = \"fit-content\"\nwidthType = \"fit-content\"\n[[template.items.items.items]]\ncomponent = 'WdIcon'\nscopedStyle = \":scope {\n color: var(--wd-color-brand);\n}\"\n[template.items.items.items.attributes]\nname = \"td:add-circle\"\n\n[[template.items.items]]\ncomponent = 'Col'\nscopedStyle = \":scope {\n flex: 0;\n}\"\n[template.items.items.attributes]\nlgWidthType = \"fit-content\"\nwidthType = \"fit-content\"\n[[template.items.items.items]]\ncomponent = 'WdText'\nscopedStyle = \":scope {\n color: var(--wd-color-brand);\n white-space: nowrap;\n}\"\n[template.items.items.items.attributes]\ntext = \"新增\"\n{{/with}}\n";
|
|
190
|
+
}];
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export default config;
|