@stenajs-webui/grid 15.4.1 → 15.5.2
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.
package/dist/index.js
CHANGED
|
@@ -1545,10 +1545,10 @@ var StandardTableCell = React__namespace.memo(function StandardTableCell(_a) {
|
|
|
1545
1545
|
var onKeyDownTable = useOnKeyDownContext();
|
|
1546
1546
|
var numNavigableColumns = useColumnIndexPerColumnIdContext().numNavigableColumns;
|
|
1547
1547
|
var stickyPropsPerColumnContext = useStickyPropsPerColumnContext();
|
|
1548
|
+
var itemKey = React.useMemo(function () { return keyResolver(item); }, [item, keyResolver]);
|
|
1548
1549
|
var isSelected = React.useMemo(function () {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
}, [item, keyResolver, selectedIds]);
|
|
1550
|
+
return selectedIds.indexOf(itemKey) >= 0;
|
|
1551
|
+
}, [itemKey, selectedIds]);
|
|
1552
1552
|
var _d = useColumnConfigById(columnId), itemValueResolver = _d.itemValueResolver, itemLabelFormatter = _d.itemLabelFormatter, width = _d.width, minWidth = _d.minWidth, _e = _d.justifyContentCell, justifyContentCell = _e === void 0 ? "flex-start" : _e, borderLeft = _d.borderLeft, renderCell = _d.renderCell, gridCellOptionsForColumn = _d.gridCellOptions, isEditable = _d.isEditable, onChange = _d.onChange, onKeyDownCell = _d.onKeyDown, disableGridCell = _d.disableGridCell, disableGridCellFocus = _d.disableGridCellFocus, zIndex = _d.zIndex;
|
|
1553
1553
|
var itemValue = React.useMemo(function () {
|
|
1554
1554
|
if (itemValueResolver) {
|
|
@@ -1570,12 +1570,8 @@ var StandardTableCell = React__namespace.memo(function StandardTableCell(_a) {
|
|
|
1570
1570
|
? isEditable(item)
|
|
1571
1571
|
: undefined;
|
|
1572
1572
|
var onKeyDownHandler = React.useCallback(function (ev) {
|
|
1573
|
-
onKeyDownTable === null || onKeyDownTable === void 0 ? void 0 : onKeyDownTable(ev, { columnId: columnId, item: item });
|
|
1574
1573
|
onKeyDownCell === null || onKeyDownCell === void 0 ? void 0 : onKeyDownCell(ev, { columnId: columnId, item: item });
|
|
1575
|
-
|
|
1576
|
-
ev.preventDefault();
|
|
1577
|
-
ev.stopPropagation();
|
|
1578
|
-
}
|
|
1574
|
+
onKeyDownTable === null || onKeyDownTable === void 0 ? void 0 : onKeyDownTable(ev, { columnId: columnId, item: item });
|
|
1579
1575
|
}, [onKeyDownTable, columnId, item, onKeyDownCell]);
|
|
1580
1576
|
var gridCell = useGridCell(label, __assign(__assign({ colIndex: colIndex, rowIndex: rowIndex, numRows: numRows, numCols: numNavigableColumns, tableId: tableId, isEditable: editable, onChange: onChange
|
|
1581
1577
|
? function (value) { return onChange(item, value); }
|
|
@@ -1594,6 +1590,7 @@ var StandardTableCell = React__namespace.memo(function StandardTableCell(_a) {
|
|
|
1594
1590
|
isEditable: editable,
|
|
1595
1591
|
isSelected: isSelected,
|
|
1596
1592
|
zIndex: currentZIndex,
|
|
1593
|
+
itemKey: itemKey,
|
|
1597
1594
|
})) : (React__namespace.createElement(TextCell, { label: label }));
|
|
1598
1595
|
}, [
|
|
1599
1596
|
renderCell,
|
|
@@ -1604,6 +1601,7 @@ var StandardTableCell = React__namespace.memo(function StandardTableCell(_a) {
|
|
|
1604
1601
|
editable,
|
|
1605
1602
|
isSelected,
|
|
1606
1603
|
currentZIndex,
|
|
1604
|
+
itemKey,
|
|
1607
1605
|
]);
|
|
1608
1606
|
var activeBorderLeft = getCellBorder(borderFromGroup, disableBorderLeft, borderLeft);
|
|
1609
1607
|
var shadow = stickyProps.sticky &&
|