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