es-grid-template 1.9.98 → 1.9.100

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.
@@ -6,7 +6,7 @@ export declare function getRowFocusHandlers<T>(rowData: T, rowFocus?: RowFocus<T
6
6
  onClickCapture: (event: MouseEvent<HTMLElement>) => void;
7
7
  onContextMenuCapture: (event: MouseEvent<HTMLElement>) => void;
8
8
  };
9
- /** Report the last focused row after the arrow key is released. */
9
+ /** Report the last focused row after a pause in arrow navigation. */
10
10
  export declare function notifyArrowRowFocus<T>(event: ReactKeyboardEvent, rowData: T, method: 'arrowUp' | 'arrowDown', useArrow?: boolean, rowFocus?: RowFocus<T>): void;
11
11
  export declare function focusArrowRow(event: ReactKeyboardEvent, rowId: string, columnId: string, scrollToRow: () => void): void;
12
12
  export {};
@@ -1,3 +1,4 @@
1
+ const arrowFocusDelay = 700;
1
2
  const gridViewportSelector = '[data-grid-scroll], [data-virtuoso-scroller]';
2
3
  const pendingArrowFocus = new WeakMap();
3
4
 
@@ -19,7 +20,7 @@ export function getRowFocusHandlers(rowData, rowFocus) {
19
20
  };
20
21
  }
21
22
 
22
- /** Report the last focused row after the arrow key is released. */
23
+ /** Report the last focused row after a pause in arrow navigation. */
23
24
  export function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus) {
24
25
  if (useArrow !== true || !rowFocus) return;
25
26
  const viewport = event.currentTarget.closest(gridViewportSelector);
@@ -31,6 +32,10 @@ export function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus)
31
32
  });
32
33
  const pending = pendingArrowFocus.get(viewport);
33
34
  if (pending) {
35
+ if (pending.timer !== undefined) {
36
+ view.clearTimeout(pending.timer);
37
+ pending.timer = undefined;
38
+ }
34
39
  pending.key = event.key;
35
40
  pending.notify = notify;
36
41
  return;
@@ -41,17 +46,18 @@ export function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus)
41
46
  };
42
47
  pendingArrowFocus.set(viewport, focus);
43
48
  const cancel = () => {
49
+ if (focus.timer !== undefined) view.clearTimeout(focus.timer);
44
50
  pendingArrowFocus.delete(viewport);
45
51
  view.removeEventListener('keyup', release, true);
46
52
  view.removeEventListener('blur', cancel);
47
53
  view.removeEventListener('pointerdown', cancel, true);
48
54
  };
49
55
  const release = keyEvent => {
50
- if (keyEvent.key !== focus.key) return;
51
- cancel();
52
- view.setTimeout(() => {
56
+ if (keyEvent.key !== focus.key || focus.timer !== undefined) return;
57
+ focus.timer = view.setTimeout(() => {
58
+ cancel();
53
59
  if (viewport.isConnected) focus.notify();
54
- }, 0);
60
+ }, arrowFocusDelay);
55
61
  };
56
62
 
57
63
  // A virtualized row can unmount before keyup reaches its original cell.
@@ -791,7 +791,7 @@ export type IWrapSettings = {
791
791
  wrapMode?: IWrapMode;
792
792
  };
793
793
  export type SelectionSettings<T = AnyObject> = {
794
- /** Invoke rowFocus for the final row after releasing ArrowUp or ArrowDown. Defaults to false. */
794
+ /** Invoke rowFocus for the final row 700 ms after releasing ArrowUp or ArrowDown. Defaults to false. */
795
795
  useArrow?: boolean;
796
796
  mode?: 'checkbox' | 'radio';
797
797
  type?: 'single' | 'multiple';
@@ -27,9 +27,13 @@ const TableBody = ({
27
27
  locale
28
28
  } = React.useContext(TableContext);
29
29
 
30
+ // Keep measured heights attached to records when expanding, sorting or filtering.
31
+ const getItemKey = React.useCallback(index => rows[index].id, [rows]);
32
+
30
33
  //dynamic row height virtualization - alternatively you could use a simpler fixed row height strategy without the need for `measureElement`
31
34
  const rowVirtualizer = useVirtualizer({
32
35
  count: rows.length,
36
+ getItemKey,
33
37
  estimateSize: () => 36,
34
38
  //estimate row height for accurate scrollbar dragging
35
39
  getScrollElement: () => tableContainerRef.current,
@@ -930,7 +930,7 @@ const TableBodyCellEdit = props => {
930
930
  }),
931
931
  style: {
932
932
  display: 'flex',
933
- height: '36px',
933
+ minHeight: 36,
934
934
  userSelect: 'none',
935
935
  width: cell.column.getSize(),
936
936
  // flexBasis: cell.column.getSize(),
@@ -1019,7 +1019,7 @@ const TableBodyCellEdit = props => {
1019
1019
  }),
1020
1020
  style: {
1021
1021
  display: 'flex',
1022
- height: '36px',
1022
+ minHeight: 36,
1023
1023
  width: cell.column.getSize(),
1024
1024
  minWidth: cell.column.getSize(),
1025
1025
  // flex: 1,
@@ -1045,7 +1045,7 @@ const TableBodyCellEdit = props => {
1045
1045
  }),
1046
1046
  style: {
1047
1047
  display: 'flex',
1048
- height: '36px',
1048
+ minHeight: 36,
1049
1049
  width: cell.column.getSize(),
1050
1050
  minWidth: cell.column.getSize(),
1051
1051
  // flex: 1,
@@ -1186,7 +1186,8 @@ const TableBodyCellEdit = props => {
1186
1186
  minWidth: cell.column.getSize(),
1187
1187
  // flex: 1,
1188
1188
  // maxWidth: cell.column.getSize(),
1189
- height: '36px',
1189
+ height: isEditing && canEdit ? 36 : undefined,
1190
+ minHeight: 36,
1190
1191
  ...getCommonPinningStyles(cell.column),
1191
1192
  cursor: isPasting ? 'crosshair' : undefined
1192
1193
  },
@@ -55,10 +55,15 @@ const TableBodyRow = ({
55
55
  const rowClass = typeof rowClassName === 'function' ? rowClassName(row.original, row.index, row.depth) : rowClassName;
56
56
  const rowStyles = typeof onRowStyles === 'function' ? onRowStyles(row.original, row) : onRowStyles;
57
57
  const isRowEditable = rowEditable ? rowEditable(row.original) : true;
58
+
59
+ // A reused DOM row needs measuring again when its virtual index changes.
60
+ const measureRow = React.useCallback(element => {
61
+ rowVirtualizer.measureElement(element);
62
+ }, [rowVirtualizer, virtualRow.index]);
58
63
  return /*#__PURE__*/React.createElement("div", _extends({
59
64
  "data-index": virtualRow.index //needed for dynamic row height measurement
60
65
  ,
61
- ref: rowVirtualizer.measureElement //measure dynamic row height
66
+ ref: measureRow //measure dynamic row height
62
67
  ,
63
68
  key: row.id,
64
69
  "data-row-key": row.id,
@@ -78,8 +83,7 @@ const TableBodyRow = ({
78
83
  //this should always be a `style` as it changes on scroll
79
84
  // height: isEditing ? '36px' : undefined,
80
85
  gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
81
- height: isEditing ? virtualRow.size : undefined,
82
- minHeight: isEditing ? undefined : virtualRow.size,
86
+ minHeight: isEditing ? virtualRow.size : 36,
83
87
  ...rowStyles
84
88
  }
85
89
  }, getRowFocusHandlers(row.original, rowFocus), {
@@ -196,10 +196,10 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
196
196
  value: any;
197
197
  rowData: RecordType;
198
198
  }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
199
- onCellStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
200
- onCellHeaderStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
199
+ onCellStyles?: Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth">);
200
+ onCellHeaderStyles?: Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth">);
201
201
  onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
202
- onCellFooterStyles?: Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "position" | "left" | "right" | "display" | "width" | "minWidth">);
202
+ onCellFooterStyles?: Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "right" | "left" | "position" | "display" | "width" | "minWidth">);
203
203
  getValue?: (row: any, rowIndex: number) => any;
204
204
  getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
205
205
  headerCellProps?: import("./../../grid-component/type").CellProps;
@@ -958,7 +958,7 @@ const TableBodyCellEdit = props => {
958
958
  }),
959
959
  style: {
960
960
  display: 'flex',
961
- height: '32px',
961
+ minHeight: 32,
962
962
  userSelect: 'none',
963
963
  width: cell.column.getSize(),
964
964
  // flexBasis: cell.column.getSize(),
@@ -1047,7 +1047,7 @@ const TableBodyCellEdit = props => {
1047
1047
  }),
1048
1048
  style: {
1049
1049
  display: 'flex',
1050
- height: '32px',
1050
+ minHeight: 32,
1051
1051
  width: cell.column.getSize(),
1052
1052
  minWidth: cell.column.getSize(),
1053
1053
  // flex: 1,
@@ -1073,7 +1073,7 @@ const TableBodyCellEdit = props => {
1073
1073
  }),
1074
1074
  style: {
1075
1075
  display: 'flex',
1076
- height: '32px',
1076
+ minHeight: 32,
1077
1077
  width: cell.column.getSize(),
1078
1078
  minWidth: cell.column.getSize(),
1079
1079
  // flex: 1,
@@ -1283,7 +1283,8 @@ const TableBodyCellEdit = props => {
1283
1283
  minWidth: cell.column.getSize(),
1284
1284
  // flex: 1,
1285
1285
  // maxWidth: cell.column.getSize(),
1286
- height: '32px',
1286
+ height: isEditing && canEdit ? 32 : undefined,
1287
+ minHeight: 32,
1287
1288
  ...getCommonPinningStyles(cell.column),
1288
1289
  cursor: isPasting ? 'crosshair' : undefined
1289
1290
  },
@@ -84,8 +84,7 @@ const TableBodyRow = ({
84
84
  transform: `translateY(${virtualRow.start}px)`,
85
85
  //this should always be a `style` as it changes on scroll
86
86
  gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
87
- height: isEditing ? virtualRow.size : undefined,
88
- minHeight: isEditing ? undefined : virtualRow.size,
87
+ minHeight: isEditing ? virtualRow.size : 32,
89
88
  ...rowStyles
90
89
  }
91
90
  }, getRowFocusHandlers(row.original, rowFocus), {
@@ -6,7 +6,7 @@ export declare function getRowFocusHandlers<T>(rowData: T, rowFocus?: RowFocus<T
6
6
  onClickCapture: (event: MouseEvent<HTMLElement>) => void;
7
7
  onContextMenuCapture: (event: MouseEvent<HTMLElement>) => void;
8
8
  };
9
- /** Report the last focused row after the arrow key is released. */
9
+ /** Report the last focused row after a pause in arrow navigation. */
10
10
  export declare function notifyArrowRowFocus<T>(event: ReactKeyboardEvent, rowData: T, method: 'arrowUp' | 'arrowDown', useArrow?: boolean, rowFocus?: RowFocus<T>): void;
11
11
  export declare function focusArrowRow(event: ReactKeyboardEvent, rowId: string, columnId: string, scrollToRow: () => void): void;
12
12
  export {};
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.focusArrowRow = focusArrowRow;
7
7
  exports.getRowFocusHandlers = getRowFocusHandlers;
8
8
  exports.notifyArrowRowFocus = notifyArrowRowFocus;
9
+ const arrowFocusDelay = 700;
9
10
  const gridViewportSelector = '[data-grid-scroll], [data-virtuoso-scroller]';
10
11
  const pendingArrowFocus = new WeakMap();
11
12
 
@@ -27,7 +28,7 @@ function getRowFocusHandlers(rowData, rowFocus) {
27
28
  };
28
29
  }
29
30
 
30
- /** Report the last focused row after the arrow key is released. */
31
+ /** Report the last focused row after a pause in arrow navigation. */
31
32
  function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus) {
32
33
  if (useArrow !== true || !rowFocus) return;
33
34
  const viewport = event.currentTarget.closest(gridViewportSelector);
@@ -39,6 +40,10 @@ function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus) {
39
40
  });
40
41
  const pending = pendingArrowFocus.get(viewport);
41
42
  if (pending) {
43
+ if (pending.timer !== undefined) {
44
+ view.clearTimeout(pending.timer);
45
+ pending.timer = undefined;
46
+ }
42
47
  pending.key = event.key;
43
48
  pending.notify = notify;
44
49
  return;
@@ -49,17 +54,18 @@ function notifyArrowRowFocus(event, rowData, method, useArrow, rowFocus) {
49
54
  };
50
55
  pendingArrowFocus.set(viewport, focus);
51
56
  const cancel = () => {
57
+ if (focus.timer !== undefined) view.clearTimeout(focus.timer);
52
58
  pendingArrowFocus.delete(viewport);
53
59
  view.removeEventListener('keyup', release, true);
54
60
  view.removeEventListener('blur', cancel);
55
61
  view.removeEventListener('pointerdown', cancel, true);
56
62
  };
57
63
  const release = keyEvent => {
58
- if (keyEvent.key !== focus.key) return;
59
- cancel();
60
- view.setTimeout(() => {
64
+ if (keyEvent.key !== focus.key || focus.timer !== undefined) return;
65
+ focus.timer = view.setTimeout(() => {
66
+ cancel();
61
67
  if (viewport.isConnected) focus.notify();
62
- }, 0);
68
+ }, arrowFocusDelay);
63
69
  };
64
70
 
65
71
  // A virtualized row can unmount before keyup reaches its original cell.
@@ -791,7 +791,7 @@ export type IWrapSettings = {
791
791
  wrapMode?: IWrapMode;
792
792
  };
793
793
  export type SelectionSettings<T = AnyObject> = {
794
- /** Invoke rowFocus for the final row after releasing ArrowUp or ArrowDown. Defaults to false. */
794
+ /** Invoke rowFocus for the final row 700 ms after releasing ArrowUp or ArrowDown. Defaults to false. */
795
795
  useArrow?: boolean;
796
796
  mode?: 'checkbox' | 'radio';
797
797
  type?: 'single' | 'multiple';
@@ -36,9 +36,13 @@ const TableBody = ({
36
36
  locale
37
37
  } = _react.default.useContext(_useContext.TableContext);
38
38
 
39
+ // Keep measured heights attached to records when expanding, sorting or filtering.
40
+ const getItemKey = _react.default.useCallback(index => rows[index].id, [rows]);
41
+
39
42
  //dynamic row height virtualization - alternatively you could use a simpler fixed row height strategy without the need for `measureElement`
40
43
  const rowVirtualizer = (0, _reactVirtual.useVirtualizer)({
41
44
  count: rows.length,
45
+ getItemKey,
42
46
  estimateSize: () => 36,
43
47
  //estimate row height for accurate scrollbar dragging
44
48
  getScrollElement: () => tableContainerRef.current,
@@ -937,7 +937,7 @@ const TableBodyCellEdit = props => {
937
937
  }),
938
938
  style: {
939
939
  display: 'flex',
940
- height: '36px',
940
+ minHeight: 36,
941
941
  userSelect: 'none',
942
942
  width: cell.column.getSize(),
943
943
  // flexBasis: cell.column.getSize(),
@@ -1026,7 +1026,7 @@ const TableBodyCellEdit = props => {
1026
1026
  }),
1027
1027
  style: {
1028
1028
  display: 'flex',
1029
- height: '36px',
1029
+ minHeight: 36,
1030
1030
  width: cell.column.getSize(),
1031
1031
  minWidth: cell.column.getSize(),
1032
1032
  // flex: 1,
@@ -1052,7 +1052,7 @@ const TableBodyCellEdit = props => {
1052
1052
  }),
1053
1053
  style: {
1054
1054
  display: 'flex',
1055
- height: '36px',
1055
+ minHeight: 36,
1056
1056
  width: cell.column.getSize(),
1057
1057
  minWidth: cell.column.getSize(),
1058
1058
  // flex: 1,
@@ -1193,7 +1193,8 @@ const TableBodyCellEdit = props => {
1193
1193
  minWidth: cell.column.getSize(),
1194
1194
  // flex: 1,
1195
1195
  // maxWidth: cell.column.getSize(),
1196
- height: '36px',
1196
+ height: isEditing && canEdit ? 36 : undefined,
1197
+ minHeight: 36,
1197
1198
  ...(0, _utils.getCommonPinningStyles)(cell.column),
1198
1199
  cursor: isPasting ? 'crosshair' : undefined
1199
1200
  },
@@ -62,10 +62,15 @@ const TableBodyRow = ({
62
62
  const rowClass = typeof rowClassName === 'function' ? rowClassName(row.original, row.index, row.depth) : rowClassName;
63
63
  const rowStyles = typeof onRowStyles === 'function' ? onRowStyles(row.original, row) : onRowStyles;
64
64
  const isRowEditable = rowEditable ? rowEditable(row.original) : true;
65
+
66
+ // A reused DOM row needs measuring again when its virtual index changes.
67
+ const measureRow = _react.default.useCallback(element => {
68
+ rowVirtualizer.measureElement(element);
69
+ }, [rowVirtualizer, virtualRow.index]);
65
70
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
66
71
  "data-index": virtualRow.index //needed for dynamic row height measurement
67
72
  ,
68
- ref: rowVirtualizer.measureElement //measure dynamic row height
73
+ ref: measureRow //measure dynamic row height
69
74
  ,
70
75
  key: row.id,
71
76
  "data-row-key": row.id,
@@ -85,8 +90,7 @@ const TableBodyRow = ({
85
90
  //this should always be a `style` as it changes on scroll
86
91
  // height: isEditing ? '36px' : undefined,
87
92
  gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
88
- height: isEditing ? virtualRow.size : undefined,
89
- minHeight: isEditing ? undefined : virtualRow.size,
93
+ minHeight: isEditing ? virtualRow.size : 36,
90
94
  ...rowStyles
91
95
  }
92
96
  }, (0, _rowFocus.getRowFocusHandlers)(row.original, rowFocus), {
@@ -167,7 +167,7 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
167
167
  haveSum?: boolean;
168
168
  isSummary?: boolean;
169
169
  sumGroup?: boolean;
170
- summaryTemplate?: (data: number, key: string) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode;
170
+ summaryTemplate?: (data: number, key: string) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
171
171
  sorter?: boolean;
172
172
  allowFiltering?: boolean;
173
173
  allowSortering?: boolean;
@@ -179,27 +179,27 @@ export declare const fixColumnsLeft: <RecordType>(columns: ColumnTable<RecordTyp
179
179
  showFilterSearch?: boolean;
180
180
  hidden?: boolean;
181
181
  visible?: boolean;
182
- headerTooltip?: string | boolean | (() => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
182
+ headerTooltip?: string | boolean | (() => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
183
183
  columnGroupText?: string;
184
184
  headerTextAlign?: import("./../../grid-component/type").ITextAlign;
185
- headerTemplate?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode | ((column: ColumnTable<RecordType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
185
+ headerTemplate?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((column: ColumnTable<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
186
186
  fixedType?: import("./../../grid-component/type").FixedType;
187
187
  headerTextWrap?: boolean;
188
188
  ellipsis?: boolean;
189
189
  allowResizing?: boolean;
190
190
  align?: import("./../../grid-component/type").ITextAlign;
191
191
  textAlign?: import("./../../grid-component/type").ITextAlign;
192
- template?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
193
- linkTemplate?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
192
+ template?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
193
+ linkTemplate?: import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | ((args: import("./../../grid-component/type").ColumnTemplate<RecordType>) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
194
194
  showTooltip?: boolean;
195
195
  tooltipDescription?: string | ((args: {
196
196
  value: any;
197
197
  rowData: RecordType;
198
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactNode);
199
- onCellStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
200
- onCellHeaderStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
198
+ }) => import("react").ReactNode | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>);
199
+ onCellStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Cell<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
200
+ onCellHeaderStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
201
201
  onCell?: (rowData: RecordType, index: number) => import("react").TdHTMLAttributes<HTMLTableCellElement>;
202
- onCellFooterStyles?: Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "width" | "minWidth" | "left" | "right" | "position" | "display">);
202
+ onCellFooterStyles?: Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position"> | ((cellValue: any, cell: import("@tanstack/react-table").Header<RecordType, unknown>) => Omit<CSSProperties, "left" | "right" | "display" | "width" | "minWidth" | "position">);
203
203
  getValue?: (row: any, rowIndex: number) => any;
204
204
  getCellProps?: (value: any, row: any, rowIndex: number) => import("./../../grid-component/type").CellProps;
205
205
  headerCellProps?: import("./../../grid-component/type").CellProps;
@@ -963,7 +963,7 @@ const TableBodyCellEdit = props => {
963
963
  }),
964
964
  style: {
965
965
  display: 'flex',
966
- height: '32px',
966
+ minHeight: 32,
967
967
  userSelect: 'none',
968
968
  width: cell.column.getSize(),
969
969
  // flexBasis: cell.column.getSize(),
@@ -1052,7 +1052,7 @@ const TableBodyCellEdit = props => {
1052
1052
  }),
1053
1053
  style: {
1054
1054
  display: 'flex',
1055
- height: '32px',
1055
+ minHeight: 32,
1056
1056
  width: cell.column.getSize(),
1057
1057
  minWidth: cell.column.getSize(),
1058
1058
  // flex: 1,
@@ -1078,7 +1078,7 @@ const TableBodyCellEdit = props => {
1078
1078
  }),
1079
1079
  style: {
1080
1080
  display: 'flex',
1081
- height: '32px',
1081
+ minHeight: 32,
1082
1082
  width: cell.column.getSize(),
1083
1083
  minWidth: cell.column.getSize(),
1084
1084
  // flex: 1,
@@ -1288,7 +1288,8 @@ const TableBodyCellEdit = props => {
1288
1288
  minWidth: cell.column.getSize(),
1289
1289
  // flex: 1,
1290
1290
  // maxWidth: cell.column.getSize(),
1291
- height: '32px',
1291
+ height: isEditing && canEdit ? 32 : undefined,
1292
+ minHeight: 32,
1292
1293
  ...(0, _utils.getCommonPinningStyles)(cell.column),
1293
1294
  cursor: isPasting ? 'crosshair' : undefined
1294
1295
  },
@@ -91,8 +91,7 @@ const TableBodyRow = ({
91
91
  transform: `translateY(${virtualRow.start}px)`,
92
92
  //this should always be a `style` as it changes on scroll
93
93
  gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
94
- height: isEditing ? virtualRow.size : undefined,
95
- minHeight: isEditing ? undefined : virtualRow.size,
94
+ minHeight: isEditing ? virtualRow.size : 32,
96
95
  ...rowStyles
97
96
  }
98
97
  }, (0, _rowFocus.getRowFocusHandlers)(row.original, rowFocus), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-grid-template",
3
- "version": "1.9.98",
3
+ "version": "1.9.100",
4
4
  "description": "es-grid-template",
5
5
  "keywords": [
6
6
  "react",