vft 0.0.483 → 0.0.487

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.
@@ -1,7 +1,7 @@
1
1
  import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
4
+ import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = g();
12
+ const a = C();
13
13
  function d(o, e = void 0) {
14
14
  const n = l() ? x(m, a) : a;
15
15
  return o ? i(() => n?.value?.[o] ?? e) : n;
@@ -27,7 +27,7 @@ function B(o) {
27
27
  };
28
28
  }
29
29
  const S = (o, e, n = !1) => {
30
- const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
31
31
  if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
@@ -32,6 +32,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
32
32
  type: import("vue").PropType<boolean>;
33
33
  default: boolean;
34
34
  };
35
+ scrollTop: {
36
+ type: import("vue").PropType<boolean>;
37
+ };
35
38
  modelValue: {
36
39
  type: import("vue").PropType<boolean>;
37
40
  default: boolean;
@@ -138,7 +141,31 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
138
141
  confirmLoading: {
139
142
  type: import("vue").PropType<boolean>;
140
143
  };
141
- }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
144
+ }>> & Readonly<{
145
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
146
+ onClose?: ((event?: Event | undefined) => any) | undefined;
147
+ onSubmit?: (() => any) | undefined;
148
+ onOpen?: (() => any) | undefined;
149
+ onOpened?: (() => any) | undefined;
150
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
151
+ onClosed?: (() => any) | undefined;
152
+ onOpenAutoFocus?: (() => any) | undefined;
153
+ onCloseAutoFocus?: (() => any) | undefined;
154
+ onRegister?: ((methods: import("./types").ModalMethods, uid: number) => any) | undefined;
155
+ onOk?: (() => any) | undefined;
156
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
157
+ "visible-change": (value: boolean) => void;
158
+ close: (event?: Event | undefined) => void;
159
+ ok: () => void;
160
+ register: (methods: import("./types").ModalMethods, uid: number) => void;
161
+ "update:modelValue": (value: boolean) => void;
162
+ submit: () => void;
163
+ open: () => void;
164
+ opened: () => void;
165
+ closed: () => void;
166
+ openAutoFocus: () => void;
167
+ closeAutoFocus: () => void;
168
+ }, import("vue").PublicProps, {
142
169
  title: string;
143
170
  center: boolean;
144
171
  fullscreen: boolean;
@@ -198,6 +225,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
198
225
  type: import("vue").PropType<boolean>;
199
226
  default: boolean;
200
227
  };
228
+ scrollTop: {
229
+ type: import("vue").PropType<boolean>;
230
+ };
201
231
  modelValue: {
202
232
  type: import("vue").PropType<boolean>;
203
233
  default: boolean;
@@ -304,7 +334,19 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
304
334
  confirmLoading: {
305
335
  type: import("vue").PropType<boolean>;
306
336
  };
307
- }>> & Readonly<{}>, {}, {}, {}, {}, {
337
+ }>> & Readonly<{
338
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
339
+ onClose?: ((event?: Event | undefined) => any) | undefined;
340
+ onSubmit?: (() => any) | undefined;
341
+ onOpen?: (() => any) | undefined;
342
+ onOpened?: (() => any) | undefined;
343
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
344
+ onClosed?: (() => any) | undefined;
345
+ onOpenAutoFocus?: (() => any) | undefined;
346
+ onCloseAutoFocus?: (() => any) | undefined;
347
+ onRegister?: ((methods: import("./types").ModalMethods, uid: number) => any) | undefined;
348
+ onOk?: (() => any) | undefined;
349
+ }>, {}, {}, {}, {}, {
308
350
  title: string;
309
351
  center: boolean;
310
352
  fullscreen: boolean;
@@ -361,6 +403,9 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
361
403
  type: import("vue").PropType<boolean>;
362
404
  default: boolean;
363
405
  };
406
+ scrollTop: {
407
+ type: import("vue").PropType<boolean>;
408
+ };
364
409
  modelValue: {
365
410
  type: import("vue").PropType<boolean>;
366
411
  default: boolean;
@@ -467,7 +512,31 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
467
512
  confirmLoading: {
468
513
  type: import("vue").PropType<boolean>;
469
514
  };
470
- }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
515
+ }>> & Readonly<{
516
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
517
+ onClose?: ((event?: Event | undefined) => any) | undefined;
518
+ onSubmit?: (() => any) | undefined;
519
+ onOpen?: (() => any) | undefined;
520
+ onOpened?: (() => any) | undefined;
521
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
522
+ onClosed?: (() => any) | undefined;
523
+ onOpenAutoFocus?: (() => any) | undefined;
524
+ onCloseAutoFocus?: (() => any) | undefined;
525
+ onRegister?: ((methods: import("./types").ModalMethods, uid: number) => any) | undefined;
526
+ onOk?: (() => any) | undefined;
527
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
528
+ "visible-change": (value: boolean) => void;
529
+ close: (event?: Event | undefined) => void;
530
+ ok: () => void;
531
+ register: (methods: import("./types").ModalMethods, uid: number) => void;
532
+ "update:modelValue": (value: boolean) => void;
533
+ submit: () => void;
534
+ open: () => void;
535
+ opened: () => void;
536
+ closed: () => void;
537
+ openAutoFocus: () => void;
538
+ closeAutoFocus: () => void;
539
+ }, string, {
471
540
  title: string;
472
541
  center: boolean;
473
542
  fullscreen: boolean;
@@ -1,4 +1,4 @@
1
- import type { ModalActionProps, ModalProps } from './types';
1
+ import type { ModalActionProps, ModalMethods, ModalProps } from './types';
2
2
  declare function __VLS_template(): {
3
3
  default?(_: {}): any;
4
4
  };
@@ -23,7 +23,19 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
23
23
  showActionButtonGroup: boolean;
24
24
  showSubmitButton: boolean;
25
25
  showCancelButton: boolean;
26
- }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps & ModalActionProps>, {
26
+ }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "visible-change": (value: boolean) => void;
28
+ close: (event?: Event | undefined) => void;
29
+ ok: () => void;
30
+ register: (methods: ModalMethods, uid: number) => void;
31
+ "update:modelValue": (value: boolean) => void;
32
+ submit: () => void;
33
+ open: () => void;
34
+ opened: () => void;
35
+ closed: () => void;
36
+ openAutoFocus: () => void;
37
+ closeAutoFocus: () => void;
38
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ModalProps & ModalActionProps>, {
27
39
  center: boolean;
28
40
  customClass: string;
29
41
  draggable: boolean;
@@ -44,7 +56,19 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
44
56
  showActionButtonGroup: boolean;
45
57
  showSubmitButton: boolean;
46
58
  showCancelButton: boolean;
47
- }>>> & Readonly<{}>, {
59
+ }>>> & Readonly<{
60
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
61
+ onClose?: ((event?: Event | undefined) => any) | undefined;
62
+ onSubmit?: (() => any) | undefined;
63
+ onOpen?: (() => any) | undefined;
64
+ onOpened?: (() => any) | undefined;
65
+ "onVisible-change"?: ((value: boolean) => any) | undefined;
66
+ onClosed?: (() => any) | undefined;
67
+ onOpenAutoFocus?: (() => any) | undefined;
68
+ onCloseAutoFocus?: (() => any) | undefined;
69
+ onRegister?: ((methods: ModalMethods, uid: number) => any) | undefined;
70
+ onOk?: (() => any) | undefined;
71
+ }>, {
48
72
  title: string;
49
73
  center: boolean;
50
74
  fullscreen: boolean;
@@ -1,14 +1,15 @@
1
- import { defineComponent as O, useAttrs as M, ref as r, getCurrentInstance as F, computed as i, unref as t, watchEffect as P, watch as R, nextTick as d, createBlock as B, openBlock as b, mergeProps as S, createSlots as T, withCtx as y, renderSlot as A, createCommentVNode as x } from "vue";
1
+ import { defineComponent as k, useAttrs as A, ref as f, getCurrentInstance as $, computed as r, unref as l, watchEffect as M, watch as P, nextTick as m, createBlock as b, openBlock as y, mergeProps as T, createSlots as R, withCtx as C, renderSlot as S, createCommentVNode as x } from "vue";
2
2
  import { deepMerge as D, isFunction as G } from "@vft/utils";
3
3
  import { VftDialog as I } from "../dialog/index.js";
4
- import $ from "./modal-footer-action.vue2.js";
5
- const N = /* @__PURE__ */ O({
4
+ import E from "./modal-footer-action.vue2.js";
5
+ const W = /* @__PURE__ */ k({
6
6
  __name: "modal",
7
7
  props: {
8
8
  closeFunc: {},
9
9
  showActionButtonGroup: { type: Boolean, default: !1 },
10
10
  confirmLoading: { type: Boolean },
11
11
  loading: { type: Boolean },
12
+ scrollTop: { type: Boolean },
12
13
  appendToBody: { type: Boolean, default: !1 },
13
14
  appendTo: {},
14
15
  beforeClose: {},
@@ -45,81 +46,81 @@ const N = /* @__PURE__ */ O({
45
46
  cancelButtonOptions: {},
46
47
  actionRowOptions: {}
47
48
  },
48
- emits: {
49
- "visible-change": [],
50
- close: [],
51
- ok: [],
52
- register: [],
53
- "update:modelValue": [],
54
- submit: []
55
- },
56
- setup(n, { emit: h }) {
57
- const o = n, a = h, C = M(), c = r(null), l = r(!1), s = r(null), f = {
58
- setModalProps: V,
49
+ emits: ["visible-change", "close", "ok", "register", "update:modelValue", "submit", "open", "opened", "closed", "openAutoFocus", "closeAutoFocus"],
50
+ setup(a, { emit: g }) {
51
+ const n = a, t = g, w = A(), d = f(null), s = f(!1), u = f(null), p = {
52
+ setModalProps: O,
59
53
  emitVisible: void 0,
60
54
  redoModalHeight: () => {
61
- d(() => {
62
- t(s) && t(s).setModalHeight();
55
+ m(() => {
56
+ l(u) && l(u).setModalHeight();
63
57
  });
64
58
  }
65
- }, u = F();
66
- u && a("register", f, u.uid);
67
- const g = i(() => ({
68
- ...o,
69
- ...t(c)
70
- })), w = i(() => ({
71
- ...C,
72
- ...t(g),
73
- modelValue: t(l)
59
+ }, i = $();
60
+ i && t("register", p, i.uid);
61
+ const v = r(() => ({
62
+ ...n,
63
+ ...l(d)
64
+ })), h = r(() => ({
65
+ ...w,
66
+ ...l(v),
67
+ modelValue: l(s)
74
68
  }));
75
- P(() => {
76
- l.value = !!o.modelValue;
77
- }), R(
78
- () => t(l),
69
+ M(() => {
70
+ s.value = !!n.modelValue;
71
+ }), P(
72
+ () => l(s),
79
73
  (e) => {
80
- a("visible-change", e), a("update:modelValue", e), u && d(() => {
81
- f.emitVisible(e, u.uid);
82
- }), d(() => {
83
- o.scrollTop && e && t(s) && t(s).scrollTop();
74
+ t("visible-change", e), t("update:modelValue", e), i && p.emitVisible && m(() => {
75
+ p.emitVisible(e, i.uid);
76
+ }), m(() => {
77
+ n.scrollTop && e && l(u) && l(u).scrollTop();
84
78
  });
85
79
  },
86
80
  {
87
81
  immediate: !1
88
82
  }
89
83
  );
90
- async function p(e) {
91
- if (e?.stopPropagation(), o.closeFunc && G(o.closeFunc)) {
92
- const m = await o.closeFunc();
93
- l.value = !m;
84
+ async function B(e) {
85
+ if (e?.stopPropagation(), n.closeFunc && G(n.closeFunc)) {
86
+ const o = await n.closeFunc();
87
+ s.value = !o;
94
88
  return;
95
89
  }
96
- l.value = !1, a("close", e);
90
+ s.value = !1, t("close", e);
97
91
  }
98
- function V(e) {
99
- c.value = D(t(c) || {}, e), Reflect.has(e, "modelValue") && (l.value = !!e.modelValue);
92
+ function O(e) {
93
+ d.value = D(l(d) || {}, e), Reflect.has(e, "modelValue") && (s.value = !!e.modelValue);
100
94
  }
101
- const v = i(() => ({
102
- onClick: (e) => p(e),
103
- ...o.cancelButtonOptions
104
- })), k = i(() => ({
105
- onClick: () => a("submit"),
106
- ...o.submitButtonOptions
95
+ const V = r(() => ({
96
+ onClick: (e) => B(e),
97
+ ...n.cancelButtonOptions
98
+ })), F = r(() => ({
99
+ onClick: () => t("submit"),
100
+ ...n.submitButtonOptions
107
101
  }));
108
- return (e, m) => (b(), B(t(I), S(w.value, { onClose: p }), T({
109
- default: y(() => [
110
- A(e.$slots, "default")
102
+ return (e, o) => (y(), b(l(I), T(h.value, {
103
+ onClose: B,
104
+ onOpen: o[0] || (o[0] = (c) => t("open")),
105
+ onOpened: o[1] || (o[1] = (c) => t("opened")),
106
+ onClosed: o[2] || (o[2] = (c) => t("closed")),
107
+ onOpenAutoFocus: o[3] || (o[3] = (c) => t("openAutoFocus")),
108
+ onCloseAutoFocus: o[4] || (o[4] = (c) => t("closeAutoFocus"))
109
+ }), R({
110
+ default: C(() => [
111
+ S(e.$slots, "default")
111
112
  ]),
112
113
  _: 2
113
114
  }, [
114
- e.$slots.footer || n.showActionButtonGroup ? {
115
+ e.$slots.footer || a.showActionButtonGroup ? {
115
116
  name: "footer",
116
- fn: y(() => [
117
- n.showActionButtonGroup ? (b(), B($, {
117
+ fn: C(() => [
118
+ a.showActionButtonGroup ? (y(), b(E, {
118
119
  key: 0,
119
- "show-cancel-button": n.showCancelButton,
120
- "show-submit-button": n.showSubmitButton,
121
- "cancel-button-options": v.value,
122
- "submit-button-options": k.value
120
+ "show-cancel-button": a.showCancelButton,
121
+ "show-submit-button": a.showSubmitButton,
122
+ "cancel-button-options": V.value,
123
+ "submit-button-options": F.value
123
124
  }, null, 8, ["show-cancel-button", "show-submit-button", "cancel-button-options", "submit-button-options"])) : x("", !0)
124
125
  ]),
125
126
  key: "0"
@@ -128,5 +129,5 @@ const N = /* @__PURE__ */ O({
128
129
  }
129
130
  });
130
131
  export {
131
- N as default
132
+ W as default
132
133
  };
@@ -12,6 +12,8 @@ export interface ModalProps extends DialogProps {
12
12
  confirmLoading?: boolean;
13
13
  /** 整个 Modal 的加载状态 */
14
14
  loading?: boolean;
15
+ /** 是否在打开时滚动到顶部 */
16
+ scrollTop?: boolean;
15
17
  }
16
18
  /** Modal 操作按钮配置接口 */
17
19
  export interface ModalActionProps {
@@ -1,4 +1,7 @@
1
1
  export declare const VftRouterViewContent: import("vft/es/utils").SFCWithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ name: {
3
+ type: import("vue").PropType<string>;
4
+ };
2
5
  cacheList: {
3
6
  type: import("vue").PropType<string[]>;
4
7
  required: true;
@@ -17,6 +20,9 @@ export declare const VftRouterViewContent: import("vft/es/utils").SFCWithInstall
17
20
  required: true;
18
21
  };
19
22
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
+ name: {
24
+ type: import("vue").PropType<string>;
25
+ };
20
26
  cacheList: {
21
27
  type: import("vue").PropType<string[]>;
22
28
  required: true;
@@ -1,4 +1,5 @@
1
1
  interface LayoutConentProps {
2
+ name?: string;
2
3
  cacheList: string[];
3
4
  transitionName?: string;
4
5
  transitionAttr?: Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { defineComponent as v, computed as s, resolveComponent as A, createBlock as t, openBlock as n, withCtx as c, createVNode as d, unref as o, KeepAlive as k, createCommentVNode as g, resolveDynamicComponent as f, Transition as x, mergeProps as C } from "vue";
1
+ import { defineComponent as v, computed as d, resolveComponent as A, createBlock as t, openBlock as n, withCtx as m, createVNode as s, unref as o, KeepAlive as k, createCommentVNode as g, resolveDynamicComponent as f, Transition as x, mergeProps as C } from "vue";
2
2
  import { getRouterKeyPath as N } from "@vft/router";
3
3
  import { createReusableTemplate as R } from "@vueuse/core";
4
4
  const K = v({
@@ -6,6 +6,7 @@ const K = v({
6
6
  }), T = /* @__PURE__ */ v({
7
7
  ...K,
8
8
  props: {
9
+ name: {},
9
10
  cacheList: {},
10
11
  transitionName: {},
11
12
  transitionAttr: {},
@@ -13,26 +14,26 @@ const K = v({
13
14
  isReloadFlag: { type: Boolean }
14
15
  },
15
16
  setup(e) {
16
- const p = s(() => e.openKeepAlive ? e.cacheList : []), h = s(() => (a) => {
17
- let l = a.name;
18
- return a.meta?.currentActivePath && (l = a.matched?.filter((r) => r.path === a.meta?.currentActivePath)?.[0].name), e.isReloadFlag ? void 0 : l;
19
- }), [y, m] = R();
20
- return (a, l) => {
17
+ const h = d(() => e.openKeepAlive ? e.cacheList : []), p = d(() => (a) => {
18
+ let i = a.name;
19
+ return a.meta?.currentActivePath && (i = a.matched?.filter((r) => r.path === a.meta?.currentActivePath)?.[0].name), e.isReloadFlag ? void 0 : i;
20
+ }), [y, c] = R();
21
+ return (a, i) => {
21
22
  const r = A("router-view");
22
- return n(), t(r, null, {
23
- default: c(({ Component: u, route: i }) => [
24
- d(o(y), null, {
25
- default: c(() => [
23
+ return n(), t(r, { name: e.name }, {
24
+ default: m(({ Component: u, route: l }) => [
25
+ s(o(y), null, {
26
+ default: m(() => [
26
27
  e.openKeepAlive ? (n(), t(k, {
27
28
  key: 0,
28
- include: p.value,
29
- exclude: h.value(i)
29
+ include: h.value,
30
+ exclude: p.value(l)
30
31
  }, [
31
32
  e.isReloadFlag ? (n(), t(f(u), {
32
- key: o(N)(i)
33
+ key: o(N)(l)
33
34
  })) : g("", !0)
34
35
  ], 1032, ["include", "exclude"])) : (n(), t(f(u), {
35
- key: i.fullPath
36
+ key: l.fullPath
36
37
  }))
37
38
  ]),
38
39
  _: 2
@@ -41,14 +42,14 @@ const K = v({
41
42
  key: 0,
42
43
  name: e.transitionName
43
44
  }, e.transitionAttr), {
44
- default: c(() => [
45
- d(o(m))
45
+ default: m(() => [
46
+ s(o(c))
46
47
  ]),
47
48
  _: 1
48
- }, 16, ["name"])) : (n(), t(o(m), { key: 1 }))
49
+ }, 16, ["name"])) : (n(), t(o(c), { key: 1 }))
49
50
  ]),
50
51
  _: 1
51
- });
52
+ }, 8, ["name"]);
52
53
  };
53
54
  }
54
55
  });
@@ -1,17 +1,17 @@
1
- import { defineComponent as g, computed as a, createBlock as l, openBlock as c, unref as t, normalizeProps as R, guardReactiveProps as x, withCtx as u, createVNode as T, normalizeClass as N, createCommentVNode as r, renderSlot as v, mergeProps as p, createTextVNode as B, toDisplayString as f } from "vue";
2
- import { VftButton as b } from "../button/index.js";
3
- import { VftFormItem as V } from "../form/index.js";
4
- import { VftRow as S } from "../row/index.js";
1
+ import { defineComponent as g, computed as i, createBlock as l, createCommentVNode as c, openBlock as r, unref as o, normalizeProps as x, mergeProps as p, withCtx as u, createVNode as R, normalizeClass as T, renderSlot as b, createTextVNode as B, toDisplayString as f } from "vue";
2
+ import { VftButton as v } from "../button/index.js";
3
+ import { VftFormItem as N } from "../form/index.js";
4
+ import { VftRow as V } from "../row/index.js";
5
5
  import "@vueuse/core";
6
6
  import "@vft/utils";
7
7
  import "../config-provider/hooks/use-global-config.js";
8
8
  import "lodash-es";
9
- import { useNamespace as j } from "../../hooks/use-namespace/index.js";
9
+ import { useNamespace as S } from "../../hooks/use-namespace/index.js";
10
10
  import "../../hooks/use-model-toggle/index.js";
11
11
  import "@popperjs/core";
12
12
  import "../../hooks/use-z-index/index.js";
13
- import { useFormContext as A } from "./use/use-form-context.js";
14
- const Q = /* @__PURE__ */ g({
13
+ import { useFormContext as j } from "./use/use-form-context.js";
14
+ const M = /* @__PURE__ */ g({
15
15
  __name: "super-form-action",
16
16
  props: {
17
17
  showResetButton: { type: Boolean },
@@ -23,86 +23,86 @@ const Q = /* @__PURE__ */ g({
23
23
  actionRowOptions: {},
24
24
  submitResetReverse: { type: Boolean }
25
25
  },
26
- setup(o) {
27
- const m = j("form-action"), { resetAction: k, submitAction: w, commonAction: C } = A(), O = a(() => ({
26
+ setup(t) {
27
+ const m = S("form-action"), { resetAction: d, submitAction: h, commonAction: C } = j(), k = i(() => ({
28
28
  justify: "end",
29
- ...o.actionRowOptions
30
- })), h = a(
31
- () => Object.assign({ btnText: "重置" }, o.resetButtonOptions)
32
- ), d = a(
33
- () => Object.assign({ btnText: "确认" }, o.submitButtonOptions)
34
- ), n = a(
35
- () => Object.assign({ btnText: "取消" }, o.commonButtonOptions)
29
+ ...t.actionRowOptions
30
+ })), O = i(
31
+ () => Object.assign({ btnText: "重置" }, t.resetButtonOptions)
32
+ ), w = i(
33
+ () => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
34
+ ), a = i(
35
+ () => Object.assign({ btnText: "取消" }, t.commonButtonOptions)
36
36
  ), y = (e) => ({
37
37
  type: e ? "warning" : "primary",
38
- options: e ? h.value : d.value,
39
- action: e ? k : w,
38
+ options: e ? O.value : w.value,
39
+ action: e ? d : h,
40
40
  className: e ? m.e("reset") : m.e("submit"),
41
- show: e ? o.showResetButton : o.showSubmitButton
42
- }), s = a(
43
- () => y(!o.submitResetReverse)
44
- ), i = a(
45
- () => y(o.submitResetReverse)
41
+ show: e ? t.showResetButton : t.showSubmitButton
42
+ }), n = i(
43
+ () => y(!t.submitResetReverse)
44
+ ), s = i(
45
+ () => y(t.submitResetReverse)
46
46
  );
47
- return (e, P) => (c(), l(t(S), R(x(O.value)), {
47
+ return (e, A) => t.showCommonButton || n.value.show || s.value.show ? (r(), l(o(V), x(p({ key: 0 }, k.value)), {
48
48
  default: u(() => [
49
- T(t(V), {
50
- class: N([{ "submit-block": d.value.block }, t(m).b()])
49
+ R(o(N), {
50
+ class: T([{ "submit-block": w.value.block }, o(m).b()])
51
51
  }, {
52
52
  default: u(() => [
53
- o.showCommonButton && !n.value.isBehind ? (c(), l(t(b), p({ key: 0 }, n.value, {
54
- class: t(m).e("common"),
55
- onClick: t(C)
53
+ t.showCommonButton && !a.value.isBehind ? (r(), l(o(v), p({ key: 0 }, a.value, {
54
+ class: o(m).e("common"),
55
+ onClick: o(C)
56
56
  }), {
57
57
  default: u(() => [
58
- B(f(n.value.btnText), 1)
58
+ B(f(a.value.btnText), 1)
59
59
  ]),
60
60
  _: 1
61
- }, 16, ["class", "onClick"])) : r("", !0),
62
- v(e.$slots, "resetBefore"),
63
- s.value.show ? (c(), l(t(b), p({
61
+ }, 16, ["class", "onClick"])) : c("", !0),
62
+ b(e.$slots, "resetBefore"),
63
+ n.value.show ? (r(), l(o(v), p({
64
64
  key: 1,
65
- type: s.value.type
66
- }, s.value.options, {
67
- onClick: s.value.action,
68
- class: s.value.className
65
+ type: n.value.type
66
+ }, n.value.options, {
67
+ onClick: n.value.action,
68
+ class: n.value.className
69
69
  }), {
70
70
  default: u(() => [
71
- B(f(s.value.options.btnText), 1)
71
+ B(f(n.value.options.btnText), 1)
72
72
  ]),
73
73
  _: 1
74
- }, 16, ["type", "onClick", "class"])) : r("", !0),
75
- v(e.$slots, "submitBefore"),
76
- i.value.show ? (c(), l(t(b), p({
74
+ }, 16, ["type", "onClick", "class"])) : c("", !0),
75
+ b(e.$slots, "submitBefore"),
76
+ s.value.show ? (r(), l(o(v), p({
77
77
  key: 2,
78
- type: i.value.type
79
- }, i.value.options, {
80
- onClick: i.value.action,
81
- class: i.value.className
78
+ type: s.value.type
79
+ }, s.value.options, {
80
+ onClick: s.value.action,
81
+ class: s.value.className
82
82
  }), {
83
83
  default: u(() => [
84
- B(f(i.value.options.btnText), 1)
84
+ B(f(s.value.options.btnText), 1)
85
85
  ]),
86
86
  _: 1
87
- }, 16, ["type", "onClick", "class"])) : r("", !0),
88
- v(e.$slots, "submitAfter"),
89
- o.showCommonButton && n.value.isBehind ? (c(), l(t(b), p({ key: 3 }, n.value, {
90
- class: t(m).e("common"),
91
- onClick: t(C)
87
+ }, 16, ["type", "onClick", "class"])) : c("", !0),
88
+ b(e.$slots, "submitAfter"),
89
+ t.showCommonButton && a.value.isBehind ? (r(), l(o(v), p({ key: 3 }, a.value, {
90
+ class: o(m).e("common"),
91
+ onClick: o(C)
92
92
  }), {
93
93
  default: u(() => [
94
- B(f(n.value.btnText), 1)
94
+ B(f(a.value.btnText), 1)
95
95
  ]),
96
96
  _: 1
97
- }, 16, ["class", "onClick"])) : r("", !0)
97
+ }, 16, ["class", "onClick"])) : c("", !0)
98
98
  ]),
99
99
  _: 3
100
100
  }, 8, ["class"])
101
101
  ]),
102
102
  _: 3
103
- }, 16));
103
+ }, 16)) : c("", !0);
104
104
  }
105
105
  });
106
106
  export {
107
- Q as default
107
+ M as default
108
108
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.483",
3
+ "version": "0.0.487",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.483";
1
+ const o = "0.0.487";
2
2
  export {
3
3
  o as version
4
4
  };