@cloudbase/weda-ui 3.6.5 → 3.7.2
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-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/navigationBar/common.js +1 -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-tabs/tabs.d.ts +1 -1
- 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,276 @@
|
|
|
1
|
+
import { Static } from '../type-utils';
|
|
2
|
+
import type { Simplify } from 'type-fest';
|
|
3
|
+
declare const data: import("@sinclair/typebox").TObject<{
|
|
4
|
+
suffixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
5
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
6
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
7
|
+
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
9
|
+
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
|
+
prefixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
13
|
+
prefixIcon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
14
|
+
prefixSrc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
|
+
suffixIcon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
16
|
+
suffixSrc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
+
clearable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
18
|
+
borderedH5: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
19
|
+
borderedPc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
20
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
21
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
22
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
23
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
24
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
25
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
26
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
27
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
28
|
+
'x-index': number;
|
|
29
|
+
}>;
|
|
30
|
+
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRecursive<import("@sinclair/typebox").TObject<{
|
|
31
|
+
label: import("@sinclair/typebox").TString;
|
|
32
|
+
value: import("@sinclair/typebox").TString;
|
|
33
|
+
isLeaf: import("@sinclair/typebox").TBoolean;
|
|
34
|
+
children: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TThis>;
|
|
35
|
+
disabled: import("@sinclair/typebox").TBoolean;
|
|
36
|
+
}>>>>;
|
|
37
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny> & {
|
|
38
|
+
title: string;
|
|
39
|
+
}>;
|
|
40
|
+
multiple: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
41
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
42
|
+
default: string;
|
|
43
|
+
}>;
|
|
44
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
45
|
+
}>;
|
|
46
|
+
declare const config: {
|
|
47
|
+
readonly $schema: "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json";
|
|
48
|
+
readonly data: import("@sinclair/typebox").TObject<{
|
|
49
|
+
suffixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
50
|
+
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
51
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
52
|
+
requiredMsg: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
53
|
+
requiredFlag: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
54
|
+
extra: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
55
|
+
after: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
56
|
+
before: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
57
|
+
prefixType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
58
|
+
prefixIcon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
59
|
+
prefixSrc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
60
|
+
suffixIcon: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
61
|
+
suffixSrc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
62
|
+
clearable: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
63
|
+
borderedH5: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
64
|
+
borderedPc: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
65
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
66
|
+
labelVisible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
67
|
+
labelAlign: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
68
|
+
labelWrap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
69
|
+
layout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
70
|
+
labelWidth: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
71
|
+
labelTips: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
72
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
73
|
+
'x-index': number;
|
|
74
|
+
}>;
|
|
75
|
+
data: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRecursive<import("@sinclair/typebox").TObject<{
|
|
76
|
+
label: import("@sinclair/typebox").TString;
|
|
77
|
+
value: import("@sinclair/typebox").TString;
|
|
78
|
+
isLeaf: import("@sinclair/typebox").TBoolean;
|
|
79
|
+
children: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TThis>;
|
|
80
|
+
disabled: import("@sinclair/typebox").TBoolean;
|
|
81
|
+
}>>>>;
|
|
82
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny> & {
|
|
83
|
+
title: string;
|
|
84
|
+
}>;
|
|
85
|
+
multiple: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
86
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
87
|
+
default: string;
|
|
88
|
+
}>;
|
|
89
|
+
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<string>>;
|
|
90
|
+
}>;
|
|
91
|
+
readonly properties: import("@sinclair/typebox").TObject<{
|
|
92
|
+
label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
93
|
+
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
94
|
+
'x-index': number;
|
|
95
|
+
}>;
|
|
96
|
+
value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TAny> & {
|
|
97
|
+
title: string;
|
|
98
|
+
}>;
|
|
99
|
+
required: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
100
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
101
|
+
visible: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
102
|
+
readOnly: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
103
|
+
selectedOptions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
104
|
+
label: import("@sinclair/typebox").TString;
|
|
105
|
+
value: import("@sinclair/typebox").TString;
|
|
106
|
+
}>>>;
|
|
107
|
+
}>;
|
|
108
|
+
readonly classes: {
|
|
109
|
+
name: string;
|
|
110
|
+
selector: string;
|
|
111
|
+
description: string;
|
|
112
|
+
}[];
|
|
113
|
+
readonly methods: readonly [{
|
|
114
|
+
name: string;
|
|
115
|
+
label: string;
|
|
116
|
+
params: {
|
|
117
|
+
properties: {
|
|
118
|
+
value: {
|
|
119
|
+
title: string;
|
|
120
|
+
type: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
description: string;
|
|
125
|
+
}, {
|
|
126
|
+
name: string;
|
|
127
|
+
label: string;
|
|
128
|
+
params: {
|
|
129
|
+
properties: {
|
|
130
|
+
value: {
|
|
131
|
+
title: string;
|
|
132
|
+
type: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
description: string;
|
|
137
|
+
}, {
|
|
138
|
+
name: string;
|
|
139
|
+
label: string;
|
|
140
|
+
params: {
|
|
141
|
+
properties: {
|
|
142
|
+
value: {
|
|
143
|
+
title: string;
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
description: string;
|
|
149
|
+
}, {
|
|
150
|
+
name: string;
|
|
151
|
+
label: string;
|
|
152
|
+
description: string;
|
|
153
|
+
}, {
|
|
154
|
+
name: string;
|
|
155
|
+
label: string;
|
|
156
|
+
params: {
|
|
157
|
+
properties: {
|
|
158
|
+
value: {
|
|
159
|
+
title: string;
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
description: string;
|
|
165
|
+
}, {
|
|
166
|
+
name: string;
|
|
167
|
+
label: string;
|
|
168
|
+
description: string;
|
|
169
|
+
}, {
|
|
170
|
+
name: string;
|
|
171
|
+
label: string;
|
|
172
|
+
description: string;
|
|
173
|
+
}];
|
|
174
|
+
readonly events: readonly [{
|
|
175
|
+
name: string;
|
|
176
|
+
title: string;
|
|
177
|
+
detail: import("@sinclair/typebox").TObject<{
|
|
178
|
+
value: import("@sinclair/typebox").TString;
|
|
179
|
+
}>;
|
|
180
|
+
description: string;
|
|
181
|
+
}];
|
|
182
|
+
readonly meta: {
|
|
183
|
+
readonly description: "多级选择器,常使用在地域选择,机型配置选择等。";
|
|
184
|
+
readonly figureIcon: "../figureIcons/WdSelect.svg";
|
|
185
|
+
readonly icon: "../icons/FormSelect.svg";
|
|
186
|
+
readonly title: "级联选择";
|
|
187
|
+
readonly componentName: "Cascader";
|
|
188
|
+
readonly name: "WdCascader";
|
|
189
|
+
readonly categoryOrder: 500;
|
|
190
|
+
readonly componentOrder: 371;
|
|
191
|
+
readonly docsUrl: "https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdCascade";
|
|
192
|
+
readonly category: string;
|
|
193
|
+
readonly shortcut: {
|
|
194
|
+
props: string[];
|
|
195
|
+
};
|
|
196
|
+
readonly group: {
|
|
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
|
+
标签风格: {
|
|
214
|
+
'x-index': number;
|
|
215
|
+
expand: boolean;
|
|
216
|
+
};
|
|
217
|
+
选择框: {
|
|
218
|
+
'x-index': number;
|
|
219
|
+
expand: boolean;
|
|
220
|
+
};
|
|
221
|
+
内容: {
|
|
222
|
+
'x-index': number;
|
|
223
|
+
expand: boolean;
|
|
224
|
+
};
|
|
225
|
+
图片内容: {
|
|
226
|
+
'x-index': number;
|
|
227
|
+
expand: boolean;
|
|
228
|
+
};
|
|
229
|
+
文件内容: {
|
|
230
|
+
'x-index': number;
|
|
231
|
+
expand: boolean;
|
|
232
|
+
};
|
|
233
|
+
地图内容: {
|
|
234
|
+
'x-index': number;
|
|
235
|
+
expand: boolean;
|
|
236
|
+
};
|
|
237
|
+
开关按钮: {
|
|
238
|
+
'x-index': number;
|
|
239
|
+
expand: boolean;
|
|
240
|
+
};
|
|
241
|
+
小程序能力: {
|
|
242
|
+
'x-index': number;
|
|
243
|
+
expand: boolean;
|
|
244
|
+
};
|
|
245
|
+
'\u72B6\u6001/\u6821\u9A8C': {
|
|
246
|
+
'x-index': number;
|
|
247
|
+
expand: boolean;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly visible: any;
|
|
251
|
+
readonly inlineStyleForm: {
|
|
252
|
+
$text: {
|
|
253
|
+
visible: boolean;
|
|
254
|
+
};
|
|
255
|
+
justifyContent: {
|
|
256
|
+
visible: boolean;
|
|
257
|
+
};
|
|
258
|
+
flexDirection: {
|
|
259
|
+
visible: boolean;
|
|
260
|
+
};
|
|
261
|
+
alignItems: {
|
|
262
|
+
visible: boolean;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
readonly templates: readonly [{
|
|
266
|
+
readonly when: "$attached";
|
|
267
|
+
readonly body: "\n [attributes]\n name = \"{{$self.id}}\"\n ";
|
|
268
|
+
readonly __k: "init-name-with-id";
|
|
269
|
+
}];
|
|
270
|
+
};
|
|
271
|
+
readonly compConfig: {
|
|
272
|
+
readonly componentType: "formField";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
export default config;
|
|
276
|
+
export type DataType = Simplify<Static<typeof data>>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { defineConfig, Type } from '../type-utils';
|
|
2
|
+
import { FORM_ITEM_DATA, FORM_ITEM_EVENTS, FORM_ITEM_METHODS, FORM_ITEM_META, ItemData, pickWithXCategory, X_CATEGORY, getFormItemDataTitle, } from '../type-utils/type-form';
|
|
3
|
+
import { getClasses } from '../type-utils/classes';
|
|
4
|
+
import { templateInitNameWithId } from './common/init-name-with-id';
|
|
5
|
+
const CASCADER = pickWithXCategory(FORM_ITEM_DATA, [
|
|
6
|
+
'clearable',
|
|
7
|
+
'before',
|
|
8
|
+
'after',
|
|
9
|
+
'prefixType',
|
|
10
|
+
'prefixIcon',
|
|
11
|
+
'prefixSrc',
|
|
12
|
+
'suffixIcon',
|
|
13
|
+
'suffixSrc',
|
|
14
|
+
'extra',
|
|
15
|
+
'borderedH5',
|
|
16
|
+
'borderedPc',
|
|
17
|
+
], X_CATEGORY.SELECT);
|
|
18
|
+
const TITLE = getFormItemDataTitle('级联选择');
|
|
19
|
+
const Node = Type.Recursive((Node) => Type.Object({
|
|
20
|
+
label: Type.String({ title: 'label' }),
|
|
21
|
+
value: Type.String({ title: 'value' }),
|
|
22
|
+
isLeaf: Type.Boolean({ title: 'isLeaf' }),
|
|
23
|
+
children: Type.Array(Node),
|
|
24
|
+
disabled: Type.Boolean({ title: 'disabled' }),
|
|
25
|
+
}), {
|
|
26
|
+
$id: 'Node',
|
|
27
|
+
});
|
|
28
|
+
// 属性类型定义
|
|
29
|
+
const data = Type.Partial(Type.Object({
|
|
30
|
+
// 通用
|
|
31
|
+
name: Object.assign({}, FORM_ITEM_DATA.name, {
|
|
32
|
+
'x-index': 9,
|
|
33
|
+
}),
|
|
34
|
+
data: Type.Array(Node, {
|
|
35
|
+
title: '选项数据',
|
|
36
|
+
description: '选项数据',
|
|
37
|
+
default: [
|
|
38
|
+
{
|
|
39
|
+
label: '北京市',
|
|
40
|
+
value: 'bj',
|
|
41
|
+
children: [
|
|
42
|
+
{ label: '朝阳区', value: 'cy' },
|
|
43
|
+
{ label: '海淀区', value: 'hd' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: '上海市',
|
|
48
|
+
value: 'sh',
|
|
49
|
+
children: [
|
|
50
|
+
{ label: '徐汇区', value: 'xh' },
|
|
51
|
+
{ label: '黄埔区', value: 'hp' },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: '广东省',
|
|
56
|
+
value: 'gd',
|
|
57
|
+
children: [
|
|
58
|
+
{
|
|
59
|
+
label: '深圳市',
|
|
60
|
+
value: 'sz',
|
|
61
|
+
children: [
|
|
62
|
+
{ label: '南山区', value: 'ns' },
|
|
63
|
+
{ label: '宝安区', value: 'ba' },
|
|
64
|
+
{ label: '福田区', value: 'ft', disabled: true },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: '广州市',
|
|
69
|
+
value: 'gz',
|
|
70
|
+
children: [
|
|
71
|
+
{ label: '天河区', value: 'th' },
|
|
72
|
+
{ label: '越秀区', value: 'yx' },
|
|
73
|
+
{ label: '海珠区', value: 'hz' },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{ label: '东莞市', value: 'dg' },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
'x-index': 10,
|
|
81
|
+
'x-component': 'jsontext',
|
|
82
|
+
'x-component-props': {
|
|
83
|
+
autoSize: { minRows: 2, maxRows: 10 },
|
|
84
|
+
},
|
|
85
|
+
'x-category': X_CATEGORY.COMMON,
|
|
86
|
+
}),
|
|
87
|
+
value: Object.assign({}, FORM_ITEM_DATA._valueInCascader, {
|
|
88
|
+
title: '选中值',
|
|
89
|
+
}),
|
|
90
|
+
multiple: FORM_ITEM_DATA._multipleInCascader,
|
|
91
|
+
placeholder: Object.assign({}, FORM_ITEM_DATA.placeholder, {
|
|
92
|
+
default: '请选择',
|
|
93
|
+
}),
|
|
94
|
+
size: FORM_ITEM_DATA.size,
|
|
95
|
+
// 标题
|
|
96
|
+
...TITLE,
|
|
97
|
+
// 选择框
|
|
98
|
+
...CASCADER,
|
|
99
|
+
suffixType: FORM_ITEM_DATA._suffixTypeInSelect,
|
|
100
|
+
// 状态校验
|
|
101
|
+
status: FORM_ITEM_DATA.status,
|
|
102
|
+
required: FORM_ITEM_DATA.required,
|
|
103
|
+
requiredMsg: FORM_ITEM_DATA.requiredMsg,
|
|
104
|
+
requiredFlag: FORM_ITEM_DATA.requiredFlag,
|
|
105
|
+
}));
|
|
106
|
+
const properties = Type.Composite([
|
|
107
|
+
Type.Pick(data, ['name', 'value', 'label', 'required']),
|
|
108
|
+
Type.Pick(ItemData, ['visible', 'disabled', 'readOnly', 'selectedOptions']),
|
|
109
|
+
]);
|
|
110
|
+
const CLASSES = getClasses('cascader', { kind: '选择框' });
|
|
111
|
+
const classes = [
|
|
112
|
+
CLASSES.root,
|
|
113
|
+
CLASSES.root_h5,
|
|
114
|
+
CLASSES.root_pc,
|
|
115
|
+
CLASSES.root_mp,
|
|
116
|
+
CLASSES.item_label,
|
|
117
|
+
CLASSES.input_edit,
|
|
118
|
+
CLASSES.input_focus,
|
|
119
|
+
{
|
|
120
|
+
...CLASSES.input_placeholder,
|
|
121
|
+
selector: `${CLASSES.root.selector} .wd-cascader__input .wd-input::placeholder`,
|
|
122
|
+
code: `
|
|
123
|
+
:scope .wd-cascader__input .wd-input::placeholder{
|
|
124
|
+
color: lightgray !important;
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
},
|
|
128
|
+
CLASSES.item_error,
|
|
129
|
+
CLASSES.item_help,
|
|
130
|
+
CLASSES.input_disabled,
|
|
131
|
+
CLASSES.item_readonly,
|
|
132
|
+
CLASSES.input_addon_left,
|
|
133
|
+
CLASSES.input_addon_right,
|
|
134
|
+
];
|
|
135
|
+
// export default
|
|
136
|
+
const config = defineConfig({
|
|
137
|
+
$schema: 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/schema/lcds_component.json',
|
|
138
|
+
data,
|
|
139
|
+
properties,
|
|
140
|
+
classes,
|
|
141
|
+
methods: [
|
|
142
|
+
FORM_ITEM_METHODS.setValue,
|
|
143
|
+
FORM_ITEM_METHODS.setVisible,
|
|
144
|
+
FORM_ITEM_METHODS.setDisabled,
|
|
145
|
+
FORM_ITEM_METHODS.clearValue,
|
|
146
|
+
FORM_ITEM_METHODS.setReadOnly,
|
|
147
|
+
FORM_ITEM_METHODS.handleValidate,
|
|
148
|
+
FORM_ITEM_METHODS.clearValidate,
|
|
149
|
+
],
|
|
150
|
+
events: [
|
|
151
|
+
FORM_ITEM_EVENTS.change,
|
|
152
|
+
// {
|
|
153
|
+
// title: '输入搜索内容',
|
|
154
|
+
// name: 'search',
|
|
155
|
+
// detail: Type.Object({
|
|
156
|
+
// value: Type.String({
|
|
157
|
+
// title: '搜索框输入值',
|
|
158
|
+
// }),
|
|
159
|
+
// }),
|
|
160
|
+
// },
|
|
161
|
+
],
|
|
162
|
+
meta: {
|
|
163
|
+
description: '多级选择器,常使用在地域选择,机型配置选择等。',
|
|
164
|
+
figureIcon: '../figureIcons/WdSelect.svg',
|
|
165
|
+
icon: '../icons/FormSelect.svg',
|
|
166
|
+
title: '级联选择',
|
|
167
|
+
componentName: 'Cascader',
|
|
168
|
+
name: 'WdCascader',
|
|
169
|
+
categoryOrder: 500,
|
|
170
|
+
componentOrder: 371,
|
|
171
|
+
docsUrl: 'https://docs.cloudbase.net/lowcode/components/wedaUI/src/docs/compsdocs/form/WdCascade',
|
|
172
|
+
category: FORM_ITEM_META.category,
|
|
173
|
+
shortcut: FORM_ITEM_META.shortcut,
|
|
174
|
+
group: FORM_ITEM_META.group,
|
|
175
|
+
visible: FORM_ITEM_META.visible,
|
|
176
|
+
inlineStyleForm: FORM_ITEM_META.inlineStyleForm,
|
|
177
|
+
templates: [templateInitNameWithId],
|
|
178
|
+
},
|
|
179
|
+
compConfig: {
|
|
180
|
+
componentType: 'formField',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
export default config;
|