@xcelsior/ui-spreadsheets 1.3.0 → 1.3.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/.omc/state/agent-replay-0cead415-b3bd-40fd-b199-47371946c4db.jsonl +2 -0
- package/.omc/state/idle-notif-cooldown.json +1 -1
- package/.omc/state/mission-state.json +31 -21
- package/.omc/state/subagent-tracking.json +12 -3
- package/dist/index.js +86 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Spreadsheet.tsx +68 -16
- package/src/components/SpreadsheetCell.tsx +9 -4
- package/src/hooks/useSpreadsheetFiltering.ts +6 -1
- package/src/hooks/useSpreadsheetKeyboardShortcuts.ts +9 -0
- package/src/hooks/useSpreadsheetSummary.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -439,9 +439,10 @@ var SpreadsheetCell = ({
|
|
|
439
439
|
return typeof value === "number" ? value.toLocaleString() : value;
|
|
440
440
|
}
|
|
441
441
|
if (column.type === "autocomplete") {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
const displayVal = localValue ?? value;
|
|
443
|
+
if (column.getOptionLabel) return column.getOptionLabel(displayVal, row);
|
|
444
|
+
const match = column.autocompleteOptions?.find((o) => o.value === displayVal);
|
|
445
|
+
return match ? match.label : displayVal != null && displayVal !== "" ? String(displayVal) : null;
|
|
445
446
|
}
|
|
446
447
|
return String(value);
|
|
447
448
|
};
|
|
@@ -456,7 +457,10 @@ var SpreadsheetCell = ({
|
|
|
456
457
|
value: localValue,
|
|
457
458
|
column,
|
|
458
459
|
compactMode,
|
|
459
|
-
onConfirm
|
|
460
|
+
onConfirm: (newVal) => {
|
|
461
|
+
setLocalValue(newVal);
|
|
462
|
+
onConfirm?.(newVal);
|
|
463
|
+
},
|
|
460
464
|
onCancel
|
|
461
465
|
}
|
|
462
466
|
);
|
|
@@ -3196,7 +3200,8 @@ function useSpreadsheetFiltering({
|
|
|
3196
3200
|
return false;
|
|
3197
3201
|
}
|
|
3198
3202
|
if (filter.textCondition) {
|
|
3199
|
-
|
|
3203
|
+
const filterableValue = column.type === "autocomplete" && column.getOptionLabel ? column.getOptionLabel(value, row) : value;
|
|
3204
|
+
return applyTextCondition(filterableValue, filter.textCondition);
|
|
3200
3205
|
}
|
|
3201
3206
|
if (filter.numberCondition) {
|
|
3202
3207
|
return applyNumberCondition(value, filter.numberCondition);
|
|
@@ -3810,6 +3815,11 @@ function useSpreadsheetKeyboardShortcuts({
|
|
|
3810
3815
|
useEffect7(() => {
|
|
3811
3816
|
if (!enabled) return;
|
|
3812
3817
|
const handleKeyDown = (event) => {
|
|
3818
|
+
const activeEl = document.activeElement;
|
|
3819
|
+
const isInFormElement = activeEl instanceof HTMLInputElement || activeEl instanceof HTMLTextAreaElement || activeEl instanceof HTMLSelectElement;
|
|
3820
|
+
if (isInFormElement && event.key !== "Escape") {
|
|
3821
|
+
return;
|
|
3822
|
+
}
|
|
3813
3823
|
if (event.key === "Escape") {
|
|
3814
3824
|
if (showKeyboardShortcuts) {
|
|
3815
3825
|
setShowKeyboardShortcuts(false);
|
|
@@ -4385,7 +4395,7 @@ function useSpreadsheetSummary({
|
|
|
4385
4395
|
const numericValues = [];
|
|
4386
4396
|
for (const { position, value } of selectedCellValues) {
|
|
4387
4397
|
const column = columns.find((c) => c.id === position.columnId);
|
|
4388
|
-
if (column?.type === "number"
|
|
4398
|
+
if (column?.type === "number") {
|
|
4389
4399
|
const num = typeof value === "number" ? value : parseFloat(value);
|
|
4390
4400
|
if (!isNaN(num)) {
|
|
4391
4401
|
numericValues.push(num);
|
|
@@ -4735,7 +4745,7 @@ function Spreadsheet({
|
|
|
4735
4745
|
onToggleCommentResolved
|
|
4736
4746
|
});
|
|
4737
4747
|
const [showSettingsModal, setShowSettingsModal] = useState16(false);
|
|
4738
|
-
const [showFiltersPanel, setShowFiltersPanel] = useState16(
|
|
4748
|
+
const [showFiltersPanel, setShowFiltersPanel] = useState16(true);
|
|
4739
4749
|
const {
|
|
4740
4750
|
canUndo,
|
|
4741
4751
|
canRedo,
|
|
@@ -4875,7 +4885,7 @@ function Spreadsheet({
|
|
|
4875
4885
|
}, [popRedoEntry, onCellsEdit, markAsChanged]);
|
|
4876
4886
|
const paginatedData = useMemo7(() => {
|
|
4877
4887
|
if (serverSide) {
|
|
4878
|
-
return filteredData;
|
|
4888
|
+
return filteredData.toArray();
|
|
4879
4889
|
}
|
|
4880
4890
|
const startIndex = (currentPage - 1) * pageSize;
|
|
4881
4891
|
return filteredData.slice(startIndex, startIndex + pageSize);
|
|
@@ -5088,8 +5098,14 @@ function Spreadsheet({
|
|
|
5088
5098
|
(rowId, columnId, event) => {
|
|
5089
5099
|
event.stopPropagation();
|
|
5090
5100
|
handleCellMouseDown(rowId, columnId, event);
|
|
5101
|
+
if (!event.shiftKey && !event.metaKey && !event.ctrlKey) {
|
|
5102
|
+
const column = columns.find((c) => c.id === columnId);
|
|
5103
|
+
if (column?.editable && enableCellEditing) {
|
|
5104
|
+
setEditingCell({ rowId, columnId });
|
|
5105
|
+
}
|
|
5106
|
+
}
|
|
5091
5107
|
},
|
|
5092
|
-
[handleCellMouseDown]
|
|
5108
|
+
[handleCellMouseDown, columns, enableCellEditing, setEditingCell]
|
|
5093
5109
|
);
|
|
5094
5110
|
const handleCellDoubleClick = useCallback11(
|
|
5095
5111
|
(rowId, columnId) => {
|
|
@@ -5355,17 +5371,67 @@ function Spreadsheet({
|
|
|
5355
5371
|
})
|
|
5356
5372
|
] })
|
|
5357
5373
|
] }),
|
|
5358
|
-
/* @__PURE__ */ jsx14("tbody", { children: isLoading ? /* @__PURE__ */
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5374
|
+
/* @__PURE__ */ jsx14("tbody", { children: isLoading ? Array.from({ length: Math.min(pageSize, 10) }).map((_, rowIdx) => /* @__PURE__ */ jsxs14("tr", { children: [
|
|
5375
|
+
/* @__PURE__ */ jsx14(
|
|
5376
|
+
"td",
|
|
5377
|
+
{
|
|
5378
|
+
className: cn(
|
|
5379
|
+
"border border-gray-200 sticky",
|
|
5380
|
+
effectiveCompactMode ? "px-1.5 py-0.5" : "px-2.5 py-1.5"
|
|
5381
|
+
),
|
|
5382
|
+
style: {
|
|
5383
|
+
minWidth: `${ROW_INDEX_COLUMN_WIDTH}px`,
|
|
5384
|
+
width: `${ROW_INDEX_COLUMN_WIDTH}px`,
|
|
5385
|
+
left: 0,
|
|
5386
|
+
zIndex: 40,
|
|
5387
|
+
backgroundColor: rowIdx % 2 !== 0 ? "#f9fafb" : "white"
|
|
5388
|
+
},
|
|
5389
|
+
children: /* @__PURE__ */ jsx14(
|
|
5390
|
+
"div",
|
|
5391
|
+
{
|
|
5392
|
+
className: "h-4 bg-gray-200 rounded animate-pulse",
|
|
5393
|
+
style: { width: "60%", animationDelay: `${rowIdx * 50}ms` }
|
|
5394
|
+
}
|
|
5395
|
+
)
|
|
5396
|
+
}
|
|
5397
|
+
),
|
|
5398
|
+
columnRenderItems.map((item, colIdx) => {
|
|
5399
|
+
if (item.type === "collapsed-placeholder") {
|
|
5400
|
+
return /* @__PURE__ */ jsx14(
|
|
5401
|
+
"td",
|
|
5402
|
+
{
|
|
5403
|
+
className: "border border-gray-200",
|
|
5404
|
+
style: { backgroundColor: rowIdx % 2 !== 0 ? "#f9fafb" : "white" }
|
|
5405
|
+
},
|
|
5406
|
+
`skeleton-${rowIdx}-placeholder-${item.groupId}`
|
|
5407
|
+
);
|
|
5408
|
+
}
|
|
5409
|
+
return /* @__PURE__ */ jsx14(
|
|
5410
|
+
"td",
|
|
5411
|
+
{
|
|
5412
|
+
className: cn(
|
|
5413
|
+
"border border-gray-200",
|
|
5414
|
+
effectiveCompactMode ? "px-1.5 py-0.5" : "px-2.5 py-1.5"
|
|
5415
|
+
),
|
|
5416
|
+
style: {
|
|
5417
|
+
minWidth: item.column.width ?? 120,
|
|
5418
|
+
backgroundColor: rowIdx % 2 !== 0 ? "#f9fafb" : "white"
|
|
5419
|
+
},
|
|
5420
|
+
children: /* @__PURE__ */ jsx14(
|
|
5421
|
+
"div",
|
|
5422
|
+
{
|
|
5423
|
+
className: "h-4 bg-gray-200 rounded animate-pulse",
|
|
5424
|
+
style: {
|
|
5425
|
+
width: `${55 + (rowIdx * 7 + colIdx * 13) % 35}%`,
|
|
5426
|
+
animationDelay: `${(rowIdx * columnRenderItems.length + colIdx) * 30}ms`
|
|
5427
|
+
}
|
|
5428
|
+
}
|
|
5429
|
+
)
|
|
5430
|
+
},
|
|
5431
|
+
`skeleton-${rowIdx}-${item.column.id}`
|
|
5432
|
+
);
|
|
5433
|
+
})
|
|
5434
|
+
] }, `skeleton-${rowIdx}`)) : paginatedData.length === 0 ? /* @__PURE__ */ jsx14("tr", { children: /* @__PURE__ */ jsx14(
|
|
5369
5435
|
"td",
|
|
5370
5436
|
{
|
|
5371
5437
|
colSpan: columnRenderItems.length + 1,
|