@vrojs/element-plus 0.0.30 → 0.0.32
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/index.d.ts +1 -0
- package/dist/index.js +147 -139
- package/dist/style/deps.js +1 -0
- package/dist/vro-el-async-dialog/function-call.d.ts +3 -0
- package/dist/vro-el-async-dialog/function-call.js +20 -0
- package/dist/vro-el-async-dialog/index.d.ts +48 -0
- package/dist/vro-el-async-dialog/index.js +9 -0
- package/dist/vro-el-async-dialog/style/css.d.ts +0 -0
- package/dist/vro-el-async-dialog/style/css.js +2 -0
- package/dist/vro-el-async-dialog/style/deps.d.ts +0 -0
- package/dist/vro-el-async-dialog/style/deps.js +1 -0
- package/dist/vro-el-async-dialog/style/index.d.ts +0 -0
- package/dist/vro-el-async-dialog/style/index.js +2 -0
- package/dist/vro-el-async-dialog/types.d.ts +12 -0
- package/dist/vro-el-async-dialog/types.js +1 -0
- package/dist/vro-el-async-dialog/vro-el-async-dialog.vue.d.ts +28 -0
- package/dist/vro-el-async-dialog/vro-el-async-dialog.vue.js +58 -0
- package/dist/vro-el-async-dialog/vro-el-async-dialog.vue2.js +4 -0
- package/dist/vro-el-image/index.d.ts +3 -3
- package/dist/vro-el-image/utils.d.ts +1 -1
- package/dist/vro-el-image/vro-el-image.vue.d.ts +1 -1
- package/dist/vro-el-schema-form/defineVroElSchemaForm.d.ts +2 -3
- package/dist/vro-el-schema-form/types.d.ts +6 -2
- package/dist/vro-el-schema-form/useVroElSchemaForm.d.ts +446 -7
- package/dist/vro-el-schema-form/useVroElSchemaForm.js +13 -13
- package/dist/vro-el-schema-form/vro-el-schema-form.vue.js +58 -52
- package/dist/vro-el-schema-form-dialog/function-call.js +2 -2
- package/dist/vro-el-schema-form-dialog/index.d.ts +2 -1
- package/dist/vro-el-schema-form-dialog/index.js +13 -9
- package/dist/vro-el-schema-form-dialog/useVroElSchemaFormDialog.d.ts +12 -13
- package/dist/vro-el-schema-form-dialog/useVroElSchemaFormDialog.js +27 -15
- package/dist/vro-el-schema-form-dialog/utils.d.ts +2 -0
- package/dist/vro-el-schema-form-dialog/utils.js +6 -0
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.d.ts +2 -2
- package/dist/vro-el-schema-form-dialog/vro-el-schema-form-dialog.vue.js +25 -24
- package/dist/vro-el-schema-form-drawer/function-call.js +2 -2
- package/dist/vro-el-schema-form-drawer/index.d.ts +1 -1
- package/dist/vro-el-schema-form-drawer/vro-el-schema-form-drawer.vue.d.ts +2 -2
- package/dist/vro-el-select/index.d.ts +1 -1
- package/dist/vro-el-select/vro-el-select.vue.d.ts +1 -1
- package/dist/vro-el-with-config/index.d.ts +58 -11
- package/dist/vro-el-with-config/types.d.ts +7 -0
- package/dist/vro-el-with-config/types.js +8 -1
- package/dist/vro-el-with-config/vro-el-with-config.vue.d.ts +28 -2
- package/dist/vro-el-with-config/vro-el-with-config.vue.js +40 -19
- package/package.json +1 -1
|
@@ -1,121 +1,127 @@
|
|
|
1
|
-
import { defineComponent as q, computed as
|
|
1
|
+
import { defineComponent as q, computed as I, ref as P, watchEffect as z, useTemplateRef as O, createBlock as E, openBlock as g, unref as u, mergeProps as i, withCtx as m, createVNode as j, createElementBlock as A, renderSlot as F, Fragment as G, renderList as _, createSlots as B, resolveDynamicComponent as H } from "vue";
|
|
2
2
|
import J from "../node_modules/.pnpm/@ajuanjs_banana@0.0.3/node_modules/@ajuanjs/banana/dist/index.js";
|
|
3
|
-
import { isFunction as d, isString as
|
|
4
|
-
import { getSlotEntries as
|
|
3
|
+
import { isFunction as d, isString as $, filterEmptyValue as Q } from "@daysnap/utils";
|
|
4
|
+
import { getSlotEntries as D } from "@vrojs/base";
|
|
5
5
|
import { ElForm as X, ElRow as Y, ElCol as Z, ElFormItem as k } from "element-plus";
|
|
6
6
|
import { useLocale as ee } from "../locale/useLocale.js";
|
|
7
7
|
import { datePickerValueFormat as re } from "../utils/datePickerValueFormat.js";
|
|
8
|
-
import { defineVroElSchemaFormFieldTrigger as
|
|
9
|
-
import { vroElSchemaFormProps as
|
|
8
|
+
import { defineVroElSchemaFormFieldTrigger as oe } from "./defineVroElSchemaFormFieldTrigger.js";
|
|
9
|
+
import { vroElSchemaFormProps as ae } from "./types.js";
|
|
10
10
|
import { vroElSchemaFormFieldManager as te } from "./vroElSchemaFormFieldManager.js";
|
|
11
|
-
const
|
|
11
|
+
const he = /* @__PURE__ */ q({
|
|
12
12
|
name: "VroElSchemaForm",
|
|
13
13
|
__name: "vro-el-schema-form",
|
|
14
|
-
props:
|
|
14
|
+
props: ae,
|
|
15
15
|
emits: ["change-field", "input-field"],
|
|
16
|
-
setup(
|
|
17
|
-
const w =
|
|
16
|
+
setup(x, { expose: y, emit: K }) {
|
|
17
|
+
const w = K, n = x, L = I(() => ({
|
|
18
18
|
validateOnRuleChange: !1,
|
|
19
19
|
...n.formProps
|
|
20
|
-
})), { locale:
|
|
20
|
+
})), { locale: M } = ee(), V = P({}), b = P({}), h = P({});
|
|
21
21
|
z(() => {
|
|
22
22
|
const { schema: e } = n;
|
|
23
|
-
|
|
23
|
+
h.value = {};
|
|
24
24
|
const a = {}, r = {};
|
|
25
25
|
Object.entries(e).forEach(([o, t]) => {
|
|
26
26
|
let { hidden: s, value: c, rules: l, is: p } = t;
|
|
27
|
-
d(s) && (s = s(c, t, e)), p || (s = !0), s || (r[o] = c,
|
|
27
|
+
d(s) && (s = s(c, t, e)), p || (s = !0), s || (r[o] = c, h.value[o] = t), d(l) && (l = l(c, t, e)), a[o] = l;
|
|
28
28
|
}), Object.assign(b.value, r), Object.assign(V.value, a);
|
|
29
29
|
});
|
|
30
|
-
const
|
|
30
|
+
const C = I(() => Object.entries(h.value).reduce((e, [a, r]) => {
|
|
31
31
|
let { is: o, options: t, labelKey: s, valueKey: c } = r, l = { ...r.props };
|
|
32
|
-
if (
|
|
32
|
+
if ($(o)) {
|
|
33
33
|
const p = te.get(o);
|
|
34
34
|
if (p) {
|
|
35
|
-
const
|
|
35
|
+
const W = M.value.el.schemaForm[o] ?? {};
|
|
36
36
|
o === "ElDatePicker" && (l.valueFormat = l.valueFormat ?? re[l.type ?? "date"]), l = Object.assign(
|
|
37
37
|
{},
|
|
38
38
|
p.props,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
W,
|
|
40
|
+
Q({ options: t, labelKey: s, valueKey: c }),
|
|
41
41
|
l
|
|
42
42
|
), l.disabled && (l.placeholder = "-", o === "ElDatePicker" && (l.startPlaceholder = "-", l.endPlaceholder = "-")), o = p.is;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return e[a] = { is: o, props: l }, e;
|
|
46
|
-
}, {})),
|
|
46
|
+
}, {})), R = async (e, a) => {
|
|
47
47
|
w("change-field", { key: e, value: a }), await n.schema[e]?.onChange?.(a, n.schema[e], n.schema);
|
|
48
|
-
},
|
|
48
|
+
}, S = async (e, a) => {
|
|
49
49
|
w("input-field", { key: e, value: a }), await n.schema[e]?.onInput?.(a, n.schema[e], n.schema);
|
|
50
|
-
},
|
|
51
|
-
const e =
|
|
50
|
+
}, v = O("componentRefs"), f = O("formRef"), T = async () => {
|
|
51
|
+
const e = v.value?.filter((a) => d(a.validate)) ?? [];
|
|
52
52
|
await Promise.all([f.value, ...e].map((a) => a?.validate()));
|
|
53
|
-
},
|
|
54
|
-
const e =
|
|
53
|
+
}, U = async () => {
|
|
54
|
+
const e = v.value?.filter((r) => d(r.extractValues)) ?? [], a = await Promise.all(
|
|
55
55
|
e.map((r) => r.extractValues())
|
|
56
56
|
);
|
|
57
57
|
return a.push(await J.extract(n.schema)), a.filter(Boolean).reduce((r, o) => ({ ...r, ...o }), {});
|
|
58
|
-
},
|
|
59
|
-
const a =
|
|
58
|
+
}, N = oe(async (e) => {
|
|
59
|
+
const a = v.value?.filter((r) => d(r.trigger)) ?? [];
|
|
60
60
|
await Promise.all(a.map((r) => r.trigger(e)));
|
|
61
61
|
});
|
|
62
|
-
return
|
|
62
|
+
return y({
|
|
63
63
|
get elForm() {
|
|
64
64
|
return f.value;
|
|
65
65
|
},
|
|
66
|
-
validate:
|
|
66
|
+
validate: T,
|
|
67
67
|
resetFields: () => f.value?.resetFields(),
|
|
68
|
-
trigger:
|
|
69
|
-
extractValues:
|
|
68
|
+
trigger: N,
|
|
69
|
+
extractValues: U,
|
|
70
70
|
validateField: async (e) => f.value?.validateField(e)
|
|
71
|
-
}), (e, a) => (g(),
|
|
71
|
+
}), (e, a) => (g(), E(u(X), i(L.value, {
|
|
72
72
|
ref_key: "formRef",
|
|
73
73
|
ref: f,
|
|
74
74
|
class: "vro-el-schema-form",
|
|
75
75
|
model: b.value,
|
|
76
76
|
rules: V.value
|
|
77
77
|
}), {
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
default:
|
|
81
|
-
(g(!0), A(G, null, _(
|
|
82
|
-
default:
|
|
83
|
-
|
|
78
|
+
default: m(() => [
|
|
79
|
+
j(u(Y), i({ gutter: 16 }, e.rowProps), {
|
|
80
|
+
default: m(() => [
|
|
81
|
+
(g(!0), A(G, null, _(h.value, (r, o) => (g(), E(u(Z), i({ key: o }, { ref_for: !0 }, { ...e.colProps, ...r.colProps }), {
|
|
82
|
+
default: m(() => [
|
|
83
|
+
j(u(k), i({
|
|
84
84
|
label: r.label,
|
|
85
85
|
prop: o
|
|
86
|
-
}, { ref_for: !0 }, { ...e.formItemProps, ...r.formItemProps }),
|
|
87
|
-
default:
|
|
88
|
-
(
|
|
86
|
+
}, { ref_for: !0 }, { ...e.formItemProps, ...r.formItemProps }), B({
|
|
87
|
+
default: m(() => [
|
|
88
|
+
u($)(r.is) && r.is.startsWith("slot-") ? F(e.$slots, r.is, {
|
|
89
|
+
key: 0,
|
|
90
|
+
item: r,
|
|
91
|
+
onChange: (t) => R(o, t),
|
|
92
|
+
onInput: (t) => S(o, t)
|
|
93
|
+
}) : (g(), E(H(C.value?.[o]?.is), i({
|
|
94
|
+
key: 1,
|
|
89
95
|
modelValue: r.value,
|
|
90
96
|
"onUpdate:modelValue": (t) => r.value = t
|
|
91
|
-
}, { ref_for: !0 },
|
|
97
|
+
}, { ref_for: !0 }, C.value?.[o]?.props, {
|
|
92
98
|
ref_for: !0,
|
|
93
99
|
ref_key: "componentRefs",
|
|
94
|
-
ref:
|
|
95
|
-
onChange: (t) =>
|
|
96
|
-
onInput: (t) =>
|
|
97
|
-
}),
|
|
98
|
-
_(
|
|
100
|
+
ref: v,
|
|
101
|
+
onChange: (t) => R(o, t),
|
|
102
|
+
onInput: (t) => S(o, t)
|
|
103
|
+
}), B({ _: 2 }, [
|
|
104
|
+
_(u(D)(r.slots), ({ source: t, target: s }) => ({
|
|
99
105
|
name: s,
|
|
100
|
-
fn:
|
|
101
|
-
|
|
106
|
+
fn: m((c) => [
|
|
107
|
+
F(e.$slots, t, i({ ref_for: !0 }, c ?? {}, { item: r }))
|
|
102
108
|
])
|
|
103
109
|
}))
|
|
104
110
|
]), 1040, ["modelValue", "onUpdate:modelValue", "onChange", "onInput"]))
|
|
105
111
|
]),
|
|
106
112
|
_: 2
|
|
107
113
|
}, [
|
|
108
|
-
_(
|
|
114
|
+
_(u(D)(r.itemSlots), ({ source: t, target: s }) => ({
|
|
109
115
|
name: s,
|
|
110
|
-
fn:
|
|
111
|
-
|
|
116
|
+
fn: m((c) => [
|
|
117
|
+
F(e.$slots, t, i({ ref_for: !0 }, c ?? {}, { item: r }))
|
|
112
118
|
])
|
|
113
119
|
}))
|
|
114
120
|
]), 1040, ["label", "prop"])
|
|
115
121
|
]),
|
|
116
122
|
_: 2
|
|
117
123
|
}, 1040))), 128)),
|
|
118
|
-
|
|
124
|
+
F(e.$slots, "default")
|
|
119
125
|
]),
|
|
120
126
|
_: 3
|
|
121
127
|
}, 16)
|
|
@@ -125,5 +131,5 @@ const ve = /* @__PURE__ */ q({
|
|
|
125
131
|
}
|
|
126
132
|
});
|
|
127
133
|
export {
|
|
128
|
-
|
|
134
|
+
he as default
|
|
129
135
|
};
|
|
@@ -2,6 +2,7 @@ export * from './function-call';
|
|
|
2
2
|
export * from './injection';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export * from './useVroElSchemaFormDialog';
|
|
5
|
+
export * from './utils';
|
|
5
6
|
export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
6
7
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
7
8
|
title: StringConstructor;
|
|
@@ -659,7 +660,7 @@ export declare const VroElSchemaFormDialog: import('@vrojs/base').WithInstall<{
|
|
|
659
660
|
onClosed?: (() => any) | undefined;
|
|
660
661
|
onOpenAutoFocus?: (() => any) | undefined;
|
|
661
662
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
662
|
-
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "
|
|
663
|
+
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "dialogContentRef" | "resetPosition" | "handleClose"> & import('vue').ShallowUnwrapRef<{
|
|
663
664
|
visible: import('vue').Ref<boolean, boolean>;
|
|
664
665
|
dialogContentRef: import('vue').Ref<any, any>;
|
|
665
666
|
resetPosition: () => void;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { withInstall as m } from "@vrojs/base";
|
|
2
2
|
import o from "./vro-el-schema-form-dialog.vue.js";
|
|
3
|
-
import { showVroElSchemaFormDialog as
|
|
4
|
-
import { useVroElSchemaFormDialogInstance as s, vroElSchemaFormDialogInjectionKey as
|
|
3
|
+
import { showVroElSchemaFormDialog as i } from "./function-call.js";
|
|
4
|
+
import { useVroElSchemaFormDialogInstance as s, vroElSchemaFormDialogInjectionKey as h } from "./injection.js";
|
|
5
5
|
import { vroElSchemaFormDialogProps as p } from "./types.js";
|
|
6
|
-
import { useVroElSchemaFormDialog as
|
|
7
|
-
|
|
6
|
+
import { createVroElSchemaFormDialog as D, useVroElSchemaFormDialog as E } from "./useVroElSchemaFormDialog.js";
|
|
7
|
+
import { getVroElSchemaFormDialogOptions as S, setVroElSchemaFormDialogOptions as x } from "./utils.js";
|
|
8
|
+
const t = m(o, (r) => {
|
|
8
9
|
r.component(o.name, o), o._context = r._context;
|
|
9
10
|
});
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
t as VroElSchemaFormDialog,
|
|
13
|
+
D as createVroElSchemaFormDialog,
|
|
14
|
+
t as default,
|
|
15
|
+
S as getVroElSchemaFormDialogOptions,
|
|
16
|
+
x as setVroElSchemaFormDialogOptions,
|
|
17
|
+
i as showVroElSchemaFormDialog,
|
|
18
|
+
E as useVroElSchemaFormDialog,
|
|
15
19
|
s as useVroElSchemaFormDialogInstance,
|
|
16
|
-
|
|
20
|
+
h as vroElSchemaFormDialogInjectionKey,
|
|
17
21
|
p as vroElSchemaFormDialogProps
|
|
18
22
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
instanceRef?: Ref<any>;
|
|
6
|
-
onGenerate?: (schema: S, ...args: any[]) => void;
|
|
7
|
-
onSuccess?: (schema: S, ...args: any[]) => void;
|
|
1
|
+
import { VroElSchemaFormNormalizedSchema, VroElSchemaFormSchema } from '../vro-el-schema-form/types';
|
|
2
|
+
import { VroElSchemaFormDialogProps } from './types';
|
|
3
|
+
export interface UseVroElSchemaFormDialogOptions {
|
|
4
|
+
trigger?: () => void;
|
|
8
5
|
}
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
export declare function useVroElSchemaFormDialog<R extends Record<string, any>, T extends VroElSchemaFormSchema = VroElSchemaFormSchema>(createSchema: (item?: R) => T | Promise<T>, request: (params: any, item?: R) => Promise<any>, options?: UseVroElSchemaFormDialogOptions): {
|
|
7
|
+
schema: import('vue').Ref<VroElSchemaFormNormalizedSchema<T> | undefined, VroElSchemaFormNormalizedSchema<T> | undefined>;
|
|
8
|
+
trigger: (item?: R, customProps?: Partial<VroElSchemaFormDialogProps>) => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
export declare function createVroElSchemaFormDialog<R extends Record<string, any>>(): <T extends VroElSchemaFormSchema = VroElSchemaFormSchema>(createSchema: (item?: R) => T | Promise<T>, request: (params: any, item?: R) => Promise<any>, options?: UseVroElSchemaFormDialogOptions) => {
|
|
11
|
+
schema: import('vue').Ref<VroElSchemaFormNormalizedSchema<T> | undefined, VroElSchemaFormNormalizedSchema<T> | undefined>;
|
|
12
|
+
trigger: (item?: R, customProps?: Partial<VroElSchemaFormDialogProps>) => Promise<void>;
|
|
13
|
+
};
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ref as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import g from "../node_modules/.pnpm/@ajuanjs_banana@0.0.3/node_modules/@ajuanjs/banana/dist/index.js";
|
|
2
|
+
import { ref as u } from "vue";
|
|
3
|
+
function w(e, c, s = {}) {
|
|
4
|
+
const a = u(), { trigger: t } = s;
|
|
5
|
+
return { schema: a, trigger: async (r, n) => {
|
|
6
|
+
const o = await e(r);
|
|
7
|
+
r && await g.assign(r, o), a.value = o, await showVroElSchemaFormDialog({
|
|
8
|
+
...n,
|
|
9
|
+
schema: a.value,
|
|
10
|
+
request: (i) => c(i, r)
|
|
11
|
+
}), t?.();
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
14
|
+
function f() {
|
|
15
|
+
return function(e, c, s = {}) {
|
|
16
|
+
const a = u(), { trigger: t } = s;
|
|
17
|
+
return { schema: a, trigger: async (r, n) => {
|
|
18
|
+
const o = await e(r);
|
|
19
|
+
r && await g.assign(r, o), a.value = o, await showVroElSchemaFormDialog({
|
|
20
|
+
...n,
|
|
21
|
+
schema: a.value,
|
|
22
|
+
request: (i) => c(i, r)
|
|
23
|
+
}), t?.();
|
|
24
|
+
} };
|
|
25
|
+
};
|
|
15
26
|
}
|
|
16
27
|
export {
|
|
17
|
-
|
|
28
|
+
f as createVroElSchemaFormDialog,
|
|
29
|
+
w as useVroElSchemaFormDialog
|
|
18
30
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { VroElSchemaFormDialogProps } from './types';
|
|
2
|
+
export declare const setVroElSchemaFormDialogOptions: (value: Partial<Omit<VroElSchemaFormDialogProps, "request" | "schema">>) => Partial<Omit<VroElSchemaFormDialogProps, "request" | "schema">>, getVroElSchemaFormDialogOptions: () => Partial<Omit<VroElSchemaFormDialogProps, "request" | "schema">>;
|
|
@@ -142,7 +142,7 @@ declare function __VLS_template(): {
|
|
|
142
142
|
onClosed?: (() => any) | undefined;
|
|
143
143
|
onOpenAutoFocus?: (() => any) | undefined;
|
|
144
144
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
145
|
-
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "
|
|
145
|
+
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "dialogContentRef" | "resetPosition" | "handleClose"> & import('vue').ShallowUnwrapRef<{
|
|
146
146
|
visible: import('vue').Ref<boolean, boolean>;
|
|
147
147
|
dialogContentRef: import('vue').Ref<any, any>;
|
|
148
148
|
resetPosition: () => void;
|
|
@@ -1312,7 +1312,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1312
1312
|
onClosed?: (() => any) | undefined;
|
|
1313
1313
|
onOpenAutoFocus?: (() => any) | undefined;
|
|
1314
1314
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
1315
|
-
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "
|
|
1315
|
+
}>, "title" | "ariaLevel" | "visible" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "dialogContentRef" | "resetPosition" | "handleClose"> & import('vue').ShallowUnwrapRef<{
|
|
1316
1316
|
visible: import('vue').Ref<boolean, boolean>;
|
|
1317
1317
|
dialogContentRef: import('vue').Ref<any, any>;
|
|
1318
1318
|
resetPosition: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 S, withCtx as n, createVNode as M, mergeProps as v, withModifiers as U, renderSlot as w, 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";
|
|
@@ -6,23 +6,24 @@ import { useLocale as ee } from "../locale/useLocale.js";
|
|
|
6
6
|
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
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { getVroElSchemaFormDialogOptions as re } from "./utils.js";
|
|
10
|
+
import { vroElSchemaFormProps as ae } from "../vro-el-schema-form/types.js";
|
|
11
|
+
const ne = { class: "dialog-footer" }, ye = /* @__PURE__ */ q({
|
|
11
12
|
name: "VroElSchemaFormDialog",
|
|
12
13
|
__name: "vro-el-schema-form-dialog",
|
|
13
14
|
props: le,
|
|
14
15
|
emits: ["change-field", "input-field", "cancel", "confirm", "closed"],
|
|
15
|
-
setup(
|
|
16
|
-
const s = P,
|
|
16
|
+
setup(V, { expose: B, emit: P }) {
|
|
17
|
+
const s = P, D = z(), R = V, { t: g } = ee(), y = I(), T = d(() => Object.keys(D).filter((o) => o !== "default")), l = d(() => Object.assign({}, R, re(), y.value)), x = d(() => W(l.value, X(ae))), { show: $, hide: i, confirm: c, visible: m } = Y({
|
|
17
18
|
showCallback: (o) => {
|
|
18
19
|
y.value = o;
|
|
19
20
|
},
|
|
20
21
|
hideCallback: (o) => s("cancel", o),
|
|
21
22
|
confirmCallback: (o) => s("confirm", o)
|
|
22
|
-
}),
|
|
23
|
-
const o =
|
|
23
|
+
}), u = k("dialogRef"), N = () => {
|
|
24
|
+
const o = u.value?.$el;
|
|
24
25
|
(o instanceof Element ? o : void 0)?.querySelector(".el-dialog__body")?.scrollTo({ top: 0 });
|
|
25
|
-
}, a = k("schemaFormRef"), { loading:
|
|
26
|
+
}, a = k("schemaFormRef"), { loading: O, trigger: h } = Z(
|
|
26
27
|
async () => {
|
|
27
28
|
if (!a.value)
|
|
28
29
|
throw new Error("not found VroElSchemaForm");
|
|
@@ -31,14 +32,14 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
31
32
|
});
|
|
32
33
|
let o = !1;
|
|
33
34
|
if (await a.value.trigger({
|
|
34
|
-
confirm:
|
|
35
|
+
confirm: c,
|
|
35
36
|
hide: i,
|
|
36
37
|
block: () => {
|
|
37
38
|
o = !0;
|
|
38
39
|
}
|
|
39
40
|
}), m.value && !o) {
|
|
40
41
|
const e = await a.value.extractValues(), t = await l.value.request?.(e, l.value.schema) ?? e;
|
|
41
|
-
|
|
42
|
+
c(t);
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
{
|
|
@@ -46,11 +47,11 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
46
47
|
}
|
|
47
48
|
);
|
|
48
49
|
return K(te, {
|
|
49
|
-
confirm:
|
|
50
|
+
confirm: c,
|
|
50
51
|
hide: i
|
|
51
|
-
}),
|
|
52
|
+
}), B({
|
|
52
53
|
get elDialog() {
|
|
53
|
-
return
|
|
54
|
+
return u.value;
|
|
54
55
|
},
|
|
55
56
|
get vroElSchemaForm() {
|
|
56
57
|
return a.value;
|
|
@@ -61,7 +62,7 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
61
62
|
modelValue: r(m),
|
|
62
63
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => A(m) ? m.value = t : null),
|
|
63
64
|
ref_key: "dialogRef",
|
|
64
|
-
ref:
|
|
65
|
+
ref: u,
|
|
65
66
|
class: "vro-el-schema-form-dialog",
|
|
66
67
|
title: l.value.title,
|
|
67
68
|
"destroy-on-close": "",
|
|
@@ -71,24 +72,24 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
71
72
|
onClose: e[5] || (e[5] = (t) => r(i)()),
|
|
72
73
|
onClosed: e[6] || (e[6] = (t) => s("closed")),
|
|
73
74
|
onOpened: N
|
|
74
|
-
},
|
|
75
|
+
}, S({
|
|
75
76
|
default: n(() => [
|
|
76
|
-
M(r(oe), v(
|
|
77
|
+
M(r(oe), v(x.value, {
|
|
77
78
|
ref_key: "schemaFormRef",
|
|
78
79
|
ref: a,
|
|
79
80
|
onChangeField: e[0] || (e[0] = (t) => s("change-field", t)),
|
|
80
81
|
onInputField: e[1] || (e[1] = (t) => s("input-field", t)),
|
|
81
82
|
onSubmit: e[2] || (e[2] = U((t) => r(h)(), ["prevent"]))
|
|
82
|
-
}),
|
|
83
|
+
}), S({
|
|
83
84
|
default: n(() => [
|
|
84
|
-
|
|
85
|
+
w(o.$slots, "default")
|
|
85
86
|
]),
|
|
86
87
|
_: 2
|
|
87
88
|
}, [
|
|
88
|
-
G(
|
|
89
|
+
G(T.value, (t) => ({
|
|
89
90
|
name: t,
|
|
90
|
-
fn: n((
|
|
91
|
-
|
|
91
|
+
fn: n((j) => [
|
|
92
|
+
w(o.$slots, t, H(J(j ?? {})))
|
|
92
93
|
])
|
|
93
94
|
}))
|
|
94
95
|
]), 1040)
|
|
@@ -98,7 +99,7 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
98
99
|
l.value.showCancelButton || l.value.showConfirmButton ? {
|
|
99
100
|
name: "footer",
|
|
100
101
|
fn: n(() => [
|
|
101
|
-
Q("div",
|
|
102
|
+
Q("div", ne, [
|
|
102
103
|
l.value.showCancelButton ? (p(), f(r(E), v({ key: 0 }, l.value.cancelButtonProps, {
|
|
103
104
|
onClick: e[3] || (e[3] = (t) => r(i)("cancel"))
|
|
104
105
|
}), {
|
|
@@ -111,7 +112,7 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
111
112
|
key: 1,
|
|
112
113
|
type: "primary"
|
|
113
114
|
}, l.value.confirmButtonProps, {
|
|
114
|
-
loading: r(
|
|
115
|
+
loading: r(O),
|
|
115
116
|
onClick: r(h)
|
|
116
117
|
}), {
|
|
117
118
|
default: n(() => [
|
|
@@ -127,5 +128,5 @@ const ae = { class: "dialog-footer" }, ve = /* @__PURE__ */ q({
|
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
130
|
export {
|
|
130
|
-
|
|
131
|
+
ye as default
|
|
131
132
|
};
|
|
@@ -696,7 +696,7 @@ export declare const VroElSchemaFormDrawer: import('@vrojs/base').WithInstall<{
|
|
|
696
696
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
697
697
|
"onResize-start"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
698
698
|
"onResize-end"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
699
|
-
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "
|
|
699
|
+
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "handleClose" | "direction" | "withHeader" | "modalFade"> & import('vue').ShallowUnwrapRef<{
|
|
700
700
|
handleClose: () => void;
|
|
701
701
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
702
702
|
$slots: {
|
|
@@ -164,7 +164,7 @@ declare function __VLS_template(): {
|
|
|
164
164
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
165
165
|
"onResize-start"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
166
166
|
"onResize-end"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
167
|
-
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "
|
|
167
|
+
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "handleClose" | "direction" | "withHeader" | "modalFade"> & import('vue').ShallowUnwrapRef<{
|
|
168
168
|
handleClose: () => void;
|
|
169
169
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
170
170
|
$slots: {
|
|
@@ -1380,7 +1380,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
1380
1380
|
onCloseAutoFocus?: (() => any) | undefined;
|
|
1381
1381
|
"onResize-start"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
1382
1382
|
"onResize-end"?: ((evt: MouseEvent, size: number) => any) | undefined;
|
|
1383
|
-
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "
|
|
1383
|
+
}>, "title" | "size" | "ariaLevel" | "appendTo" | "transition" | "closeOnClickModal" | "closeOnPressEscape" | "lockScroll" | "modal" | "openDelay" | "closeDelay" | "headerAriaLevel" | "alignCenter" | "draggable" | "overflow" | "showClose" | "handleClose" | "direction" | "withHeader" | "modalFade"> & import('vue').ShallowUnwrapRef<{
|
|
1384
1384
|
handleClose: () => void;
|
|
1385
1385
|
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
1386
1386
|
$slots: {
|
|
@@ -223,12 +223,12 @@ export declare const VroElSelect: import('@vrojs/base').WithInstall<import('vue'
|
|
|
223
223
|
popperOptions: Partial<import('element-plus').Options>;
|
|
224
224
|
showArrow: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
225
225
|
teleported: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
226
|
+
valueOnClear: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown>;
|
|
226
227
|
labelKey: string;
|
|
227
228
|
valueKey: string;
|
|
228
229
|
validateEvent: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
229
230
|
tabindex: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
230
231
|
multiple: boolean;
|
|
231
|
-
valueOnClear: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown>;
|
|
232
232
|
autocomplete: string;
|
|
233
233
|
automaticDropdown: boolean;
|
|
234
234
|
clearable: boolean;
|
|
@@ -222,12 +222,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
222
222
|
popperOptions: Partial<import('element-plus').Options>;
|
|
223
223
|
showArrow: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
224
224
|
teleported: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
225
|
+
valueOnClear: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown>;
|
|
225
226
|
labelKey: string;
|
|
226
227
|
valueKey: string;
|
|
227
228
|
validateEvent: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
228
229
|
tabindex: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
229
230
|
multiple: boolean;
|
|
230
|
-
valueOnClear: import('element-plus/es/utils/vue/props/types.mjs').EpPropMergeType<(new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | ((new (...args: any[]) => string | number | boolean | Function) | (() => string | number | boolean | Function | null) | null)[], unknown, unknown>;
|
|
231
231
|
autocomplete: string;
|
|
232
232
|
automaticDropdown: boolean;
|
|
233
233
|
clearable: boolean;
|