@trudb/tru-common-lib 0.2.255 → 0.2.257
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.
|
@@ -3456,7 +3456,7 @@ const INSERT_ICON = `
|
|
|
3456
3456
|
<svg height="20px" viewBox="0 -960 960 960" width="20px" fill="#e3e3e3"><path d="M216-192h528v-228H216v228Zm600 72H144v-672h144V-719.51h-72V-492h528v-228h-72v-72h144v672ZM480-492Zm0 72v-72 72Zm0 0Zm-36-216v-84h-84v-72h84v-84h72v84h84v72h-84v84h-72Z"/></svg>
|
|
3457
3457
|
`;
|
|
3458
3458
|
const READONLY_ICON = `
|
|
3459
|
-
<svg height="12px" viewBox="0 -960 960 960" width="12px" fill="#
|
|
3459
|
+
<svg height="12px" viewBox="0 -960 960 960" width="12px" fill="#000" style="height: 12px; width: 12px;"><path d="M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"/></svg>
|
|
3460
3460
|
`;
|
|
3461
3461
|
class TruIconModule {
|
|
3462
3462
|
constructor(sanitizer, iconRegistry) {
|
|
@@ -7909,12 +7909,15 @@ class TruDataGrid {
|
|
|
7909
7909
|
let isArrowLeft = params.event.code === 'ArrowLeft';
|
|
7910
7910
|
let isArrowRight = params.event.code === 'ArrowRight';
|
|
7911
7911
|
let isSpace = params.event.code === 'Space';
|
|
7912
|
+
let isDelete = params.event.code === 'Delete';
|
|
7912
7913
|
let isShiftKey = params.event.shiftKey;
|
|
7913
7914
|
let isAltKey = params.event.altKey;
|
|
7914
7915
|
let focusedCell = params.api.getFocusedCell();
|
|
7915
7916
|
let hasChoices = params.data[params.column.getColId()] && params.data[params.column.getColId()].choices ? true : false;
|
|
7916
7917
|
if (isSpace)
|
|
7917
7918
|
return true;
|
|
7919
|
+
if (isDelete)
|
|
7920
|
+
return true;
|
|
7918
7921
|
if (params.column.isPinned()) {
|
|
7919
7922
|
if (isTabKey && !isShiftKey)
|
|
7920
7923
|
params.api.tabToNextCell();
|
|
@@ -8111,6 +8114,15 @@ class TruDataGrid {
|
|
|
8111
8114
|
key: event.code
|
|
8112
8115
|
});
|
|
8113
8116
|
}
|
|
8117
|
+
else if (event.code === 'Delete' && !editingCells.length) {
|
|
8118
|
+
event.preventDefault();
|
|
8119
|
+
event.stopPropagation();
|
|
8120
|
+
this.api?.startEditingCell({
|
|
8121
|
+
rowIndex: params.rowIndex,
|
|
8122
|
+
colKey: params.column.getColId(),
|
|
8123
|
+
key: event.code
|
|
8124
|
+
});
|
|
8125
|
+
}
|
|
8114
8126
|
else if (params.column.isPinned() && event.ctrlKey && event.code === 'KeyC') {
|
|
8115
8127
|
let selectedRows = this.api.getSelectedRows();
|
|
8116
8128
|
let columnDefs = this.api.getColumnDefs();
|