bitz-react-admin-ui 1.6.5 → 1.6.7
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/README.md +2 -2
- package/dist/bitz-ui.mjs +126 -120
- package/dist/components/BitzFluentInput/index.mjs +20 -17
- package/dist/components/BitzFluentSelect/index.mjs +20 -18
- package/dist/components/BitzList/List.mjs +28 -0
- package/dist/components/BitzList/LoadMore.mjs +69 -0
- package/dist/components/BitzList/index.less.mjs +4 -0
- package/dist/components/BitzList/index.mjs +6 -0
- package/dist/components/BitzPullRefresh/PullRefresh.mjs +113 -0
- package/dist/components/BitzPullRefresh/index.mjs +6 -0
- package/dist/components/BitzPullRefresh/style/index.less.mjs +4 -0
- package/dist/components/BitzSelect/component/BitzSelectMobile.mjs +133 -94
- package/dist/components/BitzTable/ActionBar/ActionBar.mjs +64 -0
- package/dist/components/BitzTable/ActionBar/Button.mjs +10 -0
- package/dist/components/BitzTable/ActionBar/index.mjs +6 -60
- package/dist/components/BitzTable/ActionBar/style.mjs +36 -32
- package/dist/components/BitzTable/ActionCol/index.mjs +29 -28
- package/dist/components/BitzTable/Table/index.mjs +302 -253
- package/dist/components/BitzTable/TableSkeleton/index.mjs +46 -42
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +179 -173
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/DndItem.mjs +28 -26
- package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +10 -9
- package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +1 -1
- package/dist/components/BitzTable/ToolBar/ExportIcon/index.mjs +28 -25
- package/dist/components/BitzTable/ToolBar/RefreshIcon/index.mjs +3 -2
- package/dist/components/BitzTable/ToolBar/Wrapper/index.mjs +23 -14
- package/dist/components/BitzTable/ToolBar/style.mjs +29 -20
- package/dist/hooks/use-event-listener.mjs +40 -0
- package/dist/hooks/use-lock-fn.mjs +21 -0
- package/dist/hooks/use-scroll-parent.mjs +34 -0
- package/dist/hooks/use-touch.mjs +33 -0
- package/dist/node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +751 -1050
- package/dist/node_modules/.store/ahooks@3.7.10/node_modules/ahooks/es/useSetState/index.mjs +16 -0
- package/dist/node_modules/.store/ahooks@3.7.10/node_modules/ahooks/es/useThrottleFn/index.mjs +28 -0
- package/dist/node_modules/.store/ahooks@3.7.10/node_modules/ahooks/es/useUpdateEffect/index.mjs +6 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_Symbol.mjs +5 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_baseGetTag.mjs +11 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_baseTrim.mjs +9 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_freeGlobal.mjs +5 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_getRawTag.mjs +16 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_objectToString.mjs +8 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_root.mjs +5 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.mjs +10 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/debounce.mjs +55 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/isObject.mjs +8 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/isObjectLike.mjs +7 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/isSymbol.mjs +10 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/now.mjs +7 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/throttle.mjs +19 -0
- package/dist/node_modules/.store/lodash@4.17.21/node_modules/lodash/toNumber.mjs +23 -0
- package/dist/node_modules/.store/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs +48 -37
- package/dist/node_modules/_clsx@2.1.0@clsx/dist/clsx.mjs +23 -0
- package/dist/style.css +1 -1
- package/dist/type/bitz-ui.d.ts +2 -0
- package/dist/type/components/BitzList/List.d.ts +4 -0
- package/dist/type/components/BitzList/LoadMore.d.ts +4 -0
- package/dist/type/components/BitzList/PropsType.d.ts +35 -0
- package/dist/type/components/BitzList/index.d.ts +5 -0
- package/dist/type/components/BitzPagination/index.d.ts +8 -2
- package/dist/type/components/BitzPullRefresh/PropsType.d.ts +43 -0
- package/dist/type/components/BitzPullRefresh/PullRefresh.d.ts +4 -0
- package/dist/type/components/BitzPullRefresh/index.d.ts +5 -0
- package/dist/type/components/BitzSelect/component/BitzSelectMobile.d.ts +1 -0
- package/dist/type/components/BitzTable/ActionBar/ActionBar.d.ts +37 -0
- package/dist/type/components/BitzTable/ActionBar/Button.d.ts +6 -0
- package/dist/type/components/BitzTable/ActionBar/index.d.ts +6 -33
- package/dist/type/components/BitzTable/ActionBar/style.d.ts +2 -2
- package/dist/type/components/BitzTable/Store/index.d.ts +2 -3
- package/dist/type/components/BitzTable/Table/index.d.ts +2 -2
- package/dist/type/components/BitzTable/TableSkeleton/index.d.ts +1 -1
- package/dist/type/components/BitzTable/ToolBar/ExportIcon/index.d.ts +2 -1
- package/dist/type/components/BitzTable/ToolBar/style.d.ts +1 -2
- package/dist/type/components/BitzTable/index.d.ts +6 -7
- package/dist/type/hooks/use-event-listener.d.ts +11 -0
- package/dist/type/hooks/use-lock-fn.d.ts +2 -0
- package/dist/type/hooks/use-scroll-parent.d.ts +9 -0
- package/dist/type/hooks/use-touch.d.ts +18 -0
- package/dist/type/pages/Login2/useRowSelection.d.ts +6 -4
- package/dist/type/pages/Test/index.d.ts +3 -0
- package/dist/type/utils/get-default-props.d.ts +2 -0
- package/dist/type/utils/scroll.d.ts +6 -0
- package/dist/utils/get-default-props.mjs +12 -0
- package/dist/utils/scroll.mjs +15 -0
- package/package.json +2 -1
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { theme as L, Skeleton as
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
1
|
+
import { j as i } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { theme as L, Skeleton as O, Table as l } from "antd";
|
|
3
|
+
import R from "../../../node_modules/.store/antd@5.15.0/node_modules/antd/es/table/ExpandIcon.mjs";
|
|
4
|
+
import { useContext as T, useMemo as a, useRef as g, useEffect as h } from "react";
|
|
5
5
|
import "../../../node_modules/.store/antd@5.15.0/node_modules/antd/es/config-provider/index.mjs";
|
|
6
|
-
import
|
|
7
|
-
import { ConfigContext as
|
|
8
|
-
const
|
|
9
|
-
columns:
|
|
10
|
-
|
|
11
|
-
rowSelection:
|
|
6
|
+
import w from "../../../node_modules/.store/antd@5.15.0/node_modules/antd/locale/en_US.mjs";
|
|
7
|
+
import { ConfigContext as N } from "../../../node_modules/.store/antd@5.15.0/node_modules/antd/es/config-provider/context.mjs";
|
|
8
|
+
const U = ({
|
|
9
|
+
columns: s,
|
|
10
|
+
dataLength: c,
|
|
11
|
+
rowSelection: f,
|
|
12
12
|
expandable: o,
|
|
13
|
-
loading:
|
|
14
|
-
...
|
|
13
|
+
loading: r,
|
|
14
|
+
...u
|
|
15
15
|
}) => {
|
|
16
|
-
var
|
|
17
|
-
const { token: x } = L.useToken(), { table: p, locale: y =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
var d;
|
|
17
|
+
const { token: x } = L.useToken(), { table: p, locale: y = w } = T(N), C = { ...y.Table }, b = ((d = p == null ? void 0 : p.expandable) == null ? void 0 : d.expandIcon) || (o == null ? void 0 : o.expandIcon) || R(C), k = a(() => {
|
|
18
|
+
if (!r)
|
|
19
|
+
return [];
|
|
20
|
+
const t = c > 4 ? c >= 20 ? 20 : c : 4;
|
|
21
|
+
return Array.from({ length: t }).map((e, n) => ({ index: n }));
|
|
22
|
+
}, [r, c]), I = a(() => {
|
|
21
23
|
var t;
|
|
22
|
-
return (t =
|
|
24
|
+
return (t = s == null ? void 0 : s.filter((e) => Object.keys(e).length !== 0)) == null ? void 0 : t.map((e) => e != null && e.isOperationCol ? e : {
|
|
23
25
|
...e,
|
|
24
26
|
sorter: !1,
|
|
25
|
-
render: (
|
|
26
|
-
|
|
27
|
+
render: (n, S, _) => /* @__PURE__ */ i.jsx(
|
|
28
|
+
O,
|
|
27
29
|
{
|
|
28
30
|
active: !0,
|
|
29
31
|
title: !1,
|
|
30
32
|
paragraph: {
|
|
31
33
|
rows: 1,
|
|
32
|
-
width: (
|
|
34
|
+
width: (_ + 1) % 2 === 0 ? "100%" : "60%"
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
)
|
|
36
38
|
});
|
|
37
|
-
}, [
|
|
39
|
+
}, [s]), E = a(() => {
|
|
38
40
|
if (o)
|
|
39
41
|
return {
|
|
40
42
|
...o,
|
|
41
|
-
expandedRowRender: () => /* @__PURE__ */
|
|
43
|
+
expandedRowRender: () => /* @__PURE__ */ i.jsx(i.Fragment, {}),
|
|
42
44
|
expandIcon: (t) => {
|
|
43
45
|
const e = b(t);
|
|
44
46
|
return {
|
|
@@ -54,41 +56,43 @@ const q = ({
|
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
|
-
}, [o]),
|
|
58
|
-
if (
|
|
59
|
+
}, [o]), j = a(() => {
|
|
60
|
+
if (f)
|
|
59
61
|
return {
|
|
60
|
-
...
|
|
62
|
+
...f,
|
|
61
63
|
selectedRowKeys: [],
|
|
62
64
|
getCheckboxProps: () => ({ disabled: !0 })
|
|
63
65
|
};
|
|
64
|
-
}, [
|
|
65
|
-
return
|
|
66
|
-
var e,
|
|
67
|
-
const t = (
|
|
68
|
-
t && (t.
|
|
69
|
-
}, [
|
|
70
|
-
|
|
66
|
+
}, [f]), m = g();
|
|
67
|
+
return h(() => {
|
|
68
|
+
var e, n;
|
|
69
|
+
const t = (n = (e = m.current) == null ? void 0 : e.nativeElement) == null ? void 0 : n.querySelector(".ant-table-body");
|
|
70
|
+
t && (t.scrollLeft = 0);
|
|
71
|
+
}, [r]), /* @__PURE__ */ i.jsx(
|
|
72
|
+
l,
|
|
71
73
|
{
|
|
72
|
-
...
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
...u,
|
|
75
|
+
ref: m,
|
|
76
|
+
expandable: E,
|
|
77
|
+
rowSelection: j,
|
|
75
78
|
pagination: !1,
|
|
76
|
-
columns: [
|
|
79
|
+
columns: [l.SELECTION_COLUMN, l.EXPAND_COLUMN, ...I],
|
|
77
80
|
rowKey: "index",
|
|
78
81
|
dataSource: k,
|
|
79
82
|
loading: !1,
|
|
80
83
|
style: {
|
|
84
|
+
...u.style,
|
|
81
85
|
position: "absolute",
|
|
82
86
|
inset: 0,
|
|
83
87
|
top: 40,
|
|
84
|
-
zIndex:
|
|
88
|
+
zIndex: r ? 100 : -1,
|
|
85
89
|
/** 保险起见,使用了zIndex也要用opacity控制显隐 */
|
|
86
|
-
opacity:
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
opacity: r ? 1 : 0,
|
|
91
|
+
background: r ? "#fff" : "transparent"
|
|
92
|
+
}
|
|
89
93
|
}
|
|
90
94
|
);
|
|
91
95
|
};
|
|
92
96
|
export {
|
|
93
|
-
|
|
97
|
+
U as default
|
|
94
98
|
};
|
|
@@ -1,215 +1,221 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { create as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import
|
|
5
|
-
import { useState as
|
|
6
|
-
import { TableContext as
|
|
7
|
-
import { genColumnKey as
|
|
8
|
-
import
|
|
9
|
-
import { DndContext as
|
|
10
|
-
import { SortableContext as
|
|
11
|
-
import
|
|
12
|
-
import { restrictToVerticalAxis as
|
|
13
|
-
import
|
|
1
|
+
import { j as s } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
|
+
import { create as Q, useModal as U, antdModalV5 as X } from "@ebay/nice-modal-react";
|
|
3
|
+
import { Modal as Y, Checkbox as Z, Button as $ } from "antd";
|
|
4
|
+
import a from "./index.module.less.mjs";
|
|
5
|
+
import { useState as E, useContext as L, useEffect as ee, useCallback as B, useMemo as S } from "react";
|
|
6
|
+
import { TableContext as se } from "../../Store/index.mjs";
|
|
7
|
+
import { genColumnKey as H, columnSort as oe } from "../../Store/utils/index.mjs";
|
|
8
|
+
import u from "../../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
9
|
+
import { DndContext as te } from "../../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
|
|
10
|
+
import { SortableContext as le, verticalListSortingStrategy as ne, arrayMove as ae } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
11
|
+
import ce from "./DndItem.mjs";
|
|
12
|
+
import { restrictToVerticalAxis as ie, restrictToWindowEdges as me } from "../../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
|
|
13
|
+
import T from "../../../BitzButton/index.mjs";
|
|
14
14
|
import "./index.less.mjs";
|
|
15
|
-
import { useImmer as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
styles: {
|
|
23
|
-
active: {
|
|
24
|
-
opacity: "0.5"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
}, zs = X(() => {
|
|
29
|
-
var I;
|
|
30
|
-
const x = Y(), [u, j] = g(null), [R, v] = g(!1), [c, h] = us({
|
|
15
|
+
import { useImmer as re } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
|
|
16
|
+
import R from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
|
|
17
|
+
import de from "../../../../node_modules/.store/@ant-design_icons@5.3.1/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
|
|
18
|
+
import ue from "../../../../node_modules/.store/@ant-design_icons@5.3.1/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
|
|
19
|
+
const _e = Q(() => {
|
|
20
|
+
var w;
|
|
21
|
+
const h = U(), [b, C] = E(null), [z, k] = E(!1), [c, x] = re({
|
|
31
22
|
columnsMap: {},
|
|
32
23
|
sortKeyColumns: []
|
|
33
24
|
}), {
|
|
34
|
-
persistenceType:
|
|
35
|
-
persistenceKey:
|
|
36
|
-
onlineChange:
|
|
37
|
-
columnsMap:
|
|
38
|
-
setColumnsMap:
|
|
39
|
-
sortKeyColumns:
|
|
40
|
-
setSortKeyColumns:
|
|
25
|
+
persistenceType: A,
|
|
26
|
+
persistenceKey: v,
|
|
27
|
+
onlineChange: f,
|
|
28
|
+
columnsMap: O,
|
|
29
|
+
setColumnsMap: V,
|
|
30
|
+
sortKeyColumns: F,
|
|
31
|
+
setSortKeyColumns: W,
|
|
41
32
|
// clearPersistenceStorage,
|
|
42
33
|
...l
|
|
43
|
-
} = L(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
} = L(se);
|
|
35
|
+
ee(() => {
|
|
36
|
+
x((e) => {
|
|
37
|
+
e.columnsMap = { ...O }, e.sortKeyColumns = [...F];
|
|
47
38
|
});
|
|
48
39
|
}, []);
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
const q = B(() => {
|
|
41
|
+
x((e) => {
|
|
42
|
+
e.columnsMap = { ...l.defaultColumnKeyMap };
|
|
52
43
|
});
|
|
53
|
-
}, []), p =
|
|
44
|
+
}, []), p = S(() => {
|
|
54
45
|
var o, n;
|
|
55
|
-
const
|
|
56
|
-
return (o = l == null ? void 0 : l.columns) != null && o.length && ((n = l == null ? void 0 : l.columns) == null || n.map(({ key: d, dataIndex:
|
|
57
|
-
const
|
|
58
|
-
d ||
|
|
59
|
-
[d ||
|
|
60
|
-
),
|
|
61
|
-
return (
|
|
62
|
-
key:
|
|
63
|
-
...
|
|
46
|
+
const e = [];
|
|
47
|
+
return (o = l == null ? void 0 : l.columns) != null && o.length && ((n = l == null ? void 0 : l.columns) == null || n.map(({ key: d, dataIndex: t, ...m }) => {
|
|
48
|
+
const y = H(
|
|
49
|
+
d || t,
|
|
50
|
+
[d || t].filter(Boolean).join("-")
|
|
51
|
+
), r = c.columnsMap[y || "null"];
|
|
52
|
+
return (r == null ? void 0 : r.show) !== !1 && e.push({
|
|
53
|
+
key: y,
|
|
54
|
+
...R(m, ["className"]),
|
|
64
55
|
selectable: !1,
|
|
65
|
-
disabled: (
|
|
66
|
-
}),
|
|
67
|
-
})),
|
|
68
|
-
}, [c.columnsMap, l == null ? void 0 : l.columns]),
|
|
69
|
-
(
|
|
56
|
+
disabled: (r == null ? void 0 : r.disable) === !0
|
|
57
|
+
}), r;
|
|
58
|
+
})), e.sort(oe(c.columnsMap));
|
|
59
|
+
}, [c.columnsMap, l == null ? void 0 : l.columns]), j = B(
|
|
60
|
+
(e) => {
|
|
70
61
|
var o;
|
|
71
|
-
return (o = c.sortKeyColumns) == null ? void 0 : o.findIndex((n) => n ===
|
|
62
|
+
return (o = c.sortKeyColumns) == null ? void 0 : o.findIndex((n) => n === e);
|
|
72
63
|
},
|
|
73
64
|
[c.sortKeyColumns]
|
|
74
|
-
), N =
|
|
75
|
-
() =>
|
|
76
|
-
[
|
|
77
|
-
),
|
|
78
|
-
const
|
|
79
|
-
return { list: ((d,
|
|
80
|
-
var
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
[
|
|
84
|
-
), i = c.columnsMap[
|
|
85
|
-
(i == null ? void 0 : i.show) !== !1 && !
|
|
86
|
-
const
|
|
87
|
-
key:
|
|
88
|
-
...
|
|
65
|
+
), N = S(
|
|
66
|
+
() => b ? j(b) : -1,
|
|
67
|
+
[b, j]
|
|
68
|
+
), g = S(() => {
|
|
69
|
+
const e = [], o = /* @__PURE__ */ new Map();
|
|
70
|
+
return { list: ((d, t) => d.map(({ key: m, dataIndex: y, children: r, ...D }) => {
|
|
71
|
+
var _;
|
|
72
|
+
const M = H(
|
|
73
|
+
m || y,
|
|
74
|
+
[t == null ? void 0 : t.columnKey, D.index].filter(Boolean).join("-")
|
|
75
|
+
), i = c.columnsMap[M || "null"] || { show: !0 };
|
|
76
|
+
(i == null ? void 0 : i.show) !== !1 && !r && e.push(M);
|
|
77
|
+
const I = {
|
|
78
|
+
key: M,
|
|
79
|
+
...R(D, ["className"]),
|
|
89
80
|
selectable: !1,
|
|
90
81
|
disabled: i.disable === !0,
|
|
91
|
-
disableCheckbox: typeof i.disable == "boolean" ? i == null ? void 0 : i.disable : (
|
|
92
|
-
isLeaf:
|
|
82
|
+
disableCheckbox: typeof i.disable == "boolean" ? i == null ? void 0 : i.disable : (_ = i == null ? void 0 : i.disable) == null ? void 0 : _.checkbox,
|
|
83
|
+
isLeaf: t ? !0 : void 0
|
|
93
84
|
};
|
|
94
|
-
return o.set(
|
|
95
|
-
}))(l == null ? void 0 : l.columns), keys:
|
|
96
|
-
}, [c.columnsMap, l == null ? void 0 : l.columns]),
|
|
85
|
+
return o.set(m, I), I;
|
|
86
|
+
}))(l == null ? void 0 : l.columns), keys: e, map: o };
|
|
87
|
+
}, [c.columnsMap, l == null ? void 0 : l.columns]), G = (e, o) => {
|
|
97
88
|
const n = { ...c.columnsMap };
|
|
98
|
-
((
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
})(o.key),
|
|
102
|
-
|
|
89
|
+
((t) => {
|
|
90
|
+
const m = { ...n[t] };
|
|
91
|
+
m.show = !e, n[t] = m;
|
|
92
|
+
})(o.key), k(!0), x((t) => {
|
|
93
|
+
t.columnsMap = { ...n };
|
|
103
94
|
});
|
|
104
|
-
},
|
|
105
|
-
const n = { ...c.columnsMap }, d =
|
|
106
|
-
d.forEach((
|
|
107
|
-
n[
|
|
108
|
-
}),
|
|
109
|
-
|
|
95
|
+
}, J = (e, o) => {
|
|
96
|
+
const n = { ...c.columnsMap }, d = ae(c.sortKeyColumns, e, o);
|
|
97
|
+
d.forEach((t, m) => {
|
|
98
|
+
n[t] = { ...n[t] || {}, order: m };
|
|
99
|
+
}), k(!0), x((t) => {
|
|
100
|
+
t.columnsMap = { ...n }, t.sortKeyColumns = d;
|
|
110
101
|
});
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
return u ? ((o = (s = l == null ? void 0 : l.columns) == null ? void 0 : s.find((n) => n.key === u)) == null ? void 0 : o.title) ?? "" : "";
|
|
114
|
-
}, [l == null ? void 0 : l.columns, u]), U = () => {
|
|
115
|
-
W(c.columnsMap), G(c.sortKeyColumns), V === "online" && k && (C == null || C(k, c.columnsMap)), x.resolve({ ...c.columnsMap }), x.hide();
|
|
102
|
+
}, P = () => {
|
|
103
|
+
V(c.columnsMap), W(c.sortKeyColumns), A === "online" && v && (f == null || f(v, c.columnsMap)), h.resolve({ ...c.columnsMap }), h.hide();
|
|
116
104
|
}, K = () => {
|
|
117
|
-
|
|
105
|
+
h.hide();
|
|
118
106
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
120
|
-
|
|
107
|
+
return /* @__PURE__ */ s.jsxs(
|
|
108
|
+
Y,
|
|
121
109
|
{
|
|
122
110
|
className: "tableColumnSettingModal",
|
|
123
111
|
title: "自定义列",
|
|
124
|
-
...
|
|
112
|
+
...X(h),
|
|
113
|
+
styles: { body: { maxHeight: window.innerHeight - 300 } },
|
|
125
114
|
width: 600,
|
|
126
115
|
onCancel: K,
|
|
127
|
-
footer: /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
116
|
+
footer: /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
117
|
+
/* @__PURE__ */ s.jsx(
|
|
118
|
+
T,
|
|
130
119
|
{
|
|
131
120
|
type: "primary",
|
|
132
|
-
icon: /* @__PURE__ */
|
|
133
|
-
onClick:
|
|
134
|
-
disabled: !
|
|
121
|
+
icon: /* @__PURE__ */ s.jsx(de, {}),
|
|
122
|
+
onClick: P,
|
|
123
|
+
disabled: !z,
|
|
135
124
|
children: "保存"
|
|
136
125
|
}
|
|
137
126
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ s.jsx(T, { onClick: K, children: "取消" })
|
|
139
128
|
] }),
|
|
140
129
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ e.jsx($, { checked: o, disabled: s.disabled }),
|
|
159
|
-
/* @__PURE__ */ e.jsx("span", { className: t["content-item-text"], children: s.title })
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
s.key
|
|
163
|
-
);
|
|
164
|
-
}) }) })
|
|
165
|
-
] }),
|
|
166
|
-
/* @__PURE__ */ e.jsxs("div", { className: t.block, children: [
|
|
167
|
-
/* @__PURE__ */ e.jsxs("div", { className: t.header, children: [
|
|
168
|
-
/* @__PURE__ */ e.jsx("div", { className: t.title, children: "选定列" }),
|
|
169
|
-
/* @__PURE__ */ e.jsxs("div", { className: t.reset, onClick: H, children: [
|
|
170
|
-
/* @__PURE__ */ e.jsx("div", { children: "重置 " }),
|
|
171
|
-
/* @__PURE__ */ e.jsx(hs, {})
|
|
172
|
-
] })
|
|
173
|
-
] }),
|
|
174
|
-
/* @__PURE__ */ e.jsx("div", { className: t.body, children: /* @__PURE__ */ e.jsxs(
|
|
175
|
-
ls,
|
|
176
|
-
{
|
|
177
|
-
modifiers: [ms, ds],
|
|
178
|
-
onDragStart: (s) => {
|
|
179
|
-
const { active: o } = s;
|
|
180
|
-
o && j(o == null ? void 0 : o.id);
|
|
181
|
-
},
|
|
182
|
-
onDragCancel: () => j(null),
|
|
183
|
-
onDragEnd: (s) => {
|
|
184
|
-
j(null);
|
|
185
|
-
const { over: o } = s;
|
|
186
|
-
if (o) {
|
|
187
|
-
const n = M(o.id);
|
|
188
|
-
N !== n && P(N, n);
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
children: [
|
|
192
|
-
/* @__PURE__ */ e.jsx(
|
|
193
|
-
as,
|
|
130
|
+
/* @__PURE__ */ s.jsx("div", { className: u(a.introduce, "tableColumnSetting_introduce"), children: "选择要在表中显示的可用列。拖动选定的列以对其重新排序。" }),
|
|
131
|
+
/* @__PURE__ */ s.jsxs(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: u(a.container, "tableColumnSetting_container"),
|
|
135
|
+
style: { maxHeight: window.innerHeight - 390, overflow: "auto" },
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ s.jsxs("div", { className: a.block, children: [
|
|
138
|
+
/* @__PURE__ */ s.jsxs("div", { className: u(a.header, "tableColumnSetting_header"), children: [
|
|
139
|
+
/* @__PURE__ */ s.jsx("div", { className: u(a.title, "tableColumnSetting_title"), children: "可用列" }),
|
|
140
|
+
/* @__PURE__ */ s.jsx("div", {})
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ s.jsx("div", { className: u(a.body, "tableColumnSetting_body"), children: /* @__PURE__ */ s.jsx("ul", { className: a.content, children: (w = g.list) == null ? void 0 : w.map((e) => {
|
|
143
|
+
const o = g.keys.includes(e.key);
|
|
144
|
+
return /* @__PURE__ */ s.jsxs(
|
|
145
|
+
"li",
|
|
194
146
|
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
147
|
+
className: u(a.item, {
|
|
148
|
+
[a.checked]: !o,
|
|
149
|
+
tableColumnSetting_checked: !o
|
|
150
|
+
}),
|
|
151
|
+
onClick: () => !e.disabled && G(o, e),
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ s.jsx(Z, { checked: o, disabled: e.disabled }),
|
|
154
|
+
/* @__PURE__ */ s.jsx(
|
|
155
|
+
"span",
|
|
156
|
+
{
|
|
157
|
+
className: u(
|
|
158
|
+
a["content-item-text"],
|
|
159
|
+
"tableColumnSetting_content-item-text"
|
|
160
|
+
),
|
|
161
|
+
children: e.title
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
e.key
|
|
167
|
+
);
|
|
168
|
+
}) }) })
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ s.jsxs("div", { className: a.block, children: [
|
|
171
|
+
/* @__PURE__ */ s.jsxs("div", { className: a.header, children: [
|
|
172
|
+
/* @__PURE__ */ s.jsx("div", { className: a.title, children: "选定列" }),
|
|
173
|
+
/* @__PURE__ */ s.jsx(
|
|
174
|
+
$,
|
|
175
|
+
{
|
|
176
|
+
type: "link",
|
|
177
|
+
icon: /* @__PURE__ */ s.jsx(ue, {}),
|
|
178
|
+
size: "small",
|
|
179
|
+
onClick: q,
|
|
180
|
+
children: "重置"
|
|
198
181
|
}
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
182
|
+
)
|
|
183
|
+
] }),
|
|
184
|
+
/* @__PURE__ */ s.jsx("div", { className: u(a.body, "tableColumnSetting_body-order"), children: /* @__PURE__ */ s.jsx(
|
|
185
|
+
te,
|
|
186
|
+
{
|
|
187
|
+
modifiers: [ie, me],
|
|
188
|
+
onDragStart: (e) => {
|
|
189
|
+
const { active: o } = e;
|
|
190
|
+
o && C(o == null ? void 0 : o.id);
|
|
191
|
+
},
|
|
192
|
+
onDragCancel: () => C(null),
|
|
193
|
+
onDragEnd: (e) => {
|
|
194
|
+
C(null);
|
|
195
|
+
const { over: o } = e;
|
|
196
|
+
if (o) {
|
|
197
|
+
const n = j(o.id);
|
|
198
|
+
N !== n && J(N, n);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
children: /* @__PURE__ */ s.jsx(
|
|
202
|
+
le,
|
|
203
|
+
{
|
|
204
|
+
items: p == null ? void 0 : p.map((e) => e.key),
|
|
205
|
+
strategy: ne,
|
|
206
|
+
children: /* @__PURE__ */ s.jsx("ul", { className: a.content, children: p == null ? void 0 : p.map((e) => /* @__PURE__ */ s.jsx(ce, { item: e }, e.key)) })
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
) })
|
|
211
|
+
] })
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
)
|
|
209
215
|
]
|
|
210
216
|
}
|
|
211
217
|
);
|
|
212
218
|
});
|
|
213
219
|
export {
|
|
214
|
-
|
|
220
|
+
_e as default
|
|
215
221
|
};
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
|
|
2
2
|
import c from "react";
|
|
3
|
-
import
|
|
4
|
-
import { useSortable as
|
|
5
|
-
import { CSS as
|
|
6
|
-
import
|
|
3
|
+
import e from "./index.module.less.mjs";
|
|
4
|
+
import { useSortable as b } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
|
|
5
|
+
import { CSS as f } from "../../../../node_modules/.store/@dnd-kit_utilities@3.2.2/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs";
|
|
6
|
+
import s from "../../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
|
|
7
7
|
import u from "../../../../assets/iconfont/IconTuodong.mjs";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const { item:
|
|
11
|
-
attributes:
|
|
8
|
+
import p from "../../../../node_modules/.store/@ant-design_icons@5.3.1/node_modules/@ant-design/icons/es/icons/LockOutlined.mjs";
|
|
9
|
+
const I = (n) => {
|
|
10
|
+
const { item: t } = n, {
|
|
11
|
+
attributes: r,
|
|
12
12
|
isDragging: a,
|
|
13
13
|
setNodeRef: m,
|
|
14
|
-
listeners:
|
|
14
|
+
listeners: l,
|
|
15
15
|
transform: i,
|
|
16
16
|
transition: d
|
|
17
|
-
} =
|
|
18
|
-
id:
|
|
19
|
-
disabled:
|
|
20
|
-
}),
|
|
17
|
+
} = b({
|
|
18
|
+
id: t == null ? void 0 : t.key,
|
|
19
|
+
disabled: t == null ? void 0 : t.disabled
|
|
20
|
+
}), g = {
|
|
21
21
|
transition: d,
|
|
22
|
-
transform:
|
|
22
|
+
transform: f.Transform.toString(i)
|
|
23
23
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ o.jsxs(
|
|
25
25
|
"li",
|
|
26
26
|
{
|
|
27
27
|
ref: m,
|
|
28
|
-
className:
|
|
29
|
-
[
|
|
30
|
-
[
|
|
28
|
+
className: s(e.moveItem, "tableColumnSetting_moveItem", {
|
|
29
|
+
[e.isDragging]: a,
|
|
30
|
+
[e.disabled]: t == null ? void 0 : t.disabled,
|
|
31
|
+
tableColumnSetting_isDragging: a,
|
|
32
|
+
tableColumnSetting_disabled: t == null ? void 0 : t.disabled
|
|
31
33
|
}),
|
|
32
|
-
style:
|
|
33
|
-
...
|
|
34
|
-
...
|
|
34
|
+
style: g,
|
|
35
|
+
...l,
|
|
36
|
+
...r,
|
|
35
37
|
children: [
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
+
t.disabled ? /* @__PURE__ */ o.jsx(p, { className: s(e.dragIcon, "tableColumnSetting_dragIcon") }) : /* @__PURE__ */ o.jsx(u, { size: 14, className: s(e.dragIcon, "tableColumnSetting_dragIcon") }),
|
|
39
|
+
/* @__PURE__ */ o.jsx("span", { className: s(e["moveItem-text"], "tableColumnSetting_moveItem-text"), children: t.title })
|
|
38
40
|
]
|
|
39
41
|
}
|
|
40
42
|
);
|
|
41
|
-
},
|
|
43
|
+
}, y = c.memo(I);
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
y as default
|
|
44
46
|
};
|