geekplus-digital-ui 0.1.18 → 0.1.20

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 +1 @@
1
- .d-icon[data-v-b523c56c]{display:inline-flex}.d-icon[data-v-b523c56c] svg{box-sizing:content-box;display:inline-block;height:1em;overflow:visible;vertical-align:-.125em;width:1.25em}
1
+ .d-icon[data-v-29c845ca]{display:inline-flex}.d-icon[data-v-29c845ca] svg{box-sizing:content-box;display:inline-block;height:1em;overflow:visible;vertical-align:-.125em;width:1.25em}
@@ -5,12 +5,12 @@ const r = { class: "d-icon" }, s = /* @__PURE__ */ Object.assign({
5
5
  name: "DIcon"
6
6
  }, {
7
7
  __name: "icon",
8
- setup(_) {
9
- return (e, a) => (o(), t("i", r, [
8
+ setup(a) {
9
+ return (e, _) => (o(), t("i", r, [
10
10
  c(e.$slots, "default", {}, void 0, !0)
11
11
  ]));
12
12
  }
13
- }), m = /* @__PURE__ */ n(s, [["__scopeId", "data-v-b523c56c"]]);
13
+ }), m = /* @__PURE__ */ n(s, [["__scopeId", "data-v-29c845ca"]]);
14
14
  export {
15
15
  m as default
16
16
  };
@@ -13,7 +13,6 @@ export const DUpload: import('vue').DefineComponent<{}, {
13
13
  showTip: boolean;
14
14
  pasteable: boolean;
15
15
  showDownloadAll: boolean;
16
- beforeUpload?: Function;
17
16
  docType?: string;
18
17
  scrollHeight?: string;
19
18
  downloadAllMethod?: Function;
@@ -31,7 +30,6 @@ export const DUpload: import('vue').DefineComponent<{}, {
31
30
  readonly showTip?: boolean;
32
31
  readonly pasteable?: boolean;
33
32
  readonly showDownloadAll?: boolean;
34
- readonly beforeUpload?: Function;
35
33
  readonly docType?: string;
36
34
  readonly scrollHeight?: string;
37
35
  readonly downloadAllMethod?: Function;
@@ -128,13 +126,13 @@ export const DUpload: import('vue').DefineComponent<{}, {
128
126
  type: import('vue').PropType<boolean>;
129
127
  default: undefined;
130
128
  };
129
+ crossorigin: {
130
+ type: import('vue').PropType<import('element-plus').Crossorigin>;
131
+ };
131
132
  beforeUpload: {
132
133
  type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
133
134
  default: () => void;
134
135
  };
135
- crossorigin: {
136
- type: import('vue').PropType<import('element-plus').Crossorigin>;
137
- };
138
136
  beforeRemove: {
139
137
  type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
140
138
  };
@@ -295,13 +293,13 @@ export const DUpload: import('vue').DefineComponent<{}, {
295
293
  type: import('vue').PropType<boolean>;
296
294
  default: undefined;
297
295
  };
296
+ crossorigin: {
297
+ type: import('vue').PropType<import('element-plus').Crossorigin>;
298
+ };
298
299
  beforeUpload: {
299
300
  type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
300
301
  default: () => void;
301
302
  };
302
- crossorigin: {
303
- type: import('vue').PropType<import('element-plus').Crossorigin>;
304
- };
305
303
  beforeRemove: {
306
304
  type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
307
305
  };
@@ -1 +1 @@
1
- .d-upload[data-v-4214bfeb]{line-height:normal}.d-upload.is-list[data-v-4214bfeb],.d-upload.is-list .list[data-v-4214bfeb]{display:flex;flex-direction:column;gap:8px}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb]{position:relative;display:flex;align-items:center;gap:10px}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb] .el-link{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d-upload.is-list .list .list-item .file-row[data-v-4214bfeb] .el-link .el-link__inner{display:inline}.d-upload.is-list .list .list-item .file-row .remove-icon[data-v-4214bfeb]{cursor:pointer;display:none;color:var(--el-text-color-secondary)}.d-upload.is-list .list .list-item .file-row:hover .remove-icon[data-v-4214bfeb]{display:block}.d-upload.is-card[data-v-4214bfeb],.d-upload.is-card .card[data-v-4214bfeb]{display:flex;flex-wrap:wrap;gap:8px}.d-upload.is-card .card .card-item[data-v-4214bfeb]{display:flex;justify-content:center;align-items:center;font-size:16px;border:1px solid var(--el-border-color);border-radius:4px;overflow:hidden;position:relative;cursor:pointer}.d-upload.is-card .card .card-item .card-cover[data-v-4214bfeb]{display:flex;justify-content:center;align-items:center;gap:10px;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--el-overlay-color);opacity:0}.d-upload.is-card .card .card-item .card-cover .d-icon[data-v-4214bfeb]{color:var(--el-color-white)}.d-upload.is-card .card .card-item .card-cover[data-v-4214bfeb]:hover{opacity:1}.d-upload.is-card .card .el-image[data-v-4214bfeb]{width:100%;height:100%}.d-upload .expand-toggle[data-v-4214bfeb] .el-link__inner{gap:5px}.d-upload .tip[data-v-4214bfeb]{width:100%;font-size:12px;margin:0;color:var(--el-text-color-regular)}
1
+ .d-upload[data-v-10f8e9fe]{line-height:normal}.d-upload.is-list[data-v-10f8e9fe],.d-upload.is-list .list[data-v-10f8e9fe]{display:flex;flex-direction:column;gap:8px}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe]{position:relative;display:flex;align-items:center;gap:10px}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe] .el-link{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d-upload.is-list .list .list-item .file-row[data-v-10f8e9fe] .el-link .el-link__inner{display:inline}.d-upload.is-list .list .list-item .file-row .remove-icon[data-v-10f8e9fe]{cursor:pointer;display:none;color:var(--el-text-color-secondary)}.d-upload.is-list .list .list-item .file-row:hover .remove-icon[data-v-10f8e9fe]{display:block}.d-upload.is-card[data-v-10f8e9fe],.d-upload.is-card .card[data-v-10f8e9fe]{display:flex;flex-wrap:wrap;gap:8px}.d-upload.is-card .card .card-item[data-v-10f8e9fe]{display:flex;justify-content:center;align-items:center;font-size:16px;border:1px solid var(--el-border-color);border-radius:4px;overflow:hidden;position:relative;cursor:pointer}.d-upload.is-card .card .card-item .card-cover[data-v-10f8e9fe]{display:flex;justify-content:center;align-items:center;gap:10px;position:absolute;top:0;left:0;width:100%;height:100%;background:var(--el-overlay-color);opacity:0}.d-upload.is-card .card .card-item .card-cover .d-icon[data-v-10f8e9fe]{color:var(--el-color-white)}.d-upload.is-card .card .card-item .card-cover[data-v-10f8e9fe]:hover{opacity:1}.d-upload.is-card .card .el-image[data-v-10f8e9fe]{width:100%;height:100%}.d-upload .expand-toggle[data-v-10f8e9fe]{width:100%}.d-upload .expand-toggle[data-v-10f8e9fe] .el-link__inner{gap:5px}.d-upload .tip[data-v-10f8e9fe]{width:100%;font-size:12px;margin:0;color:var(--el-text-color-regular)}
@@ -13,7 +13,6 @@ declare const _default: import('vue').DefineComponent<{}, {
13
13
  showTip: boolean;
14
14
  pasteable: boolean;
15
15
  showDownloadAll: boolean;
16
- beforeUpload?: Function;
17
16
  docType?: string;
18
17
  scrollHeight?: string;
19
18
  downloadAllMethod?: Function;
@@ -31,7 +30,6 @@ declare const _default: import('vue').DefineComponent<{}, {
31
30
  readonly showTip?: boolean;
32
31
  readonly pasteable?: boolean;
33
32
  readonly showDownloadAll?: boolean;
34
- readonly beforeUpload?: Function;
35
33
  readonly docType?: string;
36
34
  readonly scrollHeight?: string;
37
35
  readonly downloadAllMethod?: Function;
@@ -128,13 +126,13 @@ declare const _default: import('vue').DefineComponent<{}, {
128
126
  type: import('vue').PropType<boolean>;
129
127
  default: undefined;
130
128
  };
129
+ crossorigin: {
130
+ type: import('vue').PropType<import('element-plus').Crossorigin>;
131
+ };
131
132
  beforeUpload: {
132
133
  type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
133
134
  default: () => void;
134
135
  };
135
- crossorigin: {
136
- type: import('vue').PropType<import('element-plus').Crossorigin>;
137
- };
138
136
  beforeRemove: {
139
137
  type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
140
138
  };
@@ -295,13 +293,13 @@ declare const _default: import('vue').DefineComponent<{}, {
295
293
  type: import('vue').PropType<boolean>;
296
294
  default: undefined;
297
295
  };
296
+ crossorigin: {
297
+ type: import('vue').PropType<import('element-plus').Crossorigin>;
298
+ };
298
299
  beforeUpload: {
299
300
  type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>>;
300
301
  default: () => void;
301
302
  };
302
- crossorigin: {
303
- type: import('vue').PropType<import('element-plus').Crossorigin>;
304
- };
305
303
  beforeRemove: {
306
304
  type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
307
305
  };
@@ -1,8 +1,8 @@
1
- import { useModel as ve, ref as y, computed as v, reactive as Ee, watch as Ve, onMounted as Ie, onBeforeUnmount as Ne, openBlock as o, createElementBlock as f, normalizeClass as Be, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as i, createElementVNode as _, createTextVNode as C, toDisplayString as k, normalizeStyle as F, Fragment as q, renderList as ye, withModifiers as he, mergeModels as ge } from "vue";
1
+ import { useModel as fe, ref as y, computed as m, reactive as Ve, watch as De, onMounted as Ee, onBeforeUnmount as Ie, openBlock as o, createElementBlock as f, normalizeClass as Ne, createVNode as d, unref as n, createBlock as c, createCommentVNode as p, withCtx as r, createElementVNode as C, createTextVNode as S, toDisplayString as k, normalizeStyle as M, Fragment as R, renderList as me, withModifiers as ve, mergeModels as ye } from "vue";
2
2
  import "../../../hooks/index.js";
3
- import { useFormItem as $e, ElMessageBox as Pe, ElMessage as O, ElUpload as je, ElImageViewer as Re, ElDialog as He, ElButton as M, ElImage as qe, ElProgress as ke, ElLink as K } from "element-plus";
3
+ import { useFormItem as Be, ElMessageBox as $e, ElMessage as H, ElUpload as je, ElImageViewer as Pe, ElDialog as Re, ElButton as F, ElImage as He, ElProgress as he, ElLink as q } from "element-plus";
4
4
  import "../../index.js";
5
- import { cloneDeep as b, isFunction as we } from "lodash-es";
5
+ import { isFunction as qe } from "lodash-es";
6
6
  import { saveAs as Oe } from "file-saver";
7
7
  import Ke from "../../icons/angle-down-light.vue.js";
8
8
  import Xe from "../../icons/angle-up-light.vue.js";
@@ -29,7 +29,7 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
29
29
  name: "DUpload"
30
30
  }, {
31
31
  __name: "upload",
32
- props: /* @__PURE__ */ ge({
32
+ props: /* @__PURE__ */ ye({
33
33
  domain: {
34
34
  type: String,
35
35
  required: !0
@@ -66,9 +66,6 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
66
66
  type: String,
67
67
  default: "card"
68
68
  },
69
- beforeUpload: {
70
- type: Function
71
- },
72
69
  docType: {
73
70
  type: String
74
71
  },
@@ -106,199 +103,199 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
106
103
  },
107
104
  uploadingCountModifiers: {}
108
105
  }),
109
- emits: /* @__PURE__ */ ge(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
110
- setup(g, { emit: xe }) {
111
- const l = g, z = xe, D = ve(g, "modelValue"), X = ve(g, "uploadingCount"), G = ["jpg", "jpeg", "png", "gif"], Se = ["mp4"], s = y([]), E = y(!1), w = y(!1), V = y(0), I = y([]), L = y(""), x = y(!1), J = y(null), Q = y(null), { t: r } = lt(), _e = at(), { formItem: W } = $e(), N = v(() => x.value ? s.value : s.value.slice(0, l.maxShow)), B = v(() => s.value.length > 0), $ = v(() => !l.disabled && !Y.value), T = v(() => l.showType === "list"), Y = v(() => s.value.length >= l.maxNumber), Ce = v(() => T.value ? "is-list" : "is-card"), Z = v(() => l.format.length ? l.format.map((t) => t.toUpperCase()) : []), ee = v(() => ({
112
- width: l.size,
113
- height: l.size
114
- })), be = v(() => l.format.map((t) => `.${t}`).join(",")), te = v(() => ({
115
- maxHeight: l.scrollHeight,
106
+ emits: /* @__PURE__ */ ye(["change", "success"], ["update:modelValue", "update:uploadingCount"]),
107
+ setup(g, { emit: ge }) {
108
+ const a = g, O = ge, K = fe(g, "modelValue"), ke = fe(g, "uploadingCount"), X = ["jpg", "jpeg", "png", "gif"], we = ["mp4"], s = y([]), z = y(!1), w = y(!1), V = y(0), D = y([]), L = y(""), x = y(!1), G = y(null), J = y(null), { t: u } = lt(), xe = at(), { formItem: _e } = Be(), E = m(() => x.value ? s.value : s.value.slice(0, a.maxShow)), I = m(() => s.value.length > 0), N = m(() => !a.disabled && !Q.value), b = m(() => a.showType === "list"), Q = m(() => s.value.length >= a.maxNumber), Ce = m(() => b.value ? "is-list" : "is-card"), W = m(() => a.format.length ? a.format.map((t) => t.toUpperCase()) : []), Y = m(() => ({
109
+ width: a.size,
110
+ height: a.size
111
+ })), Se = m(() => a.format.map((t) => `.${t}`).join(",")), Z = m(() => ({
112
+ maxHeight: a.scrollHeight,
116
113
  overflow: "auto"
117
- })), Le = v(() => {
118
- const t = l.format.length && l.format.every((e) => G.includes(e)), a = [];
119
- return l.maxSize && !t && a.push(r("d.upload.lessThan", { size: l.maxSize })), l.format.length && a.push(r("d.upload.format", { format: l.format.join("/") })), l.pasteable && a.push(r("d.upload.pasteable")), a.join(r("d.upload.comma"));
120
- }), Te = (t) => {
121
- s.value.some((e) => e.uploadStatus === "processing") || (s.value = t?.map((e) => ({
114
+ })), Le = m(() => {
115
+ const t = a.format.length && a.format.every((e) => X.includes(e)), l = [];
116
+ return a.maxSize && !t && l.push(u("d.upload.lessThan", { size: a.maxSize })), a.format.length && l.push(u("d.upload.format", { format: a.format.join("/") })), a.pasteable && l.push(u("d.upload.pasteable")), l.join(u("d.upload.comma"));
117
+ }), be = (t) => {
118
+ s.value.some((e) => e.status === "uploading") || (s.value = t?.map((e) => ({
122
119
  id: e.id,
123
120
  name: e.name || e.docName,
124
121
  docName: e.name || e.docName,
125
122
  url: e.url || e.docUrl,
126
123
  docUrl: e.url || e.docUrl,
127
- type: l.docType || e.type || e.docType,
128
- docType: l.docType || e.type || e.docType,
129
- uploadStatus: "finished"
130
- })) || []);
131
- }, P = (t) => {
124
+ type: a.docType || e.type || e.docType,
125
+ docType: a.docType || e.type || e.docType,
126
+ status: "success"
127
+ })) || [], A());
128
+ }, B = (t) => {
132
129
  if (t) {
133
- const a = t.split(".");
134
- return a[a.length - 1].toLowerCase();
130
+ const l = t.split(".");
131
+ return l[l.length - 1].toLowerCase();
135
132
  }
136
133
  return "";
137
- }, S = (t) => G.includes(P(t.name)), U = (t) => Se.includes(P(t.name)), A = (t) => t?.uploadStatus === "finished", le = (t) => !l.disabled && A(t), ae = () => {
138
- J.value?.$el.querySelector("input")?.click();
139
- }, Ue = (t) => {
140
- if (V.value = 0, I.value = [], L.value = "", S(t)) {
141
- const a = s.value.filter((e) => S(e));
142
- V.value = a.findIndex((e) => e.url === t.url), I.value = a.map((e) => e.url), E.value = !0;
134
+ }, _ = (t) => X.includes(B(t.name)), T = (t) => we.includes(B(t.name)), U = (t) => t?.status === "success", ee = (t) => !a.disabled && U(t), te = () => {
135
+ G.value?.$el.querySelector("input")?.click();
136
+ }, Te = (t) => {
137
+ if (V.value = 0, D.value = [], L.value = "", _(t)) {
138
+ const l = s.value.filter((e) => _(e));
139
+ V.value = l.findIndex((e) => e.url === t.url), D.value = l.map((e) => e.url), z.value = !0;
143
140
  }
144
- U(t) && (L.value = t.url, w.value = !0);
145
- }, oe = () => {
146
- Q.value?.pause(), w.value = !1;
147
- }, ne = (t) => {
148
- const a = () => {
149
- const u = s.value.indexOf(t);
150
- u !== -1 && (s.value.splice(u, 1), D.value = b(s.value), z("change", u, b(s.value)), W?.validate("change"));
141
+ T(t) && (L.value = t.url, w.value = !0);
142
+ }, le = () => {
143
+ J.value?.pause(), w.value = !1;
144
+ }, ae = (t) => {
145
+ const l = () => {
146
+ const i = s.value.indexOf(t);
147
+ i !== -1 && (s.value.splice(i, 1), A(), oe(t));
151
148
  }, e = async () => {
152
- if (!A(t)) {
153
- a();
149
+ if (!U(t)) {
150
+ l();
154
151
  return;
155
152
  }
156
- a();
153
+ l();
157
154
  };
158
- Pe.confirm(r("d.upload.deleteConfirm"), r("d.upload.tip"), {
155
+ $e.confirm(u("d.upload.deleteConfirm"), u("d.upload.tip"), {
159
156
  type: "warning"
160
157
  }).then(async () => {
161
158
  await e();
162
159
  }).catch(() => {
163
160
  });
164
- }, Ae = (t) => {
165
- O.success(r("d.upload.fileSuccess", { file: t.name }));
166
- const a = s.value.every((e) => e.uploadStatus === "finished");
167
- z("success", t, a);
168
- }, Fe = (t, a) => {
169
- const e = P(t.name);
161
+ }, Ue = (t, l) => {
162
+ H.success(u("d.upload.fileSuccess", { file: t.name })), O("success", t, l, s.value);
163
+ }, Ae = (t, l) => {
164
+ const e = B(t.name);
170
165
  if (e) {
171
- const u = e.toUpperCase();
172
- if (Z.value.length && !Z.value.includes(u))
173
- return a || O.error(r("d.upload.fileFormat", { file: t.name, format: l.format.join("/") })), !1;
166
+ const i = e.toUpperCase();
167
+ if (W.value.length && !W.value.includes(i))
168
+ return l || H.error(u("d.upload.fileFormat", { file: t.name, format: a.format.join("/") })), !1;
174
169
  }
175
170
  return !0;
176
- }, Me = (t) => t.size > l.maxSize * 1024 * 1024 ? (O.error(r("d.upload.fileLessThan", { file: t.name, size: l.maxSize })), !1) : !0, ze = (t, a) => {
177
- if (!a)
171
+ }, Me = (t) => t.size > a.maxSize * 1024 * 1024 ? (H.error(u("d.upload.fileLessThan", { file: t.name, size: a.maxSize })), !1) : !0, Fe = (t, l) => {
172
+ if (!l)
178
173
  return;
179
- const { loaded: e = 0, total: u = 0 } = t || {};
180
- u > 0 && (a.percentage = Math.floor(e / u * 100));
181
- }, se = (t, a) => (Fe(t, a) && Me(t) && De(t), !1), De = async (t) => {
182
- if (Y.value)
174
+ const { loaded: e = 0, total: i = 0 } = t || {};
175
+ i > 0 && (l.percentage = Math.floor(e / i * 100));
176
+ }, oe = (t) => {
177
+ K.value = s.value, O("change", t, s.value), _e?.validate("change");
178
+ }, A = () => {
179
+ ke.value = s.value.filter((t) => t.status === "uploading").length;
180
+ }, ne = (t, l) => (Ae(t, l) && Me(t) && ze(t), !1), ze = async (t) => {
181
+ if (Q.value)
183
182
  return !1;
184
- x.value || j();
185
- const a = new FormData();
186
- a.append("file", t), we(l.beforeUpload) && l.beforeUpload(t, a);
187
- const e = Ee({
188
- uploadStatus: "processing",
183
+ x.value || $();
184
+ const l = new FormData();
185
+ l.append("file", t);
186
+ const e = Ve({
187
+ status: "uploading",
189
188
  percentage: 0,
190
189
  name: t.name
191
190
  });
192
- s.value.push(e);
193
- const u = s.value.length - 1;
194
- X.value++;
195
- const m = () => s.value.indexOf(e);
191
+ s.value.push(e), A();
192
+ const i = () => s.value.indexOf(e);
196
193
  try {
197
- const { data: ce } = await l.axios({
198
- url: l.url,
194
+ const { data: v } = await a.axios({
195
+ url: a.url,
199
196
  method: "post",
200
- data: a,
201
- onUploadProgress: (H) => ze(H, e)
202
- }), R = ce?.data || ce;
203
- if (R && m() !== -1) {
197
+ data: l,
198
+ onUploadProgress: (P) => Fe(P, e)
199
+ }), j = v?.data || v;
200
+ if (j && i() !== -1) {
204
201
  const {
205
- id: H,
206
- name: pe,
207
- url: fe,
208
- type: me
209
- } = R;
202
+ id: P,
203
+ name: de,
204
+ url: ce,
205
+ type: pe
206
+ } = j;
210
207
  Object.assign(e, {
211
- id: H,
212
- name: pe,
213
- docName: pe,
214
- url: l.domain + fe,
215
- docUrl: l.domain + fe,
216
- type: l.docType || me,
217
- docType: l.docType || me,
218
- uploadStatus: "finished"
219
- }), Ae(R);
220
- } else m() !== -1 && s.value.splice(m(), 1);
208
+ id: P,
209
+ name: de,
210
+ docName: de,
211
+ url: a.domain + ce,
212
+ docUrl: a.domain + ce,
213
+ type: a.docType || pe,
214
+ docType: a.docType || pe,
215
+ status: "success"
216
+ }), Ue(j, e);
217
+ } else i() !== -1 && s.value.splice(i(), 1);
221
218
  } catch {
222
- m() !== -1 && s.value.splice(m(), 1);
219
+ i() !== -1 && s.value.splice(i(), 1);
223
220
  } finally {
224
- X.value--, D.value = b(s.value), z("change", u, b(s.value)), W?.validate("change");
221
+ A(), oe(e);
225
222
  }
226
- }, ie = (t) => {
223
+ }, se = (t) => {
227
224
  t?.url && Oe(t.url, t.name);
228
- }, j = () => {
225
+ }, $ = () => {
229
226
  x.value = !x.value;
230
- }, re = (t) => {
231
- if (!l.pasteable || l.disabled || !_e.value)
227
+ }, ie = (t) => {
228
+ if (!a.pasteable || a.disabled || !xe.value)
232
229
  return;
233
- const a = t.clipboardData?.items || [];
234
- for (let e = 0; e < a.length; e++) {
235
- const m = a[e].getAsFile();
236
- m && se(m, !0);
230
+ const l = t.clipboardData?.items || [];
231
+ for (let e = 0; e < l.length; e++) {
232
+ const v = l[e].getAsFile();
233
+ v && ne(v, !0);
237
234
  }
238
- }, ue = (t) => {
239
- !B.value || !t?.url || (S(t) || U(t) ? Ue(t) : ie(t));
240
- }, de = () => {
241
- we(l.downloadAllMethod) ? l.downloadAllMethod(b(s.value)) : s.value.forEach((t) => {
242
- ie(t);
235
+ }, re = (t) => {
236
+ !I.value || !t?.url || (_(t) || T(t) ? Te(t) : se(t));
237
+ }, ue = () => {
238
+ qe(a.downloadAllMethod) ? a.downloadAllMethod(s.value) : s.value.forEach((t) => {
239
+ se(t);
243
240
  });
244
241
  };
245
- return Ve(
246
- D,
242
+ return De(
243
+ K,
247
244
  (t) => {
248
- Te(t);
245
+ be(t);
249
246
  },
250
247
  { immediate: !0 }
251
- ), Ie(() => {
252
- document.addEventListener("paste", re);
253
- }), Ne(() => {
254
- document.removeEventListener("paste", re);
255
- }), (t, a) => (o(), f("div", {
256
- class: Be(["d-upload", Ce.value])
248
+ ), Ee(() => {
249
+ document.addEventListener("paste", ie);
250
+ }), Ie(() => {
251
+ document.removeEventListener("paste", ie);
252
+ }), (t, l) => (o(), f("div", {
253
+ class: Ne(["d-upload", Ce.value])
257
254
  }, [
258
255
  d(n(je), {
259
256
  ref_key: "uploadRef",
260
- ref: J,
257
+ ref: G,
261
258
  style: { display: "none" },
262
259
  "show-file-list": !1,
263
260
  "file-list": s.value,
264
- accept: be.value,
265
- "before-upload": se,
261
+ accept: Se.value,
262
+ "before-upload": ne,
266
263
  "with-credentials": "",
267
264
  multiple: "",
268
265
  action: "/"
269
266
  }, null, 8, ["file-list", "accept"]),
270
- E.value ? (o(), c(n(Re), {
267
+ z.value ? (o(), c(n(Pe), {
271
268
  key: 0,
272
- "url-list": I.value,
269
+ "url-list": D.value,
273
270
  "initial-index": V.value,
274
271
  "hide-on-click-modal": "",
275
272
  teleported: "",
276
- onClose: a[0] || (a[0] = (e) => E.value = !1)
273
+ onClose: l[0] || (l[0] = (e) => z.value = !1)
277
274
  }, null, 8, ["url-list", "initial-index"])) : p("", !0),
278
- w.value ? (o(), c(n(He), {
275
+ w.value ? (o(), c(n(Re), {
279
276
  key: 1,
280
277
  modelValue: w.value,
281
- "onUpdate:modelValue": a[1] || (a[1] = (e) => w.value = e),
282
- title: n(r)("d.upload.preview"),
278
+ "onUpdate:modelValue": l[1] || (l[1] = (e) => w.value = e),
279
+ title: n(u)("d.upload.preview"),
283
280
  width: "1200px",
284
281
  "align-center": "",
285
- "before-close": oe,
282
+ "before-close": le,
286
283
  "append-to-body": ""
287
284
  }, {
288
- footer: i(() => [
289
- d(n(M), { onClick: oe }, {
290
- default: i(() => [
291
- C(k(n(r)("d.upload.close")), 1)
285
+ footer: r(() => [
286
+ d(n(F), { onClick: le }, {
287
+ default: r(() => [
288
+ S(k(n(u)("d.upload.close")), 1)
292
289
  ]),
293
290
  _: 1
294
291
  })
295
292
  ]),
296
- default: i(() => [
297
- _("div", ot, [
293
+ default: r(() => [
294
+ C("div", ot, [
298
295
  L.value ? (o(), f("video", {
299
296
  key: 0,
300
297
  ref_key: "videoRef",
301
- ref: Q,
298
+ ref: J,
302
299
  src: L.value,
303
300
  controls: "",
304
301
  class: "preview-video"
@@ -307,90 +304,90 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
307
304
  ]),
308
305
  _: 1
309
306
  }, 8, ["modelValue", "title"])) : p("", !0),
310
- T.value ? (o(), f("div", st, [
311
- $.value ? (o(), c(n(M), {
307
+ b.value ? (o(), f("div", st, [
308
+ N.value ? (o(), c(n(F), {
312
309
  key: 0,
313
- onClick: ae
310
+ onClick: te
314
311
  }, {
315
- default: i(() => [
316
- C(k(n(r)("d.upload.upload")), 1)
312
+ default: r(() => [
313
+ S(k(n(u)("d.upload.upload")), 1)
317
314
  ]),
318
315
  _: 1
319
316
  })) : p("", !0),
320
- g.showDownloadAll && B.value ? (o(), c(n(M), {
317
+ g.showDownloadAll && I.value ? (o(), c(n(F), {
321
318
  key: 1,
322
319
  type: "primary",
323
320
  link: "",
324
- onClick: de
321
+ onClick: ue
325
322
  }, {
326
- default: i(() => [
327
- C(k(n(r)("d.upload.downloadAll")), 1)
323
+ default: r(() => [
324
+ S(k(n(u)("d.upload.downloadAll")), 1)
328
325
  ]),
329
326
  _: 1
330
327
  })) : p("", !0)
331
328
  ])) : p("", !0),
332
- T.value ? p("", !0) : (o(), f("div", {
329
+ b.value ? p("", !0) : (o(), f("div", {
333
330
  key: 3,
334
331
  class: "card",
335
- style: F(te.value)
332
+ style: M(Z.value)
336
333
  }, [
337
- g.showDownloadAll && B.value ? (o(), f("div", it, [
338
- d(n(M), {
334
+ g.showDownloadAll && I.value ? (o(), f("div", it, [
335
+ d(n(F), {
339
336
  type: "primary",
340
337
  link: "",
341
- onClick: de
338
+ onClick: ue
342
339
  }, {
343
- default: i(() => [
344
- C(k(n(r)("d.upload.downloadAll")), 1)
340
+ default: r(() => [
341
+ S(k(n(u)("d.upload.downloadAll")), 1)
345
342
  ]),
346
343
  _: 1
347
344
  })
348
345
  ])) : p("", !0),
349
- (o(!0), f(q, null, ye(N.value, (e, u) => (o(), f("div", {
350
- key: e.id || `${e.name}-${u}`,
346
+ (o(!0), f(R, null, me(E.value, (e, i) => (o(), f("div", {
347
+ key: e.id || `${e.name}-${i}`,
351
348
  class: "card-item",
352
- style: F(ee.value),
353
- onClick: (m) => ue(e)
349
+ style: M(Y.value),
350
+ onClick: (v) => re(e)
354
351
  }, [
355
- A(e) ? (o(), f(q, { key: 0 }, [
356
- S(e) ? (o(), c(n(qe), {
352
+ U(e) ? (o(), f(R, { key: 0 }, [
353
+ _(e) ? (o(), c(n(He), {
357
354
  key: 0,
358
355
  src: e.url,
359
356
  fit: "cover"
360
- }, null, 8, ["src"])) : U(e) ? (o(), c(n(h), { key: 1 }, {
361
- default: i(() => [
357
+ }, null, 8, ["src"])) : T(e) ? (o(), c(n(h), { key: 1 }, {
358
+ default: r(() => [
362
359
  d(Ge)
363
360
  ]),
364
361
  _: 1
365
362
  })) : (o(), c(n(h), { key: 2 }, {
366
- default: i(() => [
363
+ default: r(() => [
367
364
  d(Ye)
368
365
  ]),
369
366
  _: 1
370
367
  })),
371
- _("div", ut, [
372
- S(e) || U(e) ? (o(), c(n(h), { key: 0 }, {
373
- default: i(() => [
368
+ C("div", ut, [
369
+ _(e) || T(e) ? (o(), c(n(h), { key: 0 }, {
370
+ default: r(() => [
374
371
  d(We)
375
372
  ]),
376
373
  _: 1
377
374
  })) : (o(), c(n(h), { key: 1 }, {
378
- default: i(() => [
375
+ default: r(() => [
379
376
  d(Qe)
380
377
  ]),
381
378
  _: 1
382
379
  })),
383
- le(e) ? (o(), c(n(h), {
380
+ ee(e) ? (o(), c(n(h), {
384
381
  key: 2,
385
- onClick: he((m) => ne(e), ["stop"])
382
+ onClick: ve((v) => ae(e), ["stop"])
386
383
  }, {
387
- default: i(() => [
384
+ default: r(() => [
388
385
  d(et)
389
386
  ]),
390
387
  _: 1
391
388
  }, 8, ["onClick"])) : p("", !0)
392
389
  ])
393
- ], 64)) : (o(), c(n(ke), {
390
+ ], 64)) : (o(), c(n(he), {
394
391
  key: 1,
395
392
  style: { width: "80%" },
396
393
  percentage: e.percentage,
@@ -398,57 +395,57 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
398
395
  "show-text": !1
399
396
  }, null, 8, ["percentage"]))
400
397
  ], 12, rt))), 128)),
401
- $.value ? (o(), f("div", {
398
+ N.value ? (o(), f("div", {
402
399
  key: 1,
403
400
  class: "card-item",
404
- style: F(ee.value),
405
- onClick: ae
401
+ style: M(Y.value),
402
+ onClick: te
406
403
  }, [
407
404
  d(n(h), null, {
408
- default: i(() => [
405
+ default: r(() => [
409
406
  d(Ze)
410
407
  ]),
411
408
  _: 1
412
409
  })
413
410
  ], 4)) : p("", !0)
414
411
  ], 4)),
415
- $.value && g.showTip ? (o(), f("p", {
412
+ N.value && g.showTip ? (o(), f("p", {
416
413
  key: 4,
417
414
  class: "tip",
418
415
  innerHTML: Le.value
419
416
  }, null, 8, dt)) : p("", !0),
420
- T.value && N.value.length ? (o(), f("div", {
417
+ b.value && E.value.length ? (o(), f("div", {
421
418
  key: 5,
422
- style: F(te.value),
419
+ style: M(Z.value),
423
420
  class: "list"
424
421
  }, [
425
- (o(!0), f(q, null, ye(N.value, (e, u) => (o(), f("div", {
426
- key: e.id || `${e.name}-${u}`,
422
+ (o(!0), f(R, null, me(E.value, (e, i) => (o(), f("div", {
423
+ key: e.id || `${e.name}-${i}`,
427
424
  class: "list-item"
428
425
  }, [
429
- _("div", ct, [
430
- d(n(K), {
426
+ C("div", ct, [
427
+ d(n(q), {
431
428
  type: "primary",
432
429
  underline: "never",
433
- onClick: (m) => ue(e)
430
+ onClick: (v) => re(e)
434
431
  }, {
435
- default: i(() => [
436
- C(k(e.name), 1)
432
+ default: r(() => [
433
+ S(k(e.name), 1)
437
434
  ]),
438
435
  _: 2
439
436
  }, 1032, ["onClick"]),
440
- le(e) ? (o(), c(n(h), {
437
+ ee(e) ? (o(), c(n(h), {
441
438
  key: 0,
442
439
  class: "remove-icon",
443
- onClick: he((m) => ne(e), ["stop"])
440
+ onClick: ve((v) => ae(e), ["stop"])
444
441
  }, {
445
- default: i(() => [
442
+ default: r(() => [
446
443
  d(Je)
447
444
  ]),
448
445
  _: 1
449
446
  }, 8, ["onClick"])) : p("", !0)
450
447
  ]),
451
- A(e) ? p("", !0) : (o(), c(n(ke), {
448
+ U(e) ? p("", !0) : (o(), c(n(he), {
452
449
  key: 0,
453
450
  percentage: e.percentage,
454
451
  "stroke-width": 8
@@ -456,32 +453,32 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
456
453
  ]))), 128))
457
454
  ], 4)) : p("", !0),
458
455
  s.value.length > g.maxShow ? (o(), f("div", pt, [
459
- x.value ? (o(), c(n(K), {
456
+ x.value ? (o(), c(n(q), {
460
457
  key: 0,
461
458
  type: "primary",
462
459
  underline: "never",
463
- onClick: j
460
+ onClick: $
464
461
  }, {
465
- default: i(() => [
466
- _("span", null, k(n(r)("d.upload.collapse")), 1),
462
+ default: r(() => [
463
+ C("span", null, k(n(u)("d.upload.collapse")), 1),
467
464
  d(n(h), null, {
468
- default: i(() => [
465
+ default: r(() => [
469
466
  d(Xe)
470
467
  ]),
471
468
  _: 1
472
469
  })
473
470
  ]),
474
471
  _: 1
475
- })) : (o(), c(n(K), {
472
+ })) : (o(), c(n(q), {
476
473
  key: 1,
477
474
  type: "primary",
478
475
  underline: "never",
479
- onClick: j
476
+ onClick: $
480
477
  }, {
481
- default: i(() => [
482
- _("span", null, k(n(r)("d.upload.expand")), 1),
478
+ default: r(() => [
479
+ C("span", null, k(n(u)("d.upload.expand")), 1),
483
480
  d(n(h), null, {
484
- default: i(() => [
481
+ default: r(() => [
485
482
  d(Ke)
486
483
  ]),
487
484
  _: 1
@@ -492,7 +489,7 @@ const ot = { class: "d-upload__preview" }, nt = ["src"], st = { key: 2 }, it = {
492
489
  ])) : p("", !0)
493
490
  ], 2));
494
491
  }
495
- }), Vt = /* @__PURE__ */ tt(ft, [["__scopeId", "data-v-4214bfeb"]]);
492
+ }), Et = /* @__PURE__ */ tt(ft, [["__scopeId", "data-v-10f8e9fe"]]);
496
493
  export {
497
- Vt as default
494
+ Et as default
498
495
  };
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
- {
2
- "name": "geekplus-digital-ui",
3
- "version": "0.1.18",
4
- "type": "module",
5
- "main": "index.js",
6
- "module": "index.js",
7
- "types": "index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./index.d.ts",
11
- "import": "./index.js"
12
- },
13
- "./*": {
14
- "types": "./*.d.ts",
15
- "import": "./*.js"
16
- }
17
- },
18
- "sideEffects": [
19
- "**/*.css"
20
- ],
21
- "dependencies": {
22
- "@vueuse/core": "^14.2.1",
23
- "file-saver": "^2.0.5",
24
- "lodash-es": "^4.17.23",
25
- "vue-i18n": "^11.2.8"
26
- },
27
- "peerDependencies": {
28
- "element-plus": "^2.13.2",
29
- "vue": "^3.5.27"
30
- }
31
- }
1
+ {
2
+ "name": "geekplus-digital-ui",
3
+ "version": "0.1.20",
4
+ "type": "module",
5
+ "main": "index.js",
6
+ "module": "index.js",
7
+ "types": "index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "import": "./index.js"
12
+ },
13
+ "./*": {
14
+ "types": "./*.d.ts",
15
+ "import": "./*.js"
16
+ }
17
+ },
18
+ "sideEffects": [
19
+ "**/*.css"
20
+ ],
21
+ "dependencies": {
22
+ "@vueuse/core": "^14.2.1",
23
+ "file-saver": "^2.0.5",
24
+ "lodash-es": "^4.17.23",
25
+ "vue-i18n": "^11.2.8"
26
+ },
27
+ "peerDependencies": {
28
+ "element-plus": "^2.13.2",
29
+ "vue": "^3.5.27"
30
+ }
31
+ }