@zhenliang/sheet 0.1.27 → 0.1.29
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/core/reducers/keyboardReducer.js +2 -1
- package/dist/core/sheet/Control.d.ts +10 -0
- package/dist/core/sheet/Control.js +32 -0
- package/dist/core/sheet/DefaultRow.js +1 -7
- package/dist/core/sheet/Menu.d.ts +6 -0
- package/dist/core/sheet/Menu.js +21 -0
- package/dist/core/sheet/index.js +66 -65
- package/dist/core/sheet/useSelectVisible.js +1 -0
- package/dist/core/sheet/useVirtualList.d.ts +10 -1
- package/dist/core/sheet/useVirtualList.js +38 -38
- package/dist/core/shell/draggableShell/index.js +9 -2
- package/dist/core/table/events.d.ts +0 -2
- package/dist/core/table/events.js +15 -24
- package/dist/core/table/index.js +60 -168
- package/dist/core/table/useGroupConfig.d.ts +4 -1
- package/dist/core/table/useGroupConfig.js +78 -1
- package/dist/core/table/useRowSelection.d.ts +13 -1
- package/dist/core/table/useRowSelection.js +50 -0
- package/dist/core/util.d.ts +1 -1
- package/dist/core/util.js +5 -4
- package/dist/core/viewer/groupViewer/index.js +22 -9
- package/dist/example/sheet.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useGroupConfig.d.ts +4 -0
- package/dist/hooks/useGroupConfig.js +5 -0
- package/dist/hooks/useWidthConfig.d.ts +3 -3
- package/dist/type/sheet.d.ts +15 -3
- package/dist/type/sheetTable.d.ts +2 -2
- package/package.json +1 -1
package/dist/type/sheet.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/// <reference types="node" />
|
|
3
2
|
import type { EventEmitter } from 'events';
|
|
3
|
+
import { CSSProperties } from 'react';
|
|
4
4
|
import { SheetTableType, SheetType } from '.';
|
|
5
5
|
export declare enum CellAlign {
|
|
6
6
|
left = "left",
|
|
@@ -10,6 +10,8 @@ export declare enum CellAlign {
|
|
|
10
10
|
}
|
|
11
11
|
export type Cell = {
|
|
12
12
|
id: string;
|
|
13
|
+
row?: number;
|
|
14
|
+
col?: number;
|
|
13
15
|
key?: string;
|
|
14
16
|
readonly?: boolean;
|
|
15
17
|
component?: CellViewer;
|
|
@@ -68,6 +70,10 @@ export type RowGroupConfig = {
|
|
|
68
70
|
groups: RowGroup[];
|
|
69
71
|
groupOpen: boolean[];
|
|
70
72
|
};
|
|
73
|
+
export type GroupMap = Map<number, SheetType.RowGroup & {
|
|
74
|
+
isStart: boolean;
|
|
75
|
+
isOpen: boolean;
|
|
76
|
+
}>;
|
|
71
77
|
export type MenuRenderProps = {
|
|
72
78
|
position?: {
|
|
73
79
|
top: number;
|
|
@@ -96,7 +102,7 @@ export type SheetProps = {
|
|
|
96
102
|
freePaste?: boolean;
|
|
97
103
|
virtualized?: boolean;
|
|
98
104
|
showBackEdit?: boolean;
|
|
99
|
-
backEditStyle?: Partial<
|
|
105
|
+
backEditStyle?: Partial<CSSProperties>;
|
|
100
106
|
sticky?: boolean;
|
|
101
107
|
groupConfig?: RowGroupConfig;
|
|
102
108
|
onCellsChanged?: CellChangeHandler;
|
|
@@ -109,10 +115,16 @@ export type SheetProps = {
|
|
|
109
115
|
rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
|
|
110
116
|
children?: any[];
|
|
111
117
|
};
|
|
112
|
-
export type
|
|
118
|
+
export type WidthConfigContext = {
|
|
113
119
|
onChange?: (value: Record<number | string, number>) => void;
|
|
114
120
|
widths?: Record<number | string, number>;
|
|
115
121
|
};
|
|
122
|
+
export type GroupConfigContext = {
|
|
123
|
+
onChange?: (value: RowGroupConfig) => void;
|
|
124
|
+
config?: RowGroupConfig & {
|
|
125
|
+
configMap: GroupMap;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
116
128
|
export type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
|
|
117
129
|
className?: string;
|
|
118
130
|
showGroup?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { SheetType } from '.';
|
|
3
3
|
export type refAssertion = {
|
|
4
4
|
contains?: (target: EventTarget | null) => boolean;
|
|
@@ -79,7 +79,7 @@ export type TableProps = {
|
|
|
79
79
|
draggable?: boolean;
|
|
80
80
|
freePaste?: boolean;
|
|
81
81
|
showBackEdit?: boolean;
|
|
82
|
-
backEditStyle?: Partial<
|
|
82
|
+
backEditStyle?: Partial<CSSProperties>;
|
|
83
83
|
rowSelection?: TableRowSelection;
|
|
84
84
|
groupConfig?: TableGroupConfig;
|
|
85
85
|
menuRenderer?: React.FC<SheetType.MenuRenderProps>;
|