@duxweb/dvha-pro 1.0.31 → 1.0.33

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 (141) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/chart/echart.cjs +1 -1
  3. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  4. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  5. package/dist/cjs/components/data/selectModal.cjs +1 -1
  6. package/dist/cjs/components/designEditor/components/grid.cjs +1 -1
  7. package/dist/cjs/components/designEditor/editor/setting.cjs +1 -1
  8. package/dist/cjs/components/form/drawerForm.cjs +1 -1
  9. package/dist/cjs/components/form/modalForm.cjs +1 -1
  10. package/dist/cjs/components/form/pageForm.cjs +1 -1
  11. package/dist/cjs/components/form/pageTabForm.cjs +1 -0
  12. package/dist/cjs/components/form/settingForm.cjs +1 -1
  13. package/dist/cjs/components/formEditor/base/base.cjs +1 -1
  14. package/dist/cjs/components/formEditor/base/setting.cjs +1 -1
  15. package/dist/cjs/components/formEditor/components/cascader.cjs +1 -1
  16. package/dist/cjs/components/formEditor/components/cascaderAsync.cjs +1 -1
  17. package/dist/cjs/components/formEditor/components/checkbox.cjs +1 -1
  18. package/dist/cjs/components/formEditor/components/color.cjs +1 -1
  19. package/dist/cjs/components/formEditor/components/date.cjs +1 -1
  20. package/dist/cjs/components/formEditor/components/dynamicInput.cjs +1 -1
  21. package/dist/cjs/components/formEditor/components/dynamicTags.cjs +1 -1
  22. package/dist/cjs/components/formEditor/components/editor.cjs +1 -1
  23. package/dist/cjs/components/formEditor/components/input.cjs +1 -1
  24. package/dist/cjs/components/formEditor/components/inputNumber.cjs +1 -1
  25. package/dist/cjs/components/formEditor/components/mentionAsync.cjs +1 -1
  26. package/dist/cjs/components/formEditor/components/radio.cjs +1 -1
  27. package/dist/cjs/components/formEditor/components/region.cjs +1 -1
  28. package/dist/cjs/components/formEditor/components/select.cjs +1 -1
  29. package/dist/cjs/components/formEditor/components/selectAsync.cjs +1 -1
  30. package/dist/cjs/components/formEditor/components/sider.cjs +1 -1
  31. package/dist/cjs/components/formEditor/components/switch.cjs +1 -1
  32. package/dist/cjs/components/formEditor/components/time.cjs +1 -1
  33. package/dist/cjs/components/formEditor/components/transferAsync.cjs +1 -1
  34. package/dist/cjs/components/formEditor/components/treeSelect.cjs +1 -1
  35. package/dist/cjs/components/formEditor/components/treeSelectAsync.cjs +1 -1
  36. package/dist/cjs/components/formEditor/editor.cjs +1 -1
  37. package/dist/cjs/components/formEditor/renderer.cjs +1 -1
  38. package/dist/cjs/components/icon/icon.cjs +1 -1
  39. package/dist/cjs/components/layout/list.cjs +1 -1
  40. package/dist/cjs/components/layout/table.cjs +1 -1
  41. package/dist/cjs/components/level/level.cjs +1 -1
  42. package/dist/cjs/components/posterEditor/pages/RightPanel.cjs +1 -1
  43. package/dist/cjs/components/posterEditor/posterEditor.cjs +1 -1
  44. package/dist/cjs/components/table/table.cjs +1 -1
  45. package/dist/cjs/components/upload/file.cjs +1 -1
  46. package/dist/cjs/components/upload/image.cjs +1 -1
  47. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  48. package/dist/cjs/components/upload/manager.cjs +1 -1
  49. package/dist/cjs/config/echart.cjs +1 -1
  50. package/dist/cjs/dvha-pro.css +1 -1
  51. package/dist/cjs/hooks/dialog.cjs +1 -1
  52. package/dist/cjs/hooks/drawer.cjs +1 -1
  53. package/dist/cjs/hooks/modal.cjs +1 -1
  54. package/dist/cjs/hooks/table/image.cjs +1 -1
  55. package/dist/cjs/hooks/table/media.cjs +1 -1
  56. package/dist/cjs/index.cjs +1 -1
  57. package/dist/cjs/pages/layout/global.cjs +1 -1
  58. package/dist/cjs/pages/layout/page.cjs +1 -1
  59. package/dist/cjs/pages/login.cjs +1 -1
  60. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  61. package/dist/cjs/pages/menu/button.cjs +1 -1
  62. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  63. package/dist/cjs/pages/menu/main.cjs +1 -1
  64. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  65. package/dist/cjs/pages/page404.cjs +1 -1
  66. package/dist/cjs/pages/pageStatus.cjs +1 -1
  67. package/dist/cjs/theme/uno.css.cjs +2 -1
  68. package/dist/esm/component.js +31 -31
  69. package/dist/esm/components/chart/echart.js +16 -2
  70. package/dist/esm/components/crop/imageCrop.js +26 -12
  71. package/dist/esm/components/data/dynamicSelect.js +34 -20
  72. package/dist/esm/components/data/selectModal.js +41 -27
  73. package/dist/esm/components/designEditor/components/grid.js +39 -25
  74. package/dist/esm/components/designEditor/editor/setting.js +36 -22
  75. package/dist/esm/components/form/drawerForm.js +32 -18
  76. package/dist/esm/components/form/modalForm.js +31 -17
  77. package/dist/esm/components/form/pageForm.js +40 -30
  78. package/dist/esm/components/form/pageTabForm.js +159 -0
  79. package/dist/esm/components/form/settingForm.js +32 -18
  80. package/dist/esm/components/formEditor/base/base.js +29 -15
  81. package/dist/esm/components/formEditor/base/setting.js +21 -7
  82. package/dist/esm/components/formEditor/components/cascader.js +65 -51
  83. package/dist/esm/components/formEditor/components/cascaderAsync.js +95 -81
  84. package/dist/esm/components/formEditor/components/checkbox.js +43 -29
  85. package/dist/esm/components/formEditor/components/color.js +34 -20
  86. package/dist/esm/components/formEditor/components/date.js +51 -37
  87. package/dist/esm/components/formEditor/components/dynamicInput.js +42 -28
  88. package/dist/esm/components/formEditor/components/dynamicTags.js +39 -25
  89. package/dist/esm/components/formEditor/components/editor.js +23 -9
  90. package/dist/esm/components/formEditor/components/input.js +66 -52
  91. package/dist/esm/components/formEditor/components/inputNumber.js +37 -23
  92. package/dist/esm/components/formEditor/components/mentionAsync.js +60 -46
  93. package/dist/esm/components/formEditor/components/radio.js +28 -14
  94. package/dist/esm/components/formEditor/components/region.js +37 -23
  95. package/dist/esm/components/formEditor/components/select.js +16 -2
  96. package/dist/esm/components/formEditor/components/selectAsync.js +72 -58
  97. package/dist/esm/components/formEditor/components/sider.js +40 -26
  98. package/dist/esm/components/formEditor/components/switch.js +33 -19
  99. package/dist/esm/components/formEditor/components/time.js +60 -46
  100. package/dist/esm/components/formEditor/components/transferAsync.js +49 -35
  101. package/dist/esm/components/formEditor/components/treeSelect.js +54 -40
  102. package/dist/esm/components/formEditor/components/treeSelectAsync.js +74 -60
  103. package/dist/esm/components/formEditor/editor.js +16 -2
  104. package/dist/esm/components/formEditor/renderer.js +28 -14
  105. package/dist/esm/components/icon/icon.js +23 -9
  106. package/dist/esm/components/layout/list.js +69 -55
  107. package/dist/esm/components/layout/table.js +101 -85
  108. package/dist/esm/components/level/level.js +37 -23
  109. package/dist/esm/components/posterEditor/pages/RightPanel.js +46 -32
  110. package/dist/esm/components/posterEditor/posterEditor.js +26 -12
  111. package/dist/esm/components/table/table.js +21 -7
  112. package/dist/esm/components/upload/file.js +20 -4
  113. package/dist/esm/components/upload/image.js +42 -28
  114. package/dist/esm/components/upload/manage/item.js +24 -10
  115. package/dist/esm/components/upload/manager.js +16 -2
  116. package/dist/esm/config/echart.js +1 -1
  117. package/dist/esm/dvha-pro.css +1 -1
  118. package/dist/esm/hooks/dialog.js +16 -2
  119. package/dist/esm/hooks/drawer.js +16 -2
  120. package/dist/esm/hooks/modal.js +16 -2
  121. package/dist/esm/hooks/table/image.js +20 -6
  122. package/dist/esm/hooks/table/media.js +20 -6
  123. package/dist/esm/index.js +130 -128
  124. package/dist/esm/pages/layout/global.js +52 -37
  125. package/dist/esm/pages/layout/page.js +26 -12
  126. package/dist/esm/pages/login.js +33 -19
  127. package/dist/esm/pages/menu/avatar.js +46 -32
  128. package/dist/esm/pages/menu/button.js +22 -8
  129. package/dist/esm/pages/menu/cmd.js +51 -37
  130. package/dist/esm/pages/menu/main.js +42 -28
  131. package/dist/esm/pages/menu/mobile.js +16 -2
  132. package/dist/esm/pages/page404.js +14 -0
  133. package/dist/esm/pages/pageStatus.js +18 -4
  134. package/dist/esm/theme/uno.css.js +2 -1
  135. package/dist/types/components/data/selectModal.d.ts +1 -1
  136. package/dist/types/components/form/index.d.ts +1 -0
  137. package/dist/types/components/form/pageForm.d.ts +0 -9
  138. package/dist/types/components/form/pageTabForm.d.ts +63 -0
  139. package/dist/types/components/layout/table.d.ts +2 -2
  140. package/dist/types/components/table/tablePage.d.ts +2 -2
  141. package/package.json +5 -3
@@ -1,5 +1,5 @@
1
- import { defineComponent as v, createVNode as e, Fragment as u, createTextVNode as c, isVNode as s } from "vue";
2
- import { NButton as l, NTooltip as n, NInputNumber as o, NColorPicker as f } from "naive-ui";
1
+ import { defineComponent as v, createVNode as e, Fragment as o, createTextVNode as c, isVNode as s } from "vue";
2
+ import { NButton as l, NTooltip as n, NInputNumber as u, NColorPicker as f } from "naive-ui";
3
3
  import "@duxweb/dvha-core";
4
4
  import "@vueuse/core";
5
5
  import "mime";
@@ -25,6 +25,20 @@ import "vue-draggable-plus";
25
25
  import "@vee-validate/i18n";
26
26
  import "colorizr";
27
27
  import "echarts";
28
+ import "highlight.js/lib/core";
29
+ import "highlight.js/lib/languages/bash";
30
+ import "highlight.js/lib/languages/css";
31
+ import "highlight.js/lib/languages/go";
32
+ import "highlight.js/lib/languages/java";
33
+ import "highlight.js/lib/languages/javascript";
34
+ import "highlight.js/lib/languages/json";
35
+ import "highlight.js/lib/languages/markdown";
36
+ import "highlight.js/lib/languages/php";
37
+ import "highlight.js/lib/languages/python";
38
+ import "highlight.js/lib/languages/shell";
39
+ import "highlight.js/lib/languages/sql";
40
+ import "highlight.js/lib/languages/typescript";
41
+ import "highlight.js/lib/languages/xml";
28
42
  import "@ant-design/colors";
29
43
  import "@unocss/preset-icons/browser";
30
44
  import "@unocss/preset-typography";
@@ -41,7 +55,7 @@ import "@iconify-json/tabler/icons.json";
41
55
  import "../elements/index.js";
42
56
  import "fabric";
43
57
  import { Panel as m } from "./Panel.js";
44
- import { PanelItem as a } from "./PanelItem.js";
58
+ import { PanelItem as i } from "./PanelItem.js";
45
59
  import "dayjs";
46
60
  import "@tanstack/vue-query";
47
61
  import "pinia";
@@ -49,7 +63,7 @@ import { DuxImageUpload as b } from "../../upload/image.js";
49
63
  function C(t) {
50
64
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !s(t);
51
65
  }
52
- const ge = /* @__PURE__ */ v({
66
+ const Ie = /* @__PURE__ */ v({
53
67
  name: "RightPanel",
54
68
  props: {
55
69
  hasMultipleSelection: {
@@ -148,7 +162,7 @@ const ge = /* @__PURE__ */ v({
148
162
  return e(m, {
149
163
  title: "多选操作"
150
164
  }, {
151
- default: () => e(u, null, [e(a, {
165
+ default: () => e(o, null, [e(i, {
152
166
  title: "对齐"
153
167
  }, {
154
168
  default: () => [e("div", {
@@ -186,7 +200,7 @@ const ge = /* @__PURE__ */ v({
186
200
  }, null),
187
201
  default: () => "底部对齐"
188
202
  })])]
189
- }), e(a, {
203
+ }), e(i, {
190
204
  title: "居中"
191
205
  }, {
192
206
  default: () => [e("div", {
@@ -225,7 +239,7 @@ const ge = /* @__PURE__ */ v({
225
239
  default: () => "垂直分布"
226
240
  })])]
227
241
  })]),
228
- footer: () => e(u, null, [e(l, {
242
+ footer: () => e(o, null, [e(l, {
229
243
  block: !0,
230
244
  onClick: t.onDeleteSelectedElements,
231
245
  type: "error"
@@ -241,38 +255,38 @@ const ge = /* @__PURE__ */ v({
241
255
  return e(m, {
242
256
  title: "元素设置"
243
257
  }, {
244
- default: () => e(u, null, [r.map((i) => {
258
+ default: () => e(o, null, [r.map((a) => {
245
259
  let d;
246
- return e(a, {
247
- key: i.key,
248
- title: i.label
249
- }, C(d = t.onRenderToolbarControl(i)) ? d : {
260
+ return e(i, {
261
+ key: a.key,
262
+ title: a.label
263
+ }, C(d = t.onRenderToolbarControl(a)) ? d : {
250
264
  default: () => [d]
251
265
  });
252
- }), e(a, {
266
+ }), e(i, {
253
267
  title: "X"
254
268
  }, {
255
- default: () => [e(o, {
269
+ default: () => [e(u, {
256
270
  value: t.currentElementData?.left,
257
- "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "left", i || 0)
271
+ "onUpdate:value": (a) => t.onUpdateElementProperty(t.currentElementData.id, "left", a || 0)
258
272
  }, null)]
259
- }), e(a, {
273
+ }), e(i, {
260
274
  title: "Y"
261
275
  }, {
262
- default: () => [e(o, {
276
+ default: () => [e(u, {
263
277
  value: t.currentElementData?.top,
264
- "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "top", i || 0)
278
+ "onUpdate:value": (a) => t.onUpdateElementProperty(t.currentElementData.id, "top", a || 0)
265
279
  }, null)]
266
- }), e(a, {
280
+ }), e(i, {
267
281
  title: "角度"
268
282
  }, {
269
- default: () => [e(o, {
283
+ default: () => [e(u, {
270
284
  value: t.currentElementData?.angle,
271
285
  min: -180,
272
286
  max: 180,
273
- "onUpdate:value": (i) => t.onUpdateElementProperty(t.currentElementData.id, "angle", i || 0)
287
+ "onUpdate:value": (a) => t.onUpdateElementProperty(t.currentElementData.id, "angle", a || 0)
274
288
  }, null)]
275
- }), e(a, {
289
+ }), e(i, {
276
290
  title: "对齐"
277
291
  }, {
278
292
  default: () => [e("div", {
@@ -302,7 +316,7 @@ const ge = /* @__PURE__ */ v({
302
316
  }, null),
303
317
  default: () => "居中"
304
318
  })])]
305
- }), e(a, {
319
+ }), e(i, {
306
320
  title: "层级"
307
321
  }, {
308
322
  default: () => [e("div", {
@@ -345,7 +359,7 @@ const ge = /* @__PURE__ */ v({
345
359
  default: () => "移到最后"
346
360
  })])]
347
361
  })]),
348
- footer: () => e(u, null, [e(l, {
362
+ footer: () => e(o, null, [e(l, {
349
363
  block: !0,
350
364
  onClick: t.onDeleteSelectedElements,
351
365
  type: "error"
@@ -360,32 +374,32 @@ const ge = /* @__PURE__ */ v({
360
374
  return e(m, {
361
375
  title: "画布设置"
362
376
  }, {
363
- default: () => e(u, null, [e(a, {
377
+ default: () => e(o, null, [e(i, {
364
378
  title: "宽度"
365
379
  }, {
366
- default: () => [e(o, {
380
+ default: () => [e(u, {
367
381
  value: t.canvasWidth,
368
382
  min: 100,
369
383
  max: 2e3,
370
384
  "onUpdate:value": (r) => t.onUpdateCanvasSize(r || 800, t.canvasHeight)
371
385
  }, null)]
372
- }), e(a, {
386
+ }), e(i, {
373
387
  title: "高度"
374
388
  }, {
375
- default: () => [e(o, {
389
+ default: () => [e(u, {
376
390
  value: t.canvasHeight,
377
391
  min: 100,
378
392
  max: 2e3,
379
393
  "onUpdate:value": (r) => t.onUpdateCanvasSize(t.canvasWidth, r || 600)
380
394
  }, null)]
381
- }), e(a, {
395
+ }), e(i, {
382
396
  title: "背景颜色"
383
397
  }, {
384
398
  default: () => [e(f, {
385
399
  value: t.canvasBackgroundColor,
386
400
  "onUpdate:value": (r) => t.onUpdateCanvasBackground(r)
387
401
  }, null)]
388
- }), e(a, {
402
+ }), e(i, {
389
403
  title: "背景图片"
390
404
  }, {
391
405
  default: () => [e(b, {
@@ -393,7 +407,7 @@ const ge = /* @__PURE__ */ v({
393
407
  onUpdateValue: (r) => t.onUpdateCanvasBackgroundImage(typeof r == "string" ? r : Array.isArray(r) && r[0] || "")
394
408
  }, null)]
395
409
  })]),
396
- footer: () => e(u, null, [e(l, {
410
+ footer: () => e(o, null, [e(l, {
397
411
  type: "primary",
398
412
  block: !0,
399
413
  onClick: t.onSaveData
@@ -418,5 +432,5 @@ const ge = /* @__PURE__ */ v({
418
432
  }
419
433
  });
420
434
  export {
421
- ge as RightPanel
435
+ Ie as RightPanel
422
436
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as T, ref as m, watch as F, onMounted as H, onUnmounted as R, createVNode as a } from "vue";
1
+ import { defineComponent as T, ref as d, watch as F, onMounted as H, onUnmounted as R, createVNode as a } from "vue";
2
2
  import { NSlider as V, NSwitch as W, NSelect as z, NColorPicker as A, NInputNumber as J, NInput as j } from "naive-ui";
3
3
  import { DuxCard as L } from "../card/card.js";
4
4
  import "clsx";
@@ -26,6 +26,20 @@ import "vue-draggable-plus";
26
26
  import "@vee-validate/i18n";
27
27
  import "colorizr";
28
28
  import "echarts";
29
+ import "highlight.js/lib/core";
30
+ import "highlight.js/lib/languages/bash";
31
+ import "highlight.js/lib/languages/css";
32
+ import "highlight.js/lib/languages/go";
33
+ import "highlight.js/lib/languages/java";
34
+ import "highlight.js/lib/languages/javascript";
35
+ import "highlight.js/lib/languages/json";
36
+ import "highlight.js/lib/languages/markdown";
37
+ import "highlight.js/lib/languages/php";
38
+ import "highlight.js/lib/languages/python";
39
+ import "highlight.js/lib/languages/shell";
40
+ import "highlight.js/lib/languages/sql";
41
+ import "highlight.js/lib/languages/typescript";
42
+ import "highlight.js/lib/languages/xml";
29
43
  import "@ant-design/colors";
30
44
  import "@unocss/preset-icons/browser";
31
45
  import "@unocss/preset-typography";
@@ -48,7 +62,7 @@ import "dayjs";
48
62
  import "@tanstack/vue-query";
49
63
  import "pinia";
50
64
  import { DuxImageUpload as Q } from "../upload/image.js";
51
- const Ge = /* @__PURE__ */ T({
65
+ const ra = /* @__PURE__ */ T({
52
66
  name: "DuxPosterEditor",
53
67
  props: {
54
68
  data: {
@@ -75,7 +89,7 @@ const Ge = /* @__PURE__ */ T({
75
89
  onSave: Function
76
90
  },
77
91
  setup(n) {
78
- const r = m(), l = m(), {
92
+ const r = d(), i = d(), {
79
93
  initCanvas: s,
80
94
  destroy: v,
81
95
  setCallbacks: c,
@@ -91,8 +105,8 @@ const Ge = /* @__PURE__ */ T({
91
105
  loadData: p,
92
106
  canvasData: o,
93
107
  selectedElements: S,
94
- canvasScale: d,
95
- currentElementData: i,
108
+ canvasScale: m,
109
+ currentElementData: l,
96
110
  currentElementConfig: U,
97
111
  hasMultipleSelection: w,
98
112
  updateCanvasSettings: y,
@@ -111,7 +125,7 @@ const Ge = /* @__PURE__ */ T({
111
125
  });
112
126
  const B = (e) => {
113
127
  const t = (P) => {
114
- i.value && u(i.value.id, e.key, P);
128
+ l.value && u(l.value.id, e.key, P);
115
129
  };
116
130
  switch (e.type) {
117
131
  case "text":
@@ -166,7 +180,7 @@ const Ge = /* @__PURE__ */ T({
166
180
  }, {
167
181
  immediate: !1
168
182
  }), H(() => {
169
- r.value && l.value && (s(r.value, l.value), p(n.data));
183
+ r.value && i.value && (s(r.value, i.value), p(n.data));
170
184
  }), R(() => {
171
185
  v();
172
186
  }), () => a(L, {
@@ -180,11 +194,11 @@ const Ge = /* @__PURE__ */ T({
180
194
  canvasWidth: o.value.width,
181
195
  canvasHeight: o.value.height
182
196
  }, null), a("div", {
183
- ref: l,
197
+ ref: i,
184
198
  class: "flex-1 p-6 pl-12 pt-12 flex items-center justify-center overflow-hidden relative",
185
199
  style: "background: linear-gradient(45deg, rgba(0,0,0, 0.1) 25%, transparent 25%), linear-gradient(-45deg, rgba(0,0,0, 0.1) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0,0,0, 0.1) 75%), linear-gradient(-45deg, transparent 75%, rgba(0,0,0, 0.1) 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px;"
186
200
  }, [a(G, {
187
- canvasScale: d.value,
201
+ canvasScale: m.value,
188
202
  canvasWidth: o.value.width,
189
203
  canvasHeight: o.value.height
190
204
  }, null), a("div", {
@@ -197,7 +211,7 @@ const Ge = /* @__PURE__ */ T({
197
211
  onClearCanvas: E,
198
212
  hasMultipleSelection: w.value,
199
213
  selectedElementsCount: S.value.length,
200
- currentElementData: i.value || void 0,
214
+ currentElementData: l.value || void 0,
201
215
  currentElementConfig: U.value || void 0,
202
216
  canMoveUp: C.value,
203
217
  canMoveDown: b.value,
@@ -218,11 +232,11 @@ const Ge = /* @__PURE__ */ T({
218
232
  },
219
233
  onExportJson: N,
220
234
  onRenderToolbarControl: B,
221
- canvasScale: d.value
235
+ canvasScale: m.value
222
236
  }, null)])]
223
237
  });
224
238
  }
225
239
  });
226
240
  export {
227
- Ge as DuxPosterEditor
241
+ ra as DuxPosterEditor
228
242
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as u, computed as f, toRef as d, createVNode as i, mergeProps as e } from "vue";
1
+ import { defineComponent as u, computed as f, toRef as d, createVNode as i, mergeProps as m } from "vue";
2
2
  import { useI18n as c } from "@duxweb/dvha-core";
3
3
  import { useWindowSize as b } from "@vueuse/core";
4
- import { NDataTable as m, NPagination as g } from "naive-ui";
4
+ import { NDataTable as e, NPagination as g } from "naive-ui";
5
5
  import "vue-router";
6
6
  import "@overlastic/vue";
7
7
  import "clsx";
@@ -25,6 +25,20 @@ import { DuxListEmpty as x } from "../status/listEmpty.js";
25
25
  import "@vee-validate/i18n";
26
26
  import "colorizr";
27
27
  import "echarts";
28
+ import "highlight.js/lib/core";
29
+ import "highlight.js/lib/languages/bash";
30
+ import "highlight.js/lib/languages/css";
31
+ import "highlight.js/lib/languages/go";
32
+ import "highlight.js/lib/languages/java";
33
+ import "highlight.js/lib/languages/javascript";
34
+ import "highlight.js/lib/languages/json";
35
+ import "highlight.js/lib/languages/markdown";
36
+ import "highlight.js/lib/languages/php";
37
+ import "highlight.js/lib/languages/python";
38
+ import "highlight.js/lib/languages/shell";
39
+ import "highlight.js/lib/languages/sql";
40
+ import "highlight.js/lib/languages/typescript";
41
+ import "highlight.js/lib/languages/xml";
28
42
  import "@ant-design/colors";
29
43
  import "@unocss/preset-icons/browser";
30
44
  import "@unocss/preset-typography";
@@ -45,7 +59,7 @@ import "dayjs";
45
59
  import "@tanstack/vue-query";
46
60
  import { useTable as y } from "../../hooks/table.js";
47
61
  import "pinia";
48
- const bt = /* @__PURE__ */ u({
62
+ const Lt = /* @__PURE__ */ u({
49
63
  name: "DuxTable",
50
64
  props: {
51
65
  path: {
@@ -63,7 +77,7 @@ const bt = /* @__PURE__ */ u({
63
77
  default: !0
64
78
  }
65
79
  },
66
- extends: m,
80
+ extends: e,
67
81
  setup(o) {
68
82
  const p = f(() => {
69
83
  const {
@@ -86,7 +100,7 @@ const bt = /* @__PURE__ */ u({
86
100
  } = c();
87
101
  return () => i("div", {
88
102
  class: "flex flex-col gap-2"
89
- }, [i(m, e(p.value, r.table.value, {
103
+ }, [i(e, m(p.value, r.table.value, {
90
104
  class: "flex-1 min-h-0",
91
105
  minHeight: 200,
92
106
  tableLayout: "fixed",
@@ -100,7 +114,7 @@ const bt = /* @__PURE__ */ u({
100
114
  }, null)
101
115
  }), o.pagination && i("div", {
102
116
  class: "flex justify-end"
103
- }, [i(g, e(r.tablePagination.value, {
117
+ }, [i(g, m(r.tablePagination.value, {
104
118
  simple: l.value < 768
105
119
  }), {
106
120
  prefix: () => i("div", null, [a("components.list.total", {
@@ -110,5 +124,5 @@ const bt = /* @__PURE__ */ u({
110
124
  }
111
125
  });
112
126
  export {
113
- bt as DuxTable
127
+ Lt as DuxTable
114
128
  };
@@ -26,6 +26,20 @@ import "vue-draggable-plus";
26
26
  import "@vee-validate/i18n";
27
27
  import "colorizr";
28
28
  import "echarts";
29
+ import "highlight.js/lib/core";
30
+ import "highlight.js/lib/languages/bash";
31
+ import "highlight.js/lib/languages/css";
32
+ import "highlight.js/lib/languages/go";
33
+ import "highlight.js/lib/languages/java";
34
+ import "highlight.js/lib/languages/javascript";
35
+ import "highlight.js/lib/languages/json";
36
+ import "highlight.js/lib/languages/markdown";
37
+ import "highlight.js/lib/languages/php";
38
+ import "highlight.js/lib/languages/python";
39
+ import "highlight.js/lib/languages/shell";
40
+ import "highlight.js/lib/languages/sql";
41
+ import "highlight.js/lib/languages/typescript";
42
+ import "highlight.js/lib/languages/xml";
29
43
  import "@ant-design/colors";
30
44
  import "@unocss/preset-icons/browser";
31
45
  import "@unocss/preset-typography";
@@ -80,7 +94,7 @@ const m = {
80
94
  empty: "flex items-center justify-center h-full text-muted",
81
95
  actions: "flex gap-2"
82
96
  }
83
- }, Ee = /* @__PURE__ */ M({
97
+ }, $e = /* @__PURE__ */ M({
84
98
  name: "DuxFileUpload",
85
99
  props: {
86
100
  path: {
@@ -241,7 +255,9 @@ const m = {
241
255
  key: "status",
242
256
  title: a("components.upload.file.status"),
243
257
  width: 120,
244
- render: (e) => e.status === "uploading" ? o(T, {
258
+ render: (e) => e.status === "uploading" ? o("div", {
259
+ class: "flex items-center"
260
+ }, [o(T, {
245
261
  type: "line",
246
262
  style: {
247
263
  width: "24px",
@@ -252,7 +268,7 @@ const m = {
252
268
  percentage: e.progress?.percent,
253
269
  showIndicator: !1,
254
270
  height: 14
255
- }, null) : V.value[e.status]
271
+ }, null)]) : V.value[e.status]
256
272
  }, {
257
273
  key: "actions",
258
274
  title: a("components.upload.actions"),
@@ -288,5 +304,5 @@ const m = {
288
304
  }
289
305
  });
290
306
  export {
291
- Ee as DuxFileUpload
307
+ $e as DuxFileUpload
292
308
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as S, computed as n, watch as p, ref as U, createVNode as a } from "vue";
1
+ import { defineComponent as S, computed as m, watch as p, ref as U, createVNode as a } from "vue";
2
2
  import { useI18n as k, useUpload as w } from "@duxweb/dvha-core";
3
3
  import { useVModel as I } from "@vueuse/core";
4
4
  import V from "clsx";
@@ -24,6 +24,20 @@ import "lodash-es";
24
24
  import "@vee-validate/i18n";
25
25
  import "colorizr";
26
26
  import "echarts";
27
+ import "highlight.js/lib/core";
28
+ import "highlight.js/lib/languages/bash";
29
+ import "highlight.js/lib/languages/css";
30
+ import "highlight.js/lib/languages/go";
31
+ import "highlight.js/lib/languages/java";
32
+ import "highlight.js/lib/languages/javascript";
33
+ import "highlight.js/lib/languages/json";
34
+ import "highlight.js/lib/languages/markdown";
35
+ import "highlight.js/lib/languages/php";
36
+ import "highlight.js/lib/languages/python";
37
+ import "highlight.js/lib/languages/shell";
38
+ import "highlight.js/lib/languages/sql";
39
+ import "highlight.js/lib/languages/typescript";
40
+ import "highlight.js/lib/languages/xml";
27
41
  import "@ant-design/colors";
28
42
  import "@unocss/preset-icons/browser";
29
43
  import "@unocss/preset-typography";
@@ -46,7 +60,7 @@ import "dayjs";
46
60
  import { useImagePreview as O } from "../../hooks/image.js";
47
61
  import "@tanstack/vue-query";
48
62
  import "pinia";
49
- const Ae = /* @__PURE__ */ S({
63
+ const Te = /* @__PURE__ */ S({
50
64
  name: "DuxImageUpload",
51
65
  props: {
52
66
  path: {
@@ -80,13 +94,13 @@ const Ae = /* @__PURE__ */ S({
80
94
  setup(t, {
81
95
  emit: g
82
96
  }) {
83
- const u = I(t, "value", g, {
97
+ const n = I(t, "value", g, {
84
98
  passive: !0,
85
99
  deep: !0,
86
100
  defaultValue: t.defaultValue
87
101
  }), v = j(), f = O(), {
88
- t: m
89
- } = k(), o = {
102
+ t: u
103
+ } = k(), l = {
90
104
  container: "flex gap-2",
91
105
  imageItem: "size-80px rounded border border-muted relative group draggable flex items-center",
92
106
  imageOverlay: "z-1 size-full inset-0 absolute flex items-center justify-center bg-default/80 transition-all opacity-0 group-hover:opacity-100 rounded",
@@ -94,7 +108,7 @@ const Ae = /* @__PURE__ */ S({
94
108
  uploadContent: "flex-1 flex flex-col justify-center items-center gap-1 relative",
95
109
  progressContainer: "size-80px flex items-center justify-center rounded",
96
110
  progressBar: "absolute left-2 right-2 bottom-2"
97
- }, h = n(() => t.maxSize), {
111
+ }, h = m(() => t.maxSize), {
98
112
  uploadPath: s,
99
113
  managePath: b,
100
114
  driver: x
@@ -112,23 +126,23 @@ const Ae = /* @__PURE__ */ S({
112
126
  autoUpload: !0,
113
127
  accept: "image/*",
114
128
  onError: (e) => {
115
- v.error(e.message || m("components.upload.error"));
129
+ v.error(e.message || u("components.upload.error"));
116
130
  },
117
131
  driver: x.value
118
132
  });
119
133
  p(r.dataFiles, (e) => {
120
- const l = t.multiple ? e?.map((i) => i.url) : e?.[0]?.url;
121
- u.value = l, t.onUpdateValue?.(l);
134
+ const o = t.multiple ? e?.map((i) => i.url) : e?.[0]?.url;
135
+ n.value = o, t.onUpdateValue?.(o);
122
136
  });
123
- const y = n(() => r.progress.value.totalPercent), z = n(() => r.isUploading.value), F = async () => {
137
+ const y = m(() => r.progress.value.totalPercent), z = m(() => r.isUploading.value), F = async () => {
124
138
  r.open();
125
- }, P = n(() => t.multiple ? t.maxNum && r.uploadFiles.value.length >= t.maxNum : !0), C = n(() => r.dataFiles.value?.map((e) => e.url)), N = M(), d = U(!1);
126
- return p(u, (e) => {
139
+ }, P = m(() => t.multiple ? t.maxNum && r.uploadFiles.value.length >= t.maxNum : !0), C = m(() => r.dataFiles.value?.map((e) => e.url)), N = M(), d = U(!1);
140
+ return p(n, (e) => {
127
141
  if (!e || !e?.length || d.value)
128
142
  return;
129
143
  d.value = !0;
130
- const l = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
131
- r.addDataFiles(l.map((i) => ({
144
+ const o = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
145
+ r.addDataFiles(o.map((i) => ({
132
146
  url: i
133
147
  })));
134
148
  }, {
@@ -136,14 +150,14 @@ const Ae = /* @__PURE__ */ S({
136
150
  }), () => a("div", null, [a(B, {
137
151
  modelValue: r.uploadFiles.value,
138
152
  "onUpdate:modelValue": (e) => r.uploadFiles.value = e,
139
- class: o.container,
153
+ class: l.container,
140
154
  draggable: ".draggable"
141
155
  }, {
142
- default: () => [r.uploadFiles.value?.map((e, l) => {
156
+ default: () => [r.uploadFiles.value?.map((e, o) => {
143
157
  const i = e.url || URL.createObjectURL(e.file);
144
158
  return a("div", {
145
- key: l,
146
- class: V(o.imageItem)
159
+ key: o,
160
+ class: V(l.imageItem)
147
161
  }, [a(A, {
148
162
  class: "z-0 rounded",
149
163
  objectFit: "scale-down",
@@ -152,7 +166,7 @@ const Ae = /* @__PURE__ */ S({
152
166
  previewDisabled: !0,
153
167
  src: i
154
168
  }, null), a("div", {
155
- class: o.imageOverlay
169
+ class: l.imageOverlay
156
170
  }, [e.status === "success" && a(c, {
157
171
  quaternary: !0,
158
172
  circle: !0,
@@ -160,7 +174,7 @@ const Ae = /* @__PURE__ */ S({
160
174
  renderIcon: () => a("div", {
161
175
  class: "n-icon i-tabler:eye"
162
176
  }, null),
163
- onClick: () => f.show(C.value, l)
177
+ onClick: () => f.show(C.value, o)
164
178
  }, null), a(c, {
165
179
  quaternary: !0,
166
180
  circle: !0,
@@ -173,7 +187,7 @@ const Ae = /* @__PURE__ */ S({
173
187
  }
174
188
  }, null)])]);
175
189
  }), (r.uploadFiles.value.length === 0 || !P.value) && a("div", {
176
- class: o.uploadArea,
190
+ class: l.uploadArea,
177
191
  onClick: () => {
178
192
  F();
179
193
  }
@@ -181,7 +195,7 @@ const Ae = /* @__PURE__ */ S({
181
195
  class: " py-1 text-xs bg-muted border-b border-dashed border-accented flex items-center justify-center",
182
196
  onClick: (e) => {
183
197
  e.stopPropagation(), N.show({
184
- title: m("components.upload.title"),
198
+ title: u("components.upload.title"),
185
199
  width: "800px",
186
200
  component: () => import("./manager.js"),
187
201
  componentProps: {
@@ -195,20 +209,20 @@ const Ae = /* @__PURE__ */ S({
195
209
  maxSize: t.maxSize
196
210
  }
197
211
  }
198
- }).then((l) => {
199
- r.addDataFiles(l);
212
+ }).then((o) => {
213
+ r.addDataFiles(o);
200
214
  });
201
215
  }
202
216
  }, [a("div", {
203
217
  class: "i-tabler:folder size-4"
204
218
  }, null)]), a("div", {
205
- class: o.uploadContent
219
+ class: l.uploadContent
206
220
  }, [z.value ? a("div", {
207
- class: o.progressContainer
221
+ class: l.progressContainer
208
222
  }, [a("div", {
209
223
  class: "i-tabler:photo size-6"
210
224
  }, null), a("div", {
211
- class: o.progressBar
225
+ class: l.progressBar
212
226
  }, [a(D, {
213
227
  type: "line",
214
228
  percentage: y.value,
@@ -221,5 +235,5 @@ const Ae = /* @__PURE__ */ S({
221
235
  }
222
236
  });
223
237
  export {
224
- Ae as DuxImageUpload
238
+ Te as DuxImageUpload
225
239
  };