@stenajs-webui/grid 15.5.0 → 15.5.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v15.5.2 (Fri Apr 08 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Fix event propagation bug in onKeyDown in StandardTable [#450](https://github.com/StenaIT/stenajs-webui/pull/450) ([@mattias800](https://github.com/mattias800))
6
+
7
+ #### Authors: 1
8
+
9
+ - Mattias Andersson ([@mattias800](https://github.com/mattias800))
10
+
11
+ ---
12
+
13
+ # v15.5.1 (Thu Apr 07 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Pass itemKey to renderProps in StandardTable [#449](https://github.com/StenaIT/stenajs-webui/pull/449) ([@mattias800](https://github.com/mattias800))
18
+
19
+ #### Authors: 1
20
+
21
+ - Mattias Andersson ([@mattias800](https://github.com/mattias800))
22
+
23
+ ---
24
+
1
25
  # v15.4.0 (Mon Apr 04 2022)
2
26
 
3
27
  #### 🚀 Enhancement
@@ -138,6 +138,7 @@ export interface StandardTableCellRendererArgObject<TItemValue, TItem> {
138
138
  label: string;
139
139
  value: TItemValue;
140
140
  item: TItem;
141
+ itemKey: string;
141
142
  gridCell: UseGridCellResult<string>;
142
143
  isEditable?: boolean;
143
144
  isSelected: boolean;
package/dist/index.es.js CHANGED
@@ -1518,10 +1518,10 @@ var StandardTableCell = React.memo(function StandardTableCell(_a) {
1518
1518
  var onKeyDownTable = useOnKeyDownContext();
1519
1519
  var numNavigableColumns = useColumnIndexPerColumnIdContext().numNavigableColumns;
1520
1520
  var stickyPropsPerColumnContext = useStickyPropsPerColumnContext();
1521
+ var itemKey = useMemo(function () { return keyResolver(item); }, [item, keyResolver]);
1521
1522
  var isSelected = useMemo(function () {
1522
- var itemId = keyResolver(item);
1523
- return selectedIds.indexOf(itemId) >= 0;
1524
- }, [item, keyResolver, selectedIds]);
1523
+ return selectedIds.indexOf(itemKey) >= 0;
1524
+ }, [itemKey, selectedIds]);
1525
1525
  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;
1526
1526
  var itemValue = useMemo(function () {
1527
1527
  if (itemValueResolver) {
@@ -1543,12 +1543,8 @@ var StandardTableCell = React.memo(function StandardTableCell(_a) {
1543
1543
  ? isEditable(item)
1544
1544
  : undefined;
1545
1545
  var onKeyDownHandler = useCallback(function (ev) {
1546
- onKeyDownTable === null || onKeyDownTable === void 0 ? void 0 : onKeyDownTable(ev, { columnId: columnId, item: item });
1547
1546
  onKeyDownCell === null || onKeyDownCell === void 0 ? void 0 : onKeyDownCell(ev, { columnId: columnId, item: item });
1548
- if (ev.key !== "Tab" && (onKeyDownTable || onKeyDownCell)) {
1549
- ev.preventDefault();
1550
- ev.stopPropagation();
1551
- }
1547
+ onKeyDownTable === null || onKeyDownTable === void 0 ? void 0 : onKeyDownTable(ev, { columnId: columnId, item: item });
1552
1548
  }, [onKeyDownTable, columnId, item, onKeyDownCell]);
1553
1549
  var gridCell = useGridCell(label, __assign(__assign({ colIndex: colIndex, rowIndex: rowIndex, numRows: numRows, numCols: numNavigableColumns, tableId: tableId, isEditable: editable, onChange: onChange
1554
1550
  ? function (value) { return onChange(item, value); }
@@ -1567,6 +1563,7 @@ var StandardTableCell = React.memo(function StandardTableCell(_a) {
1567
1563
  isEditable: editable,
1568
1564
  isSelected: isSelected,
1569
1565
  zIndex: currentZIndex,
1566
+ itemKey: itemKey,
1570
1567
  })) : (React.createElement(TextCell, { label: label }));
1571
1568
  }, [
1572
1569
  renderCell,
@@ -1577,6 +1574,7 @@ var StandardTableCell = React.memo(function StandardTableCell(_a) {
1577
1574
  editable,
1578
1575
  isSelected,
1579
1576
  currentZIndex,
1577
+ itemKey,
1580
1578
  ]);
1581
1579
  var activeBorderLeft = getCellBorder(borderFromGroup, disableBorderLeft, borderLeft);
1582
1580
  var shadow = stickyProps.sticky &&