@duxweb/dvha-pro 1.0.46 → 1.0.48

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 (64) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/layout/list.cjs +1 -1
  3. package/dist/cjs/components/layout/table.cjs +1 -1
  4. package/dist/cjs/components/layout/tools.cjs +1 -1
  5. package/dist/cjs/components/list/card.cjs +1 -1
  6. package/dist/cjs/components/list/list.cjs +1 -1
  7. package/dist/cjs/components/table/table.cjs +1 -1
  8. package/dist/cjs/components/table/tablePage.cjs +1 -1
  9. package/dist/cjs/dvha-pro.css +1 -1
  10. package/dist/cjs/hooks/table.cjs +1 -1
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/cjs/langs/en-US.json.cjs +1 -1
  13. package/dist/cjs/langs/zh-CN.json.cjs +1 -1
  14. package/dist/cjs/pages/authLayout.cjs +1 -1
  15. package/dist/cjs/pages/layout/page.cjs +1 -1
  16. package/dist/cjs/pages/layout/tab.cjs +1 -1
  17. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  18. package/dist/cjs/pages/menu/button.cjs +1 -1
  19. package/dist/cjs/pages/menu/dark.cjs +1 -0
  20. package/dist/cjs/pages/menu/menuApp.cjs +1 -0
  21. package/dist/cjs/pages/menu/menuMain.cjs +1 -0
  22. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  23. package/dist/cjs/pages/menu/notice.cjs +1 -0
  24. package/dist/cjs/theme/uno.css.cjs +19 -9
  25. package/dist/esm/component.js +1 -1
  26. package/dist/esm/components/layout/list.js +95 -86
  27. package/dist/esm/components/layout/table.js +122 -117
  28. package/dist/esm/components/layout/tools.js +109 -32
  29. package/dist/esm/components/list/card.js +27 -22
  30. package/dist/esm/components/list/list.js +16 -11
  31. package/dist/esm/components/table/table.js +31 -27
  32. package/dist/esm/components/table/tablePage.js +17 -12
  33. package/dist/esm/dvha-pro.css +1 -1
  34. package/dist/esm/hooks/table.js +25 -19
  35. package/dist/esm/index.js +84 -78
  36. package/dist/esm/langs/en-US.json.js +1 -1
  37. package/dist/esm/langs/zh-CN.json.js +2 -2
  38. package/dist/esm/pages/authLayout.js +20 -17
  39. package/dist/esm/pages/layout/page.js +1 -1
  40. package/dist/esm/pages/layout/tab.js +2 -2
  41. package/dist/esm/pages/menu/avatar.js +83 -71
  42. package/dist/esm/pages/menu/button.js +12 -13
  43. package/dist/esm/pages/menu/dark.js +54 -0
  44. package/dist/esm/pages/menu/menuApp.js +207 -0
  45. package/dist/esm/pages/menu/{main.js → menuMain.js} +46 -41
  46. package/dist/esm/pages/menu/mobile.js +16 -13
  47. package/dist/esm/pages/menu/notice.js +205 -0
  48. package/dist/esm/theme/uno.css.js +19 -9
  49. package/dist/types/components/layout/list.d.ts +7 -0
  50. package/dist/types/components/layout/table.d.ts +7 -0
  51. package/dist/types/components/layout/tools.d.ts +28 -2
  52. package/dist/types/components/list/card.d.ts +6 -0
  53. package/dist/types/components/list/list.d.ts +6 -0
  54. package/dist/types/components/table/tablePage.d.ts +6 -0
  55. package/dist/types/main.d.ts +12 -0
  56. package/dist/types/pages/menu/avatar.d.ts +18 -0
  57. package/dist/types/pages/menu/button.d.ts +9 -9
  58. package/dist/types/pages/menu/dark.d.ts +2 -0
  59. package/dist/types/pages/menu/index.d.ts +4 -1
  60. package/dist/types/pages/menu/{main.d.ts → menuApp.d.ts} +1 -1
  61. package/dist/types/pages/menu/menuMain.d.ts +22 -0
  62. package/dist/types/pages/menu/notice.d.ts +14 -0
  63. package/package.json +3 -3
  64. package/dist/cjs/pages/menu/main.cjs +0 -1
@@ -1,8 +1,8 @@
1
- import { defineComponent as Y, toRef as z, ref as P, computed as c, reactive as b, watch as Z, onMounted as $, createVNode as e, h as R, mergeProps as ee, isVNode as te } from "vue";
2
- import { useI18n as le, useExtendList as ie, useJsonSchema as A } from "@duxweb/dvha-core";
3
- import { useWindowSize as ae } from "@vueuse/core";
4
- import { NTooltip as f, NCheckbox as F, NTabs as oe, NTab as re, NButton as s, NSpin as ne, NProgress as se, NPagination as ue, NModal as ce, NDrawer as j } from "naive-ui";
5
- import { useAction as de } from "../../hooks/action.js";
1
+ import { defineComponent as Z, toRef as z, ref as P, computed as c, reactive as b, watch as $, onMounted as ee, createVNode as e, h as R, mergeProps as te, isVNode as le } from "vue";
2
+ import { useI18n as ie, useExtendList as ae, useJsonSchema as A } from "@duxweb/dvha-core";
3
+ import { useWindowSize as oe } from "@vueuse/core";
4
+ import { NTooltip as f, NCheckbox as F, NTabs as re, NTab as ne, NButton as s, NSpin as se, NProgress as ue, NPagination as ce, NModal as de, NDrawer as j } from "naive-ui";
5
+ import { useAction as pe } from "../../hooks/action.js";
6
6
  import "@overlastic/vue";
7
7
  import "clsx";
8
8
  import "vue-echarts";
@@ -18,12 +18,12 @@ import "ace-builds/src-noconflict/ext-searchbox";
18
18
  import "ace-builds/src-noconflict/ext-language_tools";
19
19
  import "ace-builds/src-noconflict/mode-snippets";
20
20
  import "vue-cropper";
21
- import pe from "../modal/modalPage.js";
21
+ import me from "../modal/modalPage.js";
22
22
  import "jinrishici";
23
23
  import "lodash-es";
24
24
  import "vue-draggable-plus";
25
- import { DuxTableFilter as me } from "./filter.js";
26
- import { DuxFilterLayout as fe } from "./filterLayout.js";
25
+ import { DuxTableFilter as fe } from "./filter.js";
26
+ import { DuxFilterLayout as he } from "./filterLayout.js";
27
27
  import "@vee-validate/i18n";
28
28
  import "colorizr";
29
29
  import "echarts";
@@ -53,9 +53,9 @@ import "vue-command-palette";
53
53
  import "@duxweb/dvha-naiveui";
54
54
  import { DuxPage as ge } from "../../pages/page.js";
55
55
  import "../../pages/page404.js";
56
- import { DuxPageEmpty as he } from "../../pages/pageEmpty.js";
56
+ import { DuxPageEmpty as ve } from "../../pages/pageEmpty.js";
57
57
  import { DuxDrawerPage as N } from "../drawer/drawerPage.js";
58
- import { DuxTableTools as ve } from "./tools.js";
58
+ import { DuxTableTools as be } from "./tools.js";
59
59
  import "short-unique-id";
60
60
  import "aieditor";
61
61
  import "@vue-flow/core";
@@ -68,10 +68,10 @@ import "fabric";
68
68
  import "dayjs";
69
69
  import "@tanstack/vue-query";
70
70
  import "pinia";
71
- function be(t) {
72
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !te(t);
71
+ function xe(t) {
72
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !le(t);
73
73
  }
74
- const Tt = /* @__PURE__ */ Y({
74
+ const Ot = /* @__PURE__ */ Z({
75
75
  name: "DuxListLayout",
76
76
  props: {
77
77
  rowKey: {
@@ -113,28 +113,34 @@ const Tt = /* @__PURE__ */ Y({
113
113
  type: String,
114
114
  default: ""
115
115
  },
116
+ batchOptions: {
117
+ type: Array
118
+ },
116
119
  hookListProps: {
117
120
  type: Object
118
121
  }
119
122
  },
120
123
  setup(t, {
121
- slots: o
124
+ slots: o,
125
+ expose: D
122
126
  }) {
123
- const D = z(t.filter || {}), {
127
+ const U = z(t.filter || {}), {
124
128
  t: a
125
- } = le(), {
126
- renderAction: U
127
- } = de(), T = z(t.pagination && typeof t.pagination == "object" ? t.pagination : {
129
+ } = ie(), {
130
+ renderAction: T
131
+ } = pe(), O = z(t.pagination && typeof t.pagination == "object" ? t.pagination : {
128
132
  page: 1,
129
133
  pageSize: 20
130
- }), g = P({}), O = () => {
131
- Object.assign(g.value, D.value);
132
- }, i = ie({
134
+ }), h = P({}), B = () => {
135
+ Object.assign(h.value, U.value);
136
+ }, l = ae({
133
137
  path: t.path,
134
- filters: g.value,
135
- pagination: T.value,
138
+ filters: h.value,
139
+ pagination: O.value,
136
140
  ...t.hookListProps
137
- }), {
141
+ });
142
+ D(l);
143
+ const {
138
144
  meta: E,
139
145
  list: x,
140
146
  isLoading: w,
@@ -145,16 +151,16 @@ const Tt = /* @__PURE__ */ Y({
145
151
  isExportingRows: V,
146
152
  isImporting: S,
147
153
  onExport: W,
148
- onExportRows: B,
149
- onImport: J
150
- } = i, _ = c(() => ({
151
- page: i.page.value,
152
- pageSize: i.pageSize.value,
153
- pageCount: i.pageCount.value,
154
- pageSizes: i.pageSizes,
154
+ onExportRows: J,
155
+ onImport: _
156
+ } = l, K = c(() => ({
157
+ page: l.page.value,
158
+ pageSize: l.pageSize.value,
159
+ pageCount: l.pageCount.value,
160
+ pageSizes: l.pageSizes,
155
161
  pageSlot: 5,
156
- onUpdatePage: i.onUpdatePage,
157
- onUpdatePageSize: i.onUpdatePageSize,
162
+ onUpdatePage: l.onUpdatePage,
163
+ onUpdatePageSize: l.onUpdatePageSize,
158
164
  showSizePicker: !0,
159
165
  showQuickJumper: !0
160
166
  })), d = b({
@@ -163,41 +169,41 @@ const Tt = /* @__PURE__ */ Y({
163
169
  show: !1
164
170
  }), m = b({
165
171
  show: !1
166
- }), h = P(t.filterSchema?.length || 0), {
172
+ }), g = P(t.filterSchema?.length || 0), {
167
173
  width: r
168
- } = ae(), k = () => {
174
+ } = oe(), k = () => {
169
175
  if (!t.filterSchema?.length) return 0;
170
- const l = t.filterSchema.length;
171
- if (l <= 3)
172
- return l;
176
+ const i = t.filterSchema.length;
177
+ if (i <= 3)
178
+ return i;
173
179
  const n = r.value || 1024;
174
180
  let u = 3;
175
- return n >= 1280 ? u = 4 : n >= 1024 ? u = 3 : n >= 768 ? u = 2 : u = 1, Math.min(l, u);
181
+ return n >= 1280 ? u = 4 : n >= 1024 ? u = 3 : n >= 768 ? u = 2 : u = 1, Math.min(i, u);
176
182
  };
177
- Z(r, () => {
178
- h.value = k();
179
- }), $(() => {
180
- h.value = k();
183
+ $(r, () => {
184
+ g.value = k();
185
+ }), ee(() => {
186
+ g.value = k();
181
187
  });
182
- const K = c(() => (t.filterSchema || []).slice(0, h.value)), C = c(() => (t.filterSchema || []).slice(h.value)), Q = c(() => C.value.length > 0), L = (l) => l.map((n) => {
188
+ const Q = c(() => (t.filterSchema || []).slice(0, g.value)), C = c(() => (t.filterSchema || []).slice(g.value)), G = c(() => C.value.length > 0), L = (i) => i.map((n) => {
183
189
  const {
184
190
  title: u,
185
- ...X
191
+ ...Y
186
192
  } = n;
187
193
  return {
188
- tag: me,
194
+ tag: fe,
189
195
  attrs: {
190
196
  label: u,
191
197
  class: "flex-1 min-w-0"
192
198
  },
193
- children: X
199
+ children: Y
194
200
  };
195
201
  }), {
196
- render: G
202
+ render: H
197
203
  } = A({
198
- data: c(() => L(K.value))
204
+ data: c(() => L(Q.value))
199
205
  }), {
200
- render: H
206
+ render: X
201
207
  } = A({
202
208
  data: c(() => L(C.value))
203
209
  }), v = c(() => ({
@@ -224,26 +230,26 @@ const Tt = /* @__PURE__ */ Y({
224
230
  trigger: () => e("div", {
225
231
  class: "flex items-center"
226
232
  }, [e(F, {
227
- checked: i.isAllChecked.value,
228
- indeterminate: i.isIndeterminate.value,
229
- onUpdateChecked: i.toggleSelectAll
233
+ checked: l.isAllChecked.value,
234
+ indeterminate: l.isIndeterminate.value,
235
+ onUpdateChecked: l.toggleSelectAll
230
236
  }, null)]),
231
237
  default: () => a("components.list.selectAll")
232
- })]), t.tabs && e("div", null, [e(oe, {
238
+ })]), t.tabs && e("div", null, [e(re, {
233
239
  type: "segment",
234
240
  size: "small",
235
241
  style: {
236
242
  "--n-tab-padding": "4px 10px"
237
243
  },
238
244
  "default-value": t.tabs?.[0]?.value,
239
- value: g.value?.tab,
240
- onUpdateValue: (l) => {
241
- g.value.tab = l;
245
+ value: h.value?.tab,
246
+ onUpdateValue: (i) => {
247
+ h.value.tab = i;
242
248
  }
243
249
  }, {
244
- default: () => [t.tabs?.map((l) => e(re, {
245
- name: l.value,
246
- tab: l.label
250
+ default: () => [t.tabs?.map((i) => e(ne, {
251
+ name: i.value,
252
+ tab: i.label
247
253
  }, null))]
248
254
  })]), e("div", {
249
255
  class: "flex gap-2"
@@ -259,10 +265,10 @@ const Tt = /* @__PURE__ */ Y({
259
265
  }, null)
260
266
  }), e("div", {
261
267
  class: "flex flex-wrap gap-2 items-center flex-1 lg:flex-none"
262
- }, [R(G)]), e(s, {
268
+ }, [R(H)]), e(s, {
263
269
  type: "primary",
264
270
  secondary: !0,
265
- onClick: O
271
+ onClick: B
266
272
  }, {
267
273
  icon: () => e("div", {
268
274
  class: "i-tabler:search size-4"
@@ -278,7 +284,7 @@ const Tt = /* @__PURE__ */ Y({
278
284
  icon: () => e("div", {
279
285
  class: "i-tabler:layout-sidebar-right-inactive size-4"
280
286
  }, null)
281
- }), Q.value && e(s, {
287
+ }), G.value && e(s, {
282
288
  iconPlacement: "right",
283
289
  onClick: () => {
284
290
  d.show = !d.show;
@@ -290,11 +296,11 @@ const Tt = /* @__PURE__ */ Y({
290
296
  }, null)
291
297
  })])]), e("div", {
292
298
  class: "flex gap-2"
293
- }, [o.actions?.(), t.actions?.length > 0 && U({
299
+ }, [o.actions?.(), t.actions?.length > 0 && T({
294
300
  type: r.value < 1024 ? "dropdown" : "button",
295
301
  text: r.value < 1024,
296
302
  items: t.actions
297
- })])]), e(ne, {
303
+ })])]), e(se, {
298
304
  show: w.value,
299
305
  class: "flex-1 min-h-0",
300
306
  contentClass: "h-full"
@@ -303,7 +309,7 @@ const Tt = /* @__PURE__ */ Y({
303
309
  class: ["h-full overflow-auto rounded-lg px-3"]
304
310
  }, [!w.value && x.value.length === 0 && e("div", {
305
311
  class: "flex justify-center items-center h-full"
306
- }, [e(he, null, null)]), x.value.length > 0 && o?.default?.(i)])]
312
+ }, [e(ve, null, null)]), x.value.length > 0 && o?.default?.(l)])]
307
313
  }), e("div", {
308
314
  class: "flex justify-between px-3 py-2 gap-2"
309
315
  }, [e("div", null, [e("div", {
@@ -315,9 +321,9 @@ const Tt = /* @__PURE__ */ Y({
315
321
  quaternary: !0
316
322
  }, {
317
323
  default: () => [e(F, {
318
- checked: i.isAllChecked.value,
319
- indeterminate: i.isIndeterminate.value,
320
- onUpdateChecked: i.toggleSelectAll
324
+ checked: l.isAllChecked.value,
325
+ indeterminate: l.isIndeterminate.value,
326
+ onUpdateChecked: l.toggleSelectAll
321
327
  }, null)]
322
328
  }),
323
329
  default: () => a("components.list.selectAll")
@@ -336,7 +342,7 @@ const Tt = /* @__PURE__ */ Y({
336
342
  }), v.value.import && e(f, null, {
337
343
  trigger: () => e(s, {
338
344
  loading: S.value,
339
- onClick: J,
345
+ onClick: _,
340
346
  circle: !0,
341
347
  quaternary: !0
342
348
  }, {
@@ -351,7 +357,7 @@ const Tt = /* @__PURE__ */ Y({
351
357
  circle: !0,
352
358
  quaternary: !0
353
359
  }, {
354
- icon: () => q.value ? e(se, {
360
+ icon: () => q.value ? e(ue, {
355
361
  class: "size-4",
356
362
  type: "circle",
357
363
  percentage: y.value * 10,
@@ -368,55 +374,58 @@ const Tt = /* @__PURE__ */ Y({
368
374
  default: () => a("components.button.autoRefresh")
369
375
  })])]), e("div", {
370
376
  class: "flex items-center gap-2"
371
- }, [o?.bottom?.(), t.pagination && e(ue, ee(_.value, {
377
+ }, [o?.bottom?.(), t.pagination && e(ce, te(K.value, {
372
378
  simple: r.value < 768
373
379
  }), {
374
380
  prefix: () => e("div", null, [a("components.list.total", {
375
381
  total: E?.value?.total || 0
376
382
  })])
377
- })])]), e(ve, {
378
- number: i.checkeds.value.length,
383
+ })])]), e(be, {
384
+ isLoading: l.isBatching.value,
385
+ onBatch: l.onBatch,
386
+ selecteds: l.checkeds.value,
387
+ number: l.checkeds.value.length,
379
388
  group: [[{
380
389
  icon: "i-tabler:x",
381
390
  onClick: () => {
382
- i.checkeds.value = [], i.onUpdateChecked?.([]);
391
+ l.checkeds.value = [], l.onUpdateChecked?.([]);
383
392
  }
384
393
  }], [{
385
394
  label: a("components.button.export"),
386
395
  icon: "i-tabler:file-export",
387
396
  loading: V.value,
388
- onClick: B
397
+ onClick: J
389
398
  }, {
390
399
  label: a("components.button.delete"),
391
400
  type: "error",
392
401
  icon: "i-tabler:trash"
393
402
  }]]
394
- }, null), e(ce, {
403
+ }, null), e(de, {
395
404
  draggable: !0,
396
405
  class: "bg-white rounded dark:shadow-gray-950/80 dark:bg-gray-800/60 backdrop-blur",
397
406
  show: d.show,
398
- onUpdateShow: (l) => d.show = l
407
+ onUpdateShow: (i) => d.show = i
399
408
  }, {
400
409
  default: ({
401
- draggableClass: l
410
+ draggableClass: i
402
411
  }) => {
403
412
  let n;
404
- return e(pe, {
413
+ return e(me, {
405
414
  title: a("components.button.filter"),
406
- handle: l,
415
+ handle: i,
407
416
  onClose: () => d.show = !1
408
417
  }, {
409
- default: () => [e(fe, {
418
+ default: () => [e(he, {
410
419
  showLabel: !0,
411
420
  labelPlacement: "top"
412
- }, be(n = R(H)) ? n : {
421
+ }, xe(n = R(X)) ? n : {
413
422
  default: () => [n]
414
423
  })]
415
424
  });
416
425
  }
417
426
  }), e(j, {
418
427
  show: p.show,
419
- onUpdateShow: (l) => p.show = l,
428
+ onUpdateShow: (i) => p.show = i,
420
429
  autoFocus: !1,
421
430
  placement: "left"
422
431
  }, {
@@ -429,7 +438,7 @@ const Tt = /* @__PURE__ */ Y({
429
438
  })]
430
439
  }), e(j, {
431
440
  show: m.show,
432
- onUpdateShow: (l) => m.show = l,
441
+ onUpdateShow: (i) => m.show = i,
433
442
  autoFocus: !1,
434
443
  placement: "right"
435
444
  }, {
@@ -445,5 +454,5 @@ const Tt = /* @__PURE__ */ Y({
445
454
  }
446
455
  });
447
456
  export {
448
- Tt as DuxListLayout
457
+ Ot as DuxListLayout
449
458
  };