react-data-grid-temp
Advanced tools
Comparing version 7.0.0-canary.22 to 7.0.0-canary.22.0
@@ -40,4 +40,11 @@ var __assign = (this && this.__assign) || function () { | ||
function selectCell(openEditor) { | ||
var _a = column.selectCell, columnSelectCell = _a === void 0 ? true : _a; | ||
if (columnSelectCell || (isFunction(columnSelectCell) && columnSelectCell(row))) { | ||
var _a = column.selectCell, columnSelectCell = _a === void 0 ? function () { return true; } : _a; | ||
var isSelectCell = true; | ||
if (isFunction(columnSelectCell)) { | ||
isSelectCell = columnSelectCell(row); | ||
} | ||
else { | ||
isSelectCell = columnSelectCell; | ||
} | ||
if (isSelectCell) { | ||
eventBus.dispatch('SELECT_CELL', { idx: column.idx, rowIdx: rowIdx }, openEditor); | ||
@@ -44,0 +51,0 @@ } |
@@ -154,5 +154,5 @@ var __assign = (this && this.__assign) || function () { | ||
isCellFocusable.current = false; | ||
return; | ||
} | ||
focusSinkRef.current.focus(); | ||
// 兼容性问题 | ||
// focusSinkRef.current!.focus(); | ||
}); | ||
@@ -159,0 +159,0 @@ useEffect(function () { |
@@ -13,3 +13,2 @@ var __assign = (this && this.__assign) || function () { | ||
import { ToggleGroupFormatter } from '../formatters'; | ||
import { SELECT_COLUMN_KEY } from '../Columns'; | ||
export function getColumnMetrics(metrics) { | ||
@@ -42,30 +41,24 @@ var left = 0; | ||
}); | ||
columns.sort(function (_a, _b) { | ||
var aKey = _a.key, frozenA = _a.frozen; | ||
var bKey = _b.key, frozenB = _b.frozen; | ||
// Sort select column first: | ||
if (aKey === SELECT_COLUMN_KEY) | ||
return -1; | ||
if (bKey === SELECT_COLUMN_KEY) | ||
return 1; | ||
// Sort grouped columns second, following the groupBy order: | ||
if (rawGroupBy === null || rawGroupBy === void 0 ? void 0 : rawGroupBy.includes(aKey)) { | ||
if (rawGroupBy.includes(bKey)) { | ||
return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey); | ||
} | ||
return -1; | ||
} | ||
if (rawGroupBy === null || rawGroupBy === void 0 ? void 0 : rawGroupBy.includes(bKey)) | ||
return 1; | ||
// Sort frozen columns third: | ||
if (frozenA) { | ||
if (frozenB) | ||
return 0; | ||
return -1; | ||
} | ||
if (frozenB) | ||
return 1; | ||
// Sort other columns last: | ||
return 0; | ||
}); | ||
// 兼容性问题 | ||
// columns.sort(({ key: aKey, frozen: frozenA }, { key: bKey, frozen: frozenB }) => { | ||
// // Sort select column first: | ||
// if (aKey === SELECT_COLUMN_KEY) return -1; | ||
// if (bKey === SELECT_COLUMN_KEY) return 1; | ||
// // Sort grouped columns second, following the groupBy order: | ||
// if (rawGroupBy?.includes(aKey)) { | ||
// if (rawGroupBy.includes(bKey)) { | ||
// return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey); | ||
// } | ||
// return -1; | ||
// } | ||
// if (rawGroupBy?.includes(bKey)) return 1; | ||
// // Sort frozen columns third: | ||
// if (frozenA) { | ||
// if (frozenB) return 0; | ||
// return -1; | ||
// } | ||
// if (frozenB) return 1; | ||
// // Sort other columns last: | ||
// return 0; | ||
// }); | ||
var unallocatedWidth = metrics.viewportWidth - allocatedWidths; | ||
@@ -72,0 +65,0 @@ var unallocatedColumnWidth = Math.max(Math.floor(unallocatedWidth / unassignedColumnsCount), metrics.minColumnWidth); |
{ | ||
"name": "react-data-grid-temp", | ||
"version": "7.0.0-canary.22", | ||
"version": "7.0.0-canary.22.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Excel-like grid component built with React, with editors, keyboard navigation, copy & paste, and the like", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
434346