es-grid-template 1.8.2 → 1.8.21

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.
@@ -28,7 +28,7 @@ const TableHead = ({
28
28
  zIndex: 1,
29
29
  // gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
30
30
  // gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
31
- gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}px`).join(" ")}`
31
+ gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
32
32
  }
33
33
  }, leafColumns.map(column => {
34
34
  const depth = column.depth ?? 0;
@@ -226,17 +226,18 @@ const TableHeadCell2 = props => {
226
226
  // rowSpan={rowSpan}
227
227
  ,
228
228
 
229
- key: header.id,
229
+ key: column.id,
230
230
  style: {
231
231
  // display: 'flex',
232
232
  // width: column.getSize(),
233
- minWidth: header.getSize(),
233
+ minWidth: column.getSize(),
234
234
  // flex: 1,
235
- flexGrow: header.getSize(),
235
+ // flexGrow: column.getSize(),
236
+
236
237
  gridRow: `${depth + 1} / span ${rowSpan}`,
237
238
  gridColumn: `span ${colSpan}`,
238
239
  // maxWidth: header.getSize(),
239
- ...getCommonPinningStyles(header.column),
240
+ ...getCommonPinningStyles(column),
240
241
  width: 'auto',
241
242
  ...style
242
243
  },
@@ -38,7 +38,7 @@ const TableHead = ({
38
38
  zIndex: 1,
39
39
  // gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
40
40
  // gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
41
- gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}px`).join(" ")}`
41
+ gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
42
42
  }
43
43
  }, leafColumns.map(column => {
44
44
  const depth = column.depth ?? 0;
@@ -235,17 +235,18 @@ const TableHeadCell2 = props => {
235
235
  // rowSpan={rowSpan}
236
236
  ,
237
237
 
238
- key: header.id,
238
+ key: column.id,
239
239
  style: {
240
240
  // display: 'flex',
241
241
  // width: column.getSize(),
242
- minWidth: header.getSize(),
242
+ minWidth: column.getSize(),
243
243
  // flex: 1,
244
- flexGrow: header.getSize(),
244
+ // flexGrow: column.getSize(),
245
+
245
246
  gridRow: `${depth + 1} / span ${rowSpan}`,
246
247
  gridColumn: `span ${colSpan}`,
247
248
  // maxWidth: header.getSize(),
248
- ...(0, _utils.getCommonPinningStyles)(header.column),
249
+ ...(0, _utils.getCommonPinningStyles)(column),
249
250
  width: 'auto',
250
251
  ...style
251
252
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-grid-template",
3
- "version": "1.8.2",
3
+ "version": "1.8.21",
4
4
  "description": "es-grid-template",
5
5
  "keywords": [
6
6
  "react",