@tap-payments/os-micro-frontend-shared 0.0.272 → 0.0.273-test.3-test.4
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/VirtualTable/SheetView/SheetViewTableHeader.js +8 -1
- package/build/components/VirtualTable/SheetView/style.js +1 -0
- package/build/components/VirtualTable/VirtualTable.js +1 -1
- package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.d.ts +2 -2
- package/build/components/VirtualTable/components/ColumnFilter/ColumnFilter.js +10 -9
- package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.d.ts +2 -1
- package/build/components/VirtualTable/components/ColumnFilter/Inputs/Inputs.js +4 -4
- package/build/components/VirtualTable/components/ColumnFilter/List/List.d.ts +2 -2
- package/build/components/VirtualTable/components/ColumnFilter/List/List.js +4 -4
- package/build/components/VirtualTable/components/ColumnFilter/type.d.ts +7 -0
- package/build/components/VirtualTable/components/ColumnFilter/type.js +1 -0
- package/build/components/VirtualTable/components/TableHeader/TableHeader.d.ts +14 -0
- package/build/components/VirtualTable/components/{TableHeader.js → TableHeader/TableHeader.js} +10 -30
- package/build/components/VirtualTable/components/TableHeader/constant.d.ts +5 -0
- package/build/components/VirtualTable/components/TableHeader/constant.js +6 -0
- package/build/components/VirtualTable/components/TableHeader/index.d.ts +2 -0
- package/build/components/VirtualTable/components/TableHeader/index.js +2 -0
- package/build/components/VirtualTable/components/TableHeader/style.d.ts +8 -0
- package/build/components/VirtualTable/components/TableHeader/style.js +21 -0
- package/build/components/VirtualTable/components/TableHeader/type.d.ts +0 -0
- package/build/components/VirtualTable/components/TableHeader/type.js +1 -0
- package/build/components/VirtualTable/components/index.d.ts +1 -1
- package/build/components/VirtualTable/components/index.js +1 -1
- package/build/components/VirtualTable/style.js +1 -1
- package/build/utils/date.js +1 -1
- package/package.json +3 -3
- package/build/components/VirtualTable/components/TableHeader.d.ts +0 -27
|
@@ -8,9 +8,11 @@ import { StyledCell } from '../style';
|
|
|
8
8
|
import { ActionIcon, ColumnIcon, PinIconContainer, StyledHeader, StyledMUITableRow, HeaderText } from './style';
|
|
9
9
|
function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, pinnedColumns = [], onColumnPin, isPinnable = false, lastColumnId, selectedColumn = null, onColumnClick, }) {
|
|
10
10
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
11
|
+
const [columnFilterEl, setColumnFilterEl] = useState(null);
|
|
11
12
|
const open = Boolean(anchorEl);
|
|
12
13
|
const theme = useTheme();
|
|
13
14
|
const handleClick = (event) => {
|
|
15
|
+
event.stopPropagation();
|
|
14
16
|
setAnchorEl(event.currentTarget);
|
|
15
17
|
};
|
|
16
18
|
const handleClose = () => {
|
|
@@ -45,7 +47,12 @@ function SheetViewTableHeader({ columns, headerProps, showBackDrop, onColumnSort
|
|
|
45
47
|
const isPinned = pinnedColumns.includes(id);
|
|
46
48
|
const isDefaultPinned = !!column.isDefaultPinned;
|
|
47
49
|
const isSelected = selectedColumn === id;
|
|
48
|
-
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell", "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, "data-column-pinned": isPinned, isFirst: isFirst, isLast: isLast, isSheetView: true, onClick: (event) =>
|
|
50
|
+
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "SheetViewVirtualTable_TableHeader_StyledCell", "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, "data-column-pinned": isPinned, isFirst: isFirst, isLast: isLast, isSheetView: true, onClick: (event) => {
|
|
51
|
+
onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event);
|
|
52
|
+
setColumnFilterEl(event.currentTarget);
|
|
53
|
+
}, sx: Object.assign({ display: 'flex', gap: theme.spacing(0.5), alignItems: 'center', justifyContent: align === 'right' ? 'flex-end' : 'flex-start', width: column.width, textAlign: align, overflow: 'unset', cursor: 'pointer', boxSizing: 'border-box', border: isSelected ? '2px solid #1F88D0' : '1px solid #F2F2F2', backgroundColor: isSelected ? '#F2F2F2' : '#FCFCFC', height: isSelected ? '100%' : 'auto', minHeight: isSelected ? '28px' : 'auto' }, headerStyle) }, { 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, onClose: (event) => {
|
|
54
|
+
onColumnClick === null || onColumnClick === void 0 ? void 0 : onColumnClick(id, event);
|
|
55
|
+
} }))), sortable && (_jsx(Box, Object.assign({ sx: { diplay: 'flex', alignItems: 'center' } }, { children: _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id }) }))), isPinnable && pinnable && !isDefaultPinned && !isLast && (_jsx(PinIconContainer, Object.assign({ onClick: (event) => {
|
|
49
56
|
event.stopPropagation();
|
|
50
57
|
handlePinClick(id);
|
|
51
58
|
}, title: isPinned ? 'Unpin column' : 'Pin column' }, { children: _jsx("img", { src: isPinned ? unpinIcon : pinIcon, alt: "pin-icon" }) })))] }), `${id}-${colIndex}`));
|
|
@@ -17,7 +17,7 @@ import { TABLE_ROW_HEIGHT, TABLE_THRESHOLD, TABLE_LIST_OVER_SCAN, SHEET_VIEW_TAB
|
|
|
17
17
|
import { useDelayToSetValue } from '../../hooks/index.js';
|
|
18
18
|
import { isHeightNotFullyFilledByRows, isNotFoundError, isTimeoutError, hasError } from '../../utils/index.js';
|
|
19
19
|
import TableFooter from './components/TableFooter/TableFooter';
|
|
20
|
-
import TableHeader from './components/TableHeader';
|
|
20
|
+
import TableHeader from './components/TableHeader/TableHeader';
|
|
21
21
|
import TableLastItem from './components/TableLastItem';
|
|
22
22
|
import TableNoData from './components/TableNoData';
|
|
23
23
|
import ListItemWrapper from './components/virtualScroll/ListItemWrapper';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
declare function ColumnFilter(filter:
|
|
2
|
+
import { ColumnFilterProps } from './type';
|
|
3
|
+
declare function ColumnFilter(filter: ColumnFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof ColumnFilter>;
|
|
5
5
|
export default _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useMemo
|
|
2
|
+
import { memo, useMemo } from 'react';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
|
-
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
5
4
|
import Popper from '@mui/material/Popper';
|
|
6
5
|
import { closeIcon, columnIcon, whiteFilterIcon } from '../../../../constants/index.js';
|
|
7
6
|
import Inputs from './Inputs';
|
|
@@ -9,12 +8,14 @@ import List from './List';
|
|
|
9
8
|
import { FilterWrapper } from './style';
|
|
10
9
|
import CustomBackdrop from '../../../CustomBackdrop';
|
|
11
10
|
function ColumnFilter(filter) {
|
|
12
|
-
const
|
|
11
|
+
const { anchorEl, setAnchorEl, onClose } = filter;
|
|
13
12
|
const openDropdown = (event) => {
|
|
14
13
|
setAnchorEl(event.currentTarget);
|
|
15
14
|
};
|
|
16
|
-
const onCloseDropdown = () => {
|
|
15
|
+
const onCloseDropdown = (event) => {
|
|
16
|
+
event.stopPropagation();
|
|
17
17
|
setAnchorEl(null);
|
|
18
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event);
|
|
18
19
|
};
|
|
19
20
|
const filterData = useMemo(() => { var _a; return ((_a = filter === null || filter === void 0 ? void 0 : filter.options) === null || _a === void 0 ? void 0 : _a.reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = filter === null || filter === void 0 ? void 0 : filter.data) === null || _a === void 0 ? void 0 : _a[apiKey] })); }, {})) || {}; }, [filter]);
|
|
20
21
|
const listFilterData = useMemo(() => {
|
|
@@ -50,10 +51,10 @@ function ColumnFilter(filter) {
|
|
|
50
51
|
}
|
|
51
52
|
return null;
|
|
52
53
|
}, [open, filter, anchorEl, setAnchorEl]);
|
|
53
|
-
return (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
return (_jsxs(Box, Object.assign({ component: "section", "data-testid": "ColumnFilter", sx: { position: 'relative', display: 'flex', alignItems: 'center' } }, { children: [showClearIcon ? (_jsxs(FilterWrapper, { children: [_jsx(Box, { component: "img", "data-testid": "ColumnFilter_whiteFilterIcon", src: whiteFilterIcon, alt: "filter-icon", sx: { marginInlineEnd: '2px', height: 6 }, onClick: openDropdown }), _jsx(Box, { component: "img", "data-testid": "ColumnFilter_closeIcon", src: closeIcon, alt: "close-icon", onClick: () => {
|
|
55
|
+
filter.onClear(filterApiKeys);
|
|
56
|
+
} })] })) : (_jsx(Box, { component: "img", "data-testid": "ColumnFilter_columnIcon", src: columnIcon, alt: "column-icon", sx: { cursor: 'pointer', marginTop: '2px' }, onClick: openDropdown })), open && _jsx(CustomBackdrop, { onClick: onCloseDropdown }), _jsx(Popper, Object.assign({ open: open, anchorEl: anchorEl, placement: "bottom-start", sx: {
|
|
57
|
+
zIndex: 9999,
|
|
58
|
+
} }, { children: renderFilter }))] })));
|
|
58
59
|
}
|
|
59
60
|
export default memo(ColumnFilter);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
1
2
|
import type { IColumnFilter, IColumnFilterInputs } from '../../../../../types/index.js';
|
|
2
3
|
interface InputsI {
|
|
3
|
-
onCloseDropdown: () => void;
|
|
4
|
+
onCloseDropdown: (e: MouseEvent<HTMLElement>) => void;
|
|
4
5
|
filter: IColumnFilter & IColumnFilterInputs;
|
|
5
6
|
}
|
|
6
7
|
declare function Inputs({ onCloseDropdown, filter: { options, onConfirm, data, isOnlyOneFilter, onColumnFilterClearClick, wrapperSx } }: InputsI): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,12 +13,12 @@ function Inputs({ onCloseDropdown, filter: { options = [], onConfirm, data, isOn
|
|
|
13
13
|
setValues((options || []).reduce((acc, { apiKey }) => { var _a; return (Object.assign(Object.assign({}, acc), { [apiKey]: (_a = data === null || data === void 0 ? void 0 : data[apiKey]) !== null && _a !== void 0 ? _a : '' })); }, {}));
|
|
14
14
|
}, []);
|
|
15
15
|
const { t } = useTranslation();
|
|
16
|
-
const onClickOkay = () => {
|
|
16
|
+
const onClickOkay = (e) => {
|
|
17
17
|
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(values);
|
|
18
|
-
onCloseDropdown();
|
|
18
|
+
onCloseDropdown(e);
|
|
19
19
|
};
|
|
20
|
-
const onClickCancel = () => {
|
|
21
|
-
onCloseDropdown();
|
|
20
|
+
const onClickCancel = (e) => {
|
|
21
|
+
onCloseDropdown(e);
|
|
22
22
|
};
|
|
23
23
|
const onClickClear = () => {
|
|
24
24
|
onColumnFilterClearClick === null || onColumnFilterClearClick === void 0 ? void 0 : onColumnFilterClearClick();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { MouseEvent } from 'react';
|
|
2
2
|
import type { IColumnFilter, IColumnFilterList } from '../../../../../types/index.js';
|
|
3
3
|
interface ListI {
|
|
4
|
-
onCloseDropdown: () => void;
|
|
4
|
+
onCloseDropdown: (e: MouseEvent<HTMLElement>) => void;
|
|
5
5
|
filter: IColumnFilter & IColumnFilterList;
|
|
6
6
|
styles?: React.CSSProperties;
|
|
7
7
|
}
|
|
@@ -25,10 +25,10 @@ function List({ onCloseDropdown, filter, styles }) {
|
|
|
25
25
|
if (filter.options)
|
|
26
26
|
setItemsList(renderItems(filter.options));
|
|
27
27
|
}, [filter === null || filter === void 0 ? void 0 : filter.data]);
|
|
28
|
-
const onClickCancel = () => {
|
|
29
|
-
onCloseDropdown();
|
|
28
|
+
const onClickCancel = (e) => {
|
|
29
|
+
onCloseDropdown(e);
|
|
30
30
|
};
|
|
31
|
-
const onClickOkay = () => {
|
|
31
|
+
const onClickOkay = (e) => {
|
|
32
32
|
var _a;
|
|
33
33
|
const selectedValues = values.reduce((acc, { options, apiKey: parentKey, isSelected: isParentSelected }) => {
|
|
34
34
|
if (options) {
|
|
@@ -45,7 +45,7 @@ function List({ onCloseDropdown, filter, styles }) {
|
|
|
45
45
|
const selectedValueSet = new Set(selectedValues);
|
|
46
46
|
if (Object.keys(values).length)
|
|
47
47
|
(_a = filter === null || filter === void 0 ? void 0 : filter.onConfirm) === null || _a === void 0 ? void 0 : _a.call(filter, { [filter.apiKey]: [...selectedValueSet] });
|
|
48
|
-
onCloseDropdown();
|
|
48
|
+
onCloseDropdown(e);
|
|
49
49
|
};
|
|
50
50
|
const onUpdateMenuItems = (latestMenuItems) => {
|
|
51
51
|
const resetItems = (items) => items.map(({ name, selected, menuItems, label }) => (Object.assign(Object.assign(Object.assign({}, (label && { placeholder: label })), { apiKey: name, isSelected: selected }), ((menuItems === null || menuItems === void 0 ? void 0 : menuItems.length) && { options: resetItems(menuItems) }))));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
import { IColumnFilter } from '../../../../types/index.js';
|
|
3
|
+
export type ColumnFilterProps = IColumnFilter & {
|
|
4
|
+
anchorEl: HTMLElement | null;
|
|
5
|
+
setAnchorEl: (el: HTMLElement | null) => void;
|
|
6
|
+
onClose?: (e: MouseEvent<HTMLElement>) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type TableHeadProps } from '@mui/material';
|
|
3
|
+
import type { IColumnProps, IVirtualTable } from '../../../../types/index.js';
|
|
4
|
+
interface TableHeaderProps {
|
|
5
|
+
columns: IColumnProps[];
|
|
6
|
+
headerProps?: TableHeadProps;
|
|
7
|
+
columnsSorting?: IVirtualTable['columnsSorting'];
|
|
8
|
+
onColumnSort?: IVirtualTable['onColumnSort'];
|
|
9
|
+
showBackDrop: boolean;
|
|
10
|
+
isSheetView?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<typeof TableHeader>;
|
|
14
|
+
export default _default;
|
package/build/components/VirtualTable/components/{TableHeader.js → TableHeader/TableHeader.js}
RENAMED
|
@@ -1,36 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useState } from 'react';
|
|
3
3
|
import { Box, styled, useTheme } from '@mui/material';
|
|
4
|
-
import TableHead from '@mui/material/TableHead';
|
|
5
4
|
import MUITableRow from '@mui/material/TableRow';
|
|
6
|
-
import Dropdown from '
|
|
7
|
-
import { columnIcon,
|
|
8
|
-
import ColumnFilter from '
|
|
9
|
-
import { StyledCell } from '
|
|
10
|
-
|
|
11
|
-
flag: flagIcon,
|
|
12
|
-
dispute: disputeIcon,
|
|
13
|
-
refund: refundInitiatedIcon,
|
|
14
|
-
};
|
|
15
|
-
export const ActionIcon = styled('img')(() => ({
|
|
16
|
-
width: '13.3px',
|
|
17
|
-
height: '13.3px',
|
|
18
|
-
}));
|
|
19
|
-
export const ColumnIcon = styled('img')(() => ({
|
|
20
|
-
width: '8px',
|
|
21
|
-
height: '6.4px',
|
|
22
|
-
cursor: 'pointer',
|
|
23
|
-
}));
|
|
24
|
-
export const StyledHeader = styled(TableHead, {
|
|
25
|
-
shouldForwardProp: (prop) => prop !== 'showBackDrop',
|
|
26
|
-
})(({ showBackDrop, theme }) => ({
|
|
27
|
-
width: '100%',
|
|
28
|
-
minWidth: 'fit-content',
|
|
29
|
-
flex: '0 0 auto',
|
|
30
|
-
boxShadow: showBackDrop ? theme.shadows[23] : 'none',
|
|
31
|
-
backgroundColor: theme.palette.background.default,
|
|
32
|
-
zIndex: 1,
|
|
33
|
-
}));
|
|
5
|
+
import Dropdown from '../../../DropdownMenu';
|
|
6
|
+
import { columnIcon, sortAzIcon, sortZaIcon } from '../../../../constants/index.js';
|
|
7
|
+
import ColumnFilter from '../ColumnFilter';
|
|
8
|
+
import { StyledCell } from '../../style';
|
|
9
|
+
import { ActionIcon, ColumnIcon, StyledHeader } from './style';
|
|
34
10
|
const StyledMUITableRow = styled(MUITableRow, {
|
|
35
11
|
shouldForwardProp: (prop) => prop !== 'isSheetView',
|
|
36
12
|
})(({ theme, isSheetView }) => (Object.assign({ display: 'flex', justifyContent: 'flex-start', width: '100%', minWidth: 'fit-content', paddingInline: '32px', paddingBlock: '16px' }, (isSheetView && {
|
|
@@ -42,9 +18,11 @@ const StyledMUITableRow = styled(MUITableRow, {
|
|
|
42
18
|
}))));
|
|
43
19
|
function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView }) {
|
|
44
20
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
21
|
+
const [columnFilterEl, setColumnFilterEl] = useState(null);
|
|
45
22
|
const open = Boolean(anchorEl);
|
|
46
23
|
const theme = useTheme();
|
|
47
24
|
const handleClick = (event) => {
|
|
25
|
+
event.stopPropagation();
|
|
48
26
|
setAnchorEl(event.currentTarget);
|
|
49
27
|
};
|
|
50
28
|
const handleClose = () => {
|
|
@@ -62,7 +40,9 @@ function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columns
|
|
|
62
40
|
const { header, id, align, headerStyle, sortable, filter } = column;
|
|
63
41
|
const isFirst = id === columns[0].id;
|
|
64
42
|
const isLast = id === columns[columns.length - 1].id;
|
|
65
|
-
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "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: isFirst, isLast: isLast,
|
|
43
|
+
return (_jsxs(StyledCell, Object.assign({ "data-id": id, component: "div", "data-testid": "VirtualTable_TableHeader_StyledCell", "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: isFirst, isLast: isLast, onClick: (event) => {
|
|
44
|
+
setColumnFilterEl(event.currentTarget);
|
|
45
|
+
}, sx: 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: column.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(Box, Object.assign({ sx: { diplay: 'flex', alignItems: 'center' } }, { children: _jsx(ColumnIcon, { onClick: sortable ? handleClick : undefined, src: columnIcon, alt: "column-icon", "data-id": id }) })))] }), `${id}-${colIndex}`));
|
|
66
46
|
}) })), _jsx(Dropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: [
|
|
67
47
|
{
|
|
68
48
|
label: 'Sort A-Z',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ActionIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
3
|
+
export declare const ColumnIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
|
+
export declare const StyledHeader: import("@emotion/styled").StyledComponent<import("@mui/material/TableHead").TableHeadOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
|
|
6
|
+
}, "className" | "style" | "classes" | "children" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
7
|
+
showBackDrop: boolean;
|
|
8
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import TableHead from '@mui/material/TableHead';
|
|
3
|
+
export const ActionIcon = styled('img')(() => ({
|
|
4
|
+
width: '13.3px',
|
|
5
|
+
height: '13.3px',
|
|
6
|
+
}));
|
|
7
|
+
export const ColumnIcon = styled('img')(() => ({
|
|
8
|
+
width: '8px',
|
|
9
|
+
height: '6.4px',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
}));
|
|
12
|
+
export const StyledHeader = styled(TableHead, {
|
|
13
|
+
shouldForwardProp: (prop) => prop !== 'showBackDrop',
|
|
14
|
+
})(({ showBackDrop, theme }) => ({
|
|
15
|
+
width: '100%',
|
|
16
|
+
minWidth: 'fit-content',
|
|
17
|
+
flex: '0 0 auto',
|
|
18
|
+
boxShadow: showBackDrop ? theme.shadows[23] : 'none',
|
|
19
|
+
backgroundColor: theme.palette.background.default,
|
|
20
|
+
zIndex: 1,
|
|
21
|
+
}));
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -5,7 +5,7 @@ export * from './TableFooter';
|
|
|
5
5
|
export { default as TableFooter } from './TableFooter';
|
|
6
6
|
export * from './virtualScroll';
|
|
7
7
|
export * from './RowErrorState';
|
|
8
|
-
export { default as TableHeader } from './TableHeader';
|
|
8
|
+
export { default as TableHeader } from './TableHeader/TableHeader';
|
|
9
9
|
export { default as TableLastItem } from './TableLastItem';
|
|
10
10
|
export { default as TableLoading } from './TableLoading';
|
|
11
11
|
export { default as TableLoadingWithCard } from './TableLoadingWithCard';
|
|
@@ -5,7 +5,7 @@ export * from './TableFooter';
|
|
|
5
5
|
export { default as TableFooter } from './TableFooter';
|
|
6
6
|
export * from './virtualScroll';
|
|
7
7
|
export * from './RowErrorState';
|
|
8
|
-
export { default as TableHeader } from './TableHeader';
|
|
8
|
+
export { default as TableHeader } from './TableHeader/TableHeader';
|
|
9
9
|
export { default as TableLastItem } from './TableLastItem';
|
|
10
10
|
export { default as TableLoading } from './TableLoading';
|
|
11
11
|
export { default as TableLoadingWithCard } from './TableLoadingWithCard';
|
|
@@ -29,7 +29,7 @@ export const StyledSolidBackground = styled(Box)(({ theme }) => ({
|
|
|
29
29
|
backgroundColor: theme.palette.background.default,
|
|
30
30
|
}));
|
|
31
31
|
export const StyledCell = styled(TableCell, {
|
|
32
|
-
shouldForwardProp: (prop) => !['isLast', 'isFirst', 'isSheetView'].includes(prop),
|
|
32
|
+
shouldForwardProp: (prop) => !['isLast', 'isFirst', 'isSheetView', 'isSelected'].includes(prop),
|
|
33
33
|
})(({ theme, isLast, isFirst, isSheetView, isSelected }) => (Object.assign(Object.assign({ paddingBlock: '0', paddingInline: '0.3875rem !important', paddingLeft: isFirst ? '0 !important' : '0.3875rem !important', paddingRight: isLast ? '0 !important' : '0.3875rem !important', color: isSheetView ? theme.palette.text.primary : theme.palette.grey[700], fontSize: isSheetView ? theme.typography.subtitle1.fontSize : theme.typography.caption.fontSize, height: '100%', fontWeight: isSheetView ? 400 : theme.typography.fontWeightRegular, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: 'flex', alignItems: 'center' }, (isSheetView && {
|
|
34
34
|
borderRight: isLast ? 'none' : `1px solid ${theme.palette.divider}`,
|
|
35
35
|
paddingInline: '8px !important',
|
package/build/utils/date.js
CHANGED
|
@@ -58,7 +58,7 @@ export const formatUTCOffset = (offset = 0) => {
|
|
|
58
58
|
const paddedOffset = Math.abs(offset).toString().padStart(2, '0');
|
|
59
59
|
return `UTC${sign}${paddedOffset}:00`;
|
|
60
60
|
};
|
|
61
|
-
export const getDefaultDateRange = (startDay =
|
|
61
|
+
export const getDefaultDateRange = (startDay = 7) => {
|
|
62
62
|
const monthDaysMinus = dayjs().subtract(startDay, 'day').hour(0).minute(0).second(0).toDate();
|
|
63
63
|
const today = dayjs(new Date()).hour(23).minute(59).second(59).toDate();
|
|
64
64
|
return [monthDaysMinus, today];
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.0.273-test.3-test.4",
|
|
5
|
+
"testVersion": 4,
|
|
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
|
+
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { type TableHeadProps } from '@mui/material';
|
|
3
|
-
import type { IColumnProps, IVirtualTable } from '../../../types/index.js';
|
|
4
|
-
export declare const actionsIcons: {
|
|
5
|
-
flag: string;
|
|
6
|
-
dispute: string;
|
|
7
|
-
refund: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const ActionIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
10
|
-
export declare const ColumnIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
11
|
-
interface StyledHeaderProps {
|
|
12
|
-
showBackDrop: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare const StyledHeader: import("@emotion/styled").StyledComponent<import("@mui/material").TableHeadOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLTableSectionElement | null) => void) | import("react").RefObject<HTMLTableSectionElement> | null | undefined;
|
|
16
|
-
}, "className" | "style" | "classes" | "children" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & StyledHeaderProps, {}, {}>;
|
|
17
|
-
interface TableHeaderProps {
|
|
18
|
-
columns: IColumnProps[];
|
|
19
|
-
headerProps?: TableHeadProps;
|
|
20
|
-
columnsSorting?: IVirtualTable['columnsSorting'];
|
|
21
|
-
onColumnSort?: IVirtualTable['onColumnSort'];
|
|
22
|
-
showBackDrop: boolean;
|
|
23
|
-
isSheetView?: boolean;
|
|
24
|
-
}
|
|
25
|
-
declare function TableHeader({ columns, headerProps, showBackDrop, onColumnSort, columnsSorting, isSheetView }: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare const _default: import("react").MemoExoticComponent<typeof TableHeader>;
|
|
27
|
-
export default _default;
|