@hi-ui/table 4.0.0-alpha.10 → 4.0.0-alpha.11

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 (39) hide show
  1. package/lib/types/Table.d.ts +34 -11
  2. package/lib/types/TableBody.d.ts +11 -0
  3. package/lib/types/TableCell.d.ts +28 -0
  4. package/lib/types/TableColumnMenu.d.ts +10 -0
  5. package/lib/types/TableExpandedRow.d.ts +28 -0
  6. package/lib/types/TableHeader.d.ts +11 -0
  7. package/lib/types/TableRow.d.ts +26 -0
  8. package/lib/types/TableSettingMenu.d.ts +12 -0
  9. package/lib/types/context.d.ts +147 -0
  10. package/lib/types/hooks/index.d.ts +2 -0
  11. package/lib/types/hooks/use-async-switch.d.ts +3 -0
  12. package/lib/types/hooks/use-check.d.ts +15 -0
  13. package/lib/types/hooks/use-col-frozen.d.ts +10 -0
  14. package/lib/types/hooks/use-col-hidden.d.ts +13 -0
  15. package/lib/types/hooks/use-col-sorter.d.ts +13 -0
  16. package/lib/types/hooks/use-col-width.d.ts +21 -0
  17. package/lib/types/hooks/use-colgroup.d.ts +10 -0
  18. package/lib/types/hooks/use-drag.d.ts +13 -0
  19. package/lib/types/hooks/use-expand.d.ts +7 -0
  20. package/lib/types/hooks/use-pagination.d.ts +13 -0
  21. package/lib/types/hooks/use-queue.d.ts +6 -0
  22. package/lib/types/icons/index.d.ts +5 -0
  23. package/lib/types/index.d.ts +1 -0
  24. package/lib/types/types.d.ts +167 -0
  25. package/lib/types/use-table.d.ts +217 -0
  26. package/lib/types/utils/index.d.ts +11 -0
  27. package/package.json +21 -21
  28. package/lib/cjs/Table.js +0 -64
  29. package/lib/cjs/Table.js.map +0 -1
  30. package/lib/cjs/index.js +0 -22
  31. package/lib/cjs/index.js.map +0 -1
  32. package/lib/cjs/styles/index.scss.js +0 -22
  33. package/lib/cjs/styles/index.scss.js.map +0 -1
  34. package/lib/esm/Table.js +0 -44
  35. package/lib/esm/Table.js.map +0 -1
  36. package/lib/esm/index.js +0 -12
  37. package/lib/esm/index.js.map +0 -1
  38. package/lib/esm/styles/index.scss.js +0 -17
  39. package/lib/esm/styles/index.scss.js.map +0 -1
@@ -1,23 +1,46 @@
1
1
  import React from 'react';
2
+ import { HiBaseHTMLProps } from '@hi-ui/core';
3
+ import { UseTableProps } from './use-table';
4
+ import { TableExtra, TablePaginationProps } from './types';
5
+ import { AxiosRequestConfig } from 'axios';
2
6
  /**
3
- * TODO: What is Table
4
- */
7
+ * TODO: What is BaseTable
8
+ */
9
+ export declare const BaseTable: React.ForwardRefExoticComponent<BaseTableProps & React.RefAttributes<HTMLDivElement | null>>;
10
+ export interface BaseTableProps extends Omit<HiBaseHTMLProps<'div'>, 'onDrop' | 'draggable' | 'onDragStart'>, UseTableProps {
11
+ extra?: TableExtra;
12
+ }
13
+ /**
14
+ * TODO: What is Table
15
+ */
5
16
  export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLDivElement | null>>;
6
- export interface TableProps {
17
+ export interface TableProps extends Omit<BaseTableProps, 'extra' | 'role'> {
18
+ /**
19
+ * 加载中状态
20
+ */
21
+ loading?: boolean;
22
+ /**
23
+ * 标准模式,默认集成 `showColMenu = true, sticky = true, bordered = true, setting = true, striped = true`
24
+ */
25
+ standard?: boolean;
26
+ /**
27
+ * 唯一 id 前缀,废弃
28
+ */
29
+ uniqueId?: string;
7
30
  /**
8
- * 组件默认的选择器类
31
+ * 隐藏列(受控) (v3.9.0 新增),需要 column 中必须传入唯一的 dataKey 用于列隐藏
9
32
  */
10
- prefixCls?: string;
33
+ hiddenColKeys?: string[];
11
34
  /**
12
- * 组件的语义化 Role 属性
35
+ * 列隐藏设置时回调 (v3.9.0 新增)
13
36
  */
14
- role?: string;
37
+ onHiddenColKeysChange?: (hiddenColKeys: string[]) => void;
15
38
  /**
16
- * 组件的注入选择器类
39
+ * 异步数据源
17
40
  */
18
- className?: string;
41
+ dataSource?: (current: number) => AxiosRequestConfig<any>;
19
42
  /**
20
- * 组件的注入样式
43
+ * 表格分页配置项
21
44
  */
22
- style?: React.CSSProperties;
45
+ pagination?: TablePaginationProps;
23
46
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * TODO: What is TableBody
4
+ */
5
+ export declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLDivElement | null>>;
6
+ export interface TableBodyProps {
7
+ /**
8
+ * 组件默认的选择器类
9
+ */
10
+ prefixCls?: string;
11
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { TableRowSelection } from './types';
3
+ /**
4
+ * TODO: What is TableCell
5
+ */
6
+ export declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement | null>>;
7
+ export interface TableCellProps {
8
+ /**
9
+ * 组件默认的选择器类
10
+ */
11
+ prefixCls?: string;
12
+ /**
13
+ * 列配置项
14
+ */
15
+ fixedColWidth: number[];
16
+ rowSelection?: TableRowSelection;
17
+ className?: any;
18
+ column?: any;
19
+ rowIndex?: any;
20
+ depth?: any;
21
+ columnIndex?: any;
22
+ expandedTree?: any;
23
+ isTree?: any;
24
+ expandIcon?: any;
25
+ collapseIcon?: any;
26
+ leafIcon?: any;
27
+ rowData?: any;
28
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { HiBaseHTMLProps } from '@hi-ui/core';
3
+ import { UseTableProps } from './use-table';
4
+ /**
5
+ * TODO: What is Table
6
+ */
7
+ export declare const TableColumnMenu: React.ForwardRefExoticComponent<TableColumnMenuProps & React.RefAttributes<HTMLDivElement | null>>;
8
+ export interface TableColumnMenuProps extends Omit<HiBaseHTMLProps<'div'>, 'onDrop' | 'draggable' | 'onDragStart'>, UseTableProps {
9
+ }
10
+ export declare const TableColumnMenuItem: ({ prefixCls, active, onClick, content, icon }: any) => JSX.Element;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { TableColumnItem, TableRowSelection } from './types';
3
+ /**
4
+ * TODO: What is TableExpandedRow
5
+ */
6
+ export declare const TableExpandedRow: React.ForwardRefExoticComponent<TableExpandedRowProps & React.RefAttributes<HTMLDivElement | null>>;
7
+ export interface TableExpandedRowProps {
8
+ /**
9
+ * 组件默认的选择器类
10
+ */
11
+ prefixCls?: string;
12
+ /**
13
+ * 列配置项
14
+ */
15
+ columns: TableColumnItem[];
16
+ /**
17
+ * 数据配置项
18
+ */
19
+ data: object[];
20
+ /**
21
+ * 第一行ref
22
+ */
23
+ fixedColWidth: number[];
24
+ rowSelection?: TableRowSelection;
25
+ rowData?: object;
26
+ rowIndex?: number;
27
+ expandedRender: any;
28
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * TODO: What is TableHeader
4
+ */
5
+ export declare const TableHeader: React.ForwardRefExoticComponent<TableHeaderProps & React.RefAttributes<HTMLDivElement | null>>;
6
+ export interface TableHeaderProps {
7
+ /**
8
+ * 组件默认的选择器类
9
+ */
10
+ prefixCls?: string;
11
+ }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { TableRowSelection, TableColumnItem } from './types';
3
+ /**
4
+ * TODO: What is TableRow
5
+ */
6
+ export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement | null>>;
7
+ export interface TableRowProps {
8
+ /**
9
+ * 组件默认的选择器类
10
+ */
11
+ prefixCls?: string;
12
+ /**
13
+ * 列配置项
14
+ */
15
+ columns: TableColumnItem[];
16
+ /**
17
+ * 数据配置项
18
+ */
19
+ data: object[];
20
+ /**
21
+ * 第一行ref
22
+ */
23
+ firstRowRef: React.RefObject<HTMLTableRowElement>;
24
+ fixedColWidth: number[];
25
+ rowSelection?: TableRowSelection;
26
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { UseTableProps } from './use-table';
3
+ import { UseColSorterReturn } from './hooks/use-col-sorter';
4
+ import { UseColHiddenReturn } from './hooks/use-col-hidden';
5
+ /**
6
+ * TODO: What is Table
7
+ * 高级定制功能
8
+ */
9
+ export declare const TableSettingMenu: React.ForwardRefExoticComponent<TableColumnMenuProps & React.RefAttributes<HTMLDivElement | null>>;
10
+ export interface TableColumnMenuProps extends UseTableProps, UseColSorterReturn, Omit<UseColHiddenReturn, 'visibleCols'> {
11
+ prefixCls?: string;
12
+ }
@@ -0,0 +1,147 @@
1
+ /// <reference types="react" />
2
+ export declare const TableProvider: import("react").Provider<Omit<{
3
+ getColgroupProps: (column: import("./types").FlattedTableColumnItemData, index: number) => {
4
+ style: {
5
+ width: number | undefined;
6
+ minWidth: number | undefined;
7
+ };
8
+ 'data-hover-highlight': "" | undefined;
9
+ };
10
+ getStickyColProps: (column: any) => {
11
+ style: import("react").CSSProperties;
12
+ 'data-sticky': "" | undefined;
13
+ };
14
+ onHighlightedRowChange: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
15
+ isHighlightedRow: (id: import("react").ReactText) => boolean;
16
+ highlightedRowKeys: import("react").ReactText[];
17
+ trySetHighlightedRowKeys: (stateOrFunction: import("react").SetStateAction<import("react").ReactText[]>, ...args: any[]) => void;
18
+ onHighlightedColChange: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
19
+ isHighlightedCol: (id: import("react").ReactText) => boolean;
20
+ highlightedColKeys: string[];
21
+ trySetHighlightedColKeys: (stateOrFunction: import("react").SetStateAction<string[]>, ...args: any[]) => void;
22
+ showColHighlight: boolean | undefined;
23
+ isHoveredCol: (id: import("react").ReactText) => boolean;
24
+ onHoveredColChange: <T extends import("packages/hooks/use-check/lib/types").UseCheckItem>(targetItem: T, shouldSelected?: boolean | undefined) => void;
25
+ draggable: boolean;
26
+ highlightColumns: any;
27
+ dragRowRef: import("react").MutableRefObject<any>;
28
+ onDrop: (sourceId: any, targetId: any, dragDirection: any) => void;
29
+ groupedColumns: import("./types").FlattedTableColumnItemData[][];
30
+ onExpandTreeRowsChange: (expandedNode: import("./types").TableRowEventData, shouldExpanded: boolean) => void;
31
+ isExpandTreeRows: (id: import("react").ReactText) => boolean;
32
+ isLoadingTreeNodeId: (id: import("react").ReactText) => boolean;
33
+ onTreeNodeSwitch: (node: import("./types").TableRowEventData, onlyExpand?: any) => Promise<void>;
34
+ rowExpandable: (record: import("./types").TableColumnItem) => import("react").ReactNode;
35
+ resizable: boolean;
36
+ colWidths: (number | undefined)[];
37
+ onColumnResizable: (_: any, { size }: any, index: number) => void;
38
+ scrollLeft: number;
39
+ scrollRight: number;
40
+ canScroll: boolean;
41
+ maxHeight: number | undefined;
42
+ getTableHeaderProps: () => {
43
+ style: import("react").CSSProperties;
44
+ 'data-sticky': "" | undefined;
45
+ };
46
+ isErrorRow: (key: string) => boolean;
47
+ bodyTableRef: import("react").RefObject<HTMLTableElement>;
48
+ scrollBodyElementRef: import("react").RefObject<HTMLTableElement>;
49
+ columns: import("./types").FlattedTableColumnItemData[];
50
+ data: object[];
51
+ transitionData: import("./types").FlattedTableRowData[];
52
+ flattedColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
53
+ flattedColumnsWithoutChildren: import("./types").FlattedTableColumnItemData[];
54
+ fixedColWidth: number[];
55
+ expandedRender: ((record: import("./types").TableColumnItem, index: number) => import("react").ReactNode | Promise<import("react").ReactNode>) | undefined;
56
+ rowSelection: import("./types").TableRowSelection | undefined;
57
+ cacheData: object[];
58
+ firstRowElementRef: import("react").RefObject<HTMLTableRowElement>;
59
+ leafColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
60
+ bordered: boolean;
61
+ size: string | undefined;
62
+ scrollHeaderElementRef: import("react").RefObject<HTMLTableElement>;
63
+ errorRowKeys: never[];
64
+ onTableBodyScroll: (evt: any) => void;
65
+ onTableBodyScrollMock: (evt: any) => void;
66
+ scrollSize: {
67
+ scrollLeft: number;
68
+ scrollRight: number;
69
+ };
70
+ leftFrozenColKeys: any[];
71
+ rightFrozenColKeys: any[];
72
+ leftFixedColumnsWidth: number;
73
+ rightFixedColumnsWidth: number;
74
+ }, "rootProps"> | null>;
75
+ export declare const useTableContext: () => Omit<{
76
+ getColgroupProps: (column: import("./types").FlattedTableColumnItemData, index: number) => {
77
+ style: {
78
+ width: number | undefined;
79
+ minWidth: number | undefined;
80
+ };
81
+ 'data-hover-highlight': "" | undefined;
82
+ };
83
+ getStickyColProps: (column: any) => {
84
+ style: import("react").CSSProperties;
85
+ 'data-sticky': "" | undefined;
86
+ };
87
+ onHighlightedRowChange: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
88
+ isHighlightedRow: (id: import("react").ReactText) => boolean;
89
+ highlightedRowKeys: import("react").ReactText[];
90
+ trySetHighlightedRowKeys: (stateOrFunction: import("react").SetStateAction<import("react").ReactText[]>, ...args: any[]) => void;
91
+ onHighlightedColChange: (targetItem: import("packages/hooks/use-check/lib/types").UseCheckItem, shouldChecked: boolean) => void;
92
+ isHighlightedCol: (id: import("react").ReactText) => boolean;
93
+ highlightedColKeys: string[];
94
+ trySetHighlightedColKeys: (stateOrFunction: import("react").SetStateAction<string[]>, ...args: any[]) => void;
95
+ showColHighlight: boolean | undefined;
96
+ isHoveredCol: (id: import("react").ReactText) => boolean;
97
+ onHoveredColChange: <T extends import("packages/hooks/use-check/lib/types").UseCheckItem>(targetItem: T, shouldSelected?: boolean | undefined) => void;
98
+ draggable: boolean;
99
+ highlightColumns: any;
100
+ dragRowRef: import("react").MutableRefObject<any>;
101
+ onDrop: (sourceId: any, targetId: any, dragDirection: any) => void;
102
+ groupedColumns: import("./types").FlattedTableColumnItemData[][];
103
+ onExpandTreeRowsChange: (expandedNode: import("./types").TableRowEventData, shouldExpanded: boolean) => void;
104
+ isExpandTreeRows: (id: import("react").ReactText) => boolean;
105
+ isLoadingTreeNodeId: (id: import("react").ReactText) => boolean;
106
+ onTreeNodeSwitch: (node: import("./types").TableRowEventData, onlyExpand?: any) => Promise<void>;
107
+ rowExpandable: (record: import("./types").TableColumnItem) => import("react").ReactNode;
108
+ resizable: boolean;
109
+ colWidths: (number | undefined)[];
110
+ onColumnResizable: (_: any, { size }: any, index: number) => void;
111
+ scrollLeft: number;
112
+ scrollRight: number;
113
+ canScroll: boolean;
114
+ maxHeight: number | undefined;
115
+ getTableHeaderProps: () => {
116
+ style: import("react").CSSProperties;
117
+ 'data-sticky': "" | undefined;
118
+ };
119
+ isErrorRow: (key: string) => boolean;
120
+ bodyTableRef: import("react").RefObject<HTMLTableElement>;
121
+ scrollBodyElementRef: import("react").RefObject<HTMLTableElement>;
122
+ columns: import("./types").FlattedTableColumnItemData[];
123
+ data: object[];
124
+ transitionData: import("./types").FlattedTableRowData[];
125
+ flattedColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
126
+ flattedColumnsWithoutChildren: import("./types").FlattedTableColumnItemData[];
127
+ fixedColWidth: number[];
128
+ expandedRender: ((record: import("./types").TableColumnItem, index: number) => import("react").ReactNode | Promise<import("react").ReactNode>) | undefined;
129
+ rowSelection: import("./types").TableRowSelection | undefined;
130
+ cacheData: object[];
131
+ firstRowElementRef: import("react").RefObject<HTMLTableRowElement>;
132
+ leafColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
133
+ bordered: boolean;
134
+ size: string | undefined;
135
+ scrollHeaderElementRef: import("react").RefObject<HTMLTableElement>;
136
+ errorRowKeys: never[];
137
+ onTableBodyScroll: (evt: any) => void;
138
+ onTableBodyScrollMock: (evt: any) => void;
139
+ scrollSize: {
140
+ scrollLeft: number;
141
+ scrollRight: number;
142
+ };
143
+ leftFrozenColKeys: any[];
144
+ rightFrozenColKeys: any[];
145
+ leftFixedColumnsWidth: number;
146
+ rightFixedColumnsWidth: number;
147
+ }, "rootProps">;
@@ -0,0 +1,2 @@
1
+ export * from './use-async-switch';
2
+ export * from './use-expand';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TableRowEventData } from '../types';
3
+ export declare const useAsyncSwitch: (setCascaderData: React.Dispatch<React.SetStateAction<any[]>>, onExpand?: ((selectedOption: TableRowEventData, onlyExpand: boolean) => void) | undefined, onLoadChildren?: ((item: TableRowEventData) => Promise<any[] | void> | void) | undefined) => readonly [(id: React.ReactText) => boolean, (node: TableRowEventData, onlyExpand?: any) => Promise<void>];
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { FlattedTableRowData, TableRowSelection } from '../types';
3
+ export declare const useTableCheck: ({ rowSelection, flattedData, getRowKeyField, }: {
4
+ rowSelection: TableRowSelection | undefined;
5
+ flattedData: FlattedTableRowData[];
6
+ getRowKeyField: (item: any) => string;
7
+ }) => {
8
+ tryCheckAllRow: () => void;
9
+ checkedAll: boolean;
10
+ semiChecked: boolean;
11
+ onCheckedRowKeysChange: (targetItem: import("@hi-ui/use-check").UseCheckItem, shouldChecked: boolean) => void;
12
+ isCheckedRowKey: (id: React.ReactText) => boolean;
13
+ checkedRowKeys: React.ReactText[];
14
+ trySetCheckedRowKeys: (stateOrFunction: React.SetStateAction<React.ReactText[]>, ...args: any[]) => void;
15
+ };
@@ -0,0 +1,10 @@
1
+ import { FlattedTableColumnItemData, TableColumnItem } from '../types';
2
+ export declare const useColFrozen: ({ columns, resizable, }: {
3
+ resizable: boolean;
4
+ columns: TableColumnItem[];
5
+ }) => {
6
+ flattedColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
7
+ mergedColumns: FlattedTableColumnItemData[];
8
+ groupedColumns: TableColumnItem[][];
9
+ flattedColumnsWithoutChildren: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
10
+ };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { TableProps } from '../Table';
3
+ /**
4
+ * 列操作逻辑
5
+ */
6
+ export declare const useColHidden: ({ uniqueId, columns, hiddenColKeys: hiddenColKeysProp, onHiddenColKeysChange, }: TableProps) => {
7
+ visibleCols: import("..").TableColumnItem[];
8
+ hiddenColKeys: string[];
9
+ setHiddenColKeys: (stateOrFunction: import("react").SetStateAction<string[]>, ...args: any[]) => void;
10
+ cacheHiddenColKeys: string[];
11
+ setCacheHiddenColKeys: import("react").Dispatch<import("react").SetStateAction<string[]>>;
12
+ };
13
+ export declare type UseColHiddenReturn = ReturnType<typeof useColHidden>;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { UseTableProps } from '../use-table';
3
+ import { TableColumnItem } from '../types';
4
+ /**
5
+ * 列排序
6
+ */
7
+ export declare const useColSorter: ({ uniqueId, columns }: UseTableProps) => {
8
+ sortedCols: TableColumnItem[];
9
+ setSortCols: import("react").Dispatch<import("react").SetStateAction<TableColumnItem[]>>;
10
+ cacheSortedCols: TableColumnItem[];
11
+ setCacheSortedCols: import("react").Dispatch<import("react").SetStateAction<TableColumnItem[]>>;
12
+ };
13
+ export declare type UseColSorterReturn = ReturnType<typeof useColSorter>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { FlattedTableColumnItemData, TableColumnItem } from '../types';
3
+ export declare const useColWidth: ({ data, columns, resizable, dataSource, firstRowElementRef, isHoveredCol, }: {
4
+ resizable: boolean;
5
+ columns: TableColumnItem[];
6
+ data: object[];
7
+ dataSource?: any;
8
+ firstRowElementRef?: any;
9
+ isHoveredCol: (dataKey: string) => boolean;
10
+ }) => {
11
+ onColumnResizable: (_: any, { size }: any, index: number) => void;
12
+ getColgroupProps: (column: FlattedTableColumnItemData, index: number) => {
13
+ style: {
14
+ width: number | undefined;
15
+ minWidth: number | undefined;
16
+ };
17
+ 'data-hover-highlight': "" | undefined;
18
+ };
19
+ setHeaderTableElement: React.Dispatch<React.SetStateAction<HTMLTableElement | null>>;
20
+ colWidths: (number | undefined)[];
21
+ };
@@ -0,0 +1,10 @@
1
+ import { FlattedTableColumnItemData, TableColumnItem } from '../types';
2
+ export declare const useColumns: ({ columns }: {
3
+ columns: TableColumnItem[];
4
+ }) => {
5
+ flattedColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
6
+ mergedColumns: FlattedTableColumnItemData[];
7
+ groupedColumns: FlattedTableColumnItemData[][];
8
+ leafColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
9
+ flattedColumnsWithoutChildren: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
10
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { FlattedTableRowData } from '../types';
3
+ export declare const useTableDrag: ({ cacheData, setCacheData, draggable, flattedData, onDropEnd, onDrop: onDropProp, }: {
4
+ cacheData: any;
5
+ setCacheData: any;
6
+ draggable: boolean;
7
+ flattedData: FlattedTableRowData[];
8
+ onDropEnd: any;
9
+ onDrop: any;
10
+ }) => {
11
+ onDrop: (sourceId: any, targetId: any, dragDirection: any) => void;
12
+ dragRowRef: React.MutableRefObject<any>;
13
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { FlattedTableRowData, TableRowEventData } from '../types';
3
+ export declare const useExpandProps: (flattedData: FlattedTableRowData[], defaultExpandedIds: React.ReactText[], expandedIdsProp?: React.ReactText[] | undefined, onExpand?: ((expandIds: React.ReactText[], node: TableRowEventData, expanded: boolean) => void) | undefined, defaultExpandAll?: boolean | undefined) => readonly [React.ReactText[], (stateOrFunction: React.SetStateAction<React.ReactText[]>, ...args: any[]) => void];
4
+ /**
5
+ * 树形节点展开
6
+ */
7
+ export declare const useExpand: (flattedData: FlattedTableRowData[], defaultExpandedIds: React.ReactText[], expandedIdsProp?: React.ReactText[] | undefined, onExpand?: ((expandIds: React.ReactText[], node: TableRowEventData, expanded: boolean) => void) | undefined, defaultExpandAll?: boolean | undefined) => readonly [FlattedTableRowData[], (expandedNode: TableRowEventData, shouldExpanded: boolean) => void, (id: React.ReactText) => boolean];
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { PaginationProps } from '@hi-ui/pagination';
3
+ import { AxiosRequestConfig } from 'axios';
4
+ export declare const useTablePagination: ({ pagination, data: dataProp, dataSource, }: {
5
+ data?: object[] | undefined;
6
+ pagination?: PaginationProps | undefined;
7
+ dataSource?: ((current: number) => AxiosRequestConfig<any>) | undefined;
8
+ }) => {
9
+ mergedData: object[] | undefined;
10
+ pagination: PaginationProps | undefined;
11
+ currentPage: number;
12
+ trySetCurrentPage: (stateOrFunction: React.SetStateAction<number>, ...args: any[]) => void;
13
+ };
@@ -0,0 +1,6 @@
1
+ export declare const useQueue: <T>(initialValue?: T[]) => {
2
+ enqueue: (value: T) => void;
3
+ dequeue: () => void;
4
+ readonly top: T;
5
+ readonly empty: boolean;
6
+ };
@@ -0,0 +1,5 @@
1
+ export declare const defaultCollapseIcon: JSX.Element;
2
+ export declare const defaultExpandIcon: JSX.Element;
3
+ export declare const defaultLeafIcon: JSX.Element;
4
+ export declare const defaultLoadingIcon: JSX.Element;
5
+ export declare const defaultActionIcon: JSX.Element;
@@ -1,3 +1,4 @@
1
1
  import './styles/index.scss';
2
2
  export * from './Table';
3
3
  export { Table as default } from './Table';
4
+ export * from './types';
@@ -0,0 +1,167 @@
1
+ import React from 'react';
2
+ import { SelectProps } from '@hi-ui/select';
3
+ import { ValueOf } from '@hi-ui/core';
4
+ import { PaginationProps } from '@hi-ui/pagination';
5
+ export declare type TableAlign = 'left' | 'right' | 'center';
6
+ export declare type TableFrozenColumnOptions = {
7
+ left?: string;
8
+ right?: string;
9
+ };
10
+ export declare type TableExtra = {
11
+ footer?: React.ReactNode;
12
+ header?: React.ReactNode;
13
+ };
14
+ export declare type TableCheckAllOptions = {
15
+ title?: React.ReactNode;
16
+ filterIcon?: React.ReactNode;
17
+ render?: (checkboxNode: React.ReactNode) => React.ReactNode;
18
+ };
19
+ export declare type TableRowSelection = {
20
+ checkboxColWidth?: number;
21
+ selectedRowKeys?: React.ReactText[];
22
+ getCheckboxConfig?: (rowData: object) => {
23
+ disabled?: boolean;
24
+ };
25
+ onChange?: (selectedRowKeys: React.ReactText[], targetRow?: object | object[], shouldChecked?: boolean) => void;
26
+ render?: (checkboxNode: React.ReactNode, rowItem: object, rowIndex: number) => React.ReactNode;
27
+ /**
28
+ * 全选配置集合
29
+ */
30
+ checkAllOptions?: TableCheckAllOptions;
31
+ };
32
+ export declare type TableHeaderRowReturn = {
33
+ onClick?: (event: React.MouseEvent) => void;
34
+ onDoubleClick?: (event: React.MouseEvent) => void;
35
+ onContextMenu?: (event: React.MouseEvent) => void;
36
+ onMouseEnter?: (event: React.MouseEvent) => void;
37
+ onMouseLeave?: (event: React.MouseEvent) => void;
38
+ };
39
+ export declare type HeaderRowFunc = (columns: TableColumnItem[], index: number) => TableHeaderRowReturn;
40
+ export declare type TableColumnItem = {
41
+ title: React.ReactNode;
42
+ dataKey?: string;
43
+ align?: TableAlign;
44
+ sorter?: (a: any, b: any) => number;
45
+ avg?: boolean;
46
+ total?: boolean;
47
+ width?: number;
48
+ children?: TableColumnItem[];
49
+ selectFilters?: SelectProps;
50
+ defaultSortOrder?: 'ascend' | 'descend';
51
+ render?: (text: any, rowItem: Record<string, any>, rowIndex: number, dataKey: string) => React.ReactNode;
52
+ filterIcon?: React.ReactNode;
53
+ filterDropdownWidth?: number;
54
+ filterDropdownClassName?: string;
55
+ filterDropdown?: (props: {
56
+ ColumnItem: TableColumnItem;
57
+ setFilterDropdownVisible: Function;
58
+ }) => React.ReactNode;
59
+ onFilterDropdownVisibleChange?: (filterDropdownVisible: boolean, item: TableColumnItem) => void;
60
+ };
61
+ export declare type TableDataSource = {
62
+ url: string;
63
+ currentPageName?: string;
64
+ auto?: boolean;
65
+ autoDelayTime?: number;
66
+ headers?: object;
67
+ data?: object;
68
+ success?: (response: object) => any;
69
+ error?: (err: object) => void;
70
+ type?: 'GET' | 'POST';
71
+ withCredentials?: boolean;
72
+ transformResponse?: (response: object) => object[];
73
+ };
74
+ export interface TablePaginationProps extends PaginationProps {
75
+ placement?: 'left' | 'middle';
76
+ }
77
+ export interface TableRowData {
78
+ /**
79
+ * 树节点唯一 id
80
+ */
81
+ id: React.ReactText;
82
+ /**
83
+ * 树节点唯一 id
84
+ */
85
+ /**
86
+ * 该节点的子节点列表
87
+ */
88
+ children?: TableRowData[];
89
+ /**
90
+ * 是否为叶子节点
91
+ */
92
+ isLeaf?: boolean;
93
+ }
94
+ export interface FlattedTableRowData extends TableRowData {
95
+ /**
96
+ * 树节点唯一 id
97
+ */
98
+ /**
99
+ * 该节点的子节点列表
100
+ */
101
+ children?: FlattedTableRowData[];
102
+ /**
103
+ * 关联用户传入的原始节点
104
+ */
105
+ raw: TableRowData;
106
+ /**
107
+ * 该节点的层级,从 0(顶层)开始
108
+ */
109
+ depth: number;
110
+ /**
111
+ * 该节点的父节点
112
+ */
113
+ parent?: FlattedTableRowData;
114
+ /**
115
+ * 节点所在列表数据中的下标
116
+ */
117
+ pos?: number;
118
+ }
119
+ export interface FlattedTableColumnItemData extends TableColumnItem {
120
+ /**
121
+ * 树节点唯一 id
122
+ */
123
+ /**
124
+ * 该节点的子节点列表
125
+ */
126
+ children?: FlattedTableColumnItemData[];
127
+ /**
128
+ * 关联用户传入的原始节点
129
+ */
130
+ raw: TableColumnItem;
131
+ /**
132
+ * 该节点的层级,从 0(顶层)开始
133
+ */
134
+ depth: number;
135
+ /**
136
+ * 该节点的父节点
137
+ */
138
+ parent?: FlattedTableColumnItemData;
139
+ /**
140
+ * 节点所在列表数据中的下标
141
+ */
142
+ pos?: number;
143
+ }
144
+ export interface TableNodeRequiredProps {
145
+ expanded: boolean;
146
+ checked: boolean;
147
+ semiChecked: boolean;
148
+ selected: boolean;
149
+ loading: boolean;
150
+ focused: boolean;
151
+ }
152
+ export interface TableRowEventData extends FlattedTableRowData, TableNodeRequiredProps {
153
+ }
154
+ export declare const TreeNodeType: {
155
+ readonly SHOW: "show";
156
+ readonly HIDE: "hide";
157
+ readonly ADD: "add";
158
+ };
159
+ export declare type TreeNodeType = ValueOf<typeof TreeNodeType>;
160
+ export interface TableRowRequiredProps {
161
+ expanded: boolean;
162
+ checked: boolean;
163
+ semiChecked: boolean;
164
+ selected: boolean;
165
+ loading: boolean;
166
+ focused: boolean;
167
+ }
@@ -0,0 +1,217 @@
1
+ import React from 'react';
2
+ import { HeaderRowFunc, TableColumnItem, TableFrozenColumnOptions, TableRowEventData, TableRowSelection, FlattedTableColumnItemData } from './types';
3
+ import { PaginationProps } from '@hi-ui/pagination';
4
+ export declare const useTable: ({ data, columns: columnsProp, fixedToColumn, rowSelection, striped, resizable, size, errorRowKeys, highlightedRowKeys: highlightedRowKeysProp, highlightedColKeys: highlightedColKeysProp, defaultExpandRowKeys, expandRowKeys: expandRowKeysProp, onExpand, defaultExpandAll, expandEmbedRowKeys: expandEmbedRowKeysProp, onEmbedExpand, onHeaderRow, expandedRender, maxHeight, dataSource, showColMenu, showColHighlight, sticky, stickyTop, onLoadChildren, rowExpandable, scrollWidth, draggable, fieldKey, onDragStart, onDrop: onDropProp, onDropEnd, emptyContent, }: UseTableProps) => {
5
+ getColgroupProps: (column: FlattedTableColumnItemData, index: number) => {
6
+ style: {
7
+ width: number | undefined;
8
+ minWidth: number | undefined;
9
+ };
10
+ 'data-hover-highlight': "" | undefined;
11
+ };
12
+ getStickyColProps: (column: any) => {
13
+ style: React.CSSProperties;
14
+ 'data-sticky': "" | undefined;
15
+ };
16
+ onHighlightedRowChange: (targetItem: import("@hi-ui/use-check").UseCheckItem, shouldChecked: boolean) => void;
17
+ isHighlightedRow: (id: React.ReactText) => boolean;
18
+ highlightedRowKeys: React.ReactText[];
19
+ trySetHighlightedRowKeys: (stateOrFunction: React.SetStateAction<React.ReactText[]>, ...args: any[]) => void;
20
+ onHighlightedColChange: (targetItem: import("@hi-ui/use-check").UseCheckItem, shouldChecked: boolean) => void;
21
+ isHighlightedCol: (id: React.ReactText) => boolean;
22
+ highlightedColKeys: string[];
23
+ trySetHighlightedColKeys: (stateOrFunction: React.SetStateAction<string[]>, ...args: any[]) => void;
24
+ showColHighlight: boolean | undefined;
25
+ isHoveredCol: (id: React.ReactText) => boolean;
26
+ onHoveredColChange: <T extends import("@hi-ui/use-check").UseCheckItem>(targetItem: T, shouldSelected?: boolean | undefined) => void;
27
+ draggable: boolean;
28
+ highlightColumns: any;
29
+ dragRowRef: React.MutableRefObject<any>;
30
+ onDrop: (sourceId: any, targetId: any, dragDirection: any) => void;
31
+ groupedColumns: FlattedTableColumnItemData[][];
32
+ onExpandTreeRowsChange: (expandedNode: TableRowEventData, shouldExpanded: boolean) => void;
33
+ isExpandTreeRows: (id: React.ReactText) => boolean;
34
+ isLoadingTreeNodeId: (id: React.ReactText) => boolean;
35
+ onTreeNodeSwitch: (node: TableRowEventData, onlyExpand?: any) => Promise<void>;
36
+ rowExpandable: (record: TableColumnItem) => React.ReactNode;
37
+ resizable: boolean;
38
+ colWidths: (number | undefined)[];
39
+ onColumnResizable: (_: any, { size }: any, index: number) => void;
40
+ scrollLeft: number;
41
+ scrollRight: number;
42
+ canScroll: boolean;
43
+ maxHeight: number | undefined;
44
+ getTableHeaderProps: () => {
45
+ style: React.CSSProperties;
46
+ 'data-sticky': "" | undefined;
47
+ };
48
+ isErrorRow: (key: string) => boolean;
49
+ bodyTableRef: React.RefObject<HTMLTableElement>;
50
+ scrollBodyElementRef: React.RefObject<HTMLTableElement>;
51
+ columns: FlattedTableColumnItemData[];
52
+ data: object[];
53
+ transitionData: import("./types").FlattedTableRowData[];
54
+ flattedColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
55
+ flattedColumnsWithoutChildren: FlattedTableColumnItemData[];
56
+ fixedColWidth: number[];
57
+ expandedRender: ((record: TableColumnItem, index: number) => React.ReactNode | Promise<React.ReactNode>) | undefined;
58
+ rowSelection: TableRowSelection | undefined;
59
+ cacheData: object[];
60
+ firstRowElementRef: React.RefObject<HTMLTableRowElement>;
61
+ leafColumns: import("packages/utils/tree-utils/lib/types/types").BaseFlattedTreeNodeData<any, any>[];
62
+ bordered: boolean;
63
+ size: string | undefined;
64
+ scrollHeaderElementRef: React.RefObject<HTMLTableElement>;
65
+ errorRowKeys: never[];
66
+ onTableBodyScroll: (evt: any) => void;
67
+ onTableBodyScrollMock: (evt: any) => void;
68
+ scrollSize: {
69
+ scrollLeft: number;
70
+ scrollRight: number;
71
+ };
72
+ leftFrozenColKeys: any[];
73
+ rightFrozenColKeys: any[];
74
+ leftFixedColumnsWidth: number;
75
+ rightFixedColumnsWidth: number;
76
+ };
77
+ export interface UseTableProps {
78
+ /**
79
+ * 表格数据
80
+ */
81
+ data?: object[];
82
+ /**
83
+ * 指定 data 表格数据中某一属性为 key
84
+ */
85
+ fieldKey?: string;
86
+ /**
87
+ * 表格列配置信息
88
+ */
89
+ columns?: TableColumnItem[];
90
+ /**
91
+ * 是否显示边框(表头分组模式下,表格自带边框)
92
+ */
93
+ bordered?: boolean;
94
+ /**
95
+ * 是否支持表头吸顶
96
+ */
97
+ sticky?: boolean;
98
+ /**
99
+ * 表头吸顶距离视口顶部距离
100
+ */
101
+ stickyTop?: number;
102
+ /**
103
+ * 高亮列(受控)
104
+ */
105
+ highlightedColKeys?: string[];
106
+ /**
107
+ * 表格展开项
108
+ */
109
+ expandedRender?: (record: TableColumnItem, index: number) => React.ReactNode | Promise<React.ReactNode>;
110
+ /**
111
+ * 设置是否允许行展开
112
+ */
113
+ rowExpandable?: (record: TableColumnItem) => React.ReactNode;
114
+ /**
115
+ * 树形表格展开的行(受控)
116
+ */
117
+ expandRowKeys?: React.ReactText[];
118
+ /**
119
+ * 树形表格默认展开的行
120
+ */
121
+ defaultExpandRowKeys?: React.ReactText[];
122
+ /**
123
+ * 树形表格展开时的回调函数
124
+ */
125
+ onExpand?: (expandIds: React.ReactText[], targetRow: TableRowEventData, expanded: boolean) => void;
126
+ /**
127
+ * 内嵌式表格展开的行(受控)
128
+ */
129
+ expandEmbedRowKeys?: React.ReactText[];
130
+ /**
131
+ * 内嵌式表格默认展开的行
132
+ */
133
+ defaultExpandEmbedRowKeys?: React.ReactText[];
134
+ /**
135
+ * 内嵌式表格展开时的回调函数
136
+ */
137
+ onEmbedExpand?: (expandIds: React.ReactText[], targetRow: TableColumnItem, expanded: boolean) => void;
138
+ /**
139
+ * 表格最大高度,当穿过该高度时,展示滚动条且表头固定
140
+ */
141
+ maxHeight?: number;
142
+ /**
143
+ * 表格列冻结设置,为 string 时仅支持从左侧冻结至某一列
144
+ */
145
+ fixedToColumn?: string | TableFrozenColumnOptions;
146
+ /**
147
+ * 配置表格尺寸
148
+ */
149
+ size?: string;
150
+ /**
151
+ * 表格分页配置项
152
+ */
153
+ pagination?: PaginationProps;
154
+ /**
155
+ * 错误列(受控)
156
+ */
157
+ errorRowKeys?: string[];
158
+ /**
159
+ * 高亮行(受控)
160
+ */
161
+ highlightedRowKeys?: React.ReactText[];
162
+ /**
163
+ * 行可选(受控)
164
+ */
165
+ rowSelection?: TableRowSelection;
166
+ /**
167
+ * 异步数据源
168
+ */
169
+ /**
170
+ * 是否支持列操作
171
+ */
172
+ showColMenu?: boolean;
173
+ /**
174
+ * 是否展示为斑马纹效果
175
+ */
176
+ striped?: boolean;
177
+ /**
178
+ * 是否集成控制面板功能
179
+ */
180
+ setting?: boolean;
181
+ /**
182
+ * 数据为空时的展示内容
183
+ */
184
+ emptyContent?: React.ReactNode;
185
+ /**
186
+ * 是否能够动态控制列宽
187
+ */
188
+ resizable?: boolean;
189
+ /**
190
+ * 加载中状态
191
+ */
192
+ loading?: boolean;
193
+ /**
194
+ * 表格滚动的宽度(当表格总设置宽度(含自适应列)大于表格父级容器宽度时需要设置)**3.7.0 版本以后,该属性不建议使用**
195
+ */
196
+ scrollWidth?: number;
197
+ /**
198
+ * 表格某一列`hover`时,该列高亮
199
+ */
200
+ showColHighlight?: boolean;
201
+ /**
202
+ * 表格行可拖拽
203
+ */
204
+ draggable?: boolean;
205
+ /**
206
+ * 唯一 id 前缀,废弃
207
+ */
208
+ uniqueId?: string;
209
+ onHeaderRow?: HeaderRowFunc;
210
+ onDragStart?: (rowData: object) => void;
211
+ onDrop?: (dragRowData: object, dropRowData: object, data: object, level: any) => boolean | Promise<any>;
212
+ onDropEnd?: (dragRowData: object, dropRowData: object, data: object) => void;
213
+ expandedRowKeys?: string[];
214
+ defaultExpandAll?: boolean;
215
+ extra?: React.ReactNode;
216
+ }
217
+ export declare type UseTableReturn = ReturnType<typeof useTable>;
@@ -0,0 +1,11 @@
1
+ export declare const deleteRowByKey: (data: object[], dragInfo: any) => object[];
2
+ export declare const setRowByKey: (data: object[], dragInfo: any, inSameLevel?: boolean) => object[];
3
+ export declare const setColumnsDefaultWidth: (columns: any, defaultWidth: any) => any;
4
+ export declare const getMaskItemsWIdth: (columns: any) => number;
5
+ export declare const parseFixedColumns: (item: any, index: number, arr: any[], key: string, rowSelection: any, parentStickyWidth?: number) => any;
6
+ /**
7
+ * 生成 uuid
8
+ *
9
+ * @returns unique id
10
+ */
11
+ export declare const uuid: () => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/table",
3
- "version": "4.0.0-alpha.10",
3
+ "version": "4.0.0-alpha.11",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HIUI <mi-hiui@xiaomi.com>",
@@ -43,24 +43,24 @@
43
43
  "url": "https://github.com/XiaoMi/hiui/issues"
44
44
  },
45
45
  "dependencies": {
46
- "@hi-ui/checkbox": "^4.0.0-alpha.19",
47
- "@hi-ui/classname": "^4.0.0-alpha.2",
48
- "@hi-ui/core-css": "^4.0.0-alpha.9",
49
- "@hi-ui/dom-utils": "^4.0.0-alpha.5",
50
- "@hi-ui/env": "^4.0.0-alpha.4",
51
- "@hi-ui/icon-button": "^4.0.0-alpha.6",
52
- "@hi-ui/loading": "^4.0.0-alpha.15",
53
- "@hi-ui/pagination": "^4.0.0-alpha.16",
54
- "@hi-ui/popper": "^4.0.0-alpha.14",
55
- "@hi-ui/react-utils": "^4.0.0-alpha.5",
56
- "@hi-ui/times": "^4.0.0-alpha.3",
57
- "@hi-ui/tree-utils": "^4.0.0-alpha.7",
58
- "@hi-ui/type-assertion": "^4.0.0-alpha.12",
59
- "@hi-ui/use-cache": "^4.0.0-alpha.1",
60
- "@hi-ui/use-check": "^4.0.0-alpha.13",
61
- "@hi-ui/use-latest": "^4.0.0-alpha.3",
62
- "@hi-ui/use-toggle": "^4.0.0-alpha.9",
63
- "@hi-ui/use-uncontrolled-state": "^4.0.0-alpha.11",
46
+ "@hi-ui/checkbox": "^4.0.0-alpha.20",
47
+ "@hi-ui/classname": "^4.0.0-alpha.3",
48
+ "@hi-ui/core-css": "^4.0.0-alpha.10",
49
+ "@hi-ui/dom-utils": "^4.0.0-alpha.6",
50
+ "@hi-ui/env": "^4.0.0-alpha.5",
51
+ "@hi-ui/icon-button": "^4.0.0-alpha.7",
52
+ "@hi-ui/loading": "^4.0.0-alpha.16",
53
+ "@hi-ui/pagination": "^4.0.0-alpha.17",
54
+ "@hi-ui/popper": "^4.0.0-alpha.15",
55
+ "@hi-ui/react-utils": "^4.0.0-alpha.6",
56
+ "@hi-ui/times": "^4.0.0-alpha.4",
57
+ "@hi-ui/tree-utils": "^4.0.0-alpha.8",
58
+ "@hi-ui/type-assertion": "^4.0.0-alpha.13",
59
+ "@hi-ui/use-cache": "^4.0.0-alpha.2",
60
+ "@hi-ui/use-check": "^4.0.0-alpha.14",
61
+ "@hi-ui/use-latest": "^4.0.0-alpha.4",
62
+ "@hi-ui/use-toggle": "^4.0.0-alpha.10",
63
+ "@hi-ui/use-uncontrolled-state": "^4.0.0-alpha.12",
64
64
  "axios": "^0.24.0",
65
65
  "react-resizable": "^3.0.4"
66
66
  },
@@ -69,10 +69,10 @@
69
69
  "react-dom": "^17.0.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@hi-ui/hi-build": "^4.0.0-alpha.3",
72
+ "@hi-ui/hi-build": "^4.0.0-alpha.4",
73
73
  "@types/react-resizable": "^1.7.4",
74
74
  "react": "^17.0.1",
75
75
  "react-dom": "^17.0.1"
76
76
  },
77
- "gitHead": "37cbc875cd26474cfc9ddbd1eeb0abd797a31835"
77
+ "gitHead": "4fe4855aa7b3180a4e30ffa0972ac39a04947b4b"
78
78
  }
package/lib/cjs/Table.js DELETED
@@ -1,64 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- 'use strict';
11
-
12
- var _typeof = require("@babel/runtime/helpers/typeof");
13
-
14
- Object.defineProperty(exports, '__esModule', {
15
- value: true
16
- });
17
-
18
- var tslib = require('tslib');
19
-
20
- var React = require('react');
21
-
22
- var classname = require('@hi-ui/classname');
23
-
24
- var env = require('@hi-ui/env');
25
-
26
- function _interopDefaultLegacy(e) {
27
- return e && _typeof(e) === 'object' && 'default' in e ? e : {
28
- 'default': e
29
- };
30
- }
31
-
32
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
-
34
- var _role = 'table';
35
-
36
- var _prefix = classname.getPrefixCls(_role);
37
- /**
38
- * TODO: What is Table
39
- */
40
-
41
-
42
- var Table = /*#__PURE__*/React.forwardRef(function (_a, ref) {
43
- var _a$prefixCls = _a.prefixCls,
44
- prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
45
- _a$role = _a.role,
46
- role = _a$role === void 0 ? _role : _a$role,
47
- className = _a.className,
48
- children = _a.children,
49
- rest = tslib.__rest(_a, ["prefixCls", "role", "className", "children"]);
50
-
51
- var cls = classname.cx(prefixCls, className);
52
- return /*#__PURE__*/React__default['default'].createElement("div", Object.assign({
53
- ref: ref,
54
- role: role,
55
- className: cls
56
- }, rest), children);
57
- });
58
-
59
- if (env.__DEV__) {
60
- Table.displayName = 'Table';
61
- }
62
-
63
- exports.Table = Table;
64
- //# sourceMappingURL=Table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.js","sources":["../../src/Table.tsx"],"sourcesContent":[null],"names":["_role","_prefix","getPrefixCls","Table","forwardRef","_a","ref","prefixCls","role","className","children","rest","cls","cx","React","__DEV__","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,KAAK,GAAG,OAAd;;AACA,IAAMC,OAAO,GAAGC,sBAAAA,CAAaF,KAAbE,CAAhB;AAEA;;;;;IAGaC,KAAK,gBAAGC,gBAAAA,CACnB,UACEC,EADF,EAQEC,GARF;wBAEIC;MAAAA,sCAAYN;mBACZO;MAAAA,4BAAOR;MACPS,eAAAA;MACAC,cAAAA;MACGC,wBALL,YAAA,QAAA,aAAA,YAAA;;MASMC,GAAG,GAAGC,YAAAA,CAAGN,SAAHM,EAAcJ,SAAdI;sBAGVC,yBAAAA,cAAAA,MAAAA;AAAKR,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,IAAI,EAAEA;AAAMC,IAAAA,SAAS,EAAEG;KAASD,KAA/CG,EACGJ,QADHI;AAdyB,CAAVV;;AAwCrB,IAAIW,WAAJ,EAAa;AACXZ,EAAAA,KAAK,CAACa,WAANb,GAAoB,OAApBA;;;"}
package/lib/cjs/index.js DELETED
@@ -1,22 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- 'use strict';
11
-
12
- Object.defineProperty(exports, '__esModule', {
13
- value: true
14
- });
15
-
16
- require('./styles/index.scss.js');
17
-
18
- var Table = require('./Table.js');
19
-
20
- exports.Table = Table.Table;
21
- exports["default"] = Table.Table;
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
@@ -1,22 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- 'use strict';
11
-
12
- Object.defineProperty(exports, '__esModule', {
13
- value: true
14
- });
15
- var css_248z = "";
16
-
17
- var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
18
-
19
- __styleInject__(css_248z);
20
-
21
- exports["default"] = css_248z;
22
- //# sourceMappingURL=index.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
package/lib/esm/Table.js DELETED
@@ -1,44 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- import { __rest } from 'tslib';
11
- import React, { forwardRef } from 'react';
12
- import { getPrefixCls, cx } from '@hi-ui/classname';
13
- import { __DEV__ } from '@hi-ui/env';
14
- var _role = 'table';
15
-
16
- var _prefix = getPrefixCls(_role);
17
- /**
18
- * TODO: What is Table
19
- */
20
-
21
-
22
- var Table = /*#__PURE__*/forwardRef(function (_a, ref) {
23
- var _a$prefixCls = _a.prefixCls,
24
- prefixCls = _a$prefixCls === void 0 ? _prefix : _a$prefixCls,
25
- _a$role = _a.role,
26
- role = _a$role === void 0 ? _role : _a$role,
27
- className = _a.className,
28
- children = _a.children,
29
- rest = __rest(_a, ["prefixCls", "role", "className", "children"]);
30
-
31
- var cls = cx(prefixCls, className);
32
- return /*#__PURE__*/React.createElement("div", Object.assign({
33
- ref: ref,
34
- role: role,
35
- className: cls
36
- }, rest), children);
37
- });
38
-
39
- if (__DEV__) {
40
- Table.displayName = 'Table';
41
- }
42
-
43
- export { Table };
44
- //# sourceMappingURL=Table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Table.js","sources":["../../src/Table.tsx"],"sourcesContent":[null],"names":["_role","_prefix","getPrefixCls","Table","forwardRef","_a","ref","prefixCls","role","className","children","rest","cls","cx","React","__DEV__","displayName"],"mappings":";;;;;;;;;;;;;AAIA,IAAMA,KAAK,GAAG,OAAd;;AACA,IAAMC,OAAO,GAAGC,YAAY,CAACF,KAAD,CAA5B;AAEA;;;;;IAGaG,KAAK,gBAAGC,UAAU,CAC7B,UACEC,EADF,EAQEC,GARF;wBAEIC;MAAAA,sCAAYN;mBACZO;MAAAA,4BAAOR;MACPS,eAAAA;MACAC,cAAAA;MACGC,kBALL,YAAA,QAAA,aAAA,YAAA;;MASMC,GAAG,GAAGC,EAAE,CAACN,SAAD,EAAYE,SAAZ;sBAGZK,mBAAAA,MAAAA;AAAKR,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,IAAI,EAAEA;AAAMC,IAAAA,SAAS,EAAEG;KAASD,KAA/CG,EACGJ,QADHI;AAdyB,CAAA;;AAwC/B,IAAIC,OAAJ,EAAa;AACXZ,EAAAA,KAAK,CAACa,WAANb,GAAoB,OAApBA;;;"}
package/lib/esm/index.js DELETED
@@ -1,12 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- import './styles/index.scss.js';
11
- export { Table, Table as default } from './Table.js';
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,17 +0,0 @@
1
- /** @LICENSE
2
- * @hi-ui/table v4.0.0-alpha.0
3
- * https://github.com/XiaoMi/hiui/tree/master/packages/ui/table#readme
4
- *
5
- * Copyright (c) HIUI <mi-hiui@xiaomi.com>.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
- var css_248z = "";
11
-
12
- var __styleInject__ = require('style-inject/dist/style-inject.es.js')["default"];
13
-
14
- __styleInject__(css_248z);
15
-
16
- export default css_248z;
17
- //# sourceMappingURL=index.scss.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}