@progress/kendo-react-data-tools 17.1.0-develop.6 → 17.1.0-develop.7
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/clipboard/common.d.ts +17 -3
- package/clipboard/common.js +7 -6
- package/clipboard/common.mjs +97 -80
- package/data-source/use-odata-data-source.js +1 -1
- package/data-source/use-odata-data-source.mjs +22 -17
- package/data-source/use-remote-data-source.js +1 -1
- package/data-source/use-remote-data-source.mjs +89 -89
- package/dist/cdn/js/kendo-react-datatools.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { validatePackage as Me, deepMerge as le, getter as
|
|
9
|
+
import { validatePackage as Me, deepMerge as le, getter as ce, useImmediateInheritState as V, clone as ue } from "@progress/kendo-react-common";
|
|
10
10
|
import { useDataSource as Te } from "./use-data-source.mjs";
|
|
11
11
|
import { packageMetadata as be } from "../package-metadata.mjs";
|
|
12
|
-
const De = { data: (
|
|
12
|
+
const De = { data: (p) => p, total: (p) => p.length }, Se = {
|
|
13
13
|
create: {
|
|
14
14
|
method: "POST",
|
|
15
15
|
contentType: "application/json"
|
|
@@ -24,15 +24,15 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
24
24
|
delete: {
|
|
25
25
|
method: "DELETE"
|
|
26
26
|
}
|
|
27
|
-
}, B = (
|
|
28
|
-
const _ = typeof
|
|
27
|
+
}, B = (p, A) => {
|
|
28
|
+
const _ = typeof p == "function" ? p(A) : p;
|
|
29
29
|
return new URL(_);
|
|
30
|
-
}, C = (
|
|
30
|
+
}, C = (p, A, _) => typeof p == "function" ? p(A) : _ || p ? { ..._, ...p } : void 0, H = (p, A) => {
|
|
31
31
|
typeof A == "object" ? Object.keys(A).forEach((_) => {
|
|
32
|
-
|
|
33
|
-
}) : typeof A == "string" && (
|
|
32
|
+
p.searchParams.append(_, A[_]);
|
|
33
|
+
}) : typeof A == "string" && (p.search = A);
|
|
34
34
|
}, K = async ({
|
|
35
|
-
url:
|
|
35
|
+
url: p,
|
|
36
36
|
method: A,
|
|
37
37
|
contentType: _,
|
|
38
38
|
body: Q,
|
|
@@ -40,7 +40,7 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
40
40
|
onSuccess: W
|
|
41
41
|
}) => {
|
|
42
42
|
var M;
|
|
43
|
-
const N = await fetch(
|
|
43
|
+
const N = await fetch(p, {
|
|
44
44
|
method: A,
|
|
45
45
|
headers: _ ? { "Content-Type": _ } : {},
|
|
46
46
|
...Q ? { body: JSON.stringify(Q) } : {}
|
|
@@ -48,7 +48,7 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
48
48
|
return N.ok ? W(
|
|
49
49
|
(M = N.headers.get("Content-Type")) != null && M.includes("application/json") ? await N.json() : await N.text()
|
|
50
50
|
) : L == null ? void 0 : L(await N.json());
|
|
51
|
-
}, Ie = (
|
|
51
|
+
}, Ie = (p) => {
|
|
52
52
|
Me(be, { component: "useRemoteDataSource" });
|
|
53
53
|
const {
|
|
54
54
|
defaultTotal: A,
|
|
@@ -57,18 +57,18 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
57
57
|
serverPaging: L = !0,
|
|
58
58
|
serverGrouping: W = !0,
|
|
59
59
|
...N
|
|
60
|
-
} =
|
|
60
|
+
} = p, M = le({}, De, p.schema), t = le(
|
|
61
61
|
{},
|
|
62
62
|
Se,
|
|
63
|
-
|
|
64
|
-
), de = typeof M.data == "function" ? M.data : M.data ?
|
|
65
|
-
}, g =
|
|
63
|
+
p.transport
|
|
64
|
+
), de = typeof M.data == "function" ? M.data : M.data ? ce(M.data) : (a) => a, ie = typeof M.total == "function" ? M.total : M.total ? ce(M.total) : (a) => a, c = typeof M.errors == "function" ? (a) => M.errors(a) : M.errors ? ce(M.errors) : (a) => {
|
|
65
|
+
}, g = ce(String(M.model.id)), F = V(/* @__PURE__ */ new Map(), p.reads), b = V(/* @__PURE__ */ new Map(), p.creates), R = V(/* @__PURE__ */ new Map(), p.updates), x = V(/* @__PURE__ */ new Map(), p.deletes), f = V(/* @__PURE__ */ new Map()), S = V(/* @__PURE__ */ new Map()), ne = (a) => {
|
|
66
66
|
F.value = a;
|
|
67
67
|
}, X = (a) => {
|
|
68
68
|
b.value = a;
|
|
69
69
|
}, oe = (a) => {
|
|
70
70
|
R.value = a;
|
|
71
|
-
},
|
|
71
|
+
}, re = (a) => {
|
|
72
72
|
x.value = a;
|
|
73
73
|
}, q = (a) => {
|
|
74
74
|
f.value = a;
|
|
@@ -100,51 +100,51 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
100
100
|
n && (o = g(n)), S.value.has(o) || S.value.set(o, []);
|
|
101
101
|
const s = S.value.get(o) || [];
|
|
102
102
|
s.push(e), S.value.set(o, s), Y(new Map(S.value));
|
|
103
|
-
},
|
|
103
|
+
}, pe = (a) => {
|
|
104
104
|
const { error: e } = a;
|
|
105
105
|
S.value.forEach((n, o) => {
|
|
106
|
-
const s = n.filter((
|
|
106
|
+
const s = n.filter((v) => v !== e);
|
|
107
107
|
s.length === 0 ? S.value.delete(o) : S.value.set(o, s);
|
|
108
108
|
}), Y(new Map(S.value));
|
|
109
|
-
},
|
|
109
|
+
}, ve = (a) => {
|
|
110
110
|
const { data: e } = a, n = g(e);
|
|
111
111
|
S.value.delete(n), Y(new Map(S.value));
|
|
112
112
|
}, fe = () => {
|
|
113
113
|
S.value.clear(), Y(new Map(S.value));
|
|
114
|
-
},
|
|
114
|
+
}, ye = (a) => {
|
|
115
115
|
const { data: e } = a, n = g(e);
|
|
116
116
|
b.value.set(n, e), X(new Map(b.value));
|
|
117
117
|
const o = new Set(Object.keys(e).filter((s) => {
|
|
118
|
-
var
|
|
119
|
-
return s !== ((
|
|
118
|
+
var v;
|
|
119
|
+
return s !== ((v = M.model) == null ? void 0 : v.id);
|
|
120
120
|
}));
|
|
121
121
|
f.value.set(n, o), q(new Map(f.value));
|
|
122
|
-
},
|
|
122
|
+
}, we = (a) => {
|
|
123
123
|
const { data: e, field: n } = a, o = g(e);
|
|
124
124
|
if (b.value.has(o)) {
|
|
125
125
|
const d = b.value.get(o);
|
|
126
126
|
b.value.set(o, { ...d, ...e }), X(new Map(b.value));
|
|
127
|
-
const
|
|
128
|
-
n ?
|
|
127
|
+
const r = f.value.get(o) || /* @__PURE__ */ new Set();
|
|
128
|
+
n ? r.add(n) : Object.keys(e).forEach((P) => {
|
|
129
129
|
var m;
|
|
130
|
-
P !== ((m = M.model) == null ? void 0 : m.id) &&
|
|
131
|
-
}), f.value.set(o,
|
|
130
|
+
P !== ((m = M.model) == null ? void 0 : m.id) && r.add(P);
|
|
131
|
+
}), f.value.set(o, r), q(new Map(f.value));
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
const s = R.value.has(o) ? R.value.get(o) : F.value.has(o) ? F.value.get(o) : {};
|
|
135
135
|
R.value.set(o, { ...s, ...e }), oe(new Map(R.value));
|
|
136
|
-
const
|
|
137
|
-
n ?
|
|
138
|
-
var
|
|
139
|
-
d !== ((
|
|
140
|
-
}), f.value.set(o,
|
|
136
|
+
const v = f.value.get(o) || /* @__PURE__ */ new Set();
|
|
137
|
+
n ? v.add(n) : Object.keys(e).forEach((d) => {
|
|
138
|
+
var r;
|
|
139
|
+
d !== ((r = M.model) == null ? void 0 : r.id) && v.add(d);
|
|
140
|
+
}), f.value.set(o, v), q(new Map(f.value));
|
|
141
141
|
}, me = (a) => {
|
|
142
142
|
const { data: e } = a, n = g(e);
|
|
143
143
|
if (b.value.has(n)) {
|
|
144
144
|
b.value.delete(n), X(new Map(b.value)), f.value.delete(n), q(new Map(f.value));
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
x.value.set(n, e),
|
|
147
|
+
x.value.set(n, e), re(new Map(x.value));
|
|
148
148
|
}, Z = (a) => {
|
|
149
149
|
const { data: e } = a, n = g(e);
|
|
150
150
|
b.value.delete(n), X(new Map(b.value)), f.value.delete(n), q(new Map(f.value));
|
|
@@ -158,7 +158,7 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
158
158
|
R.value.delete(o), oe(new Map(R.value)), f.value.delete(o), q(new Map(f.value));
|
|
159
159
|
}, E = (a) => {
|
|
160
160
|
const { data: e } = a, n = g(e);
|
|
161
|
-
x.value.delete(n),
|
|
161
|
+
x.value.delete(n), re(new Map(x.value)), f.value.delete(n), q(new Map(f.value));
|
|
162
162
|
}, ee = (a) => {
|
|
163
163
|
const { data: e } = a, n = g(e);
|
|
164
164
|
F.value.set(n, e), ne(new Map(F.value));
|
|
@@ -190,21 +190,21 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
190
190
|
},
|
|
191
191
|
// CRUD operations
|
|
192
192
|
addError: k,
|
|
193
|
-
removeError:
|
|
194
|
-
removeErrors:
|
|
193
|
+
removeError: pe,
|
|
194
|
+
removeErrors: ve,
|
|
195
195
|
removeAllErrors: fe,
|
|
196
196
|
read: async (a) => {
|
|
197
|
-
var
|
|
197
|
+
var y, O, h, w, J, I, G;
|
|
198
198
|
if (!(t != null && t.read))
|
|
199
199
|
throw new Error("transport.read is not defined");
|
|
200
|
-
const e = (
|
|
200
|
+
const e = (y = a == null ? void 0 : a.filter) != null ? y : z.filter, n = (O = a == null ? void 0 : a.skip) != null ? O : z.skip, o = (h = a == null ? void 0 : a.take) != null ? h : z.take, s = (w = a == null ? void 0 : a.sort) != null ? w : z.sort, v = (J = a == null ? void 0 : a.group) != null ? J : z.group;
|
|
201
201
|
if (typeof t.read == "function") {
|
|
202
202
|
const T = await t.read({
|
|
203
203
|
..._ && e !== void 0 && { filter: e },
|
|
204
204
|
...L && n !== void 0 && { skip: n },
|
|
205
205
|
...L && o !== void 0 && { take: o },
|
|
206
206
|
...Q && s !== void 0 && { sort: s },
|
|
207
|
-
...W &&
|
|
207
|
+
...W && v !== void 0 && { group: v }
|
|
208
208
|
});
|
|
209
209
|
return se(T), T;
|
|
210
210
|
}
|
|
@@ -213,21 +213,21 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
213
213
|
...L && n !== void 0 && { skip: n },
|
|
214
214
|
...L && o !== void 0 && { take: o },
|
|
215
215
|
...Q && s !== void 0 && { sort: s },
|
|
216
|
-
...W &&
|
|
217
|
-
},
|
|
216
|
+
...W && v !== void 0 && { group: v }
|
|
217
|
+
}, r = B(t.read.url), P = t.read.onError, m = t.read.onResponse, j = t.read.onSuccess, D = C(t.read.data), u = ((G = (I = t.read).parameterMap) == null ? void 0 : G.call(I, { ...d, ...D })) || {
|
|
218
218
|
...d,
|
|
219
219
|
...D
|
|
220
220
|
};
|
|
221
|
-
H(
|
|
221
|
+
H(r, u);
|
|
222
222
|
try {
|
|
223
223
|
const T = await K({
|
|
224
|
-
url:
|
|
224
|
+
url: r,
|
|
225
225
|
method: t.read.method,
|
|
226
226
|
contentType: t.read.contentType,
|
|
227
227
|
body: D,
|
|
228
228
|
onError: async (l) => {
|
|
229
229
|
var U;
|
|
230
|
-
const i = (U = await (P == null ? void 0 : P(l))) != null ? U :
|
|
230
|
+
const i = (U = await (P == null ? void 0 : P(l))) != null ? U : c == null ? void 0 : c(l);
|
|
231
231
|
return i && k({ error: i }), [];
|
|
232
232
|
},
|
|
233
233
|
onSuccess: async (l) => {
|
|
@@ -241,40 +241,40 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
241
241
|
return console.error(T), [];
|
|
242
242
|
}
|
|
243
243
|
},
|
|
244
|
-
create:
|
|
245
|
-
update:
|
|
244
|
+
create: ye,
|
|
245
|
+
update: we,
|
|
246
246
|
delete: me,
|
|
247
247
|
// Renamed to "remove" internally to avoid JS keyword
|
|
248
248
|
sync: async () => {
|
|
249
249
|
await Promise.all(
|
|
250
250
|
Array.from(b.value).map(async ([a, e]) => {
|
|
251
|
-
var n, o, s,
|
|
251
|
+
var n, o, s, v;
|
|
252
252
|
if (t != null && t.create)
|
|
253
253
|
if (typeof t.create == "function")
|
|
254
254
|
try {
|
|
255
255
|
const d = await t.create({ data: e });
|
|
256
256
|
ee({ data: d || e }), Z({ data: e });
|
|
257
257
|
} catch (d) {
|
|
258
|
-
const
|
|
259
|
-
|
|
258
|
+
const r = c == null ? void 0 : c(d);
|
|
259
|
+
r && k({ error: r, data: e });
|
|
260
260
|
}
|
|
261
261
|
else {
|
|
262
|
-
const d = B(t.create.url, e),
|
|
262
|
+
const d = B(t.create.url, e), r = C(t.create.data, e, ue(e)), P = (v = (s = (o = (n = t.create).parameterMap) == null ? void 0 : o.call(n, r)) != null ? s : typeof t.create.data == "function" ? r : t.create.data) != null ? v : {}, m = t.create.onError, j = t.create.onResponse, D = t.create.onSuccess;
|
|
263
263
|
H(d, P);
|
|
264
264
|
try {
|
|
265
265
|
await K({
|
|
266
266
|
url: d,
|
|
267
267
|
method: t.create.method,
|
|
268
268
|
contentType: t.create.contentType,
|
|
269
|
-
body:
|
|
269
|
+
body: r,
|
|
270
270
|
onError: async (u) => {
|
|
271
271
|
var O;
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
const y = (O = await (m == null ? void 0 : m(u))) != null ? O : c == null ? void 0 : c(u);
|
|
273
|
+
y && k({ error: y, data: e });
|
|
274
274
|
},
|
|
275
275
|
onSuccess: async (u) => {
|
|
276
|
-
const
|
|
277
|
-
ee({ data:
|
|
276
|
+
const y = j ? await j(u) : u;
|
|
277
|
+
ee({ data: y || e }), Z({ data: e }), await (D == null ? void 0 : D(y || e));
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
} catch (u) {
|
|
@@ -284,33 +284,33 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
284
284
|
})
|
|
285
285
|
), await Promise.all(
|
|
286
286
|
Array.from(R.value).map(async ([a, e]) => {
|
|
287
|
-
var n, o, s,
|
|
287
|
+
var n, o, s, v;
|
|
288
288
|
if (t != null && t.update)
|
|
289
289
|
if (typeof t.update == "function")
|
|
290
290
|
try {
|
|
291
291
|
const d = await t.update({ data: e });
|
|
292
292
|
te({ data: d || e }), $({ data: e });
|
|
293
293
|
} catch (d) {
|
|
294
|
-
const
|
|
295
|
-
|
|
294
|
+
const r = c == null ? void 0 : c(d);
|
|
295
|
+
r && k({ error: r, data: e });
|
|
296
296
|
}
|
|
297
297
|
else {
|
|
298
|
-
const d = B(t.update.url, e),
|
|
298
|
+
const d = B(t.update.url, e), r = C(t.update.data, e, e), P = (v = (s = (o = (n = t.update).parameterMap) == null ? void 0 : o.call(n, r)) != null ? s : typeof t.update.data == "function" ? r : t.update.data) != null ? v : {}, m = t.update.onError, j = t.update.onResponse, D = t.update.onSuccess;
|
|
299
299
|
H(d, P);
|
|
300
300
|
try {
|
|
301
301
|
await K({
|
|
302
302
|
url: d,
|
|
303
303
|
method: t.update.method,
|
|
304
304
|
contentType: t.update.contentType,
|
|
305
|
-
body:
|
|
305
|
+
body: r,
|
|
306
306
|
onError: async (u) => {
|
|
307
307
|
var O;
|
|
308
|
-
const
|
|
309
|
-
|
|
308
|
+
const y = (O = await (m == null ? void 0 : m(u))) != null ? O : c == null ? void 0 : c(u);
|
|
309
|
+
y && k({ error: y, data: e });
|
|
310
310
|
},
|
|
311
311
|
onSuccess: async (u) => {
|
|
312
|
-
const
|
|
313
|
-
return te({ data:
|
|
312
|
+
const y = j ? await j(u) : u;
|
|
313
|
+
return te({ data: y || e }), $({ data: e }), await (D == null ? void 0 : D(y || e)), y;
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
316
|
} catch (u) {
|
|
@@ -320,32 +320,32 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
320
320
|
})
|
|
321
321
|
), await Promise.all(
|
|
322
322
|
Array.from(x.value).map(async ([a, e]) => {
|
|
323
|
-
var n, o, s,
|
|
323
|
+
var n, o, s, v;
|
|
324
324
|
if (t != null && t.delete)
|
|
325
325
|
if (typeof t.delete == "function")
|
|
326
326
|
try {
|
|
327
327
|
await t.delete({ data: e }), ae({ data: e }), E({ data: e });
|
|
328
328
|
} catch (d) {
|
|
329
|
-
const
|
|
330
|
-
|
|
329
|
+
const r = c == null ? void 0 : c(d);
|
|
330
|
+
r && k({ error: r, data: e });
|
|
331
331
|
}
|
|
332
332
|
else {
|
|
333
|
-
const d = B(t.delete.url, e),
|
|
333
|
+
const d = B(t.delete.url, e), r = C(t.delete.data, e, e), P = (v = (s = (o = (n = t.delete).parameterMap) == null ? void 0 : o.call(n, r)) != null ? s : typeof t.delete.data == "function" ? r : t.delete.data) != null ? v : {}, m = t.delete.onError, j = t.delete.onResponse, D = t.delete.onSuccess;
|
|
334
334
|
H(d, P);
|
|
335
335
|
try {
|
|
336
336
|
await K({
|
|
337
337
|
url: d,
|
|
338
338
|
method: t.delete.method,
|
|
339
339
|
contentType: t.delete.contentType,
|
|
340
|
-
body:
|
|
340
|
+
body: r,
|
|
341
341
|
onError: async (u) => {
|
|
342
342
|
var O;
|
|
343
|
-
const
|
|
344
|
-
|
|
343
|
+
const y = (O = await (m == null ? void 0 : m(u))) != null ? O : c == null ? void 0 : c(u);
|
|
344
|
+
y && k({ error: y, data: e });
|
|
345
345
|
},
|
|
346
346
|
onSuccess: async (u) => {
|
|
347
|
-
const
|
|
348
|
-
return ae({ data: Object.keys(
|
|
347
|
+
const y = j ? await j(u) : u;
|
|
348
|
+
return ae({ data: Object.keys(y).length !== 0 ? y : e }), E({ data: e }), await (D == null ? void 0 : D(u || e)), u;
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
351
|
} catch (u) {
|
|
@@ -356,7 +356,7 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
356
356
|
);
|
|
357
357
|
},
|
|
358
358
|
syncItem: async (a) => {
|
|
359
|
-
var o, s,
|
|
359
|
+
var o, s, v, d, r, P, m, j, D, u, y, O;
|
|
360
360
|
const { data: e } = a, n = g(e);
|
|
361
361
|
if (b.value.has(n)) {
|
|
362
362
|
if (!(t != null && t.create))
|
|
@@ -366,21 +366,21 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
366
366
|
const h = await t.create({ data: e });
|
|
367
367
|
ee({ data: h || e }), Z({ data: e });
|
|
368
368
|
} catch (h) {
|
|
369
|
-
const
|
|
370
|
-
|
|
369
|
+
const w = c == null ? void 0 : c(h);
|
|
370
|
+
w && k({ error: w, data: e });
|
|
371
371
|
}
|
|
372
372
|
else {
|
|
373
|
-
const h = B(t.create.url, e),
|
|
373
|
+
const h = B(t.create.url, e), w = C(t.create.data, e, ue(e)), J = (d = (v = (s = (o = t.create).parameterMap) == null ? void 0 : s.call(o, w)) != null ? v : typeof t.create.data == "function" ? w : t.create.data) != null ? d : {}, I = t.create.onError, G = t.create.onResponse, T = t.create.onSuccess;
|
|
374
374
|
H(h, J);
|
|
375
375
|
try {
|
|
376
376
|
await K({
|
|
377
377
|
url: h,
|
|
378
378
|
method: t.create.method,
|
|
379
379
|
contentType: t.create.contentType,
|
|
380
|
-
body:
|
|
380
|
+
body: w,
|
|
381
381
|
onError: async (l) => {
|
|
382
382
|
var U;
|
|
383
|
-
const i = (U = await (I == null ? void 0 : I(l))) != null ? U :
|
|
383
|
+
const i = (U = await (I == null ? void 0 : I(l))) != null ? U : c == null ? void 0 : c(l);
|
|
384
384
|
i && k({ error: i, data: e });
|
|
385
385
|
},
|
|
386
386
|
onSuccess: async (l) => {
|
|
@@ -401,21 +401,21 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
401
401
|
const h = await t.update({ data: e });
|
|
402
402
|
te({ data: h || e }), $({ data: e });
|
|
403
403
|
} catch (h) {
|
|
404
|
-
const
|
|
405
|
-
|
|
404
|
+
const w = c == null ? void 0 : c(h);
|
|
405
|
+
w && k({ error: w, data: e });
|
|
406
406
|
}
|
|
407
407
|
else {
|
|
408
|
-
const h = B(t.update.url, e),
|
|
408
|
+
const h = B(t.update.url, e), w = C(t.update.data, e, e), J = (j = (m = (P = (r = t.update).parameterMap) == null ? void 0 : P.call(r, w)) != null ? m : typeof t.update.data == "function" ? w : t.update.data) != null ? j : {}, I = t.update.onError, G = t.update.onResponse, T = t.update.onSuccess;
|
|
409
409
|
H(h, J);
|
|
410
410
|
try {
|
|
411
411
|
await K({
|
|
412
412
|
url: h,
|
|
413
413
|
method: t.update.method,
|
|
414
414
|
contentType: t.update.contentType,
|
|
415
|
-
body:
|
|
415
|
+
body: w,
|
|
416
416
|
onError: async (l) => {
|
|
417
417
|
var U;
|
|
418
|
-
const i = (U = await (I == null ? void 0 : I(l))) != null ? U :
|
|
418
|
+
const i = (U = await (I == null ? void 0 : I(l))) != null ? U : c == null ? void 0 : c(l);
|
|
419
419
|
i && k({ error: i, data: e });
|
|
420
420
|
},
|
|
421
421
|
onSuccess: async (l) => {
|
|
@@ -435,21 +435,21 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
435
435
|
try {
|
|
436
436
|
await t.delete({ data: e }), ae({ data: e }), E({ data: e });
|
|
437
437
|
} catch (h) {
|
|
438
|
-
const
|
|
439
|
-
|
|
438
|
+
const w = c == null ? void 0 : c(h);
|
|
439
|
+
w && k({ error: w, data: e });
|
|
440
440
|
}
|
|
441
441
|
else {
|
|
442
|
-
const h = B(t.delete.url, e),
|
|
442
|
+
const h = B(t.delete.url, e), w = C(t.delete.data, e, e), J = (O = (y = (u = (D = t.delete).parameterMap) == null ? void 0 : u.call(D, w)) != null ? y : typeof t.delete.data == "function" ? w : t.delete.data) != null ? O : {}, I = t.delete.onError, G = t.delete.onResponse, T = t.delete.onSuccess;
|
|
443
443
|
H(h, J);
|
|
444
444
|
try {
|
|
445
445
|
await K({
|
|
446
446
|
url: h,
|
|
447
447
|
method: t.delete.method,
|
|
448
448
|
contentType: t.delete.contentType,
|
|
449
|
-
body:
|
|
449
|
+
body: w,
|
|
450
450
|
onError: async (l) => {
|
|
451
451
|
var U;
|
|
452
|
-
const i = (U = await (I == null ? void 0 : I(l))) != null ? U :
|
|
452
|
+
const i = (U = await (I == null ? void 0 : I(l))) != null ? U : c == null ? void 0 : c(l);
|
|
453
453
|
i && k({ error: i, data: e });
|
|
454
454
|
},
|
|
455
455
|
onSuccess: async (l) => {
|
|
@@ -470,7 +470,7 @@ const De = { data: (v) => v, total: (v) => v.length }, Se = {
|
|
|
470
470
|
pushUpdate: te,
|
|
471
471
|
pushDelete: ae,
|
|
472
472
|
discard: () => {
|
|
473
|
-
b.value.clear(), X(new Map(b.value)), R.value.clear(), oe(new Map(R.value)), x.value.clear(),
|
|
473
|
+
b.value.clear(), X(new Map(b.value)), R.value.clear(), oe(new Map(R.value)), x.value.clear(), re(new Map(x.value)), f.value.clear(), q(new Map(f.value)), S.value.clear(), Y(new Map(S.value));
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
return Object.defineProperties(
|