@tap-payments/os-micro-frontend-shared 0.1.136 → 0.1.138-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/AmountInput/AmountInput.d.ts +14 -0
- package/build/components/AmountInput/AmountInput.js +43 -0
- package/build/components/AmountInput/index.d.ts +2 -0
- package/build/components/AmountInput/index.js +2 -0
- package/build/components/AmountInput/style.d.ts +8 -0
- package/build/components/AmountInput/style.js +30 -0
- package/build/components/InputBase/PhoneInputBase/CountriesList/CountriesList.js +1 -1
- package/build/components/RangeCalender/style.js +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/constants/assets.d.ts +2 -0
- package/build/constants/assets.js +2 -0
- package/build/constants/table/cell/authorizationTableCellWidth.d.ts +6 -6
- package/build/constants/table/cell/authorizationTableCellWidth.js +6 -6
- package/build/constants/table/cell/chargeTableCellWidth.d.ts +6 -6
- package/build/constants/table/cell/chargeTableCellWidth.js +6 -6
- package/build/constants/table/cell/destinationsTableCellWidth.d.ts +5 -5
- package/build/constants/table/cell/destinationsTableCellWidth.js +5 -5
- package/build/constants/table/cell/refundTableCellWidth.d.ts +7 -7
- package/build/constants/table/cell/refundTableCellWidth.js +7 -7
- package/build/utils/number.d.ts +2 -0
- package/build/utils/number.js +7 -0
- package/package.json +3 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
import { Currency } from '../../types/index.js';
|
|
4
|
+
interface AmountInputI extends BoxProps {
|
|
5
|
+
amount: number | string;
|
|
6
|
+
setAmount: (value?: number) => void;
|
|
7
|
+
maxAmount?: number;
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
selectedCurrency: Currency;
|
|
11
|
+
}
|
|
12
|
+
declare function AmountInput({ amount, setAmount, placeholder, maxAmount, isError, selectedCurrency, ...props }: AmountInputI): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<typeof AmountInput>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { memo, useMemo, useState } from 'react';
|
|
14
|
+
import { isSafariBrowser, getAmountPlaceholder } from '../../utils/index.js';
|
|
15
|
+
import { DisplayAmount } from '../index.js';
|
|
16
|
+
import { Wrapper, InputStyled } from './style';
|
|
17
|
+
const isSafari = isSafariBrowser();
|
|
18
|
+
function AmountInput(_a) {
|
|
19
|
+
var { amount, setAmount, placeholder, maxAmount, isError, selectedCurrency } = _a, props = __rest(_a, ["amount", "setAmount", "placeholder", "maxAmount", "isError", "selectedCurrency"]);
|
|
20
|
+
const [editMode, setEditMode] = useState(false);
|
|
21
|
+
const [value, setValue] = useState(amount || '');
|
|
22
|
+
const currencyPlaceholder = useMemo(() => getAmountPlaceholder(selectedCurrency === null || selectedCurrency === void 0 ? void 0 : selectedCurrency.decimals), [selectedCurrency]);
|
|
23
|
+
const onChange = (e) => {
|
|
24
|
+
const newValue = Number(e.target.value) || 0;
|
|
25
|
+
if (!!maxAmount && newValue > maxAmount)
|
|
26
|
+
return false;
|
|
27
|
+
setValue(newValue);
|
|
28
|
+
setAmount(newValue);
|
|
29
|
+
};
|
|
30
|
+
const onBlur = () => {
|
|
31
|
+
setEditMode(false);
|
|
32
|
+
setAmount(Number(value));
|
|
33
|
+
};
|
|
34
|
+
const onKeyDown = (evt) => {
|
|
35
|
+
if (isSafari && isNaN(Number(evt.key)) && evt.key !== 'Backspace' && evt.key !== '.') {
|
|
36
|
+
evt.preventDefault();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (_jsx(Wrapper, Object.assign({ sx: props.sx }, { children: editMode ? (_jsx(InputStyled, { placeholder: currencyPlaceholder, value: value, onChange: onChange, onBlur: onBlur, onKeyDown: onKeyDown, isError: isError, inputProps: { step: '0.01' }, hideArrows: true, autoFocus: true })) : (_jsx(DisplayAmount, { selectedCurrency: selectedCurrency, amount: amount, onClick: () => {
|
|
40
|
+
setEditMode(true);
|
|
41
|
+
} })) })));
|
|
42
|
+
}
|
|
43
|
+
export default memo(AmountInput);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: 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
|
+
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
|
+
export declare const InputStyled: import("@emotion/styled").StyledComponent<Omit<Readonly<import("@mui/material").InputProps & {
|
|
6
|
+
isError?: boolean | undefined;
|
|
7
|
+
hideArrows?: boolean | undefined;
|
|
8
|
+
}>, "ref"> & import("react").RefAttributes<HTMLInputElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
import { InputNumber } from '../index.js';
|
|
4
|
+
export const Wrapper = styled(Box)(({ theme }) => ({
|
|
5
|
+
color: theme.palette.text.primary,
|
|
6
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
7
|
+
padding: theme.spacing(1),
|
|
8
|
+
borderRadius: '4px',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'flex-end',
|
|
12
|
+
width: 93,
|
|
13
|
+
height: 32,
|
|
14
|
+
textAlign: 'right',
|
|
15
|
+
input: {
|
|
16
|
+
fontSize: '11px',
|
|
17
|
+
border: 'none',
|
|
18
|
+
color: theme.palette.text.primary,
|
|
19
|
+
height: 30,
|
|
20
|
+
padding: 0,
|
|
21
|
+
textAlign: 'right',
|
|
22
|
+
},
|
|
23
|
+
img: { cursor: 'pointer' },
|
|
24
|
+
}));
|
|
25
|
+
export const InputStyled = styled(InputNumber)(() => ({
|
|
26
|
+
padding: 0,
|
|
27
|
+
border: 'none',
|
|
28
|
+
height: 24,
|
|
29
|
+
input: { textAlign: 'right', width: '100%' },
|
|
30
|
+
}));
|
|
@@ -51,7 +51,7 @@ function CountriesList({ isLoading, countries, value: countryValue, onCountryCha
|
|
|
51
51
|
border: 'none',
|
|
52
52
|
height: 34,
|
|
53
53
|
paddingInlineStart: '8px',
|
|
54
|
-
} }, { children: isLoading ? (_jsx(Skeleton, { variant: "rectangular", width: 56.5, height: 20, sx: { borderRadius: '4px' } })) : (_jsxs(_Fragment, { children: [selectedCountry && (_jsxs(_Fragment, { children: [_jsx("img", { src: selectedCountry.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.idd_prefix}` })] })), required && _jsx(Required, Object.assign({ component: "span" }, { children: "*" })), _jsx(Box, { component: "img", src: downArrowIcon, alt: "d", className: "arrow", sx: Object.assign({}, (open && { transform: 'rotate(180deg)' })) })] })) })), open && _jsx(CustomBackdrop, { onClick: closeDropdown }), open && (_jsx(ClickAwayListener, Object.assign({ onClickAway: closeDropdown }, { children: _jsxs(CountriesWrapper, Object.assign({ id: "CountriesList_CountriesWrapper", open: open, anchorEl: anchorEl, "data-testid": "CountriesList_CountriesWrapper", placement: "bottom-start" }, { children: [_jsx(InputStyled, { endAdornment: _jsx("img", { src: searchIcon, alt: "arrow" }), onChange: handleSearch, hideArrows: true, "data-testid": "CountriesList_InputStyled", value: searchValue }), _jsx(CountriesListStyled, Object.assign({ "data-testid": "CountriesList_CountriesListStyled" }, { children: filteredCountries.map((country) => {
|
|
54
|
+
} }, { children: isLoading ? (_jsx(Skeleton, { variant: "rectangular", width: 56.5, height: 20, sx: { borderRadius: '4px' } })) : (_jsxs(_Fragment, { children: [selectedCountry && (_jsxs(_Fragment, { children: [_jsx("img", { src: selectedCountry.logo, alt: "c", className: "logo" }), _jsx("span", { children: `+${selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.idd_prefix}` })] })), required && _jsx(Required, Object.assign({ component: "span" }, { children: "*" })), _jsx(Box, { component: "img", src: downArrowIcon, alt: "d", className: "arrow", sx: Object.assign({}, (open && { transform: 'rotate(180deg)' })) })] })) })), open && _jsx(CustomBackdrop, { onClick: closeDropdown, sx: { zIndex: 9999 } }), open && (_jsx(ClickAwayListener, Object.assign({ onClickAway: closeDropdown }, { children: _jsxs(CountriesWrapper, Object.assign({ id: "CountriesList_CountriesWrapper", open: open, anchorEl: anchorEl, "data-testid": "CountriesList_CountriesWrapper", placement: "bottom-start" }, { children: [_jsx(InputStyled, { endAdornment: _jsx("img", { src: searchIcon, alt: "arrow" }), onChange: handleSearch, hideArrows: true, "data-testid": "CountriesList_InputStyled", value: searchValue }), _jsx(CountriesListStyled, Object.assign({ "data-testid": "CountriesList_CountriesListStyled" }, { children: filteredCountries.map((country) => {
|
|
55
55
|
const isSelected = (selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.countryId) === country.countryId;
|
|
56
56
|
return (_jsxs(CountryStyled, Object.assign({ onClick: () => {
|
|
57
57
|
handleOnCountryChange(country);
|
|
@@ -39,7 +39,7 @@ export const CalenderWrapper = styled(Box)(({ theme }) => ({
|
|
|
39
39
|
padding: 0,
|
|
40
40
|
},
|
|
41
41
|
'.rmdp-day.rmdp-today span': {
|
|
42
|
-
backgroundColor: 'transparent',
|
|
42
|
+
backgroundColor: 'transparent !important',
|
|
43
43
|
color: theme.palette.info.dark,
|
|
44
44
|
},
|
|
45
45
|
'.rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span': {
|
|
@@ -114,3 +114,4 @@ export { default as ErrorToast } from './ErrorToast';
|
|
|
114
114
|
export { default as ToggleView, type ToggleViewsValues, ToggleViews } from './ToggleView';
|
|
115
115
|
export { default as LanguageDropdown } from './LanguageDropdown';
|
|
116
116
|
export { default as DisplayAmount } from './DisplayAmount';
|
|
117
|
+
export { default as AmountInput } from './AmountInput';
|
|
@@ -114,3 +114,4 @@ export { default as ErrorToast } from './ErrorToast';
|
|
|
114
114
|
export { default as ToggleView, ToggleViews } from './ToggleView';
|
|
115
115
|
export { default as LanguageDropdown } from './LanguageDropdown';
|
|
116
116
|
export { default as DisplayAmount } from './DisplayAmount';
|
|
117
|
+
export { default as AmountInput } from './AmountInput';
|
|
@@ -547,3 +547,5 @@ export declare const sortAscArrowIcon: string;
|
|
|
547
547
|
export declare const closedOutlinedYellowCircle: string;
|
|
548
548
|
export declare const deactivatedOrangeCircle: string;
|
|
549
549
|
export declare const exclamationOutlinedOrangeCircle: string;
|
|
550
|
+
export declare const activeGreenIcon: string;
|
|
551
|
+
export declare const inActiveGreyIcon: string;
|
|
@@ -555,3 +555,5 @@ export const sortAscArrowIcon = `${lightUrl}/sortAscArrowIcon.svg`;
|
|
|
555
555
|
export const closedOutlinedYellowCircle = `${lightUrl}/closedOutlinedYellowCircle.svg`;
|
|
556
556
|
export const deactivatedOrangeCircle = `${lightUrl}/deactivatedOrangeCircle.svg`;
|
|
557
557
|
export const exclamationOutlinedOrangeCircle = `${lightUrl}/exclamationOutlinedOrangeCircle.svg`;
|
|
558
|
+
export const activeGreenIcon = `${lightUrl}/activeGreenIcon.svg`;
|
|
559
|
+
export const inActiveGreyIcon = `${lightUrl}/inActiveGreyIcon.svg`;
|
|
@@ -5,7 +5,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
5
5
|
readonly sheet: "240px";
|
|
6
6
|
};
|
|
7
7
|
readonly id: {
|
|
8
|
-
readonly default: "
|
|
8
|
+
readonly default: "205px";
|
|
9
9
|
readonly text: "225px";
|
|
10
10
|
readonly sheet: "250px";
|
|
11
11
|
};
|
|
@@ -25,7 +25,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
25
25
|
readonly sheet: "85px";
|
|
26
26
|
};
|
|
27
27
|
readonly date: {
|
|
28
|
-
readonly default: "
|
|
28
|
+
readonly default: "140px";
|
|
29
29
|
readonly text: "170px";
|
|
30
30
|
readonly sheet: "130px";
|
|
31
31
|
};
|
|
@@ -35,7 +35,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
35
35
|
readonly sheet: "80px";
|
|
36
36
|
};
|
|
37
37
|
readonly customer: {
|
|
38
|
-
readonly default: "
|
|
38
|
+
readonly default: "140px";
|
|
39
39
|
readonly text: "180px";
|
|
40
40
|
readonly sheet: "600px";
|
|
41
41
|
};
|
|
@@ -65,7 +65,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
65
65
|
readonly sheet: "180px";
|
|
66
66
|
};
|
|
67
67
|
readonly source: {
|
|
68
|
-
readonly default: "
|
|
68
|
+
readonly default: "70px";
|
|
69
69
|
readonly text: "125px";
|
|
70
70
|
readonly sheet: "125px";
|
|
71
71
|
};
|
|
@@ -80,7 +80,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
80
80
|
readonly sheet: "230px";
|
|
81
81
|
};
|
|
82
82
|
readonly amount: {
|
|
83
|
-
readonly default: "
|
|
83
|
+
readonly default: "130px";
|
|
84
84
|
readonly text: "195px";
|
|
85
85
|
readonly sheet: "150px";
|
|
86
86
|
};
|
|
@@ -95,7 +95,7 @@ export declare const authorizationTableCellWidth: {
|
|
|
95
95
|
readonly sheet: "95px";
|
|
96
96
|
};
|
|
97
97
|
readonly status: {
|
|
98
|
-
readonly default: "
|
|
98
|
+
readonly default: "70px";
|
|
99
99
|
readonly text: "100px";
|
|
100
100
|
readonly sheet: "300px";
|
|
101
101
|
};
|
|
@@ -5,7 +5,7 @@ export const authorizationTableCellWidth = {
|
|
|
5
5
|
sheet: '240px',
|
|
6
6
|
},
|
|
7
7
|
id: {
|
|
8
|
-
default: '
|
|
8
|
+
default: '205px',
|
|
9
9
|
text: '225px',
|
|
10
10
|
sheet: '250px',
|
|
11
11
|
},
|
|
@@ -25,7 +25,7 @@ export const authorizationTableCellWidth = {
|
|
|
25
25
|
sheet: '85px',
|
|
26
26
|
},
|
|
27
27
|
date: {
|
|
28
|
-
default: '
|
|
28
|
+
default: '140px',
|
|
29
29
|
text: '170px',
|
|
30
30
|
sheet: '130px',
|
|
31
31
|
},
|
|
@@ -35,7 +35,7 @@ export const authorizationTableCellWidth = {
|
|
|
35
35
|
sheet: '80px',
|
|
36
36
|
},
|
|
37
37
|
customer: {
|
|
38
|
-
default: '
|
|
38
|
+
default: '140px',
|
|
39
39
|
text: '180px',
|
|
40
40
|
sheet: '600px',
|
|
41
41
|
},
|
|
@@ -65,7 +65,7 @@ export const authorizationTableCellWidth = {
|
|
|
65
65
|
sheet: '180px',
|
|
66
66
|
},
|
|
67
67
|
source: {
|
|
68
|
-
default: '
|
|
68
|
+
default: '70px',
|
|
69
69
|
text: '125px',
|
|
70
70
|
sheet: '125px',
|
|
71
71
|
},
|
|
@@ -80,7 +80,7 @@ export const authorizationTableCellWidth = {
|
|
|
80
80
|
sheet: '230px',
|
|
81
81
|
},
|
|
82
82
|
amount: {
|
|
83
|
-
default: '
|
|
83
|
+
default: '130px',
|
|
84
84
|
text: '195px',
|
|
85
85
|
sheet: '150px',
|
|
86
86
|
},
|
|
@@ -95,7 +95,7 @@ export const authorizationTableCellWidth = {
|
|
|
95
95
|
sheet: '95px',
|
|
96
96
|
},
|
|
97
97
|
status: {
|
|
98
|
-
default: '
|
|
98
|
+
default: '70px',
|
|
99
99
|
text: '100px',
|
|
100
100
|
sheet: '300px',
|
|
101
101
|
},
|
|
@@ -10,7 +10,7 @@ export declare const chargeTableCellWidth: {
|
|
|
10
10
|
readonly sheet: "160px";
|
|
11
11
|
};
|
|
12
12
|
readonly id: {
|
|
13
|
-
readonly default: "
|
|
13
|
+
readonly default: "205px";
|
|
14
14
|
readonly text: "225px";
|
|
15
15
|
readonly sheet: "250px";
|
|
16
16
|
};
|
|
@@ -20,7 +20,7 @@ export declare const chargeTableCellWidth: {
|
|
|
20
20
|
readonly sheet: "85px";
|
|
21
21
|
};
|
|
22
22
|
readonly date: {
|
|
23
|
-
readonly default: "
|
|
23
|
+
readonly default: "140px";
|
|
24
24
|
readonly text: "170px";
|
|
25
25
|
readonly sheet: "130px";
|
|
26
26
|
};
|
|
@@ -35,7 +35,7 @@ export declare const chargeTableCellWidth: {
|
|
|
35
35
|
readonly sheet: "80px";
|
|
36
36
|
};
|
|
37
37
|
readonly customer: {
|
|
38
|
-
readonly default: "
|
|
38
|
+
readonly default: "140px";
|
|
39
39
|
readonly text: "180px";
|
|
40
40
|
readonly sheet: "600px";
|
|
41
41
|
};
|
|
@@ -60,7 +60,7 @@ export declare const chargeTableCellWidth: {
|
|
|
60
60
|
readonly sheet: "150px";
|
|
61
61
|
};
|
|
62
62
|
readonly source: {
|
|
63
|
-
readonly default: "
|
|
63
|
+
readonly default: "70px";
|
|
64
64
|
readonly text: "125px";
|
|
65
65
|
readonly sheet: "1250px";
|
|
66
66
|
};
|
|
@@ -115,7 +115,7 @@ export declare const chargeTableCellWidth: {
|
|
|
115
115
|
readonly sheet: "72px";
|
|
116
116
|
};
|
|
117
117
|
readonly amount: {
|
|
118
|
-
readonly default: "
|
|
118
|
+
readonly default: "130px";
|
|
119
119
|
readonly text: "195px";
|
|
120
120
|
readonly sheet: "550px";
|
|
121
121
|
};
|
|
@@ -180,7 +180,7 @@ export declare const chargeTableCellWidth: {
|
|
|
180
180
|
readonly sheet: "170px";
|
|
181
181
|
};
|
|
182
182
|
readonly metadata: {
|
|
183
|
-
readonly default: "
|
|
183
|
+
readonly default: "185px";
|
|
184
184
|
readonly text: "180px";
|
|
185
185
|
readonly sheet: "275px";
|
|
186
186
|
};
|
|
@@ -10,7 +10,7 @@ export const chargeTableCellWidth = {
|
|
|
10
10
|
sheet: '160px',
|
|
11
11
|
},
|
|
12
12
|
id: {
|
|
13
|
-
default: '
|
|
13
|
+
default: '205px',
|
|
14
14
|
text: '225px',
|
|
15
15
|
sheet: '250px',
|
|
16
16
|
},
|
|
@@ -20,7 +20,7 @@ export const chargeTableCellWidth = {
|
|
|
20
20
|
sheet: '85px',
|
|
21
21
|
},
|
|
22
22
|
date: {
|
|
23
|
-
default: '
|
|
23
|
+
default: '140px',
|
|
24
24
|
text: '170px',
|
|
25
25
|
sheet: '130px',
|
|
26
26
|
},
|
|
@@ -35,7 +35,7 @@ export const chargeTableCellWidth = {
|
|
|
35
35
|
sheet: '80px',
|
|
36
36
|
},
|
|
37
37
|
customer: {
|
|
38
|
-
default: '
|
|
38
|
+
default: '140px',
|
|
39
39
|
text: '180px',
|
|
40
40
|
sheet: '600px',
|
|
41
41
|
},
|
|
@@ -60,7 +60,7 @@ export const chargeTableCellWidth = {
|
|
|
60
60
|
sheet: '150px',
|
|
61
61
|
},
|
|
62
62
|
source: {
|
|
63
|
-
default: '
|
|
63
|
+
default: '70px',
|
|
64
64
|
text: '125px',
|
|
65
65
|
sheet: '1250px',
|
|
66
66
|
},
|
|
@@ -115,7 +115,7 @@ export const chargeTableCellWidth = {
|
|
|
115
115
|
sheet: '72px',
|
|
116
116
|
},
|
|
117
117
|
amount: {
|
|
118
|
-
default: '
|
|
118
|
+
default: '130px',
|
|
119
119
|
text: '195px',
|
|
120
120
|
sheet: '550px',
|
|
121
121
|
},
|
|
@@ -180,7 +180,7 @@ export const chargeTableCellWidth = {
|
|
|
180
180
|
sheet: '170px',
|
|
181
181
|
},
|
|
182
182
|
metadata: {
|
|
183
|
-
default: '
|
|
183
|
+
default: '185px',
|
|
184
184
|
text: '180px',
|
|
185
185
|
sheet: '275px',
|
|
186
186
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const destinationsTableCellWidth: {
|
|
2
2
|
readonly id: {
|
|
3
|
-
readonly default: "
|
|
3
|
+
readonly default: "205px";
|
|
4
4
|
readonly text: "225px";
|
|
5
5
|
readonly sheet: "225px";
|
|
6
6
|
};
|
|
@@ -10,7 +10,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
10
10
|
readonly sheet: "255px";
|
|
11
11
|
};
|
|
12
12
|
readonly created: {
|
|
13
|
-
readonly default: "
|
|
13
|
+
readonly default: "140px";
|
|
14
14
|
readonly text: "170px";
|
|
15
15
|
readonly sheet: "130px";
|
|
16
16
|
};
|
|
@@ -30,7 +30,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
30
30
|
readonly sheet: "250px";
|
|
31
31
|
};
|
|
32
32
|
readonly customer: {
|
|
33
|
-
readonly default: "
|
|
33
|
+
readonly default: "140px";
|
|
34
34
|
readonly text: "180px";
|
|
35
35
|
readonly sheet: "600px";
|
|
36
36
|
};
|
|
@@ -70,7 +70,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
70
70
|
readonly sheet: "235px";
|
|
71
71
|
};
|
|
72
72
|
readonly source: {
|
|
73
|
-
readonly default: "
|
|
73
|
+
readonly default: "70px";
|
|
74
74
|
readonly text: "125px";
|
|
75
75
|
readonly sheet: "125px";
|
|
76
76
|
};
|
|
@@ -85,7 +85,7 @@ export declare const destinationsTableCellWidth: {
|
|
|
85
85
|
readonly sheet: "165px";
|
|
86
86
|
};
|
|
87
87
|
readonly amount: {
|
|
88
|
-
readonly default: "
|
|
88
|
+
readonly default: "130px";
|
|
89
89
|
readonly text: "195px";
|
|
90
90
|
readonly sheet: "150px";
|
|
91
91
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const destinationsTableCellWidth = {
|
|
2
2
|
id: {
|
|
3
|
-
default: '
|
|
3
|
+
default: '205px',
|
|
4
4
|
text: '225px',
|
|
5
5
|
sheet: '225px',
|
|
6
6
|
},
|
|
@@ -10,7 +10,7 @@ export const destinationsTableCellWidth = {
|
|
|
10
10
|
sheet: '255px',
|
|
11
11
|
},
|
|
12
12
|
created: {
|
|
13
|
-
default: '
|
|
13
|
+
default: '140px',
|
|
14
14
|
text: '170px',
|
|
15
15
|
sheet: '130px',
|
|
16
16
|
},
|
|
@@ -30,7 +30,7 @@ export const destinationsTableCellWidth = {
|
|
|
30
30
|
sheet: '250px',
|
|
31
31
|
},
|
|
32
32
|
customer: {
|
|
33
|
-
default: '
|
|
33
|
+
default: '140px',
|
|
34
34
|
text: '180px',
|
|
35
35
|
sheet: '600px',
|
|
36
36
|
},
|
|
@@ -70,7 +70,7 @@ export const destinationsTableCellWidth = {
|
|
|
70
70
|
sheet: '235px',
|
|
71
71
|
},
|
|
72
72
|
source: {
|
|
73
|
-
default: '
|
|
73
|
+
default: '70px',
|
|
74
74
|
text: '125px',
|
|
75
75
|
sheet: '125px',
|
|
76
76
|
},
|
|
@@ -85,7 +85,7 @@ export const destinationsTableCellWidth = {
|
|
|
85
85
|
sheet: '165px',
|
|
86
86
|
},
|
|
87
87
|
amount: {
|
|
88
|
-
default: '
|
|
88
|
+
default: '130px',
|
|
89
89
|
text: '195px',
|
|
90
90
|
sheet: '150px',
|
|
91
91
|
},
|
|
@@ -5,14 +5,14 @@ export declare const refundTableCellWidth: {
|
|
|
5
5
|
readonly sheet: "240px";
|
|
6
6
|
};
|
|
7
7
|
readonly id: {
|
|
8
|
-
readonly default: "
|
|
8
|
+
readonly default: "205px";
|
|
9
9
|
readonly text: "225px";
|
|
10
10
|
readonly sheet: "250px";
|
|
11
11
|
};
|
|
12
12
|
readonly date: {
|
|
13
|
-
readonly default: "
|
|
13
|
+
readonly default: "140px";
|
|
14
14
|
readonly text: "170px";
|
|
15
|
-
readonly sheet: "
|
|
15
|
+
readonly sheet: "130px";
|
|
16
16
|
};
|
|
17
17
|
readonly order: {
|
|
18
18
|
readonly default: "80px";
|
|
@@ -25,7 +25,7 @@ export declare const refundTableCellWidth: {
|
|
|
25
25
|
readonly sheet: "85px";
|
|
26
26
|
};
|
|
27
27
|
readonly customer: {
|
|
28
|
-
readonly default: "
|
|
28
|
+
readonly default: "140px";
|
|
29
29
|
readonly text: "180px";
|
|
30
30
|
readonly sheet: "600px";
|
|
31
31
|
};
|
|
@@ -55,7 +55,7 @@ export declare const refundTableCellWidth: {
|
|
|
55
55
|
readonly sheet: "235px";
|
|
56
56
|
};
|
|
57
57
|
readonly source: {
|
|
58
|
-
readonly default: "
|
|
58
|
+
readonly default: "70px";
|
|
59
59
|
readonly text: "125px";
|
|
60
60
|
readonly sheet: "125px";
|
|
61
61
|
};
|
|
@@ -110,7 +110,7 @@ export declare const refundTableCellWidth: {
|
|
|
110
110
|
readonly sheet: "72px";
|
|
111
111
|
};
|
|
112
112
|
readonly amount: {
|
|
113
|
-
readonly default: "
|
|
113
|
+
readonly default: "130px";
|
|
114
114
|
readonly text: "195px";
|
|
115
115
|
readonly sheet: "150px";
|
|
116
116
|
};
|
|
@@ -155,7 +155,7 @@ export declare const refundTableCellWidth: {
|
|
|
155
155
|
readonly sheet: "200px";
|
|
156
156
|
};
|
|
157
157
|
readonly metadata: {
|
|
158
|
-
readonly default: "
|
|
158
|
+
readonly default: "185px";
|
|
159
159
|
readonly text: "180px";
|
|
160
160
|
readonly sheet: "180px";
|
|
161
161
|
};
|
|
@@ -5,14 +5,14 @@ export const refundTableCellWidth = {
|
|
|
5
5
|
sheet: '240px',
|
|
6
6
|
},
|
|
7
7
|
id: {
|
|
8
|
-
default: '
|
|
8
|
+
default: '205px',
|
|
9
9
|
text: '225px',
|
|
10
10
|
sheet: '250px',
|
|
11
11
|
},
|
|
12
12
|
date: {
|
|
13
|
-
default: '
|
|
13
|
+
default: '140px',
|
|
14
14
|
text: '170px',
|
|
15
|
-
sheet: '
|
|
15
|
+
sheet: '130px',
|
|
16
16
|
},
|
|
17
17
|
order: {
|
|
18
18
|
default: '80px',
|
|
@@ -25,7 +25,7 @@ export const refundTableCellWidth = {
|
|
|
25
25
|
sheet: '85px',
|
|
26
26
|
},
|
|
27
27
|
customer: {
|
|
28
|
-
default: '
|
|
28
|
+
default: '140px',
|
|
29
29
|
text: '180px',
|
|
30
30
|
sheet: '600px',
|
|
31
31
|
},
|
|
@@ -55,7 +55,7 @@ export const refundTableCellWidth = {
|
|
|
55
55
|
sheet: '235px',
|
|
56
56
|
},
|
|
57
57
|
source: {
|
|
58
|
-
default: '
|
|
58
|
+
default: '70px',
|
|
59
59
|
text: '125px',
|
|
60
60
|
sheet: '125px',
|
|
61
61
|
},
|
|
@@ -110,7 +110,7 @@ export const refundTableCellWidth = {
|
|
|
110
110
|
sheet: '72px',
|
|
111
111
|
},
|
|
112
112
|
amount: {
|
|
113
|
-
default: '
|
|
113
|
+
default: '130px',
|
|
114
114
|
text: '195px',
|
|
115
115
|
sheet: '150px',
|
|
116
116
|
},
|
|
@@ -155,7 +155,7 @@ export const refundTableCellWidth = {
|
|
|
155
155
|
sheet: '200px',
|
|
156
156
|
},
|
|
157
157
|
metadata: {
|
|
158
|
-
default: '
|
|
158
|
+
default: '185px',
|
|
159
159
|
text: '180px',
|
|
160
160
|
sheet: '180px',
|
|
161
161
|
},
|
package/build/utils/number.d.ts
CHANGED
|
@@ -4,3 +4,5 @@ export declare const stringToNumber: (value: string) => number;
|
|
|
4
4
|
export declare const numberToString: (value: number, fixed?: number) => string;
|
|
5
5
|
export declare function pad(num: number, length?: number): string;
|
|
6
6
|
export declare function isNegative(num: number): boolean;
|
|
7
|
+
export declare const getRoundedAmount: (amount: number, decimals: number) => number;
|
|
8
|
+
export declare const getAmountPlaceholder: (decimals: number) => string;
|
package/build/utils/number.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import round from 'lodash/round';
|
|
1
2
|
export function formatOrdinal(num) {
|
|
2
3
|
if (!num)
|
|
3
4
|
return '';
|
|
@@ -29,3 +30,9 @@ export function pad(num, length = 2) {
|
|
|
29
30
|
export function isNegative(num) {
|
|
30
31
|
return Math.sign(num) === -1;
|
|
31
32
|
}
|
|
33
|
+
export const getRoundedAmount = (amount, decimals) => {
|
|
34
|
+
return round(amount, decimals);
|
|
35
|
+
};
|
|
36
|
+
export const getAmountPlaceholder = (decimals) => {
|
|
37
|
+
return `0.${'0'.repeat(decimals)}`;
|
|
38
|
+
};
|
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.138-test.1",
|
|
5
|
+
"testVersion": 1,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
"publishConfig": {
|
|
137
137
|
"registry": "https://registry.npmjs.org/"
|
|
138
138
|
}
|
|
139
|
-
}
|
|
139
|
+
}
|