bitz-react-admin-ui 1.9.7 → 1.9.9

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 (44) hide show
  1. package/dist/_virtual/dayjs.min.mjs +5 -2
  2. package/dist/_virtual/dayjs.min2.mjs +4 -0
  3. package/dist/components/BitzCalendar/index.mjs +1 -1
  4. package/dist/components/BitzDayJs/index.mjs +1 -1
  5. package/dist/components/BitzFluentInput/index.mjs +24 -20
  6. package/dist/components/BitzFluentSelect/index.mjs +19 -15
  7. package/dist/components/BitzFuiCalendar/BitzFuiCalendarStore.mjs +1 -1
  8. package/dist/components/BitzFuiCalendar/CalendarAgendum.mjs +1 -1
  9. package/dist/components/BitzFuiCalendar/CalendarAgendumItem.mjs +1 -1
  10. package/dist/components/BitzFuiCalendar/CalendarHeadItem.mjs +1 -1
  11. package/dist/components/BitzFuiCalendar/CalendarToolbar.mjs +1 -1
  12. package/dist/components/BitzFuiCalendar/ColumnData.mjs +1 -1
  13. package/dist/components/BitzMeetingTime/BitzMeetingTimeItem.mjs +1 -1
  14. package/dist/components/BitzMeetingTime/index.mjs +1 -1
  15. package/dist/components/BitzTable/ActionBar/style.mjs +9 -9
  16. package/dist/components/BitzTable/ActionCol/style.mjs +8 -8
  17. package/dist/components/BitzTable/Dropdown/style.mjs +7 -7
  18. package/dist/components/BitzTable/SelectionBar/style.mjs +5 -5
  19. package/dist/components/BitzTable/Store/index.d.ts +2 -2
  20. package/dist/components/BitzTable/Store/index.mjs +21 -19
  21. package/dist/components/BitzTable/Table/index.mjs +235 -211
  22. package/dist/components/BitzTable/Table/style.d.ts +4 -34
  23. package/dist/components/BitzTable/Table/style.mjs +8 -4
  24. package/dist/components/BitzTable/Table/utils.mjs +12 -12
  25. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.d.ts +2 -0
  26. package/dist/components/BitzTable/ToolBar/ColConfigIcon/ColumnSettingModal.mjs +244 -236
  27. package/dist/components/BitzTable/ToolBar/ColConfigIcon/index.mjs +32 -27
  28. package/dist/components/BitzTable/ToolBar/DensityIcon/index.mjs +36 -28
  29. package/dist/components/BitzTable/ToolBar/style.mjs +5 -5
  30. package/dist/components/BitzTable/index.d.ts +5 -3
  31. package/dist/components/BitzTable/index.mjs +7 -7
  32. package/dist/components/BitzTableSelect/Picker/index.d.ts +5 -2
  33. package/dist/components/BitzTableSelect/SelectPopup/getData.d.ts +1 -1
  34. package/dist/components/BitzTableSelect/SelectPopup/getData.mjs +32 -34
  35. package/dist/components/BitzTableSelect/SelectPopup/index.mjs +108 -109
  36. package/dist/components/BitzTableSelect/TableCell/index.mjs +1 -1
  37. package/dist/components/BitzTableSelect/TextBlock/index.mjs +7 -7
  38. package/dist/components/BitzTableSelect/index.d.ts +2 -2
  39. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/dayjs.min.mjs +292 -292
  40. package/dist/node_modules/.store/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +13 -13
  41. package/dist/node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/isBoolean.mjs +9 -0
  42. package/dist/style.css +1 -1
  43. package/dist/utils/time.mjs +1 -1
  44. package/package.json +1 -1
@@ -1,40 +1,10 @@
1
- export declare const getCssVar: ({ height, evenRowBgColor, colorBgContainer, table, gap, borderColor, }: {
1
+ export declare const getCssVar: ({ height, evenRowBgColor, colorBgContainer, table, gap, borderColor, scrollbarWidth, other, }: {
2
2
  height: any;
3
3
  evenRowBgColor: any;
4
4
  colorBgContainer: any;
5
5
  table: any;
6
6
  gap: any;
7
7
  borderColor: any;
8
- }) => {
9
- height: any;
10
- '--toolbar-bgColor': any;
11
- '--thead-bgColor': any;
12
- '--thead-hoverBgColor': any;
13
- '--evenRow-BgColor': any;
14
- '--oddRow-BgColor': any;
15
- '--radioCheckbox-borderColor': any;
16
- '--expandIcon-borderColor': any;
17
- '--rowHover-bgColor': any;
18
- '--borderColor': any;
19
- '--container-gap': string;
20
- '--xlTable-fontSize': string;
21
- '--lgTable-fontSize': string;
22
- '--mdTable-fontSize': string;
23
- '--smTable-fontSize': string;
24
- '--xsTable-fontSize': string;
25
- '--xlTable-height': string;
26
- '--lgTable-height': string;
27
- '--mdTable-height': string;
28
- '--smTable-height': string;
29
- '--xsTable-height': string;
30
- '--xlTable-lineHeight': string;
31
- '--lgTable-lineHeight': string;
32
- '--mdTable-lineHeight': string;
33
- '--smTable-lineHeight': string;
34
- '--xsTable-lineHeight': string;
35
- '--xlSkeleton-height': string;
36
- '--lgSkeleton-height': string;
37
- '--mdSkeleton-height': string;
38
- '--smSkeleton-height': string;
39
- '--xsSkeleton-height': string;
40
- };
8
+ scrollbarWidth: any;
9
+ other: any;
10
+ }) => any;
@@ -1,10 +1,12 @@
1
- const u = ({
1
+ const j = ({
2
2
  height: v,
3
3
  evenRowBgColor: w,
4
4
  colorBgContainer: e,
5
5
  table: o,
6
6
  gap: I,
7
- borderColor: R
7
+ borderColor: R,
8
+ scrollbarWidth: u,
9
+ other: V
8
10
  }) => {
9
11
  var h, i, g, x, r, n, T, p, s, d, $, H, m, S, C, k, f, z, B, c;
10
12
  return {
@@ -19,6 +21,7 @@ const u = ({
19
21
  "--rowHover-bgColor": o == null ? void 0 : o.rowHoverBg,
20
22
  "--borderColor": R,
21
23
  "--container-gap": `${I}px`,
24
+ "--scrollbar-width": `${u || 0}px`,
22
25
  "--xlTable-fontSize": `${(h = o == null ? void 0 : o.xlTable) == null ? void 0 : h.fontSize}px`,
23
26
  "--lgTable-fontSize": `${(i = o == null ? void 0 : o.lgTable) == null ? void 0 : i.fontSize}px`,
24
27
  "--mdTable-fontSize": `${(g = o == null ? void 0 : o.mdTable) == null ? void 0 : g.fontSize}px`,
@@ -38,10 +41,11 @@ const u = ({
38
41
  "--lgSkeleton-height": `${(f = o == null ? void 0 : o.lgTable) == null ? void 0 : f.skeletonHeight}px`,
39
42
  "--mdSkeleton-height": `${(z = o == null ? void 0 : o.mdTable) == null ? void 0 : z.skeletonHeight}px`,
40
43
  "--smSkeleton-height": `${(B = o == null ? void 0 : o.smTable) == null ? void 0 : B.skeletonHeight}px`,
41
- "--xsSkeleton-height": `${(c = o == null ? void 0 : o.xsTable) == null ? void 0 : c.skeletonHeight}px`
44
+ "--xsSkeleton-height": `${(c = o == null ? void 0 : o.xsTable) == null ? void 0 : c.skeletonHeight}px`,
42
45
  // '--tableBody-bootomBorderColor': table?.borderColor || '#f0f0f0',
46
+ ...V
43
47
  };
44
48
  };
45
49
  export {
46
- u as getCssVar
50
+ j as getCssVar
47
51
  };
@@ -1,19 +1,19 @@
1
1
  import { j as f } from "../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { Skeleton as x, Table as d } from "antd";
3
- function a(o, t) {
2
+ import { Skeleton as x, Table as l } from "antd";
3
+ function a(o, r) {
4
4
  return o == null ? void 0 : o.map((e) => {
5
5
  const n = { ...e };
6
- return e != null && e.isOperationCol || e != null && e.isToolCol || t.includes(e) ? e : (n != null && n.children && (n.children = a(n == null ? void 0 : n.children, t)), {
6
+ return e != null && e.isOperationCol || e != null && e.isCheckboxCol || e != null && e.isExpandIconCol || r.includes(e) ? e : (n != null && n.children && (n.children = a(n == null ? void 0 : n.children, r)), {
7
7
  ...n,
8
8
  sorter: !1,
9
- render: (l, i, r) => /* @__PURE__ */ f.jsx(
9
+ render: (d, i, t) => /* @__PURE__ */ f.jsx(
10
10
  x,
11
11
  {
12
12
  active: !0,
13
13
  title: !1,
14
14
  paragraph: {
15
15
  rows: 1,
16
- width: (r + 1) % 2 === 0 ? "100%" : "60%"
16
+ width: (t + 1) % 2 === 0 ? "100%" : "60%"
17
17
  }
18
18
  }
19
19
  )
@@ -21,18 +21,18 @@ function a(o, t) {
21
21
  });
22
22
  }
23
23
  const C = 0, c = 1;
24
- function s(o, t, e, n) {
25
- let l = C;
24
+ function s(o, r, e, n) {
25
+ let d = C;
26
26
  if (e) {
27
- const i = o.indexOf(d.SELECTION_COLUMN);
28
- i >= 0 && (l = i), t.splice(l, 0, d.SELECTION_COLUMN);
27
+ const i = o.indexOf(l.SELECTION_COLUMN);
28
+ i >= 0 && (d = i), r.splice(d, 0, l.SELECTION_COLUMN);
29
29
  }
30
30
  if (n) {
31
31
  let i = 0;
32
- const r = o.indexOf(d.EXPAND_COLUMN);
33
- r >= 0 && (i = r), e && l === 0 && r === -1 && (i = c), t.splice(i, 0, d.EXPAND_COLUMN);
32
+ const t = o.indexOf(l.EXPAND_COLUMN);
33
+ t >= 0 && (i = t), e && d === 0 && t === -1 && (i = c), r.splice(i, 0, l.EXPAND_COLUMN);
34
34
  }
35
- return t;
35
+ return r;
36
36
  }
37
37
  export {
38
38
  s as getColumnsWithTool,
@@ -1,8 +1,10 @@
1
+ import { ModalProps } from 'antd';
1
2
  import React from 'react';
2
3
  import { BitzTableToolBarProps } from '..';
3
4
  import './index.less';
4
5
  export interface ColConfigModalProps {
5
6
  onChange?: BitzTableToolBarProps['onColumnChange'];
7
+ getContainer: ModalProps['getContainer'];
6
8
  }
7
9
  declare const ColConfigModal: React.FC<ColConfigModalProps & import("@ebay/nice-modal-react").NiceModalHocProps>;
8
10
  export default ColConfigModal;
@@ -1,249 +1,257 @@
1
1
  import { j as o } from "../../../../node_modules/.store/react@18.2.0/node_modules/react/jsx-runtime.mjs";
2
- import { create as oe, useModal as se, antdModalV5 as te } from "@ebay/nice-modal-react";
3
- import { Modal as le, Typography as ne, Checkbox as re, Button as ae } from "antd";
2
+ import { create as se, useModal as te, antdModalV5 as le } from "@ebay/nice-modal-react";
3
+ import { Modal as ne, Typography as re, Checkbox as ae, Button as ce } from "antd";
4
4
  import r from "./index.module.less.mjs";
5
- import { useState as N, useContext as ce, useEffect as ie, useCallback as V, useMemo as M } from "react";
6
- import { TableContext as me } from "../../Store/index.mjs";
7
- import { genColumnKey as F, columnSort as de } from "../../Store/utils/index.mjs";
5
+ import { useState as N, useContext as ie, useEffect as me, useCallback as V, useMemo as M } from "react";
6
+ import { BitzTableContext as de } from "../../Store/index.mjs";
7
+ import { genColumnKey as F, columnSort as ue } from "../../Store/utils/index.mjs";
8
8
  import p from "../../../../node_modules/.store/classnames@2.5.1/node_modules/classnames/index.mjs";
9
- import { DndContext as ue } from "../../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
10
- import { SortableContext as pe, verticalListSortingStrategy as fe, arrayMove as he } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
11
- import xe from "./DndItem.mjs";
12
- import { restrictToVerticalAxis as be, restrictToWindowEdges as ye } from "../../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
9
+ import { DndContext as pe } from "../../../../node_modules/.store/@dnd-kit_core@6.1.0/node_modules/@dnd-kit/core/dist/core.esm.mjs";
10
+ import { SortableContext as he, verticalListSortingStrategy as xe, arrayMove as fe } from "../../../../node_modules/.store/@dnd-kit_sortable@7.0.2/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs";
11
+ import be from "./DndItem.mjs";
12
+ import { restrictToVerticalAxis as ye, restrictToWindowEdges as Ce } from "../../../../node_modules/.store/@dnd-kit_modifiers@6.0.1/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs";
13
13
  import P from "../../../BitzButton/index.mjs";
14
- import { useImmer as Ce } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
15
- import { css as Me } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
16
- import je from "../../../BitzTheme/index.mjs";
14
+ import { useImmer as Me } from "../../../../node_modules/.store/use-immer@0.9.0/node_modules/use-immer/dist/use-immer.module.mjs";
15
+ import { css as je } from "../../../../node_modules/.store/@emotion_css@11.11.2/node_modules/@emotion/css/dist/emotion-css.esm.mjs";
16
+ import ke from "../../../BitzTheme/index.mjs";
17
17
  import "./index.less.mjs";
18
18
  import W from "../../../../node_modules/.store/lodash-es@4.17.21/node_modules/lodash-es/omit.mjs";
19
- import ke from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
20
- import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
21
- const $e = oe(({ onChange: x }) => {
22
- var _, E, z, H;
23
- const { token: i } = je.useToken(), b = se(), [j, k] = N(null), [$, K] = N(!1), [q, w] = N(!1), [a, y] = Ce({
24
- columnsMap: {},
25
- sortKeyColumns: []
26
- }), {
27
- persistenceType: G,
28
- persistenceKey: B,
29
- onlineChange: g,
30
- columnsMap: J,
31
- setColumnsMap: L,
32
- sortKeyColumns: Q,
33
- setSortKeyColumns: U,
34
- // clearPersistenceStorage,
35
- ...l
36
- } = ce(me);
37
- ie(() => {
38
- y((e) => {
39
- e.columnsMap = { ...J }, e.sortKeyColumns = [...Q];
40
- });
41
- }, []);
42
- const X = V(() => {
43
- y((e) => {
44
- e.columnsMap = { ...l.defaultColumnKeyMap };
45
- });
46
- }, []), f = M(() => {
47
- var s, n;
48
- const e = [];
49
- return (s = l == null ? void 0 : l.columns) != null && s.length && ((n = l == null ? void 0 : l.columns) == null || n.map(({ key: u, dataIndex: t, ...m }) => {
50
- const C = F(
51
- u || t,
52
- [u || t].filter(Boolean).join("-")
53
- ), d = a.columnsMap[C || "null"];
54
- return (d == null ? void 0 : d.show) !== !1 && e.push({
55
- key: C,
56
- ...W(m, ["className"]),
57
- selectable: !1,
58
- disabled: (d == null ? void 0 : d.disable) === !0
59
- }), d;
60
- })), e.sort(de(a.columnsMap));
61
- }, [a.columnsMap, l == null ? void 0 : l.columns]), S = V(
62
- (e) => {
63
- var s;
64
- return (s = a.sortKeyColumns) == null ? void 0 : s.findIndex((n) => n === e);
65
- },
66
- [a.sortKeyColumns]
67
- ), T = M(
68
- () => j ? S(j) : -1,
69
- [j, S]
70
- ), D = M(() => {
71
- const e = [], s = /* @__PURE__ */ new Map();
72
- return { list: ((u, t) => u.map(({ key: m, dataIndex: C, children: d, ...R }) => {
73
- var O;
74
- const v = F(
75
- m || C,
76
- [t == null ? void 0 : t.columnKey, R.index].filter(Boolean).join("-")
77
- ), c = a.columnsMap[v || "null"] || { show: !0 };
78
- (c == null ? void 0 : c.show) !== !1 && !d && e.push(v);
79
- const A = {
80
- key: v,
81
- ...W(R, ["className"]),
82
- selectable: !1,
83
- disabled: c.disable === !0,
84
- disableCheckbox: typeof c.disable == "boolean" ? c == null ? void 0 : c.disable : (O = c == null ? void 0 : c.disable) == null ? void 0 : O.checkbox,
85
- isLeaf: t ? !0 : void 0
86
- };
87
- return s.set(m, A), A;
88
- }))(l == null ? void 0 : l.columns), keys: e, map: s };
89
- }, [a.columnsMap, l == null ? void 0 : l.columns]), Y = (e, s) => {
90
- const n = { ...a.columnsMap };
91
- ((t) => {
92
- const m = { ...n[t] };
93
- m.show = !e, n[t] = m;
94
- })(s.key), w(!0), y((t) => {
95
- t.columnsMap = { ...n };
96
- });
97
- }, Z = (e, s) => {
98
- const n = { ...a.columnsMap }, u = he(a.sortKeyColumns, e, s);
99
- u.forEach((t, m) => {
100
- n[t] = { ...n[t] || {}, order: m };
101
- }), w(!0), y((t) => {
102
- t.columnsMap = { ...n }, t.sortKeyColumns = u;
103
- });
104
- }, ee = () => {
105
- var e;
106
- L(a.columnsMap), U(a.sortKeyColumns), G === "online" && B && (g == null || g(B, a.columnsMap)), x ? (K(!0), (e = x == null ? void 0 : x(a.columnsMap)) == null || e.finally(() => {
107
- K(!1), b.hide();
108
- })) : b.hide();
109
- }, I = () => {
110
- b.hide();
111
- }, h = M(() => i.mode === "dark", [i.mode]);
112
- return /* @__PURE__ */ o.jsxs(
113
- le,
114
- {
115
- className: "tableColumnSettingModal",
116
- title: /* @__PURE__ */ o.jsx(ne.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
117
- getContainer: !1,
118
- ...te(b),
119
- style: {
120
- "--modalContent-bgColor": (_ = i.Modal) == null ? void 0 : _.contentBg,
121
- "--header-bgColor": (E = i.Modal) == null ? void 0 : E.headerBg,
122
- "--footer-bgColor": (z = i.Modal) == null ? void 0 : z.footerBg,
123
- "--blockTitle-colorBg": h ? "#333" : "#fff",
124
- "--leftBody-bgColor": h ? "#262626" : "#e0e0e0",
125
- "--rightBody-bgColor": h ? "#262626" : "#fff",
126
- "--checked": h ? "#303030" : "#eee",
127
- "--block-bgColor": h ? "#222" : "#fff",
128
- "--colorText": i.colorText,
129
- "--colorText-desc": i.colorTextDescription,
130
- "--colorBorder": i.colorBorder
19
+ import ge from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.mjs";
20
+ import Se from "../../../../node_modules/.store/@ant-design_icons@5.3.5/node_modules/@ant-design/icons/es/icons/RedoOutlined.mjs";
21
+ const qe = se(
22
+ ({ onChange: f, getContainer: $ }) => {
23
+ var _, E, z, H;
24
+ const { token: i } = ke.useToken(), b = te(), [j, k] = N(null), [q, K] = N(!1), [G, w] = N(!1), [a, y] = Me({
25
+ columnsMap: {},
26
+ sortKeyColumns: []
27
+ }), {
28
+ persistenceType: J,
29
+ persistenceKey: B,
30
+ onlineChange: g,
31
+ columnsMap: L,
32
+ setColumnsMap: Q,
33
+ sortKeyColumns: U,
34
+ setSortKeyColumns: X,
35
+ // clearPersistenceStorage,
36
+ ...l
37
+ } = ie(de);
38
+ me(() => {
39
+ y((e) => {
40
+ e.columnsMap = { ...L }, e.sortKeyColumns = [...U];
41
+ });
42
+ }, []);
43
+ const Y = V(() => {
44
+ y((e) => {
45
+ e.columnsMap = { ...l.defaultColumnKeyMap };
46
+ });
47
+ }, []), h = M(() => {
48
+ var s, n;
49
+ const e = [];
50
+ return (s = l == null ? void 0 : l.columns) != null && s.length && ((n = l == null ? void 0 : l.columns) == null || n.map(
51
+ ({ key: u, dataIndex: t, ...m }) => {
52
+ const C = F(
53
+ u || t,
54
+ [u || t].filter(Boolean).join("-")
55
+ ), d = a.columnsMap[C || "null"];
56
+ return (d == null ? void 0 : d.show) !== !1 && e.push({
57
+ key: C,
58
+ ...W(m, ["className"]),
59
+ selectable: !1,
60
+ disabled: (d == null ? void 0 : d.disable) === !0
61
+ }), d;
62
+ }
63
+ )), e.sort(ue(a.columnsMap));
64
+ }, [a.columnsMap, l == null ? void 0 : l.columns]), S = V(
65
+ (e) => {
66
+ var s;
67
+ return (s = a.sortKeyColumns) == null ? void 0 : s.findIndex((n) => n === e);
131
68
  },
132
- styles: { body: { maxHeight: window.innerHeight - 300 } },
133
- width: 600,
134
- onCancel: I,
135
- footer: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
136
- /* @__PURE__ */ o.jsx(
137
- P,
138
- {
139
- type: "primary",
140
- icon: /* @__PURE__ */ o.jsx(ke, {}),
141
- onClick: ee,
142
- disabled: !q,
143
- loading: $,
144
- children: "保存"
145
- }
146
- ),
147
- /* @__PURE__ */ o.jsx(P, { onClick: I, children: "取消" })
148
- ] }),
149
- children: [
150
- /* @__PURE__ */ o.jsx("div", { className: p(r.introduce, "tableColumnSetting_introduce"), children: "选择要在表中显示的可用列。拖动选定的列以对其重新排序。" }),
151
- /* @__PURE__ */ o.jsxs(
152
- "div",
153
- {
154
- className: p(r.container, "tableColumnSetting_container"),
155
- style: { maxHeight: window.innerHeight - 390, overflow: "auto" },
156
- children: [
157
- /* @__PURE__ */ o.jsxs("div", { className: r.block, children: [
158
- /* @__PURE__ */ o.jsxs("div", { className: p(r.header, "tableColumnSetting_header"), children: [
159
- /* @__PURE__ */ o.jsx("div", { className: p(r.title, "tableColumnSetting_title"), children: "可用列" }),
160
- /* @__PURE__ */ o.jsx("div", {})
161
- ] }),
162
- /* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body"), children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: (H = D.list) == null ? void 0 : H.map((e) => {
163
- const s = D.keys.includes(e.key);
164
- return /* @__PURE__ */ o.jsxs(
165
- "li",
166
- {
167
- className: p(r.item, {
168
- [r.checked]: !s,
169
- tableColumnSetting_checked: !s
170
- }),
171
- onClick: () => !e.disabled && Y(s, e),
172
- children: [
173
- /* @__PURE__ */ o.jsx(re, { checked: s, disabled: e.disabled }),
174
- /* @__PURE__ */ o.jsx(
175
- "span",
176
- {
177
- className: p(
178
- r["content-item-text"],
179
- {
180
- [r["content-item-text-disabled"]]: e.disabled
181
- },
182
- "tableColumnSetting_content-item-text"
183
- ),
184
- children: e.title
185
- }
186
- )
187
- ]
188
- },
189
- e.key
190
- );
191
- }) }) })
192
- ] }),
193
- /* @__PURE__ */ o.jsxs("div", { className: r.block, children: [
194
- /* @__PURE__ */ o.jsxs("div", { className: r.header, children: [
195
- /* @__PURE__ */ o.jsx("div", { className: r.title, children: "选定列" }),
196
- /* @__PURE__ */ o.jsx(
197
- ae,
198
- {
199
- type: "link",
200
- icon: /* @__PURE__ */ o.jsx(ge, {}),
201
- size: "small",
202
- onClick: X,
203
- className: Me`
204
- &:hover {
205
- color: ${i.colorPrimary} !important;
206
- }
207
- `,
208
- children: "重置"
209
- }
210
- )
69
+ [a.sortKeyColumns]
70
+ ), T = M(
71
+ () => j ? S(j) : -1,
72
+ [j, S]
73
+ ), D = M(() => {
74
+ const e = [], s = /* @__PURE__ */ new Map();
75
+ return {
76
+ list: ((u, t) => u.map(({ key: m, dataIndex: C, children: d, ...R }) => {
77
+ var O;
78
+ const v = F(
79
+ m || C,
80
+ [t == null ? void 0 : t.columnKey, R.index].filter(Boolean).join("-")
81
+ ), c = a.columnsMap[v || "null"] || { show: !0 };
82
+ (c == null ? void 0 : c.show) !== !1 && !d && e.push(v);
83
+ const A = {
84
+ key: v,
85
+ ...W(R, ["className"]),
86
+ selectable: !1,
87
+ disabled: c.disable === !0,
88
+ disableCheckbox: typeof c.disable == "boolean" ? c == null ? void 0 : c.disable : (O = c == null ? void 0 : c.disable) == null ? void 0 : O.checkbox,
89
+ isLeaf: t ? !0 : void 0
90
+ };
91
+ return s.set(m, A), A;
92
+ }))((l == null ? void 0 : l.columns) ?? []),
93
+ keys: e,
94
+ map: s
95
+ };
96
+ }, [a.columnsMap, l == null ? void 0 : l.columns]), Z = (e, s) => {
97
+ const n = { ...a.columnsMap };
98
+ ((t) => {
99
+ const m = { ...n[t] };
100
+ m.show = !e, n[t] = m;
101
+ })(s.key), w(!0), y((t) => {
102
+ t.columnsMap = { ...n };
103
+ });
104
+ }, ee = (e, s) => {
105
+ const n = { ...a.columnsMap }, u = fe(a.sortKeyColumns, e, s);
106
+ u.forEach((t, m) => {
107
+ n[t] = { ...n[t] || {}, order: m };
108
+ }), w(!0), y((t) => {
109
+ t.columnsMap = { ...n }, t.sortKeyColumns = u;
110
+ });
111
+ }, oe = () => {
112
+ var e;
113
+ Q(a.columnsMap), X(a.sortKeyColumns), J === "online" && B && (g == null || g(B, a.columnsMap)), f ? (K(!0), (e = f == null ? void 0 : f(a.columnsMap)) == null || e.finally(() => {
114
+ K(!1), b.hide();
115
+ })) : b.hide();
116
+ }, I = () => {
117
+ b.hide();
118
+ }, x = M(() => i.mode === "dark", [i.mode]);
119
+ return /* @__PURE__ */ o.jsxs(
120
+ ne,
121
+ {
122
+ className: "tableColumnSettingModal",
123
+ title: /* @__PURE__ */ o.jsx(re.Title, { style: { fontSize: 16, margin: 0 }, children: "列设置" }),
124
+ getContainer: $,
125
+ ...le(b),
126
+ style: {
127
+ "--modalContent-bgColor": (_ = i.Modal) == null ? void 0 : _.contentBg,
128
+ "--header-bgColor": (E = i.Modal) == null ? void 0 : E.headerBg,
129
+ "--footer-bgColor": (z = i.Modal) == null ? void 0 : z.footerBg,
130
+ "--blockTitle-colorBg": x ? "#333" : "#fff",
131
+ "--leftBody-bgColor": x ? "#262626" : "#e0e0e0",
132
+ "--rightBody-bgColor": x ? "#262626" : "#fff",
133
+ "--checked": x ? "#303030" : "#eee",
134
+ "--block-bgColor": x ? "#222" : "#fff",
135
+ "--colorText": i.colorText,
136
+ "--colorText-desc": i.colorTextDescription,
137
+ "--colorBorder": i.colorBorder
138
+ },
139
+ styles: { body: { maxHeight: window.innerHeight - 300 } },
140
+ width: 600,
141
+ onCancel: I,
142
+ footer: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
143
+ /* @__PURE__ */ o.jsx(
144
+ P,
145
+ {
146
+ type: "primary",
147
+ icon: /* @__PURE__ */ o.jsx(ge, {}),
148
+ onClick: oe,
149
+ disabled: !G,
150
+ loading: q,
151
+ children: "保存"
152
+ }
153
+ ),
154
+ /* @__PURE__ */ o.jsx(P, { onClick: I, children: "取消" })
155
+ ] }),
156
+ children: [
157
+ /* @__PURE__ */ o.jsx("div", { className: p(r.introduce, "tableColumnSetting_introduce"), children: "选择要在表中显示的可用列。拖动选定的列以对其重新排序。" }),
158
+ /* @__PURE__ */ o.jsxs(
159
+ "div",
160
+ {
161
+ className: p(r.container, "tableColumnSetting_container"),
162
+ style: { maxHeight: window.innerHeight - 390, overflow: "auto" },
163
+ children: [
164
+ /* @__PURE__ */ o.jsxs("div", { className: r.block, children: [
165
+ /* @__PURE__ */ o.jsxs("div", { className: p(r.header, "tableColumnSetting_header"), children: [
166
+ /* @__PURE__ */ o.jsx("div", { className: p(r.title, "tableColumnSetting_title"), children: "可用列" }),
167
+ /* @__PURE__ */ o.jsx("div", {})
168
+ ] }),
169
+ /* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body"), children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: (H = D.list) == null ? void 0 : H.map((e) => {
170
+ const s = D.keys.includes(e.key);
171
+ return /* @__PURE__ */ o.jsxs(
172
+ "li",
173
+ {
174
+ className: p(r.item, {
175
+ [r.checked]: !s,
176
+ tableColumnSetting_checked: !s
177
+ }),
178
+ onClick: () => !e.disabled && Z(s, e),
179
+ children: [
180
+ /* @__PURE__ */ o.jsx(ae, { checked: s, disabled: e.disabled }),
181
+ /* @__PURE__ */ o.jsx(
182
+ "span",
183
+ {
184
+ className: p(
185
+ r["content-item-text"],
186
+ {
187
+ [r["content-item-text-disabled"]]: e.disabled
188
+ },
189
+ "tableColumnSetting_content-item-text"
190
+ ),
191
+ children: e.title
192
+ }
193
+ )
194
+ ]
195
+ },
196
+ e.key
197
+ );
198
+ }) }) })
211
199
  ] }),
212
- /* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body-order"), children: /* @__PURE__ */ o.jsx(
213
- ue,
214
- {
215
- modifiers: [be, ye],
216
- onDragStart: (e) => {
217
- const { active: s } = e;
218
- s && k(s == null ? void 0 : s.id);
219
- },
220
- onDragCancel: () => k(null),
221
- onDragEnd: (e) => {
222
- k(null);
223
- const { over: s } = e;
224
- if (s) {
225
- const n = S(s.id);
226
- T !== n && Z(T, n);
227
- }
228
- },
229
- children: /* @__PURE__ */ o.jsx(
230
- pe,
200
+ /* @__PURE__ */ o.jsxs("div", { className: r.block, children: [
201
+ /* @__PURE__ */ o.jsxs("div", { className: r.header, children: [
202
+ /* @__PURE__ */ o.jsx("div", { className: r.title, children: "选定列" }),
203
+ /* @__PURE__ */ o.jsx(
204
+ ce,
231
205
  {
232
- items: f == null ? void 0 : f.map((e) => e.key),
233
- strategy: fe,
234
- children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: f == null ? void 0 : f.map((e) => /* @__PURE__ */ o.jsx(xe, { item: e }, e.key)) })
206
+ type: "link",
207
+ icon: /* @__PURE__ */ o.jsx(Se, {}),
208
+ size: "small",
209
+ onClick: Y,
210
+ className: je`
211
+ &:hover {
212
+ color: ${i.colorPrimary} !important;
213
+ }
214
+ `,
215
+ children: "重置"
235
216
  }
236
217
  )
237
- }
238
- ) })
239
- ] })
240
- ]
241
- }
242
- )
243
- ]
244
- }
245
- );
246
- });
218
+ ] }),
219
+ /* @__PURE__ */ o.jsx("div", { className: p(r.body, "tableColumnSetting_body-order"), children: /* @__PURE__ */ o.jsx(
220
+ pe,
221
+ {
222
+ modifiers: [ye, Ce],
223
+ onDragStart: (e) => {
224
+ const { active: s } = e;
225
+ s && k(s == null ? void 0 : s.id);
226
+ },
227
+ onDragCancel: () => k(null),
228
+ onDragEnd: (e) => {
229
+ k(null);
230
+ const { over: s } = e;
231
+ if (s) {
232
+ const n = S(s.id);
233
+ T !== n && ee(T, n);
234
+ }
235
+ },
236
+ children: /* @__PURE__ */ o.jsx(
237
+ he,
238
+ {
239
+ items: h == null ? void 0 : h.map((e) => e.key),
240
+ strategy: xe,
241
+ children: /* @__PURE__ */ o.jsx("ul", { className: r.content, children: h == null ? void 0 : h.map((e) => /* @__PURE__ */ o.jsx(be, { item: e }, e.key)) })
242
+ }
243
+ )
244
+ }
245
+ ) })
246
+ ] })
247
+ ]
248
+ }
249
+ )
250
+ ]
251
+ }
252
+ );
253
+ }
254
+ );
247
255
  export {
248
- $e as default
256
+ qe as default
249
257
  };