vft 0.0.482 → 0.0.485

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.
Files changed (46) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/use-carousel.js +1 -1
  3. package/es/components/horizontal-menu/horizontal-menu.vue.d.ts +20 -4
  4. package/es/components/horizontal-menu/horizontal-menu.vue2.js +29 -29
  5. package/es/components/horizontal-menu/index.d.ts +20 -4
  6. package/es/components/input/input.vue2.js +4 -4
  7. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  8. package/es/components/menu/index.d.ts +28 -7
  9. package/es/components/menu/menu-item-group.vue.d.ts +2 -4
  10. package/es/components/menu/menu-item.vue.d.ts +1 -17
  11. package/es/components/menu/menu.vue.d.ts +3 -28
  12. package/es/components/menu/menu.vue2.js +81 -76
  13. package/es/components/menu/sub-menu.vue.d.ts +1 -19
  14. package/es/components/menu/types.d.ts +64 -0
  15. package/es/components/side-menu/index.d.ts +55 -4
  16. package/es/components/side-menu/side-menu.vue.d.ts +20 -3
  17. package/es/components/side-menu/side-menu.vue2.js +166 -139
  18. package/es/components/side-menu/types.d.ts +13 -2
  19. package/es/components/super-form/super-form-action.vue2.js +55 -55
  20. package/es/components/super-form/super-form-item.vue2.js +1 -1
  21. package/es/package.json.d.ts +1 -1
  22. package/es/package.json.js +1 -1
  23. package/es/utils/vue/vnode.js +1 -1
  24. package/lib/components/horizontal-menu/horizontal-menu.vue.d.ts +20 -4
  25. package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
  26. package/lib/components/horizontal-menu/index.d.ts +20 -4
  27. package/lib/components/input/input.vue2.cjs +1 -1
  28. package/lib/components/menu/index.d.ts +28 -7
  29. package/lib/components/menu/menu-item-group.vue.d.ts +2 -4
  30. package/lib/components/menu/menu-item.vue.d.ts +1 -17
  31. package/lib/components/menu/menu.vue.d.ts +3 -28
  32. package/lib/components/menu/menu.vue2.cjs +1 -1
  33. package/lib/components/menu/sub-menu.vue.d.ts +1 -19
  34. package/lib/components/menu/types.d.ts +64 -0
  35. package/lib/components/side-menu/index.d.ts +55 -4
  36. package/lib/components/side-menu/side-menu.vue.d.ts +20 -3
  37. package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
  38. package/lib/components/side-menu/types.d.ts +13 -2
  39. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  40. package/lib/package.json.cjs +1 -1
  41. package/lib/package.json.d.ts +1 -1
  42. package/package.json +5 -5
  43. package/theme-style/index.css +1 -1
  44. package/theme-style/src/menu.scss +54 -0
  45. package/theme-style/vft-menu.css +1 -1
  46. package/web-types.json +1 -1
@@ -1,25 +1,25 @@
1
- import { defineComponent as J, toRefs as ie, useSlots as de, getCurrentInstance as re, ref as h, computed as b, watch as ce, onMounted as pe, nextTick as fe, createVNode as p, h as y, isVNode as me } from "vue";
2
- import { listenerRouteChange as ve, useRouterHelper as he } from "@vft/router";
3
- import { useSortable as ge } from "@vft/use/sortable";
4
- import { isNullOrUndefined as W, isNumber as j, isUrl as be } from "@vft/utils";
1
+ import { defineComponent as H, toRefs as de, useSlots as ce, getCurrentInstance as pe, ref as h, computed as b, watch as fe, onMounted as me, nextTick as ve, createVNode as m, h as y, isVNode as he } from "vue";
2
+ import { VftIcon as ge } from "../icon/index.js";
3
+ import { VftMenu as be, VftSubMenu as ye, VftMenuItem as j, VftMenuItemGroup as Me } from "../menu/index.js";
5
4
  import "@vueuse/core";
6
- import { addUnit as q } from "../../utils/helper.js";
5
+ import { isNullOrUndefined as q, isNumber as E, isUrl as Se } from "@vft/utils";
6
+ import { addUnit as O } from "../../utils/helper.js";
7
7
  import "lodash-es";
8
8
  import "../form/index.js";
9
- import { VftIcon as ye } from "../icon/index.js";
10
- import { VftMenu as Me, VftSubMenu as Se, VftMenuItem as E } from "../menu/index.js";
11
- import { useNamespace as Oe } from "../../hooks/use-namespace/index.js";
9
+ import { listenerRouteChange as Ce, useRouterHelper as Oe } from "@vft/router";
10
+ import { useSortable as xe } from "@vft/use/sortable";
11
+ import { useNamespace as Te } from "../../hooks/use-namespace/index.js";
12
12
  import "../../hooks/use-model-toggle/index.js";
13
13
  import "@popperjs/core";
14
14
  import "../../hooks/use-z-index/index.js";
15
- import { useDragLine as Ce } from "./use-drag-line.js";
16
- function xe(g) {
17
- return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !me(g);
15
+ import { useDragLine as Be } from "./use-drag-line.js";
16
+ function _e(g) {
17
+ return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !he(g);
18
18
  }
19
- const _e = J({
19
+ const we = H({
20
20
  name: "vft-side-menu"
21
- }), Le = /* @__PURE__ */ J({
22
- ..._e,
21
+ }), Ue = /* @__PURE__ */ H({
22
+ ...we,
23
23
  props: {
24
24
  isFixedLeft: {
25
25
  type: Boolean,
@@ -84,21 +84,39 @@ const _e = J({
84
84
  disableSubMenuAction: {
85
85
  type: Boolean,
86
86
  default: !1
87
- }
87
+ },
88
+ enableScroll: {
89
+ type: Boolean,
90
+ default: !0
91
+ },
92
+ scrollThreshold: {
93
+ default: 10
94
+ },
95
+ scrollMaxHeight: {
96
+ default: 500
97
+ },
98
+ collapseTransition: {
99
+ type: Boolean,
100
+ default: !1
101
+ },
102
+ collapseType: {
103
+ default: void 0
104
+ },
105
+ tooltipCfg: {}
88
106
  },
89
107
  emits: ["update:collapse", "update:width", "dragEnd", "dragWidthEnd", "select", "subMenuClick", "subMenuOpenClick", "menuItemMouseenter", "menuItemMouseleave"],
90
108
  setup(g, {
91
- expose: L,
92
- emit: P
109
+ expose: J,
110
+ emit: L
93
111
  }) {
94
- const t = g, d = P, {
95
- defaultActive: H,
112
+ const t = g, r = L, {
113
+ defaultActive: P,
96
114
  collapse: f,
97
115
  uniqueOpened: U,
98
116
  defaultOpeneds: $,
99
117
  openMenuCollapse: F,
100
118
  defaultOpenedsLevel: M
101
- } = ie(t), u = Oe("side-menu"), r = de(), C = re(), x = h(), a = b(() => ({
119
+ } = de(t), s = Te("side-menu"), d = ce(), x = pe(), T = h(), a = b(() => ({
102
120
  path: "path",
103
121
  children: "children",
104
122
  title: "title",
@@ -106,195 +124,204 @@ const _e = J({
106
124
  icon: "icon",
107
125
  disabled: "disabled",
108
126
  ...t.attrMapping
109
- })), Z = (e, o = 1 / 0) => {
110
- const l = [], n = (s, i = 0) => {
111
- i >= o || s.forEach((v) => {
112
- v[a.value.children]?.length && (l.push(v[a.value.index]), n(v[a.value.children], i + 1));
127
+ })), Y = (e, n = 1 / 0) => {
128
+ const l = [], o = (u, c = 0) => {
129
+ c >= n || u.forEach((i) => {
130
+ i[a.value.children]?.length && (l.push(i[a.value.index]), o(i[a.value.children], c + 1));
113
131
  });
114
132
  };
115
- return n(e), l;
133
+ return o(e), l;
116
134
  };
117
- ve(({
135
+ Ce(({
118
136
  route: e
119
137
  }) => {
120
- !e || e.meta?.hideSide && !t.useRouterJump || (x.value = e.path);
138
+ !e || e.meta?.hideSide && !t.useRouterJump || (T.value = e.path);
121
139
  });
122
- const z = (e) => {
123
- const o = e.e;
124
- if (t.autoScrollActiveDom && o) {
125
- const l = j(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, n = o.target;
126
- _({
127
- activeDom: n,
140
+ const Z = (e) => {
141
+ const n = e.e;
142
+ if (t.autoScrollActiveDom && n) {
143
+ const l = E(t.autoScrollActiveDom) ? t.autoScrollActiveDom : 0, o = n.target;
144
+ B({
145
+ activeDom: o,
128
146
  offset: l
129
147
  });
130
148
  }
131
- d("subMenuOpenClick", e);
132
- }, Y = (e) => {
133
- d("subMenuClick", e);
134
- }, _ = ({
149
+ r("subMenuOpenClick", e);
150
+ }, z = (e) => {
151
+ r("subMenuClick", e);
152
+ }, B = ({
135
153
  activeDom: e = null,
136
- offset: o = 0,
154
+ offset: n = 0,
137
155
  delay: l = 300
138
156
  } = {}) => {
139
- m.value?.menu && setTimeout(() => {
140
- const n = e || document.querySelector(".vft-menu-item.is-active") || document.querySelector(".vft-sub-menu.is-active");
141
- n && (m.value.menu.scrollTop = m.value.menu.scrollTop + (n.getBoundingClientRect().top - m.value.menu.getBoundingClientRect().top) + o);
157
+ v.value?.menu && setTimeout(() => {
158
+ const o = e || document.querySelector(".vft-menu-item.is-active") || document.querySelector(".vft-sub-menu.is-active");
159
+ o && (v.value.menu.scrollTop = v.value.menu.scrollTop + (o.getBoundingClientRect().top - v.value.menu.getBoundingClientRect().top) + n);
142
160
  }, l);
143
161
  }, G = (e) => {
144
- d("menuItemMouseenter", e);
162
+ r("menuItemMouseenter", e);
145
163
  }, K = (e) => {
146
- d("menuItemMouseleave", e);
147
- }, B = (e, o) => {
148
- const l = e[a.value.path], n = e[a.value.title], s = e?.[a.value.children], i = e?.[a.value.index], v = e?.[a.value.icon], T = !!e?.[a.value.disabled], R = t.disabledJudgeTurnOver ? !T : T, N = i || l || o + n;
149
- return s?.length ? y(
150
- // @ts-ignore
151
- Se,
152
- {
153
- ...e,
154
- popperAppendToBody: !0,
155
- key: N,
156
- index: N,
157
- title: n,
158
- icon: v,
159
- disabled: t.openDisabled && R,
160
- popperClass: u.e("popper")
161
- },
162
- {
163
- default: () => s?.map((c, oe) => {
164
- const O = c[a.value.path], I = c[a.value.index], ae = c[a.value.icon], ue = c[a.value.title], V = !!c[a.value.disabled], se = t.disabledJudgeTurnOver ? !V : V;
165
- return c?.[a.value.children]?.length ? B(c, oe) : (
164
+ r("menuItemMouseleave", e);
165
+ }, Q = (e, n) => !t.enableScroll || !e ? e : f.value && n > t.scrollThreshold ? y(Me, {
166
+ style: {
167
+ maxHeight: O(t.scrollMaxHeight),
168
+ overflowY: "auto"
169
+ }
170
+ }, () => e) : e, _ = (e, n) => {
171
+ const l = e[a.value.path], o = e[a.value.title], u = e?.[a.value.children], c = e?.[a.value.index], i = e?.[a.value.icon], R = !!e?.[a.value.disabled], I = t.disabledJudgeTurnOver ? !R : R, N = c || l || n + o;
172
+ return u?.length ? y(ye, {
173
+ ...e,
174
+ popperAppendToBody: !0,
175
+ key: N,
176
+ index: N,
177
+ title: o,
178
+ icon: i,
179
+ disabled: t.openDisabled && I,
180
+ popperClass: s.e("popper"),
181
+ toolTipCfg: {
182
+ placement: "right",
183
+ "fallback-placements": ["right-start", "right"],
184
+ ...t.tooltipCfg
185
+ }
186
+ }, {
187
+ default: () => {
188
+ const ae = u?.map((p, ue) => {
189
+ const C = p[a.value.path], V = p[a.value.index], se = p[a.value.icon], ie = p[a.value.title], W = !!p[a.value.disabled], re = t.disabledJudgeTurnOver ? !W : W;
190
+ return p?.[a.value.children]?.length ? _(p, ue) : (
166
191
  // @ts-ignore
167
- y(E, {
168
- ...c,
169
- key: I || O,
170
- index: I || O,
171
- route: O,
172
- icon: ae,
173
- title: ue,
174
- disabled: t.openDisabled && se
175
- }, r.menuItem ? () => r.menuItem?.({
176
- item: c
192
+ y(j, {
193
+ ...p,
194
+ key: V || C,
195
+ index: V || C,
196
+ route: C,
197
+ icon: se,
198
+ title: ie,
199
+ disabled: t.openDisabled && re
200
+ }, d.menuItem ? () => d.menuItem?.({
201
+ item: p
177
202
  }) : "")
178
203
  );
179
- })
204
+ });
205
+ return Q(ae, u?.length || 0);
180
206
  }
181
- ) : y(E, {
207
+ }) : y(j, {
182
208
  ...e,
183
- key: i || l,
184
- index: i || l,
185
- title: n,
209
+ key: c || l,
210
+ index: c || l,
211
+ title: o,
186
212
  route: l,
187
- icon: v,
188
- disabled: t.openDisabled && R,
213
+ icon: i,
214
+ disabled: t.openDisabled && I,
189
215
  onMouseenter: () => G(e),
190
216
  onMouseleave: () => K(e)
191
- }, r.menuItem ? () => r.menuItem?.({
217
+ }, d.menuItem ? () => d.menuItem?.({
192
218
  item: e,
193
- index: o
219
+ index: n
194
220
  }) : "");
195
- }, m = h(), Q = b(() => ({
221
+ }, v = h(), X = b(() => ({
196
222
  ...t.collapseWidth === 0 && f.value ? {
197
223
  width: 0
198
224
  } : {},
199
225
  height: `calc(100% - ${t.menuTopBottomHeight}px)`
200
- })), w = C.appContext.config.globalProperties.$router;
201
- async function X(e) {
226
+ })), w = x.appContext.config.globalProperties.$router;
227
+ function ee(e, n) {
202
228
  if (t.useRouterJump) {
203
229
  const {
204
- go: o
205
- } = he(w), l = e.route;
206
- let n = e.route;
207
- e.indexPath.some((i) => be(i)) && (n = e.indexPath.slice(-2).join("/"));
208
- const s = w.getRoutes().filter((i) => i.path === n)?.[0]?.meta?.linkTarget;
209
- o(s ? {
210
- url: l,
230
+ go: l
231
+ } = Oe(w), o = e.route;
232
+ let u = e.route;
233
+ e.indexPath.some((i) => Se(i)) && (u = e.indexPath.slice(-2).join("/"));
234
+ const c = w.getRoutes().filter((i) => i.path === u)?.[0]?.meta?.linkTarget;
235
+ l(c ? {
236
+ url: o,
211
237
  winOpenOpt: {
212
- target: s
238
+ target: c
213
239
  }
214
- } : l);
240
+ } : o);
215
241
  }
216
- d("select", e);
242
+ r("select", e, n);
217
243
  }
218
- const S = h(), D = h(), k = h(), ee = b(() => ({
244
+ const S = h(), k = h(), D = h(), te = b(() => ({
219
245
  ...t.collapseWidth === 0 && f.value ? {
220
246
  borderRight: "none"
221
247
  } : {},
222
- width: q(t.width),
248
+ width: O(t.width),
223
249
  height: t.height
224
250
  }));
225
- ce(() => f.value, (e) => {
226
- te.value || (e ? d("update:width", t.collapseWidth) : d("update:width", k.value || t.width), k.value = t.width);
251
+ fe(() => f.value, (e) => {
252
+ le.value || (e ? r("update:width", t.collapseWidth) : r("update:width", D.value || t.width), D.value = t.width);
227
253
  });
228
254
  const {
229
- isDraging: te
230
- } = Ce(S, D, C), le = b(() => ({
231
- left: q(t.width)
232
- })), ne = b(() => [u.b(), t.isFixedLeft ? u.m("fixed") : ""]), A = h([]);
233
- return pe(() => {
234
- fe(() => {
255
+ isDraging: le
256
+ } = Be(S, k, x), oe = b(() => ({
257
+ left: O(t.width)
258
+ })), ne = b(() => [s.b(), t.isFixedLeft ? s.m("fixed") : ""]), A = h([]);
259
+ return me(() => {
260
+ ve(() => {
235
261
  if (t.dragOption?.dragClassName) {
236
- const e = document.querySelectorAll(`.${u.e(t.dragOption?.dragClassName)}`)?.[0], {
237
- initSortable: o
238
- } = ge(e, {
262
+ const e = document.querySelectorAll(`.${s.e(t.dragOption?.dragClassName)}`)?.[0], {
263
+ initSortable: n
264
+ } = xe(e, {
239
265
  draggable: ".vft-menu-item",
240
266
  onEnd: (l) => {
241
267
  const {
242
- oldIndex: n,
243
- newIndex: s
268
+ oldIndex: o,
269
+ newIndex: u
244
270
  } = l;
245
- W(n) || W(s) || n === s || d("dragEnd", n, s);
271
+ q(o) || q(u) || o === u || r("dragEnd", o, u);
246
272
  },
247
273
  ...t.dragOption
248
274
  });
249
- o();
275
+ n();
250
276
  }
251
277
  });
252
- }), L({
278
+ }), J({
253
279
  sideRef: S,
254
- jumpActiveDom: _,
255
- menuRef: m
280
+ jumpActiveDom: B,
281
+ menuRef: v
256
282
  }), () => {
257
283
  let e;
258
- return M.value && (A.value = Z(t.menus, j(M.value) ? M.value : 1 / 0)), p("div", {
284
+ return M.value && (A.value = Y(t.menus, E(M.value) ? M.value : 1 / 0)), m("div", {
259
285
  ref: S,
260
286
  class: ne.value,
261
- style: ee.value
262
- }, [r.top ? p("div", {
263
- class: u.e("top")
264
- }, [r.top()]) : null, y(p(Me, {
265
- ref: m,
266
- onSelect: X,
267
- onOpen: z,
268
- onSubMenuClick: Y,
269
- defaultActive: H?.value || x.value,
287
+ style: te.value
288
+ }, [d.top ? m("div", {
289
+ class: s.e("top")
290
+ }, [d.top()]) : null, y(m(be, {
291
+ ref: v,
292
+ onSelect: ee,
293
+ onOpen: Z,
294
+ onSubMenuClick: z,
295
+ defaultActive: P?.value || T.value,
270
296
  defaultOpeneds: $?.value || A.value,
271
297
  disableSubMenuAction: t.disableSubMenuAction,
272
- class: [u.e("con"), t.dragOption?.dragClassName ? u.e(t.dragOption?.dragClassName) : ""],
273
- style: Q.value,
298
+ class: [s.e("con"), t.dragOption?.dragClassName ? s.e(t.dragOption?.dragClassName) : ""],
299
+ style: X.value,
274
300
  collapse: F.value ? f.value : !1,
275
301
  uniqueOpened: U.value,
276
- collapseTransition: !1
277
- }, xe(e = t.menus.map((o, l) => B(o, l))) ? e : {
302
+ collapseTransition: t.collapseTransition,
303
+ collapseType: t.collapseType
304
+ }, _e(e = t.menus.map((n, l) => _(n, l))) ? e : {
278
305
  default: () => [e]
279
- })), r.bottom ? p("div", {
280
- class: u.e("bottom")
281
- }, [r.bottom()]) : t.showCollapse ? p("div", {
282
- onClick: () => d("update:collapse", !f.value),
283
- class: [u.e("bottom"), u.e("collapse")]
284
- }, [p(ye, {
306
+ })), d.bottom ? m("div", {
307
+ class: s.e("bottom")
308
+ }, [d.bottom()]) : t.showCollapse ? m("div", {
309
+ onClick: () => r("update:collapse", !f.value),
310
+ class: [s.e("bottom"), s.e("collapse")]
311
+ }, [m(ge, {
285
312
  style: {
286
313
  transform: f.value ? "rotateY(180deg)" : ""
287
314
  },
288
315
  size: 20,
289
316
  icon: "icon-sidebar-collapse"
290
- }, null)]) : null, r.default?.(), t.dragWidthCfg ? p("div", {
291
- ref: D,
292
- style: le.value,
293
- class: u.e("drag-bar")
317
+ }, null)]) : null, d.default?.(), t.dragWidthCfg ? m("div", {
318
+ ref: k,
319
+ style: oe.value,
320
+ class: s.e("drag-bar")
294
321
  }, null) : null]);
295
322
  };
296
323
  }
297
324
  });
298
325
  export {
299
- Le as default
326
+ Ue as default
300
327
  };
@@ -1,5 +1,8 @@
1
+ import type { MenuItemClicked } from 'vft/es/components/menu';
2
+ import type { ToolTipProps } from 'vft/es/components/tooltip';
1
3
  import type Sortable from 'sortablejs';
2
4
  import type { SortableEvent } from 'sortablejs';
5
+ import type { NavigationFailure } from 'vue-router';
3
6
  /** 菜单项类型 */
4
7
  export type MenuType = {
5
8
  /** 子菜单列表 */
@@ -72,11 +75,19 @@ export interface SideMenuProps {
72
75
  /** 默认选中的菜单索引 */
73
76
  defaultActive?: string;
74
77
  /** 默认展开的子菜单索引数组 */
75
- defaultOpeneds?: Array<string | number>;
78
+ defaultOpeneds?: Array<string>;
76
79
  /** 默认展开的层级深度 */
77
80
  defaultOpenedsLevel?: number | boolean;
78
81
  /** 禁用子菜单的展开收缩行为 */
79
82
  disableSubMenuAction?: boolean;
83
+ enableScroll?: boolean;
84
+ scrollThreshold?: number;
85
+ scrollMaxHeight?: string | number;
86
+ /** 是否开启折叠动画 */
87
+ collapseTransition?: boolean;
88
+ /** 收缩类型 */
89
+ collapseType?: 'menu-title';
90
+ tooltipCfg?: Partial<ToolTipProps>;
80
91
  }
81
92
  /** 菜单选中事件参数 */
82
93
  export interface MenuSelectEventData {
@@ -96,7 +107,7 @@ export interface SideMenuEmits {
96
107
  /** 拖拽宽度结束事件 */
97
108
  (e: 'dragWidthEnd'): void;
98
109
  /** 菜单选中事件 */
99
- (e: 'select', val: MenuSelectEventData): void;
110
+ (e: 'select', menuItem: MenuItemClicked, routerResult?: Promise<void | NavigationFailure>): void;
100
111
  /** 子菜单点击事件 */
101
112
  (e: 'subMenuClick', val: any): void;
102
113
  /** 子菜单展开点击事件 */
@@ -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,4 +1,4 @@
1
- import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, createTextVNode as O, isVNode as le, resolveComponent as N } from "vue";
1
+ import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as O, resolveComponent as N } from "vue";
2
2
  import "../alert/index.js";
3
3
  import "../avatar/index.js";
4
4
  import "../avatar-stack/index.js";
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.482",
3
+ "version": "0.0.485",
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.482";
1
+ const o = "0.0.485";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,4 +1,4 @@
1
- import { hasOwn as m, camelize as N, isArray as E } from "@vft/utils";
1
+ import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
2
2
  import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
3
3
  import { debugWarn as O } from "../error.js";
4
4
  const R = "utils/vue/vnode";