@zhenliang/sheet 0.1.19 → 0.1.22
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/changes.md +45 -0
- package/package.json +1 -1
- package/dist/core/config.d.ts +0 -13
- package/dist/core/config.js +0 -13
- package/dist/core/editor/cascaderEditor/index.d.ts +0 -5
- package/dist/core/editor/cascaderEditor/index.js +0 -54
- package/dist/core/editor/cascaderEditor/index.less +0 -28
- package/dist/core/editor/dateEditor/index.d.ts +0 -5
- package/dist/core/editor/dateEditor/index.js +0 -55
- package/dist/core/editor/dateEditor/index.less +0 -11
- package/dist/core/editor/index.d.ts +0 -4
- package/dist/core/editor/index.js +0 -4
- package/dist/core/editor/numberEditor/index.d.ts +0 -8
- package/dist/core/editor/numberEditor/index.js +0 -107
- package/dist/core/editor/numberEditor/index.less +0 -30
- package/dist/core/editor/selectEditor/index.d.ts +0 -6
- package/dist/core/editor/selectEditor/index.js +0 -96
- package/dist/core/editor/selectEditor/index.less +0 -43
- package/dist/core/reducers/index.d.ts +0 -9
- package/dist/core/reducers/index.js +0 -38
- package/dist/core/reducers/keyboardReducer.d.ts +0 -2
- package/dist/core/reducers/keyboardReducer.js +0 -93
- package/dist/core/reducers/mouseReducer.d.ts +0 -2
- package/dist/core/reducers/mouseReducer.js +0 -164
- package/dist/core/reducers/sideEffectReducer.d.ts +0 -4
- package/dist/core/reducers/sideEffectReducer.js +0 -376
- package/dist/core/reducers/stateReducer.d.ts +0 -2
- package/dist/core/reducers/stateReducer.js +0 -174
- package/dist/core/sheet/Cell.d.ts +0 -4
- package/dist/core/sheet/Cell.js +0 -181
- package/dist/core/sheet/DataEditor.d.ts +0 -3
- package/dist/core/sheet/DataEditor.js +0 -24
- package/dist/core/sheet/DefaultCell.d.ts +0 -11
- package/dist/core/sheet/DefaultCell.js +0 -31
- package/dist/core/sheet/DefaultRow.d.ts +0 -12
- package/dist/core/sheet/DefaultRow.js +0 -28
- package/dist/core/sheet/DefaultRowMapper.d.ts +0 -8
- package/dist/core/sheet/DefaultRowMapper.js +0 -15
- package/dist/core/sheet/DefaultShell.d.ts +0 -8
- package/dist/core/sheet/DefaultShell.js +0 -12
- package/dist/core/sheet/Event.d.ts +0 -5
- package/dist/core/sheet/Event.js +0 -17
- package/dist/core/sheet/ValueViewer.d.ts +0 -3
- package/dist/core/sheet/ValueViewer.js +0 -9
- package/dist/core/sheet/index.d.ts +0 -5
- package/dist/core/sheet/index.js +0 -265
- package/dist/core/sheet/index.less +0 -307
- package/dist/core/sheet/useCellEvent.d.ts +0 -3
- package/dist/core/sheet/useCellEvent.js +0 -22
- package/dist/core/sheet/useContextMenu.d.ts +0 -21
- package/dist/core/sheet/useContextMenu.js +0 -86
- package/dist/core/sheet/useKeyBoardEvent.d.ts +0 -3
- package/dist/core/sheet/useKeyBoardEvent.js +0 -66
- package/dist/core/sheet/useMouseEvent.d.ts +0 -3
- package/dist/core/sheet/useMouseEvent.js +0 -298
- package/dist/core/sheet/useSelectVisible.d.ts +0 -2
- package/dist/core/sheet/useSelectVisible.js +0 -57
- package/dist/core/sheet/useVirtualList.d.ts +0 -7
- package/dist/core/sheet/useVirtualList.js +0 -103
- package/dist/core/sheet/var.less +0 -41
- package/dist/core/shell/draggableShell/index.d.ts +0 -5
- package/dist/core/shell/draggableShell/index.js +0 -197
- package/dist/core/shell/draggableShell/index.less +0 -16
- package/dist/core/shell/tableShell.d.ts +0 -5
- package/dist/core/shell/tableShell.js +0 -109
- package/dist/core/table/events.d.ts +0 -15
- package/dist/core/table/events.js +0 -95
- package/dist/core/table/index.d.ts +0 -4
- package/dist/core/table/index.js +0 -313
- package/dist/core/table/useGroupConfig.d.ts +0 -2
- package/dist/core/table/useGroupConfig.js +0 -65
- package/dist/core/table/useRowSelection.d.ts +0 -2
- package/dist/core/table/useRowSelection.js +0 -24
- package/dist/core/table/util.d.ts +0 -8
- package/dist/core/table/util.js +0 -29
- package/dist/core/util.d.ts +0 -59
- package/dist/core/util.js +0 -490
- package/dist/core/viewer/btnViewer/index.d.ts +0 -2
- package/dist/core/viewer/btnViewer/index.js +0 -37
- package/dist/core/viewer/cascaderViewer/index.d.ts +0 -2
- package/dist/core/viewer/cascaderViewer/index.js +0 -11
- package/dist/core/viewer/checkViewer/index.d.ts +0 -2
- package/dist/core/viewer/checkViewer/index.js +0 -23
- package/dist/core/viewer/editViewer/index.d.ts +0 -2
- package/dist/core/viewer/editViewer/index.js +0 -31
- package/dist/core/viewer/groupViewer/index.d.ts +0 -2
- package/dist/core/viewer/groupViewer/index.js +0 -34
- package/dist/core/viewer/index.d.ts +0 -7
- package/dist/core/viewer/index.js +0 -7
- package/dist/core/viewer/selectorViewer/index.d.ts +0 -2
- package/dist/core/viewer/selectorViewer/index.js +0 -16
- package/dist/core/viewer/switchViewer/index.d.ts +0 -2
- package/dist/core/viewer/switchViewer/index.js +0 -22
- package/dist/example/antComponent.d.ts +0 -3
- package/dist/example/antComponent.js +0 -314
- package/dist/example/basic.d.ts +0 -4
- package/dist/example/basic.js +0 -121
- package/dist/example/ellipsis.d.ts +0 -3
- package/dist/example/ellipsis.js +0 -64
- package/dist/example/fixed.d.ts +0 -3
- package/dist/example/fixed.js +0 -89
- package/dist/example/group.d.ts +0 -3
- package/dist/example/group.js +0 -123
- package/dist/example/index.less +0 -5
- package/dist/example/selection.d.ts +0 -4
- package/dist/example/selection.js +0 -86
- package/dist/example/sheet.d.ts +0 -4
- package/dist/example/sheet.js +0 -393
- package/dist/example/valuationAnalyze.d.ts +0 -2
- package/dist/example/valuationAnalyze.js +0 -227
- package/dist/hooks/index.d.ts +0 -8
- package/dist/hooks/index.js +0 -7
- package/dist/hooks/useEventBus.d.ts +0 -3
- package/dist/hooks/useEventBus.js +0 -17
- package/dist/hooks/useKeyboard.d.ts +0 -18
- package/dist/hooks/useKeyboard.js +0 -108
- package/dist/hooks/useMiddlewareReducer.d.ts +0 -12
- package/dist/hooks/useMiddlewareReducer.js +0 -47
- package/dist/hooks/useMouse.d.ts +0 -11
- package/dist/hooks/useMouse.js +0 -68
- package/dist/hooks/useSetState.d.ts +0 -2
- package/dist/hooks/useSetState.js +0 -27
- package/dist/hooks/useSheetEvent.d.ts +0 -5
- package/dist/hooks/useSheetEvent.js +0 -5
- package/dist/hooks/useWidthConfig.d.ts +0 -4
- package/dist/hooks/useWidthConfig.js +0 -5
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -8
- package/dist/standardUtils/index.d.ts +0 -9
- package/dist/standardUtils/index.js +0 -32
- package/dist/type/index.d.ts +0 -2
- package/dist/type/index.js +0 -4
- package/dist/type/sheet.d.ts +0 -205
- package/dist/type/sheet.js +0 -9
- package/dist/type/sheetTable.d.ts +0 -89
- package/dist/type/sheetTable.js +0 -1
- package/dist/typings/index.d.ts +0 -1
package/dist/type/index.d.ts
DELETED
package/dist/type/index.js
DELETED
package/dist/type/sheet.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import type { EventEmitter } from 'events';
|
|
4
|
-
import { SheetTableType, SheetType } from '.';
|
|
5
|
-
export declare enum CellAlign {
|
|
6
|
-
left = "left",
|
|
7
|
-
center = "center",
|
|
8
|
-
right = "right",
|
|
9
|
-
unset = "unset"
|
|
10
|
-
}
|
|
11
|
-
export declare type Cell = {
|
|
12
|
-
id: string;
|
|
13
|
-
key?: string;
|
|
14
|
-
readonly?: boolean;
|
|
15
|
-
component?: CellViewer;
|
|
16
|
-
editable?: boolean;
|
|
17
|
-
colSpan?: number;
|
|
18
|
-
rowSpan?: number;
|
|
19
|
-
width?: number;
|
|
20
|
-
record?: Record<string, unknown>;
|
|
21
|
-
disableEvents?: boolean;
|
|
22
|
-
dataEditor?: CellEditor;
|
|
23
|
-
valueViewer?: CellViewer;
|
|
24
|
-
className?: string;
|
|
25
|
-
align?: CellAlign;
|
|
26
|
-
fixed?: Omit<CellAlign, 'center'>;
|
|
27
|
-
value?: string | number | null;
|
|
28
|
-
};
|
|
29
|
-
export declare type CellViewerProps = {
|
|
30
|
-
value: unknown;
|
|
31
|
-
record?: Record<string, unknown>;
|
|
32
|
-
row?: number;
|
|
33
|
-
col?: number;
|
|
34
|
-
cell?: Cell;
|
|
35
|
-
};
|
|
36
|
-
export declare type CellEditorProps = {
|
|
37
|
-
value: unknown;
|
|
38
|
-
cell?: Cell;
|
|
39
|
-
onChange: (value: unknown) => void;
|
|
40
|
-
onConfirm: (value: unknown) => void;
|
|
41
|
-
} & CellViewerProps;
|
|
42
|
-
export declare type CellEditor = React.FC<CellEditorProps> & {
|
|
43
|
-
checker?: (value: unknown, record?: Record<string, unknown>) => boolean;
|
|
44
|
-
formatter?: (value: unknown, record?: Record<string, unknown>) => unknown;
|
|
45
|
-
parser?: (value: unknown, record?: Record<string, unknown>) => unknown;
|
|
46
|
-
};
|
|
47
|
-
export declare type CellViewer = React.FC<CellViewerProps>;
|
|
48
|
-
export declare type CellPosition = {
|
|
49
|
-
row: number;
|
|
50
|
-
col: number;
|
|
51
|
-
};
|
|
52
|
-
export declare type CellData = {
|
|
53
|
-
id: string;
|
|
54
|
-
cell: Cell;
|
|
55
|
-
row: number;
|
|
56
|
-
col: number;
|
|
57
|
-
value?: string;
|
|
58
|
-
};
|
|
59
|
-
export declare type CellNavigable = (cell?: Cell, row?: number, col?: number) => boolean;
|
|
60
|
-
export declare type CellChangeHandler = (cells: CellData[], additions?: CellData[]) => void;
|
|
61
|
-
export declare type RowGroup = {
|
|
62
|
-
groupName: string;
|
|
63
|
-
groupStart: number;
|
|
64
|
-
groupEnd: number;
|
|
65
|
-
};
|
|
66
|
-
export declare type RowGroupConfig = {
|
|
67
|
-
defaultOpen?: boolean;
|
|
68
|
-
groups: RowGroup[];
|
|
69
|
-
groupOpen: boolean[];
|
|
70
|
-
};
|
|
71
|
-
export declare type MenuRenderProps = {
|
|
72
|
-
position?: {
|
|
73
|
-
top: number;
|
|
74
|
-
left: number;
|
|
75
|
-
};
|
|
76
|
-
cell?: CellPosition;
|
|
77
|
-
onContextMenu?: (event: any) => void;
|
|
78
|
-
};
|
|
79
|
-
export declare type SheetInstance = {
|
|
80
|
-
zoomTo: (row?: number) => void;
|
|
81
|
-
pushToHistory: (value: OperateHistory) => void;
|
|
82
|
-
selectRow: (row?: number) => void;
|
|
83
|
-
select: (props: {
|
|
84
|
-
start: SheetType.CellPosition;
|
|
85
|
-
end: SheetType.CellPosition;
|
|
86
|
-
}) => void;
|
|
87
|
-
popHistory: () => OperateHistory;
|
|
88
|
-
};
|
|
89
|
-
export declare type SheetProps = {
|
|
90
|
-
sheetInstance?: React.MutableRefObject<SheetInstance | null>;
|
|
91
|
-
sheetRenderer?: any;
|
|
92
|
-
rowRenderer?: any;
|
|
93
|
-
className?: string;
|
|
94
|
-
data: Cell[][];
|
|
95
|
-
freePaste?: boolean;
|
|
96
|
-
virtualized?: boolean;
|
|
97
|
-
showBackEdit?: boolean;
|
|
98
|
-
backEditStyle?: Partial<CSSStyleDeclaration>;
|
|
99
|
-
sticky?: boolean;
|
|
100
|
-
groupConfig?: RowGroupConfig;
|
|
101
|
-
onCellsChanged?: CellChangeHandler;
|
|
102
|
-
menuRenderer?: React.FC<MenuRenderProps>;
|
|
103
|
-
onContextMenu?: (event: any) => void;
|
|
104
|
-
scroll?: {
|
|
105
|
-
x?: number | string;
|
|
106
|
-
y?: number | string;
|
|
107
|
-
};
|
|
108
|
-
rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
|
|
109
|
-
children?: any[];
|
|
110
|
-
};
|
|
111
|
-
export declare type WidthConfig = {
|
|
112
|
-
onChange?: (value: Record<number | string, number>) => void;
|
|
113
|
-
widths?: Record<number | string, number>;
|
|
114
|
-
};
|
|
115
|
-
export declare type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
|
|
116
|
-
className?: string;
|
|
117
|
-
showGroup?: boolean;
|
|
118
|
-
showSelect?: boolean;
|
|
119
|
-
controlWidth?: number;
|
|
120
|
-
controlProps?: {
|
|
121
|
-
check?: {
|
|
122
|
-
checked: boolean;
|
|
123
|
-
indeterminate?: boolean;
|
|
124
|
-
};
|
|
125
|
-
group?: {
|
|
126
|
-
open: boolean;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
export declare type SheetRow = {
|
|
131
|
-
row: number;
|
|
132
|
-
cells: Cell[];
|
|
133
|
-
selected: boolean;
|
|
134
|
-
children: React.ElementType;
|
|
135
|
-
};
|
|
136
|
-
export declare type windowAssertion = {
|
|
137
|
-
clipboardData?: {
|
|
138
|
-
getData?: (type: string) => string;
|
|
139
|
-
setData?: (type: string, data: string) => string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
export declare type refAssertion = {
|
|
143
|
-
contains?: (target: EventTarget | null) => boolean;
|
|
144
|
-
focus?: () => boolean;
|
|
145
|
-
} & HTMLSpanElement;
|
|
146
|
-
export declare type AttributesRenderer = (cell: Cell, row: number, col: number) => Record<string, string>;
|
|
147
|
-
export declare type CellProps = {
|
|
148
|
-
row: number;
|
|
149
|
-
col: number;
|
|
150
|
-
cell: Cell;
|
|
151
|
-
cellRenderer?: React.ElementType;
|
|
152
|
-
dataEditor?: React.ElementType;
|
|
153
|
-
valueViewer?: React.ElementType;
|
|
154
|
-
attributesRenderer?: AttributesRenderer;
|
|
155
|
-
};
|
|
156
|
-
export declare type UpdateStateType = {
|
|
157
|
-
eventBus: EventEmitter;
|
|
158
|
-
start: CellPosition;
|
|
159
|
-
end: CellPosition;
|
|
160
|
-
selecting: boolean;
|
|
161
|
-
forceEdit: boolean;
|
|
162
|
-
clear: CellPosition;
|
|
163
|
-
editing: CellPosition & {
|
|
164
|
-
value?: string;
|
|
165
|
-
};
|
|
166
|
-
history: OperateHistory[];
|
|
167
|
-
freePaste?: boolean;
|
|
168
|
-
data: Cell[][];
|
|
169
|
-
mouseDown: boolean;
|
|
170
|
-
lastSelected?: {
|
|
171
|
-
start?: CellPosition;
|
|
172
|
-
end?: CellPosition;
|
|
173
|
-
};
|
|
174
|
-
groupConfig?: {
|
|
175
|
-
groups: RowGroup[];
|
|
176
|
-
groupOpen: boolean[];
|
|
177
|
-
};
|
|
178
|
-
lastFocus: {
|
|
179
|
-
id: string;
|
|
180
|
-
col: number;
|
|
181
|
-
}[];
|
|
182
|
-
lastEditing: CellPosition & {
|
|
183
|
-
confirm?: boolean;
|
|
184
|
-
};
|
|
185
|
-
cellChangeHandler: (cells: CellData[], additions?: CellData[]) => void;
|
|
186
|
-
};
|
|
187
|
-
export declare type UpdateFocus = (start: CellPosition, end: CellPosition) => void;
|
|
188
|
-
export declare type Options<T = any> = {
|
|
189
|
-
value: string | number;
|
|
190
|
-
label: string;
|
|
191
|
-
} & T;
|
|
192
|
-
export declare type OptionsType = Options<{
|
|
193
|
-
disabled?: boolean;
|
|
194
|
-
children?: OptionsType[];
|
|
195
|
-
}>;
|
|
196
|
-
export declare type OperateHistory = {
|
|
197
|
-
changes: Partial<CellData>[];
|
|
198
|
-
type: OperateType;
|
|
199
|
-
rowInfo?: {
|
|
200
|
-
newRow?: number;
|
|
201
|
-
deleteRow?: number;
|
|
202
|
-
};
|
|
203
|
-
extraInfo?: Record<string, unknown>;
|
|
204
|
-
};
|
|
205
|
-
export declare type OperateType = 'Edit' | 'Paste' | 'Delete' | 'DeleteRow' | 'NewRow' | 'Custom';
|
package/dist/type/sheet.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { SheetType } from '.';
|
|
3
|
-
export declare type refAssertion = {
|
|
4
|
-
contains?: (target: EventTarget | null) => boolean;
|
|
5
|
-
focus?: () => boolean;
|
|
6
|
-
} & HTMLTableSectionElement;
|
|
7
|
-
export declare type CellFixed = SheetType.CellAlign;
|
|
8
|
-
export declare type RecordRowMap<T> = (value: unknown, record: Record<string, unknown>, index: number, colIndex?: number) => T;
|
|
9
|
-
export declare type ColumnProps = {
|
|
10
|
-
/**
|
|
11
|
-
* @description 对齐
|
|
12
|
-
* @default "left"
|
|
13
|
-
*/
|
|
14
|
-
align?: SheetType.CellAlign;
|
|
15
|
-
/**
|
|
16
|
-
* @description 固定
|
|
17
|
-
* @default "undefined"
|
|
18
|
-
*/
|
|
19
|
-
fixed?: Omit<CellFixed, 'center'>;
|
|
20
|
-
/**
|
|
21
|
-
* @description 列宽
|
|
22
|
-
* @default "undefined"
|
|
23
|
-
*/
|
|
24
|
-
width?: string | number;
|
|
25
|
-
dataIndex?: string;
|
|
26
|
-
title: string | ReactNode | ReactNode[] | React.FC;
|
|
27
|
-
titleConfig?: {
|
|
28
|
-
colSpan?: number;
|
|
29
|
-
className?: string;
|
|
30
|
-
};
|
|
31
|
-
cellConfig?: {
|
|
32
|
-
className?: string | RecordRowMap<string>;
|
|
33
|
-
};
|
|
34
|
-
key?: string;
|
|
35
|
-
editable?: boolean | RecordRowMap<boolean>;
|
|
36
|
-
readonly?: boolean | RecordRowMap<boolean>;
|
|
37
|
-
render?: SheetType.CellViewer;
|
|
38
|
-
editor?: SheetType.CellEditor;
|
|
39
|
-
};
|
|
40
|
-
export declare type TableChange = {
|
|
41
|
-
col?: number;
|
|
42
|
-
row: number;
|
|
43
|
-
id: string;
|
|
44
|
-
key: string;
|
|
45
|
-
value: unknown;
|
|
46
|
-
};
|
|
47
|
-
export declare type TableRowSelection = {
|
|
48
|
-
rowSelected?: string[];
|
|
49
|
-
onChange?: (selectedRowKeys: string[], selectedRows: Record<string, unknown>[]) => void;
|
|
50
|
-
};
|
|
51
|
-
export declare type TableGroupConfig = {
|
|
52
|
-
defaultOpen?: boolean;
|
|
53
|
-
rowGroup?: SheetType.RowGroupConfig;
|
|
54
|
-
onChange?: (value: SheetType.RowGroupConfig) => void;
|
|
55
|
-
};
|
|
56
|
-
export declare type EventHandler = (value: any) => void;
|
|
57
|
-
export declare type TableProps = {
|
|
58
|
-
/**
|
|
59
|
-
* @description 表格类名
|
|
60
|
-
* @default "undefined"
|
|
61
|
-
*/
|
|
62
|
-
className?: string;
|
|
63
|
-
/**
|
|
64
|
-
* @description sheet的一些定义方法可执行
|
|
65
|
-
* @default "object"
|
|
66
|
-
*/
|
|
67
|
-
sheetInstance?: React.MutableRefObject<SheetType.SheetInstance | null>;
|
|
68
|
-
columns: ColumnProps[];
|
|
69
|
-
virtualized?: boolean;
|
|
70
|
-
dataSource: Record<string, unknown>[];
|
|
71
|
-
rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
|
|
72
|
-
rowKey?: string | ((record: Record<string, unknown>, index: number) => string);
|
|
73
|
-
scroll?: {
|
|
74
|
-
x?: number | string;
|
|
75
|
-
y?: number | string;
|
|
76
|
-
};
|
|
77
|
-
sticky?: boolean;
|
|
78
|
-
draggable?: boolean;
|
|
79
|
-
freePaste?: boolean;
|
|
80
|
-
showBackEdit?: boolean;
|
|
81
|
-
backEditStyle?: Partial<CSSStyleDeclaration>;
|
|
82
|
-
rowSelection?: TableRowSelection;
|
|
83
|
-
groupConfig?: TableGroupConfig;
|
|
84
|
-
menuRenderer?: React.FC<SheetType.MenuRenderProps>;
|
|
85
|
-
onContextMenu?: (event: any) => void;
|
|
86
|
-
onChange: (changes: TableChange[], extChanges?: TableChange[]) => void;
|
|
87
|
-
handleAdd?: () => void;
|
|
88
|
-
eventHandler?: Record<'reverse' | 'btn-click' | 'cell-edit' | 'cell-switch' | string, undefined | EventHandler>;
|
|
89
|
-
};
|
package/dist/type/sheetTable.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/typings/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module '*.less';
|