@tap-payments/os-micro-frontend-shared 0.1.96-test.24 → 0.1.96-test.25
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/AppServices/AppServices.js +2 -0
- package/build/components/BackgroundAnimation/BackgroundAnimation.js +28 -0
- package/build/components/BackgroundAnimation/Blob/Blob.js +2 -0
- package/build/components/Chip/style.js +1 -0
- package/build/components/ColorPicker/HexaFields.js +4 -0
- package/build/components/ColorPicker/style.js +1 -1
- package/build/components/Dialog/style.js +1 -0
- package/build/components/DisplayAmount/DisplayAmount.d.ts +10 -0
- package/build/components/DisplayAmount/DisplayAmount.js +22 -0
- package/build/components/DisplayAmount/index.d.ts +2 -0
- package/build/components/DisplayAmount/index.js +2 -0
- package/build/components/DisplayAmount/style.d.ts +5 -0
- package/build/components/DisplayAmount/style.js +14 -0
- package/build/components/Dropdown2/style.js +2 -0
- package/build/components/ErrorToast/ErrorToast.d.ts +3 -0
- package/build/components/ErrorToast/ErrorToast.js +7 -0
- package/build/components/ErrorToast/index.d.ts +2 -0
- package/build/components/ErrorToast/index.js +2 -0
- package/build/components/ErrorToast/style.d.ts +9 -0
- package/build/components/ErrorToast/style.js +33 -0
- package/build/components/ErrorToast/type.d.ts +10 -0
- package/build/components/ErrorToast/type.js +1 -0
- package/build/components/HeatMap/constant.js +1 -1
- package/build/components/InputBase/AmountInputBase/CurrencyList/style.js +3 -0
- package/build/components/InputBase/PhoneInputBase/CountriesList/CountriesList.js +1 -1
- package/build/components/InputBase/PhoneInputBase/CountriesList/style.js +3 -0
- package/build/components/InputBase/SelectBase/SelectBase.js +1 -0
- package/build/components/InputBase/SelectBase/SelectBaseMultiple.js +3 -0
- package/build/components/InputBase/SelectBase/style.js +3 -2
- package/build/components/InputNumber/InputNumber.js +2 -0
- package/build/components/Inputs/Input/style.js +6 -2
- package/build/components/Inputs/Select/Select.js +1 -0
- package/build/components/Inputs/Select/style.js +3 -2
- package/build/components/JSONViewer/JSONViewer.js +10 -2
- package/build/components/JSONViewer/context/Provider.js +2 -0
- package/build/components/LanguageDropdown/LanguageDropdown.d.ts +6 -0
- package/build/components/LanguageDropdown/LanguageDropdown.js +24 -0
- package/build/components/LanguageDropdown/index.d.ts +2 -0
- package/build/components/LanguageDropdown/index.js +2 -0
- package/build/components/LanguageDropdown/style.d.ts +6 -0
- package/build/components/LanguageDropdown/style.js +5 -0
- package/build/components/LeftPeekRightExpandingChip/LeftPeekRightExpandingChip.d.ts +10 -0
- package/build/components/LeftPeekRightExpandingChip/LeftPeekRightExpandingChip.js +14 -1
- package/build/components/LeftPeekRightExpandingChip/style.js +1 -0
- package/build/components/LeftPeekRightExpandingChip/useLeftPeekRightExpandingChip.js +30 -2
- package/build/components/MFWidgetLoader/MFWidgetLoader.js +3 -3
- package/build/components/MultiSelectStatusButton/MultiSelectStatusButton.js +3 -0
- package/build/components/NestedDropdown/Dropdown.js +3 -0
- package/build/components/RFH/Inputs/FormInput/FormInput.js +1 -0
- package/build/components/RFH/Inputs/MultiSelect/MultiSelect.js +1 -0
- package/build/components/RangeCalender/RangeCalender.js +1 -0
- package/build/components/RangeCalender/components/RangeDatepicker/RangeDatepicker.js +3 -1
- package/build/components/RangeCalender/style.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.d.ts +32 -0
- package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +36 -2
- package/build/components/RightLeftExpandingCenterChip/style.js +25 -4
- package/build/components/RightLeftExpandingCenterChip/useRightLeftExpandingCenterChip.d.ts +5 -0
- package/build/components/RightLeftExpandingCenterChip/useRightLeftExpandingCenterChip.js +53 -1
- package/build/components/ScrollLoader/ScrollLoader.js +2 -1
- package/build/components/SearchListInput/SearchListInput.d.ts +10 -0
- package/build/components/SearchListInput/SearchListInput.js +20 -0
- package/build/components/SearchListInput/index.d.ts +2 -0
- package/build/components/SearchListInput/index.js +2 -0
- package/build/components/SearchListInput/style.d.ts +7 -0
- package/build/components/SearchListInput/style.js +15 -0
- package/build/components/StatusButton/StatusButton.js +11 -3
- package/build/components/StatusButton/constant.js +3 -1
- package/build/components/StatusButton/style.d.ts +2 -1
- package/build/components/StatusButton/type.d.ts +13 -1
- package/build/components/StatusIcons/AuthIcons/constants.js +5 -0
- package/build/components/StatusIcons/AuthorizationAutoIcons/CaptureAutoIcon.js +11 -0
- package/build/components/StatusIcons/AuthorizationAutoIcons/VoidAutoIcon.js +11 -0
- package/build/components/TableCells/CustomCells/ApplicationStatusCell/ApplicationStatusCell.js +3 -1
- package/build/components/TableCells/CustomCells/BankCell/BankCell.js +2 -2
- package/build/components/TableCells/CustomCells/BrandCell/BrandCell.js +1 -0
- package/build/components/TableCells/CustomCells/DateCell/DateCell.js +2 -2
- package/build/components/TableCells/CustomCells/EntityCell/EntityCell.js +4 -3
- package/build/components/TableCells/CustomCells/EntityCell/style.d.ts +0 -3
- package/build/components/TableCells/CustomCells/EntityCell/style.js +2 -22
- package/build/components/TableCells/CustomCells/ReferenceCell/ReferenceCell.js +3 -1
- package/build/components/TableCells/CustomCells/RefundStatusCell/components/RefundStateIcon.js +1 -0
- package/build/components/TableCells/CustomCells/SalesChannelCell/SalesChannelCell.js +4 -3
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.d.ts +2 -1
- package/build/components/TableCells/CustomCells/SalesChannelCell/style.js +5 -6
- package/build/components/TableCells/CustomCells/SegmentsCell/SegmentsCell.js +3 -1
- package/build/components/TableCells/CustomCells/SourceMergedCell/SourceMergedCell.js +7 -1
- package/build/components/TableCells/CustomCells/StatusCell/StatusCell.js +1 -0
- package/build/components/TableCells/CustomCells/WalletCell/WalletCell.js +3 -3
- package/build/components/TableView/CustomViews.js +2 -0
- package/build/components/TableView/TableView.js +1 -0
- package/build/components/Timepicker/Timepicker.js +1 -0
- package/build/components/Timepicker/utils.js +9 -5
- package/build/components/ToggleView/index.d.ts +1 -1
- package/build/components/ToggleView/index.js +1 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/SheetViewVirtualTable.js +11 -1
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableHeaderCell.js +2 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/components/SheetViewTableLoading.js +5 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/components/VirtualTable.js +6 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/usePinnedColumns.js +2 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableData.js +1 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useTableState.js +2 -0
- package/build/components/VirtualTables/SheetViewVirtualTable/hooks/useVirtualTableContainer.js +3 -2
- package/build/components/VirtualTables/SheetViewVirtualTable/style.js +1 -1
- package/build/components/VirtualTables/VirtualTable/VirtualTable.js +12 -2
- package/build/components/VirtualTables/VirtualTableWithCard/VirtualTableWithCard.js +6 -1
- package/build/components/VirtualTables/components/ColumnFilter/Inputs/Inputs.js +1 -0
- package/build/components/VirtualTables/components/TableFooter/TableFooter.js +9 -0
- package/build/components/VirtualTables/components/TableRow.js +5 -0
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapper.js +2 -0
- package/build/components/VirtualTables/components/virtualScroll/ListItemWrapperWithCard.js +2 -0
- package/build/components/VirtualTables/components/virtualScroll/VirtualScrollList.js +16 -1
- package/build/components/Widget/style.js +1 -0
- package/build/components/Window/style.js +1 -0
- package/build/components/index.d.ts +10 -6
- package/build/components/index.js +10 -6
- package/build/constants/assets.d.ts +2 -0
- package/build/constants/assets.js +6 -0
- package/build/constants/server.js +1 -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/constants/table/cell/terminalsTableCellWidth.d.ts +3 -3
- package/build/constants/table/cell/terminalsTableCellWidth.js +3 -3
- package/build/hooks/useCountdown.js +4 -0
- package/build/hooks/useStickyHeaderShadow.js +6 -0
- package/build/types/entity.d.ts +5 -0
- package/build/utils/api.js +3 -0
- package/build/utils/array.js +5 -1
- package/build/utils/billing.js +1 -0
- package/build/utils/country.d.ts +1 -1
- package/build/utils/country.js +2 -1
- package/build/utils/currency.js +6 -0
- package/build/utils/date.d.ts +5 -0
- package/build/utils/date.js +31 -3
- package/build/utils/encrypt.js +3 -1
- package/build/utils/error.js +2 -0
- package/build/utils/freshdesk.js +2 -0
- package/build/utils/geography.js +1 -1
- package/build/utils/localStorage.js +7 -0
- package/build/utils/merchant.js +3 -0
- package/build/utils/number.d.ts +2 -0
- package/build/utils/number.js +8 -0
- package/build/utils/segment.js +1 -0
- package/build/utils/string.d.ts +7 -0
- package/build/utils/string.js +10 -0
- package/build/utils/style.d.ts +11 -0
- package/build/utils/style.js +28 -0
- package/build/utils/table.js +1 -1
- package/build/utils/url.js +2 -0
- package/package.json +2 -2
|
@@ -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
|
+
}));
|
|
@@ -30,6 +30,8 @@ function AppServices({ isMaximized, serviceCode, dimensions, appCode, services,
|
|
|
30
30
|
const handleOpenDropdown = () => {
|
|
31
31
|
setOpenDropdown((prev) => !prev);
|
|
32
32
|
};
|
|
33
|
+
// NOTE: Removed `pathname` from deps — tab title now updates based on serviceCode changes.
|
|
34
|
+
// Revisit if issues arise with tab title updates during navigation.
|
|
33
35
|
const activeTabTitle = useMemo(() => {
|
|
34
36
|
var _a, _b;
|
|
35
37
|
return getNameText((_b = (_a = servicesList.filter((service) => service.code.toLowerCase() === decodeURIComponent(serviceCode).toLowerCase())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.name, i18n.language);
|
|
@@ -11,6 +11,34 @@ const Wrapper = styled(Box)(({ theme }) => ({
|
|
|
11
11
|
width: '100%',
|
|
12
12
|
height: '100%',
|
|
13
13
|
backgroundColor: theme.palette.grey[100],
|
|
14
|
+
// '.blob_right': {
|
|
15
|
+
// animation: 'right 35s ease infinite alternate'
|
|
16
|
+
// },
|
|
17
|
+
// '.blob_left': {
|
|
18
|
+
// animation: 'left 35s ease infinite alternate'
|
|
19
|
+
// },
|
|
20
|
+
// '@keyframes right': {
|
|
21
|
+
// '0%': {
|
|
22
|
+
// transform: 'translate(0, 0) scale(1)'
|
|
23
|
+
// },
|
|
24
|
+
// '50%': {
|
|
25
|
+
// transform: 'translate(-50%, -200%) scale(1.5)'
|
|
26
|
+
// },
|
|
27
|
+
// '100%': {
|
|
28
|
+
// transform: 'translate(0, 0) scale(1)'
|
|
29
|
+
// }
|
|
30
|
+
// },
|
|
31
|
+
// '@keyframes left': {
|
|
32
|
+
// '0%': {
|
|
33
|
+
// transform: 'translate(0, 0) scale(1)'
|
|
34
|
+
// },
|
|
35
|
+
// '50%': {
|
|
36
|
+
// transform: 'translate(50%, 100%) scale(1.5)'
|
|
37
|
+
// },
|
|
38
|
+
// '100%': {
|
|
39
|
+
// transform: 'translate(0, 0) scale(1)'
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
14
42
|
}));
|
|
15
43
|
function BackgroundAnimation({ gradient = 'purpleBlue', blobHeight = '30vw', blobWidth = '30vw' }) {
|
|
16
44
|
return (_jsxs(Wrapper, Object.assign({ "aria-label": "Background-Animation-section", className: "blobContainer", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center" }, { children: [_jsx(Blob, { "aria-label": "Background-Animation-Blob-right", gradient: gradient, width: blobWidth, height: blobHeight, className: "blob_right", style: {
|
|
@@ -26,6 +26,8 @@ const Wrapper = styled(Box)(() => ({
|
|
|
26
26
|
function Blob(_a) {
|
|
27
27
|
var { gradient = 'blueGreen', height = 500, width = 500, style } = _a, props = __rest(_a, ["gradient", "height", "width", "style"]);
|
|
28
28
|
const theme = useTheme();
|
|
29
|
+
// TODO: need to add direction of gradient translate.
|
|
30
|
+
// example Blob one will have a translateX of 100% and Blob two will have a translateX of -100%.
|
|
29
31
|
return (_jsx(Wrapper, Object.assign({}, props, { className: props.className || '', sx: Object.assign({ backgroundImage: theme.palette.background.gradient[gradient], width,
|
|
30
32
|
height }, style) })));
|
|
31
33
|
}
|
|
@@ -49,6 +49,7 @@ export const SourcesContainer = styled(motion.span)(({ sourcesCount }) => ({
|
|
|
49
49
|
backgroundColor: 'transparent',
|
|
50
50
|
borderRadius: '16px',
|
|
51
51
|
}));
|
|
52
|
+
// eslint-disable-next-line react-refresh/only-export-components
|
|
52
53
|
export const defaultGetSourceAnimation = (params) => {
|
|
53
54
|
const { index, xDelta = 39, shadow, itemsCount = 0, expandDirection = 'RIGHT' } = params;
|
|
54
55
|
const startDisplacement = (itemsCount - 1) * 6;
|
|
@@ -13,6 +13,7 @@ const HexaFields = ({ value, onChange }) => {
|
|
|
13
13
|
}, [value]);
|
|
14
14
|
const [hexInput, setHexInput] = useState(colorAsHex);
|
|
15
15
|
const alphaPercent = Math.round(value.a * 100);
|
|
16
|
+
// Sync hexInput whenever `value` changes externally
|
|
16
17
|
useEffect(() => {
|
|
17
18
|
const newHex = Color.rgb(value.r, value.g, value.b).hex().replace('#', '');
|
|
18
19
|
setHexInput(newHex);
|
|
@@ -26,6 +27,7 @@ const HexaFields = ({ value, onChange }) => {
|
|
|
26
27
|
const handleHexBlur = () => {
|
|
27
28
|
let formattedValue = hexInput;
|
|
28
29
|
if (formattedValue.length === 3) {
|
|
30
|
+
// Expand shorthand like FFF -> FFFFFF
|
|
29
31
|
formattedValue = formattedValue
|
|
30
32
|
.split('')
|
|
31
33
|
.map((ch) => ch + ch)
|
|
@@ -43,10 +45,12 @@ const HexaFields = ({ value, onChange }) => {
|
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
47
|
catch (_a) {
|
|
48
|
+
// invalid hex -> revert to current value
|
|
46
49
|
setHexInput(colorAsHex);
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
else {
|
|
53
|
+
// revert to current value if incomplete
|
|
50
54
|
setHexInput(colorAsHex);
|
|
51
55
|
}
|
|
52
56
|
};
|
|
@@ -28,6 +28,7 @@ export const DialogContent = styled(Box)(({ theme }) => ({
|
|
|
28
28
|
export const DialogHeader = styled(Box)(({ theme }) => ({
|
|
29
29
|
minHeight: 95,
|
|
30
30
|
background: theme.palette.grey[400],
|
|
31
|
+
// backdropFilter: 'blur(4px)',
|
|
31
32
|
paddingInline: '24px',
|
|
32
33
|
paddingTop: '23px',
|
|
33
34
|
paddingBottom: '23px',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
import { Currency } from '../../types/index.js';
|
|
4
|
+
interface DisplayAmountI extends BoxProps {
|
|
5
|
+
amount: number;
|
|
6
|
+
selectedCurrency: Currency;
|
|
7
|
+
}
|
|
8
|
+
declare function DisplayAmount({ amount, selectedCurrency, ...props }: DisplayAmountI): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<typeof DisplayAmount>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { memo } from 'react';
|
|
14
|
+
import { formatAmountWithCurrency } from '../../utils/index.js';
|
|
15
|
+
import { DecimalSpan, CurrencySpan } from './style';
|
|
16
|
+
function DisplayAmount(_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var { amount, selectedCurrency } = _a, props = __rest(_a, ["amount", "selectedCurrency"]);
|
|
19
|
+
const { integerAmount, decimalAmount } = formatAmountWithCurrency(amount, (_b = selectedCurrency === null || selectedCurrency === void 0 ? void 0 : selectedCurrency.code) === null || _b === void 0 ? void 0 : _b.english);
|
|
20
|
+
return (_jsxs(CurrencySpan, Object.assign({}, props, { children: [_jsx("span", { children: integerAmount }), _jsx("span", { children: "." }), _jsx(DecimalSpan, { children: decimalAmount })] })));
|
|
21
|
+
}
|
|
22
|
+
export default memo(DisplayAmount);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
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>, {}>;
|
|
3
|
+
export declare const CurrencySpan: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Box from '@mui/material/Box';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
export const DecimalSpan = styled('span')(() => ({
|
|
4
|
+
fontWeight: 400,
|
|
5
|
+
}));
|
|
6
|
+
export const CurrencySpan = styled(Box)(() => ({
|
|
7
|
+
fontWeight: 700,
|
|
8
|
+
fontSize: '11px',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
cursor: 'default',
|
|
12
|
+
whiteSpace: 'nowrap',
|
|
13
|
+
overflow: 'auto',
|
|
14
|
+
}));
|
|
@@ -12,11 +12,13 @@ export const Info = styled(Box)(() => ({
|
|
|
12
12
|
export const Label = styled(Box)(() => ({
|
|
13
13
|
fontWeight: 600,
|
|
14
14
|
fontSize: '8px',
|
|
15
|
+
// lineHeight: '10.93px',
|
|
15
16
|
color: '#8D8D94',
|
|
16
17
|
}));
|
|
17
18
|
export const Value = styled(Box)(({ theme }) => ({
|
|
18
19
|
fontWeight: 500,
|
|
19
20
|
fontSize: '11px',
|
|
20
21
|
lineHeight: 1.1,
|
|
22
|
+
// lineHeight: '15.03px',
|
|
21
23
|
color: theme.palette.text.primary,
|
|
22
24
|
}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { reloadIcon } from '../../constants/index.js';
|
|
3
|
+
import { ToastContainer, ToastIcon, ToastText } from './style';
|
|
4
|
+
function ErrorToast({ message = 'Something went wrong', onRetry, position = 'bottom-center', iconSrc }) {
|
|
5
|
+
return (_jsxs(ToastContainer, Object.assign({ toastPosition: position }, { children: [_jsx(ToastText, { children: message }), _jsx(ToastIcon, { onClick: onRetry, src: iconSrc || reloadIcon, alt: "toast-icon" })] })));
|
|
6
|
+
}
|
|
7
|
+
export default ErrorToast;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastContainerProps } from './type';
|
|
3
|
+
export declare const ToastContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ToastContainerProps, {}, {}>;
|
|
6
|
+
export declare const ToastIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
7
|
+
export declare const ToastText: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
8
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
9
|
+
}, "width" | "minHeight" | "height" | "bottom" | "left" | "right" | "top" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "style" | "className" | "classes" | "children" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "sx" | "variant" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Box, styled, Typography } from '@mui/material';
|
|
2
|
+
export const ToastContainer = styled(Box, {
|
|
3
|
+
shouldForwardProp: (prop) => prop !== 'toastPosition',
|
|
4
|
+
})(({ theme, toastPosition }) => (Object.assign(Object.assign(Object.assign(Object.assign({ width: 160, position: 'absolute', bottom: 12, zIndex: 1000, display: 'flex', justifyContent: 'space-between', alignItems: 'center', backgroundColor: theme.palette.background.paper, height: 31, gap: theme.spacing(1), borderRadius: theme.shape.borderRadius, borderWidth: 1, padding: theme.spacing(1), border: `1px solid ${theme.palette.divider}`, boxShadow: '0px 0px 16px 0px #00000014', animation: 'slideIn 0.5s ease-out' }, (toastPosition === 'bottom-center' && {
|
|
5
|
+
left: '50%',
|
|
6
|
+
transform: 'translateX(-50%)',
|
|
7
|
+
})), (toastPosition === 'bottom-right' && {
|
|
8
|
+
right: 12,
|
|
9
|
+
transform: 'none',
|
|
10
|
+
})), (toastPosition === 'bottom-left' && {
|
|
11
|
+
left: 12,
|
|
12
|
+
transform: 'none',
|
|
13
|
+
})), { '@keyframes slideIn': {
|
|
14
|
+
'0%': {
|
|
15
|
+
opacity: 0,
|
|
16
|
+
transform: toastPosition === 'bottom-center' ? 'translate(-50%, 100%)' : toastPosition === 'bottom-right' ? 'translateX(100%)' : 'translateX(-100%)',
|
|
17
|
+
},
|
|
18
|
+
'100%': {
|
|
19
|
+
opacity: 1,
|
|
20
|
+
transform: toastPosition === 'bottom-center' ? 'translate(-50%, 0)' : 'translateX(0)',
|
|
21
|
+
},
|
|
22
|
+
} })));
|
|
23
|
+
export const ToastIcon = styled('img')({
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
});
|
|
26
|
+
export const ToastText = styled(Typography)(({ theme }) => ({
|
|
27
|
+
fontSize: 11,
|
|
28
|
+
fontWeight: 500,
|
|
29
|
+
color: theme.palette.text.primary,
|
|
30
|
+
overflow: 'hidden',
|
|
31
|
+
textOverflow: 'ellipsis',
|
|
32
|
+
whiteSpace: 'nowrap',
|
|
33
|
+
}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ToastPosition = 'bottom-center' | 'bottom-right' | 'bottom-left';
|
|
2
|
+
export interface ErrorToastProps {
|
|
3
|
+
message?: string;
|
|
4
|
+
onRetry?: () => void;
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
iconSrc?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastContainerProps {
|
|
9
|
+
toastPosition: ToastPosition;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const COLOR_OPACITY_DEGREE = [0.06, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];
|
|
1
|
+
export const COLOR_OPACITY_DEGREE = [0.06, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]; // 0 - 10 so we have a fixed color degrees as per the design
|
|
@@ -10,6 +10,9 @@ export const CurrencyButton = styled('button')(({ theme }) => ({
|
|
|
10
10
|
cursor: 'pointer',
|
|
11
11
|
}));
|
|
12
12
|
export const CurrenciesWrapper = styled(Popper)(({ theme }) => ({
|
|
13
|
+
// position: 'absolute',
|
|
14
|
+
// top: 30,
|
|
15
|
+
// left: 0,
|
|
13
16
|
zIndex: 99,
|
|
14
17
|
backgroundColor: theme.palette.common.white,
|
|
15
18
|
padding: '4px 8px',
|
|
@@ -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);
|
|
@@ -12,6 +12,9 @@ export const CountryButton = styled('button')(({ theme, disabled }) => ({
|
|
|
12
12
|
opacity: disabled ? 0.5 : 1,
|
|
13
13
|
}));
|
|
14
14
|
export const CountriesWrapper = styled(Popper)(({ theme }) => ({
|
|
15
|
+
// position: 'absolute',
|
|
16
|
+
// top: 30,
|
|
17
|
+
// left: 0,
|
|
15
18
|
zIndex: 9999,
|
|
16
19
|
backgroundColor: theme.palette.common.white,
|
|
17
20
|
padding: '4px 8px',
|
|
@@ -18,6 +18,7 @@ import { FormControlStyles, StyledErrorMessage, MuiSelect, Wrapper } from './sty
|
|
|
18
18
|
function SelectBase(_a, ref) {
|
|
19
19
|
var _b;
|
|
20
20
|
var { required, hasError, label, value, helperText, onChange, options, isOptionEqualToValue, renderOption, getOptionValue, isLoading, children, getOptionLabel } = _a, props = __rest(_a, ["required", "hasError", "label", "value", "helperText", "onChange", "options", "isOptionEqualToValue", "renderOption", "getOptionValue", "isLoading", "children", "getOptionLabel"]);
|
|
21
|
+
// eslint-disable-next-line
|
|
21
22
|
const handleChange = (option) => {
|
|
22
23
|
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
23
24
|
};
|
|
@@ -18,13 +18,16 @@ import { FormControlStyles, StyledErrorMessage, MuiSelect, Wrapper } from './sty
|
|
|
18
18
|
function SelectBaseMultiple(_a, ref) {
|
|
19
19
|
var _b;
|
|
20
20
|
var { required, hasError, label, value, helperText, onChange, options, isOptionEqualToValue, renderOption, getOptionValue, isLoading, children, getOptionLabel } = _a, props = __rest(_a, ["required", "hasError", "label", "value", "helperText", "onChange", "options", "isOptionEqualToValue", "renderOption", "getOptionValue", "isLoading", "children", "getOptionLabel"]);
|
|
21
|
+
// eslint-disable-next-line
|
|
21
22
|
const handleChange = (option) => {
|
|
22
23
|
onChange === null || onChange === void 0 ? void 0 : onChange(option);
|
|
23
24
|
};
|
|
24
25
|
const getMultipleValues = () => {
|
|
26
|
+
// eslint-disable-next-line
|
|
25
27
|
return getOptionValue ? value === null || value === void 0 ? void 0 : value.map(getOptionValue) : value === null || value === void 0 ? void 0 : value.map((v) => v === null || v === void 0 ? void 0 : v.id);
|
|
26
28
|
};
|
|
27
29
|
const selectedOptions = useMemo(() => options === null || options === void 0 ? void 0 : options.filter((option) => {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
31
|
return value === null || value === void 0 ? void 0 : value.some((v) => {
|
|
29
32
|
return isOptionEqualToValue ? isOptionEqualToValue(option, v) : option.id === (v === null || v === void 0 ? void 0 : v.id);
|
|
30
33
|
});
|
|
@@ -43,10 +43,10 @@ export const StyledSelect = styled(Select)(({ theme }) => ({
|
|
|
43
43
|
},
|
|
44
44
|
'& .MuiOutlinedInput-root': {
|
|
45
45
|
'& fieldset': {
|
|
46
|
-
borderColor: 'rgba(0, 0, 0, 0.23)',
|
|
46
|
+
borderColor: 'rgba(0, 0, 0, 0.23)', // default
|
|
47
47
|
},
|
|
48
48
|
'&.Mui-focused fieldset': {
|
|
49
|
-
border: '2px solid red',
|
|
49
|
+
border: '2px solid red', // focus
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
minWidth: 52,
|
|
@@ -56,6 +56,7 @@ export const StyledSelect = styled(Select)(({ theme }) => ({
|
|
|
56
56
|
'& .MuiFormLabel-asterisk': {
|
|
57
57
|
color: 'red',
|
|
58
58
|
},
|
|
59
|
+
// style form label
|
|
59
60
|
'& .MuiFormLabel-root': {
|
|
60
61
|
fontSize: '10px',
|
|
61
62
|
fontStyle: 'normal',
|
|
@@ -25,6 +25,7 @@ function InputNumber(_a, ref) {
|
|
|
25
25
|
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(evt);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
+
// eslint-disable-next-line
|
|
28
29
|
if (isSafari && isNaN(evt.key) && evt.key !== 'Backspace') {
|
|
29
30
|
evt.preventDefault();
|
|
30
31
|
}
|
|
@@ -32,6 +33,7 @@ function InputNumber(_a, ref) {
|
|
|
32
33
|
return (_jsx(Box, Object.assign({ sx: { flexGrow: 1 }, onClick: (e) => {
|
|
33
34
|
e.stopPropagation();
|
|
34
35
|
} }, { children: _jsx(InputStyled, Object.assign({}, props, { ref: ref, value: props.value || '', placeholder: props.placeholder, hideArrows: true, isError: isError, disableUnderline: true, inputProps: Object.assign(Object.assign({}, inputProps), { type: 'number' }), onKeyDown: handleKeyDown, onWheel: (e) => {
|
|
36
|
+
// eslint-disable-next-line
|
|
35
37
|
e.target instanceof HTMLElement && e.target.blur();
|
|
36
38
|
} })) })));
|
|
37
39
|
}
|
|
@@ -23,7 +23,9 @@ export const StyledInput = styled(TextField, {
|
|
|
23
23
|
border: '1px solid green',
|
|
24
24
|
}, '&.Mui-focused fieldset': {
|
|
25
25
|
border: '1px solid blue',
|
|
26
|
-
}, border: '1px solid #F2F2F2', borderRadius: '4px',
|
|
26
|
+
}, border: '1px solid #F2F2F2', borderRadius: '4px',
|
|
27
|
+
// input style
|
|
28
|
+
'& .MuiInputBase-input': {
|
|
27
29
|
margin: '0px !important',
|
|
28
30
|
padding: '0px !important',
|
|
29
31
|
color: '#20232B !important',
|
|
@@ -31,7 +33,9 @@ export const StyledInput = styled(TextField, {
|
|
|
31
33
|
fontStyle: 'normal !important',
|
|
32
34
|
fontWeight: '500 !important',
|
|
33
35
|
lineHeight: '130% !important',
|
|
34
|
-
},
|
|
36
|
+
},
|
|
37
|
+
// style form label
|
|
38
|
+
'& .MuiFormLabel-root': {
|
|
35
39
|
fontSize: '10px',
|
|
36
40
|
fontStyle: 'normal',
|
|
37
41
|
fontWeight: 500,
|
|
@@ -5,6 +5,7 @@ export const StyledSelect = styled(Select)(({ theme }) => ({
|
|
|
5
5
|
color: theme.palette.common.black,
|
|
6
6
|
borderRadius: '4px',
|
|
7
7
|
boxShadow: '0px 0px 6px 0px rgba(0, 0, 0, 0.11);',
|
|
8
|
+
// padding: '4px 8px',
|
|
8
9
|
height: '32px',
|
|
9
10
|
border: 'none',
|
|
10
11
|
outline: 'none',
|
|
@@ -14,10 +15,10 @@ export const StyledSelect = styled(Select)(({ theme }) => ({
|
|
|
14
15
|
},
|
|
15
16
|
'& .MuiOutlinedInput-root': {
|
|
16
17
|
'& fieldset': {
|
|
17
|
-
borderColor: 'rgba(0, 0, 0, 0.23)',
|
|
18
|
+
borderColor: 'rgba(0, 0, 0, 0.23)', // default
|
|
18
19
|
},
|
|
19
20
|
'&.Mui-focused fieldset': {
|
|
20
|
-
border: '2px solid red',
|
|
21
|
+
border: '2px solid red', // focus
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
}));
|
|
@@ -201,7 +201,11 @@ export default function JSONViewer({ index, json, requestJson = {}, isWindowMini
|
|
|
201
201
|
if (!keyName) {
|
|
202
202
|
return _jsx("span", {});
|
|
203
203
|
}
|
|
204
|
-
} }), _jsx(JsonView.Copied
|
|
204
|
+
} }), _jsx(JsonView.Copied
|
|
205
|
+
// @ts-expect-error Type is not supported
|
|
206
|
+
, {
|
|
207
|
+
// @ts-expect-error Type is not supported
|
|
208
|
+
render: ({ 'data-copied': copied, style, onClick }, { keyName }) => {
|
|
205
209
|
if (!keyName) {
|
|
206
210
|
return _jsx("span", {});
|
|
207
211
|
}
|
|
@@ -253,7 +257,11 @@ export default function JSONViewer({ index, json, requestJson = {}, isWindowMini
|
|
|
253
257
|
if (!keyName) {
|
|
254
258
|
return _jsx("span", {});
|
|
255
259
|
}
|
|
256
|
-
} }), _jsx(JsonView.Copied
|
|
260
|
+
} }), _jsx(JsonView.Copied
|
|
261
|
+
// @ts-expect-error Type is not supported
|
|
262
|
+
, {
|
|
263
|
+
// @ts-expect-error Type is not supported
|
|
264
|
+
render: ({ 'data-copied': copied, style, onClick }, { keyName }) => {
|
|
257
265
|
if (!keyName) {
|
|
258
266
|
return _jsx("span", {});
|
|
259
267
|
}
|
|
@@ -11,9 +11,11 @@ export const JsonViewerDialogContextProvider = ({ children }) => {
|
|
|
11
11
|
alert('Maximum allowed active Json Viewer is 7 per table.');
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
+
// Prevent duplicate JsonViewer that's currently open
|
|
14
15
|
if (jsonViewerList.some((item) => item.json.id === jsonViewer.json.id)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
18
|
+
// Create a copy to avoid mutating the original object
|
|
17
19
|
const jsonCopy = structuredClone(jsonViewer.json);
|
|
18
20
|
const requestData = jsonCopy.request_body;
|
|
19
21
|
const jsonViewerPreservedRequest = {
|