@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,17 +1,20 @@
1
- import { defineComponent as $, toRef as ee, computed as p, reactive as te, ref as ie, watch as ae, createVNode as t, h as D, mergeProps as re } from "vue";
2
- import { useI18n as ne, useJsonSchema as E } from "@duxweb/dvha-core";
3
- import { useWindowSize as le, useElementSize as oe } from "@vueuse/core";
4
- import { NInput as I, NTabs as ue, NTab as ce, NButton as o, NPopover as de, NPopselect as pe, NTooltip as f, NProgress as fe, NPagination as me } from "naive-ui";
5
- import { useAction as ge } from "../../hooks/action.js";
1
+ import { defineComponent as te, toRef as D, computed as b, reactive as x, createVNode as t, h as A, mergeProps as ie, isVNode as ae } from "vue";
2
+ import { useI18n as re, useJsonSchema as O } from "@duxweb/dvha-core";
3
+ import { useWindowSize as ne } from "@vueuse/core";
4
+ import { NTabs as oe, NTab as le, NButton as l, NPopselect as ue, NTooltip as h, NProgress as ce, NPagination as de, NModal as pe, NDrawer as U } from "naive-ui";
5
+ import { useAction as fe } from "../../hooks/action.js";
6
6
  import "@overlastic/vue";
7
7
  import "clsx";
8
8
  import "vue-echarts";
9
9
  import "vue-cropper";
10
+ import me from "../modal/modalPage.js";
10
11
  import "jinrishici";
11
12
  import "lodash-es";
12
13
  import "vue-draggable-plus";
14
+ import { DuxDrawerPage as E } from "../drawer/drawerPage.js";
13
15
  import "aieditor";
14
16
  import "vee-validate";
17
+ import "vue-router";
15
18
  import "@vee-validate/i18n";
16
19
  import "colorizr";
17
20
  import "echarts";
@@ -21,21 +24,34 @@ import "@unocss/preset-typography";
21
24
  import "unocss/preset-wind4";
22
25
  import "@vee-validate/i18n/dist/locale/en.json";
23
26
  import "@vee-validate/i18n/dist/locale/zh_CN.json";
24
- import "vue-router";
25
27
  import "vue-command-palette";
26
28
  import "@duxweb/dvha-naiveui";
27
- import { DuxPage as ve } from "../../pages/page.js";
29
+ import { DuxPage as be } from "../../pages/page.js";
28
30
  import "../../pages/page404.js";
29
31
  import "@iconify-json/tabler/icons.json";
30
- import { DuxTableFilter as be } from "./filter.js";
31
- import { DuxTableTools as he } from "./tools.js";
32
+ import { DuxTableFilter as he } from "./filter.js";
33
+ import { DuxFilterLayout as ge } from "./filterLayout.js";
34
+ import { DuxTableTools as ve } from "./tools.js";
32
35
  import "mime";
36
+ import "vue3-ace-editor";
37
+ import "ace-builds/src-noconflict/mode-vue";
38
+ import "ace-builds/src-noconflict/mode-javascript";
39
+ import "ace-builds/src-noconflict/mode-html";
40
+ import "ace-builds/src-noconflict/mode-json";
41
+ import "ace-builds/src-noconflict/mode-json5";
42
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
43
+ import "ace-builds/src-noconflict/theme-tomorrow";
44
+ import "ace-builds/src-noconflict/ext-searchbox";
45
+ import "ace-builds/src-noconflict/ext-language_tools";
46
+ import "ace-builds/src-noconflict/mode-snippets";
33
47
  import "dayjs";
34
- import { useDrawer as xe } from "../../hooks/drawer.js";
35
48
  import "@tanstack/vue-query";
36
- import { useTable as ye } from "../../hooks/table.js";
49
+ import { useTable as we } from "../../hooks/table.js";
37
50
  import "pinia";
38
- const at = /* @__PURE__ */ $({
51
+ function ye(i) {
52
+ return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !ae(i);
53
+ }
54
+ const gt = /* @__PURE__ */ te({
39
55
  name: "DuxTableLayout",
40
56
  props: {
41
57
  path: {
@@ -52,7 +68,8 @@ const at = /* @__PURE__ */ $({
52
68
  type: Array
53
69
  },
54
70
  pagination: {
55
- type: [Boolean, Object]
71
+ type: [Boolean, Object],
72
+ default: !0
56
73
  },
57
74
  tabs: {
58
75
  type: Array
@@ -71,166 +88,136 @@ const at = /* @__PURE__ */ $({
71
88
  sideRightTitle: {
72
89
  type: String,
73
90
  default: ""
91
+ },
92
+ hookTableProps: {
93
+ type: Object
74
94
  }
75
95
  },
76
- setup(a, {
96
+ setup(i, {
77
97
  slots: e
78
98
  }) {
79
- var C, N;
80
- const m = ee(a.filter || {}), {
81
- t: l
82
- } = ne(), {
83
- renderAction: O
84
- } = ge(), y = ye({
85
- path: a.path,
86
- filters: m.value,
87
- columns: a.columns || [],
88
- pagination: a.pagination
99
+ var C, S;
100
+ const g = D(i, "filter", {}), F = D(i, "columns", []), {
101
+ t: n
102
+ } = re(), {
103
+ renderAction: V
104
+ } = fe(), v = we({
105
+ path: i.path,
106
+ filters: g.value,
107
+ columns: F,
108
+ pagination: i.pagination,
109
+ ...i.hookTableProps
89
110
  }), {
90
- meta: g,
91
- columns: w,
111
+ columns: R,
92
112
  tablePagination: W,
93
- table: V,
113
+ table: I,
94
114
  onUpdateColumnSelected: B,
95
- onUpdateChecked: v,
96
- columnSelected: U,
97
- autoRefetch: q,
98
- autoCountdown: R,
99
- onAutoRefetch: F,
100
- isExporting: b,
101
- isExportingRows: H,
102
- isImporting: J,
103
- onExport: K,
104
- onExportRows: G,
105
- onImport: M
106
- } = y, Q = p(() => w.value.filter((i) => "title" in i && "key" in i).map((i) => ({
107
- label: i.title,
108
- value: i.key
115
+ onUpdateChecked: w,
116
+ columnSelected: M,
117
+ autoRefetch: _,
118
+ autoCountdown: k,
119
+ onAutoRefetch: q,
120
+ isExporting: J,
121
+ isExportingRows: K,
122
+ isImporting: G,
123
+ onExport: H,
124
+ onExportRows: Q,
125
+ onImport: X
126
+ } = v, Y = b(() => R.value.filter((r) => "title" in r && "key" in r).map((r) => ({
127
+ label: r.title,
128
+ value: r.key
109
129
  }))), {
110
130
  width: u
111
- } = le(), X = p(() => w.value.reduce((c, n) => c + (Number(n == null ? void 0 : n.width) || Number(n == null ? void 0 : n.minWidth) || 110), 0)), d = te({
112
- show: !1,
113
- collapse: !1
114
- }), k = ie(), {
115
- height: Y
116
- } = oe(k);
117
- ae(Y, (i) => {
118
- i > 35 ? d.show = !0 : d.show = !1;
119
- }, {
120
- immediate: !0,
121
- deep: !0
122
- });
123
- const h = p(() => (a.filterSchema || []).map((i) => {
131
+ } = ne(), Z = b(() => R.value.reduce((c, o) => c + (Number(o == null ? void 0 : o.width) || Number(o == null ? void 0 : o.minWidth) || 110), 0)), p = x({
132
+ show: !1
133
+ }), f = x({
134
+ show: !1
135
+ }), m = x({
136
+ show: !1
137
+ }), y = b(() => (i.filterSchema || []).map((r) => {
124
138
  const {
125
- title: c,
126
- ...n
127
- } = i;
139
+ label: c,
140
+ ...o
141
+ } = r;
128
142
  return {
129
- tag: be,
143
+ tag: he,
130
144
  attrs: {
131
145
  label: c
132
146
  },
133
- children: n
147
+ children: o
134
148
  };
135
149
  })), {
136
- render: Z
137
- } = E({
138
- data: (C = h.value) == null ? void 0 : C.slice(1),
139
- components: {
140
- NInput: I
141
- }
150
+ render: $
151
+ } = O({
152
+ data: (C = y.value) == null ? void 0 : C.slice(1)
142
153
  }), {
143
- render: _
144
- } = E({
145
- data: (N = h.value) == null ? void 0 : N.slice(0, 1),
146
- components: {
147
- NInput: I
148
- }
149
- }), x = p(() => ({
150
- import: !0,
154
+ render: ee
155
+ } = O({
156
+ data: (S = y.value) == null ? void 0 : S.slice(0, 1)
157
+ }), s = b(() => ({
158
+ import: !1,
151
159
  export: !0,
152
160
  refresh: !0,
153
- ...a.tools
154
- })), {
155
- show: T
156
- } = xe();
157
- return () => t(ve, {
158
- actions: a.actions,
161
+ ...i.tools
162
+ }));
163
+ return () => t(be, {
164
+ actions: i.actions,
159
165
  scrollbar: !1
160
166
  }, {
161
167
  sideLeft: () => {
162
- var i;
163
- return e != null && e.sideLeft && u.value >= 1024 ? (i = e == null ? void 0 : e.sideLeft) == null ? void 0 : i.call(e) : void 0;
168
+ var r;
169
+ return e != null && e.sideLeft && u.value >= 1024 ? (r = e == null ? void 0 : e.sideLeft) == null ? void 0 : r.call(e) : void 0;
164
170
  },
165
171
  sideRight: () => {
166
- var i;
167
- return e != null && e.sideRight && u.value >= 1024 ? (i = e == null ? void 0 : e.sideRight) == null ? void 0 : i.call(e) : void 0;
172
+ var r;
173
+ return e != null && e.sideRight && u.value >= 1024 ? (r = e == null ? void 0 : e.sideRight) == null ? void 0 : r.call(e) : void 0;
168
174
  },
169
175
  default: () => {
170
- var i, c, n, S, s, z, j, L, P;
176
+ var r, c, o, T, j, L, N, P, z;
171
177
  return t("div", {
172
- class: "flex flex-col gap-3 h-full relative"
178
+ class: "flex flex-col gap-2 h-full relative"
173
179
  }, [t("div", {
174
- class: "flex gap-3 justify-between flex-col lg:flex-row"
175
- }, [a.tabs && t("div", {
180
+ class: "flex gap-2 justify-between flex-col lg:flex-row"
181
+ }, [i.tabs && t("div", {
176
182
  class: "flex flex-none"
177
- }, [t(ue, {
183
+ }, [t(oe, {
178
184
  type: "segment",
179
185
  size: "small",
180
186
  style: {
181
187
  "--n-tab-padding": "4px 10px"
182
188
  },
183
- "default-value": (c = (i = a.tabs) == null ? void 0 : i[0]) == null ? void 0 : c.value,
184
- value: (n = m.value) == null ? void 0 : n.tab,
185
- onUpdateValue: (r) => {
186
- m.value.tab = r;
189
+ "default-value": (c = (r = i.tabs) == null ? void 0 : r[0]) == null ? void 0 : c.value,
190
+ value: (o = g.value) == null ? void 0 : o.tab,
191
+ onUpdateValue: (a) => {
192
+ g.value.tab = a;
187
193
  }
188
194
  }, {
189
195
  default: () => {
190
- var r;
191
- return [(r = a.tabs) == null ? void 0 : r.map((A) => t(ce, {
192
- name: A.value,
193
- tab: A.label
196
+ var a;
197
+ return [(a = i.tabs) == null ? void 0 : a.map((d) => t(le, {
198
+ name: d.value,
199
+ tab: d.label
194
200
  }, null))];
195
201
  }
196
202
  })]), t("div", {
197
- class: ["overflow-hidden flex-1 flex gap-2", d.collapse ? "h-auto" : "h-8.5"]
198
- }, [(e == null ? void 0 : e.sideLeft) && u.value < 1024 && t(o, {
203
+ class: ["overflow-hidden flex-1 flex gap-2"]
204
+ }, [(e == null ? void 0 : e.sideLeft) && u.value < 1024 && t(l, {
199
205
  class: "flex-none",
200
206
  secondary: !0,
201
- loading: b.value,
202
207
  onClick: () => {
203
- T({
204
- title: a.sideLeftTitle,
205
- component: () => {
206
- var r;
207
- return t("div", null, [(r = e == null ? void 0 : e.sideLeft) == null ? void 0 : r.call(e)]);
208
- },
209
- width: 300,
210
- placement: "left"
211
- });
208
+ f.show = !f.show;
212
209
  }
213
210
  }, {
214
211
  icon: () => t("div", {
215
212
  class: "i-tabler:layout-sidebar-inactive size-4"
216
213
  }, null)
217
214
  }), t("div", {
218
- ref: k,
219
- class: ["flex-1 lg:flex gap-2 flex-wrap", a.tabs ? "justify-end" : "justify-start"]
220
- }, [D(_)]), (e == null ? void 0 : e.sideRight) && u.value < 1024 && t(o, {
215
+ class: ["flex-1 lg:flex gap-2 flex-wrap", i.tabs ? "justify-end" : "justify-start"]
216
+ }, [A(ee)]), (e == null ? void 0 : e.sideRight) && u.value < 1024 && t(l, {
221
217
  class: "flex-none",
222
218
  secondary: !0,
223
- loading: b.value,
224
219
  onClick: () => {
225
- T({
226
- title: a.sideRightTitle,
227
- component: () => {
228
- var r;
229
- return t("div", null, [(r = e == null ? void 0 : e.sideRight) == null ? void 0 : r.call(e)]);
230
- },
231
- width: 300,
232
- placement: "right"
233
- });
220
+ m.show = !m.show;
234
221
  }
235
222
  }, {
236
223
  icon: () => t("div", {
@@ -238,38 +225,30 @@ const at = /* @__PURE__ */ $({
238
225
  }, null)
239
226
  })]), t("div", {
240
227
  class: "flex gap-2 justify-between lg:justify-end"
241
- }, [h.value.length > 1 && t(de, {
242
- trigger: "click",
243
- displayDirective: "show"
244
- }, {
245
- trigger: () => t(o, {
246
- iconPlacement: "right",
247
- onClick: () => {
248
- d.collapse = !d.collapse;
249
- }
250
- }, {
251
- default: () => l("components.button.filter"),
252
- icon: () => t("div", {
253
- class: ["i-tabler:chevrons-down size-4 transition-all"]
254
- }, null)
255
- }),
256
- default: () => t("div", {
257
- class: "flex flex-col gap-2 py-1"
258
- }, [D(Z)])
259
- }), t("div", {
228
+ }, [t("div", {
260
229
  class: "flex gap-2 items-center"
261
- }, [(S = e == null ? void 0 : e.tools) == null ? void 0 : S.call(e), t(pe, {
262
- options: Q.value,
263
- value: U.value,
264
- onUpdateValue: (r) => {
265
- B(r);
230
+ }, [y.value.length > 1 && t(l, {
231
+ iconPlacement: "right",
232
+ onClick: () => {
233
+ p.show = !p.show;
234
+ }
235
+ }, {
236
+ default: () => n("components.button.filter"),
237
+ icon: () => t("div", {
238
+ class: ["i-tabler:chevrons-down size-4 transition-all"]
239
+ }, null)
240
+ }), (T = e == null ? void 0 : e.tools) == null ? void 0 : T.call(e), t(ue, {
241
+ options: Y.value,
242
+ value: M.value,
243
+ onUpdateValue: (a) => {
244
+ B(a);
266
245
  },
267
246
  multiple: !0,
268
247
  placement: "bottom-start",
269
248
  trigger: "click"
270
249
  }, {
271
- default: () => [t(f, null, {
272
- trigger: () => t(o, {
250
+ default: () => [t(h, null, {
251
+ trigger: () => t(l, {
273
252
  secondary: !0,
274
253
  "icon-placement": "right"
275
254
  }, {
@@ -277,93 +256,145 @@ const at = /* @__PURE__ */ $({
277
256
  class: "i-tabler:columns size-4"
278
257
  }, null)
279
258
  }),
280
- default: () => l("components.list.columnSetting")
259
+ default: () => n("components.list.columnSetting")
281
260
  })]
282
- }), x.value.export && t(f, null, {
283
- trigger: () => t(o, {
261
+ }), s.value.export && t(h, null, {
262
+ trigger: () => t(l, {
284
263
  secondary: !0,
285
- loading: b.value,
286
- onClick: K
264
+ loading: J.value,
265
+ onClick: H
287
266
  }, {
288
267
  icon: () => t("div", {
289
268
  class: "i-tabler:database-export size-4"
290
269
  }, null)
291
270
  }),
292
- default: () => l("components.button.export")
293
- }), x.value.import && t(f, null, {
294
- trigger: () => t(o, {
271
+ default: () => n("components.button.export")
272
+ }), s.value.import && t(h, null, {
273
+ trigger: () => t(l, {
295
274
  secondary: !0,
296
- loading: J.value,
297
- onClick: M
275
+ loading: G.value,
276
+ onClick: X
298
277
  }, {
299
278
  icon: () => t("div", {
300
279
  class: "i-tabler:database-import size-4"
301
280
  }, null)
302
281
  }),
303
- default: () => l("components.button.import")
304
- }), x.value.refresh && t(f, null, {
305
- trigger: () => t(o, {
282
+ default: () => n("components.button.import")
283
+ }), s.value.refresh && t(h, null, {
284
+ trigger: () => t(l, {
306
285
  secondary: !0,
307
- onClick: F
286
+ onClick: q
308
287
  }, {
309
- icon: () => q.value ? t(fe, {
288
+ icon: () => _.value ? t(ce, {
310
289
  class: "size-4",
311
290
  type: "circle",
312
- percentage: R.value * 10,
291
+ percentage: k.value * 10,
313
292
  strokeWidth: 20,
314
293
  color: "rgba(var(--ui-color-primary))"
315
294
  }, {
316
295
  default: () => [t("span", {
317
296
  class: "text-8px"
318
- }, [R.value])]
297
+ }, [k.value])]
319
298
  }) : t("div", {
320
299
  class: "i-tabler:refresh size-4"
321
300
  }, null)
322
301
  }),
323
- default: () => l("components.button.autoRefresh")
302
+ default: () => n("components.button.autoRefresh")
324
303
  })]), t("div", {
325
304
  class: "flex gap-2 justify-end"
326
- }, [(s = e.actions) == null ? void 0 : s.call(e), ((z = a.actions) == null ? void 0 : z.length) > 0 && O({
305
+ }, [(j = e.actions) == null ? void 0 : j.call(e), ((L = i.actions) == null ? void 0 : L.length) > 0 && V({
327
306
  type: u.value < 1024 ? "dropdown" : "button",
328
- items: a.actions
307
+ items: i.actions
329
308
  })])])]), t("div", {
330
309
  class: "flex-1 min-h-0"
331
- }, [(j = e == null ? void 0 : e.default) == null ? void 0 : j.call(e, {
332
- ...y,
333
- width: X.value
310
+ }, [(N = e == null ? void 0 : e.default) == null ? void 0 : N.call(e, {
311
+ ...v,
312
+ width: Z.value
334
313
  })]), t("div", {
335
314
  class: "flex justify-between"
336
- }, [t("div", null, [(L = e == null ? void 0 : e.bottom) == null ? void 0 : L.call(e)]), t("div", null, [a.pagination && t(me, re(W.value, {
315
+ }, [t("div", null, [(P = e == null ? void 0 : e.bottom) == null ? void 0 : P.call(e)]), t("div", null, [i.pagination && t(de, ie(W.value, {
337
316
  simple: u.value < 768
338
317
  }), {
339
- prefix: () => {
340
- var r;
341
- return t("div", null, [l("components.list.total", {
342
- total: ((r = g == null ? void 0 : g.value) == null ? void 0 : r.total) || 0
343
- })]);
344
- }
345
- })])]), t(he, {
346
- number: ((P = V.value.checkedRowKeys) == null ? void 0 : P.length) || 0 || 0,
318
+ prefix: () => t("div", null, [n("components.list.total", {
319
+ total: v.total.value || 0
320
+ })])
321
+ })])]), t(ve, {
322
+ number: ((z = I.value.checkedRowKeys) == null ? void 0 : z.length) || 0 || 0,
347
323
  group: [[{
348
324
  icon: "i-tabler:x",
349
325
  onClick: () => {
350
- v == null || v([]);
326
+ w == null || w([]);
351
327
  }
352
328
  }], [{
353
- label: l("components.button.export"),
329
+ label: n("components.button.export"),
354
330
  icon: "i-tabler:file-export",
355
- loading: H.value,
356
- onClick: G
331
+ loading: K.value,
332
+ onClick: Q
357
333
  }, {
358
- label: l("components.button.delete"),
334
+ label: n("components.button.delete"),
359
335
  type: "error",
360
336
  icon: "i-tabler:trash"
361
337
  }]]
362
- }, null)]);
338
+ }, null), t(pe, {
339
+ draggable: !0,
340
+ class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur",
341
+ show: p.show,
342
+ onUpdateShow: (a) => p.show = a
343
+ }, {
344
+ default: ({
345
+ draggableClass: a
346
+ }) => {
347
+ let d;
348
+ return t(me, {
349
+ title: n("components.button.filter"),
350
+ handle: a,
351
+ onClose: () => p.show = !1
352
+ }, {
353
+ default: () => [t(ge, {
354
+ showLabel: !0,
355
+ labelPlacement: "top"
356
+ }, ye(d = A($)) ? d : {
357
+ default: () => [d]
358
+ })]
359
+ });
360
+ }
361
+ }), t(U, {
362
+ show: f.show,
363
+ onUpdateShow: (a) => f.show = a,
364
+ autoFocus: !1,
365
+ placement: "left"
366
+ }, {
367
+ default: () => [t(E, {
368
+ title: i.sideLeftTitle || n("components.button.sideLeft"),
369
+ onClose: () => f.show = !1,
370
+ scrollbar: !1
371
+ }, {
372
+ default: () => {
373
+ var a;
374
+ return [(a = e == null ? void 0 : e.sideLeft) == null ? void 0 : a.call(e)];
375
+ }
376
+ })]
377
+ }), t(U, {
378
+ show: m.show,
379
+ onUpdateShow: (a) => m.show = a,
380
+ autoFocus: !1,
381
+ placement: "right"
382
+ }, {
383
+ default: () => [t(E, {
384
+ title: i.sideRightTitle || n("components.button.sideRight"),
385
+ onClose: () => m.show = !1,
386
+ scrollbar: !1
387
+ }, {
388
+ default: () => {
389
+ var a;
390
+ return [(a = e == null ? void 0 : e.sideRight) == null ? void 0 : a.call(e)];
391
+ }
392
+ })]
393
+ })]);
363
394
  }
364
395
  });
365
396
  }
366
397
  });
367
398
  export {
368
- at as DuxTableLayout
399
+ gt as DuxTableLayout
369
400
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as v, computed as f, createVNode as l } from "vue";
1
+ import { defineComponent as v, computed as f, createVNode as o } from "vue";
2
2
  import { useVModel as g } from "@vueuse/core";
3
3
  import { NSelect as s } from "naive-ui";
4
4
  import "@duxweb/dvha-core";
@@ -26,10 +26,21 @@ import "@duxweb/dvha-naiveui";
26
26
  import "../../pages/page404.js";
27
27
  import "@iconify-json/tabler/icons.json";
28
28
  import "mime";
29
+ import "vue3-ace-editor";
30
+ import "ace-builds/src-noconflict/mode-vue";
31
+ import "ace-builds/src-noconflict/mode-javascript";
32
+ import "ace-builds/src-noconflict/mode-html";
33
+ import "ace-builds/src-noconflict/mode-json";
34
+ import "ace-builds/src-noconflict/mode-json5";
35
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
36
+ import "ace-builds/src-noconflict/theme-tomorrow";
37
+ import "ace-builds/src-noconflict/ext-searchbox";
38
+ import "ace-builds/src-noconflict/ext-language_tools";
39
+ import "ace-builds/src-noconflict/mode-snippets";
29
40
  import "dayjs";
30
41
  import { useLevel as c } from "../../hooks/level.js";
31
42
  import "pinia";
32
- const T = /* @__PURE__ */ v({
43
+ const me = /* @__PURE__ */ v({
33
44
  name: "DuxLevel",
34
45
  props: {
35
46
  value: {
@@ -59,46 +70,46 @@ const T = /* @__PURE__ */ v({
59
70
  },
60
71
  emits: ["update:value"],
61
72
  setup(e, {
62
- emit: r
73
+ emit: m
63
74
  }) {
64
- const i = g(e, "value", r, {
75
+ const r = g(e, "value", m, {
65
76
  passive: !0,
66
77
  defaultValue: []
67
78
  }), {
68
- regions: o,
69
- onChange: m,
79
+ regions: a,
80
+ onChange: l,
70
81
  isLoading: p
71
82
  } = c({
72
- value: i,
83
+ value: r,
73
84
  path: e.path,
74
85
  nameField: e.nameField,
75
86
  maxLevel: e.maxLevel,
76
87
  labelField: e.labelField,
77
88
  valueField: e.valueField
78
- }), u = (t, a) => {
79
- m(t, a);
89
+ }), u = (t, i) => {
90
+ l(t, i);
80
91
  }, n = f(() => Array.from({
81
92
  length: e.maxLevel
82
- }, (t, a) => {
83
- const d = o.value[a] || [];
93
+ }, (t, i) => {
94
+ const d = a.value[i] || [];
84
95
  return {
85
- index: a,
96
+ index: i,
86
97
  options: d,
87
- value: i.value[a] || null
98
+ value: r.value[i] || null
88
99
  };
89
100
  }));
90
- return () => l("div", {
101
+ return () => o("div", {
91
102
  class: ["grid grid-cols-1 gap-2", "lg:grid-cols-[repeat(auto-fit,minmax(120px,1fr))]"]
92
- }, [n.value.map((t) => l(s, {
103
+ }, [n.value.map((t) => o(s, {
93
104
  key: t.index,
94
105
  value: t.value,
95
106
  options: t.options,
96
107
  clearable: !0,
97
108
  loading: p.value,
98
- onUpdateValue: (a) => u(a, t.index)
109
+ onUpdateValue: (i) => u(i, t.index)
99
110
  }, null))]);
100
111
  }
101
112
  });
102
113
  export {
103
- T as DuxLevel
114
+ me as DuxLevel
104
115
  };