@aplus-frontend/ui 6.39.2 → 6.41.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 (47) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +1 -0
  2. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  3. package/es/src/ag-grid/editable/interface.d.ts +1 -0
  4. package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
  5. package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
  6. package/es/src/ag-grid/index.vue.mjs +162 -153
  7. package/es/src/ag-grid/interface.d.ts +19 -1
  8. package/es/src/ag-grid/theme.d.ts +2 -1
  9. package/es/src/ag-grid/theme.mjs +12 -11
  10. package/es/src/ap-action/interface.d.ts +5 -1
  11. package/es/src/ap-action/item/index.vue2.mjs +17 -16
  12. package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
  13. package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
  14. package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
  15. package/es/src/ap-grid/utils/col.mjs +91 -82
  16. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
  17. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  18. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
  19. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  20. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
  21. package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  25. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  26. package/lib/src/ag-grid/editable/interface.d.ts +1 -0
  27. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  28. package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
  29. package/lib/src/ag-grid/index.vue.js +1 -1
  30. package/lib/src/ag-grid/interface.d.ts +19 -1
  31. package/lib/src/ag-grid/theme.d.ts +2 -1
  32. package/lib/src/ag-grid/theme.js +1 -1
  33. package/lib/src/ap-action/interface.d.ts +5 -1
  34. package/lib/src/ap-action/item/index.vue2.js +1 -1
  35. package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
  36. package/lib/src/ap-action/item-modal/index.vue.js +1 -1
  37. package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
  38. package/lib/src/ap-grid/utils/col.js +1 -1
  39. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
  40. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
  41. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  42. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
  43. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  44. package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +1 -1
@@ -1,16 +1,14 @@
1
- import { useToken as d } from "@aplus-frontend/antdv/es/theme/internal";
2
- import { themeQuartz as n } from "ag-grid-community";
3
- import { computed as c } from "vue";
4
- const h = (o, r) => {
5
- const [, a] = d();
6
- return c(() => {
7
- const t = o.value === "mini", e = a.value;
8
- return n.withParams({
1
+ import { useToken as n } from "@aplus-frontend/antdv/es/theme/internal";
2
+ import { themeQuartz as c } from "ag-grid-community";
3
+ import { computed as l } from "vue";
4
+ const h = (o, r, a) => {
5
+ const [, t] = n();
6
+ return l(() => {
7
+ const d = o.value === "mini", e = t.value;
8
+ return c.withParams({
9
9
  headerHeight: "36px",
10
10
  headerFontSize: "12px",
11
11
  dataFontSize: "12px",
12
- rowHeight: r.value,
13
- spacing: t ? "5px" : "6.5px",
14
12
  foregroundColor: e.colorTextBase,
15
13
  wrapperBorder: !1,
16
14
  rowBorder: { color: e.colorBorderSecondary },
@@ -21,7 +19,10 @@ const h = (o, r) => {
21
19
  headerBackgroundColor: "var(--ap-table-header-bg)",
22
20
  headerColumnResizeHandleHeight: "50%",
23
21
  headerColumnResizeHandleWidth: "1px",
24
- wrapperBorderRadius: "4px"
22
+ wrapperBorderRadius: "4px",
23
+ ...a.value || {},
24
+ rowHeight: r.value,
25
+ spacing: d ? "5px" : "6.5px"
25
26
  });
26
27
  });
27
28
  };
@@ -1,4 +1,4 @@
1
- import { DropdownProps, ModalFuncProps, PopconfirmProps } from '@aplus-frontend/antdv';
1
+ import { DropdownProps, ModalFuncProps, PopconfirmProps, TooltipProps } from '@aplus-frontend/antdv';
2
2
  import { VNode } from 'vue';
3
3
  export type ActionColor = 'primary' | 'success' | 'error' | 'warn';
4
4
  export type ApActionItemProps = {
@@ -43,6 +43,10 @@ export type ApActionItemProps = {
43
43
  * 是否优先显示图标
44
44
  */
45
45
  iconFirst?: boolean;
46
+ /**
47
+ * 优先显示图标时,对弹出的tooltip进行设置
48
+ */
49
+ tooltip?: Partial<Omit<TooltipProps, 'title'>>;
46
50
  };
47
51
  export type MixedActionTypes = ApActionItemProps | ApActionItemModalProps | ApActionItemPopconfirmProps;
48
52
  export type GroupActionTypes = MixedActionTypes | ApActionItemDropdownProps;
@@ -1,9 +1,9 @@
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";
1
+ import { defineComponent as B, useSlots as h, createPropsRestProxy as A, ref as F, computed as u, unref as n, renderSlot as y, createElementBlock as f, createCommentVNode as a, openBlock as t, mergeProps as g, createBlock as m, normalizeClass as N, createVNode as L, withCtx as P, resolveDynamicComponent as k, isVNode as S, toDisplayString as V } from "vue";
2
2
  import "../../config-provider/index.mjs";
3
3
  import $ from "@aplus-frontend/antdv/es/button/LoadingIcon";
4
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({
5
+ import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
6
+ const I = { key: 1 }, q = /* @__PURE__ */ B({
7
7
  name: "ApActionItem",
8
8
  __name: "index",
9
9
  props: {
@@ -15,27 +15,28 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
15
15
  onClick: { type: Function },
16
16
  loading: { type: Boolean, default: !1 },
17
17
  icon: {},
18
- iconFirst: { type: Boolean, default: !1 }
18
+ iconFirst: { type: Boolean, default: !1 },
19
+ tooltip: { default: () => ({}) }
19
20
  },
20
21
  setup(o) {
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));
22
+ const s = h(), r = A(o, ["color", "disabled", "visible", "loading", "iconFirst", "icon", "tooltip"]), { b: v, m: l, e: b } = D("action-item"), c = F(!1), d = u(() => o.iconFirst && (o.icon || s.icon));
22
23
  function p(e) {
23
24
  n(i) || o.disabled || (r.onClick?.(e), r.onAction && (c.value = !0, r.onAction(e).finally(() => c.value = !1)));
24
25
  }
25
- const i = u(() => o.loading || n(c)), b = u(() => [
26
- k(),
26
+ const i = u(() => o.loading || n(c)), C = u(() => [
27
+ v(),
27
28
  l(o.color),
28
29
  d.value ? l("icon-first") : null,
29
30
  o.disabled ? l("disabled") : null,
30
31
  i.value ? l("loading") : null
31
32
  ].filter(Boolean));
32
- return (e, I) => y(e.$slots, "trigger", {
33
+ return (e, T) => y(e.$slots, "trigger", {
33
34
  loading: i.value,
34
35
  disabled: e.disabled,
35
36
  onClick: p
36
37
  }, () => [
37
- e.visible ? (t(), f("span", F({ key: 0 }, e.$attrs, {
38
- class: b.value,
38
+ e.visible ? (t(), f("span", g({ key: 0 }, e.$attrs, {
39
+ class: C.value,
39
40
  onClick: p
40
41
  }), [
41
42
  i.value ? (t(), m(n($), {
@@ -46,19 +47,19 @@ const D = { key: 1 }, q = /* @__PURE__ */ C({
46
47
  })) : a("", !0),
47
48
  e.icon || s.icon ? (t(), f("span", {
48
49
  key: 1,
49
- class: N(n(v)("icon-wrapper"))
50
+ class: N(n(b)("icon-wrapper"))
50
51
  }, [
51
- L(n(w), {
52
+ L(n(w), g({
52
53
  title: d.value ? e.text : null
53
- }, {
54
+ }, e.tooltip), {
54
55
  default: P(() => [
55
- (t(), m(g(e.icon || s.icon)))
56
+ (t(), m(k(e.icon || s.icon)))
56
57
  ]),
57
58
  _: 1
58
- }, 8, ["title"])
59
+ }, 16, ["title"])
59
60
  ], 2)) : a("", !0),
60
61
  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))
62
+ S(e.text) ? (t(), m(k(e.text), { key: 0 })) : (t(), f("span", I, V(e.text || ""), 1))
62
63
  ])
63
64
  ], 16)) : a("", !0)
64
65
  ]);
@@ -25,7 +25,8 @@ const T = /* @__PURE__ */ _({
25
25
  onClick: {},
26
26
  loading: { type: Boolean, default: !1 },
27
27
  icon: {},
28
- iconFirst: { type: Boolean }
28
+ iconFirst: { type: Boolean },
29
+ tooltip: {}
29
30
  },
30
31
  setup(d) {
31
32
  const f = d, i = v(!1), { e: p } = E("action-item-dropdown"), g = k(() => f.actions.filter((e) => e.visible || V(e.visible)).map((e) => ({
@@ -1,4 +1,4 @@
1
- import { defineComponent as i, useSlots as s, createBlock as c, openBlock as p, mergeProps as m, unref as d, createSlots as f, renderList as u, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as P } from "vue";
1
+ import { defineComponent as i, useSlots as s, createBlock as p, openBlock as c, mergeProps as m, unref as d, createSlots as f, renderList as u, withCtx as _, renderSlot as y, normalizeProps as A, guardReactiveProps as P } from "vue";
2
2
  import { Modal as B } from "@aplus-frontend/antdv";
3
3
  import "../item/index.vue.mjs";
4
4
  import { omit as k } from "lodash-unified";
@@ -16,10 +16,11 @@ const z = /* @__PURE__ */ i({
16
16
  loading: { type: Boolean, default: !1 },
17
17
  icon: {},
18
18
  iconFirst: { type: Boolean },
19
+ tooltip: {},
19
20
  modalProps: { default: () => ({}) }
20
21
  },
21
- setup(t) {
22
- const r = s(), o = t;
22
+ setup(n) {
23
+ const r = s(), o = n;
23
24
  async function a(e) {
24
25
  B.confirm({
25
26
  ...o.modalProps,
@@ -29,11 +30,11 @@ const z = /* @__PURE__ */ i({
29
30
  }
30
31
  });
31
32
  }
32
- return (e, g) => (p(), c(x, m(d(k)(o, ["modalProps", "onAction"]), { onAction: a }), f({ _: 2 }, [
33
- u(r, (h, n) => ({
34
- name: n,
33
+ return (e, g) => (c(), p(x, m(d(k)(o, ["modalProps", "onAction"]), { onAction: a }), f({ _: 2 }, [
34
+ u(r, (h, t) => ({
35
+ name: t,
35
36
  fn: _((l) => [
36
- y(e.$slots, n, A(P(l || {})))
37
+ y(e.$slots, t, A(P(l || {})))
37
38
  ])
38
39
  }))
39
40
  ]), 1040));
@@ -16,6 +16,7 @@ const I = /* @__PURE__ */ f({
16
16
  loading: { type: Boolean, default: !1 },
17
17
  icon: {},
18
18
  iconFirst: { type: Boolean },
19
+ tooltip: {},
19
20
  popconfirmProps: { default: () => ({}) }
20
21
  },
21
22
  setup(a) {
@@ -1,23 +1,23 @@
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";
1
+ import { createVNode as u, Fragment as h } from "vue";
2
+ import { isArray as b, isUndefined as E, isString as o, isBoolean as x, isNumber as O, pick as F } from "lodash-unified";
3
+ import { valueEnumToArray as S, objectToString as $, getTableTitle as R, getTableRenderType as V, getTableRenderProps as B, getTableCellRenderNode as M } from "../../ap-table/utils.mjs";
4
+ import { noRenderAsFormItemValueList as _ } from "../../ap-table/constants.mjs";
5
5
  import "../../ap-table/components/paragraph-ellipsis/index.vue.mjs";
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];
6
+ import j from "../../ap-table/components/paragraph-ellipsis/index.vue2.mjs";
7
+ function T(e, t) {
8
+ if (t)
9
+ return b(t) ? t.reduce((r, n) => r?.[n], e) : e?.[t];
10
10
  }
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);
11
+ function v(e) {
12
+ if (!E(e))
13
+ return b(e) ? e.reduce((t, r) => o(r) ? `${t}${t ? "." : ""}${r}` : `${t}[${r}]`, "") : String(e);
14
14
  }
15
- function R(e) {
15
+ function A(e) {
16
16
  if (e)
17
17
  return e === !0 ? "left" : e;
18
18
  }
19
- function j(e) {
20
- return F(e) ? {
19
+ function q(e) {
20
+ return x(e) ? {
21
21
  sortable: e
22
22
  } : e ? {
23
23
  sortable: !0,
@@ -27,117 +27,126 @@ function j(e) {
27
27
  sortable: !1
28
28
  };
29
29
  }
30
- function q(e) {
31
- let r;
32
- return F(e.filters) && e.valueEnum ? r = O(e.valueEnum) : r = e.filters, r?.map((t) => ({
33
- label: b(t.text) ? t.text : "",
34
- value: t.value
30
+ function I(e) {
31
+ let t;
32
+ return x(e.filters) && e.valueEnum ? t = S(e.valueEnum) : t = e.filters, t?.map((r) => ({
33
+ label: o(r.text) ? r.text : "",
34
+ value: r.value
35
35
  }));
36
36
  }
37
37
  function W(e) {
38
38
  if (e)
39
- return (r) => e(r.value, r.row);
39
+ return (t) => e(t.value, t.row);
40
40
  }
41
- function _(e, r) {
42
- return e ? E(e) ? {
43
- tooltip: r,
41
+ function k(e, t) {
42
+ return e ? O(e) ? {
43
+ tooltip: t,
44
44
  rows: e
45
45
  } : e === !0 || e === "tooltip" ? {
46
- tooltip: r,
46
+ tooltip: t,
47
47
  rows: 1
48
48
  } : {
49
49
  tooltip: null,
50
50
  rows: 1,
51
- htmlTitle: e === "title" ? r : ""
51
+ htmlTitle: e === "title" ? t : ""
52
52
  } : !1;
53
53
  }
54
- function k(e, r, t) {
55
- if (B.includes(e.valueType))
56
- return t;
54
+ function z(e, t, r) {
55
+ if (_.includes(e.valueType))
56
+ return r;
57
57
  if (e.copyable || e.ellipsis) {
58
- const l = _(e.ellipsis, r), i = $(r);
59
- return o(M, {
58
+ const n = k(e.ellipsis, t), i = $(t);
59
+ return u(j, {
60
60
  rawValue: i,
61
61
  copyable: e.copyable,
62
- ellipsis: l,
63
- content: t
62
+ ellipsis: n,
63
+ content: r
64
64
  }, null);
65
65
  }
66
- return t;
66
+ return r;
67
+ }
68
+ function c(e, t, r) {
69
+ const n = F(e, ["width", "minWidth", "align"]);
70
+ return n.field = v(e.dataIndex), n.fixed = A(e.fixed), n.slots = {
71
+ header: () => R(e, r, void 0, t)
72
+ }, n.headerAlign = e.align, n.showOverflow = !1, n.showFooterOverflow = !1, n;
67
73
  }
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)
72
- }, l.headerAlign = e.align, l.showOverflow = !1, l.showFooterOverflow = !1, l;
74
+ function D(e, t, r) {
75
+ if (r)
76
+ return o(r) ? e[r] : r(e, t);
73
77
  }
74
- const z = ({
78
+ const G = ({
75
79
  value: e,
76
- ...r
77
- }, t, l, i = !0) => {
78
- const s = w(t), d = S({
79
- ...t,
80
+ ...t
81
+ }, r, n, i = !0) => {
82
+ const s = V(r), d = B({
83
+ ...r,
80
84
  valueType: s
81
85
  }, {
82
86
  value: e,
83
- ...r
84
- }), n = V(s, d, r.record, l), a = t.renderText?.({
85
- value: e,
86
- ...r
87
- }) || e, u = t.renderText ? o(p, null, [t.renderText?.({
87
+ ...t
88
+ }), l = M(s, d, t.record, n), a = r.renderText?.({
88
89
  value: e,
89
- ...r
90
- })]) : n;
91
- let f = i ? k(t, a, u) : u;
92
- return t.customRender && (f = t.customRender({
90
+ ...t
91
+ }) || e, p = r.renderText ? u(h, null, [r.renderText?.({
93
92
  value: e,
94
- ...r,
95
- column: t,
96
- originalNode: f,
97
- originalText: a
98
- })), o(p, null, [f]);
93
+ ...t
94
+ })]) : l;
95
+ let f = i ? z(r, a, p) : p;
96
+ if (r.customRender) {
97
+ const N = r._path || [], w = D(t.record, t.rowIndex, t.params.rowKey);
98
+ f = r.customRender({
99
+ value: e,
100
+ ...t,
101
+ column: r,
102
+ originalNode: f,
103
+ originalText: a,
104
+ path: [...N, String(w)]
105
+ });
106
+ }
107
+ return u(h, null, [f]);
99
108
  };
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);
109
+ function y(e, t, r, n) {
110
+ const i = F(e, ["width", "minWidth", "align", "resizable", "className", "headerClassName", "footerClassName", "treeNode"]);
111
+ i.field = v(e.dataIndex), i.fixed = A(e.fixed), i.headerAlign = e.align, i.footerAlign = e.align, i.showOverflow = !1, i.showFooterOverflow = !1, Object.assign(i, q(e.sorter)), i.filters = I(e), i.filterMultiple = e.filterMultiple, i.filterMethod = W(e.onFilter);
103
112
  const s = ({
104
113
  row: d,
105
- rowIndex: n
106
- }) => z({
107
- value: h(d, e.dataIndex),
108
- text: h(d, e.dataIndex),
114
+ rowIndex: l
115
+ }) => G({
116
+ value: T(d, e.dataIndex),
117
+ text: T(d, e.dataIndex),
109
118
  record: d,
110
- index: n,
111
- renderIndex: n,
119
+ index: l,
120
+ renderIndex: l,
112
121
  column: e
113
- }, e, l);
122
+ }, e, n);
114
123
  return i.slots = {
115
- header: () => v(e, t, void 0, r),
124
+ header: () => R(e, r, void 0, t),
116
125
  default: s,
117
126
  footer: s
118
127
  }, e.html && (delete i.slots.default, delete i.slots.footer, i.type = "html"), e.seq && (i.type = "seq", i.slots = {}), i;
119
128
  }
120
- function J(e, r, t, l) {
129
+ function X(e, t, r, n) {
121
130
  if (!e.children?.length)
122
- return y(e, r, t, l);
131
+ return y(e, t, r, n);
123
132
  function i(d) {
124
- return d.map((n) => {
125
- if (n.children?.length) {
126
- const a = T(n, r, t);
127
- return a.children = i(n.children), a;
133
+ return d.map((l) => {
134
+ if (l.children?.length) {
135
+ const a = c(l, t, r);
136
+ return a.children = i(l.children), a;
128
137
  }
129
- return y(n, r, t, l);
138
+ return y(l, t, r, n);
130
139
  });
131
140
  }
132
- const s = T(e, r, t);
141
+ const s = c(e, t, r);
133
142
  return s.children = i(e.children), s;
134
143
  }
135
144
  export {
136
- z as contentCustom,
137
- A as dataIndexToField,
138
- h as getValueByDataIndex,
139
- J as transformCol,
140
- R as transformFixed,
141
- T as transformToColGroup,
145
+ G as contentCustom,
146
+ v as dataIndexToField,
147
+ T as getValueByDataIndex,
148
+ X as transformCol,
149
+ A as transformFixed,
150
+ c as transformToColGroup,
142
151
  y as transformToColumn
143
152
  };
@@ -36,7 +36,7 @@ function L(n) {
36
36
  dataSourceLength: a(
37
37
  () => l.value
38
38
  )
39
- }), m.default;
39
+ }), () => m.default?.();
40
40
  }
41
41
  });
42
42
  return [s, p];
@@ -1,3 +1,4 @@
1
1
  import { AgGridPreviewModalProps, PreviewModalReturnType } from '../interface';
2
+ import { Recordable } from '../../../type';
2
3
  /** ag-grid弹框 */
3
- export declare function useAgGridModal<T = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType<T>;
4
+ export declare function useAgGridModal<T extends Recordable = any>(props: AgGridPreviewModalProps<T>): PreviewModalReturnType<T>;
@@ -1,29 +1,29 @@
1
- import { defineComponent as v, ref as w, createVNode as n } from "vue";
2
- import { ApModal as P } from "../../../ap-modal/index.mjs";
1
+ import { defineComponent as P, ref as v, createVNode as n, mergeProps as w } from "vue";
2
+ import { ApModal as y } from "../../../ap-modal/index.mjs";
3
3
  import "../../../ag-grid/index.mjs";
4
- import { genRequest as y } from "../utils.mjs";
5
- import { useAgGridInstance as I } from "./use-ag-grid-instance.mjs";
6
- import { isFunction as A, isEmpty as f, omitBy as M, isUndefined as _, omit as q } from "lodash-unified";
4
+ import { genRequest as I } from "../utils.mjs";
5
+ import { useAgGridInstance as A } from "./use-ag-grid-instance.mjs";
6
+ import { isFunction as M, isEmpty as f, omitBy as _, isUndefined as q, omit as G } from "lodash-unified";
7
7
  import "../wrapper/index.vue.mjs";
8
- import G from "../wrapper/index.vue2.mjs";
9
- import H from "../../../ag-grid/index.vue.mjs";
10
- function L(o) {
8
+ import H from "../wrapper/index.vue2.mjs";
9
+ import x from "../../../ag-grid/index.vue.mjs";
10
+ function j(r) {
11
11
  let a = null, s = null;
12
- const [r, c] = I(), l = y(o.api, o.getRowKey, r.setDataSourceLength), u = (t) => {
12
+ const [o, c] = A(), l = I(r.api, r.getRowKey, o.setDataSourceLength), u = (t) => {
13
13
  const {
14
14
  title: e,
15
15
  width: i,
16
16
  modalProps: C,
17
17
  ...d
18
- } = A(t) ? t(o) : t;
18
+ } = M(t) ? t(r) : t;
19
19
  f(d) || s?.(d);
20
- const m = M({
20
+ const m = _({
21
21
  title: e,
22
22
  width: i,
23
23
  modalProps: C
24
- }, _);
24
+ }, q);
25
25
  f(m) || a?.update(m);
26
- }, g = /* @__PURE__ */ v({
26
+ }, g = /* @__PURE__ */ P({
27
27
  name: "AgGridModalPreviewContent",
28
28
  props: {
29
29
  modalConfig: {
@@ -32,20 +32,20 @@ function L(o) {
32
32
  }
33
33
  },
34
34
  setup(t) {
35
- const e = w(t.modalConfig);
35
+ const e = v(t.modalConfig);
36
36
  return s = (i) => {
37
37
  e.value = {
38
38
  ...e.value,
39
39
  ...i
40
40
  };
41
41
  }, () => n(c, null, {
42
- default: () => [n(G, {
42
+ default: () => [n(H, {
43
43
  rowHeight: e.value.rowHeight
44
44
  }, {
45
- default: () => [e.value.renderHeader?.(q(r, "setInstance"), {
45
+ default: () => [e.value.renderHeader?.(G(o, "setInstance"), {
46
46
  updateProps: u
47
- }), n(H, {
48
- ref: r.setInstance,
47
+ }), n(x, w({
48
+ ref: o.setInstance,
49
49
  searchForm: {
50
50
  sortable: !1,
51
51
  resize: {
@@ -59,25 +59,25 @@ function L(o) {
59
59
  },
60
60
  rowHeight: e.value.rowHeight,
61
61
  columns: e.value.columns
62
- }, e.value.gridSlots)]
62
+ }, r.gridProps), e.value.gridSlots)]
63
63
  })]
64
64
  });
65
65
  }
66
66
  });
67
67
  function p() {
68
- a = P.createModal({
69
- title: o.title,
70
- width: o.width,
68
+ a = y.createModal({
69
+ title: r.title,
70
+ width: r.width,
71
71
  destroyOnClose: !0,
72
72
  maskClosable: !1,
73
73
  footer: null,
74
74
  afterOpenChange(t) {
75
- t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
75
+ t === !1 && (o.setInstance(void 0), o.setDataSourceLength(0), a = null);
76
76
  },
77
77
  content: n(g, {
78
- modalConfig: o
78
+ modalConfig: r
79
79
  }, null),
80
- ...o.modalProps || {}
80
+ ...r.modalProps || {}
81
81
  });
82
82
  }
83
83
  function h(t) {
@@ -85,11 +85,11 @@ function L(o) {
85
85
  }
86
86
  return {
87
87
  open: h,
88
- refresh: r.refresh,
89
- getAgGridInstance: r.getInstance,
88
+ refresh: o.refresh,
89
+ getAgGridInstance: o.getInstance,
90
90
  updateProps: u
91
91
  };
92
92
  }
93
93
  export {
94
- L as useAgGridModal
94
+ j as useAgGridModal
95
95
  };
@@ -1,2 +1,3 @@
1
1
  import { AgGridSelectModalProps, SelectModalReturnType } from '../interface';
2
- export declare function useAgGridSelectModal<T = any>(props: AgGridSelectModalProps<T>): SelectModalReturnType<T>;
2
+ import { Recordable } from '../../../type';
3
+ export declare function useAgGridSelectModal<T extends Recordable = any>(props: AgGridSelectModalProps<T>): SelectModalReturnType<T>;