vft 0.0.339 → 0.0.342

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.
@@ -7,7 +7,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7
7
  /**
8
8
  * @description Validate the whole form. Receives a callback or returns `Promise`.
9
9
  */
10
- validate: (callback?: FormValidateCallback) => FormValidationResult;
10
+ validate: (callback?: FormValidateCallback, props?: Arrayable<FormItemProp>) => FormValidationResult;
11
11
  /**
12
12
  * @description Validate specified fields.
13
13
  */
@@ -61,32 +61,32 @@ const H = b({
61
61
  if (l.length === 0) return [];
62
62
  const t = f(l, e);
63
63
  return t.length ? t : (n(i.b(), "please pass correct props!"), []);
64
- }, h = async (e) => c(void 0, e), R = async (e = []) => {
64
+ }, h = async (e, t) => c(t || void 0, e), R = async (e = []) => {
65
65
  if (!k.value) return !1;
66
66
  const t = P(e);
67
67
  if (t.length === 0) return !0;
68
68
  let r = {};
69
- for (const s of t)
69
+ for (const a of t)
70
70
  try {
71
- await s.validate(""), s.validateState === "error" && s.resetField();
72
- } catch (a) {
71
+ await a.validate(""), a.validateState === "error" && a.resetField();
72
+ } catch (s) {
73
73
  r = {
74
74
  ...r,
75
- ...a
75
+ ...s
76
76
  };
77
77
  }
78
78
  return Object.keys(r).length === 0 ? !0 : Promise.reject(r);
79
79
  }, c = async (e = [], t) => {
80
80
  let r = !1;
81
- const s = !K(t);
81
+ const a = !K(t);
82
82
  try {
83
83
  return r = await R(e), r === !0 && await t?.(r), o.model;
84
- } catch (a) {
85
- if (a instanceof Error) throw a;
86
- const v = a;
84
+ } catch (s) {
85
+ if (s instanceof Error) throw s;
86
+ const v = s;
87
87
  return o.scrollToError && d.value && d.value.querySelector(
88
88
  `.${i.b()}-item.is-error`
89
- )?.scrollIntoView(o.scrollIntoViewOptions), !r && await t?.(!1, v), s && Promise.reject(v);
89
+ )?.scrollIntoView(o.scrollIntoViewOptions), console.error(s), !r && await t?.(!1, v), a && Promise.reject(v);
90
90
  }
91
91
  }, S = (e) => {
92
92
  const t = u(e);
@@ -53,7 +53,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
53
53
  }>> & Readonly<{
54
54
  onValidate?: ((...args: any[]) => any) | undefined;
55
55
  }>, {
56
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
56
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
57
57
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
58
58
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
59
59
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -119,7 +119,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
119
119
  }>> & Readonly<{
120
120
  onValidate?: ((...args: any[]) => any) | undefined;
121
121
  }>, {
122
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
122
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
123
123
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
124
124
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
125
125
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -180,7 +180,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
180
180
  }>> & Readonly<{
181
181
  onValidate?: ((...args: any[]) => any) | undefined;
182
182
  }>, {
183
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
183
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
184
184
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
185
185
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
186
186
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -79,7 +79,7 @@ export interface FormActionType {
79
79
  /** 验证指定字段 */
80
80
  validateField: (nameList?: NamePath[]) => Promise<any>;
81
81
  /** 验证表单 */
82
- validate: (nameList?: NamePath[]) => Promise<any>;
82
+ validate: (callback?: Function, nameList?: NamePath[]) => Promise<any>;
83
83
  /** 滚动到指定字段 */
84
84
  scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>;
85
85
  /** 设置表单项错误信息 */
@@ -1,210 +1,233 @@
1
- import { isDef as z, isFunction as j, isString as A, isObject as w, isArray as V, deepMerge as et, findDifferentValuesForObj as nt, isNullOrUndefined as G, isEmpty as it, isEmptyObject as rt } from "@vft/utils";
2
- import { formatToDate as H } from "@vft/utils/date";
3
- import { get as st, cloneDeep as I, uniqBy as ct, isEqual as at, set as P } from "lodash-es";
4
- import { unref as r, toRaw as B, nextTick as J } from "vue";
5
- import { isInput as ot, FormCompEnum as x, isDatePicker as lt } from "../component-map.js";
1
+ import { isDef as G, isFunction as j, isString as A, isObject as V, isArray as I, deepMerge as it, findDifferentValuesForObj as nt, isNullOrUndefined as H, isEmpty as rt, isEmptyObject as lt } from "@vft/utils";
2
+ import { formatToDate as J } from "@vft/utils/date";
3
+ import { get as st, cloneDeep as O, uniqBy as ot, isEqual as ft, set as W } from "lodash-es";
4
+ import { unref as n, toRaw as S, nextTick as P } from "vue";
5
+ import { isInput as ct, FormCompEnum as x, isDatePicker as at } from "../component-map.js";
6
6
  import { handleInputNumberValue as ut } from "./helper.js";
7
- function ft(p, v = {}) {
8
- const o = /^\[(.+)\]$/;
9
- if (o.test(p)) {
10
- const d = p.match(o);
11
- if (d && d[1]) {
12
- const y = d[1].split(",");
13
- if (!y.length)
7
+ function Q(h, y) {
8
+ const { show: s, ifShow: f } = h;
9
+ let p = !0, a = !0;
10
+ return typeof s == "boolean" ? p = s : typeof s == "function" && (p = s({
11
+ field: h.field,
12
+ model: y,
13
+ values: {
14
+ ...y
15
+ },
16
+ schema: h
17
+ })), typeof f == "boolean" ? a = f : typeof f == "function" && (a = f({
18
+ field: h.field,
19
+ model: y,
20
+ values: {
21
+ ...y
22
+ },
23
+ schema: h
24
+ })), p && a;
25
+ }
26
+ function dt(h, y = {}) {
27
+ const s = /^\[(.+)\]$/;
28
+ if (s.test(h)) {
29
+ const f = h.match(s);
30
+ if (f && f[1]) {
31
+ const p = f[1].split(",");
32
+ if (!p.length)
14
33
  return;
15
- const u = [];
16
- return y.forEach((h, b) => {
17
- P(u, b, v[h.trim()]);
18
- }), u.filter(Boolean).length ? u : void 0;
34
+ const a = [];
35
+ return p.forEach((v, D) => {
36
+ W(a, D, y[v.trim()]);
37
+ }), a.filter(Boolean).length ? a : void 0;
19
38
  }
20
39
  }
21
40
  }
22
- function dt(p, v = {}) {
23
- const o = /^\{(.+)\}$/;
24
- if (o.test(p)) {
25
- const d = p.match(o);
26
- if (d && d[1]) {
27
- const y = d[1].split(",");
28
- if (!y.length)
41
+ function ht(h, y = {}) {
42
+ const s = /^\{(.+)\}$/;
43
+ if (s.test(h)) {
44
+ const f = h.match(s);
45
+ if (f && f[1]) {
46
+ const p = f[1].split(",");
47
+ if (!p.length)
29
48
  return;
30
- const u = {};
31
- return y.forEach((h) => {
32
- P(u, h.trim(), v[h.trim()]);
33
- }), Object.values(u).filter(Boolean).length ? u : void 0;
49
+ const a = {};
50
+ return p.forEach((v) => {
51
+ W(a, v.trim(), y[v.trim()]);
52
+ }), Object.values(a).filter(Boolean).length ? a : void 0;
34
53
  }
35
54
  }
36
55
  }
37
- function Et({
38
- emit: p,
39
- getProps: v,
40
- formModel: o,
41
- getSchema: d,
42
- defaultValueRef: y,
43
- formElRef: u,
44
- schemaRef: h,
45
- handleFormValues: b,
46
- initValues: S
56
+ function Dt({
57
+ emit: h,
58
+ getProps: y,
59
+ formModel: s,
60
+ getSchema: f,
61
+ defaultValueRef: p,
62
+ formElRef: a,
63
+ schemaRef: v,
64
+ handleFormValues: D,
65
+ initValues: _
47
66
  }) {
48
- async function Q(t) {
49
- const { resetFunc: n, submitOnReset: a } = r(v);
50
- n && j(n) && await n();
51
- const i = r(u);
52
- if (i) {
67
+ async function X(t) {
68
+ const { resetFunc: i, submitOnReset: l } = n(y);
69
+ i && j(i) && await i();
70
+ const r = n(a);
71
+ if (r) {
53
72
  if (t?.length)
54
- return i.resetFields(t);
55
- Object.keys(o).forEach((c) => {
56
- const s = r(d).find((l) => l.field === c), e = I(y.value[c]);
57
- o[c] = ot(s?.type) ? e || "" : e;
58
- }), J(() => O()), p("reset", B(o)), a && await N();
73
+ return r.resetFields(t);
74
+ Object.keys(s).forEach((c) => {
75
+ const o = n(f).find((u) => u.field === c), e = O(p.value[c]);
76
+ s[c] = ct(o?.type) ? e || "" : e;
77
+ }), P(() => B()), h("reset", S(s)), l && await $();
59
78
  }
60
79
  }
61
- async function _(t, n = !0) {
62
- const a = r(d).map((e) => e.field).filter(Boolean), i = ".", c = a.filter(
63
- (e) => String(e).indexOf(i) >= 0
64
- ), s = [];
65
- a.forEach((e) => {
66
- const l = r(d).find((f) => f.field === e);
67
- let D = st(t, e);
80
+ async function m(t, i = !0) {
81
+ const l = n(f).map((e) => e.field).filter(Boolean), r = ".", c = l.filter(
82
+ (e) => String(e).indexOf(r) >= 0
83
+ ), o = [];
84
+ l.forEach((e) => {
85
+ const u = n(f).find((d) => d.field === e);
86
+ let b = st(t, e);
68
87
  const C = Reflect.has(t, e);
69
- D = ut(l?.type, D);
70
- const { componentProps: $ } = l || {};
71
- let E = $;
72
- typeof $ == "function" && (E = E({ formModel: r(o) }));
73
- const U = ft(e, t) || dt(e, t);
74
- if (C || U) {
75
- const f = U || D;
76
- if (k(e))
77
- if (Array.isArray(f)) {
88
+ b = ut(u?.type, b);
89
+ const { componentProps: U } = u || {};
90
+ let w = U;
91
+ typeof U == "function" && (w = w({ formModel: n(s) }));
92
+ const z = dt(e, t) || ht(e, t);
93
+ if (C || z) {
94
+ const d = z || b;
95
+ if (M(e))
96
+ if (Array.isArray(d)) {
78
97
  const F = [];
79
- for (const m of f)
80
- F.push(m ? H(m) : null);
81
- r(o)[e] = F;
98
+ for (const E of d)
99
+ F.push(E ? J(E) : null);
100
+ n(s)[e] = F;
82
101
  } else
83
- r(o)[e] = f ? E?.valueFormat ? f : H(f) : null;
102
+ n(s)[e] = d ? w?.valueFormat ? d : J(d) : null;
84
103
  else
85
- r(o)[e] = f;
86
- E?.onChange && E?.onChange(f), s.push(e);
104
+ n(s)[e] = d;
105
+ w?.onChange && w?.onChange(d), o.push(e);
87
106
  } else
88
- c.forEach((f) => {
107
+ c.forEach((d) => {
89
108
  try {
90
- const F = f.split(".").reduce((m, tt) => m[tt], t);
91
- z(F) && (r(o)[f] = r(F), s.push(f));
109
+ const F = d.split(".").reduce((E, et) => E[et], t);
110
+ G(F) && (n(s)[d] = n(F), o.push(d));
92
111
  } catch {
93
- z(y.value[f]) && (r(o)[f] = I(
94
- r(y.value[f])
112
+ G(p.value[d]) && (n(s)[d] = O(
113
+ n(p.value[d])
95
114
  ));
96
115
  }
97
116
  });
98
- }), n && J(async () => {
99
- await L(s).catch((e) => {
117
+ }), i && P(async () => {
118
+ await q(o).catch((e) => {
100
119
  });
101
120
  });
102
121
  }
103
- async function W(t) {
104
- const n = I(r(d));
122
+ async function Y(t) {
123
+ const i = O(n(f));
105
124
  if (!t)
106
125
  return;
107
- let a = A(t) ? [t] : t;
108
- A(t) && (a = [t]);
109
- for (const i of a)
110
- X(i, n);
111
- h.value = n;
126
+ let l = A(t) ? [t] : t;
127
+ A(t) && (l = [t]);
128
+ for (const r of l)
129
+ Z(r, i);
130
+ v.value = i;
112
131
  }
113
- function X(t, n) {
132
+ function Z(t, i) {
114
133
  if (A(t)) {
115
- const a = n.findIndex((i) => i.field === t);
116
- a !== -1 && (delete o[t], n.splice(a, 1));
134
+ const l = i.findIndex((r) => r.field === t);
135
+ l !== -1 && (delete s[t], i.splice(l, 1));
117
136
  }
118
137
  }
119
- async function Y(t, n, a = !1) {
120
- const i = I(r(d)), c = i.findIndex((e) => e.field === n), s = w(t) ? [t] : t;
121
- if (!n || c === -1 || a) {
122
- a ? i.unshift(...s) : i.push(...s), h.value = i, g(t);
138
+ async function L(t, i, l = !1) {
139
+ const r = O(n(f)), c = r.findIndex((e) => e.field === i), o = V(t) ? [t] : t;
140
+ if (!i || c === -1 || l) {
141
+ l ? r.unshift(...o) : r.push(...o), v.value = r, g(t);
123
142
  return;
124
143
  }
125
- c !== -1 && i.splice(c + 1, 0, ...s), g(t), h.value = i;
144
+ c !== -1 && r.splice(c + 1, 0, ...o), g(t), v.value = r;
126
145
  }
127
- async function Z(t) {
128
- let n = [];
129
- if (w(t) && n.push(t), V(t) && (n = [...t]), !n.every(
130
- (i) => i.type === x.DIVIDER || Reflect.has(i, "field") && i.field
146
+ async function K(t) {
147
+ let i = [];
148
+ if (V(t) && i.push(t), I(t) && (i = [...t]), !i.every(
149
+ (r) => r.type === x.DIVIDER || Reflect.has(r, "field") && r.field
131
150
  )) {
132
151
  console.error(
133
152
  "All children of the form Schema array that need to be updated must contain the `field` field"
134
153
  );
135
154
  return;
136
155
  }
137
- h.value = n;
156
+ v.value = i;
138
157
  }
139
- async function K(t) {
140
- let n = [];
141
- if (w(t) && n.push(t), V(t) && (n = [...t]), !n.every(
142
- (s) => s.type === x.DIVIDER || Reflect.has(s, "field") && s.field
158
+ async function R(t) {
159
+ let i = [];
160
+ if (V(t) && i.push(t), I(t) && (i = [...t]), !i.every(
161
+ (o) => o.type === x.DIVIDER || Reflect.has(o, "field") && o.field
143
162
  )) {
144
163
  console.error(
145
164
  "All children of the form Schema array that need to be updated must contain the `field` field"
146
165
  );
147
166
  return;
148
167
  }
149
- const i = [], c = [];
150
- r(d).forEach((s) => {
168
+ const r = [], c = [];
169
+ n(f).forEach((o) => {
151
170
  let e;
152
- if (n.forEach((l) => {
153
- s.field === l.field && (e = l), l.defaultValue && l.field && i.push(l.field);
154
- }), e !== void 0 && s.field === e.field) {
155
- const l = et(s, e);
156
- c.push(l);
171
+ if (i.forEach((u) => {
172
+ o.field === u.field && (e = u), u.defaultValue && u.field && r.push(u.field);
173
+ }), e !== void 0 && o.field === e.field) {
174
+ const u = it(o, e);
175
+ c.push(u);
157
176
  } else
158
- c.push(s);
159
- }), g(c, i), h.value = ct(c, "field");
177
+ c.push(o);
178
+ }), g(c, r), v.value = ot(c, "field");
160
179
  }
161
- function g(t, n, a = !0) {
162
- if (V(n) && n?.length === 0)
180
+ function g(t, i, l = !0) {
181
+ if (I(i) && i?.length === 0)
163
182
  return;
164
- let i = [];
165
- w(t) && i.push(t), V(t) && (i = [...t]);
166
- const c = {}, s = T();
167
- i.forEach((e) => {
168
- e.type !== x.DIVIDER && Reflect.has(e, "field") && e.field && !G(e.defaultValue) && (!(e.field in s) || G(s[e.field]) || it(s[e.field])) && (c[e.field] = e.defaultValue);
169
- }), rt(c) || _(c, a);
183
+ let r = [];
184
+ V(t) && r.push(t), I(t) && (r = [...t]);
185
+ const c = {}, o = T();
186
+ r.forEach((e) => {
187
+ e.type !== x.DIVIDER && Reflect.has(e, "field") && e.field && !H(e.defaultValue) && (!(e.field in o) || H(o[e.field]) || rt(o[e.field])) && (c[e.field] = e.defaultValue);
188
+ }), lt(c) || m(c, l);
170
189
  }
171
190
  function T() {
172
- return r(u) ? b(B(r(o))) : {};
173
- }
174
- function R(t) {
175
- return r(u) ? B(r(o))[t] : {};
191
+ return n(a) ? D(S(n(s))) : {};
176
192
  }
177
193
  function k(t) {
178
- return r(d).some((n) => n.field === t ? lt(n.type) : !1);
194
+ return n(a) ? S(n(s))[t] : {};
179
195
  }
180
- async function L(t) {
181
- return r(u)?.validateField(t);
196
+ function M(t) {
197
+ return n(f).some((i) => i.field === t ? at(i.type) : !1);
182
198
  }
183
199
  async function q(t) {
184
- return await r(u)?.validate(t);
200
+ return t || (t = n(f).filter((l) => Q(l, n(s))).map((l) => l.field).filter(Boolean)), n(a)?.validateField(t);
185
201
  }
186
- async function O(t) {
187
- await r(u)?.clearValidate(t);
202
+ async function N(t) {
203
+ return t || (t = n(f).filter((l) => Q(l, n(s))).map((l) => l.field).filter(Boolean)), await n(a)?.validate(() => {
204
+ }, t);
188
205
  }
189
- async function M(t, n) {
190
- await r(u)?.scrollToField(t, n);
206
+ async function B(t) {
207
+ await n(a)?.clearValidate(t);
191
208
  }
192
- async function N(t) {
193
- const { autoCleanErrorMessage: n, watchDataIsChange: a } = r(v);
194
- t && t.preventDefault(), n && await O();
195
- const { submitFunc: i, beforeSubmitFunc: c } = r(v);
196
- if (c && j(c) && await c(), i && j(i)) {
197
- await i();
209
+ async function tt(t, i) {
210
+ await n(a)?.scrollToField(t, i);
211
+ }
212
+ async function $(t) {
213
+ const { autoCleanErrorMessage: i, watchDataIsChange: l } = n(y);
214
+ t && t.preventDefault(), i && await B();
215
+ const { submitFunc: r, beforeSubmitFunc: c } = n(y);
216
+ if (c && j(c) && await c(), r && j(r)) {
217
+ await r();
198
218
  return;
199
219
  }
200
- if (r(u))
220
+ if (n(a))
201
221
  try {
202
- const e = await q(), l = b(e);
203
- if (a) {
204
- const D = at(S.value, l), C = nt(S.value, l);
205
- p("submit", l, !D, C);
222
+ const e = await N();
223
+ if (!e)
224
+ return;
225
+ const u = D(e);
226
+ if (l) {
227
+ const b = ft(_.value, u), C = nt(_.value, u);
228
+ h("submit", u, !b, C);
206
229
  } else
207
- p("submit", l);
230
+ h("submit", u);
208
231
  } catch (e) {
209
232
  if (e?.outOfDate === !1 && e?.errorFields)
210
233
  return;
@@ -212,21 +235,21 @@ function Et({
212
235
  }
213
236
  }
214
237
  return {
215
- handleSubmit: N,
216
- clearValidate: O,
217
- validate: q,
218
- validateField: L,
238
+ handleSubmit: $,
239
+ clearValidate: B,
240
+ validate: N,
241
+ validateField: q,
219
242
  getFieldsValue: T,
220
- updateSchema: K,
221
- resetSchema: Z,
222
- appendSchemaByField: Y,
223
- removeSchemaByField: W,
224
- resetFields: Q,
225
- setFieldsValue: _,
226
- scrollToField: M,
227
- getFieldValue: R
243
+ updateSchema: R,
244
+ resetSchema: K,
245
+ appendSchemaByField: L,
246
+ removeSchemaByField: Y,
247
+ resetFields: X,
248
+ setFieldsValue: m,
249
+ scrollToField: tt,
250
+ getFieldValue: k
228
251
  };
229
252
  }
230
253
  export {
231
- Et as useFormEvents
254
+ Dt as useFormEvents
232
255
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.339",
3
+ "version": "0.0.342",
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.339";
1
+ const o = "0.0.342";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -7,7 +7,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7
7
  /**
8
8
  * @description Validate the whole form. Receives a callback or returns `Promise`.
9
9
  */
10
- validate: (callback?: FormValidateCallback) => FormValidationResult;
10
+ validate: (callback?: FormValidateCallback, props?: Arrayable<FormItemProp>) => FormValidationResult;
11
11
  /**
12
12
  * @description Validate specified fields.
13
13
  */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");require("@vueuse/core");const E=require("@vft/utils"),d=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const k=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const R=require("./constants.cjs"),W=require("./hooks/use-form-common-props.cjs"),u=require("./utils.cjs"),x=r.defineComponent({name:"vft-form"}),M=r.defineComponent({...x,props:{size:{},disabled:{type:Boolean},model:{},rules:{},labelPosition:{default:"right"},requireAsteriskPosition:{default:"left"},labelWidth:{default:""},labelSuffix:{default:""},inline:{type:Boolean},inlineMessage:{type:Boolean},statusIcon:{type:Boolean},showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:{type:Boolean},scrollIntoViewOptions:{type:Boolean,default:!0}},emits:["validate"],setup(o,{expose:y,emit:q}){const g=q,p=r.getCurrentInstance(),c=r.ref(),l=r.reactive([]),w=W.useFormSize(),s=k.useNamespace("form"),B=r.computed(()=>[s.b(),s.m(w.value||"default"),{[s.m(`label-${o.labelPosition}`)]:o.labelPosition,[s.m("inline")]:o.inline}]),m=e=>u.filterFields(l,[e])[0],V=e=>{l.push(e)},C=e=>{e.prop&&l.splice(l.indexOf(e),1)},h=(e=[])=>{if(!o.model){d.debugWarn(s.b(),"model is required for resetFields to work.");return}u.filterFields(l,e).forEach(t=>t.resetField())},v=(e=[])=>{u.filterFields(l,e).forEach(t=>t.clearValidate())},I=r.computed(()=>{const e=!!o.model;return e||d.debugWarn(s.b(),"model is required for validate to work."),e}),O=e=>{if(l.length===0)return[];const t=u.filterFields(l,e);return t.length?t:(d.debugWarn(s.b(),"please pass correct props!"),[])},F=async e=>f(void 0,e),P=async(e=[])=>{if(!I.value)return!1;const t=O(e);if(t.length===0)return!0;let i={};for(const n of t)try{await n.validate(""),n.validateState==="error"&&n.resetField()}catch(a){i={...i,...a}}return Object.keys(i).length===0?!0:Promise.reject(i)},f=async(e=[],t)=>{let i=!1;const n=!E.isFunction(t);try{return i=await P(e),i===!0&&await t?.(i),o.model}catch(a){if(a instanceof Error)throw a;const b=a;return o.scrollToError&&c.value&&c.value.querySelector(`.${s.b()}-item.is-error`)?.scrollIntoView(o.scrollIntoViewOptions),!i&&await t?.(!1,b),n&&Promise.reject(b)}},S=e=>{const t=m(e);t&&t.$el?.scrollIntoView(o.scrollIntoViewOptions)};return r.watch(()=>o.rules,()=>{o.validateOnRuleChange&&F().catch(e=>d.debugWarn(e))},{deep:!0,flush:"post"}),r.provide(R.formContextKey,r.reactive({...r.toRefs(p.props),emit:g,resetFields:h,clearValidate:v,validateField:f,getField:m,addField:V,removeField:C,...u.useFormLabelWidth()})),y({validate:F,validateField:f,resetFields:h,clearValidate:v,scrollToField:S}),(e,t)=>(r.openBlock(),r.createElementBlock("form",{ref_key:"formRef",ref:c,class:r.normalizeClass(B.value)},[r.renderSlot(e.$slots,"default")],2))}});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");require("@vueuse/core");const E=require("@vft/utils"),d=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const k=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const R=require("./constants.cjs"),W=require("./hooks/use-form-common-props.cjs"),u=require("./utils.cjs"),x=r.defineComponent({name:"vft-form"}),M=r.defineComponent({...x,props:{size:{},disabled:{type:Boolean},model:{},rules:{},labelPosition:{default:"right"},requireAsteriskPosition:{default:"left"},labelWidth:{default:""},labelSuffix:{default:""},inline:{type:Boolean},inlineMessage:{type:Boolean},statusIcon:{type:Boolean},showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:{type:Boolean},scrollIntoViewOptions:{type:Boolean,default:!0}},emits:["validate"],setup(o,{expose:y,emit:q}){const g=q,p=r.getCurrentInstance(),c=r.ref(),l=r.reactive([]),w=W.useFormSize(),s=k.useNamespace("form"),B=r.computed(()=>[s.b(),s.m(w.value||"default"),{[s.m(`label-${o.labelPosition}`)]:o.labelPosition,[s.m("inline")]:o.inline}]),m=e=>u.filterFields(l,[e])[0],V=e=>{l.push(e)},C=e=>{e.prop&&l.splice(l.indexOf(e),1)},h=(e=[])=>{if(!o.model){d.debugWarn(s.b(),"model is required for resetFields to work.");return}u.filterFields(l,e).forEach(t=>t.resetField())},v=(e=[])=>{u.filterFields(l,e).forEach(t=>t.clearValidate())},I=r.computed(()=>{const e=!!o.model;return e||d.debugWarn(s.b(),"model is required for validate to work."),e}),O=e=>{if(l.length===0)return[];const t=u.filterFields(l,e);return t.length?t:(d.debugWarn(s.b(),"please pass correct props!"),[])},F=async(e,t)=>f(t||void 0,e),P=async(e=[])=>{if(!I.value)return!1;const t=O(e);if(t.length===0)return!0;let i={};for(const a of t)try{await a.validate(""),a.validateState==="error"&&a.resetField()}catch(n){i={...i,...n}}return Object.keys(i).length===0?!0:Promise.reject(i)},f=async(e=[],t)=>{let i=!1;const a=!E.isFunction(t);try{return i=await P(e),i===!0&&await t?.(i),o.model}catch(n){if(n instanceof Error)throw n;const b=n;return o.scrollToError&&c.value&&c.value.querySelector(`.${s.b()}-item.is-error`)?.scrollIntoView(o.scrollIntoViewOptions),console.error(n),!i&&await t?.(!1,b),a&&Promise.reject(b)}},S=e=>{const t=m(e);t&&t.$el?.scrollIntoView(o.scrollIntoViewOptions)};return r.watch(()=>o.rules,()=>{o.validateOnRuleChange&&F().catch(e=>d.debugWarn(e))},{deep:!0,flush:"post"}),r.provide(R.formContextKey,r.reactive({...r.toRefs(p.props),emit:g,resetFields:h,clearValidate:v,validateField:f,getField:m,addField:V,removeField:C,...u.useFormLabelWidth()})),y({validate:F,validateField:f,resetFields:h,clearValidate:v,scrollToField:S}),(e,t)=>(r.openBlock(),r.createElementBlock("form",{ref_key:"formRef",ref:c,class:r.normalizeClass(B.value)},[r.renderSlot(e.$slots,"default")],2))}});exports.default=M;
@@ -53,7 +53,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
53
53
  }>> & Readonly<{
54
54
  onValidate?: ((...args: any[]) => any) | undefined;
55
55
  }>, {
56
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
56
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
57
57
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
58
58
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
59
59
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -119,7 +119,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
119
119
  }>> & Readonly<{
120
120
  onValidate?: ((...args: any[]) => any) | undefined;
121
121
  }>, {
122
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
122
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
123
123
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
124
124
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
125
125
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -180,7 +180,7 @@ export declare const VftForm: import("vft/es/utils").SFCWithInstall<{
180
180
  }>> & Readonly<{
181
181
  onValidate?: ((...args: any[]) => any) | undefined;
182
182
  }>, {
183
- validate: (callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
183
+ validate: (callback?: import("./types").FormValidateCallback, props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => import("./types").FormValidationResult;
184
184
  validateField: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>, callback?: import("./types").FormValidateCallback) => import("./types").FormValidationResult;
185
185
  resetFields: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
186
186
  clearValidate: (props?: import("vft/es/utils").Arrayable<import("./types").FormItemProp>) => void;
@@ -79,7 +79,7 @@ export interface FormActionType {
79
79
  /** 验证指定字段 */
80
80
  validateField: (nameList?: NamePath[]) => Promise<any>;
81
81
  /** 验证表单 */
82
- validate: (nameList?: NamePath[]) => Promise<any>;
82
+ validate: (callback?: Function, nameList?: NamePath[]) => Promise<any>;
83
83
  /** 滚动到指定字段 */
84
84
  scrollToField: (name: NamePath, options?: ScrollOptions) => Promise<void>;
85
85
  /** 设置表单项错误信息 */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@vft/utils"),L=require("@vft/utils/date"),v=require("lodash-es"),r=require("vue"),g=require("../component-map.cjs"),X=require("./helper.cjs");function Y(y,D={}){const o=/^\[(.+)\]$/;if(o.test(y)){const h=y.match(o);if(h&&h[1]){const F=h[1].split(",");if(!F.length)return;const l=[];return F.forEach((p,O)=>{v.set(l,O,D[p.trim()])}),l.filter(Boolean).length?l:void 0}}}function Z(y,D={}){const o=/^\{(.+)\}$/;if(o.test(y)){const h=y.match(o);if(h&&h[1]){const F=h[1].split(",");if(!F.length)return;const l={};return F.forEach(p=>{v.set(l,p.trim(),D[p.trim()])}),Object.values(l).filter(Boolean).length?l:void 0}}}function K({emit:y,getProps:D,formModel:o,getSchema:h,defaultValueRef:F,formElRef:l,schemaRef:p,handleFormValues:O,initValues:A}){async function N(e){const{resetFunc:t,submitOnReset:a}=r.unref(D);t&&c.isFunction(t)&&await t();const i=r.unref(l);if(i){if(e?.length)return i.resetFields(e);Object.keys(o).forEach(u=>{const s=r.unref(h).find(f=>f.field===u),n=v.cloneDeep(F.value[u]);o[u]=g.isInput(s?.type)?n||"":n}),r.nextTick(()=>I()),y("reset",r.toRaw(o)),a&&await B()}}async function C(e,t=!0){const a=r.unref(h).map(n=>n.field).filter(Boolean),i=".",u=a.filter(n=>String(n).indexOf(i)>=0),s=[];a.forEach(n=>{const f=r.unref(h).find(d=>d.field===n);let E=v.get(e,n);const j=Reflect.has(e,n);E=X.handleInputNumberValue(f?.type,E);const{componentProps:x}=f||{};let w=x;typeof x=="function"&&(w=w({formModel:r.unref(o)}));const _=Y(n,e)||Z(n,e);if(j||_){const d=_||E;if(J(n))if(Array.isArray(d)){const b=[];for(const m of d)b.push(m?L.formatToDate(m):null);r.unref(o)[n]=b}else r.unref(o)[n]=d?w?.valueFormat?d:L.formatToDate(d):null;else r.unref(o)[n]=d;w?.onChange&&w?.onChange(d),s.push(n)}else u.forEach(d=>{try{const b=d.split(".").reduce((m,W)=>m[W],e);c.isDef(b)&&(r.unref(o)[d]=r.unref(b),s.push(d))}catch{c.isDef(F.value[d])&&(r.unref(o)[d]=v.cloneDeep(r.unref(F.value[d])))}})}),t&&r.nextTick(async()=>{await q(s).catch(n=>{})})}async function U(e){const t=v.cloneDeep(r.unref(h));if(!e)return;let a=c.isString(e)?[e]:e;c.isString(e)&&(a=[e]);for(const i of a)$(i,t);p.value=t}function $(e,t){if(c.isString(e)){const a=t.findIndex(i=>i.field===e);a!==-1&&(delete o[e],t.splice(a,1))}}async function P(e,t,a=!1){const i=v.cloneDeep(r.unref(h)),u=i.findIndex(n=>n.field===t),s=c.isObject(e)?[e]:e;if(!t||u===-1||a){a?i.unshift(...s):i.push(...s),p.value=i,V(e);return}u!==-1&&i.splice(u+1,0,...s),V(e),p.value=i}async function z(e){let t=[];if(c.isObject(e)&&t.push(e),c.isArray(e)&&(t=[...e]),!t.every(i=>i.type===g.FormCompEnum.DIVIDER||Reflect.has(i,"field")&&i.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}p.value=t}async function G(e){let t=[];if(c.isObject(e)&&t.push(e),c.isArray(e)&&(t=[...e]),!t.every(s=>s.type===g.FormCompEnum.DIVIDER||Reflect.has(s,"field")&&s.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}const i=[],u=[];r.unref(h).forEach(s=>{let n;if(t.forEach(f=>{s.field===f.field&&(n=f),f.defaultValue&&f.field&&i.push(f.field)}),n!==void 0&&s.field===n.field){const f=c.deepMerge(s,n);u.push(f)}else u.push(s)}),V(u,i),p.value=v.uniqBy(u,"field")}function V(e,t,a=!0){if(c.isArray(t)&&t?.length===0)return;let i=[];c.isObject(e)&&i.push(e),c.isArray(e)&&(i=[...e]);const u={},s=S();i.forEach(n=>{n.type!==g.FormCompEnum.DIVIDER&&Reflect.has(n,"field")&&n.field&&!c.isNullOrUndefined(n.defaultValue)&&(!(n.field in s)||c.isNullOrUndefined(s[n.field])||c.isEmpty(s[n.field]))&&(u[n.field]=n.defaultValue)}),c.isEmptyObject(u)||C(u,a)}function S(){return r.unref(l)?O(r.toRaw(r.unref(o))):{}}function H(e){return r.unref(l)?r.toRaw(r.unref(o))[e]:{}}function J(e){return r.unref(h).some(t=>t.field===e?g.isDatePicker(t.type):!1)}async function q(e){return r.unref(l)?.validateField(e)}async function T(e){return await r.unref(l)?.validate(e)}async function I(e){await r.unref(l)?.clearValidate(e)}async function Q(e,t){await r.unref(l)?.scrollToField(e,t)}async function B(e){const{autoCleanErrorMessage:t,watchDataIsChange:a}=r.unref(D);e&&e.preventDefault(),t&&await I();const{submitFunc:i,beforeSubmitFunc:u}=r.unref(D);if(u&&c.isFunction(u)&&await u(),i&&c.isFunction(i)){await i();return}if(r.unref(l))try{const n=await T(),f=O(n);if(a){const E=v.isEqual(A.value,f),j=c.findDifferentValuesForObj(A.value,f);y("submit",f,!E,j)}else y("submit",f)}catch(n){if(n?.outOfDate===!1&&n?.errorFields)return;throw new Error(n.message)}}return{handleSubmit:B,clearValidate:I,validate:T,validateField:q,getFieldsValue:S,updateSchema:G,resetSchema:z,appendSchemaByField:P,removeSchemaByField:U,resetFields:N,setFieldsValue:C,scrollToField:Q,getFieldValue:H}}exports.useFormEvents=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@vft/utils"),N=require("@vft/utils/date"),b=require("lodash-es"),i=require("vue"),O=require("../component-map.cjs"),Z=require("./helper.cjs");function U(p,F){const{show:u,ifShow:l}=p;let y=!0,a=!0;return typeof u=="boolean"?y=u:typeof u=="function"&&(y=u({field:p.field,model:F,values:{...F},schema:p})),typeof l=="boolean"?a=l:typeof l=="function"&&(a=l({field:p.field,model:F,values:{...F},schema:p})),y&&a}function L(p,F={}){const u=/^\[(.+)\]$/;if(u.test(p)){const l=p.match(u);if(l&&l[1]){const y=l[1].split(",");if(!y.length)return;const a=[];return y.forEach((v,V)=>{b.set(a,V,F[v.trim()])}),a.filter(Boolean).length?a:void 0}}}function K(p,F={}){const u=/^\{(.+)\}$/;if(u.test(p)){const l=p.match(u);if(l&&l[1]){const y=l[1].split(",");if(!y.length)return;const a={};return y.forEach(v=>{b.set(a,v.trim(),F[v.trim()])}),Object.values(a).filter(Boolean).length?a:void 0}}}function R({emit:p,getProps:F,formModel:u,getSchema:l,defaultValueRef:y,formElRef:a,schemaRef:v,handleFormValues:V,initValues:A}){async function $(e){const{resetFunc:t,submitOnReset:s}=i.unref(F);t&&c.isFunction(t)&&await t();const r=i.unref(a);if(r){if(e?.length)return r.resetFields(e);Object.keys(u).forEach(o=>{const f=i.unref(l).find(d=>d.field===o),n=b.cloneDeep(y.value[o]);u[o]=O.isInput(f?.type)?n||"":n}),i.nextTick(()=>j()),p("reset",i.toRaw(u)),s&&await x()}}async function C(e,t=!0){const s=i.unref(l).map(n=>n.field).filter(Boolean),r=".",o=s.filter(n=>String(n).indexOf(r)>=0),f=[];s.forEach(n=>{const d=i.unref(l).find(h=>h.field===n);let E=b.get(e,n);const S=Reflect.has(e,n);E=Z.handleInputNumberValue(d?.type,E);const{componentProps:_}=d||{};let w=_;typeof _=="function"&&(w=w({formModel:i.unref(u)}));const m=L(n,e)||K(n,e);if(S||m){const h=m||E;if(W(n))if(Array.isArray(h)){const D=[];for(const g of h)D.push(g?N.formatToDate(g):null);i.unref(u)[n]=D}else i.unref(u)[n]=h?w?.valueFormat?h:N.formatToDate(h):null;else i.unref(u)[n]=h;w?.onChange&&w?.onChange(h),f.push(n)}else o.forEach(h=>{try{const D=h.split(".").reduce((g,Y)=>g[Y],e);c.isDef(D)&&(i.unref(u)[h]=i.unref(D),f.push(h))}catch{c.isDef(y.value[h])&&(i.unref(u)[h]=b.cloneDeep(i.unref(y.value[h])))}})}),t&&i.nextTick(async()=>{await q(f).catch(n=>{})})}async function P(e){const t=b.cloneDeep(i.unref(l));if(!e)return;let s=c.isString(e)?[e]:e;c.isString(e)&&(s=[e]);for(const r of s)z(r,t);v.value=t}function z(e,t){if(c.isString(e)){const s=t.findIndex(r=>r.field===e);s!==-1&&(delete u[e],t.splice(s,1))}}async function G(e,t,s=!1){const r=b.cloneDeep(i.unref(l)),o=r.findIndex(n=>n.field===t),f=c.isObject(e)?[e]:e;if(!t||o===-1||s){s?r.unshift(...f):r.push(...f),v.value=r,I(e);return}o!==-1&&r.splice(o+1,0,...f),I(e),v.value=r}async function H(e){let t=[];if(c.isObject(e)&&t.push(e),c.isArray(e)&&(t=[...e]),!t.every(r=>r.type===O.FormCompEnum.DIVIDER||Reflect.has(r,"field")&&r.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}v.value=t}async function J(e){let t=[];if(c.isObject(e)&&t.push(e),c.isArray(e)&&(t=[...e]),!t.every(f=>f.type===O.FormCompEnum.DIVIDER||Reflect.has(f,"field")&&f.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}const r=[],o=[];i.unref(l).forEach(f=>{let n;if(t.forEach(d=>{f.field===d.field&&(n=d),d.defaultValue&&d.field&&r.push(d.field)}),n!==void 0&&f.field===n.field){const d=c.deepMerge(f,n);o.push(d)}else o.push(f)}),I(o,r),v.value=b.uniqBy(o,"field")}function I(e,t,s=!0){if(c.isArray(t)&&t?.length===0)return;let r=[];c.isObject(e)&&r.push(e),c.isArray(e)&&(r=[...e]);const o={},f=B();r.forEach(n=>{n.type!==O.FormCompEnum.DIVIDER&&Reflect.has(n,"field")&&n.field&&!c.isNullOrUndefined(n.defaultValue)&&(!(n.field in f)||c.isNullOrUndefined(f[n.field])||c.isEmpty(f[n.field]))&&(o[n.field]=n.defaultValue)}),c.isEmptyObject(o)||C(o,s)}function B(){return i.unref(a)?V(i.toRaw(i.unref(u))):{}}function Q(e){return i.unref(a)?i.toRaw(i.unref(u))[e]:{}}function W(e){return i.unref(l).some(t=>t.field===e?O.isDatePicker(t.type):!1)}async function q(e){return e||(e=i.unref(l).filter(s=>U(s,i.unref(u))).map(s=>s.field).filter(Boolean)),i.unref(a)?.validateField(e)}async function T(e){return e||(e=i.unref(l).filter(s=>U(s,i.unref(u))).map(s=>s.field).filter(Boolean)),await i.unref(a)?.validate(()=>{},e)}async function j(e){await i.unref(a)?.clearValidate(e)}async function X(e,t){await i.unref(a)?.scrollToField(e,t)}async function x(e){const{autoCleanErrorMessage:t,watchDataIsChange:s}=i.unref(F);e&&e.preventDefault(),t&&await j();const{submitFunc:r,beforeSubmitFunc:o}=i.unref(F);if(o&&c.isFunction(o)&&await o(),r&&c.isFunction(r)){await r();return}if(i.unref(a))try{const n=await T();if(!n)return;const d=V(n);if(s){const E=b.isEqual(A.value,d),S=c.findDifferentValuesForObj(A.value,d);p("submit",d,!E,S)}else p("submit",d)}catch(n){if(n?.outOfDate===!1&&n?.errorFields)return;throw new Error(n.message)}}return{handleSubmit:x,clearValidate:j,validate:T,validateField:q,getFieldsValue:B,updateSchema:J,resetSchema:H,appendSchemaByField:G,removeSchemaByField:P,resetFields:$,setFieldsValue:C,scrollToField:X,getFieldValue:Q}}exports.useFormEvents=R;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.339";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.342";exports.version=e;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.339",
3
+ "version": "0.0.342",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vft",
3
- "version": "0.0.339",
3
+ "version": "0.0.342",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -55,12 +55,12 @@
55
55
  "resize-detector": "0.3.0",
56
56
  "sortablejs": "1.15.0",
57
57
  "photoswipe": "5.4.4",
58
- "@vft/directives": "0.0.33",
59
- "@vft/utils": "0.0.128",
60
58
  "@vft/router": "0.0.65",
61
59
  "@vft/store": "0.0.54",
62
60
  "@vft/constants": "0.0.72",
63
- "@vft/use": "0.0.76"
61
+ "@vft/utils": "0.0.128",
62
+ "@vft/use": "0.0.76",
63
+ "@vft/directives": "0.0.33"
64
64
  },
65
65
  "vetur": {
66
66
  "tags": "tags.json",
package/web-types.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.339","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
1
+ {"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.342","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}