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