@silver-formily/element-plus 4.0.1 → 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 +90 -90
- package/esm/color-picker/index.d.ts +14 -14
- package/esm/color-picker-panel/index.d.ts +12 -12
- package/esm/form-dialog/dialog-content.mjs +10 -12
- package/esm/form-dialog/dialog-content.mjs.map +1 -1
- package/esm/form-dialog/index.mjs +22 -26
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +0 -1
- package/esm/form-drawer/drawer-content.mjs +10 -12
- package/esm/form-drawer/drawer-content.mjs.map +1 -1
- package/esm/form-drawer/index.mjs +22 -26
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +0 -1
- package/esm/form-grid/form-grid-column.mjs +6 -4
- package/esm/form-grid/form-grid-column.mjs.map +1 -1
- package/esm/form-layout/form-layout.vue.d.ts +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 +45 -45
- package/esm/radio/radio-group.mjs +4 -2
- package/esm/radio/radio-group.mjs.map +1 -1
- package/esm/select/index.d.ts +7 -7
- package/esm/select-table/index.d.ts +1 -1
- package/esm/select-table/select-table.mjs +63 -29
- package/esm/select-table/select-table.mjs.map +1 -1
- package/esm/select-table/types.d.ts +1 -1
- package/esm/time-select/index.d.ts +16 -16
- package/esm/transfer/index.d.ts +12 -12
- package/package.json +4 -4
- package/esm/shared/url-change-listener.mjs +0 -50
- package/esm/shared/url-change-listener.mjs.map +0 -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;
|
|
@@ -536,6 +536,10 @@ declare const Checkbox: {
|
|
|
536
536
|
});
|
|
537
537
|
CheckboxGroup: {
|
|
538
538
|
new (...args: any[]): _$vue.CreateComponentPublicInstanceWithMixins<Readonly<_$vue.ExtractPropTypes<{
|
|
539
|
+
modelValue: {
|
|
540
|
+
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
541
|
+
default: () => never[];
|
|
542
|
+
};
|
|
539
543
|
props: {
|
|
540
544
|
type: _$vue.PropType<{
|
|
541
545
|
value?: string;
|
|
@@ -548,27 +552,23 @@ declare const Checkbox: {
|
|
|
548
552
|
disabled?: string;
|
|
549
553
|
}>;
|
|
550
554
|
};
|
|
551
|
-
fill: {
|
|
552
|
-
type: _$vue.PropType<string>;
|
|
553
|
-
};
|
|
554
|
-
modelValue: {
|
|
555
|
-
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
556
|
-
default: () => never[];
|
|
557
|
-
};
|
|
558
555
|
type: {
|
|
559
556
|
type: _$vue.PropType<"button" | "checkbox">;
|
|
560
557
|
default: string;
|
|
561
558
|
};
|
|
559
|
+
fill: {
|
|
560
|
+
type: _$vue.PropType<string>;
|
|
561
|
+
};
|
|
562
562
|
disabled: {
|
|
563
563
|
type: _$vue.PropType<boolean>;
|
|
564
564
|
default: undefined;
|
|
565
565
|
};
|
|
566
|
-
options: {
|
|
567
|
-
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
568
|
-
};
|
|
569
566
|
size: {
|
|
570
567
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
571
568
|
};
|
|
569
|
+
options: {
|
|
570
|
+
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
571
|
+
};
|
|
572
572
|
validateEvent: {
|
|
573
573
|
type: _$vue.PropType<boolean>;
|
|
574
574
|
default: boolean;
|
|
@@ -614,6 +614,10 @@ declare const Checkbox: {
|
|
|
614
614
|
M: {};
|
|
615
615
|
Defaults: {};
|
|
616
616
|
}, Readonly<_$vue.ExtractPropTypes<{
|
|
617
|
+
modelValue: {
|
|
618
|
+
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
619
|
+
default: () => never[];
|
|
620
|
+
};
|
|
617
621
|
props: {
|
|
618
622
|
type: _$vue.PropType<{
|
|
619
623
|
value?: string;
|
|
@@ -626,27 +630,23 @@ declare const Checkbox: {
|
|
|
626
630
|
disabled?: string;
|
|
627
631
|
}>;
|
|
628
632
|
};
|
|
629
|
-
fill: {
|
|
630
|
-
type: _$vue.PropType<string>;
|
|
631
|
-
};
|
|
632
|
-
modelValue: {
|
|
633
|
-
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
634
|
-
default: () => never[];
|
|
635
|
-
};
|
|
636
633
|
type: {
|
|
637
634
|
type: _$vue.PropType<"button" | "checkbox">;
|
|
638
635
|
default: string;
|
|
639
636
|
};
|
|
637
|
+
fill: {
|
|
638
|
+
type: _$vue.PropType<string>;
|
|
639
|
+
};
|
|
640
640
|
disabled: {
|
|
641
641
|
type: _$vue.PropType<boolean>;
|
|
642
642
|
default: undefined;
|
|
643
643
|
};
|
|
644
|
-
options: {
|
|
645
|
-
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
646
|
-
};
|
|
647
644
|
size: {
|
|
648
645
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
649
646
|
};
|
|
647
|
+
options: {
|
|
648
|
+
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
649
|
+
};
|
|
650
650
|
validateEvent: {
|
|
651
651
|
type: _$vue.PropType<boolean>;
|
|
652
652
|
default: boolean;
|
|
@@ -686,6 +686,10 @@ declare const Checkbox: {
|
|
|
686
686
|
__isTeleport?: never;
|
|
687
687
|
__isSuspense?: never;
|
|
688
688
|
} & _$vue.ComponentOptionsBase<Readonly<_$vue.ExtractPropTypes<{
|
|
689
|
+
modelValue: {
|
|
690
|
+
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
691
|
+
default: () => never[];
|
|
692
|
+
};
|
|
689
693
|
props: {
|
|
690
694
|
type: _$vue.PropType<{
|
|
691
695
|
value?: string;
|
|
@@ -698,27 +702,23 @@ declare const Checkbox: {
|
|
|
698
702
|
disabled?: string;
|
|
699
703
|
}>;
|
|
700
704
|
};
|
|
701
|
-
fill: {
|
|
702
|
-
type: _$vue.PropType<string>;
|
|
703
|
-
};
|
|
704
|
-
modelValue: {
|
|
705
|
-
type: _$vue.PropType<_$element_plus0.CheckboxGroupValueType>;
|
|
706
|
-
default: () => never[];
|
|
707
|
-
};
|
|
708
705
|
type: {
|
|
709
706
|
type: _$vue.PropType<"button" | "checkbox">;
|
|
710
707
|
default: string;
|
|
711
708
|
};
|
|
709
|
+
fill: {
|
|
710
|
+
type: _$vue.PropType<string>;
|
|
711
|
+
};
|
|
712
712
|
disabled: {
|
|
713
713
|
type: _$vue.PropType<boolean>;
|
|
714
714
|
default: undefined;
|
|
715
715
|
};
|
|
716
|
-
options: {
|
|
717
|
-
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
718
|
-
};
|
|
719
716
|
size: {
|
|
720
717
|
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
721
718
|
};
|
|
719
|
+
options: {
|
|
720
|
+
type: _$vue.PropType<_$element_plus0.CheckboxOption[]>;
|
|
721
|
+
};
|
|
722
722
|
validateEvent: {
|
|
723
723
|
type: _$vue.PropType<boolean>;
|
|
724
724
|
default: boolean;
|
|
@@ -14,9 +14,6 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
14
14
|
type: _$vue.PropType<boolean>;
|
|
15
15
|
default: undefined;
|
|
16
16
|
};
|
|
17
|
-
size: {
|
|
18
|
-
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
19
|
-
};
|
|
20
17
|
popperClass: {
|
|
21
18
|
type: _$vue.PropType<string | {
|
|
22
19
|
[x: string]: boolean;
|
|
@@ -52,6 +49,9 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
52
49
|
type: _$vue.PropType<boolean>;
|
|
53
50
|
default: true;
|
|
54
51
|
};
|
|
52
|
+
size: {
|
|
53
|
+
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
54
|
+
};
|
|
55
55
|
clearable: {
|
|
56
56
|
type: _$vue.PropType<boolean>;
|
|
57
57
|
default: true;
|
|
@@ -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
|
};
|
|
@@ -115,9 +115,6 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
115
115
|
type: _$vue.PropType<boolean>;
|
|
116
116
|
default: undefined;
|
|
117
117
|
};
|
|
118
|
-
size: {
|
|
119
|
-
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
120
|
-
};
|
|
121
118
|
popperClass: {
|
|
122
119
|
type: _$vue.PropType<string | {
|
|
123
120
|
[x: string]: boolean;
|
|
@@ -153,6 +150,9 @@ declare const ColorPicker: _$element_plus_es_utils_index_mjs0.SFCWithInstall<_$v
|
|
|
153
150
|
type: _$vue.PropType<boolean>;
|
|
154
151
|
default: true;
|
|
155
152
|
};
|
|
153
|
+
size: {
|
|
154
|
+
type: _$vue.PropType<"" | "default" | "small" | "large">;
|
|
155
|
+
};
|
|
156
156
|
clearable: {
|
|
157
157
|
type: _$vue.PropType<boolean>;
|
|
158
158
|
default: true;
|
|
@@ -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
|
}, {
|
|
@@ -4,7 +4,7 @@ import { stylePrefix } from "../__builtins__/configs/index.mjs";
|
|
|
4
4
|
import { useEnterSubmit } from "../__builtins__/shared/use-enter-submit.mjs";
|
|
5
5
|
import { resolveDialogElement } from "../shared/overlay-elements.mjs";
|
|
6
6
|
import { ElButton, ElConfigProvider, ElDialog } from "element-plus";
|
|
7
|
-
import { Fragment, computed, createBlock, createElementBlock, createElementVNode,
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, openBlock, ref, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
8
8
|
import { FormProvider } from "@silver-formily/vue";
|
|
9
9
|
import { isFn } from "@formily/shared";
|
|
10
10
|
import { omit } from "lodash-es";
|
|
@@ -68,7 +68,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
68
|
if (unref(isFn)(props.dialogProps.beforeClose)) props.dialogProps.beforeClose(done);
|
|
69
69
|
else done();
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
71
|
+
}), {
|
|
72
|
+
header: withCtx(() => [slots.header ? renderSlot(_ctx.$slots, "header", {
|
|
73
|
+
key: 0,
|
|
74
|
+
resolve: __props.resolve,
|
|
75
|
+
reject: __props.reject,
|
|
76
|
+
form: __props.form
|
|
77
|
+
}) : createCommentVNode("v-if", true)]),
|
|
72
78
|
default: withCtx(() => [createVNode(unref(FormProvider), { form: props.form }, {
|
|
73
79
|
default: withCtx(() => [createVNode(unref(ElConfigProvider), normalizeProps(guardReactiveProps(unref(elConfig))), {
|
|
74
80
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
|
|
@@ -95,16 +101,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
101
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(_dialogProps).okText || "确定"), 1)]),
|
|
96
102
|
_: 1
|
|
97
103
|
}, 16, ["loading"])], 64))], 2)]),
|
|
98
|
-
_:
|
|
99
|
-
}, [
|
|
100
|
-
name: "header",
|
|
101
|
-
fn: withCtx(() => [renderSlot(_ctx.$slots, "header", {
|
|
102
|
-
resolve: __props.resolve,
|
|
103
|
-
reject: __props.reject,
|
|
104
|
-
form: __props.form
|
|
105
|
-
})]),
|
|
106
|
-
key: "0"
|
|
107
|
-
} : void 0]), 1040, [
|
|
104
|
+
_: 3
|
|
105
|
+
}, 16, [
|
|
108
106
|
"z-index",
|
|
109
107
|
"model-value",
|
|
110
108
|
"before-close"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-content.mjs","names":[],"sources":["../../src/form-dialog/dialog-content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Form } from '@formily/core'\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { FormDialogSlots, IFormDialogProps } from './types'\nimport { isFn } from '@formily/shared'\nimport { FormProvider } from '@silver-formily/vue'\nimport { ElButton, ElConfigProvider, ElDialog } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, ref } from 'vue'\nimport { loadElConfigProvider, stylePrefix, useDebonceSubmitting } from '../__builtins__'\nimport { useEnterSubmit } from '../__builtins__/shared/use-enter-submit'\nimport { resolveDialogElement } from '../shared/overlay-elements'\n\ndefineOptions({\n name: 'FormDialogContent',\n})\nconst props = defineProps({\n dialogProps: {\n type: Object as PropType<IFormDialogProps>,\n required: true,\n },\n visible: {\n type: Boolean,\n required: true,\n },\n form: {\n type: Object as PropType<Form>,\n required: true,\n },\n resolve: {\n type: Function as PropType<(type?: string) => void>,\n required: true,\n },\n reject: {\n type: Function as PropType<() => void>,\n required: true,\n },\n})\n\nconst slots = defineSlots<FormDialogSlots>()\nconst prefixCls = `${stylePrefix}-form-dialog`\nconst elConfig = loadElConfigProvider()\nconst _dialogProps = omit(props.dialogProps, [\n 'modelValue',\n 'onUpdate:modelValue',\n 'beforeClose',\n 'enterSubmit',\n])\nconst { internalSubmitting } = useDebonceSubmitting(props.form)\nconst dialogRef = ref<ComponentPublicInstance | null>(null)\nconst enableEnterSubmit = computed(() => props.dialogProps.enterSubmit !== false)\n\nuseEnterSubmit({\n visible: computed(() => props.visible),\n resolve: () => props.resolve(),\n submitting: internalSubmitting,\n getContainer: () => resolveDialogElement(dialogRef.value),\n enabled: enableEnterSubmit,\n})\n</script>\n\n<template>\n <ElDialog\n ref=\"dialogRef\"\n :class=\"prefixCls\"\n :z-index=\"elConfig.zIndex\"\n v-bind=\"_dialogProps\"\n :model-value=\"visible\"\n :before-close=\"(done) => {\n reject()\n if (isFn(props.dialogProps.beforeClose)) {\n props.dialogProps.beforeClose(done)\n }\n else {\n done()\n }\n }\"\n >\n <template v-if=\"slots.header\"
|
|
1
|
+
{"version":3,"file":"dialog-content.mjs","names":[],"sources":["../../src/form-dialog/dialog-content.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Form } from '@formily/core'\nimport type { ComponentPublicInstance, PropType } from 'vue'\nimport type { FormDialogSlots, IFormDialogProps } from './types'\nimport { isFn } from '@formily/shared'\nimport { FormProvider } from '@silver-formily/vue'\nimport { ElButton, ElConfigProvider, ElDialog } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, ref } from 'vue'\nimport { loadElConfigProvider, stylePrefix, useDebonceSubmitting } from '../__builtins__'\nimport { useEnterSubmit } from '../__builtins__/shared/use-enter-submit'\nimport { resolveDialogElement } from '../shared/overlay-elements'\n\ndefineOptions({\n name: 'FormDialogContent',\n})\nconst props = defineProps({\n dialogProps: {\n type: Object as PropType<IFormDialogProps>,\n required: true,\n },\n visible: {\n type: Boolean,\n required: true,\n },\n form: {\n type: Object as PropType<Form>,\n required: true,\n },\n resolve: {\n type: Function as PropType<(type?: string) => void>,\n required: true,\n },\n reject: {\n type: Function as PropType<() => void>,\n required: true,\n },\n})\n\nconst slots = defineSlots<FormDialogSlots>()\nconst prefixCls = `${stylePrefix}-form-dialog`\nconst elConfig = loadElConfigProvider()\nconst _dialogProps = omit(props.dialogProps, [\n 'modelValue',\n 'onUpdate:modelValue',\n 'beforeClose',\n 'enterSubmit',\n])\nconst { internalSubmitting } = useDebonceSubmitting(props.form)\nconst dialogRef = ref<ComponentPublicInstance | null>(null)\nconst enableEnterSubmit = computed(() => props.dialogProps.enterSubmit !== false)\n\nuseEnterSubmit({\n visible: computed(() => props.visible),\n resolve: () => props.resolve(),\n submitting: internalSubmitting,\n getContainer: () => resolveDialogElement(dialogRef.value),\n enabled: enableEnterSubmit,\n})\n</script>\n\n<template>\n <ElDialog\n ref=\"dialogRef\"\n :class=\"prefixCls\"\n :z-index=\"elConfig.zIndex\"\n v-bind=\"_dialogProps\"\n :model-value=\"visible\"\n :before-close=\"(done) => {\n reject()\n if (isFn(props.dialogProps.beforeClose)) {\n props.dialogProps.beforeClose(done)\n }\n else {\n done()\n }\n }\"\n >\n <template #header>\n <slot v-if=\"slots.header\" name=\"header\" :resolve=\"resolve\" :reject=\"reject\" :form=\"form\" />\n </template>\n\n <template #default>\n <FormProvider :form=\"props.form\">\n <ElConfigProvider v-bind=\"elConfig\">\n <slot :resolve=\"resolve\" :reject=\"reject\" :form=\"form\" />\n </ElConfigProvider>\n </FormProvider>\n </template>\n\n <template #footer>\n <div :class=\"`${prefixCls}-footer`\">\n <template v-if=\"slots.footer\">\n <slot name=\"footer\" :resolve=\"resolve\" :reject=\"reject\" :form=\"form\" />\n </template>\n <template v-else>\n <ElButton\n v-bind=\"_dialogProps.cancelButtonProps\"\n @click=\"props.reject()\"\n >\n {{ _dialogProps.cancelText || '取消' }}\n </ElButton>\n <ElButton\n type=\"primary\"\n v-bind=\"_dialogProps.okButtonProps\"\n :loading=\"internalSubmitting\"\n @click=\"props.resolve()\"\n >\n {{ _dialogProps.okText || '确定' }}\n </ElButton>\n </template>\n </div>\n </template>\n </ElDialog>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAuBd,MAAM,QAAQ,UAAA;EACd,MAAM,YAAY,GAAG,YAAY;EACjC,MAAM,WAAW,sBAAqB;EACtC,MAAM,eAAe,KAAK,MAAM,aAAa;GAC3C;GACA;GACA;GACA;GACD,CAAA;EACD,MAAM,EAAE,uBAAuB,qBAAqB,MAAM,KAAI;EAC9D,MAAM,YAAY,IAAoC,KAAI;EAC1D,MAAM,oBAAoB,eAAe,MAAM,YAAY,gBAAgB,MAAK;AAEhF,iBAAe;GACb,SAAS,eAAe,MAAM,QAAQ;GACtC,eAAe,MAAM,SAAS;GAC9B,YAAY;GACZ,oBAAoB,qBAAqB,UAAU,MAAM;GACzD,SAAS;GACV,CAAA;;uBAIC,YAmDW,MAAA,SAAA,EAnDX,WAmDW;aAlDL;IAAJ,KAAI;IACH,OAAO;IACP,WAAS,MAAA,SAAQ,CAAC;MACX,MAAA,aAAY,EAAA;IACnB,eAAa,QAAA;IACb,iBAAe,SAAI;AAAa,aAAA,QAAM;SAAa,MAAA,KAAI,CAAC,MAAM,YAAY,YAAW,CAAa,OAAM,YAAY,YAAY,KAAI;SAA+B,OAAI;;;IAU7J,QAAM,cAC4E,CAA/E,MAAM,SAAlB,WAA2F,KAAA,QAAA,UAAA;;KAAlD,SAAS,QAAA;KAAU,QAAQ,QAAA;KAAS,MAAM,QAAA;;IAG1E,SAAO,cAKD,CAJf,YAIe,MAAA,aAAA,EAAA,EAJA,MAAM,MAAM,MAAA,EAAA;4BAGN,CAFnB,YAEmB,MAAA,iBAAA,EAAA,eAAA,mBAFO,MAAA,SAAQ,CAAA,CAAA,EAAA;6BACyB,CAAzD,WAAyD,KAAA,QAAA,WAAA;OAAlD,SAAS,QAAA;OAAU,QAAQ,QAAA;OAAS,MAAM,QAAA;;;;;;IAK5C,QAAM,cAqBT,CApBN,mBAoBM,OAAA,EApBA,OAAK,eAAA,GAAK,UAAS,SAAA,EAAA,EAAA,CACP,MAAM,SACpB,WAAuE,KAAA,QAAA,UAAA;;KAAlD,SAAS,QAAA;KAAU,QAAQ,QAAA;KAAS,MAAM,QAAA;uBAEjE,mBAeW,UAAA,EAAA,KAAA,GAAA,EAAA,CAdT,YAKW,MAAA,SAAA,EALX,WACU,MAIC,aAJW,CAAC,mBAAiB,EACrC,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAM,QAAM,GAAA,CAAA,EAAA;4BAEiB,CAAA,gBAAA,gBAAlC,MAAA,aAAY,CAAC,cAAU,KAAA,EAAA,EAAA,CAAA,CAAA;;YAE5B,YAOW,MAAA,SAAA,EAPX,WAOW,EANT,MAAK,WAAS,EACN,MAAA,aAAY,CAAC,eAAa;KACjC,SAAS,MAAA,mBAAkB;KAC3B,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAM,SAAO;;4BAEY,CAAA,gBAAA,gBAA9B,MAAA,aAAY,CAAC,UAAM,KAAA,EAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getTransitionDuration, loading } from "../__builtins__/shared/loading.mjs";
|
|
2
2
|
import { isVueOptions } from "../__builtins__/shared/utils.mjs";
|
|
3
|
-
import { onUrlChange } from "../shared/url-change-listener.mjs";
|
|
4
3
|
import _sfc_main from "./dialog-content.mjs";
|
|
5
4
|
import { observer } from "@silver-formily/reactive-vue";
|
|
6
5
|
import { createApp, h, ref } from "vue";
|
|
@@ -16,7 +15,6 @@ function FormDialog(title, content, dynamicMiddlewareNames) {
|
|
|
16
15
|
promise: null,
|
|
17
16
|
app: null,
|
|
18
17
|
instance: null,
|
|
19
|
-
stopUrlChangeListener: void 0,
|
|
20
18
|
settled: false,
|
|
21
19
|
openMiddlewares: [],
|
|
22
20
|
confirmMiddlewares: [],
|
|
@@ -35,11 +33,7 @@ function FormDialog(title, content, dynamicMiddlewareNames) {
|
|
|
35
33
|
env[`${_middlewareName}Middlewares`] = [];
|
|
36
34
|
}
|
|
37
35
|
document.body.append(env.root);
|
|
38
|
-
const
|
|
39
|
-
const props = {
|
|
40
|
-
...rawProps,
|
|
41
|
-
closeOnUrlChange: rawProps.closeOnUrlChange ?? true
|
|
42
|
-
};
|
|
36
|
+
const props = isStr(title) ? { title } : title;
|
|
43
37
|
function render(visible, resolve, reject) {
|
|
44
38
|
const _content = isVueOptions(content) ? { default: () => h(content) } : isFn(content) ? { default: content } : content;
|
|
45
39
|
if (!env.instance) {
|
|
@@ -59,8 +53,6 @@ function FormDialog(title, content, dynamicMiddlewareNames) {
|
|
|
59
53
|
env.instance.visible = visible;
|
|
60
54
|
}
|
|
61
55
|
function disposeDialog() {
|
|
62
|
-
env.stopUrlChangeListener?.();
|
|
63
|
-
env.stopUrlChangeListener = void 0;
|
|
64
56
|
const animationDuration = getTransitionDuration();
|
|
65
57
|
setTimeout(() => {
|
|
66
58
|
env.app?.unmount?.();
|
|
@@ -73,12 +65,26 @@ function FormDialog(title, content, dynamicMiddlewareNames) {
|
|
|
73
65
|
async function rejectDialog(reject) {
|
|
74
66
|
if (env.settled) return;
|
|
75
67
|
env.settled = true;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
try {
|
|
69
|
+
await loading(props.loadingText, () => applyMiddleware(env.form, env.cancelMiddlewares));
|
|
70
|
+
render(false);
|
|
71
|
+
disposeDialog();
|
|
72
|
+
reject?.();
|
|
73
|
+
} catch {
|
|
74
|
+
env.settled = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async function submitDialog(type, resolve, close) {
|
|
78
|
+
if (env.settled) return;
|
|
79
|
+
env.settled = true;
|
|
80
|
+
try {
|
|
81
|
+
await (isValid(type) ? applyMiddleware(env.form, env[`${type}Middlewares`]) : applyMiddleware(env.form, env.confirmMiddlewares));
|
|
82
|
+
resolve(toJS(env.form.values));
|
|
83
|
+
close();
|
|
84
|
+
disposeDialog();
|
|
85
|
+
} catch {
|
|
86
|
+
env.settled = false;
|
|
87
|
+
}
|
|
82
88
|
}
|
|
83
89
|
const formDialog = {
|
|
84
90
|
forOpen: (middleware) => {
|
|
@@ -102,19 +108,9 @@ function FormDialog(title, content, dynamicMiddlewareNames) {
|
|
|
102
108
|
env.form = env.form || createForm(resPayload);
|
|
103
109
|
render(true, (type) => {
|
|
104
110
|
env.form.submit(async () => {
|
|
105
|
-
|
|
106
|
-
env.settled = true;
|
|
107
|
-
env.stopUrlChangeListener?.();
|
|
108
|
-
env.stopUrlChangeListener = void 0;
|
|
109
|
-
await (isValid(type) ? applyMiddleware(env.form, env[`${type}Middlewares`]) : applyMiddleware(env.form, env.confirmMiddlewares));
|
|
110
|
-
res(toJS(env.form.values));
|
|
111
|
-
formDialog.close();
|
|
112
|
-
disposeDialog();
|
|
111
|
+
await submitDialog(type, res, formDialog.close);
|
|
113
112
|
}).catch(() => void 0);
|
|
114
113
|
}, () => rejectDialog(() => rej(/* @__PURE__ */ new Error("cancel"))));
|
|
115
|
-
if (props.closeOnUrlChange) env.stopUrlChangeListener = onUrlChange(() => {
|
|
116
|
-
rejectDialog(() => rej(/* @__PURE__ */ new Error("cancel")));
|
|
117
|
-
});
|
|
118
114
|
}).catch(
|
|
119
115
|
/* istanbul ignore next -- @preserve */
|
|
120
116
|
(error) => rej(error)
|