@aplus-frontend/ui 0.1.9 → 0.1.10

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 (47) hide show
  1. package/es/src/ap-field/interface.d.ts +4 -0
  2. package/es/src/ap-field/select/index.vue.d.ts +6 -0
  3. package/es/src/ap-field/select/index.vue.mjs +36 -31
  4. package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
  5. package/es/src/ap-layout/ap-info-layout/ap-info-layout.vue.mjs +33 -23
  6. package/es/src/ap-table/ap-table.vue.mjs +158 -147
  7. package/es/src/ap-table/constants.d.ts +26 -0
  8. package/es/src/ap-table/hooks/use-table-paging.d.ts +4 -3
  9. package/es/src/ap-table/hooks/use-table-paging.mjs +63 -63
  10. package/es/src/ap-table/interface.d.ts +13 -1
  11. package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +53 -48
  12. package/es/src/business/ap-export-group/interface.d.ts +4 -0
  13. package/es/src/business/ap-label/ApLabel.vue2.mjs +18 -17
  14. package/es/src/business/ap-label/ApLabelGroup.d.ts +22 -4
  15. package/es/src/business/ap-label/ApLabelGroup.mjs +17 -23
  16. package/es/src/business/ap-label/constans.d.ts +10 -2
  17. package/es/src/business/ap-label/constans.mjs +8 -0
  18. package/es/src/business/ap-label/interface.d.ts +13 -8
  19. package/es/src/business/index.d.ts +35 -5
  20. package/es/src/theme/antd-global-overwrite/admin/button.css +3 -0
  21. package/es/src/theme/antd-global-overwrite/admin/index.css +3 -0
  22. package/es/src/theme/antd-global-overwrite/aplus/button.css +3 -0
  23. package/es/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  24. package/lib/src/ap-field/interface.d.ts +4 -0
  25. package/lib/src/ap-field/select/index.vue.d.ts +6 -0
  26. package/lib/src/ap-field/select/index.vue.js +1 -1
  27. package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.d.ts +6 -2
  28. package/lib/src/ap-layout/ap-info-layout/ap-info-layout.vue.js +1 -1
  29. package/lib/src/ap-table/ap-table.vue.js +1 -1
  30. package/lib/src/ap-table/constants.d.ts +26 -0
  31. package/lib/src/ap-table/hooks/use-table-paging.d.ts +4 -3
  32. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  33. package/lib/src/ap-table/interface.d.ts +13 -1
  34. package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
  35. package/lib/src/business/ap-export-group/interface.d.ts +4 -0
  36. package/lib/src/business/ap-label/ApLabel.vue2.js +1 -1
  37. package/lib/src/business/ap-label/ApLabelGroup.d.ts +22 -4
  38. package/lib/src/business/ap-label/ApLabelGroup.js +1 -1
  39. package/lib/src/business/ap-label/constans.d.ts +10 -2
  40. package/lib/src/business/ap-label/constans.js +1 -1
  41. package/lib/src/business/ap-label/interface.d.ts +13 -8
  42. package/lib/src/business/index.d.ts +35 -5
  43. package/lib/src/theme/antd-global-overwrite/admin/button.css +3 -0
  44. package/lib/src/theme/antd-global-overwrite/admin/index.css +3 -0
  45. package/lib/src/theme/antd-global-overwrite/aplus/button.css +3 -0
  46. package/lib/src/theme/antd-global-overwrite/aplus/index.css +3 -0
  47. package/package.json +3 -3
@@ -1,94 +1,94 @@
1
- import { ref as v, nextTick as N, unref as o, onMounted as U, computed as S } from "vue";
1
+ import { ref as S, nextTick as N, unref as o, onMounted as U, computed as z } from "vue";
2
2
  import { parseFieldValue as W, dataIndexToStr as X } from "../utils.mjs";
3
3
  import { isArray as Y } from "lodash-unified";
4
4
  import "../../config-provider/index.mjs";
5
5
  import { useLocale as Z } from "../../config-provider/hooks/use-locale.mjs";
6
6
  const oe = ({
7
- manual: $ = !1,
8
- defaultCurrent: j = 1,
9
- defaultPageSize: T = 10,
10
- request: D,
11
- defaultParams: R = {},
12
- defaultData: A = [],
13
- formatParams: z,
14
- paramsValueTypeMap: P,
15
- resetFieldsIgnores: w,
16
- filterFields: B = [],
17
- sortFields: E = []
7
+ manual: j = !1,
8
+ defaultCurrent: D = 1,
9
+ defaultPageSize: P = 10,
10
+ request: R,
11
+ defaultParams: A = {},
12
+ defaultData: B = [],
13
+ formatParams: w,
14
+ paramsValueTypeMap: V,
15
+ resetFieldsIgnores: b,
16
+ filterFields: E,
17
+ sortFields: L
18
18
  }) => {
19
- let F = 0, f = {};
20
- const L = (e) => z ? z(e) : e, l = v(), i = v(j), g = v(T), { t: V } = Z(), n = v({
19
+ let T = 0, f = {};
20
+ const M = (e) => w ? w(e) : e, l = S(), i = S(D), g = S(P), { t: C } = Z(), n = S({
21
21
  total: 0,
22
- records: A,
22
+ records: B,
23
23
  loading: !1
24
- }), b = async (e) => {
24
+ }), x = async (e) => {
25
25
  var r;
26
- const a = L(e), t = Date.now();
27
- F = t, n.value.loading = !0;
26
+ const a = M(e), t = Date.now();
27
+ T = t, n.value.loading = !0;
28
28
  try {
29
- const s = await D({
30
- ...R,
29
+ const s = await R({
30
+ ...A,
31
31
  ...a
32
32
  });
33
- F === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
33
+ T === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
34
34
  } catch {
35
- F === t && (n.value.records = [], n.value.total = 0);
35
+ T === t && (n.value.records = [], n.value.total = 0);
36
36
  } finally {
37
37
  n.value.loading = !1;
38
38
  }
39
- }, C = (e) => {
39
+ }, y = (e) => {
40
40
  const a = {};
41
41
  return Object.entries(e).forEach(([t, r]) => {
42
- if (a[t] = r, P && r) {
43
- const s = P[t];
42
+ if (a[t] = r, V && r) {
43
+ const s = V[t];
44
44
  s && (a[t] = W(s, r));
45
45
  }
46
46
  }), a;
47
- }, M = async (e) => {
48
- var r, s, d, p, m, u, c;
47
+ }, q = async (e) => {
48
+ var r, s, d, p, m, u, h;
49
49
  const a = ((s = (r = l.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
- Object.entries(a).forEach(([O, K]) => {
51
- w && w.indexOf(O) > -1 && (t[O] = K);
52
- }), await ((p = (d = l.value) == null ? void 0 : d.apForm) == null ? void 0 : p.resetFields()), (c = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), N(() => {
50
+ Object.entries(a).forEach(([v, c]) => {
51
+ b && b.indexOf(v) > -1 && (t[v] = c);
52
+ }), await ((p = (d = l.value) == null ? void 0 : d.apForm) == null ? void 0 : p.resetFields()), (h = (u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), N(() => {
53
53
  e == null || e();
54
54
  });
55
- }, h = (e) => {
55
+ }, F = (e) => {
56
56
  f = e;
57
- const a = C(e);
58
- b(a);
59
- }, q = (e) => {
60
- h({
57
+ const a = y(e);
58
+ x(a);
59
+ }, J = (e) => {
60
+ F({
61
61
  ...f,
62
62
  ...e
63
63
  });
64
- }, x = () => {
64
+ }, O = () => {
65
65
  var a, t;
66
66
  const e = ((t = (a = l.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
67
- i.value = 1, h({
67
+ i.value = 1, F({
68
68
  ...e,
69
69
  current: 1,
70
- pageSize: f.pageSize || T
70
+ pageSize: f.pageSize || P
71
71
  });
72
- }, J = () => {
73
- M(x);
74
72
  }, Q = () => {
75
- h(f);
76
- }, G = (e) => {
73
+ q(O);
74
+ }, G = () => {
75
+ F(f);
76
+ }, H = (e) => {
77
77
  const a = o(n).total - e, t = Math.ceil(a / o(g)), r = o(i) > t ? t : o(i);
78
- q({
78
+ J({
79
79
  current: r > 0 ? r : 1
80
80
  });
81
- }, y = (e, a, t) => {
82
- var m, u;
81
+ }, $ = (e, a, t) => {
82
+ var m, u, h, v;
83
83
  const r = ((u = (m = l.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
84
84
  i.value = e.current, g.value = e.pageSize;
85
85
  const s = Y(t) ? [...t] : [t], d = {};
86
86
  for (const c of s)
87
- E.includes(c.field) && (d[X(c.field)] = c.order);
87
+ (h = o(L)) != null && h.includes(c.field) && (d[X(c.field)] = c.order);
88
88
  const p = {};
89
89
  for (const c of Object.keys(a))
90
- B.includes(c) && (p[c] = a[c]);
91
- h({
90
+ (v = o(E)) != null && v.includes(c) && (p[c] = a[c]);
91
+ F({
92
92
  ...r,
93
93
  filter: p,
94
94
  sort: d,
@@ -103,14 +103,14 @@ const oe = ({
103
103
  current: o(i),
104
104
  pageSize: o(g),
105
105
  ...e
106
- }, !$) {
107
- const r = C(f);
108
- b(r);
106
+ }, !j) {
107
+ const r = y(f);
108
+ x(r);
109
109
  }
110
110
  });
111
- const H = S(() => o(n).total === 0 ? "-" : `${o(i.value)}/${Math.ceil(
111
+ const I = z(() => o(n).total === 0 ? "-" : `${o(i.value)}/${Math.ceil(
112
112
  o(n).total / o(g)
113
- )}`), I = S(() => ({
113
+ )}`), K = z(() => ({
114
114
  loading: o(n).loading,
115
115
  pagination: {
116
116
  current: o(i),
@@ -118,26 +118,26 @@ const oe = ({
118
118
  total: o(n).total,
119
119
  showSizeChanger: !0,
120
120
  showQuickJumper: !0,
121
- showTotal: (e) => `${V("ap.apTable.pagination.totalLeft", { total: e })} ${V(
121
+ showTotal: (e) => `${C("ap.apTable.pagination.totalLeft", { total: e })} ${C(
122
122
  "ap.apTable.pagination.totalRight",
123
- { page: o(H) }
123
+ { page: o(I) }
124
124
  )}`
125
125
  },
126
- onChange: y,
126
+ onChange: $,
127
127
  dataSource: o(n).records
128
128
  }));
129
129
  return {
130
130
  formRef: l,
131
- submit: x,
132
- reset: J,
133
- refresh: Q,
134
- refreshByDelete: G,
131
+ submit: O,
132
+ reset: Q,
133
+ refresh: G,
134
+ refreshByDelete: H,
135
135
  data: n,
136
136
  current: i,
137
137
  pageSize: g,
138
- handleTableChange: y,
139
- tableProps: I,
140
- dataSource: S(() => o(n).records)
138
+ handleTableChange: $,
139
+ tableProps: K,
140
+ dataSource: z(() => o(n).records)
141
141
  };
142
142
  };
143
143
  export {
@@ -101,6 +101,17 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
101
101
  * 自定义查询表单渲染
102
102
  */
103
103
  customRenderFormItem?: (config: ApColumnType<RecordType, ValueType>) => any;
104
+ /**
105
+ * 自定义渲染文本,和customRender相比,其必须返回字符串,并且后续的渲染(例如copy/ellipsis)都将使用这个值
106
+ */
107
+ renderText?: (option: {
108
+ value: any;
109
+ text: any;
110
+ record: RecordType;
111
+ index: number;
112
+ renderIndex: number;
113
+ column: ApColumnType<RecordType>;
114
+ }) => string;
104
115
  /**
105
116
  * 指定值类型(将会用于默认渲染和查询表单生成)
106
117
  */
@@ -126,7 +137,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
126
137
  */
127
138
  filters?: ColumnType<RecordType>['filters'] | true;
128
139
  /**
129
- * 自定义渲染,添加了`editable`以及`originalNode`
140
+ * 自定义渲染,添加了`editable`以及`originalNode、originalText`
130
141
  * @param opt
131
142
  * @returns
132
143
  */
@@ -138,6 +149,7 @@ export type ApColumnType<RecordType = any, ValueType extends ApTableValueTypes =
138
149
  renderIndex: number;
139
150
  column: ApColumnType<RecordType>;
140
151
  originalNode?: VNode;
152
+ originalText?: any;
141
153
  }) => any;
142
154
  } : never;
143
155
  export type RequestData<T> = {
@@ -1,14 +1,14 @@
1
- import { defineComponent as G, computed as u, ref as N, openBlock as f, createBlock as y, unref as t, normalizeClass as D, withCtx as i, createVNode as x, createTextVNode as h, toDisplayString as w, normalizeStyle as B, createCommentVNode as K } from "vue";
2
- import { formatFileNameAndDownloadFile as T } from "@aplus-frontend/utils";
1
+ import { defineComponent as D, computed as c, ref as B, openBlock as p, createBlock as y, unref as t, normalizeClass as K, withCtx as i, createVNode as x, createTextVNode as h, toDisplayString as w, normalizeStyle as T, createCommentVNode as I } from "vue";
2
+ import { formatFileNameAndDownloadFile as P } from "@aplus-frontend/utils";
3
3
  import { DownOutlined as V } from "@ant-design/icons-vue";
4
- import { Modal as z, Dropdown as O, Menu as I, MenuItem as C, Button as J } from "ant-design-vue";
4
+ import { Modal as z, Dropdown as O, Menu as J, MenuItem as E, Button as R } from "ant-design-vue";
5
5
  import "../../config-provider/index.mjs";
6
- import { ActionType as c } from "./interface.mjs";
7
- import { usePermission as R } from "@aplus-frontend/hooks";
8
- import { useNamespace as j } from "../../config-provider/hooks/use-namespace.mjs";
9
- import { useLocale as H } from "../../config-provider/hooks/use-locale.mjs";
10
- import { useGlobalConfig as P } from "../../config-provider/hooks/use-global-config.mjs";
11
- const oe = /* @__PURE__ */ G({
6
+ import { ActionType as d } from "./interface.mjs";
7
+ import { usePermission as j } from "@aplus-frontend/hooks";
8
+ import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
9
+ import { useLocale as Q } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useGlobalConfig as U } from "../../config-provider/hooks/use-global-config.mjs";
11
+ const ne = /* @__PURE__ */ D({
12
12
  __name: "ApExportGroup",
13
13
  props: {
14
14
  selectedRowKeys: {},
@@ -17,71 +17,76 @@ const oe = /* @__PURE__ */ G({
17
17
  ifShow: { type: Function },
18
18
  text: {},
19
19
  request: { type: Function },
20
- getRequestParams: { type: Function }
20
+ getRequestParams: { type: Function },
21
+ getInitialParams: { type: Function }
21
22
  },
22
- setup(E) {
23
- const { hasPermission: L } = R(), e = E, { b: S } = j("ap-export-group"), { t: s } = H(), F = P("uiMode"), g = u(() => {
23
+ setup(F) {
24
+ const { hasPermission: L } = j(), e = F, { b: S } = H("ap-export-group"), { t: s } = Q(), g = U("uiMode"), A = c(() => {
24
25
  const o = {
25
26
  aplus: "#0070FF",
26
27
  admin: "#34b77c"
27
28
  };
28
- return b.value ? "" : o[F.value] || o.aplus;
29
- }), b = u(() => !!(e != null && e.disabled)), A = {
29
+ return b.value ? "" : o[g.value] || o.aplus;
30
+ }), b = c(() => !!(e != null && e.disabled)), M = {
30
31
  textAlign: "center"
31
- }, p = N(!1), v = u(() => (e == null ? void 0 : e.selectedRowKeys) || []), M = u(() => {
32
+ }, m = B(!1), v = c(() => (e == null ? void 0 : e.selectedRowKeys) || []), k = c(() => {
32
33
  let o = e == null ? void 0 : e.ifShow;
33
34
  return !(e != null && e.ifShow) && (e != null && e.auth) && (o = () => L(e.auth)), (o == null ? void 0 : o()) ?? !0;
34
35
  });
35
- async function k({ key: o }) {
36
- var _;
37
- const { getRequestParams: n, request: r } = e || {};
38
- let l = {};
39
- if (o === c.SELECT) {
36
+ async function G({ key: o }) {
37
+ var _, C;
38
+ const { getRequestParams: n, request: l } = e || {};
39
+ let r = {};
40
+ if (o === d.SELECT) {
40
41
  const a = ((n == null ? void 0 : n()) || {}).exportFieldList;
41
- l = {
42
+ r = {
42
43
  ids: v.value,
43
44
  exportFieldList: a
44
45
  };
45
- for (const d in l)
46
- l[d] || delete l[d];
47
- } else o === c.ALL && (l = (n == null ? void 0 : n()) || {});
46
+ for (const u in r)
47
+ r[u] || delete r[u];
48
+ } else o === d.ALL && (r = (n == null ? void 0 : n()) || {});
49
+ const N = ((_ = e == null ? void 0 : e.getInitialParams) == null ? void 0 : _.call(e)) || {};
48
50
  try {
49
- p.value = !0;
50
- const a = await (r == null ? void 0 : r(l));
51
- a.headers && !((_ = a == null ? void 0 : a.headers) != null && _["content-disposition"]) ? a.data.text().then((d) => {
52
- const m = JSON.parse(d || "{}");
53
- m.code && m.code !== "200" && z.error({
51
+ m.value = !0;
52
+ const a = await (l == null ? void 0 : l({
53
+ ...r,
54
+ ...N
55
+ }));
56
+ a.headers && !((C = a == null ? void 0 : a.headers) != null && C["content-disposition"]) ? a.data.text().then((u) => {
57
+ const f = JSON.parse(u || "{}");
58
+ f.code && f.code !== "200" && z.error({
54
59
  title: s("ap.apExportGroup.exportError"),
55
- content: m.message,
60
+ content: f.message,
56
61
  centered: !0
57
62
  });
58
- }) : T(a);
63
+ }) : P(a);
59
64
  } finally {
60
- p.value = !1;
65
+ m.value = !1;
61
66
  }
62
67
  }
63
- return (o, n) => M.value ? (f(), y(t(O), {
68
+ return (o, n) => k.value ? (p(), y(t(O), {
64
69
  key: 0,
65
- class: D([t(S)()]),
66
- overlayStyle: A,
70
+ class: K([t(S)()]),
71
+ overlayStyle: M,
67
72
  disabled: b.value
68
73
  }, {
69
74
  overlay: i(() => [
70
- x(t(I), { onClick: k }, {
75
+ x(t(J), { onClick: G }, {
71
76
  default: i(() => {
72
- var r;
77
+ var l;
73
78
  return [
74
- (f(), y(t(C), {
75
- key: t(c).SELECT,
76
- disabled: ((r = v.value) == null ? void 0 : r.length) === 0
79
+ (p(), y(t(E), {
80
+ key: t(d).SELECT,
81
+ disabled: ((l = v.value) == null ? void 0 : l.length) === 0
77
82
  }, {
78
83
  default: i(() => [
79
84
  h(w(t(s)("ap.apExportGroup.exportSelected")), 1)
80
85
  ]),
81
86
  _: 1
82
87
  }, 8, ["disabled"])),
83
- (f(), y(t(C), {
84
- key: t(c).ALL
88
+ (p(), y(t(E), {
89
+ key: t(d).ALL
85
90
  }, {
86
91
  default: i(() => [
87
92
  h(w(t(s)("ap.apExportGroup.exportAll")), 1)
@@ -94,11 +99,11 @@ const oe = /* @__PURE__ */ G({
94
99
  })
95
100
  ]),
96
101
  default: i(() => [
97
- x(t(J), {
98
- style: B({
99
- color: g.value
102
+ x(t(R), {
103
+ style: T({
104
+ color: A.value
100
105
  }),
101
- loading: p.value
106
+ loading: m.value
102
107
  }, {
103
108
  default: i(() => [
104
109
  h(w((e == null ? void 0 : e.text) ?? t(s)("ap.apExportGroup.export")) + " ", 1),
@@ -108,9 +113,9 @@ const oe = /* @__PURE__ */ G({
108
113
  }, 8, ["style", "loading"])
109
114
  ]),
110
115
  _: 1
111
- }, 8, ["class", "disabled"])) : K("", !0);
116
+ }, 8, ["class", "disabled"])) : I("", !0);
112
117
  }
113
118
  });
114
119
  export {
115
- oe as default
120
+ ne as default
116
121
  };
@@ -28,6 +28,10 @@ export interface Props {
28
28
  * 导出接口参数
29
29
  */
30
30
  getRequestParams?: () => Record<string, any>;
31
+ /**
32
+ * 初始化参数
33
+ */
34
+ getInitialParams?: () => Record<string, any>;
31
35
  }
32
36
  export declare enum ActionType {
33
37
  ALL = "ALL",
@@ -1,8 +1,8 @@
1
- import { defineComponent as y, computed as A, openBlock as l, createElementBlock as p, normalizeClass as c, unref as t, createElementVNode as u, createVNode as k, normalizeProps as C, guardReactiveProps as g, renderSlot as m, Fragment as h, createBlock as n, withCtx as v, normalizeStyle as a, createCommentVNode as o } from "vue";
2
- import { Badge as b, Tooltip as z } from "ant-design-vue";
3
- import { IconApAdLineAnnotation as B, IconApAdFillWarn as F, IconApAdFillExecution as S, IconApAdFillSuccessful as w } from "@aplus-frontend/icon";
1
+ import { defineComponent as y, computed as A, openBlock as l, createElementBlock as c, normalizeClass as i, unref as t, createElementVNode as u, createVNode as k, normalizeProps as C, guardReactiveProps as g, renderSlot as m, Fragment as h, createBlock as n, withCtx as v, normalizeStyle as a, createCommentVNode as o } from "vue";
2
+ import { Badge as b, Tooltip as x } from "ant-design-vue";
3
+ import { IconApAdLineAnnotation as z, IconApAdFillWarn as B, IconApAdFillExecution as F, IconApAdFillSuccessful as S } from "@aplus-frontend/icon";
4
4
  import "../../config-provider/index.mjs";
5
- import { omit as x } from "lodash-unified";
5
+ import { omit as w } from "lodash-unified";
6
6
  import "./style.css";
7
7
  import { useNamespace as T } from "../../config-provider/hooks/use-namespace.mjs";
8
8
  const $ = /* @__PURE__ */ y({
@@ -33,36 +33,37 @@ const $ = /* @__PURE__ */ y({
33
33
  const s = A(() => ({
34
34
  color: e.iconColor,
35
35
  "font-size": e.iconSize + "px",
36
- "margin-left": "4px"
37
- })), e = d, { b: f, e: i } = T("ap-label");
38
- return (r, N) => e.show ? (l(), p("div", {
36
+ "margin-left": "4px",
37
+ display: "inline-flex"
38
+ })), e = d, { b: f, e: p } = T("ap-label");
39
+ return (r, N) => e.show ? (l(), c("div", {
39
40
  key: 0,
40
- class: c([t(f)()])
41
+ class: i([t(f)()])
41
42
  }, [
42
43
  u("div", {
43
- class: c([t(i)("content")])
44
+ class: i([t(p)("content")])
44
45
  }, [
45
- k(t(b), C(g(t(x)(e, ["helpMessage", "placement", "iconColor"]))), null, 16),
46
- r.$slots.default ? m(r.$slots, "default", { key: 0 }) : (l(), p(h, { key: 1 }, [
47
- e.helpMessage ? (l(), n(t(z), {
46
+ k(t(b), C(g(t(w)(e, ["helpMessage", "placement", "iconColor"]))), null, 16),
47
+ r.$slots.default ? m(r.$slots, "default", { key: 0 }) : (l(), c(h, { key: 1 }, [
48
+ e.helpMessage ? (l(), n(t(x), {
48
49
  key: 0,
49
50
  placement: e.placement,
50
51
  title: e.helpMessage
51
52
  }, {
52
53
  default: v(() => [
53
- e.iconType === "question" ? (l(), n(t(B), {
54
+ e.iconType === "question" ? (l(), n(t(z), {
54
55
  key: 0,
55
56
  style: a(s.value)
56
57
  }, null, 8, ["style"])) : o("", !0),
57
- e.iconType === "warning" ? (l(), n(t(F), {
58
+ e.iconType === "warning" ? (l(), n(t(B), {
58
59
  key: 1,
59
60
  style: a(s.value)
60
61
  }, null, 8, ["style"])) : o("", !0),
61
- e.iconType === "ellipsis" ? (l(), n(t(S), {
62
+ e.iconType === "ellipsis" ? (l(), n(t(F), {
62
63
  key: 2,
63
64
  style: a(s.value)
64
65
  }, null, 8, ["style"])) : o("", !0),
65
- e.iconType === "success" ? (l(), n(t(w), {
66
+ e.iconType === "success" ? (l(), n(t(S), {
66
67
  key: 3,
67
68
  style: a(s.value)
68
69
  }, null, 8, ["style"])) : o("", !0)
@@ -72,7 +73,7 @@ const $ = /* @__PURE__ */ y({
72
73
  ], 64))
73
74
  ], 2),
74
75
  u("div", {
75
- class: c([t(i)("custom")])
76
+ class: i([t(p)("custom")])
76
77
  }, [
77
78
  m(r.$slots, "custom")
78
79
  ], 2)
@@ -1,12 +1,20 @@
1
- import { AplabelGroupItemProps } from './interface';
1
+ import { ApLabelGroupItemProps } from './interface';
2
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
3
  declare const _default: DefineComponent<{
4
4
  value: {
5
5
  type: PropType<string | number | undefined>;
6
6
  default: undefined;
7
7
  };
8
+ tagValue: {
9
+ type: PropType<string | number | undefined>;
10
+ default: undefined;
11
+ };
8
12
  columns: {
9
- type: PropType<Array<AplabelGroupItemProps>>;
13
+ type: PropType<Array<ApLabelGroupItemProps<any>>>;
14
+ default: null;
15
+ };
16
+ record: {
17
+ type: PropType<any>;
10
18
  default: null;
11
19
  };
12
20
  }, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
@@ -14,12 +22,22 @@ declare const _default: DefineComponent<{
14
22
  type: PropType<string | number | undefined>;
15
23
  default: undefined;
16
24
  };
25
+ tagValue: {
26
+ type: PropType<string | number | undefined>;
27
+ default: undefined;
28
+ };
17
29
  columns: {
18
- type: PropType<Array<AplabelGroupItemProps>>;
30
+ type: PropType<Array<ApLabelGroupItemProps<any>>>;
31
+ default: null;
32
+ };
33
+ record: {
34
+ type: PropType<any>;
19
35
  default: null;
20
36
  };
21
37
  }>>, {
22
38
  value: string | number | undefined;
23
- columns: AplabelGroupItemProps[];
39
+ columns: ApLabelGroupItemProps<any>[];
40
+ record: any;
41
+ tagValue: string | number | undefined;
24
42
  }, {}>;
25
43
  export default _default;
@@ -1,36 +1,30 @@
1
- import { defineComponent as s, createVNode as o, mergeProps as p, createTextVNode as m } from "vue";
1
+ import { defineComponent as n, createVNode as o, mergeProps as l, createTextVNode as m } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
3
  import "./ApLabel.vue.mjs";
4
- import { omit as a } from "lodash-unified";
4
+ import { omit as t } from "lodash-unified";
5
5
  import { ApLabelGroupProps as f } from "./constans.mjs";
6
- import { Tag as c } from "ant-design-vue";
7
- import { useNamespace as d } from "../../config-provider/hooks/use-namespace.mjs";
8
- import g from "./ApLabel.vue2.mjs";
6
+ import { Tag as s } from "ant-design-vue";
7
+ import { useNamespace as c } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import i from "./ApLabel.vue2.mjs";
9
9
  const {
10
- b: i
11
- } = d("ap-label-group"), N = /* @__PURE__ */ s({
10
+ b: g
11
+ } = c("ap-label-group"), E = /* @__PURE__ */ n({
12
12
  name: "ApLabelGroup",
13
13
  props: f(),
14
- setup(e) {
15
- const l = (r, u) => {
16
- var t;
17
- return (t = r.tagConfig) != null && t.text ? () => o(c, a(r == null ? void 0 : r.tagConfig, ["text"]), {
18
- default: () => {
19
- var n;
20
- return [(n = r.tagConfig) == null ? void 0 : n.text];
21
- }
22
- }) : r.customRender ? () => o("div", null, [r.customRender(r.value, u)]) : null;
23
- };
14
+ setup(r) {
15
+ const a = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(s, t(u, ["text"]), {
16
+ default: () => [u.text]
17
+ })) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
24
18
  return () => o("div", {
25
- class: i()
26
- }, [e.columns ? e.columns.map((r, u) => o(g, p({
19
+ class: g()
20
+ }, [r.columns ? r.columns.map((e, u) => o(i, l({
27
21
  key: u,
28
- show: e.value === r.value
29
- }, a(r, ["value", "tagConfig", "customRender"])), {
30
- custom: l(r, e.value)
22
+ show: r.value === e.value
23
+ }, t(e, ["value", "tagConfig", "customRender"])), {
24
+ custom: a(e)
31
25
  })) : o("div", null, [m("columns数组不能为空")])]);
32
26
  }
33
27
  });
34
28
  export {
35
- N as default
29
+ E as default
36
30
  };
@@ -1,12 +1,20 @@
1
1
  import { PropType } from 'vue';
2
- import { AplabelGroupItemProps } from './interface';
2
+ import { ApLabelGroupItemProps } from './interface';
3
3
  export declare const ApLabelGroupProps: () => {
4
4
  value: {
5
5
  type: PropType<string | number | undefined>;
6
6
  default: undefined;
7
7
  };
8
+ tagValue: {
9
+ type: PropType<string | number | undefined>;
10
+ default: undefined;
11
+ };
8
12
  columns: {
9
- type: PropType<Array<AplabelGroupItemProps>>;
13
+ type: PropType<Array<ApLabelGroupItemProps<any>>>;
14
+ default: null;
15
+ };
16
+ record: {
17
+ type: PropType<any>;
10
18
  default: null;
11
19
  };
12
20
  };
@@ -3,9 +3,17 @@ const e = () => ({
3
3
  type: String,
4
4
  default: void 0
5
5
  },
6
+ tagValue: {
7
+ type: String,
8
+ default: void 0
9
+ },
6
10
  columns: {
7
11
  type: Array,
8
12
  default: null
13
+ },
14
+ record: {
15
+ type: Object,
16
+ default: null
9
17
  }
10
18
  });
11
19
  export {