@gx-design-vue/pro-table 0.2.0-alpha.13 → 0.2.0-alpha.15
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/dist/ProTable.js +9 -0
- package/dist/components/ScrollBar/Thumb.d.ts +1 -1
- package/dist/components/SearchForm/FormItemWrapper.d.ts +2 -2
- package/dist/components/SearchForm/SearchForm.d.ts +3 -3
- package/dist/components/Toolbar/ListToolBar.d.ts +8 -8
- package/dist/components/Toolbar/index.d.ts +5 -5
- package/dist/hooks/useTable.js +10 -5
- package/dist/pro-table.esm.js +217 -205
- package/dist/pro-table.js +1 -1
- package/package.json +4 -4
package/dist/pro-table.esm.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { createInjectionState as e, useBreakpoints as t, useDebounceFn as n, useElementSize as r, useEventListener as i, useFullscreen as a, useMutationObserver as o, useResizeObserver as s, useScroll as c, useWindowSize as l } from "@vueuse/core";
|
|
2
|
-
import { Comment as u, Fragment as d, Teleport as f, Text as p, computed as m, createVNode as h, defineComponent as g, getCurrentInstance as _, h as v, isVNode as y, mergeDefaults as b, mergeProps as x, nextTick as S, onActivated as C, onBeforeUnmount as w, onDeactivated as T, onMounted as E, onScopeDispose as D, onUnmounted as
|
|
2
|
+
import { Comment as u, Fragment as d, Teleport as f, Text as p, computed as m, createVNode as h, defineComponent as g, getCurrentInstance as _, h as v, isVNode as y, mergeDefaults as b, mergeProps as x, nextTick as S, onActivated as C, onBeforeUnmount as w, onDeactivated as T, onMounted as E, onScopeDispose as D, onUnmounted as ee, reactive as O, ref as k, shallowRef as A, toRaw as j, toRef as M, toValue as N, unref as te, watch as P, watchEffect as ne } from "vue";
|
|
3
3
|
import { proGenStyleHooks as re, unit as F, useProConfigContext as ie } from "@gx-design-vue/pro-provider";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useBaseConfig as
|
|
6
|
-
import
|
|
7
|
-
import { GIcon as
|
|
4
|
+
import { Button as ae, Cascader as I, DatePicker as L, Input as oe, InputNumber as R, Pagination as z, Select as se, SpaceCompact as ce, Spin as le, Table as ue, TimePicker as de, Tooltip as fe, TreeSelect as pe } from "antdv-next";
|
|
5
|
+
import { useBaseConfig as me } from "antdv-next/config-provider/context";
|
|
6
|
+
import he from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
7
|
+
import { GIcon as B } from "@gx-design-vue/icon";
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
|
-
var
|
|
10
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
9
|
+
var ge = Object.create, _e = Object.defineProperty, ve = Object.getOwnPropertyDescriptor, ye = Object.getOwnPropertyNames, be = Object.getPrototypeOf, xe = Object.prototype.hasOwnProperty, Se = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Ce = (e, t, n, r) => {
|
|
10
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = ye(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !xe.call(e, s) && s !== n && _e(e, s, {
|
|
11
11
|
get: ((e) => t[e]).bind(null, s),
|
|
12
|
-
enumerable: !(r =
|
|
12
|
+
enumerable: !(r = ve(t, s)) || r.enumerable
|
|
13
13
|
});
|
|
14
14
|
return e;
|
|
15
|
-
},
|
|
15
|
+
}, V = (e, t, n) => (n = e == null ? {} : ge(be(e)), Ce(t || !e || !e.__esModule ? _e(n, "default", {
|
|
16
16
|
value: e,
|
|
17
17
|
enumerable: !0
|
|
18
|
-
}) : n, e)), [
|
|
18
|
+
}) : n, e)), [we, Te] = e((e) => e), Ee = [
|
|
19
19
|
{
|
|
20
20
|
breakpoint: "xxl",
|
|
21
21
|
span: 4
|
|
@@ -40,7 +40,7 @@ var me = Object.create, he = Object.defineProperty, ge = Object.getOwnPropertyDe
|
|
|
40
40
|
breakpoint: "xs",
|
|
41
41
|
span: 1
|
|
42
42
|
}
|
|
43
|
-
],
|
|
43
|
+
], De = {
|
|
44
44
|
xs: 0,
|
|
45
45
|
sm: 576,
|
|
46
46
|
md: 768,
|
|
@@ -48,8 +48,8 @@ var me = Object.create, he = Object.defineProperty, ge = Object.getOwnPropertyDe
|
|
|
48
48
|
xl: 1200,
|
|
49
49
|
xxl: 1600
|
|
50
50
|
};
|
|
51
|
-
function
|
|
52
|
-
let e = t(
|
|
51
|
+
function Oe() {
|
|
52
|
+
let e = t(De), { width: n } = l(), r = m(() => ({
|
|
53
53
|
xs: e.isGreaterOrEqual("xs"),
|
|
54
54
|
sm: e.isGreaterOrEqual("sm"),
|
|
55
55
|
md: e.isGreaterOrEqual("md"),
|
|
@@ -58,7 +58,7 @@ function De() {
|
|
|
58
58
|
xxl: e.isGreaterOrEqual("xxl")
|
|
59
59
|
})), i = m(() => !r.value.xl);
|
|
60
60
|
function a(e, t) {
|
|
61
|
-
return t && typeof t == "object" && Object.keys(t).length > 0 ?
|
|
61
|
+
return t && typeof t == "object" && Object.keys(t).length > 0 ? H(t, n.value) : ke(e, r.value);
|
|
62
62
|
}
|
|
63
63
|
return {
|
|
64
64
|
screens: r,
|
|
@@ -67,7 +67,7 @@ function De() {
|
|
|
67
67
|
getRowItemsPerBreakpoint: a
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function H(e, t) {
|
|
71
71
|
let n = 4, r = Object.keys(e).map(Number).filter((e) => !Number.isNaN(e)).sort((e, t) => t - e);
|
|
72
72
|
for (let i of r) if (e[i] && t >= i) {
|
|
73
73
|
n = e[i];
|
|
@@ -75,12 +75,12 @@ function U(e, t) {
|
|
|
75
75
|
}
|
|
76
76
|
return n;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ke(e, t) {
|
|
79
79
|
let n = 4;
|
|
80
|
-
for (let r = 0; r <
|
|
81
|
-
let i =
|
|
80
|
+
for (let r = 0; r < Ee.length; r += 1) {
|
|
81
|
+
let i = Ee[r].breakpoint;
|
|
82
82
|
if (t[i]) {
|
|
83
|
-
n = e?.[i] ??
|
|
83
|
+
n = e?.[i] ?? Ee[r].span;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -88,30 +88,30 @@ function Oe(e, t) {
|
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region ../pro-utils/dist/is/nil.js
|
|
91
|
-
function
|
|
91
|
+
function Ae(e) {
|
|
92
92
|
return e == null;
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region ../pro-utils/dist/function/object.js
|
|
96
|
-
function
|
|
96
|
+
function je(e) {
|
|
97
97
|
return Object.getOwnPropertySymbols(e);
|
|
98
98
|
}
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region ../pro-utils/dist/is/type.js
|
|
101
|
-
function
|
|
101
|
+
function Me(e, t) {
|
|
102
102
|
return Object.prototype.toString.call(e) === `[object ${t}]`;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ne(e) {
|
|
105
105
|
return typeof e == "boolean";
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function U(e) {
|
|
108
108
|
return typeof e == "number";
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function W(e) {
|
|
111
111
|
return Array.isArray === void 0 ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
112
112
|
}
|
|
113
113
|
function G(e) {
|
|
114
|
-
return e !== null &&
|
|
114
|
+
return e !== null && Me(e, "Object");
|
|
115
115
|
}
|
|
116
116
|
function Pe(e) {
|
|
117
117
|
return typeof e == "string";
|
|
@@ -229,7 +229,7 @@ function K(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
|
229
229
|
return e;
|
|
230
230
|
}
|
|
231
231
|
function q(e, t, n = e, r, i) {
|
|
232
|
-
let a = [...Object.keys(t), ...
|
|
232
|
+
let a = [...Object.keys(t), ...je(t)];
|
|
233
233
|
for (let o = 0; o < a.length; o++) {
|
|
234
234
|
let s = a[o], c = Object.getOwnPropertyDescriptor(e, s);
|
|
235
235
|
(c == null || c.writable) && (e[s] = K(t[s], s, n, r, i));
|
|
@@ -285,7 +285,7 @@ function J(...e) {
|
|
|
285
285
|
let r = e[n];
|
|
286
286
|
if (r) {
|
|
287
287
|
if (Pe(r)) t.push(r);
|
|
288
|
-
else if (
|
|
288
|
+
else if (W(r)) for (let e = 0; e < r.length; e++) {
|
|
289
289
|
let n = J(r[e]);
|
|
290
290
|
n && t.push(n);
|
|
291
291
|
}
|
|
@@ -384,7 +384,7 @@ function bt(e, t) {
|
|
|
384
384
|
}
|
|
385
385
|
//#endregion
|
|
386
386
|
//#region src/utils/valueFormat.ts
|
|
387
|
-
var Y = /* @__PURE__ */
|
|
387
|
+
var Y = /* @__PURE__ */ V((/* @__PURE__ */ Se(((e, t) => {
|
|
388
388
|
(function(n, r) {
|
|
389
389
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
390
390
|
})(e, (function() {
|
|
@@ -680,7 +680,7 @@ var Y = /* @__PURE__ */ Se((/* @__PURE__ */ be(((e, t) => {
|
|
|
680
680
|
}));
|
|
681
681
|
})))(), 1);
|
|
682
682
|
function xt(e, t, n = {}) {
|
|
683
|
-
if (
|
|
683
|
+
if (Ae(e) || e === "" || !t || t === "text") return e;
|
|
684
684
|
if (G(t) && !Array.isArray(t)) {
|
|
685
685
|
let n = t, r = n.node ?? "span";
|
|
686
686
|
return v(r === "a" ? "span" : r, {
|
|
@@ -770,7 +770,7 @@ function Nt(e) {
|
|
|
770
770
|
return [...e].sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
|
|
771
771
|
}
|
|
772
772
|
function Pt(e) {
|
|
773
|
-
let t =
|
|
773
|
+
let t = A(null), n = P(() => e.columns.value, () => {
|
|
774
774
|
t.value = null;
|
|
775
775
|
});
|
|
776
776
|
D(() => n());
|
|
@@ -805,7 +805,7 @@ function It() {
|
|
|
805
805
|
}
|
|
806
806
|
},
|
|
807
807
|
setup(e, { slots: t, attrs: n }) {
|
|
808
|
-
let r =
|
|
808
|
+
let r = A(!1), i = A(!1), a = A(0), o = A(0);
|
|
809
809
|
function s(t) {
|
|
810
810
|
t.preventDefault(), t.stopPropagation(), r.value = !0, i.value = !1, a.value = t.clientX, o.value = e.width || t.currentTarget?.parentElement?.offsetWidth || 0;
|
|
811
811
|
function n(t) {
|
|
@@ -840,7 +840,7 @@ function It() {
|
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
842
|
function Lt(e) {
|
|
843
|
-
let t =
|
|
843
|
+
let t = A(/* @__PURE__ */ new Map());
|
|
844
844
|
function n(e, n) {
|
|
845
845
|
let r = new Map(t.value);
|
|
846
846
|
r.set(e, n.size.width), t.value = r;
|
|
@@ -872,7 +872,7 @@ function Lt(e) {
|
|
|
872
872
|
//#region src/hooks/useFetchData.ts
|
|
873
873
|
var Rt = [];
|
|
874
874
|
function zt(e, t) {
|
|
875
|
-
let { rowKey: r, polling: i, pollingTime: a, request: o, postData: s, dataSource: c, immediate: l, waitRequest: u, autoRequest: d, debounceTime: f, params: p, defaultFormSearch: h, onLoadingChange: g, onRequestError: _, onBeforeSearchSubmit: v } = e, { pageInfo: y, paginationInfo: b, setPagination: x, setLoading: S, setColumns: w, removeRowKeys: E, syncSelectedRows: D, columns:
|
|
875
|
+
let { rowKey: r, polling: i, pollingTime: a, request: o, postData: s, dataSource: c, immediate: l, waitRequest: u, autoRequest: d, debounceTime: f, params: p, defaultFormSearch: h, onLoadingChange: g, onRequestError: _, onBeforeSearchSubmit: v } = e, { pageInfo: y, paginationInfo: b, setPagination: x, setLoading: S, setColumns: w, removeRowKeys: E, syncSelectedRows: D, columns: O } = t, A = k([]), M = k(!1), N = k(null), te = k(null), ne = k("");
|
|
876
876
|
function re(e) {
|
|
877
877
|
g && g(e);
|
|
878
878
|
}
|
|
@@ -882,33 +882,33 @@ function zt(e, t) {
|
|
|
882
882
|
function ie() {
|
|
883
883
|
F();
|
|
884
884
|
}
|
|
885
|
-
function
|
|
886
|
-
if (
|
|
885
|
+
function ae(e) {
|
|
886
|
+
if (M.value || !i.value) return;
|
|
887
887
|
let t = Math.max(a.value || 2e3, 2e3);
|
|
888
888
|
F(), N.value = setTimeout(() => {
|
|
889
|
-
|
|
889
|
+
z({
|
|
890
890
|
...e,
|
|
891
891
|
isPolling: !0
|
|
892
892
|
});
|
|
893
893
|
}, t);
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function I() {
|
|
896
896
|
te.value?.abort(), te.value = null;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
if (
|
|
898
|
+
function L(e) {
|
|
899
|
+
if (A.value = ze(e, j(y)), !o || !Fe(o)) {
|
|
900
900
|
let t = e.length || 0;
|
|
901
901
|
t !== y.total && x({ total: t });
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
async function
|
|
904
|
+
async function oe(e = {}) {
|
|
905
905
|
let { pagination: t = {}, filters: n = {}, sorter: r = {}, removeKeys: i = [], isPolling: a = !1, extra: l } = e;
|
|
906
906
|
if (!o || !Fe(o)) return c.value || [];
|
|
907
907
|
a || (S(!0), re(!0)), t && Object.keys(t).length && x(t);
|
|
908
908
|
try {
|
|
909
909
|
i.length && E(i);
|
|
910
|
-
let t = G(r) && Object.keys(r).length ? [r] :
|
|
911
|
-
w &&
|
|
910
|
+
let t = G(r) && Object.keys(r).length ? [r] : W(r) ? r : [];
|
|
911
|
+
w && O && w(O.value.map((e) => {
|
|
912
912
|
let n = t.find((t) => (t?.columnKey || t?.field) === e.dataIndex);
|
|
913
913
|
return {
|
|
914
914
|
...e,
|
|
@@ -918,10 +918,10 @@ function zt(e, t) {
|
|
|
918
918
|
let a = {
|
|
919
919
|
...b.value === !1 ? {} : {
|
|
920
920
|
pageSize: y.pageSize,
|
|
921
|
-
current: bt(
|
|
921
|
+
current: bt(j(y), i.length)
|
|
922
922
|
},
|
|
923
|
-
...
|
|
924
|
-
...
|
|
923
|
+
...j(h.value),
|
|
924
|
+
...j(p.value),
|
|
925
925
|
...e.params || {}
|
|
926
926
|
};
|
|
927
927
|
v && Fe(v) && (a = await v({
|
|
@@ -946,44 +946,44 @@ function zt(e, t) {
|
|
|
946
946
|
let { success: t = !0, data: n = [] } = d;
|
|
947
947
|
if (!t) return [];
|
|
948
948
|
let r = typeof s == "function" ? s(n) : n, i = d.total || r.length || 0;
|
|
949
|
-
return i !== y.total && x({ total: i }),
|
|
949
|
+
return i !== y.total && x({ total: i }), L(r), D(r), ae(e), r;
|
|
950
950
|
}
|
|
951
951
|
return [];
|
|
952
952
|
} catch (e) {
|
|
953
953
|
if (e.name === "AbortError") return [];
|
|
954
|
-
if (_) return
|
|
954
|
+
if (_) return A.value === void 0 && L([]), _(e), [];
|
|
955
955
|
throw e;
|
|
956
956
|
} finally {
|
|
957
957
|
a || (S(!1), re(!1));
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
let
|
|
961
|
-
function
|
|
962
|
-
|
|
960
|
+
let R = n((e) => oe(e), () => f.value ?? 10);
|
|
961
|
+
function z(e = {}) {
|
|
962
|
+
I(), R(e);
|
|
963
963
|
}
|
|
964
964
|
C(() => {
|
|
965
|
-
|
|
966
|
-
}),
|
|
967
|
-
|
|
965
|
+
M.value = !1;
|
|
966
|
+
}), ee(() => {
|
|
967
|
+
M.value = !0, I(), ie();
|
|
968
968
|
}), T(() => {
|
|
969
|
-
|
|
969
|
+
M.value = !0, I(), ie();
|
|
970
970
|
}), P(() => c.value, (e) => {
|
|
971
|
-
e && !Fe(o) &&
|
|
971
|
+
e && !Fe(o) && L(e);
|
|
972
972
|
}, {
|
|
973
973
|
deep: !0,
|
|
974
974
|
immediate: !0
|
|
975
975
|
}), P(() => p.value, () => {
|
|
976
|
-
u.value || d.value && (x({ current: 1 }),
|
|
976
|
+
u.value || d.value && (x({ current: 1 }), z({ isPolling: !1 }));
|
|
977
977
|
}, { deep: !0 }), P(() => h.value, (e, t) => {
|
|
978
|
-
u.value || e !== t && (x({ current: 1 }),
|
|
978
|
+
u.value || e !== t && (x({ current: 1 }), z({ isPolling: !1 }));
|
|
979
979
|
}, { deep: !0 }), P(() => i.value, () => {
|
|
980
|
-
u.value || (i.value ?
|
|
980
|
+
u.value || (i.value ? z({ isPolling: !0 }) : ie());
|
|
981
981
|
}), P(() => u.value, (e) => {
|
|
982
|
-
e ? (S(!0), re(!0)) : l.value &&
|
|
983
|
-
}), !u.value && l.value &&
|
|
984
|
-
let
|
|
985
|
-
function
|
|
986
|
-
|
|
982
|
+
e ? (S(!0), re(!0)) : l.value && z({ isPolling: !1 });
|
|
983
|
+
}), !u.value && l.value && z({ isPolling: !1 });
|
|
984
|
+
let se = m(() => A.value.some((e) => W(e.children) && e.children.length > 0));
|
|
985
|
+
function ce(e, t = {}, n = {}, r) {
|
|
986
|
+
z({
|
|
987
987
|
pagination: e,
|
|
988
988
|
filters: t,
|
|
989
989
|
sorter: n,
|
|
@@ -991,40 +991,40 @@ function zt(e, t) {
|
|
|
991
991
|
isPolling: !1
|
|
992
992
|
});
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function le(e) {
|
|
995
995
|
let { key: t, row: n, value: i, type: a = "update" } = e, o = t ?? r.value, s = n?.[o] ?? i;
|
|
996
996
|
switch (!n && a !== "delete" && console.warn("row is required"), a) {
|
|
997
997
|
case "update":
|
|
998
|
-
o && s && n && (
|
|
998
|
+
o && s && n && (A.value = A.value.map((e) => s === e[o] ? dt({}, e, n) : e));
|
|
999
999
|
break;
|
|
1000
1000
|
case "push":
|
|
1001
|
-
n &&
|
|
1001
|
+
n && A.value.push(n);
|
|
1002
1002
|
break;
|
|
1003
1003
|
case "unshift":
|
|
1004
|
-
n &&
|
|
1004
|
+
n && A.value.unshift(n);
|
|
1005
1005
|
break;
|
|
1006
1006
|
case "delete":
|
|
1007
|
-
o && (
|
|
1007
|
+
o && (A.value = A.value.filter((e) => i !== e[o]));
|
|
1008
1008
|
break;
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1012
|
-
u.value || (o ?
|
|
1011
|
+
function ue(e) {
|
|
1012
|
+
u.value || (o ? z({
|
|
1013
1013
|
...e,
|
|
1014
1014
|
isPolling: !1
|
|
1015
|
-
}) :
|
|
1015
|
+
}) : L(c.value || []));
|
|
1016
1016
|
}
|
|
1017
|
-
function
|
|
1018
|
-
|
|
1017
|
+
function de(e) {
|
|
1018
|
+
ue(e);
|
|
1019
1019
|
}
|
|
1020
1020
|
return {
|
|
1021
|
-
dataSource: m(() =>
|
|
1022
|
-
isTreeDataRef:
|
|
1023
|
-
setTableDataList:
|
|
1024
|
-
operateTableDataRow:
|
|
1025
|
-
handleTableChange:
|
|
1026
|
-
run:
|
|
1027
|
-
reload:
|
|
1021
|
+
dataSource: m(() => A.value.length ? A.value : Rt),
|
|
1022
|
+
isTreeDataRef: se,
|
|
1023
|
+
setTableDataList: L,
|
|
1024
|
+
operateTableDataRow: le,
|
|
1025
|
+
handleTableChange: ce,
|
|
1026
|
+
run: ue,
|
|
1027
|
+
reload: de
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
//#endregion
|
|
@@ -1057,7 +1057,7 @@ function Gt(e) {
|
|
|
1057
1057
|
return (Number.parseFloat(t.marginTop) || 0) + (Number.parseFloat(t.marginBottom) || 0);
|
|
1058
1058
|
}
|
|
1059
1059
|
function Kt(e) {
|
|
1060
|
-
let { fitPage: t, cardEl: n, prefixCls: i } = e, a =
|
|
1060
|
+
let { fitPage: t, cardEl: n, prefixCls: i } = e, a = k(), l = k(), u = k(), d = k(), f = k(), p = k(), h = {
|
|
1061
1061
|
toolbarEl: l,
|
|
1062
1062
|
headerEl: u,
|
|
1063
1063
|
pageEl: d,
|
|
@@ -1103,7 +1103,7 @@ function qt(e) {
|
|
|
1103
1103
|
_() ? C(e) : S(e);
|
|
1104
1104
|
}
|
|
1105
1105
|
function Jt(e) {
|
|
1106
|
-
let t =
|
|
1106
|
+
let t = k(!1);
|
|
1107
1107
|
return qt(() => {
|
|
1108
1108
|
t.value ? e.enabled.value && e.reload() : t.value = !0;
|
|
1109
1109
|
}), { hasActivated: t };
|
|
@@ -1111,10 +1111,10 @@ function Jt(e) {
|
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
//#region src/hooks/useLoading.ts
|
|
1113
1113
|
function Yt(e, t = !1) {
|
|
1114
|
-
return
|
|
1114
|
+
return Ne(e) ? e : G(e) ? e.spinning ?? t : t;
|
|
1115
1115
|
}
|
|
1116
1116
|
function Xt(e) {
|
|
1117
|
-
let t =
|
|
1117
|
+
let t = k(Yt(e.loading.value));
|
|
1118
1118
|
P(() => e.loading.value, (n) => {
|
|
1119
1119
|
let r = Yt(n, t.value);
|
|
1120
1120
|
r !== t.value && (t.value = r, e.onChange?.(r));
|
|
@@ -1142,7 +1142,7 @@ var Zt = {
|
|
|
1142
1142
|
]
|
|
1143
1143
|
};
|
|
1144
1144
|
function Qt({ pagination: e }) {
|
|
1145
|
-
let t =
|
|
1145
|
+
let t = k({ ...Zt }), n = O({
|
|
1146
1146
|
current: Zt.current,
|
|
1147
1147
|
pageSize: Zt.pageSize,
|
|
1148
1148
|
total: 0
|
|
@@ -1162,7 +1162,7 @@ function Qt({ pagination: e }) {
|
|
|
1162
1162
|
immediate: !0
|
|
1163
1163
|
});
|
|
1164
1164
|
function r(e) {
|
|
1165
|
-
|
|
1165
|
+
U(e.current) && (n.current = e.current), U(e.pageSize) && (n.pageSize = e.pageSize), U(e.total) && (n.total = e.total);
|
|
1166
1166
|
}
|
|
1167
1167
|
function i(e) {
|
|
1168
1168
|
t.value !== !1 && (t.value = dt({}, t.value, e), r(e));
|
|
@@ -1184,7 +1184,7 @@ function Qt({ pagination: e }) {
|
|
|
1184
1184
|
//#endregion
|
|
1185
1185
|
//#region src/hooks/useRequestOptions.ts
|
|
1186
1186
|
function $t(e) {
|
|
1187
|
-
let t =
|
|
1187
|
+
let t = k([]), r = k(!1), i = k("idle"), a = n(async () => {
|
|
1188
1188
|
if (e.fetch) {
|
|
1189
1189
|
r.value = !0, i.value = "loading";
|
|
1190
1190
|
try {
|
|
@@ -1198,7 +1198,7 @@ function $t(e) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
1200
1200
|
}, e.debounceTime ?? 10);
|
|
1201
|
-
return e.fetch && !e.manual && a(),
|
|
1201
|
+
return e.fetch && !e.manual && a(), ee(() => {
|
|
1202
1202
|
t.value = [], r.value = !1;
|
|
1203
1203
|
}), {
|
|
1204
1204
|
optionList: t,
|
|
@@ -1213,7 +1213,7 @@ function X(e, t) {
|
|
|
1213
1213
|
return e[t];
|
|
1214
1214
|
}
|
|
1215
1215
|
function en(e) {
|
|
1216
|
-
let t =
|
|
1216
|
+
let t = O(/* @__PURE__ */ new Map()), n = P(() => e.rowSelection.value?.selectedRowKeys, (n) => {
|
|
1217
1217
|
if (!n) return;
|
|
1218
1218
|
let r = /* @__PURE__ */ new Map(), i = e.dataSource.value;
|
|
1219
1219
|
for (let a of n) {
|
|
@@ -1283,12 +1283,16 @@ function en(e) {
|
|
|
1283
1283
|
//#region src/hooks/useTable.ts
|
|
1284
1284
|
var tn = [];
|
|
1285
1285
|
function nn(e, t) {
|
|
1286
|
-
let n =
|
|
1286
|
+
let n = O({
|
|
1287
|
+
params: {},
|
|
1288
|
+
searchMap: []
|
|
1289
|
+
}), r = /* @__PURE__ */ new Set();
|
|
1287
1290
|
function i(e = {}) {
|
|
1288
|
-
let
|
|
1289
|
-
for (let
|
|
1290
|
-
|
|
1291
|
-
|
|
1291
|
+
for (let t of r) t in e || (delete n[t], r.delete(t));
|
|
1292
|
+
for (let t of Object.keys(e)) {
|
|
1293
|
+
let i = e[t];
|
|
1294
|
+
i !== n[t] && (n[t] = i), r.add(t);
|
|
1295
|
+
}
|
|
1292
1296
|
t?.request && (n.request = t.request);
|
|
1293
1297
|
}
|
|
1294
1298
|
P(() => N(t?.state), (e) => {
|
|
@@ -1300,7 +1304,7 @@ function nn(e, t) {
|
|
|
1300
1304
|
let a = m(() => e.value?.actionRef?.() ?? {}), o = m(() => e.value?.formRef?.() ?? {}), s = m(() => ({
|
|
1301
1305
|
...a.value?.pageInfo || {},
|
|
1302
1306
|
...o.value?.getFormSearch?.() || {}
|
|
1303
|
-
})), c =
|
|
1307
|
+
})), c = k(!1);
|
|
1304
1308
|
P(() => a.value?.loading?.value, (e) => {
|
|
1305
1309
|
c.value = !!e;
|
|
1306
1310
|
}), P(c, (e) => {
|
|
@@ -1381,15 +1385,15 @@ function on(e) {
|
|
|
1381
1385
|
order: e.searchConfig.order ?? e.order ?? 0
|
|
1382
1386
|
}));
|
|
1383
1387
|
return rn([...e, ...r]);
|
|
1384
|
-
}), i = m(() => an(r.value)), a =
|
|
1388
|
+
}), i = m(() => an(r.value)), a = k({});
|
|
1385
1389
|
P(() => i.value, (e) => {
|
|
1386
|
-
a.value = ut(
|
|
1390
|
+
a.value = ut(j(e));
|
|
1387
1391
|
}, {
|
|
1388
1392
|
deep: !0,
|
|
1389
1393
|
immediate: !0
|
|
1390
1394
|
});
|
|
1391
1395
|
function o() {
|
|
1392
|
-
let e = ut(
|
|
1396
|
+
let e = ut(j(a.value));
|
|
1393
1397
|
for (let t of r.value) {
|
|
1394
1398
|
let n = t.valueType ?? "text", r = t.name;
|
|
1395
1399
|
if (n === "text" && (e[r] = a.value[r] ?? t.initialValue), n === "dateRange" && (t.rangeStartName || t.rangeEndName)) {
|
|
@@ -1412,7 +1416,7 @@ function on(e) {
|
|
|
1412
1416
|
return e;
|
|
1413
1417
|
}
|
|
1414
1418
|
function s() {
|
|
1415
|
-
let e = ut(
|
|
1419
|
+
let e = ut(j(i.value));
|
|
1416
1420
|
a.value = e;
|
|
1417
1421
|
for (let t of r.value) if (t.valueType === "dateRange" && (t.rangeStartName || t.rangeEndName)) {
|
|
1418
1422
|
let n = t.rangeStartName || "start", r = t.rangeEndName || "end", i = e[n], o = e[r];
|
|
@@ -1557,7 +1561,7 @@ var bn = /* @__PURE__ */ g({
|
|
|
1557
1561
|
}
|
|
1558
1562
|
},
|
|
1559
1563
|
setup(e) {
|
|
1560
|
-
let t = Ut(), n =
|
|
1564
|
+
let t = Ut(), n = k(), r = k(), a = k({}), o = k(!1), s = !1, c = !1, l = 0, u = 0, d = m(() => vn[e.vertical ? "vertical" : "horizontal"]), f = m(() => yn({
|
|
1561
1565
|
size: e.size,
|
|
1562
1566
|
move: e.move,
|
|
1563
1567
|
bar: d.value
|
|
@@ -1640,7 +1644,7 @@ var bn = /* @__PURE__ */ g({
|
|
|
1640
1644
|
}
|
|
1641
1645
|
},
|
|
1642
1646
|
setup(e, { expose: t }) {
|
|
1643
|
-
let n = Ut(), r =
|
|
1647
|
+
let n = Ut(), r = k(0), i = k(0), a = k(""), o = k(""), s = k(1), c = k(1);
|
|
1644
1648
|
function l(e) {
|
|
1645
1649
|
if (!e) return;
|
|
1646
1650
|
let t = e.offsetHeight - 4, n = e.offsetWidth - 4;
|
|
@@ -1857,9 +1861,9 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1857
1861
|
}, [e.collapseRender(e.collapsed)]) : h("span", {
|
|
1858
1862
|
class: `${e.prefixCls}-search-control-text`,
|
|
1859
1863
|
onClick: () => e.onToggle(!e.collapsed)
|
|
1860
|
-
}, [e.collapsed ? "展开" : "收起", e.collapsed ? h(
|
|
1864
|
+
}, [e.collapsed ? "展开" : "收起", e.collapsed ? h(B, { type: "DownOutlined" }, null) : h(B, { type: "UpOutlined" }, null)]);
|
|
1861
1865
|
}
|
|
1862
|
-
}), { RangePicker: $n } =
|
|
1866
|
+
}), { RangePicker: $n } = L, er = /* @__PURE__ */ g({
|
|
1863
1867
|
name: "ProTableFormItemContainer",
|
|
1864
1868
|
props: {
|
|
1865
1869
|
prefixCls: {
|
|
@@ -1912,15 +1916,15 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1912
1916
|
allowClear: e.record.allowClear ?? !0,
|
|
1913
1917
|
...t
|
|
1914
1918
|
};
|
|
1915
|
-
return e.autoRequest ? h(
|
|
1919
|
+
return e.autoRequest ? h(oe.Search, x(n, {
|
|
1916
1920
|
onSearch: () => e.onSubmit?.(),
|
|
1917
1921
|
onChange: (t) => {
|
|
1918
1922
|
e.formState[e.record.name] = t.target?.value ?? t;
|
|
1919
1923
|
}
|
|
1920
|
-
}), null) : h(
|
|
1924
|
+
}), null) : h(oe, x(n, { onChange: (e) => i(e.target?.value ?? e) }), null);
|
|
1921
1925
|
}
|
|
1922
1926
|
function o() {
|
|
1923
|
-
return h(
|
|
1927
|
+
return h(R, x({
|
|
1924
1928
|
style: { width: "100%" },
|
|
1925
1929
|
value: e.formState[e.record.name],
|
|
1926
1930
|
placeholder: e.record.placeholder || "请输入",
|
|
@@ -1929,17 +1933,17 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1929
1933
|
}
|
|
1930
1934
|
function s() {
|
|
1931
1935
|
let t = e.record.name, n = e.formState[t], a = Array.isArray(e.record.placeholder) ? e.record.placeholder : ["请输入", "请输入"];
|
|
1932
|
-
return h(
|
|
1936
|
+
return h(ce, {
|
|
1933
1937
|
class: `${e.prefixCls}-search-input-compact`,
|
|
1934
1938
|
style: { width: "100%" }
|
|
1935
1939
|
}, { default: () => [
|
|
1936
|
-
h(
|
|
1940
|
+
h(R, {
|
|
1937
1941
|
value: n?.[0],
|
|
1938
1942
|
placeholder: a[0] || "请输入",
|
|
1939
1943
|
onChange: (e) => i(e, { key: 0 }),
|
|
1940
1944
|
style: r
|
|
1941
1945
|
}, null),
|
|
1942
|
-
h(
|
|
1946
|
+
h(oe, {
|
|
1943
1947
|
disabled: !0,
|
|
1944
1948
|
value: "~",
|
|
1945
1949
|
class: `${e.prefixCls}-number-range-separator`,
|
|
@@ -1949,7 +1953,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1949
1953
|
pointerEvents: "none"
|
|
1950
1954
|
}
|
|
1951
1955
|
}, null),
|
|
1952
|
-
h(
|
|
1956
|
+
h(R, {
|
|
1953
1957
|
value: n?.[1],
|
|
1954
1958
|
placeholder: a[1] || "请输入",
|
|
1955
1959
|
onChange: (e) => i(e, { key: 1 }),
|
|
@@ -1959,7 +1963,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1959
1963
|
}
|
|
1960
1964
|
function c() {
|
|
1961
1965
|
let r = e.record.loading || n.value, a = e.record.request ? t.value : e.record.valueEnum || [], o = e.record.field ?? {};
|
|
1962
|
-
return h(
|
|
1966
|
+
return h(se, x({
|
|
1963
1967
|
style: { width: "100%" },
|
|
1964
1968
|
value: r ? void 0 : e.formState[e.record.name],
|
|
1965
1969
|
optionFilterProp: "label",
|
|
@@ -1973,7 +1977,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1973
1977
|
}
|
|
1974
1978
|
function l() {
|
|
1975
1979
|
let r = e.record.field ?? {}, a = e.record.loading || n.value;
|
|
1976
|
-
return h(
|
|
1980
|
+
return h(pe, x({
|
|
1977
1981
|
style: { width: "100%" },
|
|
1978
1982
|
value: e.formState[e.record.name],
|
|
1979
1983
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -1985,7 +1989,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1985
1989
|
}
|
|
1986
1990
|
function u() {
|
|
1987
1991
|
let r = e.record.field ?? {}, a = e.record.loading || n.value;
|
|
1988
|
-
return h(
|
|
1992
|
+
return h(I, x({
|
|
1989
1993
|
style: { width: "100%" },
|
|
1990
1994
|
value: e.formState[e.record.name],
|
|
1991
1995
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -1997,7 +2001,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
1997
2001
|
}
|
|
1998
2002
|
function d() {
|
|
1999
2003
|
let t = Xn(e.record.valueFormat, e.record.showTime);
|
|
2000
|
-
return h(
|
|
2004
|
+
return h(L, x({
|
|
2001
2005
|
style: { width: "100%" },
|
|
2002
2006
|
value: e.formState[e.record.name] ? (0, Y.default)(e.formState[e.record.name]) : void 0,
|
|
2003
2007
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -2009,7 +2013,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
2009
2013
|
}
|
|
2010
2014
|
function f(t, n, r) {
|
|
2011
2015
|
let a = e.formState[e.record.name];
|
|
2012
|
-
return h(
|
|
2016
|
+
return h(L, x({
|
|
2013
2017
|
style: { width: "100%" },
|
|
2014
2018
|
picker: t,
|
|
2015
2019
|
value: a ? (0, Y.default)(a, n) : void 0,
|
|
@@ -2033,7 +2037,7 @@ var Qn = /* @__PURE__ */ g({
|
|
|
2033
2037
|
}
|
|
2034
2038
|
function m() {
|
|
2035
2039
|
let t = e.record.valueFormat || "HH:mm:ss";
|
|
2036
|
-
return h(
|
|
2040
|
+
return h(de, x({
|
|
2037
2041
|
style: { width: "100%" },
|
|
2038
2042
|
value: e.formState[e.record.name] ? (0, Y.default)(e.formState[e.record.name], t) : void 0,
|
|
2039
2043
|
placeholder: e.record.placeholder || "请选择",
|
|
@@ -2181,16 +2185,16 @@ var rr = /* @__PURE__ */ g({
|
|
|
2181
2185
|
}
|
|
2182
2186
|
},
|
|
2183
2187
|
setup(e, { slots: t, expose: n }) {
|
|
2184
|
-
let r =
|
|
2188
|
+
let r = k(e.formConfig?.collapsed ?? e.formConfig?.defaultCollapsed);
|
|
2185
2189
|
P(() => e.formConfig?.collapsed, (e) => {
|
|
2186
2190
|
r.value = e;
|
|
2187
2191
|
});
|
|
2188
|
-
let { getRowItemsPerBreakpoint: i } =
|
|
2192
|
+
let { getRowItemsPerBreakpoint: i } = Oe(), a = m(() => e.formConfig), o = m(() => e.formAutoRequest), s = m(() => e.formActions), c = m(() => {
|
|
2189
2193
|
if (a.value?.breakpoint && G(a.value.breakpoint) && Object.keys(a.value.breakpoint).length > 0) return a.value.breakpoint;
|
|
2190
2194
|
}), l = m(() => i(a.value?.span, c.value)), u = m(() => {
|
|
2191
2195
|
let e = a.value?.gap;
|
|
2192
2196
|
return typeof e == "number" ? `${e}px` : e ?? "16px";
|
|
2193
|
-
}), d = m(() => a.value?.label), f = m(() =>
|
|
2197
|
+
}), d = m(() => a.value?.label), f = m(() => Ne(s.value?.reset) ? s.value.reset : !o.value);
|
|
2194
2198
|
function p(t, n, r) {
|
|
2195
2199
|
let i = n.name, a = n.valueType ?? "text", o = t;
|
|
2196
2200
|
switch (a) {
|
|
@@ -2232,7 +2236,7 @@ var rr = /* @__PURE__ */ g({
|
|
|
2232
2236
|
break;
|
|
2233
2237
|
case "dateRange": {
|
|
2234
2238
|
let e = Xn(n.valueFormat, n.showTime);
|
|
2235
|
-
o = t &&
|
|
2239
|
+
o = t && W(t) && t.length === 2 ? Zn(t, e, "string") : null;
|
|
2236
2240
|
break;
|
|
2237
2241
|
}
|
|
2238
2242
|
case "time":
|
|
@@ -2266,7 +2270,7 @@ var rr = /* @__PURE__ */ g({
|
|
|
2266
2270
|
}
|
|
2267
2271
|
if (r === "numberRange") {
|
|
2268
2272
|
let e = t[i];
|
|
2269
|
-
t[i] = Array.isArray(e) && e.some((e) =>
|
|
2273
|
+
t[i] = Array.isArray(e) && e.some((e) => U(e)) ? e : void 0;
|
|
2270
2274
|
}
|
|
2271
2275
|
}
|
|
2272
2276
|
return t;
|
|
@@ -2335,15 +2339,15 @@ var rr = /* @__PURE__ */ g({
|
|
|
2335
2339
|
}, D = () => !f.value && o.value ? null : h("div", {
|
|
2336
2340
|
class: [`${e.prefixCls}-search-buttons`, e.proClasses.searchButtons],
|
|
2337
2341
|
style: e.proStyles.searchButtons
|
|
2338
|
-
}, [f.value && h(
|
|
2342
|
+
}, [f.value && h(ae, {
|
|
2339
2343
|
key: "reset",
|
|
2340
2344
|
onClick: x
|
|
2341
|
-
}, { default: () => [s.value?.resetText || "重置"] }), !o.value && h(
|
|
2345
|
+
}, { default: () => [s.value?.resetText || "重置"] }), !o.value && h(ae, {
|
|
2342
2346
|
key: "submit",
|
|
2343
2347
|
type: "primary",
|
|
2344
2348
|
loading: typeof e.loading == "boolean" ? e.loading : !1,
|
|
2345
2349
|
onClick: v
|
|
2346
|
-
}, { default: () => [s.value?.searchText || "查询"] })]),
|
|
2350
|
+
}, { default: () => [s.value?.searchText || "查询"] })]), ee = (t, n) => {
|
|
2347
2351
|
if (a.value?.collapseRender === !1 && !D()) return null;
|
|
2348
2352
|
let r = D();
|
|
2349
2353
|
return !t && !r ? null : h("div", {
|
|
@@ -2359,11 +2363,11 @@ var rr = /* @__PURE__ */ g({
|
|
|
2359
2363
|
prefixCls: e.prefixCls,
|
|
2360
2364
|
onToggle: S
|
|
2361
2365
|
}, null)])]);
|
|
2362
|
-
},
|
|
2366
|
+
}, O = e.cardBordered ? `${e.prefixCls}-search-border` : "", k = b <= m || !w ? b : Math.max(m - 1, 0);
|
|
2363
2367
|
return h("div", {
|
|
2364
|
-
class: J(e.proClasses.search, `${e.prefixCls}-search`,
|
|
2368
|
+
class: J(e.proClasses.search, `${e.prefixCls}-search`, O, a.value?.className),
|
|
2365
2369
|
style: e.proStyles.search
|
|
2366
|
-
}, [c.slice(0,
|
|
2370
|
+
}, [c.slice(0, k).map((e, t) => E(e, t)), ee(T, w)]);
|
|
2367
2371
|
};
|
|
2368
2372
|
}
|
|
2369
2373
|
});
|
|
@@ -2389,7 +2393,7 @@ var ar = /* @__PURE__ */ g({
|
|
|
2389
2393
|
}
|
|
2390
2394
|
},
|
|
2391
2395
|
setup(e) {
|
|
2392
|
-
return () => h(
|
|
2396
|
+
return () => h(fe, { title: e.isFullscreen ? "退出全屏" : "全屏" }, { default: () => [h("span", { onClick: e.onToggle }, [e.isFullscreen ? h(B, { type: "FullscreenExitOutlined" }, null) : h(B, { type: "FullscreenOutlined" }, null)])] });
|
|
2393
2397
|
}
|
|
2394
2398
|
});
|
|
2395
2399
|
//#endregion
|
|
@@ -2398,7 +2402,7 @@ function or(e) {
|
|
|
2398
2402
|
if (y(e)) return e;
|
|
2399
2403
|
if (!e) return null;
|
|
2400
2404
|
let { icon: t, tooltip: n, onClick: r, key: i } = e;
|
|
2401
|
-
return t && n ? h(
|
|
2405
|
+
return t && n ? h(fe, {
|
|
2402
2406
|
title: n,
|
|
2403
2407
|
key: i
|
|
2404
2408
|
}, { default: () => [h("span", {
|
|
@@ -2462,7 +2466,7 @@ var sr = /* @__PURE__ */ g({
|
|
|
2462
2466
|
}, [t.value && h("div", {
|
|
2463
2467
|
class: [`${o}-list-toolbar-title`, e.proClasses.toolbarTitle],
|
|
2464
2468
|
style: e.proStyles.toolbarTitle
|
|
2465
|
-
}, [e.headerTitle, e.headerTitleTip && h(
|
|
2469
|
+
}, [e.headerTitle, e.headerTitleTip && h(fe, { title: e.titleTipText }, { default: () => [typeof e.headerTitleTip == "boolean" ? h(B, { type: "InfoCircleOutlined" }, null) : e.headerTitleTip] })]), n.value.length > 0 && h("div", { class: `${o}-list-toolbar-actions` }, [n.value])]) : a.value ? h("div", {
|
|
2466
2470
|
class: `${o}-list-toolbar-left`,
|
|
2467
2471
|
style: e.proStyles.toolbarLeft
|
|
2468
2472
|
}, null) : null, c = a.value ? h("div", {
|
|
@@ -2532,7 +2536,7 @@ var lr = /* @__PURE__ */ g({
|
|
|
2532
2536
|
}
|
|
2533
2537
|
},
|
|
2534
2538
|
setup(e) {
|
|
2535
|
-
let t =
|
|
2539
|
+
let t = Te(), n = m(() => {
|
|
2536
2540
|
if (e.options === !1) return [];
|
|
2537
2541
|
let n = cr(e.options) ? e.options : {}, r = [];
|
|
2538
2542
|
if (n.reload !== !1) {
|
|
@@ -2540,10 +2544,10 @@ var lr = /* @__PURE__ */ g({
|
|
|
2540
2544
|
if (typeof n.reload == "function") {
|
|
2541
2545
|
let t = n.reload(e);
|
|
2542
2546
|
t && r.push(t);
|
|
2543
|
-
} else r.push(h(
|
|
2547
|
+
} else r.push(h(fe, {
|
|
2544
2548
|
title: "刷新",
|
|
2545
2549
|
key: "reload"
|
|
2546
|
-
}, { default: () => [h("span", { onClick: e }, [h(
|
|
2550
|
+
}, { default: () => [h("span", { onClick: e }, [h(B, { type: "ReloadOutlined" }, null)])] }));
|
|
2547
2551
|
}
|
|
2548
2552
|
return n.fullScreen !== !1 && (typeof n.fullScreen == "function" ? r.push(h(ar, {
|
|
2549
2553
|
key: "fullscreen",
|
|
@@ -2938,45 +2942,45 @@ var gr = (e) => {
|
|
|
2938
2942
|
"classes",
|
|
2939
2943
|
"styles"
|
|
2940
2944
|
], Sr = /* @__PURE__ */ g((e, { attrs: t, slots: n, emit: r, expose: i }) => {
|
|
2941
|
-
let { prefixCls: o } =
|
|
2945
|
+
let { prefixCls: o } = me("pro-table", e), s = he(o), [c, l] = yr(o, s), u = ie(), p = k(), { toggle: g, isFullscreen: _ } = a(p);
|
|
2942
2946
|
P(_, (e) => {
|
|
2943
2947
|
r("fullscreenChange", e);
|
|
2944
2948
|
});
|
|
2945
|
-
let v = m(() => J(o.value, c.value, l.value, s.value, t.class, e.proClasses?.root,
|
|
2949
|
+
let v = m(() => J(o.value, c.value, l.value, s.value, t.class, e.proClasses?.root, Ne.value)), y = m(() => [e.proStyles?.root, t.style]), { isMobile: b, screenWidth: S, screens: C } = Oe(), { paginationInfo: w, paginationAlign: T, requestPagination: E, setPagination: D } = Qt({ pagination: M(e, "pagination") }), { tableSize: ee, setTableSize: O } = _n({
|
|
2946
2950
|
size: m(() => e.size),
|
|
2947
2951
|
onChange: (e) => r("sizeChange", e)
|
|
2948
|
-
}), { loading:
|
|
2952
|
+
}), { loading: A, setLoading: j } = Xt({
|
|
2949
2953
|
loading: m(() => e.loading),
|
|
2950
2954
|
onChange: (t) => e.onLoadingChange?.(t)
|
|
2951
|
-
}), { selectedRowKeys: N, selectedItems: te, mergedRowSelection: ne, select: re, selectAll: F, remove:
|
|
2955
|
+
}), { selectedRowKeys: N, selectedItems: te, mergedRowSelection: ne, select: re, selectAll: F, remove: ae, clear: I, sync: L } = en({
|
|
2952
2956
|
rowKey: m(() => e.rowKey),
|
|
2953
2957
|
rowSelection: m(() => e.rowSelection),
|
|
2954
2958
|
dataSource: m(() => e.dataSource ?? [])
|
|
2955
|
-
}),
|
|
2959
|
+
}), oe = m(() => At(e.columns ?? [], e.indexColumn, e.align ?? "left")), { tableScroll: R, shouldFixActionColumn: se } = mn({
|
|
2956
2960
|
scroll: m(() => e.scroll),
|
|
2957
|
-
columns:
|
|
2961
|
+
columns: oe,
|
|
2958
2962
|
rowSelection: m(() => e.rowSelection),
|
|
2959
2963
|
screens: C,
|
|
2960
2964
|
screenWidth: S,
|
|
2961
2965
|
scrollPolicy: m(() => e.scrollPolicy)
|
|
2962
|
-
}), { tableColumns:
|
|
2966
|
+
}), { tableColumns: ce, cacheColumns: de, setColumns: fe } = Pt({
|
|
2963
2967
|
columns: m(() => e.columns ?? []),
|
|
2964
2968
|
align: m(() => e.align ?? "left"),
|
|
2965
2969
|
indexColumn: m(() => e.indexColumn),
|
|
2966
|
-
shouldFixActionColumn:
|
|
2970
|
+
shouldFixActionColumn: se,
|
|
2967
2971
|
wrapColumnRender: Ct({
|
|
2968
2972
|
columnEmptyText: m(() => e.columnEmptyText),
|
|
2969
2973
|
prefixCls: o
|
|
2970
2974
|
}).wrapColumnRender
|
|
2971
|
-
}), { resizableColumns:
|
|
2972
|
-
columns:
|
|
2975
|
+
}), { resizableColumns: pe, resizableComponents: B } = Lt({
|
|
2976
|
+
columns: ce,
|
|
2973
2977
|
onResize: (e, t) => r("resizeColumn", e, t)
|
|
2974
|
-
}),
|
|
2978
|
+
}), ge = m(() => e.form === !1 ? void 0 : e.form), _e = m(() => e.form === !1 ? e.autoRequest ?? !0 : e.form?.autoRequest ?? e.autoRequest ?? !0), ve = m(() => {
|
|
2975
2979
|
if (e.form !== !1) return e.form?.actions;
|
|
2976
|
-
}), { formColumns:
|
|
2980
|
+
}), { formColumns: ye, defaultFormSearch: be, formState: xe, getFormSearch: Se, resetFormState: Ce } = on({
|
|
2977
2981
|
searchMap: m(() => e.searchMap ?? []),
|
|
2978
2982
|
columns: m(() => e.columns ?? [])
|
|
2979
|
-
}), { dataSource:
|
|
2983
|
+
}), { dataSource: V, setTableDataList: Te, operateTableDataRow: Ee, handleTableChange: De, reload: H, run: ke } = zt({
|
|
2980
2984
|
rowKey: m(() => e.rowKey),
|
|
2981
2985
|
polling: m(() => e.polling ?? !1),
|
|
2982
2986
|
pollingTime: m(() => e.pollingTime ?? 2e3),
|
|
@@ -2988,7 +2992,7 @@ var gr = (e) => {
|
|
|
2988
2992
|
autoRequest: m(() => e.autoRequest ?? !0),
|
|
2989
2993
|
debounceTime: m(() => e.debounceTime ?? 10),
|
|
2990
2994
|
params: m(() => e.params),
|
|
2991
|
-
defaultFormSearch:
|
|
2995
|
+
defaultFormSearch: be,
|
|
2992
2996
|
onLoadingChange: e.onLoadingChange,
|
|
2993
2997
|
onRequestError: e.onRequestError,
|
|
2994
2998
|
onBeforeSearchSubmit: e.onBeforeSearchSubmit
|
|
@@ -2996,44 +3000,44 @@ var gr = (e) => {
|
|
|
2996
3000
|
pageInfo: E,
|
|
2997
3001
|
paginationInfo: w,
|
|
2998
3002
|
setPagination: D,
|
|
2999
|
-
setLoading:
|
|
3000
|
-
setColumns:
|
|
3001
|
-
removeRowKeys:
|
|
3002
|
-
syncSelectedRows:
|
|
3003
|
-
columns:
|
|
3003
|
+
setLoading: j,
|
|
3004
|
+
setColumns: fe,
|
|
3005
|
+
removeRowKeys: ae,
|
|
3006
|
+
syncSelectedRows: L,
|
|
3007
|
+
columns: de
|
|
3004
3008
|
});
|
|
3005
3009
|
Jt({
|
|
3006
3010
|
enabled: m(() => e.keepAliveReload ?? !1),
|
|
3007
|
-
reload:
|
|
3011
|
+
reload: H
|
|
3008
3012
|
});
|
|
3009
|
-
let
|
|
3010
|
-
fitPage: m(() => !
|
|
3011
|
-
cardEl:
|
|
3013
|
+
let Ae = k(), { scrollY: je, overflowHidden: Me, fullPageClass: Ne, scrollEl: U, barRef: W } = Kt({
|
|
3014
|
+
fitPage: m(() => !R.value?.y && !!e.fitPage),
|
|
3015
|
+
cardEl: Ae,
|
|
3012
3016
|
prefixCls: o
|
|
3013
3017
|
}), G = m(() => ({
|
|
3014
|
-
...
|
|
3015
|
-
...
|
|
3018
|
+
...R.value ?? {},
|
|
3019
|
+
...je.value > 0 ? { y: je.value } : {}
|
|
3016
3020
|
}));
|
|
3017
|
-
|
|
3018
|
-
reload:
|
|
3021
|
+
we({
|
|
3022
|
+
reload: H,
|
|
3019
3023
|
setPagination: D,
|
|
3020
|
-
tableSize:
|
|
3021
|
-
setTableSize:
|
|
3022
|
-
formAutoRequest:
|
|
3023
|
-
formConfig:
|
|
3024
|
-
formActions:
|
|
3024
|
+
tableSize: ee,
|
|
3025
|
+
setTableSize: O,
|
|
3026
|
+
formAutoRequest: _e,
|
|
3027
|
+
formConfig: ge,
|
|
3028
|
+
formActions: ve,
|
|
3025
3029
|
isMobile: b,
|
|
3026
3030
|
screenWidth: S,
|
|
3027
3031
|
toggleFullscreen: g,
|
|
3028
3032
|
isFullscreen: _
|
|
3029
3033
|
});
|
|
3030
|
-
let Pe = m(() => !!(e.customRender || n.customRender)), Fe = m(() => e.form === !1 ? !1 :
|
|
3034
|
+
let Pe = m(() => !!(e.customRender || n.customRender)), Fe = m(() => e.form === !1 ? !1 : ye.value.length > 0 || !!n.form);
|
|
3031
3035
|
function Ie(t, n) {
|
|
3032
|
-
if (
|
|
3033
|
-
|
|
3036
|
+
if (_e.value) {
|
|
3037
|
+
H({ params: t });
|
|
3034
3038
|
return;
|
|
3035
3039
|
}
|
|
3036
|
-
n === "reset" ? (r("reset", t), e.request &&
|
|
3040
|
+
n === "reset" ? (r("reset", t), e.request && ve.value?.resetReload && H({ params: t })) : e.request && (r("submit", t), H({ params: t }));
|
|
3037
3041
|
}
|
|
3038
3042
|
function Le(e) {
|
|
3039
3043
|
let t = w.value;
|
|
@@ -3044,7 +3048,7 @@ var gr = (e) => {
|
|
|
3044
3048
|
function Re() {
|
|
3045
3049
|
let t = e.customRender || n.customRender;
|
|
3046
3050
|
if (!t) return null;
|
|
3047
|
-
let r =
|
|
3051
|
+
let r = V.value;
|
|
3048
3052
|
return r?.length ? typeof t == "function" ? t({
|
|
3049
3053
|
dataSource: r,
|
|
3050
3054
|
currentData: Le(r)
|
|
@@ -3064,7 +3068,7 @@ var gr = (e) => {
|
|
|
3064
3068
|
pageSize: t
|
|
3065
3069
|
}, {}, {}, {});
|
|
3066
3070
|
}
|
|
3067
|
-
let Ve = m(() => e.showLoading === !1 ? !1 :
|
|
3071
|
+
let Ve = m(() => e.showLoading === !1 ? !1 : A.value), He = m(() => {
|
|
3068
3072
|
let t = {};
|
|
3069
3073
|
for (let n of xr) {
|
|
3070
3074
|
if (n === "classes") {
|
|
@@ -3075,13 +3079,21 @@ var gr = (e) => {
|
|
|
3075
3079
|
});
|
|
3076
3080
|
continue;
|
|
3077
3081
|
}
|
|
3082
|
+
if (n === "expandable") {
|
|
3083
|
+
let n = e.expandable, r = e.expandedRowKeys;
|
|
3084
|
+
(n !== void 0 || r !== void 0) && (t.expandable = {
|
|
3085
|
+
...n ?? {},
|
|
3086
|
+
...r === void 0 ? {} : { expandedRowKeys: r }
|
|
3087
|
+
});
|
|
3088
|
+
continue;
|
|
3089
|
+
}
|
|
3078
3090
|
let r = e[n];
|
|
3079
3091
|
r !== void 0 && (t[n] = r);
|
|
3080
3092
|
}
|
|
3081
3093
|
return t;
|
|
3082
3094
|
});
|
|
3083
3095
|
function Ue(t, n, r, i) {
|
|
3084
|
-
|
|
3096
|
+
De(t, n, r, i), e.onChange?.(t, n, r, i);
|
|
3085
3097
|
}
|
|
3086
3098
|
function We(e) {
|
|
3087
3099
|
r("update:expandedRowKeys", e);
|
|
@@ -3110,35 +3122,35 @@ var gr = (e) => {
|
|
|
3110
3122
|
});
|
|
3111
3123
|
return i({
|
|
3112
3124
|
actionRef: () => ({
|
|
3113
|
-
loading:
|
|
3114
|
-
dataSource:
|
|
3125
|
+
loading: A,
|
|
3126
|
+
dataSource: V,
|
|
3115
3127
|
pageInfo: E,
|
|
3116
|
-
reload:
|
|
3128
|
+
reload: H,
|
|
3117
3129
|
reloadAndReset: (e) => {
|
|
3118
|
-
D({ current: 1 }),
|
|
3130
|
+
D({ current: 1 }), Ce(), ke(), e?.callBack?.();
|
|
3119
3131
|
},
|
|
3120
3132
|
setPagination: D,
|
|
3121
3133
|
setPageInfo: (e, t, n, r) => {
|
|
3122
|
-
D(e),
|
|
3134
|
+
D(e), De(e, t ?? {}, n ?? {}, r ?? {});
|
|
3123
3135
|
},
|
|
3124
|
-
setTableDataList:
|
|
3125
|
-
operateTableDataRow:
|
|
3126
|
-
setLoading:
|
|
3136
|
+
setTableDataList: Te,
|
|
3137
|
+
operateTableDataRow: Ee,
|
|
3138
|
+
setLoading: j,
|
|
3127
3139
|
selectedKeys: N,
|
|
3128
3140
|
selectedItems: te,
|
|
3129
3141
|
rowsSelection: {
|
|
3130
|
-
clear:
|
|
3142
|
+
clear: I,
|
|
3131
3143
|
select: re,
|
|
3132
3144
|
selectAll: F,
|
|
3133
|
-
remove:
|
|
3134
|
-
sync:
|
|
3145
|
+
remove: ae,
|
|
3146
|
+
sync: L
|
|
3135
3147
|
}
|
|
3136
3148
|
}),
|
|
3137
3149
|
formRef: () => ({
|
|
3138
|
-
getFormSearch:
|
|
3139
|
-
getFormInnerState: () =>
|
|
3150
|
+
getFormSearch: Se,
|
|
3151
|
+
getFormInnerState: () => xe.value,
|
|
3140
3152
|
restFormState: (e) => {
|
|
3141
|
-
|
|
3153
|
+
Ce(), e?.();
|
|
3142
3154
|
}
|
|
3143
3155
|
})
|
|
3144
3156
|
}), () => {
|
|
@@ -3152,12 +3164,12 @@ var gr = (e) => {
|
|
|
3152
3164
|
style: e.proStyles?.content
|
|
3153
3165
|
}, [Fe.value && h(rr, {
|
|
3154
3166
|
prefixCls: o.value,
|
|
3155
|
-
formColumns:
|
|
3156
|
-
formState:
|
|
3157
|
-
defaultFormSearch:
|
|
3158
|
-
formConfig:
|
|
3159
|
-
formAutoRequest:
|
|
3160
|
-
formActions:
|
|
3167
|
+
formColumns: ye.value,
|
|
3168
|
+
formState: xe.value,
|
|
3169
|
+
defaultFormSearch: be.value,
|
|
3170
|
+
formConfig: ge.value,
|
|
3171
|
+
formAutoRequest: _e.value,
|
|
3172
|
+
formActions: ve.value,
|
|
3161
3173
|
loading: Ve.value,
|
|
3162
3174
|
cardBordered: e.cardBordered,
|
|
3163
3175
|
proClasses: e.proClasses ?? {},
|
|
@@ -3165,7 +3177,7 @@ var gr = (e) => {
|
|
|
3165
3177
|
onSearch: Ie,
|
|
3166
3178
|
onReset: (e) => r("reset", e)
|
|
3167
3179
|
}, { default: () => [n.form?.()] }), h("div", {
|
|
3168
|
-
ref:
|
|
3180
|
+
ref: Ae,
|
|
3169
3181
|
class: J(e.proClasses?.card, `${o.value}-card`, e.cardBordered && `${o.value}-card-border`),
|
|
3170
3182
|
style: e.proStyles?.card
|
|
3171
3183
|
}, [h(lr, {
|
|
@@ -3179,21 +3191,21 @@ var gr = (e) => {
|
|
|
3179
3191
|
listToolAfter: n.listToolAfter?.() ?? e.listToolAfter,
|
|
3180
3192
|
proClasses: e.proClasses ?? {},
|
|
3181
3193
|
proStyles: e.proStyles ?? {}
|
|
3182
|
-
}, null), Pe.value ? h(
|
|
3194
|
+
}, null), Pe.value ? h(le, { spinning: !!Ve.value }, { default: () => [h("div", { class: J(`${o.value}-list`, e.proClasses?.list) }, [h("div", {
|
|
3183
3195
|
class: J(`${o.value}-list-content`, e.proClasses?.listContent),
|
|
3184
3196
|
style: e.proStyles?.listContent
|
|
3185
|
-
}, [Re()]), w.value !== !1 &&
|
|
3197
|
+
}, [Re()]), w.value !== !1 && V.value?.length > 0 && h(z, x(w.value, {
|
|
3186
3198
|
align: T.value,
|
|
3187
3199
|
class: J(`${o.value}-pagination`, e.proClasses?.pagination),
|
|
3188
3200
|
style: e.proStyles?.pagination,
|
|
3189
3201
|
onChange: Be
|
|
3190
|
-
}), null)])] }) : h(d, null, [h(
|
|
3202
|
+
}), null)])] }) : h(d, null, [h(ue, x(He.value, {
|
|
3191
3203
|
scroll: G.value,
|
|
3192
|
-
dataSource:
|
|
3193
|
-
columns: e.draggable ?
|
|
3194
|
-
components: e.draggable ?
|
|
3204
|
+
dataSource: V.value,
|
|
3205
|
+
columns: e.draggable ? pe.value : ce.value,
|
|
3206
|
+
components: e.draggable ? B.value : He.value.components,
|
|
3195
3207
|
rowKey: e.rowKey,
|
|
3196
|
-
size:
|
|
3208
|
+
size: ee.value,
|
|
3197
3209
|
pagination: w.value,
|
|
3198
3210
|
loading: Ve.value,
|
|
3199
3211
|
rowSelection: ne.value,
|
|
@@ -3202,10 +3214,10 @@ var gr = (e) => {
|
|
|
3202
3214
|
onScroll: Ge,
|
|
3203
3215
|
classes: {
|
|
3204
3216
|
...He.value.classes,
|
|
3205
|
-
...
|
|
3217
|
+
...Me.value ? { root: `${o.value}-overflow-hidden` } : {}
|
|
3206
3218
|
}
|
|
3207
|
-
}), qe.value),
|
|
3208
|
-
ref:
|
|
3219
|
+
}), qe.value), U.value && h(f, { to: U.value }, { default: () => [h(xn, {
|
|
3220
|
+
ref: W,
|
|
3209
3221
|
hasScrollY: !!G.value.y
|
|
3210
3222
|
}, null)] })])])])]);
|
|
3211
3223
|
};
|
|
@@ -3648,4 +3660,4 @@ var gr = (e) => {
|
|
|
3648
3660
|
inheritAttrs: !1
|
|
3649
3661
|
});
|
|
3650
3662
|
//#endregion
|
|
3651
|
-
export { Sr as GProTable, zt as useFetchData,
|
|
3663
|
+
export { Sr as GProTable, zt as useFetchData, Te as useInjectTableContext, Qt as usePagination, Oe as useProBreakpoints, $t as useRequestOptions, nn as useTable, on as useTableForm };
|