@duxweb/dvha-pro 1.0.24 → 1.0.25

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 (120) 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/form/drawerForm.cjs +1 -1
  7. package/dist/cjs/components/form/modalForm.cjs +1 -1
  8. package/dist/cjs/components/form/pageForm.cjs +1 -1
  9. package/dist/cjs/components/form/settingForm.cjs +1 -1
  10. package/dist/cjs/components/icon/icon.cjs +1 -1
  11. package/dist/cjs/components/image/components/CanvasRuler.cjs +1 -0
  12. package/dist/cjs/components/image/elements/circle.cjs +1 -0
  13. package/dist/cjs/components/image/elements/image.cjs +1 -0
  14. package/dist/cjs/components/image/elements/index.cjs +1 -0
  15. package/dist/cjs/components/image/elements/rect.cjs +1 -0
  16. package/dist/cjs/components/image/elements/text.cjs +1 -0
  17. package/dist/cjs/components/image/hooks/usePosterEditor.cjs +1 -0
  18. package/dist/cjs/components/image/pages/LeftToolbar.cjs +1 -0
  19. package/dist/cjs/components/image/pages/Panel.cjs +1 -0
  20. package/dist/cjs/components/image/pages/PanelItem.cjs +1 -0
  21. package/dist/cjs/components/image/pages/RightPanel.cjs +1 -0
  22. package/dist/cjs/components/image/posterEditor.cjs +1 -0
  23. package/dist/cjs/components/layout/list.cjs +1 -1
  24. package/dist/cjs/components/layout/table.cjs +1 -1
  25. package/dist/cjs/components/level/level.cjs +1 -1
  26. package/dist/cjs/components/table/table.cjs +1 -1
  27. package/dist/cjs/components/upload/file.cjs +1 -1
  28. package/dist/cjs/components/upload/image.cjs +1 -1
  29. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  30. package/dist/cjs/components/upload/manager.cjs +1 -1
  31. package/dist/cjs/hooks/dialog.cjs +1 -1
  32. package/dist/cjs/hooks/drawer.cjs +1 -1
  33. package/dist/cjs/hooks/modal.cjs +1 -1
  34. package/dist/cjs/hooks/table/image.cjs +1 -1
  35. package/dist/cjs/hooks/table/media.cjs +1 -1
  36. package/dist/cjs/index.cjs +1 -1
  37. package/dist/cjs/pages/authLayout.cjs +1 -1
  38. package/dist/cjs/pages/layout/page.cjs +1 -1
  39. package/dist/cjs/pages/layout.cjs +1 -1
  40. package/dist/cjs/pages/login.cjs +1 -1
  41. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  42. package/dist/cjs/pages/menu/button.cjs +1 -1
  43. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  44. package/dist/cjs/pages/menu/main.cjs +1 -1
  45. package/dist/cjs/pages/menu/mobile.cjs +1 -1
  46. package/dist/cjs/pages/page404.cjs +1 -1
  47. package/dist/cjs/pages/pageStatus.cjs +1 -1
  48. package/dist/cjs/theme/uno.css.cjs +25 -1
  49. package/dist/esm/component.js +49 -47
  50. package/dist/esm/components/chart/echart.js +15 -13
  51. package/dist/esm/components/crop/imageCrop.js +15 -13
  52. package/dist/esm/components/data/dynamicSelect.js +15 -13
  53. package/dist/esm/components/data/selectModal.js +20 -18
  54. package/dist/esm/components/form/drawerForm.js +21 -19
  55. package/dist/esm/components/form/modalForm.js +15 -13
  56. package/dist/esm/components/form/pageForm.js +13 -11
  57. package/dist/esm/components/form/settingForm.js +12 -10
  58. package/dist/esm/components/icon/icon.js +15 -13
  59. package/dist/esm/components/image/components/CanvasRuler.js +113 -0
  60. package/dist/esm/components/image/elements/circle.js +127 -0
  61. package/dist/esm/components/image/elements/image.js +131 -0
  62. package/dist/esm/components/image/elements/index.js +46 -0
  63. package/dist/esm/components/image/elements/rect.js +171 -0
  64. package/dist/esm/components/image/elements/text.js +206 -0
  65. package/dist/esm/components/image/hooks/usePosterEditor.js +434 -0
  66. package/dist/esm/components/image/pages/LeftToolbar.js +40 -0
  67. package/dist/esm/components/image/pages/Panel.js +31 -0
  68. package/dist/esm/components/image/pages/PanelItem.js +22 -0
  69. package/dist/esm/components/image/pages/RightPanel.js +421 -0
  70. package/dist/esm/components/image/posterEditor.js +227 -0
  71. package/dist/esm/components/layout/list.js +16 -14
  72. package/dist/esm/components/layout/table.js +16 -14
  73. package/dist/esm/components/level/level.js +15 -13
  74. package/dist/esm/components/table/table.js +15 -13
  75. package/dist/esm/components/upload/file.js +98 -88
  76. package/dist/esm/components/upload/image.js +106 -94
  77. package/dist/esm/components/upload/manage/item.js +15 -13
  78. package/dist/esm/components/upload/manager.js +65 -63
  79. package/dist/esm/hooks/dialog.js +15 -13
  80. package/dist/esm/hooks/drawer.js +15 -13
  81. package/dist/esm/hooks/modal.js +15 -13
  82. package/dist/esm/hooks/table/image.js +15 -13
  83. package/dist/esm/hooks/table/media.js +15 -13
  84. package/dist/esm/index.js +213 -202
  85. package/dist/esm/pages/authLayout.js +15 -13
  86. package/dist/esm/pages/layout/page.js +15 -13
  87. package/dist/esm/pages/layout.js +7 -6
  88. package/dist/esm/pages/login.js +16 -15
  89. package/dist/esm/pages/menu/avatar.js +15 -13
  90. package/dist/esm/pages/menu/button.js +15 -13
  91. package/dist/esm/pages/menu/cmd.js +26 -24
  92. package/dist/esm/pages/menu/main.js +25 -23
  93. package/dist/esm/pages/menu/mobile.js +15 -13
  94. package/dist/esm/pages/page404.js +13 -11
  95. package/dist/esm/pages/pageStatus.js +15 -13
  96. package/dist/esm/theme/uno.css.js +25 -1
  97. package/dist/types/components/image/components/CanvasRuler.d.ts +43 -0
  98. package/dist/types/components/image/components/index.d.ts +1 -0
  99. package/dist/types/components/image/elements/circle.d.ts +3 -0
  100. package/dist/types/components/image/elements/image.d.ts +3 -0
  101. package/dist/types/components/image/elements/index.d.ts +15 -0
  102. package/dist/types/components/image/elements/rect.d.ts +3 -0
  103. package/dist/types/components/image/elements/text.d.ts +3 -0
  104. package/dist/types/components/image/elements/types.d.ts +51 -0
  105. package/dist/types/components/image/hooks/index.d.ts +1 -0
  106. package/dist/types/components/image/hooks/usePosterEditor.d.ts +48 -0
  107. package/dist/types/components/image/index.d.ts +4 -0
  108. package/dist/types/components/image/pages/LeftToolbar.d.ts +33 -0
  109. package/dist/types/components/image/pages/Panel.d.ts +11 -0
  110. package/dist/types/components/image/pages/PanelItem.d.ts +11 -0
  111. package/dist/types/components/image/pages/RightPanel.d.ts +208 -0
  112. package/dist/types/components/image/pages/index.d.ts +4 -0
  113. package/dist/types/components/image/posterEditor.d.ts +61 -0
  114. package/dist/types/components/image/types/editor.d.ts +47 -0
  115. package/dist/types/components/index.d.ts +2 -2
  116. package/dist/types/components/stats/number.d.ts +1 -1
  117. package/dist/types/components/upload/file.d.ts +5 -3
  118. package/dist/types/index.d.ts +1 -0
  119. package/dist/types/pages/layout/global.d.ts +0 -1
  120. package/package.json +6 -3
@@ -1,12 +1,23 @@
1
- import { defineComponent as F, computed as i, watch as N, createVNode as t } from "vue";
2
- import { useI18n as S, useUpload as U } from "@duxweb/dvha-core";
3
- import { useVModel as k } from "@vueuse/core";
4
- import w from "clsx";
5
- import { useMessage as I, NImage as V, NButton as s, NProgress as j } from "naive-ui";
1
+ import { defineComponent as S, computed as n, watch as c, ref as U, createVNode as a } from "vue";
2
+ import { useI18n as k, useUpload as w } from "@duxweb/dvha-core";
3
+ import { useVModel as I } from "@vueuse/core";
4
+ import V from "clsx";
5
+ import { useMessage as j, NImage as A, NButton as p, NProgress as D } from "naive-ui";
6
6
  import { VueDraggable as B } from "vue-draggable-plus";
7
7
  import "vue-router";
8
8
  import "@overlastic/vue";
9
9
  import "vue-echarts";
10
+ import "vue3-ace-editor";
11
+ import "ace-builds/src-noconflict/mode-vue";
12
+ import "ace-builds/src-noconflict/mode-javascript";
13
+ import "ace-builds/src-noconflict/mode-html";
14
+ import "ace-builds/src-noconflict/mode-json";
15
+ import "ace-builds/src-noconflict/mode-json5";
16
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
17
+ import "ace-builds/src-noconflict/theme-tomorrow";
18
+ import "ace-builds/src-noconflict/ext-searchbox";
19
+ import "ace-builds/src-noconflict/ext-language_tools";
20
+ import "ace-builds/src-noconflict/mode-snippets";
10
21
  import "vue-cropper";
11
22
  import "jinrishici";
12
23
  import "lodash-es";
@@ -25,25 +36,16 @@ import "vue-command-palette";
25
36
  import "@duxweb/dvha-naiveui";
26
37
  import "../../pages/page404.js";
27
38
  import "@iconify-json/tabler/icons.json";
39
+ import "../image/elements/index.js";
40
+ import "fabric";
28
41
  import "mime";
29
- import { useUploadConfig as D } from "./config.js";
30
- import "vue3-ace-editor";
31
- import "ace-builds/src-noconflict/mode-vue";
32
- import "ace-builds/src-noconflict/mode-javascript";
33
- import "ace-builds/src-noconflict/mode-html";
34
- import "ace-builds/src-noconflict/mode-json";
35
- import "ace-builds/src-noconflict/mode-json5";
36
- import "ace-builds/src-noconflict/theme-tomorrow_night";
37
- import "ace-builds/src-noconflict/theme-tomorrow";
38
- import "ace-builds/src-noconflict/ext-searchbox";
39
- import "ace-builds/src-noconflict/ext-language_tools";
40
- import "ace-builds/src-noconflict/mode-snippets";
41
- import { useModal as A } from "../../hooks/modal.js";
42
+ import { useUploadConfig as M } from "./config.js";
43
+ import { useModal as L } from "../../hooks/modal.js";
42
44
  import "dayjs";
43
- import { useImagePreview as M } from "../../hooks/image.js";
45
+ import { useImagePreview as O } from "../../hooks/image.js";
44
46
  import "@tanstack/vue-query";
45
47
  import "pinia";
46
- const ke = /* @__PURE__ */ F({
48
+ const je = /* @__PURE__ */ S({
47
49
  name: "DuxImageUpload",
48
50
  props: {
49
51
  path: {
@@ -74,16 +76,16 @@ const ke = /* @__PURE__ */ F({
74
76
  defaultValue: [String, Array],
75
77
  onUpdateValue: Function
76
78
  },
77
- setup(e, {
78
- emit: d
79
+ setup(t, {
80
+ emit: g
79
81
  }) {
80
- const c = k(e, "value", d, {
82
+ const u = I(t, "value", g, {
81
83
  passive: !0,
82
84
  deep: !0,
83
- defaultValue: e.defaultValue
84
- }), p = I(), g = M(), {
85
- t: u
86
- } = S(), l = {
85
+ defaultValue: t.defaultValue
86
+ }), v = j(), f = O(), {
87
+ t: m
88
+ } = k(), o = {
87
89
  container: "flex gap-2",
88
90
  imageItem: "size-80px rounded border border-muted relative group draggable flex items-center",
89
91
  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",
@@ -91,122 +93,132 @@ const ke = /* @__PURE__ */ F({
91
93
  uploadContent: "flex-1 flex flex-col justify-center items-center gap-1 relative",
92
94
  progressContainer: "size-80px flex items-center justify-center rounded",
93
95
  progressBar: "absolute left-2 right-2 bottom-2"
94
- }, v = i(() => e.maxSize), {
95
- uploadPath: m,
96
- managePath: h,
97
- driver: f
98
- } = D({
99
- driver: e?.driver,
100
- signPath: e?.signPath,
101
- signCallback: e?.signCallback,
102
- uploadPath: e?.path,
103
- managePath: e?.managePath
104
- }), r = U({
105
- path: m.value,
106
- multiple: e.multiple,
107
- maxFileCount: e.maxNum,
108
- maxFileSize: v.value * 1024 * 1024,
96
+ }, h = n(() => t.maxSize), {
97
+ uploadPath: s,
98
+ managePath: b,
99
+ driver: x
100
+ } = M({
101
+ driver: t?.driver,
102
+ signPath: t?.signPath,
103
+ signCallback: t?.signCallback,
104
+ uploadPath: t?.path,
105
+ managePath: t?.managePath
106
+ }), r = w({
107
+ path: s.value,
108
+ multiple: t.multiple,
109
+ maxFileCount: t.maxNum,
110
+ maxFileSize: h.value * 1024 * 1024,
109
111
  autoUpload: !0,
110
112
  accept: "image/*",
111
- onError: (a) => {
112
- p.error(a.message || u("components.upload.error"));
113
+ onError: (e) => {
114
+ v.error(e.message || m("components.upload.error"));
113
115
  },
114
- driver: f.value
116
+ driver: x.value
115
117
  });
116
- N(r.dataFiles, (a) => {
117
- const o = e.multiple ? a?.map((n) => n.url) : a?.[0]?.url;
118
- c.value = o, e.onUpdateValue?.(o);
118
+ c(r.dataFiles, (e) => {
119
+ const l = t.multiple ? e?.map((i) => i.url) : e?.[0]?.url;
120
+ u.value = l, t.onUpdateValue?.(l);
119
121
  });
120
- const b = i(() => r.progress.value.totalPercent), x = i(() => r.isUploading.value), y = async () => {
122
+ const y = n(() => r.progress.value.totalPercent), z = n(() => r.isUploading.value), F = async () => {
121
123
  r.open();
122
- }, z = i(() => e.multiple ? e.maxNum && r.uploadFiles.value.length >= e.maxNum : !0), P = i(() => r.dataFiles.value?.map((a) => a.url)), C = A();
123
- return () => t("div", null, [t(B, {
124
+ }, P = n(() => t.multiple ? t.maxNum && r.uploadFiles.value.length >= t.maxNum : !0), C = n(() => r.dataFiles.value?.map((e) => e.url)), N = L(), d = U(!1);
125
+ return c(u, (e) => {
126
+ if (!e || !e?.length || d.value)
127
+ return;
128
+ d.value = !0;
129
+ const l = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
130
+ r.addDataFiles(l.map((i) => ({
131
+ url: i
132
+ })));
133
+ }, {
134
+ immediate: !0
135
+ }), () => a("div", null, [a(B, {
124
136
  modelValue: r.uploadFiles.value,
125
- "onUpdate:modelValue": (a) => r.uploadFiles.value = a,
126
- class: l.container,
137
+ "onUpdate:modelValue": (e) => r.uploadFiles.value = e,
138
+ class: o.container,
127
139
  draggable: ".draggable"
128
140
  }, {
129
- default: () => [r.uploadFiles.value?.map((a, o) => {
130
- const n = a.url || URL.createObjectURL(a.file);
131
- return t("div", {
132
- key: o,
133
- class: w(l.imageItem)
134
- }, [t(V, {
141
+ default: () => [r.uploadFiles.value?.map((e, l) => {
142
+ const i = e.url || URL.createObjectURL(e.file);
143
+ return a("div", {
144
+ key: l,
145
+ class: V(o.imageItem)
146
+ }, [a(A, {
135
147
  class: "z-0 rounded",
136
148
  objectFit: "scale-down",
137
149
  width: 78,
138
150
  height: 78,
139
151
  previewDisabled: !0,
140
- src: n
141
- }, null), t("div", {
142
- class: l.imageOverlay
143
- }, [a.status === "success" && t(s, {
152
+ src: i
153
+ }, null), a("div", {
154
+ class: o.imageOverlay
155
+ }, [e.status === "success" && a(p, {
144
156
  quaternary: !0,
145
157
  circle: !0,
146
158
  size: "small",
147
- renderIcon: () => t("div", {
159
+ renderIcon: () => a("div", {
148
160
  class: "n-icon i-tabler:eye"
149
161
  }, null),
150
- onClick: () => g.show(P.value, o)
151
- }, null), t(s, {
162
+ onClick: () => f.show(C.value, l)
163
+ }, null), a(p, {
152
164
  quaternary: !0,
153
165
  circle: !0,
154
166
  size: "small",
155
- renderIcon: () => t("div", {
167
+ renderIcon: () => a("div", {
156
168
  class: "n-icon i-tabler:trash"
157
169
  }, null),
158
170
  onClick: () => {
159
- r.removeFiles([a.id]);
171
+ r.removeFiles([e.id]);
160
172
  }
161
173
  }, null)])]);
162
- }), (r.uploadFiles.value.length === 0 || !z.value) && t("div", {
163
- class: l.uploadArea,
174
+ }), (r.uploadFiles.value.length === 0 || !P.value) && a("div", {
175
+ class: o.uploadArea,
164
176
  onClick: () => {
165
- y();
177
+ F();
166
178
  }
167
- }, [e.manager && t("div", {
179
+ }, [t.manager && a("div", {
168
180
  class: " py-1 text-xs bg-muted border-b border-dashed border-accented flex items-center justify-center",
169
- onClick: (a) => {
170
- a.stopPropagation(), C.show({
171
- title: u("components.upload.title"),
181
+ onClick: (e) => {
182
+ e.stopPropagation(), N.show({
183
+ title: m("components.upload.title"),
172
184
  width: "800px",
173
185
  component: () => import("./manager.js"),
174
186
  componentProps: {
175
- path: h.value,
187
+ path: b.value,
176
188
  type: "image",
177
- multiple: e.multiple,
189
+ multiple: t.multiple,
178
190
  uploadParams: {
179
- path: m.value,
191
+ path: s.value,
180
192
  accept: "image/*",
181
- maxNum: e.maxNum,
182
- maxSize: e.maxSize
193
+ maxNum: t.maxNum,
194
+ maxSize: t.maxSize
183
195
  }
184
196
  }
185
- }).then((o) => {
186
- r.addDataFiles(o);
197
+ }).then((l) => {
198
+ r.addDataFiles(l);
187
199
  });
188
200
  }
189
- }, [t("div", {
201
+ }, [a("div", {
190
202
  class: "i-tabler:folder size-4"
191
- }, null)]), t("div", {
192
- class: l.uploadContent
193
- }, [x.value ? t("div", {
194
- class: l.progressContainer
195
- }, [t("div", {
203
+ }, null)]), a("div", {
204
+ class: o.uploadContent
205
+ }, [z.value ? a("div", {
206
+ class: o.progressContainer
207
+ }, [a("div", {
196
208
  class: "i-tabler:photo size-6"
197
- }, null), t("div", {
198
- class: l.progressBar
199
- }, [t(j, {
209
+ }, null), a("div", {
210
+ class: o.progressBar
211
+ }, [a(D, {
200
212
  type: "line",
201
- percentage: b.value,
213
+ percentage: y.value,
202
214
  showIndicator: !1,
203
215
  height: 4
204
- }, null)])]) : t("div", {
216
+ }, null)])]) : a("div", {
205
217
  class: "i-tabler:plus size-4"
206
218
  }, null)])])]
207
219
  })]);
208
220
  }
209
221
  });
210
222
  export {
211
- ke as DuxImageUpload
223
+ je as DuxImageUpload
212
224
  };
@@ -7,6 +7,17 @@ import { useDialog as d } from "../../../hooks/dialog.js";
7
7
  import "@overlastic/vue";
8
8
  import "vue-echarts";
9
9
  import "@vueuse/core";
10
+ import "vue3-ace-editor";
11
+ import "ace-builds/src-noconflict/mode-vue";
12
+ import "ace-builds/src-noconflict/mode-javascript";
13
+ import "ace-builds/src-noconflict/mode-html";
14
+ import "ace-builds/src-noconflict/mode-json";
15
+ import "ace-builds/src-noconflict/mode-json5";
16
+ import "ace-builds/src-noconflict/theme-tomorrow_night";
17
+ import "ace-builds/src-noconflict/theme-tomorrow";
18
+ import "ace-builds/src-noconflict/ext-searchbox";
19
+ import "ace-builds/src-noconflict/ext-language_tools";
20
+ import "ace-builds/src-noconflict/mode-snippets";
10
21
  import "vue-cropper";
11
22
  import "jinrishici";
12
23
  import "lodash-es";
@@ -26,6 +37,8 @@ import "vue-command-palette";
26
37
  import "@duxweb/dvha-naiveui";
27
38
  import "../../../pages/page404.js";
28
39
  import "@iconify-json/tabler/icons.json";
40
+ import "../../image/elements/index.js";
41
+ import "fabric";
29
42
  import "mime";
30
43
  import f from "../../../static/images/icon/audio.svg.js";
31
44
  import g from "../../../static/images/icon/excel.svg.js";
@@ -35,21 +48,10 @@ import h from "../../../static/images/icon/pdf.svg.js";
35
48
  import x from "../../../static/images/icon/ppt.svg.js";
36
49
  import k from "../../../static/images/icon/video.svg.js";
37
50
  import w from "../../../static/images/icon/word.svg.js";
38
- import "vue3-ace-editor";
39
- import "ace-builds/src-noconflict/mode-vue";
40
- import "ace-builds/src-noconflict/mode-javascript";
41
- import "ace-builds/src-noconflict/mode-html";
42
- import "ace-builds/src-noconflict/mode-json";
43
- import "ace-builds/src-noconflict/mode-json5";
44
- import "ace-builds/src-noconflict/theme-tomorrow_night";
45
- import "ace-builds/src-noconflict/theme-tomorrow";
46
- import "ace-builds/src-noconflict/ext-searchbox";
47
- import "ace-builds/src-noconflict/ext-language_tools";
48
- import "ace-builds/src-noconflict/mode-snippets";
49
51
  import "dayjs";
50
52
  import "@tanstack/vue-query";
51
53
  import "pinia";
52
- const xe = /* @__PURE__ */ c({
54
+ const we = /* @__PURE__ */ c({
53
55
  name: "DuxFileManageItem",
54
56
  props: {
55
57
  name: String,
@@ -184,5 +186,5 @@ const xe = /* @__PURE__ */ c({
184
186
  }
185
187
  });
186
188
  export {
187
- xe as DuxFileManageItem
189
+ we as DuxFileManageItem
188
190
  };