@tap-payments/os-micro-frontend-shared 0.0.217-test.6 → 0.0.217-test.7

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.
@@ -14,6 +14,10 @@ export declare const statusIcons: {
14
14
  AUTHORIZED: string;
15
15
  };
16
16
  export declare const sheetViewChipStyles: {
17
+ CAPTURED: {
18
+ color: string;
19
+ background: string;
20
+ };
17
21
  ABANDONED: {
18
22
  color: string;
19
23
  background: string;
@@ -14,6 +14,10 @@ export const statusIcons = {
14
14
  AUTHORIZED: authorizedIcon,
15
15
  };
16
16
  export const sheetViewChipStyles = {
17
+ CAPTURED: {
18
+ color: '#1F88D0',
19
+ background: '#1F88D01A',
20
+ },
17
21
  ABANDONED: {
18
22
  color: '#FFD600',
19
23
  background: 'transparent',
@@ -52,12 +52,18 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
52
52
  const [selectedColumn, setSelectedColumn] = useState(null);
53
53
  const handleCellClick = useCallback((rowIndex, columnId, event) => {
54
54
  event.stopPropagation();
55
+ if (event.target !== event.currentTarget) {
56
+ return;
57
+ }
55
58
  const cellKey = `${rowIndex}-${columnId}`;
56
59
  setSelectedCell((prev) => (prev === cellKey ? null : cellKey));
57
60
  setSelectedColumn(null);
58
61
  }, []);
59
62
  const handleColumnClick = useCallback((columnId, event) => {
60
63
  event.stopPropagation();
64
+ if (event.target !== event.currentTarget) {
65
+ return;
66
+ }
61
67
  setSelectedColumn((prev) => (prev === columnId ? null : columnId));
62
68
  setSelectedCell(null);
63
69
  }, []);
@@ -6,7 +6,15 @@ export const usePinnedColumns = (columns, isPinnable, onColumnPin) => {
6
6
  return Array.from(new Set([...defaultPinned, ...userPinned]));
7
7
  });
8
8
  const [pinnedEndColumns, setPinnedEndColumns] = useState(() => {
9
- return isPinnable ? columns.filter((c) => c.pinned === 'end').map((c) => c.id) : [];
9
+ if (!isPinnable)
10
+ return [];
11
+ const userPinned = columns.filter((c) => c.pinned === 'end').map((c) => c.id);
12
+ const visibleColumns = columns.filter((column) => !column.hidden);
13
+ const lastColumn = visibleColumns[visibleColumns.length - 1];
14
+ if (userPinned.length === 0 && lastColumn && !lastColumn.pinned && !lastColumn.isDefaultPinned) {
15
+ return [lastColumn.id];
16
+ }
17
+ return userPinned;
10
18
  });
11
19
  const handleColumnPin = useCallback((columnId, position = 'start') => {
12
20
  if (!isPinnable)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.0.217-test.6",
5
- "testVersion": 6,
4
+ "version": "0.0.217-test.7",
5
+ "testVersion": 7,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",