disguise-ui 0.3.1 → 0.3.3

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.
@@ -1,4 +1,4 @@
1
- import { t as e } from "./file-upload-D7N0tsLF.js";
1
+ import { t as e } from "./file-upload-n4pZizh3.js";
2
2
  // src/components/file-upload/index.ts
3
3
  var t = e;
4
4
  export { t as default };
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./modal-CHOpDVLd.js";
2
- import { n as t } from "./i18n-_x6RCAst.js";
2
+ import { n as t } from "./i18n-D9LSb_U5.js";
3
3
  import { t as n } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
4
- import { t as r } from "./use-image-url-Bs5WMZ6L.js";
5
- import { n as i, t as ee } from "./use-multiple-file-upload-Cv2dfA07.js";
4
+ import { t as r } from "./use-image-url-Df54pSFh.js";
5
+ import { n as i, t as ee } from "./use-multiple-file-upload-CBOycBu3.js";
6
6
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as te, createVNode as d, defineComponent as f, h as p, normalizeClass as m, normalizeStyle as h, openBlock as g, ref as _, renderList as v, resolveComponent as ne, resolveDynamicComponent as y, toDisplayString as b, toRefs as re, unref as x, withCtx as S } from "vue";
7
7
  import { ElIcon as C, ElTooltip as w, ElUpload as ie } from "element-plus";
8
8
  import { Delete as T, Download as E, Upload as ae, View as D } from "@element-plus/icons-vue";
@@ -1,10 +1,58 @@
1
- import { a as e, c as t } from "./context-DqlD6qDJ.js";
2
- var n = {
1
+ import { ref as e } from "vue";
2
+ // src/runtime/context.ts
3
+ var t = e("zh-CN"), n = e({}), r = e(() => !0), i = e(() => ""), a = e("hover"), o = e({
4
+ layout: "total, sizes, prev, pager, next, jumper",
5
+ background: !0,
6
+ pageSizes: [
7
+ 10,
8
+ 20,
9
+ 50,
10
+ 100
11
+ ],
12
+ popperStyle: { zIndex: 4e3 }
13
+ }), s = null, c, l, u = "";
14
+ function d(e) {
15
+ e.locale && (t.value = e.locale), e.messages && (n.value = e.messages), e.request && (s = e.request), e.fetchAllDictData && (c = e.fetchAllDictData), e.uploadFile && (l = e.uploadFile), e.imageBaseUrl !== void 0 && (u = e.imageBaseUrl), e.hasAccess && (r.value = e.hasAccess), e.getAccessToken && (i.value = e.getAccessToken), e.cardShadow && (a.value = e.cardShadow), e.paginationConfig && (o.value = {
16
+ ...o.value,
17
+ ...e.paginationConfig
18
+ });
19
+ }
20
+ function f() {
21
+ return t;
22
+ }
23
+ function p() {
24
+ return n;
25
+ }
26
+ function m() {
27
+ return s;
28
+ }
29
+ function h() {
30
+ return c?.() ?? Promise.resolve({});
31
+ }
32
+ function g() {
33
+ return l;
34
+ }
35
+ function _() {
36
+ return u;
37
+ }
38
+ function v() {
39
+ return r;
40
+ }
41
+ function y() {
42
+ return i.value();
43
+ }
44
+ function b() {
45
+ return a;
46
+ }
47
+ function x() {
48
+ return o;
49
+ }
50
+ var S = {
3
51
  pleaseSelect: "Please select",
4
52
  close: "Close",
5
53
  cancel: "Cancel",
6
54
  confirm: "Confirm"
7
- }, r = {
55
+ }, C = {
8
56
  components: {
9
57
  title: "Components",
10
58
  asyncSelect: "Async Select",
@@ -25,7 +73,8 @@ var n = {
25
73
  fieldDepartment: "Department",
26
74
  ariaLabel: "User information",
27
75
  clickToViewDetail: "Click to view details",
28
- empty: "N/A"
76
+ empty: "N/A",
77
+ fieldId: "User ID"
29
78
  }
30
79
  },
31
80
  importDialog: {
@@ -73,7 +122,11 @@ var n = {
73
122
  importError: "Import failed, please try again later",
74
123
  mappingRequired: "Required field {field} is not mapped. Please select a source column",
75
124
  mappingDuplicate: "The same column cannot be mapped to multiple fields",
76
- mappingEmpty: "Please map at least one field"
125
+ mappingEmpty: "Please map at least one field",
126
+ templateDownloadError: "Template download failed",
127
+ parseFileMissing: "File parse handler is not configured",
128
+ apiMissing: "Import API is not configured",
129
+ submitImportMissing: "Import submit handler is not configured"
77
130
  },
78
131
  richTextEditor: {
79
132
  placeholder: "Enter content...",
@@ -171,7 +224,13 @@ var n = {
171
224
  visibleCount: "{visible} / {total} columns visible",
172
225
  viewAllItems: "View all {count} {unit}",
173
226
  collapseItems: "Collapse",
174
- itemUnit: "items"
227
+ itemUnit: "items",
228
+ selectedCount: "{count} selected",
229
+ dragSort: "Drag to sort",
230
+ fileType: "Type",
231
+ fileSize: "Size",
232
+ fileOpenHint: "Click to open / download",
233
+ fileKindOther: "File"
175
234
  },
176
235
  fileUpload: {
177
236
  placeholder: "Click to upload",
@@ -203,6 +262,7 @@ var n = {
203
262
  typeNotAllowed: "Only {types} is supported",
204
263
  sizeLimitExceeded: "Image size cannot exceed {size}MB"
205
264
  },
265
+ imagesView: { empty: "No images" },
206
266
  pictureUpload: {
207
267
  cropTitle: "Crop image",
208
268
  cropHint: "Drag the crop area and resize it from the corners",
@@ -217,12 +277,41 @@ var n = {
217
277
  heightMin: "Image height must be at least {height}px",
218
278
  widthMax: "Image width must not exceed {width}px",
219
279
  heightMax: "Image height must not exceed {height}px"
280
+ },
281
+ searchForm: {
282
+ search: "Search",
283
+ reset: "Reset",
284
+ expand: "Expand",
285
+ collapse: "Collapse"
286
+ },
287
+ crudPage: {
288
+ createTitle: "New",
289
+ editTitle: "Edit",
290
+ viewTitle: "Details",
291
+ addButtonText: "New",
292
+ deleteConfirmText: "Delete this record?",
293
+ batchDeleteConfirm: "Delete the selected {count} records?",
294
+ submitHandlerMissing: "No submit handler configured for this action",
295
+ createSuccess: "Created successfully",
296
+ updateSuccess: "Updated successfully",
297
+ createFailed: "Failed to create",
298
+ updateFailed: "Failed to update",
299
+ loadDetailFailed: "Failed to load details",
300
+ deleteHandlerMissing: "No delete handler configured for this action",
301
+ deleteSuccess: "Deleted successfully",
302
+ deleteFailed: "Failed to delete",
303
+ batchDeleteHandlerMissing: "No batch delete handler configured for this action",
304
+ importNotConfigured: "Import is not configured on this page",
305
+ exportFailed: "Export failed"
220
306
  }
221
- }, i = {
307
+ }, w = {
222
308
  copy: "Copy",
223
309
  copied: "Copied",
224
- empty: "N/A"
225
- }, a = {
310
+ empty: "N/A",
311
+ requiredNote: "Required",
312
+ yes: "Yes",
313
+ no: "No"
314
+ }, T = {
226
315
  label: "Auto translate:",
227
316
  all: "All other languages",
228
317
  from: "Select source language",
@@ -234,15 +323,15 @@ var n = {
234
323
  loading: "Translating...",
235
324
  completed: "Translation completed",
236
325
  failed: "Translation failed"
237
- }, o = {
326
+ }, E = {
238
327
  enterField: "Enter {field}",
239
328
  selectField: "Select {field}"
240
- }, s = {
329
+ }, D = {
241
330
  pleaseSelect: "请选择",
242
331
  close: "关闭",
243
332
  cancel: "取消",
244
333
  confirm: "确定"
245
- }, c = {
334
+ }, O = {
246
335
  components: {
247
336
  title: "组件",
248
337
  asyncSelect: "异步选择器",
@@ -264,7 +353,8 @@ var n = {
264
353
  fieldDepartment: "部门",
265
354
  ariaLabel: "用户信息",
266
355
  clickToViewDetail: "点击查看详情",
267
- empty: "暂无"
356
+ empty: "暂无",
357
+ fieldId: "用户 ID"
268
358
  },
269
359
  importDialog: {
270
360
  title: "批量导入",
@@ -311,7 +401,11 @@ var n = {
311
401
  importError: "导入失败,请稍后重试",
312
402
  mappingRequired: "必填字段 {field} 未映射,请选择来源列",
313
403
  mappingDuplicate: "同一表格列不能重复映射到多个字段",
314
- mappingEmpty: "请至少映射一个字段"
404
+ mappingEmpty: "请至少映射一个字段",
405
+ templateDownloadError: "模板下载失败",
406
+ parseFileMissing: "未配置文件解析方法",
407
+ apiMissing: "未配置导入接口",
408
+ submitImportMissing: "未配置导入方法"
315
409
  },
316
410
  richTextEditor: {
317
411
  placeholder: "请输入内容...",
@@ -409,7 +503,13 @@ var n = {
409
503
  visibleCount: "已显示 {visible} / {total} 列",
410
504
  viewAllItems: "查看全部 {count} 个{unit}",
411
505
  collapseItems: "收起",
412
- itemUnit: "项"
506
+ itemUnit: "项",
507
+ selectedCount: "已选 {count} 项",
508
+ dragSort: "拖拽排序",
509
+ fileType: "类型",
510
+ fileSize: "大小",
511
+ fileOpenHint: "点击打开 / 下载",
512
+ fileKindOther: "文件"
413
513
  },
414
514
  fileUpload: {
415
515
  placeholder: "点击上传",
@@ -441,6 +541,7 @@ var n = {
441
541
  typeNotAllowed: "仅支持 {types} 格式",
442
542
  sizeLimitExceeded: "图片大小不能超过 {size}MB"
443
543
  },
544
+ imagesView: { empty: "暂无图片" },
444
545
  pictureUpload: {
445
546
  cropTitle: "裁剪图片",
446
547
  cropHint: "拖动裁剪框调整区域,拖动四角调整大小",
@@ -455,12 +556,41 @@ var n = {
455
556
  heightMin: "图片高度不能小于 {height}px",
456
557
  widthMax: "图片宽度不能大于 {width}px",
457
558
  heightMax: "图片高度不能大于 {height}px"
559
+ },
560
+ searchForm: {
561
+ search: "搜索",
562
+ reset: "重置",
563
+ expand: "展开",
564
+ collapse: "收起"
565
+ },
566
+ crudPage: {
567
+ createTitle: "新增",
568
+ editTitle: "编辑",
569
+ viewTitle: "详情",
570
+ addButtonText: "新增",
571
+ deleteConfirmText: "确定要删除这条数据吗?",
572
+ batchDeleteConfirm: "确定要删除选中的 {count} 条数据吗?",
573
+ submitHandlerMissing: "当前操作没有配置提交处理函数",
574
+ createSuccess: "新增成功",
575
+ updateSuccess: "更新成功",
576
+ createFailed: "新增失败",
577
+ updateFailed: "更新失败",
578
+ loadDetailFailed: "加载详情失败",
579
+ deleteHandlerMissing: "当前操作没有配置删除处理函数",
580
+ deleteSuccess: "删除成功",
581
+ deleteFailed: "删除失败",
582
+ batchDeleteHandlerMissing: "当前操作没有配置批量删除处理函数",
583
+ importNotConfigured: "当前页面没有配置导入功能",
584
+ exportFailed: "导出失败"
458
585
  }
459
- }, l = {
586
+ }, k = {
460
587
  copy: "复制",
461
588
  copied: "已复制",
462
- empty: "暂无"
463
- }, u = {
589
+ empty: "暂无",
590
+ requiredNote: "为必填项",
591
+ yes: "是",
592
+ no: "否"
593
+ }, A = {
464
594
  label: "自动翻译:",
465
595
  all: "其他所有",
466
596
  from: "请选择来源语言",
@@ -472,51 +602,51 @@ var n = {
472
602
  loading: "翻译中…",
473
603
  completed: "翻译完成",
474
604
  failed: "翻译失败"
475
- }, d = {
605
+ }, j = {
476
606
  enterField: "请输入{field}",
477
607
  selectField: "请选择{field}"
478
608
  };
479
609
  // src/runtime/i18n.ts
480
- function f(e) {
610
+ function M(e) {
481
611
  let t = { ...e }, n = e.components;
482
612
  return n && typeof n == "object" && "userAvatarInfo" in n && !t.userAvatarInfo && (t.userAvatarInfo = n.userAvatarInfo), t;
483
613
  }
484
- function p(e, t, n, r, i) {
614
+ function N(e, t, n, r, i) {
485
615
  return {
486
- components: f(e),
616
+ components: M(e),
487
617
  schemaForm: t,
488
618
  validation: n,
489
619
  common: r,
490
620
  "product-management": { attribute: { translation: i } }
491
621
  };
492
622
  }
493
- var m = {
494
- "zh-CN": p(c, l, d, s, u),
495
- "en-US": p(r, i, o, n, a)
623
+ var P = {
624
+ "zh-CN": N(O, k, j, D, A),
625
+ "en-US": N(C, w, E, S, T)
496
626
  };
497
- function h(e, t) {
627
+ function F(e, t) {
498
628
  return t.split(".").reduce((e, t) => {
499
629
  if (e && typeof e == "object") return e[t];
500
630
  }, e);
501
631
  }
502
- function g(e, t) {
632
+ function I(e, t) {
503
633
  return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] === void 0 ? "" : String(t[n])) : e;
504
634
  }
505
- function _(n) {
506
- let r = [t().value, "zh-CN"];
507
- for (let t of r) {
508
- let r = h(e().value[t], n);
635
+ function L(e) {
636
+ let t = [f().value, "zh-CN"];
637
+ for (let n of t) {
638
+ let t = F(p().value[n], e);
639
+ if (typeof t == "string") return t;
640
+ let r = F(P[n], e);
509
641
  if (typeof r == "string") return r;
510
- let i = h(m[t], n);
511
- if (typeof i == "string") return i;
512
642
  }
513
- return n;
643
+ return e;
514
644
  }
515
- function v(e, t) {
516
- return g(_(e), t);
645
+ function R(e, t) {
646
+ return I(L(e), t);
517
647
  }
518
- var y = v;
519
- function b() {
520
- return { t: v };
648
+ var z = R;
649
+ function B() {
650
+ return { t: R };
521
651
  }
522
- export { b as n, y as t };
652
+ export { y as a, _ as c, h as d, v as i, x as l, B as n, b as o, d as r, g as s, z as t, m as u };
@@ -0,0 +1,121 @@
1
+ import { t as e } from "./i18n-D9LSb_U5.js";
2
+ import { t } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, toDisplayString as g, unref as _, useAttrs as v, withCtx as y } from "vue";
4
+ import { ElEmpty as b, ElIcon as x, ElImage as S, ElTooltip as C } from "element-plus";
5
+ import { Loading as w, Picture as T } from "@element-plus/icons-vue";
6
+ // \0rolldown/runtime.js
7
+ var E = Object.defineProperty, D = (e, t) => {
8
+ let n = {};
9
+ for (var r in e) E(n, r, {
10
+ get: e[r],
11
+ enumerable: !0
12
+ });
13
+ return t || E(n, Symbol.toStringTag, { value: "Module" }), n;
14
+ }, O = { class: "inline-block" }, k = ["src"], A = { class: "flex h-full w-full items-center justify-center text-gray-400" }, j = { class: "flex h-full w-full items-center justify-center text-gray-400" }, M = /* @__PURE__ */ u({
15
+ name: "ImagesView",
16
+ __name: "index",
17
+ props: {
18
+ images: { default: () => [] },
19
+ size: { default: 80 },
20
+ maxStack: { default: 3 },
21
+ offset: { default: 6 }
22
+ },
23
+ setup(t) {
24
+ let u = t, d = r(() => [...u.images.slice(0, u.maxStack)].reverse()), v = r(() => {
25
+ let e = (Math.min(u.images.length, u.maxStack) - 1) * u.offset;
26
+ return {
27
+ width: `${u.size + e}px`,
28
+ height: `${u.size + e}px`
29
+ };
30
+ }), E = (e) => {
31
+ let t = e === Math.min(u.images.length, u.maxStack) - 1, n = e * u.offset;
32
+ return {
33
+ width: `${u.size}px`,
34
+ height: `${u.size}px`,
35
+ left: `${n}px`,
36
+ top: `${n}px`,
37
+ zIndex: e + 1,
38
+ boxShadow: t ? "none" : "0 1px 4px rgba(0,0,0,0.08)"
39
+ };
40
+ };
41
+ return (r, D) => (p(), o("div", O, [t.images.length ? (p(), o("div", {
42
+ key: 0,
43
+ class: "relative",
44
+ style: f(v.value)
45
+ }, [(p(!0), o(n, null, m(d.value, (e, n) => (p(), i(_(C), {
46
+ key: n,
47
+ placement: "top",
48
+ effect: "light",
49
+ "show-after": 100,
50
+ teleported: !0,
51
+ "z-index": 9e3
52
+ }, {
53
+ content: y(() => [s("img", {
54
+ src: e,
55
+ style: {
56
+ display: "block",
57
+ "max-width": "300px",
58
+ "max-height": "300px"
59
+ }
60
+ }, null, 8, k)]),
61
+ default: y(() => [s("div", {
62
+ class: "group absolute overflow-hidden rounded-md border border-gray-200 bg-gray-50 cursor-pointer transition-all duration-200 hover:-translate-y-px hover:border-blue-500",
63
+ style: f(E(n))
64
+ }, [l(_(S), {
65
+ src: e,
66
+ fit: "cover",
67
+ class: "block h-full w-full",
68
+ "preview-src-list": t.images,
69
+ "initial-index": d.value.length - 1 - n,
70
+ "preview-teleported": !0,
71
+ "hide-on-click-modal": !0,
72
+ "z-index": 3e3
73
+ }, {
74
+ placeholder: y(() => [s("div", A, [l(_(x), { class: "is-loading text-xl" }, {
75
+ default: y(() => [l(_(w))]),
76
+ _: 1
77
+ })])]),
78
+ error: y(() => [s("div", j, [l(_(x), { class: "text-xl" }, {
79
+ default: y(() => [l(_(T))]),
80
+ _: 1
81
+ })])]),
82
+ _: 1
83
+ }, 8, [
84
+ "src",
85
+ "preview-src-list",
86
+ "initial-index"
87
+ ]), n === d.value.length - 1 && t.images.length > 1 && u.size >= 80 ? (p(), o("span", {
88
+ key: 0,
89
+ style: f({
90
+ width: u.size < 40 ? `${u.size / 1.5}px` : "40px",
91
+ height: u.size < 25 ? `${u.size / 1.5}px` : "25px",
92
+ fontSize: u.size / 4
93
+ }),
94
+ class: "pointer-events-none absolute right-1 bottom-1 inline-flex items-center gap-0.5 rounded-full bg-black/60 px-1.5 py-px text-xs leading-tight text-white"
95
+ }, [l(_(x), { size: u.size / 4 }, {
96
+ default: y(() => [l(_(T))]),
97
+ _: 1
98
+ }, 8, ["size"]), c(" " + g(t.images.length), 1)], 4)) : a("", !0)], 4)]),
99
+ _: 2
100
+ }, 1024))), 128))], 4)) : h(r.$slots, "empty", {}, () => [l(_(b), {
101
+ description: _(e)("components.imagesView.empty"),
102
+ "image-size": 40
103
+ }, null, 8, ["description"])], void 0, 1)]));
104
+ }
105
+ }), N = { class: "picture-cell flex" }, P = { key: 1 }, F = /*@__PURE__*/ u({
106
+ inheritAttrs: !1,
107
+ __name: "picture-cell",
108
+ props: {
109
+ urls: {},
110
+ maxPreviewCount: { default: 3 },
111
+ imageListProps: { default: () => ({}) }
112
+ },
113
+ setup(e) {
114
+ let t = e, n = v(), a = r(() => t.urls.filter((e) => e)), s = r(() => a.value.slice(0, t.maxPreviewCount)), c = r(() => ({
115
+ ...n,
116
+ ...t.imageListProps ?? {}
117
+ }));
118
+ return (e, t) => (p(), o("div", N, [s.value.length > 0 ? (p(), i(M, d({ key: 0 }, c.value, { images: s.value }), null, 16, ["images"])) : (p(), o("span", P, "-"))]));
119
+ }
120
+ }), I = /* @__PURE__ */ D({ default: () => L }), L = /*#__PURE__*/ t(F, [["__scopeId", "data-v-cb2252bb"]]);
121
+ export { D as i, I as n, M as r, L as t };
@@ -1,7 +1,7 @@
1
- import { t as e } from "./i18n-_x6RCAst.js";
1
+ import { t as e } from "./i18n-D9LSb_U5.js";
2
2
  import { t } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
3
- import { t as n } from "./use-image-url-Bs5WMZ6L.js";
4
- import { n as r, t as i } from "./use-multiple-file-upload-Cv2dfA07.js";
3
+ import { t as n } from "./use-image-url-Df54pSFh.js";
4
+ import { n as r, t as i } from "./use-multiple-file-upload-CBOycBu3.js";
5
5
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as ee, normalizeClass as te, normalizeStyle as m, onBeforeUnmount as ne, openBlock as h, reactive as g, ref as _, renderList as re, renderSlot as v, toDisplayString as y, toRefs as b, unref as x, useSlots as S, watch as ie, withCtx as C, withModifiers as w } from "vue";
6
6
  import { ElButton as T, ElDialog as ae, ElIcon as E, ElImageViewer as D, ElMessage as O, ElProgress as k, ElUpload as A } from "element-plus";
7
7
  import { Close as j, Download as oe, Plus as M, ZoomIn as N } from "@element-plus/icons-vue";
@@ -246,7 +246,7 @@ var P = { class: "picture-crop" }, F = { class: "picture-crop__stage" }, I = {
246
246
  _: 1
247
247
  }, 8, ["model-value", "title"]));
248
248
  }
249
- }), [["__scopeId", "data-v-6e23c269"]]), H = { class: "picture-upload" }, U = { class: "picture-upload__multiple-grid" }, de = ["src"], fe = ["aria-label", "onClick"], pe = {
249
+ }), [["__scopeId", "data-v-749a4dff"]]), H = { class: "picture-upload" }, U = { class: "picture-upload__multiple-grid" }, de = ["src"], fe = ["aria-label", "onClick"], pe = {
250
250
  key: 3,
251
251
  class: "picture-upload__actions"
252
252
  }, me = ["aria-label", "onClick"], he = ["aria-label", "onClick"], W = ["src"], ge = ["aria-label"], G = {
@@ -645,5 +645,5 @@ var P = { class: "picture-crop" }, F = { class: "picture-crop__stage" }, I = {
645
645
  ])
646
646
  ]));
647
647
  }
648
- }), [["__scopeId", "data-v-8c2cff09"]]);
648
+ }), [["__scopeId", "data-v-21f7ef98"]]);
649
649
  export { K as t };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./picture-upload-BrrTtaCc.js";
1
+ import { t as e } from "./picture-upload-C_10NZsL.js";
2
2
  // src/components/picture-upload/index.ts
3
3
  var t = e;
4
4
  export { e as PictureUpload, t as default };