@aplus-frontend/ui 0.6.0-beta.13 → 0.6.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/es/src/ap-grid/editable/form-item.vue.mjs +38 -35
  2. package/es/src/ap-grid/editable/index.vue.mjs +13 -10
  3. package/es/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
  4. package/es/src/ap-grid/hooks/use-row-selection.mjs +122 -0
  5. package/es/src/ap-grid/index.vue.mjs +271 -222
  6. package/es/src/ap-grid/interface.d.ts +16 -0
  7. package/es/src/ap-grid/utils/table.mjs +15 -15
  8. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
  9. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +99 -96
  10. package/es/src/business/ap-copy/ApCopy.mjs +43 -43
  11. package/es/src/business/ap-label/group/ApLabelGroup.mjs +15 -16
  12. package/es/src/business/ap-label/interface.d.ts +2 -3
  13. package/es/src/business/ap-product-info/ApProductInfo.mjs +23 -24
  14. package/es/src/business/ap-table-modal/table-modal.vue2.mjs +43 -42
  15. package/es/src/business/ap-view/ap-view.vue.d.ts +4 -1
  16. package/es/src/business/ap-view/ap-view.vue2.mjs +96 -84
  17. package/es/src/business/ap-view/index.d.ts +12 -3
  18. package/es/src/business/ap-view/interface.d.ts +7 -0
  19. package/es/src/business/hooks/usePageListApGrid.mjs +17 -20
  20. package/es/src/version.d.ts +1 -1
  21. package/es/src/version.mjs +1 -1
  22. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  23. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  24. package/lib/src/ap-grid/hooks/use-row-selection.d.ts +100 -0
  25. package/lib/src/ap-grid/hooks/use-row-selection.js +1 -0
  26. package/lib/src/ap-grid/index.vue.js +1 -1
  27. package/lib/src/ap-grid/interface.d.ts +16 -0
  28. package/lib/src/ap-grid/utils/table.js +1 -1
  29. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +6 -1
  30. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  31. package/lib/src/business/ap-copy/ApCopy.js +1 -1
  32. package/lib/src/business/ap-label/group/ApLabelGroup.js +1 -1
  33. package/lib/src/business/ap-label/interface.d.ts +2 -3
  34. package/lib/src/business/ap-product-info/ApProductInfo.js +1 -1
  35. package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
  36. package/lib/src/business/ap-view/ap-view.vue.d.ts +4 -1
  37. package/lib/src/business/ap-view/ap-view.vue2.js +1 -1
  38. package/lib/src/business/ap-view/index.d.ts +12 -3
  39. package/lib/src/business/ap-view/interface.d.ts +7 -0
  40. package/lib/src/business/hooks/usePageListApGrid.js +1 -1
  41. package/lib/src/version.d.ts +1 -1
  42. package/lib/src/version.js +1 -1
  43. package/package.json +4 -3
  44. package/theme/ap-copy/ap-copy.css +2 -0
  45. package/theme/ap-copy/ap-copy.less +2 -0
  46. package/theme/ap-table-modal/index.css +15 -13
  47. package/theme/ap-table-modal/index.less +15 -13
  48. package/theme/index.css +17 -13
@@ -239,6 +239,10 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
239
239
  * 作为表单项时内部传递,请勿使用
240
240
  */
241
241
  value?: any;
242
+ /**
243
+ * 行是否可以被高亮(传入函数可以获取当前被选中的行)
244
+ */
245
+ rowHighlightable?: boolean | ((current: RecordType) => void);
242
246
  };
243
247
  export type ApGridVirtualConfig = {
244
248
  x?: false | number;
@@ -289,6 +293,12 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
289
293
  */
290
294
  rowSelection: {
291
295
  selectedRows: ComputedRef<RecordType[]>;
296
+ /**
297
+ * 通过API调用设置行选中
298
+ * @param keys
299
+ * @returns
300
+ */
301
+ setSelectedRowKeys: (keys: (string | number)[]) => void;
292
302
  clearAll: () => void;
293
303
  };
294
304
  /**
@@ -303,4 +313,10 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
303
313
  * @returns
304
314
  */
305
315
  getDataSource: () => RecordType[];
316
+ /**
317
+ * 设置某一行被选中
318
+ * @param nextRow
319
+ * @returns
320
+ */
321
+ setCurrentRow: (nextRow: Partial<RecordType>) => void;
306
322
  };
@@ -1,10 +1,10 @@
1
- import { omit as u, isUndefined as l, isFunction as h, isNumber as m } from "lodash-unified";
1
+ import { omit as l, isUndefined as s, isFunction as h, isNumber as m } from "lodash-unified";
2
2
  import { isDef as w } from "../../utils/index.mjs";
3
- const y = 20, C = 50, b = (e) => e.some((t) => !!t.html);
3
+ const C = 20, b = 50, y = (e) => e.some((t) => !!t.html);
4
4
  function v(e) {
5
5
  var i;
6
6
  const t = {
7
- ...u(e, [
7
+ ...l(e, [
8
8
  "columns",
9
9
  "request",
10
10
  "searchForm",
@@ -16,8 +16,9 @@ function v(e) {
16
16
  };
17
17
  if (t.rowConfig = {
18
18
  isHover: !0,
19
- keyField: e.rowKey
20
- }, t.columnConfig = {}, b(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
19
+ keyField: e.rowKey,
20
+ isCurrent: !!e.rowHighlightable
21
+ }, t.columnConfig = {}, y(e.columns || []) && (t.rowConfig.useKey = !0, t.columnConfig.useKey = !0), e.adaptive && (t.autoResize = !0, t.height = "100%"), e.columnResizable && (t.columnConfig.resizable = !0), e.rowSelection) {
21
22
  const o = e.rowSelection === !0 ? {} : e.rowSelection;
22
23
  o.type === "radio" ? t.radioConfig = {
23
24
  highlight: !0,
@@ -28,7 +29,7 @@ function v(e) {
28
29
  return o.shown ? o.shown(r) : !0;
29
30
  },
30
31
  checkRowKey: (i = o.defaultSelectedRowKeys) == null ? void 0 : i[0],
31
- reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
32
+ reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys
32
33
  } : t.checkboxConfig = {
33
34
  highlight: !0,
34
35
  checkMethod({ row: r }) {
@@ -37,12 +38,11 @@ function v(e) {
37
38
  visibleMethod({ row: r }) {
38
39
  return o.shown ? o.shown(r) : !0;
39
40
  },
40
- checkRowKeys: o.defaultSelectedRowKeys,
41
- reserve: l(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
41
+ reserve: s(o.preserveSelectedRowKeys) ? !0 : o.preserveSelectedRowKeys,
42
42
  range: o.range || !1
43
43
  };
44
44
  }
45
- return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
45
+ return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = l(e.expandable, [
46
46
  "renderContent",
47
47
  "width",
48
48
  "title"
@@ -50,22 +50,22 @@ function v(e) {
50
50
  enabled: !1
51
51
  }, t.virtualYConfig = {
52
52
  enabled: !1
53
- }) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
53
+ }) : (a(t, "X", e.virtual), a(t, "Y", e.virtual)), t.round = w(e.round) ? e.round : !e.card, t;
54
54
  }
55
- function f(e, t, n) {
56
- const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", d = n == null ? void 0 : n[o], a = d !== !1, s = i ? y : C, c = m(d) && d >= 0 ? d : s;
55
+ function a(e, t, n) {
56
+ const i = t === "X", o = i ? "x" : "y", r = i ? "virtualXConfig" : "virtualYConfig", u = n == null ? void 0 : n[o], f = u !== !1, d = i ? C : b, c = m(u) && u >= 0 ? u : d;
57
57
  e[r] = {
58
- enabled: a,
58
+ enabled: f,
59
59
  gt: c,
60
60
  oSize: (n == null ? void 0 : n.oSize) || 0
61
61
  };
62
62
  }
63
- function x(e) {
63
+ function g(e) {
64
64
  return e === !0 ? "left" : e;
65
65
  }
66
66
  function K(e, t) {
67
67
  const n = e === !0 || !e.type ? "checkbox" : e.type, i = e === !0 ? 60 : e.columnWidth || 60;
68
- let o = e === !0 ? void 0 : x(e.fixed);
68
+ let o = e === !0 ? void 0 : g(e.fixed);
69
69
  return o || (o === !1 ? o = void 0 : o = t.some(
70
70
  (r) => r.fixed === "left" || r.fixed === !0
71
71
  ) ? "left" : void 0), {
@@ -58,6 +58,11 @@ export type UseTablePagingParams<DataType, ParamsType> = {
58
58
  * @returns
59
59
  */
60
60
  onClickReset?: () => void;
61
+ /**
62
+ * 当请求结束后触发的事件
63
+ * @returns
64
+ */
65
+ onAfterRequest?: () => void;
61
66
  };
62
67
  type InternalDataType<DataType = Recordable> = {
63
68
  total: number;
@@ -67,7 +72,7 @@ type InternalDataType<DataType = Recordable> = {
67
72
  export declare const DEFAULT_CURRENT = 1;
68
73
  export declare const DEFAULT_PAGE_SIZE = 20;
69
74
  export type OptionalOnTableChange<T extends (...args: any[]) => any> = (...args: Partial<Parameters<T>>) => ReturnType<T>;
70
- export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields, namespace, pagination, onClickReset }: UseTablePagingParams<DataType, ParamsType>) => {
75
+ export declare const useTablePaging: <DataType = any, ParamsType = Record<string, any>>({ manual, request, defaultParams, defaultData, formatParams, paramsValueTypeMap, resetFieldsIgnores, filterFields, sortFields, namespace, pagination, onClickReset, onAfterRequest }: UseTablePagingParams<DataType, ParamsType>) => {
71
76
  formRef: Ref<ApFormSearchFormExpose | undefined, ApFormSearchFormExpose | undefined>;
72
77
  submit: () => void;
73
78
  reset: () => void;
@@ -1,98 +1,101 @@
1
- import { ref as ie, reactive as J, unref as m, nextTick as ce, onMounted as ue, watch as le, computed as A, createVNode as C } from "vue";
2
- import { useTableSortedAndFiltered as fe } from "./use-sorted-filtered.mjs";
1
+ import { ref as ce, reactive as M, unref as m, nextTick as ue, onMounted as le, watch as fe, computed as O, createVNode as C } from "vue";
2
+ import { useTableSortedAndFiltered as ge } from "./use-sorted-filtered.mjs";
3
3
  import "../../config-provider/index.mjs";
4
- import { parseFieldValue as ge, dataIndexToStr as de, isEqualCustom as pe } from "../utils.mjs";
5
- import { isArray as K, isEqualWith as me, isUndefined as Se } from "lodash-unified";
6
- import { isDef as M } from "../../utils/index.mjs";
7
- import { useLocale as he } from "../../config-provider/hooks/use-locale.mjs";
8
- import { useNamespace as ze } from "../../config-provider/hooks/use-namespace.mjs";
9
- const S = 1, L = 20, Q = {
4
+ import { parseFieldValue as de, dataIndexToStr as pe, isEqualCustom as me } from "../utils.mjs";
5
+ import { isArray as Q, isEqualWith as Se, isUndefined as he } from "lodash-unified";
6
+ import { isDef as $ } from "../../utils/index.mjs";
7
+ import { useLocale as ze } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { useNamespace as Te } from "../../config-provider/hooks/use-namespace.mjs";
9
+ const S = 1, y = 20, G = {
10
10
  defaultCurrent: S,
11
- defaultPageSize: L,
11
+ defaultPageSize: y,
12
12
  showLessItems: !1,
13
13
  showTotal: !0
14
14
  };
15
- function Te(i) {
16
- return i === !1 ? {} : i == null || i === !0 ? Q : {
17
- ...Q,
15
+ function Pe(i) {
16
+ return i === !1 ? {} : i == null || i === !0 ? G : {
17
+ ...G,
18
18
  ...i
19
19
  };
20
20
  }
21
- function Pe(i) {
21
+ function we(i) {
22
22
  const f = {};
23
- return i === !1 || (i === !0 || i == null ? (f.current = S, f.pageSize = L) : (f.current = i.defaultCurrent || S, f.pageSize = i.defaultPageSize || L)), f;
23
+ return i === !1 || (i === !0 || i == null ? (f.current = S, f.pageSize = y) : (f.current = i.defaultCurrent || S, f.pageSize = i.defaultPageSize || y)), f;
24
24
  }
25
- const Ae = ({
25
+ const Oe = ({
26
26
  manual: i = !1,
27
27
  request: f,
28
- defaultParams: O = {},
29
- defaultData: y = [],
30
- formatParams: I,
31
- paramsValueTypeMap: V,
32
- resetFieldsIgnores: U,
33
- filterFields: R,
34
- sortFields: $,
35
- namespace: G = "ap-table",
28
+ defaultParams: I = {},
29
+ defaultData: V = [],
30
+ formatParams: U,
31
+ paramsValueTypeMap: _,
32
+ resetFieldsIgnores: j,
33
+ filterFields: W,
34
+ sortFields: Z,
35
+ namespace: H = "ap-table",
36
36
  pagination: h,
37
- onClickReset: b
37
+ onClickReset: b,
38
+ onAfterRequest: E
38
39
  }) => {
39
- let E = 0, c = {};
40
- const W = Te(h), Z = (e) => I ? I(e) : e, z = ie(), s = J(Pe(h)), {
41
- getColumnSFConfig: H,
42
- setSF: X,
43
- clearAll: Y,
44
- sortedInfo: _,
45
- filteredInfo: j
46
- } = fe(), {
40
+ let v = 0, c = {};
41
+ const X = Pe(h), Y = (e) => U ? U(e) : e, z = ce(), s = M(we(h)), {
42
+ getColumnSFConfig: q,
43
+ setSF: R,
44
+ clearAll: k,
45
+ sortedInfo: A,
46
+ filteredInfo: N
47
+ } = ge(), {
47
48
  t: T
48
- } = he(), {
49
+ } = ze(), {
49
50
  b: P
50
- } = ze(G), o = J({
51
- total: y.length,
52
- records: y,
51
+ } = Te(H), o = M({
52
+ total: V.length,
53
+ records: V,
53
54
  loading: !1
54
55
  }), w = () => {
55
56
  var e, t;
56
57
  return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
57
- }, q = async (e) => {
58
+ }, B = async (e) => {
58
59
  var n;
59
- const t = Z(e), r = Date.now();
60
- E = r, o.loading = !0;
60
+ const t = Y(e), r = Date.now();
61
+ v = r, o.loading = !0;
61
62
  try {
62
63
  const a = await f({
63
- ...m(O),
64
+ ...m(I),
64
65
  ...t
65
66
  });
66
- E === r && (o.total = a.total || ((n = a.data) == null ? void 0 : n.length) || 0, o.records = [...a.data || []], o.loading = !1);
67
+ v === r && (o.total = a.total || ((n = a.data) == null ? void 0 : n.length) || 0, o.records = [...a.data || []], o.loading = !1);
67
68
  } catch {
68
- E === r && (o.records = [], o.total = 0, o.loading = !1);
69
+ v === r && (o.records = [], o.total = 0, o.loading = !1);
70
+ } finally {
71
+ E == null || E();
69
72
  }
70
- }, N = (e) => {
73
+ }, J = (e) => {
71
74
  const t = {};
72
75
  return Object.entries(e).forEach(([r, n]) => {
73
- if (t[r] = n, V && n) {
74
- const a = V[r];
75
- a && (t[r] = ge(a, n));
76
+ if (t[r] = n, _ && n) {
77
+ const a = _[r];
78
+ a && (t[r] = de(a, n));
76
79
  }
77
80
  }), t;
78
- }, k = async (e) => {
81
+ }, ee = async (e) => {
79
82
  var n, a, l, g, d;
80
83
  const t = w(), r = {};
81
84
  Object.entries(t).forEach(([p, F]) => {
82
- U && U.indexOf(p) > -1 && (r[p] = F);
83
- }), await ((a = (n = z.value) == null ? void 0 : n.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, r), ce(() => {
85
+ j && j.indexOf(p) > -1 && (r[p] = F);
86
+ }), await ((a = (n = z.value) == null ? void 0 : n.apForm) == null ? void 0 : a.resetFields()), (d = (g = (l = z.value) == null ? void 0 : l.apForm) == null ? void 0 : g.setFieldsValue) == null || d.call(g, r), ue(() => {
84
87
  e == null || e();
85
88
  });
86
89
  }, x = (e) => {
87
90
  c = e;
88
- const t = N(e);
89
- q(t);
90
- }, ee = (e) => {
91
+ const t = J(e);
92
+ B(t);
93
+ }, te = (e) => {
91
94
  x({
92
95
  ...c,
93
96
  ...e
94
97
  });
95
- }, v = () => {
98
+ }, D = () => {
96
99
  const e = w(), t = h !== !1;
97
100
  t && (s.current = S), x({
98
101
  ...e,
@@ -101,32 +104,32 @@ const Ae = ({
101
104
  current: t ? S : void 0,
102
105
  pageSize: t ? c.pageSize || s.pageSize : void 0
103
106
  });
104
- }, te = () => {
105
- Y(), c.sort = {}, c.filter = {}, b == null || b(), k(v);
106
- }, B = () => {
107
+ }, re = () => {
108
+ k(), c.sort = {}, c.filter = {}, b == null || b(), ee(D);
109
+ }, K = () => {
107
110
  x(c);
108
- }, re = (e) => {
111
+ }, ne = (e) => {
109
112
  if (h === !1)
110
- B();
113
+ K();
111
114
  else {
112
115
  const {
113
116
  current: t,
114
117
  pageSize: r
115
118
  } = s, n = o.total - e, a = Math.ceil(n / r), l = t > a ? a : t;
116
- ee({
119
+ te({
117
120
  current: l > 0 ? l : 1
118
121
  });
119
122
  }
120
- }, D = (e, t, r) => {
123
+ }, L = (e, t, r) => {
121
124
  var p, F;
122
125
  const n = w();
123
- s.current = e.current, s.pageSize = e.pageSize, X(t, r);
124
- const a = K(r) ? [...r] : [r], l = {};
126
+ s.current = e.current, s.pageSize = e.pageSize, R(t, r);
127
+ const a = Q(r) ? [...r] : [r], l = {};
125
128
  for (const u of a)
126
- (p = m($)) != null && p.includes(u.columnKey || u.field) && u.order && (l[de(u.columnKey || u.field)] = u.order);
129
+ (p = m(Z)) != null && p.includes(u.columnKey || u.field) && u.order && (l[pe(u.columnKey || u.field)] = u.order);
127
130
  const g = {};
128
131
  for (const u of Object.keys(t))
129
- (F = m(R)) != null && F.includes(u) && t[u] && (g[u] = t[u]);
132
+ (F = m(W)) != null && F.includes(u) && t[u] && (g[u] = t[u]);
130
133
  const d = {
131
134
  ...n,
132
135
  filter: g,
@@ -134,10 +137,10 @@ const Ae = ({
134
137
  current: e.current,
135
138
  pageSize: e.pageSize
136
139
  };
137
- me(c, d, pe) || x(d);
138
- }, ne = (e, t = j.value || {}, r = _.value || {}) => {
140
+ Se(c, d, me) || x(d);
141
+ }, ae = (e, t = N.value || {}, r = A.value || {}) => {
139
142
  const n = (e == null ? void 0 : e.current) ?? s.current, a = (e == null ? void 0 : e.pageSize) ?? s.pageSize;
140
- D(
143
+ L(
141
144
  {
142
145
  current: n,
143
146
  pageSize: a
@@ -151,7 +154,7 @@ const Ae = ({
151
154
  }
152
155
  );
153
156
  };
154
- ue(() => {
157
+ le(() => {
155
158
  const e = w(), {
156
159
  current: t,
157
160
  pageSize: r
@@ -163,15 +166,15 @@ const Ae = ({
163
166
  sort: {},
164
167
  ...e
165
168
  }, !i) {
166
- const n = N(c);
167
- q(n);
169
+ const n = J(c);
170
+ B(n);
168
171
  }
169
- }), le(() => m(O), () => {
170
- v();
172
+ }), fe(() => m(I), () => {
173
+ D();
171
174
  }, {
172
175
  deep: !0
173
176
  });
174
- const ae = A(() => {
177
+ const oe = O(() => {
175
178
  if (o.total === 0)
176
179
  return "-";
177
180
  const {
@@ -180,28 +183,28 @@ const Ae = ({
180
183
  } = s;
181
184
  return `${e}/${Math.ceil(o.total / t)}`;
182
185
  });
183
- function oe(e) {
184
- K(e) && (o.records = e, o.total = e.length);
186
+ function se(e) {
187
+ Q(e) && (o.records = e, o.total = e.length);
185
188
  }
186
- const se = A(() => {
189
+ const ie = O(() => {
187
190
  const {
188
191
  showLessItems: e,
189
192
  showTotal: t,
190
193
  showQuickJumper: r,
191
194
  showSizeChanger: n,
192
195
  pageSizeOptions: a
193
- } = W;
196
+ } = X;
194
197
  return {
195
198
  loading: o.loading,
196
199
  pagination: {
197
200
  current: s.current,
198
201
  pageSize: s.pageSize,
199
202
  total: o.total,
200
- showSizeChanger: M(n) ? n : !e,
201
- showQuickJumper: M(r) ? r : !e,
203
+ showSizeChanger: $(n) ? n : !e,
204
+ showQuickJumper: $(r) ? r : !e,
202
205
  showLessItems: e,
203
206
  size: "default",
204
- pageSizeOptions: Se(a) ? ["10", "20", "50", "100"] : a,
207
+ pageSizeOptions: he(a) ? ["10", "20", "50", "100"] : a,
205
208
  showTotal: t ? (l) => C("span", {
206
209
  class: P("pagination-total-wrapper")
207
210
  }, [T("ap.apTable.pagination.totalLeftPrefix"), " ", C("span", {
@@ -210,33 +213,33 @@ const Ae = ({
210
213
  class: P("pagination--total-right")
211
214
  }, [T("ap.apTable.pagination.totalRightPrefix"), " ", C("span", {
212
215
  class: P("pagination-count-text")
213
- }, [m(ae)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
216
+ }, [m(oe)]), " ", T("ap.apTable.pagination.totalRightSuffix")])]) : void 0
214
217
  },
215
- onChange: D,
218
+ onChange: L,
216
219
  dataSource: o.records
217
220
  };
218
221
  });
219
222
  return {
220
223
  formRef: z,
221
- submit: v,
222
- reset: te,
223
- refresh: B,
224
- refreshByDelete: re,
224
+ submit: D,
225
+ reset: re,
226
+ refresh: K,
227
+ refreshByDelete: ne,
225
228
  data: o,
226
229
  current: s.current,
227
230
  pageSize: s.pageSize,
228
- handleTableChange: D,
229
- handleTableChangeOptional: ne,
230
- tableProps: se,
231
- dataSource: A(() => o.records),
232
- setDataSource: oe,
233
- getColumnSFConfig: H,
234
- sortedInfo: _,
235
- filteredInfo: j
231
+ handleTableChange: L,
232
+ handleTableChangeOptional: ae,
233
+ tableProps: ie,
234
+ dataSource: O(() => o.records),
235
+ setDataSource: se,
236
+ getColumnSFConfig: q,
237
+ sortedInfo: A,
238
+ filteredInfo: N
236
239
  };
237
240
  };
238
241
  export {
239
242
  S as DEFAULT_CURRENT,
240
- L as DEFAULT_PAGE_SIZE,
241
- Ae as useTablePaging
243
+ y as DEFAULT_PAGE_SIZE,
244
+ Oe as useTablePaging
242
245
  };
@@ -1,47 +1,47 @@
1
- import { defineComponent as T, Text as y, isVNode as p, computed as b, createVNode as r, Fragment as h } from "vue";
2
- import { ApCopyProps as v } from "./constans.mjs";
1
+ import { defineComponent as T, Text as p, isVNode as y, computed as m, createVNode as n, Fragment as b } from "vue";
2
+ import { ApCopyProps as h } from "./constans.mjs";
3
3
  import { IconApAdLineCopy as k } from "@aplus-frontend/icon";
4
4
  import "../../config-provider/index.mjs";
5
- import { message as m } from "@aplus-frontend/antdv";
6
- import { isNull as j, isUndefined as A } from "lodash-unified";
7
- import { useNamespace as N } from "../../config-provider/hooks/use-namespace.mjs";
8
- import { useLocale as P } from "../../config-provider/hooks/use-locale.mjs";
9
- const I = /* @__PURE__ */ T({
5
+ import { message as d } from "@aplus-frontend/antdv";
6
+ import { isNull as P, isUndefined as j } from "lodash-unified";
7
+ import { useNamespace as A } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import { useLocale as N } from "../../config-provider/hooks/use-locale.mjs";
9
+ const D = /* @__PURE__ */ T({
10
10
  name: "CopyBtn",
11
- props: v(),
12
- setup(n, {
13
- slots: l
11
+ props: h(),
12
+ setup(r, {
13
+ slots: a
14
14
  }) {
15
15
  const {
16
- b: d,
17
- e: a,
18
- m: x
19
- } = N("ap-copy"), {
20
- t: c
21
- } = P(), g = () => {
22
- navigator.clipboard.writeText(n.text || u() || "").then(() => {
23
- m.success(c("ap.apCopy.copySuccess"));
16
+ b: x,
17
+ e: l,
18
+ m: g
19
+ } = A("ap-copy"), {
20
+ t: u
21
+ } = N(), v = (t) => {
22
+ t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation(), navigator.clipboard.writeText(r.text || c() || "").then(() => {
23
+ d.success(u("ap.apCopy.copySuccess"));
24
24
  }).catch(() => {
25
- m.error(c("ap.apCopy.copyError"));
25
+ d.error(u("ap.apCopy.copyError"));
26
26
  });
27
27
  }, S = (t) => {
28
28
  if (t.length === 1) {
29
29
  const e = t[0];
30
- if (e.type === y || e.type.toString() === "Symbol(Text)" || p(e) && typeof e.children == "string")
30
+ if (e.type === p || e.type.toString() === "Symbol(Text)" || y(e) && typeof e.children == "string")
31
31
  return !0;
32
32
  }
33
33
  return !1;
34
34
  }, C = (t) => {
35
35
  if (!t.length) return "";
36
36
  const e = t[0];
37
- return e.type === y || e.type.toString() === "Symbol(Text)" ? String(e.children) : p(e) && typeof e.children == "string" ? e.children : "";
38
- }, u = () => {
37
+ return e.type === p || e.type.toString() === "Symbol(Text)" ? String(e.children) : y(e) && typeof e.children == "string" ? e.children : "";
38
+ }, c = () => {
39
39
  var f;
40
- const t = (f = l.default) == null ? void 0 : f.call(l);
40
+ const t = (f = a.default) == null ? void 0 : f.call(a);
41
41
  return t && S(t) ? C(t) : null;
42
- }, s = (t) => !(j(t) || A(t) || typeof t == "string" && t === ""), i = b(() => {
43
- if (typeof n.textStyle == "string")
44
- switch (n.textStyle) {
42
+ }, s = (t) => !(P(t) || j(t) || typeof t == "string" && t === ""), o = m(() => {
43
+ if (typeof r.textStyle == "string")
44
+ switch (r.textStyle) {
45
45
  case "link":
46
46
  return "text-link";
47
47
  case "minor":
@@ -51,29 +51,29 @@ const I = /* @__PURE__ */ T({
51
51
  default:
52
52
  return "text-major";
53
53
  }
54
- else if (typeof n.textStyle == "object")
54
+ else if (typeof r.textStyle == "object")
55
55
  return {
56
- ...n.textStyle
56
+ ...r.textStyle
57
57
  };
58
58
  return {};
59
- }), o = u() || n.text || "";
60
- return () => r(h, null, [r("div", {
61
- class: [d()],
62
- onClick: n.disableCopy ? void 0 : g
63
- }, [r("div", {
64
- class: [a("text"), typeof i.value == "string" && x(i.value)],
65
- style: typeof i.value != "string" && i.value,
66
- title: typeof i.value == "string" ? o : ""
67
- }, [s(o) ? n.link ? r("a", {
68
- href: n.link,
59
+ }), i = m(() => c() || r.text || "");
60
+ return () => n(b, null, [n("div", {
61
+ class: [x()]
62
+ }, [n("div", {
63
+ class: [l("text"), typeof o.value == "string" && g(o.value)],
64
+ style: typeof o.value != "string" && o.value,
65
+ title: typeof o.value == "string" ? i.value : ""
66
+ }, [s(i.value) ? r.link ? n("a", {
67
+ href: r.link,
69
68
  target: "_blank"
70
- }, [o]) : o : "--"]), s(o) && !n.disableCopy && r("div", {
71
- class: [a("copy-btn"), "copy-btn"]
72
- }, [r(k, {
73
- size: n.size
69
+ }, [i.value]) : i.value : "--"]), s(i.value) && !r.disableCopy && n("div", {
70
+ class: [l("copy-btn"), "copy-btn"],
71
+ onClick: r.disableCopy ? void 0 : v
72
+ }, [n(k, {
73
+ size: r.size
74
74
  }, null)])])]);
75
75
  }
76
76
  });
77
77
  export {
78
- I as default
78
+ D as default
79
79
  };
@@ -1,29 +1,28 @@
1
- import { defineComponent as n, createVNode as o, mergeProps as l, createTextVNode as m } from "vue";
1
+ import { defineComponent as n, createVNode as o, mergeProps as a, createTextVNode as l } from "vue";
2
2
  import "../../../config-provider/index.mjs";
3
- import f from "../ApLabel.mjs";
4
- import { omit as t } from "lodash-unified";
5
- import { ApLabelGroupProps as s } from "../constans.mjs";
6
- import { Tag as c } from "@aplus-frontend/antdv";
7
- import { useNamespace as g } from "../../../config-provider/hooks/use-namespace.mjs";
3
+ import m from "../ApLabel.mjs";
4
+ import { omit as s } from "lodash-unified";
5
+ import { ApLabelGroupProps as c } from "../constans.mjs";
6
+ import "../../../ap-tag/index.mjs";
7
+ import { useNamespace as f } from "../../../config-provider/hooks/use-namespace.mjs";
8
+ import i from "../../../ap-tag/ap-tag.vue.mjs";
8
9
  const {
9
10
  b: p
10
- } = g("ap-label-group"), x = /* @__PURE__ */ n({
11
+ } = f("ap-label-group"), _ = /* @__PURE__ */ n({
11
12
  name: "ApLabelGroup",
12
- props: s(),
13
+ props: c(),
13
14
  setup(r) {
14
- 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(c, t(u, ["text"]), {
15
- default: () => [u.text]
16
- })) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
15
+ const t = (e) => (r.tagValue || r.tagValue === 0) && e.tagConfig && e.tagConfig.length > 0 ? () => e.tagConfig.filter((u) => r.tagValue === u.value).map((u) => o(i, u, null)) : e.customRender ? () => o("div", null, [e.customRender(r.record)]) : null;
17
16
  return () => o("div", {
18
17
  class: p()
19
- }, [r.columns ? r.columns.map((e, u) => o(f, l({
18
+ }, [r.columns ? r.columns.map((e, u) => o(m, a({
20
19
  key: u,
21
20
  show: r.value === e.value
22
- }, t(e, ["value", "tagConfig", "customRender"])), {
23
- custom: a(e)
24
- })) : o("div", null, [m("columns数组不能为空")])]);
21
+ }, s(e, ["value", "tagConfig", "customRender"])), {
22
+ custom: t(e)
23
+ })) : o("div", null, [l("columns数组不能为空")])]);
25
24
  }
26
25
  });
27
26
  export {
28
- x as default
27
+ _ as default
29
28
  };
@@ -1,6 +1,6 @@
1
1
  import { BadgeProps } from '@aplus-frontend/antdv';
2
2
  import { TooltipPlacement } from '@aplus-frontend/antdv/es/tooltip/Tooltip';
3
- import { TagProps } from '@aplus-frontend/antdv/es/tag';
3
+ import { ApTagProps } from '../../ap-tag';
4
4
  import { VNode, VNodeChild } from 'vue';
5
5
  type Recordable = Record<string, any>;
6
6
  export type ApLabelProps = BadgeProps & Partial<{
@@ -12,9 +12,8 @@ export type ApLabelProps = BadgeProps & Partial<{
12
12
  show: boolean;
13
13
  toolTipBgColor: string;
14
14
  }>;
15
- export type tagConfigKey = TagProps & {
15
+ export type tagConfigKey = ApTagProps & {
16
16
  value: number | string | undefined | null;
17
- text: string;
18
17
  };
19
18
  export type ApLabelGroupItemProps<T extends Recordable = Recordable> = ApLabelProps & {
20
19
  value?: string | number | null | undefined;