@aplus-frontend/ui 0.2.0-beta.3 → 0.2.0-beta.5

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 (89) hide show
  1. package/es/src/ap-field/hooks/use-default-placeholder.mjs +14 -14
  2. package/es/src/ap-form/item-text/style/css.d.ts +0 -1
  3. package/es/src/ap-form/item-text/style/css.js +1 -1
  4. package/es/src/ap-form/item-text/style/index.d.ts +0 -1
  5. package/es/src/ap-form/item-text/style/index.js +1 -1
  6. package/es/src/ap-form/item-text-group/style/css.d.ts +0 -0
  7. package/es/src/ap-form/item-text-group/style/css.js +1 -0
  8. package/es/src/ap-form/item-text-group/style/index.d.ts +0 -0
  9. package/es/src/ap-form/item-text-group/style/index.js +1 -0
  10. package/es/src/ap-form/items/checkbox/index.vue.d.ts +1 -1
  11. package/es/src/ap-form/items/date/index.vue.d.ts +1 -1
  12. package/es/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  13. package/es/src/ap-form/items/interface.d.ts +11 -0
  14. package/es/src/ap-form/items/number/index.vue.d.ts +1 -1
  15. package/es/src/ap-form/items/radio/index.vue.d.ts +1 -1
  16. package/es/src/ap-form/items/select/index.vue.d.ts +1 -1
  17. package/es/src/ap-form/items/switch/index.vue.d.ts +1 -1
  18. package/es/src/ap-form/items/text/group.vue.d.ts +42 -0
  19. package/es/src/ap-form/items/text/group.vue.mjs +4 -0
  20. package/es/src/ap-form/items/text/group.vue2.mjs +26 -0
  21. package/es/src/ap-form/items/text/index.d.ts +3 -1
  22. package/es/src/ap-form/items/text/index.mjs +10 -6
  23. package/es/src/ap-form/items/text/index.vue.d.ts +1 -1
  24. package/es/src/ap-form/items/text/password.vue.d.ts +1 -1
  25. package/es/src/ap-form/items/text-area/index.vue.d.ts +1 -1
  26. package/es/src/ap-table/ap-table.vue.mjs +103 -108
  27. package/es/src/ap-table/constants.d.ts +192 -190
  28. package/es/src/ap-table/utils.d.ts +197 -233
  29. package/es/src/ap-table/utils.mjs +69 -80
  30. package/es/src/ap-upload/apUpload.vue.d.ts +18 -2
  31. package/es/src/ap-upload/apUpload.vue.mjs +54 -42
  32. package/es/src/ap-upload/apUploadTypes.d.ts +24 -1
  33. package/es/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  34. package/es/src/ap-upload/components/MultipleFile.vue2.mjs +97 -91
  35. package/es/src/ap-upload/components/Picture.vue.d.ts +44 -1
  36. package/es/src/ap-upload/components/Picture.vue2.mjs +182 -153
  37. package/es/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  38. package/es/src/ap-upload/components/SingleFile.vue2.mjs +84 -86
  39. package/es/src/business/ap-label/constans.d.ts +1 -1
  40. package/es/src/business/ap-label/interface.d.ts +2 -2
  41. package/es/src/editable-table/hooks/use-get-columns.mjs +29 -34
  42. package/es/src/locale/lang/en.mjs +4 -0
  43. package/es/src/locale/lang/zh-cn.mjs +4 -0
  44. package/es/src/path-map.mjs +3 -1
  45. package/lib/src/ap-field/hooks/use-default-placeholder.js +1 -1
  46. package/lib/src/ap-form/item-text/style/css.d.ts +0 -1
  47. package/lib/src/ap-form/item-text/style/css.js +1 -1
  48. package/lib/src/ap-form/item-text/style/index.d.ts +0 -1
  49. package/lib/src/ap-form/item-text/style/index.js +1 -1
  50. package/lib/src/ap-form/item-text-group/style/css.d.ts +0 -0
  51. package/lib/src/ap-form/item-text-group/style/css.js +1 -0
  52. package/lib/src/ap-form/item-text-group/style/index.d.ts +0 -0
  53. package/lib/src/ap-form/item-text-group/style/index.js +1 -0
  54. package/lib/src/ap-form/items/checkbox/index.vue.d.ts +1 -1
  55. package/lib/src/ap-form/items/date/index.vue.d.ts +1 -1
  56. package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  57. package/lib/src/ap-form/items/interface.d.ts +11 -0
  58. package/lib/src/ap-form/items/number/index.vue.d.ts +1 -1
  59. package/lib/src/ap-form/items/radio/index.vue.d.ts +1 -1
  60. package/lib/src/ap-form/items/select/index.vue.d.ts +1 -1
  61. package/lib/src/ap-form/items/switch/index.vue.d.ts +1 -1
  62. package/lib/src/ap-form/items/text/group.vue.d.ts +42 -0
  63. package/lib/src/ap-form/items/text/group.vue.js +1 -0
  64. package/lib/src/ap-form/items/text/group.vue2.js +1 -0
  65. package/lib/src/ap-form/items/text/index.d.ts +3 -1
  66. package/lib/src/ap-form/items/text/index.js +1 -1
  67. package/lib/src/ap-form/items/text/index.vue.d.ts +1 -1
  68. package/lib/src/ap-form/items/text/password.vue.d.ts +1 -1
  69. package/lib/src/ap-form/items/text-area/index.vue.d.ts +1 -1
  70. package/lib/src/ap-table/ap-table.vue.js +1 -1
  71. package/lib/src/ap-table/constants.d.ts +192 -190
  72. package/lib/src/ap-table/utils.d.ts +197 -233
  73. package/lib/src/ap-table/utils.js +1 -1
  74. package/lib/src/ap-upload/apUpload.vue.d.ts +18 -2
  75. package/lib/src/ap-upload/apUpload.vue.js +1 -1
  76. package/lib/src/ap-upload/apUploadTypes.d.ts +24 -1
  77. package/lib/src/ap-upload/components/MultipleFile.vue.d.ts +4 -1
  78. package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
  79. package/lib/src/ap-upload/components/Picture.vue.d.ts +44 -1
  80. package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
  81. package/lib/src/ap-upload/components/SingleFile.vue.d.ts +4 -1
  82. package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
  83. package/lib/src/business/ap-label/constans.d.ts +1 -1
  84. package/lib/src/business/ap-label/interface.d.ts +2 -2
  85. package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
  86. package/lib/src/locale/lang/en.js +1 -1
  87. package/lib/src/locale/lang/zh-cn.js +1 -1
  88. package/lib/src/path-map.js +1 -1
  89. package/package.json +4 -4
@@ -1,83 +1,91 @@
1
- import { defineComponent as $, inject as n, ref as j, watch as W, nextTick as G, openBlock as x, createElementBlock as C, normalizeClass as H, unref as s, createVNode as _, withCtx as b, createElementVNode as L, createTextVNode as J, toDisplayString as S, withModifiers as K, createBlock as Q, resolveDynamicComponent as V, createCommentVNode as X } from "vue";
1
+ import { defineComponent as $, inject as n, ref as j, watch as V, nextTick as W, openBlock as h, createElementBlock as k, normalizeClass as G, unref as s, createVNode as C, withCtx as E, createElementVNode as L, createTextVNode as H, toDisplayString as b, withModifiers as J, createBlock as K, resolveDynamicComponent as Q, createCommentVNode as X } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import { getPath as Y, getName as Z, getReturnData as y } from "../utils/returnData.mjs";
3
+ import { getPath as Y, getName as Z, getReturnData as S } from "../utils/returnData.mjs";
4
4
  import { useOss as ee, getOssInstance as te } from "../hooks/useOss.mjs";
5
- import { message as c, Upload as oe, Button as ae } from "ant-design-vue";
5
+ import { message as m, Upload as oe, Button as ae } from "ant-design-vue";
6
6
  import { UploadOutlined as se } from "@ant-design/icons-vue";
7
7
  import { fileMatchesAccept as ne, getAcceptText as ie } from "../utils/accept.mjs";
8
8
  import { useLocale as re } from "../../config-provider/hooks/use-locale.mjs";
9
9
  import { useNamespace as le } from "../../config-provider/hooks/use-namespace.mjs";
10
10
  const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 }, Ce = /* @__PURE__ */ $({
11
11
  __name: "MultipleFile",
12
- setup(me) {
13
- const { t: i } = re(), { b: U } = le("ap-upload-multiple-file"), { put: B } = ee(), I = n("theme"), P = n("dirName"), w = n("accept") || "*", A = n("maxSize") ?? 500, z = n("title") || i("ap.apUpload.uploadFile"), h = n("subTitle"), r = n("maxCount") ?? 10, m = n("uploadingCount"), F = n("beforeUpload"), N = n("customRequest"), R = n("getOssAccess"), a = n("value"), g = [], d = n("needName"), p = j(null);
14
- W(
12
+ setup(me, { expose: B }) {
13
+ const { t: i } = re(), { b: U } = le("ap-upload-multiple-file"), { put: I } = ee(), P = n("theme"), z = n("dirName"), x = n("accept") || "*", _ = n("maxSize") ?? 500, R = n("title") || i("ap.apUpload.uploadFile"), f = n("subTitle"), r = n("maxCount") ?? 10, d = n("uploadingCount"), A = n("beforeUpload"), F = n("customRequest"), O = n("getOssAccess"), a = n("value"), p = [], g = n("needName"), l = j(null);
14
+ V(
15
15
  () => a == null ? void 0 : a.value,
16
16
  function(e) {
17
17
  var t, o;
18
- !((o = (t = p == null ? void 0 : p.value) == null ? void 0 : t.fileList) != null && o.length) && e && G(() => {
19
- const l = e.map((u) => {
20
- const E = Y(d, u), M = Z(d, u), k = new File(
21
- [u],
22
- M,
23
- {}
24
- );
25
- return k.response = E, k.uid = E, k;
26
- });
27
- if (r && l.length > r) {
28
- c.warning(
29
- i("ap.apUpload.fileInitializationException", {
30
- maxCount: r
31
- })
32
- );
33
- return;
34
- }
35
- l.forEach((u) => {
36
- f.push(u), g.push({
37
- uid: u.uid,
38
- path: u.response
39
- });
40
- }), p.value.fileList = l;
41
- });
18
+ !((o = (t = l == null ? void 0 : l.value) == null ? void 0 : t.fileList) != null && o.length) && e && N(e);
42
19
  },
43
20
  { immediate: !0 }
44
21
  );
45
- let f = [], T;
22
+ function N(e) {
23
+ if (!e) {
24
+ c = [], l.value.fileList = [], a.value = void 0, p.splice(0, p.length);
25
+ return;
26
+ }
27
+ W(() => {
28
+ const t = e.map((o) => {
29
+ const u = Y(g, o), y = Z(g, o), w = new File(
30
+ [o],
31
+ y,
32
+ {}
33
+ );
34
+ return w.response = u, w.uid = u, w;
35
+ });
36
+ if (r && t.length > r) {
37
+ m.warning(
38
+ i("ap.apUpload.fileInitializationException", {
39
+ maxCount: r
40
+ })
41
+ );
42
+ return;
43
+ }
44
+ t.forEach((o) => {
45
+ c.push(o), p.push({
46
+ uid: o.uid,
47
+ path: o.response
48
+ });
49
+ }), l.value.fileList = t, a.value = e;
50
+ });
51
+ }
52
+ B({ setValue: N });
53
+ let c = [], T;
46
54
  function v(e) {
47
55
  setTimeout(() => {
48
- const t = p.value.fileList.findIndex(
56
+ const t = l.value.fileList.findIndex(
49
57
  (o) => o.uid === e.uid
50
58
  );
51
- t >= 0 && p.value.fileList.splice(t, 1);
59
+ t >= 0 && l.value.fileList.splice(t, 1);
52
60
  });
53
61
  }
54
- function O(e) {
55
- if (r && r > 1 && f.length >= r)
62
+ function q(e) {
63
+ if (r && r > 1 && c.length >= r)
56
64
  return clearTimeout(T), T = setTimeout(() => {
57
- c.warning(
65
+ m.warning(
58
66
  i("ap.apUpload.maxUploadFiles", {
59
67
  maxCount: r
60
68
  })
61
69
  );
62
70
  }), v(e), !1;
63
- if (typeof F == "function") {
64
- if (F(e) === !1)
71
+ if (typeof A == "function") {
72
+ if (A(e) === !1)
65
73
  return v(e), !1;
66
74
  } else {
67
- if (e.size > A * 1024 * 1024)
68
- return c.warning(
75
+ if (e.size > _ * 1024 * 1024)
76
+ return m.warning(
69
77
  i("ap.apUpload.maxUploadFileSize", {
70
- maxSize: A
78
+ maxSize: _
71
79
  })
72
80
  ), v(e), !1;
73
- if (!ne(e, w))
74
- return c.warning(i("ap.apUpload.fileFormatNotSupported")), v(e), !1;
81
+ if (!ne(e, x))
82
+ return m.warning(i("ap.apUpload.fileFormatNotSupported")), v(e), !1;
75
83
  }
76
- r && r === 1 && (f = [], a.value = void 0), f.push(e);
84
+ r && r === 1 && (c = [], a.value = void 0), c.push(e);
77
85
  }
78
- async function q(e) {
79
- if (m.value++, typeof N == "function") {
80
- N({
86
+ async function D(e) {
87
+ if (d.value++, typeof F == "function") {
88
+ F({
81
89
  onProgress: (t) => {
82
90
  setTimeout(() => {
83
91
  e.onProgress({
@@ -86,50 +94,48 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
86
94
  });
87
95
  },
88
96
  onError: (t) => {
89
- c.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
97
+ m.warning(t || i("ap.apUpload.networkAnomaly")), setTimeout(() => {
90
98
  e.onError({
91
99
  name: t,
92
100
  message: t
93
101
  });
94
- }), m.value--;
102
+ }), d.value--;
95
103
  },
96
104
  onSuccess: (t) => {
97
105
  setTimeout(() => {
98
106
  e.onSuccess(t);
99
- }), a.value ? a.value.push(
100
- y(d, t, e.file.name)
101
- ) : a.value = [
102
- y(d, t, e.file.name)
103
- ], g.push({
107
+ }), a.value = [
108
+ ...a.value || [],
109
+ S(g, t, e.file.name)
110
+ ], p.push({
104
111
  uid: e.file.uid,
105
112
  path: t
106
- }), m.value--;
113
+ }), d.value--;
107
114
  },
108
115
  file: e.file
109
116
  });
110
117
  return;
111
118
  }
112
119
  try {
113
- const t = await te(R);
114
- e.file.oss = t, B({
120
+ const t = await te(O);
121
+ e.file.oss = t, I({
115
122
  file: e.file,
116
- dirName: P,
123
+ dirName: z,
117
124
  oss: t,
118
125
  successCallBack(o) {
119
- e.onSuccess(o), a.value ? a.value.push(
120
- y(d, o, e.file.name)
121
- ) : a.value = [
122
- y(d, o, e.file.name)
123
- ], g.push({
126
+ e.onSuccess(o), a.value = [
127
+ ...a.value || [],
128
+ S(g, o, e.file.name)
129
+ ], p.push({
124
130
  uid: e.file.uid,
125
131
  path: o
126
- }), m.value--;
132
+ }), d.value--;
127
133
  },
128
134
  errorCallBack(o) {
129
- c.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
135
+ m.warning(o || i("ap.apUpload.networkAnomaly")), e.onError({
130
136
  name: o,
131
137
  message: o
132
- }), m.value--;
138
+ }), d.value--;
133
139
  },
134
140
  progressCallBack(o) {
135
141
  e.onProgress({
@@ -138,38 +144,38 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
138
144
  }
139
145
  });
140
146
  } catch (t) {
141
- c.warning(
147
+ m.warning(
142
148
  typeof (t == null ? void 0 : t.message) == "string" ? t.message : i("ap.apUpload.networkAnomaly")
143
149
  ), e.onError({
144
150
  name: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly"),
145
151
  message: (t == null ? void 0 : t.message) || i("ap.apUpload.networkAnomaly")
146
- }), m.value--;
152
+ }), d.value--;
147
153
  }
148
154
  }
149
- function D(e) {
155
+ function M(e) {
150
156
  var o;
151
157
  if (e.response) {
152
158
  if (Array.isArray(a.value)) {
153
- const l = g.findIndex((u) => u.uid === e.uid);
154
- l >= 0 && (a == null || a.value.splice(l, 1), g.splice(l, 1)), a.value.length === 0 && (a.value = void 0);
159
+ const u = p.findIndex((y) => y.uid === e.uid);
160
+ u >= 0 && (a == null || a.value.splice(u, 1), p.splice(u, 1)), a.value.length === 0 && (a.value = void 0);
155
161
  }
156
162
  } else
157
163
  (o = e == null ? void 0 : e.oss) == null || o.pauseUpload();
158
- const t = f.findIndex(
159
- (l) => l.uid === e.uid
164
+ const t = c.findIndex(
165
+ (u) => u.uid === e.uid
160
166
  );
161
- return f.splice(t, 1), Promise.resolve(!0);
167
+ return c.splice(t, 1), Promise.resolve(!0);
162
168
  }
163
- return (e, t) => (x(), C("div", {
164
- class: H({
169
+ return (e, t) => (h(), k("div", {
170
+ class: G({
165
171
  [s(U)()]: !0,
166
- [s(U)("admin")]: s(I) === "admin"
172
+ [s(U)("admin")]: s(P) === "admin"
167
173
  })
168
174
  }, [
169
- _(s(oe), {
175
+ C(s(oe), {
170
176
  ref_key: "uploadRef",
171
- ref: p,
172
- accept: s(w),
177
+ ref: l,
178
+ accept: s(x),
173
179
  multiple: "",
174
180
  maxCount: s(r),
175
181
  progress: {
@@ -177,26 +183,26 @@ const ue = { class: "multiple-file-context" }, pe = { key: 0 }, ce = { key: 1 },
177
183
  showInfo: !1,
178
184
  strokeColor: "#0070FF"
179
185
  },
180
- beforeUpload: O,
181
- customRequest: q,
182
- onRemove: D
186
+ beforeUpload: q,
187
+ customRequest: D,
188
+ onRemove: M
183
189
  }, {
184
- default: b(() => [
190
+ default: E(() => [
185
191
  L("div", ue, [
186
- _(s(ae), { class: "file-btn" }, {
187
- default: b(() => [
188
- _(s(se)),
189
- J(" " + S(s(z)), 1)
192
+ C(s(ae), { class: "file-btn" }, {
193
+ default: E(() => [
194
+ C(s(se)),
195
+ H(" " + b(s(R)), 1)
190
196
  ]),
191
197
  _: 1
192
198
  }),
193
199
  L("div", {
194
200
  class: "sub-title",
195
- onClick: t[0] || (t[0] = K(() => {
201
+ onClick: t[0] || (t[0] = J(() => {
196
202
  }, ["stop"]))
197
203
  }, [
198
- typeof s(h) == "string" ? (x(), C("div", pe, S(s(h) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(w))}`), 1)) : s(h) ? (x(), C("div", ce, [
199
- (x(), Q(V(s(h))))
204
+ typeof s(f) == "string" ? (h(), k("div", pe, b(s(f) || `${s(i)("ap.apUpload.supportExtension")}:${s(ie)(s(x))}`), 1)) : s(f) ? (h(), k("div", ce, [
205
+ (h(), K(Q(s(f))))
200
206
  ])) : X("", !0)
201
207
  ])
202
208
  ])
@@ -1,3 +1,46 @@
1
+ import { Oss } from '../hooks/useOss';
1
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
3
+ declare function setValue(val?: (string | Record<string, any>)[]): void;
4
+ interface UploadFile extends File {
5
+ uid: string;
6
+ thumbUrl?: string;
7
+ status: 'error' | 'success' | 'done' | 'uploading' | 'removed';
8
+ percent: number;
9
+ path?: string;
10
+ oss?: Oss;
11
+ [key: string | number | symbol]: any;
12
+ }
13
+ declare function handleRemove(uploadFile: UploadFile): Promise<boolean>;
14
+ declare function __VLS_template(): {
15
+ slots: {
16
+ pictureContext?(_: {
17
+ fileList: {
18
+ oss: {
19
+ pauseUpload: (() => Promise<{
20
+ status: number;
21
+ previewUrl?: string;
22
+ saveUrl?: string;
23
+ originalFileName?: string;
24
+ message: string;
25
+ }>) | undefined;
26
+ };
27
+ }[];
28
+ remove: typeof handleRemove;
29
+ }): any;
30
+ };
31
+ refs: {
32
+ fileRef: HTMLInputElement;
33
+ };
34
+ attrs: Partial<{}>;
35
+ };
36
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
37
+ declare const __VLS_component: DefineComponent<{}, {
38
+ setValue: typeof setValue;
39
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
40
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
3
41
  export default _default;
42
+ type __VLS_WithTemplateSlots<T, S> = T & {
43
+ new (): {
44
+ $slots: S;
45
+ };
46
+ };