@tap-payments/os-micro-frontend-shared 0.0.290-test.7 → 0.0.290-test.9
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.
|
@@ -17,6 +17,7 @@ import { TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN } from '../../../constants/index.
|
|
|
17
17
|
import { useDelayToSetValue } from '../../../hooks/index.js';
|
|
18
18
|
import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../../utils/index.js';
|
|
19
19
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
20
|
+
import TableNoData from '../components/TableNoData';
|
|
20
21
|
import { SheetViewTableNoData } from './components';
|
|
21
22
|
import ListItemWrapper from '../components/virtualScroll/ListItemWrapper';
|
|
22
23
|
import { StyledBox, StyledTableBox, StyledVirtualList, TableContainer, TableWrapper } from '../style';
|
|
@@ -185,7 +186,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
185
186
|
height: 'auto',
|
|
186
187
|
display: 'flex',
|
|
187
188
|
flexDirection: 'column',
|
|
188
|
-
} }, { children: _jsx(SheetViewTableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns:
|
|
189
|
+
} }, { children: _jsx(SheetViewTableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps }) })) }))] })) }))) : (_jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView }, { children: _jsxs(TableWrapper, Object.assign({ isSheetView: true, "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: tableBodyStyles }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_LoadingTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: orderedColumns, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [], onColumnPin: handleColumnPin, isPinnable: false, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick }) })), _jsx(TableNoData, { error: error, tableEmpty: tableEmpty, isTimeoutError: hasTimeoutError, tableError: tableError, tableLoading: tableLoading, orderedColumns: orderedColumns, triggerDataRefetch: triggerDataRefetch, footerProps: footerProps })] })) })))) : (_jsxs(SheetViewVirtualTableWrapper, { children: [renderPinnedColumn('start', pinnedStartColumnsData, pinnedStartColumnsWidth, pinnedStartColumns), _jsx(MainTableWrapper, Object.assign({ hasPinnedStart: pinnedStartColumnsData.length > 0, hasPinnedEnd: pinnedEndColumnsData.length > 0 }, { children: _jsx(StyledTableBox, Object.assign({ as: "main", id: "sheet-table-box-container", "aria-labelledby": "sheet-table-box-container", "data-testid": "SheetViewVirtualTable_StyledTableBox", "data-title": tableTitle, "data-direction": theme.direction, "data-are-all-rows-loaded": !!areAllRowsLoaded, "data-is-fetching-next-page": !!isFetchingNextPage, "data-scroll-to-index": scrollToIndex, "data-is-loading": !!isLoading, "data-is-error": !!isError, "data-is-error-timeout": !!hasTimeoutError, "data-show-background-color": !!showBackgroundColor, "data-table-mode": tableMode, height: "100%", dir: theme.direction, showBackgroundColor: showBackgroundColor, showNoDataView: showNoDataView, scrollable: true }, { children: _jsxs(TableWrapper, Object.assign({ "data-testid": "SheetViewVirtualTable_TableWrapper", showNoDataView: showNoDataView, sx: Object.assign(Object.assign({}, tableBodyStyles), { display: 'flex', flexDirection: 'column', height: '100%' }) }, { children: [showHeader && (_jsx(UnpinnedTableHeaderWrapper, { children: _jsx(SheetViewTableHeader, { "data-testid": "SheetViewVirtualTable_UnpinnedTableHeader", columnsSorting: columnsSorting, onColumnSort: onColumnSort, columns: unpinnedColumnsData, headerProps: headerProps, showBackDrop: showBackDrop, pinnedColumns: [...pinnedStartColumns, ...pinnedEndColumns], onColumnPin: handleColumnPin, isPinnable: isPinnable, lastColumnId: lastColumnId, selectedColumn: selectedColumn, onColumnClick: handleColumnClick }) })), _jsx(TableWrapper, Object.assign({ "data-testid": "VirtualTable_TableWrapper", sx: {
|
|
189
190
|
width: '100%',
|
|
190
191
|
minWidth: 'fit-content',
|
|
191
192
|
} }, { children: _jsx(StyledBox, Object.assign({ "data-testid": "SheetViewVirtualTable_ScrollableStyledBox", hidePadding: true, className: "list-wrapper" }, { children: createVirtualTableContainer(unpinnedColumnsData, 'scrollable', false) })) }))] })) })) })), renderPinnedColumn('end', pinnedEndColumnsData, pinnedEndColumnsWidth, [...pinnedStartColumns, ...pinnedEndColumns])] })) }), _jsx(TableFooter, Object.assign({ "data-testid": "SheetViewVirtualTable_TableFooter", showSeparator: true, showBackDrop: showBackDrop, onPointerDown: onPointerDown }, footerProps))] }));
|
|
@@ -9,17 +9,8 @@ interface SheetViewTableNoDataProps {
|
|
|
9
9
|
orderedColumns: IColumnProps[];
|
|
10
10
|
triggerDataRefetch: () => Promise<unknown>;
|
|
11
11
|
footerProps: IVirtualTable['footerProps'];
|
|
12
|
-
showHeader?: boolean;
|
|
13
|
-
headerProps?: IVirtualTable['headerProps'];
|
|
14
|
-
columnsSorting?: IVirtualTable['columnsSorting'];
|
|
15
|
-
onColumnSort?: IVirtualTable['onColumnSort'];
|
|
16
|
-
onColumnPin?: (columnId: string, position: 'start' | 'end' | 'unpin') => void;
|
|
17
|
-
isPinnable?: boolean;
|
|
18
|
-
lastColumnId?: string | null;
|
|
19
|
-
selectedColumn?: string | null;
|
|
20
|
-
onColumnClick?: (columnId: string, event: React.MouseEvent) => void;
|
|
21
12
|
}
|
|
22
|
-
declare function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps,
|
|
13
|
+
declare function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }: SheetViewTableNoDataProps): JSX.Element;
|
|
23
14
|
declare namespace SheetViewTableNoData {
|
|
24
15
|
var displayName: string;
|
|
25
16
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { backendErrorHandler } from '../../../../utils/index.js';
|
|
4
4
|
import EmptyList from '../../components/EmptyList/EmptyList';
|
|
5
5
|
import ErrorList from '../../components/ErrorList/ErrorList';
|
|
6
6
|
import SheetViewTableLoading from './SheetViewTableLoading';
|
|
7
|
-
import SheetViewTableHeader from './SheetViewTableHeader';
|
|
8
7
|
import { StyledSolidBackground } from '../../style';
|
|
9
|
-
|
|
10
|
-
function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, showHeader = true, headerProps, columnsSorting, onColumnSort, onColumnPin, isPinnable = false, lastColumnId, selectedColumn, onColumnClick, }) {
|
|
8
|
+
function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, tableLoading, orderedColumns, triggerDataRefetch, footerProps, }) {
|
|
11
9
|
let content;
|
|
12
10
|
if (tableLoading) {
|
|
13
11
|
content = (_jsx(StyledSolidBackground, Object.assign({ "data-testid": "SheetViewVirtualTable_SolidBackground" }, { children: _jsx(SheetViewTableLoading, { "data-testid": "SheetViewVirtualTable_TableLoading", columns: orderedColumns, isLoading: true }) })));
|
|
@@ -28,7 +26,7 @@ function SheetViewTableNoData({ error, tableEmpty, isTimeoutError, tableError, t
|
|
|
28
26
|
else {
|
|
29
27
|
content = (_jsx(ErrorList, { "data-testid": "SheetViewVirtualTable_ErrorList_tableError", heading: "somethingWentWrong", message: "connectionErrorMsg", triggerDataRefetch: triggerDataRefetch, sandboxMode: footerProps === null || footerProps === void 0 ? void 0 : footerProps.sandboxMode }));
|
|
30
28
|
}
|
|
31
|
-
return
|
|
29
|
+
return content;
|
|
32
30
|
}
|
|
33
31
|
SheetViewTableNoData.displayName = 'SheetViewTableNoData';
|
|
34
32
|
export default memo(SheetViewTableNoData);
|
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.290-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.290-test.9",
|
|
5
|
+
"testVersion": 9,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|