@duxweb/dvha-core 0.1.18 → 0.1.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.
- package/dist/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/json/index.cjs +1 -0
- package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -0
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -0
- package/dist/cjs/hooks/json/vFor.cjs +1 -0
- package/dist/cjs/hooks/json/vIf.cjs +1 -0
- package/dist/cjs/hooks/json/vModel.cjs +1 -0
- package/dist/cjs/hooks/json/vOn.cjs +1 -0
- package/dist/cjs/hooks/json/vShow.cjs +1 -0
- package/dist/cjs/hooks/json/vText.cjs +1 -0
- package/dist/cjs/hooks/json.cjs +1 -0
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +2 -2
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/node_modules/jsep/dist/jsep.cjs +2 -0
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/utils/theme.cjs +1 -1
- package/dist/esm/components/auth/can.js +6 -5
- package/dist/esm/components/overlay/overlay.js +31 -22
- package/dist/esm/directive/permission.js +3 -2
- package/dist/esm/hooks/data.js +96 -96
- package/dist/esm/hooks/json/index.js +23 -0
- package/dist/esm/hooks/json/utils/contextManager.js +31 -0
- package/dist/esm/hooks/json/utils/expressionParser.js +134 -0
- package/dist/esm/hooks/json/vFor.js +57 -0
- package/dist/esm/hooks/json/vIf.js +17 -0
- package/dist/esm/hooks/json/vModel.js +78 -0
- package/dist/esm/hooks/json/vOn.js +32 -0
- package/dist/esm/hooks/json/vShow.js +24 -0
- package/dist/esm/hooks/json/vText.js +54 -0
- package/dist/esm/hooks/json.js +80 -0
- package/dist/esm/hooks/overlay.js +3 -2
- package/dist/esm/hooks/theme.js +62 -62
- package/dist/esm/index.js +107 -91
- package/dist/esm/node_modules/jsep/dist/jsep.js +737 -0
- package/dist/esm/preset/i18nProvider.js +18 -9
- package/dist/esm/provider/app.js +3 -2
- package/dist/esm/utils/theme.js +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/json/index.d.ts +10 -0
- package/dist/types/hooks/json/types.d.ts +29 -0
- package/dist/types/hooks/json/utils/contextManager.d.ts +34 -0
- package/dist/types/hooks/json/utils/expressionParser.d.ts +10 -0
- package/dist/types/hooks/json/vFor.d.ts +2 -0
- package/dist/types/hooks/json/vIf.d.ts +2 -0
- package/dist/types/hooks/json/vModel.d.ts +2 -0
- package/dist/types/hooks/json/vOn.d.ts +2 -0
- package/dist/types/hooks/json/vShow.d.ts +2 -0
- package/dist/types/hooks/json/vText.d.ts +2 -0
- package/dist/types/hooks/json.d.ts +14 -0
- package/dist/types/hooks/overlay.d.ts +4 -0
- package/dist/types/types/data.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/hooks/data.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useGetAuth as E, useError as P } from "./auth.js";
|
|
|
4
4
|
import { useManage as h } from "./manage.js";
|
|
5
5
|
function K(t) {
|
|
6
6
|
var c;
|
|
7
|
-
const
|
|
7
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = S(t.pagination ? t.pagination : { page: 1, pageSize: 20 }), r = a(() => {
|
|
8
8
|
const { onError: n, options: g, pagination: y, ...q } = t;
|
|
9
9
|
return q;
|
|
10
10
|
});
|
|
@@ -13,14 +13,14 @@ function K(t) {
|
|
|
13
13
|
}, {
|
|
14
14
|
deep: !0
|
|
15
15
|
});
|
|
16
|
-
const
|
|
16
|
+
const i = a(() => ({
|
|
17
17
|
...r.value,
|
|
18
18
|
pagination: t.pagination ? s.value : void 0
|
|
19
19
|
})), d = L({
|
|
20
|
-
queryKey: [`${(c =
|
|
20
|
+
queryKey: [`${(c = u.config) == null ? void 0 : c.name}:${v}:${t.path}`, i],
|
|
21
21
|
queryFn: () => {
|
|
22
22
|
var n, g, y;
|
|
23
|
-
return (y = (g = (n =
|
|
23
|
+
return (y = (g = (n = u.config) == null ? void 0 : n.dataProvider) == null ? void 0 : g[v]) == null ? void 0 : y.getList(i.value, u, l);
|
|
24
24
|
},
|
|
25
25
|
...t.options
|
|
26
26
|
}), o = a(() => d.isFetching.value);
|
|
@@ -43,7 +43,7 @@ function K(t) {
|
|
|
43
43
|
}
|
|
44
44
|
function Q(t) {
|
|
45
45
|
var c;
|
|
46
|
-
const
|
|
46
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = S(t.pagination || { page: 1, pageSize: 20 }), r = a(() => {
|
|
47
47
|
const { onError: n, options: g, pagination: y, ...q } = t;
|
|
48
48
|
return q;
|
|
49
49
|
});
|
|
@@ -52,17 +52,17 @@ function Q(t) {
|
|
|
52
52
|
}, {
|
|
53
53
|
deep: !0
|
|
54
54
|
});
|
|
55
|
-
const
|
|
56
|
-
queryKey: [`${(c =
|
|
55
|
+
const i = A({
|
|
56
|
+
queryKey: [`${(c = u.config) == null ? void 0 : c.name}:${v}:${t.path}`, r],
|
|
57
57
|
queryFn: ({ pageParam: n }) => {
|
|
58
58
|
var g, y, q;
|
|
59
|
-
return s.value.page = n, (q = (y = (g =
|
|
59
|
+
return s.value.page = n, (q = (y = (g = u.config) == null ? void 0 : g.dataProvider) == null ? void 0 : y[v]) == null ? void 0 : q.getList({
|
|
60
60
|
...r.value,
|
|
61
61
|
pagination: {
|
|
62
62
|
...s.value,
|
|
63
63
|
page: n
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, u, l);
|
|
66
66
|
},
|
|
67
67
|
initialPageParam: 1,
|
|
68
68
|
getNextPageParam: (n, g, y) => {
|
|
@@ -75,42 +75,42 @@ function Q(t) {
|
|
|
75
75
|
return y - 1;
|
|
76
76
|
},
|
|
77
77
|
...t.options
|
|
78
|
-
}), d = a(() =>
|
|
79
|
-
N(() =>
|
|
78
|
+
}), d = a(() => i.isFetching.value);
|
|
79
|
+
N(() => i.isError, () => {
|
|
80
80
|
var n;
|
|
81
|
-
f(
|
|
81
|
+
f(i.error), (n = t.onError) == null || n.call(t, i.error);
|
|
82
82
|
});
|
|
83
83
|
const o = () => {
|
|
84
|
-
if (!(!
|
|
85
|
-
return
|
|
84
|
+
if (!(!i.hasNextPage.value || i.isFetching.value))
|
|
85
|
+
return i.fetchNextPage();
|
|
86
86
|
}, e = w(void 0);
|
|
87
|
-
return N(
|
|
87
|
+
return N(i.data, (n) => {
|
|
88
88
|
n && (e.value = n);
|
|
89
89
|
}, {
|
|
90
90
|
immediate: !0
|
|
91
91
|
}), {
|
|
92
|
-
...
|
|
92
|
+
...i,
|
|
93
93
|
isLoading: d,
|
|
94
94
|
data: e,
|
|
95
95
|
fetchNextPage: o,
|
|
96
|
-
hasNextPage:
|
|
97
|
-
refetch:
|
|
96
|
+
hasNextPage: i.hasNextPage,
|
|
97
|
+
refetch: i.refetch,
|
|
98
98
|
pagination: s
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
function k(t) {
|
|
102
102
|
var o;
|
|
103
|
-
const
|
|
103
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = a(() => {
|
|
104
104
|
const { onError: e, options: c, ...n } = t;
|
|
105
105
|
return n;
|
|
106
106
|
}), r = L({
|
|
107
|
-
queryKey: [`${(o =
|
|
107
|
+
queryKey: [`${(o = u.config) == null ? void 0 : o.name}:${v}:${t.path}`, s],
|
|
108
108
|
queryFn: () => {
|
|
109
109
|
var e, c, n;
|
|
110
|
-
return (n = (c = (e =
|
|
110
|
+
return (n = (c = (e = u.config) == null ? void 0 : e.dataProvider) == null ? void 0 : c[v]) == null ? void 0 : n.getOne(s.value, u, l);
|
|
111
111
|
},
|
|
112
112
|
...t.options
|
|
113
|
-
}),
|
|
113
|
+
}), i = a(() => r.isFetched.value ? !1 : r.isFetching.value);
|
|
114
114
|
N(() => r.isError, () => {
|
|
115
115
|
var e;
|
|
116
116
|
f(r.error), (e = t.onError) == null || e.call(t, r.error);
|
|
@@ -122,24 +122,24 @@ function k(t) {
|
|
|
122
122
|
immediate: !0
|
|
123
123
|
}), {
|
|
124
124
|
...r,
|
|
125
|
-
isLoading:
|
|
125
|
+
isLoading: i,
|
|
126
126
|
data: d,
|
|
127
127
|
refetch: r.refetch
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
function I(t) {
|
|
131
131
|
var o;
|
|
132
|
-
const
|
|
132
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = a(() => {
|
|
133
133
|
const { onError: e, options: c, ...n } = t;
|
|
134
134
|
return n;
|
|
135
135
|
}), r = L({
|
|
136
|
-
queryKey: [`${(o =
|
|
136
|
+
queryKey: [`${(o = u.config) == null ? void 0 : o.name}:${v}:${t.path}`, s],
|
|
137
137
|
queryFn: () => {
|
|
138
138
|
var e, c, n;
|
|
139
|
-
return (n = (c = (e =
|
|
139
|
+
return (n = (c = (e = u.config) == null ? void 0 : e.dataProvider) == null ? void 0 : c[v]) == null ? void 0 : n.getMany(s.value, u, l);
|
|
140
140
|
},
|
|
141
141
|
...t.options
|
|
142
|
-
}),
|
|
142
|
+
}), i = a(() => r.isFetched.value ? !1 : r.isFetching.value);
|
|
143
143
|
N(() => r.isError, () => {
|
|
144
144
|
var e;
|
|
145
145
|
f(r.error), (e = t.onError) == null || e.call(t, r.error);
|
|
@@ -151,24 +151,24 @@ function I(t) {
|
|
|
151
151
|
immediate: !0
|
|
152
152
|
}), {
|
|
153
153
|
...r,
|
|
154
|
-
isLoading:
|
|
154
|
+
isLoading: i,
|
|
155
155
|
data: d,
|
|
156
156
|
refetch: r.refetch
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
function O(t) {
|
|
160
|
-
const
|
|
160
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
161
161
|
const { onError: o, options: e, ...c } = t;
|
|
162
162
|
return c;
|
|
163
|
-
}),
|
|
163
|
+
}), i = F({
|
|
164
164
|
mutationFn: (o) => {
|
|
165
165
|
var e, c, n, g;
|
|
166
|
-
if (!((e =
|
|
166
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
167
167
|
throw new Error("Data provider is not initialized");
|
|
168
|
-
return (g = (n = (c =
|
|
168
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.create({
|
|
169
169
|
...r.value,
|
|
170
170
|
...o
|
|
171
|
-
},
|
|
171
|
+
}, u, l);
|
|
172
172
|
},
|
|
173
173
|
onSuccess: (o) => {
|
|
174
174
|
var e;
|
|
@@ -179,26 +179,26 @@ function O(t) {
|
|
|
179
179
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
180
180
|
},
|
|
181
181
|
...t.options
|
|
182
|
-
}), d = a(() =>
|
|
182
|
+
}), d = a(() => i.isPending.value);
|
|
183
183
|
return {
|
|
184
|
-
...
|
|
184
|
+
...i,
|
|
185
185
|
isLoading: d,
|
|
186
|
-
mutate:
|
|
186
|
+
mutate: i.mutate
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
function _(t) {
|
|
190
|
-
const
|
|
190
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
191
191
|
const { onError: o, options: e, ...c } = t;
|
|
192
192
|
return c;
|
|
193
|
-
}),
|
|
193
|
+
}), i = F({
|
|
194
194
|
mutationFn: (o) => {
|
|
195
195
|
var e, c, n, g;
|
|
196
|
-
if (!((e =
|
|
196
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
197
197
|
throw new Error("Data provider is not initialized");
|
|
198
|
-
return (g = (n = (c =
|
|
198
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.createMany({
|
|
199
199
|
...r.value,
|
|
200
200
|
...o
|
|
201
|
-
},
|
|
201
|
+
}, u, l);
|
|
202
202
|
},
|
|
203
203
|
onSuccess: (o) => {
|
|
204
204
|
var e;
|
|
@@ -209,26 +209,26 @@ function _(t) {
|
|
|
209
209
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
210
210
|
},
|
|
211
211
|
...t.options
|
|
212
|
-
}), d = a(() =>
|
|
212
|
+
}), d = a(() => i.isPending.value);
|
|
213
213
|
return {
|
|
214
|
-
...
|
|
214
|
+
...i,
|
|
215
215
|
isLoading: d,
|
|
216
|
-
mutate:
|
|
216
|
+
mutate: i.mutate
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
219
|
function U(t) {
|
|
220
|
-
const
|
|
220
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
221
221
|
const { onError: o, options: e, ...c } = t;
|
|
222
222
|
return c;
|
|
223
|
-
}),
|
|
223
|
+
}), i = F({
|
|
224
224
|
mutationFn: (o) => {
|
|
225
225
|
var e, c, n, g;
|
|
226
|
-
if (!((e =
|
|
226
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
227
227
|
throw new Error("Data provider is not initialized");
|
|
228
|
-
return (g = (n = (c =
|
|
228
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.update({
|
|
229
229
|
...r.value,
|
|
230
230
|
...o
|
|
231
|
-
},
|
|
231
|
+
}, u, l);
|
|
232
232
|
},
|
|
233
233
|
onSuccess: (o) => {
|
|
234
234
|
var e;
|
|
@@ -239,26 +239,26 @@ function U(t) {
|
|
|
239
239
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
240
240
|
},
|
|
241
241
|
...t.options
|
|
242
|
-
}), d = a(() =>
|
|
242
|
+
}), d = a(() => i.isPending.value);
|
|
243
243
|
return {
|
|
244
|
-
...
|
|
244
|
+
...i,
|
|
245
245
|
isLoading: d,
|
|
246
|
-
mutate:
|
|
246
|
+
mutate: i.mutate
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
function G(t) {
|
|
250
|
-
const
|
|
250
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
251
251
|
const { onError: o, options: e, ...c } = t;
|
|
252
252
|
return c;
|
|
253
|
-
}),
|
|
253
|
+
}), i = F({
|
|
254
254
|
mutationFn: (o) => {
|
|
255
255
|
var e, c, n, g;
|
|
256
|
-
if (!((e =
|
|
256
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
257
257
|
throw new Error("Data provider is not initialized");
|
|
258
|
-
return (g = (n = (c =
|
|
258
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.updateMany({
|
|
259
259
|
...r.value,
|
|
260
260
|
...o
|
|
261
|
-
},
|
|
261
|
+
}, u, l);
|
|
262
262
|
},
|
|
263
263
|
onSuccess: (o) => {
|
|
264
264
|
var e;
|
|
@@ -269,56 +269,56 @@ function G(t) {
|
|
|
269
269
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
270
270
|
},
|
|
271
271
|
...t.options
|
|
272
|
-
}), d = a(() =>
|
|
272
|
+
}), d = a(() => i.isPending.value);
|
|
273
273
|
return {
|
|
274
|
-
...
|
|
274
|
+
...i,
|
|
275
275
|
isLoading: d,
|
|
276
|
-
mutate:
|
|
276
|
+
mutate: i.mutate
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
279
|
function R(t) {
|
|
280
|
-
const
|
|
280
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
281
281
|
const { onError: o, options: e, ...c } = t;
|
|
282
282
|
return c;
|
|
283
|
-
}),
|
|
283
|
+
}), i = F({
|
|
284
284
|
mutationFn: (o) => {
|
|
285
285
|
var e, c, n, g;
|
|
286
|
-
if (!((e =
|
|
286
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
287
287
|
throw new Error("Data provider is not initialized");
|
|
288
|
-
return (g = (n = (c =
|
|
288
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.deleteOne({
|
|
289
289
|
...r.value,
|
|
290
290
|
...o
|
|
291
|
-
},
|
|
291
|
+
}, u, l);
|
|
292
292
|
},
|
|
293
293
|
onSuccess: (o) => {
|
|
294
294
|
var e;
|
|
295
|
-
(e = t.onSuccess) == null || e.call(t, o), t.path && s(t.path);
|
|
295
|
+
i.reset(), (e = t.onSuccess) == null || e.call(t, o), t.path && s(t.path);
|
|
296
296
|
},
|
|
297
297
|
onError: (o) => {
|
|
298
298
|
var e;
|
|
299
299
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
300
300
|
},
|
|
301
301
|
...t.options
|
|
302
|
-
}), d = a(() =>
|
|
302
|
+
}), d = a(() => i.isPending.value);
|
|
303
303
|
return {
|
|
304
|
-
...
|
|
304
|
+
...i,
|
|
305
305
|
isLoading: d,
|
|
306
|
-
mutate:
|
|
306
|
+
mutate: i.mutate
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
function b(t) {
|
|
310
|
-
const
|
|
310
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), { invalidate: s } = $(), r = a(() => {
|
|
311
311
|
const { onError: o, options: e, ...c } = t;
|
|
312
312
|
return c;
|
|
313
|
-
}),
|
|
313
|
+
}), i = F({
|
|
314
314
|
mutationFn: (o) => {
|
|
315
315
|
var e, c, n, g;
|
|
316
|
-
if (!((e =
|
|
316
|
+
if (!((e = u.config) != null && e.dataProvider))
|
|
317
317
|
throw new Error("Data provider is not initialized");
|
|
318
|
-
return (g = (n = (c =
|
|
318
|
+
return (g = (n = (c = u.config) == null ? void 0 : c.dataProvider) == null ? void 0 : n[v]) == null ? void 0 : g.deleteMany({
|
|
319
319
|
...r.value,
|
|
320
320
|
...o
|
|
321
|
-
},
|
|
321
|
+
}, u, l);
|
|
322
322
|
},
|
|
323
323
|
onSuccess: (o) => {
|
|
324
324
|
var e;
|
|
@@ -329,26 +329,26 @@ function b(t) {
|
|
|
329
329
|
f(o), (e = t.onError) == null || e.call(t, o);
|
|
330
330
|
},
|
|
331
331
|
...t.options
|
|
332
|
-
}), d = a(() =>
|
|
332
|
+
}), d = a(() => i.isPending.value);
|
|
333
333
|
return {
|
|
334
|
-
...
|
|
334
|
+
...i,
|
|
335
335
|
isLoading: d,
|
|
336
|
-
mutate:
|
|
336
|
+
mutate: i.mutate
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
function j(t) {
|
|
340
340
|
var o;
|
|
341
|
-
const
|
|
341
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = a(() => {
|
|
342
342
|
const { onError: e, options: c, ...n } = t;
|
|
343
343
|
return n;
|
|
344
344
|
}), r = L({
|
|
345
|
-
queryKey: [`${(o =
|
|
345
|
+
queryKey: [`${(o = u.config) == null ? void 0 : o.name}:${v}:${t.path}`, s],
|
|
346
346
|
queryFn: () => {
|
|
347
347
|
var e, c, n;
|
|
348
|
-
return (n = (c = (e =
|
|
348
|
+
return (n = (c = (e = u.config) == null ? void 0 : e.dataProvider) == null ? void 0 : c[v]) == null ? void 0 : n.custom(s.value, u, l);
|
|
349
349
|
},
|
|
350
350
|
...t.options
|
|
351
|
-
}),
|
|
351
|
+
}), i = a(() => r.isFetched.value ? !1 : r.isFetching.value);
|
|
352
352
|
N(() => r.isError, () => {
|
|
353
353
|
var e;
|
|
354
354
|
f(r.error), (e = t.onError) == null || e.call(t, r.error);
|
|
@@ -360,64 +360,64 @@ function j(t) {
|
|
|
360
360
|
immediate: !0
|
|
361
361
|
}), {
|
|
362
362
|
...r,
|
|
363
|
-
isLoading:
|
|
363
|
+
isLoading: i,
|
|
364
364
|
data: d,
|
|
365
365
|
refetch: r.refetch
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
function B(t) {
|
|
369
|
-
const
|
|
369
|
+
const u = h(), l = E(), v = t.providerName || "default", { mutate: f } = P(), s = a(() => {
|
|
370
370
|
const { onError: d, options: o, ...e } = t;
|
|
371
371
|
return e;
|
|
372
372
|
}), r = F({
|
|
373
373
|
mutationFn: (d) => {
|
|
374
374
|
var o, e, c, n;
|
|
375
|
-
if (!((o =
|
|
375
|
+
if (!((o = u.config) != null && o.dataProvider))
|
|
376
376
|
throw new Error("Data provider is not initialized");
|
|
377
|
-
return (n = (c = (e =
|
|
377
|
+
return (n = (c = (e = u.config) == null ? void 0 : e.dataProvider) == null ? void 0 : c[v]) == null ? void 0 : n.custom({
|
|
378
378
|
...s.value,
|
|
379
379
|
...d
|
|
380
|
-
},
|
|
380
|
+
}, u, l);
|
|
381
381
|
},
|
|
382
382
|
onSuccess: (d) => {
|
|
383
383
|
var o;
|
|
384
|
-
(o = t.onSuccess) == null || o.call(t, d);
|
|
384
|
+
r.reset(), (o = t.onSuccess) == null || o.call(t, d);
|
|
385
385
|
},
|
|
386
386
|
onError: (d) => {
|
|
387
387
|
var o;
|
|
388
388
|
f(d), (o = t.onError) == null || o.call(t, d);
|
|
389
389
|
},
|
|
390
390
|
...t.options
|
|
391
|
-
}),
|
|
391
|
+
}), i = a(() => r.isPending.value);
|
|
392
392
|
return {
|
|
393
393
|
...r,
|
|
394
|
-
isLoading:
|
|
394
|
+
isLoading: i,
|
|
395
395
|
mutate: r.mutate
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
function H() {
|
|
399
|
-
const t = h(),
|
|
399
|
+
const t = h(), u = E();
|
|
400
400
|
return {
|
|
401
401
|
request: (v) => {
|
|
402
|
-
var s, r,
|
|
402
|
+
var s, r, i, d;
|
|
403
403
|
if (!((s = t.config) != null && s.dataProvider))
|
|
404
404
|
throw new Error("Data provider is not initialized");
|
|
405
405
|
const f = v.providerName || "default";
|
|
406
|
-
return (d = (
|
|
406
|
+
return (d = (i = (r = t.config) == null ? void 0 : r.dataProvider) == null ? void 0 : i[f]) == null ? void 0 : d.custom({
|
|
407
407
|
...v
|
|
408
|
-
}, t,
|
|
408
|
+
}, t, u);
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
function $() {
|
|
413
|
-
const t = M(),
|
|
413
|
+
const t = M(), u = h();
|
|
414
414
|
return {
|
|
415
415
|
invalidate: (v, f) => {
|
|
416
416
|
var r;
|
|
417
417
|
let s = v;
|
|
418
418
|
Array.isArray(v) || (s = [v]);
|
|
419
|
-
for (const
|
|
420
|
-
const d = `${(r =
|
|
419
|
+
for (const i of s) {
|
|
420
|
+
const d = `${(r = u.config) == null ? void 0 : r.name}:${f || "default"}:${i}`;
|
|
421
421
|
t.invalidateQueries({
|
|
422
422
|
queryKey: [d]
|
|
423
423
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { vForAdaptor as t } from "./vFor.js";
|
|
2
|
+
import { vIfAdaptor as p } from "./vIf.js";
|
|
3
|
+
import { vModelAdaptor as m } from "./vModel.js";
|
|
4
|
+
import { vOnAdaptor as i } from "./vOn.js";
|
|
5
|
+
import { vShowAdaptor as d } from "./vShow.js";
|
|
6
|
+
import { vTextAdaptor as a } from "./vText.js";
|
|
7
|
+
const n = [
|
|
8
|
+
p,
|
|
9
|
+
d,
|
|
10
|
+
t,
|
|
11
|
+
m,
|
|
12
|
+
i,
|
|
13
|
+
a
|
|
14
|
+
].sort((o, r) => r.priority - o.priority);
|
|
15
|
+
export {
|
|
16
|
+
n as defaultAdaptors,
|
|
17
|
+
t as vForAdaptor,
|
|
18
|
+
p as vIfAdaptor,
|
|
19
|
+
m as vModelAdaptor,
|
|
20
|
+
i as vOnAdaptor,
|
|
21
|
+
d as vShowAdaptor,
|
|
22
|
+
a as vTextAdaptor
|
|
23
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
return e._context || {};
|
|
3
|
+
}
|
|
4
|
+
function c(e, n) {
|
|
5
|
+
return Object.keys(n).length === 0 ? e : {
|
|
6
|
+
...e,
|
|
7
|
+
_context: n
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function u(e) {
|
|
11
|
+
const { _context: n, ...t } = e;
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
function a(e, n = {}) {
|
|
15
|
+
const t = { ...e };
|
|
16
|
+
return n.cleanKeys && n.cleanKeys.forEach((r) => delete t[r]), {
|
|
17
|
+
props: t,
|
|
18
|
+
skip: n.skip,
|
|
19
|
+
nodes: n.nodes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function i(e, n, t) {
|
|
23
|
+
return typeof e == "string" ? !!t(e, n) : !!e;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
u as cleanProps,
|
|
27
|
+
a as createAdaptorResult,
|
|
28
|
+
i as evaluateCondition,
|
|
29
|
+
o as extractContext,
|
|
30
|
+
c as injectContext
|
|
31
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import p from "../../../node_modules/jsep/dist/jsep.js";
|
|
2
|
+
import { unref as c } from "vue";
|
|
3
|
+
p.addIdentifierChar("$");
|
|
4
|
+
p.addIdentifierChar("@");
|
|
5
|
+
function y(r) {
|
|
6
|
+
try {
|
|
7
|
+
return p(r);
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return console.warn(`Expression parsing failed: ${r}`, e), null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function m(r, e) {
|
|
13
|
+
const n = y(r);
|
|
14
|
+
if (n)
|
|
15
|
+
return i(n, e);
|
|
16
|
+
}
|
|
17
|
+
function i(r, e) {
|
|
18
|
+
var n, l;
|
|
19
|
+
if (!(!r || typeof r != "object"))
|
|
20
|
+
switch (r.type) {
|
|
21
|
+
case "Literal":
|
|
22
|
+
return r.value;
|
|
23
|
+
case "Identifier":
|
|
24
|
+
return v(e, r.name);
|
|
25
|
+
case "MemberExpression": {
|
|
26
|
+
const t = i(r.object, e);
|
|
27
|
+
if (t == null)
|
|
28
|
+
return;
|
|
29
|
+
const s = r.computed ? i(r.property, e) : (n = r.property) == null ? void 0 : n.name, a = c(t);
|
|
30
|
+
return a == null ? void 0 : a[s];
|
|
31
|
+
}
|
|
32
|
+
case "BinaryExpression": {
|
|
33
|
+
const t = i(r.left, e), s = i(r.right, e), a = {
|
|
34
|
+
"+": () => t + s,
|
|
35
|
+
"-": () => t - s,
|
|
36
|
+
"*": () => t * s,
|
|
37
|
+
"/": () => t / s,
|
|
38
|
+
"%": () => t % s,
|
|
39
|
+
"==": () => t === s,
|
|
40
|
+
"===": () => t === s,
|
|
41
|
+
"!=": () => t !== s,
|
|
42
|
+
"!==": () => t !== s,
|
|
43
|
+
"<": () => t < s,
|
|
44
|
+
">": () => t > s,
|
|
45
|
+
"<=": () => t <= s,
|
|
46
|
+
">=": () => t >= s
|
|
47
|
+
};
|
|
48
|
+
return ((l = a[r.operator]) == null ? void 0 : l.call(a)) ?? void 0;
|
|
49
|
+
}
|
|
50
|
+
case "LogicalExpression": {
|
|
51
|
+
const t = i(r.left, e);
|
|
52
|
+
return r.operator === "&&" ? t && i(r.right, e) : r.operator === "||" ? t || i(r.right, e) : r.operator === "??" ? t ?? i(r.right, e) : void 0;
|
|
53
|
+
}
|
|
54
|
+
case "UnaryExpression": {
|
|
55
|
+
const t = i(r.argument, e);
|
|
56
|
+
return r.operator === "!" ? !t : r.operator === "-" ? -t : r.operator === "+" ? +t : void 0;
|
|
57
|
+
}
|
|
58
|
+
case "ConditionalExpression": {
|
|
59
|
+
const t = i(r.test, e);
|
|
60
|
+
return i(t ? r.consequent : r.alternate, e);
|
|
61
|
+
}
|
|
62
|
+
case "CallExpression": {
|
|
63
|
+
const t = i(r.callee, e), s = c(t);
|
|
64
|
+
if (typeof s != "function") {
|
|
65
|
+
console.warn("Attempting to call non-function value:", s);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const a = Array.isArray(r.arguments) ? r.arguments.map((u) => {
|
|
69
|
+
const o = i(u, e);
|
|
70
|
+
return c(o);
|
|
71
|
+
}) : [];
|
|
72
|
+
try {
|
|
73
|
+
let u;
|
|
74
|
+
if (r.callee.type === "MemberExpression") {
|
|
75
|
+
const o = i(r.callee.object, e);
|
|
76
|
+
u = c(o);
|
|
77
|
+
}
|
|
78
|
+
return s.apply(u, a);
|
|
79
|
+
} catch (u) {
|
|
80
|
+
console.warn("Function call error:", u);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
case "ArrayExpression":
|
|
85
|
+
return Array.isArray(r.elements) ? r.elements.map((t) => {
|
|
86
|
+
if (!t)
|
|
87
|
+
return;
|
|
88
|
+
const s = i(t, e);
|
|
89
|
+
return c(s);
|
|
90
|
+
}) : [];
|
|
91
|
+
default:
|
|
92
|
+
console.warn(`Unsupported expression type: ${r.type}`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function v(r, e) {
|
|
97
|
+
if (!(!e || !r))
|
|
98
|
+
try {
|
|
99
|
+
return e.split(".").reduce((n, l) => {
|
|
100
|
+
if (n == null)
|
|
101
|
+
return;
|
|
102
|
+
const t = c(n);
|
|
103
|
+
return t == null ? void 0 : t[l];
|
|
104
|
+
}, r);
|
|
105
|
+
} catch {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function g(r, e) {
|
|
110
|
+
const n = r.trim(), l = n.match(/^\((\w+),\s*(\w+)\) in (.+)$/);
|
|
111
|
+
if (l) {
|
|
112
|
+
const [, s, a, u] = l, o = m(u, e), f = c(o);
|
|
113
|
+
return {
|
|
114
|
+
items: Array.isArray(f) ? f : [],
|
|
115
|
+
itemName: s,
|
|
116
|
+
indexName: a
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const t = n.match(/^(\w+) in (.+)$/);
|
|
120
|
+
if (t) {
|
|
121
|
+
const [, s, a] = t, u = m(a, e), o = c(u);
|
|
122
|
+
return {
|
|
123
|
+
items: Array.isArray(o) ? o : [],
|
|
124
|
+
itemName: s,
|
|
125
|
+
indexName: "index"
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
throw new Error(`Invalid v-for expression: ${r}`);
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
m as evaluateExpression,
|
|
132
|
+
y as parseExpression,
|
|
133
|
+
g as parseVForExpression
|
|
134
|
+
};
|