@zhenliang/sheet 0.1.6 → 0.1.7-3.beta.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 (117) hide show
  1. package/dist/assets/arrow-mac-down.svg +19 -0
  2. package/dist/assets/arrow-mac-right.svg +17 -0
  3. package/dist/assets/arrow-windows-down.svg +17 -0
  4. package/dist/assets/arrow-windows-right.svg +17 -0
  5. package/dist/core/config.d.ts +3 -0
  6. package/dist/core/config.js +4 -1
  7. package/dist/core/editor/cascaderEditor/index.d.ts +1 -1
  8. package/dist/core/editor/cascaderEditor/index.js +12 -11
  9. package/dist/core/editor/cascaderEditor/index.less +15 -7
  10. package/dist/core/editor/dateEditor/index.js +31 -8
  11. package/dist/core/editor/dateEditor/index.less +9 -2
  12. package/dist/core/editor/numberEditor/index.d.ts +3 -1
  13. package/dist/core/editor/numberEditor/index.js +62 -27
  14. package/dist/core/editor/numberEditor/index.less +3 -2
  15. package/dist/core/editor/selectEditor/index.d.ts +1 -1
  16. package/dist/core/editor/selectEditor/index.js +34 -19
  17. package/dist/core/editor/selectEditor/index.less +16 -5
  18. package/dist/core/reducers/index.d.ts +2 -2
  19. package/dist/core/reducers/index.js +8 -1
  20. package/dist/core/reducers/keyboardReducer.js +39 -9
  21. package/dist/core/reducers/mouseReducer.js +115 -11
  22. package/dist/core/reducers/sideEffectReducer.d.ts +1 -1
  23. package/dist/core/reducers/sideEffectReducer.js +146 -41
  24. package/dist/core/reducers/stateReducer.d.ts +1 -0
  25. package/dist/core/reducers/stateReducer.js +96 -27
  26. package/dist/core/sheet/Cell.d.ts +1 -1
  27. package/dist/core/sheet/Cell.js +33 -24
  28. package/dist/core/sheet/Control.d.ts +21 -0
  29. package/dist/core/sheet/Control.js +83 -0
  30. package/dist/core/sheet/DataEditor.js +3 -3
  31. package/dist/core/sheet/DefaultCell.d.ts +8 -3
  32. package/dist/core/sheet/DefaultCell.js +12 -8
  33. package/dist/core/sheet/DefaultRow.js +3 -9
  34. package/dist/core/sheet/DefaultRowMapper.d.ts +3 -0
  35. package/dist/core/sheet/DefaultRowMapper.js +22 -6
  36. package/dist/core/sheet/DefaultShell.js +1 -1
  37. package/dist/core/sheet/Event.d.ts +1 -1
  38. package/dist/core/sheet/Event.js +1 -1
  39. package/dist/core/sheet/Menu.d.ts +6 -0
  40. package/dist/core/sheet/Menu.js +21 -0
  41. package/dist/core/sheet/ValueViewer.js +1 -1
  42. package/dist/core/sheet/index.js +249 -88
  43. package/dist/core/sheet/index.less +199 -107
  44. package/dist/core/sheet/searchInput.d.ts +15 -0
  45. package/dist/core/sheet/searchInput.js +78 -0
  46. package/dist/core/sheet/useCellEvent.js +1 -1
  47. package/dist/core/sheet/useContextMenu.d.ts +1 -1
  48. package/dist/core/sheet/useContextMenu.js +13 -10
  49. package/dist/core/sheet/useKeyBoardEvent.js +19 -2
  50. package/dist/core/sheet/useMouseEvent.js +19 -12
  51. package/dist/core/sheet/useSearchInput.d.ts +11 -0
  52. package/dist/core/sheet/useSearchInput.js +65 -0
  53. package/dist/core/sheet/useSelectVisible.d.ts +1 -1
  54. package/dist/core/sheet/useSelectVisible.js +17 -7
  55. package/dist/core/sheet/useVirtualList.d.ts +10 -1
  56. package/dist/core/sheet/useVirtualList.js +44 -28
  57. package/dist/core/sheet/var.less +41 -34
  58. package/dist/core/shell/draggableShell/index.d.ts +4 -1
  59. package/dist/core/shell/draggableShell/index.js +133 -50
  60. package/dist/core/shell/tableShell.d.ts +4 -1
  61. package/dist/core/shell/tableShell.js +82 -34
  62. package/dist/core/table/addButton.d.ts +6 -0
  63. package/dist/core/table/addButton.js +103 -0
  64. package/dist/core/table/events.d.ts +1 -3
  65. package/dist/core/table/events.js +28 -34
  66. package/dist/core/table/index.js +97 -190
  67. package/dist/core/table/index.less +12 -0
  68. package/dist/core/table/useGroupConfig.d.ts +4 -1
  69. package/dist/core/table/useGroupConfig.js +139 -14
  70. package/dist/core/table/useRowSelection.d.ts +3 -0
  71. package/dist/core/table/useRowSelection.js +68 -2
  72. package/dist/core/util.d.ts +10 -4
  73. package/dist/core/util.js +121 -69
  74. package/dist/core/viewer/btnViewer/index.js +3 -3
  75. package/dist/core/viewer/cascaderViewer/index.js +6 -1
  76. package/dist/core/viewer/checkViewer/index.js +2 -2
  77. package/dist/core/viewer/editViewer/index.js +3 -3
  78. package/dist/core/viewer/groupViewer/index.js +26 -10
  79. package/dist/core/viewer/selectorViewer/index.js +7 -3
  80. package/dist/core/viewer/switchViewer/index.js +10 -4
  81. package/dist/example/antComponent.d.ts +1 -1
  82. package/dist/example/antComponent.js +63 -37
  83. package/dist/example/basic.d.ts +1 -1
  84. package/dist/example/basic.js +20 -14
  85. package/dist/example/ellipsis.d.ts +1 -1
  86. package/dist/example/ellipsis.js +3 -2
  87. package/dist/example/fixed.d.ts +1 -1
  88. package/dist/example/fixed.js +3 -2
  89. package/dist/example/group.js +40 -17
  90. package/dist/example/selection.d.ts +1 -1
  91. package/dist/example/selection.js +9 -8
  92. package/dist/example/sheet.d.ts +1 -1
  93. package/dist/example/sheet.js +21 -22
  94. package/dist/example/valuationAnalyze.d.ts +1 -0
  95. package/dist/example/valuationAnalyze.js +3 -4
  96. package/dist/hooks/index.d.ts +1 -1
  97. package/dist/hooks/index.js +1 -1
  98. package/dist/hooks/useEventBus.d.ts +1 -0
  99. package/dist/hooks/useEventBus.js +2 -2
  100. package/dist/hooks/useGroupConfig.d.ts +4 -0
  101. package/dist/hooks/useGroupConfig.js +5 -0
  102. package/dist/hooks/useKeyboard.d.ts +5 -2
  103. package/dist/hooks/useKeyboard.js +17 -3
  104. package/dist/hooks/useMiddlewareReducer.d.ts +5 -5
  105. package/dist/hooks/useMiddlewareReducer.js +3 -3
  106. package/dist/hooks/useMouse.d.ts +1 -1
  107. package/dist/hooks/useMouse.js +7 -7
  108. package/dist/hooks/useSetState.js +7 -7
  109. package/dist/hooks/useSheetEvent.d.ts +1 -1
  110. package/dist/hooks/useSheetEvent.js +2 -2
  111. package/dist/hooks/useWidthConfig.d.ts +3 -3
  112. package/dist/hooks/useWidthConfig.js +2 -2
  113. package/dist/standardUtils/index.d.ts +1 -1
  114. package/dist/standardUtils/index.js +1 -1
  115. package/dist/type/sheet.d.ts +76 -31
  116. package/dist/type/sheetTable.d.ts +21 -12
  117. package/package.json +7 -4
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="react" />
3
3
  import Events from 'events';
4
- export declare const SheetEventContext: import("react").Context<Events | undefined>;
4
+ export declare const SheetEventContext: import("../../node_modules/@types/react").Context<Events | undefined>;
5
5
  export declare function useSheetEvent(): Events;
@@ -1,5 +1,5 @@
1
- import { createContext, useContext } from 'react';
2
- export var SheetEventContext = /*#__PURE__*/createContext(undefined);
1
+ import { createContext, useContext } from "../../node_modules/@types/react";
2
+ export var SheetEventContext = createContext(undefined);
3
3
  export function useSheetEvent() {
4
4
  return useContext(SheetEventContext);
5
5
  }
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { WidthConfig } from '../type/sheet';
3
- export declare const WidthContext: import("react").Context<WidthConfig>;
4
- export declare function useWidth(): WidthConfig;
2
+ import { WidthConfigContext } from '../type/sheet';
3
+ export declare const WidthContext: import("../../node_modules/@types/react").Context<WidthConfigContext>;
4
+ export declare function useWidth(): WidthConfigContext;
@@ -1,5 +1,5 @@
1
- import { createContext, useContext } from 'react';
2
- export var WidthContext = /*#__PURE__*/createContext({});
1
+ import { createContext, useContext } from "../../node_modules/@types/react";
2
+ export var WidthContext = createContext({});
3
3
  export function useWidth() {
4
4
  return useContext(WidthContext);
5
5
  }
@@ -1,4 +1,4 @@
1
- declare type ValueParams = string | number | null | undefined;
1
+ type ValueParams = string | number | null | undefined;
2
2
  export declare const formatPrecision: (value: ValueParams, precision?: number) => string;
3
3
  /**
4
4
  * 千位分隔符
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
2
2
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  export var formatPrecision = function formatPrecision(value) {
8
8
  var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="node" />
3
2
  import type { EventEmitter } from 'events';
3
+ import { CSSProperties } from "../../node_modules/@types/react";
4
4
  import { SheetTableType, SheetType } from '.';
5
5
  export declare enum CellAlign {
6
6
  left = "left",
@@ -8,8 +8,10 @@ export declare enum CellAlign {
8
8
  right = "right",
9
9
  unset = "unset"
10
10
  }
11
- export declare type Cell = {
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;
@@ -20,55 +22,70 @@ export declare type Cell = {
20
22
  record?: Record<string, unknown>;
21
23
  disableEvents?: boolean;
22
24
  dataEditor?: CellEditor;
25
+ dataIndex?: string;
23
26
  valueViewer?: CellViewer;
27
+ searchKey?: (value: unknown, record?: unknown) => string;
24
28
  className?: string;
25
29
  align?: CellAlign;
26
30
  fixed?: Omit<CellAlign, 'center'>;
27
31
  value?: string | number | null;
32
+ allowClear?: boolean;
33
+ };
34
+ export type FixedInfo = {
35
+ isFirstFixedRight: boolean;
36
+ isLastFixedLeft: boolean;
37
+ fixPosition: number;
38
+ isScrolledOver?: boolean;
39
+ isScrolledToEnd?: boolean;
28
40
  };
29
- export declare type CellViewerProps = {
41
+ export type CellViewerProps = {
30
42
  value: unknown;
31
43
  record?: Record<string, unknown>;
32
44
  row?: number;
33
45
  col?: number;
34
46
  cell?: Cell;
35
47
  };
36
- export declare type CellEditorProps = {
48
+ export type CellEditorProps = {
37
49
  value: unknown;
38
50
  cell?: Cell;
39
51
  onChange: (value: unknown) => void;
40
52
  onConfirm: (value: unknown) => void;
41
53
  } & CellViewerProps;
42
- export declare type CellEditor = React.FC<CellEditorProps> & {
54
+ export type CellEditor = React.FC<CellEditorProps> & {
43
55
  checker?: (value: unknown, record?: Record<string, unknown>) => boolean;
44
56
  formatter?: (value: unknown, record?: Record<string, unknown>) => unknown;
45
57
  parser?: (value: unknown, record?: Record<string, unknown>) => unknown;
46
58
  };
47
- export declare type CellViewer = React.FC<CellViewerProps>;
48
- export declare type CellPosition = {
59
+ export type CellViewer = React.FC<CellViewerProps>;
60
+ export type CellPosition = {
49
61
  row: number;
50
62
  col: number;
51
63
  };
52
- export declare type CellData = {
64
+ export type CellData = {
53
65
  id: string;
54
66
  cell: Cell;
55
67
  row: number;
56
68
  col: number;
69
+ key?: string;
57
70
  value?: string;
58
71
  };
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 = {
72
+ export type CellNavigable = (cell?: Cell, row?: number, col?: number) => boolean;
73
+ export type CellChangeHandler = (cells: CellData[], additions?: CellData[]) => void;
74
+ export type RowGroup = {
62
75
  groupName: string;
63
76
  groupStart: number;
64
77
  groupEnd: number;
65
78
  };
66
- export declare type RowGroupConfig = {
79
+ export type RowGroupConfig = {
67
80
  defaultOpen?: boolean;
68
81
  groups: RowGroup[];
69
82
  groupOpen: boolean[];
70
83
  };
71
- export declare type MenuRenderProps = {
84
+ export type GroupMap = Map<number, SheetType.RowGroup & {
85
+ isStart: boolean;
86
+ isOpen: boolean;
87
+ }>;
88
+ export type MenuRenderProps = {
72
89
  position?: {
73
90
  top: number;
74
91
  left: number;
@@ -76,8 +93,9 @@ export declare type MenuRenderProps = {
76
93
  cell?: CellPosition;
77
94
  onContextMenu?: (event: any) => void;
78
95
  };
79
- export declare type SheetInstance = {
96
+ export type SheetInstance = {
80
97
  zoomTo: (row?: number) => void;
98
+ goTo: (row: number, col: number) => void;
81
99
  pushToHistory: (value: OperateHistory) => void;
82
100
  selectRow: (row?: number) => void;
83
101
  select: (props: {
@@ -85,33 +103,48 @@ export declare type SheetInstance = {
85
103
  end: SheetType.CellPosition;
86
104
  }) => void;
87
105
  popHistory: () => OperateHistory;
106
+ dropHistory: () => OperateHistory[];
88
107
  };
89
- export declare type SheetProps = {
108
+ export type SheetProps = {
90
109
  sheetInstance?: React.MutableRefObject<SheetInstance | null>;
91
110
  sheetRenderer?: any;
92
111
  rowRenderer?: any;
112
+ emptyRenderer?: any;
93
113
  className?: string;
94
114
  data: Cell[][];
95
115
  freePaste?: boolean;
96
116
  virtualized?: boolean;
97
117
  showBackEdit?: boolean;
98
- backEditStyle?: Partial<CSSStyleDeclaration>;
118
+ backEditStyle?: Partial<CSSProperties>;
119
+ searchStyle?: Partial<CSSProperties>;
120
+ sticky?: boolean;
99
121
  groupConfig?: RowGroupConfig;
100
122
  onCellsChanged?: CellChangeHandler;
101
123
  menuRenderer?: React.FC<MenuRenderProps>;
102
124
  onContextMenu?: (event: any) => void;
125
+ handleAdd?: () => void;
103
126
  scroll?: {
104
127
  x?: number | string;
105
128
  y?: number | string;
106
129
  };
107
130
  rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
108
131
  children?: any[];
132
+ boldScroll?: boolean;
133
+ hideColBar?: boolean;
134
+ showQuickLocationBtn?: boolean;
135
+ ControlContainer?: React.FC;
109
136
  };
110
- export declare type WidthConfig = {
137
+ export type WidthConfigContext = {
111
138
  onChange?: (value: Record<number | string, number>) => void;
112
139
  widths?: Record<number | string, number>;
113
140
  };
114
- export declare type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
141
+ export type GroupConfigContext = {
142
+ onChange?: (value: RowGroupConfig) => void;
143
+ config?: RowGroupConfig & {
144
+ configMap: GroupMap;
145
+ };
146
+ };
147
+ export type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
115
148
  className?: string;
116
149
  showGroup?: boolean;
117
150
  showSelect?: boolean;
@@ -126,24 +159,24 @@ export declare type SheetShell = Pick<SheetTableType.TableProps, 'columns'> & {
126
159
  };
127
160
  };
128
161
  };
129
- export declare type SheetRow = {
162
+ export type SheetRow = {
130
163
  row: number;
131
164
  cells: Cell[];
132
165
  selected: boolean;
133
166
  children: React.ElementType;
134
167
  };
135
- export declare type windowAssertion = {
168
+ export type windowAssertion = {
136
169
  clipboardData?: {
137
170
  getData?: (type: string) => string;
138
171
  setData?: (type: string, data: string) => string;
139
172
  };
140
173
  };
141
- export declare type refAssertion = {
174
+ export type refAssertion = {
142
175
  contains?: (target: EventTarget | null) => boolean;
143
176
  focus?: () => boolean;
144
177
  } & HTMLSpanElement;
145
- export declare type AttributesRenderer = (cell: Cell, row: number, col: number) => Record<string, string>;
146
- export declare type CellProps = {
178
+ export type AttributesRenderer = (cell: Cell, row: number, col: number) => Record<string, string>;
179
+ export type CellProps = {
147
180
  row: number;
148
181
  col: number;
149
182
  cell: Cell;
@@ -151,8 +184,17 @@ export declare type CellProps = {
151
184
  dataEditor?: React.ElementType;
152
185
  valueViewer?: React.ElementType;
153
186
  attributesRenderer?: AttributesRenderer;
187
+ cellFixedInfo: SheetType.FixedInfo;
154
188
  };
155
- export declare type UpdateStateType = {
189
+ export type SearchState = {
190
+ showSearch: boolean;
191
+ searchText: string;
192
+ searchTotal: number;
193
+ searchCurrent: number;
194
+ searchResultList?: CellPosition[];
195
+ searchCalledCount: number;
196
+ };
197
+ export type UpdateStateType = {
156
198
  eventBus: EventEmitter;
157
199
  start: CellPosition;
158
200
  end: CellPosition;
@@ -163,9 +205,11 @@ export declare type UpdateStateType = {
163
205
  value?: string;
164
206
  };
165
207
  history: OperateHistory[];
208
+ recoverHisotry: OperateHistory[];
166
209
  freePaste?: boolean;
167
210
  data: Cell[][];
168
211
  mouseDown: boolean;
212
+ isIndex: boolean;
169
213
  lastSelected?: {
170
214
  start?: CellPosition;
171
215
  end?: CellPosition;
@@ -182,17 +226,18 @@ export declare type UpdateStateType = {
182
226
  confirm?: boolean;
183
227
  };
184
228
  cellChangeHandler: (cells: CellData[], additions?: CellData[]) => void;
185
- };
186
- export declare type UpdateFocus = (start: CellPosition, end: CellPosition) => void;
187
- export declare type Options<T = any> = {
188
- value: string;
229
+ fixedInfo: SheetType.FixedInfo[];
230
+ } & SearchState;
231
+ export type UpdateFocus = (start: CellPosition, end: CellPosition) => void;
232
+ export type Options<T = any> = {
233
+ value: string | number;
189
234
  label: string;
190
235
  } & T;
191
- export declare type OptionsType = Options<{
236
+ export type OptionsType = Options<{
192
237
  disabled?: boolean;
193
238
  children?: OptionsType[];
194
239
  }>;
195
- export declare type OperateHistory = {
240
+ export type OperateHistory = {
196
241
  changes: Partial<CellData>[];
197
242
  type: OperateType;
198
243
  rowInfo?: {
@@ -201,4 +246,4 @@ export declare type OperateHistory = {
201
246
  };
202
247
  extraInfo?: Record<string, unknown>;
203
248
  };
204
- export declare type OperateType = 'Edit' | 'Paste' | 'Delete' | 'DeleteRow' | 'NewRow' | 'Custom';
249
+ export type OperateType = 'Edit' | 'Paste' | 'Delete' | 'DeleteRow' | 'NewRow' | 'Custom';
@@ -1,12 +1,12 @@
1
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from "../../node_modules/@types/react";
2
2
  import { SheetType } from '.';
3
- export declare type refAssertion = {
3
+ export type refAssertion = {
4
4
  contains?: (target: EventTarget | null) => boolean;
5
5
  focus?: () => boolean;
6
6
  } & HTMLTableSectionElement;
7
- export declare type CellFixed = SheetType.CellAlign;
8
- export declare type RecordRowMap<T> = (value: unknown, record: Record<string, unknown>, index: number) => T;
9
- export declare type ColumnProps = {
7
+ export type CellFixed = SheetType.CellAlign;
8
+ export type RecordRowMap<T> = (value: unknown, record: Record<string, unknown>, index: number, colIndex?: number) => T;
9
+ export type ColumnProps = {
10
10
  /**
11
11
  * @description 对齐
12
12
  * @default "left"
@@ -23,7 +23,7 @@ export declare type ColumnProps = {
23
23
  */
24
24
  width?: string | number;
25
25
  dataIndex?: string;
26
- title: string | ReactNode | ReactNode[];
26
+ title: string | ReactNode;
27
27
  titleConfig?: {
28
28
  colSpan?: number;
29
29
  className?: string;
@@ -34,26 +34,29 @@ export declare type ColumnProps = {
34
34
  key?: string;
35
35
  editable?: boolean | RecordRowMap<boolean>;
36
36
  readonly?: boolean | RecordRowMap<boolean>;
37
+ allowClear?: boolean;
37
38
  render?: SheetType.CellViewer;
38
39
  editor?: SheetType.CellEditor;
40
+ searchKey?: (value: unknown, record: Record<string, unknown>) => string;
39
41
  };
40
- export declare type TableChange = {
42
+ export type TableChange = {
43
+ col?: number;
41
44
  row: number;
42
45
  id: string;
43
46
  key: string;
44
47
  value: unknown;
45
48
  };
46
- export declare type TableRowSelection = {
49
+ export type TableRowSelection = {
47
50
  rowSelected?: string[];
48
51
  onChange?: (selectedRowKeys: string[], selectedRows: Record<string, unknown>[]) => void;
49
52
  };
50
- export declare type TableGroupConfig = {
53
+ export type TableGroupConfig = {
51
54
  defaultOpen?: boolean;
52
55
  rowGroup?: SheetType.RowGroupConfig;
53
56
  onChange?: (value: SheetType.RowGroupConfig) => void;
54
57
  };
55
- export declare type EventHandler = (value: any) => void;
56
- export declare type TableProps = {
58
+ export type EventHandler = (value: any) => void;
59
+ export type TableProps = {
57
60
  /**
58
61
  * @description 表格类名
59
62
  * @default "undefined"
@@ -67,6 +70,7 @@ export declare type TableProps = {
67
70
  columns: ColumnProps[];
68
71
  virtualized?: boolean;
69
72
  dataSource: Record<string, unknown>[];
73
+ emptyRenderer?: any;
70
74
  rowClassName?: string | ((record: Record<string, unknown>, index: number) => string);
71
75
  rowKey?: string | ((record: Record<string, unknown>, index: number) => string);
72
76
  scroll?: {
@@ -77,12 +81,17 @@ export declare type TableProps = {
77
81
  draggable?: boolean;
78
82
  freePaste?: boolean;
79
83
  showBackEdit?: boolean;
80
- backEditStyle?: Partial<CSSStyleDeclaration>;
84
+ backEditStyle?: Partial<CSSProperties>;
85
+ searchStyle?: Partial<CSSProperties>;
81
86
  rowSelection?: TableRowSelection;
82
87
  groupConfig?: TableGroupConfig;
83
88
  menuRenderer?: React.FC<SheetType.MenuRenderProps>;
84
89
  onContextMenu?: (event: any) => void;
85
90
  onChange: (changes: TableChange[], extChanges?: TableChange[]) => void;
86
91
  handleAdd?: () => void;
92
+ handleBatchAdd?: (value: number) => void;
87
93
  eventHandler?: Record<'reverse' | 'btn-click' | 'cell-edit' | 'cell-switch' | string, undefined | EventHandler>;
94
+ boldScroll?: boolean;
95
+ showQuickLocationBtn?: boolean;
96
+ ControlContainer?: React.FC;
88
97
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.6",
3
+ "version": "0.1.73.beta.0",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -49,6 +49,8 @@
49
49
  "events": "^3.3.0",
50
50
  "lodash": "^4.17.21",
51
51
  "moment": "^2.29.4",
52
+ "react": "17.x",
53
+ "react-dom": "17.x",
52
54
  "redux-logger": "^3.0.6",
53
55
  "redux-thunk": "^2.4.2"
54
56
  },
@@ -56,8 +58,8 @@
56
58
  "@commitlint/cli": "^17.1.2",
57
59
  "@commitlint/config-conventional": "^17.1.0",
58
60
  "@types/lodash": "^4.14.195",
59
- "@types/react": "^17.0.0",
60
- "@types/react-dom": "^17.0.0",
61
+ "@types/react": "17.0.40",
62
+ "@types/react-dom": "17.0.13",
61
63
  "@umijs/lint": "^4.0.0",
62
64
  "dumi": "^2.2.0",
63
65
  "eslint": "^8.23.0",
@@ -78,5 +80,6 @@
78
80
  },
79
81
  "authors": [
80
82
  "fizz.zhou@ap.jll.com"
81
- ]
83
+ ],
84
+ "preid": "beta"
82
85
  }