@duxweb/dvha-core 1.0.18 → 1.0.20

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 (38) hide show
  1. package/dist/cjs/components/loader/loader.cjs +1 -1
  2. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  3. package/dist/cjs/hooks/auth.cjs +1 -1
  4. package/dist/cjs/hooks/data.cjs +1 -1
  5. package/dist/cjs/hooks/export.cjs +1 -1
  6. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  7. package/dist/cjs/hooks/form.cjs +1 -1
  8. package/dist/cjs/hooks/formExtend.cjs +1 -1
  9. package/dist/cjs/hooks/i18n.cjs +1 -1
  10. package/dist/cjs/hooks/list.cjs +1 -1
  11. package/dist/cjs/hooks/tree.cjs +1 -1
  12. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  13. package/dist/cjs/provider/app.cjs +1 -1
  14. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  15. package/dist/cjs/stores/route.cjs +1 -1
  16. package/dist/esm/components/loader/loader.js +19 -30
  17. package/dist/esm/components/loader/remote/loader.js +22 -24
  18. package/dist/esm/hooks/auth.js +26 -24
  19. package/dist/esm/hooks/data.js +272 -258
  20. package/dist/esm/hooks/export.js +12 -12
  21. package/dist/esm/hooks/exportCsv.js +16 -24
  22. package/dist/esm/hooks/form.js +48 -39
  23. package/dist/esm/hooks/formExtend.js +11 -9
  24. package/dist/esm/hooks/i18n.js +6 -2
  25. package/dist/esm/hooks/list.js +12 -12
  26. package/dist/esm/hooks/tree.js +20 -26
  27. package/dist/esm/preset/i18nProvider.js +14 -13
  28. package/dist/esm/provider/app.js +76 -77
  29. package/dist/esm/stores/jsonSchema.js +22 -26
  30. package/dist/esm/stores/route.js +26 -23
  31. package/dist/types/hooks/auth.d.ts +1 -1
  32. package/dist/types/hooks/export.d.ts +2 -3
  33. package/dist/types/hooks/form.d.ts +2 -2
  34. package/dist/types/hooks/formExtend.d.ts +1 -1
  35. package/dist/types/hooks/i18n.d.ts +1 -0
  36. package/dist/types/types/config.d.ts +0 -1
  37. package/dist/types/types/i18n.d.ts +1 -0
  38. package/package.json +1 -1
@@ -1,465 +1,479 @@
1
- import { useQuery as x, useInfiniteQuery as Q, useMutation as A, useQueryClient as k } from "@tanstack/vue-query";
2
- import { toRef as K, computed as h, watch as S, ref as w } from "vue";
3
- import { useGetAuth as q, useError as $ } from "./auth.js";
4
- import { useManage as P } from "./manage.js";
5
- function G(t) {
6
- var E;
7
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = K(t.pagination ? t.pagination : { page: 1, pageSize: 20 }), n = h(() => {
8
- const { onError: s, options: N, pagination: y, ...a } = t;
9
- return a;
1
+ import { useQuery as O, useInfiniteQuery as _, useMutation as C, useQueryClient as G } from "@tanstack/vue-query";
2
+ import { toRef as D, computed as s, watch as A, ref as z } from "vue";
3
+ import { useGetAuth as S, useError as L } from "./auth.js";
4
+ import { useManage as F } from "./manage.js";
5
+ function H(t) {
6
+ var K;
7
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), u = D(t.pagination ? t.pagination : { page: 1, pageSize: 20 }), r = D(t, "sorters", {}), c = D(t, "filters", {}), l = D(t, "meta", {}), o = s(() => {
8
+ const { onError: $, options: v, pagination: P, filters: y, sorters: N, meta: M, ...q } = t;
9
+ return q;
10
10
  });
11
- S(n, () => {
12
- t.pagination && (d.value.page = 1);
11
+ A(o, () => {
12
+ t.pagination && (u.value.page = 1);
13
13
  }, {
14
14
  deep: !0
15
15
  });
16
- const c = h(() => ({
17
- ...n.value,
18
- pagination: t.pagination ? d.value : void 0
19
- })), u = x({
20
- queryKey: [`${(E = i.config) == null ? void 0 : E.name}:${f}:${t.path}`, c],
16
+ const e = s(() => ({
17
+ ...o.value,
18
+ pagination: t.pagination ? u.value : void 0,
19
+ filters: c.value || {},
20
+ sorters: r.value || {},
21
+ meta: l.value || {}
22
+ })), n = O({
23
+ queryKey: [`${(K = i.config) == null ? void 0 : K.name}:${f}:${t.path}`, e.value],
21
24
  queryFn: () => {
22
- var s, N, y;
23
- return (y = (N = (s = i.config) == null ? void 0 : s.dataProvider) == null ? void 0 : N[f]) == null ? void 0 : y.getList(c.value, i, l);
25
+ var $, v, P;
26
+ return (P = (v = ($ = i.config) == null ? void 0 : $.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : P.getList(e.value, i, E);
24
27
  },
25
28
  ...t.options
26
- }), o = h(() => u.isFetching.value);
27
- S(() => u.isError, () => {
28
- var s;
29
- g(u.error), (s = t.onError) == null || s.call(t, u.error);
29
+ }), d = s(() => n.isFetching.value);
30
+ A(n.isError, ($) => {
31
+ var v;
32
+ $ && (h(n.error.value), (v = t == null ? void 0 : t.onError) == null || v.call(t, n.error.value));
30
33
  });
31
- const e = w(void 0), r = w(0), v = w(0);
32
- return S(u.data, (s) => {
33
- var N, y, a, F;
34
- s && (e.value = s, r.value = ((F = (a = (y = (N = i.config) == null ? void 0 : N.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getTotal) == null ? void 0 : F.call(a, s)) || 0, v.value = Math.ceil(r.value / (d.value.pageSize || 20)) || 0);
34
+ const g = z(void 0), T = z(0), k = z(0);
35
+ return A(n.data, ($) => {
36
+ var v, P, y, N;
37
+ $ && (g.value = $, T.value = ((N = (y = (P = (v = i.config) == null ? void 0 : v.dataProvider) == null ? void 0 : P[f]) == null ? void 0 : y.getTotal) == null ? void 0 : N.call(y, $)) || 0, k.value = Math.ceil(T.value / (u.value.pageSize || 20)) || 0);
35
38
  }, {
36
39
  immediate: !0
37
40
  }), {
38
- ...u,
39
- isLoading: o,
40
- data: e,
41
- refetch: u.refetch,
42
- pagination: d,
43
- total: r,
44
- pageCount: v
41
+ ...n,
42
+ isLoading: d,
43
+ data: g,
44
+ refetch: n.refetch,
45
+ pagination: u,
46
+ total: T,
47
+ pageCount: k
45
48
  };
46
49
  }
47
- function R(t) {
48
- var E;
49
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = K(t, "pagination", { page: 1, pageSize: 20 }), n = h(() => {
50
- const { onError: s, options: N, pagination: y, ...a } = t;
51
- return a;
50
+ function J(t) {
51
+ var $;
52
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), u = D(t, "pagination", { page: 1, pageSize: 20 }), r = D(t, "sorters", {}), c = D(t, "filters", {}), l = D(t, "meta", {}), o = s(() => {
53
+ const { onError: v, options: P, pagination: y, filters: N, sorters: M, meta: q, ...w } = t;
54
+ return w;
52
55
  });
53
- S(n, () => {
54
- d.value.page = 1;
56
+ A(o, () => {
57
+ u.value.page = 1;
55
58
  }, {
56
59
  deep: !0
57
60
  });
58
- const c = w(0), u = w(0), o = Q({
59
- queryKey: [`${(E = i.config) == null ? void 0 : E.name}:${f}:${t.path}`, n],
60
- queryFn: ({ pageParam: s }) => {
61
- var N, y, a;
62
- return d.value.page = s, (a = (y = (N = i.config) == null ? void 0 : N.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getList({
63
- ...n.value,
61
+ const e = z(0), n = z(0), d = s(() => ({
62
+ ...o.value,
63
+ filters: c.value || {},
64
+ sorters: r.value || {},
65
+ meta: l.value || {}
66
+ })), g = _({
67
+ queryKey: [`${($ = i.config) == null ? void 0 : $.name}:${f}:${t.path}:infinite`, d.value],
68
+ queryFn: ({ pageParam: v }) => {
69
+ var P, y, N;
70
+ return u.value.page = v, (N = (y = (P = i.config) == null ? void 0 : P.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : N.getList({
71
+ ...d.value,
64
72
  pagination: {
65
- ...d.value,
66
- page: s
73
+ ...u.value,
74
+ page: v
67
75
  }
68
- }, i, l);
76
+ }, i, E);
69
77
  },
70
78
  initialPageParam: 1,
71
- getNextPageParam: (s, N, y) => {
72
- var M, L, D, C, T;
73
- if (!(s != null && s.data) || ((M = s == null ? void 0 : s.data) == null ? void 0 : M.length) === 0)
79
+ getNextPageParam: (v, P, y) => {
80
+ var q, w, Q, I, U;
81
+ if (!(v != null && v.data) || !((q = v == null ? void 0 : v.data) != null && q.length))
74
82
  return;
75
- const a = ((T = (C = (D = (L = i.config) == null ? void 0 : L.dataProvider) == null ? void 0 : D[f]) == null ? void 0 : C.getTotal) == null ? void 0 : T.call(C, s)) || 0;
76
- if (u.value = Math.ceil(a / (d.value.pageSize || 20)) || 0, c.value = a, !(y * (d.value.pageSize || 20) >= a))
83
+ const N = ((U = (I = (Q = (w = i.config) == null ? void 0 : w.dataProvider) == null ? void 0 : Q[f]) == null ? void 0 : I.getTotal) == null ? void 0 : U.call(I, v)) || 0;
84
+ if (n.value = Math.ceil(N / (u.value.pageSize || 20)) || 0, e.value = N, !(y * (u.value.pageSize || 20) >= N))
77
85
  return y + 1;
78
86
  },
79
- getPreviousPageParam: (s, N, y) => {
80
- var F, M, L, D;
87
+ getPreviousPageParam: (v, P, y) => {
88
+ var M, q, w, Q;
81
89
  if (y <= 1)
82
90
  return;
83
- const a = ((D = (L = (M = (F = i.config) == null ? void 0 : F.dataProvider) == null ? void 0 : M[f]) == null ? void 0 : L.getTotal) == null ? void 0 : D.call(L, s)) || 0;
84
- return u.value = Math.ceil(a / (d.value.pageSize || 20)) || 0, c.value = a, y - 1;
91
+ const N = ((Q = (w = (q = (M = i.config) == null ? void 0 : M.dataProvider) == null ? void 0 : q[f]) == null ? void 0 : w.getTotal) == null ? void 0 : Q.call(w, v)) || 0;
92
+ return n.value = Math.ceil(N / (u.value.pageSize || 20)) || 0, e.value = N, y - 1;
85
93
  },
86
94
  ...t.options
87
- }), e = h(() => o.isFetching.value);
88
- S(() => o.isError, () => {
89
- var s;
90
- g(o.error), (s = t.onError) == null || s.call(t, o.error);
95
+ }), T = s(() => g.isFetching.value);
96
+ A(g.isError, (v) => {
97
+ var P;
98
+ v && (h(g.error.value), (P = t == null ? void 0 : t.onError) == null || P.call(t, g.error.value));
91
99
  });
92
- const r = () => {
93
- if (!(!o.hasNextPage.value || o.isFetching.value))
94
- return o.fetchNextPage();
95
- }, v = w(void 0);
96
- return S(o.data, (s) => {
97
- if (!(s != null && s.pages) || s.pages.length === 0)
100
+ const k = () => {
101
+ if (!(!g.hasNextPage.value || g.isFetching.value))
102
+ return g.fetchNextPage();
103
+ }, K = z(void 0);
104
+ return A(g.data, (v) => {
105
+ var N;
106
+ if (!v || !(v != null && v.pages) || !((N = v.pages) != null && N.length))
98
107
  return;
99
- const N = s.pages.reduce((a, F) => F != null && F.data && F.data.length > 0 ? a.concat(F.data) : a, []), y = s.pages[0];
100
- y && (v.value = {
108
+ const P = v.pages.reduce((M, q) => {
109
+ var w;
110
+ return q != null && q.data && Array.isArray(q.data) && ((w = q.data) != null && w.length) ? M.concat(q.data) : M;
111
+ }, []), y = v.pages[0];
112
+ y && (K.value = {
101
113
  ...y,
102
- data: N
114
+ data: P
103
115
  });
104
116
  }, {
105
117
  deep: !0,
106
118
  immediate: !0
107
119
  }), {
108
- ...o,
109
- isLoading: e,
110
- data: v,
111
- fetchNextPage: r,
112
- hasNextPage: o.hasNextPage,
113
- refetch: o.refetch,
114
- pagination: d,
115
- total: c,
116
- pageCount: u
120
+ ...g,
121
+ isLoading: T,
122
+ data: K,
123
+ fetchNextPage: k,
124
+ hasNextPage: g.hasNextPage,
125
+ refetch: g.refetch,
126
+ pagination: u,
127
+ total: e,
128
+ pageCount: n
117
129
  };
118
130
  }
119
- function b(t) {
131
+ function V(t) {
120
132
  var o;
121
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = h(() => {
122
- const { onError: e, options: r, ...v } = t;
123
- return v;
124
- }), n = x({
125
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, d],
133
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), u = s(() => {
134
+ const { onError: e, options: n, ...d } = t;
135
+ return d;
136
+ }), r = O({
137
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, u],
126
138
  queryFn: () => {
127
- var e, r, v;
128
- return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.getOne(d.value, i, l);
139
+ var e, n, d;
140
+ return (d = (n = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : n[f]) == null ? void 0 : d.getOne(u.value, i, E);
129
141
  },
130
142
  ...t.options
131
- }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
132
- S(() => n.isError, () => {
133
- var e;
134
- g(n.error), (e = t.onError) == null || e.call(t, n.error);
143
+ }), c = s(() => r.isFetched.value ? !1 : r.isFetching.value);
144
+ A(r.isError, (e) => {
145
+ var n;
146
+ e && (h(r.error.value), (n = t == null ? void 0 : t.onError) == null || n.call(t, r.error.value));
147
+ }, {
148
+ immediate: !0
135
149
  });
136
- const u = w(void 0);
137
- return S(n.data, (e) => {
138
- e && (u.value = e);
150
+ const l = z(void 0);
151
+ return A(r.data, (e) => {
152
+ e && (l.value = e);
139
153
  }, {
140
154
  immediate: !0
141
155
  }), {
142
- ...n,
156
+ ...r,
143
157
  isLoading: c,
144
- data: u,
145
- refetch: n.refetch
158
+ data: l,
159
+ refetch: r.refetch
146
160
  };
147
161
  }
148
- function j(t) {
162
+ function W(t) {
149
163
  var o;
150
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = h(() => {
151
- const { onError: e, options: r, ...v } = t;
152
- return v;
153
- }), n = x({
154
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, d],
164
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), u = s(() => {
165
+ const { onError: e, options: n, ...d } = t;
166
+ return d;
167
+ }), r = O({
168
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, u],
155
169
  queryFn: () => {
156
- var e, r, v;
157
- return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.getMany(d.value, i, l);
170
+ var e, n, d;
171
+ return (d = (n = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : n[f]) == null ? void 0 : d.getMany(u.value, i, E);
158
172
  },
159
173
  ...t.options
160
- }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
161
- S(() => n.isError, () => {
162
- var e;
163
- g(n.error), (e = t.onError) == null || e.call(t, n.error);
174
+ }), c = s(() => r.isFetched.value ? !1 : r.isFetching.value);
175
+ A(r.isError, (e) => {
176
+ var n;
177
+ e && (h(r.error.value), (n = t == null ? void 0 : t.onError) == null || n.call(t, r.error.value));
164
178
  });
165
- const u = w(void 0);
166
- return S(n.data, (e) => {
167
- e && (u.value = e);
179
+ const l = z(void 0);
180
+ return A(r.data, (e) => {
181
+ e && (l.value = e);
168
182
  }, {
169
183
  immediate: !0
170
184
  }), {
171
- ...n,
185
+ ...r,
172
186
  isLoading: c,
173
- data: u,
174
- refetch: n.refetch
187
+ data: l,
188
+ refetch: r.refetch
175
189
  };
176
190
  }
177
- function B(t) {
178
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
179
- const { onError: o, options: e, ...r } = t;
180
- return r;
181
- }), c = A({
191
+ function X(t) {
192
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
193
+ const { onError: o, options: e, ...n } = t;
194
+ return n;
195
+ }), c = C({
182
196
  mutationFn: (o) => {
183
- var e, r, v, E;
197
+ var e, n, d, g;
184
198
  if (!((e = i.config) != null && e.dataProvider))
185
199
  throw new Error("Data provider is not initialized");
186
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.create({
187
- ...n.value,
200
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.create({
201
+ ...r.value,
188
202
  ...o
189
- }, i, l);
203
+ }, i, E);
190
204
  },
191
205
  onSuccess: (o) => {
192
206
  var e;
193
- (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
207
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
194
208
  },
195
209
  onError: (o) => {
196
210
  var e;
197
- g(o), (e = t.onError) == null || e.call(t, o);
211
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
198
212
  },
199
213
  ...t.options
200
- }), u = h(() => c.isPending.value);
214
+ }), l = s(() => c.isPending.value);
201
215
  return {
202
216
  ...c,
203
- isLoading: u,
217
+ isLoading: l,
204
218
  mutate: c.mutate
205
219
  };
206
220
  }
207
- function H(t) {
208
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
209
- const { onError: o, options: e, ...r } = t;
210
- return r;
211
- }), c = A({
221
+ function Y(t) {
222
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
223
+ const { onError: o, options: e, ...n } = t;
224
+ return n;
225
+ }), c = C({
212
226
  mutationFn: (o) => {
213
- var e, r, v, E;
227
+ var e, n, d, g;
214
228
  if (!((e = i.config) != null && e.dataProvider))
215
229
  throw new Error("Data provider is not initialized");
216
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.createMany({
217
- ...n.value,
230
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.createMany({
231
+ ...r.value,
218
232
  ...o
219
- }, i, l);
233
+ }, i, E);
220
234
  },
221
235
  onSuccess: (o) => {
222
236
  var e;
223
- (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
237
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
224
238
  },
225
239
  onError: (o) => {
226
240
  var e;
227
- g(o), (e = t.onError) == null || e.call(t, o);
241
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
228
242
  },
229
243
  ...t.options
230
- }), u = h(() => c.isPending.value);
244
+ }), l = s(() => c.isPending.value);
231
245
  return {
232
246
  ...c,
233
- isLoading: u,
247
+ isLoading: l,
234
248
  mutate: c.mutate
235
249
  };
236
250
  }
237
- function J(t) {
238
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
239
- const { onError: o, options: e, ...r } = t;
240
- return r;
241
- }), c = A({
251
+ function Z(t) {
252
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
253
+ const { onError: o, options: e, ...n } = t;
254
+ return n;
255
+ }), c = C({
242
256
  mutationFn: (o) => {
243
- var e, r, v, E;
257
+ var e, n, d, g;
244
258
  if (!((e = i.config) != null && e.dataProvider))
245
259
  throw new Error("Data provider is not initialized");
246
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.update({
247
- ...n.value,
260
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.update({
261
+ ...r.value,
248
262
  ...o
249
- }, i, l);
263
+ }, i, E);
250
264
  },
251
265
  onSuccess: (o) => {
252
266
  var e;
253
- (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
267
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
254
268
  },
255
269
  onError: (o) => {
256
270
  var e;
257
- g(o), (e = t.onError) == null || e.call(t, o);
271
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
258
272
  },
259
273
  ...t.options
260
- }), u = h(() => c.isPending.value);
274
+ }), l = s(() => c.isPending.value);
261
275
  return {
262
276
  ...c,
263
- isLoading: u,
277
+ isLoading: l,
264
278
  mutate: c.mutate
265
279
  };
266
280
  }
267
- function V(t) {
268
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
269
- const { onError: o, options: e, ...r } = t;
270
- return r;
271
- }), c = A({
281
+ function a(t) {
282
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
283
+ const { onError: o, options: e, ...n } = t;
284
+ return n;
285
+ }), c = C({
272
286
  mutationFn: (o) => {
273
- var e, r, v, E;
287
+ var e, n, d, g;
274
288
  if (!((e = i.config) != null && e.dataProvider))
275
289
  throw new Error("Data provider is not initialized");
276
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.updateMany({
277
- ...n.value,
290
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.updateMany({
291
+ ...r.value,
278
292
  ...o
279
- }, i, l);
293
+ }, i, E);
280
294
  },
281
295
  onSuccess: (o) => {
282
296
  var e;
283
- (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
297
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
284
298
  },
285
299
  onError: (o) => {
286
300
  var e;
287
- g(o), (e = t.onError) == null || e.call(t, o);
301
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
288
302
  },
289
303
  ...t.options
290
- }), u = h(() => c.isPending.value);
304
+ }), l = s(() => c.isPending.value);
291
305
  return {
292
306
  ...c,
293
- isLoading: u,
307
+ isLoading: l,
294
308
  mutate: c.mutate
295
309
  };
296
310
  }
297
- function W(t) {
298
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
299
- const { onError: o, options: e, ...r } = t;
300
- return r;
301
- }), c = A({
311
+ function p(t) {
312
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
313
+ const { onError: o, options: e, ...n } = t;
314
+ return n;
315
+ }), c = C({
302
316
  mutationFn: (o) => {
303
- var e, r, v, E;
317
+ var e, n, d, g;
304
318
  if (!((e = i.config) != null && e.dataProvider))
305
319
  throw new Error("Data provider is not initialized");
306
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.deleteOne({
307
- ...n.value,
320
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.deleteOne({
321
+ ...r.value,
308
322
  ...o
309
- }, i, l);
323
+ }, i, E);
310
324
  },
311
325
  onSuccess: (o) => {
312
326
  var e;
313
- c.reset(), (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
327
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
314
328
  },
315
329
  onError: (o) => {
316
330
  var e;
317
- g(o), (e = t.onError) == null || e.call(t, o);
331
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
318
332
  },
319
333
  ...t.options
320
- }), u = h(() => c.isPending.value);
334
+ }), l = s(() => c.isPending.value);
321
335
  return {
322
336
  ...c,
323
- isLoading: u,
337
+ isLoading: l,
324
338
  mutate: c.mutate
325
339
  };
326
340
  }
327
- function X(t) {
328
- const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
329
- const { onError: o, options: e, ...r } = t;
330
- return r;
331
- }), c = A({
341
+ function m(t) {
342
+ const i = F(), E = S(), f = t.providerName || "default", { mutate: h } = L(), { invalidate: u } = x(), r = s(() => {
343
+ const { onError: o, options: e, ...n } = t;
344
+ return n;
345
+ }), c = C({
332
346
  mutationFn: (o) => {
333
- var e, r, v, E;
347
+ var e, n, d, g;
334
348
  if (!((e = i.config) != null && e.dataProvider))
335
349
  throw new Error("Data provider is not initialized");
336
- return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.deleteMany({
337
- ...n.value,
350
+ return o.path && (t.path = o.path), (g = (d = (n = i.config) == null ? void 0 : n.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : g.deleteMany({
351
+ ...r.value,
338
352
  ...o
339
- }, i, l);
353
+ }, i, E);
340
354
  },
341
355
  onSuccess: (o) => {
342
356
  var e;
343
- (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
357
+ (e = t.onSuccess) == null || e.call(t, o), t.path && u(t.path);
344
358
  },
345
359
  onError: (o) => {
346
360
  var e;
347
- g(o), (e = t.onError) == null || e.call(t, o);
361
+ h(o), (e = t == null ? void 0 : t.onError) == null || e.call(t, o);
348
362
  },
349
363
  ...t.options
350
- }), u = h(() => c.isPending.value);
364
+ }), l = s(() => c.isPending.value);
351
365
  return {
352
366
  ...c,
353
- isLoading: u,
367
+ isLoading: l,
354
368
  mutate: c.mutate
355
369
  };
356
370
  }
357
- function Y(t) {
371
+ function tt(t) {
358
372
  var o;
359
- const i = P(), l = q(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: g } = $(), d = h(() => {
373
+ const i = F(), E = S(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: h } = L(), u = s(() => {
360
374
  if (!t)
361
375
  return {};
362
- const { onError: e, options: r, ...v } = t;
363
- return v;
364
- }), n = x({
365
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t == null ? void 0 : t.path}`, d],
376
+ const { onError: e, options: n, ...d } = t;
377
+ return d;
378
+ }), r = O({
379
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t == null ? void 0 : t.path}`, u],
366
380
  queryFn: () => {
367
- var e, r, v;
368
- return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.custom(d.value, i, l);
381
+ var e, n, d;
382
+ return (d = (n = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : n[f]) == null ? void 0 : d.custom(u.value, i, E);
369
383
  },
370
384
  ...t == null ? void 0 : t.options
371
- }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
372
- S(() => n.isError, () => {
373
- var e;
374
- g(n.error), (e = t == null ? void 0 : t.onError) == null || e.call(t, n.error);
385
+ }), c = s(() => r.isFetched.value ? !1 : r.isFetching.value);
386
+ A(r.isError, (e) => {
387
+ var n;
388
+ e && (h(r.error.value), (n = t == null ? void 0 : t.onError) == null || n.call(t, r.error.value));
375
389
  });
376
- const u = w(void 0);
377
- return S(n.data, (e) => {
378
- e && (u.value = e);
390
+ const l = z(void 0);
391
+ return A(r.data, (e) => {
392
+ e && (l.value = e);
379
393
  }, {
380
394
  immediate: !0
381
395
  }), {
382
- ...n,
396
+ ...r,
383
397
  isLoading: c,
384
- data: u,
385
- refetch: n.refetch
398
+ data: l,
399
+ refetch: r.refetch
386
400
  };
387
401
  }
388
- function Z(t) {
389
- const i = P(), l = q(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: g } = $(), d = h(() => {
402
+ function et(t) {
403
+ const i = F(), E = S(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: h } = L(), u = s(() => {
390
404
  if (!t)
391
405
  return {};
392
- const { onError: u, options: o, ...e } = t;
406
+ const { onError: l, options: o, ...e } = t;
393
407
  return e;
394
- }), n = A({
395
- mutationFn: (u) => {
396
- var o, e, r, v;
408
+ }), r = C({
409
+ mutationFn: (l) => {
410
+ var o, e, n, d;
397
411
  if (!((o = i.config) != null && o.dataProvider))
398
412
  throw new Error("Data provider is not initialized");
399
- return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.custom({
400
- ...d.value,
401
- ...u
402
- }, i, l);
413
+ return (d = (n = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : n[f]) == null ? void 0 : d.custom({
414
+ ...u.value,
415
+ ...l
416
+ }, i, E);
403
417
  },
404
- onSuccess: (u) => {
418
+ onSuccess: (l) => {
405
419
  var o;
406
- n.reset(), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t, u);
420
+ r.reset(), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t, l);
407
421
  },
408
- onError: (u) => {
422
+ onError: (l) => {
409
423
  var o;
410
- g(u), (o = t == null ? void 0 : t.onError) == null || o.call(t, u);
424
+ h(l), (o = t == null ? void 0 : t.onError) == null || o.call(t, l);
411
425
  },
412
426
  ...t == null ? void 0 : t.options
413
- }), c = h(() => n.isPending.value);
427
+ }), c = s(() => r.isPending.value);
414
428
  return {
415
- ...n,
429
+ ...r,
416
430
  isLoading: c,
417
- mutate: n.mutate
431
+ mutate: r.mutate
418
432
  };
419
433
  }
420
- function p() {
421
- const t = P(), i = q();
434
+ function ot() {
435
+ const t = F(), i = S();
422
436
  return {
423
437
  request: (f) => {
424
- var d, n, c, u;
425
- if (!((d = t.config) != null && d.dataProvider))
438
+ var u, r, c, l;
439
+ if (!((u = t.config) != null && u.dataProvider))
426
440
  throw new Error("Data provider is not initialized");
427
- const g = f.providerName || "default";
428
- return (u = (c = (n = t.config) == null ? void 0 : n.dataProvider) == null ? void 0 : c[g]) == null ? void 0 : u.custom({
441
+ const h = f.providerName || "default";
442
+ return (l = (c = (r = t.config) == null ? void 0 : r.dataProvider) == null ? void 0 : c[h]) == null ? void 0 : l.custom({
429
443
  ...f
430
444
  }, t, i);
431
445
  }
432
446
  };
433
447
  }
434
- function z() {
435
- const t = k(), i = P();
448
+ function x() {
449
+ const t = G(), i = F();
436
450
  return {
437
- invalidate: (f, g) => {
438
- var n;
439
- let d = f;
440
- Array.isArray(f) || (d = [f]);
441
- for (const c of d) {
442
- const u = `${(n = i.config) == null ? void 0 : n.name}:${g || "default"}:${c}`;
451
+ invalidate: (f, h) => {
452
+ var r;
453
+ let u = f;
454
+ Array.isArray(f) || (u = [f]);
455
+ for (const c of u) {
456
+ const l = `${(r = i.config) == null ? void 0 : r.name}:${h || "default"}:${c}`;
443
457
  t.invalidateQueries({
444
- queryKey: [u]
458
+ queryKey: [l]
445
459
  });
446
460
  }
447
461
  }
448
462
  };
449
463
  }
450
464
  export {
451
- p as useClient,
452
- B as useCreate,
453
- H as useCreateMany,
454
- Y as useCustom,
455
- Z as useCustomMutation,
456
- W as useDelete,
457
- X as useDeleteMany,
458
- R as useInfiniteList,
459
- z as useInvalidate,
460
- G as useList,
461
- j as useMany,
462
- b as useOne,
463
- J as useUpdate,
464
- V as useUpdateMany
465
+ ot as useClient,
466
+ X as useCreate,
467
+ Y as useCreateMany,
468
+ tt as useCustom,
469
+ et as useCustomMutation,
470
+ p as useDelete,
471
+ m as useDeleteMany,
472
+ J as useInfiniteList,
473
+ x as useInvalidate,
474
+ H as useList,
475
+ W as useMany,
476
+ V as useOne,
477
+ Z as useUpdate,
478
+ a as useUpdateMany
465
479
  };