@tap-payments/os-micro-frontend-shared 0.1.130-test.6 → 0.1.130
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/TableCells/CustomCells/BankCell/BankCell.js +2 -2
- package/build/components/TableCells/CustomCells/DateCell/DateCell.js +2 -2
- package/build/components/TableCells/CustomCells/EntityCell/EntityCell.js +2 -2
- package/build/components/TableCells/CustomCells/WalletCell/WalletCell.js +3 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +2 -4
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +4 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.d.ts +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.js +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +0 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +23 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +19 -15
- package/build/components/VirtualTables/components/TableRow.js +18 -20
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapper.js +1 -1
- package/build/constants/table.d.ts +1 -1
- package/build/constants/table.js +1 -1
- package/build/utils/country.d.ts +1 -1
- package/build/utils/country.js +1 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.js +0 -1
- package/build/utils/style.d.ts +2 -2
- package/build/utils/style.js +2 -2
- package/package.json +3 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.d.ts +0 -38
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.js +0 -44
- package/build/utils/memoComparison.d.ts +0 -19
- package/build/utils/memoComparison.js +0 -24
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -14,12 +14,12 @@ import Tooltip from '../../../Tooltip';
|
|
|
14
14
|
import CountryFlag from '../../../CountryFlag';
|
|
15
15
|
import { TableCell } from '../../../TableCells';
|
|
16
16
|
import { bankIcon } from '../../../../constants/index.js';
|
|
17
|
-
import {
|
|
17
|
+
import { getCountryNameByISO } from '../../../../utils/index.js';
|
|
18
18
|
import { BankCellContainer, BankIcon, BankIdContainer, BankWrapper, IconWrapper } from './style';
|
|
19
19
|
import { GeographyBox } from '../style';
|
|
20
20
|
function BankCell(_a) {
|
|
21
21
|
var { walletId, country, name } = _a, props = __rest(_a, ["walletId", "country", "name"]);
|
|
22
|
-
const icon = country && (_jsx(Tooltip, Object.assign({ title:
|
|
22
|
+
const icon = country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { code: country, sx: { padding: '1px' } }) })));
|
|
23
23
|
return (_jsx(TableCell, Object.assign({ style: {
|
|
24
24
|
textAlign: 'center',
|
|
25
25
|
overflow: 'visible',
|
|
@@ -14,13 +14,13 @@ import { useMemo } from 'react';
|
|
|
14
14
|
import { TableCell } from '../../../TableCells';
|
|
15
15
|
import Tooltip from '../../../Tooltip';
|
|
16
16
|
import CountryFlag from '../../../CountryFlag';
|
|
17
|
-
import { formatCellDate,
|
|
17
|
+
import { formatCellDate, getCountryNameByISO } from '../../../../utils/index.js';
|
|
18
18
|
import { DateCellContainer } from './style';
|
|
19
19
|
import { GeographyBox } from '../style';
|
|
20
20
|
import { Box } from '@mui/material';
|
|
21
21
|
function DateCell(_a) {
|
|
22
22
|
var { value, format: dateFormat, flagIcon, hasFlag, tableMode } = _a, props = __rest(_a, ["value", "format", "flagIcon", "hasFlag", "tableMode"]);
|
|
23
|
-
const icon = flagIcon && (_jsx(Tooltip, Object.assign({ title:
|
|
23
|
+
const icon = flagIcon && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(flagIcon || '') }, { children: _jsx(CountryFlag, { code: flagIcon }) })));
|
|
24
24
|
const renderedValue = useMemo(() => formatCellDate(value, dateFormat), [value]);
|
|
25
25
|
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(DateCellContainer, { children: [hasFlag && (_jsx(GeographyBox, Object.assign({ sx: {
|
|
26
26
|
visibility: 'visible',
|
|
@@ -15,10 +15,10 @@ import { EntityName, EntityWrapper, VerificationIcon, VerificationContainer } fr
|
|
|
15
15
|
import { verificationIcon } from './constants';
|
|
16
16
|
import Tooltip from '../../../Tooltip';
|
|
17
17
|
import { CountryFlag } from '../../../index.js';
|
|
18
|
-
import {
|
|
18
|
+
import { getCountryNameByISO } from '../../../../utils/index.js';
|
|
19
19
|
import { Box } from '@mui/material';
|
|
20
20
|
export default function EntityCell(_a) {
|
|
21
21
|
var { entity, country, verificationStatus, licenseNumber, hideStatus } = _a, props = __rest(_a, ["entity", "country", "verificationStatus", "licenseNumber", "hideStatus"]);
|
|
22
22
|
const icon = verificationIcon[verificationStatus !== null && verificationStatus !== void 0 ? verificationStatus : 'incomplete'];
|
|
23
|
-
return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(Tooltip, Object.assign({ title:
|
|
23
|
+
return (_jsx(TableCell, Object.assign({}, props, { sx: { cursor: (props === null || props === void 0 ? void 0 : props.onClick) ? 'pointer' : 'default' } }, { children: _jsx(Tooltip, Object.assign({ title: entity }, { children: _jsx(EntityWrapper, Object.assign({ sx: { cursor: props.onClick ? 'pointer' : 'default' } }, { children: _jsxs(Box, Object.assign({ display: "flex", alignItems: "center", gap: '5px', sx: { overflow: 'hidden', width: '100%' } }, { children: [_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { code: country }) })), _jsx(EntityName, { children: licenseNumber }), !hideStatus && (_jsx(VerificationContainer, { children: _jsx(VerificationIcon, { src: icon }) }))] })) })) })) })));
|
|
24
24
|
}
|
|
@@ -14,16 +14,16 @@ import Tooltip from '../../../Tooltip';
|
|
|
14
14
|
import CountryFlag from '../../../CountryFlag';
|
|
15
15
|
import { TableCell } from '../../../TableCells';
|
|
16
16
|
import { walletIcon } from '../../../../constants/index.js';
|
|
17
|
-
import {
|
|
17
|
+
import { getCountryNameByISO } from '../../../../utils/index.js';
|
|
18
18
|
import { WalletCellContainer, WalletIcon, WalletIdContainer, WalletWrapper } from './style';
|
|
19
19
|
import { GeographyBox, StatusIconWrapper } from '../style';
|
|
20
20
|
function WalletCell(_a) {
|
|
21
21
|
var { walletId, country, showCountry = true } = _a, props = __rest(_a, ["walletId", "country", "showCountry"]);
|
|
22
|
-
const icon = country && (_jsx(Tooltip, Object.assign({ title:
|
|
22
|
+
const icon = country && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(country) }, { children: _jsx(CountryFlag, { code: country, sx: { padding: '1px' } }) })));
|
|
23
23
|
return (_jsx(TableCell, Object.assign({ style: {
|
|
24
24
|
textAlign: 'center',
|
|
25
25
|
overflow: 'visible',
|
|
26
|
-
} }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && (_jsx(StatusIconWrapper, { children: _jsx(Tooltip, Object.assign({ title: country ?
|
|
26
|
+
} }, props, { children: _jsxs(WalletCellContainer, { children: [showCountry && (_jsx(StatusIconWrapper, { children: _jsx(Tooltip, Object.assign({ title: country ? getCountryNameByISO(country) : '' }, { children: _jsx(GeographyBox, Object.assign({ sx: {
|
|
27
27
|
visibility: 'visible',
|
|
28
28
|
}, variant: undefined }, { children: icon })) })) })), _jsxs(WalletWrapper, { children: [_jsx(WalletIcon, { src: walletIcon, alt: "wallet-icon" }), walletId && _jsxs(WalletIdContainer, { children: ["\u00B7\u00B7\u00B7\u00B7 ", walletId === null || walletId === void 0 ? void 0 : walletId.substring(((walletId === null || walletId === void 0 ? void 0 : walletId.length) || 0) - 4)] })] })] }) })));
|
|
29
29
|
}
|
|
@@ -4,10 +4,9 @@ import { SHEET_VIEW_TABLE_THRESHOLD } from '../../../constants/index.js';
|
|
|
4
4
|
import TableFooter from '../components/TableFooter/TableFooter';
|
|
5
5
|
import { SheetViewTableContainer } from '../components/style';
|
|
6
6
|
import { SheetViewVirtualTableWrapper } from './style';
|
|
7
|
-
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths
|
|
7
|
+
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths } from './hooks';
|
|
8
8
|
import { PinnedColumn, MainTable, LoadingMainTable, NoDataView, VirtualTable } from './components';
|
|
9
9
|
function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THRESHOLD, showHeader, headerProps, rowProps, footerProps, rowHeight = 28, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded = false, tableBodyStyles, tableTitle, dragControls, onColumnPin, clearBackdropVisibilityTimeout = 100, isPinnable = false, tableMode, overscanCount, }) {
|
|
10
|
-
const { stableColumnsWithFilters } = usePerformanceOptimizations(columns);
|
|
11
10
|
const { selectedCell, selectedColumn, selectedRow, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick, handleChipClick, selectedChip, } = useTableState();
|
|
12
11
|
const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
|
|
13
12
|
rows,
|
|
@@ -16,7 +15,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
16
15
|
isFetchingNextPage,
|
|
17
16
|
areAllRowsLoaded,
|
|
18
17
|
});
|
|
19
|
-
const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(
|
|
18
|
+
const { pinnedStartColumns, pinnedEndColumns, handleColumnPin, pinnedStartColumnsData, pinnedEndColumnsData, unpinnedColumnsData, orderedColumns, lastColumnId, } = usePinnedColumns(columns, isPinnable, onColumnPin);
|
|
20
19
|
const { pinnedStartVirtualListRef, scrollableVirtualListRef, pinnedEndVirtualListRef, handleScroll } = useSynchronizedScroll();
|
|
21
20
|
const { pinnedStartColumnsWidth, pinnedEndColumnsWidth } = usePinnedColumnsWidths(pinnedStartColumnsData, pinnedEndColumnsData);
|
|
22
21
|
const { getItemSize, getItemDataForContainer } = useVirtualTableContainer({
|
|
@@ -58,7 +57,6 @@ function SheetViewVirtualTable({ columns, rows, threshold = SHEET_VIEW_TABLE_THR
|
|
|
58
57
|
clearBackdropVisibilityTimeout,
|
|
59
58
|
handleScroll,
|
|
60
59
|
setShowBackdrop,
|
|
61
|
-
overscanCount,
|
|
62
60
|
pinnedStartVirtualListRef,
|
|
63
61
|
pinnedEndVirtualListRef,
|
|
64
62
|
scrollableVirtualListRef,
|
package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js
CHANGED
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { pinIcon, unpinIcon } from '../../../../constants/index.js';
|
|
5
|
-
import { areTableHeaderCellPropsEqual } from '../../../../utils/index.js';
|
|
6
5
|
import ColumnFilter from '../../components/ColumnFilter';
|
|
7
6
|
import { StyledCell, TableHeaderInner } from '../../components/style';
|
|
8
7
|
import { PinIconContainer, HeaderText } from '../style';
|
|
@@ -45,9 +44,11 @@ function SheetViewTableHeaderCell({ column: { header, id, align, headerStyle, so
|
|
|
45
44
|
right: 0,
|
|
46
45
|
left: 0,
|
|
47
46
|
bottom: 0,
|
|
48
|
-
} }, headerStyle)) }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && _jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting
|
|
47
|
+
} }, headerStyle)) }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: handleHeaderInnerClick }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "SheetViewTableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && _jsx(HeaderText, Object.assign({ "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell_header_text" }, { children: header })) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && (_jsx(ColumnSort, { columnId: id, onColumnSort: onColumnSort, columnsSorting: columnsSorting, onClick: (e) => {
|
|
48
|
+
onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(colIndex, e, pinned);
|
|
49
|
+
} })), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
|
|
49
50
|
event.stopPropagation();
|
|
50
51
|
handlePinClick(id);
|
|
51
52
|
}, title: isPinned ? 'Unpin column' : 'Pin column' }, { children: _jsx("img", { src: isPinned ? unpinIcon : pinIcon, alt: "pin-icon" }) })))] })) })));
|
|
52
53
|
}
|
|
53
|
-
export default memo(SheetViewTableHeaderCell
|
|
54
|
+
export default memo(SheetViewTableHeaderCell);
|
|
@@ -4,4 +4,3 @@ export { useTableState } from './useTableState';
|
|
|
4
4
|
export { useTableData } from './useTableData';
|
|
5
5
|
export { useVirtualTableContainer } from './useVirtualTableContainer';
|
|
6
6
|
export { usePinnedColumnsWidths } from './usePinnedColumnsWidths';
|
|
7
|
-
export { usePerformanceOptimizations } from './usePerformanceOptimizations';
|
|
@@ -4,4 +4,3 @@ export { useTableState } from './useTableState';
|
|
|
4
4
|
export { useTableData } from './useTableData';
|
|
5
5
|
export { useVirtualTableContainer } from './useVirtualTableContainer';
|
|
6
6
|
export { usePinnedColumnsWidths } from './usePinnedColumnsWidths';
|
|
7
|
-
export { usePerformanceOptimizations } from './usePerformanceOptimizations';
|
|
@@ -17,7 +17,6 @@ export const useTableState = () => {
|
|
|
17
17
|
}
|
|
18
18
|
setSelectedChip(chipKey);
|
|
19
19
|
setSelectedCell(cellKey);
|
|
20
|
-
setSelectedColumn(null);
|
|
21
20
|
setSelectedRow(null);
|
|
22
21
|
}, [selectedChip, setSelectedChip, setSelectedCell, setSelectedRow]);
|
|
23
22
|
const handleCellClick = useCallback((rowIndex, columnIndex, event, pinnedType) => {
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts
CHANGED
|
@@ -23,6 +23,28 @@ interface UseVirtualTableContainerProps<T = unknown> extends TableChipProps {
|
|
|
23
23
|
}
|
|
24
24
|
export declare const useVirtualTableContainer: <T = unknown>({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, selectedRow, selectedChip, handleCellClick, handleChipClick, }: UseVirtualTableContainerProps<T>) => {
|
|
25
25
|
getItemSize: (index: number, height: number) => number;
|
|
26
|
-
getItemDataForContainer: (columnsData: IColumnProps[], isPinnedColumn: boolean, height: number) =>
|
|
26
|
+
getItemDataForContainer: (columnsData: IColumnProps[], isPinnedColumn: boolean, height: number) => {
|
|
27
|
+
columns: any;
|
|
28
|
+
isLoading: any;
|
|
29
|
+
rows: any;
|
|
30
|
+
rowProps: any;
|
|
31
|
+
scrollToIndex: any;
|
|
32
|
+
totalCount: any;
|
|
33
|
+
lastItemIndex: any;
|
|
34
|
+
isError: any;
|
|
35
|
+
areAllRowsLoaded: any;
|
|
36
|
+
limit: any;
|
|
37
|
+
newLoadedRowsEndIndex: any;
|
|
38
|
+
isSheetView: boolean;
|
|
39
|
+
isPinned: any;
|
|
40
|
+
selectedCell: any;
|
|
41
|
+
selectedColumn: any;
|
|
42
|
+
selectedRow: any;
|
|
43
|
+
selectedChip: any;
|
|
44
|
+
onCellClick: any;
|
|
45
|
+
onChipClick: any;
|
|
46
|
+
containerHeight: any;
|
|
47
|
+
rowHeight: any;
|
|
48
|
+
};
|
|
27
49
|
};
|
|
28
50
|
export {};
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import memoize from 'memoize-one';
|
|
3
|
-
const
|
|
3
|
+
const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, selectedRow, selectedChip, onCellClick, onChipClick, containerHeight, rowHeight) => ({
|
|
4
4
|
columns,
|
|
5
|
+
isLoading,
|
|
5
6
|
rows,
|
|
6
7
|
rowProps,
|
|
8
|
+
scrollToIndex,
|
|
7
9
|
totalCount,
|
|
8
10
|
lastItemIndex,
|
|
9
11
|
isError,
|
|
@@ -12,19 +14,15 @@ const createCoreItemData = memoize((columns, rows, rowProps, totalCount, lastIte
|
|
|
12
14
|
newLoadedRowsEndIndex: lastItemIndex,
|
|
13
15
|
isSheetView: true,
|
|
14
16
|
isPinned,
|
|
15
|
-
containerHeight,
|
|
16
|
-
rowHeight,
|
|
17
|
-
}));
|
|
18
|
-
const createInteractionData = memoize((selectedCell, selectedColumn, selectedRow, selectedChip, onCellClick, onChipClick) => ({
|
|
19
17
|
selectedCell,
|
|
20
18
|
selectedColumn,
|
|
21
19
|
selectedRow,
|
|
22
20
|
selectedChip,
|
|
23
21
|
onCellClick,
|
|
24
22
|
onChipClick,
|
|
23
|
+
containerHeight,
|
|
24
|
+
rowHeight,
|
|
25
25
|
}));
|
|
26
|
-
const createItemData = (coreData, interactionData, scrollToIndex, isLoading) => (Object.assign(Object.assign(Object.assign({}, coreData), interactionData), { scrollToIndex,
|
|
27
|
-
isLoading }));
|
|
28
26
|
export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, selectedRow, selectedChip, handleCellClick, handleChipClick, }) => {
|
|
29
27
|
const getItemSize = useCallback((index, height) => {
|
|
30
28
|
const isLastRow = areAllRowsLoaded && index === rows.length;
|
|
@@ -36,15 +34,21 @@ export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, is
|
|
|
36
34
|
}
|
|
37
35
|
return rowHeight;
|
|
38
36
|
}, [areAllRowsLoaded, rows.length, rowHeight]);
|
|
39
|
-
const
|
|
37
|
+
const commonItemDataParams = useMemo(() => {
|
|
40
38
|
var _a;
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
return [
|
|
40
|
+
isDelayedFetchingNextPage,
|
|
41
|
+
rows,
|
|
42
|
+
rowProps,
|
|
43
|
+
scrollToIndex,
|
|
44
|
+
rows.length - 1,
|
|
45
|
+
(_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0,
|
|
46
|
+
isError,
|
|
47
|
+
areAllRowsLoaded,
|
|
48
|
+
];
|
|
49
|
+
}, [isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount, isError, areAllRowsLoaded]);
|
|
50
|
+
const commonItemDataSuffix = useMemo(() => [selectedCell, selectedColumn, selectedRow, selectedChip, handleCellClick, handleChipClick], [selectedCell, selectedColumn, selectedRow, selectedChip, handleCellClick, handleChipClick]);
|
|
51
|
+
const getItemDataForContainer = useCallback((columnsData, isPinnedColumn, height) => createItemData(columnsData, ...commonItemDataParams, isPinnedColumn, ...commonItemDataSuffix, height, rowHeight), [commonItemDataParams, commonItemDataSuffix, rowHeight]);
|
|
48
52
|
return {
|
|
49
53
|
getItemSize,
|
|
50
54
|
getItemDataForContainer,
|
|
@@ -6,25 +6,23 @@ import { areEqual } from 'react-window';
|
|
|
6
6
|
import { StyledCell, StyledTableRow } from './style';
|
|
7
7
|
import { getSelectionStyles, getRowSelectionBorderStyles } from '../../../utils/index.js';
|
|
8
8
|
function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = null, selectedColumn = null, selectedRow = null, selectedChip = null, onCellClick, isLastRow = false, onChipClick, }) {
|
|
9
|
-
const renderCell =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick(rowIndex, colIndex, event, chipIndex, column.pinned);
|
|
14
|
-
};
|
|
15
|
-
if (!(column === null || column === void 0 ? void 0 : column.id) || !row)
|
|
16
|
-
return null;
|
|
17
|
-
const value = selector ? selector({ row, index, value: row[column === null || column === void 0 ? void 0 : column.id] }) : row[column === null || column === void 0 ? void 0 : column.id];
|
|
18
|
-
const formattedValue = format ? format({ value, row, index }) : value;
|
|
19
|
-
return render ? (render({
|
|
20
|
-
row,
|
|
21
|
-
column,
|
|
22
|
-
index,
|
|
23
|
-
value: row[column === null || column === void 0 ? void 0 : column.id],
|
|
24
|
-
selectionProps: { onClick: handleChipClick, rowIndex, colIndex, selectedId: selectedChip },
|
|
25
|
-
})) : (_jsx(_Fragment, { children: formattedValue }));
|
|
9
|
+
const renderCell = (column, rowIndex, colIndex) => {
|
|
10
|
+
const { render, format, selector } = column;
|
|
11
|
+
const handleChipClick = (event, chipIndex) => {
|
|
12
|
+
onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick(rowIndex, colIndex, event, chipIndex, column.pinned);
|
|
26
13
|
};
|
|
27
|
-
|
|
14
|
+
if (!(column === null || column === void 0 ? void 0 : column.id) || !row)
|
|
15
|
+
return null;
|
|
16
|
+
const value = selector ? selector({ row, index, value: row[column === null || column === void 0 ? void 0 : column.id] }) : row[column === null || column === void 0 ? void 0 : column.id];
|
|
17
|
+
const formattedValue = format ? format({ value, row, index }) : value;
|
|
18
|
+
return render ? (render({
|
|
19
|
+
row,
|
|
20
|
+
column,
|
|
21
|
+
index,
|
|
22
|
+
value: row[column === null || column === void 0 ? void 0 : column.id],
|
|
23
|
+
selectionProps: { onClick: handleChipClick, rowIndex, colIndex, selectedId: selectedChip },
|
|
24
|
+
})) : (_jsx(_Fragment, { children: formattedValue }));
|
|
25
|
+
};
|
|
28
26
|
const content = useMemo(() => (_jsx(_Fragment, { children: columns.map((column, colIndex) => {
|
|
29
27
|
var _a, _b;
|
|
30
28
|
const cellKey = `${(_a = column.pinned) !== null && _a !== void 0 ? _a : 'default'}-${index}-${colIndex}`;
|
|
@@ -50,7 +48,7 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
|
|
|
50
48
|
}
|
|
51
49
|
const rowSelectionBorderStyles = isRowSelected
|
|
52
50
|
? getRowSelectionBorderStyles({
|
|
53
|
-
|
|
51
|
+
effectiveFirst,
|
|
54
52
|
isPinnedStart: column.pinned === 'start',
|
|
55
53
|
isPinnedEnd: column.pinned === 'end',
|
|
56
54
|
})
|
|
@@ -59,7 +57,7 @@ function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = n
|
|
|
59
57
|
return (_jsx(StyledCell, Object.assign({ component: "div", "data-testid": "TableRow_TableCell", "data-column-id": column.id, "data-column-width": column.width, "data-column-width-used": column.width, "data-column-align": column.align, "data-column-order": column.order, "data-column-header": typeof column.header === 'string' ? column.header : 'component', "data-column-sortable": !!column.sortable, "data-column-filterable": !!column.filter, isFirst: effectiveFirst, isLast: effectiveLast, onClick: (event) => {
|
|
60
58
|
onCellClick === null || onCellClick === void 0 ? void 0 : onCellClick(index, colIndex, event, column.pinned);
|
|
61
59
|
}, sx: Object.assign(Object.assign(Object.assign({ width: column.width, minWidth: column.width, textAlign: column.align, justifyContent: isIndexColumn ? 'center' : column.align === 'right' ? 'flex-end' : 'flex-start', cursor: onCellClick ? 'pointer' : 'default' }, selectionStyles), rowSelectionBorderStyles), column.cellStyle), isSheetView: isSheetView, isSelected: isCellSelected }, { children: isSheetView ? (_jsx(Box, Object.assign({ sx: { position: 'relative', zIndex: 1 } }, { children: renderCell(column, index, colIndex) }))) : (_jsx(_Fragment, { children: renderCell(column, index, colIndex) })) }), `${column.id}-${colIndex}`));
|
|
62
|
-
}) })), [columns, index, selectedCell, selectedColumn, selectedRow, onCellClick, isLastRow,
|
|
60
|
+
}) })), [columns, row, index, selectedCell, selectedColumn, selectedRow, onCellClick, isLastRow, selectedChip, isSheetView]);
|
|
63
61
|
return (_createElement(StyledTableRow, Object.assign({ "data-testid": "TableRow", onClick: rowProps === null || rowProps === void 0 ? void 0 : rowProps.onRowClick, showShadowHighlight: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showShadowHighlight, showLoadedStyle: rowProps === null || rowProps === void 0 ? void 0 : rowProps.showLoadedStyle, component: "article" }, rowProps, { key: index, isSheetView: isSheetView }), content));
|
|
64
62
|
}
|
|
65
63
|
export default memo(TableRow, areEqual);
|
|
@@ -66,9 +66,9 @@ function ListItemWrapper(_a) {
|
|
|
66
66
|
width: '100%',
|
|
67
67
|
} }, { children: isError ? _jsx(RowErrorState, {}) : lastRowContent })));
|
|
68
68
|
}, [isError]);
|
|
69
|
-
const isLastRow = React.useMemo(() => isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1), [isLoadingRow, areAllRowsLoaded, index, lastItemIndex]);
|
|
70
69
|
const memoizedListItemComponent = React.useMemo(() => {
|
|
71
70
|
const lastRowContent = _jsx(LastRowContent, { isSheetView: isSheetView, isLoadingRow: isLoadingRow, columns: columns, currentRowCount: rows.length });
|
|
71
|
+
const isLastRow = isLoadingRow || (areAllRowsLoaded && index === lastItemIndex + 1);
|
|
72
72
|
if (isPinned && isLastRow) {
|
|
73
73
|
if (isSheetView && isLoadingRow && columns && columns.length > 0) {
|
|
74
74
|
return renderSheetViewLoadingRow(lastRowContent);
|
|
@@ -3,6 +3,6 @@ export declare const TABLE_CONTENT_ROW_HEIGHT = 70;
|
|
|
3
3
|
export declare const TABLE_ROW_HEIGHT = 57;
|
|
4
4
|
export declare const TABLE_THRESHOLD = 200;
|
|
5
5
|
export declare const TABLE_LIST_OVER_SCAN = 5;
|
|
6
|
-
export declare const SHEET_VIEW_TABLE_LIST_OVER_SCAN =
|
|
6
|
+
export declare const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 50;
|
|
7
7
|
export declare const SHEET_VIEW_TABLE_THRESHOLD = 20;
|
|
8
8
|
export declare const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
|
package/build/constants/table.js
CHANGED
|
@@ -3,6 +3,6 @@ export const TABLE_CONTENT_ROW_HEIGHT = 70;
|
|
|
3
3
|
export const TABLE_ROW_HEIGHT = 57;
|
|
4
4
|
export const TABLE_THRESHOLD = 200;
|
|
5
5
|
export const TABLE_LIST_OVER_SCAN = 5;
|
|
6
|
-
export const SHEET_VIEW_TABLE_LIST_OVER_SCAN =
|
|
6
|
+
export const SHEET_VIEW_TABLE_LIST_OVER_SCAN = 50;
|
|
7
7
|
export const SHEET_VIEW_TABLE_THRESHOLD = 20;
|
|
8
8
|
export const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
|
package/build/utils/country.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function getCountryNameByISO(countryCode: string): string | undefined;
|
package/build/utils/country.js
CHANGED
package/build/utils/index.d.ts
CHANGED
package/build/utils/index.js
CHANGED
package/build/utils/style.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ interface GetSelectionStylesParams {
|
|
|
14
14
|
type SelectionStyles = Record<string, string | Record<string, string>>;
|
|
15
15
|
export declare const getSelectionStyles: ({ isSelected, isCellSelected, isColumnSelected, isRowSelected, isLastRow, }: GetSelectionStylesParams) => SelectionStyles;
|
|
16
16
|
interface GetRowSelectionBorderStylesParams {
|
|
17
|
-
|
|
17
|
+
effectiveFirst: boolean;
|
|
18
18
|
isPinnedStart: boolean;
|
|
19
19
|
isPinnedEnd: boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare const getRowSelectionBorderStyles: ({
|
|
21
|
+
export declare const getRowSelectionBorderStyles: ({ effectiveFirst, isPinnedStart, isPinnedEnd }: GetRowSelectionBorderStylesParams) => SelectionStyles;
|
|
22
22
|
export {};
|
package/build/utils/style.js
CHANGED
|
@@ -59,9 +59,9 @@ const getBorderWidthForColumn = () => {
|
|
|
59
59
|
const getBorderBottomForColumn = (isLastRow) => {
|
|
60
60
|
return isLastRow ? `${BORDER_STYLES.thick} solid ${SELECTION_COLORS.primary}` : `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.border}`;
|
|
61
61
|
};
|
|
62
|
-
export const getRowSelectionBorderStyles = ({
|
|
62
|
+
export const getRowSelectionBorderStyles = ({ effectiveFirst, isPinnedStart, isPinnedEnd }) => ({
|
|
63
63
|
borderTop: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
|
|
64
64
|
borderBottom: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
|
|
65
65
|
borderRight: `${BORDER_STYLES.thin} solid ${isPinnedEnd ? SELECTION_COLORS.primary : 'none'}`,
|
|
66
|
-
borderLeft: `${BORDER_STYLES.thin} solid ${isPinnedStart &&
|
|
66
|
+
borderLeft: `${BORDER_STYLES.thin} solid ${isPinnedStart && effectiveFirst ? SELECTION_COLORS.primary : 'transparent'}`,
|
|
67
67
|
});
|
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.1.130
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.130",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
"publishConfig": {
|
|
137
137
|
"registry": "https://registry.npmjs.org/"
|
|
138
138
|
}
|
|
139
|
-
}
|
|
139
|
+
}
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { IColumnProps } from '../../../../types/index.js';
|
|
3
|
-
export declare const usePerformanceOptimizations: (columns: readonly IColumnProps[]) => {
|
|
4
|
-
stableColumns: IColumnProps<any>[];
|
|
5
|
-
stableColumnsWithFilters: {
|
|
6
|
-
filter: ({
|
|
7
|
-
onConfirm?: ((filterValues: import("../../../../types/index.js").ColumnFilterValues) => void) | undefined;
|
|
8
|
-
onClear: (apiKeys: string[]) => void;
|
|
9
|
-
onClearFilterFields?: (() => void) | undefined;
|
|
10
|
-
data?: import("../../../../types/index.js").ColumnFilterValues | undefined;
|
|
11
|
-
isOnlyOneFilter?: boolean | undefined;
|
|
12
|
-
wrapperSx?: import("@mui/system").SxProps | undefined;
|
|
13
|
-
} & (import("../../../../types/index.js").IColumnFilterList | import("../../../../types/index.js").IColumnFilterInputs | import("../../../../types/index.js").IColumnFilterCustom)) | undefined;
|
|
14
|
-
header?: string | (() => import("react").ReactNode) | undefined;
|
|
15
|
-
render?: ((props: import("../../../../types/index.js").IRenderAttr<any, IColumnProps<any>>) => import("react").ReactNode) | undefined;
|
|
16
|
-
id: string | number | symbol;
|
|
17
|
-
tableViewId?: string | undefined;
|
|
18
|
-
width?: import("csstype").Property.Width<string | number> | undefined;
|
|
19
|
-
format?: ((props: import("../../../../types/index.js").IFormatAttr<any>) => string) | undefined;
|
|
20
|
-
selector?: ((props: import("../../../../types/index.js").ISelectorAttr<any>) => string | number | Record<string, any>) | undefined;
|
|
21
|
-
align?: import("csstype").Property.TextAlign | undefined;
|
|
22
|
-
sortable?: boolean | undefined;
|
|
23
|
-
hidden?: boolean | undefined;
|
|
24
|
-
order?: number | undefined;
|
|
25
|
-
pinned?: "start" | "end" | undefined;
|
|
26
|
-
pinnable?: boolean | undefined;
|
|
27
|
-
cellStyle?: import("react").CSSProperties | undefined;
|
|
28
|
-
headerStyle?: import("react").CSSProperties | undefined;
|
|
29
|
-
isDefaultPinned?: boolean | undefined;
|
|
30
|
-
}[];
|
|
31
|
-
columnMetrics: {
|
|
32
|
-
visibleColumns: IColumnProps<any>[];
|
|
33
|
-
totalWidth: number;
|
|
34
|
-
columnCount: number;
|
|
35
|
-
firstColumnId: string | number | symbol;
|
|
36
|
-
lastColumnId: string | number | symbol;
|
|
37
|
-
};
|
|
38
|
-
};
|
package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePerformanceOptimizations.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
-
export const usePerformanceOptimizations = (columns) => {
|
|
3
|
-
const stableColumnsRef = useRef([]);
|
|
4
|
-
const stableColumns = useMemo(() => {
|
|
5
|
-
const hasChanged = columns.length !== stableColumnsRef.current.length ||
|
|
6
|
-
columns.some((col, index) => {
|
|
7
|
-
const prevCol = stableColumnsRef.current[index];
|
|
8
|
-
return (!prevCol ||
|
|
9
|
-
col.id !== prevCol.id ||
|
|
10
|
-
col.width !== prevCol.width ||
|
|
11
|
-
col.pinned !== prevCol.pinned ||
|
|
12
|
-
col.hidden !== prevCol.hidden ||
|
|
13
|
-
col.order !== prevCol.order);
|
|
14
|
-
});
|
|
15
|
-
if (hasChanged) {
|
|
16
|
-
stableColumnsRef.current = [...columns];
|
|
17
|
-
}
|
|
18
|
-
return stableColumnsRef.current;
|
|
19
|
-
}, [columns]);
|
|
20
|
-
const stableColumnsWithFilters = useMemo(() => {
|
|
21
|
-
return stableColumns.map((stableCol, index) => {
|
|
22
|
-
const currentCol = columns[index];
|
|
23
|
-
return Object.assign(Object.assign({}, stableCol), { filter: currentCol === null || currentCol === void 0 ? void 0 : currentCol.filter });
|
|
24
|
-
});
|
|
25
|
-
}, [stableColumns, columns]);
|
|
26
|
-
const columnMetrics = useMemo(() => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const visibleColumns = stableColumns.filter((col) => !col.hidden);
|
|
29
|
-
const totalWidth = visibleColumns.reduce((sum, col) => sum + +((col === null || col === void 0 ? void 0 : col.width) || 100), 0);
|
|
30
|
-
const columnCount = visibleColumns.length;
|
|
31
|
-
return {
|
|
32
|
-
visibleColumns,
|
|
33
|
-
totalWidth,
|
|
34
|
-
columnCount,
|
|
35
|
-
firstColumnId: (_a = visibleColumns[0]) === null || _a === void 0 ? void 0 : _a.id,
|
|
36
|
-
lastColumnId: (_b = visibleColumns[columnCount - 1]) === null || _b === void 0 ? void 0 : _b.id,
|
|
37
|
-
};
|
|
38
|
-
}, [stableColumns]);
|
|
39
|
-
return {
|
|
40
|
-
stableColumns,
|
|
41
|
-
stableColumnsWithFilters,
|
|
42
|
-
columnMetrics,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { IColumnProps } from '../types/index.js';
|
|
3
|
-
interface SheetViewTableHeaderCellProps {
|
|
4
|
-
column: IColumnProps;
|
|
5
|
-
colIndex: number;
|
|
6
|
-
isFirst: boolean;
|
|
7
|
-
isLast: boolean;
|
|
8
|
-
isSelected: boolean;
|
|
9
|
-
isDefaultPinned: boolean;
|
|
10
|
-
isPinnable?: boolean;
|
|
11
|
-
lastColumnId?: string | null;
|
|
12
|
-
columnsSorting?: Record<string, 'asc' | 'desc'>;
|
|
13
|
-
pinnedColumns?: string[];
|
|
14
|
-
onColumnSort?: (columnsSorting: Record<string, 'asc' | 'desc'>) => void;
|
|
15
|
-
onColumnPin?: (columnId: string, position: 'start' | 'end' | 'unpin') => void;
|
|
16
|
-
onColumnClick?: (columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
|
|
17
|
-
}
|
|
18
|
-
export declare const areTableHeaderCellPropsEqual: (prevProps: SheetViewTableHeaderCellProps, nextProps: SheetViewTableHeaderCellProps) => boolean;
|
|
19
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const areTableHeaderCellPropsEqual = (prevProps, nextProps) => {
|
|
2
|
-
const prevCol = prevProps.column;
|
|
3
|
-
const nextCol = nextProps.column;
|
|
4
|
-
const filterChanged = prevCol.filter !== nextCol.filter;
|
|
5
|
-
const essentialPropsChanged = prevCol.id !== nextCol.id ||
|
|
6
|
-
prevCol.header !== nextCol.header ||
|
|
7
|
-
prevCol.width !== nextCol.width ||
|
|
8
|
-
prevCol.align !== nextCol.align ||
|
|
9
|
-
prevCol.pinned !== nextCol.pinned ||
|
|
10
|
-
prevCol.sortable !== nextCol.sortable ||
|
|
11
|
-
prevCol.pinnable !== nextCol.pinnable ||
|
|
12
|
-
prevCol.order !== nextCol.order ||
|
|
13
|
-
JSON.stringify(prevCol.headerStyle) !== JSON.stringify(nextCol.headerStyle);
|
|
14
|
-
const otherPropsChanged = prevProps.colIndex !== nextProps.colIndex ||
|
|
15
|
-
prevProps.isFirst !== nextProps.isFirst ||
|
|
16
|
-
prevProps.isLast !== nextProps.isLast ||
|
|
17
|
-
prevProps.isSelected !== nextProps.isSelected ||
|
|
18
|
-
prevProps.isDefaultPinned !== nextProps.isDefaultPinned ||
|
|
19
|
-
prevProps.isPinnable !== nextProps.isPinnable ||
|
|
20
|
-
prevProps.lastColumnId !== nextProps.lastColumnId ||
|
|
21
|
-
JSON.stringify(prevProps.columnsSorting) !== JSON.stringify(nextProps.columnsSorting) ||
|
|
22
|
-
JSON.stringify(prevProps.pinnedColumns) !== JSON.stringify(nextProps.pinnedColumns);
|
|
23
|
-
return !filterChanged && !essentialPropsChanged && !otherPropsChanged;
|
|
24
|
-
};
|