@baishuyun/ui-base 6.28.2 → 6.29.1
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/index.js +1 -1
- package/dist/Calendar/{Calendar-DPF0ecD9.js → Calendar-cXOw65UG.js} +1 -1
- package/dist/Calendar/index.js +3 -3
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/index.js +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DatePicker/{DatePicker-Hn_P6uYt.js → DatePicker-TimXurVT.js} +1 -1
- package/dist/DatePicker/{DatePickerPanel-Bl83l0FK.js → DatePickerPanel-CfnP7Cpa.js} +1 -1
- package/dist/DatePicker/index.js +2 -2
- package/dist/DropDown/index.js +1 -1
- package/dist/Editor/index.js +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/Gantt/index.js +2 -2
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/index.js +1 -1
- package/dist/Kanban/index.js +1 -1
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/ScrollBar/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Table/Table-BMqJZqBK.js +1169 -0
- package/dist/Table/index.js +4 -3
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/Tree/index.js +1 -1
- package/dist/components/Table/HierarchyCell/HierarchyCell.d.ts +3 -0
- package/dist/components/Table/HierarchyCell/hierarchyTreeLayout.d.ts +27 -0
- package/dist/components/Table/HierarchyCell/index.d.ts +4 -0
- package/dist/components/Table/HierarchyCell/interface.d.ts +46 -0
- package/dist/components/Table/components/TableBody.d.ts +1 -40
- package/dist/components/Table/hooks/useTableVirtual.d.ts +5 -1
- package/dist/components/Table/index.d.ts +3 -2
- package/dist/components/Table/interface.d.ts +39 -0
- package/dist/components/Table/utils/tableUtils.d.ts +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/index.js +6 -6
- package/dist/style.css +1 -1
- package/dist/vendors/{version-C6z7Jrt6.js → version-Foao691n.js} +1 -1
- package/package.json +1 -1
- package/dist/Table/Table-Cfj7bTb2.js +0 -881
package/dist/Table/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import "../vendors/version-
|
|
1
|
+
import "../vendors/version-Foao691n.js";
|
|
2
2
|
import "../ScrollBar/style-D26azwz6.js";
|
|
3
|
+
import "../Icon/Icon-CcKDWNGy.js";
|
|
3
4
|
import "../vendors/LocaleContext-CsTLO_Y2.js";
|
|
4
5
|
import "../vendors/useLocale-3oUjPb-k.js";
|
|
5
|
-
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./Table-
|
|
6
|
-
export {
|
|
6
|
+
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "./Table-BMqJZqBK.js";
|
|
7
|
+
export { e as COLUMN_DEFAULTS, _ as DEFAULT_CONFIG, h as HierarchyCell, v as TABLE_DOM, p as Table, p as default, m as TableBody, u as buildHierarchyTreeMeta, r as calculateFixedOffset, i as expandLeafColumns, n as getCellRowspan, f as getColumnsWidth, l as getRowKey, c as processRowspan, s as resolveTableThemeVars, g as shouldRenderCell, o as sortData, a as splitFixedColumns, t as useColumnResize, d as useTableVirtual };
|
package/dist/Tabs/index.js
CHANGED
package/dist/Tooltip/index.js
CHANGED
package/dist/Tree/index.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HierarchyGutterBridgeStyle, HierarchyRailSegment, HierarchyRowMeta, HierarchyTreeLayout } from './interface';
|
|
2
|
+
export declare const HIERARCHY_TREE_LAYOUT: {
|
|
3
|
+
axisOffset: number;
|
|
4
|
+
arrowSize: number;
|
|
5
|
+
branchContinueOffset: number;
|
|
6
|
+
branchEndOffset: number;
|
|
7
|
+
iconOffset: number;
|
|
8
|
+
levelStep: number;
|
|
9
|
+
prefixOffset: number;
|
|
10
|
+
textGap: number;
|
|
11
|
+
textOffset: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const getHierarchyTreeLayout: (depth?: number) => HierarchyTreeLayout;
|
|
14
|
+
export declare const buildHierarchyTreeMeta: (depths: number[]) => HierarchyRowMeta[];
|
|
15
|
+
export declare const getHierarchyTreeRailSegment: ({ rowIndex, subtreeEndIndex, type, }: {
|
|
16
|
+
rowIndex: number;
|
|
17
|
+
subtreeEndIndex: number;
|
|
18
|
+
type?: "ancestor" | "current";
|
|
19
|
+
}) => HierarchyRailSegment;
|
|
20
|
+
export declare const getHierarchyGutterBridgeStyle: ({ depth, hasChildren, previousDepth, rowIndex, rowMeta, treeMeta, }: {
|
|
21
|
+
depth?: number;
|
|
22
|
+
hasChildren?: boolean;
|
|
23
|
+
previousDepth?: number;
|
|
24
|
+
rowIndex?: number;
|
|
25
|
+
rowMeta?: HierarchyRowMeta | null;
|
|
26
|
+
treeMeta?: HierarchyRowMeta[];
|
|
27
|
+
}) => HierarchyGutterBridgeStyle;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface HierarchyRowMeta {
|
|
3
|
+
ancestorIndices: number[];
|
|
4
|
+
subtreeEndIndex: number;
|
|
5
|
+
}
|
|
6
|
+
export interface HierarchyLoadMore {
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface HierarchyTreeLayout {
|
|
12
|
+
axisCenter: number;
|
|
13
|
+
arrowLeft: number;
|
|
14
|
+
prefixWidth: number;
|
|
15
|
+
textOffset: number;
|
|
16
|
+
}
|
|
17
|
+
export interface HierarchyRailSegment {
|
|
18
|
+
top: number | string;
|
|
19
|
+
bottom: number | string;
|
|
20
|
+
}
|
|
21
|
+
export type HierarchyDataProps = {
|
|
22
|
+
loadMore?: undefined;
|
|
23
|
+
rowIndex: number;
|
|
24
|
+
/** 上一可见行的深度,首行为 -1。用来画槽底横线 */
|
|
25
|
+
previousDepth?: number;
|
|
26
|
+
rowMeta: HierarchyRowMeta;
|
|
27
|
+
/** 整表元数据,与可见行下标对齐 */
|
|
28
|
+
treeMeta: HierarchyRowMeta[];
|
|
29
|
+
hasChildren?: boolean;
|
|
30
|
+
expanded?: boolean;
|
|
31
|
+
/** 子节点加载中时,箭头位置显示转圈,不显示展开按钮 */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
onToggle?: () => void;
|
|
34
|
+
};
|
|
35
|
+
type HierarchyLoadMoreProps = {
|
|
36
|
+
/** 传入后只画加载更多,不画引导线、箭头和 children */
|
|
37
|
+
loadMore: HierarchyLoadMore;
|
|
38
|
+
};
|
|
39
|
+
export type HierarchyProps = {
|
|
40
|
+
/** 当前行深度,从 0 开始。树槽宽度只由它决定 */
|
|
41
|
+
depth: number;
|
|
42
|
+
/** 字段内容。加载更多行不使用 */
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
} & (HierarchyDataProps | HierarchyLoadMoreProps);
|
|
45
|
+
export type HierarchyGutterBridgeStyle = Pick<CSSProperties, 'left' | 'width'> | null;
|
|
46
|
+
export {};
|
|
@@ -1,43 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ColumnConfig } from '../interface';
|
|
3
|
-
export interface TableBodyProps {
|
|
4
|
-
leftFixedColumns?: ColumnConfig[];
|
|
5
|
-
normalColumns?: ColumnConfig[];
|
|
6
|
-
rightFixedColumns?: ColumnConfig[];
|
|
7
|
-
dataSource?: Record<string, unknown>[];
|
|
8
|
-
rowKey?: string;
|
|
9
|
-
rowHeight?: number | string;
|
|
10
|
-
emptyText?: ReactNode;
|
|
11
|
-
onRowClick?: (record: Record<string, unknown>, index: number, e: MouseEvent) => void;
|
|
12
|
-
onRow?: (record: Record<string, unknown>, index: number, defaults: {
|
|
13
|
-
className: string;
|
|
14
|
-
style: CSSProperties;
|
|
15
|
-
}) => Record<string, unknown>;
|
|
16
|
-
onCell?: (value: unknown, record: Record<string, unknown>, column: ColumnConfig, rowIndex: number, cellProps: {
|
|
17
|
-
className: string;
|
|
18
|
-
style: CSSProperties;
|
|
19
|
-
}) => Record<string, unknown>;
|
|
20
|
-
totalColumnsWidth?: number;
|
|
21
|
-
needSpacer?: boolean;
|
|
22
|
-
rowRefCallback?: (element: HTMLElement) => void;
|
|
23
|
-
isDynamicHeight?: boolean;
|
|
24
|
-
emptyRowContent?: ReactNode;
|
|
25
|
-
showEmptyRow?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* 分组数据块在全局虚拟列表中的起始下标。
|
|
28
|
-
* 传入(含 0)时强制 data-index = startVirtualIndex + rowIndex,不与 record.dataIndex 混用。
|
|
29
|
-
*/
|
|
30
|
-
startVirtualIndex?: number;
|
|
31
|
-
/** 无数据时返回 null(分组块常用);优先于 showEmptyRow */
|
|
32
|
-
hideWhenEmpty?: boolean;
|
|
33
|
-
/** 追加到 .custom-table-body */
|
|
34
|
-
wrapperClassName?: string;
|
|
35
|
-
/**
|
|
36
|
-
* 为 true 时即使 isDynamicHeight 也使用 rowHeight(对齐 Gantt 分组块现状)。
|
|
37
|
-
* 默认 false:平坦路径保持 isDynamicHeight ? 'auto' : rowHeight。
|
|
38
|
-
*/
|
|
39
|
-
forceRowHeight?: boolean;
|
|
40
|
-
}
|
|
1
|
+
import { TableBodyProps } from '../interface';
|
|
41
2
|
declare const _default: import('react').MemoExoticComponent<{
|
|
42
3
|
({ leftFixedColumns, normalColumns, rightFixedColumns, dataSource, rowKey, rowHeight, emptyText, onRowClick, onRow, onCell, totalColumnsWidth, needSpacer, rowRefCallback, isDynamicHeight, emptyRowContent, showEmptyRow, startVirtualIndex, hideWhenEmpty, wrapperClassName, forceRowHeight, }: TableBodyProps): import("react").JSX.Element | null;
|
|
43
4
|
displayName: string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { VirtualItem } from '@tanstack/react-virtual';
|
|
2
2
|
export interface UseTableVirtualOptions {
|
|
3
|
-
rowHeight?: number | string | ((index: number) => number);
|
|
3
|
+
rowHeight?: number | 'auto' | string | ((index: number) => number);
|
|
4
|
+
/** 是否开启自适应/动态行高测量,默认在 rowHeight === 'auto' 时自动开启 */
|
|
5
|
+
dynamicHeight?: boolean;
|
|
6
|
+
/** 行主键字段,对齐 TableProps.rowKey */
|
|
7
|
+
rowKey?: string;
|
|
4
8
|
enabled?: boolean;
|
|
5
9
|
overscan?: number;
|
|
6
10
|
estimateSize?: (index: number, row?: Record<string, unknown>) => number;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { default as Table } from './Table';
|
|
2
2
|
export { default } from './Table';
|
|
3
3
|
export { default as TableBody } from './components/TableBody';
|
|
4
|
-
export type { TableBodyProps } from './
|
|
5
|
-
export type { TableProps, TableTheme, ColumnConfig, HeaderRenderApi, TableRenderBodyContext, } from './interface';
|
|
4
|
+
export type { TableProps, TableTheme, ColumnConfig, HeaderRenderApi, TableRenderBodyContext, TableBodyProps, TableRef, } from './interface';
|
|
6
5
|
export { resolveTableThemeVars } from './style';
|
|
7
6
|
export { processRowspan, shouldRenderCell, getCellRowspan } from './utils/processRowspan';
|
|
8
7
|
export { getRowKey, calculateFixedOffset, splitFixedColumns, getColumnsWidth, expandLeafColumns, sortData, } from './utils/tableUtils';
|
|
9
8
|
export { useTableVirtual, useColumnResize } from './hooks';
|
|
10
9
|
export { TABLE_DOM, DEFAULT_CONFIG, COLUMN_DEFAULTS } from './constants';
|
|
10
|
+
export { HierarchyCell, buildHierarchyTreeMeta } from './HierarchyCell';
|
|
11
|
+
export type { HierarchyLoadMore, HierarchyProps, HierarchyRowMeta } from './HierarchyCell';
|
|
@@ -129,3 +129,42 @@ export interface TableRef {
|
|
|
129
129
|
clearRowHeightCache: (rowIds?: string | number | Array<string | number>) => void;
|
|
130
130
|
remeasure: () => void;
|
|
131
131
|
}
|
|
132
|
+
/** 可组合表体。分组等自定义 body 复用表格已拆分的列。 */
|
|
133
|
+
export interface TableBodyProps {
|
|
134
|
+
leftFixedColumns?: ColumnConfig[];
|
|
135
|
+
normalColumns?: ColumnConfig[];
|
|
136
|
+
rightFixedColumns?: ColumnConfig[];
|
|
137
|
+
dataSource?: Record<string, unknown>[];
|
|
138
|
+
rowKey?: string;
|
|
139
|
+
rowHeight?: number | string;
|
|
140
|
+
emptyText?: ReactNode;
|
|
141
|
+
onRowClick?: (record: Record<string, unknown>, index: number, e: MouseEvent) => void;
|
|
142
|
+
onRow?: (record: Record<string, unknown>, index: number, defaults: {
|
|
143
|
+
className: string;
|
|
144
|
+
style: CSSProperties;
|
|
145
|
+
}) => Record<string, unknown>;
|
|
146
|
+
onCell?: (value: unknown, record: Record<string, unknown>, column: ColumnConfig, rowIndex: number, cellProps: {
|
|
147
|
+
className: string;
|
|
148
|
+
style: CSSProperties;
|
|
149
|
+
}) => Record<string, unknown>;
|
|
150
|
+
totalColumnsWidth?: number;
|
|
151
|
+
needSpacer?: boolean;
|
|
152
|
+
rowRefCallback?: (element: HTMLElement) => void;
|
|
153
|
+
isDynamicHeight?: boolean;
|
|
154
|
+
emptyRowContent?: ReactNode;
|
|
155
|
+
showEmptyRow?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* 分组数据块在全局虚拟列表中的起始下标。
|
|
158
|
+
* 传入(含 0)时强制 data-index = startVirtualIndex + rowIndex,不与 record.dataIndex 混用。
|
|
159
|
+
*/
|
|
160
|
+
startVirtualIndex?: number;
|
|
161
|
+
/** 无数据时返回 null(分组块常用);优先于 showEmptyRow */
|
|
162
|
+
hideWhenEmpty?: boolean;
|
|
163
|
+
/** 追加到 .custom-table-body */
|
|
164
|
+
wrapperClassName?: string;
|
|
165
|
+
/**
|
|
166
|
+
* 为 true 时即使 isDynamicHeight 也使用 rowHeight(对齐 Gantt 分组块现状)。
|
|
167
|
+
* 默认 false:平坦路径保持 isDynamicHeight ? 'auto' : rowHeight。
|
|
168
|
+
*/
|
|
169
|
+
forceRowHeight?: boolean;
|
|
170
|
+
}
|
|
@@ -12,7 +12,7 @@ export declare const getFixedStickyStyle: (columnIndex: number, flatColumns: Col
|
|
|
12
12
|
* 排序数据。compareFn 按升序编写,降序由内部 reverse。
|
|
13
13
|
*/
|
|
14
14
|
export declare const sortData: <T extends Record<string, unknown>>(data: T[], key: string, direction: SortDirection, compareFn?: (aVal: unknown, bVal: unknown, a: T, b: T) => number) => T[];
|
|
15
|
-
export declare const getRowKey: (record: Record<string, unknown
|
|
15
|
+
export declare const getRowKey: (record: Record<string, unknown> | undefined, rowKey: string | undefined, index: number) => string | number;
|
|
16
16
|
export declare const splitFixedColumns: (columns: ColumnConfig[]) => {
|
|
17
17
|
leftFixedColumns: ColumnConfig[];
|
|
18
18
|
normalColumns: ColumnConfig[];
|
|
@@ -38,6 +38,7 @@ export { default as DatePicker } from './DatePicker';
|
|
|
38
38
|
export type { DatePickerProps, DatePickerTheme, PickerType } from './DatePicker';
|
|
39
39
|
export { default as Table } from './Table';
|
|
40
40
|
export type { TableProps, TableTheme, ColumnConfig, HeaderRenderApi } from './Table';
|
|
41
|
-
export { processRowspan, shouldRenderCell, getCellRowspan, getRowKey, calculateFixedOffset, splitFixedColumns, getColumnsWidth, expandLeafColumns, sortData, useTableVirtual, useColumnResize, resolveTableThemeVars, } from './Table';
|
|
41
|
+
export { processRowspan, shouldRenderCell, getCellRowspan, getRowKey, calculateFixedOffset, splitFixedColumns, getColumnsWidth, expandLeafColumns, sortData, useTableVirtual, useColumnResize, resolveTableThemeVars, HierarchyCell, buildHierarchyTreeMeta, } from './Table';
|
|
42
|
+
export type { HierarchyLoadMore, HierarchyProps, HierarchyRowMeta } from './Table';
|
|
42
43
|
export { default as FieldCard } from './FieldCard';
|
|
43
44
|
export type { FieldCardCheckProps, FieldCardCoverFit, FieldCardCoverLayout, FieldCardCoverPosition, FieldCardCoverShape, FieldCardExtraProps, FieldCardFooterProps, FieldCardLayout, FieldCardMetaProps, FieldCardProps, FieldCardSize, FieldCardSkeletonProps, FieldCardTheme, } from './FieldCard';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./vendors/version-
|
|
1
|
+
import "./vendors/version-Foao691n.js";
|
|
2
2
|
import "./ScrollBar/style-D26azwz6.js";
|
|
3
3
|
import { t as e } from "./Icon/Icon-CcKDWNGy.js";
|
|
4
4
|
import "./vendors/LocaleContext-CsTLO_Y2.js";
|
|
@@ -29,10 +29,10 @@ import { t as O } from "./DropDown/DropDown-B3VFy5GF.js";
|
|
|
29
29
|
import { t as k } from "./Loading/Loading-Dm4i0lYd.js";
|
|
30
30
|
import "./NotFoundContent/index.js";
|
|
31
31
|
import { t as A } from "./InputTag/InputTag-C1WA6sDA.js";
|
|
32
|
-
import { t as j } from "./Calendar/Calendar-
|
|
33
|
-
import { t as M } from "./DatePicker/DatePicker-
|
|
32
|
+
import { t as j } from "./Calendar/Calendar-cXOw65UG.js";
|
|
33
|
+
import { t as M } from "./DatePicker/DatePicker-TimXurVT.js";
|
|
34
34
|
import "./DatePicker/pickerLocale-Brf7_Tnd.js";
|
|
35
|
-
import {
|
|
36
|
-
import { t as
|
|
35
|
+
import { a as N, c as P, d as F, f as I, g as L, h as R, i as z, l as B, m as V, n as H, o as U, p as W, r as G, t as K, u as q } from "./Table/Table-BMqJZqBK.js";
|
|
36
|
+
import { t as J } from "./FieldCard/FieldCard-CCv4nLpH.js";
|
|
37
37
|
import "overlayscrollbars/overlayscrollbars.css";
|
|
38
|
-
export { u as Amap, d as AmapCircle, l as AmapMarker, p as AmapMarkerCluster, f as AmapProvider, j as Calendar, m as Card, S as Checkbox, g as ColorPicker, n as ConfigProvider, M as DatePicker, O as DropDown,
|
|
38
|
+
export { u as Amap, d as AmapCircle, l as AmapMarker, p as AmapMarkerCluster, f as AmapProvider, j as Calendar, m as Card, S as Checkbox, g as ColorPicker, n as ConfigProvider, M as DatePicker, O as DropDown, J as FieldCard, K as HierarchyCell, e as Icon, A as InputTag, k as Loading, t as LocalTheme, h as Modal, w as NotFoundContent, o as OVERLAY_Z_BASE, a as OVERLAY_Z_STEP, i as OverlayProvider, C as Radio, C as Ratio, T as ScrollBar, _ as Segmented, b as Select, D as TabSelect, G as Table, E as Tabs, y as Tooltip, v as TooltipFloatingContext, x as Tree, H as buildHierarchyTreeMeta, F as calculateFixedOffset, I as expandLeafColumns, P as getCellRowspan, W as getColumnsWidth, V as getRowKey, B as processRowspan, z as resolveTableThemeVars, q as shouldRenderCell, R as sortData, L as splitFixedColumns, s as useAmap, N as useColumnResize, c as useCurrentLocation, r as useOverlayZIndex, U as useTableVirtual };
|