@silver-formily/element-plus 4.0.2 → 4.0.3
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/esm/__builtins__/shared/utils.mjs +4 -1
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/checkbox/index.d.ts +60 -60
- package/esm/color-picker/index.d.ts +8 -8
- package/esm/color-picker-panel/index.d.ts +12 -12
- package/esm/form-collapse/index.d.ts +3 -3
- package/esm/form-grid/form-grid-column.mjs +6 -4
- package/esm/form-grid/form-grid-column.mjs.map +1 -1
- package/esm/input-number/index.d.ts +24 -24
- package/esm/preview-text/select.mjs +8 -3
- package/esm/preview-text/select.mjs.map +1 -1
- package/esm/query-form/query-form-light.mjs +13 -6
- package/esm/query-form/query-form-light.mjs.map +1 -1
- package/esm/query-form/query-form.mjs +13 -6
- package/esm/query-form/query-form.mjs.map +1 -1
- package/esm/query-form/types.d.ts +8 -1
- package/esm/radio/index.d.ts +12 -12
- package/esm/radio/radio-group.mjs +4 -2
- package/esm/radio/radio-group.mjs.map +1 -1
- package/esm/select/index.d.ts +14 -14
- package/esm/transfer/index.d.ts +9 -9
- package/package.json +1 -1
|
@@ -25,7 +25,10 @@ function isVueOptions(options) {
|
|
|
25
25
|
return options && typeof options !== "function" && (typeof options.template === "string" || typeof options.render === "function" || typeof options.setup === "function" || typeof options.__asyncLoader === "function" || typeof options.__name === "string");
|
|
26
26
|
}
|
|
27
27
|
function composeExport(s0, s1) {
|
|
28
|
-
|
|
28
|
+
const composed = Object.create(Object.getPrototypeOf(s0));
|
|
29
|
+
Object.defineProperties(composed, Object.getOwnPropertyDescriptors(s0));
|
|
30
|
+
Object.defineProperties(composed, Object.getOwnPropertyDescriptors(s1));
|
|
31
|
+
return composed;
|
|
29
32
|
}
|
|
30
33
|
/* istanbul ignore next -- @preserve */
|
|
31
34
|
function isVnodeEmpty(vnodes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { useAttrs, version } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { Comment, computed, Fragment, Text } from 'vue'\nimport { lt } from './simple-version-compare'\n\nexport function useCleanAttrs(removeAttrsList: string[] = []): {\n props: ComputedRef<Record<string, any>>\n} {\n const attrs = useAttrs()\n const props = computed(() => {\n const DEFAULT_REMOVE_ATTRS = ['value', 'onChange', 'attrs', 'on', 'readOnly']\n if (isPlainObj(attrs.value.attrs)) {\n return omit({ ...attrs.value, ...attrs.value.attrs }, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n }\n return omit(attrs.value, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n })\n return {\n props,\n }\n}\n\nexport function isVueOptions(options: any): options is Component {\n return (\n options\n && typeof options !== 'function'\n && (typeof options.template === 'string'\n || typeof options.render === 'function'\n || typeof options.setup === 'function'\n || typeof options.__asyncLoader === 'function'\n || typeof options.__name === 'string')\n )\n}\n\nexport function composeExport<T0 extends object, T1 extends object>(\n s0: T0,\n s1: T1,\n): T0 & T1 {\n
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { useAttrs, version } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { Comment, computed, Fragment, Text } from 'vue'\nimport { lt } from './simple-version-compare'\n\nexport function useCleanAttrs(removeAttrsList: string[] = []): {\n props: ComputedRef<Record<string, any>>\n} {\n const attrs = useAttrs()\n const props = computed(() => {\n const DEFAULT_REMOVE_ATTRS = ['value', 'onChange', 'attrs', 'on', 'readOnly']\n if (isPlainObj(attrs.value.attrs)) {\n return omit({ ...attrs.value, ...attrs.value.attrs }, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n }\n return omit(attrs.value, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n })\n return {\n props,\n }\n}\n\nexport function isVueOptions(options: any): options is Component {\n return (\n options\n && typeof options !== 'function'\n && (typeof options.template === 'string'\n || typeof options.render === 'function'\n || typeof options.setup === 'function'\n || typeof options.__asyncLoader === 'function'\n || typeof options.__name === 'string')\n )\n}\n\nexport function composeExport<T0 extends object, T1 extends object>(\n s0: T0,\n s1: T1,\n): T0 & T1 {\n const composed = Object.create(Object.getPrototypeOf(s0))\n Object.defineProperties(composed, Object.getOwnPropertyDescriptors(s0))\n Object.defineProperties(composed, Object.getOwnPropertyDescriptors(s1))\n return composed\n}\n\n// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77\n/* istanbul ignore next -- @preserve */\nexport function isVnodeEmpty(vnodes: Array<VNode>) {\n return vnodes.every((node: VNode) => {\n if (node.type === Comment) {\n return true\n }\n\n if (node.type === Text && typeof node.children === 'string' && !node.children.trim()) {\n return true\n }\n\n if (\n node.type === Fragment\n && isVnodeEmpty(node.children as Array<VNode>)\n ) {\n return true\n }\n\n return false\n })\n}\n\nexport function hasSlotContent(slot: Slot<any> | undefined) {\n if (!slot) {\n return false\n }\n return !isVnodeEmpty(slot())\n}\n\nexport function compatibleUnderlineProp() {\n /* istanbul ignore next -- @preserve */\n return lt(version, '2.9.9') ? false : 'never'\n}\n"],"mappings":";;;;;;AAOA,SAAgB,cAAc,kBAA4B,EAAE,EAE1D;CACA,MAAM,QAAQ,UAAU;AAQxB,QAAO,EACL,OARY,eAAe;EAC3B,MAAM,uBAAuB;GAAC;GAAS;GAAY;GAAS;GAAM;GAAW;AAC7E,MAAI,WAAW,MAAM,MAAM,MAAM,CAC/B,QAAO,KAAK;GAAE,GAAG,MAAM;GAAO,GAAG,MAAM,MAAM;GAAO,EAAE,qBAAqB,OAAO,gBAAgB,CAAC;AAErG,SAAO,KAAK,MAAM,OAAO,qBAAqB,OAAO,gBAAgB,CAAC;GACtE,EAGD;;AAGH,SAAgB,aAAa,SAAoC;AAC/D,QACE,WACG,OAAO,YAAY,eAClB,OAAO,QAAQ,aAAa,YAC3B,OAAO,QAAQ,WAAW,cAC1B,OAAO,QAAQ,UAAU,cACzB,OAAO,QAAQ,kBAAkB,cACjC,OAAO,QAAQ,WAAW;;AAInC,SAAgB,cACd,IACA,IACS;CACT,MAAM,WAAW,OAAO,OAAO,OAAO,eAAe,GAAG,CAAC;AACzD,QAAO,iBAAiB,UAAU,OAAO,0BAA0B,GAAG,CAAC;AACvE,QAAO,iBAAiB,UAAU,OAAO,0BAA0B,GAAG,CAAC;AACvE,QAAO;;;AAKT,SAAgB,aAAa,QAAsB;AACjD,QAAO,OAAO,OAAO,SAAgB;AACnC,MAAI,KAAK,SAAS,QAChB,QAAO;AAGT,MAAI,KAAK,SAAS,QAAQ,OAAO,KAAK,aAAa,YAAY,CAAC,KAAK,SAAS,MAAM,CAClF,QAAO;AAGT,MACE,KAAK,SAAS,YACX,aAAa,KAAK,SAAyB,CAE9C,QAAO;AAGT,SAAO;GACP;;AAGJ,SAAgB,eAAe,MAA6B;AAC1D,KAAI,CAAC,KACH,QAAO;AAET,QAAO,CAAC,aAAa,MAAM,CAAC;;AAG9B,SAAgB,0BAA0B;;AAExC,QAAO,GAAG,SAAS,QAAQ,GAAG,QAAQ"}
|
package/esm/checkbox/index.d.ts
CHANGED
|
@@ -30,6 +30,16 @@ declare const Checkbox: {
|
|
|
30
30
|
ariaLabel: {
|
|
31
31
|
type: _$vue.PropType<string>;
|
|
32
32
|
};
|
|
33
|
+
id: {
|
|
34
|
+
type: _$vue.PropType<string>;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
tabindex: {
|
|
38
|
+
type: _$vue.PropType<string | number>;
|
|
39
|
+
};
|
|
40
|
+
border: {
|
|
41
|
+
type: _$vue.PropType<boolean>;
|
|
42
|
+
};
|
|
33
43
|
ariaControls: {
|
|
34
44
|
type: _$vue.PropType<string>;
|
|
35
45
|
};
|
|
@@ -59,16 +69,6 @@ declare const Checkbox: {
|
|
|
59
69
|
type: _$vue.PropType<string | number>;
|
|
60
70
|
default: undefined;
|
|
61
71
|
};
|
|
62
|
-
id: {
|
|
63
|
-
type: _$vue.PropType<string>;
|
|
64
|
-
default: undefined;
|
|
65
|
-
};
|
|
66
|
-
border: {
|
|
67
|
-
type: _$vue.PropType<boolean>;
|
|
68
|
-
};
|
|
69
|
-
tabindex: {
|
|
70
|
-
type: _$vue.PropType<string | number>;
|
|
71
|
-
};
|
|
72
72
|
}>> & {
|
|
73
73
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
74
74
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -121,6 +121,16 @@ declare const Checkbox: {
|
|
|
121
121
|
ariaLabel: {
|
|
122
122
|
type: _$vue.PropType<string>;
|
|
123
123
|
};
|
|
124
|
+
id: {
|
|
125
|
+
type: _$vue.PropType<string>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
tabindex: {
|
|
129
|
+
type: _$vue.PropType<string | number>;
|
|
130
|
+
};
|
|
131
|
+
border: {
|
|
132
|
+
type: _$vue.PropType<boolean>;
|
|
133
|
+
};
|
|
124
134
|
ariaControls: {
|
|
125
135
|
type: _$vue.PropType<string>;
|
|
126
136
|
};
|
|
@@ -150,16 +160,6 @@ declare const Checkbox: {
|
|
|
150
160
|
type: _$vue.PropType<string | number>;
|
|
151
161
|
default: undefined;
|
|
152
162
|
};
|
|
153
|
-
id: {
|
|
154
|
-
type: _$vue.PropType<string>;
|
|
155
|
-
default: undefined;
|
|
156
|
-
};
|
|
157
|
-
border: {
|
|
158
|
-
type: _$vue.PropType<boolean>;
|
|
159
|
-
};
|
|
160
|
-
tabindex: {
|
|
161
|
-
type: _$vue.PropType<string | number>;
|
|
162
|
-
};
|
|
163
163
|
}>> & {
|
|
164
164
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
165
165
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -206,6 +206,16 @@ declare const Checkbox: {
|
|
|
206
206
|
ariaLabel: {
|
|
207
207
|
type: _$vue.PropType<string>;
|
|
208
208
|
};
|
|
209
|
+
id: {
|
|
210
|
+
type: _$vue.PropType<string>;
|
|
211
|
+
default: undefined;
|
|
212
|
+
};
|
|
213
|
+
tabindex: {
|
|
214
|
+
type: _$vue.PropType<string | number>;
|
|
215
|
+
};
|
|
216
|
+
border: {
|
|
217
|
+
type: _$vue.PropType<boolean>;
|
|
218
|
+
};
|
|
209
219
|
ariaControls: {
|
|
210
220
|
type: _$vue.PropType<string>;
|
|
211
221
|
};
|
|
@@ -235,16 +245,6 @@ declare const Checkbox: {
|
|
|
235
245
|
type: _$vue.PropType<string | number>;
|
|
236
246
|
default: undefined;
|
|
237
247
|
};
|
|
238
|
-
id: {
|
|
239
|
-
type: _$vue.PropType<string>;
|
|
240
|
-
default: undefined;
|
|
241
|
-
};
|
|
242
|
-
border: {
|
|
243
|
-
type: _$vue.PropType<boolean>;
|
|
244
|
-
};
|
|
245
|
-
tabindex: {
|
|
246
|
-
type: _$vue.PropType<string | number>;
|
|
247
|
-
};
|
|
248
248
|
}>> & {
|
|
249
249
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
250
250
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -296,6 +296,16 @@ declare const Checkbox: {
|
|
|
296
296
|
ariaLabel: {
|
|
297
297
|
type: _$vue.PropType<string>;
|
|
298
298
|
};
|
|
299
|
+
id: {
|
|
300
|
+
type: _$vue.PropType<string>;
|
|
301
|
+
default: undefined;
|
|
302
|
+
};
|
|
303
|
+
tabindex: {
|
|
304
|
+
type: _$vue.PropType<string | number>;
|
|
305
|
+
};
|
|
306
|
+
border: {
|
|
307
|
+
type: _$vue.PropType<boolean>;
|
|
308
|
+
};
|
|
299
309
|
ariaControls: {
|
|
300
310
|
type: _$vue.PropType<string>;
|
|
301
311
|
};
|
|
@@ -325,16 +335,6 @@ declare const Checkbox: {
|
|
|
325
335
|
type: _$vue.PropType<string | number>;
|
|
326
336
|
default: undefined;
|
|
327
337
|
};
|
|
328
|
-
id: {
|
|
329
|
-
type: _$vue.PropType<string>;
|
|
330
|
-
default: undefined;
|
|
331
|
-
};
|
|
332
|
-
border: {
|
|
333
|
-
type: _$vue.PropType<boolean>;
|
|
334
|
-
};
|
|
335
|
-
tabindex: {
|
|
336
|
-
type: _$vue.PropType<string | number>;
|
|
337
|
-
};
|
|
338
338
|
}>> & {
|
|
339
339
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
340
340
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -387,6 +387,16 @@ declare const Checkbox: {
|
|
|
387
387
|
ariaLabel: {
|
|
388
388
|
type: _$vue.PropType<string>;
|
|
389
389
|
};
|
|
390
|
+
id: {
|
|
391
|
+
type: _$vue.PropType<string>;
|
|
392
|
+
default: undefined;
|
|
393
|
+
};
|
|
394
|
+
tabindex: {
|
|
395
|
+
type: _$vue.PropType<string | number>;
|
|
396
|
+
};
|
|
397
|
+
border: {
|
|
398
|
+
type: _$vue.PropType<boolean>;
|
|
399
|
+
};
|
|
390
400
|
ariaControls: {
|
|
391
401
|
type: _$vue.PropType<string>;
|
|
392
402
|
};
|
|
@@ -416,16 +426,6 @@ declare const Checkbox: {
|
|
|
416
426
|
type: _$vue.PropType<string | number>;
|
|
417
427
|
default: undefined;
|
|
418
428
|
};
|
|
419
|
-
id: {
|
|
420
|
-
type: _$vue.PropType<string>;
|
|
421
|
-
default: undefined;
|
|
422
|
-
};
|
|
423
|
-
border: {
|
|
424
|
-
type: _$vue.PropType<boolean>;
|
|
425
|
-
};
|
|
426
|
-
tabindex: {
|
|
427
|
-
type: _$vue.PropType<string | number>;
|
|
428
|
-
};
|
|
429
429
|
}>> & {
|
|
430
430
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
431
431
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -472,6 +472,16 @@ declare const Checkbox: {
|
|
|
472
472
|
ariaLabel: {
|
|
473
473
|
type: _$vue.PropType<string>;
|
|
474
474
|
};
|
|
475
|
+
id: {
|
|
476
|
+
type: _$vue.PropType<string>;
|
|
477
|
+
default: undefined;
|
|
478
|
+
};
|
|
479
|
+
tabindex: {
|
|
480
|
+
type: _$vue.PropType<string | number>;
|
|
481
|
+
};
|
|
482
|
+
border: {
|
|
483
|
+
type: _$vue.PropType<boolean>;
|
|
484
|
+
};
|
|
475
485
|
ariaControls: {
|
|
476
486
|
type: _$vue.PropType<string>;
|
|
477
487
|
};
|
|
@@ -501,16 +511,6 @@ declare const Checkbox: {
|
|
|
501
511
|
type: _$vue.PropType<string | number>;
|
|
502
512
|
default: undefined;
|
|
503
513
|
};
|
|
504
|
-
id: {
|
|
505
|
-
type: _$vue.PropType<string>;
|
|
506
|
-
default: undefined;
|
|
507
|
-
};
|
|
508
|
-
border: {
|
|
509
|
-
type: _$vue.PropType<boolean>;
|
|
510
|
-
};
|
|
511
|
-
tabindex: {
|
|
512
|
-
type: _$vue.PropType<string | number>;
|
|
513
|
-
};
|
|
514
514
|
}>> & {
|
|
515
515
|
"onUpdate:modelValue"?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
516
516
|
onChange?: ((val: _$element_plus0.CheckboxValueType) => any) | undefined;
|
|
@@ -77,16 +77,16 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
77
77
|
id: {
|
|
78
78
|
type: _$vue.PropType<string>;
|
|
79
79
|
};
|
|
80
|
-
tabindex: {
|
|
81
|
-
type: _$vue.PropType<string | number>;
|
|
82
|
-
default: 0;
|
|
83
|
-
};
|
|
84
80
|
showAlpha: {
|
|
85
81
|
type: _$vue.PropType<boolean>;
|
|
86
82
|
};
|
|
87
83
|
colorFormat: {
|
|
88
84
|
type: _$vue.PropType<string>;
|
|
89
85
|
};
|
|
86
|
+
tabindex: {
|
|
87
|
+
type: _$vue.PropType<string | number>;
|
|
88
|
+
default: 0;
|
|
89
|
+
};
|
|
90
90
|
appendTo: {
|
|
91
91
|
type: _$vue.PropType<string | HTMLElement>;
|
|
92
92
|
};
|
|
@@ -178,16 +178,16 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
178
178
|
id: {
|
|
179
179
|
type: _$vue.PropType<string>;
|
|
180
180
|
};
|
|
181
|
-
tabindex: {
|
|
182
|
-
type: _$vue.PropType<string | number>;
|
|
183
|
-
default: 0;
|
|
184
|
-
};
|
|
185
181
|
showAlpha: {
|
|
186
182
|
type: _$vue.PropType<boolean>;
|
|
187
183
|
};
|
|
188
184
|
colorFormat: {
|
|
189
185
|
type: _$vue.PropType<string>;
|
|
190
186
|
};
|
|
187
|
+
tabindex: {
|
|
188
|
+
type: _$vue.PropType<string | number>;
|
|
189
|
+
default: 0;
|
|
190
|
+
};
|
|
191
191
|
appendTo: {
|
|
192
192
|
type: _$vue.PropType<string | HTMLElement>;
|
|
193
193
|
};
|
|
@@ -19,10 +19,6 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
19
19
|
type: _$vue.PropType<boolean>;
|
|
20
20
|
default: boolean;
|
|
21
21
|
};
|
|
22
|
-
border: {
|
|
23
|
-
type: _$vue.PropType<boolean>;
|
|
24
|
-
default: boolean;
|
|
25
|
-
};
|
|
26
22
|
showAlpha: {
|
|
27
23
|
type: _$vue.PropType<boolean>;
|
|
28
24
|
};
|
|
@@ -32,6 +28,10 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
32
28
|
predefine: {
|
|
33
29
|
type: _$vue.PropType<string[]>;
|
|
34
30
|
};
|
|
31
|
+
border: {
|
|
32
|
+
type: _$vue.PropType<boolean>;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
35
|
}>> & {
|
|
36
36
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
37
37
|
}, {
|
|
@@ -63,10 +63,6 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
63
63
|
type: _$vue.PropType<boolean>;
|
|
64
64
|
default: boolean;
|
|
65
65
|
};
|
|
66
|
-
border: {
|
|
67
|
-
type: _$vue.PropType<boolean>;
|
|
68
|
-
default: boolean;
|
|
69
|
-
};
|
|
70
66
|
showAlpha: {
|
|
71
67
|
type: _$vue.PropType<boolean>;
|
|
72
68
|
};
|
|
@@ -76,6 +72,10 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
76
72
|
predefine: {
|
|
77
73
|
type: _$vue.PropType<string[]>;
|
|
78
74
|
};
|
|
75
|
+
border: {
|
|
76
|
+
type: _$vue.PropType<boolean>;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
79
|
}>> & {
|
|
80
80
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
81
81
|
}, {
|
|
@@ -102,10 +102,6 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
102
102
|
type: _$vue.PropType<boolean>;
|
|
103
103
|
default: boolean;
|
|
104
104
|
};
|
|
105
|
-
border: {
|
|
106
|
-
type: _$vue.PropType<boolean>;
|
|
107
|
-
default: boolean;
|
|
108
|
-
};
|
|
109
105
|
showAlpha: {
|
|
110
106
|
type: _$vue.PropType<boolean>;
|
|
111
107
|
};
|
|
@@ -115,6 +111,10 @@ declare const ColorPickerPanel: _$element_plus_es_utils_index_mjs0.SFCWithInstal
|
|
|
115
111
|
predefine: {
|
|
116
112
|
type: _$vue.PropType<string[]>;
|
|
117
113
|
};
|
|
114
|
+
border: {
|
|
115
|
+
type: _$vue.PropType<boolean>;
|
|
116
|
+
default: boolean;
|
|
117
|
+
};
|
|
118
118
|
}>> & {
|
|
119
119
|
"onUpdate:modelValue"?: ((val: string | null) => any) | undefined;
|
|
120
120
|
}, {
|
|
@@ -11,7 +11,7 @@ declare const composeFormCollapse: {
|
|
|
11
11
|
type: _$vue.PropType<IFormCollapse>;
|
|
12
12
|
};
|
|
13
13
|
activeKey: {
|
|
14
|
-
type: (
|
|
14
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
15
15
|
};
|
|
16
16
|
}>> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
17
17
|
P: {};
|
|
@@ -25,7 +25,7 @@ declare const composeFormCollapse: {
|
|
|
25
25
|
type: _$vue.PropType<IFormCollapse>;
|
|
26
26
|
};
|
|
27
27
|
activeKey: {
|
|
28
|
-
type: (
|
|
28
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
29
29
|
};
|
|
30
30
|
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
31
31
|
__isFragment?: never;
|
|
@@ -36,7 +36,7 @@ declare const composeFormCollapse: {
|
|
|
36
36
|
type: _$vue.PropType<IFormCollapse>;
|
|
37
37
|
};
|
|
38
38
|
activeKey: {
|
|
39
|
-
type: (
|
|
39
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
40
40
|
};
|
|
41
41
|
}>> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & {
|
|
42
42
|
Item: _$vue.DefineComponent<{}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent,
|
|
1
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, unref, useAttrs } from "vue";
|
|
2
2
|
//#region src/form-grid/form-grid-column.vue
|
|
3
3
|
const _hoisted_1 = ["data-grid-span"];
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
name: "FFormGridColumn",
|
|
6
|
+
inheritAttrs: false,
|
|
6
7
|
__name: "form-grid-column",
|
|
7
8
|
props: { gridSpan: {
|
|
8
9
|
type: Number,
|
|
@@ -10,15 +11,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
11
|
} },
|
|
11
12
|
setup(__props) {
|
|
12
13
|
const props = __props;
|
|
14
|
+
const attrs = useAttrs();
|
|
13
15
|
const gridColumnStyle = computed(() => {
|
|
14
16
|
if (props.gridSpan === -1) return {};
|
|
15
17
|
return { gridColumn: `span ${props.gridSpan} / auto` };
|
|
16
18
|
});
|
|
17
19
|
return (_ctx, _cache) => {
|
|
18
|
-
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" @silver-formily/grid 会优先使用这个值,如果没有会自动生成 "), createElementVNode("div", {
|
|
20
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" @silver-formily/grid 会优先使用这个值,如果没有会自动生成 "), createElementVNode("div", mergeProps(unref(attrs), {
|
|
19
21
|
"data-grid-span": props.gridSpan,
|
|
20
|
-
style:
|
|
21
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
22
|
+
style: gridColumnStyle.value
|
|
23
|
+
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1)], 2112);
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-grid-column.mjs","names":[],"sources":["../../src/form-grid/form-grid-column.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from 'vue'\n\ndefineOptions({\n name: 'FFormGridColumn',\n})\n\nconst props = defineProps({\n gridSpan: {\n type: Number,\n default: 1,\n },\n})\n\nconst gridColumnStyle = computed(() => {\n if (props.gridSpan === -1) {\n // gridSpan=-1 means \"fill remaining columns in current row\".\n // Leave gridColumn unset so @silver-formily/grid can manage it dynamically.\n return {}\n }\n return {\n gridColumn: `span ${props.gridSpan} / auto`,\n }\n})\n</script>\n\n<template>\n <!-- @silver-formily/grid 会优先使用这个值,如果没有会自动生成 -->\n <div :data-grid-span=\"props.gridSpan\" :style=\"gridColumnStyle\">\n <slot />\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-grid-column.mjs","names":[],"sources":["../../src/form-grid/form-grid-column.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed, useAttrs } from 'vue'\n\ndefineOptions({\n name: 'FFormGridColumn',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n gridSpan: {\n type: Number,\n default: 1,\n },\n})\n\nconst attrs = useAttrs()\n\nconst gridColumnStyle = computed(() => {\n if (props.gridSpan === -1) {\n // gridSpan=-1 means \"fill remaining columns in current row\".\n // Leave gridColumn unset so @silver-formily/grid can manage it dynamically.\n return {}\n }\n return {\n gridColumn: `span ${props.gridSpan} / auto`,\n }\n})\n</script>\n\n<template>\n <!-- @silver-formily/grid 会优先使用这个值,如果没有会自动生成 -->\n <div v-bind=\"attrs\" :data-grid-span=\"props.gridSpan\" :style=\"gridColumnStyle\">\n <slot />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EAQA,MAAM,QAAQ;EAOd,MAAM,QAAQ,UAAS;EAEvB,MAAM,kBAAkB,eAAe;AACrC,OAAI,MAAM,aAAa,GAGrB,QAAO,EAAC;AAEV,UAAO,EACL,YAAY,QAAQ,MAAM,SAAS,UACrC;IACD;;2DAIC,mBAAA,4CAAgD,EAChD,mBAEM,OAFN,WAAa,MAEP,MAFY,EAAA;IAAG,kBAAgB,MAAM;IAAW,OAAO,gBAAA;QAC3D,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,IAAA,WAAA,CAAA,EAAA,KAAA"}
|
|
@@ -19,10 +19,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
19
19
|
size: {
|
|
20
20
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
21
21
|
};
|
|
22
|
-
readonly: {
|
|
23
|
-
type: _$vue.PropType<boolean>;
|
|
24
|
-
default: boolean;
|
|
25
|
-
};
|
|
26
22
|
placeholder: {
|
|
27
23
|
type: _$vue.PropType<string>;
|
|
28
24
|
};
|
|
@@ -34,6 +30,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
34
30
|
type: _$vue.PropType<number | "min" | "max">;
|
|
35
31
|
default: null;
|
|
36
32
|
};
|
|
33
|
+
readonly: {
|
|
34
|
+
type: _$vue.PropType<boolean>;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
37
|
ariaLabel: {
|
|
38
38
|
type: _$vue.PropType<string>;
|
|
39
39
|
};
|
|
@@ -41,6 +41,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
41
41
|
type: _$vue.PropType<string>;
|
|
42
42
|
default: undefined;
|
|
43
43
|
};
|
|
44
|
+
inputmode: {
|
|
45
|
+
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
44
48
|
min: {
|
|
45
49
|
type: _$vue.PropType<number>;
|
|
46
50
|
default: number;
|
|
@@ -49,10 +53,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
49
53
|
type: _$vue.PropType<number>;
|
|
50
54
|
default: number;
|
|
51
55
|
};
|
|
52
|
-
inputmode: {
|
|
53
|
-
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
54
|
-
default: undefined;
|
|
55
|
-
};
|
|
56
56
|
align: {
|
|
57
57
|
type: _$vue.PropType<"right" | "left" | "center">;
|
|
58
58
|
default: string;
|
|
@@ -129,10 +129,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
129
129
|
size: {
|
|
130
130
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
131
131
|
};
|
|
132
|
-
readonly: {
|
|
133
|
-
type: _$vue.PropType<boolean>;
|
|
134
|
-
default: boolean;
|
|
135
|
-
};
|
|
136
132
|
placeholder: {
|
|
137
133
|
type: _$vue.PropType<string>;
|
|
138
134
|
};
|
|
@@ -144,6 +140,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
144
140
|
type: _$vue.PropType<number | "min" | "max">;
|
|
145
141
|
default: null;
|
|
146
142
|
};
|
|
143
|
+
readonly: {
|
|
144
|
+
type: _$vue.PropType<boolean>;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
147
147
|
ariaLabel: {
|
|
148
148
|
type: _$vue.PropType<string>;
|
|
149
149
|
};
|
|
@@ -151,6 +151,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
151
151
|
type: _$vue.PropType<string>;
|
|
152
152
|
default: undefined;
|
|
153
153
|
};
|
|
154
|
+
inputmode: {
|
|
155
|
+
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
156
|
+
default: undefined;
|
|
157
|
+
};
|
|
154
158
|
min: {
|
|
155
159
|
type: _$vue.PropType<number>;
|
|
156
160
|
default: number;
|
|
@@ -159,10 +163,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
159
163
|
type: _$vue.PropType<number>;
|
|
160
164
|
default: number;
|
|
161
165
|
};
|
|
162
|
-
inputmode: {
|
|
163
|
-
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
164
|
-
default: undefined;
|
|
165
|
-
};
|
|
166
166
|
align: {
|
|
167
167
|
type: _$vue.PropType<"right" | "left" | "center">;
|
|
168
168
|
default: string;
|
|
@@ -230,10 +230,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
230
230
|
size: {
|
|
231
231
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
232
232
|
};
|
|
233
|
-
readonly: {
|
|
234
|
-
type: _$vue.PropType<boolean>;
|
|
235
|
-
default: boolean;
|
|
236
|
-
};
|
|
237
233
|
placeholder: {
|
|
238
234
|
type: _$vue.PropType<string>;
|
|
239
235
|
};
|
|
@@ -245,6 +241,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
245
241
|
type: _$vue.PropType<number | "min" | "max">;
|
|
246
242
|
default: null;
|
|
247
243
|
};
|
|
244
|
+
readonly: {
|
|
245
|
+
type: _$vue.PropType<boolean>;
|
|
246
|
+
default: boolean;
|
|
247
|
+
};
|
|
248
248
|
ariaLabel: {
|
|
249
249
|
type: _$vue.PropType<string>;
|
|
250
250
|
};
|
|
@@ -252,6 +252,10 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
252
252
|
type: _$vue.PropType<string>;
|
|
253
253
|
default: undefined;
|
|
254
254
|
};
|
|
255
|
+
inputmode: {
|
|
256
|
+
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
257
|
+
default: undefined;
|
|
258
|
+
};
|
|
255
259
|
min: {
|
|
256
260
|
type: _$vue.PropType<number>;
|
|
257
261
|
default: number;
|
|
@@ -260,10 +264,6 @@ declare const InputNumber: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
260
264
|
type: _$vue.PropType<number>;
|
|
261
265
|
default: number;
|
|
262
266
|
};
|
|
263
|
-
inputmode: {
|
|
264
|
-
type: _$vue.PropType<"search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal">;
|
|
265
|
-
default: undefined;
|
|
266
|
-
};
|
|
267
267
|
align: {
|
|
268
268
|
type: _$vue.PropType<"right" | "left" | "center">;
|
|
269
269
|
default: string;
|
|
@@ -2,12 +2,14 @@ import { useCleanAttrs } from "../__builtins__/shared/utils.mjs";
|
|
|
2
2
|
import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
3
3
|
import { usePreviewConfig } from "./utils.mjs";
|
|
4
4
|
import { ElSpace, ElTag, ElText } from "element-plus";
|
|
5
|
+
import { formilyComputed } from "@silver-formily/reactive-vue";
|
|
5
6
|
import { Fragment, createBlock, createElementBlock, createTextVNode, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
6
7
|
import { useField } from "@silver-formily/vue";
|
|
7
8
|
import { isValid } from "@formily/shared";
|
|
8
9
|
//#region src/preview-text/select.vue
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
11
|
name: "FPreviewTextSelect",
|
|
12
|
+
inheritAttrs: false,
|
|
11
13
|
__name: "select",
|
|
12
14
|
props: { modelValue: {} },
|
|
13
15
|
setup(__props) {
|
|
@@ -15,19 +17,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
17
|
const prefixCls = `${stylePrefix}-preview-text`;
|
|
16
18
|
const fieldRef = useField();
|
|
17
19
|
const { props: attrs } = useCleanAttrs();
|
|
18
|
-
const dataSource = fieldRef.value.dataSource ?? [];
|
|
19
20
|
const { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig();
|
|
21
|
+
const dataSource = formilyComputed(() => fieldRef.value?.dataSource ?? []);
|
|
22
|
+
function getOptionLabel(value) {
|
|
23
|
+
return dataSource.value.find((i) => i.value === value)?.label ?? value;
|
|
24
|
+
}
|
|
20
25
|
return (_ctx, _cache) => {
|
|
21
26
|
return openBlock(), createElementBlock("div", { class: normalizeClass(prefixCls) }, [!unref(isValid)(props.modelValue) ? (openBlock(), createBlock(unref(ElText), normalizeProps(mergeProps({ key: 0 }, unref(textProps))), {
|
|
22
27
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(placeholder)), 1)]),
|
|
23
28
|
_: 1
|
|
24
29
|
}, 16)) : !unref(attrs).multiple ? (openBlock(), createBlock(unref(ElText), normalizeProps(mergeProps({ key: 1 }, unref(textProps))), {
|
|
25
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
30
|
+
default: withCtx(() => [createTextVNode(toDisplayString(getOptionLabel(props.modelValue)), 1)]),
|
|
26
31
|
_: 1
|
|
27
32
|
}, 16)) : (openBlock(), createBlock(unref(ElSpace), normalizeProps(mergeProps({ key: 2 }, unref(spaceProps))), {
|
|
28
33
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.modelValue, (item, key) => {
|
|
29
34
|
return openBlock(), createBlock(unref(ElTag), mergeProps({ key }, { ref_for: true }, unref(tagProps)), {
|
|
30
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
35
|
+
default: withCtx(() => [createTextVNode(toDisplayString(getOptionLabel(item)), 1)]),
|
|
31
36
|
_: 2
|
|
32
37
|
}, 1040);
|
|
33
38
|
}), 128))]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.mjs","names":[],"sources":["../../src/preview-text/select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { isValid } from '@formily/shared'\nimport { useField } from '@silver-formily/vue'\nimport { ElSpace, ElTag, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextSelect',\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst prefixCls = `${stylePrefix}-preview-text`\n\nconst fieldRef = useField<Field>()\nconst { props: attrs } = useCleanAttrs()\nconst dataSource = fieldRef.value
|
|
1
|
+
{"version":3,"file":"select.mjs","names":[],"sources":["../../src/preview-text/select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Field } from '@formily/core'\nimport { isValid } from '@formily/shared'\nimport { formilyComputed } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { ElSpace, ElTag, ElText } from 'element-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { usePreviewConfig } from './utils'\n\ndefineOptions({\n name: 'FPreviewTextSelect',\n inheritAttrs: false,\n})\n\nconst props = defineProps<{\n modelValue?: any\n}>()\n\nconst prefixCls = `${stylePrefix}-preview-text`\n\nconst fieldRef = useField<Field>()\nconst { props: attrs } = useCleanAttrs()\nconst { spaceProps, textProps, tagProps, placeholder } = usePreviewConfig()\nconst dataSource = formilyComputed(() => fieldRef.value?.dataSource ?? [])\n\nfunction getOptionLabel(value: any) {\n return dataSource.value.find(i => i.value === value)?.label ?? value\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <template v-if=\"!isValid(props.modelValue)\">\n <ElText v-bind=\"textProps\">\n {{ placeholder }}\n </ElText>\n </template>\n <template v-else-if=\"!attrs.multiple\">\n <ElText v-bind=\"textProps\">\n {{ getOptionLabel(props.modelValue) }}\n </ElText>\n </template>\n <ElSpace v-else v-bind=\"spaceProps\">\n <ElTag v-for=\"(item, key) of props.modelValue\" :key=\"key\" v-bind=\"tagProps\">\n {{ getOptionLabel(item) }}\n </ElTag>\n </ElSpace>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAId,MAAM,YAAY,GAAG,YAAY;EAEjC,MAAM,WAAW,UAAgB;EACjC,MAAM,EAAE,OAAO,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|
|
17
18
|
schemaField: {},
|
|
18
19
|
components: { default: () => ({}) },
|
|
19
20
|
scope: {},
|
|
20
|
-
throttleWait: { default: 300 }
|
|
21
|
+
throttleWait: { default: 300 },
|
|
22
|
+
onAutoSubmit: {},
|
|
23
|
+
onAutoSubmitFailed: {}
|
|
21
24
|
},
|
|
22
25
|
emits: ["autoSubmit", "autoSubmitFailed"],
|
|
23
26
|
setup(__props, { emit: __emit }) {
|
|
@@ -29,22 +32,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
29
32
|
const fieldSchemaRef = useFieldSchema();
|
|
30
33
|
const prefixCls = `${stylePrefix}-query-form-light`;
|
|
31
34
|
const { externalForm, activeForm } = useQueryFormForm({
|
|
32
|
-
formProps,
|
|
35
|
+
formProps: computed(() => ({ form: props.form })),
|
|
33
36
|
fallbackForm: formRef
|
|
34
37
|
});
|
|
35
38
|
const resolvedSchema = computed(() => props.schema ?? fieldSchemaRef.value);
|
|
36
39
|
const innerFormProps = computed(() => ({
|
|
37
40
|
fullness: false,
|
|
38
41
|
...formProps.value,
|
|
39
|
-
form: externalForm.value
|
|
42
|
+
form: externalForm.value,
|
|
43
|
+
onAutoSubmit: props.onAutoSubmit,
|
|
44
|
+
onAutoSubmitFailed: props.onAutoSubmitFailed
|
|
40
45
|
}));
|
|
41
46
|
function submitByChange() {
|
|
42
|
-
activeForm.value
|
|
47
|
+
const form = activeForm.value;
|
|
48
|
+
if (!form) return;
|
|
49
|
+
form.submit((values) => {
|
|
43
50
|
emit("autoSubmit", values);
|
|
44
|
-
return
|
|
51
|
+
return props.onAutoSubmit?.(values);
|
|
45
52
|
}).catch((error) => {
|
|
46
53
|
emit("autoSubmitFailed", error);
|
|
47
|
-
|
|
54
|
+
props.onAutoSubmitFailed?.(error);
|
|
48
55
|
});
|
|
49
56
|
}
|
|
50
57
|
const triggerSubmit = throttle(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-form-light.mjs","names":[],"sources":["../../src/query-form/query-form-light.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Form } from '@formily/core'\nimport type { IQueryFormLightProps } from './types'\nimport { toJS } from '@formily/reactive'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { useFieldSchema, useForm } from '@silver-formily/vue'\nimport { throttle } from 'lodash-es'\nimport { computed, onUnmounted, useSlots } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { Form as FForm } from '../form'\nimport { useQueryFormForm, useQueryFormSchemaField } from './hooks'\n\ndefineOptions({\n name: 'FQueryFormLight',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IQueryFormLightProps>(), {\n components: () => ({}),\n throttleWait: 300,\n})\nconst emit = defineEmits<{\n (e: 'autoSubmit', values: Form['values']): void\n (e: 'autoSubmitFailed', error: any): void\n}>()\n\nconst { props: formProps } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\nconst slots = useSlots()\nconst formRef = useForm()\nconst fieldSchemaRef = useFieldSchema()\nconst prefixCls = `${stylePrefix}-query-form-light`\n\nconst { externalForm, activeForm } = useQueryFormForm({\n formProps,\n fallbackForm: formRef,\n})\nconst resolvedSchema = computed(() => props.schema ?? fieldSchemaRef.value)\n\nconst innerFormProps = computed(() => ({\n fullness: false,\n ...formProps.value,\n form: externalForm.value,\n}))\n\nfunction submitByChange() {\n const form = activeForm.value\n form\n .submit((values) => {\n emit('autoSubmit', values)\n return
|
|
1
|
+
{"version":3,"file":"query-form-light.mjs","names":[],"sources":["../../src/query-form/query-form-light.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Form } from '@formily/core'\nimport type { IQueryFormLightProps } from './types'\nimport { toJS } from '@formily/reactive'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { useFieldSchema, useForm } from '@silver-formily/vue'\nimport { throttle } from 'lodash-es'\nimport { computed, onUnmounted, useSlots } from 'vue'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { Form as FForm } from '../form'\nimport { useQueryFormForm, useQueryFormSchemaField } from './hooks'\n\ndefineOptions({\n name: 'FQueryFormLight',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IQueryFormLightProps>(), {\n components: () => ({}),\n throttleWait: 300,\n})\nconst emit = defineEmits<{\n (e: 'autoSubmit', values: Form['values']): void\n (e: 'autoSubmitFailed', error: any): void\n}>()\n\nconst { props: formProps } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\nconst slots = useSlots()\nconst formRef = useForm()\nconst fieldSchemaRef = useFieldSchema()\nconst prefixCls = `${stylePrefix}-query-form-light`\n\nconst { externalForm, activeForm } = useQueryFormForm({\n formProps: computed(() => ({ form: props.form })),\n fallbackForm: formRef,\n})\nconst resolvedSchema = computed(() => props.schema ?? fieldSchemaRef.value)\n\nconst innerFormProps = computed(() => ({\n fullness: false,\n ...formProps.value,\n form: externalForm.value,\n onAutoSubmit: props.onAutoSubmit,\n onAutoSubmitFailed: props.onAutoSubmitFailed,\n}))\n\nfunction submitByChange() {\n const form = activeForm.value\n if (!form)\n return\n form\n .submit((values) => {\n emit('autoSubmit', values)\n return props.onAutoSubmit?.(values)\n })\n .catch((error) => {\n emit('autoSubmitFailed', error)\n props.onAutoSubmitFailed?.(error)\n })\n}\n\nconst triggerSubmit = throttle(() => {\n submitByChange()\n}, props.throttleWait, {\n leading: false,\n trailing: true,\n})\n\nreactionWatch(() => {\n const form = activeForm.value\n if (!form)\n return\n return toJS(form.values)\n}, () => {\n triggerSubmit()\n})\n\nonUnmounted(() => {\n triggerSubmit.cancel()\n})\n\nconst { hasDefaultSlot, schemaField } = useQueryFormSchemaField({\n slots,\n schema: resolvedSchema,\n schemaField: computed(() => props.schemaField),\n components: computed(() => props.components),\n})\n</script>\n\n<template>\n <FForm v-bind=\"innerFormProps\" :class=\"prefixCls\">\n <div :class=\"`${prefixCls}__content`\">\n <slot v-if=\"hasDefaultSlot\" />\n <component\n :is=\"schemaField\"\n v-else-if=\"schemaField\"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ATqB,EAAG,OAAO,WAAS,CAAA,EAAA;2BAQxC,CAPN,mBAOM,OAAA,EAPA,OAAK,eAAA,GAAK,UAAS,WAAA,EAAA,EAAA,CACX,MAAA,eAAc,GAA1B,WAA8B,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,GAGjB,MAAA,YAAW,IAAA,WAAA,EAFxB,YAIE,wBAHK,MAAA,YAAW,CAAA,EAAA;;KAEf,QAAQ,eAAA"}
|
|
@@ -20,6 +20,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
inheritAttrs: false,
|
|
21
21
|
__name: "query-form",
|
|
22
22
|
props: {
|
|
23
|
+
form: {},
|
|
23
24
|
schema: {},
|
|
24
25
|
schemaField: {},
|
|
25
26
|
components: { default: () => ({}) },
|
|
@@ -51,7 +52,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
51
52
|
default: true
|
|
52
53
|
},
|
|
53
54
|
submitProps: {},
|
|
54
|
-
resetProps: {}
|
|
55
|
+
resetProps: {},
|
|
56
|
+
onAutoSubmit: {},
|
|
57
|
+
onAutoSubmitFailed: {}
|
|
55
58
|
},
|
|
56
59
|
setup(__props) {
|
|
57
60
|
const props = __props;
|
|
@@ -60,14 +63,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
63
|
const prefixCls = `${stylePrefix}-query-form`;
|
|
61
64
|
const FormGridColumn = FormGrid.GridColumn;
|
|
62
65
|
const fieldSchemaRef = useFieldSchema();
|
|
66
|
+
const formRef = useForm();
|
|
63
67
|
const { externalForm, activeForm } = useQueryFormForm({
|
|
64
|
-
formProps,
|
|
65
|
-
fallbackForm:
|
|
68
|
+
formProps: computed(() => ({ form: props.form })),
|
|
69
|
+
fallbackForm: formRef
|
|
66
70
|
});
|
|
67
71
|
const innerFormProps = computed(() => ({
|
|
68
72
|
fullness: true,
|
|
69
73
|
...formProps.value,
|
|
70
|
-
form: externalForm.value
|
|
74
|
+
form: externalForm.value,
|
|
75
|
+
onAutoSubmit: props.onAutoSubmit,
|
|
76
|
+
onAutoSubmitFailed: props.onAutoSubmitFailed
|
|
71
77
|
}));
|
|
72
78
|
const schemaList = computed(() => {
|
|
73
79
|
const rawSchema = props.schema ?? fieldSchemaRef.value;
|
|
@@ -108,8 +114,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
108
114
|
return (props.visibleWhen ? props.visibleWhen(context) : defaultVisibleWhen(context)) !== false;
|
|
109
115
|
}
|
|
110
116
|
function isActionsNode(node, grid) {
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
const isLastNode = node.index === grid.childSize - 1;
|
|
118
|
+
if ("element" in node && node.element) return node.element.dataset.queryFormActions !== void 0 || isLastNode;
|
|
119
|
+
return isLastNode;
|
|
113
120
|
}
|
|
114
121
|
function getFieldRowCount(grid) {
|
|
115
122
|
const rows = (grid.children ?? []).filter((node) => !isActionsNode(node, grid)).map((node) => node.shadowRow ?? 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-form.mjs","names":[],"sources":["../../src/query-form/query-form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ISchema } from '@formily/json-schema'\nimport type { Grid, GridNode, IGridOptions } from '@silver-formily/grid'\nimport type { IQueryFormProps, SchemaEntry } from './types'\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\nimport { Schema } from '@formily/json-schema'\nimport { createGrid } from '@silver-formily/grid'\nimport { autorunEffect } from '@silver-formily/reactive-vue'\nimport { useFieldSchema, useForm } from '@silver-formily/vue'\nimport { ElIcon, ElLink } from 'element-plus'\nimport { computed, ref, useSlots } from 'vue'\nimport { compatibleUnderlineProp, stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { Form } from '../form'\nimport { FormButtonGroup } from '../form-button-group'\nimport { FormGrid } from '../form-grid'\nimport { Reset } from '../reset'\nimport { Submit } from '../submit'\nimport { useQueryFormForm, useQueryFormSchemaField } from './hooks'\n\ndefineOptions({\n name: 'FQueryForm',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IQueryFormProps>(), {\n components: () => ({}),\n gridProps: () => ({}),\n defaultExpanded: false,\n showToggle: true,\n actionsAtRowEnd: false,\n submitText: '查询',\n resetText: '重置',\n expandText: '展开',\n collapseText: '收起',\n showSubmit: true,\n showReset: true,\n})\n\nconst { props: formProps } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\nconst slots = useSlots()\nconst prefixCls = `${stylePrefix}-query-form`\nconst FormGridColumn = FormGrid.GridColumn\n\nconst COLLAPSED_ROWS = 1\nconst fieldSchemaRef = useFieldSchema()\nconst formRef = useForm()\nconst { externalForm, activeForm } = useQueryFormForm({\n formProps,\n fallbackForm: formRef,\n})\nconst innerFormProps = computed(() => ({\n fullness: true,\n ...formProps.value,\n form: externalForm.value,\n}))\n\nconst schemaList = computed<SchemaEntry[]>(() => {\n const rawSchema = props.schema ?? fieldSchemaRef.value\n /* istanbul ignore next -- @preserve defensive: schema can be temporarily absent in external field-schema lifecycle */\n if (!rawSchema)\n return []\n const schema = rawSchema instanceof Schema ? rawSchema : new Schema(rawSchema)\n return schema.mapProperties((childSchema: ISchema, name: string | number) => ({\n name,\n schema: childSchema,\n }))\n})\n\nfunction resolveField(name?: string | number) {\n return activeForm.value?.query(name).take()\n}\n\nfunction createVisibleContext(\n node: GridNode,\n grid: Grid<HTMLElement>,\n collapsedOverride?: boolean,\n) {\n const index = node.index ?? 0\n const entry = schemaList.value[index]\n const schema = entry?.schema\n const name = entry?.name ?? schema?.name\n return {\n field: resolveField(name),\n schema,\n index,\n node,\n grid,\n collapsed: collapsedOverride ?? grid.maxRows !== Infinity,\n breakpoint: grid.breakpoint,\n }\n}\n\nfunction defaultVisibleWhen(context: ReturnType<typeof createVisibleContext>) {\n if (!context.collapsed)\n return true\n\n const shadowRow = context.node.shadowRow ?? 0\n const withinRows = shadowRow < COLLAPSED_ROWS + 1\n if (!withinRows)\n return false\n\n const isCollapsible = getFieldRowCount(context.grid) > COLLAPSED_ROWS\n if (!isCollapsible)\n return true\n const shadowColumn = context.node.shadowColumn ?? 1\n const span = context.node.span ?? 1\n const endColumn = shadowColumn + span - 1\n if (shadowRow === COLLAPSED_ROWS && endColumn === context.grid.columns)\n return false\n\n return true\n}\n\nfunction resolveVisibleWhen(context: ReturnType<typeof createVisibleContext>) {\n const visible = props.visibleWhen\n ? props.visibleWhen(context)\n : defaultVisibleWhen(context)\n return visible !== false\n}\n\nfunction isActionsNode(node: GridNode, grid: Grid<HTMLElement>) {\n if ('element' in node && node.element) {\n return node.element.dataset.queryFormActions !== undefined\n }\n return node.index === grid.childSize - 1\n}\n\nfunction getFieldRowCount(grid: Grid<HTMLElement>) {\n const rows = (grid.children ?? [])\n .filter(node => !isActionsNode(node, grid))\n .map(node => node.shadowRow ?? 0)\n return new Set(rows).size\n}\n\nconst defaultShouldVisible: IGridOptions['shouldVisible'] = (node, grid) => {\n if (isActionsNode(node, grid))\n return true\n return resolveVisibleWhen(createVisibleContext(node, grid))\n}\n\nconst restGridProps = props.gridProps ?? {}\nconst defaultGridProps: Partial<IGridOptions> = restGridProps.minColumns === undefined && restGridProps.maxColumns === undefined\n ? { maxColumns: 4 }\n : {}\n\nconst gridOptions: IGridOptions = {\n ...defaultGridProps,\n ...restGridProps,\n maxRows: (props.defaultExpanded || !props.showToggle) ? Infinity : COLLAPSED_ROWS,\n shouldVisible: defaultShouldVisible,\n}\n\nconst grid = createGrid(gridOptions)\n\nconst expanded = ref(grid.maxRows === Infinity)\nconst gridType = ref<'incomplete-wrap' | 'collapsible' | 'complete-wrap'>('complete-wrap')\n\nfunction updateType() {\n if (!props.showToggle) {\n gridType.value = 'incomplete-wrap'\n return\n }\n\n if (!props.visibleWhen) {\n gridType.value = getFieldRowCount(grid) > COLLAPSED_ROWS\n ? 'collapsible'\n : 'incomplete-wrap'\n return\n }\n\n const nodes = grid.children ?? []\n const hasHiddenInCollapsed = nodes.some((node) => {\n if (isActionsNode(node, grid))\n return false\n return !resolveVisibleWhen(createVisibleContext(node, grid, true))\n })\n /* istanbul ignore next -- @preserve layout branch depends on runtime grid measurement in browser */\n if (hasHiddenInCollapsed) {\n gridType.value = 'collapsible'\n return\n }\n const realRows = grid.shadowRows\n gridType.value = realRows < COLLAPSED_ROWS + 1 ? 'incomplete-wrap' : 'complete-wrap'\n}\n\nautorunEffect(() => {\n expanded.value = grid.maxRows === Infinity\n updateType()\n})\n\nfunction toggle() {\n if (!props.showToggle)\n return\n grid.maxRows = grid.maxRows === Infinity ? COLLAPSED_ROWS : Infinity\n}\n\nconst { hasDefaultSlot, schemaField } = useQueryFormSchemaField({\n slots,\n schema: computed(() => props.schema),\n schemaField: computed(() => props.schemaField),\n components: computed(() => props.components),\n scope: computed(() => props.scope),\n})\n</script>\n\n<template>\n <Form v-bind=\"innerFormProps\" :class=\"prefixCls\">\n <FormGrid :grid=\"grid\">\n <slot v-if=\"hasDefaultSlot\" />\n <component\n :is=\"schemaField\"\n v-else-if=\"schemaField\"\n :schema=\"props.schema\"\n />\n <FormGridColumn\n :grid-span=\"-1\"\n data-query-form-actions\n :class=\"[\n `${prefixCls}__actions`,\n props.actionsAtRowEnd && `${prefixCls}__actions--row-end`,\n ]\"\n >\n <template v-if=\"gridType === 'incomplete-wrap'\">\n <FormButtonGroup\n :align=\"props.actionsAtRowEnd ? 'right' : 'left'\"\n align-form-item\n inline\n :style=\"props.actionsAtRowEnd && { width: '100%' }\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n </FormButtonGroup>\n </template>\n <template v-else-if=\"gridType === 'collapsible' && props.showToggle\">\n <FormButtonGroup\n :align=\"props.actionsAtRowEnd ? 'right' : 'left'\"\n align-form-item\n inline\n :style=\"props.actionsAtRowEnd && { width: '100%' }\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n <slot\n name=\"collapse\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <ElLink\n type=\"primary\"\n :underline=\"compatibleUnderlineProp()\"\n :class=\"`${prefixCls}__collapse-link`\"\n @click=\"toggle\"\n >\n {{ expanded ? props.collapseText : props.expandText }}\n <ElIcon :class=\"`${prefixCls}__collapse-icon`\">\n <ArrowUp v-if=\"expanded\" />\n <ArrowDown v-else />\n </ElIcon>\n </ElLink>\n </slot>\n </FormButtonGroup>\n </template>\n <template v-else>\n <FormButtonGroup\n align=\"right\"\n inline\n style=\"display: flex; width: 100%;\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n </FormButtonGroup>\n </template>\n </FormGridColumn>\n </FormGrid>\n </Form>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAnBvB,MAAM,QAAQ;EAcd,MAAM,EAAE,OAAO,cAAc,cAAc,CAAC,cAAc,sBAAsB,CAAA;EAChF,MAAM,QAAQ,UAAS;EACvB,MAAM,YAAY,GAAG,YAAY;EACjC,MAAM,iBAAiB,SAAS;EAGhC,MAAM,iBAAiB,gBAAe;EAEtC,MAAM,EAAE,cAAc,eAAe,iBAAiB;GACpD;GACA,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AAA,CAAA,EAAA,CAAA;;;;;;iDAO5B,YAkBkB,MAAA,gBAAA,EAAA;;OAjBhB,OAAM;OACN,QAAA;OACA,OAAA;QAAA,WAAA;QAAA,SAAA;QAAmC;;8BAc5B,CAZP,WAYO,KAAA,QAAA,WAAA;QAVJ,UAAU,SAAA;QACF;QACR,MAAM,SAAA;gBAQF,CANS,MAAM,cAAA,WAAA,EAApB,YAES,MAAA,OAAA,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAF+B,MAAM,YAAW,CAAA,EAAA;+BACjC,CAAA,gBAAA,gBAAnB,MAAM,WAAU,EAAA,EAAA,CAAA,CAAA;;mDAER,MAAM,aAAA,WAAA,EAAnB,YAEQ,MAAA,MAAA,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAF8B,MAAM,WAAU,CAAA,EAAA;+BAC/B,CAAA,gBAAA,gBAAlB,MAAM,UAAS,EAAA,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"query-form.mjs","names":[],"sources":["../../src/query-form/query-form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ISchema } from '@formily/json-schema'\nimport type { Grid, GridNode, IGridOptions } from '@silver-formily/grid'\nimport type { IQueryFormProps, SchemaEntry } from './types'\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\nimport { Schema } from '@formily/json-schema'\nimport { createGrid } from '@silver-formily/grid'\nimport { autorunEffect } from '@silver-formily/reactive-vue'\nimport { useFieldSchema, useForm } from '@silver-formily/vue'\nimport { ElIcon, ElLink } from 'element-plus'\nimport { computed, ref, useSlots } from 'vue'\nimport { compatibleUnderlineProp, stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { Form } from '../form'\nimport { FormButtonGroup } from '../form-button-group'\nimport { FormGrid } from '../form-grid'\nimport { Reset } from '../reset'\nimport { Submit } from '../submit'\nimport { useQueryFormForm, useQueryFormSchemaField } from './hooks'\n\ndefineOptions({\n name: 'FQueryForm',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<IQueryFormProps>(), {\n components: () => ({}),\n gridProps: () => ({}),\n defaultExpanded: false,\n showToggle: true,\n actionsAtRowEnd: false,\n submitText: '查询',\n resetText: '重置',\n expandText: '展开',\n collapseText: '收起',\n showSubmit: true,\n showReset: true,\n})\n\nconst { props: formProps } = useCleanAttrs(['modelValue', 'onUpdate:modelValue'])\nconst slots = useSlots()\nconst prefixCls = `${stylePrefix}-query-form`\nconst FormGridColumn = FormGrid.GridColumn\n\nconst COLLAPSED_ROWS = 1\nconst fieldSchemaRef = useFieldSchema()\nconst formRef = useForm()\nconst { externalForm, activeForm } = useQueryFormForm({\n formProps: computed(() => ({ form: props.form })),\n fallbackForm: formRef,\n})\nconst innerFormProps = computed(() => ({\n fullness: true,\n ...formProps.value,\n form: externalForm.value,\n onAutoSubmit: props.onAutoSubmit,\n onAutoSubmitFailed: props.onAutoSubmitFailed,\n}))\n\nconst schemaList = computed<SchemaEntry[]>(() => {\n const rawSchema = props.schema ?? fieldSchemaRef.value\n /* istanbul ignore next -- @preserve defensive: schema can be temporarily absent in external field-schema lifecycle */\n if (!rawSchema)\n return []\n const schema = rawSchema instanceof Schema ? rawSchema : new Schema(rawSchema)\n return schema.mapProperties((childSchema: ISchema, name: string | number) => ({\n name,\n schema: childSchema,\n }))\n})\n\nfunction resolveField(name?: string | number) {\n return activeForm.value?.query(name).take()\n}\n\nfunction createVisibleContext(\n node: GridNode,\n grid: Grid<HTMLElement>,\n collapsedOverride?: boolean,\n) {\n const index = node.index ?? 0\n const entry = schemaList.value[index]\n const schema = entry?.schema\n const name = entry?.name ?? schema?.name\n return {\n field: resolveField(name),\n schema,\n index,\n node,\n grid,\n collapsed: collapsedOverride ?? grid.maxRows !== Infinity,\n breakpoint: grid.breakpoint,\n }\n}\n\nfunction defaultVisibleWhen(context: ReturnType<typeof createVisibleContext>) {\n if (!context.collapsed)\n return true\n\n const shadowRow = context.node.shadowRow ?? 0\n const withinRows = shadowRow < COLLAPSED_ROWS + 1\n if (!withinRows)\n return false\n\n const isCollapsible = getFieldRowCount(context.grid) > COLLAPSED_ROWS\n if (!isCollapsible)\n return true\n const shadowColumn = context.node.shadowColumn ?? 1\n const span = context.node.span ?? 1\n const endColumn = shadowColumn + span - 1\n if (shadowRow === COLLAPSED_ROWS && endColumn === context.grid.columns)\n return false\n\n return true\n}\n\nfunction resolveVisibleWhen(context: ReturnType<typeof createVisibleContext>) {\n const visible = props.visibleWhen\n ? props.visibleWhen(context)\n : defaultVisibleWhen(context)\n return visible !== false\n}\n\nfunction isActionsNode(node: GridNode, grid: Grid<HTMLElement>) {\n const isLastNode = node.index === grid.childSize - 1\n if ('element' in node && node.element) {\n return node.element.dataset.queryFormActions !== undefined || isLastNode\n }\n return isLastNode\n}\n\nfunction getFieldRowCount(grid: Grid<HTMLElement>) {\n const rows = (grid.children ?? [])\n .filter(node => !isActionsNode(node, grid))\n .map(node => node.shadowRow ?? 0)\n return new Set(rows).size\n}\n\nconst defaultShouldVisible: IGridOptions['shouldVisible'] = (node, grid) => {\n if (isActionsNode(node, grid))\n return true\n return resolveVisibleWhen(createVisibleContext(node, grid))\n}\n\nconst restGridProps = props.gridProps ?? {}\nconst defaultGridProps: Partial<IGridOptions> = restGridProps.minColumns === undefined && restGridProps.maxColumns === undefined\n ? { maxColumns: 4 }\n : {}\n\nconst gridOptions: IGridOptions = {\n ...defaultGridProps,\n ...restGridProps,\n maxRows: (props.defaultExpanded || !props.showToggle) ? Infinity : COLLAPSED_ROWS,\n shouldVisible: defaultShouldVisible,\n}\n\nconst grid = createGrid(gridOptions)\n\nconst expanded = ref(grid.maxRows === Infinity)\nconst gridType = ref<'incomplete-wrap' | 'collapsible' | 'complete-wrap'>('complete-wrap')\n\nfunction updateType() {\n if (!props.showToggle) {\n gridType.value = 'incomplete-wrap'\n return\n }\n\n if (!props.visibleWhen) {\n gridType.value = getFieldRowCount(grid) > COLLAPSED_ROWS\n ? 'collapsible'\n : 'incomplete-wrap'\n return\n }\n\n const nodes = grid.children ?? []\n const hasHiddenInCollapsed = nodes.some((node) => {\n if (isActionsNode(node, grid))\n return false\n return !resolveVisibleWhen(createVisibleContext(node, grid, true))\n })\n /* istanbul ignore next -- @preserve layout branch depends on runtime grid measurement in browser */\n if (hasHiddenInCollapsed) {\n gridType.value = 'collapsible'\n return\n }\n const realRows = grid.shadowRows\n gridType.value = realRows < COLLAPSED_ROWS + 1 ? 'incomplete-wrap' : 'complete-wrap'\n}\n\nautorunEffect(() => {\n expanded.value = grid.maxRows === Infinity\n updateType()\n})\n\nfunction toggle() {\n if (!props.showToggle)\n return\n grid.maxRows = grid.maxRows === Infinity ? COLLAPSED_ROWS : Infinity\n}\n\nconst { hasDefaultSlot, schemaField } = useQueryFormSchemaField({\n slots,\n schema: computed(() => props.schema),\n schemaField: computed(() => props.schemaField),\n components: computed(() => props.components),\n scope: computed(() => props.scope),\n})\n</script>\n\n<template>\n <Form v-bind=\"innerFormProps\" :class=\"prefixCls\">\n <FormGrid :grid=\"grid\">\n <slot v-if=\"hasDefaultSlot\" />\n <component\n :is=\"schemaField\"\n v-else-if=\"schemaField\"\n :schema=\"props.schema\"\n />\n <FormGridColumn\n :grid-span=\"-1\"\n data-query-form-actions\n :class=\"[\n `${prefixCls}__actions`,\n props.actionsAtRowEnd && `${prefixCls}__actions--row-end`,\n ]\"\n >\n <template v-if=\"gridType === 'incomplete-wrap'\">\n <FormButtonGroup\n :align=\"props.actionsAtRowEnd ? 'right' : 'left'\"\n align-form-item\n inline\n :style=\"props.actionsAtRowEnd && { width: '100%' }\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n </FormButtonGroup>\n </template>\n <template v-else-if=\"gridType === 'collapsible' && props.showToggle\">\n <FormButtonGroup\n :align=\"props.actionsAtRowEnd ? 'right' : 'left'\"\n align-form-item\n inline\n :style=\"props.actionsAtRowEnd && { width: '100%' }\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n <slot\n name=\"collapse\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <ElLink\n type=\"primary\"\n :underline=\"compatibleUnderlineProp()\"\n :class=\"`${prefixCls}__collapse-link`\"\n @click=\"toggle\"\n >\n {{ expanded ? props.collapseText : props.expandText }}\n <ElIcon :class=\"`${prefixCls}__collapse-icon`\">\n <ArrowUp v-if=\"expanded\" />\n <ArrowDown v-else />\n </ElIcon>\n </ElLink>\n </slot>\n </FormButtonGroup>\n </template>\n <template v-else>\n <FormButtonGroup\n align=\"right\"\n inline\n style=\"display: flex; width: 100%;\"\n >\n <slot\n name=\"actions\"\n :expanded=\"expanded\"\n :toggle=\"toggle\"\n :type=\"gridType\"\n >\n <Submit v-if=\"props.showSubmit\" v-bind=\"props.submitProps\">\n {{ props.submitText }}\n </Submit>\n <Reset v-if=\"props.showReset\" v-bind=\"props.resetProps\">\n {{ props.resetText }}\n </Reset>\n </slot>\n </FormButtonGroup>\n </template>\n </FormGridColumn>\n </FormGrid>\n </Form>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAnBvB,MAAM,QAAQ;EAcd,MAAM,EAAE,OAAO,cAAc,cAAc,CAAC,cAAc,sBAAsB,CAAA;EAChF,MAAM,QAAQ,UAAS;EACvB,MAAM,YAAY,GAAG,YAAY;EACjC,MAAM,iBAAiB,SAAS;EAGhC,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,EAHA,OAAK,eAAA,GAAK,UAAS,iBAAA,EAAA,EAAA;gCACC,CAAZ,SAAA,SAAA,WAAA,EAAf,YAA2B,MAAA,QAAA,EAAA,EAAA,KAAA,GAAA,CAAA,KAAA,WAAA,EAC3B,YAAoB,MAAA,UAAA,EAAA,EAAA,KAAA,GAAA,CAAA,EAAA,CAAA;;;;;;iDAO5B,YAkBkB,MAAA,gBAAA,EAAA;;OAjBhB,OAAM;OACN,QAAA;OACA,OAAA;QAAA,WAAA;QAAA,SAAA;QAAmC;;8BAc5B,CAZP,WAYO,KAAA,QAAA,WAAA;QAVJ,UAAU,SAAA;QACF;QACR,MAAM,SAAA;gBAQF,CANS,MAAM,cAAA,WAAA,EAApB,YAES,MAAA,OAAA,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAF+B,MAAM,YAAW,CAAA,EAAA;+BACjC,CAAA,gBAAA,gBAAnB,MAAM,WAAU,EAAA,EAAA,CAAA,CAAA;;mDAER,MAAM,aAAA,WAAA,EAAnB,YAEQ,MAAA,MAAA,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAF8B,MAAM,WAAU,CAAA,EAAA;+BAC/B,CAAA,gBAAA,gBAAlB,MAAM,UAAS,EAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Component } from "vue";
|
|
2
|
-
import { GeneralField } from "@formily/core";
|
|
2
|
+
import { Form, GeneralField, IFormFeedback } from "@formily/core";
|
|
3
3
|
import { Grid, GridNode, IGridOptions } from "@silver-formily/grid";
|
|
4
4
|
import { ISchema } from "@formily/json-schema";
|
|
5
5
|
|
|
6
6
|
//#region src/query-form/types.d.ts
|
|
7
|
+
type QueryFormFormProvider = Form | (() => Form | undefined);
|
|
7
8
|
interface QueryFormVisibleContext {
|
|
8
9
|
field?: GeneralField;
|
|
9
10
|
schema?: ISchema;
|
|
@@ -15,6 +16,7 @@ interface QueryFormVisibleContext {
|
|
|
15
16
|
}
|
|
16
17
|
type QueryFormVisible = (context: QueryFormVisibleContext) => boolean;
|
|
17
18
|
interface IQueryFormProps {
|
|
19
|
+
form?: QueryFormFormProvider;
|
|
18
20
|
schema?: ISchema;
|
|
19
21
|
schemaField?: Component;
|
|
20
22
|
components?: Record<string, Component>;
|
|
@@ -32,13 +34,18 @@ interface IQueryFormProps {
|
|
|
32
34
|
showReset?: boolean;
|
|
33
35
|
submitProps?: Record<string, any>;
|
|
34
36
|
resetProps?: Record<string, any>;
|
|
37
|
+
onAutoSubmit?: (values: Form['values']) => Promise<any>;
|
|
38
|
+
onAutoSubmitFailed?: (error: IFormFeedback[]) => void;
|
|
35
39
|
}
|
|
36
40
|
interface IQueryFormLightProps {
|
|
41
|
+
form?: QueryFormFormProvider;
|
|
37
42
|
schema?: ISchema;
|
|
38
43
|
schemaField?: Component;
|
|
39
44
|
components?: Record<string, Component>;
|
|
40
45
|
scope?: Record<string, any>;
|
|
41
46
|
throttleWait?: number;
|
|
47
|
+
onAutoSubmit?: (values: Form['values']) => Promise<any>;
|
|
48
|
+
onAutoSubmitFailed?: (error: any) => void;
|
|
42
49
|
}
|
|
43
50
|
//#endregion
|
|
44
51
|
export { IQueryFormLightProps, IQueryFormProps, QueryFormVisible, QueryFormVisibleContext };
|
package/esm/radio/index.d.ts
CHANGED
|
@@ -23,14 +23,14 @@ declare const Radio: {
|
|
|
23
23
|
size: {
|
|
24
24
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
25
25
|
};
|
|
26
|
-
label: {
|
|
27
|
-
type: _$vue.PropType<string | number | boolean>;
|
|
28
|
-
default: undefined;
|
|
29
|
-
};
|
|
30
26
|
border: {
|
|
31
27
|
type: _$vue.PropType<boolean>;
|
|
32
28
|
default: false;
|
|
33
29
|
};
|
|
30
|
+
label: {
|
|
31
|
+
type: _$vue.PropType<string | number | boolean>;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
34
|
}>> & {
|
|
35
35
|
"onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
36
36
|
onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
@@ -71,14 +71,14 @@ declare const Radio: {
|
|
|
71
71
|
size: {
|
|
72
72
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
73
73
|
};
|
|
74
|
-
label: {
|
|
75
|
-
type: _$vue.PropType<string | number | boolean>;
|
|
76
|
-
default: undefined;
|
|
77
|
-
};
|
|
78
74
|
border: {
|
|
79
75
|
type: _$vue.PropType<boolean>;
|
|
80
76
|
default: false;
|
|
81
77
|
};
|
|
78
|
+
label: {
|
|
79
|
+
type: _$vue.PropType<string | number | boolean>;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
82
|
}>> & {
|
|
83
83
|
"onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
84
84
|
onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
@@ -113,14 +113,14 @@ declare const Radio: {
|
|
|
113
113
|
size: {
|
|
114
114
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
115
115
|
};
|
|
116
|
-
label: {
|
|
117
|
-
type: _$vue.PropType<string | number | boolean>;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
116
|
border: {
|
|
121
117
|
type: _$vue.PropType<boolean>;
|
|
122
118
|
default: false;
|
|
123
119
|
};
|
|
120
|
+
label: {
|
|
121
|
+
type: _$vue.PropType<string | number | boolean>;
|
|
122
|
+
default: undefined;
|
|
123
|
+
};
|
|
124
124
|
}>> & {
|
|
125
125
|
"onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
126
126
|
onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
@@ -6,6 +6,7 @@ import { isPlainObj } from "@formily/shared";
|
|
|
6
6
|
//#region src/radio/radio-group.vue
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
name: "FRadioGroup",
|
|
9
|
+
inheritAttrs: false,
|
|
9
10
|
__name: "radio-group",
|
|
10
11
|
props: {
|
|
11
12
|
options: {
|
|
@@ -20,6 +21,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
21
|
setup(__props) {
|
|
21
22
|
const props = __props;
|
|
22
23
|
const { props: radioProps } = useCleanAttrs();
|
|
24
|
+
const normalizedOptions = computed(() => Array.isArray(props.options) ? props.options : []);
|
|
23
25
|
const OptionType = computed(() => {
|
|
24
26
|
return props.optionType === "button" ? ElRadioButton : ElRadio;
|
|
25
27
|
});
|
|
@@ -28,11 +30,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
30
|
return isPlainObj(option);
|
|
29
31
|
}
|
|
30
32
|
function getOptionLabel(option, index) {
|
|
31
|
-
if (isRadioPropsObject(
|
|
33
|
+
if (isRadioPropsObject(normalizedOptions.value[index])) return normalizedOptions.value[index].label;
|
|
32
34
|
return option.label;
|
|
33
35
|
}
|
|
34
36
|
const compatiableProps = computed(() => {
|
|
35
|
-
return
|
|
37
|
+
return normalizedOptions.value.map((option) => {
|
|
36
38
|
if (!isRadioPropsObject(option)) return {
|
|
37
39
|
label: option,
|
|
38
40
|
value: option
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.mjs","names":[],"sources":["../../src/radio/radio-group.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<RadioProps | string | number>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst { props: radioProps } = useCleanAttrs()\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElRadioButton : ElRadio\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\n\nfunction isRadioPropsObject(option: any): option is RadioProps {\n return isPlainObj(option)\n}\n\nfunction getOptionLabel(option: any, index: number) {\n if (isRadioPropsObject(
|
|
1
|
+
{"version":3,"file":"radio-group.mjs","names":[],"sources":["../../src/radio/radio-group.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { RadioProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElRadio, ElRadioButton, ElRadioGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FRadioGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n options: {\n type: Array as PropType<Array<RadioProps | string | number>>,\n default: () => [],\n },\n optionType: {\n type: String as PropType<'default' | 'button'>,\n default: 'default',\n },\n})\n\nconst { props: radioProps } = useCleanAttrs()\nconst normalizedOptions = computed(() => Array.isArray(props.options) ? props.options : [])\n\nconst OptionType = computed(() => {\n return props.optionType === 'button' ? ElRadioButton : ElRadio\n})\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\n\nfunction isRadioPropsObject(option: any): option is RadioProps {\n return isPlainObj(option)\n}\n\nfunction getOptionLabel(option: any, index: number) {\n if (isRadioPropsObject(normalizedOptions.value[index])) {\n return normalizedOptions.value[index].label\n }\n return option.label\n}\n\nconst compatiableProps = computed(() => {\n return normalizedOptions.value.map((option) => {\n if (!isRadioPropsObject(option)) {\n return {\n label: option,\n value: option,\n }\n }\n /* istanbul ignore if -- @preserve */\n if (IS_LESS_THAN_2_6_0) {\n return {\n ...option,\n label: option.value,\n }\n }\n return option\n })\n})\n\nconst slots = useSlots()\n</script>\n\n<template>\n <ElRadioGroup v-bind=\"radioProps\">\n <template v-if=\"!slots.option\">\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n {{ getOptionLabel(option, index) }}\n </component>\n </template>\n <template v-else>\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\n <slot name=\"option\" :option=\"option\" />\n </component>\n </template>\n </ElRadioGroup>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAWd,MAAM,EAAE,OAAO,eAAe,eAAc;EAC5C,MAAM,oBAAoB,eAAe,MAAM,QAAQ,MAAM,QAAQ,GAAG,MAAM,UAAU,EAAE,CAAA;EAE1F,MAAM,aAAa,eAAe;AAChC,UAAO,MAAM,eAAe,WAAW,gBAAgB;IACxD;EACD,MAAM,qBAAqB,GAAG,SAAS,QAAO;EAE9C,SAAS,mBAAmB,QAAmC;AAC7D,UAAO,WAAW,OAAM;;EAG1B,SAAS,eAAe,QAAa,OAAe;AAClD,OAAI,mBAAmB,kBAAkB,MAAM,OAAO,CACpD,QAAO,kBAAkB,MAAM,OAAO;AAExC,UAAO,OAAO;;EAGhB,MAAM,mBAAmB,eAAe;AACtC,UAAO,kBAAkB,MAAM,KAAK,WAAW;AAC7C,QAAI,CAAC,mBAAmB,OAAO,CAC7B,QAAO;KACL,OAAO;KACP,OAAO;KACT;;AAGF,QAAI,mBACF,QAAO;KACL,GAAG;KACH,OAAO,OAAO;KAChB;AAEF,WAAO;KACR;IACF;EAED,MAAM,QAAQ,UAAS;;uBAIrB,YAWe,MAAA,aAAA,EAAA,eAAA,mBAXO,MAAA,WAAU,CAAA,CAAA,EAAA;2BAKnB,CAAA,CAJM,MAAA,MAAK,CAAC,UAAA,UAAA,KAAA,EACrB,mBAEY,UAAA,EAAA,KAAA,GAAA,EAAA,WAF0C,iBAAA,QAAlB,QAAQ,UAAK;yBAAjD,YAEY,wBAFI,WAAA,MAAU,EAA1B,WAEY,EAF6D,KAAK,OAAK,EAAA,EAAA,SAAA,MAAA,EAAU,OAAM,EAAA;6BAC9D,CAAA,gBAAA,gBAAhC,eAAe,QAAQ,MAAK,CAAA,EAAA,EAAA,CAAA,CAAA;;;kCAIjC,mBAEY,UAAA,EAAA,KAAA,GAAA,EAAA,WAF0C,iBAAA,QAAlB,QAAQ,UAAK;yBAAjD,YAEY,wBAFI,WAAA,MAAU,EAA1B,WAEY,EAF6D,KAAK,OAAK,EAAA,EAAA,SAAA,MAAA,EAAU,OAAM,EAAA;6BAC1D,CAAvC,WAAuC,KAAA,QAAA,UAAA,EAAV,QAAM,CAAA,CAAA,CAAA"}
|
package/esm/select/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ declare const Select: {
|
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
created: boolean;
|
|
10
10
|
}> & Omit<{
|
|
11
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
11
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
12
12
|
readonly disabled: boolean;
|
|
13
13
|
readonly created: boolean;
|
|
14
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
14
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
15
15
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
}> & Omit<{
|
|
@@ -22,10 +22,10 @@ declare const Select: {
|
|
|
22
22
|
disabled: boolean;
|
|
23
23
|
created: boolean;
|
|
24
24
|
}> & Omit<{
|
|
25
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
25
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
26
26
|
readonly disabled: boolean;
|
|
27
27
|
readonly created: boolean;
|
|
28
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
28
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
29
29
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
30
30
|
})>;
|
|
31
31
|
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, _$vue.PublicProps, {}, true, {}, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, {}, any, _$vue.ComponentProvideOptions, {
|
|
@@ -40,10 +40,10 @@ declare const Select: {
|
|
|
40
40
|
disabled: boolean;
|
|
41
41
|
created: boolean;
|
|
42
42
|
}> & Omit<{
|
|
43
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
43
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
44
44
|
readonly disabled: boolean;
|
|
45
45
|
readonly created: boolean;
|
|
46
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
46
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
47
47
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
48
48
|
disabled: boolean;
|
|
49
49
|
}> & Omit<{
|
|
@@ -54,10 +54,10 @@ declare const Select: {
|
|
|
54
54
|
disabled: boolean;
|
|
55
55
|
created: boolean;
|
|
56
56
|
}> & Omit<{
|
|
57
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
57
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
58
58
|
readonly disabled: boolean;
|
|
59
59
|
readonly created: boolean;
|
|
60
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
60
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
61
61
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
62
62
|
})>;
|
|
63
63
|
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
@@ -69,10 +69,10 @@ declare const Select: {
|
|
|
69
69
|
disabled: boolean;
|
|
70
70
|
created: boolean;
|
|
71
71
|
}> & Omit<{
|
|
72
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
72
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
73
73
|
readonly disabled: boolean;
|
|
74
74
|
readonly created: boolean;
|
|
75
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
75
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
76
76
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">) | (Partial<{
|
|
77
77
|
disabled: boolean;
|
|
78
78
|
}> & Omit<{
|
|
@@ -83,10 +83,10 @@ declare const Select: {
|
|
|
83
83
|
disabled: boolean;
|
|
84
84
|
created: boolean;
|
|
85
85
|
}> & Omit<{
|
|
86
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
86
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
87
87
|
readonly disabled: boolean;
|
|
88
88
|
readonly created: boolean;
|
|
89
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
89
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
90
90
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">)[];
|
|
91
91
|
})>;
|
|
92
92
|
}> & Readonly<{}>, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, _$vue.GlobalComponents, _$vue.GlobalDirectives, string, _$vue.ComponentProvideOptions> & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps & (new () => {
|
|
@@ -96,10 +96,10 @@ declare const Select: {
|
|
|
96
96
|
disabled: boolean;
|
|
97
97
|
created: boolean;
|
|
98
98
|
}> & Omit<{
|
|
99
|
-
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor |
|
|
99
|
+
readonly value: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(BooleanConstructor | ObjectConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
100
100
|
readonly disabled: boolean;
|
|
101
101
|
readonly created: boolean;
|
|
102
|
-
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(
|
|
102
|
+
readonly label?: _$element_plus_es_utils_index_mjs0.EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
103
103
|
} & _$vue.VNodeProps & _$vue.AllowedComponentProps & _$vue.ComponentCustomProps, "disabled" | "created">;
|
|
104
104
|
}) => any;
|
|
105
105
|
header?: () => any;
|
package/esm/transfer/index.d.ts
CHANGED
|
@@ -38,9 +38,6 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
38
38
|
type: _$vue.PropType<_$element_plus0.TransferFormat>;
|
|
39
39
|
default: () => {};
|
|
40
40
|
};
|
|
41
|
-
renderContent: {
|
|
42
|
-
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
43
|
-
};
|
|
44
41
|
titles: {
|
|
45
42
|
type: _$vue.PropType<[string, string]>;
|
|
46
43
|
default: () => [string, string];
|
|
@@ -60,6 +57,9 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
60
57
|
type: _$vue.PropType<_$element_plus0.TransferKey[]>;
|
|
61
58
|
default: () => never[];
|
|
62
59
|
};
|
|
60
|
+
renderContent: {
|
|
61
|
+
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
62
|
+
};
|
|
63
63
|
targetOrder: {
|
|
64
64
|
type: _$vue.PropType<"push" | "unshift" | "original">;
|
|
65
65
|
default: string;
|
|
@@ -127,9 +127,6 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
127
127
|
type: _$vue.PropType<_$element_plus0.TransferFormat>;
|
|
128
128
|
default: () => {};
|
|
129
129
|
};
|
|
130
|
-
renderContent: {
|
|
131
|
-
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
132
|
-
};
|
|
133
130
|
titles: {
|
|
134
131
|
type: _$vue.PropType<[string, string]>;
|
|
135
132
|
default: () => [string, string];
|
|
@@ -149,6 +146,9 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
149
146
|
type: _$vue.PropType<_$element_plus0.TransferKey[]>;
|
|
150
147
|
default: () => never[];
|
|
151
148
|
};
|
|
149
|
+
renderContent: {
|
|
150
|
+
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
151
|
+
};
|
|
152
152
|
targetOrder: {
|
|
153
153
|
type: _$vue.PropType<"push" | "unshift" | "original">;
|
|
154
154
|
default: string;
|
|
@@ -208,9 +208,6 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
208
208
|
type: _$vue.PropType<_$element_plus0.TransferFormat>;
|
|
209
209
|
default: () => {};
|
|
210
210
|
};
|
|
211
|
-
renderContent: {
|
|
212
|
-
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
213
|
-
};
|
|
214
211
|
titles: {
|
|
215
212
|
type: _$vue.PropType<[string, string]>;
|
|
216
213
|
default: () => [string, string];
|
|
@@ -230,6 +227,9 @@ declare const Transfer: _$element_plus_es_utils_index_mjs0.SFCWithInstall<{
|
|
|
230
227
|
type: _$vue.PropType<_$element_plus0.TransferKey[]>;
|
|
231
228
|
default: () => never[];
|
|
232
229
|
};
|
|
230
|
+
renderContent: {
|
|
231
|
+
type: _$vue.PropType<_$element_plus0.renderContent>;
|
|
232
|
+
};
|
|
233
233
|
targetOrder: {
|
|
234
234
|
type: _$vue.PropType<"push" | "unshift" | "original">;
|
|
235
235
|
default: string;
|