Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-data-grid-temp

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-data-grid-temp - npm Package Compare versions

Comparing version 7.0.0-canary.22.0 to 7.0.0-canary.22.1

5

lib/DataGrid.js

@@ -155,4 +155,5 @@ var __assign = (this && this.__assign) || function () {

}
// 兼容性问题
// focusSinkRef.current!.focus();
focusSinkRef.current.focus({
preventScroll: true
});
});

@@ -159,0 +160,0 @@ useEffect(function () {

67

lib/utils/columnUtils.js

@@ -13,2 +13,19 @@ var __assign = (this && this.__assign) || function () {

import { ToggleGroupFormatter } from '../formatters';
import { SELECT_COLUMN_KEY } from '../Columns';
// 修复sort的兼容性问题
function sort(array, compare) {
for (var i = 1; i < array.length; i += 1) {
var currentIndex = i;
while (currentIndex > 0) {
var nextIndex = currentIndex - 1;
var position = compare(array[currentIndex], array[nextIndex]);
if (position < 0) {
var swap = array[nextIndex];
array[nextIndex] = array[currentIndex];
array[currentIndex] = swap;
}
currentIndex = nextIndex;
}
}
}
export function getColumnMetrics(metrics) {

@@ -41,24 +58,30 @@ var left = 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;
// });
sort(columns, 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;
});
var unallocatedWidth = metrics.viewportWidth - allocatedWidths;

@@ -65,0 +88,0 @@ var unallocatedColumnWidth = Math.max(Math.floor(unallocatedWidth / unassignedColumnsCount), metrics.minColumnWidth);

{
"name": "react-data-grid-temp",
"version": "7.0.0-canary.22.0",
"version": "7.0.0-canary.22.1",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc