@vunk/form 2.16.0 → 2.16.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/components/dialog/index.cjs +2 -1
- package/components/dialog/index.mjs +2 -1
- package/components/radio/index.cjs +161 -33
- package/components/radio/index.css +16 -0
- package/components/radio/index.d.ts +1 -1
- package/components/radio/index.mjs +165 -37
- package/components/radio/src/ctx.d.ts +9 -1
- package/components/radio/src/index.vue.d.ts +686 -500
- package/components/radio/src/option.vue.d.ts +901 -0
- package/components/radio/src/wraper.vue.d.ts +337 -0
- package/components/select/index.cjs +80 -26
- package/components/select/index.mjs +82 -28
- package/components/select/src/core.vue.d.ts +30 -0
- package/components/select/src/ctx.d.ts +17 -1
- package/components/select/src/index.vue.d.ts +9 -0
- package/components/select/src/options.vue.d.ts +24 -0
- package/index.css +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
options: {
|
|
3
|
+
type: import("vue").PropType<import("@vunk/form/shared/types/form").RadioProps[]>;
|
|
4
|
+
default: () => any[];
|
|
5
|
+
};
|
|
6
|
+
type: {
|
|
7
|
+
type: import("vue").PropType<"button" | "radio" | "card">;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: import("vue").PropType<string | number>;
|
|
12
|
+
};
|
|
13
|
+
slots: any;
|
|
14
|
+
ariaLabel: StringConstructor;
|
|
15
|
+
id: {
|
|
16
|
+
readonly type: import("vue").PropType<string>;
|
|
17
|
+
readonly required: false;
|
|
18
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
|
+
__epPropKey: true;
|
|
20
|
+
} & {
|
|
21
|
+
readonly default: undefined;
|
|
22
|
+
};
|
|
23
|
+
size: {
|
|
24
|
+
readonly type: import("vue").PropType<"" | "default" | "small" | "large">;
|
|
25
|
+
readonly required: false;
|
|
26
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
27
|
+
__epPropKey: true;
|
|
28
|
+
};
|
|
29
|
+
disabled: BooleanConstructor;
|
|
30
|
+
fill: {
|
|
31
|
+
readonly type: import("vue").PropType<string>;
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
34
|
+
__epPropKey: true;
|
|
35
|
+
} & {
|
|
36
|
+
readonly default: "";
|
|
37
|
+
};
|
|
38
|
+
textColor: {
|
|
39
|
+
readonly type: import("vue").PropType<string>;
|
|
40
|
+
readonly required: false;
|
|
41
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
42
|
+
__epPropKey: true;
|
|
43
|
+
} & {
|
|
44
|
+
readonly default: "";
|
|
45
|
+
};
|
|
46
|
+
name: {
|
|
47
|
+
readonly type: import("vue").PropType<string>;
|
|
48
|
+
readonly required: false;
|
|
49
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
50
|
+
__epPropKey: true;
|
|
51
|
+
} & {
|
|
52
|
+
readonly default: undefined;
|
|
53
|
+
};
|
|
54
|
+
validateEvent: {
|
|
55
|
+
readonly type: import("vue").PropType<boolean>;
|
|
56
|
+
readonly required: false;
|
|
57
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
58
|
+
__epPropKey: true;
|
|
59
|
+
} & {
|
|
60
|
+
readonly default: true;
|
|
61
|
+
};
|
|
62
|
+
required: {
|
|
63
|
+
readonly type: import("vue").PropType<boolean>;
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
66
|
+
__epPropKey: true;
|
|
67
|
+
} & {
|
|
68
|
+
readonly default: undefined;
|
|
69
|
+
};
|
|
70
|
+
formItemSize: {
|
|
71
|
+
type: import("vue").PropType<"default" | "small" | "large">;
|
|
72
|
+
default: "default" | "small" | "large";
|
|
73
|
+
};
|
|
74
|
+
formItemSlots: {
|
|
75
|
+
type: import("vue").PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
|
|
76
|
+
default: any;
|
|
77
|
+
};
|
|
78
|
+
elRef: {
|
|
79
|
+
type: import("vue").PropType<any>;
|
|
80
|
+
required: boolean;
|
|
81
|
+
};
|
|
82
|
+
inline: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
readonly: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: any;
|
|
89
|
+
};
|
|
90
|
+
formItemTip: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
default: any;
|
|
93
|
+
};
|
|
94
|
+
formItemTipClass: any;
|
|
95
|
+
labelTip: {
|
|
96
|
+
type: StringConstructor;
|
|
97
|
+
default: any;
|
|
98
|
+
};
|
|
99
|
+
information: {
|
|
100
|
+
type: BooleanConstructor;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
103
|
+
prop: any;
|
|
104
|
+
defaultModelValue: any;
|
|
105
|
+
label: StringConstructor;
|
|
106
|
+
labelWidth: {
|
|
107
|
+
readonly type: import("vue").PropType<string | number>;
|
|
108
|
+
readonly required: false;
|
|
109
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
110
|
+
__epPropKey: true;
|
|
111
|
+
} & {
|
|
112
|
+
readonly default: "";
|
|
113
|
+
};
|
|
114
|
+
labelPosition: {
|
|
115
|
+
readonly type: import("vue").PropType<"" | "top" | "left" | "right">;
|
|
116
|
+
readonly required: false;
|
|
117
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
118
|
+
__epPropKey: true;
|
|
119
|
+
} & {
|
|
120
|
+
readonly default: "";
|
|
121
|
+
};
|
|
122
|
+
rules: {
|
|
123
|
+
readonly type: import("vue").PropType<unknown>;
|
|
124
|
+
readonly required: false;
|
|
125
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
126
|
+
__epPropKey: true;
|
|
127
|
+
};
|
|
128
|
+
error: StringConstructor;
|
|
129
|
+
validateStatus: {
|
|
130
|
+
readonly type: import("vue").PropType<"" | "error" | "success" | "validating">;
|
|
131
|
+
readonly required: false;
|
|
132
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
133
|
+
__epPropKey: true;
|
|
134
|
+
};
|
|
135
|
+
for: StringConstructor;
|
|
136
|
+
inlineMessage: {
|
|
137
|
+
readonly type: import("vue").PropType<string | boolean>;
|
|
138
|
+
readonly required: false;
|
|
139
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
140
|
+
__epPropKey: true;
|
|
141
|
+
} & {
|
|
142
|
+
readonly default: "";
|
|
143
|
+
};
|
|
144
|
+
showMessage: {
|
|
145
|
+
readonly type: import("vue").PropType<boolean>;
|
|
146
|
+
readonly required: false;
|
|
147
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
148
|
+
__epPropKey: true;
|
|
149
|
+
} & {
|
|
150
|
+
readonly default: true;
|
|
151
|
+
};
|
|
152
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
155
|
+
"update:modelValue": (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
156
|
+
change: (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
157
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
158
|
+
options: {
|
|
159
|
+
type: import("vue").PropType<import("@vunk/form/shared/types/form").RadioProps[]>;
|
|
160
|
+
default: () => any[];
|
|
161
|
+
};
|
|
162
|
+
type: {
|
|
163
|
+
type: import("vue").PropType<"button" | "radio" | "card">;
|
|
164
|
+
default: string;
|
|
165
|
+
};
|
|
166
|
+
modelValue: {
|
|
167
|
+
type: import("vue").PropType<string | number>;
|
|
168
|
+
};
|
|
169
|
+
slots: any;
|
|
170
|
+
ariaLabel: StringConstructor;
|
|
171
|
+
id: {
|
|
172
|
+
readonly type: import("vue").PropType<string>;
|
|
173
|
+
readonly required: false;
|
|
174
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
175
|
+
__epPropKey: true;
|
|
176
|
+
} & {
|
|
177
|
+
readonly default: undefined;
|
|
178
|
+
};
|
|
179
|
+
size: {
|
|
180
|
+
readonly type: import("vue").PropType<"" | "default" | "small" | "large">;
|
|
181
|
+
readonly required: false;
|
|
182
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
183
|
+
__epPropKey: true;
|
|
184
|
+
};
|
|
185
|
+
disabled: BooleanConstructor;
|
|
186
|
+
fill: {
|
|
187
|
+
readonly type: import("vue").PropType<string>;
|
|
188
|
+
readonly required: false;
|
|
189
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
190
|
+
__epPropKey: true;
|
|
191
|
+
} & {
|
|
192
|
+
readonly default: "";
|
|
193
|
+
};
|
|
194
|
+
textColor: {
|
|
195
|
+
readonly type: import("vue").PropType<string>;
|
|
196
|
+
readonly required: false;
|
|
197
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
198
|
+
__epPropKey: true;
|
|
199
|
+
} & {
|
|
200
|
+
readonly default: "";
|
|
201
|
+
};
|
|
202
|
+
name: {
|
|
203
|
+
readonly type: import("vue").PropType<string>;
|
|
204
|
+
readonly required: false;
|
|
205
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
206
|
+
__epPropKey: true;
|
|
207
|
+
} & {
|
|
208
|
+
readonly default: undefined;
|
|
209
|
+
};
|
|
210
|
+
validateEvent: {
|
|
211
|
+
readonly type: import("vue").PropType<boolean>;
|
|
212
|
+
readonly required: false;
|
|
213
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
214
|
+
__epPropKey: true;
|
|
215
|
+
} & {
|
|
216
|
+
readonly default: true;
|
|
217
|
+
};
|
|
218
|
+
required: {
|
|
219
|
+
readonly type: import("vue").PropType<boolean>;
|
|
220
|
+
readonly required: false;
|
|
221
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
222
|
+
__epPropKey: true;
|
|
223
|
+
} & {
|
|
224
|
+
readonly default: undefined;
|
|
225
|
+
};
|
|
226
|
+
formItemSize: {
|
|
227
|
+
type: import("vue").PropType<"default" | "small" | "large">;
|
|
228
|
+
default: "default" | "small" | "large";
|
|
229
|
+
};
|
|
230
|
+
formItemSlots: {
|
|
231
|
+
type: import("vue").PropType<import("@vunk/form/components/form-item/src/types").FormItemSlots>;
|
|
232
|
+
default: any;
|
|
233
|
+
};
|
|
234
|
+
elRef: {
|
|
235
|
+
type: import("vue").PropType<any>;
|
|
236
|
+
required: boolean;
|
|
237
|
+
};
|
|
238
|
+
inline: {
|
|
239
|
+
type: BooleanConstructor;
|
|
240
|
+
default: boolean;
|
|
241
|
+
};
|
|
242
|
+
readonly: {
|
|
243
|
+
type: BooleanConstructor;
|
|
244
|
+
default: any;
|
|
245
|
+
};
|
|
246
|
+
formItemTip: {
|
|
247
|
+
type: StringConstructor;
|
|
248
|
+
default: any;
|
|
249
|
+
};
|
|
250
|
+
formItemTipClass: any;
|
|
251
|
+
labelTip: {
|
|
252
|
+
type: StringConstructor;
|
|
253
|
+
default: any;
|
|
254
|
+
};
|
|
255
|
+
information: {
|
|
256
|
+
type: BooleanConstructor;
|
|
257
|
+
default: boolean;
|
|
258
|
+
};
|
|
259
|
+
prop: any;
|
|
260
|
+
defaultModelValue: any;
|
|
261
|
+
label: StringConstructor;
|
|
262
|
+
labelWidth: {
|
|
263
|
+
readonly type: import("vue").PropType<string | number>;
|
|
264
|
+
readonly required: false;
|
|
265
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
266
|
+
__epPropKey: true;
|
|
267
|
+
} & {
|
|
268
|
+
readonly default: "";
|
|
269
|
+
};
|
|
270
|
+
labelPosition: {
|
|
271
|
+
readonly type: import("vue").PropType<"" | "top" | "left" | "right">;
|
|
272
|
+
readonly required: false;
|
|
273
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
274
|
+
__epPropKey: true;
|
|
275
|
+
} & {
|
|
276
|
+
readonly default: "";
|
|
277
|
+
};
|
|
278
|
+
rules: {
|
|
279
|
+
readonly type: import("vue").PropType<unknown>;
|
|
280
|
+
readonly required: false;
|
|
281
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
282
|
+
__epPropKey: true;
|
|
283
|
+
};
|
|
284
|
+
error: StringConstructor;
|
|
285
|
+
validateStatus: {
|
|
286
|
+
readonly type: import("vue").PropType<"" | "error" | "success" | "validating">;
|
|
287
|
+
readonly required: false;
|
|
288
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
289
|
+
__epPropKey: true;
|
|
290
|
+
};
|
|
291
|
+
for: StringConstructor;
|
|
292
|
+
inlineMessage: {
|
|
293
|
+
readonly type: import("vue").PropType<string | boolean>;
|
|
294
|
+
readonly required: false;
|
|
295
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
296
|
+
__epPropKey: true;
|
|
297
|
+
} & {
|
|
298
|
+
readonly default: "";
|
|
299
|
+
};
|
|
300
|
+
showMessage: {
|
|
301
|
+
readonly type: import("vue").PropType<boolean>;
|
|
302
|
+
readonly required: false;
|
|
303
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
304
|
+
__epPropKey: true;
|
|
305
|
+
} & {
|
|
306
|
+
readonly default: true;
|
|
307
|
+
};
|
|
308
|
+
}>> & Readonly<{
|
|
309
|
+
"onUpdate:modelValue"?: (val: string | number | boolean) => any;
|
|
310
|
+
onChange?: (val: string | number | boolean) => any;
|
|
311
|
+
}>, {
|
|
312
|
+
type: "button" | "card" | "radio";
|
|
313
|
+
required: boolean;
|
|
314
|
+
fill: string;
|
|
315
|
+
formItemSize: "default" | "small" | "large";
|
|
316
|
+
formItemSlots: import("@vunk/form/components/form-item/src/types").FormItemSlots;
|
|
317
|
+
inline: boolean;
|
|
318
|
+
readonly: boolean;
|
|
319
|
+
formItemTip: string;
|
|
320
|
+
formItemTipClass: any;
|
|
321
|
+
labelTip: string;
|
|
322
|
+
information: boolean;
|
|
323
|
+
prop: any;
|
|
324
|
+
defaultModelValue: any;
|
|
325
|
+
labelWidth: string | number;
|
|
326
|
+
labelPosition: "" | "top" | "left" | "right";
|
|
327
|
+
inlineMessage: string | boolean;
|
|
328
|
+
showMessage: boolean;
|
|
329
|
+
disabled: boolean;
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
332
|
+
slots: any;
|
|
333
|
+
options: import("@vunk/form/shared/types/form").RadioProps[];
|
|
334
|
+
validateEvent: boolean;
|
|
335
|
+
textColor: string;
|
|
336
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
337
|
+
export default _default;
|
|
@@ -22,7 +22,13 @@ const props = {
|
|
|
22
22
|
type: Object,
|
|
23
23
|
default: void 0
|
|
24
24
|
},
|
|
25
|
+
/**
|
|
26
|
+
* @description el组件实例ref
|
|
27
|
+
*/
|
|
25
28
|
selectRef: null,
|
|
29
|
+
/**
|
|
30
|
+
* @description a url which's response is options
|
|
31
|
+
*/
|
|
26
32
|
optionsUrl: {
|
|
27
33
|
type: String,
|
|
28
34
|
default: ""
|
|
@@ -34,7 +40,17 @@ const props = {
|
|
|
34
40
|
type: Boolean,
|
|
35
41
|
default: false
|
|
36
42
|
},
|
|
37
|
-
|
|
43
|
+
/**
|
|
44
|
+
* @description 同插槽
|
|
45
|
+
*/
|
|
46
|
+
slots: null,
|
|
47
|
+
/**
|
|
48
|
+
* @description 若 option中含有该字段内容,则渲染为 Group
|
|
49
|
+
*/
|
|
50
|
+
optionChildrenProp: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
}
|
|
38
54
|
};
|
|
39
55
|
const createBindProps = utilsVue.bindPropsFactory(props);
|
|
40
56
|
const emits = {
|
|
@@ -50,12 +66,62 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
50
66
|
props: props
|
|
51
67
|
});
|
|
52
68
|
|
|
69
|
+
function _isSlot(s) {
|
|
70
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
71
|
+
}
|
|
72
|
+
var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
73
|
+
props: {
|
|
74
|
+
data: {
|
|
75
|
+
type: Array,
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
optionChildrenProp: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: ""
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
setup(props, {
|
|
84
|
+
slots
|
|
85
|
+
}) {
|
|
86
|
+
const ItemView = item => {
|
|
87
|
+
let _slot;
|
|
88
|
+
const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
|
|
89
|
+
return isGroup ? vue.createVNode(elementPlus$1.ElOptionGroup, {
|
|
90
|
+
"label": item.label,
|
|
91
|
+
"key": item.value || item.label,
|
|
92
|
+
"disabled": item.disabled
|
|
93
|
+
}, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => vue.createVNode(ItemView, vue.mergeProps({
|
|
94
|
+
"key": childOption.value
|
|
95
|
+
}, childOption), null))) ? _slot : {
|
|
96
|
+
default: () => [_slot]
|
|
97
|
+
}) : vue.createVNode(elementPlus$1.ElOption, {
|
|
98
|
+
"key": item.value,
|
|
99
|
+
"value": item.value,
|
|
100
|
+
"class": item.class,
|
|
101
|
+
"created": item.created,
|
|
102
|
+
"disabled": item.disabled,
|
|
103
|
+
"label": item.label,
|
|
104
|
+
"ref": item.ref,
|
|
105
|
+
"style": item.style
|
|
106
|
+
}, {
|
|
107
|
+
default: () => slots.option ? slots.option(item) : item.label
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return () => {
|
|
111
|
+
return props.data.map(item => ItemView(item));
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
var Options = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
|
|
117
|
+
|
|
53
118
|
var _sfc_main$1 = vue.defineComponent({
|
|
54
119
|
name: "VkfSelect",
|
|
55
120
|
components: {
|
|
56
121
|
VkfFormItem: formItem.VkfFormItem,
|
|
57
122
|
ElSelect: elementPlus$1.ElSelect,
|
|
58
|
-
ElOption: elementPlus$1.ElOption
|
|
123
|
+
ElOption: elementPlus$1.ElOption,
|
|
124
|
+
Options
|
|
59
125
|
},
|
|
60
126
|
props,
|
|
61
127
|
emits,
|
|
@@ -138,7 +204,7 @@ var _sfc_main$1 = vue.defineComponent({
|
|
|
138
204
|
});
|
|
139
205
|
|
|
140
206
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
141
|
-
const
|
|
207
|
+
const _component_Options = vue.resolveComponent("Options");
|
|
142
208
|
const _component_ElSelect = vue.resolveComponent("ElSelect");
|
|
143
209
|
const _component_VkfFormItem = vue.resolveComponent("VkfFormItem");
|
|
144
210
|
return vue.openBlock(), vue.createBlock(
|
|
@@ -156,29 +222,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
156
222
|
}
|
|
157
223
|
}, vue.toHandlers(_ctx.selectOnEmits)), vue.createSlots({
|
|
158
224
|
default: vue.withCtx(() => [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
vue.renderSlot(_ctx.$slots, "option", vue.mergeProps({ ref_for: true }, item))
|
|
171
|
-
]),
|
|
172
|
-
_: 2
|
|
173
|
-
/* DYNAMIC */
|
|
174
|
-
},
|
|
175
|
-
1040
|
|
176
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
177
|
-
);
|
|
178
|
-
}),
|
|
179
|
-
128
|
|
180
|
-
/* KEYED_FRAGMENT */
|
|
181
|
-
))
|
|
225
|
+
vue.createVNode(_component_Options, {
|
|
226
|
+
data: _ctx.selectOptions,
|
|
227
|
+
"option-children-prop": _ctx.optionChildrenProp
|
|
228
|
+
}, {
|
|
229
|
+
option: vue.withCtx((e) => [
|
|
230
|
+
vue.renderSlot(_ctx.$slots, "option", vue.normalizeProps(vue.guardReactiveProps(e)))
|
|
231
|
+
]),
|
|
232
|
+
_: 3
|
|
233
|
+
/* FORWARDED */
|
|
234
|
+
}, 8, ["data", "option-children-prop"]),
|
|
235
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
182
236
|
]),
|
|
183
237
|
_: 2
|
|
184
238
|
/* DYNAMIC */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx,
|
|
1
|
+
import { defineComponent, createVNode, mergeProps, isVNode, computed, ref, watch, nextTick, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, toHandlers, createSlots, renderSlot, renderList, resolveDynamicComponent, createCommentVNode, h } from 'vue';
|
|
2
2
|
import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
|
|
3
3
|
import { selectProps, selectEmits, createSelectBindProps, createSelectOnEmits } from '@vunk/form/shared/element-plus';
|
|
4
4
|
import { bindPropsFactory, onEmitsFactory, vOn } from '@vunk/core/shared/utils-vue';
|
|
5
|
-
import {
|
|
5
|
+
import { ElOptionGroup, ElOption, ElSelect } from 'element-plus';
|
|
6
6
|
import { isNotEmptyObject, isPlainObject } from '@vunk/core/shared/utils-object';
|
|
7
7
|
import { useComputedReadonly } from '@vunk/form/composables';
|
|
8
8
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
@@ -18,7 +18,13 @@ const props = {
|
|
|
18
18
|
type: Object,
|
|
19
19
|
default: void 0
|
|
20
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* @description el组件实例ref
|
|
23
|
+
*/
|
|
21
24
|
selectRef: null,
|
|
25
|
+
/**
|
|
26
|
+
* @description a url which's response is options
|
|
27
|
+
*/
|
|
22
28
|
optionsUrl: {
|
|
23
29
|
type: String,
|
|
24
30
|
default: ""
|
|
@@ -30,7 +36,17 @@ const props = {
|
|
|
30
36
|
type: Boolean,
|
|
31
37
|
default: false
|
|
32
38
|
},
|
|
33
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @description 同插槽
|
|
41
|
+
*/
|
|
42
|
+
slots: null,
|
|
43
|
+
/**
|
|
44
|
+
* @description 若 option中含有该字段内容,则渲染为 Group
|
|
45
|
+
*/
|
|
46
|
+
optionChildrenProp: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: ""
|
|
49
|
+
}
|
|
34
50
|
};
|
|
35
51
|
const createBindProps = bindPropsFactory(props);
|
|
36
52
|
const emits = {
|
|
@@ -46,12 +62,62 @@ var ctx = /*#__PURE__*/Object.freeze({
|
|
|
46
62
|
props: props
|
|
47
63
|
});
|
|
48
64
|
|
|
65
|
+
function _isSlot(s) {
|
|
66
|
+
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
|
|
67
|
+
}
|
|
68
|
+
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
69
|
+
props: {
|
|
70
|
+
data: {
|
|
71
|
+
type: Array,
|
|
72
|
+
required: true
|
|
73
|
+
},
|
|
74
|
+
optionChildrenProp: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup(props, {
|
|
80
|
+
slots
|
|
81
|
+
}) {
|
|
82
|
+
const ItemView = item => {
|
|
83
|
+
let _slot;
|
|
84
|
+
const isGroup = props.optionChildrenProp && Array.isArray(item[props.optionChildrenProp]) && item[props.optionChildrenProp].length > 0;
|
|
85
|
+
return isGroup ? createVNode(ElOptionGroup, {
|
|
86
|
+
"label": item.label,
|
|
87
|
+
"key": item.value || item.label,
|
|
88
|
+
"disabled": item.disabled
|
|
89
|
+
}, _isSlot(_slot = item[props.optionChildrenProp].map(childOption => createVNode(ItemView, mergeProps({
|
|
90
|
+
"key": childOption.value
|
|
91
|
+
}, childOption), null))) ? _slot : {
|
|
92
|
+
default: () => [_slot]
|
|
93
|
+
}) : createVNode(ElOption, {
|
|
94
|
+
"key": item.value,
|
|
95
|
+
"value": item.value,
|
|
96
|
+
"class": item.class,
|
|
97
|
+
"created": item.created,
|
|
98
|
+
"disabled": item.disabled,
|
|
99
|
+
"label": item.label,
|
|
100
|
+
"ref": item.ref,
|
|
101
|
+
"style": item.style
|
|
102
|
+
}, {
|
|
103
|
+
default: () => slots.option ? slots.option(item) : item.label
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
return () => {
|
|
107
|
+
return props.data.map(item => ItemView(item));
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
var Options = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/select/src/options.vue"]]);
|
|
113
|
+
|
|
49
114
|
var _sfc_main$1 = defineComponent({
|
|
50
115
|
name: "VkfSelect",
|
|
51
116
|
components: {
|
|
52
117
|
VkfFormItem,
|
|
53
118
|
ElSelect,
|
|
54
|
-
ElOption
|
|
119
|
+
ElOption,
|
|
120
|
+
Options
|
|
55
121
|
},
|
|
56
122
|
props,
|
|
57
123
|
emits,
|
|
@@ -134,7 +200,7 @@ var _sfc_main$1 = defineComponent({
|
|
|
134
200
|
});
|
|
135
201
|
|
|
136
202
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
137
|
-
const
|
|
203
|
+
const _component_Options = resolveComponent("Options");
|
|
138
204
|
const _component_ElSelect = resolveComponent("ElSelect");
|
|
139
205
|
const _component_VkfFormItem = resolveComponent("VkfFormItem");
|
|
140
206
|
return openBlock(), createBlock(
|
|
@@ -152,29 +218,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
218
|
}
|
|
153
219
|
}, toHandlers(_ctx.selectOnEmits)), createSlots({
|
|
154
220
|
default: withCtx(() => [
|
|
155
|
-
(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, item))
|
|
167
|
-
]),
|
|
168
|
-
_: 2
|
|
169
|
-
/* DYNAMIC */
|
|
170
|
-
},
|
|
171
|
-
1040
|
|
172
|
-
/* FULL_PROPS, DYNAMIC_SLOTS */
|
|
173
|
-
);
|
|
174
|
-
}),
|
|
175
|
-
128
|
|
176
|
-
/* KEYED_FRAGMENT */
|
|
177
|
-
))
|
|
221
|
+
createVNode(_component_Options, {
|
|
222
|
+
data: _ctx.selectOptions,
|
|
223
|
+
"option-children-prop": _ctx.optionChildrenProp
|
|
224
|
+
}, {
|
|
225
|
+
option: withCtx((e) => [
|
|
226
|
+
renderSlot(_ctx.$slots, "option", normalizeProps(guardReactiveProps(e)))
|
|
227
|
+
]),
|
|
228
|
+
_: 3
|
|
229
|
+
/* FORWARDED */
|
|
230
|
+
}, 8, ["data", "option-children-prop"]),
|
|
231
|
+
renderSlot(_ctx.$slots, "footer")
|
|
178
232
|
]),
|
|
179
233
|
_: 2
|
|
180
234
|
/* DYNAMIC */
|
|
@@ -18,6 +18,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
20
|
slots: any;
|
|
21
|
+
optionChildrenProp: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
21
25
|
name: StringConstructor;
|
|
22
26
|
id: StringConstructor;
|
|
23
27
|
modelValue: {
|
|
@@ -444,6 +448,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
444
448
|
default: boolean;
|
|
445
449
|
};
|
|
446
450
|
slots: any;
|
|
451
|
+
optionChildrenProp: {
|
|
452
|
+
type: StringConstructor;
|
|
453
|
+
default: string;
|
|
454
|
+
};
|
|
447
455
|
name: StringConstructor;
|
|
448
456
|
id: StringConstructor;
|
|
449
457
|
modelValue: {
|
|
@@ -848,6 +856,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
848
856
|
selectSlots: import("./types").SelectSlots;
|
|
849
857
|
selectRef: any;
|
|
850
858
|
optionsUrl: string;
|
|
859
|
+
optionChildrenProp: string;
|
|
851
860
|
}, {}, {
|
|
852
861
|
VkfFormItem: {
|
|
853
862
|
new (...args: any[]): any;
|
|
@@ -1036,5 +1045,26 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1036
1045
|
disabled: boolean;
|
|
1037
1046
|
created: boolean;
|
|
1038
1047
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
1048
|
+
Options: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
1049
|
+
data: {
|
|
1050
|
+
type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
|
|
1051
|
+
required: true;
|
|
1052
|
+
};
|
|
1053
|
+
optionChildrenProp: {
|
|
1054
|
+
type: StringConstructor;
|
|
1055
|
+
default: string;
|
|
1056
|
+
};
|
|
1057
|
+
}>, () => JSX.Element[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1058
|
+
data: {
|
|
1059
|
+
type: import("vue").PropType<import("@vunk/shared").NormalObject[]>;
|
|
1060
|
+
required: true;
|
|
1061
|
+
};
|
|
1062
|
+
optionChildrenProp: {
|
|
1063
|
+
type: StringConstructor;
|
|
1064
|
+
default: string;
|
|
1065
|
+
};
|
|
1066
|
+
}>> & Readonly<{}>, {
|
|
1067
|
+
optionChildrenProp: string;
|
|
1068
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1039
1069
|
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1040
1070
|
export default _default;
|