@aplus-frontend/ui 7.0.0 → 7.1.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 (156) hide show
  1. package/es/index.mjs +108 -106
  2. package/es/src/ag-grid/style/custom-header.mjs +1 -1
  3. package/es/src/ag-grid/style/index.mjs +0 -1
  4. package/es/src/ap-action/item-dropdown/index.vue.mjs +12 -12
  5. package/es/src/ap-descriptions/ap-descriptions.vue.mjs +39 -39
  6. package/es/src/ap-descriptions/style/index.mjs +16 -43
  7. package/es/src/ap-download/ap-download.vue.mjs +43 -43
  8. package/es/src/ap-download/hooks/useStyle.d.ts +1 -1
  9. package/es/src/ap-download/hooks/useStyle.mjs +17 -14
  10. package/es/src/ap-download/style/index.mjs +6 -13
  11. package/es/src/ap-form/modal-form/index.vue.mjs +59 -60
  12. package/es/src/ap-form/style/item.mjs +5 -4
  13. package/es/src/ap-form/style/modal-form.mjs +11 -12
  14. package/es/src/ap-form/style/search-form-sorter.mjs +31 -27
  15. package/es/src/ap-form/style/token.d.ts +8 -0
  16. package/es/src/ap-grid/style/index.mjs +3 -3
  17. package/es/src/ap-pro-card/style/statistic.mjs +3 -3
  18. package/es/src/ap-pro-card/style/token.mjs +1 -1
  19. package/es/src/ap-table/style/index.mjs +2 -2
  20. package/es/src/ap-table/style/setting.mjs +2 -2
  21. package/es/src/ap-tag/ap-tag-group.vue.mjs +61 -61
  22. package/es/src/ap-tag/ap-tag.vue.mjs +19 -20
  23. package/es/src/ap-tag/style/group.mjs +2 -8
  24. package/es/src/ap-tag/style/index.mjs +14 -23
  25. package/es/src/ap-upload/apUpload.vue.mjs +42 -41
  26. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +60 -61
  27. package/es/src/ap-upload/components/Picture.vue2.mjs +90 -91
  28. package/es/src/ap-upload/components/SingleFile.vue2.mjs +72 -72
  29. package/es/src/ap-upload/style/multiple-file.mjs +13 -40
  30. package/es/src/ap-upload/style/picture.mjs +12 -30
  31. package/es/src/ap-upload/style/single-file.mjs +5 -16
  32. package/es/src/business/ag-grid-modal/interface.d.ts +1 -1
  33. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +6 -2
  34. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +29 -12
  35. package/es/src/business/ap-appendix/style/index.mjs +1 -1
  36. package/es/src/business/ap-attachment/ApAttachment.mjs +42 -39
  37. package/es/src/business/ap-copy/style/index.mjs +1 -1
  38. package/es/src/business/ap-expand-alert/ApExpandAlert.vue2.mjs +45 -46
  39. package/es/src/business/ap-ladder/ApLadder.mjs +20 -22
  40. package/es/src/business/ap-ladder/style/index.mjs +11 -39
  41. package/es/src/business/ap-product-info/ApProductInfo.mjs +21 -22
  42. package/es/src/business/ap-product-info/style/index.mjs +8 -24
  43. package/es/src/business/ap-radio-group/style/index.mjs +1 -1
  44. package/es/src/business/ap-size-input/ApSizeInput.d.ts +20 -4
  45. package/es/src/business/ap-size-input/ApSizeInput.mjs +37 -40
  46. package/es/src/business/ap-size-input/constans.d.ts +10 -2
  47. package/es/src/business/ap-size-input/constans.mjs +9 -1
  48. package/es/src/business/ap-size-input/form-item.vue.d.ts +13 -0
  49. package/es/src/business/ap-size-input/form-item.vue.mjs +65 -0
  50. package/es/src/business/ap-size-input/form-item.vue2.mjs +4 -0
  51. package/es/src/business/ap-size-input/index.d.ts +33 -8
  52. package/es/src/business/ap-size-input/index.mjs +3 -2
  53. package/es/src/business/ap-size-input/interface.d.ts +7 -0
  54. package/es/src/business/ap-size-input/style/index.mjs +2 -1
  55. package/es/src/business/ap-table-modal/hooks/use-table-modal.mjs +18 -19
  56. package/es/src/business/ap-table-modal/modal-title.vue2.mjs +13 -13
  57. package/es/src/business/ap-title/style/index.mjs +1 -1
  58. package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +38 -37
  59. package/es/src/business/ap-value-select-card/index.vue2.mjs +36 -37
  60. package/es/src/business/ap-value-select-card/style/index.mjs +7 -29
  61. package/es/src/business/ap-view/components/menu-list-content.vue2.mjs +61 -64
  62. package/es/src/business/ap-view/style/index.mjs +1 -1
  63. package/es/src/business/batch-input-group/style/index.mjs +1 -1
  64. package/es/src/check-card/style/index.mjs +46 -51
  65. package/es/src/config-provider/hooks/use-token.d.ts +2 -2
  66. package/es/src/design-token/constants.mjs +4 -2
  67. package/es/src/design-token/interface.d.ts +39 -19
  68. package/es/src/index.mjs +95 -93
  69. package/es/src/scroll-bar/style/index.mjs +12 -12
  70. package/es/src/splitter/style/index.mjs +6 -6
  71. package/es/src/style/index.mjs +1 -1
  72. package/es/src/text/style/index.mjs +1 -1
  73. package/es/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  74. package/es/src/utils/cssinjs/TokenUtil.mjs +26 -0
  75. package/es/src/utils/cssinjs/index.d.ts +1 -1
  76. package/es/src/utils/cssinjs/index.mjs +51 -50
  77. package/es/src/version.d.ts +1 -1
  78. package/es/src/version.mjs +1 -1
  79. package/lib/index.js +1 -1
  80. package/lib/src/ag-grid/style/custom-header.js +1 -1
  81. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  82. package/lib/src/ap-descriptions/ap-descriptions.vue.js +1 -1
  83. package/lib/src/ap-descriptions/style/index.js +1 -1
  84. package/lib/src/ap-download/ap-download.vue.js +1 -1
  85. package/lib/src/ap-download/hooks/useStyle.d.ts +1 -1
  86. package/lib/src/ap-download/hooks/useStyle.js +1 -1
  87. package/lib/src/ap-download/style/index.js +1 -1
  88. package/lib/src/ap-form/modal-form/index.vue.js +1 -1
  89. package/lib/src/ap-form/style/item.js +1 -1
  90. package/lib/src/ap-form/style/modal-form.js +1 -1
  91. package/lib/src/ap-form/style/search-form-sorter.js +1 -1
  92. package/lib/src/ap-form/style/token.d.ts +8 -0
  93. package/lib/src/ap-grid/style/index.js +1 -1
  94. package/lib/src/ap-pro-card/style/statistic.js +1 -1
  95. package/lib/src/ap-pro-card/style/token.js +1 -1
  96. package/lib/src/ap-table/style/index.js +1 -1
  97. package/lib/src/ap-table/style/setting.js +1 -1
  98. package/lib/src/ap-tag/ap-tag-group.vue.js +1 -1
  99. package/lib/src/ap-tag/ap-tag.vue.js +1 -1
  100. package/lib/src/ap-tag/style/group.js +1 -1
  101. package/lib/src/ap-tag/style/index.js +1 -1
  102. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  103. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  104. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  105. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  106. package/lib/src/ap-upload/style/multiple-file.js +1 -1
  107. package/lib/src/ap-upload/style/picture.js +1 -1
  108. package/lib/src/ap-upload/style/single-file.js +1 -1
  109. package/lib/src/business/ag-grid-modal/interface.d.ts +1 -1
  110. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +6 -2
  111. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  112. package/lib/src/business/ap-appendix/style/index.js +1 -1
  113. package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
  114. package/lib/src/business/ap-copy/style/index.js +1 -1
  115. package/lib/src/business/ap-expand-alert/ApExpandAlert.vue2.js +1 -1
  116. package/lib/src/business/ap-ladder/ApLadder.js +1 -1
  117. package/lib/src/business/ap-ladder/style/index.js +1 -1
  118. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  119. package/lib/src/business/ap-product-info/style/index.js +1 -1
  120. package/lib/src/business/ap-radio-group/style/index.js +1 -1
  121. package/lib/src/business/ap-size-input/ApSizeInput.d.ts +20 -4
  122. package/lib/src/business/ap-size-input/ApSizeInput.js +1 -1
  123. package/lib/src/business/ap-size-input/constans.d.ts +10 -2
  124. package/lib/src/business/ap-size-input/constans.js +1 -1
  125. package/lib/src/business/ap-size-input/form-item.vue.d.ts +13 -0
  126. package/lib/src/business/ap-size-input/form-item.vue.js +1 -0
  127. package/lib/src/business/ap-size-input/form-item.vue2.js +1 -0
  128. package/lib/src/business/ap-size-input/index.d.ts +33 -8
  129. package/lib/src/business/ap-size-input/index.js +1 -1
  130. package/lib/src/business/ap-size-input/interface.d.ts +7 -0
  131. package/lib/src/business/ap-size-input/style/index.js +1 -1
  132. package/lib/src/business/ap-table-modal/hooks/use-table-modal.js +1 -1
  133. package/lib/src/business/ap-table-modal/modal-title.vue2.js +1 -1
  134. package/lib/src/business/ap-title/style/index.js +1 -1
  135. package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -1
  136. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  137. package/lib/src/business/ap-value-select-card/style/index.js +1 -1
  138. package/lib/src/business/ap-view/components/menu-list-content.vue2.js +1 -1
  139. package/lib/src/business/ap-view/style/index.js +1 -1
  140. package/lib/src/business/batch-input-group/style/index.js +1 -1
  141. package/lib/src/check-card/style/index.js +1 -1
  142. package/lib/src/config-provider/hooks/use-token.d.ts +2 -2
  143. package/lib/src/design-token/constants.js +1 -1
  144. package/lib/src/design-token/interface.d.ts +39 -19
  145. package/lib/src/index.js +1 -1
  146. package/lib/src/scroll-bar/style/index.js +1 -1
  147. package/lib/src/splitter/style/index.js +1 -1
  148. package/lib/src/style/index.js +1 -1
  149. package/lib/src/text/style/index.js +1 -1
  150. package/lib/src/utils/cssinjs/TokenUtil.d.ts +11 -0
  151. package/lib/src/utils/cssinjs/TokenUtil.js +1 -0
  152. package/lib/src/utils/cssinjs/index.d.ts +1 -1
  153. package/lib/src/utils/cssinjs/index.js +1 -1
  154. package/lib/src/version.d.ts +1 -1
  155. package/lib/src/version.js +1 -1
  156. package/package.json +1 -1
@@ -1,50 +1,50 @@
1
- import { defineComponent as F, inject as r, ref as I, watch as ee, nextTick as te, createElementBlock as g, openBlock as h, normalizeClass as ae, unref as o, createElementVNode as d, renderSlot as oe, createCommentVNode as $, Fragment as ne, renderList as se, withDirectives as ie, createVNode as k, vShow as re, toDisplayString as C } from "vue";
1
+ import { defineComponent as Z, inject as r, ref as P, watch as F, nextTick as ee, createElementBlock as g, openBlock as h, normalizeClass as te, unref as n, createElementVNode as d, renderSlot as ae, createCommentVNode as I, Fragment as oe, renderList as se, withDirectives as ne, createVNode as k, vShow as ie, toDisplayString as C } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as ce, getName as ue, getReturnData as V } from "../utils/returnData.mjs";
4
- import { CloseOutlined as le, PlusOutlined as pe } from "@ant-design/icons-vue";
5
- import { useOss as de, getOssInstance as T } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as me, getAcceptText as fe } from "../utils/accept.mjs";
7
- import { message as m, Progress as ge } from "@aplus-frontend/antdv";
8
- import { omit as he } from "lodash-unified";
9
- import ve from "../style/index.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 we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture-item-box" }, ke = ["src"], Ce = { class: "picture-item-shadow" }, Ee = ["onClick"], Se = {
3
+ import { getPath as re, getName as ce, getReturnData as $ } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ue, PlusOutlined as le } from "@ant-design/icons-vue";
5
+ import { useOss as pe, getOssInstance as V } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as de, getAcceptText as me } from "../utils/accept.mjs";
7
+ import { message as m, Progress as fe } from "@aplus-frontend/antdv";
8
+ import { omit as ge } from "lodash-unified";
9
+ import he from "../style/index.mjs";
10
+ import { useLocale as ve } from "../../config-provider/hooks/use-locale.mjs";
11
+ import { useNamespace as xe } from "../../config-provider/hooks/use-namespace.mjs";
12
+ const ye = ["accept"], we = { class: "picture-context" }, _e = { class: "picture-item-box" }, Ue = ["src"], ke = { class: "picture-item-shadow" }, Ce = ["onClick"], Ee = {
13
13
  key: 0,
14
14
  class: "picture-item-uploading"
15
- }, Re = { class: "picture-title" }, Me = { key: 0 }, be = { key: 1 }, qe = /* @__PURE__ */ F({
15
+ }, Se = { class: "picture-title" }, Re = { key: 0 }, Me = { key: 1 }, Be = /* @__PURE__ */ Z({
16
16
  __name: "Picture",
17
- setup(ze, { expose: D }) {
18
- const { t: u } = xe(), { b: E } = ye("ap-upload-picture"), L = ve("ap-upload"), { put: O } = de(), B = r("theme"), q = r("dirName"), w = r("accept") || "image/*", _ = r("maxSize") ?? 5, S = r("title"), l = r("maxCount") ?? 10, v = r("uploadingCount"), R = r("beforeUpload"), M = r("customRequest"), b = r("getOssAccess"), j = r("maxSizeErrorMsg"), G = r("maxCountErrorMsg"), H = r("acceptErrorMsg"), x = I(null), c = r("value"), y = r("needName"), z = r("onRemove"), U = r("showUploadErrorMsg");
19
- let s = I([]);
17
+ setup(be, { expose: T }) {
18
+ const { t: u } = ve(), { b: D } = xe("ap-upload-picture"), L = he("ap-upload"), { put: O } = pe(), B = r("dirName"), w = r("accept") || "image/*", _ = r("maxSize") ?? 5, E = r("title"), l = r("maxCount") ?? 10, v = r("uploadingCount"), S = r("beforeUpload"), R = r("customRequest"), M = r("getOssAccess"), q = r("maxSizeErrorMsg"), j = r("maxCountErrorMsg"), G = r("acceptErrorMsg"), x = P(null), c = r("value"), y = r("needName"), b = r("onRemove"), U = r("showUploadErrorMsg");
19
+ let s = P([]);
20
20
  const f = [];
21
- ee(
21
+ F(
22
22
  () => c?.value,
23
23
  async function(t) {
24
- !s?.value?.length && t && A(t);
24
+ !s?.value?.length && t && z(t);
25
25
  },
26
26
  { immediate: !0 }
27
27
  );
28
- function A(t) {
28
+ function z(t) {
29
29
  if (!t) {
30
30
  c.value = void 0, f.splice(0, f.length), s.value = [];
31
31
  return;
32
32
  }
33
- te(async () => {
34
- const n = [];
33
+ ee(async () => {
34
+ const o = [];
35
35
  for (let e of t) {
36
- const a = ce(y, e), i = ue(y, e), p = await T(b), Y = await p.getSignatureUrl(a), Z = {
36
+ const a = re(y, e), i = ce(y, e), p = await V(M), X = await p.getSignatureUrl(a), Y = {
37
37
  ...typeof e == "string" ? {} : e,
38
38
  ...new File([e], i, {}),
39
39
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
40
- thumbUrl: Y,
40
+ thumbUrl: X,
41
41
  status: "success",
42
42
  percent: 100,
43
43
  path: a
44
44
  };
45
- n.push(Z), p.destroy();
45
+ o.push(Y), p.destroy();
46
46
  }
47
- if (l && n.length > l) {
47
+ if (l && o.length > l) {
48
48
  m.warning(
49
49
  u("ap.apUpload.fileInitializationException", {
50
50
  maxCount: l
@@ -52,7 +52,7 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
52
52
  );
53
53
  return;
54
54
  }
55
- n.forEach((e) => {
55
+ o.forEach((e) => {
56
56
  s.value.push(e), f.push({
57
57
  uid: e.uid,
58
58
  path: e.path
@@ -60,40 +60,40 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
60
60
  }), c.value = t;
61
61
  });
62
62
  }
63
- D({ setValue: A });
64
- function J() {
63
+ T({ setValue: z });
64
+ function H() {
65
65
  x.value?.click();
66
66
  }
67
- function K(t) {
68
- const n = t.target;
69
- Q(n?.files);
67
+ function J(t) {
68
+ const o = t.target;
69
+ K(o?.files);
70
70
  }
71
- function Q(t) {
71
+ function K(t) {
72
72
  if (t?.length)
73
- for (let n = 0; n < t.length; n++)
74
- W(t[n]);
73
+ for (let o = 0; o < t.length; o++)
74
+ Q(t[o]);
75
75
  x.value && (x.value.value = "");
76
76
  }
77
- let N;
78
- async function W(t) {
77
+ let A;
78
+ async function Q(t) {
79
79
  if (l && l > 1 && s.value.length >= l)
80
- return clearTimeout(N), N = setTimeout(() => {
80
+ return clearTimeout(A), A = setTimeout(() => {
81
81
  m.warning(
82
- G || u("ap.apUpload.maxUploadPicture", { maxCount: l })
82
+ j || u("ap.apUpload.maxUploadPicture", { maxCount: l })
83
83
  );
84
84
  }), !1;
85
85
  if (t.size > _ * 1024 * 1024)
86
86
  return m.warning(
87
- j || u("ap.apUpload.maxUploadFileSize", { maxSize: _ })
87
+ q || u("ap.apUpload.maxUploadFileSize", { maxSize: _ })
88
88
  ), !1;
89
- if (!/image\/\w+/.test(t.type) || !me(t, w))
89
+ if (!/image\/\w+/.test(t.type) || !de(t, w))
90
90
  return m.warning(
91
- H || u("ap.apUpload.pictureFormatNotSupported")
91
+ G || u("ap.apUpload.pictureFormatNotSupported")
92
92
  ), !1;
93
- if (typeof R == "function" && await R(t) === !1)
93
+ if (typeof S == "function" && await S(t) === !1)
94
94
  return !1;
95
- const n = new FileReader();
96
- n.readAsDataURL(t), n.onload = function() {
95
+ const o = new FileReader();
96
+ o.readAsDataURL(t), o.onload = function() {
97
97
  const e = {
98
98
  ...t,
99
99
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
@@ -101,14 +101,14 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
101
101
  status: "uploading",
102
102
  percent: 0
103
103
  };
104
- X(e, t);
105
- }, n.onerror = function() {
104
+ W(e, t);
105
+ }, o.onerror = function() {
106
106
  m.warning(u("ap.apUpload.imageParsingFailed"));
107
107
  };
108
108
  }
109
- async function X(t, n) {
110
- if (v.value++, typeof M == "function") {
111
- M({
109
+ async function W(t, o) {
110
+ if (v.value++, typeof R == "function") {
111
+ R({
112
112
  onProgress: (e) => {
113
113
  const a = s.value.find((i) => i.uid === t.uid);
114
114
  a && (a.percent = e);
@@ -124,27 +124,27 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
124
124
  const a = s.value.find((i) => i.uid === t.uid);
125
125
  a && (a.status = "success", a.path = e), c.value = [
126
126
  ...c.value || [],
127
- V(y, e, n.name)
127
+ $(y, e, o.name)
128
128
  ], f.push({
129
129
  uid: t.uid,
130
130
  path: e
131
131
  }), v.value--;
132
132
  },
133
- file: n
133
+ file: o
134
134
  });
135
135
  return;
136
136
  }
137
137
  try {
138
- const e = await T(b);
138
+ const e = await V(M);
139
139
  t.oss = e, s.value.push(t), O({
140
- file: n,
141
- dirName: q,
140
+ file: o,
141
+ dirName: B,
142
142
  oss: e,
143
143
  successCallBack(a) {
144
144
  const i = s.value.find((p) => p.uid === t.uid);
145
145
  i && (i.status = "success", i.path = a), c.value = [
146
146
  ...c.value || [],
147
- V(y, a, n.name)
147
+ $(y, a, o.name)
148
148
  ], f.push({
149
149
  uid: t.uid,
150
150
  path: a
@@ -170,8 +170,8 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
170
170
  a > -1 && s.value.splice(a, 1), v.value--;
171
171
  }
172
172
  }
173
- function P(t) {
174
- if (z && z?.(t), t.path && c) {
173
+ function N(t) {
174
+ if (b && b?.(t), t.path && c) {
175
175
  if (Array.isArray(c.value)) {
176
176
  const e = f.findIndex(
177
177
  (a) => a.uid === t.uid
@@ -184,16 +184,15 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
184
184
  }
185
185
  } else
186
186
  t?.oss?.pauseUpload();
187
- const n = s.value.findIndex(
187
+ const o = s.value.findIndex(
188
188
  (e) => e.uid === t.uid
189
189
  );
190
- return s.value.splice(n, 1), Promise.resolve(!0);
190
+ return s.value.splice(o, 1), Promise.resolve(!0);
191
191
  }
192
- return (t, n) => (h(), g("div", {
193
- class: ae({
194
- [o(E)()]: !0,
195
- [o(E)("admin")]: o(B) === "admin",
196
- [o(L) ?? ""]: !0
192
+ return (t, o) => (h(), g("div", {
193
+ class: te({
194
+ [n(D)()]: !0,
195
+ [n(L) ?? ""]: !0
197
196
  })
198
197
  }, [
199
198
  d("input", {
@@ -201,68 +200,68 @@ const we = ["accept"], _e = { class: "picture-context" }, Ue = { class: "picture
201
200
  ref: x,
202
201
  style: { display: "none" },
203
202
  type: "file",
204
- accept: o(w),
205
- onChange: K
206
- }, null, 40, we),
207
- d("div", _e, [
208
- oe(t.$slots, "pictureContext", {
209
- fileList: o(s).map((e) => ({
210
- ...o(he)(e, "oss"),
203
+ accept: n(w),
204
+ onChange: J
205
+ }, null, 40, ye),
206
+ d("div", we, [
207
+ ae(t.$slots, "pictureContext", {
208
+ fileList: n(s).map((e) => ({
209
+ ...n(ge)(e, "oss"),
211
210
  oss: {
212
211
  pauseUpload: e?.oss?.pauseUpload
213
212
  }
214
213
  })),
215
- remove: P
214
+ remove: N
216
215
  }, () => [
217
- (h(!0), g(ne, null, se(o(s), (e) => (h(), g("div", {
216
+ (h(!0), g(oe, null, se(n(s), (e) => (h(), g("div", {
218
217
  key: e.uid,
219
218
  class: "picture-item"
220
219
  }, [
221
- d("div", Ue, [
220
+ d("div", _e, [
222
221
  d("img", {
223
222
  src: e.thumbUrl,
224
223
  alt: ""
225
- }, null, 8, ke),
226
- ie(d("div", Ce, [
224
+ }, null, 8, Ue),
225
+ ne(d("div", ke, [
227
226
  d("div", {
228
227
  class: "picture-item-close",
229
- onClick: (a) => P(e)
228
+ onClick: (a) => N(e)
230
229
  }, [
231
- k(o(le))
232
- ], 8, Ee),
233
- e.status === "uploading" ? (h(), g("div", Se, [
234
- k(o(ge), {
230
+ k(n(ue))
231
+ ], 8, Ce),
232
+ e.status === "uploading" ? (h(), g("div", Ee, [
233
+ k(n(fe), {
235
234
  percent: e.percent,
236
235
  "stroke-color": "#ffffff",
237
236
  "trail-color": "rgba(255, 255, 255, 0.3)",
238
237
  size: 4,
239
238
  "show-info": !1
240
239
  }, null, 8, ["percent"])
241
- ])) : $("", !0)
240
+ ])) : I("", !0)
242
241
  ], 512), [
243
- [re, e.status === "uploading"]
242
+ [ie, e.status === "uploading"]
244
243
  ])
245
244
  ])
246
245
  ]))), 128))
247
246
  ]),
248
- o(l) === void 0 || o(s).length < o(l) ? (h(), g("div", {
247
+ n(l) === void 0 || n(s).length < n(l) ? (h(), g("div", {
249
248
  key: 0,
250
249
  class: "picture-upload",
251
- onClick: J
250
+ onClick: H
252
251
  }, [
253
- k(o(pe)),
254
- d("div", null, C(o(u)("ap.apUpload.update")), 1)
255
- ])) : $("", !0)
252
+ k(n(le)),
253
+ d("div", null, C(n(u)("ap.apUpload.update")), 1)
254
+ ])) : I("", !0)
256
255
  ]),
257
- d("div", Re, [
258
- o(S) ? (h(), g("div", Me, C(o(S)), 1)) : (h(), g("div", be, C(`${o(u)("ap.apUpload.supportExtension")}:${o(fe)(o(w))},${o(u)(
256
+ d("div", Se, [
257
+ n(E) ? (h(), g("div", Re, C(n(E)), 1)) : (h(), g("div", Me, C(`${n(u)("ap.apUpload.supportExtension")}:${n(me)(n(w))},${n(u)(
259
258
  "ap.apUpload.maxUploadPictureSize",
260
- { maxSize: o(_) }
259
+ { maxSize: n(_) }
261
260
  )}`), 1))
262
261
  ])
263
262
  ], 2));
264
263
  }
265
264
  });
266
265
  export {
267
- qe as default
266
+ Be as default
268
267
  };
@@ -1,43 +1,44 @@
1
- import { defineComponent as le, inject as o, ref as g, watch as se, computed as re, createElementBlock as x, openBlock as h, normalizeClass as ie, unref as a, createElementVNode as r, createCommentVNode as z, toDisplayString as A, normalizeStyle as ce, createBlock as ue, withModifiers as pe, createVNode as de } from "vue";
1
+ import { defineComponent as ne, inject as l, ref as g, watch as se, computed as re, createElementBlock as E, openBlock as h, normalizeClass as ie, unref as a, createElementVNode as r, createCommentVNode as N, toDisplayString as x, normalizeStyle as ce, createBlock as ue, withModifiers as pe, createVNode as de } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
3
  import { getName as ve, getReturnData as $ } from "../utils/returnData.mjs";
4
4
  import { useOss as fe, useOssInit as me } from "../hooks/useOss.mjs";
5
5
  import { fileMatchesAccept as ge, getAcceptText as he } from "../utils/accept.mjs";
6
6
  import { message as c, Progress as _e } from "@aplus-frontend/antdv";
7
- import { DeleteOutlined as ye } from "@ant-design/icons-vue";
7
+ import { DeleteOutlined as ke } from "@ant-design/icons-vue";
8
8
  import q from "../assets/single-file-icon.png.mjs";
9
- import ke from "../style/index.mjs";
10
- import { useLocale as De } from "../../config-provider/hooks/use-locale.mjs";
11
- import { useNamespace as we } from "../../config-provider/hooks/use-namespace.mjs";
12
- const Ue = ["accept"], Fe = {
9
+ import ye from "../style/index.mjs";
10
+ import { useToken as we } from "../../config-provider/hooks/use-token.mjs";
11
+ import { useLocale as Ue } from "../../config-provider/hooks/use-locale.mjs";
12
+ import { useNamespace as Ce } from "../../config-provider/hooks/use-namespace.mjs";
13
+ const De = ["accept"], Fe = {
13
14
  key: 0,
14
15
  class: "state-un"
15
- }, Ce = ["src"], Ee = { class: "state-un-title" }, Se = { class: "state-un-subtitle" }, Ne = {
16
+ }, Se = ["src"], Ee = { class: "state-un-title" }, Ne = { class: "state-un-subtitle" }, xe = {
16
17
  key: 1,
17
18
  class: "state-ing"
18
- }, xe = { class: "left" }, ze = ["src"], Ae = { class: "center" }, be = { class: "center-progress" }, Ge = /* @__PURE__ */ le({
19
+ }, ze = { class: "left" }, be = ["src"], Ae = { class: "center" }, Re = { class: "center-progress" }, He = /* @__PURE__ */ ne({
19
20
  __name: "SingleFile",
20
- setup(Re, { expose: j }) {
21
- const { t: s } = De(), { b: _ } = we("ap-upload-single-file"), G = ke("ap-upload"), { put: W, client: b } = fe(), y = o("theme"), H = o("dirName"), k = o("accept") || "*", D = o("maxSize") ?? 500, J = o("title") || s("ap.apUpload.clickOrDragUpload"), w = o("subTitle"), i = o("value"), U = o("needName"), u = o("uploadingCount"), R = o("beforeUpload"), B = o("customRequest"), K = o("getOssAccess"), Q = o("maxSizeErrorMsg"), X = o("acceptErrorMsg"), M = o("onRemove"), F = o("showUploadErrorMsg"), n = g(null);
21
+ setup(Be, { expose: j }) {
22
+ const { t: s } = Ue(), { b: z } = Ce("ap-upload-single-file"), G = ye("ap-upload"), { put: W, client: b } = fe(), H = l("dirName"), _ = l("accept") || "*", k = l("maxSize") ?? 500, J = l("title") || s("ap.apUpload.clickOrDragUpload"), y = l("subTitle"), { token: A } = we(), i = l("value"), w = l("needName"), u = l("uploadingCount"), R = l("beforeUpload"), B = l("customRequest"), K = l("getOssAccess"), Q = l("maxSizeErrorMsg"), X = l("acceptErrorMsg"), M = l("onRemove"), U = l("showUploadErrorMsg"), o = g(null);
22
23
  se(
23
24
  () => i?.value,
24
25
  function(e) {
25
- n.value === null && e && O(e);
26
+ o.value === null && e && P(e);
26
27
  },
27
28
  { immediate: !0 }
28
29
  );
29
- function O(e) {
30
+ function P(e) {
30
31
  e ? setTimeout(() => {
31
- const t = ve(U, e);
32
- l.value = 3, n.value = new File([e], t, {}), i.value = e;
33
- }) : (l.value = 1, n.value = null, i.value = void 0);
32
+ const t = ve(w, e);
33
+ n.value = 3, o.value = new File([e], t, {}), i.value = e;
34
+ }) : (n.value = 1, o.value = null, i.value = void 0);
34
35
  }
35
- j({ setValue: O });
36
- const l = g(1), d = g(0), v = g(null), P = re(() => n.value && i?.value);
36
+ j({ setValue: P });
37
+ const n = g(1), d = g(0), v = g(null), T = re(() => o.value && i?.value);
37
38
  function Y() {
38
- l.value === 1 && v.value?.click();
39
+ n.value === 1 && v.value?.click();
39
40
  }
40
- function T(e) {
41
+ function O(e) {
41
42
  e.preventDefault(), e.stopPropagation();
42
43
  }
43
44
  function Z(e) {
@@ -47,7 +48,7 @@ const Ue = ["accept"], Fe = {
47
48
  L(e);
48
49
  }
49
50
  function te(e) {
50
- if (e.preventDefault(), e.stopPropagation(), l.value !== 1)
51
+ if (e.preventDefault(), e.stopPropagation(), n.value !== 1)
51
52
  return;
52
53
  var t = e.dataTransfer, f = [], V = 0, I = t.files.length;
53
54
  function p() {
@@ -55,27 +56,27 @@ const Ue = ["accept"], Fe = {
55
56
  }
56
57
  if (t.items !== void 0)
57
58
  for (var C = 0; C < t.items.length; C++) {
58
- var E = t.items[C];
59
- if (E.kind === "file" && E.webkitGetAsEntry().isFile) {
60
- var ne = E.getAsFile();
61
- f.push(ne), p();
59
+ var D = t.items[C];
60
+ if (D.kind === "file" && D.webkitGetAsEntry().isFile) {
61
+ var le = D.getAsFile();
62
+ f.push(le), p();
62
63
  }
63
64
  }
64
65
  else
65
- for (let N = 0; N < I; N++) {
66
- var m = t.files[N];
66
+ for (let S = 0; S < I; S++) {
67
+ var m = t.files[S];
67
68
  if (m.type)
68
69
  f.push(m), p();
69
70
  else
70
71
  try {
71
- var S = new FileReader();
72
- S.readAsDataURL(m.slice(0, 3)), S.addEventListener(
72
+ var F = new FileReader();
73
+ F.readAsDataURL(m.slice(0, 3)), F.addEventListener(
73
74
  "load",
74
75
  function() {
75
76
  f.push(m), p();
76
77
  },
77
78
  !1
78
- ), S.addEventListener(
79
+ ), F.addEventListener(
79
80
  "error",
80
81
  function() {
81
82
  c.warning(s("ap.apUpload.foldersNotSupported")), p();
@@ -93,15 +94,15 @@ const Ue = ["accept"], Fe = {
93
94
  }
94
95
  async function L(e) {
95
96
  if (e?.length) {
96
- if (e[0].size > D * 1024 * 1024) {
97
+ if (e[0].size > k * 1024 * 1024) {
97
98
  c.warning(
98
99
  Q || s("ap.apUpload.maxUploadFileSize", {
99
- maxSize: D
100
+ maxSize: k
100
101
  })
101
102
  );
102
103
  return;
103
104
  }
104
- if (!ge(e[0], k)) {
105
+ if (!ge(e[0], _)) {
105
106
  c.warning(
106
107
  X || s("ap.apUpload.fileFormatNotSupported")
107
108
  );
@@ -109,20 +110,20 @@ const Ue = ["accept"], Fe = {
109
110
  }
110
111
  if (typeof R == "function" && await R(e[0]) === !1)
111
112
  return;
112
- if (n.value = e[0], l.value = 2, d.value = 0, u.value++, typeof B == "function") {
113
+ if (o.value = e[0], n.value = 2, d.value = 0, u.value++, typeof B == "function") {
113
114
  B({
114
115
  onProgress: (t) => {
115
116
  d.value = t;
116
117
  },
117
118
  onError: (t) => {
118
- F && c.warning(t || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, u.value--;
119
+ U && c.warning(t || s("ap.apUpload.networkAnomaly")), n.value = 1, o.value = null, u.value--;
119
120
  },
120
121
  onSuccess: (t) => {
121
122
  i.value = $(
122
- U,
123
+ w,
123
124
  t,
124
- n.value.name
125
- ), l.value = 3, u.value--;
125
+ o.value.name
126
+ ), n.value = 3, u.value--;
126
127
  },
127
128
  file: e[0]
128
129
  });
@@ -130,44 +131,43 @@ const Ue = ["accept"], Fe = {
130
131
  }
131
132
  try {
132
133
  await me(K), W({
133
- file: n.value,
134
+ file: o.value,
134
135
  dirName: H,
135
136
  oss: b,
136
137
  successCallBack(t) {
137
138
  i.value = $(
138
- U,
139
+ w,
139
140
  t,
140
- n.value.name
141
- ), l.value = 3, u.value--;
141
+ o.value.name
142
+ ), n.value = 3, u.value--;
142
143
  },
143
144
  errorCallBack(t) {
144
- F && c.warning(t || s("ap.apUpload.networkAnomaly")), l.value = 1, n.value = null, u.value--;
145
+ U && c.warning(t || s("ap.apUpload.networkAnomaly")), n.value = 1, o.value = null, u.value--;
145
146
  },
146
147
  progressCallBack(t) {
147
148
  d.value = t;
148
149
  }
149
150
  });
150
151
  } catch (t) {
151
- F && c.warning(
152
+ U && c.warning(
152
153
  typeof t?.message == "string" ? t.message : s("ap.apUpload.networkAnomaly")
153
- ), l.value = 1, n.value = null, u.value--;
154
+ ), n.value = 1, o.value = null, u.value--;
154
155
  }
155
156
  }
156
157
  }
157
158
  function oe() {
158
- M && M?.(n.value), n.value && !i?.value && b.pauseUpload(), l.value = 1, n.value = null, i.value = void 0;
159
+ M && M?.(o.value), o.value && !i?.value && b.pauseUpload(), n.value = 1, o.value = null, i.value = void 0;
159
160
  }
160
- return (e, t) => (h(), x("div", {
161
+ return (e, t) => (h(), E("div", {
161
162
  class: ie({
162
- [a(_)()]: !0,
163
- [a(_)("admin")]: a(y) === "admin",
164
- [a(_)("un")]: l.value === 1,
163
+ [a(z)()]: !0,
164
+ [a(z)("un")]: n.value === 1,
165
165
  [a(G) ?? ""]: !0
166
166
  }),
167
167
  onClick: Y,
168
- onDragenter: T,
168
+ onDragenter: O,
169
169
  onDragover: Z,
170
- onDragleave: T,
170
+ onDragleave: O,
171
171
  onDrop: te
172
172
  }, [
173
173
  r("input", {
@@ -175,40 +175,40 @@ const Ue = ["accept"], Fe = {
175
175
  ref: v,
176
176
  style: { display: "none" },
177
177
  type: "file",
178
- accept: a(k),
178
+ accept: a(_),
179
179
  onChange: ae
180
- }, null, 40, Ue),
181
- l.value === 1 ? (h(), x("div", Fe, [
180
+ }, null, 40, De),
181
+ n.value === 1 ? (h(), E("div", Fe, [
182
182
  r("img", {
183
183
  class: "state-un-icon",
184
184
  src: a(q)
185
- }, null, 8, Ce),
186
- r("div", Ee, A(a(J)), 1),
187
- r("div", Se, A(typeof a(w) == "string" && a(w).length > 0 ? a(w) : `${a(s)("ap.apUpload.supportExtension")}:${a(he)(
188
- a(k)
185
+ }, null, 8, Se),
186
+ r("div", Ee, x(a(J)), 1),
187
+ r("div", Ne, x(typeof a(y) == "string" && a(y).length > 0 ? a(y) : `${a(s)("ap.apUpload.supportExtension")}:${a(he)(
188
+ a(_)
189
189
  )},${a(s)("ap.apUpload.maxWarnUploadFileSize", {
190
- maxSize: a(D)
190
+ maxSize: a(k)
191
191
  })}`), 1)
192
- ])) : z("", !0),
193
- [2, 3].includes(l.value) ? (h(), x("div", Ne, [
194
- r("div", xe, [
195
- r("img", { src: a(q) }, null, 8, ze)
192
+ ])) : N("", !0),
193
+ [2, 3].includes(n.value) ? (h(), E("div", xe, [
194
+ r("div", ze, [
195
+ r("img", { src: a(q) }, null, 8, be)
196
196
  ]),
197
197
  r("div", Ae, [
198
198
  r("div", {
199
199
  class: "center-title",
200
200
  style: ce({
201
- color: P.value ? "#0070FF" : "#182948"
201
+ color: T.value ? "#0070FF" : "#182948"
202
202
  })
203
- }, A(n.value?.name), 5),
204
- r("div", be, [
205
- P.value ? z("", !0) : (h(), ue(a(_e), {
203
+ }, x(o.value?.name), 5),
204
+ r("div", Re, [
205
+ T.value ? N("", !0) : (h(), ue(a(_e), {
206
206
  key: 0,
207
207
  percent: d.value,
208
208
  size: 4,
209
209
  "show-info": !1,
210
- "trail-color": a(y) === "admin" ? "#D9D9D9" : "#DEE4ED",
211
- "stroke-color": a(y) === "admin" ? "#34B77C" : "#0070FF"
210
+ "trail-color": a(A).borderColorBase,
211
+ "stroke-color": a(A).colorPrimary
212
212
  }, null, 8, ["percent", "trail-color", "stroke-color"]))
213
213
  ])
214
214
  ]),
@@ -216,12 +216,12 @@ const Ue = ["accept"], Fe = {
216
216
  class: "right",
217
217
  onClick: pe(oe, ["stop"])
218
218
  }, [
219
- de(a(ye))
219
+ de(a(ke))
220
220
  ])
221
- ])) : z("", !0)
221
+ ])) : N("", !0)
222
222
  ], 34));
223
223
  }
224
224
  });
225
225
  export {
226
- Ge as default
226
+ He as default
227
227
  };