@baishuyun/ui-base 6.4.1 → 6.5.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.
Files changed (153) hide show
  1. package/dist/Amap/{Amap-DL5dLiUm.js → Amap-Dnvu_pUP.js} +1 -1
  2. package/dist/Amap/AmapCircle/index.js +3 -3
  3. package/dist/Amap/{AmapCircle-mh92P2l6.js → AmapCircle-Wfn43qco.js} +1 -1
  4. package/dist/Amap/AmapMarker/index.js +4 -4
  5. package/dist/Amap/{AmapMarker-DYW0-8Hd.js → AmapMarker-CB66dQIG.js} +2 -2
  6. package/dist/Amap/AmapMarkerCluster/index.js +4 -4
  7. package/dist/Amap/{AmapMarkerCluster-BRVHHMbi.js → AmapMarkerCluster-DvXchCC0.js} +2 -2
  8. package/dist/Amap/AmapProvider/index.js +4 -4
  9. package/dist/Amap/{AmapProvider-CwKdpmCg.js → AmapProvider-XCrqzo9W.js} +2 -2
  10. package/dist/Amap/hooks/index.js +2 -2
  11. package/dist/Amap/{hooks-D1m8KgVM.js → hooks-DwRvpafb.js} +1 -1
  12. package/dist/Amap/index.js +10 -10
  13. package/dist/Calendar/{AllDaySection-CseF1DuB.js → AllDaySection-M-b9tRHh.js} +4 -4
  14. package/dist/Calendar/{Calendar-Yu2HfA5D.js → Calendar-C9PhASp0.js} +13 -13
  15. package/dist/Calendar/{CurrentTimeIndicator-CUeblc9r.js → CurrentTimeIndicator-Dpi36eVJ.js} +1 -1
  16. package/dist/Calendar/{EventCard-L6jaKgEw.js → EventCard-BIfRqCk5.js} +3 -3
  17. package/dist/Calendar/{TimeGrid-B8lvUb1W.js → TimeGrid-Dk3soSo4.js} +2 -2
  18. package/dist/Calendar/context/index.js +1 -1
  19. package/dist/Calendar/index.js +19 -19
  20. package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
  21. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -4
  22. package/dist/Calendar/subcomponents/EventCard/index.js +5 -5
  23. package/dist/Calendar/subcomponents/TimeAxis/index.js +3 -3
  24. package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
  25. package/dist/Calendar/{theme-BzNDRi0U.js → theme-Cgn0zQoC.js} +2 -2
  26. package/dist/Calendar/utils/index.js +3 -3
  27. package/dist/Calendar/utils/layout/index.js +2 -2
  28. package/dist/Calendar/utils/theme/index.js +1 -1
  29. package/dist/Card/{Card-CRrtIjNT.js → Card-BjWdQRjq.js} +1 -1
  30. package/dist/Card/index.js +2 -2
  31. package/dist/CheckBox/{CheckBox-DIunYcfS.js → CheckBox-81R8QKHb.js} +1 -1
  32. package/dist/CheckBox/{CheckBox-CkVe5Boq.js → CheckBox-ejvbDr-a.js} +1 -1
  33. package/dist/CheckBox/index.js +3 -3
  34. package/dist/ColorPicker/{ColorPicker-By-Y8Tyz.js → ColorPicker-aj57lMA5.js} +5 -5
  35. package/dist/ColorPicker/index.js +6 -6
  36. package/dist/ConfigProvider/index.js +2 -2
  37. package/dist/DatePicker/{DatePicker-PCdNachD.js → DatePicker-EIFyC9zF.js} +6 -6
  38. package/dist/DatePicker/{DatePickerPanel-HoxXteK0.js → DatePickerPanel-BjnLfncu.js} +5 -5
  39. package/dist/DatePicker/index.js +7 -7
  40. package/dist/DatePicker/style/index.js +1 -1
  41. package/dist/DatePicker/{style-DZaSSoNs.js → style-BxWyBhZ3.js} +1 -1
  42. package/dist/DropDown/DropDown-B34vfoOs.js +172 -0
  43. package/dist/DropDown/index.js +8 -7
  44. package/dist/DropDown/style/index.js +2 -0
  45. package/dist/DropDown/style-4LK6rNHe.js +9 -0
  46. package/dist/Editor/{Buttons-DmSUkHWl.js → Buttons-Ds6bLmnl.js} +6 -6
  47. package/dist/Editor/ToolbarPlugin/Buttons/index.js +15 -14
  48. package/dist/Editor/index.js +15 -14
  49. package/dist/Gantt/GanttChart/index.js +15 -14
  50. package/dist/Gantt/{GanttChart-DJA8pG9U.js → GanttChart-CnIWe_wk.js} +685 -598
  51. package/dist/Gantt/GanttTable/index.js +9 -9
  52. package/dist/Gantt/{GanttTable-Di_p-0M1.js → GanttTable-C3PLGmKr.js} +20 -19
  53. package/dist/Gantt/GanttToolBar/index.js +11 -10
  54. package/dist/Gantt/GanttToolBar-8jPQ9BAG.js +121 -0
  55. package/dist/Gantt/{collapseKeys-C8139wvy.js → collapseKeys-1N9ci2oJ.js} +2 -2
  56. package/dist/Gantt/index.js +195 -162
  57. package/dist/Gantt/theme-C197Dtjy.js +31 -0
  58. package/dist/Gantt/{timelineViewConfig-BXl2UkN8.js → timelineViewConfig-Dl3AXO45.js} +1 -1
  59. package/dist/Gantt/utils/index.js +5 -5
  60. package/dist/Gantt/utils/theme/index.js +2 -0
  61. package/dist/Icon/index.js +1 -1
  62. package/dist/InputTag/InputTag-CGQ5dXyf.js +143 -0
  63. package/dist/InputTag/index.js +3 -2
  64. package/dist/Loading/index.js +1 -1
  65. package/dist/Modal/{Modal-D3LFqIV4.js → Modal-GGHNlZv3.js} +1 -1
  66. package/dist/Modal/index.js +2 -2
  67. package/dist/NotFoundContent/index.js +1 -1
  68. package/dist/Radio/index.js +1 -1
  69. package/dist/ScrollBar/ScrollBar-CSGBOE3e.js +68 -0
  70. package/dist/ScrollBar/index.js +2 -0
  71. package/dist/Segmented/{Segmented-BTW445jc.js → Segmented-CzVKrL6o.js} +1 -1
  72. package/dist/Segmented/index.js +1 -1
  73. package/dist/Select/{Select-OjCjCogR.js → Select-B0r9VgF6.js} +199 -200
  74. package/dist/Select/{SelectInputSearch-DXPTGSc2.js → SelectInputSearch-BDwg-Noi.js} +2 -2
  75. package/dist/Select/index.js +12 -11
  76. package/dist/Table/Table-BtH9Oa14.js +545 -0
  77. package/dist/Table/hooks/index.js +1 -1
  78. package/dist/Table/{hooks-CJ2CnSep.js → hooks-DK8Pf7iH.js} +1 -1
  79. package/dist/Table/index.js +8 -7
  80. package/dist/Table/{processRowspan-BCzfI5un.js → processRowspan-D4uv6zLk.js} +1 -1
  81. package/dist/Table/style/index.js +2 -0
  82. package/dist/Table/style-BwcnT2ee.js +9 -0
  83. package/dist/Table/utils/index.js +1 -1
  84. package/dist/Tabs/{Tabs-DVQcB3YG.js → Tabs-7wEcxUv6.js} +4 -4
  85. package/dist/Tabs/index.js +4 -4
  86. package/dist/Tooltip/{Tooltip-DW_XP13m.js → Tooltip-B_SZOy6k.js} +41 -44
  87. package/dist/Tooltip/index.js +1 -1
  88. package/dist/Tree/index.js +4 -4
  89. package/dist/components/DropDown/index.d.ts +1 -0
  90. package/dist/components/DropDown/interface.d.ts +45 -0
  91. package/dist/components/DropDown/style/__tests__/resolveDropDownThemeVars.test.d.ts +1 -0
  92. package/dist/components/DropDown/style/index.d.ts +1 -0
  93. package/dist/components/DropDown/style/resolveDropDownThemeVars.d.ts +2 -0
  94. package/dist/components/Gantt/Gantt.d.ts +1 -1
  95. package/dist/components/Gantt/GanttChart/hooks/useEdgeScroll.d.ts +1 -1
  96. package/dist/components/Gantt/GanttTable/GanttTable.d.ts +1 -1
  97. package/dist/components/Gantt/GanttThemeContext.d.ts +3 -0
  98. package/dist/components/Gantt/index.d.ts +2 -1
  99. package/dist/components/Gantt/interface.d.ts +39 -0
  100. package/dist/components/Gantt/internal/GanttLayout.d.ts +1 -1
  101. package/dist/components/Gantt/types.internal.d.ts +2 -0
  102. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttTheme.test.d.ts +1 -0
  103. package/dist/components/Gantt/utils/theme/__tests__/resolveGanttThemeVars.test.d.ts +1 -0
  104. package/dist/components/Gantt/utils/theme/__tests__/resolveTableThemeFromGantt.test.d.ts +1 -0
  105. package/dist/components/Gantt/utils/theme/index.d.ts +3 -0
  106. package/dist/components/Gantt/utils/theme/resolveGanttTheme.d.ts +3 -0
  107. package/dist/components/Gantt/utils/theme/resolveGanttThemeVars.d.ts +5 -0
  108. package/dist/components/Gantt/utils/theme/resolveTableThemeFromGantt.d.ts +4 -0
  109. package/dist/components/ScrollBar/ScrollBar.d.ts +3 -0
  110. package/dist/components/ScrollBar/__tests__/ScrollBar.test.d.ts +1 -0
  111. package/dist/components/ScrollBar/index.d.ts +3 -0
  112. package/dist/components/ScrollBar/interface.d.ts +23 -0
  113. package/dist/components/Table/index.d.ts +2 -1
  114. package/dist/components/Table/interface.d.ts +17 -0
  115. package/dist/components/Table/style/__tests__/resolveTableThemeVars.test.d.ts +1 -0
  116. package/dist/components/Table/style/index.d.ts +1 -0
  117. package/dist/components/Table/style/resolveTableThemeVars.d.ts +3 -0
  118. package/dist/components/index.d.ts +5 -2
  119. package/dist/index.js +50 -47
  120. package/dist/style.css +1 -1
  121. package/dist/utils/mergeRefs.d.ts +1 -0
  122. package/dist/vendors/{ConfigProvider-DwmA94S2.js → ConfigProvider-AQTr7T_c.js} +1 -1
  123. package/dist/vendors/{Tree-C7BgkjCQ.js → Tree-DqnOGJtB.js} +3 -3
  124. package/dist/vendors/mergeRefs-TiJ0xjUN.js +9 -0
  125. package/dist/vendors/{useLocale-BTz4slNW.js → useLocale-DZ8XW2VL.js} +1 -1
  126. package/package.json +1 -2
  127. package/dist/DropDown/DropDown-CvQAbsEo.js +0 -168
  128. package/dist/Gantt/GanttToolBar-D5pQdrzv.js +0 -105
  129. package/dist/InputTag/InputTag-zP5QdId7.js +0 -139
  130. package/dist/Table/Table-3-kFIm5v.js +0 -543
  131. /package/dist/Amap/{AmapContext-JaYk1a3H.js → AmapContext-CFmsMycg.js} +0 -0
  132. /package/dist/Amap/{useMarkerInfoWindowController-CRgf2I0Q.js → useMarkerInfoWindowController-G-Bg-NDJ.js} +0 -0
  133. /package/dist/Calendar/{TimeAxis-cK2_3FeM.js → TimeAxis-Chwxo6Yj.js} +0 -0
  134. /package/dist/Calendar/{colorUtils-DcpqM3KR.js → colorUtils-FNbm3zBQ.js} +0 -0
  135. /package/dist/Calendar/{context-DNOJ9LW_.js → context-CzS6P3nk.js} +0 -0
  136. /package/dist/Calendar/{layout-CaPxiRd-.js → layout-Cb39seCc.js} +0 -0
  137. /package/dist/DatePicker/{ensureDayjsPlugins-C3aqki6i.js → ensureDayjsPlugins-DxqbKqon.js} +0 -0
  138. /package/dist/DatePicker/{pickerLocale-VqSP_iIm.js → pickerLocale-CtDOOxxD.js} +0 -0
  139. /package/dist/Gantt/{GanttHighlightContext-AIpN3-af.js → GanttHighlightContext-CtT98ZnK.js} +0 -0
  140. /package/dist/Gantt/{columnResize-By_1E48E.js → columnResize-DFe7F98O.js} +0 -0
  141. /package/dist/Gantt/{constants-D4ur8WRs.js → constants-CrBb5i5p.js} +0 -0
  142. /package/dist/Gantt/{highlightTarget-DmzCIiQb.js → highlightTarget-DtCe7zto.js} +0 -0
  143. /package/dist/Icon/{Icon-BQ3Whub2.js → Icon-SQ5tu-yG.js} +0 -0
  144. /package/dist/Loading/{Loading-WjmzBabh.js → Loading-ho-6d72M.js} +0 -0
  145. /package/dist/NotFoundContent/{NotFoundContent-7xV-zOG2.js → NotFoundContent-CV9fTylQ.js} +0 -0
  146. /package/dist/Radio/{Radio-DkrZHoG1.js → Radio-C2zJzZc3.js} +0 -0
  147. /package/dist/Table/{constants-CKqc9Os_.js → constants-CuBlYZLO.js} +0 -0
  148. /package/dist/vendors/{LocaleContext-BJdHS0sH.js → LocaleContext-CBcJzvUD.js} +0 -0
  149. /package/dist/vendors/{animations-BeI8JZp1.js → animations-Mlw78WYo.js} +0 -0
  150. /package/dist/vendors/{color-BeQo449h.js → color-BQYy0Wgy.js} +0 -0
  151. /package/dist/vendors/{cssVars-C4BlzyxA.js → cssVars-DoQgQ2CM.js} +0 -0
  152. /package/dist/vendors/{useFloatingOverlay-3KB88hpZ.js → useFloatingOverlay-WbbHmuT-.js} +0 -0
  153. /package/dist/vendors/{useFloatingPortal-DsEtsAGW.js → useFloatingPortal-B2SDNV5C.js} +0 -0
@@ -1,543 +0,0 @@
1
- import { t as e } from "../vendors/useLocale-BTz4slNW.js";
2
- import { n as t, o as n, t as r } from "./constants-CKqc9Os_.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-BCzfI5un.js";
4
- import { n as p, t as m } from "./hooks-CJ2CnSep.js";
5
- import { sumBy as h } from "lodash-es";
6
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
7
- import v, { forwardRef as y, memo as b, useCallback as x, useEffect as S, useImperativeHandle as ee, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
8
- import D from "clsx";
9
- import { useMemoizedFn as O, useSize as te } from "ahooks";
10
- import { useOverlayScrollbars as k } from "overlayscrollbars-react";
11
- //#region src/components/Table/components/HeaderCell.tsx
12
- var A = b(({ column: e, style: t = {}, className: n = "", onResizeStart: i, isResizing: a = !1, resizable: o = !0, colSpan: s = 1, rowSpan: c = 1 }) => {
13
- let l = T(null), u = x((e) => {
14
- l.current?.triggerClick?.(e);
15
- }, []), d = x((t) => {
16
- if (!o || !i) return;
17
- t.preventDefault(), t.stopPropagation();
18
- let n = (e) => {
19
- e.preventDefault(), e.stopPropagation();
20
- };
21
- document.addEventListener("click", n, !0), document.addEventListener("mouseup", () => {
22
- setTimeout(() => document.removeEventListener("click", n, !0), 0);
23
- }, { once: !0 }), i(e.key, e.width || r.DEFAULT_WIDTH, t.clientX);
24
- }, [
25
- e.key,
26
- e.width,
27
- o,
28
- i
29
- ]), f = typeof e.header == "function" ? e.header(e, { menuRef: l }) : e.title;
30
- return /* @__PURE__ */ _("th", {
31
- className: `custom-table-header-cell ${n} `,
32
- style: t,
33
- colSpan: s > 1 ? s : void 0,
34
- rowSpan: c > 1 ? c : void 0,
35
- onClick: u,
36
- children: [/* @__PURE__ */ g("div", {
37
- className: "header-cell-content",
38
- children: f
39
- }), o ? /* @__PURE__ */ g("div", {
40
- className: `resize-handle ${a ? "resizing" : ""}`,
41
- onMouseDown: d
42
- }) : null]
43
- });
44
- });
45
- A.displayName = "HeaderCell";
46
- //#endregion
47
- //#region src/components/Table/components/TableHeader.tsx
48
- var j = y(({ 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) => {
49
- let h = w(() => e.some((e) => e.children && e.children.length > 0), [e]), { flatColumns: v, headerRows: y } = w(() => {
50
- if (h) return o(e);
51
- let t = Math.max(1, p || 1);
52
- if (t > 1) {
53
- let n = [e.map((e) => ({
54
- ...e,
55
- colSpan: 1,
56
- rowSpan: t,
57
- isLeaf: !0
58
- }))];
59
- for (let e = 1; e < t; e++) n.push([]);
60
- return {
61
- flatColumns: e,
62
- headerRows: n
63
- };
64
- }
65
- return {
66
- flatColumns: e,
67
- headerRows: [e]
68
- };
69
- }, [
70
- e,
71
- h,
72
- p
73
- ]), b = (e) => {
74
- let t = u(e, v), n = e.align || "left", r = l.includes(e.key), i = {
75
- textAlign: n,
76
- ...s(t, v, e.fixed)
77
- }, o = `custom-table-header-cell ${e.className || ""}`.trim();
78
- return e.fixed === "left" && (o += " fixed-left"), e.fixed === "right" && (o += " fixed-right"), t === 0 && (o += " first"), t === v.length - 1 && (o += " last"), /* @__PURE__ */ g(A, {
79
- column: {
80
- ...e,
81
- index: t
82
- },
83
- style: i,
84
- className: o,
85
- onResizeStart: c,
86
- isResizing: a === e.key,
87
- resizable: !e.children && !r,
88
- colSpan: e.colSpan,
89
- rowSpan: e.rowSpan
90
- }, e.key);
91
- };
92
- return /* @__PURE__ */ g("div", {
93
- ref: m,
94
- className: "custom-table-header",
95
- style: w(() => {
96
- let e = { minWidth: d };
97
- return n && (e.position = "sticky", e.top = 0, e.zIndex = 11), e;
98
- }, [n, d]),
99
- children: /* @__PURE__ */ _("table", {
100
- style: {
101
- tableLayout: "fixed",
102
- minWidth: d
103
- },
104
- children: [/* @__PURE__ */ _("colgroup", { children: [v.map((e) => /* @__PURE__ */ g("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), f ? /* @__PURE__ */ g("col", {
105
- className: "spacer-col",
106
- style: { width: "auto" }
107
- }) : null] }), /* @__PURE__ */ g("thead", { children: y.map((e, t) => e.length === 0 ? /* @__PURE__ */ g("tr", { style: { height: i } }, t) : /* @__PURE__ */ _("tr", {
108
- style: { height: h || p > 1 ? i : "auto" },
109
- children: [e.map((e) => b(e)), f && t === 0 ? /* @__PURE__ */ g("th", {
110
- className: "custom-table-header-cell",
111
- rowSpan: y.length
112
- }) : null]
113
- }, t)) })]
114
- })
115
- });
116
- });
117
- j.displayName = "TableHeader";
118
- var M = b(j), N = (e, t, n) => {
119
- let r = u(e, t), i = e.align || "left", a = s(r, t, n);
120
- return {
121
- column: e,
122
- className: D("custom-table-cell", {
123
- first: r === 0,
124
- fixed: !!n
125
- }, e.className, e?.type || "", e?.colorEnable ? "color-enable" : "", e?.regex === "barcode" ? "bar-code" : "", e?.regex === "qrcode" ? "qr-code" : ""),
126
- style: {
127
- textAlign: i,
128
- ...a
129
- }
130
- };
131
- }, 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: v = 0, needSpacer: y = !1, rowRefCallback: b, isDynamicHeight: S = !1, emptyRowContent: ee, showEmptyRow: C = !0, startVirtualIndex: T, hideWhenEmpty: E = !1, wrapperClassName: O, forceRowHeight: te = !1 }) => {
132
- let k = w(() => c(e), [e]), A = w(() => c(n), [n]), j = w(() => c(i), [i]), M = w(() => [
133
- ...k,
134
- ...A,
135
- ...j
136
- ], [
137
- k,
138
- A,
139
- j
140
- ]), P = w(() => {
141
- 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"));
142
- return [
143
- ...e,
144
- ...t,
145
- ...n
146
- ];
147
- }, [
148
- M,
149
- k,
150
- A,
151
- j
152
- ]), F = x((e) => {
153
- e && b && b(e);
154
- }, [b]), I = (e, t, n) => {
155
- let { column: r, className: i, style: a } = e;
156
- if (!l(t, r)) return null;
157
- 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 = {
158
- className: i,
159
- style: a
160
- };
161
- return h && typeof h == "function" && (u = h(s, t, r, n, {
162
- className: i,
163
- style: a
164
- }) || {}), /* @__PURE__ */ g("td", {
165
- className: `${i} ${u.className || ""}`.trim(),
166
- style: { ...a },
167
- rowSpan: o > 1 ? o : void 0,
168
- ...u,
169
- children: /* @__PURE__ */ g("div", {
170
- className: D("cell-content", r.align),
171
- children: c
172
- })
173
- }, r.key);
174
- };
175
- if (E && a.length === 0) return null;
176
- let ne = () => ee ?? /* @__PURE__ */ g("tr", {
177
- className: "custom-table-empty-row",
178
- children: /* @__PURE__ */ g("td", {
179
- colSpan: M.length + (y ? 1 : 0),
180
- style: {
181
- textAlign: "center",
182
- padding: "20px",
183
- color: "#999"
184
- },
185
- children: u
186
- })
187
- }), re = te || !S;
188
- return /* @__PURE__ */ g("div", {
189
- className: D("custom-table-body", O),
190
- style: { minWidth: v },
191
- children: /* @__PURE__ */ _("table", {
192
- style: {
193
- tableLayout: "fixed",
194
- minWidth: v
195
- },
196
- children: [/* @__PURE__ */ _("colgroup", { children: [M.map((e) => /* @__PURE__ */ g("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), y ? /* @__PURE__ */ g("col", {
197
- className: "spacer-col",
198
- style: { width: "auto" }
199
- }) : null] }), /* @__PURE__ */ g("tbody", { children: a.length === 0 ? C ? ne() : null : a.map((e, t) => {
200
- let n = {};
201
- if (m && typeof m == "function") {
202
- let r = m(e, t, {
203
- className: "",
204
- style: {}
205
- }) || {};
206
- n = {
207
- className: r.className,
208
- style: r.style,
209
- ...r
210
- };
211
- }
212
- let r = typeof T == "number" ? T + t : typeof e.dataIndex == "number" ? e.dataIndex : t;
213
- return /* @__PURE__ */ _("tr", {
214
- ref: S ? F : void 0,
215
- style: {
216
- height: re ? s : "auto",
217
- ...n.style
218
- },
219
- className: D("custom-table-row", n.className),
220
- onClick: (n) => p?.(e, t, n),
221
- "data-index": S ? r : void 0,
222
- ...n,
223
- children: [P.map((n) => I(n, e, t)), y ? /* @__PURE__ */ g("td", { className: "spacer-cell" }) : null]
224
- }, f(e, o, t));
225
- }) })]
226
- })
227
- });
228
- };
229
- P.displayName = "TableBody";
230
- var F = b(P), I = ({ leftFixedColumns: e = [], normalColumns: t = [], rightFixedColumns: n = [], footerData: i = {}, summary: a, render: o, enableFixed: l = !0, totalColumnsWidth: d = 0, needSpacer: f = !1 }) => {
231
- let p = w(() => c(e), [e]), m = w(() => c(t), [t]), h = w(() => c(n), [n]), v = w(() => [
232
- ...p,
233
- ...m,
234
- ...h
235
- ], [
236
- p,
237
- m,
238
- h
239
- ]), y = (e) => {
240
- 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";
241
- if (l && e.fixed) {
242
- let t = s(u(e, v), v, e.fixed);
243
- t && (c = {
244
- ...c,
245
- ...t
246
- }, d += e.fixed === "left" ? " fixed-left" : " fixed-right");
247
- }
248
- return /* @__PURE__ */ g("td", {
249
- className: d,
250
- style: c,
251
- children: /* @__PURE__ */ g("div", {
252
- className: "cell-content",
253
- children: r
254
- })
255
- }, e.key);
256
- };
257
- return /* @__PURE__ */ g("div", {
258
- className: "custom-table-footer",
259
- style: w(() => {
260
- let e = { minWidth: d };
261
- return l && (e.position = "sticky", e.bottom = 0, e.zIndex = 10), e;
262
- }, [l, d]),
263
- children: /* @__PURE__ */ _("table", {
264
- style: {
265
- tableLayout: "fixed",
266
- minWidth: d
267
- },
268
- children: [/* @__PURE__ */ _("colgroup", { children: [v.map((e) => /* @__PURE__ */ g("col", { style: { width: e.width || r.DEFAULT_WIDTH } }, e.key)), f ? /* @__PURE__ */ g("col", {
269
- className: "spacer-col",
270
- style: { width: "auto" }
271
- }) : null] }), /* @__PURE__ */ g("tfoot", { children: /* @__PURE__ */ _("tr", { children: [
272
- p.map((e) => y(e)),
273
- m.map((e) => y(e)),
274
- h.map((e) => y(e)),
275
- f ? /* @__PURE__ */ g("td", { className: "spacer-cell" }) : null
276
- ] }) })]
277
- })
278
- });
279
- };
280
- I.displayName = "TableFooter";
281
- var ne = b(I), re = [], ie = {
282
- left: !0,
283
- right: !0
284
- }, ae = {
285
- low: {
286
- className: "bsy-row-height-low",
287
- height: 34
288
- },
289
- middle: {
290
- className: "bsy-row-height-middle",
291
- height: 68
292
- },
293
- high: {
294
- className: "bsy-row-height-high",
295
- height: 106
296
- },
297
- auto: {
298
- className: "bsy-row-height-auto",
299
- height: "auto"
300
- }
301
- }, L = y(({ columns: o = [], dataSource: s = [], rowKey: l = "id", height: u, bordered: d = !0, emptyText: f, onRowClick: y, scroll: b, footerData: x, footerSummary: D, renderFooter: A, hasFooter: j = !1, onRow: N, onCell: P, rowHeightStyle: I = "low", resizable: L = !0, disabledResizeColumns: oe = re, minColumnWidth: se, maxColumnWidth: ce, onColumnResize: le, onColumnResizeEnd: ue, renderBody: de, estimateSize: fe, virtualEnabled: R, dataProcessor: z, headerRowSpan: pe, fixedShadowMask: me = ie, onRenderEmpty: he, overlayScrollbarOptions: B, wrapperStyle: ge }, _e) => {
302
- let { t: ve } = e(), V = T(null), ye = T(null), H = T(null), U = T(/* @__PURE__ */ new Map()), W = te(V), G = W?.width ?? 0, be = W?.height ?? 0, [xe, Se] = E(0), [Ce, we] = E(!1), [Te, Ee] = E({
303
- left: 0,
304
- top: 0
305
- }), [De, Oe] = E(t.HEADER_HEIGHT), K = w(() => c(o), [o]);
306
- S(() => {
307
- K.forEach((e) => {
308
- U.current.set(e.key, e.width || r.DEFAULT_WIDTH);
309
- });
310
- }, [K]);
311
- let ke = O((e) => U.current.get(e.key) || e.width || r.DEFAULT_WIDTH), Ae = O((e) => {
312
- let t = K.findIndex((t) => t.key === e);
313
- if (t === -1) return 0;
314
- let n = K[t], r = h(K.slice(0, t + 1), (e) => ke(e));
315
- return n.fixed === "left" ? r : r - (V.current?.scrollLeft || 0);
316
- }), je = O((e) => {
317
- H.current && (H.current.style.display = "block", H.current.style.left = `${Ae(e)}px`);
318
- }), { isResizing: Me, resizingColumn: Ne, startResize: Pe } = m({
319
- minColumnWidth: se || r.MIN_WIDTH,
320
- maxColumnWidth: ce || r.MAX_WIDTH,
321
- onColumnResizeEnd: O((e, t) => {
322
- U.current.set(e, t), ue?.(e, t, U.current), H.current && (H.current.style.display = "none");
323
- }),
324
- onColumnResize: O((e, t, n) => {
325
- U.current.set(t, n), le?.(t, n, U.current), je(t);
326
- })
327
- }), Fe = O((e, t, n) => {
328
- je(e), Pe(e, t, n);
329
- }), { className: Ie, height: q } = ae[I] || ae.auto, { virtualRows: Le, totalHeight: Re, paddingTop: ze, paddingBottom: Be, remeasure: J, rowRefCallback: Ve, isDynamicHeight: He, clearRowHeightCache: Ue, enabled: We } = p(s, w(() => ({
330
- rowHeight: q,
331
- overscan: n.DEFAULT_OVERSCAN,
332
- estimateSize: fe,
333
- ...R === void 0 ? {} : { enabled: R }
334
- }), [
335
- q,
336
- fe,
337
- R
338
- ]), V);
339
- ee(_e, () => ({
340
- clearRowHeightCache: Ue,
341
- remeasure: J
342
- }), [Ue, J]);
343
- let Ge = f || ve(t.EMPTY_TEXT_KEY);
344
- S(() => {
345
- J?.();
346
- }, [q, J]);
347
- let { leftFixedColumns: Y, normalColumns: Ke, rightFixedColumns: X } = w(() => a(o), [o]), qe = w(() => i(Y), [Y]), Je = w(() => i(X), [X]), { totalColumnsWidth: Z, needSpacer: Q } = w(() => {
348
- let e = i(o);
349
- return {
350
- totalColumnsWidth: e,
351
- needSpacer: e < G
352
- };
353
- }, [o, G]), [Ye] = k({ options: {
354
- overflow: {
355
- x: B?.overflowX ?? "scroll",
356
- y: B?.overflowY ?? "scroll"
357
- },
358
- scrollbars: {
359
- theme: B?.theme ?? "os-theme-bsy",
360
- autoHide: B?.autoHide ?? "move",
361
- autoHideDelay: 400
362
- }
363
- } });
364
- C(() => {
365
- if (!V.current) return;
366
- let e = V.current, t = e.parentElement;
367
- t && Ye({
368
- target: t,
369
- elements: { viewport: e }
370
- });
371
- }, [Ye]);
372
- let Xe = w(() => {
373
- let e = We ? Le.map((e) => {
374
- let t = s[e.index];
375
- return t && {
376
- ...t,
377
- dataIndex: e.index
378
- };
379
- }) : s.map((e, t) => ({
380
- ...e,
381
- dataIndex: t
382
- }));
383
- return z ? z(e) : e;
384
- }, [
385
- We,
386
- Le,
387
- s,
388
- z
389
- ]), Ze = w(() => {
390
- let e = {};
391
- return d ? e.border = "1px solid #e0e0e0" : e.border = "none", (u || b?.y) && (e.maxHeight = u || b?.y), e;
392
- }, [
393
- d,
394
- u,
395
- b
396
- ]);
397
- C(() => {
398
- let e = V.current;
399
- e && (Se(e.clientHeight), Ee({
400
- left: e.offsetLeft,
401
- top: e.offsetTop
402
- }), Oe(ye.current?.clientHeight || t.HEADER_HEIGHT), we(e.scrollHeight > e.clientHeight));
403
- }, [
404
- W?.width,
405
- W?.height,
406
- s.length,
407
- j,
408
- pe
409
- ]);
410
- let Qe = w(() => {
411
- if (!be || !xe) return;
412
- let e = d ? 2 : 0, n = xe - De - (j ? t.HEADER_HEIGHT : 0) - e;
413
- return Math.max(0, n);
414
- }, [
415
- be,
416
- xe,
417
- De,
418
- j,
419
- d
420
- ]), $e = !!(u || b?.y), et, $, tt = !0;
421
- if (!de && s.length === 0 && typeof he == "function") {
422
- let e = he();
423
- v.isValidElement(e) && e.type === "tr" ? et = e : e && ($ = e, tt = !1);
424
- }
425
- return /* @__PURE__ */ _("div", {
426
- className: `custom-table ${Ce ? "has-y-scroll" : ""}`,
427
- style: {
428
- position: "relative",
429
- height: "100%"
430
- },
431
- "data-overlayscrollbars-initialize": "",
432
- children: [
433
- /* @__PURE__ */ _("div", {
434
- ref: V,
435
- className: `custom-table-wrapper ${Me ? "resizing" : ""} ${Ie} os-enabled`,
436
- style: {
437
- ...Ze,
438
- ...ge
439
- },
440
- children: [
441
- /* @__PURE__ */ g(M, {
442
- ref: ye,
443
- columns: o,
444
- enableFixed: $e,
445
- height: t.HEADER_HEIGHT,
446
- resizingColumn: Ne,
447
- onResizeStart: L ? Fe : void 0,
448
- disabledResizeColumns: oe,
449
- totalColumnsWidth: Z,
450
- needSpacer: Q,
451
- headerRowSpan: pe
452
- }),
453
- /* @__PURE__ */ g("div", {
454
- className: "custom-table-body-wrapper",
455
- style: { position: "relative" },
456
- children: /* @__PURE__ */ g("div", {
457
- style: {
458
- minHeight: Qe,
459
- height: Re,
460
- paddingBottom: Be > 0 ? `${Be}px` : void 0,
461
- paddingTop: ze > 0 ? `${ze}px` : void 0,
462
- position: "relative"
463
- },
464
- children: de ? de({
465
- columns: o,
466
- flatColumns: K,
467
- leftFixedColumns: Y,
468
- normalColumns: Ke,
469
- rightFixedColumns: X,
470
- totalColumnsWidth: Z,
471
- needSpacer: Q,
472
- rowRefCallback: Ve,
473
- isDynamicHeight: He,
474
- rowHeight: q,
475
- onRowClick: y,
476
- scrollRef: V,
477
- virtualRows: Le,
478
- virtualEnabled: We
479
- }) : /* @__PURE__ */ g(F, {
480
- leftFixedColumns: Y,
481
- normalColumns: Ke,
482
- rightFixedColumns: X,
483
- dataSource: Xe,
484
- rowKey: l,
485
- rowHeight: q,
486
- emptyText: Ge,
487
- emptyRowContent: et,
488
- showEmptyRow: tt,
489
- onRowClick: y,
490
- onRow: N,
491
- onCell: P,
492
- totalColumnsWidth: Z,
493
- needSpacer: Q,
494
- rowRefCallback: Ve,
495
- isDynamicHeight: He
496
- })
497
- })
498
- }),
499
- j && (x || D || A) ? /* @__PURE__ */ g(ne, {
500
- leftFixedColumns: Y,
501
- normalColumns: Ke,
502
- rightFixedColumns: X,
503
- footerData: x,
504
- summary: D,
505
- render: A,
506
- enableFixed: $e,
507
- totalColumnsWidth: Z,
508
- needSpacer: Q
509
- }) : null
510
- ]
511
- }),
512
- $ ? /* @__PURE__ */ g("div", {
513
- className: "custom-table-empty-overlay",
514
- style: {
515
- height: Qe,
516
- left: Te.left,
517
- top: Te.top + De + (d ? 1 : 0),
518
- width: G || void 0
519
- },
520
- children: /* @__PURE__ */ g("div", {
521
- className: "custom-table-empty-overlay-inner",
522
- children: $
523
- })
524
- }) : null,
525
- L ? /* @__PURE__ */ g("div", {
526
- className: "custom-table-resize-handle",
527
- ref: H
528
- }) : null,
529
- me.left !== !1 && qe > 0 ? /* @__PURE__ */ g("div", {
530
- className: "fixed-shadow-mask left",
531
- style: { width: qe }
532
- }) : null,
533
- !Q && me.right !== !1 && Je > 0 ? /* @__PURE__ */ g("div", {
534
- className: "fixed-shadow-mask right",
535
- style: { width: Je }
536
- }) : null
537
- ]
538
- });
539
- });
540
- L.displayName = "Table";
541
- var oe = v.memo(L);
542
- //#endregion
543
- export { F as n, oe as t };