@duxweb/dvha-core 1.1.30 → 1.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/cjs/components/auth/can.cjs +1 -1
  3. package/dist/cjs/components/auth/index.cjs +1 -0
  4. package/dist/cjs/components/common/icon.cjs +1 -1
  5. package/dist/cjs/components/common/index.cjs +1 -0
  6. package/dist/cjs/components/common/logo.cjs +1 -1
  7. package/dist/cjs/components/index.cjs +1 -0
  8. package/dist/cjs/components/loader/iframe.cjs +1 -1
  9. package/dist/cjs/components/loader/index.cjs +1 -0
  10. package/dist/cjs/components/loader/loader.cjs +1 -1
  11. package/dist/cjs/components/loader/remote/index.cjs +1 -0
  12. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  13. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  14. package/dist/cjs/components/overlay/index.cjs +1 -0
  15. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  16. package/dist/cjs/components/status/error.cjs +1 -1
  17. package/dist/cjs/components/status/exception.cjs +1 -1
  18. package/dist/cjs/components/status/index.cjs +1 -0
  19. package/dist/cjs/components/status/notAuthorized.cjs +1 -1
  20. package/dist/cjs/components/status/notFound.cjs +1 -1
  21. package/dist/cjs/config/color.cjs +1 -1
  22. package/dist/cjs/directive/index.cjs +1 -0
  23. package/dist/cjs/directive/permission.cjs +1 -1
  24. package/dist/cjs/hooks/auth.cjs +1 -1
  25. package/dist/cjs/hooks/config.cjs +1 -1
  26. package/dist/cjs/hooks/data.cjs +1 -1
  27. package/dist/cjs/hooks/export.cjs +1 -1
  28. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  29. package/dist/cjs/hooks/form.cjs +1 -1
  30. package/dist/cjs/hooks/formExtend.cjs +1 -1
  31. package/dist/cjs/hooks/formValidate.cjs +1 -1
  32. package/dist/cjs/hooks/i18n.cjs +1 -1
  33. package/dist/cjs/hooks/import.cjs +1 -1
  34. package/dist/cjs/hooks/importCsv.cjs +2 -2
  35. package/dist/cjs/hooks/index.cjs +1 -0
  36. package/dist/cjs/hooks/json/index.cjs +1 -1
  37. package/dist/cjs/hooks/json/utils/contextManager.cjs +1 -1
  38. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  39. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  40. package/dist/cjs/hooks/json/vIf.cjs +1 -1
  41. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  42. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  43. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  44. package/dist/cjs/hooks/json/vText.cjs +1 -1
  45. package/dist/cjs/hooks/json.cjs +1 -1
  46. package/dist/cjs/hooks/list.cjs +1 -1
  47. package/dist/cjs/hooks/manage.cjs +1 -1
  48. package/dist/cjs/hooks/menu.cjs +1 -1
  49. package/dist/cjs/hooks/overlay.cjs +1 -1
  50. package/dist/cjs/hooks/select.cjs +1 -1
  51. package/dist/cjs/hooks/theme.cjs +4 -8
  52. package/dist/cjs/hooks/tree.cjs +1 -1
  53. package/dist/cjs/hooks/upload/index.cjs +1 -0
  54. package/dist/cjs/hooks/upload/local.cjs +1 -1
  55. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  56. package/dist/cjs/hooks/upload.cjs +1 -1
  57. package/dist/cjs/index.cjs +1 -1
  58. package/dist/cjs/main.cjs +1 -1
  59. package/dist/cjs/preset/authProvider.cjs +1 -1
  60. package/dist/cjs/preset/dataProvider.cjs +1 -1
  61. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  62. package/dist/cjs/preset/index.cjs +1 -0
  63. package/dist/cjs/provider/app.cjs +1 -1
  64. package/dist/cjs/provider/index.cjs +1 -0
  65. package/dist/cjs/provider/tab.cjs +1 -1
  66. package/dist/cjs/router/index.cjs +1 -0
  67. package/dist/cjs/router/route.cjs +1 -1
  68. package/dist/cjs/stores/auth.cjs +1 -1
  69. package/dist/cjs/stores/i18n.cjs +1 -1
  70. package/dist/cjs/stores/index.cjs +1 -0
  71. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  72. package/dist/cjs/stores/manage.cjs +1 -1
  73. package/dist/cjs/stores/route.cjs +1 -1
  74. package/dist/cjs/stores/tab.cjs +1 -1
  75. package/dist/cjs/stores/theme.cjs +1 -1
  76. package/dist/cjs/utils/bus.cjs +1 -1
  77. package/dist/cjs/utils/index.cjs +1 -0
  78. package/dist/cjs/utils/theme.cjs +8 -8
  79. package/dist/cjs/utils/tree.cjs +1 -1
  80. package/dist/esm/_virtual/_rolldown/runtime.js +9 -0
  81. package/dist/esm/components/auth/can.js +17 -36
  82. package/dist/esm/components/auth/index.js +1 -0
  83. package/dist/esm/components/common/icon.js +16 -24
  84. package/dist/esm/components/common/index.js +2 -0
  85. package/dist/esm/components/common/logo.js +50 -49
  86. package/dist/esm/components/index.js +14 -0
  87. package/dist/esm/components/loader/iframe.js +16 -18
  88. package/dist/esm/components/loader/index.js +1 -0
  89. package/dist/esm/components/loader/loader.js +11 -40
  90. package/dist/esm/components/loader/remote/index.js +2 -0
  91. package/dist/esm/components/loader/remote/loader.js +118 -156
  92. package/dist/esm/components/loader/remote/render.js +12 -17
  93. package/dist/esm/components/overlay/index.js +1 -0
  94. package/dist/esm/components/overlay/overlay.js +54 -70
  95. package/dist/esm/components/status/error.js +7 -9
  96. package/dist/esm/components/status/exception.js +21 -37
  97. package/dist/esm/components/status/index.js +4 -0
  98. package/dist/esm/components/status/notAuthorized.js +7 -9
  99. package/dist/esm/components/status/notFound.js +7 -9
  100. package/dist/esm/config/color.js +288 -290
  101. package/dist/esm/directive/index.js +1 -0
  102. package/dist/esm/directive/permission.js +7 -27
  103. package/dist/esm/hooks/auth.js +154 -120
  104. package/dist/esm/hooks/config.js +11 -9
  105. package/dist/esm/hooks/data.js +416 -415
  106. package/dist/esm/hooks/export.js +32 -36
  107. package/dist/esm/hooks/exportCsv.js +42 -46
  108. package/dist/esm/hooks/form.js +86 -95
  109. package/dist/esm/hooks/formExtend.js +36 -40
  110. package/dist/esm/hooks/formValidate.js +22 -25
  111. package/dist/esm/hooks/i18n.js +14 -18
  112. package/dist/esm/hooks/import.js +45 -54
  113. package/dist/esm/hooks/importCsv.js +90 -83
  114. package/dist/esm/hooks/index.js +31 -0
  115. package/dist/esm/hooks/json/index.js +14 -22
  116. package/dist/esm/hooks/json/utils/contextManager.js +35 -26
  117. package/dist/esm/hooks/json/utils/expressionParser.js +100 -123
  118. package/dist/esm/hooks/json/vFor.js +50 -55
  119. package/dist/esm/hooks/json/vIf.js +17 -16
  120. package/dist/esm/hooks/json/vModel.js +96 -106
  121. package/dist/esm/hooks/json/vOn.js +30 -32
  122. package/dist/esm/hooks/json/vShow.js +20 -22
  123. package/dist/esm/hooks/json/vText.js +44 -51
  124. package/dist/esm/hooks/json.js +131 -132
  125. package/dist/esm/hooks/list.js +150 -184
  126. package/dist/esm/hooks/manage.js +25 -22
  127. package/dist/esm/hooks/menu.js +57 -61
  128. package/dist/esm/hooks/overlay.js +6 -23
  129. package/dist/esm/hooks/select.js +84 -94
  130. package/dist/esm/hooks/theme.js +289 -219
  131. package/dist/esm/hooks/tree.js +43 -47
  132. package/dist/esm/hooks/upload/index.js +2 -0
  133. package/dist/esm/hooks/upload/local.js +24 -30
  134. package/dist/esm/hooks/upload/s3.js +70 -80
  135. package/dist/esm/hooks/upload.js +256 -272
  136. package/dist/esm/index.js +150 -141
  137. package/dist/esm/main.js +24 -45
  138. package/dist/esm/preset/authProvider.js +62 -68
  139. package/dist/esm/preset/dataProvider.js +154 -180
  140. package/dist/esm/preset/i18nProvider.js +28 -30
  141. package/dist/esm/preset/index.js +3 -0
  142. package/dist/esm/provider/app.js +124 -151
  143. package/dist/esm/provider/index.js +2 -0
  144. package/dist/esm/provider/tab.js +49 -66
  145. package/dist/esm/router/index.js +1 -0
  146. package/dist/esm/router/route.js +39 -46
  147. package/dist/esm/stores/auth.js +51 -46
  148. package/dist/esm/stores/i18n.js +32 -29
  149. package/dist/esm/stores/index.js +7 -0
  150. package/dist/esm/stores/jsonSchema.js +47 -34
  151. package/dist/esm/stores/manage.js +63 -48
  152. package/dist/esm/stores/route.js +60 -56
  153. package/dist/esm/stores/tab.js +55 -60
  154. package/dist/esm/stores/theme.js +48 -55
  155. package/dist/esm/utils/bus.js +3 -5
  156. package/dist/esm/utils/index.js +3 -0
  157. package/dist/esm/utils/theme.js +110 -93
  158. package/dist/esm/utils/tree.js +28 -37
  159. package/package.json +1 -1
@@ -1,23 +1,26 @@
1
- import { trimStart as a } from "lodash-es";
2
- import { inject as c } from "vue";
3
- import { useRoute as s } from "vue-router";
4
- import "pinia";
5
- import { useManageStore as g } from "../stores/manage.js";
6
- function v(e) {
7
- const n = c("dux.manage");
8
- if (e || (e = n?.value), !e)
9
- throw new Error("manage name is not defined");
10
- const { config: t } = g(e), i = (r) => `${t?.routePrefix}/${a(r || "", "/")}`, u = (r, o) => t?.dataProvider?.[o || "default"]?.apiUrl?.(r, t?.apiBasePath) || "", f = s();
11
- return {
12
- config: t,
13
- getRoutePath: i,
14
- getApiUrl: u,
15
- getPath: () => {
16
- const r = f.path, o = t?.routePrefix || "";
17
- return a(r.replace(o, ""), "/");
18
- }
19
- };
1
+ import { useManageStore as e } from "../stores/manage.js";
2
+ import "../stores/index.js";
3
+ import { inject as t } from "vue";
4
+ import { useRoute as n } from "vue-router";
5
+ import { trimStart as r } from "lodash-es";
6
+ /**
7
+ * Manage
8
+ * get manage config
9
+ * @param name Manage name
10
+ * @returns Manage
11
+ */
12
+ function i(i) {
13
+ let a = t("dux.manage");
14
+ if (i ||= a?.value, !i) throw Error("manage name is not defined");
15
+ let { config: o } = e(i), s = (e) => `${o?.routePrefix}/${r(e || "", "/")}`, c = (e, t) => (o?.dataProvider?.[t || "default"])?.apiUrl?.(e, o?.apiBasePath) || "", l = n();
16
+ return {
17
+ config: o,
18
+ getRoutePath: s,
19
+ getApiUrl: c,
20
+ getPath: () => {
21
+ let e = l.path, t = o?.routePrefix || "";
22
+ return r(e.replace(t, ""), "/");
23
+ }
24
+ };
20
25
  }
21
- export {
22
- v as useManage
23
- };
26
+ export { i as useManage };
@@ -1,62 +1,58 @@
1
- import { cloneDeep as y } from "lodash-es";
2
- import { storeToRefs as R } from "pinia";
3
- import { computed as l, ref as f, watch as M } from "vue";
4
- import { useRoute as S } from "vue-router";
5
- import { useRouteStore as A } from "../stores/route.js";
6
- import "../utils/bus.js";
7
- import { arrayToTree as K, searchTree as c } from "../utils/tree.js";
8
- function C(t) {
9
- const g = A(), { routes: x } = R(g), v = (e = !0) => y(x.value)?.filter((n) => !!n?.name).filter((n) => !e || n.hidden === void 0 || n.hidden === !1), d = l(() => {
10
- const e = v(!1);
11
- return K(e, {
12
- idKey: "name",
13
- parentKey: "parent",
14
- childrenKey: "children",
15
- sortKey: "sort"
16
- }, void 0);
17
- }), u = l(() => {
18
- const e = v();
19
- return K(e, {
20
- idKey: "name",
21
- parentKey: "parent",
22
- childrenKey: "children",
23
- sortKey: "sort"
24
- }, void 0);
25
- }), r = S(), h = f(r.name), a = f(r.name), o = f(r.name), L = l(() => t?.doubleMenu ? y(u.value)?.map((n) => (delete n.children, n)) : u.value), b = l(() => t?.doubleMenu ? u.value?.find((n) => n.name === a.value)?.children || [] : []), T = l(() => c(d.value, (n) => n?.name === r.name));
26
- M(() => t?.doubleMenu, () => {
27
- if (t?.doubleMenu) {
28
- const e = c(u.value, (n) => n?.name === a.value);
29
- a.value = e?.[0]?.name, o.value = e?.[e.length - 1]?.name;
30
- } else {
31
- const e = c(u.value, (n) => n?.name === o.value);
32
- a.value = e?.[e.length - 1]?.name, o.value = e?.[e.length - 1]?.name;
33
- }
34
- }, { immediate: !0 });
35
- const I = l(() => t?.doubleMenu ? b.value.length > 0 : !0);
36
- return M([r, d, () => t?.doubleMenu], () => {
37
- const e = c(d.value, (i) => i.name === r.name), m = ((i) => {
38
- let p = -1;
39
- for (let s = i.length - 1; s >= 0; s--)
40
- if (i[s].hidden === !1 || i[s].hidden === void 0) {
41
- p = s;
42
- break;
43
- }
44
- return p;
45
- })(e);
46
- h.value = e?.[m]?.name, t?.doubleMenu ? (a.value = e?.[0]?.name, o.value = e?.[m]?.name) : (a.value = e?.[m]?.name, o.value = e?.[m]?.name);
47
- }, { immediate: !0 }), {
48
- data: u,
49
- originalData: d,
50
- getMenu: v,
51
- mainMenu: L,
52
- subMenu: b,
53
- isSubMenu: I,
54
- crumbs: T,
55
- active: h,
56
- appActive: a,
57
- subActive: o
58
- };
1
+ import { useRouteStore as e } from "../stores/route.js";
2
+ import "../stores/index.js";
3
+ import { arrayToTree as t, searchTree as n } from "../utils/tree.js";
4
+ import "../utils/index.js";
5
+ import { computed as r, ref as i, watch as a } from "vue";
6
+ import { useRoute as o } from "vue-router";
7
+ import { storeToRefs as s } from "pinia";
8
+ import { cloneDeep as c } from "lodash-es";
9
+ function l(l) {
10
+ let { routes: u } = s(e()), d = (e = !0) => c(u.value)?.filter((e) => !!e?.name).filter((t) => !e || t.hidden === void 0 || t.hidden === !1), f = r(() => t(d(!1), {
11
+ idKey: "name",
12
+ parentKey: "parent",
13
+ childrenKey: "children",
14
+ sortKey: "sort"
15
+ }, void 0)), p = r(() => t(d(), {
16
+ idKey: "name",
17
+ parentKey: "parent",
18
+ childrenKey: "children",
19
+ sortKey: "sort"
20
+ }, void 0)), m = o(), h = i(m.name), g = i(m.name), _ = i(m.name), v = r(() => l?.doubleMenu ? c(p.value)?.map((e) => (delete e.children, e)) : p.value), y = r(() => l?.doubleMenu && p.value?.find((e) => e.name === g.value)?.children || []), b = r(() => n(f.value, (e) => e?.name === m.name));
21
+ a(() => l?.doubleMenu, () => {
22
+ if (l?.doubleMenu) {
23
+ let e = n(p.value, (e) => e?.name === g.value);
24
+ g.value = e?.[0]?.name, _.value = e?.[e.length - 1]?.name;
25
+ } else {
26
+ let e = n(p.value, (e) => e?.name === _.value);
27
+ g.value = e?.[e.length - 1]?.name, _.value = e?.[e.length - 1]?.name;
28
+ }
29
+ }, { immediate: !0 });
30
+ let x = r(() => l?.doubleMenu ? y.value.length > 0 : !0);
31
+ return a([
32
+ m,
33
+ f,
34
+ () => l?.doubleMenu
35
+ ], () => {
36
+ let e = n(f.value, (e) => e.name === m.name), t = ((e) => {
37
+ let t = -1;
38
+ for (let n = e.length - 1; n >= 0; n--) if (e[n].hidden === !1 || e[n].hidden === void 0) {
39
+ t = n;
40
+ break;
41
+ }
42
+ return t;
43
+ })(e);
44
+ h.value = e?.[t]?.name, l?.doubleMenu ? (g.value = e?.[0]?.name, _.value = e?.[t]?.name) : (g.value = e?.[t]?.name, _.value = e?.[t]?.name);
45
+ }, { immediate: !0 }), {
46
+ data: p,
47
+ originalData: f,
48
+ getMenu: d,
49
+ mainMenu: v,
50
+ subMenu: y,
51
+ isSubMenu: x,
52
+ crumbs: b,
53
+ active: h,
54
+ appActive: g,
55
+ subActive: _
56
+ };
59
57
  }
60
- export {
61
- C as useMenu
62
- };
58
+ export { l as useMenu };
@@ -1,25 +1,8 @@
1
+ import { DuxOverlay as e } from "../components/overlay/overlay.js";
2
+ import "../components/index.js";
1
3
  import { useOverlay as t } from "@overlastic/vue";
2
- import "vue";
3
- import "vue-router";
4
- import "pinia";
5
- import "lodash-es";
6
- import "@tanstack/vue-query";
7
- import "json-2-csv";
8
- import "@vee-validate/rules";
9
- import "vee-validate";
10
- import "@vueuse/core";
11
- import "./json/index.js";
12
- import "../utils/bus.js";
13
- import "colorizr";
14
- import "axios";
15
- import "clsx";
16
- import { DuxOverlay as m } from "../components/overlay/overlay.js";
17
- function $() {
18
- const r = t(m);
19
- return {
20
- show: (o) => r(o)
21
- };
4
+ function n() {
5
+ let n = t(e);
6
+ return { show: (e) => n(e) };
22
7
  }
23
- export {
24
- $ as useOverlay
25
- };
8
+ export { n as useOverlay };
@@ -1,95 +1,85 @@
1
- import { debounce as j, isArray as C } from "lodash-es";
2
- import { toRef as z, ref as i, computed as u, unref as c, reactive as D, watch as S } from "vue";
3
- import { useList as I, useMany as M } from "./data.js";
4
- function G(o) {
5
- const s = z(o, "defaultValue"), d = i(), f = u(() => c(o.path) || ""), v = u(() => c(o.params) || {}), g = u(() => c(o.providerName)), p = i({
6
- page: 1,
7
- pageSize: typeof o.pagination == "number" ? o.pagination : o.pagination ? 20 : 0
8
- }), y = i(!1), l = D({
9
- keyword: "",
10
- ...v.value
11
- }), m = j((e) => {
12
- d.value = e, l.keyword = e;
13
- }, o.debounce || 300), x = (e) => {
14
- m(e);
15
- };
16
- S(v, (e) => {
17
- const t = e || {};
18
- Object.keys(l).forEach((a) => {
19
- a !== "keyword" && (a in t || delete l[a]);
20
- }), Object.entries(t).forEach(([a, n]) => {
21
- l[a] = n;
22
- }), l.keyword = d.value || "";
23
- }, {
24
- deep: !0,
25
- immediate: !0
26
- });
27
- const { data: h, isLoading: E, total: O, pageCount: k, refetch: N } = I({
28
- get path() {
29
- return f.value;
30
- },
31
- filters: l,
32
- get pagination() {
33
- return o.pagination ? p.value : void 0;
34
- },
35
- get providerName() {
36
- return g.value;
37
- }
38
- }), b = i([]), w = (e) => {
39
- const t = o.optionField || o.optionValue;
40
- return typeof t == "string" ? e[t] || e.value || e.id : typeof t == "function" ? t(e) : e.value || e.id;
41
- }, A = (e) => {
42
- const { optionLabel: t = "label", optionValue: a = "value" } = o;
43
- let n;
44
- typeof t == "function" ? n = t(e) : typeof t == "string" ? n = e[t] || e.label || e.name || e.title || String(e.value || e.id || "") : n = e.label || e.name || e.title || String(e.value || e.id || "");
45
- let r;
46
- return typeof a == "function" ? r = a(e) : typeof a == "string" ? r = e[a] || e.value || e.id : r = e.value || e.id, {
47
- label: n,
48
- value: r,
49
- raw: e
50
- };
51
- }, V = u(() => {
52
- const e = h.value?.data || [], t = [...b.value];
53
- return e.forEach((a) => {
54
- t.some(
55
- (r) => w(r) === w(a)
56
- ) || t.push(a);
57
- }), t.map((a) => A(a));
58
- }), F = u(() => h.value?.meta || {}), { refetch: L } = M({
59
- get path() {
60
- return f.value;
61
- },
62
- get ids() {
63
- return C(s.value) ? s.value : [s.value];
64
- },
65
- options: {
66
- enabled: !1
67
- },
68
- providerName: g.value
69
- });
70
- S(s, async (e) => {
71
- if (!(y.value || !e || (y.value = !0, (Array.isArray(e) ? e : [e]).every(
72
- (n) => V.value.some((r) => r.value === n)
73
- ))))
74
- try {
75
- const n = await L();
76
- b.value = n?.data?.data || [];
77
- } catch (n) {
78
- console.warn("Failed to fetch selected items:", n);
79
- }
80
- }, { immediate: !0, deep: !0 });
81
- const P = u(() => E.value);
82
- return {
83
- onSearch: x,
84
- options: V,
85
- meta: F,
86
- loading: P,
87
- refetch: N,
88
- pagination: p,
89
- total: O,
90
- pageCount: k
91
- };
1
+ import { useList as e, useMany as t } from "./data.js";
2
+ import { computed as n, reactive as r, ref as i, toRef as a, unref as o, watch as s } from "vue";
3
+ import { debounce as c, isArray as l } from "lodash-es";
4
+ function u(u) {
5
+ let d = a(u, "defaultValue"), f = i(), p = n(() => o(u.path) || ""), m = n(() => o(u.params) || {}), h = n(() => o(u.providerName)), g = i({
6
+ page: 1,
7
+ pageSize: typeof u.pagination == "number" ? u.pagination : u.pagination ? 20 : 0
8
+ }), _ = i(!1), v = r({
9
+ keyword: "",
10
+ ...m.value
11
+ }), y = c((e) => {
12
+ f.value = e, v.keyword = e;
13
+ }, u.debounce || 300), b = (e) => {
14
+ y(e);
15
+ };
16
+ s(m, (e) => {
17
+ let t = e || {};
18
+ Object.keys(v).forEach((e) => {
19
+ e !== "keyword" && (e in t || delete v[e]);
20
+ }), Object.entries(t).forEach(([e, t]) => {
21
+ v[e] = t;
22
+ }), v.keyword = f.value || "";
23
+ }, {
24
+ deep: !0,
25
+ immediate: !0
26
+ });
27
+ let { data: x, isLoading: S, total: C, pageCount: w, refetch: T } = e({
28
+ get path() {
29
+ return p.value;
30
+ },
31
+ filters: v,
32
+ get pagination() {
33
+ return u.pagination ? g.value : void 0;
34
+ },
35
+ get providerName() {
36
+ return h.value;
37
+ }
38
+ }), E = i([]), D = (e) => {
39
+ let t = u.optionField || u.optionValue;
40
+ return typeof t == "string" ? e[t] || e.value || e.id : typeof t == "function" ? t(e) : e.value || e.id;
41
+ }, O = (e) => {
42
+ let { optionLabel: t = "label", optionValue: n = "value" } = u, r;
43
+ r = typeof t == "function" ? t(e) : typeof t == "string" ? e[t] || e.label || e.name || e.title || String(e.value || e.id || "") : e.label || e.name || e.title || String(e.value || e.id || "");
44
+ let i;
45
+ return i = typeof n == "function" ? n(e) : typeof n == "string" ? e[n] || e.value || e.id : e.value || e.id, {
46
+ label: r,
47
+ value: i,
48
+ raw: e
49
+ };
50
+ }, k = n(() => {
51
+ let e = x.value?.data || [], t = [...E.value];
52
+ return e.forEach((e) => {
53
+ t.some((t) => D(t) === D(e)) || t.push(e);
54
+ }), t.map((e) => O(e));
55
+ }), A = n(() => x.value?.meta || {}), { refetch: j } = t({
56
+ get path() {
57
+ return p.value;
58
+ },
59
+ get ids() {
60
+ return l(d.value) ? d.value : [d.value];
61
+ },
62
+ options: { enabled: !1 },
63
+ providerName: h.value
64
+ });
65
+ return s(d, async (e) => {
66
+ if (!(_.value || !e) && (_.value = !0, !(Array.isArray(e) ? e : [e]).every((e) => k.value.some((t) => t.value === e)))) try {
67
+ E.value = (await j())?.data?.data || [];
68
+ } catch (e) {
69
+ console.warn("Failed to fetch selected items:", e);
70
+ }
71
+ }, {
72
+ immediate: !0,
73
+ deep: !0
74
+ }), {
75
+ onSearch: b,
76
+ options: k,
77
+ meta: A,
78
+ loading: n(() => S.value),
79
+ refetch: T,
80
+ pagination: g,
81
+ total: C,
82
+ pageCount: w
83
+ };
92
84
  }
93
- export {
94
- G as useSelect
95
- };
85
+ export { u as useSelect };