@baishuyun/ui-base 6.16.0 → 6.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Amap/Amap-CNsoge6e.js +826 -0
- package/dist/Amap/index.js +3 -10
- package/dist/Calendar/Calendar-BlsUX2vX.js +1608 -0
- package/dist/Calendar/index.js +10 -20
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/{CheckBox-B92dxWNo.js → CheckBox-CM24-quL.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/{ColorPicker-CPr5j6ZN.js → ColorPicker-B_wLqurt.js} +5 -5
- package/dist/ColorPicker/index.js +5 -5
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/DatePicker-BRwPZeui.js +111 -0
- package/dist/DatePicker/{DatePickerPanel-CRnLvIwc.js → DatePickerPanel-UwjSXS-U.js} +3 -4
- package/dist/DatePicker/index.js +6 -8
- package/dist/DatePicker/pickerLocale-Brf7_Tnd.js +30 -0
- package/dist/DropDown/{DropDown-CvG9IFVk.js → DropDown-B_szM67V.js} +86 -82
- package/dist/DropDown/index.js +8 -9
- package/dist/Editor/index.js +2839 -880
- package/dist/Gantt/index.js +3055 -197
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-BfZycXw4.js → InputTag-C_5nm0eo.js} +2 -2
- package/dist/InputTag/index.js +4 -4
- package/dist/Loading/{Loading-DpbJSRYf.js → Loading-Cherk9Ax.js} +1 -1
- package/dist/Loading/index.js +3 -3
- package/dist/Modal/index.js +2 -2
- package/dist/NotFoundContent/index.js +2 -2
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +2 -2
- package/dist/ScrollBar/{ScrollBar-N2pOLv-8.js → ScrollBar-IMTuAOF5.js} +1 -1
- package/dist/ScrollBar/index.js +2 -2
- package/dist/Segmented/{Segmented-BCQRrc65.js → Segmented-DpmwFerw.js} +1 -1
- package/dist/Segmented/index.js +2 -2
- package/dist/Select/{Select-Bla1mQ8v.js → Select-VIy6OKEj.js} +262 -259
- package/dist/Select/{SelectInputSearch-CRgBcsq2.js → SelectInputSearch-MApQHnU9.js} +21 -10
- package/dist/Select/index.js +12 -13
- package/dist/Table/Table-8ac6xLZv.js +808 -0
- package/dist/Table/index.js +4 -8
- package/dist/Tabs/{Tabs-B9uCGlxM.js → Tabs-DnoZ8BO0.js} +3 -3
- package/dist/Tabs/index.js +4 -4
- package/dist/Tooltip/{Tooltip-nJU13gX4.js → Tooltip-DBrt3t2r.js} +3 -3
- package/dist/Tooltip/index.js +3 -3
- package/dist/Tree/index.js +4 -4
- package/dist/components/Editor/EditorHtmlPreview.d.ts +3 -0
- package/dist/components/Editor/Preview/HtmlPreview.d.ts +2 -3
- package/dist/components/Editor/__tests__/createTestEditor.d.ts +1 -0
- package/dist/components/Editor/constants/portableEditorStyles.d.ts +2 -0
- package/dist/components/Editor/hooks/useEditorFocus.d.ts +1 -0
- package/dist/components/Editor/hooks/useTextFormatsState.d.ts +1 -2
- package/dist/components/Editor/index.d.ts +1 -0
- package/dist/components/Editor/nodes/ExtendedLinkNode.d.ts +9 -0
- package/dist/components/Editor/utils/getToolbarItems.d.ts +14 -0
- package/dist/components/Editor/utils/placeProgrammaticCaret.d.ts +5 -0
- package/dist/components/Editor/utils/readTextFormats.d.ts +6 -0
- package/dist/components/Editor/utils/retainCodeSelection.d.ts +3 -0
- package/dist/components/Select/SelectInputSearch/SelectInputSearch.d.ts +2 -0
- package/dist/index.js +28 -50
- package/dist/style.css +1 -1
- package/dist/vendors/Tree-D0Q1IZ2D.js +267 -0
- package/dist/vendors/{version-CFii9VTt.js → version-CfjNx5v2.js} +1 -1
- package/package.json +1 -1
- package/dist/Amap/Amap-BLSziesG.js +0 -77
- package/dist/Amap/AmapCircle/index.js +0 -5
- package/dist/Amap/AmapCircle-2qupysHe.js +0 -55
- package/dist/Amap/AmapContext-CJBe6lld.js +0 -11
- package/dist/Amap/AmapMarker/index.js +0 -6
- package/dist/Amap/AmapMarker-xEqoVnFR.js +0 -153
- package/dist/Amap/AmapMarkerCluster/index.js +0 -6
- package/dist/Amap/AmapMarkerCluster-CvEQa3o9.js +0 -240
- package/dist/Amap/AmapProvider/index.js +0 -7
- package/dist/Amap/AmapProvider-B-R2DrkJ.js +0 -107
- package/dist/Amap/hooks/index.js +0 -4
- package/dist/Amap/hooks-BTcFpdd0.js +0 -121
- package/dist/Amap/useMarkerInfoWindowController-Cjx0xQXw.js +0 -94
- package/dist/Calendar/AllDaySection-pO7suGJM.js +0 -53
- package/dist/Calendar/Calendar-DUD4iffO.js +0 -795
- package/dist/Calendar/CurrentTimeIndicator-BF3_INSL.js +0 -65
- package/dist/Calendar/EventCard-DKEZQRTp.js +0 -155
- package/dist/Calendar/TimeAxis-DUc6EL-j.js +0 -13
- package/dist/Calendar/TimeGrid-BV8x9VnF.js +0 -47
- package/dist/Calendar/colorUtils-BbeSMnOs.js +0 -55
- package/dist/Calendar/context/index.js +0 -3
- package/dist/Calendar/context-CamSpkj3.js +0 -21
- package/dist/Calendar/layout-CpOabFQ2.js +0 -300
- package/dist/Calendar/subcomponents/AllDaySection/index.js +0 -11
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +0 -8
- package/dist/Calendar/subcomponents/EventCard/index.js +0 -9
- package/dist/Calendar/subcomponents/TimeAxis/index.js +0 -5
- package/dist/Calendar/subcomponents/TimeGrid/index.js +0 -7
- package/dist/Calendar/theme-Dc8hjcdo.js +0 -71
- package/dist/Calendar/utils/index.js +0 -111
- package/dist/Calendar/utils/layout/index.js +0 -4
- package/dist/Calendar/utils/theme/index.js +0 -3
- package/dist/DatePicker/DatePicker-BWMmI6rl.js +0 -101
- package/dist/DatePicker/ensureDayjsPlugins-CSqhjLS7.js +0 -15
- package/dist/DatePicker/pickerLocale-CcPLUbZO.js +0 -15
- package/dist/DatePicker/style/index.js +0 -3
- package/dist/DatePicker/style-W7f5wyUb.js +0 -15
- package/dist/DropDown/style/index.js +0 -3
- package/dist/DropDown/style-DZpkarne.js +0 -9
- package/dist/Editor/Buttons-vt3gwedu.js +0 -1841
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +0 -21
- package/dist/Editor/constants/index.js +0 -61
- package/dist/Gantt/GanttChart/index.js +0 -21
- package/dist/Gantt/GanttChart-DRzJdEm-.js +0 -2292
- package/dist/Gantt/GanttHighlightContext-dtyoq-oj.js +0 -12
- package/dist/Gantt/GanttTable/index.js +0 -13
- package/dist/Gantt/GanttTable-fOv1Zn2-.js +0 -84
- package/dist/Gantt/GanttToolBar/index.js +0 -17
- package/dist/Gantt/GanttToolBar-4kxZP6oS.js +0 -120
- package/dist/Gantt/collapseKeys-BV_8sIA-.js +0 -160
- package/dist/Gantt/columnResize-Bkenlbab.js +0 -46
- package/dist/Gantt/constants-mEGQ1U1Q.js +0 -39
- package/dist/Gantt/highlightTarget-D3Nf9_7S.js +0 -25
- package/dist/Gantt/theme-B7Iap-tZ.js +0 -31
- package/dist/Gantt/timelineViewConfig-DNt7yi83.js +0 -118
- package/dist/Gantt/utils/index.js +0 -7
- package/dist/Gantt/utils/theme/index.js +0 -3
- package/dist/Select/style/index.js +0 -3
- package/dist/Select/style-C4A8kUd1.js +0 -9
- package/dist/Table/Table-3LSO0xSH.js +0 -545
- package/dist/Table/constants-D7wLH8Qy.js +0 -25
- package/dist/Table/hooks/index.js +0 -3
- package/dist/Table/hooks-DSBl2e4O.js +0 -108
- package/dist/Table/processRowspan-B6HMqw0Q.js +0 -144
- package/dist/Table/style/index.js +0 -3
- package/dist/Table/style-B8Cw8HJe.js +0 -9
- package/dist/Table/utils/index.js +0 -3
- package/dist/Tree/utils/index.js +0 -26
- package/dist/vendors/Tree-DSl4lDjx.js +0 -248
- /package/dist/Card/{Card-rJeWgxu5.js → Card-DAz0dvA3.js} +0 -0
- /package/dist/CheckBox/{CheckBox-DOK5N7z6.js → CheckBox-CcHskTz_.js} +0 -0
- /package/dist/Modal/{Modal-CRKitOOj.js → Modal-eZijJ7CB.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-BLmzWNBi.js → NotFoundContent-DJUQ0_2D.js} +0 -0
- /package/dist/Radio/{Radio-CX9cUqb7.js → Radio-D9jhW7K6.js} +0 -0
- /package/dist/vendors/{animations-Dn_5xJ7B.js → animations-ISccYUE3.js} +0 -0
- /package/dist/vendors/{cssVars-l4-kP_14.js → cssVars-UpriQzph.js} +0 -0
- /package/dist/vendors/{mergeRefs-TiJ0xjUN.js → mergeRefs-mEH9TBYV.js} +0 -0
- /package/dist/vendors/{useFloatingOverlay-B3M9k8nj.js → useFloatingOverlay-B66lOL8v.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-VpzL-EPh.js → useFloatingPortal-DJ1iKmW-.js} +0 -0
- /package/dist/vendors/{useLatchedPopupPortalRoot-4fVhqVT4.js → useLatchedPopupPortalRoot-CC6af8t-.js} +0 -0
- /package/dist/vendors/{useLocale-D31qCCff.js → useLocale-Be4e7Xfn.js} +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../vendors/cssVars-l4-kP_14.js";
|
|
2
|
-
//#region src/components/Select/style/resolveSelectThemeVars.ts
|
|
3
|
-
var t = (t) => {
|
|
4
|
-
if (!t) return {};
|
|
5
|
-
let n = {}, r = t.colorPrimary;
|
|
6
|
-
return e(n, "--bsy-select-color-bg", t.colorBgContainer), e(n, "--bsy-select-color-bg-elevated", t.colorBgElevated ?? t.colorBgContainer), e(n, "--bsy-select-color-text", t.colorText), e(n, "--bsy-select-color-text-placeholder", t.colorTextPlaceholder), e(n, "--bsy-select-color-icon", t.colorIcon), e(n, "--bsy-select-color-icon-hover", t.colorIconHover ?? r), e(n, "--bsy-select-color-border", t.colorBorder), e(n, "--bsy-select-color-border-hover", t.colorBorderHover ?? r), e(n, "--bsy-select-color-bg-disabled", t.colorBgDisabled), e(n, "--bsy-select-color-text-disabled", t.colorTextDisabled), e(n, "--bsy-select-color-border-disabled", t.colorBorderDisabled), e(n, "--bsy-select-item-hover-bg", t.itemHoverBg), e(n, "--bsy-select-item-active-bg", t.itemActiveBg), e(n, "--bsy-select-item-active-color", t.itemActiveColor ?? r), e(n, "--bsy-select-item-color-disabled", t.itemColorDisabled), e(n, "--bsy-select-item-system-color", t.itemSystemColor), e(n, "--bsy-select-color-highlight", t.colorHighlight ?? r), e(n, "--bsy-select-tag-bg", t.tagBg), e(n, "--bsy-select-tag-color", t.tagColor), e(n, "--bsy-select-tag-bg-disabled", t.tagBgDisabled), e(n, "--bsy-select-tag-color-disabled", t.tagColorDisabled), n;
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { t };
|
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
import { t as e } from "../vendors/useLocale-D31qCCff.js";
|
|
2
|
-
import { n as t, o as n, t as r } from "./constants-D7wLH8Qy.js";
|
|
3
|
-
import { c as i, f as a, i as o, l as s, o as c, r as l, s as u, t as d, u as f } from "./processRowspan-B6HMqw0Q.js";
|
|
4
|
-
import { n as p, t as m } from "./hooks-DSBl2e4O.js";
|
|
5
|
-
import { t as h } from "./style-B8Cw8HJe.js";
|
|
6
|
-
import { sumBy as g } from "lodash-es";
|
|
7
|
-
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
|
-
import y, { forwardRef as b, memo as x, useCallback as S, useEffect as ee, useImperativeHandle as te, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
|
|
9
|
-
import D from "clsx";
|
|
10
|
-
import { useMemoizedFn as O, useSize as k } from "ahooks";
|
|
11
|
-
import { useOverlayScrollbars as A } from "overlayscrollbars-react";
|
|
12
|
-
//#region src/components/Table/components/HeaderCell.tsx
|
|
13
|
-
var j = x(({ column: e, style: t = {}, className: n = "", onResizeStart: i, isResizing: a = !1, resizable: o = !0, colSpan: s = 1, rowSpan: c = 1 }) => {
|
|
14
|
-
let l = T(null), u = S((e) => {
|
|
15
|
-
l.current?.triggerClick?.(e);
|
|
16
|
-
}, []), d = S((t) => {
|
|
17
|
-
if (!o || !i) return;
|
|
18
|
-
t.preventDefault(), t.stopPropagation();
|
|
19
|
-
let n = (e) => {
|
|
20
|
-
e.preventDefault(), e.stopPropagation();
|
|
21
|
-
};
|
|
22
|
-
document.addEventListener("click", n, !0), document.addEventListener("mouseup", () => {
|
|
23
|
-
setTimeout(() => document.removeEventListener("click", n, !0), 0);
|
|
24
|
-
}, { once: !0 }), i(e.key, e.width || r.DEFAULT_WIDTH, t.clientX);
|
|
25
|
-
}, [
|
|
26
|
-
e.key,
|
|
27
|
-
e.width,
|
|
28
|
-
o,
|
|
29
|
-
i
|
|
30
|
-
]), f = typeof e.header == "function" ? e.header(e, { menuRef: l }) : e.title;
|
|
31
|
-
return /* @__PURE__ */ v("th", {
|
|
32
|
-
className: `custom-table-header-cell ${n} `,
|
|
33
|
-
style: t,
|
|
34
|
-
colSpan: s > 1 ? s : void 0,
|
|
35
|
-
rowSpan: c > 1 ? c : void 0,
|
|
36
|
-
onClick: u,
|
|
37
|
-
children: [/* @__PURE__ */ _("div", {
|
|
38
|
-
className: "header-cell-content",
|
|
39
|
-
children: f
|
|
40
|
-
}), o ? /* @__PURE__ */ _("div", {
|
|
41
|
-
className: `resize-handle ${a ? "resizing" : ""}`,
|
|
42
|
-
onMouseDown: d
|
|
43
|
-
}) : null]
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
j.displayName = "HeaderCell";
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/components/Table/components/TableHeader.tsx
|
|
49
|
-
var M = b(({ columns: e = [], enableFixed: n = !1, height: i = t.HEADER_HEIGHT, resizingColumn: a = null, onResizeStart: c, disabledResizeColumns: l = [], totalColumnsWidth: d = 0, needSpacer: f = !1, headerRowSpan: p = 1 }, m) => {
|
|
50
|
-
let h = w(() => e.some((e) => e.children && e.children.length > 0), [e]), { flatColumns: g, headerRows: y } = w(() => {
|
|
51
|
-
if (h) return o(e);
|
|
52
|
-
let t = Math.max(1, p || 1);
|
|
53
|
-
if (t > 1) {
|
|
54
|
-
let n = [e.map((e) => ({
|
|
55
|
-
...e,
|
|
56
|
-
colSpan: 1,
|
|
57
|
-
rowSpan: t,
|
|
58
|
-
isLeaf: !0
|
|
59
|
-
}))];
|
|
60
|
-
for (let e = 1; e < t; e++) n.push([]);
|
|
61
|
-
return {
|
|
62
|
-
flatColumns: e,
|
|
63
|
-
headerRows: n
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
flatColumns: e,
|
|
68
|
-
headerRows: [e]
|
|
69
|
-
};
|
|
70
|
-
}, [
|
|
71
|
-
e,
|
|
72
|
-
h,
|
|
73
|
-
p
|
|
74
|
-
]), b = (e) => {
|
|
75
|
-
let t = u(e, g), n = e.align || "left", r = l.includes(e.key), i = {
|
|
76
|
-
textAlign: n,
|
|
77
|
-
...s(t, g, e.fixed)
|
|
78
|
-
}, o = `custom-table-header-cell ${e.className || ""}`.trim();
|
|
79
|
-
return e.fixed === "left" && (o += " fixed-left"), e.fixed === "right" && (o += " fixed-right"), t === 0 && (o += " first"), t === g.length - 1 && (o += " last"), /* @__PURE__ */ _(j, {
|
|
80
|
-
column: {
|
|
81
|
-
...e,
|
|
82
|
-
index: t
|
|
83
|
-
},
|
|
84
|
-
style: i,
|
|
85
|
-
className: o,
|
|
86
|
-
onResizeStart: c,
|
|
87
|
-
isResizing: a === e.key,
|
|
88
|
-
resizable: !e.children && !r,
|
|
89
|
-
colSpan: e.colSpan,
|
|
90
|
-
rowSpan: e.rowSpan
|
|
91
|
-
}, e.key);
|
|
92
|
-
};
|
|
93
|
-
return /* @__PURE__ */ _("div", {
|
|
94
|
-
ref: m,
|
|
95
|
-
className: "custom-table-header",
|
|
96
|
-
style: w(() => {
|
|
97
|
-
let e = { minWidth: d };
|
|
98
|
-
return n && (e.position = "sticky", e.top = 0, e.zIndex = 11), e;
|
|
99
|
-
}, [n, d]),
|
|
100
|
-
children: /* @__PURE__ */ v("table", {
|
|
101
|
-
style: {
|
|
102
|
-
tableLayout: "fixed",
|
|
103
|
-
minWidth: d
|
|
104
|
-
},
|
|
105
|
-
children: [/* @__PURE__ */ v("colgroup", { children: [g.map((e) => /* @__PURE__ */ _("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), f ? /* @__PURE__ */ _("col", {
|
|
106
|
-
className: "spacer-col",
|
|
107
|
-
style: { width: "auto" }
|
|
108
|
-
}) : null] }), /* @__PURE__ */ _("thead", { children: y.map((e, t) => e.length === 0 ? /* @__PURE__ */ _("tr", { style: { height: i } }, t) : /* @__PURE__ */ v("tr", {
|
|
109
|
-
style: { height: h || p > 1 ? i : "auto" },
|
|
110
|
-
children: [e.map((e) => b(e)), f && t === 0 ? /* @__PURE__ */ _("th", {
|
|
111
|
-
className: "custom-table-header-cell",
|
|
112
|
-
rowSpan: y.length
|
|
113
|
-
}) : null]
|
|
114
|
-
}, t)) })]
|
|
115
|
-
})
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
M.displayName = "TableHeader";
|
|
119
|
-
var ne = x(M), N = (e, t, n) => {
|
|
120
|
-
let r = u(e, t), i = e.align || "left", a = s(r, t, n);
|
|
121
|
-
return {
|
|
122
|
-
column: e,
|
|
123
|
-
className: D("custom-table-cell", {
|
|
124
|
-
first: r === 0,
|
|
125
|
-
fixed: !!n
|
|
126
|
-
}, e.className, e?.type || "", e?.colorEnable ? "color-enable" : "", e?.regex === "barcode" ? "bar-code" : "", e?.regex === "qrcode" ? "qr-code" : ""),
|
|
127
|
-
style: {
|
|
128
|
-
textAlign: i,
|
|
129
|
-
...a
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}, P = ({ leftFixedColumns: e = [], normalColumns: n = [], rightFixedColumns: i = [], dataSource: a = [], rowKey: o = "id", rowHeight: s = t.ROW_HEIGHT, emptyText: u, onRowClick: p, onRow: m, onCell: h, totalColumnsWidth: g = 0, needSpacer: y = !1, rowRefCallback: b, isDynamicHeight: x = !1, emptyRowContent: ee, showEmptyRow: te = !0, startVirtualIndex: C, hideWhenEmpty: T = !1, wrapperClassName: E, forceRowHeight: O = !1 }) => {
|
|
133
|
-
let k = w(() => c(e), [e]), A = w(() => c(n), [n]), j = w(() => c(i), [i]), M = w(() => [
|
|
134
|
-
...k,
|
|
135
|
-
...A,
|
|
136
|
-
...j
|
|
137
|
-
], [
|
|
138
|
-
k,
|
|
139
|
-
A,
|
|
140
|
-
j
|
|
141
|
-
]), ne = w(() => {
|
|
142
|
-
let e = k.map((e) => N(e, M, "left")), t = A.map((e) => N(e, M, void 0)), n = j.map((e) => N(e, M, "right"));
|
|
143
|
-
return [
|
|
144
|
-
...e,
|
|
145
|
-
...t,
|
|
146
|
-
...n
|
|
147
|
-
];
|
|
148
|
-
}, [
|
|
149
|
-
M,
|
|
150
|
-
k,
|
|
151
|
-
A,
|
|
152
|
-
j
|
|
153
|
-
]), P = S((e) => {
|
|
154
|
-
e && b && b(e);
|
|
155
|
-
}, [b]), F = (e, t, n) => {
|
|
156
|
-
let { column: r, className: i, style: a } = e;
|
|
157
|
-
if (!l(t, r)) return null;
|
|
158
|
-
let o = d(t, r), s = r.dataIndex ? t[r.dataIndex] : void 0, c = r.render && typeof r.render == "function" ? r.render(s, t, n) : s, u = {
|
|
159
|
-
className: i,
|
|
160
|
-
style: a
|
|
161
|
-
};
|
|
162
|
-
return h && typeof h == "function" && (u = h(s, t, r, n, {
|
|
163
|
-
className: i,
|
|
164
|
-
style: a
|
|
165
|
-
}) || {}), /* @__PURE__ */ _("td", {
|
|
166
|
-
className: `${i} ${u.className || ""}`.trim(),
|
|
167
|
-
style: { ...a },
|
|
168
|
-
rowSpan: o > 1 ? o : void 0,
|
|
169
|
-
...u,
|
|
170
|
-
children: /* @__PURE__ */ _("div", {
|
|
171
|
-
className: D("cell-content", r.align),
|
|
172
|
-
children: c
|
|
173
|
-
})
|
|
174
|
-
}, r.key);
|
|
175
|
-
};
|
|
176
|
-
if (T && a.length === 0) return null;
|
|
177
|
-
let I = () => ee ?? /* @__PURE__ */ _("tr", {
|
|
178
|
-
className: "custom-table-empty-row",
|
|
179
|
-
children: /* @__PURE__ */ _("td", {
|
|
180
|
-
colSpan: M.length + (y ? 1 : 0),
|
|
181
|
-
style: {
|
|
182
|
-
textAlign: "center",
|
|
183
|
-
padding: "20px",
|
|
184
|
-
color: "#999"
|
|
185
|
-
},
|
|
186
|
-
children: u
|
|
187
|
-
})
|
|
188
|
-
}), re = O || !x;
|
|
189
|
-
return /* @__PURE__ */ _("div", {
|
|
190
|
-
className: D("custom-table-body", E),
|
|
191
|
-
style: { minWidth: g },
|
|
192
|
-
children: /* @__PURE__ */ v("table", {
|
|
193
|
-
style: {
|
|
194
|
-
tableLayout: "fixed",
|
|
195
|
-
minWidth: g
|
|
196
|
-
},
|
|
197
|
-
children: [/* @__PURE__ */ v("colgroup", { children: [M.map((e) => /* @__PURE__ */ _("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), y ? /* @__PURE__ */ _("col", {
|
|
198
|
-
className: "spacer-col",
|
|
199
|
-
style: { width: "auto" }
|
|
200
|
-
}) : null] }), /* @__PURE__ */ _("tbody", { children: a.length === 0 ? te ? I() : null : a.map((e, t) => {
|
|
201
|
-
let n = {};
|
|
202
|
-
if (m && typeof m == "function") {
|
|
203
|
-
let r = m(e, t, {
|
|
204
|
-
className: "",
|
|
205
|
-
style: {}
|
|
206
|
-
}) || {};
|
|
207
|
-
n = {
|
|
208
|
-
className: r.className,
|
|
209
|
-
style: r.style,
|
|
210
|
-
...r
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
let r = typeof C == "number" ? C + t : typeof e.dataIndex == "number" ? e.dataIndex : t;
|
|
214
|
-
return /* @__PURE__ */ v("tr", {
|
|
215
|
-
ref: x ? P : void 0,
|
|
216
|
-
style: {
|
|
217
|
-
height: re ? s : "auto",
|
|
218
|
-
...n.style
|
|
219
|
-
},
|
|
220
|
-
className: D("custom-table-row", n.className),
|
|
221
|
-
onClick: (n) => p?.(e, t, n),
|
|
222
|
-
"data-index": x ? r : void 0,
|
|
223
|
-
...n,
|
|
224
|
-
children: [ne.map((n) => F(n, e, t)), y ? /* @__PURE__ */ _("td", { className: "spacer-cell" }) : null]
|
|
225
|
-
}, f(e, o, t));
|
|
226
|
-
}) })]
|
|
227
|
-
})
|
|
228
|
-
});
|
|
229
|
-
};
|
|
230
|
-
P.displayName = "TableBody";
|
|
231
|
-
var F = x(P), I = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFixedColumns: n = [], footerData: i = {}, summary: a, render: o, enableFixed: l = !0, totalColumnsWidth: d = 0, needSpacer: f = !1 }) => {
|
|
232
|
-
let p = w(() => c(e), [e]), m = w(() => c(t), [t]), h = w(() => c(n), [n]), g = w(() => [
|
|
233
|
-
...p,
|
|
234
|
-
...m,
|
|
235
|
-
...h
|
|
236
|
-
], [
|
|
237
|
-
p,
|
|
238
|
-
m,
|
|
239
|
-
h
|
|
240
|
-
]), y = (e) => {
|
|
241
|
-
let t = (e.dataIndex ? i?.[e.dataIndex] : void 0) ?? a?.[e.key], { renderFooter: n } = e, r = n && typeof n == "function" ? n(t, e) : o && typeof o == "function" ? o(t, e) : t, c = { textAlign: e.align || "left" }, d = "custom-table-footer-cell";
|
|
242
|
-
if (l && e.fixed) {
|
|
243
|
-
let t = s(u(e, g), g, e.fixed);
|
|
244
|
-
t && (c = {
|
|
245
|
-
...c,
|
|
246
|
-
...t
|
|
247
|
-
}, d += e.fixed === "left" ? " fixed-left" : " fixed-right");
|
|
248
|
-
}
|
|
249
|
-
return /* @__PURE__ */ _("td", {
|
|
250
|
-
className: d,
|
|
251
|
-
style: c,
|
|
252
|
-
children: /* @__PURE__ */ _("div", {
|
|
253
|
-
className: "cell-content",
|
|
254
|
-
children: r
|
|
255
|
-
})
|
|
256
|
-
}, e.key);
|
|
257
|
-
};
|
|
258
|
-
return /* @__PURE__ */ _("div", {
|
|
259
|
-
className: "custom-table-footer",
|
|
260
|
-
style: w(() => {
|
|
261
|
-
let e = { minWidth: d };
|
|
262
|
-
return l && (e.position = "sticky", e.bottom = 0, e.zIndex = 10), e;
|
|
263
|
-
}, [l, d]),
|
|
264
|
-
children: /* @__PURE__ */ v("table", {
|
|
265
|
-
style: {
|
|
266
|
-
tableLayout: "fixed",
|
|
267
|
-
minWidth: d
|
|
268
|
-
},
|
|
269
|
-
children: [/* @__PURE__ */ v("colgroup", { children: [g.map((e) => /* @__PURE__ */ _("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), f ? /* @__PURE__ */ _("col", {
|
|
270
|
-
className: "spacer-col",
|
|
271
|
-
style: { width: "auto" }
|
|
272
|
-
}) : null] }), /* @__PURE__ */ _("tfoot", { children: /* @__PURE__ */ v("tr", { children: [
|
|
273
|
-
p.map((e) => y(e)),
|
|
274
|
-
m.map((e) => y(e)),
|
|
275
|
-
h.map((e) => y(e)),
|
|
276
|
-
f ? /* @__PURE__ */ _("td", { className: "spacer-cell" }) : null
|
|
277
|
-
] }) })]
|
|
278
|
-
})
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
I.displayName = "TableFooter";
|
|
282
|
-
var re = x(I), ie = [], ae = {
|
|
283
|
-
left: !0,
|
|
284
|
-
right: !0
|
|
285
|
-
}, oe = {
|
|
286
|
-
low: {
|
|
287
|
-
className: "bsy-row-height-low",
|
|
288
|
-
height: 34
|
|
289
|
-
},
|
|
290
|
-
middle: {
|
|
291
|
-
className: "bsy-row-height-middle",
|
|
292
|
-
height: 68
|
|
293
|
-
},
|
|
294
|
-
high: {
|
|
295
|
-
className: "bsy-row-height-high",
|
|
296
|
-
height: 106
|
|
297
|
-
},
|
|
298
|
-
auto: {
|
|
299
|
-
className: "bsy-row-height-auto",
|
|
300
|
-
height: "auto"
|
|
301
|
-
}
|
|
302
|
-
}, L = b(({ columns: o = [], dataSource: s = [], rowKey: l = "id", height: u, bordered: d = !0, emptyText: f, onRowClick: b, scroll: x, footerData: S, footerSummary: D, renderFooter: j, hasFooter: M = !1, onRow: N, onCell: P, rowHeightStyle: I = "low", resizable: L = !0, disabledResizeColumns: se = ie, minColumnWidth: ce, maxColumnWidth: le, onColumnResize: ue, onColumnResizeEnd: de, renderBody: R, estimateSize: fe, virtualEnabled: z, dataProcessor: B, headerRowSpan: pe, fixedShadowMask: me = ae, onRenderEmpty: he, overlayScrollbarOptions: V, wrapperStyle: ge, theme: _e }, ve) => {
|
|
303
|
-
let { t: ye } = e(), be = w(() => h(_e), [_e]), H = T(null), xe = T(null), U = T(null), W = T(/* @__PURE__ */ new Map()), G = k(H), K = G?.width ?? 0, Se = G?.height ?? 0, [Ce, we] = E(0), [Te, Ee] = E(!1), [De, Oe] = E({
|
|
304
|
-
left: 0,
|
|
305
|
-
top: 0
|
|
306
|
-
}), [ke, Ae] = E(t.HEADER_HEIGHT), q = w(() => c(o), [o]);
|
|
307
|
-
ee(() => {
|
|
308
|
-
q.forEach((e) => {
|
|
309
|
-
W.current.set(e.key, e.width || r.DEFAULT_WIDTH);
|
|
310
|
-
});
|
|
311
|
-
}, [q]);
|
|
312
|
-
let je = O((e) => W.current.get(e.key) || e.width || r.DEFAULT_WIDTH), Me = O((e) => {
|
|
313
|
-
let t = q.findIndex((t) => t.key === e);
|
|
314
|
-
if (t === -1) return 0;
|
|
315
|
-
let n = q[t], r = g(q.slice(0, t + 1), (e) => je(e));
|
|
316
|
-
return n.fixed === "left" ? r : r - (H.current?.scrollLeft || 0);
|
|
317
|
-
}), Ne = O((e) => {
|
|
318
|
-
U.current && (U.current.style.display = "block", U.current.style.left = `${Me(e)}px`);
|
|
319
|
-
}), { isResizing: Pe, resizingColumn: Fe, startResize: Ie } = m({
|
|
320
|
-
minColumnWidth: ce || r.MIN_WIDTH,
|
|
321
|
-
maxColumnWidth: le || r.MAX_WIDTH,
|
|
322
|
-
onColumnResizeEnd: O((e, t) => {
|
|
323
|
-
W.current.set(e, t), de?.(e, t, W.current), U.current && (U.current.style.display = "none");
|
|
324
|
-
}),
|
|
325
|
-
onColumnResize: O((e, t, n) => {
|
|
326
|
-
W.current.set(t, n), ue?.(t, n, W.current), Ne(t);
|
|
327
|
-
})
|
|
328
|
-
}), Le = O((e, t, n) => {
|
|
329
|
-
Ne(e), Ie(e, t, n);
|
|
330
|
-
}), { className: Re, height: J } = oe[I] || oe.auto, { virtualRows: ze, totalHeight: Be, paddingTop: Ve, paddingBottom: He, remeasure: Y, rowRefCallback: Ue, isDynamicHeight: We, clearRowHeightCache: Ge, enabled: Ke } = p(s, w(() => ({
|
|
331
|
-
rowHeight: J,
|
|
332
|
-
overscan: n.DEFAULT_OVERSCAN,
|
|
333
|
-
estimateSize: fe,
|
|
334
|
-
...z === void 0 ? {} : { enabled: z }
|
|
335
|
-
}), [
|
|
336
|
-
J,
|
|
337
|
-
fe,
|
|
338
|
-
z
|
|
339
|
-
]), H);
|
|
340
|
-
te(ve, () => ({
|
|
341
|
-
clearRowHeightCache: Ge,
|
|
342
|
-
remeasure: Y
|
|
343
|
-
}), [Ge, Y]);
|
|
344
|
-
let qe = f || ye(t.EMPTY_TEXT_KEY);
|
|
345
|
-
ee(() => {
|
|
346
|
-
Y?.();
|
|
347
|
-
}, [J, Y]);
|
|
348
|
-
let { leftFixedColumns: X, normalColumns: Je, rightFixedColumns: Z } = w(() => a(o), [o]), Ye = w(() => i(X), [X]), Xe = w(() => i(Z), [Z]), { totalColumnsWidth: Q, needSpacer: $ } = w(() => {
|
|
349
|
-
let e = i(o);
|
|
350
|
-
return {
|
|
351
|
-
totalColumnsWidth: e,
|
|
352
|
-
needSpacer: e < K
|
|
353
|
-
};
|
|
354
|
-
}, [o, K]), [Ze] = A({ options: {
|
|
355
|
-
overflow: {
|
|
356
|
-
x: V?.overflowX ?? "scroll",
|
|
357
|
-
y: V?.overflowY ?? "scroll"
|
|
358
|
-
},
|
|
359
|
-
scrollbars: {
|
|
360
|
-
theme: V?.theme ?? "os-theme-bsy",
|
|
361
|
-
autoHide: V?.autoHide ?? "move",
|
|
362
|
-
autoHideDelay: 400
|
|
363
|
-
}
|
|
364
|
-
} });
|
|
365
|
-
C(() => {
|
|
366
|
-
if (!H.current) return;
|
|
367
|
-
let e = H.current, t = e.parentElement;
|
|
368
|
-
t && Ze({
|
|
369
|
-
target: t,
|
|
370
|
-
elements: { viewport: e }
|
|
371
|
-
});
|
|
372
|
-
}, [Ze]);
|
|
373
|
-
let Qe = w(() => {
|
|
374
|
-
let e = Ke ? ze.map((e) => {
|
|
375
|
-
let t = s[e.index];
|
|
376
|
-
return t && {
|
|
377
|
-
...t,
|
|
378
|
-
dataIndex: e.index
|
|
379
|
-
};
|
|
380
|
-
}) : s.map((e, t) => ({
|
|
381
|
-
...e,
|
|
382
|
-
dataIndex: t
|
|
383
|
-
}));
|
|
384
|
-
return B ? B(e) : e;
|
|
385
|
-
}, [
|
|
386
|
-
Ke,
|
|
387
|
-
ze,
|
|
388
|
-
s,
|
|
389
|
-
B
|
|
390
|
-
]), $e = w(() => {
|
|
391
|
-
let e = {};
|
|
392
|
-
return d ? e.border = "1px solid #e0e0e0" : e.border = "none", (u || x?.y) && (e.maxHeight = u || x?.y), e;
|
|
393
|
-
}, [
|
|
394
|
-
d,
|
|
395
|
-
u,
|
|
396
|
-
x
|
|
397
|
-
]);
|
|
398
|
-
C(() => {
|
|
399
|
-
let e = H.current;
|
|
400
|
-
e && (we(e.clientHeight), Oe({
|
|
401
|
-
left: e.offsetLeft,
|
|
402
|
-
top: e.offsetTop
|
|
403
|
-
}), Ae(xe.current?.clientHeight || t.HEADER_HEIGHT), Ee(e.scrollHeight > e.clientHeight));
|
|
404
|
-
}, [
|
|
405
|
-
G?.width,
|
|
406
|
-
G?.height,
|
|
407
|
-
s.length,
|
|
408
|
-
M,
|
|
409
|
-
pe
|
|
410
|
-
]);
|
|
411
|
-
let et = w(() => {
|
|
412
|
-
if (!Se || !Ce) return;
|
|
413
|
-
let e = d ? 2 : 0, n = Ce - ke - (M ? t.HEADER_HEIGHT : 0) - e;
|
|
414
|
-
return Math.max(0, n);
|
|
415
|
-
}, [
|
|
416
|
-
Se,
|
|
417
|
-
Ce,
|
|
418
|
-
ke,
|
|
419
|
-
M,
|
|
420
|
-
d
|
|
421
|
-
]), tt = !!(u || x?.y), nt, rt, it = !0;
|
|
422
|
-
if (!R && s.length === 0 && typeof he == "function") {
|
|
423
|
-
let e = he();
|
|
424
|
-
y.isValidElement(e) && e.type === "tr" ? nt = e : e && (rt = e, it = !1);
|
|
425
|
-
}
|
|
426
|
-
return /* @__PURE__ */ v("div", {
|
|
427
|
-
className: `custom-table ${Te ? "has-y-scroll" : ""}`,
|
|
428
|
-
style: {
|
|
429
|
-
position: "relative",
|
|
430
|
-
height: "100%",
|
|
431
|
-
...be
|
|
432
|
-
},
|
|
433
|
-
"data-overlayscrollbars-initialize": "",
|
|
434
|
-
children: [
|
|
435
|
-
/* @__PURE__ */ v("div", {
|
|
436
|
-
ref: H,
|
|
437
|
-
className: `custom-table-wrapper ${Pe ? "resizing" : ""} ${Re} os-enabled`,
|
|
438
|
-
style: {
|
|
439
|
-
...$e,
|
|
440
|
-
...ge
|
|
441
|
-
},
|
|
442
|
-
children: [
|
|
443
|
-
/* @__PURE__ */ _(ne, {
|
|
444
|
-
ref: xe,
|
|
445
|
-
columns: o,
|
|
446
|
-
enableFixed: tt,
|
|
447
|
-
height: t.HEADER_HEIGHT,
|
|
448
|
-
resizingColumn: Fe,
|
|
449
|
-
onResizeStart: L ? Le : void 0,
|
|
450
|
-
disabledResizeColumns: se,
|
|
451
|
-
totalColumnsWidth: Q,
|
|
452
|
-
needSpacer: $,
|
|
453
|
-
headerRowSpan: pe
|
|
454
|
-
}),
|
|
455
|
-
/* @__PURE__ */ _("div", {
|
|
456
|
-
className: "custom-table-body-wrapper",
|
|
457
|
-
style: { position: "relative" },
|
|
458
|
-
children: /* @__PURE__ */ _("div", {
|
|
459
|
-
style: {
|
|
460
|
-
minHeight: et,
|
|
461
|
-
height: Be,
|
|
462
|
-
paddingBottom: He > 0 ? `${He}px` : void 0,
|
|
463
|
-
paddingTop: Ve > 0 ? `${Ve}px` : void 0,
|
|
464
|
-
position: "relative"
|
|
465
|
-
},
|
|
466
|
-
children: R ? R({
|
|
467
|
-
columns: o,
|
|
468
|
-
flatColumns: q,
|
|
469
|
-
leftFixedColumns: X,
|
|
470
|
-
normalColumns: Je,
|
|
471
|
-
rightFixedColumns: Z,
|
|
472
|
-
totalColumnsWidth: Q,
|
|
473
|
-
needSpacer: $,
|
|
474
|
-
rowRefCallback: Ue,
|
|
475
|
-
isDynamicHeight: We,
|
|
476
|
-
rowHeight: J,
|
|
477
|
-
onRowClick: b,
|
|
478
|
-
scrollRef: H,
|
|
479
|
-
virtualRows: ze,
|
|
480
|
-
virtualEnabled: Ke
|
|
481
|
-
}) : /* @__PURE__ */ _(F, {
|
|
482
|
-
leftFixedColumns: X,
|
|
483
|
-
normalColumns: Je,
|
|
484
|
-
rightFixedColumns: Z,
|
|
485
|
-
dataSource: Qe,
|
|
486
|
-
rowKey: l,
|
|
487
|
-
rowHeight: J,
|
|
488
|
-
emptyText: qe,
|
|
489
|
-
emptyRowContent: nt,
|
|
490
|
-
showEmptyRow: it,
|
|
491
|
-
onRowClick: b,
|
|
492
|
-
onRow: N,
|
|
493
|
-
onCell: P,
|
|
494
|
-
totalColumnsWidth: Q,
|
|
495
|
-
needSpacer: $,
|
|
496
|
-
rowRefCallback: Ue,
|
|
497
|
-
isDynamicHeight: We
|
|
498
|
-
})
|
|
499
|
-
})
|
|
500
|
-
}),
|
|
501
|
-
M && (S || D || j) ? /* @__PURE__ */ _(re, {
|
|
502
|
-
leftFixedColumns: X,
|
|
503
|
-
normalColumns: Je,
|
|
504
|
-
rightFixedColumns: Z,
|
|
505
|
-
footerData: S,
|
|
506
|
-
summary: D,
|
|
507
|
-
render: j,
|
|
508
|
-
enableFixed: tt,
|
|
509
|
-
totalColumnsWidth: Q,
|
|
510
|
-
needSpacer: $
|
|
511
|
-
}) : null
|
|
512
|
-
]
|
|
513
|
-
}),
|
|
514
|
-
rt ? /* @__PURE__ */ _("div", {
|
|
515
|
-
className: "custom-table-empty-overlay",
|
|
516
|
-
style: {
|
|
517
|
-
height: et,
|
|
518
|
-
left: De.left,
|
|
519
|
-
top: De.top + ke + (d ? 1 : 0),
|
|
520
|
-
width: K || void 0
|
|
521
|
-
},
|
|
522
|
-
children: /* @__PURE__ */ _("div", {
|
|
523
|
-
className: "custom-table-empty-overlay-inner",
|
|
524
|
-
children: rt
|
|
525
|
-
})
|
|
526
|
-
}) : null,
|
|
527
|
-
L ? /* @__PURE__ */ _("div", {
|
|
528
|
-
className: "custom-table-resize-handle",
|
|
529
|
-
ref: U
|
|
530
|
-
}) : null,
|
|
531
|
-
me.left !== !1 && Ye > 0 ? /* @__PURE__ */ _("div", {
|
|
532
|
-
className: "fixed-shadow-mask left",
|
|
533
|
-
style: { width: Ye }
|
|
534
|
-
}) : null,
|
|
535
|
-
!$ && me.right !== !1 && Xe > 0 ? /* @__PURE__ */ _("div", {
|
|
536
|
-
className: "fixed-shadow-mask right",
|
|
537
|
-
style: { width: Xe }
|
|
538
|
-
}) : null
|
|
539
|
-
]
|
|
540
|
-
});
|
|
541
|
-
});
|
|
542
|
-
L.displayName = "Table";
|
|
543
|
-
var se = y.memo(L);
|
|
544
|
-
//#endregion
|
|
545
|
-
export { F as n, se as t };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region src/components/Table/constants.ts
|
|
2
|
-
var e = {
|
|
3
|
-
ROW_HEIGHT: 34,
|
|
4
|
-
HEADER_HEIGHT: 34,
|
|
5
|
-
EMPTY_TEXT_KEY: "table.empty"
|
|
6
|
-
}, t = {
|
|
7
|
-
MIN_HEIGHT: 34,
|
|
8
|
-
MAX_HEIGHT: 200
|
|
9
|
-
}, n = {
|
|
10
|
-
DEFAULT_OVERSCAN: 10,
|
|
11
|
-
ENABLE_AUTO_SIZE: 40
|
|
12
|
-
}, r = {
|
|
13
|
-
DEFAULT_WIDTH: 120,
|
|
14
|
-
MIN_WIDTH: 60,
|
|
15
|
-
MAX_WIDTH: 1e3
|
|
16
|
-
}, i = {
|
|
17
|
-
ASC: "asc",
|
|
18
|
-
DESC: "desc",
|
|
19
|
-
NONE: null
|
|
20
|
-
}, a = {
|
|
21
|
-
wrapper: "custom-table-wrapper",
|
|
22
|
-
body: "custom-table-body"
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { a, i, e as n, n as o, t as r, r as t };
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { o as e, r as t, t as n } from "./constants-D7wLH8Qy.js";
|
|
2
|
-
import { clamp as r } from "lodash-es";
|
|
3
|
-
import { useCallback as i, useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
4
|
-
import { useEventListener as l, useLatest as u, useMemoizedFn as d } from "ahooks";
|
|
5
|
-
import { useVirtualizer as f } from "@tanstack/react-virtual";
|
|
6
|
-
//#region src/components/Table/hooks/useTableVirtual.ts
|
|
7
|
-
var p = [];
|
|
8
|
-
function m(n, c, l) {
|
|
9
|
-
let m = u(n), h = u(c.estimateSize), g = c.rowHeight, _ = c.minRowHeight || t.MIN_HEIGHT, v = c.maxRowHeight || t.MAX_HEIGHT, y = i((e) => {
|
|
10
|
-
let n = m.current ?? [], i = h.current;
|
|
11
|
-
if (typeof i == "function") return i(e, n[e]);
|
|
12
|
-
let a = n[e];
|
|
13
|
-
return a && typeof a.rowHeight == "number" ? r(a.rowHeight, _, v) : typeof g == "string" ? t.MIN_HEIGHT : r(typeof g == "function" ? g(e) : g || t.MIN_HEIGHT, _, v);
|
|
14
|
-
}, [
|
|
15
|
-
g,
|
|
16
|
-
_,
|
|
17
|
-
v,
|
|
18
|
-
h,
|
|
19
|
-
m
|
|
20
|
-
]), b = o(() => c.enabled === !0 ? !0 : c.enabled === !1 ? !1 : n.length > e.ENABLE_AUTO_SIZE, [c.enabled, n.length]), x = typeof g == "string", S = s(/* @__PURE__ */ new Map()), C = s(null), w = o(() => {
|
|
21
|
-
if (n.length === 0) return null;
|
|
22
|
-
let e = n[0]?.uniqueId || n[0]?._id || n[0]?.id, t = n[n.length - 1]?.uniqueId || n[n.length - 1]?._id || n[n.length - 1]?.id;
|
|
23
|
-
return `${String(e)}-${String(t)}-${n.length}`;
|
|
24
|
-
}, [n]);
|
|
25
|
-
a(() => {
|
|
26
|
-
C.current !== null && C.current !== w && S.current.clear(), C.current = w;
|
|
27
|
-
}, [w]), a(() => {
|
|
28
|
-
let e = S.current;
|
|
29
|
-
return () => {
|
|
30
|
-
e.clear();
|
|
31
|
-
};
|
|
32
|
-
}, []);
|
|
33
|
-
let T = i((e) => {
|
|
34
|
-
let t = m.current ?? [];
|
|
35
|
-
return t[e]?.uniqueId || t[e]?._id || t[e]?.id || `table-row-${e}`;
|
|
36
|
-
}, [m]), E = f({
|
|
37
|
-
count: b ? n.length : 0,
|
|
38
|
-
getScrollElement: () => l.current,
|
|
39
|
-
estimateSize: y,
|
|
40
|
-
overscan: c.overscan ?? e.DEFAULT_OVERSCAN,
|
|
41
|
-
enabled: b,
|
|
42
|
-
measureElement: x ? (e) => {
|
|
43
|
-
let n = e.getAttribute("data-index");
|
|
44
|
-
if (!n) return t.MIN_HEIGHT;
|
|
45
|
-
let r = S.current, i = r.get(n);
|
|
46
|
-
if (i !== void 0) return i;
|
|
47
|
-
let a = e.getBoundingClientRect().height, o = Math.max(t.MIN_HEIGHT, a);
|
|
48
|
-
return r.set(n, o), o;
|
|
49
|
-
} : void 0,
|
|
50
|
-
getItemKey: T
|
|
51
|
-
}), D = b ? E.getTotalSize() : 0, O = b ? E.getVirtualItems() : p, k = b && O.length > 0 && O[0].start || 0, A = b && O.length > 0 ? D - (O[O.length - 1].end || 0) : 0, j = d(() => {
|
|
52
|
-
S.current.clear(), typeof E.measure == "function" && E.measure();
|
|
53
|
-
}), M = d((e) => {
|
|
54
|
-
if (e === void 0) {
|
|
55
|
-
S.current.clear();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let t = Array.isArray(e) ? e : [e], n = S.current, r = m.current ?? [];
|
|
59
|
-
t.forEach((e) => {
|
|
60
|
-
if (typeof e == "number") n.delete(String(e));
|
|
61
|
-
else {
|
|
62
|
-
let t = r.findIndex((t) => t.uniqueId === e || t._id === e || t.id === e);
|
|
63
|
-
t !== -1 && n.delete(String(t));
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
return {
|
|
68
|
-
enabled: b,
|
|
69
|
-
virtualRows: O,
|
|
70
|
-
rowRefCallback: E.measureElement,
|
|
71
|
-
totalHeight: D,
|
|
72
|
-
paddingTop: k,
|
|
73
|
-
paddingBottom: A,
|
|
74
|
-
remeasure: j,
|
|
75
|
-
clearRowHeightCache: M,
|
|
76
|
-
isDynamicHeight: x
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/components/Table/hooks/useColumnResize.ts
|
|
81
|
-
function h(e = {}) {
|
|
82
|
-
let { minColumnWidth: t = n.MIN_WIDTH, maxColumnWidth: i = n.MAX_WIDTH, onColumnResize: a, onColumnResizeEnd: o } = e, [s, f] = c(null), p = u(s), m = u(a), h = u(o), g = d((e, t, n) => {
|
|
83
|
-
f({
|
|
84
|
-
columnKey: e,
|
|
85
|
-
startWidth: t,
|
|
86
|
-
startX: n
|
|
87
|
-
});
|
|
88
|
-
}), _ = (e, n) => r(n.startWidth + e - n.startX, t, i);
|
|
89
|
-
return l("mousemove", (e) => {
|
|
90
|
-
let t = p.current;
|
|
91
|
-
t && m.current?.(e, t.columnKey, _(e.clientX, t));
|
|
92
|
-
}, {
|
|
93
|
-
target: document,
|
|
94
|
-
enable: !!s
|
|
95
|
-
}), l("mouseup", (e) => {
|
|
96
|
-
let t = p.current;
|
|
97
|
-
t && (h.current?.(t.columnKey, _(e.clientX, t)), f(null));
|
|
98
|
-
}, {
|
|
99
|
-
target: document,
|
|
100
|
-
enable: !!s
|
|
101
|
-
}), {
|
|
102
|
-
isResizing: !!s,
|
|
103
|
-
resizingColumn: s?.columnKey,
|
|
104
|
-
startResize: g
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
export { m as n, h as t };
|