@aplus-frontend/ui 7.19.8 → 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.
- package/es/src/ag-grid/editable/form-item.vue.mjs +113 -93
- package/es/src/ag-grid/editable/index.vue.mjs +91 -79
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
- package/es/src/ag-grid/index.vue.mjs +124 -120
- package/es/src/ag-grid/interface.d.ts +6 -0
- package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/es/src/business/ag-grid-modal/constants.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +51 -41
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +30 -29
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +46 -45
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -4
- package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/es/src/business/ag-grid-modal/utils.mjs +34 -30
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +6 -0
- package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/constants.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +4 -4
- package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -7
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,50 +1,60 @@
|
|
|
1
|
-
import { cloneDeep as
|
|
2
|
-
import { ref as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
29
|
+
r.value = e, s?.onSelectedRows?.(e);
|
|
20
30
|
}
|
|
21
31
|
);
|
|
22
|
-
const
|
|
23
|
-
setInstance:
|
|
24
|
-
refresh:
|
|
25
|
-
getInstance:
|
|
26
|
-
setSelectedRowKeys:
|
|
27
|
-
getSelectedRows:
|
|
28
|
-
clearAllSelected:
|
|
29
|
-
removeSelected:
|
|
30
|
-
setDataSourceLength:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)
|
|
39
|
-
}), () =>
|
|
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 [
|
|
52
|
+
return [i, m];
|
|
43
53
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
54
|
+
function j() {
|
|
55
|
+
return x(v);
|
|
46
56
|
}
|
|
47
57
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
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
|
|
5
|
-
import { genRequest as
|
|
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
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
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 [
|
|
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
|
-
...
|
|
18
|
-
} = w(t) ? t(
|
|
19
|
-
g(
|
|
20
|
-
const
|
|
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
|
-
},
|
|
25
|
-
g(
|
|
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(
|
|
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?.(
|
|
48
|
+
default: () => [e.value.renderHeader?.(I(r, "setInstance"), {
|
|
49
49
|
updateProps: u
|
|
50
|
-
}), n(
|
|
51
|
-
ref:
|
|
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:
|
|
66
|
-
|
|
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 =
|
|
73
|
-
title:
|
|
74
|
-
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 && (
|
|
80
|
+
t === !1 && (r.setInstance(void 0), r.setDataSourceLength(0), a = null);
|
|
80
81
|
},
|
|
81
82
|
content: n(c, {
|
|
82
|
-
modalConfig:
|
|
83
|
+
modalConfig: o
|
|
83
84
|
}, null),
|
|
84
|
-
...
|
|
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:
|
|
93
|
-
getAgGridInstance:
|
|
93
|
+
refresh: r.refresh,
|
|
94
|
+
getAgGridInstance: r.getInstance,
|
|
94
95
|
updateProps: u
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
L as useAgGridModal
|
|
99
100
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as O, ref as _, createVNode as i, mergeProps as
|
|
2
|
-
import { message as
|
|
3
|
-
import { isFunction as u, cloneDeep as
|
|
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
|
|
5
|
+
import { ApModal as U } from "../../../ap-modal/index.mjs";
|
|
6
6
|
import "../../../config-provider/index.mjs";
|
|
7
|
-
import { ROW_KEY as
|
|
7
|
+
import { ROW_KEY as F } from "../constants.mjs";
|
|
8
8
|
import "../modal-layout/index.vue.mjs";
|
|
9
|
-
import { AsyncCallback as
|
|
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
|
|
20
|
-
t:
|
|
21
|
-
} = Y(), [
|
|
19
|
+
const c = new E(), [S, p] = V(), {
|
|
20
|
+
t: K
|
|
21
|
+
} = Y(), [l, k] = N({
|
|
22
22
|
onSelectedRows(e) {
|
|
23
|
-
|
|
23
|
+
p.setCount(e?.length || 0);
|
|
24
24
|
}
|
|
25
|
-
}), w = W(o.api, o.getRowKey,
|
|
25
|
+
}), w = W(o.api, o.getRowKey, l.setDataSourceLength), y = (e) => {
|
|
26
26
|
const {
|
|
27
27
|
title: t,
|
|
28
|
-
width:
|
|
28
|
+
width: s,
|
|
29
29
|
modalProps: n,
|
|
30
30
|
...a
|
|
31
|
-
} = u(e) ? e(
|
|
31
|
+
} = u(e) ? e(q(o)) : e;
|
|
32
32
|
b(a) || g?.(a);
|
|
33
|
-
const r =
|
|
33
|
+
const r = D({
|
|
34
34
|
title: t,
|
|
35
|
-
width:
|
|
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 =
|
|
40
|
+
const e = o.mergeRule || "old", t = l.getSelectedRows() || [];
|
|
41
41
|
return {
|
|
42
|
-
keys:
|
|
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 ? (
|
|
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
|
-
},
|
|
53
|
+
}, M = () => {
|
|
54
54
|
c.reject("modal is closed!");
|
|
55
|
-
},
|
|
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 = (
|
|
69
|
+
return g = (s) => {
|
|
70
70
|
t.value = {
|
|
71
71
|
...t.value,
|
|
72
|
-
...
|
|
72
|
+
...s
|
|
73
73
|
};
|
|
74
74
|
}, () => {
|
|
75
|
-
const
|
|
76
|
-
return i(
|
|
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(
|
|
83
|
+
default: () => [o.renderHeader?.(x(l, "setInstance"), {
|
|
84
84
|
updateProps: y
|
|
85
85
|
}), i(Q, a.props, {
|
|
86
|
-
default: () => [i(X,
|
|
87
|
-
ref:
|
|
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) ?
|
|
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:
|
|
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(
|
|
108
|
+
return u(n.disabledCheckbox) ? n.disabledCheckbox(r, x(l, "setInstance")) : n.disabledCheckbox ?? !1;
|
|
109
109
|
},
|
|
110
110
|
...o.rowSelection
|
|
111
111
|
},
|
|
112
|
-
autoHeight:
|
|
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(
|
|
123
|
+
return i(v, {
|
|
123
124
|
modalConfig: o,
|
|
124
125
|
selectedRows: e
|
|
125
126
|
}, null);
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function A() {
|
|
128
129
|
const e = Object.values(d || {}), t = C(e);
|
|
129
|
-
f =
|
|
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:
|
|
140
|
-
afterOpenChange(
|
|
141
|
-
|
|
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
|
|
148
|
+
function H(e) {
|
|
148
149
|
return e?.map(m) || [];
|
|
149
150
|
}
|
|
150
|
-
function R(e, t,
|
|
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),
|
|
155
|
+
}, {}), w.setExtraParams(t?.extraParams), A(), s)
|
|
155
156
|
return c.buildPromise();
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function I(e, t) {
|
|
158
159
|
return R(e, t, !0);
|
|
159
160
|
}
|
|
160
|
-
return
|
|
161
|
+
return L(() => {
|
|
161
162
|
c.reject("component is Unmounted!");
|
|
162
163
|
}), {
|
|
163
164
|
open: R,
|
|
164
|
-
asyncOpen:
|
|
165
|
-
refresh:
|
|
166
|
-
getAgGridInstance:
|
|
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 {
|
|
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?:
|
|
23
|
-
minHeight?:
|
|
24
|
-
maxHeight?:
|
|
22
|
+
height?: number | string;
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
maxHeight?: number | string;
|
|
25
25
|
}
|
|
26
26
|
/** 刷新方式 */
|
|
27
27
|
export type RefreshType = 'reset' | 'submit' | 'submitWith';
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { isFunction as p } from "lodash-unified";
|
|
2
|
-
import { ROW_KEY as
|
|
3
|
-
function
|
|
2
|
+
import { ROW_KEY as l } from "./constants.mjs";
|
|
3
|
+
function F(t, e, r) {
|
|
4
4
|
let n = null;
|
|
5
|
-
return { request: async (
|
|
6
|
-
const i =
|
|
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 && (
|
|
13
|
-
const { records:
|
|
14
|
-
return r?.(
|
|
15
|
-
data:
|
|
16
|
-
total:
|
|
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: (
|
|
19
|
-
n =
|
|
18
|
+
}, setExtraParams: (o) => {
|
|
19
|
+
n = o || null;
|
|
20
20
|
} };
|
|
21
21
|
}
|
|
22
|
-
function h(
|
|
23
|
-
return p(
|
|
24
|
-
...
|
|
25
|
-
[
|
|
26
|
-
} :
|
|
22
|
+
function h(t, e) {
|
|
23
|
+
return p(e) ? {
|
|
24
|
+
...t,
|
|
25
|
+
[l]: e(t)
|
|
26
|
+
} : t;
|
|
27
27
|
}
|
|
28
|
-
function g(
|
|
29
|
-
return Reflect.deleteProperty(
|
|
28
|
+
function g(t) {
|
|
29
|
+
return Reflect.deleteProperty(t, l), t;
|
|
30
30
|
}
|
|
31
|
-
function j(
|
|
32
|
-
const { renderSelectedItem:
|
|
31
|
+
function j(t) {
|
|
32
|
+
const { renderSelectedItem: e, rightTitle: r, rightBottom: n, ...s } = t || {};
|
|
33
33
|
return {
|
|
34
|
-
props: { ...
|
|
34
|
+
props: { ...s, layoutType: t && "two-column" },
|
|
35
35
|
slots: {
|
|
36
|
-
renderSelectedItem:
|
|
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((
|
|
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:
|
|
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(
|
|
59
|
-
this.operateFn && (this.operateFn.resolve(
|
|
58
|
+
resolve(e) {
|
|
59
|
+
this.operateFn && (this.operateFn.resolve(e), this.clear());
|
|
60
60
|
}
|
|
61
61
|
/** 拒绝回调 */
|
|
62
|
-
reject(
|
|
63
|
-
this.operateFn && (this.operateFn.reject("Ignored Reject: " +
|
|
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
|
-
|
|
71
|
-
j as getModalLayoutConfig
|
|
73
|
+
F as genRequest,
|
|
74
|
+
j as getModalLayoutConfig,
|
|
75
|
+
P as toHeight
|
|
72
76
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
rowHeight?: number;
|
|
4
|
-
height?:
|
|
5
|
-
minHeight?:
|
|
6
|
-
maxHeight?:
|
|
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:
|
|
21
|
-
maxHeight:
|
|
22
|
-
minHeight:
|
|
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
|
|
2
|
-
import { LARGER_HEIGHT as w, SMALL_HEIGHT as
|
|
3
|
-
import { useAgGridModalInject as
|
|
4
|
-
|
|
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:
|
|
10
|
+
minHeight: { default: G },
|
|
10
11
|
maxHeight: { default: w }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
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
|
|
20
|
-
!
|
|
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
|
|
23
|
-
() =>
|
|
24
|
-
() => {
|
|
25
|
-
|
|
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
|
-
),
|
|
28
|
-
l();
|
|
29
|
-
}), (e, i) => (H(), m("div", {
|
|
29
|
+
), (e, t) => (d(), H("div", {
|
|
30
30
|
ref_key: "wrapperContainer",
|
|
31
|
-
ref:
|
|
32
|
-
style:
|
|
33
|
-
minHeight: e.height ? "unset" :
|
|
34
|
-
height: e.height
|
|
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
|
-
|
|
39
|
+
v(e.$slots, "default")
|
|
40
40
|
], 4));
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
k as default
|
|
45
45
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.
|
|
1
|
+
declare const _default: "7.20.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED