@tap-payments/os-micro-frontend-shared 0.0.217-test.5 → 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.
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +4 -0
- package/build/components/TableCells/CustomCells/StatusCell/constant.js +4 -0
- package/build/components/VirtualTable/SheetView/SheetViewVirtualTable.js +6 -0
- package/build/components/VirtualTable/SheetView/hooks/usePinnedColumns.js +9 -1
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +1 -6
- package/build/constants/table/cell/chargeTableCellWidth.js +1 -6
- package/build/utils/columns.d.ts +2 -0
- package/build/utils/columns.js +1 -1
- package/package.json +2 -2
|
@@ -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
|
-
|
|
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)
|
|
@@ -159,14 +159,9 @@ export declare const chargeTableCellWidth: {
|
|
|
159
159
|
readonly text: "52px";
|
|
160
160
|
readonly sheet: "52px";
|
|
161
161
|
};
|
|
162
|
-
readonly
|
|
162
|
+
readonly action_icon: {
|
|
163
163
|
readonly default: "30px";
|
|
164
164
|
readonly text: "30px";
|
|
165
165
|
readonly sheet: "30px";
|
|
166
166
|
};
|
|
167
|
-
readonly actionIconSheet: {
|
|
168
|
-
readonly default: "100px";
|
|
169
|
-
readonly text: "100px";
|
|
170
|
-
readonly sheet: "300px";
|
|
171
|
-
};
|
|
172
167
|
};
|
|
@@ -159,14 +159,9 @@ export const chargeTableCellWidth = {
|
|
|
159
159
|
text: '52px',
|
|
160
160
|
sheet: '52px',
|
|
161
161
|
},
|
|
162
|
-
|
|
162
|
+
action_icon: {
|
|
163
163
|
default: '30px',
|
|
164
164
|
text: '30px',
|
|
165
165
|
sheet: '30px',
|
|
166
166
|
},
|
|
167
|
-
actionIconSheet: {
|
|
168
|
-
default: '100px',
|
|
169
|
-
text: '100px',
|
|
170
|
-
sheet: '300px',
|
|
171
|
-
},
|
|
172
167
|
};
|
package/build/utils/columns.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { IColumnProps, ColumnViewProps, ColumnsView } from '../types/index.js';
|
|
2
2
|
export declare function filterShownColumns<T>(columns: Array<IColumnProps<T & {
|
|
3
3
|
actions: string;
|
|
4
|
+
action_icon: string;
|
|
4
5
|
}>>, tableViews: ColumnViewProps[]): IColumnProps<T & {
|
|
5
6
|
actions: string;
|
|
7
|
+
action_icon: string;
|
|
6
8
|
}>[];
|
|
7
9
|
export declare function isParameterSelected(columns: ColumnViewProps[], columnId: string, parameter: string): boolean;
|
|
8
10
|
export declare function mapDataToViews(columnData?: ColumnsView[], language?: string): ColumnViewProps[];
|
package/build/utils/columns.js
CHANGED
|
@@ -7,7 +7,7 @@ export function filterShownColumns(columns, tableViews) {
|
|
|
7
7
|
const isColumnWithMenuItems = !!column.tableViewId && (((_a = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.menuItems) === null || _a === void 0 ? void 0 : _a.length) || 0) > 1;
|
|
8
8
|
const isMenuItemSelected = (_c = (_b = selectedColumn === null || selectedColumn === void 0 ? void 0 : selectedColumn.menuItems) === null || _b === void 0 ? void 0 : _b.find((item) => item.name === column.tableViewId)) === null || _c === void 0 ? void 0 : _c.selected;
|
|
9
9
|
const isColumnSelected = !!selectedColumn && (isMenuItemSelected || !isColumnWithMenuItems);
|
|
10
|
-
const isBasicColumn = ['actions', '
|
|
10
|
+
const isBasicColumn = ['actions', 'action_icon'].includes((_e = (_d = column.id) === null || _d === void 0 ? void 0 : _d.toString()) === null || _e === void 0 ? void 0 : _e.toLowerCase());
|
|
11
11
|
if (isColumnSelected || isBasicColumn) {
|
|
12
12
|
return true;
|
|
13
13
|
}
|
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.
|
|
5
|
-
"testVersion":
|
|
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",
|