@aplus-frontend/ui 6.37.0 → 6.38.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 (71) hide show
  1. package/es/index.mjs +224 -231
  2. package/es/src/ag-grid/components/row/index.vue.d.ts +6 -0
  3. package/es/src/ag-grid/components/row/index.vue.mjs +4 -0
  4. package/es/src/ag-grid/components/row/index.vue2.mjs +14 -0
  5. package/es/src/ag-grid/editable/form-item.vue.mjs +10 -9
  6. package/es/src/ag-grid/editable/index.vue.mjs +17 -16
  7. package/es/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
  8. package/es/src/ag-grid/hooks/use-row-selection.mjs +81 -68
  9. package/es/src/ag-grid/index.vue.d.ts +2 -1
  10. package/es/src/ag-grid/index.vue.mjs +256 -232
  11. package/es/src/ag-grid/interface.d.ts +40 -3
  12. package/es/src/ap-action/group/index.vue.mjs +24 -21
  13. package/es/src/ap-action/item/index.vue2.mjs +28 -20
  14. package/es/src/index.d.ts +0 -1
  15. package/es/src/index.mjs +280 -288
  16. package/es/src/path-map.mjs +0 -1
  17. package/es/src/version.d.ts +1 -1
  18. package/es/src/version.mjs +1 -1
  19. package/lib/index.js +1 -1
  20. package/lib/src/ag-grid/components/row/index.vue.d.ts +6 -0
  21. package/lib/src/ag-grid/components/row/index.vue.js +1 -0
  22. package/lib/src/ag-grid/components/row/index.vue2.js +1 -0
  23. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  24. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  25. package/lib/src/ag-grid/hooks/use-row-selection.d.ts +1 -1
  26. package/lib/src/ag-grid/hooks/use-row-selection.js +1 -1
  27. package/lib/src/ag-grid/index.vue.d.ts +2 -1
  28. package/lib/src/ag-grid/index.vue.js +1 -1
  29. package/lib/src/ag-grid/interface.d.ts +40 -3
  30. package/lib/src/ap-action/group/index.vue.js +1 -1
  31. package/lib/src/ap-action/item/index.vue2.js +1 -1
  32. package/lib/src/index.d.ts +0 -1
  33. package/lib/src/index.js +1 -1
  34. package/lib/src/path-map.js +1 -1
  35. package/lib/src/version.d.ts +1 -1
  36. package/lib/src/version.js +1 -1
  37. package/package.json +1 -1
  38. package/theme/index.css +0 -3
  39. package/theme/index.less +0 -1
  40. package/es/src/work-order-modal/createWorkOrder.d.ts +0 -3
  41. package/es/src/work-order-modal/createWorkOrder.mjs +0 -32
  42. package/es/src/work-order-modal/help-message.vue.d.ts +0 -3
  43. package/es/src/work-order-modal/help-message.vue.mjs +0 -4
  44. package/es/src/work-order-modal/help-message.vue2.mjs +0 -36
  45. package/es/src/work-order-modal/index.d.ts +0 -4
  46. package/es/src/work-order-modal/index.mjs +0 -8
  47. package/es/src/work-order-modal/interfaces.d.ts +0 -31
  48. package/es/src/work-order-modal/interfaces.mjs +0 -9
  49. package/es/src/work-order-modal/style/css.d.ts +0 -0
  50. package/es/src/work-order-modal/style/css.js +0 -4
  51. package/es/src/work-order-modal/style/index.d.ts +0 -0
  52. package/es/src/work-order-modal/style/index.js +0 -4
  53. package/es/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
  54. package/es/src/work-order-modal/work-order-modal.vue.mjs +0 -192
  55. package/es/src/work-order-modal/work-order-modal.vue2.mjs +0 -4
  56. package/lib/src/work-order-modal/createWorkOrder.d.ts +0 -3
  57. package/lib/src/work-order-modal/createWorkOrder.js +0 -1
  58. package/lib/src/work-order-modal/help-message.vue.d.ts +0 -3
  59. package/lib/src/work-order-modal/help-message.vue.js +0 -1
  60. package/lib/src/work-order-modal/help-message.vue2.js +0 -1
  61. package/lib/src/work-order-modal/index.d.ts +0 -4
  62. package/lib/src/work-order-modal/index.js +0 -1
  63. package/lib/src/work-order-modal/interfaces.d.ts +0 -31
  64. package/lib/src/work-order-modal/interfaces.js +0 -1
  65. package/lib/src/work-order-modal/style/css.cjs +0 -4
  66. package/lib/src/work-order-modal/style/css.d.ts +0 -0
  67. package/lib/src/work-order-modal/style/index.cjs +0 -4
  68. package/lib/src/work-order-modal/style/index.d.ts +0 -0
  69. package/lib/src/work-order-modal/work-order-modal.vue.d.ts +0 -846
  70. package/lib/src/work-order-modal/work-order-modal.vue.js +0 -1
  71. package/lib/src/work-order-modal/work-order-modal.vue2.js +0 -1
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
4
4
  import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
5
5
  import { Recordable } from '../type';
6
6
  import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
7
- import { ColDef, GridApi, ICellRendererParams, IRowNode, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowPinnedType, ScrollDirection } from 'ag-grid-community';
7
+ import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
8
8
  import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
9
9
  export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
10
10
  children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
@@ -123,6 +123,10 @@ export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>,
123
123
  * 是否隐藏不可选中的元素
124
124
  */
125
125
  hideDisabled?: boolean;
126
+ /**
127
+ * 默认选中的行数据(如果没有rowKey将会被过滤掉,如果和defaultSelectedRowKeys同时使用,优先级更低)
128
+ */
129
+ defaultSelectedRows?: RecordType[];
126
130
  };
127
131
  export type AgGridVirtualConfig = {
128
132
  row?: boolean;
@@ -135,7 +139,20 @@ export type AgGridSummaryType<RecordType = any> = {
135
139
  cellClassName?: string | string[] | ((data: RecordType, column: ColDef<RecordType>, pinned: RowPinnedType, rowIndex: number) => string | string[]);
136
140
  rowClassName?: string | string[] | ((data: RecordType, rowIndex: number, pinned: RowPinnedType) => string | string[]);
137
141
  };
138
- export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky'> & {
142
+ export type AgGridCustomRowConfig<RecordType = any> = {
143
+ /**
144
+ * 判断哪些行是自定义渲染行
145
+ * @param params
146
+ * @returns
147
+ */
148
+ isCustomRow: (params: IsFullWidthRowParams<RecordType>) => boolean;
149
+ /**
150
+ * 行自定义渲染函数
151
+ * @returns
152
+ */
153
+ render: (params: any) => any;
154
+ };
155
+ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<RecordType>, 'columns' | 'pagination' | 'dataSource' | 'size' | 'rowSelection' | 'rowClassName' | 'footer' | 'loading' | 'sticky' | 'customRow'> & {
139
156
  /**
140
157
  * 列配置
141
158
  */
@@ -239,6 +256,13 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
239
256
  * 指定每一行占据的高度(大量数据展示时的性能优化)
240
257
  */
241
258
  rowHeight?: number;
259
+ /**
260
+ * 指定一行占据的高度
261
+ * @since 6.38.0
262
+ * @param params
263
+ * @returns
264
+ */
265
+ getRowHeight?: (params: RowHeightParams<RecordType>) => number | null | undefined;
242
266
  /**
243
267
  * 是否使用另外一种渲染器来渲染单元格
244
268
  */
@@ -282,6 +306,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
282
306
  * @returns
283
307
  */
284
308
  onUpdate?: () => void;
309
+ /**
310
+ * 自定义行渲染配置
311
+ * @since 6.37.0
312
+ */
313
+ customRow?: AgGridCustomRowConfig;
285
314
  };
286
315
  export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
287
316
  /**
@@ -328,11 +357,19 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
328
357
  rowSelection: {
329
358
  selectedRows: ComputedRef<RecordType[]>;
330
359
  /**
331
- * 通过API调用设置行选中
360
+ * 通过rowKey来选中行
361
+ * 如果是单选模式,只会选择数组中的第一个元素做选中操作
332
362
  * @param keys
333
363
  * @returns
334
364
  */
335
365
  setSelectedRowKeys: (keys: (string | number)[]) => void;
366
+ /**
367
+ * 通过整行数据来选中行
368
+ * 如果是单选模式,只会选择数组中的第一个元素做选中操作
369
+ * @param rows
370
+ * @returns
371
+ */
372
+ setSelectedRows: (rows: RecordType[]) => void;
336
373
  clearAll: () => void;
337
374
  };
338
375
  /**
@@ -5,10 +5,10 @@ import "../item-modal/index.vue2.mjs";
5
5
  import "../item-popconfirm/index.vue2.mjs";
6
6
  import "../item-dropdown/index.vue2.mjs";
7
7
  import "../../config-provider/index.mjs";
8
- import { isUndefined as x } from "lodash-unified";
9
- import { useLocale as B } from "../../config-provider/hooks/use-locale.mjs";
8
+ import { isUndefined as F } from "lodash-unified";
9
+ import { useLocale as x } from "../../config-provider/hooks/use-locale.mjs";
10
10
  import f from "../item-dropdown/index.vue.mjs";
11
- import F from "../item-modal/index.vue.mjs";
11
+ import B from "../item-modal/index.vue.mjs";
12
12
  import $ from "../item-popconfirm/index.vue.mjs";
13
13
  import b from "../item/index.vue2.mjs";
14
14
  const q = /* @__PURE__ */ k({
@@ -22,51 +22,54 @@ const q = /* @__PURE__ */ k({
22
22
  iconFirst: { type: Boolean }
23
23
  },
24
24
  setup(_) {
25
- const r = _, { t: g } = B(), l = m(
25
+ const r = _, { t: g } = x(), l = m(
26
26
  () => r.actions.filter(
27
- (e) => e.visible || x(e.visible)
27
+ (t) => t.visible || F(t.visible)
28
28
  )
29
29
  ), d = m(() => c(l).length > r.count), u = m(() => {
30
- const e = c(l);
31
- if (e.length <= r.count)
30
+ const t = c(l);
31
+ if (t.length <= r.count)
32
32
  return {
33
- showActions: e,
33
+ showActions: t.map((e) => ({
34
+ ...e,
35
+ iconFirst: !0
36
+ })),
34
37
  menuActions: []
35
38
  };
36
- let i = e.slice(0, r.count - 1);
37
- return r.iconFirst && (i = i.map((t) => ({
38
- ...t,
39
+ let i = t.slice(0, r.count - 1);
40
+ return r.iconFirst && (i = i.map((e) => ({
41
+ ...e,
39
42
  iconFirst: !0
40
43
  }))), {
41
44
  showActions: i,
42
- menuActions: e.slice(r.count - 1)
45
+ menuActions: t.slice(r.count - 1)
43
46
  };
44
47
  });
45
- return (e, i) => (o(), n(c(w), {
48
+ return (t, i) => (o(), n(c(w), {
46
49
  size: 16,
47
50
  align: "center"
48
51
  }, {
49
52
  default: A(() => [
50
- (o(!0), a(p, null, v(u.value.showActions, (t, h) => (o(), a(p, { key: h }, [
51
- t.actions ? (o(), n(f, s({
53
+ (o(!0), a(p, null, v(u.value.showActions, (e, h) => (o(), a(p, { key: h }, [
54
+ e.actions ? (o(), n(f, s({
52
55
  key: 0,
53
56
  ref_for: !0
54
- }, t), null, 16)) : t.modalProps ? (o(), n(F, s({
57
+ }, e), null, 16)) : e.modalProps ? (o(), n(B, s({
55
58
  key: 1,
56
59
  ref_for: !0
57
- }, t), null, 16)) : t.popconfirmProps ? (o(), n($, s({
60
+ }, e), null, 16)) : e.popconfirmProps ? (o(), n($, s({
58
61
  key: 2,
59
62
  ref_for: !0
60
- }, t), null, 16)) : (o(), n(b, s({
63
+ }, e), null, 16)) : (o(), n(b, s({
61
64
  key: 3,
62
65
  ref_for: !0
63
- }, t), null, 16))
66
+ }, e), null, 16))
64
67
  ], 64))), 128)),
65
68
  d.value ? (o(), n(f, {
66
69
  key: 0,
67
70
  actions: u.value.menuActions,
68
- placement: e.placement,
69
- trigger: e.trigger,
71
+ placement: t.placement,
72
+ trigger: t.trigger,
70
73
  text: c(g)("ap.common.more")
71
74
  }, null, 8, ["actions", "placement", "trigger", "text"])) : y("", !0)
72
75
  ]),
@@ -1,8 +1,9 @@
1
- import { defineComponent as C, useSlots as B, createPropsRestProxy as A, ref as F, computed as d, unref as l, renderSlot as y, createElementBlock as u, createCommentVNode as a, openBlock as n, mergeProps as h, createBlock as f, normalizeClass as L, resolveDynamicComponent as g, isVNode as N, toDisplayString as P } from "vue";
1
+ import { defineComponent as C, useSlots as B, createPropsRestProxy as h, ref as A, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as F, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as g, isVNode as S, toDisplayString as V } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
- import S from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
- import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
5
- const D = { key: 1 }, E = /* @__PURE__ */ C({
3
+ import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
+ import { Tooltip as w } from "@aplus-frontend/antdv";
5
+ import { useNamespace as x } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const D = { key: 1 }, q = /* @__PURE__ */ C({
6
7
  name: "ApActionItem",
7
8
  __name: "index",
8
9
  props: {
@@ -17,45 +18,52 @@ const D = { key: 1 }, E = /* @__PURE__ */ C({
17
18
  iconFirst: { type: Boolean, default: !1 }
18
19
  },
19
20
  setup(o) {
20
- const s = B(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: t, e: b } = $("action-item"), c = F(!1), m = d(() => o.iconFirst && (o.icon || s.icon));
21
+ const s = B(), r = h(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon"]), { b: k, m: l, e: v } = x("action-item"), c = A(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
21
22
  function p(e) {
22
- l(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
23
+ n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
23
24
  }
24
- const i = d(() => o.loading || l(c)), v = d(() => [
25
+ const i = u(() => o.loading || n(c)), b = u(() => [
25
26
  k(),
26
- t(o.color),
27
- m.value ? t("icon-first") : null,
28
- o.disabled ? t("disabled") : null,
29
- i.value ? t("loading") : null
27
+ l(o.color),
28
+ d.value ? l("icon-first") : null,
29
+ o.disabled ? l("disabled") : null,
30
+ i.value ? l("loading") : null
30
31
  ].filter(Boolean));
31
32
  return (e, I) => y(e.$slots, "trigger", {
32
33
  loading: i.value,
33
34
  disabled: e.disabled,
34
35
  onClick: p
35
36
  }, () => [
36
- e.visible ? (n(), u("span", h({ key: 0 }, e.$attrs, {
37
- class: v.value,
37
+ e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
38
+ class: b.value,
38
39
  onClick: p
39
40
  }), [
40
- i.value ? (n(), f(l(S), {
41
+ i.value ? (t(), m(n($), {
41
42
  key: 0,
42
43
  "prefix-cls": "btn",
43
44
  "exist-icon": !1,
44
45
  loading: ""
45
46
  })) : a("", !0),
46
- e.icon || s.icon ? (n(), u("span", {
47
+ e.icon || s.icon ? (t(), f("span", {
47
48
  key: 1,
48
- class: L(l(b)("icon-wrapper"))
49
+ class: N(n(v)("icon-wrapper"))
49
50
  }, [
50
- (n(), f(g(e.icon || s.icon)))
51
+ L(n(w), {
52
+ title: d.value ? e.text : null
53
+ }, {
54
+ default: P(() => [
55
+ (t(), m(g(e.icon || s.icon)))
56
+ ]),
57
+ _: 1
58
+ }, 8, ["title"])
51
59
  ], 2)) : a("", !0),
52
- m.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
53
- N(e.text) ? (n(), f(g(e.text), { key: 0 })) : (n(), u("span", D, P(e.text || ""), 1))
60
+ d.value ? a("", !0) : y(e.$slots, "default", { key: 2 }, () => [
61
+ S(e.text) ? (t(), m(g(e.text), { key: 0 })) : (t(), f("span", D, V(e.text || ""), 1))
54
62
  ])
55
63
  ], 16)) : a("", !0)
56
64
  ]);
57
65
  }
58
66
  });
59
67
  export {
60
- E as default
68
+ q as default
61
69
  };
package/es/src/index.d.ts CHANGED
@@ -3,7 +3,6 @@ export * from './ap-form';
3
3
  export * from './ap-field';
4
4
  export * from './design-token';
5
5
  export * from './ap-action';
6
- export * from './work-order-modal';
7
6
  export * from './ap-tag';
8
7
  export * from './ap-upload';
9
8
  export * from './ap-download';