@aplus-frontend/ui 6.24.2 → 6.26.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 (46) hide show
  1. package/es/src/ag-grid/index.vue.mjs +36 -32
  2. package/es/src/ap-form/interface.d.ts +1 -2
  3. package/es/src/ap-form/search-form/hooks/use-count-per-row.mjs +27 -24
  4. package/es/src/ap-form/search-form/index.vue.d.ts +1 -1
  5. package/es/src/ap-form/search-form/index.vue.mjs +116 -109
  6. package/es/src/ap-grid/editable/form-item.vue.mjs +1 -0
  7. package/es/src/ap-grid/editable/index.vue.mjs +1 -0
  8. package/es/src/ap-grid/index.vue.mjs +229 -212
  9. package/es/src/ap-grid/interface.d.ts +13 -1
  10. package/es/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  11. package/es/src/ap-pro-card/components/statistic/index.vue.d.ts +2 -1
  12. package/es/src/ap-pro-card/components/statistic/index.vue2.mjs +43 -37
  13. package/es/src/ap-pro-card/interface.d.ts +3 -1
  14. package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  15. package/es/src/ap-table/hooks/use-table-paging-ng.mjs +41 -41
  16. package/es/src/business/ap-value-select-card/index.vue.d.ts +6 -0
  17. package/es/src/business/ap-value-select-card/index.vue2.mjs +88 -80
  18. package/es/src/utils/copy.mjs +14 -4
  19. package/es/src/version.d.ts +1 -1
  20. package/es/src/version.mjs +1 -1
  21. package/lib/src/ag-grid/index.vue.js +1 -1
  22. package/lib/src/ap-form/interface.d.ts +1 -2
  23. package/lib/src/ap-form/search-form/hooks/use-count-per-row.js +1 -1
  24. package/lib/src/ap-form/search-form/index.vue.d.ts +1 -1
  25. package/lib/src/ap-form/search-form/index.vue.js +1 -1
  26. package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
  27. package/lib/src/ap-grid/editable/index.vue.js +1 -1
  28. package/lib/src/ap-grid/index.vue.js +1 -1
  29. package/lib/src/ap-grid/interface.d.ts +13 -1
  30. package/lib/src/ap-pro-card/components/card/index.vue.d.ts +1 -1
  31. package/lib/src/ap-pro-card/components/statistic/index.vue.d.ts +2 -1
  32. package/lib/src/ap-pro-card/components/statistic/index.vue2.js +1 -1
  33. package/lib/src/ap-pro-card/interface.d.ts +3 -1
  34. package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +1 -1
  35. package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
  36. package/lib/src/business/ap-value-select-card/index.vue.d.ts +6 -0
  37. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
  38. package/lib/src/utils/copy.js +1 -1
  39. package/lib/src/version.d.ts +1 -1
  40. package/lib/src/version.js +1 -1
  41. package/package.json +5 -5
  42. package/theme/ap-pro-card/index.css +29 -25
  43. package/theme/ap-pro-card/index.less +32 -16
  44. package/theme/ap-value-select-card/index.css +1 -0
  45. package/theme/ap-value-select-card/index.less +1 -0
  46. package/theme/index.css +30 -25
@@ -234,7 +234,7 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
234
234
  /**
235
235
  * 自定义渲染内容
236
236
  */
237
- renderContent: VxeColumnSlots<RecordType>['content'];
237
+ renderContent: NonNullable<VxeColumnSlots<RecordType>['content']>;
238
238
  /**
239
239
  * 展开列占据的宽度,默认为auto
240
240
  */
@@ -256,6 +256,11 @@ export type ApGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
256
256
  * 树形表格设置(部分vxe-table.treeConfig配置)
257
257
  */
258
258
  treeConfig?: Omit<VxeTablePropTypes.TreeConfig<RecordType>, 'transform' | 'iconOpen' | 'iconClose' | 'iconLoaded'>;
259
+ /**
260
+ * 当表格准备好后执行,可以在这个事件中执行表格的API操作
261
+ * @returns
262
+ */
263
+ onReady?: (records: RecordType[]) => void;
259
264
  };
260
265
  export type ApGridVirtualConfig = {
261
266
  x?: false | number;
@@ -366,4 +371,11 @@ export type ApGridExpose<SearchParamsType = Recordable, RecordType = any> = {
366
371
  * @returns
367
372
  */
368
373
  resetSearchFormSorterItems: () => void;
374
+ /**
375
+ * 根据rowKey设置展开行
376
+ * @param rowKeys
377
+ * @param expanded 设置展开与否,默认为`true`
378
+ * @returns
379
+ */
380
+ setRowExpand: (rowKeys: string | number | (string | number)[], expanded?: boolean) => Promise<void>;
369
381
  };
@@ -21,9 +21,9 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
21
21
  gutter: ApProCardGutter | ApProCardGutter[];
22
22
  ghost: boolean;
23
23
  bordered: boolean;
24
+ collapsible: boolean;
24
25
  headerBordered: boolean;
25
26
  hoverable: boolean;
26
- collapsible: boolean;
27
27
  defaultCollapsed: boolean;
28
28
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
29
29
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -8,6 +8,7 @@ declare function __VLS_template(): {
8
8
  };
9
9
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
10
  declare const __VLS_component: DefineComponent<ApProCardStatisticProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApProCardStatisticProps> & Readonly<{}>, {
11
+ size: "default" | "small";
11
12
  title: string | number | boolean | void | VNode<RendererNode, RendererElement, {
12
13
  [key: string]: any;
13
14
  }> | (string | number | boolean | void | VNode<RendererNode, RendererElement, {
@@ -15,7 +16,7 @@ declare const __VLS_component: DefineComponent<ApProCardStatisticProps, {}, {},
15
16
  }> | null | undefined)[] | VNode<RendererNode, RendererElement, {
16
17
  [key: string]: any;
17
18
  }> | null;
18
- layout: "horizontal" | "vertical" | "inline";
19
+ layout: "horizontal" | "vertical" | "vertical-center" | "inline";
19
20
  icon: string | number | boolean | void | VNodeArrayChildren | VNode<RendererNode, RendererElement, {
20
21
  [key: string]: any;
21
22
  }> | null;
@@ -1,11 +1,11 @@
1
- import { defineComponent as E, useSlots as F, computed as i, createVNode as r, Fragment as d, createElementBlock as P, openBlock as l, mergeProps as y, createBlock as a, createElementVNode as x, resolveDynamicComponent as o, normalizeClass as C, unref as O, createSlots as V, withCtx as s } from "vue";
2
- import { QuestionCircleOutlined as z } from "@ant-design/icons-vue";
1
+ import { defineComponent as h, useSlots as E, computed as i, createVNode as r, Fragment as d, createElementBlock as F, openBlock as u, mergeProps as x, createBlock as a, createElementVNode as C, resolveDynamicComponent as o, normalizeClass as B, unref as O, createSlots as P, withCtx as s } from "vue";
2
+ import { QuestionCircleOutlined as V } from "@ant-design/icons-vue";
3
3
  import { Tooltip as I, Badge as Q, Statistic as R } from "@aplus-frontend/antdv";
4
4
  import { omit as T } from "lodash-unified";
5
5
  import "../../../config-provider/index.mjs";
6
- import { mergeClass as B } from "../../../editable-table/utils.mjs";
6
+ import { mergeClass as c } from "../../../editable-table/utils.mjs";
7
7
  import { useNamespace as q } from "../../../config-provider/hooks/use-namespace.mjs";
8
- const Y = /* @__PURE__ */ E({
8
+ const Y = /* @__PURE__ */ h({
9
9
  name: "ApProCardStatistic",
10
10
  __name: "index",
11
11
  props: {
@@ -55,78 +55,84 @@ const Y = /* @__PURE__ */ E({
55
55
  },
56
56
  trend: {
57
57
  default: void 0
58
+ },
59
+ size: {
60
+ default: "default"
58
61
  }
59
62
  },
60
63
  setup(S) {
61
- const t = F(), n = S, {
62
- b: u
63
- } = q("pro-card-statistic"), b = i(() => u()), g = i(() => u("tip")), D = i(() => {
64
- const e = u();
65
- return B(`${e}-trend-icon`, [n.trend ? `${e}-trend-icon-${n.trend}` : void 0].filter(Boolean));
66
- }), N = i(() => u("status")), $ = i(() => u("icon")), M = i(() => u("wrapper")), A = i(() => u("content")), j = i(() => {
67
- const e = u();
68
- return B(`${e}-layout`, [n.layout ? `${e}-layout-${n.layout}` : void 0, n.trend ? `${e}-trend-${n.trend}` : void 0].filter(Boolean));
69
- }), k = i(() => u("description")), c = i(() => {
64
+ const t = E(), n = S, {
65
+ b: l
66
+ } = q("pro-card-statistic"), b = i(() => {
67
+ const e = l();
68
+ return c(`${e}`, [n.size ? `${e}-size-${n.size}` : void 0].filter(Boolean));
69
+ }), g = i(() => l("tip")), $ = i(() => {
70
+ const e = l();
71
+ return c(`${e}-trend-icon`, [n.trend ? `${e}-trend-icon-${n.trend}` : void 0].filter(Boolean));
72
+ }), D = i(() => l("status")), N = i(() => l("icon")), M = i(() => l("wrapper")), A = i(() => l("content")), j = i(() => {
73
+ const e = l();
74
+ return c(`${e}-layout`, [n.layout ? `${e}-layout-${n.layout}` : void 0, n.trend ? `${e}-trend-${n.trend}` : void 0].filter(Boolean));
75
+ }), k = i(() => l("description")), f = i(() => {
70
76
  var e;
71
77
  return n.tip || t.tip ? r(I, {
72
78
  title: n.tip ?? ((e = t.tip) == null ? void 0 : e.call(t))
73
79
  }, {
74
- default: () => [r(z, {
80
+ default: () => [r(V, {
75
81
  class: g.value
76
82
  }, null)]
77
83
  }) : void 0;
78
- }), f = i(() => n.trend ? r("div", {
79
- class: D.value
84
+ }), p = i(() => n.trend ? r("div", {
85
+ class: $.value
80
86
  }, null) : void 0), _ = i(() => n.status ? r(Q, {
81
- class: N.value,
87
+ class: D.value,
82
88
  status: n.status
83
- }, null) : void 0), w = i(() => {
89
+ }, null) : void 0), z = i(() => {
84
90
  var e;
85
91
  return n.icon || t.icon ? r("div", {
86
- class: $.value
92
+ class: N.value
87
93
  }, [n.icon ?? ((e = t.icon) == null ? void 0 : e.call(t))]) : void 0;
88
- }), p = i(() => {
94
+ }), m = i(() => {
89
95
  var e;
90
96
  return n.title || t.title ? r(d, null, [n.title || ((e = t.title) == null ? void 0 : e.call(t))]) : void 0;
91
- }), m = i(() => {
97
+ }), v = i(() => {
92
98
  var e;
93
99
  return n.prefix || t.prefix ? r(d, null, [n.prefix || ((e = t.prefix) == null ? void 0 : e.call(t))]) : void 0;
94
- }), v = i(() => {
100
+ }), y = i(() => {
95
101
  var e;
96
102
  return n.suffix || t.suffix ? r(d, null, [n.suffix || ((e = t.suffix) == null ? void 0 : e.call(t))]) : void 0;
97
- }), h = i(() => {
103
+ }), w = i(() => {
98
104
  var e;
99
105
  return n.description || t.description ? r("div", {
100
106
  class: k.value
101
107
  }, [n.description || ((e = t.description) == null ? void 0 : e.call(t))]) : void 0;
102
108
  });
103
- return (e, G) => (l(), P("div", y({
109
+ return (e, G) => (u(), F("div", x({
104
110
  ...e.$attrs
105
111
  }, {
106
112
  class: b.value
107
- }), [(l(), a(o(w.value))), x("div", {
108
- class: C(M.value)
109
- }, [(l(), a(o(_.value))), x("div", {
110
- class: C(A.value)
111
- }, [r(O(R), y({
113
+ }), [(u(), a(o(z.value))), C("div", {
114
+ class: B(M.value)
115
+ }, [(u(), a(o(_.value))), C("div", {
116
+ class: B(A.value)
117
+ }, [r(O(R), x({
112
118
  class: j.value
113
119
  }, {
114
120
  ...O(T)(n, ["title", "prefix"])
115
- }), V({
121
+ }), P({
116
122
  _: 2
117
- }, [p.value || c.value ? {
123
+ }, [m.value || f.value ? {
118
124
  name: "title",
119
- fn: s(() => [(l(), a(o(p.value))), (l(), a(o(c.value)))]),
125
+ fn: s(() => [(u(), a(o(m.value))), (u(), a(o(f.value)))]),
120
126
  key: "0"
121
- } : void 0, f.value || m.value ? {
127
+ } : void 0, p.value || v.value ? {
122
128
  name: "prefix",
123
- fn: s(() => [(l(), a(o(f.value))), (l(), a(o(m.value)))]),
129
+ fn: s(() => [(u(), a(o(p.value))), (u(), a(o(v.value)))]),
124
130
  key: "1"
125
- } : void 0, v.value ? {
131
+ } : void 0, y.value ? {
126
132
  name: "suffix",
127
- fn: s(() => [(l(), a(o(v.value)))]),
133
+ fn: s(() => [(u(), a(o(y.value)))]),
128
134
  key: "2"
129
- } : void 0]), 1040, ["class"]), (l(), a(o(h.value)))], 2)], 2)], 16));
135
+ } : void 0]), 1040, ["class"]), (u(), a(o(w.value)))], 2)], 2)], 16));
130
136
  }
131
137
  });
132
138
  export {
@@ -79,9 +79,11 @@ export type ApProCardStatisticProps = StatisticProps & {
79
79
  /** Icon 图标 */
80
80
  icon?: VNodeChild;
81
81
  /** Layout 布局 */
82
- layout?: 'horizontal' | 'vertical' | 'inline';
82
+ layout?: 'horizontal' | 'vertical' | 'vertical-center' | 'inline';
83
83
  /** 趋势 */
84
84
  trend?: 'up' | 'down';
85
+ /** 尺寸 */
86
+ size?: 'default' | 'small';
85
87
  };
86
88
  export type ApProCardStatisticSolts = {
87
89
  /**
@@ -62,7 +62,7 @@ export type UseTablePagingParams<DataType, ParamsType> = {
62
62
  * 当请求结束后触发的事件
63
63
  * @returns
64
64
  */
65
- onAfterRequest?: () => void;
65
+ onAfterRequest?: (records: DataType[]) => void;
66
66
  };
67
67
  export type InternalPagingType = Partial<{
68
68
  current: number;
@@ -56,41 +56,41 @@ const Ve = ({
56
56
  var e, t;
57
57
  return ((t = (e = z.value) == null ? void 0 : e.apForm) == null ? void 0 : t.getFieldsValueTransformed(!0)) || {};
58
58
  }, J = async (e) => {
59
- var r;
60
- const t = q(e), n = Date.now();
61
- v = n, o.loading = !0;
59
+ var n;
60
+ const t = q(e), r = Date.now();
61
+ v = r, o.loading = !0;
62
62
  try {
63
63
  const a = await f({
64
64
  ...m(V),
65
65
  ...t
66
66
  });
67
- v === n && (o.total = a.total || ((r = a.data) == null ? void 0 : r.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);
68
68
  } catch {
69
- v === n && (o.records = [], o.total = 0, o.loading = !1);
69
+ v === r && (o.records = [], o.total = 0, o.loading = !1);
70
70
  } finally {
71
- E == null || E();
71
+ E == null || E(o.records);
72
72
  }
73
73
  }, K = (e) => {
74
74
  const t = {};
75
- return Object.entries(e).forEach(([n, r]) => {
76
- if (t[n] = r, _ && r) {
77
- const a = _[n];
78
- a && (t[n] = he(a, r));
75
+ return Object.entries(e).forEach(([r, n]) => {
76
+ if (t[r] = n, _ && n) {
77
+ const a = _[r];
78
+ a && (t[r] = he(a, n));
79
79
  }
80
80
  }), t;
81
81
  }, te = async (e) => {
82
- var r, a, l, g, d;
83
- const t = w(), n = {};
82
+ var n, a, l, g, d;
83
+ const t = w(), r = {};
84
84
  Object.entries(t).forEach(([p, F]) => {
85
- A && A.indexOf(p) > -1 && (n[p] = F);
86
- }), await ((a = (r = z.value) == null ? void 0 : r.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, n), ge(() => {
85
+ A && A.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), ge(() => {
87
87
  e == null || e();
88
88
  });
89
89
  }, b = (e) => {
90
90
  s = e;
91
91
  const t = K(e);
92
92
  J(t);
93
- }, ne = (e) => {
93
+ }, re = (e) => {
94
94
  b({
95
95
  ...s,
96
96
  ...e
@@ -98,15 +98,15 @@ const Ve = ({
98
98
  }, D = () => {
99
99
  M(!0);
100
100
  }, M = (e = !1) => {
101
- const t = w(), n = S !== !1;
102
- n && e && (i.current = h), b({
101
+ const t = w(), r = S !== !1;
102
+ r && e && (i.current = h), b({
103
103
  ...t,
104
104
  filter: s.filter,
105
105
  sort: s.sort,
106
- current: n ? e ? h : s.current || i.current : void 0,
107
- pageSize: n ? s.pageSize || i.pageSize : void 0
106
+ current: r ? e ? h : s.current || i.current : void 0,
107
+ pageSize: r ? s.pageSize || i.pageSize : void 0
108
108
  });
109
- }, re = () => {
109
+ }, ne = () => {
110
110
  ee(), s.sort = {}, s.filter = {}, C == null || C(), te(D);
111
111
  }, O = () => {
112
112
  b(s);
@@ -116,39 +116,39 @@ const Ve = ({
116
116
  else {
117
117
  const {
118
118
  current: t,
119
- pageSize: n
120
- } = i, r = o.total - e, a = Math.ceil(r / n), l = t > a ? a : t;
121
- ne({
119
+ pageSize: r
120
+ } = i, n = o.total - e, a = Math.ceil(n / r), l = t > a ? a : t;
121
+ re({
122
122
  current: l > 0 ? l : 1
123
123
  });
124
124
  }
125
- }, L = (e, t, n) => {
125
+ }, L = (e, t, r) => {
126
126
  var p, F;
127
- const r = w();
128
- i.current = e.current, i.pageSize = e.pageSize, k(t, n);
129
- const a = W(n) ? [...n] : [n], l = {};
127
+ const n = w();
128
+ i.current = e.current, i.pageSize = e.pageSize, k(t, r);
129
+ const a = W(r) ? [...r] : [r], l = {};
130
130
  for (const u of a)
131
131
  (p = m(H)) != null && p.includes(u.columnKey || u.field) && u.order && (l[Se(u.columnKey || u.field)] = u.order);
132
132
  const g = {};
133
133
  for (const u of Object.keys(t))
134
134
  (F = m(Z)) != null && F.includes(u) && t[u] && (g[u] = t[u]);
135
135
  const d = {
136
- ...r,
136
+ ...n,
137
137
  filter: g,
138
138
  sort: l,
139
139
  current: e.current,
140
140
  pageSize: e.pageSize
141
141
  };
142
142
  Pe(s, d, ze) || b(d);
143
- }, oe = (e, t = B.value || {}, n = N.value || {}) => {
144
- const r = (e == null ? void 0 : e.current) ?? i.current, a = (e == null ? void 0 : e.pageSize) ?? i.pageSize;
143
+ }, oe = (e, t = B.value || {}, r = N.value || {}) => {
144
+ const n = (e == null ? void 0 : e.current) ?? i.current, a = (e == null ? void 0 : e.pageSize) ?? i.pageSize;
145
145
  L(
146
146
  {
147
- current: r,
147
+ current: n,
148
148
  pageSize: a
149
149
  },
150
150
  t,
151
- n,
151
+ r,
152
152
  // 此参数随意传递,并无使用
153
153
  {
154
154
  action: "sort",
@@ -159,17 +159,17 @@ const Ve = ({
159
159
  de(() => {
160
160
  const e = w(), {
161
161
  current: t,
162
- pageSize: n
162
+ pageSize: r
163
163
  } = i;
164
164
  if (s = {
165
165
  current: t,
166
- pageSize: n,
166
+ pageSize: r,
167
167
  filter: {},
168
168
  sort: {},
169
169
  ...e
170
170
  }, !c) {
171
- const r = K(s);
172
- J(r);
171
+ const n = K(s);
172
+ J(n);
173
173
  }
174
174
  }), pe(() => m(V), () => {
175
175
  D();
@@ -192,8 +192,8 @@ const Ve = ({
192
192
  const {
193
193
  showLessItems: e,
194
194
  showTotal: t,
195
- showQuickJumper: n,
196
- showSizeChanger: r,
195
+ showQuickJumper: r,
196
+ showSizeChanger: n,
197
197
  pageSizeOptions: a
198
198
  } = Y;
199
199
  return {
@@ -202,8 +202,8 @@ const Ve = ({
202
202
  current: i.current,
203
203
  pageSize: i.pageSize,
204
204
  total: o.total,
205
- showSizeChanger: $(r) ? r : !e,
206
- showQuickJumper: $(n) ? n : !e,
205
+ showSizeChanger: $(n) ? n : !e,
206
+ showQuickJumper: $(r) ? r : !e,
207
207
  showLessItems: e,
208
208
  size: "default",
209
209
  pageSizeOptions: Te(a) ? ["10", "20", "50", "100"] : a,
@@ -232,7 +232,7 @@ const Ve = ({
232
232
  return {
233
233
  formRef: z,
234
234
  submit: D,
235
- reset: re,
235
+ reset: ne,
236
236
  refresh: O,
237
237
  refreshByDelete: ae,
238
238
  data: o,
@@ -22,6 +22,12 @@ declare const _default: <T extends Record<string, any> = Record<string, any>>(__
22
22
  }>): void;
23
23
  attrs: any;
24
24
  slots: {
25
+ 'popover-label'?(_: {
26
+ option: ApValueSelectCardOption<T>;
27
+ }): any;
28
+ 'popover-value'?(_: {
29
+ option: ApValueSelectCardOption<T>;
30
+ }): any;
25
31
  'close-icon'?(_: {}): any;
26
32
  label?(_: {
27
33
  option: ApValueSelectCardOption<T>;