@tap-payments/os-micro-frontend-shared 0.1.22 → 0.1.24-test.1

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.
Files changed (100) hide show
  1. package/build/components/AccountDropdown/style.d.ts +1 -1
  2. package/build/components/ActivityAreaChart/styles.d.ts +3 -3
  3. package/build/components/AppServices/style.d.ts +1 -1
  4. package/build/components/CircularProgressWithLabel/style.d.ts +1 -1
  5. package/build/components/DockButton/style.d.ts +1 -1
  6. package/build/components/FileUpload/style.d.ts +2 -2
  7. package/build/components/FileUploader/style.d.ts +1 -1
  8. package/build/components/IconWithBadge/IconWithBadge.d.ts +1 -1
  9. package/build/components/IconWithBadge/IconWithBadge.js +2 -2
  10. package/build/components/IconWithBadge/type.d.ts +1 -0
  11. package/build/components/IconWithLabel/style.d.ts +1 -1
  12. package/build/components/IconsDropdown/style.d.ts +2 -2
  13. package/build/components/JSONViewer/style.d.ts +1 -1
  14. package/build/components/LabeledIconDropdown/style.d.ts +3 -3
  15. package/build/components/MultiSelectWithSearch/style.d.ts +3 -3
  16. package/build/components/NestedDropdown/styles.d.ts +1 -1
  17. package/build/components/ProgressBar/style.d.ts +1 -1
  18. package/build/components/ProgressRing/style.d.ts +2 -2
  19. package/build/components/RFH/Inputs/SelectWithAccordion/style.d.ts +3 -3
  20. package/build/components/SelectDropdown/style.d.ts +1 -1
  21. package/build/components/SelectWithSearch/style.d.ts +3 -3
  22. package/build/components/StatusBar/StatusBar.js +3 -2
  23. package/build/components/StatusIcons/SourceIcons/SourceIcons.js +2 -2
  24. package/build/components/StatusLabel/style.d.ts +1 -1
  25. package/build/components/TableCells/CustomCells/AppsCell/AppsCell.js +3 -0
  26. package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.d.ts +1 -1
  27. package/build/components/TableCells/CustomCells/BrandsCell/BrandsCell.js +3 -8
  28. package/build/components/TableCells/CustomCells/BrandsCell/type.d.ts +1 -0
  29. package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +2 -2
  30. package/build/components/TableCells/CustomCells/EntityCell/EntityCell.d.ts +1 -1
  31. package/build/components/TableCells/CustomCells/EntityCell/EntityCell.js +2 -2
  32. package/build/components/TableCells/CustomCells/EntityCell/type.d.ts +1 -0
  33. package/build/components/TableCells/CustomCells/LeadStatusCell/LeadStatusCell.d.ts +2 -0
  34. package/build/components/TableCells/CustomCells/LeadStatusCell/LeadStatusCell.js +25 -0
  35. package/build/components/TableCells/CustomCells/LeadStatusCell/constant.d.ts +7 -0
  36. package/build/components/TableCells/CustomCells/LeadStatusCell/constant.js +8 -0
  37. package/build/components/TableCells/CustomCells/LeadStatusCell/index.d.ts +1 -0
  38. package/build/components/TableCells/CustomCells/LeadStatusCell/index.js +1 -0
  39. package/build/components/TableCells/CustomCells/LeadStatusCell/style.d.ts +2 -0
  40. package/build/components/TableCells/CustomCells/LeadStatusCell/style.js +12 -0
  41. package/build/components/TableCells/CustomCells/LeadStatusCell/type.d.ts +6 -0
  42. package/build/components/TableCells/CustomCells/index.d.ts +2 -0
  43. package/build/components/TableCells/CustomCells/index.js +2 -0
  44. package/build/components/TableHeader/style.d.ts +1 -1
  45. package/build/components/Timepicker/style.d.ts +2 -2
  46. package/build/components/ToolbarIcon/ExpandButton/style.d.ts +1 -1
  47. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.d.ts +1 -6
  48. package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +59 -161
  49. package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.d.ts +5 -0
  50. package/build/components/VirtualTables/SheetViewVirtualTable/components/LoadingMainTable.js +19 -0
  51. package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.d.ts +5 -0
  52. package/build/components/VirtualTables/SheetViewVirtualTable/components/MainTable.js +15 -0
  53. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.d.ts +5 -0
  54. package/build/components/VirtualTables/SheetViewVirtualTable/components/NoDataView.js +13 -0
  55. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.d.ts +5 -0
  56. package/build/components/VirtualTables/SheetViewVirtualTable/components/PinnedColumn.js +20 -0
  57. package/build/components/VirtualTables/SheetViewVirtualTable/components/{SheetViewTableHeader/SheetViewTableHeader.d.ts → SheetViewTableHeader.d.ts} +1 -1
  58. package/build/components/VirtualTables/SheetViewVirtualTable/components/{SheetViewTableHeader/SheetViewTableHeader.js → SheetViewTableHeader.js} +3 -3
  59. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.d.ts +14 -0
  60. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +49 -0
  61. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.d.ts +44 -0
  62. package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +33 -0
  63. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.d.ts +6 -0
  64. package/build/components/VirtualTables/SheetViewVirtualTable/components/index.js +6 -0
  65. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.d.ts +6 -0
  66. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/index.js +6 -0
  67. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumnsWidths.d.ts +5 -0
  68. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumnsWidths.js +15 -0
  69. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableData.d.ts +20 -0
  70. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableData.js +40 -0
  71. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.d.ts +15 -0
  72. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +31 -0
  73. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.d.ts +44 -0
  74. package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +53 -0
  75. package/build/components/VirtualTables/SheetViewVirtualTable/index.d.ts +2 -0
  76. package/build/components/VirtualTables/SheetViewVirtualTable/index.js +2 -0
  77. package/build/components/VirtualTables/SheetViewVirtualTable/types.d.ts +89 -0
  78. package/build/components/VirtualTables/SheetViewVirtualTable/types.js +1 -0
  79. package/build/components/VirtualTables/components/TableFooter/style.d.ts +2 -2
  80. package/build/components/VirtualTables/components/TableHeader/components/TableCell/TableCell.js +7 -5
  81. package/build/components/VirtualTables/components/TableRow.js +1 -1
  82. package/build/components/VirtualTables/components/style.d.ts +3 -0
  83. package/build/components/VirtualTables/components/style.js +6 -0
  84. package/build/components/Widget/style.d.ts +1 -1
  85. package/build/components/WindowAppIcon/style.d.ts +1 -1
  86. package/build/constants/assets.d.ts +5 -0
  87. package/build/constants/assets.js +5 -0
  88. package/build/utils/index.d.ts +1 -0
  89. package/build/utils/index.js +1 -0
  90. package/build/utils/style.d.ts +9 -0
  91. package/build/utils/style.js +62 -0
  92. package/package.json +3 -3
  93. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.d.ts +0 -14
  94. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/TableCell.js +0 -46
  95. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/index.d.ts +0 -2
  96. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/index.js +0 -2
  97. package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader/type.d.ts +0 -19
  98. package/build/components/VirtualTables/utils/getSelectionStyles.d.ts +0 -55
  99. package/build/components/VirtualTables/utils/getSelectionStyles.js +0 -31
  100. /package/build/components/{VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeader → TableCells/CustomCells/LeadStatusCell}/type.js +0 -0
@@ -0,0 +1,5 @@
1
+ import type { IColumnProps } from '../../../../types/index.js';
2
+ export declare const usePinnedColumnsWidths: (pinnedStartColumnsData: IColumnProps[], pinnedEndColumnsData: IColumnProps[]) => {
3
+ pinnedStartColumnsWidth: number;
4
+ pinnedEndColumnsWidth: number;
5
+ };
@@ -0,0 +1,15 @@
1
+ import { useMemo } from 'react';
2
+ export const usePinnedColumnsWidths = (pinnedStartColumnsData, pinnedEndColumnsData) => {
3
+ const pinnedStartColumnsWidth = useMemo(() => pinnedStartColumnsData.reduce((acc, col) => {
4
+ const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
5
+ return acc + width;
6
+ }, 0.2), [pinnedStartColumnsData]);
7
+ const pinnedEndColumnsWidth = useMemo(() => pinnedEndColumnsData.reduce((acc, col) => {
8
+ const width = typeof col.width === 'string' ? parseInt(col.width) : col.width || 100;
9
+ return acc + width;
10
+ }, 0.2), [pinnedEndColumnsData]);
11
+ return {
12
+ pinnedStartColumnsWidth,
13
+ pinnedEndColumnsWidth,
14
+ };
15
+ };
@@ -0,0 +1,20 @@
1
+ interface UseTableDataProps<T = unknown> {
2
+ rows: T[];
3
+ isLoading?: boolean;
4
+ error?: Error | null;
5
+ isFetchingNextPage?: boolean;
6
+ areAllRowsLoaded?: boolean;
7
+ }
8
+ export declare const useTableData: <T = unknown>({ rows, isLoading, error, isFetchingNextPage, areAllRowsLoaded }: UseTableDataProps<T>) => {
9
+ isDelayedFetchingNextPage: boolean;
10
+ lastItemIndex: number;
11
+ areTotalRowsNotFillingHeight: boolean;
12
+ itemsCount: number;
13
+ isError: boolean;
14
+ tableLoading: boolean;
15
+ tableError: boolean;
16
+ tableEmpty: boolean;
17
+ hasTimeoutError: boolean;
18
+ showNoDataView: boolean;
19
+ };
20
+ export {};
@@ -0,0 +1,40 @@
1
+ import { useMemo } from 'react';
2
+ import { useDelayToSetValue } from '../../../../hooks/index.js';
3
+ import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../../../utils/index.js';
4
+ const isAxiosError = (error) => {
5
+ return error !== null && 'isAxiosError' in error && error.isAxiosError === true;
6
+ };
7
+ export const useTableData = ({ rows, isLoading, error, isFetchingNextPage, areAllRowsLoaded }) => {
8
+ const isDelayedFetchingNextPage = useDelayToSetValue({
9
+ value: isFetchingNextPage,
10
+ delay: 1000,
11
+ });
12
+ const tableStates = useMemo(() => {
13
+ const isError = hasError(error || null);
14
+ const tableLoading = isLoading !== null && isLoading !== void 0 ? isLoading : true;
15
+ const axiosError = error && isAxiosError(error) ? error : null;
16
+ const tableError = !isLoading && rows.length === 0 && isError && !isNotFoundError(axiosError);
17
+ const tableEmpty = !isLoading && rows.length === 0;
18
+ const hasTimeoutError = isTimeoutError(axiosError);
19
+ const showNoDataView = tableLoading || tableError || tableEmpty || hasTimeoutError;
20
+ return {
21
+ isError,
22
+ tableLoading,
23
+ tableError,
24
+ tableEmpty,
25
+ hasTimeoutError,
26
+ showNoDataView,
27
+ };
28
+ }, [rows.length, isLoading, error]);
29
+ const tableMetrics = useMemo(() => {
30
+ const lastItemIndex = rows.length - 1;
31
+ const areTotalRowsNotFillingHeight = isHeightNotFullyFilledByRows(rows.length) && !tableStates.tableLoading;
32
+ const itemsCount = (isDelayedFetchingNextPage !== null && isDelayedFetchingNextPage !== void 0 ? isDelayedFetchingNextPage : false) || areAllRowsLoaded ? rows.length + 1 : rows.length;
33
+ return {
34
+ lastItemIndex,
35
+ areTotalRowsNotFillingHeight,
36
+ itemsCount,
37
+ };
38
+ }, [rows.length, tableStates.tableLoading, isDelayedFetchingNextPage, areAllRowsLoaded]);
39
+ return Object.assign(Object.assign(Object.assign({}, tableStates), tableMetrics), { isDelayedFetchingNextPage: isDelayedFetchingNextPage !== null && isDelayedFetchingNextPage !== void 0 ? isDelayedFetchingNextPage : false });
40
+ };
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ export interface TableState {
3
+ selectedCell: string | null;
4
+ selectedColumn: string | null;
5
+ showBackDrop: boolean;
6
+ }
7
+ export declare const useTableState: () => {
8
+ selectedCell: string | null;
9
+ selectedColumn: string | null;
10
+ showBackDrop: boolean;
11
+ setShowBackdrop: import("react").Dispatch<import("react").SetStateAction<boolean>>;
12
+ handleCellClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
13
+ handleColumnClick: (columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
14
+ resetSelection: () => void;
15
+ };
@@ -0,0 +1,31 @@
1
+ import { useState, useCallback } from 'react';
2
+ export const useTableState = () => {
3
+ const [selectedCell, setSelectedCell] = useState(null);
4
+ const [selectedColumn, setSelectedColumn] = useState(null);
5
+ const [showBackDrop, setShowBackdrop] = useState(false);
6
+ const handleCellClick = useCallback((rowIndex, columnIndex, event, pinnedType) => {
7
+ event.stopPropagation();
8
+ const cellKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${rowIndex}-${columnIndex}`;
9
+ setSelectedCell((prev) => (prev === cellKey ? null : cellKey));
10
+ setSelectedColumn(null);
11
+ }, []);
12
+ const handleColumnClick = useCallback((columnIndex, event, pinnedType) => {
13
+ event.stopPropagation();
14
+ const columnKey = `${pinnedType !== null && pinnedType !== void 0 ? pinnedType : 'default'}-${columnIndex}`;
15
+ setSelectedColumn((prev) => (prev === columnKey ? null : columnKey));
16
+ setSelectedCell(null);
17
+ }, []);
18
+ const resetSelection = useCallback(() => {
19
+ setSelectedCell(null);
20
+ setSelectedColumn(null);
21
+ }, []);
22
+ return {
23
+ selectedCell,
24
+ selectedColumn,
25
+ showBackDrop,
26
+ setShowBackdrop,
27
+ handleCellClick,
28
+ handleColumnClick,
29
+ resetSelection,
30
+ };
31
+ };
@@ -0,0 +1,44 @@
1
+ /// <reference types="react" />
2
+ import type { IColumnProps } from '../../../../types/index.js';
3
+ import type { TableRowProps } from '@mui/material/TableRow';
4
+ interface UseVirtualTableContainerProps<T = unknown> {
5
+ rowHeight: number;
6
+ areAllRowsLoaded?: boolean;
7
+ rows: T[];
8
+ isDelayedFetchingNextPage: boolean;
9
+ rowProps?: TableRowProps & {
10
+ onRowClick?: (row: T, index: number) => void;
11
+ };
12
+ scrollToIndex?: number;
13
+ footerProps?: {
14
+ totalCount?: number;
15
+ };
16
+ isError: boolean;
17
+ selectedCell: string | null;
18
+ selectedColumn: string | null;
19
+ handleCellClick: (rowIndex: number, columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
20
+ }
21
+ export declare const useVirtualTableContainer: <T = unknown>({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, handleCellClick, }: UseVirtualTableContainerProps<T>) => {
22
+ getItemSize: (index: number, height: number) => number;
23
+ getItemDataForContainer: (columnsData: IColumnProps[], isPinnedColumn: boolean, height: number) => {
24
+ columns: any;
25
+ isLoading: any;
26
+ rows: any;
27
+ rowProps: any;
28
+ scrollToIndex: any;
29
+ totalCount: any;
30
+ lastItemIndex: any;
31
+ isError: any;
32
+ areAllRowsLoaded: any;
33
+ limit: any;
34
+ newLoadedRowsEndIndex: any;
35
+ isSheetView: boolean;
36
+ isPinned: any;
37
+ selectedCell: any;
38
+ selectedColumn: any;
39
+ onCellClick: any;
40
+ containerHeight: any;
41
+ rowHeight: any;
42
+ };
43
+ };
44
+ export {};
@@ -0,0 +1,53 @@
1
+ import { useCallback, useMemo } from 'react';
2
+ import memoize from 'memoize-one';
3
+ const createItemData = memoize((columns, isLoading, rows, rowProps, scrollToIndex, lastItemIndex, totalCount, isError, areAllRowsLoaded, isPinned, selectedCell, selectedColumn, onCellClick, containerHeight, rowHeight) => ({
4
+ columns,
5
+ isLoading,
6
+ rows,
7
+ rowProps,
8
+ scrollToIndex,
9
+ totalCount,
10
+ lastItemIndex,
11
+ isError,
12
+ areAllRowsLoaded,
13
+ limit: totalCount,
14
+ newLoadedRowsEndIndex: lastItemIndex,
15
+ isSheetView: true,
16
+ isPinned,
17
+ selectedCell,
18
+ selectedColumn,
19
+ onCellClick,
20
+ containerHeight,
21
+ rowHeight,
22
+ }));
23
+ export const useVirtualTableContainer = ({ rowHeight, areAllRowsLoaded, rows, isDelayedFetchingNextPage, rowProps, scrollToIndex, footerProps, isError, selectedCell, selectedColumn, handleCellClick, }) => {
24
+ const getItemSize = useCallback((index, height) => {
25
+ const isLastRow = areAllRowsLoaded && index === rows.length;
26
+ if (isLastRow) {
27
+ const usedHeight = rows.length * rowHeight;
28
+ const remainingHeight = height - usedHeight;
29
+ const minimumLastRowHeight = rowHeight * 2;
30
+ return Math.max(remainingHeight, minimumLastRowHeight);
31
+ }
32
+ return rowHeight;
33
+ }, [areAllRowsLoaded, rows.length, rowHeight]);
34
+ const commonItemDataParams = useMemo(() => {
35
+ var _a;
36
+ return [
37
+ isDelayedFetchingNextPage,
38
+ rows,
39
+ rowProps,
40
+ scrollToIndex,
41
+ rows.length - 1,
42
+ (_a = footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount) !== null && _a !== void 0 ? _a : 0,
43
+ isError,
44
+ areAllRowsLoaded,
45
+ ];
46
+ }, [isDelayedFetchingNextPage, rows, rowProps, scrollToIndex, footerProps === null || footerProps === void 0 ? void 0 : footerProps.totalCount, isError, areAllRowsLoaded]);
47
+ const commonItemDataSuffix = useMemo(() => [selectedCell, selectedColumn, handleCellClick], [selectedCell, selectedColumn, handleCellClick]);
48
+ const getItemDataForContainer = useCallback((columnsData, isPinnedColumn, height) => createItemData(columnsData, ...commonItemDataParams, isPinnedColumn, ...commonItemDataSuffix, height, rowHeight), [commonItemDataParams, commonItemDataSuffix, rowHeight]);
49
+ return {
50
+ getItemSize,
51
+ getItemDataForContainer,
52
+ };
53
+ };
@@ -1,3 +1,5 @@
1
1
  export { default as SheetViewVirtualTable } from './SheetViewVirtualTable';
2
2
  export { default as SheetViewTableHeader } from './components/SheetViewTableHeader';
3
3
  export * from './style';
4
+ export * from './hooks';
5
+ export * from './components';
@@ -1,3 +1,5 @@
1
1
  export { default as SheetViewVirtualTable } from './SheetViewVirtualTable';
2
2
  export { default as SheetViewTableHeader } from './components/SheetViewTableHeader';
3
3
  export * from './style';
4
+ export * from './hooks';
5
+ export * from './components';
@@ -0,0 +1,89 @@
1
+ import type { IColumnProps, IVirtualTable, TablePosition, SortingOrder, TableFooterProps } from '../../../types/index.js';
2
+ import { type TableHeadProps } from '@mui/material/TableHead';
3
+ import { type CSSProperties } from 'react';
4
+ export interface ISheetViewVirtualTable extends Omit<IVirtualTable, 'isSheetView'> {
5
+ onColumnPin?: (columnId: string, isPinned: boolean) => void;
6
+ isPinnable?: boolean;
7
+ clearBackdropVisibilityTimeout?: number;
8
+ }
9
+ export interface SheetViewTableHeaderProps {
10
+ columns: IColumnProps[];
11
+ headerProps?: TableHeadProps;
12
+ columnsSorting?: IVirtualTable['columnsSorting'];
13
+ onColumnSort?: IVirtualTable['onColumnSort'];
14
+ showBackDrop: boolean;
15
+ pinnedColumns?: string[];
16
+ onColumnPin?: (columnId: string, position: 'start' | 'end' | 'unpin') => void;
17
+ isPinnable?: boolean;
18
+ lastColumnId?: string | null;
19
+ selectedColumn?: string | null;
20
+ onColumnClick?: (columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
21
+ tablePosition?: TablePosition;
22
+ hasPinnedStart?: boolean;
23
+ hasPinnedEnd?: boolean;
24
+ }
25
+ export interface VirtualTableContainerProps {
26
+ columnsData: IColumnProps[];
27
+ containerKey: 'pinnedStart' | 'pinnedEnd' | 'scrollable';
28
+ isPinned?: boolean;
29
+ fixedWidth?: number;
30
+ }
31
+ export interface CommonTableProps {
32
+ showHeader?: boolean;
33
+ columnsSorting?: Record<string, SortingOrder>;
34
+ onColumnSort?: (columnsSorting: Record<string, SortingOrder>) => void;
35
+ headerProps?: TableHeadProps;
36
+ showBackDrop: boolean;
37
+ onColumnPin: (columnId: string, position: 'start' | 'end' | 'unpin') => void;
38
+ isPinnable: boolean;
39
+ lastColumnId?: string | null;
40
+ selectedColumn?: string | null;
41
+ onColumnClick?: (columnIndex: number, event: React.MouseEvent, pinnedType?: 'start' | 'end') => void;
42
+ tableTitle?: string;
43
+ areAllRowsLoaded?: boolean;
44
+ isFetchingNextPage?: boolean;
45
+ scrollToIndex?: number;
46
+ isLoading?: boolean;
47
+ isError: boolean;
48
+ hasTimeoutError: boolean;
49
+ tableMode?: string;
50
+ showNoDataView: boolean;
51
+ tableBodyStyles?: CSSProperties;
52
+ }
53
+ export interface PinnedColumnProps extends CommonTableProps {
54
+ position: 'start' | 'end';
55
+ columnsData: IColumnProps[];
56
+ columnsWidth: number;
57
+ pinnedColumnsList: string[];
58
+ hasPinnedStart: boolean;
59
+ hasPinnedEnd: boolean;
60
+ createVirtualTableContainer: (columnsData: IColumnProps[], containerKey: 'pinnedStart' | 'pinnedEnd' | 'scrollable', isPinned?: boolean, fixedWidth?: number) => JSX.Element;
61
+ tableLoading: boolean;
62
+ }
63
+ export interface MainTableProps extends CommonTableProps {
64
+ hasPinnedStart: boolean;
65
+ hasPinnedEnd: boolean;
66
+ unpinnedColumnsData: IColumnProps[];
67
+ pinnedStartColumns: string[];
68
+ pinnedEndColumns: string[];
69
+ createVirtualTableContainer: (columnsData: IColumnProps[], containerKey: 'pinnedStart' | 'pinnedEnd' | 'scrollable', isPinned?: boolean, fixedWidth?: number) => JSX.Element;
70
+ tableLoading: boolean;
71
+ }
72
+ export interface NoDataViewProps extends CommonTableProps {
73
+ tableLoading: boolean;
74
+ tableError: boolean;
75
+ tableEmpty: boolean;
76
+ hasTimeoutError: boolean;
77
+ orderedColumns: IColumnProps[];
78
+ error?: Error | null;
79
+ triggerDataRefetch?: () => Promise<unknown>;
80
+ footerProps?: TableFooterProps;
81
+ }
82
+ export interface LoadingMainTableProps extends CommonTableProps {
83
+ hasPinnedStart: boolean;
84
+ hasPinnedEnd: boolean;
85
+ unpinnedColumnsData: IColumnProps[];
86
+ pinnedStartColumns: string[];
87
+ pinnedEndColumns: string[];
88
+ tableLoading: boolean;
89
+ }
@@ -15,12 +15,12 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
15
15
  }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
16
16
  export declare const Title: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
17
17
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
18
- }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "className" | "classes" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
18
+ }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "border" | "borderColor" | "borderBottom" | "flex" | "display" | "alignItems" | "className" | "classes" | "children" | "borderTop" | "borderRight" | "borderLeft" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
19
19
  component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
20
20
  } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
21
21
  export declare const ValueWrapper: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
22
22
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
23
- }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "className" | "classes" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
23
+ }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "border" | "borderColor" | "borderBottom" | "flex" | "display" | "alignItems" | "className" | "classes" | "children" | "borderTop" | "borderRight" | "borderLeft" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
24
24
  component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
25
25
  } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
26
26
  export declare const Value: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
@@ -1,12 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
2
+ import { useRef, useState } from 'react';
3
3
  import Box from '@mui/material/Box';
4
4
  import ColumnFilter from '../../../../../VirtualTables/components/ColumnFilter';
5
5
  import ColumnSort from '../../../../../VirtualTables/components/ColumnSort';
6
- import { StyledCell } from '../../../../../VirtualTables/components/style';
6
+ import { StyledCell, TableHeaderInner } from '../../../../../VirtualTables/components/style';
7
7
  export function TableCell({ column: { header, id, align, headerStyle, sortable, filter, width, order }, isFirst, isLast, isSheetView, onColumnSort, columnsSorting, }) {
8
8
  const [columnFilterEl, setColumnFilterEl] = useState(null);
9
- return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, isFirst: isFirst, isLast: isLast, onClick: (event) => {
10
- setColumnFilterEl(event.currentTarget);
11
- }, sx: (theme) => (Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: width, textAlign: align, overflow: 'unset', fontWeight: 600 }, headerStyle)), isSheetView: isSheetView }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && _jsx(ColumnSort, { onColumnSort: onColumnSort, columnsSorting: columnsSorting, columnId: id })] })));
9
+ const cellRef = useRef(null);
10
+ const onOpenFilterDropdown = () => {
11
+ setColumnFilterEl(cellRef.current);
12
+ };
13
+ return (_jsx(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "data-column-id": id, "data-column-width": width, "data-column-width-used": width, "data-column-align": align, "data-column-order": order, "data-column-header": typeof header === 'string' ? header : 'component', "data-column-sortable": !!sortable, "data-column-filterable": !!filter, isFirst: isFirst, isLast: isLast, ref: cellRef, sx: (theme) => (Object.assign({ paddingInline: '0.6875rem', paddingLeft: isFirst ? '0' : '0.6875rem', paddingRight: isLast ? '0' : '0.6875rem', display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: width, textAlign: align, overflow: 'unset', fontWeight: 600 }, headerStyle)), isSheetView: isSheetView }, { children: _jsxs(TableHeaderInner, Object.assign({ onClick: onOpenFilterDropdown }, { children: [typeof header === 'function' ? (header()) : (_jsx(Box, Object.assign({ "data-testid": "TableHeader_columns_header", sx: { maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, { children: header && (_jsx("span", Object.assign({ style: { textOverflow: 'ellipsis', width: '80%', overflow: 'hidden' }, "data-testid": "VirtualTable_TableHeader_StyledCell_header_text" }, { children: header }))) }))), filter && _jsx(ColumnFilter, Object.assign({}, filter, { anchorEl: columnFilterEl, setAnchorEl: setColumnFilterEl })), sortable && _jsx(ColumnSort, { onColumnSort: onColumnSort, columnsSorting: columnsSorting, columnId: id })] })) })));
12
14
  }
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
3
  import { memo, useMemo } from 'react';
4
4
  import { areEqual } from 'react-window';
5
5
  import { StyledCell, StyledTableRow } from './style';
6
- import { getSelectionStyles } from '../utils/getSelectionStyles';
6
+ import { getSelectionStyles } from '../../../utils/index.js';
7
7
  function TableRow({ row, columns, index, rowProps, isSheetView, selectedCell = null, selectedColumn = null, onCellClick, isLastRow = false, }) {
8
8
  const renderCell = (column) => {
9
9
  const { render, format, selector } = column;
@@ -19,6 +19,9 @@ export declare const StyledCell: import("@emotion/styled").StyledComponent<impor
19
19
  isSheetView?: boolean | undefined;
20
20
  isSelected?: boolean | undefined;
21
21
  }, {}, {}>;
22
+ export declare const TableHeaderInner: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
23
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
24
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
22
25
  interface StyledVirtualListProps {
23
26
  areTotalRowsNotFillingHeight: boolean;
24
27
  isSheetView?: boolean;
@@ -49,6 +49,12 @@ export const StyledCell = styled(TableCell, {
49
49
  },
50
50
  }));
51
51
  });
52
+ export const TableHeaderInner = styled(Box)(({ theme }) => ({
53
+ zIndex: 1,
54
+ display: 'flex',
55
+ gap: theme.spacing(0.5),
56
+ alignItems: 'center',
57
+ }));
52
58
  export const StyledVirtualList = styled(VirtualScrollList, {
53
59
  shouldForwardProp: (prop) => !['areTotalRowsNotFillingHeight', 'isSheetView'].includes(prop),
54
60
  })(({ theme, areTotalRowsNotFillingHeight, isSheetView }) => (Object.assign({ backgroundColor: areTotalRowsNotFillingHeight ? 'transparent' : theme.palette.background.default }, (isSheetView && {
@@ -13,7 +13,7 @@ export declare const ListItemStyled: import("@emotion/styled").StyledComponent<i
13
13
  }, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
14
14
  export declare const ItemText: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
15
15
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
16
- }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "className" | "classes" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
16
+ }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "border" | "borderColor" | "borderBottom" | "flex" | "display" | "alignItems" | "className" | "classes" | "children" | "borderTop" | "borderRight" | "borderLeft" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
17
17
  component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
18
18
  } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
19
19
  export declare const ItemTextWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare const TitleStyled: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
3
3
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
4
- }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "className" | "classes" | "children" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
4
+ }, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "m" | "order" | "p" | "style" | "color" | "border" | "borderColor" | "borderBottom" | "flex" | "display" | "alignItems" | "className" | "classes" | "children" | "borderTop" | "borderRight" | "borderLeft" | "borderRadius" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignContent" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "boxShadow" | "maxWidth" | "minWidth" | "maxHeight" | "boxSizing" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & {
5
5
  component?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
6
6
  } & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
7
7
  export declare const StyledWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -256,6 +256,11 @@ export declare const savedStatusIcon: string;
256
256
  export declare const scheduledStatusIcon: string;
257
257
  export declare const pendingStatusIcon: string;
258
258
  export declare const refundedStatusIcon: string;
259
+ export declare const activeLeadStatusIcon: string;
260
+ export declare const completedLeadStatusIcon: string;
261
+ export declare const closedLeadStatusIcon: string;
262
+ export declare const expiredLeadStatusIcon: string;
263
+ export declare const readyLeadStatusIcon: string;
259
264
  export declare const newFileIcon: string;
260
265
  export declare const teamWindowIcon: string;
261
266
  export declare const blueAppsIcon: string;
@@ -260,6 +260,11 @@ export const savedStatusIcon = `${appBaseUrl}/savedStatus1.svg`;
260
260
  export const scheduledStatusIcon = `${appBaseUrl}/scheduledStatus1.svg`;
261
261
  export const pendingStatusIcon = `${appBaseUrl}/invoicePendingStatus2.svg`;
262
262
  export const refundedStatusIcon = `${appBaseUrl}/invoiceRefundedStatus2.svg`;
263
+ export const activeLeadStatusIcon = `${lightUrl}/activeLeadStatus.svg`;
264
+ export const completedLeadStatusIcon = `${lightUrl}/completedLeadStatus.svg`;
265
+ export const closedLeadStatusIcon = `${lightUrl}/closedLeadStatus.svg`;
266
+ export const expiredLeadStatusIcon = `${lightUrl}/expiredLeadStatus.svg`;
267
+ export const readyLeadStatusIcon = `${lightUrl}/readyLeadStatus.svg`;
263
268
  export const newFileIcon = `${lightUrl}/newFileIcon.svg`;
264
269
  export const teamWindowIcon = `${lightUrl}/teamWindowIcon.svg`;
265
270
  export const blueAppsIcon = `${lightUrl}/blueAppsIcon.svg`;
@@ -40,3 +40,4 @@ export * from './toggleOptions';
40
40
  export * from './flag';
41
41
  export * from './encrypt';
42
42
  export * from './day';
43
+ export * from './style';
@@ -40,3 +40,4 @@ export * from './toggleOptions';
40
40
  export * from './flag';
41
41
  export * from './encrypt';
42
42
  export * from './day';
43
+ export * from './style';
@@ -0,0 +1,9 @@
1
+ interface GetSelectionStylesParams {
2
+ isSelected: boolean;
3
+ isCellSelected: boolean;
4
+ isColumnSelected: boolean;
5
+ isLastRow: boolean;
6
+ }
7
+ type SelectionStyles = Record<string, string | Record<string, string>>;
8
+ export declare const getSelectionStyles: ({ isSelected, isCellSelected, isColumnSelected, isLastRow }: GetSelectionStylesParams) => SelectionStyles;
9
+ export {};
@@ -0,0 +1,62 @@
1
+ const SELECTION_COLORS = {
2
+ primary: '#1F88D0',
3
+ background: 'white',
4
+ border: '#F2F2F2',
5
+ transparent: 'transparent',
6
+ };
7
+ const BORDER_STYLES = {
8
+ thin: '1px',
9
+ thick: '1.5px',
10
+ none: '0px',
11
+ };
12
+ const CELL_DIMENSIONS = {
13
+ minHeight: '28px',
14
+ fullHeight: '100%',
15
+ };
16
+ export const getSelectionStyles = ({ isSelected, isCellSelected, isColumnSelected, isLastRow }) => {
17
+ if (!isSelected) {
18
+ return {};
19
+ }
20
+ if (isCellSelected && !isColumnSelected) {
21
+ return getSingleCellSelectionStyles();
22
+ }
23
+ if (isColumnSelected) {
24
+ return getColumnSelectionStyles(isLastRow);
25
+ }
26
+ return {};
27
+ };
28
+ const getSingleCellSelectionStyles = () => ({
29
+ border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
30
+ backgroundColor: SELECTION_COLORS.background,
31
+ color: SELECTION_COLORS.primary,
32
+ '&:before': {
33
+ border: `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.primary}`,
34
+ },
35
+ });
36
+ const getColumnSelectionStyles = (isLastRow) => {
37
+ const borderWidth = getBorderWidthForColumn(isLastRow);
38
+ const borderBottom = getBorderBottomForColumn(isLastRow);
39
+ return {
40
+ borderWidth,
41
+ borderStyle: 'solid',
42
+ borderColor: SELECTION_COLORS.primary,
43
+ borderBottom,
44
+ height: CELL_DIMENSIONS.fullHeight,
45
+ minHeight: CELL_DIMENSIONS.minHeight,
46
+ display: 'flex',
47
+ alignItems: 'center',
48
+ '&:before': {
49
+ borderWidth,
50
+ borderBottom: isLastRow
51
+ ? `${BORDER_STYLES.thick} solid ${SELECTION_COLORS.primary}`
52
+ : `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.transparent}`,
53
+ },
54
+ };
55
+ };
56
+ const getBorderWidthForColumn = (isLastRow) => {
57
+ const { none, thick } = BORDER_STYLES;
58
+ return isLastRow ? `${none} ${thick} ${thick} ${thick}` : `${none} ${thick} ${none} ${thick}`;
59
+ };
60
+ const getBorderBottomForColumn = (isLastRow) => {
61
+ return isLastRow ? `${BORDER_STYLES.thick} solid ${SELECTION_COLORS.primary}` : `${BORDER_STYLES.thin} solid ${SELECTION_COLORS.border}`;
62
+ };
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.22",
5
- "testVersion": 0,
4
+ "version": "0.1.24-test.1",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -131,4 +131,4 @@
131
131
  "publishConfig": {
132
132
  "registry": "https://registry.npmjs.org/"
133
133
  }
134
- }
134
+ }