@aplus-frontend/ui 7.19.7 → 7.20.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 (53) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +113 -93
  2. package/es/src/ag-grid/editable/index.vue.mjs +91 -79
  3. package/es/src/ag-grid/editable/interface.d.ts +7 -0
  4. package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
  5. package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
  6. package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
  7. package/es/src/ag-grid/index.vue.mjs +124 -120
  8. package/es/src/ag-grid/interface.d.ts +6 -0
  9. package/es/src/ap-button/ap-button.vue.mjs +23 -23
  10. package/es/src/ap-button/interface.d.ts +1 -1
  11. package/es/src/ap-button/utils/index.d.ts +1 -1
  12. package/es/src/ap-button/utils/index.mjs +7 -7
  13. package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
  14. package/es/src/business/ag-grid-modal/constants.mjs +1 -1
  15. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
  16. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +51 -41
  17. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +33 -30
  18. package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +71 -68
  19. package/es/src/business/ag-grid-modal/interface.d.ts +4 -2
  20. package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
  21. package/es/src/business/ag-grid-modal/utils.mjs +34 -30
  22. package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
  23. package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -23
  24. package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
  25. package/es/src/version.d.ts +1 -1
  26. package/es/src/version.mjs +1 -1
  27. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  28. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  29. package/lib/src/ag-grid/editable/interface.d.ts +7 -0
  30. package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
  31. package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
  32. package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
  33. package/lib/src/ag-grid/index.vue.js +1 -1
  34. package/lib/src/ag-grid/interface.d.ts +6 -0
  35. package/lib/src/ap-button/ap-button.vue.js +1 -1
  36. package/lib/src/ap-button/interface.d.ts +1 -1
  37. package/lib/src/ap-button/utils/index.d.ts +1 -1
  38. package/lib/src/ap-button/utils/index.js +1 -1
  39. package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
  40. package/lib/src/business/ag-grid-modal/constants.js +1 -1
  41. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
  42. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
  43. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
  44. package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
  45. package/lib/src/business/ag-grid-modal/interface.d.ts +4 -2
  46. package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
  47. package/lib/src/business/ag-grid-modal/utils.js +1 -1
  48. package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
  49. package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
  50. package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
  51. package/lib/src/version.d.ts +1 -1
  52. package/lib/src/version.js +1 -1
  53. package/package.json +1 -1
@@ -3,36 +3,36 @@ import { omit as a } from "lodash-unified";
3
3
  function f(o) {
4
4
  return typeof o == "object" && typeof o.then == "function" ? o : !1;
5
5
  }
6
- const m = (o) => typeof o == "function" && f(o?.()), h = (o, c = "0.7") => {
6
+ const m = (o, n) => typeof o == "function" && f(o?.(n)), h = (o, n = "0.7") => {
7
7
  try {
8
8
  let t = o?.toLowerCase();
9
9
  if (t && /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) {
10
10
  if (t.length === 4) {
11
11
  let e = "#";
12
- for (let n = 1; n < 4; n += 1)
13
- e += t.slice(n, n + 1).concat(t.slice(n, n + 1));
12
+ for (let c = 1; c < 4; c += 1)
13
+ e += t.slice(c, c + 1).concat(t.slice(c, c + 1));
14
14
  t = e;
15
15
  }
16
16
  const r = [];
17
17
  for (let e = 1; e < 7; e += 2)
18
18
  r.push(parseInt("0x" + t.slice(e, e + 2)));
19
- return "rgba(" + r.join(",") + "," + c + ")";
19
+ return "rgba(" + r.join(",") + "," + n + ")";
20
20
  }
21
21
  if (t && t.startsWith("rgb")) {
22
22
  let r = t.match(/(\d(\.\d+)?)+/g);
23
- return r = r?.slice(0, 3)?.concat(c), "rgba(" + r.join(",") + ")";
23
+ return r = r?.slice(0, 3)?.concat(n), "rgba(" + r.join(",") + ")";
24
24
  }
25
25
  return t;
26
26
  } catch {
27
27
  return;
28
28
  }
29
29
  }, p = (o) => {
30
- const { onOk: c = () => ({}) } = o;
30
+ const { onOk: n = () => ({}) } = o;
31
31
  return new Promise((t, s) => {
32
32
  i.confirm({
33
33
  onOk: async () => {
34
34
  try {
35
- await c(), t(!0);
35
+ await n(), t(!0);
36
36
  } catch (r) {
37
37
  s(r);
38
38
  }
@@ -1,4 +1,4 @@
1
1
  /** 非字符串增加key值字段 */
2
2
  export declare const ROW_KEY = "__ag-grid-modal-row-key";
3
- export declare const SMALL_HEIGHT = "480px";
3
+ export declare const SMALL_HEIGHT = 480;
4
4
  export declare const LARGER_HEIGHT = "calc(100vh - 200px)";
@@ -1,4 +1,4 @@
1
- const o = "__ag-grid-modal-row-key", c = "480px", _ = "calc(100vh - 200px)";
1
+ const o = "__ag-grid-modal-row-key", c = 480, _ = "calc(100vh - 200px)";
2
2
  export {
3
3
  _ as LARGER_HEIGHT,
4
4
  o as ROW_KEY,
@@ -1,4 +1,5 @@
1
- import { ComputedRef } from 'vue';
1
+ import { GridApi as AgGridApi } from 'ag-grid-community';
2
+ import { ComputedRef, Ref } from 'vue';
2
3
  import { AgGridExpose } from '../../../ag-grid';
3
4
  import { RefreshType } from '../interface';
4
5
  interface Options {
@@ -22,10 +23,13 @@ export interface GridApi {
22
23
  removeSelected: (record: any) => void;
23
24
  /** 设置表格数据length */
24
25
  setDataSourceLength: (len: number) => void;
26
+ /** 获取表格高度 */
27
+ onAgGridUpdate(api: AgGridApi<any> | undefined): void;
25
28
  }
26
29
  interface GridApiProvider extends GridApi {
27
30
  selectedRows?: ComputedRef<any[]>;
28
- dataSourceLength?: ComputedRef<number>;
31
+ dataSourceLength?: Readonly<Ref<number>>;
32
+ agGridBodyHeight?: Readonly<Ref<number>>;
29
33
  }
30
34
  export declare function useAgGridInstance(options?: Options): [GridApi, any];
31
35
  /** 获取上下文中grid的api */
@@ -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) => {
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
- }, w = (e) => {
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(
17
- () => t.value?.rowSelection.selectedRows.value,
1
+ import { cloneDeep as I } from "lodash-unified";
2
+ import { ref as c, watch as g, defineComponent as D, provide as H, toRef as l, inject as x } from "vue";
3
+ const v = /* @__PURE__ */ Symbol("ag-grid-provider-key");
4
+ function _(s) {
5
+ const o = c(), r = c(), a = c(0), d = c(0), w = (e) => {
6
+ o.value = e;
7
+ }, S = (e) => {
8
+ a.value = e;
9
+ }, f = () => o.value, h = (e = "reset") => {
10
+ o.value && e in o.value && o.value[e]();
11
+ }, R = (e) => {
12
+ o.value?.rowSelection.setSelectedRowKeys(e);
13
+ }, p = () => I(o.value?.rowSelection.selectedRows.value), A = () => o.value?.rowSelection.clearAll(), y = (e) => o.value?.rowSelection.unSelectRows([e]), G = (e) => {
14
+ if (!e) return;
15
+ const t = e.getDisplayedRowCount();
16
+ if (console.log("onAgGridUpdate", t), t > 0) {
17
+ const n = e.getDisplayedRowAtIndex(t - 1);
18
+ if (n && n.rowTop && n.rowHeight) {
19
+ const u = n.rowTop + n.rowHeight;
20
+ console.log("height", u), d.value = u;
21
+ }
22
+ }
23
+ };
24
+ g(o, (e) => {
25
+ e && s?.onMounted?.();
26
+ }), g(
27
+ () => o.value?.rowSelection.selectedRows.value,
18
28
  (e) => {
19
- c.value = e, n?.onSelectedRows?.(e);
29
+ r.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: w,
34
+ refresh: h,
35
+ getInstance: f,
36
+ setSelectedRowKeys: R,
37
+ getSelectedRows: p,
38
+ clearAllSelected: A,
39
+ removeSelected: y,
40
+ setDataSourceLength: S,
41
+ onAgGridUpdate: G
42
+ }, m = D({
43
+ setup(e, { slots: t }) {
44
+ return H(v, {
45
+ ...i,
46
+ selectedRows: l(() => r.value),
47
+ dataSourceLength: l(() => a.value),
48
+ agGridBodyHeight: l(() => d.value)
49
+ }), () => t.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(v);
46
56
  }
47
57
  export {
48
- L as useAgGridInstance,
49
- _ as useAgGridModalInject
58
+ _ as useAgGridInstance,
59
+ j as useAgGridModalInject
50
60
  };
@@ -1,29 +1,29 @@
1
- import { defineComponent as C, ref as P, createVNode as n, mergeProps as w } from "vue";
2
- import { isFunction as y, isEmpty as f, omitBy as I, isUndefined as A, omit as H } from "lodash-unified";
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 A, omit as I } from "lodash-unified";
3
3
  import "../../../ag-grid/index.mjs";
4
4
  import { ApModal as M } from "../../../ap-modal/index.mjs";
5
- import { genRequest as _ } from "../utils.mjs";
5
+ import { genRequest as x } from "../utils.mjs";
6
6
  import "../wrapper/index.vue.mjs";
7
- import { useAgGridInstance as q } from "./use-ag-grid-instance.mjs";
8
- import G from "../wrapper/index.vue2.mjs";
9
- import x 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, c] = q(), s = _(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
17
  ...d
18
- } = y(t) ? t(r) : t;
19
- f(d) || l?.(d);
20
- const m = I({
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
24
  }, A);
25
- f(m) || a?.update(m);
26
- }, g = /* @__PURE__ */ C({
25
+ g(m) || a?.update(m);
26
+ }, c = /* @__PURE__ */ C({
27
27
  name: "AgGridModalPreviewContent",
28
28
  props: {
29
29
  modalConfig: {
@@ -38,15 +38,17 @@ function j(r) {
38
38
  ...e.value,
39
39
  ...i
40
40
  };
41
- }, () => n(c, null, {
42
- default: () => [n(G, {
41
+ }, () => n(f, null, {
42
+ default: () => [n(_, {
43
43
  height: e.value.height,
44
- rowHeight: e.value.rowHeight
44
+ rowHeight: e.value.rowHeight,
45
+ minHeight: e.value.minHeight,
46
+ maxHeight: e.value.maxHeight
45
47
  }, {
46
- default: () => [e.value.renderHeader?.(H(o, "setInstance"), {
48
+ default: () => [e.value.renderHeader?.(I(r, "setInstance"), {
47
49
  updateProps: u
48
- }), n(x, w({
49
- ref: o.setInstance,
50
+ }), n(q, H({
51
+ ref: r.setInstance,
50
52
  searchForm: {
51
53
  sortable: !1,
52
54
  resize: {
@@ -60,26 +62,27 @@ function j(r) {
60
62
  },
61
63
  rowHeight: e.value.rowHeight,
62
64
  columns: e.value.columns,
63
- autoHeight: !!e.value.height
64
- }, r.gridProps), e.value.gridSlots)]
65
+ autoHeight: e.value.height === "auto",
66
+ onModelUpdated: r.onAgGridUpdate
67
+ }, o.gridProps), e.value.gridSlots)]
65
68
  })]
66
69
  });
67
70
  }
68
71
  });
69
72
  function h() {
70
73
  a = M.createModal({
71
- title: r.title,
72
- width: r.width,
74
+ title: o.title,
75
+ width: o.width,
73
76
  destroyOnClose: !0,
74
77
  maskClosable: !1,
75
78
  footer: null,
76
79
  afterOpenChange(t) {
77
- t === !1 && (o.setInstance(void 0), o.setDataSourceLength(0), a = null);
80
+ t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
78
81
  },
79
- content: n(g, {
80
- modalConfig: r
82
+ content: n(c, {
83
+ modalConfig: o
81
84
  }, null),
82
- ...r.modalProps || {}
85
+ ...o.modalProps || {}
83
86
  });
84
87
  }
85
88
  function p(t) {
@@ -87,11 +90,11 @@ function j(r) {
87
90
  }
88
91
  return {
89
92
  open: p,
90
- refresh: o.refresh,
91
- getAgGridInstance: o.getInstance,
93
+ refresh: r.refresh,
94
+ getAgGridInstance: r.getInstance,
92
95
  updateProps: u
93
96
  };
94
97
  }
95
98
  export {
96
- j as useAgGridModal
99
+ L as useAgGridModal
97
100
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as _, ref as H, 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 S } 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";
@@ -14,45 +14,45 @@ import { useLocale as Y } from "../../../config-provider/hooks/use-locale.mjs";
14
14
  import J from "../wrapper/index.vue2.mjs";
15
15
  import Q from "../modal-layout/index.vue2.mjs";
16
16
  import X from "../../../ag-grid/index.vue.mjs";
17
- function we(t) {
17
+ function we(o) {
18
18
  let d, f = null, g = null;
19
- const c = new U(), [x, 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(t.api, t.getRowKey, s.setDataSourceLength), y = (e) => {
25
+ }), w = W(o.api, o.getRowKey, l.setDataSourceLength), y = (e) => {
26
26
  const {
27
- title: o,
28
- width: l,
27
+ title: t,
28
+ width: s,
29
29
  modalProps: n,
30
30
  ...a
31
- } = u(e) ? e(D(t)) : e;
31
+ } = u(e) ? e(q(o)) : e;
32
32
  b(a) || g?.(a);
33
- const r = G({
34
- title: o,
35
- width: l,
33
+ const r = D({
34
+ title: t,
35
+ width: s,
36
36
  modalProps: n
37
37
  }, T);
38
38
  b(r) || f?.update(r);
39
- }, m = u(t.getRowKey) ? t.getRowKey : (e) => e[t.getRowKey], P = () => {
40
- const e = t.mergeRule || "old", o = s.getSelectedRows() || [];
39
+ }, m = u(o.getRowKey) ? o.getRowKey : (e) => e[o.getRowKey], P = () => {
40
+ const e = o.mergeRule || "old", t = l.getSelectedRows() || [];
41
41
  return {
42
- keys: A(o),
43
- rows: o.map((a) => {
42
+ keys: H(t),
43
+ rows: t.map((a) => {
44
44
  const r = m(a);
45
45
  return e === "old" && d?.[r] ? d[r] : $(a);
46
46
  })
47
47
  };
48
48
  }, h = async () => {
49
- const e = P(), o = t.maxCount || 1 / 0;
50
- return e.keys.length > o ? (q.warning(k("ap.apTableModal.messageMaxCount", {
51
- maxCount: o
52
- })), Promise.reject()) : (await t.beforeOk?.(e), t.finishCallback?.(e), c.resolve(e), e);
49
+ const e = P(), t = o.maxCount || 1 / 0;
50
+ return e.keys.length > t ? (j.warning(K("ap.apTableModal.messageMaxCount", {
51
+ maxCount: t
52
+ })), Promise.reject()) : (await o.beforeOk?.(e), o.finishCallback?.(e), c.resolve(e), e);
53
53
  }, M = () => {
54
54
  c.reject("modal is closed!");
55
- }, I = /* @__PURE__ */ _({
55
+ }, v = /* @__PURE__ */ O({
56
56
  name: "AgGridModalSelectContent",
57
57
  props: {
58
58
  modalConfig: {
@@ -65,31 +65,33 @@ function we(t) {
65
65
  }
66
66
  },
67
67
  setup(e) {
68
- const o = H(e.modalConfig);
69
- return g = (l) => {
70
- o.value = {
71
- ...o.value,
72
- ...l
68
+ const t = _(e.modalConfig);
69
+ return g = (s) => {
70
+ t.value = {
71
+ ...t.value,
72
+ ...s
73
73
  };
74
74
  }, () => {
75
- const l = e.selectedRows?.map((r) => z(r, o.value.getRowKey)), n = o.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
- rowHeight: n.rowHeight
79
+ rowHeight: n.rowHeight,
80
+ minHeight: t.value.minHeight,
81
+ maxHeight: t.value.maxHeight
80
82
  }, {
81
- default: () => [t.renderHeader?.(S(s, "setInstance"), {
83
+ default: () => [o.renderHeader?.(x(l, "setInstance"), {
82
84
  updateProps: y
83
85
  }), i(Q, a.props, {
84
- default: () => [i(X, L({
85
- ref: s.setInstance,
86
+ default: () => [i(X, G({
87
+ ref: l.setInstance,
86
88
  searchForm: {
87
89
  sortable: !1,
88
90
  resize: {
89
91
  target: "form"
90
92
  }
91
93
  },
92
- rowKey: u(n.getRowKey) ? E : n.getRowKey,
94
+ rowKey: u(n.getRowKey) ? F : n.getRowKey,
93
95
  request: w.request,
94
96
  style: {
95
97
  padding: "0px"
@@ -97,18 +99,19 @@ function we(t) {
97
99
  rowHeight: n.rowHeight,
98
100
  columns: n.columns,
99
101
  rowSelection: {
100
- defaultSelectedRows: l,
102
+ defaultSelectedRows: s,
101
103
  preserveSelectedRowKeys: !0,
102
104
  type: n.mode || "checkbox",
103
105
  fixed: "left",
104
106
  columnWidth: 38,
105
107
  disabled(r) {
106
- return u(n.disabledCheckbox) ? n.disabledCheckbox(r, S(s, "setInstance")) : n.disabledCheckbox ?? !1;
108
+ return u(n.disabledCheckbox) ? n.disabledCheckbox(r, x(l, "setInstance")) : n.disabledCheckbox ?? !1;
107
109
  },
108
- ...t.rowSelection
110
+ ...o.rowSelection
109
111
  },
110
- autoHeight: !!o.value.height
111
- }, t.gridProps), n.gridSlots)],
112
+ autoHeight: t.value.height === "auto",
113
+ onModelUpdated: l.onAgGridUpdate
114
+ }, o.gridProps), n.gridSlots)],
112
115
  ...a.slots
113
116
  })]
114
117
  })]
@@ -117,51 +120,51 @@ function we(t) {
117
120
  }
118
121
  });
119
122
  function C(e) {
120
- return i(I, {
121
- modalConfig: t,
123
+ return i(v, {
124
+ modalConfig: o,
122
125
  selectedRows: e
123
126
  }, null);
124
127
  }
125
- function v() {
126
- const e = Object.values(d || {}), o = C(e);
127
- f = F.createModal({
128
- title: i(x, {
129
- title: t.title,
130
- maxCount: t.maxCount || 1 / 0,
131
- isShowDefaultSuffix: t.mode !== "radio"
132
- }, t.modalTitleSlots),
133
- width: t.width,
128
+ function A() {
129
+ const e = Object.values(d || {}), t = C(e);
130
+ f = U.createModal({
131
+ title: i(S, {
132
+ title: o.title,
133
+ maxCount: o.maxCount || 1 / 0,
134
+ isShowDefaultSuffix: o.mode !== "radio"
135
+ }, o.modalTitleSlots),
136
+ width: o.width,
134
137
  destroyOnClose: !0,
135
138
  maskClosable: !1,
136
139
  onOk: h,
137
140
  onCancel: M,
138
- afterOpenChange(l) {
139
- l === !1 && (s.setInstance(void 0), s.setDataSourceLength(0));
141
+ afterOpenChange(s) {
142
+ s === !1 && (l.setInstance(void 0), l.setDataSourceLength(0));
140
143
  },
141
- content: o,
142
- ...t.modalProps || {}
144
+ content: t,
145
+ ...o.modalProps || {}
143
146
  });
144
147
  }
145
- function A(e) {
148
+ function H(e) {
146
149
  return e?.map(m) || [];
147
150
  }
148
- function R(e, o, l = !1) {
151
+ function R(e, t, s = !1) {
149
152
  if (d = e?.reduce((n, a) => {
150
153
  const r = m(a);
151
154
  return n[r] = a, n;
152
- }, {}), w.setExtraParams(o?.extraParams), v(), l)
155
+ }, {}), w.setExtraParams(t?.extraParams), A(), s)
153
156
  return c.buildPromise();
154
157
  }
155
- function O(e, o) {
156
- return R(e, o, !0);
158
+ function I(e, t) {
159
+ return R(e, t, !0);
157
160
  }
158
- return j(() => {
161
+ return L(() => {
159
162
  c.reject("component is Unmounted!");
160
163
  }), {
161
164
  open: R,
162
- asyncOpen: O,
163
- refresh: s.refresh,
164
- getAgGridInstance: s.getInstance,
165
+ asyncOpen: I,
166
+ refresh: l.refresh,
167
+ getAgGridInstance: l.getInstance,
165
168
  genContent: C,
166
169
  validate: h,
167
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,7 +19,9 @@ export interface AgGridModalBasicProps<TableRowType = any> {
19
19
  updateProps: UpdatePropsFn<TableRowType>;
20
20
  }) => VNodeChild;
21
21
  rowHeight?: number;
22
- height?: CSSProperties['height'];
22
+ height?: number | string;
23
+ minHeight?: number;
24
+ maxHeight?: number | string;
23
25
  }
24
26
  /** 刷新方式 */
25
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
  };