vft 0.0.119 → 0.0.121

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 (81) hide show
  1. package/attributes.json +1 -1
  2. package/es/component.js +25 -23
  3. package/es/components/backtop/backtop.vue2.js +3 -2
  4. package/es/components/button/button.vue2.js +21 -21
  5. package/es/components/context-menu/context-menu.vue2.js +3 -2
  6. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +53 -57
  7. package/es/components/footer-layout/footer-layout.vue2.js +3 -2
  8. package/es/components/header-layout/header-layout.vue2.js +3 -2
  9. package/es/components/index.js +269 -261
  10. package/es/components/md-container/md-container.vue2.js +3 -2
  11. package/es/components/menu/menu-item.vue2.js +3 -2
  12. package/es/components/menu/sub-menu.vue2.js +3 -2
  13. package/es/components/message/message.vue2.js +12 -12
  14. package/es/components/modal/index.js +15 -0
  15. package/es/components/modal/modal.vue.js +4 -0
  16. package/es/components/modal/modal.vue2.js +92 -0
  17. package/es/components/modal/style/css.js +4 -0
  18. package/es/components/modal/style/index.js +4 -0
  19. package/es/components/modal/use/use-modal.js +95 -0
  20. package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -14
  21. package/es/components/multiple-tabs/tab-content.vue2.js +11 -12
  22. package/es/components/multiple-tabs/use/use-multiple-tabs.js +22 -23
  23. package/es/components/result/result.vue2.js +3 -2
  24. package/es/components/side-menu/side-menu.vue2.js +26 -25
  25. package/es/components/super-form/component-map.js +24 -23
  26. package/es/components/super-form/super-form-action.vue2.js +28 -29
  27. package/es/components/super-form/super-form-item.vue2.js +132 -123
  28. package/es/components/super-form/super-form.vue2.js +139 -136
  29. package/es/components/super-form/use/use-form-events.js +144 -139
  30. package/es/components/table/field.js +90 -52
  31. package/es/components/table/index.js +15 -12
  32. package/es/components/table/types.js +1 -0
  33. package/es/components/tabs/tab-nav.vue2.js +3 -2
  34. package/es/components/upload/upload-content.vue2.js +2 -2
  35. package/es/components/upload/upload.vue2.js +40 -49
  36. package/es/index.js +354 -346
  37. package/es/package.json.js +1 -1
  38. package/lib/component.cjs +1 -1
  39. package/lib/components/backtop/backtop.vue2.cjs +1 -1
  40. package/lib/components/button/button.vue2.cjs +1 -1
  41. package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
  42. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  43. package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
  44. package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
  45. package/lib/components/index.cjs +1 -1
  46. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  47. package/lib/components/menu/menu-item.vue2.cjs +1 -1
  48. package/lib/components/menu/sub-menu.vue2.cjs +1 -1
  49. package/lib/components/message/message.vue2.cjs +1 -1
  50. package/lib/components/modal/index.cjs +1 -0
  51. package/lib/components/modal/modal.vue.cjs +1 -0
  52. package/lib/components/modal/modal.vue2.cjs +1 -0
  53. package/lib/components/modal/style/css.cjs +1 -0
  54. package/lib/components/modal/style/index.cjs +1 -0
  55. package/lib/components/modal/use/use-modal.cjs +1 -0
  56. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  57. package/lib/components/multiple-tabs/tab-content.vue2.cjs +1 -1
  58. package/lib/components/multiple-tabs/use/use-multiple-tabs.cjs +1 -1
  59. package/lib/components/result/result.vue2.cjs +1 -1
  60. package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
  61. package/lib/components/super-form/component-map.cjs +1 -1
  62. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  63. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  64. package/lib/components/super-form/super-form.vue2.cjs +1 -1
  65. package/lib/components/super-form/use/use-form-events.cjs +1 -1
  66. package/lib/components/table/field.cjs +1 -1
  67. package/lib/components/table/index.cjs +1 -1
  68. package/lib/components/table/types.cjs +1 -0
  69. package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
  70. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  71. package/lib/components/upload/upload.vue2.cjs +1 -1
  72. package/lib/index.cjs +1 -1
  73. package/lib/package.json.cjs +1 -1
  74. package/package.json +3 -3
  75. package/tags.json +1 -1
  76. package/theme-style/src/index.scss +1 -0
  77. package/theme-style/src/modal.scss +0 -0
  78. package/theme-style/vft-modal.css +0 -0
  79. package/web-types.json +1 -1
  80. /package/es/components/{table/type.js → modal/types.js} +0 -0
  81. /package/lib/components/{table/type.cjs → modal/types.cjs} +0 -0
@@ -1,18 +1,18 @@
1
- import { defineComponent as J, useAttrs as nt, reactive as at, ref as p, computed as c, unref as e, watch as d, nextTick as st, onMounted as pt, openBlock as l, createBlock as B, mergeProps as C, withKeys as lt, withCtx as h, normalizeProps as y, renderSlot as g, createElementBlock as ut, Fragment as ft, renderList as E, createSlots as U, guardReactiveProps as j, createCommentVNode as V } from "vue";
2
- import { useNamespace as ct } from "../../hooks/use-namespace/index.js";
1
+ import { defineComponent as W, useAttrs as nt, reactive as st, ref as n, computed as c, unref as o, watch as d, nextTick as pt, onMounted as lt, openBlock as l, createBlock as B, mergeProps as R, withKeys as ut, withCtx as h, normalizeProps as g, renderSlot as y, createElementBlock as ft, Fragment as ct, renderList as V, createSlots as j, guardReactiveProps as x, createCommentVNode as E } from "vue";
2
+ import { useNamespace as dt } from "../../hooks/use-namespace/index.js";
3
3
  import "@popperjs/core";
4
4
  import "lodash";
5
5
  import "../../hooks/use-z-index/index.js";
6
- import { useDebounceFn as dt } from "@vueuse/core";
7
- import { cloneDeep as x, pick as Bt, deepMerge as ht } from "@vft/utils";
6
+ import { useTimeoutFn as Bt, useDebounceFn as ht } from "@vueuse/core";
7
+ import { cloneDeep as J, pick as gt, deepMerge as yt } from "@vft/utils";
8
8
  import "../../utils/ns-cover.js";
9
- import { FormCompEnum as yt } from "./component-map.js";
10
- import gt from "./super-form-action.vue2.js";
11
- import bt from "./super-form-item.vue2.js";
12
- import { useAutoFocus as vt } from "./use/use-auto-focus.js";
13
- import { createFormContext as Ft } from "./use/use-form-context.js";
14
- import { useFormEvents as wt } from "./use/use-form-events.js";
15
- import { useFormValues as St } from "./use/use-form-values.js";
9
+ import { FormCompEnum as bt } from "./component-map.js";
10
+ import vt from "./super-form-action.vue2.js";
11
+ import Ft from "./super-form-item.vue2.js";
12
+ import { useAutoFocus as wt } from "./use/use-auto-focus.js";
13
+ import { createFormContext as St } from "./use/use-form-context.js";
14
+ import { useFormEvents as Pt } from "./use/use-form-events.js";
15
+ import { useFormValues as At } from "./use/use-form-values.js";
16
16
  import "../divider/index.js";
17
17
  import "../icon/index.js";
18
18
  import "../avatar/index.js";
@@ -50,7 +50,7 @@ import "../clamp-toggle/index.js";
50
50
  import "../page-wrapper/index.js";
51
51
  import "../exception/index.js";
52
52
  import "../search/index.js";
53
- import { VftForm as Pt } from "../form/index.js";
53
+ import { VftForm as Ct } from "../form/index.js";
54
54
  import "../button/index.js";
55
55
  import "../checkbox/index.js";
56
56
  import "../radio/index.js";
@@ -71,7 +71,7 @@ import "../list-cell/index.js";
71
71
  import "../dialog/index.js";
72
72
  import "../date-time-select/index.js";
73
73
  import "../col/index.js";
74
- import { VftRow as At } from "../row/index.js";
74
+ import { VftRow as kt } from "../row/index.js";
75
75
  import "../horizontal-menu/index.js";
76
76
  import "../time-picker/index.js";
77
77
  import "../date-picker/index.js";
@@ -89,6 +89,7 @@ import "../autocomplete/index.js";
89
89
  import "./index.js";
90
90
  import "../progress/index.js";
91
91
  import "../upload/index.js";
92
+ import "../modal/index.js";
92
93
  import "../md-container/index.js";
93
94
  import "../md-comment/index.js";
94
95
  import "../md-tabs/index.js";
@@ -98,18 +99,17 @@ import "../md-code-tabs/index.js";
98
99
  import "../message/index.js";
99
100
  const Ot = (
100
101
  /* hoist-static*/
101
- ct("super-form")
102
- ), Rt = J({
102
+ dt("super-form")
103
+ ), Rt = W({
103
104
  name: "vft-super-form"
104
- }), bo = /* @__PURE__ */ J({
105
+ }), wo = /* @__PURE__ */ W({
105
106
  ...Rt,
106
107
  props: {
107
108
  rowProps: { default: {
108
109
  gutter: 20
109
110
  } },
110
- baseColProps: { default: {
111
- span: 8
112
- } },
111
+ baseColProps: {},
112
+ quickColSpan: { default: 3 },
113
113
  autoSetPlaceHolder: { type: Boolean, default: !0 },
114
114
  schemas: {},
115
115
  autoFocusFirstItem: { type: Boolean, default: !1 },
@@ -126,6 +126,7 @@ const Ot = (
126
126
  autoCleanErrorMessage: { type: Boolean },
127
127
  beforeSubmitFunc: {},
128
128
  submitFunc: {},
129
+ watchDataIsChange: { type: Boolean },
129
130
  size: { default: "default" },
130
131
  disabled: { type: Boolean },
131
132
  model: {},
@@ -143,121 +144,123 @@ const Ot = (
143
144
  scrollToError: { type: Boolean },
144
145
  showResetButton: { type: Boolean, default: !1 },
145
146
  showSubmitButton: { type: Boolean, default: !0 },
146
- showCommonButton: { type: Boolean, default: !0 },
147
+ showCommonButton: { type: Boolean, default: !1 },
147
148
  resetButtonOptions: {},
148
149
  submitButtonOptions: {},
149
150
  commonButtonOptions: {},
150
151
  actionRowOptions: {}
151
152
  },
152
153
  emits: ["register", "reset", "submit", "field-value-change"],
153
- setup(W, { expose: Q, emit: _ }) {
154
- const b = W;
155
- console.log(b, "===");
156
- const X = nt(), m = at({}), v = p({}), u = p(!1), F = p({}), D = p(null), w = p(null), o = c(() => ({ ...b, ...e(F) })), Y = c(() => ({ ...X, ...b, ...e(o) })), i = c(() => {
157
- const t = e(D);
158
- return e(o).showAdvancedButton ? x(t.filter((n) => n.component !== yt.DIVIDER)) : x(t);
159
- }), { handleFormValues: Z, initDefault: M } = St({
160
- getProps: o,
161
- defaultValueRef: v,
162
- getSchema: i,
163
- formModel: m
154
+ setup(Q, { expose: X, emit: D }) {
155
+ const _ = Q, Y = nt(), a = st({}), b = n({}), u = n(!1), v = n({}), M = n(null), F = n(null), I = n(), e = c(() => ({ ..._, ...o(v) })), Z = c(() => ({ ...Y, ..._, ...o(e) })), m = c(() => {
156
+ const t = o(M);
157
+ return o(e).showAdvancedButton ? J(t.filter((i) => i.component !== bt.DIVIDER)) : J(t);
158
+ }), { handleFormValues: tt, initDefault: T } = At({
159
+ getProps: e,
160
+ defaultValueRef: b,
161
+ getSchema: m,
162
+ formModel: a
164
163
  });
165
- vt({
166
- getSchema: i,
167
- getProps: o,
164
+ wt({
165
+ getSchema: m,
166
+ getProps: e,
168
167
  isInitedDefault: u,
169
- formElRef: w
168
+ formElRef: F
170
169
  });
171
170
  const {
172
- handleSubmit: a,
173
- setFieldsValue: S,
174
- clearValidate: I,
175
- validate: T,
176
- validateField: P,
177
- getFieldsValue: $,
171
+ handleSubmit: s,
172
+ setFieldsValue: w,
173
+ clearValidate: $,
174
+ validate: L,
175
+ validateField: S,
176
+ getFieldsValue: P,
178
177
  updateSchema: A,
179
- resetSchema: O,
180
- appendSchemaByField: L,
181
- removeSchemaByField: N,
182
- resetFields: R,
183
- scrollToField: tt,
178
+ resetSchema: C,
179
+ appendSchemaByField: N,
180
+ removeSchemaByField: q,
181
+ resetFields: k,
182
+ scrollToField: et,
184
183
  getFieldValue: H,
185
- setFormItemError: et
186
- } = wt({
187
- emit: _,
188
- getProps: o,
189
- formModel: m,
190
- getSchema: i,
191
- defaultValueRef: v,
192
- formElRef: w,
193
- schemaRef: D,
194
- handleFormValues: Z
184
+ setFormItemError: ot
185
+ } = Pt({
186
+ emit: D,
187
+ getProps: e,
188
+ formModel: a,
189
+ getSchema: m,
190
+ defaultValueRef: b,
191
+ formElRef: F,
192
+ schemaRef: M,
193
+ handleFormValues: tt,
194
+ initValues: I
195
195
  });
196
- Ft({
197
- resetAction: R,
198
- submitAction: a
196
+ St({
197
+ resetAction: k,
198
+ submitAction: s
199
199
  }), d(
200
- () => e(o).model,
200
+ () => o(e).model,
201
201
  () => {
202
- const { model: t } = e(o);
203
- t && S(t);
202
+ const { model: t } = o(e);
203
+ t && w(t);
204
204
  },
205
205
  {
206
206
  immediate: !0
207
207
  }
208
208
  ), d(
209
- () => e(o).schemas,
209
+ () => o(e).schemas,
210
210
  (t) => {
211
- O(t ?? []);
211
+ C(t ?? []);
212
212
  }
213
213
  ), d(
214
- () => i.value,
214
+ () => m.value,
215
215
  (t) => {
216
- st(() => {
217
- }), !e(u) && t != null && t.length && (M(), u.value = !0);
216
+ var i;
217
+ pt(() => {
218
+ }), !o(u) && t != null && t.length && (T(), u.value = !0, (i = e.value) != null && i.watchDataIsChange && Bt(() => {
219
+ I.value = P();
220
+ }, 40));
218
221
  }
219
222
  ), d(
220
- () => m,
221
- dt(() => {
222
- e(o).submitOnChange && a();
223
+ () => a,
224
+ ht(() => {
225
+ o(e).submitOnChange && s();
223
226
  }, 300),
224
227
  { deep: !0 }
225
228
  );
226
229
  async function K(t) {
227
- F.value = ht(e(F) || {}, t);
230
+ v.value = yt(o(v) || {}, t);
228
231
  }
229
- function ot(t, n, r) {
230
- m[t] = n, r && r.itemProps && !r.itemProps.autoLink && P(t).catch((k) => {
232
+ function rt(t, i, r) {
233
+ a[t] = i, r && r.itemProps && !r.itemProps.autoLink && S(t).catch((O) => {
231
234
  });
232
235
  }
233
- function rt(t) {
234
- const { autoSubmitOnEnter: n } = e(o);
235
- if (n && t.key === "Enter" && t.target && t.target instanceof HTMLElement) {
236
+ function it(t) {
237
+ const { autoSubmitOnEnter: i } = o(e);
238
+ if (i && t.key === "Enter" && t.target && t.target instanceof HTMLElement) {
236
239
  const r = t.target;
237
- r && r.tagName && r.tagName.toUpperCase() === "INPUT" && a();
240
+ r && r.tagName && r.tagName.toUpperCase() === "INPUT" && s();
238
241
  }
239
242
  }
240
- const q = {
241
- getFieldsValue: $,
243
+ const z = {
244
+ getFieldsValue: P,
242
245
  getFieldValue: H,
243
- setFieldsValue: S,
244
- resetFields: R,
246
+ setFieldsValue: w,
247
+ resetFields: k,
245
248
  updateSchema: A,
246
- resetSchema: O,
249
+ resetSchema: C,
247
250
  setProps: K,
248
- removeSchemaByField: N,
249
- appendSchemaByField: L,
250
- clearValidate: I,
251
- validateField: P,
252
- validate: T,
253
- submit: a,
254
- scrollToField: tt
251
+ removeSchemaByField: q,
252
+ appendSchemaByField: N,
253
+ clearValidate: $,
254
+ validateField: S,
255
+ validate: L,
256
+ submit: s,
257
+ scrollToField: et
255
258
  };
256
- pt(() => {
257
- M(), _("register", q);
259
+ lt(() => {
260
+ T(), D("register", z), console.log("111");
258
261
  });
259
- const it = c(() => Bt(
260
- o.value,
262
+ const mt = c(() => gt(
263
+ e.value,
261
264
  [
262
265
  "showResetButton",
263
266
  "showCommonButton",
@@ -269,73 +272,73 @@ const Ot = (
269
272
  "actionSpan"
270
273
  ]
271
274
  ));
272
- return Q({
273
- getFieldsValue: $,
275
+ return X({
276
+ getFieldsValue: P,
274
277
  getFieldValue: H,
275
- setFieldsValue: S,
276
- resetFields: R,
278
+ setFieldsValue: w,
279
+ resetFields: k,
277
280
  updateSchema: A,
278
- resetSchema: O,
281
+ resetSchema: C,
279
282
  setProps: K,
280
- removeSchemaByField: N,
281
- appendSchemaByField: L,
282
- clearValidate: I,
283
- validateField: P,
284
- validate: T,
285
- submit: a,
286
- setFormItemError: et
287
- }), (t, n) => {
283
+ removeSchemaByField: q,
284
+ appendSchemaByField: N,
285
+ clearValidate: $,
286
+ validateField: S,
287
+ validate: L,
288
+ submit: s,
289
+ setFormItemError: ot
290
+ }), (t, i) => {
288
291
  var r;
289
- return u.value && ((r = i.value) != null && r.length) ? (l(), B(e(Pt), C({ key: 0 }, Y.value, {
292
+ return u.value && ((r = m.value) != null && r.length) ? (l(), B(o(Ct), R({ key: 0 }, Z.value, {
290
293
  ref_key: "formElRef",
291
- ref: w,
292
- class: e(Ot).b(),
293
- model: m,
294
- onKeypress: lt(rt, ["enter"])
294
+ ref: F,
295
+ class: o(Ot).b(),
296
+ model: a,
297
+ onKeypress: ut(it, ["enter"])
295
298
  }), {
296
299
  default: h(() => {
297
- var k, z, G;
300
+ var O, G, U;
298
301
  return [
299
- (k = i.value) != null && k.length ? (l(), B(e(At), y(C({ key: 0 }, (z = o.value) == null ? void 0 : z.rowProps)), {
302
+ (O = m.value) != null && O.length ? (l(), B(o(kt), g(R({ key: 0 }, (G = e.value) == null ? void 0 : G.rowProps)), {
300
303
  default: h(() => [
301
- g(t.$slots, "formHeader"),
302
- (l(!0), ut(ft, null, E(i.value, (s) => (l(), B(bt, {
303
- key: s.field,
304
+ y(t.$slots, "formHeader"),
305
+ (l(!0), ft(ct, null, V(m.value, (p) => (l(), B(Ft, {
306
+ key: p.field,
304
307
  tableAction: t.tableAction,
305
- formActionType: q,
306
- schema: s,
307
- formProps: o.value,
308
- allDefaultValues: v.value,
309
- formModel: m,
310
- setFormModel: ot,
311
- updateSchema: e(A)
312
- }, U({ _: 2 }, [
313
- E(Object.keys(t.$slots), (f) => ({
308
+ formActionType: z,
309
+ schema: p,
310
+ formProps: e.value,
311
+ allDefaultValues: b.value,
312
+ formModel: a,
313
+ setFormModel: rt,
314
+ updateSchema: o(A)
315
+ }, j({ _: 2 }, [
316
+ V(Object.keys(t.$slots), (f) => ({
314
317
  name: f,
315
- fn: h((mt) => [
316
- g(t.$slots, f, y(j(mt || {})))
318
+ fn: h((at) => [
319
+ y(t.$slots, f, g(x(at || {})))
317
320
  ])
318
321
  }))
319
322
  ]), 1032, ["tableAction", "schema", "formProps", "allDefaultValues", "formModel", "updateSchema"]))), 128))
320
323
  ]),
321
324
  _: 3
322
- }, 16)) : V("", !0),
323
- (G = o.value) != null && G.showActionButtonGroup ? (l(), B(gt, y(C({ key: 1 }, it.value)), U({ _: 2 }, [
324
- E(["resetBefore", "submitBefore", "submitAfter"], (s) => ({
325
- name: s,
325
+ }, 16)) : E("", !0),
326
+ (U = e.value) != null && U.showActionButtonGroup ? (l(), B(vt, g(R({ key: 1 }, mt.value)), j({ _: 2 }, [
327
+ V(["resetBefore", "submitBefore", "submitAfter"], (p) => ({
328
+ name: p,
326
329
  fn: h((f) => [
327
- g(t.$slots, s, y(j(f || {})))
330
+ y(t.$slots, p, g(x(f || {})))
328
331
  ])
329
332
  }))
330
- ]), 1040)) : V("", !0),
331
- g(t.$slots, "formFooter")
333
+ ]), 1040)) : E("", !0),
334
+ y(t.$slots, "formFooter")
332
335
  ];
333
336
  }),
334
337
  _: 3
335
- }, 16, ["class", "model", "onKeypress"])) : V("", !0);
338
+ }, 16, ["class", "model", "onKeypress"])) : E("", !0);
336
339
  };
337
340
  }
338
341
  });
339
342
  export {
340
- bo as default
343
+ wo as default
341
344
  };