@tap-payments/os-micro-frontend-shared 0.1.69 → 0.1.71
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/StatusIcons/SourceIcons/components/SourceIcon.d.ts +6 -2
- package/build/components/StatusIcons/SourceIcons/components/SourceIcon.js +2 -2
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts +3 -2
- package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js +14 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.d.ts +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +3 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.d.ts +2 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +3 -3
- package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +1 -0
- package/build/constants/assets.d.ts +5 -0
- package/build/constants/assets.js +5 -0
- package/build/constants/table.d.ts +2 -0
- package/build/constants/table.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
type SourceIconProps = {
|
|
2
2
|
source: string;
|
|
3
3
|
isTextShown?: boolean;
|
|
4
4
|
title?: string;
|
|
5
|
-
|
|
5
|
+
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
};
|
|
8
|
+
export declare function SourceIcon({ source, isTextShown, title, width, height }: SourceIconProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -4,10 +4,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import Tooltip from '../../../Tooltip';
|
|
5
5
|
import { getPaymentMethodsIcon } from '../../../../constants/index.js';
|
|
6
6
|
import { StyledBadgeTextWrapper, StyledSourceImage, TextLabel } from '../style';
|
|
7
|
-
export function SourceIcon({ source, isTextShown, title }) {
|
|
7
|
+
export function SourceIcon({ source, isTextShown, title, width, height }) {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
const ImageSrc = getPaymentMethodsIcon(source);
|
|
10
|
-
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) }))) : (_jsx(StyledSourceImage, { src: ImageSrc, alt: source, onError: (e) => {
|
|
10
|
+
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StyledBadgeTextWrapper, Object.assign({ "data-testid": "SourceCell_BadgeTextWrapper" }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "SourceCell_TextLabel", "data-source": source }, { children: t(camelCase(source)) })) }))) : (_jsx(StyledSourceImage, { src: ImageSrc, alt: source, width: width, height: height, onError: (e) => {
|
|
11
11
|
e.currentTarget.src = getPaymentMethodsIcon('card');
|
|
12
12
|
} })) })));
|
|
13
13
|
}
|
package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { StackProps } from '@mui/material/Stack';
|
|
2
3
|
import { TextAndLang } from '../../../../types/index.js';
|
|
3
|
-
type TerminalsPlatformCellProps = {
|
|
4
|
+
type TerminalsPlatformCellProps = StackProps & {
|
|
4
5
|
name: TextAndLang[];
|
|
5
6
|
icon?: React.ReactNode;
|
|
6
7
|
displayRules?: {
|
|
@@ -8,5 +9,5 @@ type TerminalsPlatformCellProps = {
|
|
|
8
9
|
showLabel?: boolean;
|
|
9
10
|
};
|
|
10
11
|
};
|
|
11
|
-
declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
12
|
+
declare const _default: import("react").MemoExoticComponent<({ name, icon, displayRules, ...props }: TerminalsPlatformCellProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
12
13
|
export default _default;
|
package/build/components/TableCells/CustomCells/TerminalsPlatformCell/TerminalsPlatformCell.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { memo } from 'react';
|
|
3
14
|
import { useTranslation } from 'react-i18next';
|
|
@@ -6,7 +17,8 @@ import Typography from '@mui/material/Typography';
|
|
|
6
17
|
import Box from '@mui/material/Box';
|
|
7
18
|
import { Chip, Tooltip } from '../../../index.js';
|
|
8
19
|
import { getNameText } from '../../../../utils/index.js';
|
|
9
|
-
const TerminalsPlatformCell = (
|
|
20
|
+
const TerminalsPlatformCell = (_a) => {
|
|
21
|
+
var { name, icon, displayRules } = _a, props = __rest(_a, ["name", "icon", "displayRules"]);
|
|
10
22
|
const { i18n } = useTranslation();
|
|
11
23
|
const { showIcon = true, showLabel = true } = displayRules || {};
|
|
12
24
|
const platformName = getNameText(name, i18n.language);
|
|
@@ -14,6 +26,6 @@ const TerminalsPlatformCell = ({ name, icon, displayRules }) => {
|
|
|
14
26
|
const displayLabel = showLabel || !!platformName;
|
|
15
27
|
if (!displayIcon && !displayLabel)
|
|
16
28
|
return null;
|
|
17
|
-
return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: platformName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: platformName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: "Unavailable" }))) })) })))] })));
|
|
29
|
+
return (_jsxs(Stack, Object.assign({ "data-testid": "TerminalsPlatformCell", direction: "row", alignItems: "center", spacing: 1, color: "text.primary" }, props, { children: [displayIcon && (_jsx(Chip, Object.assign({ variant: "circular", sx: { '&.CustomVariant_circular': { minWidth: 32, height: 32 } } }, { children: icon }))), displayLabel && (_jsx(Tooltip, Object.assign({ title: platformName }, { children: _jsx(Typography, Object.assign({ noWrap: true, fontSize: 12, fontWeight: 500 }, { children: platformName || (_jsx(Box, Object.assign({ component: "span", sx: { opacity: 0.2 } }, { children: "Unavailable" }))) })) })))] })));
|
|
18
30
|
};
|
|
19
31
|
export default memo(TerminalsPlatformCell);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ISheetViewVirtualTable } from './types';
|
|
3
|
-
declare function SheetViewVirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, rowHeight, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableTitle, dragControls, onColumnPin, clearBackdropVisibilityTimeout, isPinnable, tableMode, }: Readonly<ISheetViewVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function SheetViewVirtualTable({ columns, rows, threshold, showHeader, headerProps, rowProps, footerProps, rowHeight, isLoading, error, columnsSorting, onColumnSort, loadMoreItems, isFetchingNextPage, triggerDataRefetch, scrollToIndex, areAllRowsLoaded, tableBodyStyles, tableTitle, dragControls, onColumnPin, clearBackdropVisibilityTimeout, isPinnable, tableMode, overscanCount, }: Readonly<ISheetViewVirtualTable>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof SheetViewVirtualTable>;
|
|
5
5
|
export default _default;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
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
7
|
import { usePinnedColumns, useSynchronizedScroll, useTableState, useTableData, useVirtualTableContainer, usePinnedColumnsWidths } from './hooks';
|
|
8
8
|
import { PinnedColumn, MainTable, LoadingMainTable, NoDataView, VirtualTable } from './components';
|
|
9
|
-
function SheetViewVirtualTable({ columns, rows, threshold =
|
|
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
10
|
const { selectedCell, selectedColumn, selectedRow, showBackDrop, setShowBackdrop, handleCellClick, handleColumnClick, handleChipClick, selectedChip, } = useTableState();
|
|
11
11
|
const { isError, tableLoading, tableError, tableEmpty, hasTimeoutError, showNoDataView, lastItemIndex, areTotalRowsNotFillingHeight, itemsCount, isDelayedFetchingNextPage, } = useTableData({
|
|
12
12
|
rows,
|
|
@@ -43,7 +43,7 @@ function SheetViewVirtualTable({ columns, rows, threshold = TABLE_THRESHOLD, sho
|
|
|
43
43
|
const source = containerKey === 'pinnedStart' ? 'start' : containerKey === 'pinnedEnd' ? 'end' : 'scrollable';
|
|
44
44
|
handleScroll(scrollProps, source);
|
|
45
45
|
};
|
|
46
|
-
return (_jsx(VirtualTable, { columnsData: columnsData, itemCount: itemsCount, lastItemIndex: lastItemIndex, areAllRowsLoaded: areAllRowsLoaded, loadMoreItems: loadMoreItems, threshold: threshold, getItemSize: getItemSize, getItemData: getItemDataForContainer, isPinned: isPinned, fixedWidth: fixedWidth, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, onScroll: handleScrollCallback, setBackdropVisibility: setShowBackdrop, listRef: listRef }));
|
|
46
|
+
return (_jsx(VirtualTable, { columnsData: columnsData, itemCount: itemsCount, lastItemIndex: lastItemIndex, areAllRowsLoaded: areAllRowsLoaded, loadMoreItems: loadMoreItems, threshold: threshold, getItemSize: getItemSize, getItemData: getItemDataForContainer, isPinned: isPinned, fixedWidth: fixedWidth, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, onScroll: handleScrollCallback, setBackdropVisibility: setShowBackdrop, listRef: listRef, overscanCount: overscanCount }));
|
|
47
47
|
}, [
|
|
48
48
|
itemsCount,
|
|
49
49
|
lastItemIndex,
|
|
@@ -39,7 +39,8 @@ interface VirtualTableProps {
|
|
|
39
39
|
onScroll?: (scrollProps: ListOnScrollProps) => void;
|
|
40
40
|
setBackdropVisibility: (visible: boolean) => void;
|
|
41
41
|
listRef: React.RefObject<VariableSizeList>;
|
|
42
|
+
overscanCount?: number;
|
|
42
43
|
}
|
|
43
|
-
declare function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, }: VirtualTableProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, overscanCount, }: VirtualTableProps): import("react/jsx-runtime").JSX.Element;
|
|
44
45
|
declare const _default: import("react").MemoExoticComponent<typeof VirtualTable>;
|
|
45
46
|
export default _default;
|
|
@@ -11,10 +11,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { memo } from 'react';
|
|
12
12
|
import InfiniteLoader from 'react-window-infinite-loader';
|
|
13
13
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
14
|
-
import {
|
|
14
|
+
import { SHEET_VIEW_TABLE_LIST_OVER_SCAN } from '../../../../constants/index.js';
|
|
15
15
|
import ListItemWrapper from '../../components/virtualScroll/ListItemWrapper';
|
|
16
16
|
import { StyledVirtualList } from '../../components/style';
|
|
17
|
-
function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, }) {
|
|
17
|
+
function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded, loadMoreItems, threshold, getItemSize, getItemData, isPinned, fixedWidth, scrollToIndex, areTotalRowsNotFillingHeight, clearBackdropVisibilityTimeout, onScroll, setBackdropVisibility, listRef, overscanCount = SHEET_VIEW_TABLE_LIST_OVER_SCAN, }) {
|
|
18
18
|
const handleOnLoadMoreItems = () => __awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
if (areAllRowsLoaded)
|
|
20
20
|
return;
|
|
@@ -23,7 +23,7 @@ function VirtualTable({ columnsData, itemCount, lastItemIndex, areAllRowsLoaded,
|
|
|
23
23
|
return (_jsx(InfiniteLoader, Object.assign({ isItemLoaded: (index) => index !== lastItemIndex, itemCount: itemCount, loadMoreItems: handleOnLoadMoreItems, threshold: threshold }, { children: ({ onItemsRendered, ref }) => (_jsx(AutoSizer, Object.assign({ ref: ref }, { children: ({ height, width }) => {
|
|
24
24
|
const itemSize = (index) => getItemSize(index, height);
|
|
25
25
|
const itemData = getItemData(columnsData, isPinned, height);
|
|
26
|
-
return (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: itemCount, itemSize: itemSize, itemData: itemData, onItemsRendered: onItemsRendered, overscanCount:
|
|
26
|
+
return (_jsx(StyledVirtualList, Object.assign({ listRef: listRef, height: height, width: fixedWidth || width, itemCount: itemCount, itemSize: itemSize, itemData: itemData, onItemsRendered: onItemsRendered, overscanCount: overscanCount, setBackdropVisibility: setBackdropVisibility, scrollToIndex: scrollToIndex, areTotalRowsNotFillingHeight: areTotalRowsNotFillingHeight, useIsScrolling: true, onScroll: onScroll, clearBackdropVisibilityTimeout: clearBackdropVisibilityTimeout, style: {
|
|
27
27
|
overflowX: isPinned ? 'hidden' : 'auto',
|
|
28
28
|
paddingBottom: isPinned ? '25px' : '13px',
|
|
29
29
|
backgroundColor: isPinned ? 'transparent' : '#F6F8FACC',
|
|
@@ -5,6 +5,7 @@ export interface ISheetViewVirtualTable extends Omit<IVirtualTable, 'isSheetView
|
|
|
5
5
|
onColumnPin?: (columnId: string, isPinned: boolean) => void;
|
|
6
6
|
isPinnable?: boolean;
|
|
7
7
|
clearBackdropVisibilityTimeout?: number;
|
|
8
|
+
overscanCount?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface SheetViewTableHeaderProps {
|
|
10
11
|
columns: IColumnProps[];
|
|
@@ -534,3 +534,8 @@ export declare const gradientSettings: string;
|
|
|
534
534
|
export declare const gradientWallet: string;
|
|
535
535
|
export declare const manyCurrencyCoin: string;
|
|
536
536
|
export declare const manyCurrencyCoinGradient: string;
|
|
537
|
+
export declare const blackMobileBatteryIcon: string;
|
|
538
|
+
export declare const blackMobileSignalIcon: string;
|
|
539
|
+
export declare const emptyMobileWifiIcon: string;
|
|
540
|
+
export declare const deemaWithLabel: string;
|
|
541
|
+
export declare const blackUnLinkIcon: string;
|
|
@@ -538,3 +538,8 @@ export const gradientSettings = `${lightUrl}/gradientSettings.svg`;
|
|
|
538
538
|
export const gradientWallet = `${lightUrl}/gradientWallet.svg`;
|
|
539
539
|
export const manyCurrencyCoin = `${lightUrl}/manyCurrencyCoin.svg`;
|
|
540
540
|
export const manyCurrencyCoinGradient = `${lightUrl}/manyCurrencyCoinGradient.svg`;
|
|
541
|
+
export const blackMobileBatteryIcon = `${lightUrl}/blackMobileBatteryIcon.svg`;
|
|
542
|
+
export const blackMobileSignalIcon = `${lightUrl}/blackMobileSignalIcon.svg`;
|
|
543
|
+
export const emptyMobileWifiIcon = `${lightUrl}/emptyMobileWifiIcon.svg`;
|
|
544
|
+
export const deemaWithLabel = `${lightUrl}/deemaWithLabel.svg`;
|
|
545
|
+
export const blackUnLinkIcon = `${lightUrl}/blackUnLinkIcon.svg`;
|
|
@@ -3,4 +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 = 50;
|
|
7
|
+
export declare const SHEET_VIEW_TABLE_THRESHOLD = 20;
|
|
6
8
|
export declare const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
|
package/build/constants/table.js
CHANGED
|
@@ -3,4 +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 = 50;
|
|
7
|
+
export const SHEET_VIEW_TABLE_THRESHOLD = 20;
|
|
6
8
|
export const SHEET_VIEW_TABLE_ROW_HEIGHT = 28;
|
package/package.json
CHANGED