@duxweb/dvha-core 0.1.17 → 0.1.19

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