@vrojs/element-plus 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vro-el-schema-form-dialog/index.d.ts +30 -0
- package/dist/vro-el-schema-form-dialog/types.d.ts +15 -0
- package/dist/vro-el-schema-form-dialog/types.js +15 -1
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.d.ts +18 -0
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.js +41 -41
- package/dist/vro-el-schema-form-drawer/index.d.ts +30 -0
- package/dist/vro-el-schema-form-drawer/types.d.ts +15 -1
- package/dist/vro-el-schema-form-drawer/types.js +15 -1
- package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.d.ts +18 -0
- package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.js +55 -55
- package/dist/vro-el-with-config/vro-el-with-config.vue.js +5 -4
- package/package.json +2 -2
|
@@ -25,7 +25,15 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
25
25
|
default: boolean;
|
|
26
26
|
};
|
|
27
27
|
cancelButtonText: StringConstructor;
|
|
28
|
+
cancelButtonProps: {
|
|
29
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
30
|
+
default: () => {};
|
|
31
|
+
};
|
|
28
32
|
confirmButtonText: StringConstructor;
|
|
33
|
+
confirmButtonProps: {
|
|
34
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
35
|
+
default: () => {};
|
|
36
|
+
};
|
|
29
37
|
rowProps: {
|
|
30
38
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
31
39
|
default: () => {};
|
|
@@ -510,6 +518,8 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
510
518
|
schema: import('..').VroElSchemaFormSchema;
|
|
511
519
|
showCancelButton: boolean;
|
|
512
520
|
showConfirmButton: boolean;
|
|
521
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
522
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
513
523
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
514
524
|
dialogRef: ({
|
|
515
525
|
$: import('vue').ComponentInternalInstance;
|
|
@@ -1141,7 +1151,15 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
1141
1151
|
default: boolean;
|
|
1142
1152
|
};
|
|
1143
1153
|
cancelButtonText: StringConstructor;
|
|
1154
|
+
cancelButtonProps: {
|
|
1155
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1156
|
+
default: () => {};
|
|
1157
|
+
};
|
|
1144
1158
|
confirmButtonText: StringConstructor;
|
|
1159
|
+
confirmButtonProps: {
|
|
1160
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1161
|
+
default: () => {};
|
|
1162
|
+
};
|
|
1145
1163
|
rowProps: {
|
|
1146
1164
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1147
1165
|
default: () => {};
|
|
@@ -1620,6 +1638,8 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
1620
1638
|
schema: import('..').VroElSchemaFormSchema;
|
|
1621
1639
|
showCancelButton: boolean;
|
|
1622
1640
|
showConfirmButton: boolean;
|
|
1641
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1642
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1623
1643
|
}>;
|
|
1624
1644
|
__isFragment?: never;
|
|
1625
1645
|
__isTeleport?: never;
|
|
@@ -1646,7 +1666,15 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
1646
1666
|
default: boolean;
|
|
1647
1667
|
};
|
|
1648
1668
|
cancelButtonText: StringConstructor;
|
|
1669
|
+
cancelButtonProps: {
|
|
1670
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1671
|
+
default: () => {};
|
|
1672
|
+
};
|
|
1649
1673
|
confirmButtonText: StringConstructor;
|
|
1674
|
+
confirmButtonProps: {
|
|
1675
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1676
|
+
default: () => {};
|
|
1677
|
+
};
|
|
1650
1678
|
rowProps: {
|
|
1651
1679
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1652
1680
|
default: () => {};
|
|
@@ -2131,6 +2159,8 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
2131
2159
|
schema: import('..').VroElSchemaFormSchema;
|
|
2132
2160
|
showCancelButton: boolean;
|
|
2133
2161
|
showConfirmButton: boolean;
|
|
2162
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
2163
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
2134
2164
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
2135
2165
|
$slots: Readonly<import('./types').VroElSchemaFormDialogSlots> & import('./types').VroElSchemaFormDialogSlots;
|
|
2136
2166
|
})>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VroSlot } from '@vrojs/base';
|
|
2
|
+
import { ButtonProps } from 'element-plus';
|
|
2
3
|
import { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
|
3
4
|
import { VroElSchemaFormFieldEvent, VroElSchemaFormFormProps, VroElSchemaFormSchema, VroElSchemaFormSlotProps } from '../vro-el-schema-form';
|
|
4
5
|
export interface VroElSchemaFormDialogRequest {
|
|
@@ -54,10 +55,24 @@ export declare const vroElSchemaFormDialogProps: {
|
|
|
54
55
|
* 取消按钮文本。
|
|
55
56
|
*/
|
|
56
57
|
cancelButtonText: StringConstructor;
|
|
58
|
+
/**
|
|
59
|
+
* 透传给取消按钮 ElButton 的属性。
|
|
60
|
+
*/
|
|
61
|
+
cancelButtonProps: {
|
|
62
|
+
type: PropType<Partial<ButtonProps>>;
|
|
63
|
+
default: () => {};
|
|
64
|
+
};
|
|
57
65
|
/**
|
|
58
66
|
* 确认按钮文本。
|
|
59
67
|
*/
|
|
60
68
|
confirmButtonText: StringConstructor;
|
|
69
|
+
/**
|
|
70
|
+
* 透传给确认按钮 ElButton 的属性。
|
|
71
|
+
*/
|
|
72
|
+
confirmButtonProps: {
|
|
73
|
+
type: PropType<Partial<ButtonProps>>;
|
|
74
|
+
default: () => {};
|
|
75
|
+
};
|
|
61
76
|
rowProps: {
|
|
62
77
|
type: PropType<Partial<import('element-plus').RowProps>>;
|
|
63
78
|
default: () => {};
|
|
@@ -44,10 +44,24 @@ const r = {
|
|
|
44
44
|
* 取消按钮文本。
|
|
45
45
|
*/
|
|
46
46
|
cancelButtonText: String,
|
|
47
|
+
/**
|
|
48
|
+
* 透传给取消按钮 ElButton 的属性。
|
|
49
|
+
*/
|
|
50
|
+
cancelButtonProps: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: () => ({})
|
|
53
|
+
},
|
|
47
54
|
/**
|
|
48
55
|
* 确认按钮文本。
|
|
49
56
|
*/
|
|
50
|
-
confirmButtonText: String
|
|
57
|
+
confirmButtonText: String,
|
|
58
|
+
/**
|
|
59
|
+
* 透传给确认按钮 ElButton 的属性。
|
|
60
|
+
*/
|
|
61
|
+
confirmButtonProps: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: () => ({})
|
|
64
|
+
}
|
|
51
65
|
};
|
|
52
66
|
export {
|
|
53
67
|
r as vroElSchemaFormDialogProps
|
|
@@ -631,7 +631,15 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
631
631
|
default: boolean;
|
|
632
632
|
};
|
|
633
633
|
cancelButtonText: StringConstructor;
|
|
634
|
+
cancelButtonProps: {
|
|
635
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
636
|
+
default: () => {};
|
|
637
|
+
};
|
|
634
638
|
confirmButtonText: StringConstructor;
|
|
639
|
+
confirmButtonProps: {
|
|
640
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
641
|
+
default: () => {};
|
|
642
|
+
};
|
|
635
643
|
rowProps: {
|
|
636
644
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
637
645
|
default: () => {};
|
|
@@ -1123,7 +1131,15 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1123
1131
|
default: boolean;
|
|
1124
1132
|
};
|
|
1125
1133
|
cancelButtonText: StringConstructor;
|
|
1134
|
+
cancelButtonProps: {
|
|
1135
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1136
|
+
default: () => {};
|
|
1137
|
+
};
|
|
1126
1138
|
confirmButtonText: StringConstructor;
|
|
1139
|
+
confirmButtonProps: {
|
|
1140
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1141
|
+
default: () => {};
|
|
1142
|
+
};
|
|
1127
1143
|
rowProps: {
|
|
1128
1144
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1129
1145
|
default: () => {};
|
|
@@ -1155,6 +1171,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1155
1171
|
schema: import('..').VroElSchemaFormSchema;
|
|
1156
1172
|
showCancelButton: boolean;
|
|
1157
1173
|
showConfirmButton: boolean;
|
|
1174
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1175
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1158
1176
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
1159
1177
|
dialogRef: ({
|
|
1160
1178
|
$: import('vue').ComponentInternalInstance;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, useSlots as z, ref as I, computed as d, useTemplateRef as k, provide as K, createBlock as f, openBlock as p, unref as r, normalizeStyle as L, isRef as A, createSlots as w, withCtx as n, createVNode as M, mergeProps as v, withModifiers as U, renderSlot as S, renderList as G, normalizeProps as H, guardReactiveProps as J, createElementVNode as Q, createCommentVNode as C, createTextVNode as F, toDisplayString as b } from "vue";
|
|
2
2
|
import { pick as W, typedKeys as X } from "@daysnap/utils";
|
|
3
3
|
import { useVisible as Y, useAsyncTask as Z } from "@vrojs/use";
|
|
4
4
|
import { ElDialog as _, ElButton as E } from "element-plus";
|
|
@@ -7,22 +7,22 @@ import { VroElSchemaForm as oe } from "../vro-el-schema-form/index.js";
|
|
|
7
7
|
import { vroElSchemaFormDialogInjectionKey as te } from "./injection.js";
|
|
8
8
|
import { vroElSchemaFormDialogProps as le } from "./types.js";
|
|
9
9
|
import { vroElSchemaFormProps as re } from "../vro-el-schema-form/types.js";
|
|
10
|
-
const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */
|
|
10
|
+
const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
11
11
|
name: "VroElSchemaFormDialog",
|
|
12
12
|
__name: "vro-el-schema-form-dialog",
|
|
13
13
|
props: le,
|
|
14
14
|
emits: ["change-field", "input-field", "cancel", "confirm", "closed"],
|
|
15
|
-
setup(
|
|
16
|
-
const s = P, R =
|
|
15
|
+
setup(B, { expose: V, emit: P }) {
|
|
16
|
+
const s = P, R = z(), T = B, { t: g } = ee(), y = I(), x = d(() => Object.keys(R).filter((o) => o !== "default")), l = d(() => Object.assign({}, T, y.value)), D = d(() => W(l.value, X(re))), { show: $, hide: i, confirm: u, visible: m } = Y({
|
|
17
17
|
showCallback: (o) => {
|
|
18
|
-
|
|
18
|
+
y.value = o;
|
|
19
19
|
},
|
|
20
20
|
hideCallback: (o) => s("cancel", o),
|
|
21
21
|
confirmCallback: (o) => s("confirm", o)
|
|
22
|
-
}),
|
|
23
|
-
const o =
|
|
22
|
+
}), c = k("dialogRef"), N = () => {
|
|
23
|
+
const o = c.value?.$el;
|
|
24
24
|
(o instanceof Element ? o : void 0)?.querySelector(".el-dialog__body")?.scrollTo({ top: 0 });
|
|
25
|
-
}, a = k("schemaFormRef"), { loading:
|
|
25
|
+
}, a = k("schemaFormRef"), { loading: j, trigger: h } = Z(
|
|
26
26
|
async () => {
|
|
27
27
|
if (!a.value)
|
|
28
28
|
throw new Error("not found VroElSchemaForm");
|
|
@@ -37,7 +37,7 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ O({
|
|
|
37
37
|
o = !0;
|
|
38
38
|
}
|
|
39
39
|
}), m.value && !o) {
|
|
40
|
-
const e = await a.value.extractValues(), t = await
|
|
40
|
+
const e = await a.value.extractValues(), t = await l.value.request?.(e, l.value.schema) ?? e;
|
|
41
41
|
u(t);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
@@ -45,80 +45,80 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ O({
|
|
|
45
45
|
throwError: !0
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
return
|
|
48
|
+
return K(te, {
|
|
49
49
|
confirm: u,
|
|
50
50
|
hide: i
|
|
51
|
-
}),
|
|
51
|
+
}), V({
|
|
52
52
|
get elDialog() {
|
|
53
|
-
return
|
|
53
|
+
return c.value;
|
|
54
54
|
},
|
|
55
55
|
get vroElSchemaForm() {
|
|
56
56
|
return a.value;
|
|
57
57
|
},
|
|
58
|
-
show:
|
|
58
|
+
show: $,
|
|
59
59
|
hide: i
|
|
60
|
-
}), (o, e) => (
|
|
61
|
-
modelValue:
|
|
62
|
-
"onUpdate:modelValue": e[4] || (e[4] = (t) =>
|
|
60
|
+
}), (o, e) => (p(), f(r(_), {
|
|
61
|
+
modelValue: r(m),
|
|
62
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => A(m) ? m.value = t : null),
|
|
63
63
|
ref_key: "dialogRef",
|
|
64
|
-
ref:
|
|
64
|
+
ref: c,
|
|
65
65
|
class: "vro-el-schema-form-dialog",
|
|
66
|
-
title:
|
|
66
|
+
title: l.value.title,
|
|
67
67
|
"destroy-on-close": "",
|
|
68
68
|
"append-to-body": "",
|
|
69
69
|
"close-on-click-modal": !1,
|
|
70
|
-
style:
|
|
71
|
-
onClose: e[5] || (e[5] = (t) =>
|
|
70
|
+
style: L(l.value.style),
|
|
71
|
+
onClose: e[5] || (e[5] = (t) => r(i)()),
|
|
72
72
|
onClosed: e[6] || (e[6] = (t) => s("closed")),
|
|
73
|
-
onOpened:
|
|
73
|
+
onOpened: N
|
|
74
74
|
}, w({
|
|
75
75
|
default: n(() => [
|
|
76
|
-
|
|
76
|
+
M(r(oe), v(D.value, {
|
|
77
77
|
ref_key: "schemaFormRef",
|
|
78
78
|
ref: a,
|
|
79
79
|
onChangeField: e[0] || (e[0] = (t) => s("change-field", t)),
|
|
80
80
|
onInputField: e[1] || (e[1] = (t) => s("input-field", t)),
|
|
81
|
-
onSubmit: e[2] || (e[2] = U((t) =>
|
|
81
|
+
onSubmit: e[2] || (e[2] = U((t) => r(h)(), ["prevent"]))
|
|
82
82
|
}), w({
|
|
83
83
|
default: n(() => [
|
|
84
84
|
S(o.$slots, "default")
|
|
85
85
|
]),
|
|
86
86
|
_: 2
|
|
87
87
|
}, [
|
|
88
|
-
G(
|
|
88
|
+
G(x.value, (t) => ({
|
|
89
89
|
name: t,
|
|
90
|
-
fn: n((
|
|
91
|
-
S(o.$slots, t, H(J(
|
|
90
|
+
fn: n((O) => [
|
|
91
|
+
S(o.$slots, t, H(J(O ?? {})))
|
|
92
92
|
])
|
|
93
93
|
}))
|
|
94
94
|
]), 1040)
|
|
95
95
|
]),
|
|
96
96
|
_: 2
|
|
97
97
|
}, [
|
|
98
|
-
|
|
98
|
+
l.value.showCancelButton || l.value.showConfirmButton ? {
|
|
99
99
|
name: "footer",
|
|
100
100
|
fn: n(() => [
|
|
101
|
-
Q("
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, {
|
|
101
|
+
Q("div", ae, [
|
|
102
|
+
l.value.showCancelButton ? (p(), f(r(E), v({ key: 0 }, l.value.cancelButtonProps, {
|
|
103
|
+
onClick: e[3] || (e[3] = (t) => r(i)("cancel"))
|
|
104
|
+
}), {
|
|
106
105
|
default: n(() => [
|
|
107
|
-
b(
|
|
106
|
+
F(b(l.value.cancelButtonText || r(g)("schemaFormDialog.cancelText")), 1)
|
|
108
107
|
]),
|
|
109
108
|
_: 1
|
|
110
|
-
})) : C("", !0),
|
|
111
|
-
|
|
109
|
+
}, 16)) : C("", !0),
|
|
110
|
+
l.value.showConfirmButton ? (p(), f(r(E), v({
|
|
112
111
|
key: 1,
|
|
113
|
-
type: "primary"
|
|
114
|
-
|
|
115
|
-
loading:
|
|
116
|
-
|
|
112
|
+
type: "primary"
|
|
113
|
+
}, l.value.confirmButtonProps, {
|
|
114
|
+
loading: r(j),
|
|
115
|
+
onClick: r(h)
|
|
116
|
+
}), {
|
|
117
117
|
default: n(() => [
|
|
118
|
-
b(
|
|
118
|
+
F(b(l.value.confirmButtonText || r(g)("schemaFormDialog.confirmText")), 1)
|
|
119
119
|
]),
|
|
120
120
|
_: 1
|
|
121
|
-
},
|
|
121
|
+
}, 16, ["loading", "onClick"])) : C("", !0)
|
|
122
122
|
])
|
|
123
123
|
]),
|
|
124
124
|
key: "0"
|
|
@@ -37,7 +37,15 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
37
37
|
default: boolean;
|
|
38
38
|
};
|
|
39
39
|
cancelButtonText: StringConstructor;
|
|
40
|
+
cancelButtonProps: {
|
|
41
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
42
|
+
default: () => {};
|
|
43
|
+
};
|
|
40
44
|
confirmButtonText: StringConstructor;
|
|
45
|
+
confirmButtonProps: {
|
|
46
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
47
|
+
default: () => {};
|
|
48
|
+
};
|
|
41
49
|
rowProps: {
|
|
42
50
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
43
51
|
default: () => {};
|
|
@@ -524,6 +532,8 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
524
532
|
schema: import('..').VroElSchemaFormSchema;
|
|
525
533
|
showCancelButton: boolean;
|
|
526
534
|
showConfirmButton: boolean;
|
|
535
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
536
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
527
537
|
withHeader: boolean;
|
|
528
538
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
529
539
|
drawerRef: ({
|
|
@@ -1187,7 +1197,15 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
1187
1197
|
default: boolean;
|
|
1188
1198
|
};
|
|
1189
1199
|
cancelButtonText: StringConstructor;
|
|
1200
|
+
cancelButtonProps: {
|
|
1201
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1202
|
+
default: () => {};
|
|
1203
|
+
};
|
|
1190
1204
|
confirmButtonText: StringConstructor;
|
|
1205
|
+
confirmButtonProps: {
|
|
1206
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1207
|
+
default: () => {};
|
|
1208
|
+
};
|
|
1191
1209
|
rowProps: {
|
|
1192
1210
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1193
1211
|
default: () => {};
|
|
@@ -1668,6 +1686,8 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
1668
1686
|
schema: import('..').VroElSchemaFormSchema;
|
|
1669
1687
|
showCancelButton: boolean;
|
|
1670
1688
|
showConfirmButton: boolean;
|
|
1689
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1690
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1671
1691
|
withHeader: boolean;
|
|
1672
1692
|
}>;
|
|
1673
1693
|
__isFragment?: never;
|
|
@@ -1707,7 +1727,15 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
1707
1727
|
default: boolean;
|
|
1708
1728
|
};
|
|
1709
1729
|
cancelButtonText: StringConstructor;
|
|
1730
|
+
cancelButtonProps: {
|
|
1731
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1732
|
+
default: () => {};
|
|
1733
|
+
};
|
|
1710
1734
|
confirmButtonText: StringConstructor;
|
|
1735
|
+
confirmButtonProps: {
|
|
1736
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1737
|
+
default: () => {};
|
|
1738
|
+
};
|
|
1711
1739
|
rowProps: {
|
|
1712
1740
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1713
1741
|
default: () => {};
|
|
@@ -2194,6 +2222,8 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
2194
2222
|
schema: import('..').VroElSchemaFormSchema;
|
|
2195
2223
|
showCancelButton: boolean;
|
|
2196
2224
|
showConfirmButton: boolean;
|
|
2225
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
2226
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
2197
2227
|
withHeader: boolean;
|
|
2198
2228
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
2199
2229
|
$slots: Readonly<import('./types').VroElSchemaFormDrawerSlots> & import('./types').VroElSchemaFormDrawerSlots;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VroSlot } from '@vrojs/base';
|
|
2
|
-
import { DrawerProps } from 'element-plus';
|
|
2
|
+
import { ButtonProps, DrawerProps } from 'element-plus';
|
|
3
3
|
import { CSSProperties, ExtractPropTypes, PropType } from 'vue';
|
|
4
4
|
import { VroElSchemaFormFieldEvent, VroElSchemaFormFormProps, VroElSchemaFormSchema, VroElSchemaFormSlotProps } from '../vro-el-schema-form';
|
|
5
5
|
export interface VroElSchemaFormDrawerRequest {
|
|
@@ -76,10 +76,24 @@ export declare const vroElSchemaFormDrawerProps: {
|
|
|
76
76
|
* 取消按钮文本。
|
|
77
77
|
*/
|
|
78
78
|
cancelButtonText: StringConstructor;
|
|
79
|
+
/**
|
|
80
|
+
* 透传给取消按钮 ElButton 的属性。
|
|
81
|
+
*/
|
|
82
|
+
cancelButtonProps: {
|
|
83
|
+
type: PropType<Partial<ButtonProps>>;
|
|
84
|
+
default: () => {};
|
|
85
|
+
};
|
|
79
86
|
/**
|
|
80
87
|
* 确认按钮文本。
|
|
81
88
|
*/
|
|
82
89
|
confirmButtonText: StringConstructor;
|
|
90
|
+
/**
|
|
91
|
+
* 透传给确认按钮 ElButton 的属性。
|
|
92
|
+
*/
|
|
93
|
+
confirmButtonProps: {
|
|
94
|
+
type: PropType<Partial<ButtonProps>>;
|
|
95
|
+
default: () => {};
|
|
96
|
+
};
|
|
83
97
|
rowProps: {
|
|
84
98
|
type: PropType<Partial<import('element-plus').RowProps>>;
|
|
85
99
|
default: () => {};
|
|
@@ -65,10 +65,24 @@ const r = {
|
|
|
65
65
|
* 取消按钮文本。
|
|
66
66
|
*/
|
|
67
67
|
cancelButtonText: String,
|
|
68
|
+
/**
|
|
69
|
+
* 透传给取消按钮 ElButton 的属性。
|
|
70
|
+
*/
|
|
71
|
+
cancelButtonProps: {
|
|
72
|
+
type: Object,
|
|
73
|
+
default: () => ({})
|
|
74
|
+
},
|
|
68
75
|
/**
|
|
69
76
|
* 确认按钮文本。
|
|
70
77
|
*/
|
|
71
|
-
confirmButtonText: String
|
|
78
|
+
confirmButtonText: String,
|
|
79
|
+
/**
|
|
80
|
+
* 透传给确认按钮 ElButton 的属性。
|
|
81
|
+
*/
|
|
82
|
+
confirmButtonProps: {
|
|
83
|
+
type: Object,
|
|
84
|
+
default: () => ({})
|
|
85
|
+
}
|
|
72
86
|
};
|
|
73
87
|
export {
|
|
74
88
|
r as vroElSchemaFormDrawerProps
|
|
@@ -662,7 +662,15 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
662
662
|
default: boolean;
|
|
663
663
|
};
|
|
664
664
|
cancelButtonText: StringConstructor;
|
|
665
|
+
cancelButtonProps: {
|
|
666
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
667
|
+
default: () => {};
|
|
668
|
+
};
|
|
665
669
|
confirmButtonText: StringConstructor;
|
|
670
|
+
confirmButtonProps: {
|
|
671
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
672
|
+
default: () => {};
|
|
673
|
+
};
|
|
666
674
|
rowProps: {
|
|
667
675
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
668
676
|
default: () => {};
|
|
@@ -1166,7 +1174,15 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1166
1174
|
default: boolean;
|
|
1167
1175
|
};
|
|
1168
1176
|
cancelButtonText: StringConstructor;
|
|
1177
|
+
cancelButtonProps: {
|
|
1178
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1179
|
+
default: () => {};
|
|
1180
|
+
};
|
|
1169
1181
|
confirmButtonText: StringConstructor;
|
|
1182
|
+
confirmButtonProps: {
|
|
1183
|
+
type: import('vue').PropType<Partial<import('element-plus').ButtonProps>>;
|
|
1184
|
+
default: () => {};
|
|
1185
|
+
};
|
|
1170
1186
|
rowProps: {
|
|
1171
1187
|
type: import('vue').PropType<Partial<import('element-plus').RowProps>>;
|
|
1172
1188
|
default: () => {};
|
|
@@ -1200,6 +1216,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1200
1216
|
schema: import('..').VroElSchemaFormSchema;
|
|
1201
1217
|
showCancelButton: boolean;
|
|
1202
1218
|
showConfirmButton: boolean;
|
|
1219
|
+
cancelButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1220
|
+
confirmButtonProps: Partial<import('element-plus').ButtonProps>;
|
|
1203
1221
|
withHeader: boolean;
|
|
1204
1222
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
1205
1223
|
drawerRef: ({
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as O, useSlots as q, ref as I, computed as d, useTemplateRef as k, provide as K, createBlock as f, openBlock as v, unref as l, normalizeStyle as L, isRef as A, createSlots as S, withCtx as n, createVNode as H, mergeProps as p, withModifiers as M, renderSlot as g, renderList as U, normalizeProps as G, guardReactiveProps as J, createElementVNode as Q, createCommentVNode as C, createTextVNode as F, toDisplayString as b } from "vue";
|
|
2
2
|
import { pick as W, typedKeys as X } from "@daysnap/utils";
|
|
3
3
|
import { useVisible as Y, useAsyncTask as Z } from "@vrojs/use";
|
|
4
|
-
import { ElDrawer as _, ElButton as
|
|
4
|
+
import { ElDrawer as _, ElButton as E } from "element-plus";
|
|
5
5
|
import { useLocale as ee } from "../locale/useLocale.js";
|
|
6
6
|
import { VroElSchemaForm as oe } from "../vro-el-schema-form/index.js";
|
|
7
7
|
import { vroElSchemaFormDrawerInjectionKey as re } from "./injection.js";
|
|
8
8
|
import { vroElSchemaFormDrawerProps as te } from "./types.js";
|
|
9
9
|
import { vroElSchemaFormProps as le } from "../vro-el-schema-form/types.js";
|
|
10
|
-
const ae = { class: "vro-el-schema-form-drawer-footer" }, pe = /* @__PURE__ */
|
|
10
|
+
const ae = { class: "vro-el-schema-form-drawer-footer" }, pe = /* @__PURE__ */ O({
|
|
11
11
|
name: "VroElSchemaFormDrawer",
|
|
12
12
|
__name: "vro-el-schema-form-drawer",
|
|
13
13
|
props: te,
|
|
14
14
|
emits: ["change-field", "input-field", "cancel", "confirm", "closed"],
|
|
15
|
-
setup(
|
|
16
|
-
const s =
|
|
17
|
-
showCallback: (
|
|
18
|
-
|
|
15
|
+
setup(B, { expose: V, emit: P }) {
|
|
16
|
+
const s = P, R = q(), T = B, { t: w } = ee(), h = I(), x = d(() => Object.keys(R).filter((r) => r !== "default")), o = d(() => Object.assign({}, T, h.value)), D = d(() => W(o.value, X(le))), { show: $, hide: i, confirm: c, visible: m } = Y({
|
|
17
|
+
showCallback: (r) => {
|
|
18
|
+
h.value = r;
|
|
19
19
|
},
|
|
20
|
-
hideCallback: (
|
|
21
|
-
confirmCallback: (
|
|
22
|
-
}), u =
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
}, a =
|
|
20
|
+
hideCallback: (r) => s("cancel", r),
|
|
21
|
+
confirmCallback: (r) => s("confirm", r)
|
|
22
|
+
}), u = k("drawerRef"), z = () => {
|
|
23
|
+
const r = u.value?.$el;
|
|
24
|
+
(r instanceof Element ? r : void 0)?.querySelector(".el-drawer__body")?.scrollTo({ top: 0 });
|
|
25
|
+
}, a = k("schemaFormRef"), { loading: N, trigger: y } = Z(
|
|
26
26
|
async () => {
|
|
27
27
|
if (!a.value)
|
|
28
28
|
throw new Error("not found VroElSchemaForm");
|
|
29
29
|
await a.value.validate().catch(() => {
|
|
30
30
|
throw "cancel";
|
|
31
31
|
});
|
|
32
|
-
let
|
|
32
|
+
let r = !1;
|
|
33
33
|
if (await a.value.trigger({
|
|
34
34
|
confirm: c,
|
|
35
35
|
hide: i,
|
|
36
36
|
block: () => {
|
|
37
|
-
|
|
37
|
+
r = !0;
|
|
38
38
|
}
|
|
39
|
-
}), m.value && !
|
|
40
|
-
const e = await a.value.extractValues(),
|
|
41
|
-
c(
|
|
39
|
+
}), m.value && !r) {
|
|
40
|
+
const e = await a.value.extractValues(), t = await o.value.request?.(e, o.value.schema) ?? e;
|
|
41
|
+
c(t);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
throwError: !0
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
return
|
|
48
|
+
return K(re, {
|
|
49
49
|
confirm: c,
|
|
50
50
|
hide: i
|
|
51
51
|
}), V({
|
|
@@ -55,73 +55,73 @@ const ae = { class: "vro-el-schema-form-drawer-footer" }, pe = /* @__PURE__ */ j
|
|
|
55
55
|
get vroElSchemaForm() {
|
|
56
56
|
return a.value;
|
|
57
57
|
},
|
|
58
|
-
show:
|
|
58
|
+
show: $,
|
|
59
59
|
hide: i
|
|
60
|
-
}), (
|
|
60
|
+
}), (r, e) => (v(), f(l(_), {
|
|
61
61
|
modelValue: l(m),
|
|
62
|
-
"onUpdate:modelValue": e[4] || (e[4] = (
|
|
62
|
+
"onUpdate:modelValue": e[4] || (e[4] = (t) => A(m) ? m.value = t : null),
|
|
63
63
|
ref_key: "drawerRef",
|
|
64
64
|
ref: u,
|
|
65
65
|
class: "vro-el-schema-form-drawer",
|
|
66
|
-
title:
|
|
67
|
-
direction:
|
|
68
|
-
size:
|
|
69
|
-
"with-header":
|
|
66
|
+
title: o.value.title,
|
|
67
|
+
direction: o.value.direction,
|
|
68
|
+
size: o.value.size,
|
|
69
|
+
"with-header": o.value.withHeader,
|
|
70
70
|
"destroy-on-close": "",
|
|
71
71
|
"append-to-body": "",
|
|
72
72
|
"close-on-click-modal": !1,
|
|
73
|
-
style:
|
|
74
|
-
onClose: e[5] || (e[5] = (
|
|
75
|
-
onClosed: e[6] || (e[6] = (
|
|
76
|
-
onOpened:
|
|
77
|
-
},
|
|
73
|
+
style: L(o.value.style),
|
|
74
|
+
onClose: e[5] || (e[5] = (t) => l(i)()),
|
|
75
|
+
onClosed: e[6] || (e[6] = (t) => s("closed")),
|
|
76
|
+
onOpened: z
|
|
77
|
+
}, S({
|
|
78
78
|
default: n(() => [
|
|
79
|
-
|
|
79
|
+
H(l(oe), p(D.value, {
|
|
80
80
|
ref_key: "schemaFormRef",
|
|
81
81
|
ref: a,
|
|
82
|
-
onChangeField: e[0] || (e[0] = (
|
|
83
|
-
onInputField: e[1] || (e[1] = (
|
|
84
|
-
onSubmit: e[2] || (e[2] = M((
|
|
85
|
-
}),
|
|
82
|
+
onChangeField: e[0] || (e[0] = (t) => s("change-field", t)),
|
|
83
|
+
onInputField: e[1] || (e[1] = (t) => s("input-field", t)),
|
|
84
|
+
onSubmit: e[2] || (e[2] = M((t) => l(y)(), ["prevent"]))
|
|
85
|
+
}), S({
|
|
86
86
|
default: n(() => [
|
|
87
|
-
|
|
87
|
+
g(r.$slots, "default")
|
|
88
88
|
]),
|
|
89
89
|
_: 2
|
|
90
90
|
}, [
|
|
91
|
-
U(x.value, (
|
|
92
|
-
name:
|
|
93
|
-
fn: n((
|
|
94
|
-
|
|
91
|
+
U(x.value, (t) => ({
|
|
92
|
+
name: t,
|
|
93
|
+
fn: n((j) => [
|
|
94
|
+
g(r.$slots, t, G(J(j ?? {})))
|
|
95
95
|
])
|
|
96
96
|
}))
|
|
97
97
|
]), 1040)
|
|
98
98
|
]),
|
|
99
99
|
_: 2
|
|
100
100
|
}, [
|
|
101
|
-
|
|
101
|
+
o.value.showCancelButton || o.value.showConfirmButton ? {
|
|
102
102
|
name: "footer",
|
|
103
103
|
fn: n(() => [
|
|
104
104
|
Q("div", ae, [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}, {
|
|
105
|
+
o.value.showCancelButton ? (v(), f(l(E), p({ key: 0 }, o.value.cancelButtonProps, {
|
|
106
|
+
onClick: e[3] || (e[3] = (t) => l(i)("cancel"))
|
|
107
|
+
}), {
|
|
109
108
|
default: n(() => [
|
|
110
|
-
|
|
109
|
+
F(b(o.value.cancelButtonText || l(w)("schemaFormDrawer.cancelText")), 1)
|
|
111
110
|
]),
|
|
112
111
|
_: 1
|
|
113
|
-
})) :
|
|
114
|
-
|
|
112
|
+
}, 16)) : C("", !0),
|
|
113
|
+
o.value.showConfirmButton ? (v(), f(l(E), p({
|
|
115
114
|
key: 1,
|
|
116
|
-
type: "primary"
|
|
117
|
-
|
|
118
|
-
loading: l(
|
|
119
|
-
|
|
115
|
+
type: "primary"
|
|
116
|
+
}, o.value.confirmButtonProps, {
|
|
117
|
+
loading: l(N),
|
|
118
|
+
onClick: l(y)
|
|
119
|
+
}), {
|
|
120
120
|
default: n(() => [
|
|
121
|
-
|
|
121
|
+
F(b(o.value.confirmButtonText || l(w)("schemaFormDrawer.confirmText")), 1)
|
|
122
122
|
]),
|
|
123
123
|
_: 1
|
|
124
|
-
},
|
|
124
|
+
}, 16, ["loading", "onClick"])) : C("", !0)
|
|
125
125
|
])
|
|
126
126
|
]),
|
|
127
127
|
key: "0"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { defineComponent as u, useAttrs as m, useSlots as g, ref as d, createBlock as C, openBlock as v, h as t } from "vue";
|
|
2
2
|
import { ElConfigProvider as _ } from "element-plus";
|
|
3
|
-
import { VroElConfigProvider as
|
|
4
|
-
import { vroElWithConfigProps as
|
|
3
|
+
import { VroElConfigProvider as h } from "../vro-el-config-provider/index.js";
|
|
4
|
+
import { vroElWithConfigProps as P } from "./types.js";
|
|
5
5
|
const w = /* @__PURE__ */ u({
|
|
6
6
|
name: "VroElWithConfig",
|
|
7
|
+
inheritAttrs: !1,
|
|
7
8
|
__name: "vro-el-with-config",
|
|
8
|
-
props:
|
|
9
|
+
props: P,
|
|
9
10
|
setup(i, { expose: f }) {
|
|
10
11
|
const r = i, a = m(), n = g(), o = d();
|
|
11
12
|
f(
|
|
@@ -21,7 +22,7 @@ const w = /* @__PURE__ */ u({
|
|
|
21
22
|
}
|
|
22
23
|
)
|
|
23
24
|
);
|
|
24
|
-
const l = () => r.is ? t(r.is, { ...a, ref: o }, n) : n.default?.(), p = () => t(
|
|
25
|
+
const l = () => r.is ? t(r.is, { ...a, ref: o }, n) : n.default?.(), p = () => t(h, r.vroConfigProps, {
|
|
25
26
|
default: l
|
|
26
27
|
}), c = () => t(_, r.elConfigProps, p);
|
|
27
28
|
return (s, e) => (v(), C(c));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vrojs/element-plus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "vrojs ui",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vite": "^7.1.12",
|
|
54
54
|
"vite-plugin-dts": "^4.5.4",
|
|
55
55
|
"vue": "^3.5.22",
|
|
56
|
-
"@vrojs/base": "0.0.
|
|
56
|
+
"@vrojs/base": "0.0.11",
|
|
57
57
|
"@vrojs/use": "0.0.5"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|