@duxweb/dvha-core 0.1.22 → 0.1.23

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.
@@ -1,85 +1,87 @@
1
- import { debounce as N, isArray as k } from "lodash-es";
2
- import { ref as o, computed as c, watch as m } from "vue";
3
- import { useList as p, useMany as A } from "./data.js";
4
- function z(a) {
5
- const r = o(), s = o({
1
+ import { debounce as k, isArray as A } from "lodash-es";
2
+ import { ref as u, computed as c, watch as E } from "vue";
3
+ import { useList as L, useMany as O } from "./data.js";
4
+ function D(t) {
5
+ const r = u(), s = u({
6
6
  page: 1,
7
- pageSize: typeof a.pagination == "number" ? a.pagination : a.pagination ? 20 : 0
8
- }), d = o(!1), h = N((e) => {
7
+ pageSize: typeof t.pagination == "number" ? t.pagination : t.pagination ? 20 : 0
8
+ }), d = u(!1), h = k((e) => {
9
9
  r.value = e;
10
- }, a.debounce || 300), b = (e) => {
10
+ }, t.debounce || 300), V = (e) => {
11
11
  h(e);
12
- }, { data: f, isLoading: V } = p({
12
+ }, { data: f, isLoading: b, total: w, pageCount: S } = L({
13
13
  get path() {
14
- return a.path || "";
14
+ return t.path || "";
15
15
  },
16
16
  get filters() {
17
- const e = { ...a.params };
18
- return r.value && (e[a.keywordField || "keyword"] = r.value), e;
17
+ const e = { ...t.params };
18
+ return r.value && (e[t.keywordField || "keyword"] = r.value), e;
19
19
  },
20
20
  get pagination() {
21
- return a.pagination ? s.value : void 0;
21
+ return t.pagination ? s.value : void 0;
22
22
  },
23
23
  get providerName() {
24
- return a.providerName;
24
+ return t.providerName;
25
25
  }
26
- }), v = o([]), g = (e) => {
27
- const { optionField: n } = a;
28
- return typeof n == "string" ? e[n] || e.value || e.id : e.value || e.id;
29
- }, w = (e) => {
30
- const { optionLabel: n = "label", optionValue: u = "value" } = a;
26
+ }), g = u([]), v = (e) => {
27
+ const a = t.optionField || t.optionValue;
28
+ return typeof a == "string" ? e[a] || e.value || e.id : typeof a == "function" ? a(e) : e.value || e.id;
29
+ }, x = (e) => {
30
+ const { optionLabel: a = "label", optionValue: o = "value" } = t;
31
31
  let l;
32
- typeof n == "function" ? l = n(e) : typeof n == "string" ? l = e[n] || e.label || e.name || e.title || String(e.value || e.id || "") : l = e.label || e.name || e.title || String(e.value || e.id || "");
33
- let t;
34
- return typeof u == "function" ? t = u(e) : typeof u == "string" ? t = e[u] || e.value || e.id : t = e.value || e.id, {
32
+ typeof a == "function" ? l = a(e) : typeof a == "string" ? l = e[a] || e.label || e.name || e.title || String(e.value || e.id || "") : l = e.label || e.name || e.title || String(e.value || e.id || "");
33
+ let n;
34
+ return typeof o == "function" ? n = o(e) : typeof o == "string" ? n = e[o] || e.value || e.id : n = e.value || e.id, {
35
35
  label: l,
36
- value: t,
36
+ value: n,
37
37
  raw: e
38
38
  };
39
39
  }, y = c(() => {
40
- var u;
41
- const e = ((u = f.value) == null ? void 0 : u.data) || [], n = [...v.value];
40
+ var o;
41
+ const e = ((o = f.value) == null ? void 0 : o.data) || [], a = [...g.value];
42
42
  return e.forEach((l) => {
43
- n.some(
44
- (i) => g(i) === g(l)
45
- ) || n.push(l);
46
- }), n.map((l) => w(l));
47
- }), S = c(() => {
43
+ a.some(
44
+ (i) => v(i) === v(l)
45
+ ) || a.push(l);
46
+ }), a.map((l) => x(l));
47
+ }), p = c(() => {
48
48
  var e;
49
49
  return ((e = f.value) == null ? void 0 : e.meta) || {};
50
- }), { refetch: x } = A({
50
+ }), { refetch: F } = O({
51
51
  get path() {
52
- return a.path || "";
52
+ return t.path || "";
53
53
  },
54
54
  get ids() {
55
- return a.defaultValue ? k(a.defaultValue) ? a.defaultValue : [a.defaultValue] : [];
55
+ return t.defaultValue ? A(t.defaultValue) ? t.defaultValue : [t.defaultValue] : [];
56
56
  },
57
57
  options: {
58
58
  enabled: !1
59
59
  },
60
- providerName: a.providerName
60
+ providerName: t.providerName
61
61
  });
62
- m(() => a.defaultValue, async (e) => {
62
+ E(() => t.defaultValue, async (e) => {
63
63
  var l;
64
64
  if (!(d.value || !e || (d.value = !0, (Array.isArray(e) ? e : [e]).every(
65
- (t) => y.value.some((i) => i.value === t)
65
+ (n) => y.value.some((i) => i.value === n)
66
66
  ))))
67
67
  try {
68
- const t = await x();
69
- v.value = ((l = t == null ? void 0 : t.data) == null ? void 0 : l.data) || [];
70
- } catch (t) {
71
- console.warn("Failed to fetch selected items:", t);
68
+ const n = await F();
69
+ g.value = ((l = n == null ? void 0 : n.data) == null ? void 0 : l.data) || [];
70
+ } catch (n) {
71
+ console.warn("Failed to fetch selected items:", n);
72
72
  }
73
73
  }, { immediate: !0 });
74
- const F = c(() => V.value);
74
+ const N = c(() => b.value);
75
75
  return {
76
- onSearch: b,
76
+ onSearch: V,
77
77
  options: y,
78
- meta: S,
79
- loading: F,
80
- pagination: s
78
+ meta: p,
79
+ loading: N,
80
+ pagination: s,
81
+ total: w,
82
+ pageCount: S
81
83
  };
82
84
  }
83
85
  export {
84
- z as useSelect
86
+ D as useSelect
85
87
  };
@@ -65,7 +65,7 @@ function de() {
65
65
  dark: {
66
66
  text: { dimmed: "600", muted: "500", toned: "300", base: "400", highlighted: "100", inverted: "black" },
67
67
  bg: { base: "950", muted: "900", elevated: "800", accented: "700", inverted: "100" },
68
- border: { base: "600", muted: "800", accented: "700", inverted: "100" }
68
+ border: { base: "900", muted: "800", accented: "700", inverted: "100" }
69
69
  }
70
70
  },
71
71
  colorBase: { white: "#ffffff", black: "#000000" }
@@ -0,0 +1,41 @@
1
+ import { computed as a } from "vue";
2
+ import { arrayToTree as y, treeToArr as m } from "../utils/tree.js";
3
+ import { useList as v } from "./data.js";
4
+ function g(e) {
5
+ const { data: o, isLoading: c } = v({
6
+ get path() {
7
+ return e.path || "";
8
+ },
9
+ get filters() {
10
+ return e.params;
11
+ },
12
+ get providerName() {
13
+ return e.providerName;
14
+ }
15
+ }), d = a(() => {
16
+ var r, n, i, t, l, s;
17
+ return e.converTree ? y(((n = o.value) == null ? void 0 : n.data) || [], {
18
+ idKey: ((i = e.treeOptions) == null ? void 0 : i.valueKey) || "id",
19
+ parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parentId",
20
+ sortKey: ((l = e.treeOptions) == null ? void 0 : l.sortKey) || "sort",
21
+ childrenKey: ((s = e.treeOptions) == null ? void 0 : s.childrenKey) || "children"
22
+ }) : ((r = o.value) == null ? void 0 : r.data) || [];
23
+ }), u = a(() => {
24
+ var r, n;
25
+ return m(d.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
26
+ }), h = a(() => c.value);
27
+ return {
28
+ options: a(() => {
29
+ const r = (n) => n.map((i) => {
30
+ const t = { ...i };
31
+ return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = r(t.children)), t;
32
+ });
33
+ return r(d.value || []);
34
+ }),
35
+ loading: h,
36
+ expanded: u
37
+ };
38
+ }
39
+ export {
40
+ g as useTree
41
+ };
@@ -3,6 +3,7 @@ import { uniqueId as R } from "lodash-es";
3
3
  import { ref as g, computed as v, watch as V } from "vue";
4
4
  import { createLocalUploadDriver as W } from "./upload/local.js";
5
5
  function ne(l) {
6
+ l = l || {};
6
7
  const w = g(!1), i = g([]), u = g(-1), d = g(/* @__PURE__ */ new Map()), A = l.driver || W(), $ = v(() => {
7
8
  const { onProgress: e, onDataCallback: n, onCancel: a, onComplete: t, maxFileSize: c, maxFileCount: o, accept: s, multiple: r, autoUpload: f, options: U, onSuccess: P, onError: x, method: Y, driver: Z, ...J } = l;
8
9
  return J;
package/dist/esm/index.js CHANGED
@@ -8,7 +8,7 @@ import { DuxException as l } from "./components/status/exception.js";
8
8
  import { DuxNotAuthorized as D } from "./components/status/notAuthorized.js";
9
9
  import { DuxNotFound as h } from "./components/status/notFound.js";
10
10
  import { themeColor as c } from "./config/color.js";
11
- import { useCan as g, useCheck as I, useError as L, useForgotPassword as T, useGetAuth as M, useIsLogin as y, useLogin as E, useLogout as F, useRegister as P, useUpdatePassword as U } from "./hooks/auth.js";
11
+ import { useCan as T, useCheck as g, useError as I, useForgotPassword as L, useGetAuth as M, useIsLogin as y, useLogin as E, useLogout as F, useRegister as P, useUpdatePassword as U } from "./hooks/auth.js";
12
12
  import { useConfig as O } from "./hooks/config.js";
13
13
  import { useClient as b, useCreate as V, useCreateMany as N, useCustom as k, useCustomMutation as z, useDelete as G, useDeleteMany as J, useInfiniteList as j, useInvalidate as q, useList as B, useMany as H, useOne as K, useUpdate as Q, useUpdateMany as W } from "./hooks/data.js";
14
14
  import { useExport as Y } from "./hooks/export.js";
@@ -24,35 +24,36 @@ import { defaultAdaptors as ve } from "./hooks/json/index.js";
24
24
  import { useExtendList as Ae } from "./hooks/list.js";
25
25
  import { useManage as Ce } from "./hooks/manage.js";
26
26
  import { useMenu as Se } from "./hooks/menu.js";
27
- import { useOverlay as Ie } from "./hooks/overlay.js";
28
- import { useSelect as Te } from "./hooks/select.js";
27
+ import { useOverlay as ge } from "./hooks/overlay.js";
28
+ import { useSelect as Le } from "./hooks/select.js";
29
29
  import { useTheme as ye } from "./hooks/theme.js";
30
- import { useUpload as Fe } from "./hooks/upload.js";
31
- import { createLocalUploadDriver as Ue } from "./hooks/upload/local.js";
32
- import { createS3UploadDriver as Oe } from "./hooks/upload/s3.js";
33
- import { createDux as be } from "./main.js";
34
- import { simpleAuthProvider as Ne } from "./preset/authProvider.js";
35
- import { simpleDataProvider as ze } from "./preset/dataProvider.js";
36
- import { i18nProvider as Je } from "./preset/i18nProvider.js";
37
- import { DuxAppProvider as qe } from "./provider/app.js";
38
- import { DuxTabRouterView as He } from "./provider/tab.js";
39
- import { initRouter as Qe } from "./router/route.js";
40
- import { useAuthStore as Xe } from "./stores/auth.js";
41
- import { useI18nStore as Ze } from "./stores/i18n.js";
42
- import { useManageStore as $e } from "./stores/manage.js";
43
- import { useRouteStore as rr } from "./stores/route.js";
44
- import { createTabStore as tr, useTabStore as pr } from "./stores/tab.js";
45
- import { useThemeStore as xr } from "./stores/theme.js";
46
- import { themePreset as sr } from "./utils/theme.js";
47
- import { arrayToTree as ar, searchTree as dr, treeToArr as ir } from "./utils/tree.js";
48
- import { vForAdaptor as lr } from "./hooks/json/vFor.js";
49
- import { vIfAdaptor as Dr } from "./hooks/json/vIf.js";
50
- import { vModelAdaptor as hr } from "./hooks/json/vModel.js";
51
- import { vOnAdaptor as cr } from "./hooks/json/vOn.js";
52
- import { vShowAdaptor as gr } from "./hooks/json/vShow.js";
53
- import { vTextAdaptor as Lr } from "./hooks/json/vText.js";
30
+ import { useTree as Fe } from "./hooks/tree.js";
31
+ import { useUpload as Ue } from "./hooks/upload.js";
32
+ import { createLocalUploadDriver as Oe } from "./hooks/upload/local.js";
33
+ import { createS3UploadDriver as be } from "./hooks/upload/s3.js";
34
+ import { createDux as Ne } from "./main.js";
35
+ import { simpleAuthProvider as ze } from "./preset/authProvider.js";
36
+ import { simpleDataProvider as Je } from "./preset/dataProvider.js";
37
+ import { i18nProvider as qe } from "./preset/i18nProvider.js";
38
+ import { DuxAppProvider as He } from "./provider/app.js";
39
+ import { DuxTabRouterView as Qe } from "./provider/tab.js";
40
+ import { initRouter as Xe } from "./router/route.js";
41
+ import { useAuthStore as Ze } from "./stores/auth.js";
42
+ import { useI18nStore as $e } from "./stores/i18n.js";
43
+ import { useManageStore as rr } from "./stores/manage.js";
44
+ import { useRouteStore as tr } from "./stores/route.js";
45
+ import { createTabStore as ur, useTabStore as xr } from "./stores/tab.js";
46
+ import { useThemeStore as sr } from "./stores/theme.js";
47
+ import { themePreset as ar } from "./utils/theme.js";
48
+ import { arrayToTree as ir, searchTree as nr, treeToArr as lr } from "./utils/tree.js";
49
+ import { vForAdaptor as Dr } from "./hooks/json/vFor.js";
50
+ import { vIfAdaptor as hr } from "./hooks/json/vIf.js";
51
+ import { vModelAdaptor as cr } from "./hooks/json/vModel.js";
52
+ import { vOnAdaptor as Tr } from "./hooks/json/vOn.js";
53
+ import { vShowAdaptor as Ir } from "./hooks/json/vShow.js";
54
+ import { vTextAdaptor as Mr } from "./hooks/json/vText.js";
54
55
  export {
55
- qe as DuxAppProvider,
56
+ He as DuxAppProvider,
56
57
  o as DuxCan,
57
58
  i as DuxError,
58
59
  l as DuxException,
@@ -62,25 +63,25 @@ export {
62
63
  D as DuxNotAuthorized,
63
64
  h as DuxNotFound,
64
65
  a as DuxOverlay,
65
- He as DuxTabRouterView,
66
- ar as arrayToTree,
67
- be as createDux,
68
- Ue as createLocalUploadDriver,
69
- Oe as createS3UploadDriver,
70
- tr as createTabStore,
66
+ Qe as DuxTabRouterView,
67
+ ir as arrayToTree,
68
+ Ne as createDux,
69
+ Oe as createLocalUploadDriver,
70
+ be as createS3UploadDriver,
71
+ ur as createTabStore,
71
72
  ve as defaultAdaptors,
72
- Je as i18nProvider,
73
+ qe as i18nProvider,
73
74
  pe as initFormValidate,
74
- Qe as initRouter,
75
- dr as searchTree,
76
- Ne as simpleAuthProvider,
77
- ze as simpleDataProvider,
75
+ Xe as initRouter,
76
+ nr as searchTree,
77
+ ze as simpleAuthProvider,
78
+ Je as simpleDataProvider,
78
79
  c as themeColor,
79
- sr as themePreset,
80
- ir as treeToArr,
81
- Xe as useAuthStore,
82
- g as useCan,
83
- I as useCheck,
80
+ ar as themePreset,
81
+ lr as treeToArr,
82
+ Ze as useAuthStore,
83
+ T as useCan,
84
+ g as useCheck,
84
85
  b as useClient,
85
86
  O as useConfig,
86
87
  V as useCreate,
@@ -89,16 +90,16 @@ export {
89
90
  z as useCustomMutation,
90
91
  G as useDelete,
91
92
  J as useDeleteMany,
92
- L as useError,
93
+ I as useError,
93
94
  Y as useExport,
94
95
  _ as useExportCsv,
95
96
  oe as useExtendForm,
96
97
  Ae as useExtendList,
97
- T as useForgotPassword,
98
+ L as useForgotPassword,
98
99
  ee as useForm,
99
100
  M as useGetAuth,
100
101
  me as useI18n,
101
- Ze as useI18nStore,
102
+ $e as useI18nStore,
102
103
  fe as useImport,
103
104
  de as useImportCsv,
104
105
  j as useInfiniteList,
@@ -109,26 +110,27 @@ export {
109
110
  E as useLogin,
110
111
  F as useLogout,
111
112
  Ce as useManage,
112
- $e as useManageStore,
113
+ rr as useManageStore,
113
114
  H as useMany,
114
115
  Se as useMenu,
115
116
  K as useOne,
116
- Ie as useOverlay,
117
+ ge as useOverlay,
117
118
  P as useRegister,
118
- rr as useRouteStore,
119
- Te as useSelect,
120
- pr as useTabStore,
119
+ tr as useRouteStore,
120
+ Le as useSelect,
121
+ xr as useTabStore,
121
122
  ye as useTheme,
122
- xr as useThemeStore,
123
+ sr as useThemeStore,
124
+ Fe as useTree,
123
125
  Q as useUpdate,
124
126
  W as useUpdateMany,
125
127
  U as useUpdatePassword,
126
- Fe as useUpload,
128
+ Ue as useUpload,
127
129
  ue as useValidateForm,
128
- lr as vForAdaptor,
129
- Dr as vIfAdaptor,
130
- hr as vModelAdaptor,
131
- cr as vOnAdaptor,
132
- gr as vShowAdaptor,
133
- Lr as vTextAdaptor
130
+ Dr as vForAdaptor,
131
+ hr as vIfAdaptor,
132
+ cr as vModelAdaptor,
133
+ Tr as vOnAdaptor,
134
+ Ir as vShowAdaptor,
135
+ Mr as vTextAdaptor
134
136
  };
@@ -1,99 +1,99 @@
1
1
  import k from "axios";
2
- import { trimStart as u } from "lodash-es";
3
- function w(c) {
4
- const r = (a) => a ? `${c.apiUrl}/${u(a || "", "/")}` : c.apiUrl;
2
+ import { trimStart as h } from "lodash-es";
3
+ function w(l) {
4
+ const d = (a) => a ? `${l.apiUrl}/${h(a || "", "/")}` : l.apiUrl;
5
5
  return {
6
- apiUrl: r,
7
- getList: (a, d, l) => {
6
+ apiUrl: d,
7
+ getList: (a, r, c) => {
8
8
  const e = {};
9
- return a.pagination && typeof a.pagination == "object" && (e.page = a.pagination.page, e.pageSize = a.pagination.pageSize), k.get(r(a.path) || "", {
9
+ return a.pagination && typeof a.pagination == "object" && (e.page = a.pagination.page, e.pageSize = a.pagination.pageSize), k.get(d(a.path) || "", {
10
10
  params: {
11
11
  ...e,
12
12
  ...a.filters,
13
13
  ...a.sorters
14
14
  },
15
15
  headers: {
16
- Authorization: l == null ? void 0 : l.token
16
+ Authorization: c == null ? void 0 : c.token
17
17
  },
18
18
  ...a.meta
19
- }).then((t) => c.successCallback ? c.successCallback(t) : n(t)).catch((t) => {
20
- throw c.errorCallback ? c.errorCallback(t) : b(t);
19
+ }).then((t) => l.successCallback ? l.successCallback(t) : n(t)).catch((t) => {
20
+ throw l.errorCallback ? l.errorCallback(t) : m(t);
21
21
  });
22
22
  },
23
- create: (a, d, l) => k.post(r(a.path) || "", a.data, {
23
+ create: (a, r, c) => k.post(d(a.path) || "", a.data, {
24
24
  headers: {
25
- Authorization: l == null ? void 0 : l.token
25
+ Authorization: c == null ? void 0 : c.token
26
26
  },
27
27
  ...a.meta
28
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
29
- throw c.errorCallback ? c.errorCallback(e) : b(e);
28
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
29
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
30
30
  }),
31
- update: (a, d, l) => k.put(r(a.id ? `${a.path}/${a.id}` : a.path) || "", a.data, {
31
+ update: (a, r, c) => k.put(d(a.id ? `${a.path}/${a.id}` : a.path) || "", a.data, {
32
32
  headers: {
33
- Authorization: l == null ? void 0 : l.token
33
+ Authorization: c == null ? void 0 : c.token
34
34
  },
35
35
  ...a.meta
36
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
37
- throw c.errorCallback ? c.errorCallback(e) : b(e);
36
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
37
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
38
38
  }),
39
- deleteOne: (a, d, l) => k.delete(r(a.id ? `${a.path}/${a.id}` : a.path) || "", {
39
+ deleteOne: (a, r, c) => k.delete(d(a.id ? `${a.path}/${a.id}` : a.path) || "", {
40
40
  headers: {
41
- Authorization: l == null ? void 0 : l.token
41
+ Authorization: c == null ? void 0 : c.token
42
42
  },
43
43
  ...a.meta
44
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
45
- throw c.errorCallback ? c.errorCallback(e) : b(e);
44
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
45
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
46
46
  }),
47
- getOne: (a, d, l) => k.get(r(a.id ? `${a.path}/${a.id}` : a.path) || "", {
47
+ getOne: (a, r, c) => k.get(d(a.id ? `${a.path}/${a.id}` : a.path) || "", {
48
48
  headers: {
49
- Authorization: l == null ? void 0 : l.token
49
+ Authorization: c == null ? void 0 : c.token
50
50
  },
51
51
  ...a.meta
52
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
53
- throw c.errorCallback ? c.errorCallback(e) : b(e);
52
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
53
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
54
54
  }),
55
- getMany: (a, d, l) => k.get(r(a.path) || "", {
55
+ getMany: (a, r, c) => k.get(d(a.path) || "", {
56
56
  params: {
57
57
  ids: a.ids
58
58
  },
59
59
  headers: {
60
- Authorization: l == null ? void 0 : l.token
60
+ Authorization: c == null ? void 0 : c.token
61
61
  },
62
62
  ...a.meta
63
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
64
- throw c.errorCallback ? c.errorCallback(e) : b(e);
63
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
64
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
65
65
  }),
66
- createMany: (a, d, l) => k.post(r(a.path) || "", a.data, {
66
+ createMany: (a, r, c) => k.post(d(a.path) || "", a.data, {
67
67
  headers: {
68
- Authorization: l == null ? void 0 : l.token
68
+ Authorization: c == null ? void 0 : c.token
69
69
  },
70
70
  ...a.meta
71
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
72
- throw c.errorCallback ? c.errorCallback(e) : b(e);
71
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
72
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
73
73
  }),
74
- updateMany: (a, d, l) => k.put(r(a.path) || "", {
74
+ updateMany: (a, r, c) => k.put(d(a.path) || "", {
75
75
  ids: a.ids,
76
76
  data: a.data
77
77
  }, {
78
78
  headers: {
79
- Authorization: l == null ? void 0 : l.token
79
+ Authorization: c == null ? void 0 : c.token
80
80
  },
81
81
  ...a.meta
82
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
83
- throw c.errorCallback ? c.errorCallback(e) : b(e);
82
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
83
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
84
84
  }),
85
- deleteMany: (a, d, l) => k.delete(r(a.path) || "", {
85
+ deleteMany: (a, r, c) => k.delete(d(a.path) || "", {
86
86
  params: {
87
87
  ids: a.ids
88
88
  },
89
89
  headers: {
90
- Authorization: l == null ? void 0 : l.token
90
+ Authorization: c == null ? void 0 : c.token
91
91
  },
92
92
  ...a.meta
93
- }).then((e) => c.successCallback ? c.successCallback(e) : n(e)).catch((e) => {
94
- throw c.errorCallback ? c.errorCallback(e) : b(e);
93
+ }).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
94
+ throw l.errorCallback ? l.errorCallback(e) : m(e);
95
95
  }),
96
- custom: (a, d, l) => {
96
+ custom: (a, r, c) => {
97
97
  let e = {
98
98
  ...a.query
99
99
  };
@@ -104,57 +104,61 @@ function w(c) {
104
104
  ...e,
105
105
  ...a.filters
106
106
  }), k.request({
107
- url: r(a.path || ""),
107
+ url: d(a.path || ""),
108
108
  method: a.method || "GET",
109
109
  data: a.payload,
110
110
  params: e,
111
111
  signal: a.signal,
112
112
  headers: {
113
- Authorization: l == null ? void 0 : l.token,
113
+ Authorization: c == null ? void 0 : c.token,
114
114
  ...a.headers
115
115
  },
116
116
  onUploadProgress: (t) => {
117
- var m;
117
+ var b;
118
118
  const C = Math.round(t.loaded * 100 / (t.total || 1));
119
- (m = a.onUploadProgress) == null || m.call(a, {
119
+ (b = a.onUploadProgress) == null || b.call(a, {
120
120
  loaded: t.loaded,
121
121
  total: t.total,
122
122
  percent: C
123
123
  });
124
124
  },
125
125
  onDownloadProgress: (t) => {
126
- var m;
126
+ var b;
127
127
  const C = Math.round(t.loaded * 100 / (t.total || 1));
128
- (m = a.onDownloadProgress) == null || m.call(a, {
128
+ (b = a.onDownloadProgress) == null || b.call(a, {
129
129
  loaded: t.loaded,
130
130
  total: t.total,
131
131
  percent: C
132
132
  });
133
133
  },
134
134
  ...a.meta
135
- }).then((t) => c.successCallback ? c.successCallback(t) : n(t)).catch((t) => {
136
- throw c.errorCallback ? c.errorCallback(t) : b(t);
135
+ }).then((t) => l.successCallback ? l.successCallback(t) : n(t)).catch((t) => {
136
+ throw l.errorCallback ? l.errorCallback(t) : m(t);
137
137
  });
138
+ },
139
+ getTotal: (a) => {
140
+ var r;
141
+ return l.getTotal ? l.getTotal(a) : ((r = a.meta) == null ? void 0 : r.total) || 0;
138
142
  }
139
143
  };
140
144
  }
141
- function n(c) {
142
- var r, a, d;
145
+ function n(l) {
146
+ var d, a, r;
143
147
  return {
144
- message: (r = c.data) == null ? void 0 : r.message,
145
- data: (a = c.data) == null ? void 0 : a.data,
146
- meta: (d = c.data) == null ? void 0 : d.meta,
147
- raw: c.data
148
+ message: (d = l.data) == null ? void 0 : d.message,
149
+ data: (a = l.data) == null ? void 0 : a.data,
150
+ meta: (r = l.data) == null ? void 0 : r.meta,
151
+ raw: l.data
148
152
  };
149
153
  }
150
- function b(c) {
151
- var r, a, d, l, e, t, C, m, g, h;
154
+ function m(l) {
155
+ var d, a, r, c, e, t, C, b, g, u;
152
156
  return {
153
- message: ((a = (r = c.response) == null ? void 0 : r.data) == null ? void 0 : a.message) || (c == null ? void 0 : c.message),
154
- data: (l = (d = c.response) == null ? void 0 : d.data) == null ? void 0 : l.data,
155
- meta: (t = (e = c.response) == null ? void 0 : e.data) == null ? void 0 : t.meta,
156
- status: ((m = (C = c.response) == null ? void 0 : C.data) == null ? void 0 : m.code) || ((g = c.response) == null ? void 0 : g.status) || 500,
157
- raw: (h = c.response) == null ? void 0 : h.data
157
+ message: ((a = (d = l.response) == null ? void 0 : d.data) == null ? void 0 : a.message) || (l == null ? void 0 : l.message),
158
+ data: (c = (r = l.response) == null ? void 0 : r.data) == null ? void 0 : c.data,
159
+ meta: (t = (e = l.response) == null ? void 0 : e.data) == null ? void 0 : t.meta,
160
+ status: ((b = (C = l.response) == null ? void 0 : C.data) == null ? void 0 : b.code) || ((g = l.response) == null ? void 0 : g.status) || 500,
161
+ raw: (u = l.response) == null ? void 0 : u.data
158
162
  };
159
163
  }
160
164
  export {