@aplus-frontend/ui 6.30.0 → 6.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/es/src/ap-form/search-form/index.vue.mjs +40 -40
  2. package/es/src/ap-grid/utils/col.d.ts +1 -0
  3. package/es/src/ap-grid/utils/col.mjs +54 -49
  4. package/es/src/business/ap-appendix/ap-appendix.vue2.mjs +95 -81
  5. package/es/src/business/ap-appendix/icons/empty-admin-icon.vue.d.ts +3 -0
  6. package/es/src/business/ap-appendix/icons/empty-admin-icon.vue.mjs +20 -0
  7. package/es/src/business/ap-appendix/icons/empty-aplus-icon.vue.d.ts +3 -0
  8. package/es/src/business/ap-appendix/icons/empty-aplus-icon.vue.mjs +20 -0
  9. package/es/src/business/ap-appendix/interface.d.ts +1 -0
  10. package/es/src/business/ap-view/ap-view.vue2.mjs +80 -80
  11. package/es/src/business/ap-view/interface.d.ts +13 -3
  12. package/es/src/locale/lang/en.mjs +2 -1
  13. package/es/src/locale/lang/zh-cn.mjs +2 -1
  14. package/es/src/mask/utils.d.ts +1 -1
  15. package/es/src/mask/utils.mjs +29 -13
  16. package/es/src/version.d.ts +1 -1
  17. package/es/src/version.mjs +1 -1
  18. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  19. package/lib/src/ap-grid/utils/col.d.ts +1 -0
  20. package/lib/src/ap-grid/utils/col.js +1 -1
  21. package/lib/src/business/ap-appendix/ap-appendix.vue2.js +1 -1
  22. package/lib/src/business/ap-appendix/icons/empty-admin-icon.vue.d.ts +3 -0
  23. package/lib/src/business/ap-appendix/icons/empty-admin-icon.vue.js +1 -0
  24. package/lib/src/business/ap-appendix/icons/empty-aplus-icon.vue.d.ts +3 -0
  25. package/lib/src/business/ap-appendix/icons/empty-aplus-icon.vue.js +1 -0
  26. package/lib/src/business/ap-appendix/interface.d.ts +1 -0
  27. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  28. package/lib/src/business/ap-view/interface.d.ts +13 -3
  29. package/lib/src/locale/lang/en.js +1 -1
  30. package/lib/src/locale/lang/zh-cn.js +1 -1
  31. package/lib/src/mask/utils.d.ts +1 -1
  32. package/lib/src/mask/utils.js +3 -3
  33. package/lib/src/version.d.ts +1 -1
  34. package/lib/src/version.js +1 -1
  35. package/package.json +1 -1
  36. package/theme/antdv-override.css +0 -6
  37. package/theme/antdv-override.less +0 -8
  38. package/theme/ap-appendix/ap-appendix.css +15 -0
  39. package/theme/ap-appendix/ap-appendix.less +15 -0
  40. package/theme/ap-expand-alert/ap-expand-alert.css +0 -4
  41. package/theme/ap-expand-alert/ap-expand-alert.less +6 -5
  42. package/theme/ap-view/ap-view.css +4 -0
  43. package/theme/ap-view/ap-view.less +4 -0
  44. package/theme/index.css +19 -10
@@ -1,21 +1,21 @@
1
- import { isVNode as se, defineComponent as ie, useSlots as ue, ref as D, shallowRef as U, computed as _, unref as a, watch as z, createVNode as o, Fragment as w, createBlock as y, openBlock as p, mergeProps as ce, withCtx as B, resolveDynamicComponent as I, createElementBlock as pe, renderList as de, normalizeStyle as fe } from "vue";
2
- import { Col as R, Flex as k, Button as M, Row as me } from "@aplus-frontend/antdv";
1
+ import { isVNode as se, defineComponent as ie, useSlots as ue, ref as U, shallowRef as z, computed as _, unref as a, watch as M, createVNode as o, Fragment as w, createBlock as y, openBlock as p, mergeProps as ce, withCtx as B, resolveDynamicComponent as I, createElementBlock as pe, renderList as de, normalizeStyle as fe } from "vue";
2
+ import { Col as R, Flex as k, Button as q, Row as me } from "@aplus-frontend/antdv";
3
3
  import "../ap-form.vue.mjs";
4
4
  import "../item/index.vue2.mjs";
5
- import { genRealChildren as q } from "../item-group/helper.mjs";
5
+ import { genRealChildren as H } from "../item-group/helper.mjs";
6
6
  import "../../config-provider/index.mjs";
7
7
  import { isArray as he, isBoolean as xe, omit as ye } from "lodash-unified";
8
- import { isDef as H } from "../../utils/index.mjs";
9
- import { execFunc as G, diffFormItem as ge } from "./utils.mjs";
8
+ import { isDef as G } from "../../utils/index.mjs";
9
+ import { execFunc as J, diffFormItem as ge } from "./utils.mjs";
10
10
  import "./components/popover-filter.vue.mjs";
11
11
  import { useCountPerRow as ve } from "./hooks/use-count-per-row.mjs";
12
12
  import "./components/popover-sorter/index.vue.mjs";
13
13
  import { useSorter as Ce } from "./hooks/use-sorter.mjs";
14
14
  import { getTargetNode as Se } from "./hooks/use-collapse-input-count.mjs";
15
- import { floorWith as J } from "@fruits-chain/utils";
15
+ import { floorWith as K } from "@fruits-chain/utils";
16
16
  import { useNamespace as _e } from "../../config-provider/hooks/use-namespace.mjs";
17
17
  import { useLocale as we } from "../../config-provider/hooks/use-locale.mjs";
18
- import K from "../item/index.vue.mjs";
18
+ import Q from "../item/index.vue.mjs";
19
19
  import Re from "./components/popover-filter.vue2.mjs";
20
20
  import be from "./components/popover-sorter/index.vue2.mjs";
21
21
  import Fe from "../ap-form.vue2.mjs";
@@ -119,57 +119,57 @@ const r = 100, Qe = /* @__PURE__ */ ie({
119
119
  }
120
120
  },
121
121
  setup(d, {
122
- expose: Q
122
+ expose: X
123
123
  }) {
124
124
  const g = ue(), t = d, {
125
125
  b: f
126
126
  } = _e("ap-form-search-form"), {
127
127
  t: T
128
- } = we(), X = ve(t), v = D(), Y = D();
129
- function P() {
128
+ } = we(), Y = ve(t), v = U(), P = U();
129
+ function E() {
130
130
  const e = v.value?.getFieldsValueTransformed(!0);
131
- G(t.onSubmit, e);
131
+ J(t.onSubmit, e);
132
132
  }
133
133
  function Z() {
134
- t.customReset || v.value?.resetFields?.(), G(t.onReset);
134
+ t.customReset || v.value?.resetFields?.(), J(t.onReset);
135
135
  }
136
- const ee = (e) => H(e) ? (he(e) ? e : [e]).join("") : Date.now();
137
- let E = [];
138
- const m = U(q(g.default())), u = U(g.extra?.()), O = _(() => J(r / a(X), 4)), {
136
+ const ee = (e) => G(e) ? (he(e) ? e : [e]).join("") : Date.now();
137
+ let O = [];
138
+ const m = z(H(g.default())), u = z(g.extra?.()), L = _(() => K(r / a(Y), 4)), {
139
139
  items: b,
140
- sorted: L,
140
+ sorted: W,
141
141
  handleClickConfirm: F
142
142
  } = Ce(m);
143
- z(() => g.default(), (e) => {
144
- E = m.value, m.value = ge(E, q(e)), L.value = !1;
145
- }), z(() => g.extra?.(), (e) => {
143
+ M(() => g.default(), (e) => {
144
+ O = m.value, m.value = ge(O, H(e)), W.value = !1;
145
+ }), M(() => g.extra?.(), (e) => {
146
146
  u.value = e;
147
147
  });
148
148
  function te(e) {
149
- return J(e * (r / 24), 4);
149
+ return K(e * (r / 24), 4);
150
150
  }
151
151
  const n = _(() => {
152
- const e = m.value, c = [], l = [], x = [], s = a(O);
152
+ const e = m.value, c = [], l = [], x = [], s = a(L);
153
153
  let C = 0, A = 0;
154
154
  const ne = r * t.maxRows - s * (a(u) && !t.extraInAction ? 2 : 1);
155
155
  e.forEach((N) => {
156
- const $ = Se(N);
157
- if (!$)
156
+ const j = Se(N);
157
+ if (!j)
158
158
  return;
159
- const i = $.props;
160
- if (xe(i.hidden) ? !!i.hidden : H(i.hidden))
159
+ const i = j.props;
160
+ if (xe(i.hidden) ? !!i.hidden : G(i.hidden))
161
161
  c.push(N);
162
162
  else {
163
163
  let S = i.span ? te(i.span) : s;
164
- const j = {
164
+ const V = {
165
165
  node: N,
166
166
  span: S,
167
167
  key: `ApFormSearchFormItem-${ee(i.name)}-${i._signal}`
168
- }, V = r - C % r;
169
- V < S && (S += V), C += S, C > ne ? l.push(j) : (A = C, x.push(j));
168
+ }, D = r - C % r;
169
+ D < S && (S += D), C += S, C > ne ? l.push(V) : (A = C, x.push(V));
170
170
  }
171
171
  });
172
- const W = r - (A + s) % r, le = Math.ceil(A) % r < s, re = W < s ? r : W;
172
+ const $ = r - (A + s) % r, le = Math.ceil(A) % r < s, re = $ < s ? r : $;
173
173
  return {
174
174
  hideNode: o(w, null, [c]),
175
175
  nodes: x,
@@ -180,10 +180,10 @@ const r = 100, Qe = /* @__PURE__ */ ie({
180
180
  }), h = (e) => `${e}%`, oe = _(() => {
181
181
  let e;
182
182
  const c = n.value.collapseNodes.length || t.sortable && m.value.length, l = o(R, {
183
- flex: h(a(O)),
183
+ flex: h(a(L)),
184
184
  key: "actionWrapper"
185
185
  }, {
186
- default: () => [o(K, null, {
186
+ default: () => [o(Q, null, {
187
187
  default: () => [o(k, {
188
188
  wrap: "wrap",
189
189
  justify: n.value.lastRowOnlyIncludeActionAndExtra && !(a(u) && t.extraInAction) ? "flex-end" : "space-between"
@@ -195,17 +195,17 @@ const r = 100, Qe = /* @__PURE__ */ ie({
195
195
  default: () => [c ? o("div", {
196
196
  class: f("column-setting-trigger-wrapper")
197
197
  }, [n.value.collapseNodes.length ? o(Re, {
198
- onSubmit: P,
198
+ onSubmit: E,
199
199
  config: n.value.collapseNodes,
200
200
  submitLoading: t.submitLoading
201
201
  }, null) : null, t.sortable && b.value.length ? o(be, {
202
- ref: "sorterIns",
202
+ ref: P,
203
203
  items: b.value,
204
204
  onClickConfirm: F,
205
- sorted: L.value
206
- }, null) : null]) : null, o(M, {
205
+ sorted: W.value
206
+ }, null) : null]) : null, o(q, {
207
207
  type: "primary",
208
- onClick: P,
208
+ onClick: E,
209
209
  loading: t.submitLoading ? {
210
210
  delay: t.loadingDelay
211
211
  } : !1,
@@ -213,7 +213,7 @@ const r = 100, Qe = /* @__PURE__ */ ie({
213
213
  class: f("action-btn")
214
214
  }, {
215
215
  default: () => [t.searchText || T("ap.apForm.search.search")]
216
- }), o(M, {
216
+ }), o(q, {
217
217
  onClick: Z,
218
218
  type: "text",
219
219
  class: [f("action-btn"), f("action-btn-reset")]
@@ -227,7 +227,7 @@ const r = 100, Qe = /* @__PURE__ */ ie({
227
227
  flex: h(n.value.extraSpan),
228
228
  key: "extraNode"
229
229
  }, {
230
- default: () => [o(K, null, {
230
+ default: () => [o(Q, null, {
231
231
  default: () => [o(k, {
232
232
  justify: n.value.extraSpan === r || n.value.lastRowOnlyIncludeActionAndExtra ? "start" : "flex-end"
233
233
  }, Ae(e = a(u)) ? e : {
@@ -240,10 +240,10 @@ const r = 100, Qe = /* @__PURE__ */ ie({
240
240
  return n.value.lastRowOnlyIncludeActionAndExtra ? o(w, null, [x || s, l]) : o(w, null, [l, x]);
241
241
  });
242
242
  function ae() {
243
- const e = Y.value?.getCachedList();
243
+ const e = P.value?.getCachedList();
244
244
  F(e);
245
245
  }
246
- return Q({
246
+ return X({
247
247
  apForm: _(() => a(v)),
248
248
  getSorterItems: () => b.value,
249
249
  setSorterItems: F,
@@ -1,6 +1,7 @@
1
1
  import { DataIndex } from '@aplus-frontend/antdv/es/vc-table/interface';
2
2
  import { ApGridColumnType, ColConfigType } from '../interface';
3
3
  import { ValueTypeRenderConfig } from '../../config-provider';
4
+ export declare function getValueByDataIndex(row: any, dataIndex?: DataIndex): any;
4
5
  export declare function dataIndexToField(dataIndex: DataIndex): string | undefined;
5
6
  export declare function transformFixed(fixed: ApGridColumnType['fixed']): "left" | "right" | undefined;
6
7
  /**
@@ -1,19 +1,23 @@
1
- import { createVNode as f, Fragment as p } from "vue";
2
- import { isUndefined as A, isArray as R, isString as y, isBoolean as c, isNumber as N, pick as b } from "lodash-unified";
3
- import { valueEnumToArray as w, objectToString as E, getTableTitle as F, getTableRenderType as O, getTableRenderProps as S, getTableCellRenderNode as $ } from "../../ap-table/utils.mjs";
4
- import { noRenderAsFormItemValueList as M } from "../../ap-table/constants.mjs";
1
+ import { createVNode as o, Fragment as p } from "vue";
2
+ import { isArray as c, isUndefined as N, isString as b, isBoolean as F, isNumber as E, pick as x } from "lodash-unified";
3
+ import { valueEnumToArray as O, objectToString as $, getTableTitle as v, getTableRenderType as w, getTableRenderProps as S, getTableCellRenderNode as V } from "../../ap-table/utils.mjs";
4
+ import { noRenderAsFormItemValueList as B } from "../../ap-table/constants.mjs";
5
5
  import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
6
- import V from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
- function v(e) {
8
- if (!A(e))
9
- return R(e) ? e.reduce((r, t) => y(t) ? `${r}.${t}` : `${r}[${t}]`, "") : String(e);
6
+ import M from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
+ function h(e, r) {
8
+ if (r)
9
+ return c(r) ? r.reduce((t, l) => t?.[l], e) : e?.[r];
10
10
  }
11
- function x(e) {
11
+ function A(e) {
12
+ if (!N(e))
13
+ return c(e) ? e.reduce((r, t) => b(t) ? `${r}${r ? "." : ""}${t}` : `${r}[${t}]`, "") : String(e);
14
+ }
15
+ function R(e) {
12
16
  if (e)
13
17
  return e === !0 ? "left" : e;
14
18
  }
15
19
  function j(e) {
16
- return c(e) ? {
20
+ return F(e) ? {
17
21
  sortable: e
18
22
  } : e ? {
19
23
  sortable: !0,
@@ -25,17 +29,17 @@ function j(e) {
25
29
  }
26
30
  function q(e) {
27
31
  let r;
28
- return c(e.filters) && e.valueEnum ? r = w(e.valueEnum) : r = e.filters, r?.map((t) => ({
29
- label: y(t.text) ? t.text : "",
32
+ return F(e.filters) && e.valueEnum ? r = O(e.valueEnum) : r = e.filters, r?.map((t) => ({
33
+ label: b(t.text) ? t.text : "",
30
34
  value: t.value
31
35
  }));
32
36
  }
33
- function B(e) {
37
+ function W(e) {
34
38
  if (e)
35
39
  return (r) => e(r.value, r.row);
36
40
  }
37
- function W(e, r) {
38
- return e ? N(e) ? {
41
+ function _(e, r) {
42
+ return e ? E(e) ? {
39
43
  tooltip: r,
40
44
  rows: e
41
45
  } : e === !0 || e === "tooltip" ? {
@@ -47,12 +51,12 @@ function W(e, r) {
47
51
  htmlTitle: e === "title" ? r : ""
48
52
  } : !1;
49
53
  }
50
- function _(e, r, t) {
51
- if (M.includes(e.valueType))
54
+ function k(e, r, t) {
55
+ if (B.includes(e.valueType))
52
56
  return t;
53
57
  if (e.copyable || e.ellipsis) {
54
- const l = W(e.ellipsis, r), i = E(r);
55
- return f(V, {
58
+ const l = _(e.ellipsis, r), i = $(r);
59
+ return o(M, {
56
60
  rawValue: i,
57
61
  copyable: e.copyable,
58
62
  ellipsis: l,
@@ -61,78 +65,79 @@ function _(e, r, t) {
61
65
  }
62
66
  return t;
63
67
  }
64
- function h(e, r, t) {
65
- const l = b(e, ["width", "minWidth", "align"]);
66
- return l.field = v(e.dataIndex), l.fixed = x(e.fixed), l.slots = {
67
- header: () => F(e, t, void 0, r)
68
+ function T(e, r, t) {
69
+ const l = x(e, ["width", "minWidth", "align"]);
70
+ return l.field = A(e.dataIndex), l.fixed = R(e.fixed), l.slots = {
71
+ header: () => v(e, t, void 0, r)
68
72
  }, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
69
73
  }
70
- const k = ({
74
+ const z = ({
71
75
  value: e,
72
76
  ...r
73
77
  }, t, l, i = !0) => {
74
- const s = O(t), d = S({
78
+ const s = w(t), d = S({
75
79
  ...t,
76
80
  valueType: s
77
81
  }, {
78
82
  value: e,
79
83
  ...r
80
- }), n = $(s, d, r.record, l), a = t.renderText?.({
84
+ }), n = V(s, d, r.record, l), a = t.renderText?.({
81
85
  value: e,
82
86
  ...r
83
- }) || e, u = t.renderText ? f(p, null, [t.renderText?.({
87
+ }) || e, u = t.renderText ? o(p, null, [t.renderText?.({
84
88
  value: e,
85
89
  ...r
86
90
  })]) : n;
87
- let o = i ? _(t, a, u) : u;
88
- return t.customRender && (o = t.customRender({
91
+ let f = i ? k(t, a, u) : u;
92
+ return t.customRender && (f = t.customRender({
89
93
  value: e,
90
94
  ...r,
91
95
  column: t,
92
- originalNode: o,
96
+ originalNode: f,
93
97
  originalText: a
94
- })), f(p, null, [o]);
98
+ })), o(p, null, [f]);
95
99
  };
96
- function T(e, r, t, l) {
97
- const i = b(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
98
- i.field = v(e.dataIndex), i.fixed = x(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, j(e.sorter)), i.filters = q(e), i.filterMultiple = e.filterMultiple, i.filterMethod = B(e.onFilter);
100
+ function y(e, r, t, l) {
101
+ const i = x(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
102
+ i.field = A(e.dataIndex), i.fixed = R(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, j(e.sorter)), i.filters = q(e), i.filterMultiple = e.filterMultiple, i.filterMethod = W(e.onFilter);
99
103
  const s = ({
100
104
  row: d,
101
105
  rowIndex: n
102
- }) => k({
103
- value: d[i.field],
104
- text: d[i.field],
106
+ }) => z({
107
+ value: h(d, e.dataIndex),
108
+ text: h(d, e.dataIndex),
105
109
  record: d,
106
110
  index: n,
107
111
  renderIndex: n,
108
112
  column: e
109
113
  }, e, l);
110
114
  return i.slots = {
111
- header: () => F(e, t, void 0, r),
115
+ header: () => v(e, t, void 0, r),
112
116
  default: s,
113
117
  footer: s
114
118
  }, e.html && (delete i.slots.default, delete i.slots.footer, i.type = "html"), e.seq && (i.type = "seq", i.slots = {}), i;
115
119
  }
116
- function H(e, r, t, l) {
120
+ function J(e, r, t, l) {
117
121
  if (!e.children?.length)
118
- return T(e, r, t, l);
122
+ return y(e, r, t, l);
119
123
  function i(d) {
120
124
  return d.map((n) => {
121
125
  if (n.children?.length) {
122
- const a = h(n, r, t);
126
+ const a = T(n, r, t);
123
127
  return a.children = i(n.children), a;
124
128
  }
125
- return T(n, r, t, l);
129
+ return y(n, r, t, l);
126
130
  });
127
131
  }
128
- const s = h(e, r, t);
132
+ const s = T(e, r, t);
129
133
  return s.children = i(e.children), s;
130
134
  }
131
135
  export {
132
- k as contentCustom,
133
- v as dataIndexToField,
134
- H as transformCol,
135
- x as transformFixed,
136
- h as transformToColGroup,
137
- T as transformToColumn
136
+ z as contentCustom,
137
+ A as dataIndexToField,
138
+ h as getValueByDataIndex,
139
+ J as transformCol,
140
+ R as transformFixed,
141
+ T as transformToColGroup,
142
+ y as transformToColumn
138
143
  };
@@ -1,18 +1,20 @@
1
- import { defineComponent as O, computed as p, ref as I, createElementBlock as m, openBlock as n, mergeProps as T, unref as e, renderSlot as d, createVNode as u, withCtx as g, createElementVNode as r, normalizeClass as o, createBlock as A, createCommentVNode as F, Fragment as V, renderList as S, createSlots as j, createTextVNode as D, toDisplayString as E } from "vue";
2
- import U from "./icons/file-icon.vue.mjs";
3
- import { Tooltip as z, TypographyText as G } from "@aplus-frontend/antdv";
4
- import { IconVariantDownload as P } from "@aplus-frontend/icon";
5
- import { LoadingOutlined as q } from "@ant-design/icons-vue";
1
+ import { defineComponent as T, computed as d, ref as E, createElementBlock as k, openBlock as r, mergeProps as V, unref as e, renderSlot as c, createCommentVNode as C, createVNode as v, withCtx as g, createElementVNode as s, normalizeClass as i, createBlock as p, Fragment as S, renderList as j, createSlots as D, createTextVNode as M, toDisplayString as h } from "vue";
2
+ import U from "./icons/empty-aplus-icon.vue.mjs";
3
+ import z from "./icons/empty-admin-icon.vue.mjs";
4
+ import G from "./icons/file-icon.vue.mjs";
5
+ import { Tooltip as P, TypographyText as q } from "@aplus-frontend/antdv";
6
+ import { IconVariantDownload as H } from "@aplus-frontend/icon";
7
+ import { LoadingOutlined as J } from "@ant-design/icons-vue";
6
8
  import "../ap-title/ApTitle.vue.mjs";
7
9
  import "../../ap-download/ap-download.vue2.mjs";
8
10
  import "../../config-provider/index.mjs";
9
- import { getFileInfo as H } from "./utils/index.mjs";
10
- import { useNamespace as J } from "../../config-provider/hooks/use-namespace.mjs";
11
- import { useLocale as K } from "../../config-provider/hooks/use-locale.mjs";
12
- import { useGlobalConfig as _ } from "../../config-provider/hooks/use-global-config.mjs";
13
- import M from "../ap-title/ApTitle.vue2.mjs";
14
- import Q from "../../ap-download/ap-download.vue.mjs";
15
- const R = ["onClick"], fe = /* @__PURE__ */ O({
11
+ import { getFileInfo as K } from "./utils/index.mjs";
12
+ import { useNamespace as Q } from "../../config-provider/hooks/use-namespace.mjs";
13
+ import { useLocale as R } from "../../config-provider/hooks/use-locale.mjs";
14
+ import { useGlobalConfig as N } from "../../config-provider/hooks/use-global-config.mjs";
15
+ import W from "../ap-title/ApTitle.vue2.mjs";
16
+ import X from "../../ap-download/ap-download.vue.mjs";
17
+ const Y = ["onClick"], ve = /* @__PURE__ */ T({
16
18
  __name: "ap-appendix",
17
19
  props: {
18
20
  fileList: {},
@@ -23,67 +25,67 @@ const R = ["onClick"], fe = /* @__PURE__ */ O({
23
25
  column: { default: 2 },
24
26
  isFileAreaBorder: { type: Boolean, default: !1 }
25
27
  },
26
- setup(h) {
27
- const { b: w, e: a, em: C } = J("ap-appendix"), { t: v } = K(), l = h, $ = _("apUpload"), k = _(
28
+ setup(w) {
29
+ const { b: _, e: l, em: F } = Q("ap-appendix"), { t: m } = R(), x = N("uiMode"), a = w, B = N("apUpload"), $ = N(
28
30
  "downloadCenterTriggerConfig"
29
- ), c = p(
30
- () => H(l?.needName, l?.fileList ?? [])
31
- ), x = p(
32
- () => l.getOssAccess || $.value?.getOssAccess
33
- ), N = p(
34
- () => !(Array.isArray(c.value) && c.value.length)
35
- ), i = I([]), B = p(() => l.title || v("ap.apAppendix.appendix"));
36
- async function b(s, f) {
37
- if (!(i.value.findIndex((t) => t === f) > -1)) {
38
- i.value = [...i.value, f];
31
+ ), f = d(
32
+ () => K(a?.needName, a?.fileList ?? [])
33
+ ), I = d(
34
+ () => a.getOssAccess || B.value?.getOssAccess
35
+ ), y = d(
36
+ () => !(Array.isArray(f.value) && f.value.length)
37
+ ), o = E([]), b = d(() => a.title || m("ap.apAppendix.appendix"));
38
+ async function O(n, u) {
39
+ if (!(o.value.findIndex((t) => t === u) > -1)) {
40
+ o.value = [...o.value, u];
39
41
  try {
40
- if (k.value?.trigger) {
41
- let t = [s].map((L) => ({
42
+ if ($.value?.trigger) {
43
+ let t = [n].map((L) => ({
42
44
  objectName: L.path,
43
45
  fileName: L.fileName
44
46
  }));
45
- await k.value?.trigger(t);
47
+ await $.value?.trigger(t);
46
48
  }
47
49
  } finally {
48
- i.value = i.value.filter((t) => t !== f);
50
+ o.value = o.value.filter((t) => t !== u);
49
51
  }
50
52
  }
51
53
  }
52
- return (s, f) => (n(), m("div", T({
53
- class: [e(w)()]
54
+ return (n, u) => (r(), k("div", V({
55
+ class: [e(_)()]
54
56
  }, {
55
- ...s.$attrs
57
+ ...n.$attrs
56
58
  }, {
57
59
  style: {
58
- "--ap-appendix-column": `repeat(${Number(l?.column || 2)}, 1fr)`
60
+ "--ap-appendix-column": `repeat(${Number(a?.column || 2)}, 1fr)`
59
61
  }
60
62
  }), [
61
- d(s.$slots, "title", {
62
- fileList: l.fileList
63
+ c(n.$slots, "title", {
64
+ fileList: a.fileList
63
65
  }, () => [
64
- u(M, {
65
- title: B.value,
66
- "help-message": l?.tooltip
66
+ v(W, {
67
+ title: b.value,
68
+ "help-message": a?.tooltip
67
69
  }, {
68
70
  suffix: g(() => [
69
- r("div", {
70
- class: o([e(a)("suffix")])
71
+ s("div", {
72
+ class: i([e(l)("suffix")])
71
73
  }, [
72
- d(s.$slots, "titleSuffix", {
73
- fileList: l.fileList
74
+ c(n.$slots, "titleSuffix", {
75
+ fileList: a.fileList
74
76
  }),
75
- d(s.$slots, "titleDownloadAllBtn", {
76
- fileList: l.fileList
77
+ c(n.$slots, "titleDownloadAllBtn", {
78
+ fileList: a.fileList
77
79
  }, () => [
78
- N.value ? F("", !0) : (n(), A(Q, {
80
+ y.value ? C("", !0) : (r(), p(X, {
79
81
  key: 0,
80
- class: o([e(a)("download-all")]),
81
- text: e(v)("ap.apAppendix.downloadAll"),
82
- "get-oss-access": x.value,
83
- "file-name": c.value
82
+ class: i([e(l)("download-all")]),
83
+ text: e(m)("ap.apAppendix.downloadAll"),
84
+ "get-oss-access": I.value,
85
+ "file-name": f.value
84
86
  }, {
85
87
  icon: g(() => [
86
- u(e(P))
88
+ v(e(H))
87
89
  ]),
88
90
  _: 1
89
91
  }, 8, ["class", "text", "get-oss-access", "file-name"]))
@@ -93,67 +95,79 @@ const R = ["onClick"], fe = /* @__PURE__ */ O({
93
95
  _: 3
94
96
  }, 8, ["title", "help-message"])
95
97
  ]),
96
- d(s.$slots, "fileArea", {
97
- fileList: l.fileList
98
+ y.value ? C("", !0) : c(n.$slots, "fileArea", {
99
+ key: 0,
100
+ fileList: a.fileList
98
101
  }, () => [
99
- N.value ? F("", !0) : (n(), m("div", {
100
- key: 0,
101
- class: o({
102
- [e(a)("file-area")]: !0,
103
- [e(C)("file-area", "border")]: !!l.isFileAreaBorder
102
+ s("div", {
103
+ class: i({
104
+ [e(l)("file-area")]: !0,
105
+ [e(F)("file-area", "border")]: !!a.isFileAreaBorder
104
106
  })
105
107
  }, [
106
- r("div", {
107
- class: o([e(a)("file-area-content")])
108
+ s("div", {
109
+ class: i([e(l)("file-area-content")])
108
110
  }, [
109
- (n(!0), m(V, null, S(c.value, (y, t) => (n(), m("div", {
111
+ (r(!0), k(S, null, j(f.value, (A, t) => (r(), k("div", {
110
112
  key: t,
111
- class: o({
112
- [e(a)("file-area-content-item")]: !0,
113
- [e(C)("file-area-content-item", "loading")]: i.value.includes(t)
113
+ class: i({
114
+ [e(l)("file-area-content-item")]: !0,
115
+ [e(F)("file-area-content-item", "loading")]: o.value.includes(t)
114
116
  })
115
117
  }, [
116
- u(e(z), null, j({
118
+ v(e(P), null, D({
117
119
  default: g(() => [
118
- r("div", {
119
- class: o({
120
- [e(a)("file-area-content-item-content")]: !0,
121
- [e(a)("file-area-content-item--loading-content")]: i.value.includes(t)
120
+ s("div", {
121
+ class: i({
122
+ [e(l)("file-area-content-item-content")]: !0,
123
+ [e(l)("file-area-content-item--loading-content")]: o.value.includes(t)
122
124
  }),
123
- onClick: (L) => b(y, t)
125
+ onClick: (L) => O(A, t)
124
126
  }, [
125
- r("div", {
126
- class: o([e(a)("file-area-content-item-icon")])
127
+ s("div", {
128
+ class: i([e(l)("file-area-content-item-icon")])
127
129
  }, [
128
- i.value.includes(t) ? (n(), A(e(q), { key: 0 })) : (n(), A(U, { key: 1 }))
130
+ o.value.includes(t) ? (r(), p(e(J), { key: 0 })) : (r(), p(G, { key: 1 }))
129
131
  ], 2),
130
- r("div", {
131
- class: o([e(a)("file-area-content-item-file-name")])
132
+ s("div", {
133
+ class: i([e(l)("file-area-content-item-file-name")])
132
134
  }, [
133
- u(e(G), {
135
+ v(e(q), {
134
136
  ellipsis: "",
135
- content: y.fileName
137
+ content: A.fileName
136
138
  }, null, 8, ["content"])
137
139
  ], 2)
138
- ], 10, R)
140
+ ], 10, Y)
139
141
  ]),
140
142
  _: 2
141
143
  }, [
142
- i.value.includes(t) ? void 0 : {
144
+ o.value.includes(t) ? void 0 : {
143
145
  name: "title",
144
146
  fn: g(() => [
145
- D(E(e(v)("ap.apAppendix.downloadFile")), 1)
147
+ M(h(e(m)("ap.apAppendix.downloadFile")), 1)
146
148
  ]),
147
149
  key: "0"
148
150
  }
149
151
  ]), 1024)
150
152
  ], 2))), 128))
151
153
  ], 2)
152
- ], 2))
153
- ])
154
+ ], 2)
155
+ ]),
156
+ y.value ? c(n.$slots, "empty", { key: 1 }, () => [
157
+ s("div", {
158
+ class: i([e(l)("empty")])
159
+ }, [
160
+ s("div", {
161
+ class: i([e(l)("empty-content")])
162
+ }, [
163
+ e(x) === "aplus" ? (r(), p(U, { key: 0 })) : (r(), p(z, { key: 1 })),
164
+ s("span", null, h(e(m)("ap.apAppendix.empty")), 1)
165
+ ], 2)
166
+ ], 2)
167
+ ]) : C("", !0)
154
168
  ], 16));
155
169
  }
156
170
  });
157
171
  export {
158
- fe as default
172
+ ve as default
159
173
  };
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, SVGSVGElement>;
3
+ export default _default;