@duxweb/dvha-pro 1.0.18 → 1.0.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.
Files changed (147) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/card/card.cjs +1 -1
  3. package/dist/cjs/components/chart/echart.cjs +1 -1
  4. package/dist/cjs/components/code/code.cjs +1 -0
  5. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  6. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  7. package/dist/cjs/components/data/selectModal.cjs +1 -1
  8. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  9. package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
  10. package/dist/cjs/components/form/formItem.cjs +1 -1
  11. package/dist/cjs/components/form/formLayout.cjs +1 -1
  12. package/dist/cjs/components/form/modalForm.cjs +1 -1
  13. package/dist/cjs/components/form/pageForm.cjs +1 -1
  14. package/dist/cjs/components/form/settingForm.cjs +1 -1
  15. package/dist/cjs/components/icon/icon.cjs +1 -1
  16. package/dist/cjs/components/layout/filter.cjs +1 -1
  17. package/dist/cjs/components/layout/filterLayout.cjs +1 -0
  18. package/dist/cjs/components/layout/list.cjs +1 -1
  19. package/dist/cjs/components/layout/table.cjs +1 -1
  20. package/dist/cjs/components/level/level.cjs +1 -1
  21. package/dist/cjs/components/modal/modal.cjs +1 -1
  22. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  23. package/dist/cjs/components/panel/collapse.cjs +1 -0
  24. package/dist/cjs/components/panel/setting.cjs +1 -1
  25. package/dist/cjs/components/status/listEmpty.cjs +1 -0
  26. package/dist/cjs/components/table/table.cjs +1 -0
  27. package/dist/cjs/components/table/tablePage.cjs +1 -1
  28. package/dist/cjs/components/tree/treeFilter.cjs +1 -1
  29. package/dist/cjs/components/upload/config.cjs +1 -0
  30. package/dist/cjs/components/upload/file.cjs +1 -1
  31. package/dist/cjs/components/upload/image.cjs +1 -1
  32. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  33. package/dist/cjs/components/upload/manager.cjs +1 -1
  34. package/dist/cjs/dvha-pro.css +1 -1
  35. package/dist/cjs/hooks/action.cjs +1 -1
  36. package/dist/cjs/hooks/dialog.cjs +1 -1
  37. package/dist/cjs/hooks/drawer.cjs +1 -1
  38. package/dist/cjs/hooks/modal.cjs +1 -1
  39. package/dist/cjs/hooks/table/image.cjs +1 -1
  40. package/dist/cjs/hooks/table/media.cjs +1 -1
  41. package/dist/cjs/hooks/table.cjs +1 -1
  42. package/dist/cjs/index.cjs +1 -1
  43. package/dist/cjs/langs/en-US.json.cjs +1 -1
  44. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  45. package/dist/cjs/pages/authLayout.cjs +1 -1
  46. package/dist/cjs/pages/layout/page.cjs +1 -1
  47. package/dist/cjs/pages/login.cjs +1 -1
  48. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  49. package/dist/cjs/pages/menu/button.cjs +1 -1
  50. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  51. package/dist/cjs/pages/menu/main.cjs +1 -1
  52. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  53. package/dist/cjs/pages/page.cjs +1 -1
  54. package/dist/cjs/pages/page404.cjs +1 -1
  55. package/dist/cjs/pages/pageStatus.cjs +1 -1
  56. package/dist/cjs/theme/naiveTheme.cjs +1 -1
  57. package/dist/cjs/theme/uno.css.cjs +23 -7
  58. package/dist/esm/component.js +36 -34
  59. package/dist/esm/components/card/card.js +6 -6
  60. package/dist/esm/components/chart/echart.js +17 -6
  61. package/dist/esm/components/code/code.js +53 -0
  62. package/dist/esm/components/crop/imageCrop.js +37 -26
  63. package/dist/esm/components/data/dynamicSelect.js +29 -18
  64. package/dist/esm/components/data/selectModal.js +49 -38
  65. package/dist/esm/components/drawer/drawer.js +17 -28
  66. package/dist/esm/components/drawer/drawerPage.js +54 -17
  67. package/dist/esm/components/form/formItem.js +17 -17
  68. package/dist/esm/components/form/formLayout.js +8 -8
  69. package/dist/esm/components/form/modalForm.js +44 -35
  70. package/dist/esm/components/form/pageForm.js +81 -43
  71. package/dist/esm/components/form/settingForm.js +28 -17
  72. package/dist/esm/components/icon/icon.js +23 -12
  73. package/dist/esm/components/layout/filter.js +15 -11
  74. package/dist/esm/components/layout/filterLayout.js +34 -0
  75. package/dist/esm/components/layout/list.js +211 -161
  76. package/dist/esm/components/layout/table.js +217 -186
  77. package/dist/esm/components/level/level.js +28 -17
  78. package/dist/esm/components/modal/modal.js +9 -9
  79. package/dist/esm/components/modal/modalPage.js +2 -2
  80. package/dist/esm/components/panel/collapse.js +49 -0
  81. package/dist/esm/components/panel/setting.js +3 -3
  82. package/dist/esm/components/status/listEmpty.js +26 -0
  83. package/dist/esm/components/table/table.js +110 -0
  84. package/dist/esm/components/table/tablePage.js +24 -18
  85. package/dist/esm/components/tree/treeFilter.js +44 -39
  86. package/dist/esm/components/upload/config.js +32 -0
  87. package/dist/esm/components/upload/file.js +142 -116
  88. package/dist/esm/components/upload/image.js +95 -66
  89. package/dist/esm/components/upload/manage/item.js +17 -6
  90. package/dist/esm/components/upload/manager.js +202 -164
  91. package/dist/esm/dvha-pro.css +1 -1
  92. package/dist/esm/hooks/action.js +77 -75
  93. package/dist/esm/hooks/dialog.js +13 -2
  94. package/dist/esm/hooks/drawer.js +13 -2
  95. package/dist/esm/hooks/modal.js +13 -2
  96. package/dist/esm/hooks/table/image.js +21 -10
  97. package/dist/esm/hooks/table/media.js +20 -9
  98. package/dist/esm/hooks/table.js +16 -16
  99. package/dist/esm/index.js +174 -164
  100. package/dist/esm/langs/en-US.json.js +5 -3
  101. package/dist/esm/langs/zh-CN.json.js +5 -3
  102. package/dist/esm/pages/authLayout.js +19 -8
  103. package/dist/esm/pages/layout/page.js +17 -6
  104. package/dist/esm/pages/login.js +40 -29
  105. package/dist/esm/pages/menu/avatar.js +97 -86
  106. package/dist/esm/pages/menu/button.js +23 -12
  107. package/dist/esm/pages/menu/cmd.js +45 -34
  108. package/dist/esm/pages/menu/main.js +40 -27
  109. package/dist/esm/pages/menu/mobile.js +13 -2
  110. package/dist/esm/pages/page.js +1 -1
  111. package/dist/esm/pages/page404.js +20 -9
  112. package/dist/esm/pages/pageStatus.js +31 -15
  113. package/dist/esm/theme/naiveTheme.js +6 -6
  114. package/dist/esm/theme/uno.css.js +23 -7
  115. package/dist/types/components/code/code.d.ts +44 -0
  116. package/dist/types/components/code/index.d.ts +1 -0
  117. package/dist/types/components/drawer/drawer.d.ts +2 -0
  118. package/dist/types/components/drawer/drawerPage.d.ts +20 -1
  119. package/dist/types/components/form/formItem.d.ts +2 -2
  120. package/dist/types/components/form/formLayout.d.ts +3 -3
  121. package/dist/types/components/form/modalForm.d.ts +3 -3
  122. package/dist/types/components/form/pageForm.d.ts +12 -0
  123. package/dist/types/components/index.d.ts +1 -0
  124. package/dist/types/components/layout/filterLayout.d.ts +32 -0
  125. package/dist/types/components/layout/index.d.ts +1 -0
  126. package/dist/types/components/layout/list.d.ts +7 -1
  127. package/dist/types/components/layout/table.d.ts +10 -1
  128. package/dist/types/components/list/card.d.ts +6 -0
  129. package/dist/types/components/list/list.d.ts +6 -0
  130. package/dist/types/components/panel/collapse.d.ts +14 -0
  131. package/dist/types/components/panel/index.d.ts +1 -0
  132. package/dist/types/components/select/cardSelect.d.ts +1 -1
  133. package/dist/types/components/status/index.d.ts +1 -0
  134. package/dist/types/components/status/listEmpty.d.ts +11 -0
  135. package/dist/types/components/table/index.d.ts +1 -0
  136. package/dist/types/components/table/table.d.ts +6552 -0
  137. package/dist/types/components/table/tablePage.d.ts +9 -0
  138. package/dist/types/components/tree/treeFilter.d.ts +13 -12
  139. package/dist/types/components/upload/config.d.ts +13 -0
  140. package/dist/types/components/upload/file.d.ts +4 -0
  141. package/dist/types/components/upload/image.d.ts +30 -2
  142. package/dist/types/components/upload/manager.d.ts +4 -0
  143. package/dist/types/hooks/drawer.d.ts +1 -0
  144. package/dist/types/hooks/table/types.d.ts +1 -0
  145. package/dist/types/main.d.ts +6 -0
  146. package/dist/types/pages/pageStatus.d.ts +11 -1
  147. package/package.json +7 -5
@@ -1,4 +1,4 @@
1
- import { defineComponent as c, defineAsyncComponent as s, createVNode as t, mergeProps as n, Suspense as m } from "vue";
1
+ import { defineComponent as c, defineAsyncComponent as m, createVNode as t, mergeProps as n, Suspense as s } from "vue";
2
2
  import { useExtendOverlay as f } from "@overlastic/vue";
3
3
  import { NModal as g, NSpin as b } from "naive-ui";
4
4
  const v = /* @__PURE__ */ c({
@@ -27,13 +27,13 @@ const v = /* @__PURE__ */ c({
27
27
  const {
28
28
  visible: l,
29
29
  resolve: d,
30
- reject: o,
30
+ reject: a,
31
31
  vanish: i
32
32
  } = f({
33
33
  duration: 1e3
34
- }), a = (e == null ? void 0 : e.componentProps) || {};
35
- a.onConfirm = d, a.onClose = o;
36
- const r = typeof e.component == "function" ? s(e.component) : e.component;
34
+ }), o = (e == null ? void 0 : e.componentProps) || {};
35
+ o.title = e.title, o.onConfirm = d, o.onClose = a;
36
+ const r = typeof e.component == "function" ? m(e.component) : e.component;
37
37
  return () => t(g, n({
38
38
  displayDirective: "show",
39
39
  show: l.value,
@@ -41,10 +41,10 @@ const v = /* @__PURE__ */ c({
41
41
  i();
42
42
  },
43
43
  onClose: () => {
44
- o();
44
+ a();
45
45
  },
46
46
  onEsc: () => {
47
- o();
47
+ a();
48
48
  },
49
49
  draggable: e.draggable,
50
50
  class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur",
@@ -60,8 +60,8 @@ const v = /* @__PURE__ */ c({
60
60
  style: {
61
61
  width: typeof e.width == "number" ? `${e.width}px` : e.width
62
62
  }
63
- }, [t(m, null, {
64
- default: () => t(r, n(a, {
63
+ }, [t(s, null, {
64
+ default: () => t(r, n(o, {
65
65
  title: e.title,
66
66
  handle: u
67
67
  }), null),
@@ -32,7 +32,7 @@ const x = /* @__PURE__ */ f({
32
32
  }), () => {
33
33
  var t, d, r;
34
34
  return a("div", {
35
- class: "flex flex-col gap-2"
35
+ class: "flex flex-col"
36
36
  }, [a("div", {
37
37
  class: ["px-4 py-3 border-b border-muted rounded-t flex justify-between items-center bg-white dark:bg-gray-800/50", n.draggable && "cursor-move", n.handle]
38
38
  }, [a("div", {
@@ -49,7 +49,7 @@ const x = /* @__PURE__ */ f({
49
49
  class: "i-tabler:x"
50
50
  }, null)
51
51
  })])]), a("div", {
52
- class: "px-4 py-2"
52
+ class: "p-4"
53
53
  }, [(t = e.default) == null ? void 0 : t.call(e)]), ((d = e.footer) == null ? void 0 : d.call(e)) && a("div", {
54
54
  class: "flex justify-end gap-2 p-3 rounded-b border-t border-muted bg-muted dark:bg-gray-800/50"
55
55
  }, [(r = e.footer) == null ? void 0 : r.call(e)])]);
@@ -0,0 +1,49 @@
1
+ import { defineComponent as n, ref as c, createVNode as a } from "vue";
2
+ import t from "clsx";
3
+ const h = /* @__PURE__ */ n({
4
+ name: "DuxCollapsePanel",
5
+ props: {
6
+ title: String,
7
+ desc: String,
8
+ defaultShow: Boolean,
9
+ highlight: Boolean
10
+ },
11
+ setup(e, {
12
+ slots: i
13
+ }) {
14
+ const l = c(!!e.defaultShow);
15
+ return () => {
16
+ var d, r;
17
+ return a("div", {
18
+ class: t(["border rounded-sm", e.highlight ? "border-primary" : "border-muted"])
19
+ }, [a("div", {
20
+ class: t(["px-4 py-3 flex justify-between items-center", e.highlight ? "bg-primary/10" : "bg-gray/5"])
21
+ }, [a("div", {
22
+ class: "flex gap-2 items-start"
23
+ }, [a("div", {
24
+ class: "pt-0.5"
25
+ }, [(d = i.suffix) == null ? void 0 : d.call(i)]), a("div", {
26
+ class: "flex flex-col"
27
+ }, [a("div", {
28
+ class: "font-medium text-base"
29
+ }, [e == null ? void 0 : e.title]), (e == null ? void 0 : e.desc) && a("div", {
30
+ class: "text-muted"
31
+ }, [e.desc])])]), a("div", {
32
+ class: t(["p-2 rounded-full text-primary cursor-pointer", e.highlight ? "bg-primary/10" : "bg-gray/5"]),
33
+ onClick: () => l.value = !l.value
34
+ }, [a("div", {
35
+ class: t(["i-tabler:arrow-down size-4 transition-all", l.value ? "" : "rotate-180"])
36
+ }, null)])]), a("div", {
37
+ class: t("transition-all overflow-hidden", {
38
+ "max-h-0": !l.value,
39
+ "max-h-500": l.value
40
+ })
41
+ }, [a("div", {
42
+ class: "p-4"
43
+ }, [(r = i.default) == null ? void 0 : r.call(i)])])]);
44
+ };
45
+ }
46
+ });
47
+ export {
48
+ h as DuxCollapsePanel
49
+ };
@@ -2,7 +2,7 @@ import { defineComponent as r, createVNode as e } from "vue";
2
2
  import { DuxCard as n } from "../card/card.js";
3
3
  import "clsx";
4
4
  import "naive-ui";
5
- const p = /* @__PURE__ */ r({
5
+ const m = /* @__PURE__ */ r({
6
6
  name: "DuxPanelCard",
7
7
  props: {
8
8
  title: {
@@ -27,7 +27,7 @@ const p = /* @__PURE__ */ r({
27
27
  }, [e("div", {
28
28
  class: "flex items-center"
29
29
  }, [e("div", {
30
- class: "flex-1 flex flex-col gap-1"
30
+ class: "flex-1 flex flex-col"
31
31
  }, [e("div", {
32
32
  class: "text-base"
33
33
  }, [i.title]), i.description && e("div", {
@@ -48,5 +48,5 @@ const p = /* @__PURE__ */ r({
48
48
  }
49
49
  });
50
50
  export {
51
- p as DuxPanelCard
51
+ m as DuxPanelCard
52
52
  };
@@ -0,0 +1,26 @@
1
+ import { defineComponent as i, createVNode as e } from "vue";
2
+ import { useI18n as m } from "@duxweb/dvha-core";
3
+ import { DuxDrawEmptyForm as n } from "../draw/drawEmptyForm.js";
4
+ const a = /* @__PURE__ */ i({
5
+ name: "DuxListEmpty",
6
+ props: {
7
+ title: String,
8
+ desc: String,
9
+ bordered: Boolean
10
+ },
11
+ setup(t) {
12
+ const {
13
+ t: l
14
+ } = m();
15
+ return () => e("div", {
16
+ class: "flex flex-col items-center justify-center gap-2 h-full"
17
+ }, [e(n, null, null), e("div", {
18
+ class: "text-lg text-default font-bold"
19
+ }, [(t == null ? void 0 : t.title) || l("pages.empty.title")]), e("div", {
20
+ class: "text-muted"
21
+ }, [(t == null ? void 0 : t.desc) || l("pages.empty.desc")])]);
22
+ }
23
+ });
24
+ export {
25
+ a as DuxListEmpty
26
+ };
@@ -0,0 +1,110 @@
1
+ import { defineComponent as u, computed as f, toRef as c, createVNode as o, mergeProps as e } from "vue";
2
+ import { NDataTable as m, NPagination as d } from "naive-ui";
3
+ import { useI18n as b } from "@duxweb/dvha-core";
4
+ import "clsx";
5
+ import { DuxListEmpty as x } from "../status/listEmpty.js";
6
+ import "vue-router";
7
+ import "@overlastic/vue";
8
+ import "vue-echarts";
9
+ import { useWindowSize as g } from "@vueuse/core";
10
+ import "vue-cropper";
11
+ import "jinrishici";
12
+ import "lodash-es";
13
+ import "vue-draggable-plus";
14
+ import "aieditor";
15
+ import "vee-validate";
16
+ import "@vee-validate/i18n";
17
+ import "colorizr";
18
+ import "echarts";
19
+ import "@ant-design/colors";
20
+ import "@unocss/preset-icons/browser";
21
+ import "@unocss/preset-typography";
22
+ import "unocss/preset-wind4";
23
+ import "@vee-validate/i18n/dist/locale/en.json";
24
+ import "@vee-validate/i18n/dist/locale/zh_CN.json";
25
+ import "vue-command-palette";
26
+ import "@duxweb/dvha-naiveui";
27
+ import "../../pages/page404.js";
28
+ import "@iconify-json/tabler/icons.json";
29
+ import "mime";
30
+ import "vue3-ace-editor";
31
+ import "ace-builds/src-noconflict/mode-vue";
32
+ import "ace-builds/src-noconflict/mode-javascript";
33
+ import "ace-builds/src-noconflict/mode-html";
34
+ import "ace-builds/src-noconflict/mode-json";
35
+ import "ace-builds/src-noconflict/mode-json5";
36
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
37
+ import "ace-builds/src-noconflict/theme-tomorrow";
38
+ import "ace-builds/src-noconflict/ext-searchbox";
39
+ import "ace-builds/src-noconflict/ext-language_tools";
40
+ import "ace-builds/src-noconflict/mode-snippets";
41
+ import "dayjs";
42
+ import "@tanstack/vue-query";
43
+ import { useTable as y } from "../../hooks/table.js";
44
+ import "pinia";
45
+ const ft = /* @__PURE__ */ u({
46
+ name: "DuxTable",
47
+ props: {
48
+ path: {
49
+ type: String,
50
+ required: !0
51
+ },
52
+ filter: {
53
+ type: Object
54
+ },
55
+ columns: {
56
+ type: Array
57
+ },
58
+ pagination: {
59
+ type: [Boolean, Object],
60
+ default: !0
61
+ }
62
+ },
63
+ extends: m,
64
+ setup(t) {
65
+ const p = f(() => {
66
+ const {
67
+ path: r,
68
+ filter: v,
69
+ columns: h,
70
+ pagination: D,
71
+ ...s
72
+ } = t;
73
+ return s;
74
+ }), a = c(t.filter || {}), i = y({
75
+ path: t.path,
76
+ filters: a.value,
77
+ columns: t.columns || [],
78
+ pagination: t.pagination
79
+ }), {
80
+ width: l
81
+ } = g(), {
82
+ t: n
83
+ } = b();
84
+ return () => o("div", {
85
+ class: "flex flex-col"
86
+ }, [o(m, e(p.value, i.table.value, {
87
+ class: "flex-1 min-h-0",
88
+ minHeight: 200,
89
+ tableLayout: "fixed",
90
+ flexHeight: !0,
91
+ rowKey: (r) => r.id,
92
+ bordered: !1
93
+ }), {
94
+ empty: () => o(x, {
95
+ bordered: !1
96
+ }, null)
97
+ }), t.pagination && o("div", {
98
+ class: "flex justify-end"
99
+ }, [o(d, e(i.tablePagination.value, {
100
+ simple: l.value < 768
101
+ }), {
102
+ prefix: () => o("div", null, [n("components.list.total", {
103
+ total: i.total.value || 0
104
+ })])
105
+ })])]);
106
+ }
107
+ });
108
+ export {
109
+ ft as DuxTable
110
+ };
@@ -1,36 +1,42 @@
1
- import { defineComponent as d, computed as m, createVNode as i, mergeProps as n } from "vue";
2
- import { NDataTable as p } from "naive-ui";
3
- import { DuxTableLayout as b } from "../layout/table.js";
4
- const g = /* @__PURE__ */ d({
1
+ import { defineComponent as b, computed as d, createVNode as t, mergeProps as o } from "vue";
2
+ import { NDataTable as u } from "naive-ui";
3
+ import { DuxTableLayout as m } from "../layout/table.js";
4
+ import "@duxweb/dvha-core";
5
+ import "clsx";
6
+ import { DuxListEmpty as n } from "../status/listEmpty.js";
7
+ const y = /* @__PURE__ */ b({
5
8
  name: "DuxTablePage",
6
9
  props: {
7
10
  tableProps: {
8
11
  type: Object
9
12
  }
10
13
  },
11
- extends: b,
14
+ extends: m,
12
15
  slots: Object,
13
- setup(t, {
16
+ setup(i, {
14
17
  slots: e
15
18
  }) {
16
- const u = m(() => {
19
+ const p = d(() => {
17
20
  const {
18
- tableProps: a,
19
- ...r
20
- } = t;
21
- return r;
21
+ tableProps: r,
22
+ ...a
23
+ } = i;
24
+ return a;
22
25
  });
23
- return () => i(b, u.value, {
24
- default: (a) => i(p, n({
25
- remote: !0,
26
+ return () => t(m, p.value, {
27
+ default: (r) => t(u, o(r.table.value, i.tableProps, {
26
28
  class: "h-full",
27
29
  minHeight: 200,
28
30
  tableLayout: "fixed",
29
31
  flexHeight: !0,
30
- rowKey: (r) => r.id,
32
+ rowKey: (a) => a.id,
31
33
  bordered: !1,
32
- scrollX: a.width
33
- }, a.table.value, t.tableProps), null),
34
+ scrollX: r.width
35
+ }), {
36
+ empty: () => t(n, {
37
+ bordered: !1
38
+ }, null)
39
+ }),
34
40
  bottom: e == null ? void 0 : e.bottom,
35
41
  tools: e == null ? void 0 : e.tools,
36
42
  actions: e == null ? void 0 : e.actions,
@@ -40,5 +46,5 @@ const g = /* @__PURE__ */ d({
40
46
  }
41
47
  });
42
48
  export {
43
- g as DuxTablePage
49
+ y as DuxTablePage
44
50
  };
@@ -1,9 +1,10 @@
1
- import { defineComponent as Y, toRef as y, ref as r, watch as P, computed as C, createVNode as n, mergeProps as q, Fragment as G } from "vue";
1
+ import { defineComponent as Y, toRef as g, ref as r, watch as P, computed as C, createVNode as n, mergeProps as q, Fragment as G } from "vue";
2
2
  import { useI18n as H, useTree as J, useCustomMutation as Q } from "@duxweb/dvha-core";
3
3
  import { useVModel as W } from "@vueuse/core";
4
4
  import Z from "clsx";
5
- import { NTree as T, NCard as $, NInput as p, NScrollbar as ee, NSpin as te, NDropdown as le } from "naive-ui";
6
- const ce = /* @__PURE__ */ Y({
5
+ import { NTree as T, NInput as $, NScrollbar as p, NSpin as ee, NDropdown as te } from "naive-ui";
6
+ import { DuxCard as le } from "../card/card.js";
7
+ const oe = /* @__PURE__ */ Y({
7
8
  name: "DuxTreeFilter",
8
9
  props: {
9
10
  title: String,
@@ -17,22 +18,26 @@ const ce = /* @__PURE__ */ Y({
17
18
  value: Array,
18
19
  defaultValue: Array,
19
20
  onUpdateValue: Function,
20
- draggable: Boolean
21
+ draggable: Boolean,
22
+ bordered: {
23
+ type: Boolean,
24
+ default: !0
25
+ }
21
26
  },
22
27
  extends: T,
23
28
  setup(t, {
24
29
  emit: U,
25
30
  slots: v
26
31
  }) {
27
- const O = W(t, "value", U, {
32
+ const D = W(t, "value", U, {
28
33
  passive: !1,
29
34
  defaultValue: t.defaultValue
30
- }), I = y(t, "params", {}), N = y(t, "path", ""), A = y(t, "sortPath", ""), V = r(), k = r(0), D = r(0), s = r([]), S = r(), {
35
+ }), I = g(t, "params", {}), N = g(t, "path", ""), A = g(t, "sortPath", ""), O = r(), V = r(0), k = r(0), s = r([]), S = r(), {
31
36
  t: K
32
37
  } = H(), {
33
38
  options: j,
34
- loading: L,
35
- expanded: M
39
+ loading: B,
40
+ expanded: L
36
41
  } = J({
37
42
  path: N.value,
38
43
  params: I.value,
@@ -44,7 +49,7 @@ const ce = /* @__PURE__ */ Y({
44
49
  immediate: !0,
45
50
  deep: !0
46
51
  });
47
- const m = r(!1), _ = C(() => {
52
+ const h = r(!1), M = C(() => {
48
53
  var l;
49
54
  return ((l = t.menus) == null ? void 0 : l.map((e) => ({
50
55
  label: e.label,
@@ -54,20 +59,20 @@ const ce = /* @__PURE__ */ Y({
54
59
  }, null) : void 0,
55
60
  onSelect: e.onSelect
56
61
  }))) || [];
57
- }), z = (l) => {
62
+ }), _ = (l) => {
58
63
  var a;
59
64
  const e = (a = t.menus) == null ? void 0 : a.find((i) => i.value === l);
60
- e && e.onSelect(V.value), m.value = !1;
61
- }, B = Q({
65
+ e && e.onSelect(O.value), h.value = !1;
66
+ }, z = Q({
62
67
  path: A.value,
63
68
  method: "POST"
64
- }), g = (l, e) => {
69
+ }), y = (l, e) => {
65
70
  for (const a of l)
66
71
  if (a.children) {
67
72
  for (const x of a.children)
68
73
  if (x.id === e)
69
74
  return a;
70
- const i = g(a.children, e);
75
+ const i = y(a.children, e);
71
76
  if (i)
72
77
  return i;
73
78
  }
@@ -77,15 +82,15 @@ const ce = /* @__PURE__ */ Y({
77
82
  dropPosition: a
78
83
  }) => {
79
84
  var F, w;
80
- const i = g(s.value, e.id), x = !i, h = [...s.value];
85
+ const i = y(s.value, e.id), x = !i, m = [...s.value];
81
86
  if (x) {
82
87
  const u = s.value.findIndex((X) => X.id === e.id);
83
- u >= 0 && h.splice(u, 1);
88
+ u >= 0 && m.splice(u, 1);
84
89
  } else {
85
90
  const u = ((F = i == null ? void 0 : i.children) == null ? void 0 : F.indexOf(e)) || 0;
86
91
  (w = i == null ? void 0 : i.children) == null || w.splice(u, 1);
87
92
  }
88
- let d = g(h, l.id), b, c = (d == null ? void 0 : d.children) || h, o = 0;
93
+ let d = y(m, l.id), b, c = (d == null ? void 0 : d.children) || m, o = 0;
89
94
  switch (a) {
90
95
  case "before":
91
96
  o = c.findIndex((u) => u.id === l.id), o > 0 && (b = c[o - 1].id);
@@ -97,7 +102,7 @@ const ce = /* @__PURE__ */ Y({
97
102
  o = c.findIndex((u) => u.id === l.id) + 1, b = l.id;
98
103
  break;
99
104
  }
100
- c.splice(o, 0, e), s.value = h, B.mutate({
105
+ c.splice(o, 0, e), s.value = m, z.mutate({
101
106
  payload: {
102
107
  parent_id: d == null ? void 0 : d.id,
103
108
  before_id: b,
@@ -105,7 +110,7 @@ const ce = /* @__PURE__ */ Y({
105
110
  }
106
111
  });
107
112
  }, f = r([]);
108
- P(M, (l) => {
113
+ P(L, (l) => {
109
114
  var e;
110
115
  ((e = f == null ? void 0 : f.value) == null ? void 0 : e.length) > 0 || (f.value = l);
111
116
  }, {
@@ -118,20 +123,20 @@ const ce = /* @__PURE__ */ Y({
118
123
  sortPath: a,
119
124
  params: i,
120
125
  menus: x,
121
- numField: h,
126
+ numField: m,
122
127
  iconField: d,
123
128
  treeOptions: b,
124
129
  value: c,
125
130
  defaultValue: o,
126
- draggable: F,
127
- onUpdateValue: w,
131
+ onUpdateValue: F,
132
+ bordered: w,
128
133
  ...u
129
134
  } = t;
130
135
  return u;
131
136
  });
132
- return () => n($, {
137
+ return () => n(le, {
133
138
  class: "h-full",
134
- contentClass: "p-0! h-full flex flex-col"
139
+ bordered: t.bordered
135
140
  }, {
136
141
  default: () => {
137
142
  var l;
@@ -141,18 +146,18 @@ const ce = /* @__PURE__ */ Y({
141
146
  class: "p-2 flex gap-2 items-center"
142
147
  }, [n("div", {
143
148
  class: "flex-1"
144
- }, [v.header ? v.header() : n(p, {
149
+ }, [v.header ? v.header() : n($, {
145
150
  value: S.value,
146
151
  "onUpdate:value": (e) => S.value = e,
147
152
  placeholder: K("common.keyword")
148
- }, null)]), (l = v.tools) == null ? void 0 : l.call(v)]), n(ee, {
153
+ }, null)]), (l = v.tools) == null ? void 0 : l.call(v)]), n(p, {
149
154
  class: "flex-1 min-h-0",
150
155
  xScrollable: !0
151
156
  }, {
152
157
  default: () => [n("div", {
153
158
  class: "p-2"
154
- }, [n(te, {
155
- show: L.value,
159
+ }, [n(ee, {
160
+ show: B.value,
156
161
  class: "h-full"
157
162
  }, {
158
163
  default: () => [n(T, q(R.value, {
@@ -162,10 +167,10 @@ const ce = /* @__PURE__ */ Y({
162
167
  f.value = e;
163
168
  },
164
169
  blockLine: !0,
165
- selectedKeys: O.value,
170
+ selectedKeys: D.value,
166
171
  onUpdateSelectedKeys: (e) => {
167
172
  var a;
168
- O.value = e, (a = t == null ? void 0 : t.onUpdateValue) == null || a.call(t, e);
173
+ D.value = e, (a = t == null ? void 0 : t.onUpdateValue) == null || a.call(t, e);
169
174
  },
170
175
  onDrop: E,
171
176
  pattern: S.value,
@@ -180,22 +185,22 @@ const ce = /* @__PURE__ */ Y({
180
185
  option: e
181
186
  }) => ({
182
187
  onContextmenu: (a) => {
183
- V.value = e, m.value = !0, k.value = a.clientX, D.value = a.clientY, a.preventDefault();
188
+ O.value = e, h.value = !0, V.value = a.clientX, k.value = a.clientY, a.preventDefault();
184
189
  }
185
190
  })
186
191
  }), null)]
187
192
  })])]
188
- }), n(le, {
193
+ }), n(te, {
189
194
  trigger: "manual",
190
195
  placement: "bottom-start",
191
- show: m.value,
192
- options: _.value,
193
- x: k.value,
194
- y: D.value,
196
+ show: h.value,
197
+ options: M.value,
198
+ x: V.value,
199
+ y: k.value,
195
200
  width: 100,
196
- onSelect: z,
201
+ onSelect: _,
197
202
  onClickoutside: () => {
198
- m.value = !1;
203
+ h.value = !1;
199
204
  }
200
205
  }, null)];
201
206
  }
@@ -203,5 +208,5 @@ const ce = /* @__PURE__ */ Y({
203
208
  }
204
209
  });
205
210
  export {
206
- ce as DuxTreeFilter
211
+ oe as DuxTreeFilter
207
212
  };
@@ -0,0 +1,32 @@
1
+ import { useManage as r, createS3UploadDriver as v, createLocalUploadDriver as U } from "@duxweb/dvha-core";
2
+ import { computed as u } from "vue";
3
+ const b = (a) => {
4
+ const n = r(), d = u(() => {
5
+ var t, l;
6
+ return (a == null ? void 0 : a.uploadPath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.upload) || "upload";
7
+ }), P = u(() => {
8
+ var t, l;
9
+ return (a == null ? void 0 : a.managePath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.uploadManager) || "uploadManager";
10
+ }), f = u(() => {
11
+ var t, l, e, c;
12
+ return (a == null ? void 0 : a.driver) === "s3" ? v({
13
+ signPath: (a == null ? void 0 : a.signPath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.upload) || d.value || "",
14
+ signCallback: (a == null ? void 0 : a.signCallback) || ((c = (e = n.config) == null ? void 0 : e.upload) == null ? void 0 : c.signCallback) || ((i) => {
15
+ var g, m, h;
16
+ return {
17
+ uploadUrl: (g = i.data) == null ? void 0 : g.uploadUrl,
18
+ url: (m = i.data) == null ? void 0 : m.url,
19
+ params: (h = i.data) == null ? void 0 : h.params
20
+ };
21
+ })
22
+ }) : U();
23
+ });
24
+ return {
25
+ uploadPath: d,
26
+ managePath: P,
27
+ driver: f
28
+ };
29
+ };
30
+ export {
31
+ b as useUploadConfig
32
+ };