@aplus-frontend/ui 0.4.13 → 0.4.15

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 (97) hide show
  1. package/es/index.mjs +84 -80
  2. package/es/src/ap-descriptions/help-message/index.vue2.mjs +17 -12
  3. package/es/src/ap-field/date/helper.mjs +9 -9
  4. package/es/src/ap-table/ap-table.vue2.mjs +206 -181
  5. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +62 -62
  6. package/es/src/ap-upload/apUpload.vue.d.ts +9 -0
  7. package/es/src/ap-upload/apUpload.vue.mjs +22 -18
  8. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +66 -66
  9. package/es/src/ap-upload/components/Picture.vue2.mjs +82 -82
  10. package/es/src/ap-upload/components/SingleFile.vue2.mjs +114 -114
  11. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +79 -67
  12. package/es/src/config-provider/config-provider.d.ts +3 -0
  13. package/es/src/config-provider/css-var.d.ts +3 -0
  14. package/es/src/config-provider/css-var.mjs +21 -14
  15. package/es/src/config-provider/index.d.ts +15 -0
  16. package/es/src/hooks/index.d.ts +1 -0
  17. package/es/src/hooks/index.mjs +6 -4
  18. package/es/src/hooks/useResize.d.ts +8 -0
  19. package/es/src/hooks/useResize.mjs +23 -0
  20. package/es/src/index.d.ts +1 -0
  21. package/es/src/index.mjs +212 -209
  22. package/es/src/path-map.mjs +2 -1
  23. package/es/src/resize-observer/index.d.ts +3 -0
  24. package/es/src/resize-observer/index.mjs +2 -0
  25. package/es/src/resize-observer/index.vue.d.ts +25 -0
  26. package/es/src/resize-observer/index.vue.mjs +45 -0
  27. package/es/src/resize-observer/index.vue2.mjs +4 -0
  28. package/es/src/resize-observer/interface.d.ts +27 -0
  29. package/es/src/resize-observer/interface.mjs +1 -0
  30. package/es/src/resize-observer/style/css.d.ts +1 -0
  31. package/es/src/resize-observer/style/css.js +1 -0
  32. package/es/src/resize-observer/style/index.d.ts +1 -0
  33. package/es/src/resize-observer/style/index.js +1 -0
  34. package/es/src/scroll-bar/index.vue.d.ts +1 -0
  35. package/es/src/scroll-bar/index.vue.mjs +31 -30
  36. package/es/src/scroll-bar/interface.d.ts +3 -1
  37. package/es/src/theme/antd-global-overwrite/admin/index.css +24 -2
  38. package/es/src/theme/antd-global-overwrite/admin/table.css +24 -2
  39. package/es/src/theme/antd-global-overwrite/aplus/index.css +24 -2
  40. package/es/src/theme/antd-global-overwrite/aplus/table.css +24 -2
  41. package/es/src/utils/index.d.ts +1 -0
  42. package/es/src/utils/index.mjs +40 -30
  43. package/lib/index.js +1 -1
  44. package/lib/src/ap-descriptions/help-message/index.vue2.js +1 -1
  45. package/lib/src/ap-field/date/helper.js +1 -1
  46. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  47. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  48. package/lib/src/ap-upload/apUpload.vue.d.ts +9 -0
  49. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  50. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  51. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  52. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  53. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  54. package/lib/src/config-provider/config-provider.d.ts +3 -0
  55. package/lib/src/config-provider/css-var.d.ts +3 -0
  56. package/lib/src/config-provider/css-var.js +1 -1
  57. package/lib/src/config-provider/index.d.ts +15 -0
  58. package/lib/src/hooks/index.d.ts +1 -0
  59. package/lib/src/hooks/index.js +1 -1
  60. package/lib/src/hooks/useResize.d.ts +8 -0
  61. package/lib/src/hooks/useResize.js +1 -0
  62. package/lib/src/index.d.ts +1 -0
  63. package/lib/src/index.js +1 -1
  64. package/lib/src/path-map.js +1 -1
  65. package/lib/src/resize-observer/index.d.ts +3 -0
  66. package/lib/src/resize-observer/index.js +1 -0
  67. package/lib/src/resize-observer/index.vue.d.ts +25 -0
  68. package/lib/src/resize-observer/index.vue.js +1 -0
  69. package/lib/src/resize-observer/index.vue2.js +1 -0
  70. package/lib/src/resize-observer/interface.d.ts +27 -0
  71. package/lib/src/resize-observer/interface.js +1 -0
  72. package/lib/src/resize-observer/style/css.cjs +1 -0
  73. package/lib/src/resize-observer/style/css.d.ts +1 -0
  74. package/lib/src/resize-observer/style/index.cjs +1 -0
  75. package/lib/src/resize-observer/style/index.d.ts +1 -0
  76. package/lib/src/scroll-bar/index.vue.d.ts +1 -0
  77. package/lib/src/scroll-bar/index.vue.js +1 -1
  78. package/lib/src/scroll-bar/interface.d.ts +3 -1
  79. package/lib/src/theme/antd-global-overwrite/admin/index.css +24 -2
  80. package/lib/src/theme/antd-global-overwrite/admin/table.css +24 -2
  81. package/lib/src/theme/antd-global-overwrite/aplus/index.css +24 -2
  82. package/lib/src/theme/antd-global-overwrite/aplus/table.css +24 -2
  83. package/lib/src/utils/index.d.ts +1 -0
  84. package/lib/src/utils/index.js +1 -1
  85. package/package.json +3 -3
  86. package/theme/antd-global-overwrite/admin/index.css +24 -2
  87. package/theme/antd-global-overwrite/admin/table.css +24 -2
  88. package/theme/antd-global-overwrite/admin/table.less +8 -2
  89. package/theme/antd-global-overwrite/aplus/index.css +24 -2
  90. package/theme/antd-global-overwrite/aplus/table.css +24 -2
  91. package/theme/antd-global-overwrite/aplus/table.less +7 -2
  92. package/theme/ap-descriptions/ap-descriptions.css +3 -0
  93. package/theme/ap-descriptions/ap-descriptions.less +7 -0
  94. package/theme/ap-table/ap-table.css +8 -1
  95. package/theme/ap-table/ap-table.less +11 -9
  96. package/theme/ap-table-modal/index.css +8 -1
  97. package/theme/index.css +11 -1
@@ -1,48 +1,48 @@
1
- import { defineComponent as X, inject as u, ref as R, watch as Y, nextTick as Z, openBlock as g, createElementBlock as h, normalizeClass as F, unref as i, createElementVNode as d, renderSlot as ee, Fragment as te, renderList as ne, withDirectives as ae, createVNode as U, createCommentVNode as $, vShow as se, toDisplayString as k } from "vue";
1
+ import { defineComponent as Y, inject as c, ref as $, watch as Z, nextTick as F, openBlock as g, createElementBlock as h, normalizeClass as ee, unref as i, createElementVNode as d, renderSlot as te, Fragment as ne, renderList as ae, withDirectives as se, createVNode as k, createCommentVNode as I, vShow as oe, toDisplayString as C } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as oe, getName as ie, getReturnData as I } from "../utils/returnData.mjs";
4
- import { CloseOutlined as re, PlusOutlined as ce } from "@ant-design/icons-vue";
5
- import { useOss as ue, getOssInstance as M } from "../hooks/useOss.mjs";
6
- import { fileMatchesAccept as le, getAcceptText as pe } from "../utils/accept.mjs";
7
- import { message as m, Progress as de } from "@aplus-frontend/antdv";
8
- import { omit as me } from "lodash-unified";
9
- import { useLocale as fe } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useNamespace as ge } from "../../config-provider/hooks/use-namespace.mjs";
11
- const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture-item-box" }, ye = ["src"], _e = { class: "picture-item-shadow" }, we = ["onClick"], Ue = {
3
+ import { getPath as ie, getName as re, getReturnData as M } from "../utils/returnData.mjs";
4
+ import { CloseOutlined as ce, PlusOutlined as ue } from "@ant-design/icons-vue";
5
+ import { useOss as le, getOssInstance as T } from "../hooks/useOss.mjs";
6
+ import { fileMatchesAccept as pe, getAcceptText as de } from "../utils/accept.mjs";
7
+ import { message as m, Progress as me } from "@aplus-frontend/antdv";
8
+ import { omit as fe } from "lodash-unified";
9
+ import { useLocale as ge } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
11
+ const ve = ["accept"], xe = { class: "picture-context" }, ye = { class: "picture-item-box" }, _e = ["src"], we = { class: "picture-item-shadow" }, Ue = ["onClick"], ke = {
12
12
  key: 0,
13
13
  class: "picture-item-uploading"
14
- }, ke = { class: "picture-title" }, Ce = { key: 0 }, Se = { key: 1 }, De = /* @__PURE__ */ X({
14
+ }, Ce = { class: "picture-title" }, Se = { key: 0 }, Ee = { key: 1 }, Oe = /* @__PURE__ */ Y({
15
15
  __name: "Picture",
16
- setup(Ee, { expose: T }) {
17
- const { t: l } = fe(), { b: C } = ge("ap-upload-picture"), { put: D } = ue(), O = u("theme"), B = u("dirName"), _ = u("accept") || "image/*", w = u("maxSize") ?? 5, S = u("title"), p = u("maxCount") ?? 10, v = u("uploadingCount"), E = u("beforeUpload"), b = u("customRequest"), z = u("getOssAccess"), L = u("maxSizeErrorMsg"), q = u("maxCountErrorMsg"), V = u("acceptErrorMsg"), x = R(null), r = u("value"), y = u("needName");
18
- let o = R([]);
16
+ setup(be, { expose: D }) {
17
+ const { t: l } = ge(), { b: S } = he("ap-upload-picture"), { put: O } = le(), B = c("theme"), L = c("dirName"), w = c("accept") || "image/*", U = c("maxSize") ?? 5, E = c("title"), p = c("maxCount") ?? 10, v = c("uploadingCount"), b = c("beforeUpload"), z = c("customRequest"), A = c("getOssAccess"), q = c("maxSizeErrorMsg"), V = c("maxCountErrorMsg"), j = c("acceptErrorMsg"), x = $(null), r = c("value"), y = c("needName"), _ = c("onRemove");
18
+ let o = $([]);
19
19
  const f = [];
20
- Y(
20
+ Z(
21
21
  () => r == null ? void 0 : r.value,
22
22
  async function(e) {
23
23
  var a;
24
- !((a = o == null ? void 0 : o.value) != null && a.length) && e && A(e);
24
+ !((a = o == null ? void 0 : o.value) != null && a.length) && e && N(e);
25
25
  },
26
26
  { immediate: !0 }
27
27
  );
28
- function A(e) {
28
+ function N(e) {
29
29
  if (!e) {
30
30
  r.value = void 0, f.splice(0, f.length), o.value = [];
31
31
  return;
32
32
  }
33
- Z(async () => {
33
+ F(async () => {
34
34
  const a = [];
35
35
  for (let t of e) {
36
- const n = oe(y, t), s = ie(y, t), c = await M(z), Q = await c.getSignatureUrl(n), W = {
36
+ const n = ie(y, t), s = re(y, t), u = await T(A), W = await u.getSignatureUrl(n), X = {
37
37
  ...typeof t == "string" ? {} : t,
38
38
  ...new File([t], s, {}),
39
39
  uid: `${(/* @__PURE__ */ new Date()).getTime()}-${Math.random()}`,
40
- thumbUrl: Q,
40
+ thumbUrl: W,
41
41
  status: "success",
42
42
  percent: 100,
43
43
  path: n
44
44
  };
45
- a.push(W), c.destroy();
45
+ a.push(X), u.destroy();
46
46
  }
47
47
  if (p && a.length > p) {
48
48
  m.warning(
@@ -60,38 +60,38 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
60
60
  }), r.value = e;
61
61
  });
62
62
  }
63
- T({ setValue: A });
64
- function j() {
63
+ D({ setValue: N });
64
+ function G() {
65
65
  var e;
66
66
  (e = x.value) == null || e.click();
67
67
  }
68
- function G(e) {
68
+ function H(e) {
69
69
  const a = e.target;
70
- H(a == null ? void 0 : a.files);
70
+ J(a == null ? void 0 : a.files);
71
71
  }
72
- function H(e) {
72
+ function J(e) {
73
73
  if (e != null && e.length)
74
74
  for (let a = 0; a < e.length; a++)
75
- J(e[a]);
75
+ K(e[a]);
76
76
  x.value && (x.value.value = "");
77
77
  }
78
- let N;
79
- async function J(e) {
78
+ let P;
79
+ async function K(e) {
80
80
  if (p && p > 1 && o.value.length >= p)
81
- return clearTimeout(N), N = setTimeout(() => {
81
+ return clearTimeout(P), P = setTimeout(() => {
82
82
  m.warning(
83
- q || l("ap.apUpload.maxUploadPicture", { maxCount: p })
83
+ V || l("ap.apUpload.maxUploadPicture", { maxCount: p })
84
84
  );
85
85
  }), !1;
86
- if (e.size > w * 1024 * 1024)
86
+ if (e.size > U * 1024 * 1024)
87
87
  return m.warning(
88
- L || l("ap.apUpload.maxUploadFileSize", { maxSize: w })
88
+ q || l("ap.apUpload.maxUploadFileSize", { maxSize: U })
89
89
  ), !1;
90
- if (!/image\/\w+/.test(e.type) || !le(e, _))
90
+ if (!/image\/\w+/.test(e.type) || !pe(e, w))
91
91
  return m.warning(
92
- V || l("ap.apUpload.pictureFormatNotSupported")
92
+ j || l("ap.apUpload.pictureFormatNotSupported")
93
93
  ), !1;
94
- if (typeof E == "function" && await E(e) === !1)
94
+ if (typeof b == "function" && await b(e) === !1)
95
95
  return !1;
96
96
  const a = new FileReader();
97
97
  a.readAsDataURL(e), a.onload = function() {
@@ -102,14 +102,14 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
102
102
  status: "uploading",
103
103
  percent: 0
104
104
  };
105
- K(t, e);
105
+ Q(t, e);
106
106
  }, a.onerror = function() {
107
107
  m.warning(l("ap.apUpload.imageParsingFailed"));
108
108
  };
109
109
  }
110
- async function K(e, a) {
111
- if (v.value++, typeof b == "function") {
112
- b({
110
+ async function Q(e, a) {
111
+ if (v.value++, typeof z == "function") {
112
+ z({
113
113
  onProgress: (t) => {
114
114
  const n = o.value.find((s) => s.uid === e.uid);
115
115
  n && (n.percent = t);
@@ -125,7 +125,7 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
125
125
  const n = o.value.find((s) => s.uid === e.uid);
126
126
  n && (n.status = "success", n.path = t), r.value = [
127
127
  ...r.value || [],
128
- I(y, t, a.name)
128
+ M(y, t, a.name)
129
129
  ], f.push({
130
130
  uid: e.uid,
131
131
  path: t
@@ -136,16 +136,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
136
136
  return;
137
137
  }
138
138
  try {
139
- const t = await M(z);
140
- e.oss = t, o.value.push(e), D({
139
+ const t = await T(A);
140
+ e.oss = t, o.value.push(e), O({
141
141
  file: a,
142
- dirName: B,
142
+ dirName: L,
143
143
  oss: t,
144
144
  successCallBack(n) {
145
- const s = o.value.find((c) => c.uid === e.uid);
145
+ const s = o.value.find((u) => u.uid === e.uid);
146
146
  s && (s.status = "success", s.path = n), r.value = [
147
147
  ...r.value || [],
148
- I(y, n, a.name)
148
+ M(y, n, a.name)
149
149
  ], f.push({
150
150
  uid: e.uid,
151
151
  path: n
@@ -154,12 +154,12 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
154
154
  errorCallBack(n) {
155
155
  m.warning(n || l("ap.apUpload.networkAnomaly"));
156
156
  const s = o.value.findIndex(
157
- (c) => c.uid === e.uid
157
+ (u) => u.uid === e.uid
158
158
  );
159
159
  s > -1 && o.value.splice(s, 1), v.value--;
160
160
  },
161
161
  progressCallBack(n) {
162
- const s = o.value.find((c) => c.uid === e.uid);
162
+ const s = o.value.find((u) => u.uid === e.uid);
163
163
  s && (s.percent = n);
164
164
  }
165
165
  });
@@ -171,16 +171,16 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
171
171
  n > -1 && o.value.splice(n, 1), v.value--;
172
172
  }
173
173
  }
174
- function P(e) {
174
+ function R(e) {
175
175
  var t, n;
176
- if (e.path && r) {
176
+ if (_ && (_ == null || _(e)), e.path && r) {
177
177
  if (Array.isArray(r.value)) {
178
178
  const s = f.findIndex(
179
- (c) => c.uid === e.uid
179
+ (u) => u.uid === e.uid
180
180
  );
181
181
  if (s >= 0) {
182
- const c = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
183
- c == null || c.splice(s, 1), r.value = c, f.splice(s, 1);
182
+ const u = ((t = r == null ? void 0 : r.value) == null ? void 0 : t.slice()) ?? [];
183
+ u == null || u.splice(s, 1), r.value = u, f.splice(s, 1);
184
184
  }
185
185
  r.value.length === 0 && (r.value = void 0);
186
186
  }
@@ -192,9 +192,9 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
192
192
  return o.value.splice(a, 1), Promise.resolve(!0);
193
193
  }
194
194
  return (e, a) => (g(), h("div", {
195
- class: F({
196
- [i(C)()]: !0,
197
- [i(C)("admin")]: i(O) === "admin"
195
+ class: ee({
196
+ [i(S)()]: !0,
197
+ [i(S)("admin")]: i(B) === "admin"
198
198
  })
199
199
  }, [
200
200
  d("input", {
@@ -202,49 +202,49 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
202
202
  ref: x,
203
203
  style: { display: "none" },
204
204
  type: "file",
205
- accept: i(_),
206
- onChange: G
207
- }, null, 40, he),
208
- d("div", ve, [
209
- ee(e.$slots, "pictureContext", {
205
+ accept: i(w),
206
+ onChange: H
207
+ }, null, 40, ve),
208
+ d("div", xe, [
209
+ te(e.$slots, "pictureContext", {
210
210
  fileList: i(o).map((t) => {
211
211
  var n;
212
212
  return {
213
- ...i(me)(t, "oss"),
213
+ ...i(fe)(t, "oss"),
214
214
  oss: {
215
215
  pauseUpload: (n = t == null ? void 0 : t.oss) == null ? void 0 : n.pauseUpload
216
216
  }
217
217
  };
218
218
  }),
219
- remove: P
219
+ remove: R
220
220
  }, () => [
221
- (g(!0), h(te, null, ne(i(o), (t) => (g(), h("div", {
221
+ (g(!0), h(ne, null, ae(i(o), (t) => (g(), h("div", {
222
222
  key: t.uid,
223
223
  class: "picture-item"
224
224
  }, [
225
- d("div", xe, [
225
+ d("div", ye, [
226
226
  d("img", {
227
227
  src: t.thumbUrl,
228
228
  alt: ""
229
- }, null, 8, ye),
230
- ae(d("div", _e, [
229
+ }, null, 8, _e),
230
+ se(d("div", we, [
231
231
  d("div", {
232
232
  class: "picture-item-close",
233
- onClick: (n) => P(t)
233
+ onClick: (n) => R(t)
234
234
  }, [
235
- U(i(re))
236
- ], 8, we),
237
- t.status === "uploading" ? (g(), h("div", Ue, [
238
- U(i(de), {
235
+ k(i(ce))
236
+ ], 8, Ue),
237
+ t.status === "uploading" ? (g(), h("div", ke, [
238
+ k(i(me), {
239
239
  percent: t.percent,
240
240
  "stroke-color": "#ffffff",
241
241
  "trail-color": "rgba(255, 255, 255, 0.3)",
242
242
  size: 4,
243
243
  "show-info": !1
244
244
  }, null, 8, ["percent"])
245
- ])) : $("", !0)
245
+ ])) : I("", !0)
246
246
  ], 512), [
247
- [se, t.status === "uploading"]
247
+ [oe, t.status === "uploading"]
248
248
  ])
249
249
  ])
250
250
  ]))), 128))
@@ -252,21 +252,21 @@ const he = ["accept"], ve = { class: "picture-context" }, xe = { class: "picture
252
252
  i(p) === void 0 || i(o).length < i(p) ? (g(), h("div", {
253
253
  key: 0,
254
254
  class: "picture-upload",
255
- onClick: j
255
+ onClick: G
256
256
  }, [
257
- U(i(ce)),
258
- d("div", null, k(i(l)("ap.apUpload.update")), 1)
259
- ])) : $("", !0)
257
+ k(i(ue)),
258
+ d("div", null, C(i(l)("ap.apUpload.update")), 1)
259
+ ])) : I("", !0)
260
260
  ]),
261
- d("div", ke, [
262
- i(S) ? (g(), h("div", Ce, k(i(S)), 1)) : (g(), h("div", Se, k(`${i(l)("ap.apUpload.supportExtension")}:${i(pe)(i(_))},${i(l)(
261
+ d("div", Ce, [
262
+ i(E) ? (g(), h("div", Se, C(i(E)), 1)) : (g(), h("div", Ee, C(`${i(l)("ap.apUpload.supportExtension")}:${i(de)(i(w))},${i(l)(
263
263
  "ap.apUpload.maxUploadPictureSize",
264
- { maxSize: i(w) }
264
+ { maxSize: i(U) }
265
265
  )}`), 1))
266
266
  ])
267
267
  ], 2));
268
268
  }
269
269
  });
270
270
  export {
271
- De as default
271
+ Oe as default
272
272
  };