@duxweb/dvha-pro 0.0.5

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 (293) hide show
  1. package/dist/cjs/app.cjs +1 -0
  2. package/dist/cjs/component.cjs +1 -0
  3. package/dist/cjs/components/card/card.cjs +1 -0
  4. package/dist/cjs/components/carousel/carousel.cjs +1 -0
  5. package/dist/cjs/components/dashboard/hello.cjs +1 -0
  6. package/dist/cjs/components/dashboard/helloBig.cjs +1 -0
  7. package/dist/cjs/components/dashboard/quick.cjs +1 -0
  8. package/dist/cjs/components/dialog/dialog.cjs +1 -0
  9. package/dist/cjs/components/draw/drawApps.cjs +1 -0
  10. package/dist/cjs/components/draw/drawAuth.cjs +1 -0
  11. package/dist/cjs/components/draw/drawEmpty.cjs +1 -0
  12. package/dist/cjs/components/draw/drawEmptyForm.cjs +1 -0
  13. package/dist/cjs/components/draw/drawError.cjs +1 -0
  14. package/dist/cjs/components/drawer/drawer.cjs +1 -0
  15. package/dist/cjs/components/drawer/drawerPage.cjs +1 -0
  16. package/dist/cjs/components/form/formItem.cjs +1 -0
  17. package/dist/cjs/components/form/formLayout.cjs +1 -0
  18. package/dist/cjs/components/form/modalForm.cjs +1 -0
  19. package/dist/cjs/components/form/pageForm.cjs +1 -0
  20. package/dist/cjs/components/form/settingForm.cjs +1 -0
  21. package/dist/cjs/components/layout/filter.cjs +1 -0
  22. package/dist/cjs/components/layout/list.cjs +1 -0
  23. package/dist/cjs/components/layout/table.cjs +1 -0
  24. package/dist/cjs/components/layout/tools.cjs +1 -0
  25. package/dist/cjs/components/list/card.cjs +1 -0
  26. package/dist/cjs/components/list/list.cjs +1 -0
  27. package/dist/cjs/components/media/media.cjs +1 -0
  28. package/dist/cjs/components/modal/modal.cjs +1 -0
  29. package/dist/cjs/components/modal/modalPage.cjs +1 -0
  30. package/dist/cjs/components/modal/modalTab.cjs +1 -0
  31. package/dist/cjs/components/panel/alert.cjs +1 -0
  32. package/dist/cjs/components/panel/setting.cjs +1 -0
  33. package/dist/cjs/components/status/blockEmpty.cjs +1 -0
  34. package/dist/cjs/components/table/tablePage.cjs +1 -0
  35. package/dist/cjs/components/widget/connect.cjs +1 -0
  36. package/dist/cjs/config/uno.cjs +1 -0
  37. package/dist/cjs/config/validate.cjs +1 -0
  38. package/dist/cjs/dvha-pro.css +1 -0
  39. package/dist/cjs/hooks/action.cjs +1 -0
  40. package/dist/cjs/hooks/dialog.cjs +1 -0
  41. package/dist/cjs/hooks/drawer.cjs +1 -0
  42. package/dist/cjs/hooks/modal.cjs +1 -0
  43. package/dist/cjs/hooks/table/column.cjs +1 -0
  44. package/dist/cjs/hooks/table/copy.cjs +1 -0
  45. package/dist/cjs/hooks/table/hidden.cjs +1 -0
  46. package/dist/cjs/hooks/table/image.cjs +1 -0
  47. package/dist/cjs/hooks/table/input.cjs +1 -0
  48. package/dist/cjs/hooks/table/map.cjs +1 -0
  49. package/dist/cjs/hooks/table/media.cjs +1 -0
  50. package/dist/cjs/hooks/table/status.cjs +1 -0
  51. package/dist/cjs/hooks/table/switch.cjs +1 -0
  52. package/dist/cjs/hooks/table.cjs +1 -0
  53. package/dist/cjs/hooks/ui.cjs +1 -0
  54. package/dist/cjs/index.cjs +1 -0
  55. package/dist/cjs/langs/en-US.json.cjs +1 -0
  56. package/dist/cjs/langs/zh-CN.json.cjs +1 -0
  57. package/dist/cjs/main.cjs +1 -0
  58. package/dist/cjs/node_modules/@iconify-json/tabler/icons.json.cjs +1 -0
  59. package/dist/cjs/node_modules/@overlastic/core/dist/index.cjs +1 -0
  60. package/dist/cjs/node_modules/@overlastic/vue/dist/index.cjs +1 -0
  61. package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/en.json.cjs +1 -0
  62. package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.cjs +1 -0
  63. package/dist/cjs/node_modules/@vueuse/integrations/useFocusTrap.cjs +1 -0
  64. package/dist/cjs/node_modules/@vueuse/shared/index.cjs +1 -0
  65. package/dist/cjs/node_modules/colorizr/dist/index.cjs +1 -0
  66. package/dist/cjs/node_modules/focus-trap/dist/focus-trap.esm.cjs +5 -0
  67. package/dist/cjs/node_modules/lower-case/dist.es2015/index.cjs +1 -0
  68. package/dist/cjs/node_modules/no-case/dist.es2015/index.cjs +1 -0
  69. package/dist/cjs/node_modules/pascal-case/dist.es2015/index.cjs +1 -0
  70. package/dist/cjs/node_modules/tabbable/dist/index.esm.cjs +4 -0
  71. package/dist/cjs/node_modules/tslib/tslib.es6.cjs +1 -0
  72. package/dist/cjs/pages/authLayout.cjs +1 -0
  73. package/dist/cjs/pages/layout/global.cjs +1 -0
  74. package/dist/cjs/pages/layout/page.cjs +1 -0
  75. package/dist/cjs/pages/layout/tab.cjs +1 -0
  76. package/dist/cjs/pages/layout.cjs +1 -0
  77. package/dist/cjs/pages/loading.cjs +1 -0
  78. package/dist/cjs/pages/login.cjs +1 -0
  79. package/dist/cjs/pages/menu/avatar.cjs +1 -0
  80. package/dist/cjs/pages/menu/button.cjs +1 -0
  81. package/dist/cjs/pages/menu/cmd.cjs +1 -0
  82. package/dist/cjs/pages/menu/main.cjs +1 -0
  83. package/dist/cjs/pages/menu/mobile.cjs +1 -0
  84. package/dist/cjs/pages/page.cjs +1 -0
  85. package/dist/cjs/pages/page403.cjs +1 -0
  86. package/dist/cjs/pages/page404.cjs +1 -0
  87. package/dist/cjs/pages/page500.cjs +1 -0
  88. package/dist/cjs/pages/pageEmpty.cjs +1 -0
  89. package/dist/cjs/pages/pageLoading.cjs +1 -0
  90. package/dist/cjs/pages/pageStatus.cjs +1 -0
  91. package/dist/cjs/static/images/placeholder.png.cjs +1 -0
  92. package/dist/cjs/stores/ui.cjs +1 -0
  93. package/dist/cjs/theme/naiveTheme.cjs +1 -0
  94. package/dist/cjs/theme/presetTheme.cjs +1 -0
  95. package/dist/cjs/theme/uno.css.cjs +1285 -0
  96. package/dist/esm/app.js +20 -0
  97. package/dist/esm/component.js +59 -0
  98. package/dist/esm/components/card/card.js +114 -0
  99. package/dist/esm/components/carousel/carousel.js +37 -0
  100. package/dist/esm/components/dashboard/hello.js +40 -0
  101. package/dist/esm/components/dashboard/helloBig.js +344 -0
  102. package/dist/esm/components/dashboard/quick.js +59 -0
  103. package/dist/esm/components/dialog/dialog.js +118 -0
  104. package/dist/esm/components/draw/drawApps.js +145 -0
  105. package/dist/esm/components/draw/drawAuth.js +50 -0
  106. package/dist/esm/components/draw/drawEmpty.js +92 -0
  107. package/dist/esm/components/draw/drawEmptyForm.js +128 -0
  108. package/dist/esm/components/draw/drawError.js +242 -0
  109. package/dist/esm/components/drawer/drawer.js +73 -0
  110. package/dist/esm/components/drawer/drawerPage.js +28 -0
  111. package/dist/esm/components/form/formItem.js +77 -0
  112. package/dist/esm/components/form/formLayout.js +38 -0
  113. package/dist/esm/components/form/modalForm.js +108 -0
  114. package/dist/esm/components/form/pageForm.js +94 -0
  115. package/dist/esm/components/form/settingForm.js +104 -0
  116. package/dist/esm/components/layout/filter.js +27 -0
  117. package/dist/esm/components/layout/list.js +333 -0
  118. package/dist/esm/components/layout/table.js +292 -0
  119. package/dist/esm/components/layout/tools.js +78 -0
  120. package/dist/esm/components/list/card.js +78 -0
  121. package/dist/esm/components/list/list.js +38 -0
  122. package/dist/esm/components/media/media.js +77 -0
  123. package/dist/esm/components/modal/modal.js +116 -0
  124. package/dist/esm/components/modal/modalPage.js +56 -0
  125. package/dist/esm/components/modal/modalTab.js +70 -0
  126. package/dist/esm/components/panel/alert.js +57 -0
  127. package/dist/esm/components/panel/setting.js +49 -0
  128. package/dist/esm/components/status/blockEmpty.js +78 -0
  129. package/dist/esm/components/table/tablePage.js +41 -0
  130. package/dist/esm/components/widget/connect.js +119 -0
  131. package/dist/esm/config/uno.js +32 -0
  132. package/dist/esm/config/validate.js +15 -0
  133. package/dist/esm/dvha-pro.css +1 -0
  134. package/dist/esm/hooks/action.js +213 -0
  135. package/dist/esm/hooks/dialog.js +32 -0
  136. package/dist/esm/hooks/drawer.js +25 -0
  137. package/dist/esm/hooks/modal.js +14 -0
  138. package/dist/esm/hooks/table/column.js +31 -0
  139. package/dist/esm/hooks/table/copy.js +27 -0
  140. package/dist/esm/hooks/table/hidden.js +48 -0
  141. package/dist/esm/hooks/table/image.js +24 -0
  142. package/dist/esm/hooks/table/input.js +81 -0
  143. package/dist/esm/hooks/table/map.js +21 -0
  144. package/dist/esm/hooks/table/media.js +34 -0
  145. package/dist/esm/hooks/table/status.js +32 -0
  146. package/dist/esm/hooks/table/switch.js +33 -0
  147. package/dist/esm/hooks/table.js +74 -0
  148. package/dist/esm/hooks/ui.js +16 -0
  149. package/dist/esm/index.js +139 -0
  150. package/dist/esm/langs/en-US.json.js +11 -0
  151. package/dist/esm/langs/zh-CN.json.js +11 -0
  152. package/dist/esm/main.js +18 -0
  153. package/dist/esm/node_modules/@iconify-json/tabler/icons.json.js +17 -0
  154. package/dist/esm/node_modules/@overlastic/core/dist/index.js +76 -0
  155. package/dist/esm/node_modules/@overlastic/vue/dist/index.js +122 -0
  156. package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/en.json.js +9 -0
  157. package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.js +9 -0
  158. package/dist/esm/node_modules/@vueuse/integrations/useFocusTrap.js +43 -0
  159. package/dist/esm/node_modules/@vueuse/shared/index.js +6 -0
  160. package/dist/esm/node_modules/colorizr/dist/index.js +318 -0
  161. package/dist/esm/node_modules/focus-trap/dist/focus-trap.esm.js +473 -0
  162. package/dist/esm/node_modules/lower-case/dist.es2015/index.js +6 -0
  163. package/dist/esm/node_modules/no-case/dist.es2015/index.js +18 -0
  164. package/dist/esm/node_modules/pascal-case/dist.es2015/index.js +13 -0
  165. package/dist/esm/node_modules/tabbable/dist/index.esm.js +202 -0
  166. package/dist/esm/node_modules/tslib/tslib.es6.js +12 -0
  167. package/dist/esm/pages/authLayout.js +38 -0
  168. package/dist/esm/pages/layout/global.js +51 -0
  169. package/dist/esm/pages/layout/page.js +54 -0
  170. package/dist/esm/pages/layout/tab.js +110 -0
  171. package/dist/esm/pages/layout.js +14 -0
  172. package/dist/esm/pages/loading.js +14 -0
  173. package/dist/esm/pages/login.js +143 -0
  174. package/dist/esm/pages/menu/avatar.js +205 -0
  175. package/dist/esm/pages/menu/button.js +60 -0
  176. package/dist/esm/pages/menu/cmd.js +156 -0
  177. package/dist/esm/pages/menu/main.js +101 -0
  178. package/dist/esm/pages/menu/mobile.js +38 -0
  179. package/dist/esm/pages/page.js +47 -0
  180. package/dist/esm/pages/page403.js +46 -0
  181. package/dist/esm/pages/page404.js +57 -0
  182. package/dist/esm/pages/page500.js +45 -0
  183. package/dist/esm/pages/pageEmpty.js +25 -0
  184. package/dist/esm/pages/pageLoading.js +22 -0
  185. package/dist/esm/pages/pageStatus.js +50 -0
  186. package/dist/esm/static/images/placeholder.png.js +4 -0
  187. package/dist/esm/stores/ui.js +34 -0
  188. package/dist/esm/theme/naiveTheme.js +97 -0
  189. package/dist/esm/theme/presetTheme.js +12 -0
  190. package/dist/esm/theme/uno.css.js +1288 -0
  191. package/dist/types/app.d.ts +1 -0
  192. package/dist/types/component.d.ts +5 -0
  193. package/dist/types/components/card/card.d.ts +140 -0
  194. package/dist/types/components/card/index.d.ts +1 -0
  195. package/dist/types/components/carousel/carousel.d.ts +20 -0
  196. package/dist/types/components/carousel/index.d.ts +1 -0
  197. package/dist/types/components/dashboard/hello.d.ts +16 -0
  198. package/dist/types/components/dashboard/helloBig.d.ts +19 -0
  199. package/dist/types/components/dashboard/index.d.ts +3 -0
  200. package/dist/types/components/dashboard/quick.d.ts +33 -0
  201. package/dist/types/components/dialog/dialog.d.ts +35 -0
  202. package/dist/types/components/dialog/index.d.ts +1 -0
  203. package/dist/types/components/draw/drawApps.d.ts +1 -0
  204. package/dist/types/components/draw/drawAuth.d.ts +1 -0
  205. package/dist/types/components/draw/drawEmpty.d.ts +1 -0
  206. package/dist/types/components/draw/drawEmptyForm.d.ts +1 -0
  207. package/dist/types/components/draw/drawError.d.ts +1 -0
  208. package/dist/types/components/draw/index.d.ts +5 -0
  209. package/dist/types/components/drawer/drawer.d.ts +19 -0
  210. package/dist/types/components/drawer/drawerPage.d.ts +1 -0
  211. package/dist/types/components/drawer/index.d.ts +2 -0
  212. package/dist/types/components/form/formItem.d.ts +27 -0
  213. package/dist/types/components/form/formLayout.d.ts +38 -0
  214. package/dist/types/components/form/index.d.ts +5 -0
  215. package/dist/types/components/form/modalForm.d.ts +89 -0
  216. package/dist/types/components/form/pageForm.d.ts +51 -0
  217. package/dist/types/components/form/settingForm.d.ts +69 -0
  218. package/dist/types/components/index.d.ts +14 -0
  219. package/dist/types/components/layout/filter.d.ts +13 -0
  220. package/dist/types/components/layout/index.d.ts +4 -0
  221. package/dist/types/components/layout/list.d.ts +85 -0
  222. package/dist/types/components/layout/table.d.ts +72 -0
  223. package/dist/types/components/layout/tools.d.ts +37 -0
  224. package/dist/types/components/list/card.d.ts +117 -0
  225. package/dist/types/components/list/index.d.ts +2 -0
  226. package/dist/types/components/list/list.d.ts +87 -0
  227. package/dist/types/components/media/index.d.ts +1 -0
  228. package/dist/types/components/media/media.d.ts +95 -0
  229. package/dist/types/components/modal/index.d.ts +3 -0
  230. package/dist/types/components/modal/modal.d.ts +66 -0
  231. package/dist/types/components/modal/modalPage.d.ts +42 -0
  232. package/dist/types/components/modal/modalTab.d.ts +42 -0
  233. package/dist/types/components/panel/alert.d.ts +32 -0
  234. package/dist/types/components/panel/index.d.ts +2 -0
  235. package/dist/types/components/panel/setting.d.ts +29 -0
  236. package/dist/types/components/status/blockEmpty.d.ts +25 -0
  237. package/dist/types/components/status/index.d.ts +1 -0
  238. package/dist/types/components/table/index.d.ts +1 -0
  239. package/dist/types/components/table/tablePage.d.ts +73 -0
  240. package/dist/types/components/widget/connect.d.ts +11 -0
  241. package/dist/types/components/widget/index.d.ts +1 -0
  242. package/dist/types/config/index.d.ts +2 -0
  243. package/dist/types/config/uno.d.ts +2 -0
  244. package/dist/types/config/validate.d.ts +1 -0
  245. package/dist/types/hooks/action.d.ts +17 -0
  246. package/dist/types/hooks/dialog.d.ts +17 -0
  247. package/dist/types/hooks/drawer.d.ts +11 -0
  248. package/dist/types/hooks/index.d.ts +6 -0
  249. package/dist/types/hooks/modal.d.ts +9 -0
  250. package/dist/types/hooks/table/column.d.ts +14 -0
  251. package/dist/types/hooks/table/copy.d.ts +6 -0
  252. package/dist/types/hooks/table/hidden.d.ts +7 -0
  253. package/dist/types/hooks/table/image.d.ts +8 -0
  254. package/dist/types/hooks/table/index.d.ts +7 -0
  255. package/dist/types/hooks/table/input.d.ts +9 -0
  256. package/dist/types/hooks/table/map.d.ts +13 -0
  257. package/dist/types/hooks/table/media.d.ts +12 -0
  258. package/dist/types/hooks/table/status.d.ts +12 -0
  259. package/dist/types/hooks/table/switch.d.ts +7 -0
  260. package/dist/types/hooks/table/types.d.ts +74 -0
  261. package/dist/types/hooks/table.d.ts +2 -0
  262. package/dist/types/hooks/ui.d.ts +8 -0
  263. package/dist/types/index.d.ts +10 -0
  264. package/dist/types/langs/index.d.ts +3 -0
  265. package/dist/types/main.d.ts +5 -0
  266. package/dist/types/pages/authLayout.d.ts +1 -0
  267. package/dist/types/pages/index.d.ts +12 -0
  268. package/dist/types/pages/layout/global.d.ts +1 -0
  269. package/dist/types/pages/layout/index.d.ts +3 -0
  270. package/dist/types/pages/layout/page.d.ts +1 -0
  271. package/dist/types/pages/layout/tab.d.ts +1 -0
  272. package/dist/types/pages/layout.d.ts +1 -0
  273. package/dist/types/pages/loading.d.ts +1 -0
  274. package/dist/types/pages/login.d.ts +1 -0
  275. package/dist/types/pages/menu/avatar.d.ts +14 -0
  276. package/dist/types/pages/menu/button.d.ts +41 -0
  277. package/dist/types/pages/menu/cmd.d.ts +7 -0
  278. package/dist/types/pages/menu/index.d.ts +4 -0
  279. package/dist/types/pages/menu/main.d.ts +13 -0
  280. package/dist/types/pages/menu/mobile.d.ts +1 -0
  281. package/dist/types/pages/page.d.ts +42 -0
  282. package/dist/types/pages/page403.d.ts +1 -0
  283. package/dist/types/pages/page404.d.ts +1 -0
  284. package/dist/types/pages/page500.d.ts +1 -0
  285. package/dist/types/pages/pageEmpty.d.ts +7 -0
  286. package/dist/types/pages/pageLoading.d.ts +1 -0
  287. package/dist/types/pages/pageStatus.d.ts +7 -0
  288. package/dist/types/stores/index.d.ts +1 -0
  289. package/dist/types/stores/ui.d.ts +28 -0
  290. package/dist/types/theme/index.d.ts +2 -0
  291. package/dist/types/theme/naiveTheme.d.ts +5 -0
  292. package/dist/types/theme/presetTheme.d.ts +7 -0
  293. package/package.json +73 -0
@@ -0,0 +1,213 @@
1
+ import { useI18n as b, useManage as S, useCustomMutation as D, useDelete as C } from "@duxweb/dvha-core";
2
+ import { useMessage as I, NButton as j, NDropdown as N } from "naive-ui";
3
+ import { h as s } from "vue";
4
+ import { useRouter as $ } from "vue-router";
5
+ import { useDialog as B } from "./dialog.js";
6
+ import { useDrawer as E } from "./drawer.js";
7
+ import { useModal as T } from "./modal.js";
8
+ function U(n) {
9
+ const y = T(), d = E(), f = B(), {
10
+ t: c
11
+ } = b(), l = I(), a = S(), u = $(), v = D({
12
+ onSuccess: (e) => {
13
+ l.success(e.message || "操作成功");
14
+ },
15
+ onError: (e) => {
16
+ l.error(e.message || "操作失败");
17
+ }
18
+ }), A = C({
19
+ onSuccess: (e) => {
20
+ l.success(e.message || "操作成功");
21
+ },
22
+ onError: (e) => {
23
+ l.error(e.message || "操作失败");
24
+ }
25
+ }), g = (n == null ? void 0 : n.path) || a.getPath(), x = (e) => {
26
+ var r, P;
27
+ const i = c(e.item.title || "", {}, e.item.title), m = c(e.item.label || "", {}, e.item.label);
28
+ if (e.item.type === "modal") {
29
+ const t = e.item;
30
+ y.show({
31
+ title: i || m,
32
+ component: t.component,
33
+ componentProps: {
34
+ id: e.id,
35
+ ...t.componentProps
36
+ },
37
+ width: t.width
38
+ });
39
+ }
40
+ if (e.item.type === "drawer") {
41
+ const t = e.item;
42
+ d.show({
43
+ title: i || m,
44
+ component: t.component,
45
+ componentProps: {
46
+ id: e.id,
47
+ ...t.componentProps
48
+ },
49
+ width: t.width
50
+ });
51
+ }
52
+ if (e.item.type === "confirm") {
53
+ const t = e.item;
54
+ f.confirm({
55
+ title: i || m,
56
+ content: t.content
57
+ }).then((h) => {
58
+ var o;
59
+ h && ((o = t.callback) == null || o.call(t, e.id, e.data));
60
+ });
61
+ }
62
+ if (e.item.type === "request") {
63
+ const t = e.item;
64
+ f.confirm({
65
+ title: i || m,
66
+ content: t.content
67
+ }).then(() => {
68
+ const h = typeof t.data == "function" ? t.data(e.id, e.data) : t.data, o = (t.method || "post").toLowerCase(), M = t.path || g;
69
+ v.mutate({
70
+ path: M,
71
+ method: o,
72
+ payload: h
73
+ });
74
+ });
75
+ }
76
+ if (e.item.type === "delete") {
77
+ const t = e.item;
78
+ f.confirm({
79
+ title: i || m,
80
+ content: t.content
81
+ }).then(() => {
82
+ A.mutate({
83
+ id: e.id,
84
+ path: t.path || g
85
+ });
86
+ });
87
+ }
88
+ if (e.item.type === "link") {
89
+ const t = e.item, h = typeof t.path == "function" ? (r = t.path) == null ? void 0 : r.call(t, e.id, e.data) : a.getRoutePath(e.id ? `${t.path || g}${e.data === void 0 ? "" : `/${e.id}`}` : t.path || g);
90
+ u.push(h);
91
+ }
92
+ if (e.item.type === "callback") {
93
+ const t = e.item;
94
+ (P = t.callback) == null || P.call(t, e.id, e.data);
95
+ }
96
+ }, w = q(), k = L();
97
+ return {
98
+ target: x,
99
+ renderTable: (e) => (i, m) => {
100
+ const r = {
101
+ id: i[e.key || (n == null ? void 0 : n.key) || "id"],
102
+ data: i,
103
+ index: m,
104
+ target: x,
105
+ text: e.text !== void 0 ? e.text : (n == null ? void 0 : n.text) || !1,
106
+ align: e.align !== void 0 ? e.align : (n == null ? void 0 : n.align) || "left"
107
+ };
108
+ return (e.type || (n == null ? void 0 : n.type)) === "button" ? w.render({
109
+ ...r,
110
+ action: e || n
111
+ }) : k.render({
112
+ ...r,
113
+ action: e || n
114
+ });
115
+ },
116
+ renderAction: (e) => {
117
+ const i = {
118
+ target: x,
119
+ text: e.text !== void 0 ? e.text : (n == null ? void 0 : n.text) || !1,
120
+ align: e.align !== void 0 ? e.align : (n == null ? void 0 : n.align) || "left"
121
+ };
122
+ return (e.type || (n == null ? void 0 : n.type)) === "button" ? w.render({
123
+ ...i,
124
+ action: e || n
125
+ }) : k.render({
126
+ ...i,
127
+ action: e || n
128
+ });
129
+ }
130
+ };
131
+ }
132
+ function q() {
133
+ const {
134
+ t: n
135
+ } = b();
136
+ return {
137
+ render: (d) => {
138
+ var c;
139
+ const f = (c = d.action.items) == null ? void 0 : c.filter((l) => {
140
+ var a;
141
+ return !l.show || ((a = l.show) == null ? void 0 : a.call(l, d.data, d.index));
142
+ }).map((l, a) => s(j, {
143
+ key: a,
144
+ type: l.color || l.type === "delete" ? "error" : "primary",
145
+ text: d.text,
146
+ onClick: () => {
147
+ var u;
148
+ (u = d == null ? void 0 : d.target) == null || u.call(d, {
149
+ id: d.id,
150
+ data: d.data,
151
+ item: l
152
+ });
153
+ },
154
+ renderIcon: l.icon ? () => s("div", {
155
+ class: ["n-icon", l.icon]
156
+ }) : void 0
157
+ }, () => n(l.label || "", {}, l.label)));
158
+ return s("div", {
159
+ class: ["flex gap-2 flex-wrap items-center", d.align === "right" ? "justify-end" : d.align === "center" ? "justify-center" : "justify-start"]
160
+ }, f);
161
+ }
162
+ };
163
+ }
164
+ function L() {
165
+ const {
166
+ t: n
167
+ } = b();
168
+ return {
169
+ render: (d) => {
170
+ var c;
171
+ const f = (c = d.action.items) == null ? void 0 : c.filter((l) => {
172
+ var a;
173
+ return !l.show || ((a = l.show) == null ? void 0 : a.call(l, d.data, d.index));
174
+ }).map((l, a) => ({
175
+ label: n(l.label || "", {}, l.label),
176
+ key: a,
177
+ icon: l.icon ? () => s("div", {
178
+ class: ["n-icon", l.icon]
179
+ }) : void 0,
180
+ onSelect: () => {
181
+ var u;
182
+ (u = d == null ? void 0 : d.target) == null || u.call(d, {
183
+ id: d.id,
184
+ data: d.data,
185
+ item: l
186
+ });
187
+ }
188
+ }));
189
+ return s(N, {
190
+ trigger: "click",
191
+ options: f,
192
+ onSelect: (l, a) => {
193
+ var u;
194
+ (u = a == null ? void 0 : a.onSelect) == null || u.call(a);
195
+ }
196
+ }, () => [s("div", {
197
+ class: ["flex items-center", d.align === "right" ? "justify-end" : d.align === "center" ? "justify-center" : "justify-start"]
198
+ }, s(j, {
199
+ type: "default",
200
+ text: d.text,
201
+ secondary: !d.text,
202
+ renderIcon: () => s("div", {
203
+ class: ["n-icon", "i-tabler:dots-vertical"]
204
+ })
205
+ }))]);
206
+ }
207
+ };
208
+ }
209
+ export {
210
+ U as useAction,
211
+ q as useActionButton,
212
+ L as useActionDropdown
213
+ };
@@ -0,0 +1,32 @@
1
+ import { useOverlay as t } from "@duxweb/dvha-core";
2
+ function i() {
3
+ const e = t(), o = (r) => e.show({
4
+ component: () => import("../components/dialog/dialog.js"),
5
+ componentProps: r
6
+ });
7
+ return {
8
+ confirm: (r) => o({
9
+ ...r,
10
+ type: "confirm"
11
+ }),
12
+ success: (r) => o({
13
+ ...r,
14
+ type: "success"
15
+ }),
16
+ error: (r) => o({
17
+ ...r,
18
+ type: "error"
19
+ }),
20
+ prompt: (r) => o({
21
+ ...r,
22
+ type: "prompt"
23
+ }),
24
+ node: (r) => o({
25
+ ...r,
26
+ type: "node"
27
+ })
28
+ };
29
+ }
30
+ export {
31
+ i as useDialog
32
+ };
@@ -0,0 +1,25 @@
1
+ import { useOverlayInject as t } from "../node_modules/@overlastic/vue/dist/index.js";
2
+ import "vue";
3
+ import "naive-ui";
4
+ import "clsx";
5
+ import "jinrishici";
6
+ import "lodash-es";
7
+ import m from "../components/drawer/drawer.js";
8
+ import "@vueuse/core";
9
+ import "vee-validate";
10
+ import "@duxweb/dvha-core";
11
+ import "vue-router";
12
+ import "@duxweb/dvha-naiveui";
13
+ import "pinia";
14
+ import "@vee-validate/i18n";
15
+ import "vue-command-palette";
16
+ import "../pages/page404.js";
17
+ function I() {
18
+ const r = t(m);
19
+ return {
20
+ show: (o) => r(o)
21
+ };
22
+ }
23
+ export {
24
+ I as useDrawer
25
+ };
@@ -0,0 +1,14 @@
1
+ import { useOverlay as e } from "@duxweb/dvha-core";
2
+ function s() {
3
+ const r = e();
4
+ return {
5
+ show: (o) => r.show({
6
+ component: () => import("../components/modal/modal.js"),
7
+ componentProps: o,
8
+ mask: !o.draggable
9
+ })
10
+ };
11
+ }
12
+ export {
13
+ s as useModal
14
+ };
@@ -0,0 +1,31 @@
1
+ import { useManage as s } from "@duxweb/dvha-core";
2
+ import { useTableColumnCopy as C } from "./copy.js";
3
+ import { useTableColumnHidden as f } from "./hidden.js";
4
+ import { useTableColumnImage as b } from "./image.js";
5
+ import { useTableColumnInput as T } from "./input.js";
6
+ import { useTableColumnMap as M } from "./map.js";
7
+ import { useTableColumnMedia as h } from "./media.js";
8
+ import { useTableColumnStatus as I } from "./status.js";
9
+ import { useTableColumnSwitch as S } from "./switch.js";
10
+ function k(e) {
11
+ const { getPath: o } = s(), n = (e == null ? void 0 : e.path) || o(), r = (e == null ? void 0 : e.rowKey) || "id", t = h(), m = b(), u = S({
12
+ path: n,
13
+ rowKey: r
14
+ }), a = I(), d = M(), l = T({
15
+ path: n,
16
+ rowKey: r
17
+ }), c = C(), i = f();
18
+ return {
19
+ renderMedia: t.render,
20
+ renderImage: m.render,
21
+ renderSwitch: u.render,
22
+ renderStatus: a.render,
23
+ renderMap: d.render,
24
+ renderInput: l.render,
25
+ renderCopy: c.render,
26
+ renderHidden: i.render
27
+ };
28
+ }
29
+ export {
30
+ k as useTableColumn
31
+ };
@@ -0,0 +1,27 @@
1
+ import { createVNode as r } from "vue";
2
+ import { useClipboard as c } from "@vueuse/core";
3
+ import { get as i } from "lodash-es";
4
+ import { useMessage as l } from "naive-ui";
5
+ function v() {
6
+ const t = l(), {
7
+ copy: o
8
+ } = c();
9
+ return {
10
+ render: (s) => (n, a) => {
11
+ const e = i(n, s.key || "");
12
+ return r("div", {
13
+ class: "flex"
14
+ }, [e && e !== "-" ? r("div", {
15
+ class: "flex justify-start items-center gap-1"
16
+ }, [r("div", null, [e]), r("div", {
17
+ class: "cursor-pointer i-tabler:copy size-4 text-muted hover:text-primary",
18
+ onClick: () => {
19
+ o(e).then(() => t.success("复制成功")).catch(() => t.error("复制失败"));
20
+ }
21
+ }, null)]) : "-"]);
22
+ }
23
+ };
24
+ }
25
+ export {
26
+ v as useTableColumnCopy
27
+ };
@@ -0,0 +1,48 @@
1
+ import { createVNode as i, defineComponent as o, ref as u } from "vue";
2
+ import { get as a } from "lodash-es";
3
+ const d = /* @__PURE__ */ o({
4
+ name: "TableColumnHidden",
5
+ props: {
6
+ value: {
7
+ type: String,
8
+ default: ""
9
+ },
10
+ percent: {
11
+ type: Number,
12
+ default: 30
13
+ }
14
+ },
15
+ setup(e) {
16
+ const t = u(!0);
17
+ return () => e.value ? i("div", {
18
+ class: "flex justify-start items-center gap-1"
19
+ }, [i("div", {
20
+ class: "font-mono"
21
+ }, [t.value ? c(e.value, e.percent) : e.value]), i("div", {
22
+ class: ["cursor-pointer size-4 text-muted hover:text-primary transition-all duration-150", t.value ? "i-tabler:eye" : "i-tabler:eye-off"],
23
+ onClick: () => {
24
+ t.value = !t.value;
25
+ }
26
+ }, null)]) : "-";
27
+ }
28
+ });
29
+ function m() {
30
+ return {
31
+ render: (t) => (n, r) => {
32
+ const l = a(n, t.key || "");
33
+ return i(d, {
34
+ value: l,
35
+ percent: t.percent
36
+ }, null);
37
+ }
38
+ };
39
+ }
40
+ function c(e, t = 30) {
41
+ if (!e || e.length < 4)
42
+ return e;
43
+ const n = e.length, r = Math.ceil(n * t / 100), l = Math.floor((n - r) / 2);
44
+ return e.slice(0, l) + "*".repeat(r) + e.slice(l + r);
45
+ }
46
+ export {
47
+ m as useTableColumnHidden
48
+ };
@@ -0,0 +1,24 @@
1
+ import { createVNode as t } from "vue";
2
+ import { get as m } from "lodash-es";
3
+ import { NImage as l } from "naive-ui";
4
+ import n from "../../static/images/placeholder.png.js";
5
+ function p() {
6
+ return {
7
+ render: (r) => (a, d) => {
8
+ let e = m(a, r.key || "") || [];
9
+ return e = Array.isArray(e) ? e : [e], t("div", {
10
+ class: "flex flex-wrap gap-2"
11
+ }, [e.map((o, i) => t(l, {
12
+ key: i,
13
+ src: o,
14
+ width: r.imageWidth,
15
+ height: r.imageHeight,
16
+ fallbackSrc: n,
17
+ objectFit: "cover"
18
+ }, null))]);
19
+ }
20
+ };
21
+ }
22
+ export {
23
+ p as useTableColumnImage
24
+ };
@@ -0,0 +1,81 @@
1
+ import { createVNode as t, defineComponent as v, ref as f, h } from "vue";
2
+ import { useCustomMutation as s } from "@duxweb/dvha-core";
3
+ import { get as c } from "lodash-es";
4
+ import { useMessage as g, NInput as y, NButton as C } from "naive-ui";
5
+ const b = /* @__PURE__ */ v({
6
+ name: "TableColumnInput",
7
+ props: {
8
+ data: {
9
+ type: Object,
10
+ required: !0
11
+ },
12
+ field: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ path: {
17
+ type: String,
18
+ required: !0
19
+ },
20
+ tag: {
21
+ type: Object
22
+ }
23
+ },
24
+ setup(e) {
25
+ const d = f(!1), a = f(""), {
26
+ mutateAsync: i
27
+ } = s(), l = g(), n = (u) => {
28
+ i({
29
+ path: e.path,
30
+ method: "PATCH",
31
+ payload: {
32
+ [e.field]: u
33
+ }
34
+ }).then(() => {
35
+ l.success("保存成功");
36
+ }).catch((r) => {
37
+ l.error(r.message);
38
+ });
39
+ };
40
+ return () => d.value ? t("div", {
41
+ class: "flex gap-2"
42
+ }, [t("div", null, [h(e.tag || y, {
43
+ value: a.value,
44
+ "onUpdate:value": (u) => a.value = u,
45
+ autofocus: !0
46
+ })]), t(C, {
47
+ type: "primary",
48
+ onClick: () => {
49
+ a.value !== e.data[e.field] ? n(a.value) : d.value = !1;
50
+ },
51
+ renderIcon: () => t("div", {
52
+ class: "size-4 i-tabler:check"
53
+ }, null)
54
+ }, null)]) : t("div", {
55
+ class: "flex"
56
+ }, [t("div", {
57
+ class: "flex justify-start items-center gap-1"
58
+ }, [t("div", null, [e.data[e.field] === void 0 || e.data[e.field] === "" ? "-" : e.data[e.field]]), t("div", {
59
+ class: "cursor-pointer i-tabler:pencil size-4 text-muted hover:text-primary",
60
+ onClick: () => {
61
+ a.value = e.data[e.field], d.value = !0;
62
+ }
63
+ }, null)])]);
64
+ }
65
+ });
66
+ function j(e) {
67
+ return {
68
+ render: (a) => (i, l) => {
69
+ const n = typeof (e == null ? void 0 : e.path) == "function" ? e == null ? void 0 : e.path(i) : `${e == null ? void 0 : e.path}/${c(i, (e == null ? void 0 : e.rowKey) || "id")}`;
70
+ return t(b, {
71
+ data: i,
72
+ field: a.key,
73
+ path: n,
74
+ tag: a.tag
75
+ }, null);
76
+ }
77
+ };
78
+ }
79
+ export {
80
+ j as useTableColumnInput
81
+ };
@@ -0,0 +1,21 @@
1
+ import { createVNode as n } from "vue";
2
+ import { get as s } from "lodash-es";
3
+ function f() {
4
+ return {
5
+ render: (r) => (l, d) => {
6
+ const c = typeof r.maps == "function" ? r.maps(l) : r.maps;
7
+ return n("div", {
8
+ class: "flex flex-col gap-1"
9
+ }, [c == null ? void 0 : c.map((e) => n("div", {
10
+ class: "flex gap-2 "
11
+ }, [n("div", {
12
+ class: "flex text-muted items-center gap-1 whitespace-nowrap"
13
+ }, [e.icon && n("div", {
14
+ class: ["size-4", e.icon]
15
+ }, null), e.label]), n("div", null, [e != null && e.render ? e.render(s(l, e.key || "")) : s(l, e.key || "")])]))]);
16
+ }
17
+ };
18
+ }
19
+ export {
20
+ f as useTableColumnMap
21
+ };
@@ -0,0 +1,34 @@
1
+ import { createVNode as r } from "vue";
2
+ import { get as i } from "lodash-es";
3
+ import "naive-ui";
4
+ import "clsx";
5
+ import "jinrishici";
6
+ import "../../node_modules/@overlastic/vue/dist/index.js";
7
+ import "@vueuse/core";
8
+ import "vee-validate";
9
+ import "@duxweb/dvha-core";
10
+ import "vue-router";
11
+ import "@duxweb/dvha-naiveui";
12
+ import "pinia";
13
+ import "@vee-validate/i18n";
14
+ import "vue-command-palette";
15
+ import "../../pages/page404.js";
16
+ import { DuxMedia as c } from "../../components/media/media.js";
17
+ function V() {
18
+ return {
19
+ render: (t) => (e, g) => {
20
+ const m = typeof t.title == "function" ? t.title(e) : i(e, t.title || ""), n = typeof t.desc == "function" ? t.desc(e) : i(e, t.desc || ""), o = typeof t.image == "function" ? t.image(e) : i(e, t.image || "");
21
+ return r(c, {
22
+ title: m,
23
+ desc: n,
24
+ avatar: t.avatar,
25
+ image: o,
26
+ imageWidth: t.imageWidth,
27
+ imageHeight: t.imageHeight
28
+ }, null);
29
+ }
30
+ };
31
+ }
32
+ export {
33
+ V as useTableColumnMedia
34
+ };
@@ -0,0 +1,32 @@
1
+ import { createVNode as l, Fragment as u } from "vue";
2
+ import { findKey as d, get as o } from "lodash-es";
3
+ import { NTag as s } from "naive-ui";
4
+ function g() {
5
+ return {
6
+ render: (n) => (c, m) => {
7
+ var i;
8
+ const a = (n == null ? void 0 : n.key) || "status", e = d(n.maps, (t) => t ? (t == null ? void 0 : t.value) === o(c, a) : !1), r = e ? (i = n.maps) == null ? void 0 : i[e] : void 0;
9
+ return r ? l(s, {
10
+ round: !0,
11
+ bordered: !0,
12
+ type: e
13
+ }, {
14
+ icon: () => l(u, null, [e === "success" && l("div", {
15
+ class: "n-icon i-tabler:circle-check-filled"
16
+ }, null), e === "error" && l("div", {
17
+ class: "n-icon i-tabler:circle-x-filled"
18
+ }, null), e === "warning" && l("div", {
19
+ class: "n-icon i-tabler:exclamation-circle-filled"
20
+ }, null), (e === "default" || e === "info") && l("div", {
21
+ class: "n-icon i-tabler:info-circle-filled"
22
+ }, null)]),
23
+ default: () => l("span", {
24
+ class: "text-sm"
25
+ }, [r == null ? void 0 : r.label])
26
+ }) : null;
27
+ }
28
+ };
29
+ }
30
+ export {
31
+ g as useTableColumnStatus
32
+ };
@@ -0,0 +1,33 @@
1
+ import { createVNode as C } from "vue";
2
+ import { useCustomMutation as n } from "@duxweb/dvha-core";
3
+ import { get as r } from "lodash-es";
4
+ import { useMessage as x, NSwitch as A } from "naive-ui";
5
+ function $(e) {
6
+ const {
7
+ mutateAsync: a
8
+ } = n(), d = x();
9
+ return {
10
+ render: (f) => (t, M) => {
11
+ const i = f.key || "status", y = typeof (e == null ? void 0 : e.path) == "function" ? e == null ? void 0 : e.path(t) : `${e == null ? void 0 : e.path}/${r(t, (e == null ? void 0 : e.rowKey) || "id")}`;
12
+ return C(A, {
13
+ value: !!t[i],
14
+ onUpdateValue: (h) => {
15
+ t[i] = h, a({
16
+ path: y,
17
+ method: "PATCH",
18
+ payload: {
19
+ [i]: h
20
+ }
21
+ }).then(() => {
22
+ t[i] = h;
23
+ }).catch((g) => {
24
+ t[i] = !h, d.error(g.message);
25
+ });
26
+ }
27
+ }, null);
28
+ }
29
+ };
30
+ }
31
+ export {
32
+ $ as useTableColumnSwitch
33
+ };