@tap-payments/os-micro-frontend-shared 0.0.128 → 0.0.129-sheetview-component-ui-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/DeviceIcon/DeviceIcon.d.ts +3 -1
- package/build/components/DeviceIcon/DeviceIcon.js +3 -3
- package/build/components/DeviceIcon/style.d.ts +4 -1
- package/build/components/DeviceIcon/style.js +4 -1
- package/build/components/MaskedText/MaskedText.d.ts +3 -0
- package/build/components/MaskedText/MaskedText.js +11 -0
- package/build/components/MaskedText/index.d.ts +3 -0
- package/build/components/MaskedText/index.js +2 -0
- package/build/components/MaskedText/type.d.ts +7 -0
- package/build/components/MaskedText/type.js +1 -0
- package/build/components/StatusButton/StatusButton.js +10 -9
- package/build/components/StatusChip/StatusChip.d.ts +4 -0
- package/build/components/StatusChip/StatusChip.js +19 -0
- package/build/components/StatusChip/index.d.ts +3 -0
- package/build/components/StatusChip/index.js +2 -0
- package/build/components/StatusChip/style.d.ts +14 -0
- package/build/components/StatusChip/style.js +32 -0
- package/build/components/StatusChip/type.d.ts +9 -0
- package/build/components/StatusChip/type.js +1 -0
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.d.ts +3 -1
- package/build/components/StatusIcons/AuthorizedIcon/AuthorizedIcon.js +4 -4
- package/build/components/StatusIcons/DeviceIcon/DeviceIcon.d.ts +3 -1
- package/build/components/StatusIcons/DeviceIcon/DeviceIcon.js +2 -2
- package/build/components/StatusIcons/IssuerIcon/IssuerIcon.d.ts +1 -1
- package/build/components/StatusIcons/IssuerIcon/IssuerIcon.js +2 -2
- package/build/components/StatusIcons/IssuerIcon/style.d.ts +4 -1
- package/build/components/StatusIcons/IssuerIcon/style.js +3 -4
- package/build/components/StatusIcons/IssuerIcon/type.d.ts +2 -0
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.d.ts +3 -1
- package/build/components/StatusIcons/PayoutIcon/PayoutIcon.js +7 -2
- package/build/components/TableCells/CustomCells/ActionCell/ActionCell.d.ts +3 -1
- package/build/components/TableCells/CustomCells/ActionCell/ActionCell.js +5 -4
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +4 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.js +4 -2
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/AmountCell/AmountCell.js +2 -2
- package/build/components/TableCells/CustomCells/AmountCell/style.d.ts +7 -2
- package/build/components/TableCells/CustomCells/AmountCell/style.js +4 -4
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/CustomerCell/CustomerCell.js +4 -1
- package/build/components/TableCells/CustomCells/CustomerCell/style.d.ts +4 -1
- package/build/components/TableCells/CustomCells/CustomerCell/style.js +3 -7
- package/build/components/TableCells/CustomCells/DateCell/DateCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DateCell/DateCell.js +3 -2
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/DestinationCell/DestinationCell.js +3 -2
- package/build/components/TableCells/CustomCells/DestinationCell/styled.d.ts +4 -1
- package/build/components/TableCells/CustomCells/DestinationCell/styled.js +4 -2
- package/build/components/TableCells/CustomCells/OrderCell/OrderCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/OrderCell/OrderCell.js +4 -1
- package/build/components/TableCells/CustomCells/ReceiptCell/ReceiptCell.d.ts +2 -1
- package/build/components/TableCells/CustomCells/ReceiptCell/ReceiptCell.js +5 -2
- package/build/components/TableCells/CustomCells/ReferenceCell/ReferenceCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/ReferenceCell.js +25 -2
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.d.ts +5 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/constant.js +9 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +1 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/style.js +3 -0
- package/build/components/TableCells/CustomCells/ReferenceCell/type.d.ts +5 -2
- package/build/components/TableCells/CustomCells/SheetViewIDButton/SheetViewIDButton.d.ts +7 -0
- package/build/components/TableCells/CustomCells/SheetViewIDButton/SheetViewIDButton.js +35 -0
- package/build/components/TableCells/CustomCells/SheetViewIDButton/index.d.ts +1 -0
- package/build/components/TableCells/CustomCells/SheetViewIDButton/index.js +1 -0
- package/build/components/TableCells/CustomCells/SheetViewIDButton/style.d.ts +3 -0
- package/build/components/TableCells/CustomCells/SheetViewIDButton/style.js +22 -0
- package/build/components/TableCells/CustomCells/SourceMergedCell/SourceMergedCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/SourceMergedCell/SourceMergedCell.js +13 -3
- package/build/components/TableCells/CustomCells/SourceMergedCell/style.d.ts +3 -0
- package/build/components/TableCells/CustomCells/SourceMergedCell/style.js +19 -0
- package/build/components/TableCells/CustomCells/SourceMergedCell/type.d.ts +2 -1
- package/build/components/TableCells/CustomCells/StatusCell/StatusCell.d.ts +1 -1
- package/build/components/TableCells/CustomCells/StatusCell/StatusCell.js +6 -2
- package/build/components/TableCells/CustomCells/StatusCell/constant.d.ts +17 -0
- package/build/components/TableCells/CustomCells/StatusCell/constant.js +17 -0
- package/build/components/TableCells/CustomCells/StatusCell/style.js +1 -0
- package/build/components/TableCells/CustomCells/StatusCell/type.d.ts +1 -0
- package/build/components/TableCells/CustomCells/index.d.ts +1 -0
- package/build/components/TableCells/CustomCells/index.js +1 -0
- package/build/components/TableCells/CustomCells/style.d.ts +4 -1
- package/build/components/TableCells/CustomCells/style.js +6 -9
- package/build/components/TableCells/CustomCells/type.d.ts +6 -1
- package/build/components/VirtualTable/SheetView/SheetViewVirtualTable.d.ts +1 -1
- package/build/components/VirtualTable/SheetView/SheetViewVirtualTable.js +1 -1
- package/build/components/VirtualTable/components/TableRowLoading.js +1 -0
- package/build/components/VirtualTable/style.js +3 -3
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +14 -14
- package/build/constants/table/cell/chargeTableCellWidth.js +14 -14
- package/build/types/table.d.ts +2 -1
- package/package.json +132 -132
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
3
|
import { DEVICE_ICON } from './constants';
|
|
4
|
+
import { TableMode } from '../../types/index.js';
|
|
4
5
|
interface DeviceIconProps extends BoxProps {
|
|
5
6
|
type?: keyof typeof DEVICE_ICON;
|
|
6
7
|
isTextShown?: boolean;
|
|
8
|
+
tableMode?: TableMode;
|
|
7
9
|
}
|
|
8
|
-
declare function DeviceIcon({ type, isTextShown, ...props }: DeviceIconProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DeviceIcon({ type, isTextShown, tableMode, ...props }: DeviceIconProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
declare const _default: import("react").MemoExoticComponent<typeof DeviceIcon>;
|
|
10
12
|
export default _default;
|
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo } from 'react';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
15
|
import capitalize from 'lodash/capitalize';
|
|
@@ -21,9 +21,9 @@ import Tooltip from '../Tooltip';
|
|
|
21
21
|
import { DEVICE_ICON } from './constants';
|
|
22
22
|
import { isDeviceIconShown } from './utils';
|
|
23
23
|
function DeviceIcon(_a) {
|
|
24
|
-
var { type, isTextShown } = _a, props = __rest(_a, ["type", "isTextShown"]);
|
|
24
|
+
var { type, isTextShown, tableMode } = _a, props = __rest(_a, ["type", "isTextShown", "tableMode"]);
|
|
25
25
|
const { t } = useTranslation();
|
|
26
26
|
const icon = isDeviceIconShown(type) ? DEVICE_ICON[type] : null;
|
|
27
|
-
return (_jsx(Tooltip, Object.assign({ title: icon ? capitalizeFirstLetter((type !== null && type !== void 0 ? type : '').toLowerCase()) : t('unKnown') }, { children: isTextShown ? (
|
|
27
|
+
return (_jsx(Tooltip, Object.assign({ title: icon ? capitalizeFirstLetter((type !== null && type !== void 0 ? type : '').toLowerCase()) : t('unKnown') }, { children: isTextShown ? (_jsxs(TextLabel, Object.assign({ tableMode: tableMode }, { children: [" ", type ? capitalize(type) : 'Unknown'] }))) : (_jsx(Box, Object.assign({}, props, { component: "img", src: type ? icon || defaultDeviceIcon : defaultDeviceIcon, alt: type }))) })));
|
|
28
28
|
}
|
|
29
29
|
export default memo(DeviceIcon);
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TableMode } from '../../types/index.js';
|
|
2
3
|
export declare const TextLabel: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
4
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
6
|
+
tableMode?: TableMode | undefined;
|
|
7
|
+
}, {}, {}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const TextLabel = styled(Box
|
|
3
|
+
export const TextLabel = styled(Box, {
|
|
4
|
+
shouldForwardProp: (prop) => prop !== 'tableMode',
|
|
5
|
+
})(({ theme, tableMode }) => ({
|
|
4
6
|
fontSize: '11px',
|
|
5
7
|
display: 'flex',
|
|
6
8
|
alignItems: 'center',
|
|
@@ -12,4 +14,5 @@ export const TextLabel = styled(Box)(({ theme }) => ({
|
|
|
12
14
|
borderRadius: '24px',
|
|
13
15
|
border: `1px solid ${theme.palette.divider}`,
|
|
14
16
|
color: theme.palette.text.primary,
|
|
17
|
+
height: tableMode === 'sheet' ? '18px' : '24px',
|
|
15
18
|
}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import StatusChip from '../StatusChip';
|
|
3
|
+
import { Box, useTheme } from '@mui/material';
|
|
4
|
+
import { passwordDotsIcon } from '../../constants/index.js';
|
|
5
|
+
const MaskedText = ({ text, startLength = 8, endLength = 4 }) => {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const startText = text.slice(0, startLength);
|
|
8
|
+
const endText = text.slice(text.length - endLength);
|
|
9
|
+
return (_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center', gap: theme.spacing(0.5) } }, { children: [_jsx(StatusChip, Object.assign({ bgColor: "#EFF1F2", borderColor: "transparent", textColor: theme.palette.text.primary }, { children: startText })), _jsx("img", { src: passwordDotsIcon, alt: "passwordDots" }), _jsx(StatusChip, Object.assign({ bgColor: "#EFF1F2", borderColor: "transparent", textColor: theme.palette.text.primary }, { children: endText }))] })));
|
|
10
|
+
};
|
|
11
|
+
export default MaskedText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -37,17 +37,18 @@ function StatusButton(_a) {
|
|
|
37
37
|
var _a, _b;
|
|
38
38
|
(_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
39
39
|
onButtonBodyClick === null || onButtonBodyClick === void 0 ? void 0 : onButtonBodyClick(lastActiveStatus || ((_b = dropdownOptions === null || dropdownOptions === void 0 ? void 0 : dropdownOptions[0]) === null || _b === void 0 ? void 0 : _b.status) || 'all');
|
|
40
|
-
if (showDropdownIcon) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
if (hasDropdown) {
|
|
46
|
-
setAnchorEl(buttonRef.current);
|
|
47
|
-
}
|
|
48
40
|
}, sx: Object.assign({}, (hasDropdown && {
|
|
49
41
|
paddingInlineEnd: '27px',
|
|
50
|
-
})) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && _jsx(ChevronContainer,
|
|
42
|
+
})) }, { children: _jsxs(LabelWrapper, { children: [_jsxs(Label, Object.assign({ variant: variant }, { children: [statusIcon, lastActiveStatus ? t(lastActiveStatus) : label, statusBadge] })), dropdownIcon && (_jsx(ChevronContainer, Object.assign({ onClick: (e) => {
|
|
43
|
+
if (showDropdownIcon) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
if (hasDropdown) {
|
|
49
|
+
setAnchorEl(buttonRef.current);
|
|
50
|
+
}
|
|
51
|
+
} }, { children: dropdownIcon })))] }) })), open && !showDropdownIcon && (_jsx(StyledDropdown, { open: open, onClose: handleClose, anchorEl: anchorEl, menuItems: (_c = (dropdownOptions || [])) === null || _c === void 0 ? void 0 : _c.map((item) => (Object.assign(Object.assign({}, item), { onClick: (e) => {
|
|
51
52
|
var _a;
|
|
52
53
|
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
|
|
53
54
|
setLastActiveStatus(item.status);
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from 'react';
|
|
14
|
+
import { ChipStyled } from './style';
|
|
15
|
+
const StatusChip = forwardRef((_a, ref) => {
|
|
16
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
17
|
+
return (_jsx(ChipStyled, Object.assign({ ref: ref }, props, { children: children })));
|
|
18
|
+
});
|
|
19
|
+
export default StatusChip;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
+
textColor?: string | undefined;
|
|
6
|
+
bgColor?: string | undefined;
|
|
7
|
+
borderColor?: string | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
padding?: string | undefined;
|
|
10
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & {
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
};
|
|
12
|
+
import { Box, styled } from '@mui/material';
|
|
13
|
+
export const ChipStyled = styled(Box)((_a) => {
|
|
14
|
+
var { theme } = _a, props = __rest(_a, ["theme"]);
|
|
15
|
+
const { textColor = theme.palette.text.primary, bgColor = theme.palette.background.paper, borderColor = theme.palette.divider, disabled = false, padding, } = props;
|
|
16
|
+
return {
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
height: '18px',
|
|
21
|
+
padding: padding || `${theme.spacing(0.5)} ${theme.spacing(1.5)}`,
|
|
22
|
+
borderRadius: '30px',
|
|
23
|
+
border: `1px solid ${borderColor}`,
|
|
24
|
+
backgroundColor: bgColor,
|
|
25
|
+
color: textColor,
|
|
26
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
27
|
+
opacity: disabled ? 0.5 : 1,
|
|
28
|
+
whiteSpace: 'nowrap',
|
|
29
|
+
fontSize: '11px',
|
|
30
|
+
minWidth: '67px',
|
|
31
|
+
};
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type AuthorizedStatusType } from '../../TableCells';
|
|
3
|
+
import { TableMode } from '../../../types/index.js';
|
|
3
4
|
type AuthorizedIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
authorizedStatus?: AuthorizedStatusType;
|
|
6
7
|
isTextShown?: boolean;
|
|
8
|
+
tableMode?: TableMode;
|
|
7
9
|
};
|
|
8
|
-
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const AuthorizedIcon: ({ authorizedStatus, isTextShown, iconStyles, tableMode }: AuthorizedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|
|
@@ -6,10 +6,10 @@ import Tooltip from '../../Tooltip';
|
|
|
6
6
|
import { authorizedStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
7
7
|
import Icon from '../../Icon';
|
|
8
8
|
import { TextLabel } from '../../TableCells/CustomCells/style';
|
|
9
|
-
export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles }) => {
|
|
9
|
+
export const AuthorizedIcon = ({ authorizedStatus, isTextShown, iconStyles, tableMode }) => {
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const theme = useTheme();
|
|
12
|
-
return (_jsx(Tooltip, Object.assign({ title: t(camelCase(authorizedStatus)) }, { children: isTextShown ? (_jsx(TextLabel, Object.assign({ "data-testid": "StatusCell_AuthorizedStatusLabel", sx: {
|
|
13
|
-
|
|
14
|
-
} }, { children: t(camelCase(authorizedStatus)) }))) : (_jsx(Icon, { src: authorizedStatusIcons[authorizedStatus], alt: "authorized-icon", "data-testid": "StatusCell_AuthorizedStatusIcon", sx: iconStyles })) })));
|
|
12
|
+
return (_jsx(Tooltip, Object.assign({ title: tableMode === 'sheet' ? '' : t(camelCase(authorizedStatus)) }, { children: isTextShown ? (_jsx(TextLabel, Object.assign({ "data-testid": "StatusCell_AuthorizedStatusLabel", sx: Object.assign({ color: theme.palette.info.dark }, (tableMode === 'sheet' && {
|
|
13
|
+
height: '18px',
|
|
14
|
+
})) }, { children: t(camelCase(authorizedStatus)) }))) : (_jsx(Icon, { src: authorizedStatusIcons[authorizedStatus], alt: "authorized-icon", "data-testid": "StatusCell_AuthorizedStatusIcon", sx: iconStyles })) })));
|
|
15
15
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { TableMode } from '../../../types/index.js';
|
|
1
2
|
interface DeviceIconChipProps {
|
|
2
3
|
geographyVariant?: 'G' | 'L' | 'R';
|
|
3
4
|
isTextShown?: boolean;
|
|
4
5
|
deviceCountry?: string;
|
|
5
6
|
deviceType?: 'DESKTOP' | 'PHONE' | 'TABLET';
|
|
7
|
+
tableMode?: TableMode;
|
|
6
8
|
}
|
|
7
|
-
export declare const DeviceIconChip: ({ geographyVariant, isTextShown, deviceCountry, deviceType }: DeviceIconChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const DeviceIconChip: ({ geographyVariant, isTextShown, deviceCountry, deviceType, tableMode }: DeviceIconChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import DeviceIcon from '../../DeviceIcon';
|
|
4
4
|
import { GeographyIcon } from '../GeographyIcon/GeographyIcon';
|
|
5
|
-
export const DeviceIconChip = ({ geographyVariant, isTextShown, deviceCountry, deviceType }) => {
|
|
6
|
-
return (_jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '8px', alignItems: 'center' } }, { children: [_jsx(GeographyIcon, { geographyVariant: geographyVariant, isTextShown: isTextShown, countryCode: deviceCountry }), _jsx(DeviceIcon, { type: deviceType, isTextShown: isTextShown })] })));
|
|
5
|
+
export const DeviceIconChip = ({ geographyVariant, isTextShown, deviceCountry, deviceType, tableMode }) => {
|
|
6
|
+
return (_jsxs(Box, Object.assign({ sx: Object.assign({ display: 'flex', gap: '8px', alignItems: 'center' }, (tableMode === 'sheet' && { height: '18px' })) }, { children: [_jsx(GeographyIcon, { geographyVariant: geographyVariant, isTextShown: isTextShown, countryCode: deviceCountry }), _jsx(DeviceIcon, { type: deviceType, isTextShown: isTextShown, tableMode: tableMode })] })));
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IssuerIconProps } from './type';
|
|
2
|
-
export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName }: IssuerIconProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName, tableMode }: IssuerIconProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { GeographyIcon } from '../GeographyIcon/GeographyIcon';
|
|
3
3
|
import { IssuerIconContainer, CardNumber } from './style';
|
|
4
4
|
import Tooltip from '../../Tooltip';
|
|
5
|
-
export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName }) {
|
|
5
|
+
export default function IssuerIcon({ countryCode, isTextShown, cardNumber, bankName, tableMode }) {
|
|
6
6
|
const firstFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(0, 4);
|
|
7
7
|
const lastFourDigits = cardNumber === null || cardNumber === void 0 ? void 0 : cardNumber.slice(-4);
|
|
8
|
-
return (_jsxs(IssuerIconContainer, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), _jsx(Tooltip, Object.assign({ title: bankName }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))] }));
|
|
8
|
+
return (_jsxs(IssuerIconContainer, Object.assign({ tableMode: tableMode }, { children: [countryCode && _jsx(GeographyIcon, { countryCode: countryCode, isTextShown: isTextShown }), _jsx(Tooltip, Object.assign({ title: bankName }, { children: _jsx(CardNumber, { children: `${firstFourDigits || ''} ${lastFourDigits || ''}` }) }))] })));
|
|
9
9
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TableMode } from '../../../types/index.js';
|
|
2
3
|
export declare const IssuerIconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
4
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
4
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
6
|
+
tableMode?: TableMode | undefined;
|
|
7
|
+
}, {}, {}>;
|
|
5
8
|
export declare const CardNumber: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Box } from '@mui/material';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const IssuerIconContainer = styled(Box
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}));
|
|
3
|
+
export const IssuerIconContainer = styled(Box, {
|
|
4
|
+
shouldForwardProp: (prop) => prop !== 'tableMode',
|
|
5
|
+
})(({ theme, tableMode }) => (Object.assign(Object.assign({ display: 'flex', gap: theme.spacing(0.5) }, (tableMode === 'sheet' && { height: '18px' })), { alignItems: 'center' })));
|
|
7
6
|
export const CardNumber = styled('span')(({ theme }) => ({
|
|
8
7
|
fontSize: '10px',
|
|
9
8
|
fontWeight: 500,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PayoutStatusType } from '../../TableCells';
|
|
3
|
+
import { TableMode } from '../../../types/index.js';
|
|
3
4
|
type PayoutIconProps = {
|
|
4
5
|
iconStyles?: React.CSSProperties;
|
|
5
6
|
payoutStatus?: PayoutStatusType;
|
|
6
7
|
payoutTooltip?: React.ReactNode;
|
|
7
8
|
isTextShown?: boolean;
|
|
9
|
+
tableMode?: TableMode;
|
|
8
10
|
};
|
|
9
|
-
export declare const PayoutIcon: ({ payoutStatus, isTextShown, payoutTooltip, iconStyles }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const PayoutIcon: ({ payoutStatus, tableMode, isTextShown, payoutTooltip, iconStyles }: PayoutIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -4,9 +4,14 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import Tooltip from '../../Tooltip';
|
|
5
5
|
import { StatusIcon } from '../../TableCells/CustomCells/style';
|
|
6
6
|
import { StatusTextLabel } from '../../TableCells/CustomCells/InvoiceStatusCell/style';
|
|
7
|
-
import { payoutStatusIcons } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
8
|
-
|
|
7
|
+
import { payoutStatusIcons, payoutStatusStyles } from '../../TableCells/CustomCells/StatusCell/constant';
|
|
8
|
+
import { StatusChip } from '../../index.js';
|
|
9
|
+
export const PayoutIcon = ({ payoutStatus = 'PENDING', tableMode, isTextShown, payoutTooltip, iconStyles }) => {
|
|
9
10
|
const { t } = useTranslation();
|
|
11
|
+
const payoutStatusStyle = payoutStatusStyles[payoutStatus];
|
|
12
|
+
if (tableMode === 'sheet') {
|
|
13
|
+
return _jsx(StatusChip, Object.assign({ sx: Object.assign({}, payoutStatusStyle) }, { children: t(camelCase(payoutStatus)) }));
|
|
14
|
+
}
|
|
10
15
|
const title = payoutTooltip ? payoutTooltip : t(camelCase(payoutStatus));
|
|
11
16
|
return (_jsx(Tooltip, Object.assign({ title: title }, { children: isTextShown ? (_jsx(StatusTextLabel, Object.assign({ "data-testid": "StatusCell_PayoutStatusLabel" }, { children: t(camelCase(payoutStatus)) }))) : (_jsx(StatusIcon, { src: payoutStatusIcons[payoutStatus], alt: "settled-icon", "data-testid": "StatusCell_PayoutStatusIcon", style: iconStyles })) })));
|
|
12
17
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ActionCellProps } from '../type';
|
|
3
|
+
import { TableMode } from '../../../../types/index.js';
|
|
3
4
|
type Props = Readonly<ActionCellProps> & {
|
|
4
5
|
onJsonViewClick?: () => void;
|
|
6
|
+
tableMode?: TableMode;
|
|
5
7
|
};
|
|
6
|
-
declare function ActionCell({ flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ActionCell({ flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown, row, showJsonViewer, isTextShown, showIdButton, rowId, onJsonViewClick, tableMode, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
declare const _default: React.MemoExoticComponent<typeof ActionCell>;
|
|
8
10
|
export default _default;
|
|
@@ -24,14 +24,15 @@ import { useActionCell } from './hooks/useActionCell';
|
|
|
24
24
|
import { ActionCellContainer, ActionIcon, ActionsIconContainer } from './style';
|
|
25
25
|
import { IDButton } from '../IDButton';
|
|
26
26
|
import { BadgeWrapper, IdButtonContainer, TextLabel, TransparentButton } from '../style';
|
|
27
|
+
import SheetViewIDButton from '../SheetViewIDButton/SheetViewIDButton';
|
|
27
28
|
function ActionCell(_a) {
|
|
28
29
|
var _b, _c;
|
|
29
|
-
var { flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown = true, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick } = _a, props = __rest(_a, ["flag", "actions", "flagTooltip", "flagsCount", "dropdownAction", "onCloseDropdown", "isDropdownShown", "row", "showJsonViewer", "isTextShown", "showIdButton", "rowId", "onJsonViewClick"]);
|
|
30
|
+
var { flag, actions, flagTooltip, flagsCount, dropdownAction, onCloseDropdown, isDropdownShown = true, row, showJsonViewer = true, isTextShown, showIdButton = true, rowId, onJsonViewClick, tableMode } = _a, props = __rest(_a, ["flag", "actions", "flagTooltip", "flagsCount", "dropdownAction", "onCloseDropdown", "isDropdownShown", "row", "showJsonViewer", "isTextShown", "showIdButton", "rowId", "onJsonViewClick", "tableMode"]);
|
|
30
31
|
const { t } = useTranslation();
|
|
31
32
|
const { open, anchorEl, filteredActions, isAnyActionLoading, isAnyActionHasError, isAnyActionSuccessful, areThereAnyShownActions, handleClick, handleClose, } = useActionCell({ actions, isDropdownShown, onCloseDropdown });
|
|
32
33
|
return (_jsx(TableCell, Object.assign({}, props, { sx: {
|
|
33
34
|
overflow: 'visible',
|
|
34
|
-
} }, { children: _jsxs(ActionCellContainer, Object.assign({ "data-testid": "ActionCell_ActionCellContainer" }, { children: [flag && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "ActionCell_FlagLabel", sx: {
|
|
35
|
+
} }, { children: _jsxs(ActionCellContainer, Object.assign({ "data-testid": "ActionCell_ActionCellContainer", tableMode: tableMode }, { children: [flag && (_jsx(_Fragment, { children: isTextShown ? (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsx(TextLabel, Object.assign({ "data-testid": "ActionCell_FlagLabel", sx: {
|
|
35
36
|
textAlign: 'left',
|
|
36
37
|
justifyContent: 'flex-start',
|
|
37
38
|
} }, { children: flagTooltip })) }))) : (_jsx(Tooltip, Object.assign({ title: flagTooltip }, { children: _jsxs(BadgeWrapper, Object.assign({ "data-testid": "ActionCell_FlagBadge", sx: {
|
|
@@ -71,12 +72,12 @@ function ActionCell(_a) {
|
|
|
71
72
|
},
|
|
72
73
|
opacity: 1,
|
|
73
74
|
},
|
|
74
|
-
} }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: colorToVariant[(_c = flags[flag]) === null || _c === void 0 ? void 0 : _c.color] || BadgeVariants.ORANGE, "data-testid": "ActionCell_StyledBadge" }, { children: [flagsCount, "x"] })) })))] })) }))) })), showIdButton
|
|
75
|
+
} }, { children: _jsxs(StyledBadge, Object.assign({ compact: true, variant: colorToVariant[(_c = flags[flag]) === null || _c === void 0 ? void 0 : _c.color] || BadgeVariants.ORANGE, "data-testid": "ActionCell_StyledBadge" }, { children: [flagsCount, "x"] })) })))] })) }))) })), showIdButton ? (tableMode === 'sheet' ? (_jsx(SheetViewIDButton, { rowId: rowId || row.id })) : (_jsx(IDButton, { rowId: rowId || row.id }))) : null, _jsxs("div", Object.assign({ "data-testid": "ActionCell_IconsContainer", style: {
|
|
75
76
|
display: 'flex',
|
|
76
77
|
alignItems: 'center',
|
|
77
78
|
justifyContent: 'center',
|
|
78
79
|
gap: '5px',
|
|
79
|
-
} }, { children: [showJsonViewer && (_jsx(_Fragment, { children: _jsx(TransparentButton, Object.assign({ onClick: onJsonViewClick, type: "button", "data-testid": "ActionCell_TransparentButton" }, { children: _jsx(Tooltip, Object.assign({ title: t('jsonViewer') }, { children: _jsx(IdButtonContainer, Object.assign({ "data-testid": "ActionCell_IdButtonContainer" }, { children: _jsx(motion.img, { src: jsonBlackIcon, alt: "icon" }, "id-icon") })) })) })) })), _jsxs(ActionsIconContainer, Object.assign({ id: "styled-popover", selected: !!dropdownAction || open, "data-testid": "ActionCell_ActionsIconContainer", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
80
|
+
} }, { children: [showJsonViewer && (_jsx(_Fragment, { children: _jsx(TransparentButton, Object.assign({ onClick: onJsonViewClick, type: "button", "data-testid": "ActionCell_TransparentButton" }, { children: _jsx(Tooltip, Object.assign({ title: t('jsonViewer') }, { children: _jsx(IdButtonContainer, Object.assign({ tableMode: tableMode, "data-testid": "ActionCell_IdButtonContainer" }, { children: tableMode === 'sheet' ? (_jsx("span", Object.assign({ style: { fontSize: '11px', fontWeight: 400 } }, { children: "View API" }))) : (_jsx(motion.img, { src: jsonBlackIcon, alt: "icon" }, "id-icon")) })) })) })) })), _jsxs(ActionsIconContainer, Object.assign({ id: "styled-popover", selected: !!dropdownAction || open, "data-testid": "ActionCell_ActionsIconContainer", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
80
81
|
pointerEvents: 'none',
|
|
81
82
|
})) }, { children: [_jsx(TransparentButton, Object.assign({ onClick: handleClick, "data-testid": "ActionCell_ActionsIconContainer_TransparentButton", "data-is-active": areThereAnyShownActions, sx: Object.assign({}, (!areThereAnyShownActions && {
|
|
82
83
|
pointerEvents: 'none',
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { TableMode } from '../../../../types/index.js';
|
|
3
|
+
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
4
|
+
tableMode?: TableMode | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
3
6
|
export declare const ActionsIconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
4
7
|
selected: boolean;
|
|
5
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { styled } from '@mui/material/styles';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
|
-
export const ActionCellContainer = styled('section'
|
|
3
|
+
export const ActionCellContainer = styled('section', {
|
|
4
|
+
shouldForwardProp: (props) => props !== 'tableMode',
|
|
5
|
+
})(({ theme, tableMode }) => ({
|
|
4
6
|
display: 'flex',
|
|
5
7
|
alignItems: 'center',
|
|
6
8
|
justifyContent: 'flex-end',
|
|
7
9
|
textAlign: 'center',
|
|
8
10
|
borderRadius: '50%',
|
|
9
|
-
gap: theme.spacing(1),
|
|
11
|
+
gap: tableMode === 'sheet' ? '4px' : theme.spacing(1),
|
|
10
12
|
overflow: 'visible',
|
|
11
13
|
}));
|
|
12
14
|
export const ActionsIconContainer = styled('span')(({ selected }) => (Object.assign(Object.assign({ overflow: 'visible', borderRadius: '50%', display: 'flex', justifyContent: 'center', alignItems: 'center', '&:hover': {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AmountCellProps } from '../type';
|
|
2
|
-
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function AmountCell({ conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode, ...props }: AmountCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default AmountCell;
|
|
@@ -18,9 +18,9 @@ import { formatAmountWithCurrency } from '../../../../utils/index.js';
|
|
|
18
18
|
import { AmountCellContainer, ConversionBadge, CurrencySpan, DecimalSpan, FlagContainer } from './style';
|
|
19
19
|
import { FlagIcon } from '../style';
|
|
20
20
|
function AmountCell(_a) {
|
|
21
|
-
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown"]);
|
|
21
|
+
var { conversionType, amount, currency, tooltipLabel, amountTooltipLabel, isTextShown, tableMode } = _a, props = __rest(_a, ["conversionType", "amount", "currency", "tooltipLabel", "amountTooltipLabel", "isTextShown", "tableMode"]);
|
|
22
22
|
const icon = currency && _jsx(FlagIcon, { src: getCurrenciesIcon(currency), alt: "customer icon" });
|
|
23
23
|
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, currency);
|
|
24
|
-
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: conversionType && _jsx(ConversionBadge, Object.assign({ className: "conversion-type" }, { children: conversionType })) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: isTextShown ? _jsx("span", {}) : _jsx(FlagContainer, { children: icon }) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencySpan, { children: integerAmount && decimalAmount && amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencyIcon, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, ".", _jsx(DecimalSpan, { children: decimalAmount })] })) : (_jsx("span", { children: "-" })) }) }))] }) })));
|
|
24
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(AmountCellContainer, { children: [_jsx(Tooltip, Object.assign({ title: tooltipLabel || '' }, { children: conversionType && (_jsx(ConversionBadge, Object.assign({ tableMode: tableMode, className: "conversion-type" }, { children: conversionType }))) })), _jsx(Tooltip, Object.assign({ title: _jsx(CurrencyIcon, { currency: currency }) }, { children: isTextShown ? _jsx("span", {}) : _jsx(FlagContainer, { children: icon }) })), _jsx(Tooltip, Object.assign({ title: amountTooltipLabel }, { children: _jsx(CurrencySpan, Object.assign({ tableMode: tableMode }, { children: integerAmount && decimalAmount && amount !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { children: _jsx(CurrencyIcon, { currency: currency, fontSize: 10 }) }), ' ', integerAmount, ".", _jsx(DecimalSpan, { children: decimalAmount })] })) : (_jsx("span", { children: "-" })) })) }))] }) })));
|
|
25
25
|
}
|
|
26
26
|
export default AmountCell;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TableMode } from '../../../../types/index.js';
|
|
2
3
|
export declare const AmountCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
-
export declare const ConversionBadge: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme
|
|
4
|
+
export declare const ConversionBadge: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
|
+
tableMode?: TableMode | undefined;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
7
|
export declare const FlagContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
5
|
-
export declare const CurrencySpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme
|
|
8
|
+
export declare const CurrencySpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
9
|
+
tableMode?: TableMode | undefined;
|
|
10
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
6
11
|
export declare const DecimalSpan: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
7
12
|
export declare const ConversionTooltip: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
13
|
export declare const ConversionTooltipRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
@@ -5,12 +5,12 @@ export const AmountCellContainer = styled('span')(({ theme }) => ({
|
|
|
5
5
|
justifyContent: 'flex-end',
|
|
6
6
|
gap: theme.spacing(1),
|
|
7
7
|
}));
|
|
8
|
-
export const ConversionBadge = styled('span')(({ theme }) => ({
|
|
8
|
+
export const ConversionBadge = styled('span')(({ theme, tableMode }) => ({
|
|
9
9
|
backgroundColor: theme.palette.grey[100],
|
|
10
10
|
display: 'block',
|
|
11
11
|
borderRadius: '4px',
|
|
12
12
|
padding: '1.5px 3px',
|
|
13
|
-
fontSize: '10px',
|
|
13
|
+
fontSize: tableMode === 'sheet' ? '11px' : '10px',
|
|
14
14
|
lineHeight: '13px',
|
|
15
15
|
textTransform: 'uppercase',
|
|
16
16
|
fontWeight: theme.typography.fontWeightBold,
|
|
@@ -21,8 +21,8 @@ export const FlagContainer = styled('span')(() => ({
|
|
|
21
21
|
height: '12px',
|
|
22
22
|
flexShrink: 0,
|
|
23
23
|
}));
|
|
24
|
-
export const CurrencySpan = styled('span')(({ theme }) => ({
|
|
25
|
-
fontSize: theme.typography.body2.fontSize,
|
|
24
|
+
export const CurrencySpan = styled('span')(({ theme, tableMode }) => ({
|
|
25
|
+
fontSize: tableMode === 'sheet' ? '11px' : theme.typography.body2.fontSize,
|
|
26
26
|
lineHeight: '17px',
|
|
27
27
|
fontWeight: '700',
|
|
28
28
|
}));
|