@aplus-frontend/ui 7.10.5 → 7.11.0

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 (105) hide show
  1. package/es/index.mjs +93 -91
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +75 -63
  3. package/es/src/ag-grid/editable/index.vue.mjs +80 -72
  4. package/es/src/ag-grid/editable/interface.d.ts +2 -1
  5. package/es/src/ag-grid/editable/utils.d.ts +7 -0
  6. package/es/src/ag-grid/editable/utils.mjs +32 -17
  7. package/es/src/ap-form/ap-form.vue2.mjs +144 -153
  8. package/es/src/ap-form/utils/transform.d.ts +6 -0
  9. package/es/src/ap-form/utils/transform.mjs +30 -0
  10. package/es/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  11. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +147 -110
  12. package/es/src/business/ap-appendix/interface.d.ts +4 -0
  13. package/es/src/business/ap-appendix/style/index.mjs +56 -34
  14. package/es/src/business/ap-attachment/ApAttachment.mjs +112 -89
  15. package/es/src/business/ap-attachment/style/index.mjs +21 -7
  16. package/es/src/business/ap-file-preview/ap-file-preview.vue.d.ts +4 -0
  17. package/es/src/business/ap-file-preview/ap-file-preview.vue.mjs +4 -0
  18. package/es/src/business/ap-file-preview/ap-file-preview.vue2.mjs +103 -0
  19. package/es/src/business/ap-file-preview/components/error-result/index.vue.d.ts +6 -0
  20. package/es/src/business/ap-file-preview/components/error-result/index.vue.mjs +4 -0
  21. package/es/src/business/ap-file-preview/components/error-result/index.vue2.mjs +40 -0
  22. package/es/src/business/ap-file-preview/icons/not-exist-icon.vue.d.ts +3 -0
  23. package/es/src/business/ap-file-preview/icons/not-exist-icon.vue.mjs +20 -0
  24. package/es/src/business/ap-file-preview/icons/not-preview-icon.vue.d.ts +3 -0
  25. package/es/src/business/ap-file-preview/icons/not-preview-icon.vue.mjs +20 -0
  26. package/es/src/business/ap-file-preview/index.d.ts +7 -0
  27. package/es/src/business/ap-file-preview/index.mjs +8 -0
  28. package/es/src/business/ap-file-preview/interface.d.ts +43 -0
  29. package/es/src/business/ap-file-preview/style/index.d.ts +5 -0
  30. package/es/src/business/ap-file-preview/style/index.mjs +46 -0
  31. package/es/src/business/ap-file-preview/utils/create-file-preview-modal.d.ts +2 -0
  32. package/es/src/business/ap-file-preview/utils/create-file-preview-modal.mjs +18 -0
  33. package/es/src/business/ap-file-preview/utils/default-parser-plugin.d.ts +4 -0
  34. package/es/src/business/ap-file-preview/utils/default-parser-plugin.mjs +48 -0
  35. package/es/src/business/ap-image/ApImage.vue2.mjs +16 -16
  36. package/es/src/business/ap-upload/apUpload.vue.d.ts +1 -1
  37. package/es/src/business/ap-upload/apUploadTypes.d.ts +2 -2
  38. package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +94 -82
  39. package/es/src/business/ap-upload/style/multiple-file.mjs +6 -3
  40. package/es/src/business/index.d.ts +1 -0
  41. package/es/src/business/index.mjs +16 -14
  42. package/es/src/config-provider/config-provider-props.d.ts +6 -0
  43. package/es/src/config-provider/config-provider-props.mjs +6 -2
  44. package/es/src/config-provider/config-provider.d.ts +17 -1
  45. package/es/src/config-provider/config-provider.mjs +24 -23
  46. package/es/src/config-provider/hooks/use-global-config.d.ts +7 -0
  47. package/es/src/config-provider/index.d.ts +31 -3
  48. package/es/src/index.mjs +74 -72
  49. package/es/src/locale/lang/en.mjs +5 -0
  50. package/es/src/locale/lang/zh-cn.mjs +5 -0
  51. package/es/src/version.d.ts +1 -1
  52. package/es/src/version.mjs +1 -1
  53. package/lib/index.js +1 -1
  54. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  55. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  56. package/lib/src/ag-grid/editable/interface.d.ts +2 -1
  57. package/lib/src/ag-grid/editable/utils.d.ts +7 -0
  58. package/lib/src/ag-grid/editable/utils.js +1 -1
  59. package/lib/src/ap-form/ap-form.vue2.js +1 -1
  60. package/lib/src/ap-form/utils/transform.d.ts +6 -0
  61. package/lib/src/ap-form/utils/transform.js +1 -0
  62. package/lib/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  63. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  64. package/lib/src/business/ap-appendix/interface.d.ts +4 -0
  65. package/lib/src/business/ap-appendix/style/index.js +1 -1
  66. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  67. package/lib/src/business/ap-attachment/style/index.js +1 -1
  68. package/lib/src/business/ap-file-preview/ap-file-preview.vue.d.ts +4 -0
  69. package/lib/src/business/ap-file-preview/ap-file-preview.vue.js +1 -0
  70. package/lib/src/business/ap-file-preview/ap-file-preview.vue2.js +1 -0
  71. package/lib/src/business/ap-file-preview/components/error-result/index.vue.d.ts +6 -0
  72. package/lib/src/business/ap-file-preview/components/error-result/index.vue.js +1 -0
  73. package/lib/src/business/ap-file-preview/components/error-result/index.vue2.js +1 -0
  74. package/lib/src/business/ap-file-preview/icons/not-exist-icon.vue.d.ts +3 -0
  75. package/lib/src/business/ap-file-preview/icons/not-exist-icon.vue.js +1 -0
  76. package/lib/src/business/ap-file-preview/icons/not-preview-icon.vue.d.ts +3 -0
  77. package/lib/src/business/ap-file-preview/icons/not-preview-icon.vue.js +1 -0
  78. package/lib/src/business/ap-file-preview/index.d.ts +7 -0
  79. package/lib/src/business/ap-file-preview/index.js +1 -0
  80. package/lib/src/business/ap-file-preview/interface.d.ts +43 -0
  81. package/lib/src/business/ap-file-preview/style/index.d.ts +5 -0
  82. package/lib/src/business/ap-file-preview/style/index.js +1 -0
  83. package/lib/src/business/ap-file-preview/utils/create-file-preview-modal.d.ts +2 -0
  84. package/lib/src/business/ap-file-preview/utils/create-file-preview-modal.js +1 -0
  85. package/lib/src/business/ap-file-preview/utils/default-parser-plugin.d.ts +4 -0
  86. package/lib/src/business/ap-file-preview/utils/default-parser-plugin.js +1 -0
  87. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  88. package/lib/src/business/ap-upload/apUpload.vue.d.ts +1 -1
  89. package/lib/src/business/ap-upload/apUploadTypes.d.ts +2 -2
  90. package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
  91. package/lib/src/business/ap-upload/style/multiple-file.js +1 -1
  92. package/lib/src/business/index.d.ts +1 -0
  93. package/lib/src/business/index.js +1 -1
  94. package/lib/src/config-provider/config-provider-props.d.ts +6 -0
  95. package/lib/src/config-provider/config-provider-props.js +1 -1
  96. package/lib/src/config-provider/config-provider.d.ts +17 -1
  97. package/lib/src/config-provider/config-provider.js +1 -1
  98. package/lib/src/config-provider/hooks/use-global-config.d.ts +7 -0
  99. package/lib/src/config-provider/index.d.ts +31 -3
  100. package/lib/src/index.js +1 -1
  101. package/lib/src/locale/lang/en.js +1 -1
  102. package/lib/src/locale/lang/zh-cn.js +1 -1
  103. package/lib/src/version.d.ts +1 -1
  104. package/lib/src/version.js +1 -1
  105. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { createVNode as r } from "vue";
2
+ import { omit as o } from "lodash-unified";
3
+ import { ApModal as t } from "../../../ap-modal/index.mjs";
4
+ import { ApFilePreview as l } from "../index.mjs";
5
+ const f = (e) => {
6
+ t.createModal({
7
+ title: e?.fileName ?? "File Preview",
8
+ width: "90%",
9
+ wrapperOffset: !0,
10
+ wrapperFullHeight: !0,
11
+ footer: null,
12
+ content: r(l, o(e, "modalProps"), null),
13
+ ...e?.modalProps
14
+ });
15
+ };
16
+ export {
17
+ f as createFilePreviewModal
18
+ };
@@ -0,0 +1,4 @@
1
+ import { ApFilePreviewParser } from '../interface';
2
+ export declare const iframeParser: ApFilePreviewParser;
3
+ export declare const imgParser: ApFilePreviewParser;
4
+ export declare const defaultParserPlugins: ApFilePreviewParser[];
@@ -0,0 +1,48 @@
1
+ import { createVNode as r } from "vue";
2
+ import { ApImage as t } from "../../ap-image/index.mjs";
3
+ const a = {
4
+ format: [
5
+ // DPF
6
+ "pdf",
7
+ // 视频
8
+ "mp4",
9
+ "webm",
10
+ "ogg",
11
+ "ogv",
12
+ // 音频
13
+ "mp3",
14
+ "wav",
15
+ "ogg",
16
+ "oga",
17
+ "m4a",
18
+ "aac"
19
+ ],
20
+ parser: ({
21
+ src: e
22
+ }) => r("iframe", {
23
+ src: e,
24
+ style: {
25
+ width: "100%",
26
+ height: "100%",
27
+ border: "none"
28
+ }
29
+ }, null)
30
+ }, i = {
31
+ format: ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "tiff", "tif", "avif", "heif", "heic"],
32
+ parser: ({
33
+ src: e
34
+ }) => r(t, {
35
+ src: e,
36
+ width: "100%",
37
+ height: "100%",
38
+ preview: !1,
39
+ style: {
40
+ "object-fit": "contain"
41
+ }
42
+ }, null)
43
+ }, g = [a, i];
44
+ export {
45
+ g as defaultParserPlugins,
46
+ a as iframeParser,
47
+ i as imgParser
48
+ };
@@ -1,4 +1,4 @@
1
- import { defineComponent as S, computed as n, ref as j, watchEffect as B, createBlock as h, openBlock as i, unref as o, mergeProps as v, withCtx as E, renderSlot as F, normalizeProps as L, guardReactiveProps as U, createElementVNode as b, normalizeClass as W, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
1
+ import { defineComponent as S, computed as l, ref as W, watchEffect as j, createBlock as h, openBlock as i, unref as o, mergeProps as b, withCtx as B, renderSlot as E, normalizeProps as F, guardReactiveProps as L, createElementVNode as v, normalizeClass as U, createElementBlock as x, Fragment as D, renderList as P, resolveDynamicComponent as R, createVNode as T } from "vue";
2
2
  import { DownloadOutlined as z } from "@ant-design/icons-vue";
3
3
  import { Image as V } from "@aplus-frontend/antdv";
4
4
  import { omit as $ } from "lodash-unified";
@@ -29,28 +29,28 @@ const ue = /* @__PURE__ */ S({
29
29
  admin: J
30
30
  }, w = m("apImage", { uiMode: "aplus" }), C = m("apUpload"), f = m(
31
31
  "downloadCenterTriggerConfig"
32
- ), O = n(
32
+ ), O = l(
33
33
  () => e.uiMode || w.value?.uiMode
34
- ), { t: y, lang: A } = Y(), g = n(
34
+ ), { t: y, lang: A } = Y(), g = l(
35
35
  () => e.getOssAccess || C.value?.getOssAccess
36
- ), N = n(
36
+ ), N = l(
37
37
  () => d[O.value] || d.aplus
38
- ), I = n(() => e?.fallback || N.value), s = j("");
39
- G(y, A), B(async () => {
38
+ ), I = l(() => e?.fallback || N.value), s = W("");
39
+ G(y, A), j(async () => {
40
40
  if (!e?.src) {
41
41
  s.value = "";
42
42
  return;
43
43
  }
44
- if (e.src?.startsWith("http") || e.src?.startsWith("data:")) {
44
+ if (e.src?.startsWith("http") || e.src?.startsWith("data:") || e.src?.startsWith("blob:")) {
45
45
  s.value = e.src;
46
46
  return;
47
47
  }
48
48
  try {
49
- const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src, l = await q(
49
+ const a = e.src?.match(/^([^:]+):(.*)$/), r = a?.[1], t = a?.[2] ?? e.src, n = await q(
50
50
  () => r ? g.value?.(r) : g.value?.(),
51
51
  r
52
52
  ), c = await H({
53
- oss: l,
53
+ oss: n,
54
54
  fileName: t
55
55
  });
56
56
  c && (s.value = c);
@@ -80,20 +80,20 @@ const ue = /* @__PURE__ */ S({
80
80
  const t = document.createElement("a");
81
81
  t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", r), document.body.appendChild(t), t.click(), document.body.removeChild(t);
82
82
  };
83
- return (a, r) => (i(), h(o(V), v({
83
+ return (a, r) => (i(), h(o(V), b({
84
84
  class: [o(u)(), o(p)]
85
85
  }, {
86
86
  ...o($)(e, ["src", "getOssAccess"]),
87
87
  fallback: I.value,
88
88
  src: s.value
89
89
  }), {
90
- toolbarRender: E((t) => [
91
- F(a.$slots, "toolbarRender", L(U({ ...t })), () => [
92
- b("div", {
93
- class: W([o(u)("toolbar"), o(p)])
90
+ toolbarRender: B((t) => [
91
+ E(a.$slots, "toolbarRender", F(L({ ...t })), () => [
92
+ v("div", {
93
+ class: U([o(u)("toolbar"), o(p)])
94
94
  }, [
95
- (i(!0), x(D, null, P(t.originalNodes, (l, c) => (i(), h(R(l), v({ ref_for: !0 }, e, { key: c }), null, 16))), 128)),
96
- b("div", {
95
+ (i(!0), x(D, null, P(t.originalNodes, (n, c) => (i(), h(R(n), b({ ref_for: !0 }, e, { key: c }), null, 16))), 128)),
96
+ v("div", {
97
97
  class: "ant-image-preview-operations-operation",
98
98
  onClick: _
99
99
  }, [
@@ -189,8 +189,8 @@ declare const __VLS_component: DefineComponent<ExtractPropTypes<{
189
189
  value: string | unknown[] | Record<string, any>;
190
190
  maxCount: number;
191
191
  maxSize: number;
192
- needName: boolean | Record<string, any>;
193
192
  getOssAccess: GetOssAccess;
193
+ needName: boolean | Record<string, any>;
194
194
  accept: string;
195
195
  beforeUpload: BeforeUpload;
196
196
  onRemove: Function;
@@ -70,7 +70,7 @@ export type SingleFileProps = FileUploadProps & {
70
70
  /**
71
71
  * 副标题
72
72
  */
73
- subTitle?: string;
73
+ subTitle?: string | null;
74
74
  };
75
75
  export type MultipleFileProps = FileUploadProps & {
76
76
  /**
@@ -80,7 +80,7 @@ export type MultipleFileProps = FileUploadProps & {
80
80
  /**
81
81
  * 副标题
82
82
  */
83
- subTitle?: string | VNode;
83
+ subTitle?: string | VNode | null;
84
84
  /**
85
85
  * 限制上传数量
86
86
  */
@@ -1,45 +1,47 @@
1
- import { defineComponent as Y, inject as a, ref as Z, watch as ee, nextTick as oe, createElementBlock as b, openBlock as x, normalizeClass as te, unref as n, createVNode as y, withCtx as U, createElementVNode as S, createTextVNode as ae, toDisplayString as L, withModifiers as se, createCommentVNode as ne, createBlock as re, resolveDynamicComponent as le } from "vue";
2
- import { UploadOutlined as ie, VerticalAlignBottomOutlined as ce } from "@ant-design/icons-vue";
1
+ import { defineComponent as Z, inject as a, ref as ee, watch as oe, nextTick as te, createElementBlock as C, openBlock as x, normalizeClass as ae, unref as n, createVNode as y, withCtx as N, createElementVNode as P, createTextVNode as se, toDisplayString as L, withModifiers as ne, createCommentVNode as re, createBlock as ie, resolveDynamicComponent as le } from "vue";
2
+ import { UploadOutlined as ce } from "@ant-design/icons-vue";
3
3
  import { message as p, Upload as ue, Button as pe } from "@aplus-frontend/antdv";
4
+ import { IconApAdLineDownload as me } from "@aplus-frontend/icon";
5
+ import { ApFilePreview as de } from "../../ap-file-preview/index.mjs";
4
6
  import "../../../config-provider/index.mjs";
5
- import { useOss as de, getOssInstance as z } from "../hooks/useOss.mjs";
6
- import me from "../style/index.mjs";
7
- import { fileMatchesAccept as fe, getAcceptText as ge } from "../utils/accept.mjs";
8
- import { getPath as he, getName as ve, getReturnData as B } from "../utils/returnData.mjs";
9
- import { useGlobalConfig as we } from "../../../config-provider/hooks/use-global-config.mjs";
10
- import { useLocale as xe } from "../../../config-provider/hooks/use-locale.mjs";
11
- import { useNamespace as ye } from "../../../config-provider/hooks/use-namespace.mjs";
12
- const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 }, ze = /* @__PURE__ */ Y({
7
+ import { useOss as fe, getOssInstance as S } from "../hooks/useOss.mjs";
8
+ import ge from "../style/index.mjs";
9
+ import { fileMatchesAccept as ve, getAcceptText as we } from "../utils/accept.mjs";
10
+ import { getPath as he, getName as xe, getReturnData as D } from "../utils/returnData.mjs";
11
+ import { useGlobalConfig as ye } from "../../../config-provider/hooks/use-global-config.mjs";
12
+ import { useLocale as ke } from "../../../config-provider/hooks/use-locale.mjs";
13
+ import { useNamespace as be } from "../../../config-provider/hooks/use-namespace.mjs";
14
+ const Ce = { class: "multiple-file-context" }, Ne = { key: 0 }, Ue = { key: 1 }, Oe = /* @__PURE__ */ Z({
13
15
  __name: "MultipleFile",
14
- setup(Ue, { expose: D }) {
15
- const N = we(
16
+ setup(Ee, { expose: z }) {
17
+ const U = ye(
16
18
  "downloadCenterTriggerConfig"
17
- ), { t: l } = xe(), { b: O } = ye("ap-upload-multiple-file"), P = me("ap-upload"), { put: V } = de(), q = a("dirName"), j = a("baseDirName"), k = a("accept") || "*", E = a("maxSize") ?? 500, $ = a("title") || l("ap.apUpload.uploadFile"), f = a("subTitle"), i = a("maxCount") ?? 10, d = a("uploadingCount"), _ = a("beforeUpload"), F = a("customRequest"), g = a("getOssAccess"), G = a("maxSizeErrorMsg"), W = a("maxCountErrorMsg"), H = a("acceptErrorMsg"), T = a("onRemove"), C = a("showUploadErrorMsg"), A = a("bucket"), r = a("value"), c = [], h = a("needName"), m = Z(null);
18
- ee(
19
+ ), { t: i } = ke(), { b: B } = be("ap-upload-multiple-file"), O = ge("ap-upload"), { put: V } = fe(), q = a("dirName"), j = a("baseDirName"), k = a("accept") || "*", E = a("maxSize") ?? 500, $ = a("title") || i("ap.apUpload.uploadFile"), f = a("subTitle"), l = a("maxCount") ?? 10, m = a("uploadingCount"), F = a("beforeUpload"), A = a("customRequest"), g = a("getOssAccess"), G = a("maxSizeErrorMsg"), W = a("maxCountErrorMsg"), H = a("acceptErrorMsg"), _ = a("onRemove"), b = a("showUploadErrorMsg"), T = a("bucket"), r = a("value"), c = [], v = a("needName"), d = ee(null);
20
+ oe(
19
21
  () => r?.value,
20
22
  function(e) {
21
- !m?.value?.fileList?.length && e && R(e);
23
+ !d?.value?.fileList?.length && e && I(e);
22
24
  },
23
25
  { immediate: !0 }
24
26
  );
25
- function R(e) {
27
+ function I(e) {
26
28
  if (!e) {
27
- u = [], m.value.fileList = [], r.value = void 0, c.splice(0, c.length);
29
+ u = [], d.value.fileList = [], r.value = void 0, c.splice(0, c.length);
28
30
  return;
29
31
  }
30
- oe(() => {
32
+ te(() => {
31
33
  const o = e.map((t) => {
32
- const s = he(h, t), M = ve(h, t), w = new File(
34
+ const s = he(v, t), M = xe(v, t), h = new File(
33
35
  [t],
34
36
  M,
35
37
  {}
36
38
  );
37
- return w.response = s, w.uid = s, w.status = "done", w;
39
+ return h.response = s, h.uid = s, h.status = "done", h;
38
40
  });
39
- if (i && o.length > i) {
41
+ if (l && o.length > l) {
40
42
  p.warning(
41
- l("ap.apUpload.fileInitializationException", {
42
- maxCount: i
43
+ i("ap.apUpload.fileInitializationException", {
44
+ maxCount: l
43
45
  })
44
46
  );
45
47
  return;
@@ -49,45 +51,45 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
49
51
  uid: t.uid,
50
52
  path: t.response
51
53
  });
52
- }), m.value.fileList = o, r.value = e;
54
+ }), d.value.fileList = o, r.value = e;
53
55
  });
54
56
  }
55
- D({ setValue: R });
56
- let u = [], I;
57
- function v(e) {
57
+ z({ setValue: I });
58
+ let u = [], R;
59
+ function w(e) {
58
60
  setTimeout(() => {
59
- const o = m.value.fileList.findIndex(
61
+ const o = d.value.fileList.findIndex(
60
62
  (t) => t.uid === e.uid
61
63
  );
62
- o >= 0 && m.value.fileList.splice(o, 1);
64
+ o >= 0 && d.value.fileList.splice(o, 1);
63
65
  });
64
66
  }
65
67
  async function J(e) {
66
- if (i && i > 1 && u.length >= i)
67
- return clearTimeout(I), I = setTimeout(() => {
68
+ if (l && l > 1 && u.length >= l)
69
+ return clearTimeout(R), R = setTimeout(() => {
68
70
  p.warning(
69
- W || l("ap.apUpload.maxUploadFiles", {
70
- maxCount: i
71
+ W || i("ap.apUpload.maxUploadFiles", {
72
+ maxCount: l
71
73
  })
72
74
  );
73
- }), v(e), !1;
75
+ }), w(e), !1;
74
76
  if (e.size > E * 1024 * 1024)
75
77
  return p.warning(
76
- G || l("ap.apUpload.maxUploadFileSize", {
78
+ G || i("ap.apUpload.maxUploadFileSize", {
77
79
  maxSize: E
78
80
  })
79
- ), v(e), !1;
80
- if (!fe(e, k))
81
+ ), w(e), !1;
82
+ if (!ve(e, k))
81
83
  return p.warning(
82
- H || l("ap.apUpload.fileFormatNotSupported")
83
- ), v(e), !1;
84
- if (typeof _ == "function" && await _(e) === !1)
85
- return v(e), !1;
86
- i && i === 1 && (u = [], r.value = void 0), u.push(e);
84
+ H || i("ap.apUpload.fileFormatNotSupported")
85
+ ), w(e), !1;
86
+ if (typeof F == "function" && await F(e) === !1)
87
+ return w(e), !1;
88
+ l && l === 1 && (u = [], r.value = void 0), u.push(e);
87
89
  }
88
90
  async function K(e) {
89
- if (d.value++, typeof F == "function") {
90
- F({
91
+ if (m.value++, typeof A == "function") {
92
+ A({
91
93
  onProgress: (o) => {
92
94
  setTimeout(() => {
93
95
  e.onProgress({
@@ -96,30 +98,30 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
96
98
  });
97
99
  },
98
100
  onError: (o) => {
99
- C && p.warning(o || l("ap.apUpload.networkAnomaly")), setTimeout(() => {
101
+ b && p.warning(o || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
100
102
  e.onError({
101
103
  name: o,
102
104
  message: o
103
105
  });
104
- }), d.value--;
106
+ }), m.value--;
105
107
  },
106
108
  onSuccess: (o) => {
107
109
  setTimeout(() => {
108
110
  e.onSuccess(o);
109
111
  }), r.value = [
110
112
  ...r.value || [],
111
- B(h, o, e.file.name)
113
+ D(v, o, e.file.name)
112
114
  ], c.push({
113
115
  uid: e.file.uid,
114
116
  path: o
115
- }), d.value--;
117
+ }), m.value--;
116
118
  },
117
119
  file: e.file
118
120
  });
119
121
  return;
120
122
  }
121
123
  try {
122
- const o = await (A ? g(A) : g()), t = await z(async () => o);
124
+ const o = await (T ? g(T) : g()), t = await S(async () => o);
123
125
  e.file.oss = t, V({
124
126
  file: e.file,
125
127
  dirName: q,
@@ -127,17 +129,17 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
127
129
  successCallBack(s) {
128
130
  e.onSuccess(s), r.value = [
129
131
  ...r.value || [],
130
- B(h, s, e.file.name)
132
+ D(v, s, e.file.name)
131
133
  ], c.push({
132
134
  uid: e.file.uid,
133
135
  path: s
134
- }), d.value--;
136
+ }), m.value--;
135
137
  },
136
138
  errorCallBack(s) {
137
- C && p.warning(s || l("ap.apUpload.networkAnomaly")), e.onError({
139
+ b && p.warning(s || i("ap.apUpload.networkAnomaly")), e.onError({
138
140
  name: s,
139
141
  message: s
140
- }), d.value--;
142
+ }), m.value--;
141
143
  },
142
144
  progressCallBack(s) {
143
145
  e.onProgress({
@@ -148,16 +150,16 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
148
150
  bucket: o?.bucket
149
151
  });
150
152
  } catch (o) {
151
- C && p.warning(
152
- typeof o?.message == "string" ? o.message : l("ap.apUpload.networkAnomaly")
153
+ b && p.warning(
154
+ typeof o?.message == "string" ? o.message : i("ap.apUpload.networkAnomaly")
153
155
  ), e.onError({
154
- name: o?.message || l("ap.apUpload.networkAnomaly"),
155
- message: o?.message || l("ap.apUpload.networkAnomaly")
156
- }), d.value--;
156
+ name: o?.message || i("ap.apUpload.networkAnomaly"),
157
+ message: o?.message || i("ap.apUpload.networkAnomaly")
158
+ }), m.value--;
157
159
  }
158
160
  }
159
161
  function Q(e) {
160
- if (T && T?.(e), e.response) {
162
+ if (_ && _?.(e), e.response) {
161
163
  if (Array.isArray(r.value)) {
162
164
  const t = c.findIndex((s) => s.uid === e.uid);
163
165
  t >= 0 && (r?.value.splice(t, 1), c.splice(t, 1)), r.value.length === 0 && (r.value = void 0);
@@ -170,15 +172,15 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
170
172
  return u.splice(o, 1), Promise.resolve(!0);
171
173
  }
172
174
  const X = async (e) => {
173
- if (N.value?.trigger) {
175
+ if (U.value?.trigger) {
174
176
  let o = [e].map((t) => ({
175
177
  objectName: t.response,
176
178
  fileName: t.name
177
179
  }));
178
- N.value?.trigger?.(o);
180
+ U.value?.trigger?.(o);
179
181
  } else {
180
182
  const o = e.response?.match(/^([^:]+):(.*)$/), t = o?.[1], s = o?.[2] ?? e.response;
181
- (await z(
183
+ (await S(
182
184
  () => t ? g?.(t) : g?.()
183
185
  )).downloadFile([
184
186
  {
@@ -187,19 +189,24 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
187
189
  }
188
190
  ]);
189
191
  }
192
+ }, Y = (e) => {
193
+ de.createFilePreviewModal({
194
+ src: e.response,
195
+ fileName: e.name
196
+ });
190
197
  };
191
- return (e, o) => (x(), b("div", {
192
- class: te({
193
- [n(O)()]: !0,
194
- [n(P) ?? ""]: !0
198
+ return (e, o) => (x(), C("div", {
199
+ class: ae({
200
+ [n(B)()]: !0,
201
+ [n(O) ?? ""]: !0
195
202
  })
196
203
  }, [
197
204
  y(n(ue), {
198
205
  ref_key: "uploadRef",
199
- ref: m,
206
+ ref: d,
200
207
  accept: n(k),
201
208
  multiple: "",
202
- "max-count": n(i),
209
+ "max-count": n(l),
203
210
  progress: {
204
211
  strokeWidth: 3,
205
212
  showInfo: !1,
@@ -207,30 +214,35 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
207
214
  },
208
215
  "before-upload": J,
209
216
  "custom-request": K,
210
- "show-upload-list": { showDownloadIcon: !0, showRemoveIcon: !0 },
217
+ "show-upload-list": {
218
+ showDownloadIcon: !0,
219
+ showRemoveIcon: !0,
220
+ showPreviewIcon: !0
221
+ },
222
+ onPreview: Y,
211
223
  onRemove: Q,
212
224
  onDownload: X
213
225
  }, {
214
- downloadIcon: U(() => [
215
- y(n(ce))
226
+ downloadIcon: N(() => [
227
+ y(n(me), { class: "anticon anticon-vertical-align-bottom" })
216
228
  ]),
217
- default: U(() => [
218
- S("div", ke, [
229
+ default: N(() => [
230
+ P("div", Ce, [
219
231
  y(n(pe), { class: "file-btn" }, {
220
- default: U(() => [
221
- y(n(ie)),
222
- ae(" " + L(n($)), 1)
232
+ default: N(() => [
233
+ y(n(ce)),
234
+ se(" " + L(n($)), 1)
223
235
  ]),
224
236
  _: 1
225
237
  }),
226
- S("div", {
238
+ P("div", {
227
239
  class: "sub-title",
228
- onClick: o[0] || (o[0] = se(() => {
240
+ onClick: o[0] || (o[0] = ne(() => {
229
241
  }, ["stop"]))
230
242
  }, [
231
- typeof n(f) == "string" ? (x(), b("div", Ce, L(n(f) || `${n(l)("ap.apUpload.supportExtension")}:${n(ge)(n(k))}`), 1)) : n(f) ? (x(), b("div", be, [
232
- (x(), re(le(n(f))))
233
- ])) : ne("", !0)
243
+ typeof n(f) == "string" ? (x(), C("div", Ne, L(n(f) || `${n(i)("ap.apUpload.supportExtension")}:${n(we)(n(k))}`), 1)) : n(f) ? (x(), C("div", Ue, [
244
+ (x(), ie(le(n(f))))
245
+ ])) : re("", !0)
234
246
  ])
235
247
  ])
236
248
  ]),
@@ -240,5 +252,5 @@ const ke = { class: "multiple-file-context" }, Ce = { key: 0 }, be = { key: 1 },
240
252
  }
241
253
  });
242
254
  export {
243
- ze as default
255
+ Oe as default
244
256
  };
@@ -1,4 +1,4 @@
1
- const t = (l) => {
1
+ const i = (l) => {
2
2
  const { componentCls: o } = l;
3
3
  return {
4
4
  [`${o}-multiple-file`]: {
@@ -54,7 +54,10 @@ const t = (l) => {
54
54
  }
55
55
  },
56
56
  ".ant-upload-list-item-done": {
57
- color: l.colorLink
57
+ color: l.colorLink,
58
+ ".ant-upload-list-item-name": {
59
+ cursor: "pointer"
60
+ }
58
61
  },
59
62
  ".ant-upload-list-item-undefined": {
60
63
  color: l.colorLink
@@ -63,5 +66,5 @@ const t = (l) => {
63
66
  };
64
67
  };
65
68
  export {
66
- t as multipleFileStyle
69
+ i as multipleFileStyle
67
70
  };
@@ -32,3 +32,4 @@ export * from './ap-tag';
32
32
  export * from './ap-upload';
33
33
  export * from './ap-download';
34
34
  export * from './ap-descriptions';
35
+ export * from './ap-file-preview';
@@ -8,13 +8,13 @@ import "./ap-expand-alert/index.mjs";
8
8
  import { ApExportGroup as h } from "./ap-export-group/index.mjs";
9
9
  import { ApImage as B } from "./ap-image/index.mjs";
10
10
  import { ApInputRadio as T } from "./ap-input-radio/index.mjs";
11
- import { ApLabel as R, ApLabelGroup as V } from "./ap-label/index.mjs";
12
- import { ApLadder as w } from "./ap-ladder/index.mjs";
13
- import { ApSelectLayout as E } from "./ap-select-layout/index.mjs";
14
- import { ApStatus as K, ApStatusGroup as M } from "./ap-status/index.mjs";
15
- import { ApTitle as j } from "./ap-title/index.mjs";
11
+ import { ApLabel as w, ApLabelGroup as D } from "./ap-label/index.mjs";
12
+ import { ApLadder as R } from "./ap-ladder/index.mjs";
13
+ import { ApSelectLayout as z } from "./ap-select-layout/index.mjs";
14
+ import { ApStatus as F, ApStatusGroup as H } from "./ap-status/index.mjs";
15
+ import { ApTitle as M } from "./ap-title/index.mjs";
16
16
  import "./hooks/index.mjs";
17
- import { ApSummary as q } from "./ap-summary/index.mjs";
17
+ import { ApSummary as k } from "./ap-summary/index.mjs";
18
18
  import { ApAppendix as J } from "./ap-appendix/index.mjs";
19
19
  import "./ap-upload-file/index.mjs";
20
20
  import "./batch-input-group/index.mjs";
@@ -32,6 +32,7 @@ import "./ap-tag/index.mjs";
32
32
  import "./ap-upload/index.mjs";
33
33
  import "./ap-download/index.mjs";
34
34
  import "./ap-descriptions/index.mjs";
35
+ import { ApFilePreview as ao } from "./ap-file-preview/index.mjs";
35
36
  export {
36
37
  J as ApAppendix,
37
38
  d as ApAttachment,
@@ -42,21 +43,22 @@ export {
42
43
  X as ApCopy,
43
44
  to as ApDraggableGrid,
44
45
  h as ApExportGroup,
46
+ ao as ApFilePreview,
45
47
  B as ApImage,
46
48
  T as ApInputRadio,
47
49
  ro as ApKeepAlive,
48
- R as ApLabel,
49
- V as ApLabelGroup,
50
- w as ApLadder,
50
+ w as ApLabel,
51
+ D as ApLabelGroup,
52
+ R as ApLadder,
51
53
  U as ApProductInfo,
52
54
  $ as ApRadioGroup,
53
- E as ApSelectLayout,
55
+ z as ApSelectLayout,
54
56
  O as ApSizeInput,
55
- K as ApStatus,
56
- M as ApStatusGroup,
57
- q as ApSummary,
57
+ F as ApStatus,
58
+ H as ApStatusGroup,
59
+ k as ApSummary,
58
60
  u as ApTableModal,
59
- j as ApTitle,
61
+ M as ApTitle,
60
62
  fo as ApTransformDataHelper,
61
63
  mo as ApValueSelectCard,
62
64
  Z as ApView
@@ -1,4 +1,5 @@
1
1
  import { ExtractPropTypes, PropType } from 'vue';
2
+ import { ApFilePreviewProps } from '../business/ap-file-preview/interface';
2
3
  import { AgGridProps } from '../ag-grid';
3
4
  import { ApGridProps } from '../ap-grid';
4
5
  import { ApImageProps, ApTitleProps, ViewCacheOption } from '../business';
@@ -19,6 +20,7 @@ type ApProCardConfig = {
19
20
  };
20
21
  type ApImageConfig = Pick<ApImageProps, 'uiMode'>;
21
22
  type ApTitleConfig = Pick<ApTitleProps, 'uiMode'>;
23
+ type ApFilePreviewConfig = Pick<ApFilePreviewProps, 'parserPlugin'>;
22
24
  export declare const configProviderProps: () => {
23
25
  iconPrefixCls: StringConstructor;
24
26
  getTargetContainer: {
@@ -178,6 +180,10 @@ export declare const configProviderProps: () => {
178
180
  type: PropType<ApDescriptionsConfig>;
179
181
  default: () => {};
180
182
  };
183
+ apFilePreview: {
184
+ type: PropType<ApFilePreviewConfig>;
185
+ default: () => {};
186
+ };
181
187
  /**
182
188
  * @description aplus-ui的locale
183
189
  */
@@ -26,8 +26,12 @@ const t = () => ({
26
26
  apDescriptions: {
27
27
  type: Object,
28
28
  default: () => ({})
29
+ },
30
+ apFilePreview: {
31
+ type: Object,
32
+ default: () => ({})
29
33
  }
30
- }), o = () => ({
34
+ }), a = () => ({
31
35
  /**
32
36
  * @description aplus-ui的locale
33
37
  */
@@ -76,5 +80,5 @@ const t = () => ({
76
80
  ...e()
77
81
  });
78
82
  export {
79
- o as configProviderProps
83
+ a as configProviderProps
80
84
  };