@aplus-frontend/ui 7.19.8 → 7.20.1

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/components/tooltip/index.vue2.mjs +9 -9
  2. package/es/src/ag-grid/editable/form-item.vue.mjs +113 -93
  3. package/es/src/ag-grid/editable/index.vue.mjs +91 -79
  4. package/es/src/ag-grid/editable/interface.d.ts +7 -0
  5. package/es/src/ag-grid/hooks/use-columns-def.mjs +74 -65
  6. package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
  7. package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
  8. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
  9. package/es/src/ag-grid/index.vue.mjs +124 -120
  10. package/es/src/ag-grid/interface.d.ts +6 -0
  11. package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
  12. package/es/src/business/ag-grid-modal/constants.mjs +1 -1
  13. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
  14. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +47 -37
  15. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +30 -29
  16. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +46 -45
  17. package/es/src/business/ag-grid-modal/interface.d.ts +4 -4
  18. package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
  19. package/es/src/business/ag-grid-modal/utils.mjs +34 -30
  20. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
  21. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -25
  22. package/es/src/version.d.ts +1 -1
  23. package/es/src/version.mjs +1 -1
  24. package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -1
  25. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  26. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  27. package/lib/src/ag-grid/editable/interface.d.ts +7 -0
  28. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  29. package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
  30. package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
  31. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  32. package/lib/src/ag-grid/index.vue.js +1 -1
  33. package/lib/src/ag-grid/interface.d.ts +6 -0
  34. package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
  35. package/lib/src/business/ag-grid-modal/constants.js +1 -1
  36. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
  37. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
  38. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  39. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  40. package/lib/src/business/ag-grid-modal/interface.d.ts +4 -4
  41. package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
  42. package/lib/src/business/ag-grid-modal/utils.js +1 -1
  43. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
  44. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  45. package/lib/src/version.d.ts +1 -1
  46. package/lib/src/version.js +1 -1
  47. package/package.json +1 -1
@@ -1,50 +1,60 @@
1
- import { cloneDeep as A } from "lodash-unified";
2
- import { ref as o, watch as r, defineComponent as h, provide as I, toRef as a, inject as y } from "vue";
3
- const u = /* @__PURE__ */ Symbol("ag-grid-provider-key");
4
- function L(n) {
5
- const t = o(), c = o(), l = o(0), d = (e) => {
1
+ import { cloneDeep as I } from "lodash-unified";
2
+ import { ref as c, watch as u, defineComponent as D, provide as H, toRef as r, inject as x } from "vue";
3
+ const g = /* @__PURE__ */ Symbol("ag-grid-provider-key");
4
+ function _(s) {
5
+ const t = c(), l = c(), a = c(0), d = c(0), v = (e) => {
6
6
  t.value = e;
7
- }, i = (e) => {
8
- l.value = e;
9
- }, v = () => t.value, S = (e = "reset") => {
10
- t.value && e in t.value && t.value[e]();
11
7
  }, w = (e) => {
8
+ a.value = e;
9
+ }, S = () => t.value, f = (e = "reset") => {
10
+ t.value && e in t.value && t.value[e]();
11
+ }, R = (e) => {
12
12
  t.value?.rowSelection.setSelectedRowKeys(e);
13
- }, g = () => A(t.value?.rowSelection.selectedRows.value), f = () => t.value?.rowSelection.clearAll(), R = (e) => t.value?.rowSelection.unSelectRows([e]);
14
- r(t, (e) => {
15
- e && n?.onMounted?.();
16
- }), r(
13
+ }, h = () => I(t.value?.rowSelection.selectedRows.value), p = () => t.value?.rowSelection.clearAll(), y = (e) => t.value?.rowSelection.unSelectRows([e]), A = (e) => {
14
+ if (!e) return;
15
+ const n = e.getDisplayedRowCount();
16
+ if (n > 0) {
17
+ const o = e.getDisplayedRowAtIndex(n - 1);
18
+ if (o && o.rowTop && o.rowHeight) {
19
+ const G = o.rowTop + o.rowHeight;
20
+ d.value = G;
21
+ }
22
+ }
23
+ };
24
+ u(t, (e) => {
25
+ e && s?.onMounted?.();
26
+ }), u(
17
27
  () => t.value?.rowSelection.selectedRows.value,
18
28
  (e) => {
19
- c.value = e, n?.onSelectedRows?.(e);
29
+ l.value = e, s?.onSelectedRows?.(e);
20
30
  }
21
31
  );
22
- const s = {
23
- setInstance: d,
24
- refresh: S,
25
- getInstance: v,
26
- setSelectedRowKeys: w,
27
- getSelectedRows: g,
28
- clearAllSelected: f,
29
- removeSelected: R,
30
- setDataSourceLength: i
31
- }, p = h({
32
- setup(e, { slots: m }) {
33
- return I(u, {
34
- ...s,
35
- selectedRows: a(() => c.value),
36
- dataSourceLength: a(
37
- () => l.value
38
- )
39
- }), () => m.default?.();
32
+ const i = {
33
+ setInstance: v,
34
+ refresh: f,
35
+ getInstance: S,
36
+ setSelectedRowKeys: R,
37
+ getSelectedRows: h,
38
+ clearAllSelected: p,
39
+ removeSelected: y,
40
+ setDataSourceLength: w,
41
+ onAgGridUpdate: A
42
+ }, m = D({
43
+ setup(e, { slots: n }) {
44
+ return H(g, {
45
+ ...i,
46
+ selectedRows: r(() => l.value),
47
+ dataSourceLength: r(() => a.value),
48
+ agGridBodyHeight: r(() => d.value)
49
+ }), () => n.default?.();
40
50
  }
41
51
  });
42
- return [s, p];
52
+ return [i, m];
43
53
  }
44
- function _() {
45
- return y(u);
54
+ function j() {
55
+ return x(g);
46
56
  }
47
57
  export {
48
- L as useAgGridInstance,
49
- _ as useAgGridModalInject
58
+ _ as useAgGridInstance,
59
+ j as useAgGridModalInject
50
60
  };
@@ -1,28 +1,28 @@
1
1
  import { defineComponent as C, ref as P, createVNode as n, mergeProps as H } from "vue";
2
- import { isFunction as w, isEmpty as g, omitBy as y, isUndefined as I, omit as x } from "lodash-unified";
2
+ import { isFunction as w, isEmpty as g, omitBy as y, isUndefined as A, omit as I } from "lodash-unified";
3
3
  import "../../../ag-grid/index.mjs";
4
- import { ApModal as A } from "../../../ap-modal/index.mjs";
5
- import { genRequest as M } from "../utils.mjs";
4
+ import { ApModal as M } from "../../../ap-modal/index.mjs";
5
+ import { genRequest as x } from "../utils.mjs";
6
6
  import "../wrapper/index.vue.mjs";
7
- import { useAgGridInstance as _ } from "./use-ag-grid-instance.mjs";
8
- import q from "../wrapper/index.vue2.mjs";
9
- import G from "../../../ag-grid/index.vue.mjs";
10
- function j(r) {
7
+ import { useAgGridInstance as G } from "./use-ag-grid-instance.mjs";
8
+ import _ from "../wrapper/index.vue2.mjs";
9
+ import q from "../../../ag-grid/index.vue.mjs";
10
+ function L(o) {
11
11
  let a = null, l = null;
12
- const [o, f] = _(), s = M(r.api, r.getRowKey, o.setDataSourceLength), u = (t) => {
12
+ const [r, f] = G(), s = x(o.api, o.getRowKey, r.setDataSourceLength), u = (t) => {
13
13
  const {
14
14
  title: e,
15
15
  width: i,
16
16
  modalProps: v,
17
- ...m
18
- } = w(t) ? t(r) : t;
19
- g(m) || l?.(m);
20
- const d = y({
17
+ ...d
18
+ } = w(t) ? t(o) : t;
19
+ g(d) || l?.(d);
20
+ const m = y({
21
21
  title: e,
22
22
  width: i,
23
23
  modalProps: v
24
- }, I);
25
- g(d) || a?.update(d);
24
+ }, A);
25
+ g(m) || a?.update(m);
26
26
  }, c = /* @__PURE__ */ C({
27
27
  name: "AgGridModalPreviewContent",
28
28
  props: {
@@ -39,16 +39,16 @@ function j(r) {
39
39
  ...i
40
40
  };
41
41
  }, () => n(f, null, {
42
- default: () => [n(q, {
42
+ default: () => [n(_, {
43
43
  height: e.value.height,
44
44
  rowHeight: e.value.rowHeight,
45
45
  minHeight: e.value.minHeight,
46
46
  maxHeight: e.value.maxHeight
47
47
  }, {
48
- default: () => [e.value.renderHeader?.(x(o, "setInstance"), {
48
+ default: () => [e.value.renderHeader?.(I(r, "setInstance"), {
49
49
  updateProps: u
50
- }), n(G, H({
51
- ref: o.setInstance,
50
+ }), n(q, H({
51
+ ref: r.setInstance,
52
52
  searchForm: {
53
53
  sortable: !1,
54
54
  resize: {
@@ -62,26 +62,27 @@ function j(r) {
62
62
  },
63
63
  rowHeight: e.value.rowHeight,
64
64
  columns: e.value.columns,
65
- autoHeight: !!e.value.height
66
- }, r.gridProps), e.value.gridSlots)]
65
+ autoHeight: e.value.height === "auto",
66
+ onModelUpdated: r.onAgGridUpdate
67
+ }, o.gridProps), e.value.gridSlots)]
67
68
  })]
68
69
  });
69
70
  }
70
71
  });
71
72
  function h() {
72
- a = A.createModal({
73
- title: r.title,
74
- width: r.width,
73
+ a = M.createModal({
74
+ title: o.title,
75
+ width: o.width,
75
76
  destroyOnClose: !0,
76
77
  maskClosable: !1,
77
78
  footer: null,
78
79
  afterOpenChange(t) {
79
- t === !1 && (o.setInstance(void 0), o.setDataSourceLength(0), a = null);
80
+ t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
80
81
  },
81
82
  content: n(c, {
82
- modalConfig: r
83
+ modalConfig: o
83
84
  }, null),
84
- ...r.modalProps || {}
85
+ ...o.modalProps || {}
85
86
  });
86
87
  }
87
88
  function p(t) {
@@ -89,11 +90,11 @@ function j(r) {
89
90
  }
90
91
  return {
91
92
  open: p,
92
- refresh: o.refresh,
93
- getAgGridInstance: o.getInstance,
93
+ refresh: r.refresh,
94
+ getAgGridInstance: r.getInstance,
94
95
  updateProps: u
95
96
  };
96
97
  }
97
98
  export {
98
- j as useAgGridModal
99
+ L as useAgGridModal
99
100
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as O, ref as _, createVNode as i, mergeProps as L, onUnmounted as j } from "vue";
2
- import { message as q } from "@aplus-frontend/antdv";
3
- import { isFunction as u, cloneDeep as D, isEmpty as b, omitBy as G, isUndefined as T, omit as x } from "lodash-unified";
1
+ import { defineComponent as O, ref as _, createVNode as i, mergeProps as G, onUnmounted as L } from "vue";
2
+ import { message as j } from "@aplus-frontend/antdv";
3
+ import { isFunction as u, cloneDeep as q, isEmpty as b, omitBy as D, isUndefined as T, omit as x } from "lodash-unified";
4
4
  import "../../../ag-grid/index.mjs";
5
- import { ApModal as F } from "../../../ap-modal/index.mjs";
5
+ import { ApModal as U } from "../../../ap-modal/index.mjs";
6
6
  import "../../../config-provider/index.mjs";
7
- import { ROW_KEY as E } from "../constants.mjs";
7
+ import { ROW_KEY as F } from "../constants.mjs";
8
8
  import "../modal-layout/index.vue.mjs";
9
- import { AsyncCallback as U, genRequest as W, delRowKeyField as $, addRowKeyField as z, getModalLayoutConfig as B } from "../utils.mjs";
9
+ import { AsyncCallback as E, genRequest as W, delRowKeyField as $, addRowKeyField as z, getModalLayoutConfig as B } from "../utils.mjs";
10
10
  import "../wrapper/index.vue.mjs";
11
11
  import { useAgGridInstance as N } from "./use-ag-grid-instance.mjs";
12
12
  import { useModalTitle as V } from "./use-modal-title.mjs";
@@ -16,30 +16,30 @@ import Q from "../modal-layout/index.vue2.mjs";
16
16
  import X from "../../../ag-grid/index.vue.mjs";
17
17
  function we(o) {
18
18
  let d, f = null, g = null;
19
- const c = new U(), [S, K] = V(), {
20
- t: k
21
- } = Y(), [s, p] = N({
19
+ const c = new E(), [S, p] = V(), {
20
+ t: K
21
+ } = Y(), [l, k] = N({
22
22
  onSelectedRows(e) {
23
- K.setCount(e?.length || 0);
23
+ p.setCount(e?.length || 0);
24
24
  }
25
- }), w = W(o.api, o.getRowKey, s.setDataSourceLength), y = (e) => {
25
+ }), w = W(o.api, o.getRowKey, l.setDataSourceLength), y = (e) => {
26
26
  const {
27
27
  title: t,
28
- width: l,
28
+ width: s,
29
29
  modalProps: n,
30
30
  ...a
31
- } = u(e) ? e(D(o)) : e;
31
+ } = u(e) ? e(q(o)) : e;
32
32
  b(a) || g?.(a);
33
- const r = G({
33
+ const r = D({
34
34
  title: t,
35
- width: l,
35
+ width: s,
36
36
  modalProps: n
37
37
  }, T);
38
38
  b(r) || f?.update(r);
39
39
  }, m = u(o.getRowKey) ? o.getRowKey : (e) => e[o.getRowKey], P = () => {
40
- const e = o.mergeRule || "old", t = s.getSelectedRows() || [];
40
+ const e = o.mergeRule || "old", t = l.getSelectedRows() || [];
41
41
  return {
42
- keys: I(t),
42
+ keys: H(t),
43
43
  rows: t.map((a) => {
44
44
  const r = m(a);
45
45
  return e === "old" && d?.[r] ? d[r] : $(a);
@@ -47,12 +47,12 @@ function we(o) {
47
47
  };
48
48
  }, h = async () => {
49
49
  const e = P(), t = o.maxCount || 1 / 0;
50
- return e.keys.length > t ? (q.warning(k("ap.apTableModal.messageMaxCount", {
50
+ return e.keys.length > t ? (j.warning(K("ap.apTableModal.messageMaxCount", {
51
51
  maxCount: t
52
52
  })), Promise.reject()) : (await o.beforeOk?.(e), o.finishCallback?.(e), c.resolve(e), e);
53
- }, v = () => {
53
+ }, M = () => {
54
54
  c.reject("modal is closed!");
55
- }, M = /* @__PURE__ */ O({
55
+ }, v = /* @__PURE__ */ O({
56
56
  name: "AgGridModalSelectContent",
57
57
  props: {
58
58
  modalConfig: {
@@ -66,32 +66,32 @@ function we(o) {
66
66
  },
67
67
  setup(e) {
68
68
  const t = _(e.modalConfig);
69
- return g = (l) => {
69
+ return g = (s) => {
70
70
  t.value = {
71
71
  ...t.value,
72
- ...l
72
+ ...s
73
73
  };
74
74
  }, () => {
75
- const l = e.selectedRows?.map((r) => z(r, t.value.getRowKey)), n = t.value, a = B(n.modalLayout);
76
- return i(p, null, {
75
+ const s = e.selectedRows?.map((r) => z(r, t.value.getRowKey)), n = t.value, a = B(n.modalLayout);
76
+ return i(k, null, {
77
77
  default: () => [i(J, {
78
78
  height: n.height,
79
79
  rowHeight: n.rowHeight,
80
80
  minHeight: t.value.minHeight,
81
81
  maxHeight: t.value.maxHeight
82
82
  }, {
83
- default: () => [o.renderHeader?.(x(s, "setInstance"), {
83
+ default: () => [o.renderHeader?.(x(l, "setInstance"), {
84
84
  updateProps: y
85
85
  }), i(Q, a.props, {
86
- default: () => [i(X, L({
87
- ref: s.setInstance,
86
+ default: () => [i(X, G({
87
+ ref: l.setInstance,
88
88
  searchForm: {
89
89
  sortable: !1,
90
90
  resize: {
91
91
  target: "form"
92
92
  }
93
93
  },
94
- rowKey: u(n.getRowKey) ? E : n.getRowKey,
94
+ rowKey: u(n.getRowKey) ? F : n.getRowKey,
95
95
  request: w.request,
96
96
  style: {
97
97
  padding: "0px"
@@ -99,17 +99,18 @@ function we(o) {
99
99
  rowHeight: n.rowHeight,
100
100
  columns: n.columns,
101
101
  rowSelection: {
102
- defaultSelectedRows: l,
102
+ defaultSelectedRows: s,
103
103
  preserveSelectedRowKeys: !0,
104
104
  type: n.mode || "checkbox",
105
105
  fixed: "left",
106
106
  columnWidth: 38,
107
107
  disabled(r) {
108
- return u(n.disabledCheckbox) ? n.disabledCheckbox(r, x(s, "setInstance")) : n.disabledCheckbox ?? !1;
108
+ return u(n.disabledCheckbox) ? n.disabledCheckbox(r, x(l, "setInstance")) : n.disabledCheckbox ?? !1;
109
109
  },
110
110
  ...o.rowSelection
111
111
  },
112
- autoHeight: !!t.value.height
112
+ autoHeight: t.value.height === "auto",
113
+ onModelUpdated: l.onAgGridUpdate
113
114
  }, o.gridProps), n.gridSlots)],
114
115
  ...a.slots
115
116
  })]
@@ -119,14 +120,14 @@ function we(o) {
119
120
  }
120
121
  });
121
122
  function C(e) {
122
- return i(M, {
123
+ return i(v, {
123
124
  modalConfig: o,
124
125
  selectedRows: e
125
126
  }, null);
126
127
  }
127
- function H() {
128
+ function A() {
128
129
  const e = Object.values(d || {}), t = C(e);
129
- f = F.createModal({
130
+ f = U.createModal({
130
131
  title: i(S, {
131
132
  title: o.title,
132
133
  maxCount: o.maxCount || 1 / 0,
@@ -136,34 +137,34 @@ function we(o) {
136
137
  destroyOnClose: !0,
137
138
  maskClosable: !1,
138
139
  onOk: h,
139
- onCancel: v,
140
- afterOpenChange(l) {
141
- l === !1 && (s.setInstance(void 0), s.setDataSourceLength(0));
140
+ onCancel: M,
141
+ afterOpenChange(s) {
142
+ s === !1 && (l.setInstance(void 0), l.setDataSourceLength(0));
142
143
  },
143
144
  content: t,
144
145
  ...o.modalProps || {}
145
146
  });
146
147
  }
147
- function I(e) {
148
+ function H(e) {
148
149
  return e?.map(m) || [];
149
150
  }
150
- function R(e, t, l = !1) {
151
+ function R(e, t, s = !1) {
151
152
  if (d = e?.reduce((n, a) => {
152
153
  const r = m(a);
153
154
  return n[r] = a, n;
154
- }, {}), w.setExtraParams(t?.extraParams), H(), l)
155
+ }, {}), w.setExtraParams(t?.extraParams), A(), s)
155
156
  return c.buildPromise();
156
157
  }
157
- function A(e, t) {
158
+ function I(e, t) {
158
159
  return R(e, t, !0);
159
160
  }
160
- return j(() => {
161
+ return L(() => {
161
162
  c.reject("component is Unmounted!");
162
163
  }), {
163
164
  open: R,
164
- asyncOpen: A,
165
- refresh: s.refresh,
166
- getAgGridInstance: s.getInstance,
165
+ asyncOpen: I,
166
+ refresh: l.refresh,
167
+ getAgGridInstance: l.getInstance,
167
168
  genContent: C,
168
169
  validate: h,
169
170
  updateProps: y
@@ -1,4 +1,4 @@
1
- import { CSSProperties, StyleValue, VNodeChild } from 'vue';
1
+ import { StyleValue, VNodeChild } from 'vue';
2
2
  import { AgGridColumnType, AgGridExpose, AgGridProps, AgGridRowSelection, AgGridSlots } from '../../ag-grid';
3
3
  import { CreateModalFuncProps } from '../../ap-modal';
4
4
  import { Recordable } from '../../type';
@@ -19,9 +19,9 @@ export interface AgGridModalBasicProps<TableRowType = any> {
19
19
  updateProps: UpdatePropsFn<TableRowType>;
20
20
  }) => VNodeChild;
21
21
  rowHeight?: number;
22
- height?: CSSProperties['height'];
23
- minHeight?: CSSProperties['height'];
24
- maxHeight?: CSSProperties['height'];
22
+ height?: number | string;
23
+ minHeight?: number;
24
+ maxHeight?: number | string;
25
25
  }
26
26
  /** 刷新方式 */
27
27
  export type RefreshType = 'reset' | 'submit' | 'submitWith';
@@ -55,3 +55,5 @@ export declare class AsyncCallback<T = any> {
55
55
  /** 拒绝回调 */
56
56
  reject(error?: string): void;
57
57
  }
58
+ /** 数字类型转像素 */
59
+ export declare function toHeight(val: number | string): string;
@@ -1,39 +1,39 @@
1
1
  import { isFunction as p } from "lodash-unified";
2
- import { ROW_KEY as a } from "./constants.mjs";
3
- function m(e, t, r) {
2
+ import { ROW_KEY as l } from "./constants.mjs";
3
+ function F(t, e, r) {
4
4
  let n = null;
5
- return { request: async (s) => {
6
- const i = e;
5
+ return { request: async (o) => {
6
+ const i = t;
7
7
  if (!i)
8
8
  return r?.(0), {
9
9
  data: [],
10
10
  total: 0
11
11
  };
12
- n && (s = Object.assign(s, n));
13
- const { records: l, total: u } = await i(Object.assign({}, s));
14
- return r?.(l?.length || 0), {
15
- data: l?.map((c) => h(c, t)),
16
- total: u
12
+ n && (o = Object.assign(o, n));
13
+ const { records: u, total: a } = await i(Object.assign({}, o));
14
+ return r?.(u?.length || 0), {
15
+ data: u?.map((c) => h(c, e)),
16
+ total: a
17
17
  };
18
- }, setExtraParams: (s) => {
19
- n = s || null;
18
+ }, setExtraParams: (o) => {
19
+ n = o || null;
20
20
  } };
21
21
  }
22
- function h(e, t) {
23
- return p(t) ? {
24
- ...e,
25
- [a]: t(e)
26
- } : e;
22
+ function h(t, e) {
23
+ return p(e) ? {
24
+ ...t,
25
+ [l]: e(t)
26
+ } : t;
27
27
  }
28
- function g(e) {
29
- return Reflect.deleteProperty(e, a), e;
28
+ function g(t) {
29
+ return Reflect.deleteProperty(t, l), t;
30
30
  }
31
- function j(e) {
32
- const { renderSelectedItem: t, rightTitle: r, rightBottom: n, ...o } = e || {};
31
+ function j(t) {
32
+ const { renderSelectedItem: e, rightTitle: r, rightBottom: n, ...s } = t || {};
33
33
  return {
34
- props: { ...o, layoutType: e && "two-column" },
34
+ props: { ...s, layoutType: t && "two-column" },
35
35
  slots: {
36
- renderSelectedItem: t,
36
+ renderSelectedItem: e,
37
37
  rightTitle: r,
38
38
  rightBottom: n
39
39
  }
@@ -44,10 +44,10 @@ class y {
44
44
  this.p = null, this.operateFn = null;
45
45
  }
46
46
  buildPromise() {
47
- return this.operateFn && this.operateFn.reject("Ignored Reject: reuse"), this.p = new Promise((t, r) => {
47
+ return this.operateFn && this.operateFn.reject("Ignored Reject: reuse"), this.p = new Promise((e, r) => {
48
48
  this.operateFn = {
49
49
  reject: r,
50
- resolve: t
50
+ resolve: e
51
51
  };
52
52
  }), this.p;
53
53
  }
@@ -55,18 +55,22 @@ class y {
55
55
  this.p = null, this.operateFn = null;
56
56
  }
57
57
  /** 兑现回调 */
58
- resolve(t) {
59
- this.operateFn && (this.operateFn.resolve(t), this.clear());
58
+ resolve(e) {
59
+ this.operateFn && (this.operateFn.resolve(e), this.clear());
60
60
  }
61
61
  /** 拒绝回调 */
62
- reject(t) {
63
- this.operateFn && (this.operateFn.reject("Ignored Reject: " + t), this.clear());
62
+ reject(e) {
63
+ this.operateFn && (this.operateFn.reject("Ignored Reject: " + e), this.clear());
64
64
  }
65
65
  }
66
+ function P(t) {
67
+ return typeof t == "number" && t ? `${t}px` : t.toString();
68
+ }
66
69
  export {
67
70
  y as AsyncCallback,
68
71
  h as addRowKeyField,
69
72
  g as delRowKeyField,
70
- m as genRequest,
71
- j as getModalLayoutConfig
73
+ F as genRequest,
74
+ j as getModalLayoutConfig,
75
+ P as toHeight
72
76
  };
@@ -1,9 +1,9 @@
1
- import { CSSProperties, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  type __VLS_Props = {
3
3
  rowHeight?: number;
4
- height?: CSSProperties['height'];
5
- minHeight?: CSSProperties['height'];
6
- maxHeight?: CSSProperties['height'];
4
+ height?: number | string;
5
+ minHeight?: number;
6
+ maxHeight?: number | string;
7
7
  };
8
8
  declare function __VLS_template(): {
9
9
  attrs: Partial<{}>;
@@ -17,9 +17,9 @@ declare function __VLS_template(): {
17
17
  };
18
18
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
19
  declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
- height: import("csstype").Property.Height<string | number>;
21
- maxHeight: import("csstype").Property.Height<string | number>;
22
- minHeight: import("csstype").Property.Height<string | number>;
20
+ height: number | string;
21
+ maxHeight: number | string;
22
+ minHeight: number;
23
23
  rowHeight: number;
24
24
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
25
25
  wrapperContainer: HTMLDivElement;
@@ -1,45 +1,45 @@
1
- import { defineComponent as c, useTemplateRef as g, computed as s, ref as p, watch as d, onMounted as f, createElementBlock as m, openBlock as H, normalizeStyle as v, renderSlot as y } from "vue";
2
- import { LARGER_HEIGHT as w, SMALL_HEIGHT as S } from "../constants.mjs";
3
- import { useAgGridModalInject as _ } from "../hooks/use-ag-grid-instance.mjs";
4
- const E = /* @__PURE__ */ c({
1
+ import { defineComponent as f, useTemplateRef as p, ref as s, watch as c, createElementBlock as H, openBlock as d, normalizeStyle as y, unref as h, renderSlot as v } from "vue";
2
+ import { LARGER_HEIGHT as w, SMALL_HEIGHT as G } from "../constants.mjs";
3
+ import { useAgGridModalInject as A } from "../hooks/use-ag-grid-instance.mjs";
4
+ import { toHeight as r } from "../utils.mjs";
5
+ const k = /* @__PURE__ */ f({
5
6
  __name: "index",
6
7
  props: {
7
8
  rowHeight: { default: 32 },
8
9
  height: { default: void 0 },
9
- minHeight: { default: S },
10
+ minHeight: { default: G },
10
11
  maxHeight: { default: w }
11
12
  },
12
- setup(h) {
13
- const t = h, o = g("wrapperContainer"), u = _(), a = s(
14
- () => u?.dataSourceLength?.value || 0
15
- ), r = p(t.minHeight), l = () => {
16
- const e = o.value?.clientHeight, i = o.value?.querySelector(
13
+ setup(g) {
14
+ const o = g, n = p("wrapperContainer"), m = A(), a = s(r(o.minHeight)), u = (e) => {
15
+ const t = n.value?.clientHeight, l = n.value?.querySelector(
17
16
  ".ag-body.ag-layout-normal"
18
17
  )?.clientHeight;
19
- let n = 0;
20
- !e || !i ? n = 0 : n = e - i, a.value * t.rowHeight > 480 - n && (r.value = t.maxHeight);
18
+ let i = 0;
19
+ !t || !l ? i = 0 : i = t - l, e > o.minHeight - i && (a.value = `min(${e + i}px,${r(o.maxHeight)})`);
21
20
  };
22
- return d(
23
- () => a.value,
24
- () => {
25
- l();
21
+ return c(
22
+ () => m?.agGridBodyHeight?.value,
23
+ (e, t) => {
24
+ e && (!t || e > t) && u(e || 0);
25
+ },
26
+ {
27
+ immediate: !0
26
28
  }
27
- ), f(() => {
28
- l();
29
- }), (e, i) => (H(), m("div", {
29
+ ), (e, t) => (d(), H("div", {
30
30
  ref_key: "wrapperContainer",
31
- ref: o,
32
- style: v({
33
- minHeight: e.height ? "unset" : t.minHeight,
34
- height: e.height ?? r.value,
31
+ ref: n,
32
+ style: y({
33
+ minHeight: e.height === "auto" ? "unset" : h(r)(e.minHeight),
34
+ height: e.height ? h(r)(e.height) : a.value,
35
35
  display: "flex",
36
36
  flexDirection: "column"
37
37
  })
38
38
  }, [
39
- y(e.$slots, "default")
39
+ v(e.$slots, "default")
40
40
  ], 4));
41
41
  }
42
42
  });
43
43
  export {
44
- E as default
44
+ k as default
45
45
  };
@@ -1,2 +1,2 @@
1
- declare const _default: "7.19.8";
1
+ declare const _default: "7.20.1";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "7.19.8";
1
+ const e = "7.20.1";
2
2
  export {
3
3
  e as default
4
4
  };