@tap-payments/os-micro-frontend-shared 0.1.272 → 0.1.273-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.
- package/build/components/Chip/style.d.ts +0 -1
- package/build/components/ColorPicker/ColorPicker.d.ts +1 -0
- package/build/components/ColorPicker/ColorPicker.js +10 -4
- package/build/components/ColorPicker/ColorPickerPanel.d.ts +2 -1
- package/build/components/ColorPicker/ColorPickerPanel.js +20 -5
- package/build/components/ColorPicker/HexaFields.d.ts +2 -1
- package/build/components/ColorPicker/HexaFields.js +3 -3
- package/build/components/ColorPicker/RGBAFields.d.ts +2 -1
- package/build/components/ColorPicker/RGBAFields.js +19 -7
- package/build/components/ColorPicker/style.js +4 -3
- package/build/components/CountBadge/style.d.ts +0 -1
- package/build/components/Dialog/style.d.ts +0 -1
- package/build/components/FlippingCard/style.d.ts +0 -1
- package/build/components/ImageWrapper/ImageWrapper.d.ts +0 -1
- package/build/components/JSONViewer/style.d.ts +0 -1
- package/build/components/LeftPeekRightExpandingChip/style.d.ts +0 -1
- package/build/components/RightLeftExpandingCenterChip/style.d.ts +0 -1
- package/build/components/SearchButton/styles.d.ts +0 -1
- package/build/components/StatusIcons/AuthIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/AuthorizationAutoIcons/style.d.ts +0 -1
- package/build/components/StatusIcons/ChargeStatusIcon/style.d.ts +0 -1
- package/build/components/StatusIcons/SourceIcons/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ActionCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/AuthenticationTypeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/BalanceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ChannelsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/CheckoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DateCell/DateCell.d.ts +9 -3
- package/build/components/TableCells/CustomCells/DateCell/DateCell.js +13 -16
- package/build/components/TableCells/CustomCells/DateCell/DateViewer.d.ts +3 -0
- package/build/components/TableCells/CustomCells/DateCell/DateViewer.js +29 -0
- package/build/components/TableCells/CustomCells/DateCell/index.d.ts +1 -0
- package/build/components/TableCells/CustomCells/DateCell/index.js +1 -0
- package/build/components/TableCells/CustomCells/DestinationStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/DueDateCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IDButton/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/IntentsStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/InvoiceStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/PayoutDateCell/PayoutDateCell.d.ts +2 -2
- package/build/components/TableCells/CustomCells/PayoutStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ProductsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/ReferenceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundChargeCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.d.ts +1 -2
- package/build/components/TableCells/CustomCells/RefundStatusCell/style.js +2 -2
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SegmentsCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/SourceCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/StatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/TokenStatusCell/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/style.d.ts +0 -1
- package/build/components/TableCells/CustomCells/type.d.ts +1 -1
- package/build/components/VirtualTables/components/style.d.ts +0 -1
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
import { GetSourceAnimationFunction } from './type';
|
|
4
3
|
export declare const ChipStyled: import("@emotion/styled").StyledComponent<import("react").RefAttributes<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
4
|
variant?: import("./type").ChipVariant | undefined;
|
|
@@ -8,8 +8,14 @@ import { StyledCloseButtonWrapper } from './style';
|
|
|
8
8
|
import { closeXIcon } from '../../constants/index.js';
|
|
9
9
|
import ColorPickerPanel from './ColorPickerPanel';
|
|
10
10
|
import { Popper } from '@mui/material';
|
|
11
|
-
const
|
|
11
|
+
const DEFAULT_OPTIONS = {
|
|
12
|
+
hideReset: false,
|
|
13
|
+
disableAlpha: false,
|
|
14
|
+
};
|
|
15
|
+
const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx, options = DEFAULT_OPTIONS }) => {
|
|
12
16
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
17
|
+
const { disableAlpha = false, hideReset = false } = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);
|
|
18
|
+
console.log('disableAlpha', disableAlpha);
|
|
13
19
|
const rootRef = useRef(null);
|
|
14
20
|
const handleOpen = useCallback(() => {
|
|
15
21
|
setAnchorEl(rootRef.current);
|
|
@@ -18,9 +24,9 @@ const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx, options })
|
|
|
18
24
|
setAnchorEl(null);
|
|
19
25
|
}, []);
|
|
20
26
|
const handleConfirm = useCallback((newValue) => {
|
|
21
|
-
onChange(newValue);
|
|
27
|
+
onChange(disableAlpha ? newValue.substring(0, 7) : newValue);
|
|
22
28
|
setAnchorEl(null);
|
|
23
|
-
}, [onChange]);
|
|
24
|
-
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: () => setAnchorEl(null) }, { children: _jsxs(Stack, Object.assign({ ref: rootRef, bgcolor: "grey.400", borderRadius: "4px", p: "4px", pr: "12px", direction: "row", justifyContent: "space-between", spacing: 1, alignItems: "center", className: "color-picker", sx: sx }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", className: "color-picker__controls-wrapper" }, { children: [_jsx(Box, { borderRadius: "5px", width: 32, height: 32, sx: { backgroundColor: value }, className: "color-picker__viewer" }), _jsxs(Box, Object.assign({ className: "color-picker__actions-wrapper" }, { children: [_jsx(Typography, Object.assign({ className: "color-picker__label", fontWeight: 500, fontSize: 9, color: "text.primary", textTransform: "uppercase" }, { children: value })), _jsx(Typography, Object.assign({ className: "color-picker__edit-btn", role: "button", onClick: handleOpen, htmlFor: id, fontWeight: 500, fontSize: 9, color: "info.dark", component: "label", sx: { textDecoration: 'underline', cursor: 'pointer' } }, { children: "Edit" }))] }))] })), !
|
|
29
|
+
}, [onChange, disableAlpha]);
|
|
30
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: () => setAnchorEl(null) }, { children: _jsxs(Stack, Object.assign({ ref: rootRef, bgcolor: "grey.400", borderRadius: "4px", p: "4px", pr: "12px", direction: "row", justifyContent: "space-between", spacing: 1, alignItems: "center", className: "color-picker", sx: sx }, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center", className: "color-picker__controls-wrapper" }, { children: [_jsx(Box, { borderRadius: "5px", width: 32, height: 32, sx: { backgroundColor: value }, className: "color-picker__viewer" }), _jsxs(Box, Object.assign({ className: "color-picker__actions-wrapper" }, { children: [_jsx(Typography, Object.assign({ className: "color-picker__label", fontWeight: 500, fontSize: 9, color: "text.primary", textTransform: "uppercase" }, { children: value })), _jsx(Typography, Object.assign({ className: "color-picker__edit-btn", role: "button", onClick: handleOpen, htmlFor: id, fontWeight: 500, fontSize: 9, color: "info.dark", component: "label", sx: { textDecoration: 'underline', cursor: 'pointer' } }, { children: "Edit" }))] }))] })), !hideReset ? (_jsx(StyledCloseButtonWrapper, Object.assign({ className: "color-picker__close-btn", type: "button", onClick: onReset }, { children: _jsx(Box, { component: "img", src: closeXIcon, width: 10, height: 10 }) }))) : (_jsx("div", {})), _jsx(Popper, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, placement: "top" }, { children: _jsx(ColorPickerPanel, { initialValue: value, onCancel: handleCancel, onConfirm: handleConfirm, disableAlpha: disableAlpha }) }))] })) })));
|
|
25
31
|
};
|
|
26
32
|
export default ColorPicker;
|
|
@@ -2,6 +2,7 @@ export type ColorPickerPanelProps = {
|
|
|
2
2
|
initialValue?: string;
|
|
3
3
|
onCancel: () => void;
|
|
4
4
|
onConfirm: (newValue: string) => void;
|
|
5
|
+
disableAlpha?: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const ColorPickerPanel: ({ initialValue, onCancel, onConfirm }: ColorPickerPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const ColorPickerPanel: ({ initialValue, onCancel, onConfirm, disableAlpha }: ColorPickerPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default ColorPickerPanel;
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { RgbaColorPicker } from 'react-colorful';
|
|
15
|
+
import { RgbaColorPicker, RgbColorPicker } from 'react-colorful';
|
|
16
16
|
import Stack from '@mui/material/Stack';
|
|
17
17
|
import Divider from '@mui/material/Divider';
|
|
18
18
|
import { hexa2Rgba, rgba2Hexa } from '../../utils/index.js';
|
|
@@ -20,7 +20,7 @@ import { CancelButton, ConfirmButton, Footer, StyledColorWidgetWrapper } from '.
|
|
|
20
20
|
import ColorSchemeSelect from './ColorSchemeSelect';
|
|
21
21
|
import RGBAFields from './RGBAFields';
|
|
22
22
|
import HexaFields from './HexaFields';
|
|
23
|
-
const ColorPickerPanel = ({ initialValue = '#ffffff', onCancel, onConfirm }) => {
|
|
23
|
+
const ColorPickerPanel = ({ initialValue = '#ffffff', onCancel, onConfirm, disableAlpha = false }) => {
|
|
24
24
|
const [colorScheme, setColorScheme] = useState('RGB');
|
|
25
25
|
const [color, setColor] = useState(() => {
|
|
26
26
|
const _a = hexa2Rgba(initialValue).value, { alpha: a } = _a, rest = __rest(_a, ["alpha"]);
|
|
@@ -34,8 +34,23 @@ const ColorPickerPanel = ({ initialValue = '#ffffff', onCancel, onConfirm }) =>
|
|
|
34
34
|
}, [initialValue, onCancel]);
|
|
35
35
|
const handleConfirm = useCallback(() => {
|
|
36
36
|
const { a: alpha } = color, rest = __rest(color, ["a"]);
|
|
37
|
-
onConfirm(rgba2Hexa(Object.assign(Object.assign({}, rest), { alpha })));
|
|
38
|
-
}, [color, onConfirm]);
|
|
39
|
-
|
|
37
|
+
onConfirm(rgba2Hexa(Object.assign(Object.assign({}, rest), { alpha: disableAlpha ? 1 : alpha })));
|
|
38
|
+
}, [color, onConfirm, disableAlpha]);
|
|
39
|
+
const handleColorChange = useCallback((newColor) => {
|
|
40
|
+
if (disableAlpha) {
|
|
41
|
+
setColor(Object.assign(Object.assign({}, newColor), { a: 1 }));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
setColor(newColor);
|
|
45
|
+
}
|
|
46
|
+
}, [disableAlpha]);
|
|
47
|
+
const handleRGBAFieldsChange = useCallback((newColor) => {
|
|
48
|
+
setColor(Object.assign(Object.assign({}, newColor), { a: newColor.a / 100 }));
|
|
49
|
+
}, []);
|
|
50
|
+
const handleHexaFieldsChange = useCallback((newColor) => {
|
|
51
|
+
setColor(Object.assign(Object.assign({}, newColor), { a: newColor.a }));
|
|
52
|
+
}, []);
|
|
53
|
+
const PickerArea = disableAlpha ? RgbColorPicker : RgbaColorPicker;
|
|
54
|
+
return (_jsxs(StyledColorWidgetWrapper, Object.assign({ className: "color-picker__widget" }, { children: [_jsx(PickerArea, { color: color, onChange: handleColorChange }), _jsxs(Stack, Object.assign({ mt: 2, spacing: 1, direction: "row" }, { children: [_jsx(ColorSchemeSelect, { scheme: colorScheme, setScheme: setColorScheme }), colorScheme === 'RGB' ? (_jsx(RGBAFields, { value: Object.assign(Object.assign({}, color), { a: Math.round(color.a * 100) }), onChange: handleRGBAFieldsChange, disableAlpha: disableAlpha })) : (_jsx(HexaFields, { value: Object.assign(Object.assign({}, color), { a: color.a }), onChange: handleHexaFieldsChange, disableAlpha: disableAlpha }))] })), _jsx(Divider, { sx: { my: '12px' } }), _jsxs(Footer, Object.assign({ className: "color-picker__widget-actions" }, { children: [_jsx(CancelButton, Object.assign({ className: "color-picker__widget-actions__cancel", onClick: handleCancel }, { children: t('cancel') })), _jsx(ConfirmButton, Object.assign({ className: "color-picker__widget-actions__confirm", onClick: handleConfirm }, { children: t('okay') }))] }))] })));
|
|
40
55
|
};
|
|
41
56
|
export default ColorPickerPanel;
|
|
@@ -2,6 +2,7 @@ import { RgbaColor } from 'react-colorful';
|
|
|
2
2
|
type HexaFieldsProps = {
|
|
3
3
|
value: RgbaColor;
|
|
4
4
|
onChange: (newValue: RgbaColor) => void;
|
|
5
|
+
disableAlpha?: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const HexaFields: ({ value, onChange }: HexaFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const HexaFields: ({ value, onChange, disableAlpha }: HexaFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default HexaFields;
|
|
@@ -6,7 +6,7 @@ import Stack from '@mui/material/Stack';
|
|
|
6
6
|
import Typography from '@mui/material/Typography';
|
|
7
7
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
8
8
|
import { StyledInput } from './style';
|
|
9
|
-
const HexaFields = ({ value, onChange }) => {
|
|
9
|
+
const HexaFields = ({ value, onChange, disableAlpha = false }) => {
|
|
10
10
|
const colorAsHex = useMemo(() => {
|
|
11
11
|
const color = Color.rgb(value.r, value.g, value.b, value.a);
|
|
12
12
|
return color.hex().replace('#', '');
|
|
@@ -71,13 +71,13 @@ const HexaFields = ({ value, onChange }) => {
|
|
|
71
71
|
},
|
|
72
72
|
}, InputProps: {
|
|
73
73
|
startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start", sx: { m: 0 } }, { children: _jsx(Typography, Object.assign({ component: "span", color: (theme) => alpha(theme.palette.text.primary, 0.5), display: "inline-block", fontSize: 12, fontWeight: 500 }, { children: "#" })) }))),
|
|
74
|
-
} }), _jsx(StyledInput, { type: "number", value: alphaPercent, onChange: handleAlphaChange, inputProps: { min: 0, max: 100 }, sx: {
|
|
74
|
+
} }), !disableAlpha && (_jsx(StyledInput, { type: "number", value: alphaPercent, onChange: handleAlphaChange, inputProps: { min: 0, max: 100 }, sx: {
|
|
75
75
|
flex: 0.8,
|
|
76
76
|
'& .MuiOutlinedInput-root': {
|
|
77
77
|
pr: 1,
|
|
78
78
|
},
|
|
79
79
|
}, InputProps: {
|
|
80
80
|
endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end", sx: { m: 0 } }, { children: _jsx(Typography, Object.assign({ component: "span", color: "text.primary", display: "inline-block", fontSize: 12, fontWeight: 500 }, { children: "%" })) }))),
|
|
81
|
-
} })] })));
|
|
81
|
+
} }))] })));
|
|
82
82
|
};
|
|
83
83
|
export default HexaFields;
|
|
@@ -2,6 +2,7 @@ import { RgbaColor } from 'react-colorful';
|
|
|
2
2
|
type RGBAFieldsProps = {
|
|
3
3
|
value: RgbaColor;
|
|
4
4
|
onChange: (newValue: RgbaColor) => void;
|
|
5
|
+
disableAlpha?: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const RGBAFields: ({ value, onChange }: RGBAFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const RGBAFields: ({ value, onChange, disableAlpha }: RGBAFieldsProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default RGBAFields;
|
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
3
|
import Stack from '@mui/material/Stack';
|
|
3
4
|
import Typography from '@mui/material/Typography';
|
|
4
5
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
5
6
|
import { StyledInput } from './style';
|
|
6
|
-
const RGBAFields = ({ value, onChange }) => {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const RGBAFields = ({ value, onChange, disableAlpha = false }) => {
|
|
8
|
+
const [internalValue, setInternalValue] = useState(value);
|
|
9
|
+
const { r, g, b, a } = internalValue;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setInternalValue(value);
|
|
12
|
+
}, [value]);
|
|
13
|
+
const handleValueBoundaries = useCallback((num, max) => {
|
|
9
14
|
if (isNaN(num))
|
|
10
15
|
num = 0;
|
|
11
16
|
if (num < 0)
|
|
12
17
|
num = 0;
|
|
13
18
|
if (num > max)
|
|
14
19
|
num = max;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
console.log('num', num);
|
|
21
|
+
return num;
|
|
22
|
+
}, []);
|
|
23
|
+
const handleChange = useCallback((key, max) => (event) => {
|
|
24
|
+
setInternalValue(Object.assign(Object.assign({}, internalValue), { [key]: handleValueBoundaries(+event.target.value, max) }));
|
|
25
|
+
}, [internalValue, handleValueBoundaries]);
|
|
26
|
+
const handleBlur = useCallback((key, max) => {
|
|
27
|
+
onChange(Object.assign(Object.assign({}, internalValue), { [key]: handleValueBoundaries(internalValue[key], max) }));
|
|
28
|
+
}, [onChange, internalValue, handleValueBoundaries]);
|
|
29
|
+
return (_jsxs(Stack, Object.assign({ direction: "row", spacing: 1 }, (disableAlpha && { flex: 1 }), { children: [_jsx(StyledInput, Object.assign({ type: "number", value: r, onBlur: () => handleBlur('r', 255), onChange: handleChange('r', 255), inputProps: { min: 0, max: 255, style: { textAlign: 'center' } }, variant: "outlined", size: "small" }, (disableAlpha && { sx: { flex: 1 } }))), _jsx(StyledInput, Object.assign({ type: "number", value: g, onBlur: () => handleBlur('g', 255), onChange: handleChange('g', 255), inputProps: { min: 0, max: 255, style: { textAlign: 'center' } }, variant: "outlined", size: "small" }, (disableAlpha && { sx: { flex: 1 } }))), _jsx(StyledInput, Object.assign({ type: "number", value: b, onBlur: () => handleBlur('b', 255), onChange: handleChange('b', 255), inputProps: { min: 0, max: 255, style: { textAlign: 'center' } }, variant: "outlined", size: "small" }, (disableAlpha && { sx: { flex: 1 } }))), !disableAlpha && (_jsx(StyledInput, { type: "number", value: a, onBlur: () => handleBlur('a', 100), onChange: handleChange('a', 100), inputProps: { min: 0, max: 100, style: { textAlign: 'center' } }, variant: "outlined", sx: {
|
|
18
30
|
'& .MuiOutlinedInput-root': {
|
|
19
31
|
pr: 1,
|
|
20
32
|
},
|
|
21
33
|
}, InputProps: {
|
|
22
34
|
endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end", sx: { m: 0 } }, { children: _jsx(Typography, Object.assign({ component: "span", display: "inline-block", fontSize: 12, fontWeight: 500 }, { children: "%" })) }))),
|
|
23
|
-
}, size: "small" })] })));
|
|
35
|
+
}, size: "small" }))] })));
|
|
24
36
|
};
|
|
25
37
|
export default RGBAFields;
|
|
@@ -34,18 +34,19 @@ export const StyledColorWidgetWrapper = styled(Box)(({ theme }) => ({
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
'&__hue': {
|
|
37
|
-
marginBottom: theme.spacing(2),
|
|
38
37
|
borderRadius: '4px',
|
|
39
|
-
height: '
|
|
38
|
+
height: '8px',
|
|
40
39
|
'&-pointer': {
|
|
41
40
|
width: 10,
|
|
42
41
|
height: 10,
|
|
43
42
|
},
|
|
44
43
|
},
|
|
45
44
|
'&__alpha': {
|
|
45
|
+
marginTop: theme.spacing(2),
|
|
46
|
+
marginBottom: 0,
|
|
46
47
|
border: 0,
|
|
47
48
|
borderRadius: '4px',
|
|
48
|
-
height: '
|
|
49
|
+
height: '8px',
|
|
49
50
|
'&-pointer': {
|
|
50
51
|
width: 10,
|
|
51
52
|
height: 10,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
import { TableMode } from '../../../../types/index.js';
|
|
4
3
|
export declare const ActionCellContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
5
4
|
tableMode?: TableMode | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledAppsCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const AppsStatusContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const AuthIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
4
3
|
export declare const AuthCellContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { DateCellBaseProps } from '../../../index.js';
|
|
2
|
+
interface DateCellProps extends DateCellBaseProps {
|
|
3
|
+
currentTimezone?: string;
|
|
4
|
+
timezoneOffset?: number;
|
|
5
|
+
defaultTimezoneOffset?: number;
|
|
6
|
+
hideTimezoneIcon?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function DateCell({ value, currentTimezone, timezoneOffset, defaultTimezoneOffset, hideTimezoneIcon, ...props }: DateCellProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -10,20 +10,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
return (
|
|
26
|
-
visibility: 'visible',
|
|
27
|
-
}, className: "geography-box" }, { children: icon }))), _jsx(Box, Object.assign({ sx: Object.assign({}, (tableMode === 'sheet' && { fontSize: '11px' })) }, { children: renderedValue }))] }) })));
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
14
|
+
import { Tooltip } from '../../../index.js';
|
|
15
|
+
import DateViewer from './DateViewer';
|
|
16
|
+
import { greyTimezoneIcon, TIMEZONES } from '../../../../constants/index.js';
|
|
17
|
+
import { changeDateTimezone, formatCellDate } from '../../../../utils/index.js';
|
|
18
|
+
export default function DateCell(_a) {
|
|
19
|
+
var { value, currentTimezone = TIMEZONES.UTC, timezoneOffset = 0, defaultTimezoneOffset = 0, hideTimezoneIcon = false } = _a, props = __rest(_a, ["value", "currentTimezone", "timezoneOffset", "defaultTimezoneOffset", "hideTimezoneIcon"]);
|
|
20
|
+
const formatDate = (targetTimezone) => changeDateTimezone(value, { currentTimezone, targetTimezone });
|
|
21
|
+
const formattedDate = formatDate(timezoneOffset);
|
|
22
|
+
const formattedDefaultDate = formatDate(defaultTimezoneOffset);
|
|
23
|
+
const renderDefaultDate = formatCellDate(formattedDefaultDate);
|
|
24
|
+
const showTimezoneIcon = !hideTimezoneIcon && defaultTimezoneOffset !== timezoneOffset;
|
|
25
|
+
return (_jsxs(Box, Object.assign({ sx: { display: 'flex', gap: '8px' } }, { children: [_jsx(DateViewer, Object.assign({ value: formattedDate }, props)), showTimezoneIcon && (_jsx(Tooltip, Object.assign({ title: renderDefaultDate }, { children: _jsx("img", { src: greyTimezoneIcon, width: 14, alt: "timezone" }) })))] })));
|
|
28
26
|
}
|
|
29
|
-
export default DateCell;
|
|
@@ -0,0 +1,29 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { TableCell } from '../../../TableCells';
|
|
15
|
+
import Tooltip from '../../../Tooltip';
|
|
16
|
+
import CountryFlag from '../../../CountryFlag';
|
|
17
|
+
import { formatCellDate, getCountryNameByISO } from '../../../../utils/index.js';
|
|
18
|
+
import { DateCellContainer } from './style';
|
|
19
|
+
import { GeographyBox } from '../style';
|
|
20
|
+
import { Box } from '@mui/material';
|
|
21
|
+
function DateViewer(_a) {
|
|
22
|
+
var { value, format: dateFormat, flagIcon, hasFlag, tableMode } = _a, props = __rest(_a, ["value", "format", "flagIcon", "hasFlag", "tableMode"]);
|
|
23
|
+
const icon = flagIcon && (_jsx(Tooltip, Object.assign({ title: getCountryNameByISO(flagIcon || '') }, { children: _jsx(CountryFlag, { countryCode: flagIcon }) })));
|
|
24
|
+
const renderedValue = useMemo(() => formatCellDate(value, dateFormat), [value]);
|
|
25
|
+
return (_jsx(TableCell, Object.assign({}, props, { children: _jsxs(DateCellContainer, { children: [hasFlag && (_jsx(GeographyBox, Object.assign({ sx: {
|
|
26
|
+
visibility: 'visible',
|
|
27
|
+
}, className: "geography-box" }, { children: icon }))), _jsx(Box, Object.assign({ sx: Object.assign({}, (tableMode === 'sheet' && { fontSize: '11px' })) }, { children: renderedValue }))] }) })));
|
|
28
|
+
}
|
|
29
|
+
export default DateViewer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function PayoutDateCell({ value, ...props }:
|
|
1
|
+
import { DateCellBaseProps } from '../type';
|
|
2
|
+
export default function PayoutDateCell({ value, ...props }: DateCellBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const RefundCellContainer: import("@emotion/styled").StyledComponent<{
|
|
4
3
|
hidden?: boolean | undefined;
|
|
5
4
|
color?: string | undefined;
|
|
@@ -266,7 +265,7 @@ export declare const RefundCellContainer: import("@emotion/styled").StyledCompon
|
|
|
266
265
|
isFullyUsed?: boolean | undefined;
|
|
267
266
|
}, {}, {}>;
|
|
268
267
|
export declare const PercentageContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
269
|
-
export declare const DateContainer: import("@emotion/styled").StyledComponent<import("..").
|
|
268
|
+
export declare const DateContainer: import("@emotion/styled").StyledComponent<import("..").DateCellBaseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
270
269
|
export declare const PiePercentage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
271
270
|
percentage: number;
|
|
272
271
|
isCapture?: boolean | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled } from '@mui/material/styles';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
|
-
import
|
|
3
|
+
import DateViewer from '../DateCell/DateViewer';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
export const RefundCellContainer = styled(motion.div)(({ theme }) => ({
|
|
6
6
|
display: 'flex',
|
|
@@ -32,7 +32,7 @@ export const PercentageContainer = styled('div')(({ theme }) => ({
|
|
|
32
32
|
gap: theme.spacing(0.5),
|
|
33
33
|
lineHeight: 0,
|
|
34
34
|
}));
|
|
35
|
-
export const DateContainer = styled(
|
|
35
|
+
export const DateContainer = styled(DateViewer)(({ theme }) => ({
|
|
36
36
|
fontSize: '12px',
|
|
37
37
|
fontWeight: theme.typography.fontWeightRegular,
|
|
38
38
|
color: theme.palette.secondary.main,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const SalesChannelsContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const ReferenceSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
5
4
|
hidden?: boolean | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const StyledSourceCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
4
3
|
export declare const StyledSourceImage: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
5
4
|
export declare const PaymentSourcesContainer: import("@emotion/styled").StyledComponent<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
2
|
export declare const GeographyBox: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
4
3
|
variant?: "Global" | "Regional" | "Local" | undefined;
|
|
5
4
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -5,7 +5,7 @@ import { getGeographyBoxColor } from '../../../utils/index.js';
|
|
|
5
5
|
import type { ActionType, FlagType } from './ActionCell';
|
|
6
6
|
export type GeographyBoxVariant = keyof ReturnType<typeof getGeographyBoxColor>;
|
|
7
7
|
export type PaymentMethod = 'VISA' | 'card' | 'MASTERCARD' | 'APPLE_PAY' | 'KNET' | 'MADA';
|
|
8
|
-
export interface
|
|
8
|
+
export interface DateCellBaseProps extends TableCellProps {
|
|
9
9
|
value: string | Date;
|
|
10
10
|
format?: object;
|
|
11
11
|
flagIcon?: string;
|
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.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.273-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -164,4 +164,4 @@
|
|
|
164
164
|
"publishConfig": {
|
|
165
165
|
"registry": "https://registry.npmjs.org/"
|
|
166
166
|
}
|
|
167
|
-
}
|
|
167
|
+
}
|