@aplus-frontend/ui 0.2.12 → 0.2.13

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 (31) hide show
  1. package/es/src/ap-table/ap-table.vue2.mjs +64 -65
  2. package/es/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +20 -0
  3. package/es/src/ap-table/components/paragraph-ellipsis/index.vue.mjs +4 -0
  4. package/es/src/ap-table/components/paragraph-ellipsis/index.vue2.mjs +82 -0
  5. package/es/src/business/ap-image/ApImage.vue.d.ts +39 -1
  6. package/es/src/business/ap-image/ApImage.vue2.mjs +78 -30
  7. package/es/src/business/ap-image/hooks/useOss.mjs +35 -26
  8. package/es/src/business/ap-image/index.d.ts +41 -1
  9. package/es/src/business/ap-image/interface.d.ts +1 -0
  10. package/es/src/business/ap-image/style/css.d.ts +0 -1
  11. package/es/src/business/ap-image/style/css.js +1 -1
  12. package/es/src/business/ap-image/style/index.d.ts +0 -1
  13. package/es/src/business/ap-image/style/index.js +1 -1
  14. package/es/src/locale/lang/en.mjs +4 -0
  15. package/es/src/locale/lang/zh-cn.mjs +4 -0
  16. package/lib/src/ap-table/ap-table.vue2.js +1 -1
  17. package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.d.ts +20 -0
  18. package/lib/src/ap-table/components/paragraph-ellipsis/index.vue.js +1 -0
  19. package/lib/src/ap-table/components/paragraph-ellipsis/index.vue2.js +1 -0
  20. package/lib/src/business/ap-image/ApImage.vue.d.ts +39 -1
  21. package/lib/src/business/ap-image/ApImage.vue2.js +1 -1
  22. package/lib/src/business/ap-image/hooks/useOss.js +1 -1
  23. package/lib/src/business/ap-image/index.d.ts +41 -1
  24. package/lib/src/business/ap-image/interface.d.ts +1 -0
  25. package/lib/src/business/ap-image/style/css.d.ts +0 -1
  26. package/lib/src/business/ap-image/style/css.js +1 -1
  27. package/lib/src/business/ap-image/style/index.d.ts +0 -1
  28. package/lib/src/business/ap-image/style/index.js +1 -1
  29. package/lib/src/locale/lang/en.js +1 -1
  30. package/lib/src/locale/lang/zh-cn.js +1 -1
  31. package/package.json +2 -2
@@ -1,22 +1,24 @@
1
- import { defineComponent as ve, useSlots as Te, ref as z, computed as s, unref as r, createVNode as y, Fragment as U, watchEffect as Fe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as h, createSlots as J, withCtx as F, renderList as Q, createBlock as X, resolveDynamicComponent as Be, renderSlot as w, createCommentVNode as Y, createElementVNode as I, normalizeProps as xe, guardReactiveProps as ke } from "vue";
2
- import { Typography as Pe, Divider as ze, Table as Ie } from "@aplus-frontend/antdv";
3
- import { useToken as Ne } from "@aplus-frontend/antdv/es/theme/internal";
4
- import { ApForm as Ee } from "../ap-form/index.mjs";
5
- import { noRenderAsFormItemValueList as Z } from "./constants.mjs";
1
+ import { defineComponent as ve, useSlots as Te, ref as P, computed as s, unref as r, createVNode as y, Fragment as U, watchEffect as Fe, watch as G, openBlock as p, createElementBlock as T, normalizeClass as f, normalizeStyle as M, mergeProps as w, createSlots as _, withCtx as F, renderList as J, createBlock as Q, resolveDynamicComponent as Be, renderSlot as h, createCommentVNode as X, createElementVNode as I, normalizeProps as xe, guardReactiveProps as ke } from "vue";
2
+ import { Divider as ze, Table as Pe } from "@aplus-frontend/antdv";
3
+ import { useToken as Ie } from "@aplus-frontend/antdv/es/theme/internal";
4
+ import { ApForm as Ne } from "../ap-form/index.mjs";
5
+ import { noRenderAsFormItemValueList as Y } from "./constants.mjs";
6
6
  import "../config-provider/index.mjs";
7
- import { useTablePaging as Ke } from "./hooks/use-table-paging.mjs";
8
- import { omit as _, isUndefined as m, isBoolean as Le } from "lodash-unified";
9
- import { apColumnToColumn as Oe, getTableTitle as Ve, getTableRenderType as De, getTableRenderProps as Ae, getTableCellRenderNode as je, getColumnOrder as ee, updateFormProps as We, getFieldProps as $e, getSearchFormItemRenderNode as He, recursionApColumns as ae, objectToString as qe } from "./utils.mjs";
10
- import Ue from "./hooks/use-table-content-height.mjs";
11
- import { getRawDisplayValue as Ge } from "../editable-table/utils.mjs";
12
- import Me from "./hooks/use-table-row-selection.mjs";
13
- import { isDef as Je } from "../utils/index.mjs";
7
+ import { useTablePaging as Ee } from "./hooks/use-table-paging.mjs";
8
+ import { omit as Z, isUndefined as m, isBoolean as Ke } from "lodash-unified";
9
+ import { apColumnToColumn as Le, getTableTitle as Oe, getTableRenderType as Ve, getTableRenderProps as De, getTableCellRenderNode as Ae, getColumnOrder as ee, updateFormProps as je, getFieldProps as $e, getSearchFormItemRenderNode as We, recursionApColumns as ae, objectToString as He } from "./utils.mjs";
10
+ import qe from "./hooks/use-table-content-height.mjs";
11
+ import { getRawDisplayValue as Ue } from "../editable-table/utils.mjs";
12
+ import Ge from "./hooks/use-table-row-selection.mjs";
13
+ import { isDef as Me } from "../utils/index.mjs";
14
14
  import "./components/setting/modal/index.vue.mjs";
15
- import { useProvideApTable as Qe } from "./context.mjs";
16
- import { useNamespace as Xe } from "../config-provider/hooks/use-namespace.mjs";
17
- import { useGlobalConfig as Ye } from "../config-provider/hooks/use-global-config.mjs";
18
- import Ze from "./components/setting/modal/index.vue2.mjs";
19
- const ha = /* @__PURE__ */ ve({
15
+ import "./components/paragraph-ellipsis/index.vue.mjs";
16
+ import { useProvideApTable as _e } from "./context.mjs";
17
+ import { useNamespace as Je } from "../config-provider/hooks/use-namespace.mjs";
18
+ import { useGlobalConfig as Qe } from "../config-provider/hooks/use-global-config.mjs";
19
+ import Xe from "./components/paragraph-ellipsis/index.vue2.mjs";
20
+ import Ye from "./components/setting/modal/index.vue2.mjs";
21
+ const Sa = /* @__PURE__ */ ve({
20
22
  name: "ApTable",
21
23
  __name: "ap-table",
22
24
  props: {
@@ -145,15 +147,15 @@ const ha = /* @__PURE__ */ ve({
145
147
  }) {
146
148
  const a = oe;
147
149
  let N = 0;
148
- const S = Te(), [, re] = Ne(), {
150
+ const S = Te(), [, re] = Ie(), {
149
151
  e: B,
150
152
  b: i,
151
153
  be: E
152
- } = Xe("ap-table"), K = Ye("valueTypeMap"), {
154
+ } = Je("ap-table"), K = Qe("valueTypeMap"), {
153
155
  height: le,
154
156
  contentRef: ne
155
- } = Ue(), x = z(a.size), d = z([]), L = z([]);
156
- Qe({
157
+ } = qe(), x = P(a.size), d = P([]), L = P([]);
158
+ _e({
157
159
  columns: s(() => d.value),
158
160
  columnsBackup: s(() => L.value),
159
161
  size: s(() => x.value),
@@ -169,36 +171,36 @@ const ha = /* @__PURE__ */ ve({
169
171
  let e = ((t = a.columns) == null ? void 0 : t.filter((l) => !l.hideInTable)) || [];
170
172
  function o(l, u) {
171
173
  return l.map((n) => ({
172
- resizable: Je(n.resizable) ? n.resizable : a.columnResizable,
173
- ..._(Oe(n), ["ellipsis"]),
174
+ resizable: Me(n.resizable) ? n.resizable : a.columnResizable,
175
+ ...Z(Le(n), ["ellipsis"]),
174
176
  fixed: u ? u.fixed : n.fixed,
175
- title: Ve(n, E("table-header", "title"), S.headerCell, r(re).colorPrimary),
177
+ title: Oe(n, E("table-header", "title"), S.headerCell, r(re).colorPrimary),
176
178
  customRender({
177
179
  value: c,
178
180
  ...g
179
181
  }) {
180
182
  var H, q;
181
- const W = De(n), be = Ae({
183
+ const $ = Ve(n), be = De({
182
184
  ...n,
183
- valueType: W
185
+ valueType: $
184
186
  }, {
185
187
  value: c,
186
188
  ...g
187
- }), Re = je(W, be, g.record, r(K)), $ = ((H = n.renderText) == null ? void 0 : H.call(n, {
189
+ }), Re = Ae($, be, g.record, r(K)), W = ((H = n.renderText) == null ? void 0 : H.call(n, {
188
190
  value: c,
189
191
  ...g
190
192
  })) || c, Ce = n.renderText ? y(U, null, [(q = n.renderText) == null ? void 0 : q.call(n, {
191
193
  value: c,
192
194
  ...g
193
195
  })]) : Re;
194
- let P = ye(n, $, Ce);
195
- return n.customRender && (P = n.customRender({
196
+ let z = ye(n, W, Ce);
197
+ return n.customRender && (z = n.customRender({
196
198
  value: c,
197
199
  ...g,
198
200
  column: n,
199
- originalNode: P,
200
- originalText: $
201
- })), P;
201
+ originalNode: z,
202
+ originalText: W
203
+ })), z;
202
204
  },
203
205
  children: o(n.children || [], u || n)
204
206
  }));
@@ -211,11 +213,11 @@ const ha = /* @__PURE__ */ ve({
211
213
  });
212
214
  const O = s(() => {
213
215
  var e, o, t;
214
- return N++, ((t = (o = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Z.includes(l.valueType))) == null ? void 0 : o.sort((l, u) => {
216
+ return N++, ((t = (o = (e = a.columns) == null ? void 0 : e.filter((l) => !l.hideInSearch && l.dataIndex && (l.valueType || l.customRenderFormItem) && !Y.includes(l.valueType))) == null ? void 0 : o.sort((l, u) => {
215
217
  let n = ee(l.order);
216
218
  return ee(u.order) - n;
217
219
  })) == null ? void 0 : t.map((l) => {
218
- const u = We(l, $e(l.fieldProps, {})), n = {
220
+ const u = je(l, $e(l.fieldProps, {})), n = {
219
221
  ...l,
220
222
  fieldProps: {
221
223
  label: l.title,
@@ -225,7 +227,7 @@ const ha = /* @__PURE__ */ ve({
225
227
  },
226
228
  renderNode: void 0
227
229
  };
228
- return n.renderNode = He(n, r(K)), n;
230
+ return n.renderNode = We(n, r(K)), n;
229
231
  })) || [];
230
232
  }), de = s(() => ae(r(d), (e) => {
231
233
  if (e.sorter === !0)
@@ -237,7 +239,7 @@ const ha = /* @__PURE__ */ ve({
237
239
  rowSelection: b,
238
240
  selectedRows: R,
239
241
  ...C
240
- } = Me({
242
+ } = Ge({
241
243
  ...a.rowSelection === !0 ? {} : a.rowSelection,
242
244
  rowKey: a.rowKey,
243
245
  dataSource: ie
@@ -249,7 +251,7 @@ const ha = /* @__PURE__ */ ve({
249
251
  refresh: ce,
250
252
  data: v,
251
253
  setDataSource: pe
252
- } = Ke({
254
+ } = Ee({
253
255
  async request(e) {
254
256
  var t, l;
255
257
  if (!b.value.preserveSelectedRowKeys && m(a.dataSource) && C.clearAll(), !m(a.dataSource))
@@ -305,21 +307,18 @@ const ha = /* @__PURE__ */ ve({
305
307
  };
306
308
  }), ge = s(() => [i(), a.card ? null : i("wrapper"), a.adaptive ? i("adaptive") : null].filter(Boolean));
307
309
  function ye(e, o, t) {
308
- if (Z.includes(e.valueType))
310
+ if (Y.includes(e.valueType))
309
311
  return t;
310
- const l = qe(o);
311
- return e.copyable || e.ellipsis ? y(Pe.Paragraph, {
312
- copyable: e.copyable ? {
313
- text: l,
314
- tooltip: !1
315
- } : !1,
316
- ellipsis: e.ellipsis ? Le(e.ellipsis) ? {
312
+ const l = He(o);
313
+ return e.copyable || e.ellipsis ? y(Xe, {
314
+ copyable: e.copyable,
315
+ ellipsis: e.ellipsis ? Ke(e.ellipsis) ? {
317
316
  tooltip: l
318
317
  } : {
319
318
  ...e.ellipsis,
320
319
  tooltip: l
321
320
  } : !1,
322
- content: e.ellipsis ? Ge(e, o) : t
321
+ content: e.ellipsis ? Ue(e, o) : t
323
322
  }, null) : t;
324
323
  }
325
324
  G(() => r(v).loading, (e) => {
@@ -330,11 +329,11 @@ const ha = /* @__PURE__ */ ve({
330
329
  }, {
331
330
  immediate: !0
332
331
  });
333
- function he(e) {
332
+ function we(e) {
334
333
  var o, t, l;
335
334
  (l = (t = (o = k.value) == null ? void 0 : o.apForm) == null ? void 0 : t.setFieldsValue) == null || l.call(t, e);
336
335
  }
337
- function we() {
336
+ function he() {
338
337
  var e, o, t;
339
338
  return (t = (o = (e = k.value) == null ? void 0 : e.apForm) == null ? void 0 : o.getFieldsValue) == null ? void 0 : t.call(o, !0);
340
339
  }
@@ -345,8 +344,8 @@ const ha = /* @__PURE__ */ ve({
345
344
  submit: () => V(),
346
345
  reset: () => D(),
347
346
  refresh: () => ce(),
348
- setSearchFormValues: he,
349
- getSearchFormValues: we,
347
+ setSearchFormValues: we,
348
+ getSearchFormValues: he,
350
349
  getShownColumns: Se,
351
350
  dataSource: s(() => r(v).records),
352
351
  rowSelection: {
@@ -359,15 +358,15 @@ const ha = /* @__PURE__ */ ve({
359
358
  key: 0,
360
359
  class: f(e.card ? r(B)("search-wrapper") : null),
361
360
  style: M(e.searchFormWrapperStyle)
362
- }, [y(r(Ee).SearchForm, h(e.searchForm || {}, {
361
+ }, [y(r(Ne).SearchForm, w(e.searchForm || {}, {
363
362
  ref_key: "formRef",
364
363
  ref: k,
365
364
  "custom-reset": "",
366
365
  onSubmit: r(V),
367
366
  onReset: r(D),
368
367
  "submit-loading": r(A).loading
369
- }), J({
370
- default: F(() => [(p(!0), T(U, null, Q(O.value, (t) => (p(), X(Be(t.renderNode), h({
368
+ }), _({
369
+ default: F(() => [(p(!0), T(U, null, J(O.value, (t) => (p(), Q(Be(t.renderNode), w({
371
370
  key: t.dataIndex,
372
371
  ref_for: !0
373
372
  }, t.fieldProps || {}, {
@@ -376,9 +375,9 @@ const ha = /* @__PURE__ */ ve({
376
375
  _: 2
377
376
  }, [S.searchFormExtra ? {
378
377
  name: "extra",
379
- fn: F(() => [w(e.$slots, "searchFormExtra")]),
378
+ fn: F(() => [h(e.$slots, "searchFormExtra")]),
380
379
  key: "0"
381
- } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : Y("", !0), I("div", {
380
+ } : void 0]), 1040, ["onSubmit", "onReset", "submit-loading"])], 6)) : X("", !0), I("div", {
382
381
  ref_key: "contentRef",
383
382
  ref: ne,
384
383
  class: f([r(B)("table-wrapper"), e.card ? r(B)("table-wrapper-card") : null]),
@@ -390,40 +389,40 @@ const ha = /* @__PURE__ */ ve({
390
389
  class: f(r(i)("header"))
391
390
  }, [I("div", {
392
391
  class: f(r(E)("header", "title"))
393
- }, [w(e.$slots, "title", h({
392
+ }, [h(e.$slots, "title", w({
394
393
  selectedRows: r(R),
395
394
  selectedRowKeys: r(b).selectedRowKeys,
396
395
  shownColumns: d.value
397
- }, C))], 2), S.title ? (p(), X(r(ze), {
396
+ }, C))], 2), S.title ? (p(), Q(r(ze), {
398
397
  key: 0,
399
398
  type: "vertical"
400
- })) : Y("", !0), y(Ze, {
399
+ })) : X("", !0), y(Ye, {
401
400
  config: e.settings === !0 ? {} : e.settings
402
- }, null, 8, ["config"])], 2)) : w(e.$slots, "title", h({
401
+ }, null, 8, ["config"])], 2)) : h(e.$slots, "title", w({
403
402
  key: 1,
404
403
  selectedRows: r(R),
405
404
  selectedRowKeys: r(b).selectedRowKeys,
406
405
  shownColumns: d.value
407
- }, C))], 2), y(r(Ie), h({
406
+ }, C))], 2), y(r(Pe), w({
408
407
  class: r(i)("table")
409
408
  }, j.value, {
410
409
  size: x.value,
411
410
  "table-layout": me.value,
412
411
  columns: d.value,
413
412
  onResizeColumn: o[0] || (o[0] = (t, l) => l.width = t)
414
- }), J({
415
- summary: F(() => [w(e.$slots, "summary", {
413
+ }), _({
414
+ summary: F(() => [h(e.$slots, "summary", {
416
415
  columns: d.value,
417
416
  records: j.value.dataSource,
418
417
  selectedRows: r(R)
419
418
  })]),
420
419
  _: 2
421
- }, [Q(r(_)(S, ["title", "searchFormExtra", "headerCell", "summary"]), (t, l) => ({
420
+ }, [J(r(Z)(S, ["title", "searchFormExtra", "headerCell", "summary"]), (t, l) => ({
422
421
  name: l,
423
- fn: F((u) => [w(e.$slots, l, xe(ke(u || {})))])
422
+ fn: F((u) => [h(e.$slots, l, xe(ke(u || {})))])
424
423
  }))]), 1040, ["class", "size", "table-layout", "columns"])], 6)], 2));
425
424
  }
426
425
  });
427
426
  export {
428
- ha as default
427
+ Sa as default
429
428
  };
@@ -0,0 +1,20 @@
1
+ import { VNodeChild, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
2
+ interface Props {
3
+ copyable?: boolean;
4
+ content?: VNodeChild;
5
+ ellipsis?: boolean | {
6
+ rows?: number;
7
+ tooltip?: VNodeChild;
8
+ };
9
+ }
10
+ declare const _default: DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
11
+ export default _default;
12
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
+ type __VLS_TypePropsToOption<T> = {
14
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
15
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
16
+ } : {
17
+ type: PropType<T[K]>;
18
+ required: true;
19
+ };
20
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./index.vue2.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,82 @@
1
+ import { defineComponent as T, ref as _, computed as w, openBlock as o, createElementBlock as f, mergeProps as B, unref as t, createElementVNode as O, normalizeClass as y, createVNode as d, createSlots as x, withCtx as u, createBlock as s, resolveDynamicComponent as v, h as b, Fragment as h, createCommentVNode as E } from "vue";
2
+ import "../../../config-provider/index.mjs";
3
+ import { Tooltip as C } from "@aplus-frontend/antdv";
4
+ import { CopyOutlined as N, CheckOutlined as j } from "@ant-design/icons-vue";
5
+ import { useNamespace as S } from "../../../config-provider/hooks/use-namespace.mjs";
6
+ import { useLocale as V } from "../../../config-provider/hooks/use-locale.mjs";
7
+ const $ = /* @__PURE__ */ T({
8
+ name: "ApTableParagraphEllipsis",
9
+ __name: "index",
10
+ props: {
11
+ copyable: { type: Boolean },
12
+ content: { type: [Object, String, Number, Boolean, null, Array] },
13
+ ellipsis: { type: [Boolean, Object] }
14
+ },
15
+ setup(g) {
16
+ const { b: i } = S("ap-table-paragraph-ellipsis"), { t: m } = V(), e = g, l = _(!1), r = w(() => e.ellipsis === !0 ? {
17
+ rows: 1,
18
+ tooltip: e.content
19
+ } : typeof e.ellipsis == "object" ? Object.assign(
20
+ {
21
+ rows: 1,
22
+ tooltip: e.content
23
+ },
24
+ e.ellipsis
25
+ ) : {});
26
+ function k() {
27
+ var c, a, p;
28
+ const n = ((c = r.value) == null ? void 0 : c.tooltip) ?? ((p = (a = e.content) == null ? void 0 : a.props) == null ? void 0 : p.value) ?? e.content;
29
+ navigator.clipboard.writeText(n), l.value || (l.value = !0, setTimeout(() => {
30
+ l.value = !1;
31
+ }, 2200));
32
+ }
33
+ return (n, c) => {
34
+ var a, p;
35
+ return o(), f("div", B({
36
+ class: [t(i)()]
37
+ }, {
38
+ ...n.$attrs
39
+ }, {
40
+ style: {
41
+ "--ap-table-paragraph-ellipsis-rows": (a = r.value) == null ? void 0 : a.rows
42
+ }
43
+ }), [
44
+ O("div", {
45
+ class: y([t(i)("content")])
46
+ }, [
47
+ d(t(C), null, x({
48
+ default: u(() => [
49
+ (o(), s(v(b(h, [e.content]))))
50
+ ]),
51
+ _: 2
52
+ }, [
53
+ (p = r.value) != null && p.tooltip ? {
54
+ name: "title",
55
+ fn: u(() => [
56
+ (o(), s(v(b(h, [r.value.tooltip]))))
57
+ ]),
58
+ key: "0"
59
+ } : void 0
60
+ ]), 1024)
61
+ ], 2),
62
+ e.copyable ? (o(), f("div", {
63
+ key: 0,
64
+ class: y([t(i)("copyable")]),
65
+ onClick: k
66
+ }, [
67
+ d(t(C), {
68
+ title: l.value ? t(m)("ap.apTable.paragraphEllipsis.copySuccess") : t(m)("ap.apTable.paragraphEllipsis.copy")
69
+ }, {
70
+ default: u(() => [
71
+ l.value ? (o(), s(t(j), { key: 1 })) : (o(), s(t(N), { key: 0 }))
72
+ ]),
73
+ _: 1
74
+ }, 8, ["title"])
75
+ ], 2)) : E("", !0)
76
+ ], 16);
77
+ };
78
+ }
79
+ });
80
+ export {
81
+ $ as default
82
+ };
@@ -1,6 +1,38 @@
1
1
  import { ApImageProps } from './interface';
2
+ import { ImgInfo } from '@aplus-frontend/antdv/es/vc-image/src/Preview';
2
3
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
- declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
4
+ declare function __VLS_template(): {
5
+ slots: {
6
+ toolbarRender?(_: {
7
+ originalNodes: import("vue/jsx-runtime").JSX.Element[];
8
+ actions: {
9
+ onFlipX: () => void;
10
+ onFlipY: () => void;
11
+ onRotateLeft: () => void;
12
+ onRotateRight: () => void;
13
+ onZoomIn: () => void;
14
+ onZoomOut: () => void;
15
+ };
16
+ transform: {
17
+ x: number;
18
+ y: number;
19
+ scale: number;
20
+ rotate: number;
21
+ flip: {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ };
26
+ image: ImgInfo;
27
+ current?: number;
28
+ total?: number;
29
+ }): any;
30
+ };
31
+ refs: {};
32
+ attrs: Partial<{}>;
33
+ };
34
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
35
+ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
4
36
  preview: boolean;
5
37
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
6
38
  preview: boolean;
@@ -14,6 +46,7 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOpti
14
46
  current?: number;
15
47
  };
16
48
  }, {}>;
49
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
50
  export default _default;
18
51
  type __VLS_WithDefaults<P, D> = {
19
52
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
@@ -29,6 +62,11 @@ type __VLS_TypePropsToOption<T> = {
29
62
  required: true;
30
63
  };
31
64
  };
65
+ type __VLS_WithTemplateSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
32
70
  type __VLS_PrettifyLocal<T> = {
33
71
  [K in keyof T]: T[K];
34
72
  } & {};
@@ -1,13 +1,15 @@
1
- import { defineComponent as b, computed as s, ref as k, watchEffect as A, openBlock as O, createBlock as h, unref as l, normalizeProps as _, guardReactiveProps as w } from "vue";
2
- import { Image as U } from "@aplus-frontend/antdv";
3
- import { injectLocaleToOss as y, getOssInstance as B, getSignatureUrl as C } from "./hooks/useOss.mjs";
1
+ import { defineComponent as S, computed as s, ref as U, watchEffect as j, openBlock as i, createBlock as g, unref as n, mergeProps as p, withCtx as B, renderSlot as E, normalizeProps as I, guardReactiveProps as L, createElementVNode as b, normalizeClass as D, createElementBlock as M, Fragment as P, renderList as R, resolveDynamicComponent as T, createVNode as x } from "vue";
2
+ import { Image as z } from "@aplus-frontend/antdv";
3
+ import { DownloadOutlined as V } from "@ant-design/icons-vue";
4
+ import { injectLocaleToOss as W, getOssInstance as G, getSignatureUrl as $ } from "./hooks/useOss.mjs";
4
5
  import "../../config-provider/index.mjs";
5
- import F from "./imgs/admin-fallback.jpg.mjs";
6
- import I from "./imgs/aplus-fallback.jpg.mjs";
7
- import { omit as M } from "lodash-unified";
8
- import { useGlobalConfig as n } from "../../config-provider/hooks/use-global-config.mjs";
9
- import { useLocale as S } from "../../config-provider/hooks/use-locale.mjs";
10
- const T = /* @__PURE__ */ b({
6
+ import q from "./imgs/admin-fallback.jpg.mjs";
7
+ import H from "./imgs/aplus-fallback.jpg.mjs";
8
+ import { omit as J } from "lodash-unified";
9
+ import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
10
+ import { useGlobalConfig as m } from "../../config-provider/hooks/use-global-config.mjs";
11
+ import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
12
+ const se = /* @__PURE__ */ S({
11
13
  __name: "ApImage",
12
14
  props: {
13
15
  getOssAccess: {},
@@ -16,46 +18,92 @@ const T = /* @__PURE__ */ b({
16
18
  alt: {},
17
19
  fallback: {},
18
20
  src: {},
21
+ fileName: {},
19
22
  preview: { type: [Boolean, Object], default: !0 }
20
23
  },
21
- setup(i) {
22
- const e = i, c = {
23
- aplus: I,
24
- admin: F
25
- }, u = n("uiMode"), f = n("apUpload"), { t: m, lang: p } = S(), g = s(
24
+ setup(v) {
25
+ const { b: u } = K("ap-image"), e = v, d = {
26
+ aplus: H,
27
+ admin: q
28
+ }, k = m("uiMode"), w = m("apUpload"), f = m(
29
+ "downloadCenterTriggerConfig"
30
+ ), { t: h, lang: C } = Q(), O = s(
26
31
  () => {
27
32
  var a;
28
- return e.getOssAccess || ((a = f.value) == null ? void 0 : a.getOssAccess);
33
+ return e.getOssAccess || ((a = w.value) == null ? void 0 : a.getOssAccess);
29
34
  }
30
- ), d = s(
31
- () => c[u.value] || c.aplus
32
- ), v = s(() => (e == null ? void 0 : e.fallback) || d.value), t = k("");
33
- return y(m, p), A(async () => {
35
+ ), A = s(
36
+ () => d[k.value] || d.aplus
37
+ ), N = s(() => (e == null ? void 0 : e.fallback) || A.value), r = U("");
38
+ W(h, C), j(async () => {
34
39
  var a;
35
40
  if (!(e != null && e.src)) {
36
- t.value = "";
41
+ r.value = "";
37
42
  return;
38
43
  }
39
44
  if (!((a = e.src) != null && a.startsWith("Frontend-Upload"))) {
40
- t.value = e.src;
45
+ r.value = e.src;
41
46
  return;
42
47
  }
43
48
  try {
44
- const o = await B(g.value), r = await C({
49
+ const o = await G(O.value), t = await $({
45
50
  oss: o,
46
51
  fileName: e.src
47
52
  });
48
- r && (t.value = r);
53
+ t && (r.value = t);
49
54
  } catch {
50
- t.value = "";
55
+ r.value = "";
51
56
  }
52
- }), (a, o) => (O(), h(l(U), _(w({
53
- ...l(M)(e, ["src", "getOssAccess"]),
54
- fallback: v.value,
55
- src: t.value
56
- })), null, 16));
57
+ });
58
+ async function y() {
59
+ var t, l, c;
60
+ if (!(e != null && e.src))
61
+ return;
62
+ const a = e.src, o = e.fileName ?? e.src;
63
+ if (!((t = e.src) != null && t.startsWith("Frontend-Upload"))) {
64
+ _(a, o);
65
+ return;
66
+ }
67
+ if ((l = f.value) != null && l.trigger) {
68
+ let F = [
69
+ {
70
+ objectName: a,
71
+ fileName: o
72
+ }
73
+ ];
74
+ await ((c = f.value) == null ? void 0 : c.trigger(F));
75
+ }
76
+ }
77
+ const _ = (a, o) => {
78
+ const t = document.createElement("a");
79
+ t.href = a, t.rel = "noopener noreferrer", t.setAttribute("download", o), document.body.appendChild(t), t.click(), document.body.removeChild(t);
80
+ };
81
+ return (a, o) => (i(), g(n(z), p({
82
+ class: [n(u)()]
83
+ }, {
84
+ ...n(J)(e, ["src", "getOssAccess"]),
85
+ fallback: N.value,
86
+ src: r.value
87
+ }), {
88
+ toolbarRender: B((t) => [
89
+ E(a.$slots, "toolbarRender", I(L({ ...t })), () => [
90
+ b("div", {
91
+ class: D([n(u)("toolbar")])
92
+ }, [
93
+ (i(!0), M(P, null, R(t.originalNodes, (l, c) => (i(), g(T(l), p({ ref_for: !0 }, t, { key: c }), null, 16))), 128)),
94
+ b("div", {
95
+ class: "ant-image-preview-operations-operation",
96
+ onClick: y
97
+ }, [
98
+ x(n(V))
99
+ ])
100
+ ], 2)
101
+ ])
102
+ ]),
103
+ _: 3
104
+ }, 16, ["class"]));
57
105
  }
58
106
  });
59
107
  export {
60
- T as default
108
+ se as default
61
109
  };
@@ -1,37 +1,46 @@
1
- import { createOssInstance as o } from "@aplus-frontend/oss";
2
- let a, s;
3
- function c(n, t) {
4
- a = n, s = t;
1
+ import { createOssInstance as l } from "@aplus-frontend/oss";
2
+ const r = 1e4;
3
+ let a, i;
4
+ function f(t, n) {
5
+ a = t, i = n;
5
6
  }
6
- const i = {
7
+ const u = {
7
8
  "zh-cn": "zh_CN",
8
9
  en: "en_US"
9
10
  };
10
- function l() {
11
- return i[s.value] ?? "zh_CN";
11
+ function g() {
12
+ return u[i.value] ?? "zh_CN";
12
13
  }
13
- async function p(n) {
14
- if (!n)
14
+ let e;
15
+ async function m(t) {
16
+ if (!t)
15
17
  throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);
16
- const t = o();
17
- return await t.initOssClient({
18
- getOssAccess: n,
19
- locale: l(),
20
- onFailure: (e) => {
21
- throw new Error(
22
- typeof (e == null ? void 0 : e.message) == "string" ? e.message : a("ap.apUpload.FailedToObtainOssTemporaryPermissions")
23
- );
24
- }
25
- }), t;
18
+ return e != null && e.createDate && e.createDate < Date.now() + r && (e != null && e.oss) || (e = {
19
+ oss: new Promise((n, c) => {
20
+ const o = l();
21
+ o.initOssClient({
22
+ getOssAccess: t,
23
+ locale: g(),
24
+ onFailure: (s) => {
25
+ c(
26
+ typeof (s == null ? void 0 : s.message) == "string" ? s.message : a("ap.apUpload.FailedToObtainOssTemporaryPermissions")
27
+ );
28
+ }
29
+ }).then(() => {
30
+ n(o);
31
+ });
32
+ }),
33
+ createDate: Date.now()
34
+ }), e.oss;
26
35
  }
27
- function g({
28
- oss: n,
29
- fileName: t
36
+ function O({
37
+ oss: t,
38
+ fileName: n
30
39
  }) {
31
- return n.getSignatureUrl(t);
40
+ return t.getSignatureUrl(n);
32
41
  }
33
42
  export {
34
- p as getOssInstance,
35
- g as getSignatureUrl,
36
- c as injectLocaleToOss
43
+ m as getOssInstance,
44
+ O as getSignatureUrl,
45
+ f as injectLocaleToOss
37
46
  };
@@ -1,5 +1,6 @@
1
1
  import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin } from 'vue';
2
2
  import { accessCreate } from '@aplus-frontend/oss';
3
+ import { ImgInfo } from '@aplus-frontend/antdv/es/vc-image/src/Preview';
3
4
  export * from './interface';
4
5
  declare const ApImage: {
5
6
  new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
@@ -12,6 +13,9 @@ declare const ApImage: {
12
13
  getOssAccess: {
13
14
  type: PropType<() => Promise< accessCreate>>;
14
15
  };
16
+ fileName: {
17
+ type: PropType<string>;
18
+ };
15
19
  src: {
16
20
  type: PropType<string>;
17
21
  };
@@ -42,6 +46,9 @@ declare const ApImage: {
42
46
  getOssAccess: {
43
47
  type: PropType<() => Promise< accessCreate>>;
44
48
  };
49
+ fileName: {
50
+ type: PropType<string>;
51
+ };
45
52
  src: {
46
53
  type: PropType<string>;
47
54
  };
@@ -88,6 +95,9 @@ declare const ApImage: {
88
95
  getOssAccess: {
89
96
  type: PropType<() => Promise< accessCreate>>;
90
97
  };
98
+ fileName: {
99
+ type: PropType<string>;
100
+ };
91
101
  src: {
92
102
  type: PropType<string>;
93
103
  };
@@ -131,6 +141,9 @@ declare const ApImage: {
131
141
  getOssAccess: {
132
142
  type: PropType<() => Promise< accessCreate>>;
133
143
  };
144
+ fileName: {
145
+ type: PropType<string>;
146
+ };
134
147
  src: {
135
148
  type: PropType<string>;
136
149
  };
@@ -160,7 +173,34 @@ declare const ApImage: {
160
173
  maskClassName?: string;
161
174
  current?: number;
162
175
  };
163
- }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
176
+ }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
177
+ $slots: {
178
+ toolbarRender?(_: {
179
+ originalNodes: import("vue/jsx-runtime").JSX.Element[];
180
+ actions: {
181
+ onFlipX: () => void;
182
+ onFlipY: () => void;
183
+ onRotateLeft: () => void;
184
+ onRotateRight: () => void;
185
+ onZoomIn: () => void;
186
+ onZoomOut: () => void;
187
+ };
188
+ transform: {
189
+ x: number;
190
+ y: number;
191
+ scale: number;
192
+ rotate: number;
193
+ flip: {
194
+ x: number;
195
+ y: number;
196
+ };
197
+ };
198
+ image: ImgInfo;
199
+ current?: number;
200
+ total?: number;
201
+ }): any;
202
+ };
203
+ }) & ( Plugin & (new (...args: any[]) => {
164
204
  $props: {
165
205
  onClick?: () => void;
166
206
  };
@@ -6,6 +6,7 @@ export interface ApImageProps {
6
6
  alt?: string;
7
7
  fallback?: string;
8
8
  src?: string;
9
+ fileName?: string;
9
10
  preview?: boolean | {
10
11
  visible?: boolean;
11
12
  onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export {};
1
+ import '@aplus-frontend/ui-theme/dist/ap-image/ap-image.css';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export {};
1
+ import '@aplus-frontend/ui-theme/src/ap-image/ap-image.less';
@@ -44,6 +44,10 @@ const e = {
44
44
  fixToRight: "Fixed on the right",
45
45
  unFixed: "Not fixed",
46
46
  delete: "Delete"
47
+ },
48
+ paragraphEllipsis: {
49
+ copy: "Copy",
50
+ copySuccess: "Copied successfully"
47
51
  }
48
52
  },
49
53
  apUpload: {
@@ -53,6 +53,10 @@ const e = {
53
53
  fixToRight: "固定在右侧",
54
54
  unFixed: "不固定",
55
55
  delete: "删除"
56
+ },
57
+ paragraphEllipsis: {
58
+ copy: "复制",
59
+ copySuccess: "复制成功"
56
60
  }
57
61
  },
58
62
  apUpload: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("@aplus-frontend/antdv"),ne=require("@aplus-frontend/antdv/es/theme/internal"),le=require("../ap-form/index.js"),O=require("./constants.js");require("../config-provider/index.js");const se=require("./hooks/use-table-paging.js"),i=require("lodash-unified"),s=require("./utils.js"),ue=require("./hooks/use-table-content-height.js"),de=require("../editable-table/utils.js"),ie=require("./hooks/use-table-row-selection.js"),ce=require("../utils/index.js");require("./components/setting/modal/index.vue.js");const fe=require("./context.js"),pe=require("../config-provider/hooks/use-namespace.js"),me=require("../config-provider/hooks/use-global-config.js"),ge=require("./components/setting/modal/index.vue2.js"),ye=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:[Boolean,Object]},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1},columnResizable:{type:Boolean,default:!1},settings:{type:[Boolean,Object],default:void 0}},setup(K,{expose:A}){const t=K;let B=0;const m=e.useSlots(),[,D]=ne.useToken(),{e:S,b:c,be:T}=pe.useNamespace("ap-table"),x=me.useGlobalConfig("valueTypeMap"),{height:j,contentRef:U}=ue.default(),b=e.ref(t.size),u=e.ref([]),F=e.ref([]);fe.useProvideApTable({columns:e.computed(()=>u.value),columnsBackup:e.computed(()=>F.value),size:e.computed(()=>b.value),updateColumns(r){u.value=r},updateSize(r){b.value=r}});const $=()=>{var a;let r=((a=t.columns)==null?void 0:a.filter(n=>!n.hideInTable))||[];function o(n,d){return n.map(l=>({resizable:ce.isDef(l.resizable)?l.resizable:t.columnResizable,...i.omit(s.apColumnToColumn(l),["ellipsis"]),fixed:d?d.fixed:l.fixed,title:s.getTableTitle(l,T("table-header","title"),m.headerCell,e.unref(D).colorPrimary),customRender({value:f,...p}){var I,L;const V=s.getTableRenderType(l),te=s.getTableRenderProps({...l,valueType:V},{value:f,...p}),oe=s.getTableCellRenderNode(V,te,p.record,e.unref(x)),E=((I=l.renderText)==null?void 0:I.call(l,{value:f,...p}))||f,ae=l.renderText?e.createVNode(e.Fragment,null,[(L=l.renderText)==null?void 0:L.call(l,{value:f,...p})]):oe;let v=Y(l,E,ae);return l.customRender&&(v=l.customRender({value:f,...p,column:l,originalNode:v,originalText:E})),v},children:o(l.children||[],d||l)}))}return o(r)};e.watchEffect(()=>{const r=$();u.value=r,F.value=r});const k=e.computed(()=>{var r,o,a;return B++,((a=(o=(r=t.columns)==null?void 0:r.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!O.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:o.sort((n,d)=>{let l=s.getColumnOrder(n.order);return s.getColumnOrder(d.order)-l}))==null?void 0:a.map(n=>{const d=s.updateFormProps(n,s.getFieldProps(n.fieldProps,{})),l={...n,fieldProps:{label:n.title,name:n.dataIndex,...d||{},_signal:B},renderNode:void 0};return l.renderNode=s.getSearchFormItemRenderNode(l,e.unref(x)),l}))||[]}),W=e.computed(()=>s.recursionApColumns(e.unref(u),r=>{if(r.sorter===!0)return r.key}).filter(Boolean)),_=e.computed(()=>s.recursionApColumns(e.unref(u),r=>{if(r.filters&&!r.onFilter)return r.key}).filter(Boolean)),H=e.computed(()=>i.isUndefined(t.dataSource)?w.value.records:t.dataSource),{rowSelection:g,selectedRows:y,...h}=ie.default({...t.rowSelection===!0?{}:t.rowSelection,rowKey:t.rowKey,dataSource:H}),{formRef:C,submit:P,reset:z,tableProps:N,refresh:M,data:w,setDataSource:G}=se.useTablePaging({async request(r){var a,n;if(!g.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&h.clearAll(),!i.isUndefined(t.dataSource))return{data:t.dataSource||[],total:t.dataSource.length||0};const o=await((a=t.request)==null?void 0:a.call(t,r));return(n=t.onLoad)==null||n.call(t,(o==null?void 0:o.data)||[]),{data:(o==null?void 0:o.data)||[],total:(o==null?void 0:o.total)||0}},filterFields:_,sortFields:W,defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,defaultCurrent:t.pagination?t.pagination.defaultCurrent:void 0,defaultPageSize:t.pagination?t.pagination.defaultPageSize:void 0,formatParams:t.beforeSearchSubmit,showLessItems:t.pagination?t.pagination.showLessItems:void 0,showTotal:t.pagination?t.pagination.showTotal:void 0}),J=e.computed(()=>{var o,a;if(t.adaptive&&(w.value.total>0||((o=t.dataSource)==null?void 0:o.length)))return{y:e.unref(j),x:((a=t.scroll)==null?void 0:a.x)||"100%"};if(t.scroll)return t.scroll}),Q=e.computed(()=>{var r;if(t.tableLayout)return t.tableLayout;if((r=t.columns)!=null&&r.some(o=>o.ellipsis))return"fixed"}),q=e.computed(()=>{var a;const r=e.unref(N),o=e.unref(g);return{...t,...r,rowSelection:t.rowSelection===!0||((a=t.rowSelection)==null?void 0:a.mode)==="internal"?{...o,preserveSelectedRowKeys:i.isUndefined(t.dataSource)?o.preserveSelectedRowKeys:!0}:t.rowSelection,loading:i.isUndefined(t.loading)?r.loading:t.loading,pagination:t.pagination===!1?!1:r.pagination,scroll:e.unref(J)}}),X=e.computed(()=>[c(),t.card?null:c("wrapper"),t.adaptive?c("adaptive"):null].filter(Boolean));function Y(r,o,a){if(O.noRenderAsFormItemValueList.includes(r.valueType))return a;const n=s.objectToString(o);return r.copyable||r.ellipsis?e.createVNode(R.Typography.Paragraph,{copyable:r.copyable?{text:n,tooltip:!1}:!1,ellipsis:r.ellipsis?i.isBoolean(r.ellipsis)?{tooltip:n}:{...r.ellipsis,tooltip:n}:!1,content:r.ellipsis?de.getRawDisplayValue(r,o):a},null):a}e.watch(()=>e.unref(w).loading,r=>{var o;(o=t.onLoadingChange)==null||o.call(t,r)}),e.watch(()=>t.dataSource,r=>{G(r)},{immediate:!0});function Z(r){var o,a,n;(n=(a=(o=C.value)==null?void 0:o.apForm)==null?void 0:a.setFieldsValue)==null||n.call(a,r)}function ee(){var r,o,a;return(a=(o=(r=C.value)==null?void 0:r.apForm)==null?void 0:o.getFieldsValue)==null?void 0:a.call(o,!0)}function re(){return e.unref(u)}return A({submit:()=>P(),reset:()=>z(),refresh:()=>M(),setSearchFormValues:Z,getSearchFormValues:ee,getShownColumns:re,dataSource:e.computed(()=>e.unref(w).records),rowSelection:{selectedRows:e.computed(()=>e.unref(y)),...h}}),(r,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(X.value)},[e.unref(i.isUndefined)(r.dataSource)&&r.searchForm!==!1&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(S)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(le.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:C,"custom-reset":"",onSubmit:e.unref(P),onReset:e.unref(z),"submit-loading":e.unref(N).loading}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.renderNode),e.mergeProps({key:a.dataIndex,ref_for:!0},a.fieldProps||{},{span:a.span}),null,16,["span"]))),128))]),_:2},[m.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:U,class:e.normalizeClass([e.unref(S)("table-wrapper"),r.card?e.unref(S)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[r.settings?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(c)("header"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(T)("header","title"))},[e.renderSlot(r.$slots,"title",e.mergeProps({selectedRows:e.unref(y),selectedRowKeys:e.unref(g).selectedRowKeys,shownColumns:u.value},h))],2),m.title?(e.openBlock(),e.createBlock(e.unref(R.Divider),{key:0,type:"vertical"})):e.createCommentVNode("",!0),e.createVNode(ge.default,{config:r.settings===!0?{}:r.settings},null,8,["config"])],2)):e.renderSlot(r.$slots,"title",e.mergeProps({key:1,selectedRows:e.unref(y),selectedRowKeys:e.unref(g).selectedRowKeys,shownColumns:u.value},h))],2),e.createVNode(e.unref(R.Table),e.mergeProps({class:e.unref(c)("table")},q.value,{size:b.value,"table-layout":Q.value,columns:u.value,onResizeColumn:o[0]||(o[0]=(a,n)=>n.width=a)}),e.createSlots({summary:e.withCtx(()=>[e.renderSlot(r.$slots,"summary",{columns:u.value,records:q.value.dataSource,selectedRows:e.unref(y)})]),_:2},[e.renderList(e.unref(i.omit)(m,["title","searchFormExtra","headerCell","summary"]),(a,n)=>({name:n,fn:e.withCtx(d=>[e.renderSlot(r.$slots,n,e.normalizeProps(e.guardReactiveProps(d||{})))])}))]),1040,["class","size","table-layout","columns"])],6)],2))}});exports.default=ye;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),L=require("@aplus-frontend/antdv"),ae=require("@aplus-frontend/antdv/es/theme/internal"),le=require("../ap-form/index.js"),O=require("./constants.js");require("../config-provider/index.js");const se=require("./hooks/use-table-paging.js"),i=require("lodash-unified"),s=require("./utils.js"),ue=require("./hooks/use-table-content-height.js"),de=require("../editable-table/utils.js"),ie=require("./hooks/use-table-row-selection.js"),ce=require("../utils/index.js");require("./components/setting/modal/index.vue.js");require("./components/paragraph-ellipsis/index.vue.js");const fe=require("./context.js"),pe=require("../config-provider/hooks/use-namespace.js"),me=require("../config-provider/hooks/use-global-config.js"),ge=require("./components/paragraph-ellipsis/index.vue2.js"),ye=require("./components/setting/modal/index.vue2.js"),we=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},rowSelection:{type:[Boolean,Object]},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},dataSource:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"},adaptive:{type:Boolean,default:!1},columnResizable:{type:Boolean,default:!1},settings:{type:[Boolean,Object],default:void 0}},setup(_,{expose:K}){const t=_;let R=0;const m=e.useSlots(),[,A]=ae.useToken(),{e:h,b:c,be:B}=pe.useNamespace("ap-table"),T=me.useGlobalConfig("valueTypeMap"),{height:D,contentRef:j}=ue.default(),b=e.ref(t.size),u=e.ref([]),x=e.ref([]);fe.useProvideApTable({columns:e.computed(()=>u.value),columnsBackup:e.computed(()=>x.value),size:e.computed(()=>b.value),updateColumns(r){u.value=r},updateSize(r){b.value=r}});const U=()=>{var o;let r=((o=t.columns)==null?void 0:o.filter(a=>!a.hideInTable))||[];function n(a,d){return a.map(l=>({resizable:ce.isDef(l.resizable)?l.resizable:t.columnResizable,...i.omit(s.apColumnToColumn(l),["ellipsis"]),fixed:d?d.fixed:l.fixed,title:s.getTableTitle(l,B("table-header","title"),m.headerCell,e.unref(A).colorPrimary),customRender({value:f,...p}){var E,I;const N=s.getTableRenderType(l),te=s.getTableRenderProps({...l,valueType:N},{value:f,...p}),ne=s.getTableCellRenderNode(N,te,p.record,e.unref(T)),V=((E=l.renderText)==null?void 0:E.call(l,{value:f,...p}))||f,oe=l.renderText?e.createVNode(e.Fragment,null,[(I=l.renderText)==null?void 0:I.call(l,{value:f,...p})]):ne;let v=Y(l,V,oe);return l.customRender&&(v=l.customRender({value:f,...p,column:l,originalNode:v,originalText:V})),v},children:n(l.children||[],d||l)}))}return n(r)};e.watchEffect(()=>{const r=U();u.value=r,x.value=r});const F=e.computed(()=>{var r,n,o;return R++,((o=(n=(r=t.columns)==null?void 0:r.filter(a=>!a.hideInSearch&&a.dataIndex&&(a.valueType||a.customRenderFormItem)&&!O.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:n.sort((a,d)=>{let l=s.getColumnOrder(a.order);return s.getColumnOrder(d.order)-l}))==null?void 0:o.map(a=>{const d=s.updateFormProps(a,s.getFieldProps(a.fieldProps,{})),l={...a,fieldProps:{label:a.title,name:a.dataIndex,...d||{},_signal:R},renderNode:void 0};return l.renderNode=s.getSearchFormItemRenderNode(l,e.unref(T)),l}))||[]}),$=e.computed(()=>s.recursionApColumns(e.unref(u),r=>{if(r.sorter===!0)return r.key}).filter(Boolean)),W=e.computed(()=>s.recursionApColumns(e.unref(u),r=>{if(r.filters&&!r.onFilter)return r.key}).filter(Boolean)),H=e.computed(()=>i.isUndefined(t.dataSource)?S.value.records:t.dataSource),{rowSelection:g,selectedRows:y,...w}=ie.default({...t.rowSelection===!0?{}:t.rowSelection,rowKey:t.rowKey,dataSource:H}),{formRef:C,submit:k,reset:z,tableProps:P,refresh:M,data:S,setDataSource:G}=se.useTablePaging({async request(r){var o,a;if(!g.value.preserveSelectedRowKeys&&i.isUndefined(t.dataSource)&&w.clearAll(),!i.isUndefined(t.dataSource))return{data:t.dataSource||[],total:t.dataSource.length||0};const n=await((o=t.request)==null?void 0:o.call(t,r));return(a=t.onLoad)==null||a.call(t,(n==null?void 0:n.data)||[]),{data:(n==null?void 0:n.data)||[],total:(n==null?void 0:n.total)||0}},filterFields:W,sortFields:$,defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,defaultCurrent:t.pagination?t.pagination.defaultCurrent:void 0,defaultPageSize:t.pagination?t.pagination.defaultPageSize:void 0,formatParams:t.beforeSearchSubmit,showLessItems:t.pagination?t.pagination.showLessItems:void 0,showTotal:t.pagination?t.pagination.showTotal:void 0}),J=e.computed(()=>{var n,o;if(t.adaptive&&(S.value.total>0||((n=t.dataSource)==null?void 0:n.length)))return{y:e.unref(D),x:((o=t.scroll)==null?void 0:o.x)||"100%"};if(t.scroll)return t.scroll}),Q=e.computed(()=>{var r;if(t.tableLayout)return t.tableLayout;if((r=t.columns)!=null&&r.some(n=>n.ellipsis))return"fixed"}),q=e.computed(()=>{var o;const r=e.unref(P),n=e.unref(g);return{...t,...r,rowSelection:t.rowSelection===!0||((o=t.rowSelection)==null?void 0:o.mode)==="internal"?{...n,preserveSelectedRowKeys:i.isUndefined(t.dataSource)?n.preserveSelectedRowKeys:!0}:t.rowSelection,loading:i.isUndefined(t.loading)?r.loading:t.loading,pagination:t.pagination===!1?!1:r.pagination,scroll:e.unref(J)}}),X=e.computed(()=>[c(),t.card?null:c("wrapper"),t.adaptive?c("adaptive"):null].filter(Boolean));function Y(r,n,o){if(O.noRenderAsFormItemValueList.includes(r.valueType))return o;const a=s.objectToString(n);return r.copyable||r.ellipsis?e.createVNode(ge.default,{copyable:r.copyable,ellipsis:r.ellipsis?i.isBoolean(r.ellipsis)?{tooltip:a}:{...r.ellipsis,tooltip:a}:!1,content:r.ellipsis?de.getRawDisplayValue(r,n):o},null):o}e.watch(()=>e.unref(S).loading,r=>{var n;(n=t.onLoadingChange)==null||n.call(t,r)}),e.watch(()=>t.dataSource,r=>{G(r)},{immediate:!0});function Z(r){var n,o,a;(a=(o=(n=C.value)==null?void 0:n.apForm)==null?void 0:o.setFieldsValue)==null||a.call(o,r)}function ee(){var r,n,o;return(o=(n=(r=C.value)==null?void 0:r.apForm)==null?void 0:n.getFieldsValue)==null?void 0:o.call(n,!0)}function re(){return e.unref(u)}return K({submit:()=>k(),reset:()=>z(),refresh:()=>M(),setSearchFormValues:Z,getSearchFormValues:ee,getShownColumns:re,dataSource:e.computed(()=>e.unref(S).records),rowSelection:{selectedRows:e.computed(()=>e.unref(y)),...w}}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(X.value)},[e.unref(i.isUndefined)(r.dataSource)&&r.searchForm!==!1&&F.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(r.card?e.unref(h)("search-wrapper"):null),style:e.normalizeStyle(r.searchFormWrapperStyle)},[e.createVNode(e.unref(le.ApForm).SearchForm,e.mergeProps(r.searchForm||{},{ref_key:"formRef",ref:C,"custom-reset":"",onSubmit:e.unref(k),onReset:e.unref(z),"submit-loading":e.unref(P).loading}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,o=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.renderNode),e.mergeProps({key:o.dataIndex,ref_for:!0},o.fieldProps||{},{span:o.span}),null,16,["span"]))),128))]),_:2},[m.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"contentRef",ref:j,class:e.normalizeClass([e.unref(h)("table-wrapper"),r.card?e.unref(h)("table-wrapper-card"):null]),style:e.normalizeStyle(r.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(c)("header-wrapper"))},[r.settings?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(c)("header"))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(B)("header","title"))},[e.renderSlot(r.$slots,"title",e.mergeProps({selectedRows:e.unref(y),selectedRowKeys:e.unref(g).selectedRowKeys,shownColumns:u.value},w))],2),m.title?(e.openBlock(),e.createBlock(e.unref(L.Divider),{key:0,type:"vertical"})):e.createCommentVNode("",!0),e.createVNode(ye.default,{config:r.settings===!0?{}:r.settings},null,8,["config"])],2)):e.renderSlot(r.$slots,"title",e.mergeProps({key:1,selectedRows:e.unref(y),selectedRowKeys:e.unref(g).selectedRowKeys,shownColumns:u.value},w))],2),e.createVNode(e.unref(L.Table),e.mergeProps({class:e.unref(c)("table")},q.value,{size:b.value,"table-layout":Q.value,columns:u.value,onResizeColumn:n[0]||(n[0]=(o,a)=>a.width=o)}),e.createSlots({summary:e.withCtx(()=>[e.renderSlot(r.$slots,"summary",{columns:u.value,records:q.value.dataSource,selectedRows:e.unref(y)})]),_:2},[e.renderList(e.unref(i.omit)(m,["title","searchFormExtra","headerCell","summary"]),(o,a)=>({name:a,fn:e.withCtx(d=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(d||{})))])}))]),1040,["class","size","table-layout","columns"])],6)],2))}});exports.default=we;
@@ -0,0 +1,20 @@
1
+ import { VNodeChild, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
2
+ interface Props {
3
+ copyable?: boolean;
4
+ content?: VNodeChild;
5
+ ellipsis?: boolean | {
6
+ rows?: number;
7
+ tooltip?: VNodeChild;
8
+ };
9
+ }
10
+ declare const _default: DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
11
+ export default _default;
12
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
+ type __VLS_TypePropsToOption<T> = {
14
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
15
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
16
+ } : {
17
+ type: PropType<T[K]>;
18
+ required: true;
19
+ };
20
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.vue2.js");exports.default=e.default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../config-provider/index.js");const p=require("@aplus-frontend/antdv"),u=require("@ant-design/icons-vue"),d=require("../../../config-provider/hooks/use-namespace.js"),v=require("../../../config-provider/hooks/use-locale.js"),y=e.defineComponent({name:"ApTableParagraphEllipsis",__name:"index",props:{copyable:{type:Boolean},content:{type:[Object,String,Number,Boolean,null,Array]},ellipsis:{type:[Boolean,Object]}},setup(m){const{b:r}=d.useNamespace("ap-table-paragraph-ellipsis"),{t:i}=v.useLocale(),t=m,o=e.ref(!1),n=e.computed(()=>t.ellipsis===!0?{rows:1,tooltip:t.content}:typeof t.ellipsis=="object"?Object.assign({rows:1,tooltip:t.content},t.ellipsis):{});function f(){var c,l,a;const s=((c=n.value)==null?void 0:c.tooltip)??((a=(l=t.content)==null?void 0:l.props)==null?void 0:a.value)??t.content;navigator.clipboard.writeText(s),o.value||(o.value=!0,setTimeout(()=>{o.value=!1},2200))}return(s,c)=>{var l,a;return e.openBlock(),e.createElementBlock("div",e.mergeProps({class:[e.unref(r)()]},{...s.$attrs},{style:{"--ap-table-paragraph-ellipsis-rows":(l=n.value)==null?void 0:l.rows}}),[e.createElementVNode("div",{class:e.normalizeClass([e.unref(r)("content")])},[e.createVNode(e.unref(p.Tooltip),null,e.createSlots({default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[t.content]))))]),_:2},[(a=n.value)!=null&&a.tooltip?{name:"title",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h(e.Fragment,[n.value.tooltip]))))]),key:"0"}:void 0]),1024)],2),t.copyable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(r)("copyable")]),onClick:f},[e.createVNode(e.unref(p.Tooltip),{title:o.value?e.unref(i)("ap.apTable.paragraphEllipsis.copySuccess"):e.unref(i)("ap.apTable.paragraphEllipsis.copy")},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createBlock(e.unref(u.CheckOutlined),{key:1})):(e.openBlock(),e.createBlock(e.unref(u.CopyOutlined),{key:0}))]),_:1},8,["title"])],2)):e.createCommentVNode("",!0)],16)}}});exports.default=y;
@@ -1,6 +1,38 @@
1
1
  import { ApImageProps } from './interface';
2
+ import { ImgInfo } from '@aplus-frontend/antdv/es/vc-image/src/Preview';
2
3
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
- declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
4
+ declare function __VLS_template(): {
5
+ slots: {
6
+ toolbarRender?(_: {
7
+ originalNodes: import("vue/jsx-runtime").JSX.Element[];
8
+ actions: {
9
+ onFlipX: () => void;
10
+ onFlipY: () => void;
11
+ onRotateLeft: () => void;
12
+ onRotateRight: () => void;
13
+ onZoomIn: () => void;
14
+ onZoomOut: () => void;
15
+ };
16
+ transform: {
17
+ x: number;
18
+ y: number;
19
+ scale: number;
20
+ rotate: number;
21
+ flip: {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ };
26
+ image: ImgInfo;
27
+ current?: number;
28
+ total?: number;
29
+ }): any;
30
+ };
31
+ refs: {};
32
+ attrs: Partial<{}>;
33
+ };
34
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
35
+ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
4
36
  preview: boolean;
5
37
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ApImageProps>, {
6
38
  preview: boolean;
@@ -14,6 +46,7 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOpti
14
46
  current?: number;
15
47
  };
16
48
  }, {}>;
49
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
50
  export default _default;
18
51
  type __VLS_WithDefaults<P, D> = {
19
52
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
@@ -29,6 +62,11 @@ type __VLS_TypePropsToOption<T> = {
29
62
  required: true;
30
63
  };
31
64
  };
65
+ type __VLS_WithTemplateSlots<T, S> = T & {
66
+ new (): {
67
+ $slots: S;
68
+ };
69
+ };
32
70
  type __VLS_PrettifyLocal<T> = {
33
71
  [K in keyof T]: T[K];
34
72
  } & {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("@aplus-frontend/antdv"),c=require("./hooks/useOss.js");require("../../config-provider/index.js");const k=require("./imgs/admin-fallback.jpg.js"),O=require("./imgs/aplus-fallback.jpg.js"),q=require("lodash-unified"),u=require("../../config-provider/hooks/use-global-config.js"),h=require("../../config-provider/hooks/use-locale.js"),_=e.defineComponent({__name:"ApImage",props:{getOssAccess:{},width:{},height:{},alt:{},fallback:{},src:{},preview:{type:[Boolean,Object],default:!0}},setup(n){const s=n,l={aplus:O.default,admin:k.default},i=u.useGlobalConfig("uiMode"),f=u.useGlobalConfig("apUpload"),{t:d,lang:g}=h.useLocale(),p=e.computed(()=>{var a;return s.getOssAccess||((a=f.value)==null?void 0:a.getOssAccess)}),v=e.computed(()=>l[i.value]||l.aplus),b=e.computed(()=>(s==null?void 0:s.fallback)||v.value),t=e.ref("");return c.injectLocaleToOss(d,g),e.watchEffect(async()=>{var a;if(!(s!=null&&s.src)){t.value="";return}if(!((a=s.src)!=null&&a.startsWith("Frontend-Upload"))){t.value=s.src;return}try{const r=await c.getOssInstance(p.value),o=await c.getSignatureUrl({oss:r,fileName:s.src});o&&(t.value=o)}catch{t.value=""}}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(m.Image),e.normalizeProps(e.guardReactiveProps({...e.unref(q.omit)(s,["src","getOssAccess"]),fallback:b.value,src:t.value})),null,16))}});exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("@aplus-frontend/antdv"),y=require("@ant-design/icons-vue"),l=require("./hooks/useOss.js");require("../../config-provider/index.js");const _=require("./imgs/admin-fallback.jpg.js"),A=require("./imgs/aplus-fallback.jpg.js"),B=require("lodash-unified"),S=require("../../config-provider/hooks/use-namespace.js"),i=require("../../config-provider/hooks/use-global-config.js"),F=require("../../config-provider/hooks/use-locale.js"),U=e.defineComponent({__name:"ApImage",props:{getOssAccess:{},width:{},height:{},alt:{},fallback:{},src:{},fileName:{},preview:{type:[Boolean,Object],default:!0}},setup(g){const{b:u}=S.useNamespace("ap-image"),t=g,d={aplus:A.default,admin:_.default},m=i.useGlobalConfig("uiMode"),b=i.useGlobalConfig("apUpload"),f=i.useGlobalConfig("downloadCenterTriggerConfig"),{t:p,lang:v}=F.useLocale(),k=e.computed(()=>{var r;return t.getOssAccess||((r=b.value)==null?void 0:r.getOssAccess)}),C=e.computed(()=>d[m.value]||d.aplus),h=e.computed(()=>(t==null?void 0:t.fallback)||C.value),n=e.ref("");l.injectLocaleToOss(p,v),e.watchEffect(async()=>{var r;if(!(t!=null&&t.src)){n.value="";return}if(!((r=t.src)!=null&&r.startsWith("Frontend-Upload"))){n.value=t.src;return}try{const o=await l.getOssInstance(k.value),a=await l.getSignatureUrl({oss:o,fileName:t.src});a&&(n.value=a)}catch{n.value=""}});async function w(){var a,s,c;if(!(t!=null&&t.src))return;const r=t.src,o=t.fileName??t.src;if(!((a=t.src)!=null&&a.startsWith("Frontend-Upload"))){O(r,o);return}if((s=f.value)!=null&&s.trigger){let q=[{objectName:r,fileName:o}];await((c=f.value)==null?void 0:c.trigger(q))}}const O=(r,o)=>{const a=document.createElement("a");a.href=r,a.rel="noopener noreferrer",a.setAttribute("download",o),document.body.appendChild(a),a.click(),document.body.removeChild(a)};return(r,o)=>(e.openBlock(),e.createBlock(e.unref(N.Image),e.mergeProps({class:[e.unref(u)()]},{...e.unref(B.omit)(t,["src","getOssAccess"]),fallback:h.value,src:n.value}),{toolbarRender:e.withCtx(a=>[e.renderSlot(r.$slots,"toolbarRender",e.normalizeProps(e.guardReactiveProps({...a})),()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(u)("toolbar")])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.originalNodes,(s,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s),e.mergeProps({ref_for:!0},a,{key:c}),null,16))),128)),e.createElementVNode("div",{class:"ant-image-preview-operations-operation",onClick:w},[e.createVNode(e.unref(y.DownloadOutlined))])],2)])]),_:3},16,["class"]))}});exports.default=U;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@aplus-frontend/oss");let s,a;function i(e,t){s=e,a=t}const l={"zh-cn":"zh_CN",en:"en_US"};function r(){return l[a.value]??"zh_CN"}async function c(e){if(!e)throw new Error(`${s("ap.apUpload.pleasePass")}getOssAccess`);const t=o.createOssInstance();return await t.initOssClient({getOssAccess:e,locale:r(),onFailure:n=>{throw new Error(typeof(n==null?void 0:n.message)=="string"?n.message:s("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}),t}function g({oss:e,fileName:t}){return e.getSignatureUrl(t)}exports.getOssInstance=c;exports.getSignatureUrl=g;exports.injectLocaleToOss=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@aplus-frontend/oss"),r=1e4;let a,c;function u(t,n){a=t,c=n}const g={"zh-cn":"zh_CN",en:"en_US"};function O(){return g[c.value]??"zh_CN"}let e;async function f(t){if(!t)throw new Error(`${a("ap.apUpload.pleasePass")}getOssAccess`);return e!=null&&e.createDate&&e.createDate<Date.now()+r&&(e!=null&&e.oss)||(e={oss:new Promise((n,i)=>{const o=l.createOssInstance();o.initOssClient({getOssAccess:t,locale:O(),onFailure:s=>{i(typeof(s==null?void 0:s.message)=="string"?s.message:a("ap.apUpload.FailedToObtainOssTemporaryPermissions"))}}).then(()=>{n(o)})}),createDate:Date.now()}),e.oss}function p({oss:t,fileName:n}){return t.getSignatureUrl(n)}exports.getOssInstance=f;exports.getSignatureUrl=p;exports.injectLocaleToOss=u;
@@ -1,5 +1,6 @@
1
1
  import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Plugin } from 'vue';
2
2
  import { accessCreate } from '@aplus-frontend/oss';
3
+ import { ImgInfo } from '@aplus-frontend/antdv/es/vc-image/src/Preview';
3
4
  export * from './interface';
4
5
  declare const ApImage: {
5
6
  new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
@@ -12,6 +13,9 @@ declare const ApImage: {
12
13
  getOssAccess: {
13
14
  type: PropType<() => Promise< accessCreate>>;
14
15
  };
16
+ fileName: {
17
+ type: PropType<string>;
18
+ };
15
19
  src: {
16
20
  type: PropType<string>;
17
21
  };
@@ -42,6 +46,9 @@ declare const ApImage: {
42
46
  getOssAccess: {
43
47
  type: PropType<() => Promise< accessCreate>>;
44
48
  };
49
+ fileName: {
50
+ type: PropType<string>;
51
+ };
45
52
  src: {
46
53
  type: PropType<string>;
47
54
  };
@@ -88,6 +95,9 @@ declare const ApImage: {
88
95
  getOssAccess: {
89
96
  type: PropType<() => Promise< accessCreate>>;
90
97
  };
98
+ fileName: {
99
+ type: PropType<string>;
100
+ };
91
101
  src: {
92
102
  type: PropType<string>;
93
103
  };
@@ -131,6 +141,9 @@ declare const ApImage: {
131
141
  getOssAccess: {
132
142
  type: PropType<() => Promise< accessCreate>>;
133
143
  };
144
+ fileName: {
145
+ type: PropType<string>;
146
+ };
134
147
  src: {
135
148
  type: PropType<string>;
136
149
  };
@@ -160,7 +173,34 @@ declare const ApImage: {
160
173
  maskClassName?: string;
161
174
  current?: number;
162
175
  };
163
- }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
176
+ }, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
177
+ $slots: {
178
+ toolbarRender?(_: {
179
+ originalNodes: import("vue/jsx-runtime").JSX.Element[];
180
+ actions: {
181
+ onFlipX: () => void;
182
+ onFlipY: () => void;
183
+ onRotateLeft: () => void;
184
+ onRotateRight: () => void;
185
+ onZoomIn: () => void;
186
+ onZoomOut: () => void;
187
+ };
188
+ transform: {
189
+ x: number;
190
+ y: number;
191
+ scale: number;
192
+ rotate: number;
193
+ flip: {
194
+ x: number;
195
+ y: number;
196
+ };
197
+ };
198
+ image: ImgInfo;
199
+ current?: number;
200
+ total?: number;
201
+ }): any;
202
+ };
203
+ }) & ( Plugin & (new (...args: any[]) => {
164
204
  $props: {
165
205
  onClick?: () => void;
166
206
  };
@@ -6,6 +6,7 @@ export interface ApImageProps {
6
6
  alt?: string;
7
7
  fallback?: string;
8
8
  src?: string;
9
+ fileName?: string;
9
10
  preview?: boolean | {
10
11
  visible?: boolean;
11
12
  onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export {};
1
+ import '@aplus-frontend/ui-theme/dist/ap-image/ap-image.css';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export {};
1
+ import '@aplus-frontend/ui-theme/src/ap-image/ap-image.less';
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={name:"en",ap:{common:{okText:"OK",cancelText:"Cancel",resetText:"Reset",queryText:"Search",expandText:"Unfold",closeText:"Put away",inputText:"Please enter",chooseText:"Please choose",redo:"Refresh",back:"Back",more:"More"},field:{startDateText:"Start date",endDateText:"End date"},apForm:{search:{search:"Search",reset:"Reset"}},apTable:{pagination:{totalLeftPrefix:"Total",totalLeftSuffix:"items",totalRightPrefix:"Page",totalRightSuffix:""},setting:{title:"Custom Table",selectAll:"Select All",unSelectAll:"Deselect All",selectAllTip:"Please select the columns to display in the table.",sizeSmall:"Small",sizeNormal:"Normal",selectCount:"Selected fields ({count})",reset:"Reset",fixToLeft:"Fixed on the left",fixToRight:"Fixed on the right",unFixed:"Not fixed",delete:"Delete"}},apUpload:{update:"Upload",pictureType:"Image type",videoType:"Video type",audioType:"Audio type",documentType:"Document type",allTypes:"All types",networkAnomaly:"Network abnormality",FailedToObtainOssTemporaryPermissions:"Failed to obtain temporary OSS permissions",pleasePass:"Please pass in",supportExtension:"Support extensions",uploadFile:"Upload files",fileInitializationException:"If the initial number of initialized files exceeds {maxCount}, subsequent uploaded files will be out of sync with the data",maxUploadFiles:"Upload a maximum of {maxCount} files",maxUploadPicture:"Upload a maximum of {maxCount} images",maxUploadFileSize:"The file size does not exceed {maxSize}MB",maxWarnUploadFileSize:"The file size is smaller than {maxSize}MB",maxUploadPictureSize:"The image size is smaller than {maxSize}MB",fileFormatNotSupported:"Files in this format are not supported",pictureFormatNotSupported:"Images in this format are not supported",imageParsingFailed:"Image parsing failed",clickOrDragUpload:"Click or drag the file",foldersNotSupported:"Do not support uploading folders"},apExportGroup:{exportError:"Export error",exportSelected:"Export selected",exportAll:"Export all",export:"Export"},apBatchAction:{selected:"Selected",piecesOfData:"Pieces of data",empty:"Empty"},apApBatchActionGroup:{batchOperation:"Batch operation"},workOrderModal:{createTickets:"Create ticket",submit:"Confirm",cancel:"Cancel",ticketsTitle:"Ticket Title",noEmpty:"No empty",pleaseEntry:"please enter",ticketsType:"Ticket Type",ticketsDetail:"Ticket Detail",ticketsLevel:"Priority",operationSuccess:"operate successfully",fileSizeMax:"Single file size limit",fileCountMax:"Limit the number to {x} at a time"},apTableModal:{titleSuffixOne:"You can add up to {maxCount},",titleSuffixTwo:"Added",titleSuffixThree:"",messageMaxCount:"You can select up to {maxCount} data entries",clear:"Clear",selected:"Selected"},apAttachment:{downloadall:"Download All",more:"More"},apExpandAlert:{expand:"Expand",collapse:"Collapse"},apAppendix:{downloadAll:"Download All",downloadFile:"Download file",appendix:"Appendix"},apGroupSearch:{defaultPlaceholder:"Please input",all:"All",close:"Close",clear:"Clear",confirm:"Confirm",tokenSeparatorsPlaceholder:"A maximum of 200 entries can be entered in batches, separated by commas and newlines"}}};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={name:"en",ap:{common:{okText:"OK",cancelText:"Cancel",resetText:"Reset",queryText:"Search",expandText:"Unfold",closeText:"Put away",inputText:"Please enter",chooseText:"Please choose",redo:"Refresh",back:"Back",more:"More"},field:{startDateText:"Start date",endDateText:"End date"},apForm:{search:{search:"Search",reset:"Reset"}},apTable:{pagination:{totalLeftPrefix:"Total",totalLeftSuffix:"items",totalRightPrefix:"Page",totalRightSuffix:""},setting:{title:"Custom Table",selectAll:"Select All",unSelectAll:"Deselect All",selectAllTip:"Please select the columns to display in the table.",sizeSmall:"Small",sizeNormal:"Normal",selectCount:"Selected fields ({count})",reset:"Reset",fixToLeft:"Fixed on the left",fixToRight:"Fixed on the right",unFixed:"Not fixed",delete:"Delete"},paragraphEllipsis:{copy:"Copy",copySuccess:"Copied successfully"}},apUpload:{update:"Upload",pictureType:"Image type",videoType:"Video type",audioType:"Audio type",documentType:"Document type",allTypes:"All types",networkAnomaly:"Network abnormality",FailedToObtainOssTemporaryPermissions:"Failed to obtain temporary OSS permissions",pleasePass:"Please pass in",supportExtension:"Support extensions",uploadFile:"Upload files",fileInitializationException:"If the initial number of initialized files exceeds {maxCount}, subsequent uploaded files will be out of sync with the data",maxUploadFiles:"Upload a maximum of {maxCount} files",maxUploadPicture:"Upload a maximum of {maxCount} images",maxUploadFileSize:"The file size does not exceed {maxSize}MB",maxWarnUploadFileSize:"The file size is smaller than {maxSize}MB",maxUploadPictureSize:"The image size is smaller than {maxSize}MB",fileFormatNotSupported:"Files in this format are not supported",pictureFormatNotSupported:"Images in this format are not supported",imageParsingFailed:"Image parsing failed",clickOrDragUpload:"Click or drag the file",foldersNotSupported:"Do not support uploading folders"},apExportGroup:{exportError:"Export error",exportSelected:"Export selected",exportAll:"Export all",export:"Export"},apBatchAction:{selected:"Selected",piecesOfData:"Pieces of data",empty:"Empty"},apApBatchActionGroup:{batchOperation:"Batch operation"},workOrderModal:{createTickets:"Create ticket",submit:"Confirm",cancel:"Cancel",ticketsTitle:"Ticket Title",noEmpty:"No empty",pleaseEntry:"please enter",ticketsType:"Ticket Type",ticketsDetail:"Ticket Detail",ticketsLevel:"Priority",operationSuccess:"operate successfully",fileSizeMax:"Single file size limit",fileCountMax:"Limit the number to {x} at a time"},apTableModal:{titleSuffixOne:"You can add up to {maxCount},",titleSuffixTwo:"Added",titleSuffixThree:"",messageMaxCount:"You can select up to {maxCount} data entries",clear:"Clear",selected:"Selected"},apAttachment:{downloadall:"Download All",more:"More"},apExpandAlert:{expand:"Expand",collapse:"Collapse"},apAppendix:{downloadAll:"Download All",downloadFile:"Download file",appendix:"Appendix"},apGroupSearch:{defaultPlaceholder:"Please input",all:"All",close:"Close",clear:"Clear",confirm:"Confirm",tokenSeparatorsPlaceholder:"A maximum of 200 entries can be entered in batches, separated by commas and newlines"}}};exports.default=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={name:"zh-cn",ap:{common:{okText:"确认",cancelText:"取消",resetText:"重置",queryText:"查询",expandText:"展开",closeText:"收起",inputText:"请输入",chooseText:"请选择",redo:"刷新",back:"返回",more:"更多"},field:{startDateText:"开始日期",endDateText:"结束日期"},modal:{restore:"还原",maximize:"最大化",close:"关闭"},countdown:{normalText:"获取验证码",sendText:"{sec}秒后重新获取"},apForm:{search:{search:"查询",reset:"重置"}},apTable:{pagination:{totalLeftPrefix:"共",totalLeftSuffix:"条记录",totalRightPrefix:"第",totalRightSuffix:"页"},setting:{title:"自定义表格",selectAll:"全选",unSelectAll:"取消全选",selectAllTip:"请选择需要展示在表格的字段",sizeSmall:"紧凑",sizeNormal:"正常",selectCount:"已选字段({count})",reset:"重置",fixToLeft:"固定在左侧",fixToRight:"固定在右侧",unFixed:"不固定",delete:"删除"}},apUpload:{update:"上传",pictureType:"图片类型",videoType:"视频类型",audioType:"音频类型",documentType:"文档类型",allTypes:"全部类型",networkAnomaly:"网络异常",FailedToObtainOssTemporaryPermissions:"获取oss临时权限失败",pleasePass:"请传入",supportExtension:"支持扩展名",uploadFile:"上传文件",fileInitializationException:"文件初始化个数超过{maxCount}个,后续上传的文件会与数据不同步",maxUploadFiles:"最多上传{maxCount}个文件",maxUploadPicture:"最多上传{maxCount}张图片",maxUploadFileSize:"文件大小不超过{maxSize}MB",maxWarnUploadFileSize:"文件大小小于{maxSize}MB",maxUploadPictureSize:"图片大小小于{maxSize}MB",fileFormatNotSupported:"不支持该格式的文件",pictureFormatNotSupported:"不支持该格式的图片",imageParsingFailed:"图片解析失败",clickOrDragUpload:"点击或将文件拖拽到这里上传",foldersNotSupported:"不支持上传文件夹"},apExportGroup:{exportError:"导出失败",exportSelected:"导出所选",exportAll:"导出全部",export:"导出"},apBatchAction:{selected:"已选",piecesOfData:"条数据",empty:"清空"},apApBatchActionGroup:{batchOperation:"批量操作"},workOrderModal:{createTickets:"创建工单",submit:"确定",cancel:"取消",ticketsTitle:"工单标题",noEmpty:"不可为空",pleaseEntry:"请输入",ticketsType:"工单类型",ticketsDetail:"工单详情",ticketsLevel:"优先级",operationSuccess:"操作成功",fileSizeMax:"单个文件大小限制",fileCountMax:"单次数量限制 {x} 个"},apTableModal:{titleSuffixOne:"最多可添加{maxCount}个,",titleSuffixTwo:"已添加",titleSuffixThree:"个",messageMaxCount:"最多选择{maxCount}条数据",clear:"清空",selected:"已选"},apAttachment:{downloadall:"下载全部",more:"更多"},apExpandAlert:{expand:"展开",collapse:"收起"},apAppendix:{downloadAll:"下载全部",downloadFile:"下载文件",appendix:"附件"},apGroupSearch:{defaultPlaceholder:"请输入",all:"全部",close:"关闭",clear:"清空",confirm:"确定",tokenSeparatorsPlaceholder:"支持批量输入,可用逗号、换行符号分隔,最多输入200条"}}};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={name:"zh-cn",ap:{common:{okText:"确认",cancelText:"取消",resetText:"重置",queryText:"查询",expandText:"展开",closeText:"收起",inputText:"请输入",chooseText:"请选择",redo:"刷新",back:"返回",more:"更多"},field:{startDateText:"开始日期",endDateText:"结束日期"},modal:{restore:"还原",maximize:"最大化",close:"关闭"},countdown:{normalText:"获取验证码",sendText:"{sec}秒后重新获取"},apForm:{search:{search:"查询",reset:"重置"}},apTable:{pagination:{totalLeftPrefix:"共",totalLeftSuffix:"条记录",totalRightPrefix:"第",totalRightSuffix:"页"},setting:{title:"自定义表格",selectAll:"全选",unSelectAll:"取消全选",selectAllTip:"请选择需要展示在表格的字段",sizeSmall:"紧凑",sizeNormal:"正常",selectCount:"已选字段({count})",reset:"重置",fixToLeft:"固定在左侧",fixToRight:"固定在右侧",unFixed:"不固定",delete:"删除"},paragraphEllipsis:{copy:"复制",copySuccess:"复制成功"}},apUpload:{update:"上传",pictureType:"图片类型",videoType:"视频类型",audioType:"音频类型",documentType:"文档类型",allTypes:"全部类型",networkAnomaly:"网络异常",FailedToObtainOssTemporaryPermissions:"获取oss临时权限失败",pleasePass:"请传入",supportExtension:"支持扩展名",uploadFile:"上传文件",fileInitializationException:"文件初始化个数超过{maxCount}个,后续上传的文件会与数据不同步",maxUploadFiles:"最多上传{maxCount}个文件",maxUploadPicture:"最多上传{maxCount}张图片",maxUploadFileSize:"文件大小不超过{maxSize}MB",maxWarnUploadFileSize:"文件大小小于{maxSize}MB",maxUploadPictureSize:"图片大小小于{maxSize}MB",fileFormatNotSupported:"不支持该格式的文件",pictureFormatNotSupported:"不支持该格式的图片",imageParsingFailed:"图片解析失败",clickOrDragUpload:"点击或将文件拖拽到这里上传",foldersNotSupported:"不支持上传文件夹"},apExportGroup:{exportError:"导出失败",exportSelected:"导出所选",exportAll:"导出全部",export:"导出"},apBatchAction:{selected:"已选",piecesOfData:"条数据",empty:"清空"},apApBatchActionGroup:{batchOperation:"批量操作"},workOrderModal:{createTickets:"创建工单",submit:"确定",cancel:"取消",ticketsTitle:"工单标题",noEmpty:"不可为空",pleaseEntry:"请输入",ticketsType:"工单类型",ticketsDetail:"工单详情",ticketsLevel:"优先级",operationSuccess:"操作成功",fileSizeMax:"单个文件大小限制",fileCountMax:"单次数量限制 {x} 个"},apTableModal:{titleSuffixOne:"最多可添加{maxCount}个,",titleSuffixTwo:"已添加",titleSuffixThree:"个",messageMaxCount:"最多选择{maxCount}条数据",clear:"清空",selected:"已选"},apAttachment:{downloadall:"下载全部",more:"更多"},apExpandAlert:{expand:"展开",collapse:"收起"},apAppendix:{downloadAll:"下载全部",downloadFile:"下载文件",appendix:"附件"},apGroupSearch:{defaultPlaceholder:"请输入",all:"全部",close:"关闭",clear:"清空",confirm:"确定",tokenSeparatorsPlaceholder:"支持批量输入,可用逗号、换行符号分隔,最多输入200条"}}};exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -71,7 +71,7 @@
71
71
  "@aplus-frontend/icon": "^1.0.21",
72
72
  "@aplus-frontend/oss": "^1.1.2",
73
73
  "@aplus-frontend/antdv": "^1.0.3",
74
- "@aplus-frontend/ui-theme": "1.0.13"
74
+ "@aplus-frontend/ui-theme": "1.0.14"
75
75
  },
76
76
  "devDependencies": {
77
77
  "vue": "3.4.38",