@mcistudio/unoui-vue 1.0.0 → 1.1.1

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 (31) hide show
  1. package/README.md +15 -1
  2. package/dist/button/index.js +1 -1
  3. package/dist/chunks/ImageEditor-DOGIATeD.js +311 -0
  4. package/dist/chunks/ImageEditor-DOGIATeD.js.map +1 -0
  5. package/dist/chunks/{Table-DhXmuKQd.js → Table-SDKDGSur.js} +2 -2
  6. package/dist/chunks/{Table-DhXmuKQd.js.map → Table-SDKDGSur.js.map} +1 -1
  7. package/dist/chunks/{button-pDObrN_X.js → button-BDScl2qA.js} +3 -3
  8. package/dist/chunks/{button-pDObrN_X.js.map → button-BDScl2qA.js.map} +1 -1
  9. package/dist/chunks/{datepicker-Cy808x7X.js → datepicker-wXIjngpq.js} +2 -2
  10. package/dist/chunks/{datepicker-Cy808x7X.js.map → datepicker-wXIjngpq.js.map} +1 -1
  11. package/dist/chunks/{input-BDOXVCrK.js → input-DhZ8Wu1m.js} +2 -2
  12. package/dist/chunks/{input-BDOXVCrK.js.map → input-DhZ8Wu1m.js.map} +1 -1
  13. package/dist/chunks/{pagination-Bc583AQX.js → pagination-cndgtghb.js} +3 -3
  14. package/dist/chunks/{pagination-Bc583AQX.js.map → pagination-cndgtghb.js.map} +1 -1
  15. package/dist/chunks/{popconfirm-D6lUfSxG.js → popconfirm-Bp2mluJ5.js} +2 -2
  16. package/dist/chunks/{popconfirm-D6lUfSxG.js.map → popconfirm-Bp2mluJ5.js.map} +1 -1
  17. package/dist/chunks/{timepicker-DsGIdcf8.js → timepicker-DFxwJePF.js} +2 -2
  18. package/dist/chunks/{timepicker-DsGIdcf8.js.map → timepicker-DFxwJePF.js.map} +1 -1
  19. package/dist/datepicker/index.js +1 -1
  20. package/dist/imageeditor/ImageEditor.vue.d.ts +60 -0
  21. package/dist/imageeditor/index.d.ts +25 -0
  22. package/dist/imageeditor/index.js +2 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +21 -20
  25. package/dist/input/index.js +1 -1
  26. package/dist/pagination/index.js +1 -1
  27. package/dist/popconfirm/index.js +1 -1
  28. package/dist/style.css +1 -1
  29. package/dist/table/index.js +1 -1
  30. package/dist/timepicker/index.js +1 -1
  31. package/package.json +2 -1
package/README.md CHANGED
@@ -53,15 +53,28 @@ createApp(App).mount('#app')
53
53
  Enable the UnoUI preset and scan the compiled package entries in `uno.config.ts`:
54
54
 
55
55
  ```ts
56
+ import { readFileSync, readdirSync } from 'node:fs'
57
+ import { createRequire } from 'node:module'
58
+ import { dirname, resolve } from 'node:path'
59
+
56
60
  import { defineConfig, transformerDirectives, transformerVariantGroup } from 'unocss'
57
61
  import { presetUnoUI } from '@mcistudio/unoui-vue/uno'
58
62
 
63
+ const require = createRequire(import.meta.url)
64
+ const unoUIPackageDirectory = dirname(require.resolve('@mcistudio/unoui-vue/package.json'))
65
+ const unoUIDistDirectory = resolve(unoUIPackageDirectory, 'dist')
66
+ const unoUIContent = readdirSync(unoUIDistDirectory, { encoding: 'utf8', recursive: true })
67
+ .filter((file) => file.endsWith('.js'))
68
+ .map((file) => readFileSync(resolve(unoUIDistDirectory, file), 'utf8'))
69
+ .join('\n')
70
+
59
71
  export default defineConfig({
60
72
  presets: [presetUnoUI()],
61
73
  transformers: [transformerDirectives(), transformerVariantGroup()],
62
74
  content: {
75
+ inline: [unoUIContent],
63
76
  pipeline: {
64
- include: ['src/**/*.{vue,js,ts}', 'node_modules/@mcistudio/unoui-vue/dist/**/*.js']
77
+ include: ['src/**/*.{vue,js,ts}']
65
78
  }
66
79
  }
67
80
  })
@@ -88,6 +101,7 @@ Set `data-theme="dark"` on the document root to enable the dark theme. The light
88
101
  | Form | `Form`, `FormItem`, `Input`, `Autocomplete`, `InputTag`, `InputI18n`, `InputOtp` |
89
102
  | Selection | `Checkbox`, `CheckboxGroup`, `Radio`, `RadioGroup`, `Switch`, `Select` |
90
103
  | Date and numeric | `DatePicker`, `RangePicker`, `TimePicker`, `TimeRangePicker`, `Slider`, `ColorPicker`, `Rate` |
104
+ | Media | `ImageEditor` |
91
105
  | Data display | `Table`, `Pagination`, `Progress`, `Skeleton`, `QRCode`, `MillerColumns` |
92
106
  | Feedback and overlays | `Alert`, `message`, `Modal`, `Drawer`, `Tooltip`, `Popconfirm`, `Dropdown` |
93
107
  | Navigation | `Tabs`, `TabPane` |
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../chunks/button-pDObrN_X.js";
1
+ import { n as e, r as t, t as n } from "../chunks/button-BDScl2qA.js";
2
2
  export { t as Button, e as ButtonGroup, n as button };
@@ -0,0 +1,311 @@
1
+ import { r as e } from "./button-BDScl2qA.js";
2
+ import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
+ import { r as n } from "./tooltip-DMhiAqto.js";
4
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as ee, openBlock as p, ref as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
5
+ import te from "cropperjs";
6
+ //#region src/imageeditor/ImageEditor.vue?vue&type=script&setup=true&lang.ts
7
+ var y = ["aria-busy"], b = ["src", "alt"], x = {
8
+ key: 0,
9
+ class: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-zinc-950/75 text-zinc-200"
10
+ }, S = {
11
+ key: 1,
12
+ "data-ui-image-editor-error": "true",
13
+ class: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 bg-zinc-950 px-4 text-center text-zinc-200"
14
+ }, C = { class: "text-sm" }, w = {
15
+ key: 0,
16
+ "data-ui-image-editor-toolbar": "true",
17
+ class: "flex min-h-12 flex-wrap items-center gap-2 border-t border-medium bg-primary px-3 py-2"
18
+ }, T = {
19
+ class: "flex items-center gap-1",
20
+ role: "group",
21
+ "aria-label": "图片缩放"
22
+ }, ne = {
23
+ class: "flex items-center gap-1",
24
+ role: "group",
25
+ "aria-label": "图片旋转"
26
+ }, E = { class: "ml-auto flex min-w-0 items-center gap-3" }, D = {
27
+ key: 0,
28
+ class: "hidden whitespace-nowrap font-mono text-xs text-tertiary sm:inline"
29
+ }, O = /*#__PURE__*/ t(/* @__PURE__ */ l({
30
+ __name: "ImageEditor",
31
+ props: {
32
+ src: {},
33
+ alt: { default: "" },
34
+ aspectRatio: { default: void 0 },
35
+ minWidth: { default: 0 },
36
+ minHeight: { default: 0 },
37
+ height: { default: 420 },
38
+ zoomStep: { default: .1 },
39
+ outputType: { default: "image/png" },
40
+ outputQuality: { default: .92 },
41
+ disabled: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ showToolbar: {
46
+ type: Boolean,
47
+ default: !0
48
+ }
49
+ },
50
+ emits: [
51
+ "ready",
52
+ "change",
53
+ "crop",
54
+ "error"
55
+ ],
56
+ setup(t, { expose: l, emit: O }) {
57
+ let k = t, A = O, j = m(null), M = m(!0), N = m(!1), P = m(""), F = m(), I, L = !1, R = !1, z = r(() => ({ height: typeof k.height == "number" ? `${Math.max(240, k.height)}px` : k.height })), B = r(() => k.disabled || M.value || N.value || !!P.value), V = r(() => Number.isFinite(k.aspectRatio) && Number(k.aspectRatio) > 0 ? Number(k.aspectRatio) : NaN);
58
+ function H(e) {
59
+ return {
60
+ x: e.x,
61
+ y: e.y,
62
+ width: e.width,
63
+ height: e.height,
64
+ rotate: e.rotate,
65
+ scaleX: e.scaleX,
66
+ scaleY: e.scaleY
67
+ };
68
+ }
69
+ function U() {
70
+ let e = Math.max(0, Number.isFinite(k.minWidth) ? k.minWidth : 0), t = Math.max(0, Number.isFinite(k.minHeight) ? k.minHeight : 0), n = V.value;
71
+ return Number.isFinite(n) && (e = Math.max(e, t * n), t = e / n), {
72
+ width: e,
73
+ height: t
74
+ };
75
+ }
76
+ function W() {
77
+ if (!I || R) return;
78
+ let e = I.getData(), t = U();
79
+ if (e.width + .5 >= t.width && e.height + .5 >= t.height) return;
80
+ let n = Math.max(e.width, t.width), r = Math.max(e.height, t.height);
81
+ R = !0, I.setData({
82
+ x: e.x - (n - e.width) / 2,
83
+ y: e.y - (r - e.height) / 2,
84
+ width: n,
85
+ height: r
86
+ }), R = !1;
87
+ }
88
+ function G(e = !0) {
89
+ if (!I) return;
90
+ W();
91
+ let t = H(I.getData());
92
+ return F.value = t, e && A("change", t), t;
93
+ }
94
+ function K(e, t, n = !1) {
95
+ let r = e instanceof Error ? e : Error(t);
96
+ return n && (P.value = r.message || t, M.value = !1), N.value = !1, A("error", r), r;
97
+ }
98
+ function q() {
99
+ I?.destroy(), I = void 0, F.value = void 0;
100
+ }
101
+ function J() {
102
+ if (!(!L || !j.value)) {
103
+ if (q(), P.value = "", M.value = !0, !k.src.trim()) {
104
+ K(/* @__PURE__ */ Error("图片地址不能为空"), "图片地址不能为空", !0);
105
+ return;
106
+ }
107
+ I = new te(j.value, {
108
+ aspectRatio: V.value,
109
+ autoCropArea: .86,
110
+ background: !1,
111
+ center: !0,
112
+ dragMode: "move",
113
+ guides: !0,
114
+ highlight: !1,
115
+ modal: !0,
116
+ responsive: !0,
117
+ restore: !1,
118
+ rotatable: !0,
119
+ toggleDragModeOnDblclick: !1,
120
+ viewMode: 1,
121
+ wheelZoomRatio: Math.max(.01, Math.abs(k.zoomStep)),
122
+ zoomOnTouch: !0,
123
+ zoomOnWheel: !0,
124
+ zoomable: !0,
125
+ ready: () => {
126
+ if (!I) return;
127
+ M.value = !1, k.disabled && I.disable();
128
+ let e = G(!1);
129
+ e && A("ready", e);
130
+ },
131
+ crop: () => {
132
+ !I || M.value || G();
133
+ },
134
+ cropend: () => W()
135
+ });
136
+ }
137
+ }
138
+ function Y() {
139
+ q(), K(/* @__PURE__ */ Error("图片加载失败,请检查图片地址或跨域配置"), "图片加载失败", !0);
140
+ }
141
+ function X(e = k.zoomStep) {
142
+ B.value || !Number.isFinite(e) || e === 0 || I?.zoom(e);
143
+ }
144
+ function Z(e) {
145
+ B.value || !Number.isFinite(e) || e === 0 || (I?.rotate(e), W());
146
+ }
147
+ function Q() {
148
+ B.value || (I?.reset(), I?.setAspectRatio(V.value), G());
149
+ }
150
+ function re(e = !1) {
151
+ if (I) return W(), H(I.getData(e));
152
+ }
153
+ function ie(e) {
154
+ return new Promise((t, n) => {
155
+ e.toBlob((e) => {
156
+ e ? t(e) : n(/* @__PURE__ */ Error("无法生成裁剪图片"));
157
+ }, k.outputType, Math.min(1, Math.max(0, k.outputQuality)));
158
+ });
159
+ }
160
+ async function $() {
161
+ if (!I || M.value || P.value) throw Error("图片编辑器尚未就绪");
162
+ try {
163
+ N.value = !0;
164
+ let e = U();
165
+ W();
166
+ let t = I.getCroppedCanvas({
167
+ minWidth: Math.ceil(e.width),
168
+ minHeight: Math.ceil(e.height),
169
+ fillColor: k.outputType === "image/jpeg" ? "#ffffff" : void 0,
170
+ imageSmoothingEnabled: !0,
171
+ imageSmoothingQuality: "high"
172
+ });
173
+ if (!t) throw Error("无法创建裁剪画布");
174
+ let n = Math.min(1, Math.max(0, k.outputQuality)), [r, i] = await Promise.all([ie(t), Promise.resolve(t.toDataURL(k.outputType, n))]), a = {
175
+ blob: r,
176
+ dataUrl: i,
177
+ width: t.width,
178
+ height: t.height,
179
+ data: H(I.getData())
180
+ };
181
+ return A("crop", a), a;
182
+ } catch (e) {
183
+ throw K(e, "图片裁剪失败");
184
+ } finally {
185
+ N.value = !1;
186
+ }
187
+ }
188
+ async function ae() {
189
+ try {
190
+ await $();
191
+ } catch {}
192
+ }
193
+ return _(() => k.src, async () => {
194
+ await u(), J();
195
+ }), _(V, (e) => {
196
+ I?.setAspectRatio(e), G();
197
+ }), _(() => [k.minWidth, k.minHeight], () => G()), _(() => k.disabled, (e) => {
198
+ I && (e ? I.disable() : I.enable());
199
+ }), ee(() => {
200
+ L = !0, J();
201
+ }), f(() => {
202
+ L = !1, q();
203
+ }), l({
204
+ zoom: X,
205
+ rotate: Z,
206
+ reset: Q,
207
+ crop: $,
208
+ getData: re
209
+ }), (r, l) => (p(), a("div", {
210
+ "data-ui-image-editor": "true",
211
+ class: "min-w-0 overflow-hidden rounded-lg border border-medium bg-primary",
212
+ "aria-busy": M.value
213
+ }, [o("div", {
214
+ class: "relative overflow-hidden bg-zinc-950",
215
+ style: d(z.value)
216
+ }, [
217
+ o("img", {
218
+ ref_key: "imageRef",
219
+ ref: j,
220
+ "data-ui-image-editor-image": "true",
221
+ class: "block size-full max-w-full object-contain",
222
+ src: t.src,
223
+ alt: t.alt,
224
+ onError: Y
225
+ }, null, 40, b),
226
+ M.value && !P.value ? (p(), a("div", x, [...l[4] ||= [o("span", {
227
+ class: "i-lucide:loader-circle size-5 animate-spin",
228
+ "aria-hidden": "true"
229
+ }, null, -1), o("span", { class: "sr-only" }, "图片加载中", -1)]])) : i("", !0),
230
+ P.value ? (p(), a("div", S, [l[5] ||= o("span", {
231
+ class: "i-lucide:image-off size-7 text-zinc-400",
232
+ "aria-hidden": "true"
233
+ }, null, -1), o("span", C, h(P.value), 1)])) : i("", !0)
234
+ ], 4), t.showToolbar ? (p(), a("div", w, [
235
+ o("div", T, [c(g(n), { title: "缩小" }, {
236
+ default: v(() => [c(g(e), {
237
+ "aria-label": "缩小",
238
+ icon: "i-lucide:zoom-out",
239
+ size: "icon",
240
+ variant: "mono",
241
+ disabled: B.value,
242
+ onClick: l[0] ||= (e) => X(-t.zoomStep)
243
+ }, null, 8, ["disabled"])]),
244
+ _: 1
245
+ }), c(g(n), { title: "放大" }, {
246
+ default: v(() => [c(g(e), {
247
+ "aria-label": "放大",
248
+ icon: "i-lucide:zoom-in",
249
+ size: "icon",
250
+ variant: "mono",
251
+ disabled: B.value,
252
+ onClick: l[1] ||= (e) => X(t.zoomStep)
253
+ }, null, 8, ["disabled"])]),
254
+ _: 1
255
+ })]),
256
+ l[7] ||= o("span", {
257
+ class: "h-5 w-px bg-medium",
258
+ "aria-hidden": "true"
259
+ }, null, -1),
260
+ o("div", ne, [
261
+ c(g(n), { title: "向左旋转" }, {
262
+ default: v(() => [c(g(e), {
263
+ "aria-label": "向左旋转",
264
+ icon: "i-lucide:rotate-ccw",
265
+ size: "icon",
266
+ variant: "mono",
267
+ disabled: B.value,
268
+ onClick: l[2] ||= (e) => Z(-90)
269
+ }, null, 8, ["disabled"])]),
270
+ _: 1
271
+ }),
272
+ c(g(n), { title: "向右旋转" }, {
273
+ default: v(() => [c(g(e), {
274
+ "aria-label": "向右旋转",
275
+ icon: "i-lucide:rotate-cw",
276
+ size: "icon",
277
+ variant: "mono",
278
+ disabled: B.value,
279
+ onClick: l[3] ||= (e) => Z(90)
280
+ }, null, 8, ["disabled"])]),
281
+ _: 1
282
+ }),
283
+ c(g(n), { title: "重置" }, {
284
+ default: v(() => [c(g(e), {
285
+ "aria-label": "重置",
286
+ icon: "i-lucide:refresh-cw",
287
+ size: "icon",
288
+ variant: "mono",
289
+ disabled: B.value,
290
+ onClick: Q
291
+ }, null, 8, ["disabled"])]),
292
+ _: 1
293
+ })
294
+ ]),
295
+ o("div", E, [F.value ? (p(), a("span", D, h(Math.round(F.value.width)) + " x " + h(Math.round(F.value.height)) + " px ", 1)) : i("", !0), c(g(e), {
296
+ icon: "i-lucide:crop",
297
+ size: "sm",
298
+ disabled: B.value,
299
+ loading: N.value,
300
+ onClick: ae
301
+ }, {
302
+ default: v(() => [...l[6] ||= [s("裁剪", -1)]]),
303
+ _: 1
304
+ }, 8, ["disabled", "loading"])])
305
+ ])) : i("", !0)], 8, y));
306
+ }
307
+ }), [["__scopeId", "data-v-894b056e"]]);
308
+ //#endregion
309
+ export { O as t };
310
+
311
+ //# sourceMappingURL=ImageEditor-DOGIATeD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageEditor-DOGIATeD.js","names":[],"sources":["../../src/imageeditor/ImageEditor.vue","../../src/imageeditor/ImageEditor.vue"],"sourcesContent":["<template>\n <div data-ui-image-editor=\"true\" class=\"min-w-0 overflow-hidden rounded-lg border border-medium bg-primary\" :aria-busy=\"loading\">\n <div class=\"relative overflow-hidden bg-zinc-950\" :style=\"stageStyle\">\n <img ref=\"imageRef\" data-ui-image-editor-image=\"true\" class=\"block size-full max-w-full object-contain\" :src=\"src\" :alt=\"alt\" @error=\"handleImageError\" />\n\n <div v-if=\"loading && !errorMessage\" class=\"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-zinc-950/75 text-zinc-200\">\n <span class=\"i-lucide:loader-circle size-5 animate-spin\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">图片加载中</span>\n </div>\n\n <div v-if=\"errorMessage\" data-ui-image-editor-error=\"true\" class=\"absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 bg-zinc-950 px-4 text-center text-zinc-200\">\n <span class=\"i-lucide:image-off size-7 text-zinc-400\" aria-hidden=\"true\"></span>\n <span class=\"text-sm\">{{ errorMessage }}</span>\n </div>\n </div>\n\n <div v-if=\"showToolbar\" data-ui-image-editor-toolbar=\"true\" class=\"flex min-h-12 flex-wrap items-center gap-2 border-t border-medium bg-primary px-3 py-2\">\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"图片缩放\">\n <Tooltip title=\"缩小\">\n <Button aria-label=\"缩小\" icon=\"i-lucide:zoom-out\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"zoom(-zoomStep)\" />\n </Tooltip>\n <Tooltip title=\"放大\">\n <Button aria-label=\"放大\" icon=\"i-lucide:zoom-in\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"zoom(zoomStep)\" />\n </Tooltip>\n </div>\n\n <span class=\"h-5 w-px bg-medium\" aria-hidden=\"true\"></span>\n\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"图片旋转\">\n <Tooltip title=\"向左旋转\">\n <Button aria-label=\"向左旋转\" icon=\"i-lucide:rotate-ccw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"rotate(-90)\" />\n </Tooltip>\n <Tooltip title=\"向右旋转\">\n <Button aria-label=\"向右旋转\" icon=\"i-lucide:rotate-cw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"rotate(90)\" />\n </Tooltip>\n <Tooltip title=\"重置\">\n <Button aria-label=\"重置\" icon=\"i-lucide:refresh-cw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"reset\" />\n </Tooltip>\n </div>\n\n <div class=\"ml-auto flex min-w-0 items-center gap-3\">\n <span v-if=\"currentData\" class=\"hidden whitespace-nowrap font-mono text-xs text-tertiary sm:inline\"> {{ Math.round(currentData.width) }} x {{ Math.round(currentData.height) }} px </span>\n <Button icon=\"i-lucide:crop\" size=\"sm\" :disabled=\"controlsDisabled\" :loading=\"cropping\" @click=\"handleCrop\">裁剪</Button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport Cropper from 'cropperjs'\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport type { CSSProperties } from 'vue'\n\nimport type { ImageEditorData, ImageEditorOutputType, ImageEditorResult } from '.'\nimport { Button } from '../button'\nimport { Tooltip } from '../tooltip'\n\nconst props = withDefaults(\n defineProps<{\n /** src 是待编辑图片地址,支持普通 URL、Blob URL 和 Data URL。 */\n src: string\n /** alt 是原始图片的替代文本。 */\n alt?: string\n /** aspectRatio 固定裁剪宽高比;不传或传非正数时为自由比例。 */\n aspectRatio?: number\n /** minWidth 是最终裁剪区域的最小宽度,单位为原图像素。 */\n minWidth?: number\n /** minHeight 是最终裁剪区域的最小高度,单位为原图像素。 */\n minHeight?: number\n /** height 是编辑画布高度。 */\n height?: number | string\n /** zoomStep 是工具栏每次缩放的比例。 */\n zoomStep?: number\n /** outputType 是裁剪结果的图片 MIME 类型。 */\n outputType?: ImageEditorOutputType\n /** outputQuality 是 JPEG/WebP 输出质量,取值 0 到 1。 */\n outputQuality?: number\n /** disabled 禁用画布交互和工具栏操作。 */\n disabled?: boolean\n /** showToolbar 控制内置工具栏是否显示。 */\n showToolbar?: boolean\n }>(),\n {\n alt: '',\n aspectRatio: undefined,\n minWidth: 0,\n minHeight: 0,\n height: 420,\n zoomStep: 0.1,\n outputType: 'image/png',\n outputQuality: 0.92,\n disabled: false,\n showToolbar: true\n }\n)\n\nconst emit = defineEmits<{\n (e: 'ready', data: ImageEditorData): void\n (e: 'change', data: ImageEditorData): void\n (e: 'crop', result: ImageEditorResult): void\n (e: 'error', error: Error): void\n}>()\n\nconst imageRef = ref<HTMLImageElement | null>(null)\nconst loading = ref(true)\nconst cropping = ref(false)\nconst errorMessage = ref('')\nconst currentData = ref<ImageEditorData>()\nlet cropper: Cropper | undefined\nlet mounted = false\nlet applyingConstraints = false\n\nconst stageStyle = computed<CSSProperties>(() => ({\n height: typeof props.height === 'number' ? `${Math.max(240, props.height)}px` : props.height\n}))\nconst controlsDisabled = computed(() => props.disabled || loading.value || cropping.value || !!errorMessage.value)\nconst normalizedAspectRatio = computed(() => (Number.isFinite(props.aspectRatio) && Number(props.aspectRatio) > 0 ? Number(props.aspectRatio) : Number.NaN))\n\nfunction toImageEditorData(data: Cropper.Data): ImageEditorData {\n return {\n x: data.x,\n y: data.y,\n width: data.width,\n height: data.height,\n rotate: data.rotate,\n scaleX: data.scaleX,\n scaleY: data.scaleY\n }\n}\n\nfunction minimumCropSize() {\n let width = Math.max(0, Number.isFinite(props.minWidth) ? props.minWidth : 0)\n let height = Math.max(0, Number.isFinite(props.minHeight) ? props.minHeight : 0)\n const ratio = normalizedAspectRatio.value\n\n if (Number.isFinite(ratio)) {\n width = Math.max(width, height * ratio)\n height = width / ratio\n }\n\n return { width, height }\n}\n\nfunction enforceMinimumCropSize() {\n if (!cropper || applyingConstraints) return\n\n const data = cropper.getData()\n const minimum = minimumCropSize()\n if (data.width + 0.5 >= minimum.width && data.height + 0.5 >= minimum.height) return\n\n const width = Math.max(data.width, minimum.width)\n const height = Math.max(data.height, minimum.height)\n applyingConstraints = true\n cropper.setData({\n x: data.x - (width - data.width) / 2,\n y: data.y - (height - data.height) / 2,\n width,\n height\n })\n applyingConstraints = false\n}\n\nfunction syncData(shouldEmit = true) {\n if (!cropper) return\n enforceMinimumCropSize()\n const data = toImageEditorData(cropper.getData())\n currentData.value = data\n if (shouldEmit) emit('change', data)\n return data\n}\n\nfunction reportError(error: unknown, fallback: string, blocking = false) {\n const normalizedError = error instanceof Error ? error : new Error(fallback)\n if (blocking) {\n errorMessage.value = normalizedError.message || fallback\n loading.value = false\n }\n cropping.value = false\n emit('error', normalizedError)\n return normalizedError\n}\n\nfunction destroyCropper() {\n cropper?.destroy()\n cropper = undefined\n currentData.value = undefined\n}\n\nfunction initializeCropper() {\n if (!mounted || !imageRef.value) return\n destroyCropper()\n errorMessage.value = ''\n loading.value = true\n\n if (!props.src.trim()) {\n reportError(new Error('图片地址不能为空'), '图片地址不能为空', true)\n return\n }\n\n cropper = new Cropper(imageRef.value, {\n aspectRatio: normalizedAspectRatio.value,\n autoCropArea: 0.86,\n background: false,\n center: true,\n dragMode: 'move',\n guides: true,\n highlight: false,\n modal: true,\n responsive: true,\n restore: false,\n rotatable: true,\n toggleDragModeOnDblclick: false,\n viewMode: 1,\n wheelZoomRatio: Math.max(0.01, Math.abs(props.zoomStep)),\n zoomOnTouch: true,\n zoomOnWheel: true,\n zoomable: true,\n ready: () => {\n if (!cropper) return\n loading.value = false\n if (props.disabled) cropper.disable()\n const data = syncData(false)\n if (data) emit('ready', data)\n },\n crop: () => {\n if (!cropper || loading.value) return\n syncData()\n },\n cropend: () => enforceMinimumCropSize()\n })\n}\n\nfunction handleImageError() {\n destroyCropper()\n reportError(new Error('图片加载失败,请检查图片地址或跨域配置'), '图片加载失败', true)\n}\n\nfunction zoom(ratio = props.zoomStep) {\n if (controlsDisabled.value || !Number.isFinite(ratio) || ratio === 0) return\n cropper?.zoom(ratio)\n}\n\nfunction rotate(degrees: number) {\n if (controlsDisabled.value || !Number.isFinite(degrees) || degrees === 0) return\n cropper?.rotate(degrees)\n enforceMinimumCropSize()\n}\n\nfunction reset() {\n if (controlsDisabled.value) return\n cropper?.reset()\n cropper?.setAspectRatio(normalizedAspectRatio.value)\n syncData()\n}\n\nfunction getData(rounded = false) {\n if (!cropper) return\n enforceMinimumCropSize()\n return toImageEditorData(cropper.getData(rounded))\n}\n\nfunction canvasToBlob(canvas: HTMLCanvasElement) {\n return new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n (blob) => {\n if (blob) resolve(blob)\n else reject(new Error('无法生成裁剪图片'))\n },\n props.outputType,\n Math.min(1, Math.max(0, props.outputQuality))\n )\n })\n}\n\nasync function crop(): Promise<ImageEditorResult> {\n if (!cropper || loading.value || errorMessage.value) throw new Error('图片编辑器尚未就绪')\n\n try {\n cropping.value = true\n const minimum = minimumCropSize()\n enforceMinimumCropSize()\n const canvas = cropper.getCroppedCanvas({\n minWidth: Math.ceil(minimum.width),\n minHeight: Math.ceil(minimum.height),\n fillColor: props.outputType === 'image/jpeg' ? '#ffffff' : undefined,\n imageSmoothingEnabled: true,\n imageSmoothingQuality: 'high'\n })\n if (!canvas) throw new Error('无法创建裁剪画布')\n\n const quality = Math.min(1, Math.max(0, props.outputQuality))\n const [blob, dataUrl] = await Promise.all([canvasToBlob(canvas), Promise.resolve(canvas.toDataURL(props.outputType, quality))])\n const result: ImageEditorResult = {\n blob,\n dataUrl,\n width: canvas.width,\n height: canvas.height,\n data: toImageEditorData(cropper.getData())\n }\n emit('crop', result)\n return result\n } catch (error) {\n throw reportError(error, '图片裁剪失败')\n } finally {\n cropping.value = false\n }\n}\n\nasync function handleCrop() {\n try {\n await crop()\n } catch {\n // crop() 已通过 error 事件报告失败原因。\n }\n}\n\nwatch(\n () => props.src,\n async () => {\n await nextTick()\n initializeCropper()\n }\n)\n\nwatch(normalizedAspectRatio, (ratio) => {\n cropper?.setAspectRatio(ratio)\n syncData()\n})\n\nwatch(\n () => [props.minWidth, props.minHeight],\n () => syncData()\n)\n\nwatch(\n () => props.disabled,\n (disabled) => {\n if (!cropper) return\n if (disabled) cropper.disable()\n else cropper.enable()\n }\n)\n\nonMounted(() => {\n mounted = true\n initializeCropper()\n})\n\nonBeforeUnmount(() => {\n mounted = false\n destroyCropper()\n})\n\ndefineExpose({ zoom, rotate, reset, crop, getData })\n</script>\n\n<style scoped>\n:deep(.cropper-container) {\n height: 100% !important;\n width: 100% !important;\n}\n\n:deep(.cropper-view-box) {\n outline-color: oklch(68.98% 0.1679 252.18 / 0.9);\n}\n\n:deep(.cropper-line),\n:deep(.cropper-point) {\n background-color: oklch(68.98% 0.1679 252.18);\n}\n\n:deep(.cropper-point) {\n height: 8px;\n opacity: 1;\n width: 8px;\n}\n\n:deep(.cropper-modal) {\n background-color: #09090b;\n opacity: 0.66;\n}\n</style>\n","<template>\n <div data-ui-image-editor=\"true\" class=\"min-w-0 overflow-hidden rounded-lg border border-medium bg-primary\" :aria-busy=\"loading\">\n <div class=\"relative overflow-hidden bg-zinc-950\" :style=\"stageStyle\">\n <img ref=\"imageRef\" data-ui-image-editor-image=\"true\" class=\"block size-full max-w-full object-contain\" :src=\"src\" :alt=\"alt\" @error=\"handleImageError\" />\n\n <div v-if=\"loading && !errorMessage\" class=\"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-zinc-950/75 text-zinc-200\">\n <span class=\"i-lucide:loader-circle size-5 animate-spin\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">图片加载中</span>\n </div>\n\n <div v-if=\"errorMessage\" data-ui-image-editor-error=\"true\" class=\"absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 bg-zinc-950 px-4 text-center text-zinc-200\">\n <span class=\"i-lucide:image-off size-7 text-zinc-400\" aria-hidden=\"true\"></span>\n <span class=\"text-sm\">{{ errorMessage }}</span>\n </div>\n </div>\n\n <div v-if=\"showToolbar\" data-ui-image-editor-toolbar=\"true\" class=\"flex min-h-12 flex-wrap items-center gap-2 border-t border-medium bg-primary px-3 py-2\">\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"图片缩放\">\n <Tooltip title=\"缩小\">\n <Button aria-label=\"缩小\" icon=\"i-lucide:zoom-out\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"zoom(-zoomStep)\" />\n </Tooltip>\n <Tooltip title=\"放大\">\n <Button aria-label=\"放大\" icon=\"i-lucide:zoom-in\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"zoom(zoomStep)\" />\n </Tooltip>\n </div>\n\n <span class=\"h-5 w-px bg-medium\" aria-hidden=\"true\"></span>\n\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"图片旋转\">\n <Tooltip title=\"向左旋转\">\n <Button aria-label=\"向左旋转\" icon=\"i-lucide:rotate-ccw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"rotate(-90)\" />\n </Tooltip>\n <Tooltip title=\"向右旋转\">\n <Button aria-label=\"向右旋转\" icon=\"i-lucide:rotate-cw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"rotate(90)\" />\n </Tooltip>\n <Tooltip title=\"重置\">\n <Button aria-label=\"重置\" icon=\"i-lucide:refresh-cw\" size=\"icon\" variant=\"mono\" :disabled=\"controlsDisabled\" @click=\"reset\" />\n </Tooltip>\n </div>\n\n <div class=\"ml-auto flex min-w-0 items-center gap-3\">\n <span v-if=\"currentData\" class=\"hidden whitespace-nowrap font-mono text-xs text-tertiary sm:inline\"> {{ Math.round(currentData.width) }} x {{ Math.round(currentData.height) }} px </span>\n <Button icon=\"i-lucide:crop\" size=\"sm\" :disabled=\"controlsDisabled\" :loading=\"cropping\" @click=\"handleCrop\">裁剪</Button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport Cropper from 'cropperjs'\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport type { CSSProperties } from 'vue'\n\nimport type { ImageEditorData, ImageEditorOutputType, ImageEditorResult } from '.'\nimport { Button } from '../button'\nimport { Tooltip } from '../tooltip'\n\nconst props = withDefaults(\n defineProps<{\n /** src 是待编辑图片地址,支持普通 URL、Blob URL 和 Data URL。 */\n src: string\n /** alt 是原始图片的替代文本。 */\n alt?: string\n /** aspectRatio 固定裁剪宽高比;不传或传非正数时为自由比例。 */\n aspectRatio?: number\n /** minWidth 是最终裁剪区域的最小宽度,单位为原图像素。 */\n minWidth?: number\n /** minHeight 是最终裁剪区域的最小高度,单位为原图像素。 */\n minHeight?: number\n /** height 是编辑画布高度。 */\n height?: number | string\n /** zoomStep 是工具栏每次缩放的比例。 */\n zoomStep?: number\n /** outputType 是裁剪结果的图片 MIME 类型。 */\n outputType?: ImageEditorOutputType\n /** outputQuality 是 JPEG/WebP 输出质量,取值 0 到 1。 */\n outputQuality?: number\n /** disabled 禁用画布交互和工具栏操作。 */\n disabled?: boolean\n /** showToolbar 控制内置工具栏是否显示。 */\n showToolbar?: boolean\n }>(),\n {\n alt: '',\n aspectRatio: undefined,\n minWidth: 0,\n minHeight: 0,\n height: 420,\n zoomStep: 0.1,\n outputType: 'image/png',\n outputQuality: 0.92,\n disabled: false,\n showToolbar: true\n }\n)\n\nconst emit = defineEmits<{\n (e: 'ready', data: ImageEditorData): void\n (e: 'change', data: ImageEditorData): void\n (e: 'crop', result: ImageEditorResult): void\n (e: 'error', error: Error): void\n}>()\n\nconst imageRef = ref<HTMLImageElement | null>(null)\nconst loading = ref(true)\nconst cropping = ref(false)\nconst errorMessage = ref('')\nconst currentData = ref<ImageEditorData>()\nlet cropper: Cropper | undefined\nlet mounted = false\nlet applyingConstraints = false\n\nconst stageStyle = computed<CSSProperties>(() => ({\n height: typeof props.height === 'number' ? `${Math.max(240, props.height)}px` : props.height\n}))\nconst controlsDisabled = computed(() => props.disabled || loading.value || cropping.value || !!errorMessage.value)\nconst normalizedAspectRatio = computed(() => (Number.isFinite(props.aspectRatio) && Number(props.aspectRatio) > 0 ? Number(props.aspectRatio) : Number.NaN))\n\nfunction toImageEditorData(data: Cropper.Data): ImageEditorData {\n return {\n x: data.x,\n y: data.y,\n width: data.width,\n height: data.height,\n rotate: data.rotate,\n scaleX: data.scaleX,\n scaleY: data.scaleY\n }\n}\n\nfunction minimumCropSize() {\n let width = Math.max(0, Number.isFinite(props.minWidth) ? props.minWidth : 0)\n let height = Math.max(0, Number.isFinite(props.minHeight) ? props.minHeight : 0)\n const ratio = normalizedAspectRatio.value\n\n if (Number.isFinite(ratio)) {\n width = Math.max(width, height * ratio)\n height = width / ratio\n }\n\n return { width, height }\n}\n\nfunction enforceMinimumCropSize() {\n if (!cropper || applyingConstraints) return\n\n const data = cropper.getData()\n const minimum = minimumCropSize()\n if (data.width + 0.5 >= minimum.width && data.height + 0.5 >= minimum.height) return\n\n const width = Math.max(data.width, minimum.width)\n const height = Math.max(data.height, minimum.height)\n applyingConstraints = true\n cropper.setData({\n x: data.x - (width - data.width) / 2,\n y: data.y - (height - data.height) / 2,\n width,\n height\n })\n applyingConstraints = false\n}\n\nfunction syncData(shouldEmit = true) {\n if (!cropper) return\n enforceMinimumCropSize()\n const data = toImageEditorData(cropper.getData())\n currentData.value = data\n if (shouldEmit) emit('change', data)\n return data\n}\n\nfunction reportError(error: unknown, fallback: string, blocking = false) {\n const normalizedError = error instanceof Error ? error : new Error(fallback)\n if (blocking) {\n errorMessage.value = normalizedError.message || fallback\n loading.value = false\n }\n cropping.value = false\n emit('error', normalizedError)\n return normalizedError\n}\n\nfunction destroyCropper() {\n cropper?.destroy()\n cropper = undefined\n currentData.value = undefined\n}\n\nfunction initializeCropper() {\n if (!mounted || !imageRef.value) return\n destroyCropper()\n errorMessage.value = ''\n loading.value = true\n\n if (!props.src.trim()) {\n reportError(new Error('图片地址不能为空'), '图片地址不能为空', true)\n return\n }\n\n cropper = new Cropper(imageRef.value, {\n aspectRatio: normalizedAspectRatio.value,\n autoCropArea: 0.86,\n background: false,\n center: true,\n dragMode: 'move',\n guides: true,\n highlight: false,\n modal: true,\n responsive: true,\n restore: false,\n rotatable: true,\n toggleDragModeOnDblclick: false,\n viewMode: 1,\n wheelZoomRatio: Math.max(0.01, Math.abs(props.zoomStep)),\n zoomOnTouch: true,\n zoomOnWheel: true,\n zoomable: true,\n ready: () => {\n if (!cropper) return\n loading.value = false\n if (props.disabled) cropper.disable()\n const data = syncData(false)\n if (data) emit('ready', data)\n },\n crop: () => {\n if (!cropper || loading.value) return\n syncData()\n },\n cropend: () => enforceMinimumCropSize()\n })\n}\n\nfunction handleImageError() {\n destroyCropper()\n reportError(new Error('图片加载失败,请检查图片地址或跨域配置'), '图片加载失败', true)\n}\n\nfunction zoom(ratio = props.zoomStep) {\n if (controlsDisabled.value || !Number.isFinite(ratio) || ratio === 0) return\n cropper?.zoom(ratio)\n}\n\nfunction rotate(degrees: number) {\n if (controlsDisabled.value || !Number.isFinite(degrees) || degrees === 0) return\n cropper?.rotate(degrees)\n enforceMinimumCropSize()\n}\n\nfunction reset() {\n if (controlsDisabled.value) return\n cropper?.reset()\n cropper?.setAspectRatio(normalizedAspectRatio.value)\n syncData()\n}\n\nfunction getData(rounded = false) {\n if (!cropper) return\n enforceMinimumCropSize()\n return toImageEditorData(cropper.getData(rounded))\n}\n\nfunction canvasToBlob(canvas: HTMLCanvasElement) {\n return new Promise<Blob>((resolve, reject) => {\n canvas.toBlob(\n (blob) => {\n if (blob) resolve(blob)\n else reject(new Error('无法生成裁剪图片'))\n },\n props.outputType,\n Math.min(1, Math.max(0, props.outputQuality))\n )\n })\n}\n\nasync function crop(): Promise<ImageEditorResult> {\n if (!cropper || loading.value || errorMessage.value) throw new Error('图片编辑器尚未就绪')\n\n try {\n cropping.value = true\n const minimum = minimumCropSize()\n enforceMinimumCropSize()\n const canvas = cropper.getCroppedCanvas({\n minWidth: Math.ceil(minimum.width),\n minHeight: Math.ceil(minimum.height),\n fillColor: props.outputType === 'image/jpeg' ? '#ffffff' : undefined,\n imageSmoothingEnabled: true,\n imageSmoothingQuality: 'high'\n })\n if (!canvas) throw new Error('无法创建裁剪画布')\n\n const quality = Math.min(1, Math.max(0, props.outputQuality))\n const [blob, dataUrl] = await Promise.all([canvasToBlob(canvas), Promise.resolve(canvas.toDataURL(props.outputType, quality))])\n const result: ImageEditorResult = {\n blob,\n dataUrl,\n width: canvas.width,\n height: canvas.height,\n data: toImageEditorData(cropper.getData())\n }\n emit('crop', result)\n return result\n } catch (error) {\n throw reportError(error, '图片裁剪失败')\n } finally {\n cropping.value = false\n }\n}\n\nasync function handleCrop() {\n try {\n await crop()\n } catch {\n // crop() 已通过 error 事件报告失败原因。\n }\n}\n\nwatch(\n () => props.src,\n async () => {\n await nextTick()\n initializeCropper()\n }\n)\n\nwatch(normalizedAspectRatio, (ratio) => {\n cropper?.setAspectRatio(ratio)\n syncData()\n})\n\nwatch(\n () => [props.minWidth, props.minHeight],\n () => syncData()\n)\n\nwatch(\n () => props.disabled,\n (disabled) => {\n if (!cropper) return\n if (disabled) cropper.disable()\n else cropper.enable()\n }\n)\n\nonMounted(() => {\n mounted = true\n initializeCropper()\n})\n\nonBeforeUnmount(() => {\n mounted = false\n destroyCropper()\n})\n\ndefineExpose({ zoom, rotate, reset, crop, getData })\n</script>\n\n<style scoped>\n:deep(.cropper-container) {\n height: 100% !important;\n width: 100% !important;\n}\n\n:deep(.cropper-view-box) {\n outline-color: oklch(68.98% 0.1679 252.18 / 0.9);\n}\n\n:deep(.cropper-line),\n:deep(.cropper-point) {\n background-color: oklch(68.98% 0.1679 252.18);\n}\n\n:deep(.cropper-point) {\n height: 8px;\n opacity: 1;\n width: 8px;\n}\n\n:deep(.cropper-modal) {\n background-color: #09090b;\n opacity: 0.66;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDA,IAAM,IAAQ,GAuCR,IAAO,GAOP,IAAW,EAA6B,IAAI,GAC5C,IAAU,EAAI,EAAI,GAClB,IAAW,EAAI,EAAK,GACpB,IAAe,EAAI,EAAE,GACrB,IAAc,EAAqB,GACrC,GACA,IAAU,IACV,IAAsB,IAEpB,IAAa,SAA+B,EAChD,QAAQ,OAA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AA;;;;IAE7H,EAEU,EAAA,CAAA,GAAA,EAFD,OAAM,OAAM,GAAA;sBAC+G,CAAlI,EAAkI,EAAA,CAAA,GAAA;MAA1H,cAAW;MAAO,MAAK;MAAqB,MAAK;MAAO,SAAQ;MAAQ,UAAU,EAAA;MAAmB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAM,EAAA;;;;IAE5H,EAEU,EAAA,CAAA,GAAA,EAFD,OAAM,KAAI,GAAA;sBAC2G,CAA5H,EAA4H,EAAA,CAAA,GAAA;MAApH,cAAW;MAAK,MAAK;MAAsB,MAAK;MAAO,SAAQ;MAAQ,UAAU,EAAA;MAAmB,SAAO;;;;;GAIvH,EAGM,OAHN,GAGM,CAFQ,EAAA,SAAA,EAAA,GAAZ,EAA0L,QAA1L,GAA0L,EAAlF,KAAK,MAAM,EAAA,MAAY,KAAK,CAAA,IAAI,QAAG,EAAG,KAAK,MAAM,EAAA,MAAY,MAAM,CAAA,IAAI,QAAI,CAAA,KAAA,EAAA,IAAA,EAAA,GACnL,EAAuH,EAAA,CAAA,GAAA;IAA/G,MAAK;IAAgB,MAAK;IAAM,UAAU,EAAA;IAAmB,SAAS,EAAA;IAAW,SAAO;;qBAAc,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAAF,MAAE,EAAA,CAAA,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { r as e } from "./button-pDObrN_X.js";
1
+ import { r as e } from "./button-BDScl2qA.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as n } from "./dropdown-0l967g7D.js";
4
4
  /* empty css */
@@ -327,4 +327,4 @@ var oe = ["onClick"], se = { class: "truncate" }, ce = {
327
327
  //#endregion
328
328
  export { w as t };
329
329
 
330
- //# sourceMappingURL=Table-DhXmuKQd.js.map
330
+ //# sourceMappingURL=Table-SDKDGSur.js.map