@tap-payments/auth-jsconnect 2.10.2-development → 2.10.4-development
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/assets/locales/ar.json +39 -11
- package/build/assets/locales/en.json +42 -41
- package/build/constants/app.js +12 -6
- package/build/constants/flows.d.ts +2 -1
- package/build/constants/flows.js +3 -2
- package/build/features/app/terminal/terminalStore.js +5 -2
- package/build/features/featuresScreens.js +6 -1
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +1 -1
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +38 -23
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +0 -12
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +1 -44
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +41 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +2 -2
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +0 -18
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +3 -71
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/{UnlinkedTerminalInfo → shared}/TerminalList.d.ts +3 -1
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +3 -0
- package/build/features/terminal/screens/shared/index.js +3 -0
- package/build/features/terminal/screens/shared/styles.d.ts +33 -0
- package/build/features/terminal/screens/shared/styles.js +105 -0
- package/build/utils/string.js +1 -1
- package/package.json +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/Header.d.ts +0 -6
- package/build/features/terminal/screens/TerminalDeviceList/Header.js +0 -23
- package/build/features/terminal/screens/UnlinkedTerminalInfo/TerminalList.js +0 -16
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import Button from '@mui/material/Button';
|
|
13
1
|
import Box from '@mui/material/Box';
|
|
14
|
-
import {
|
|
15
|
-
import Typography from '@mui/material/Typography';
|
|
16
|
-
export var Container = styled(Box)(function (_a) {
|
|
17
|
-
var spacing = _a.theme.spacing;
|
|
18
|
-
return ({
|
|
19
|
-
display: 'flex',
|
|
20
|
-
justifyContent: 'space-between',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
width: '100%',
|
|
23
|
-
paddingBottom: spacing(2)
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
export var LinkButton = styled(Button)(function (_a) {
|
|
27
|
-
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
28
|
-
return (__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, textTransform: 'none', color: palette.primary.main, display: 'flex', alignItems: 'center', gap: spacing(0.5) }));
|
|
29
|
-
});
|
|
30
|
-
export var AddIconContainer = styled(Box)(function (_a) {
|
|
31
|
-
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette;
|
|
32
|
-
return ({
|
|
33
|
-
background: alpha(palette.primary.main, 0.1),
|
|
34
|
-
height: spacing(2.25),
|
|
35
|
-
width: spacing(2.25),
|
|
36
|
-
display: 'flex',
|
|
37
|
-
justifyContent: 'center',
|
|
38
|
-
borderRadius: spacing(11.25),
|
|
39
|
-
alignItems: 'center'
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
export var LinkText = styled(Typography)(function (_a) {
|
|
43
|
-
var typography = _a.theme.typography;
|
|
44
|
-
return (__assign({}, typography.button_small));
|
|
45
|
-
});
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
46
3
|
export var DeviceListContainer = styled(Box)(function (_a) {
|
|
47
4
|
var spacing = _a.theme.spacing;
|
|
48
5
|
return ({
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
17
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import Button from '../../../../components/Button';
|
|
19
|
+
import { linkNewTerminal, storeSelectedTerminal, terminalSelector } from '../../../app/terminal/terminalStore';
|
|
20
|
+
import { Header, Container, TerminalList } from '../shared';
|
|
21
|
+
var TerminalListPage = function () {
|
|
22
|
+
var t = useTranslation().t;
|
|
23
|
+
var dispatch = useAppDispatch();
|
|
24
|
+
var _a = useAppSelector(terminalSelector), _b = _a.data, selectedTerminal = _b.terminalInfo.selectedTerminal, responseData = _b.responseData, loading = _a.loading;
|
|
25
|
+
var terminalList = (responseData || {}).terminalList;
|
|
26
|
+
var handleOnSelectTerminal = function (terminal) {
|
|
27
|
+
dispatch(storeSelectedTerminal(terminal));
|
|
28
|
+
dispatch(linkNewTerminal())
|
|
29
|
+
.unwrap()
|
|
30
|
+
.then(function (_a) {
|
|
31
|
+
var nextScreen = _a.nextScreen;
|
|
32
|
+
dispatch(handleNextScreenStep(nextScreen));
|
|
33
|
+
})
|
|
34
|
+
.catch(function () { });
|
|
35
|
+
};
|
|
36
|
+
var handleOnBack = function () {
|
|
37
|
+
dispatch(handlePrevScreenStep());
|
|
38
|
+
};
|
|
39
|
+
return (_jsxs(ScreenContainer, __assign({ minHeight: 200, sx: { pl: 2.5, pr: 2.5 }, justifyContent: 'space-between' }, { children: [_jsxs(Container, { children: [_jsx(Header, { title: 'terminal_select_device', sx: { pb: 0 } }), _jsx(TerminalList, { select: false, loading: loading, selectedTerminal: selectedTerminal, list: terminalList, onClick: handleOnSelectTerminal })] }), _jsx(Button, __assign({ sx: { mb: 1.5, mt: 1.5 }, onClick: function () { return handleOnBack(); }, variant: 'text' }, { children: t('back') }))] })));
|
|
40
|
+
};
|
|
41
|
+
export default React.memo(TerminalListPage);
|
|
@@ -26,7 +26,7 @@ import PushNotification from '../../../shared/PushNotification';
|
|
|
26
26
|
import Button from '../../../shared/Button';
|
|
27
27
|
import { Container, getId, getIdLabel, LinkWithText } from '../shared';
|
|
28
28
|
import { SendRequestContainer } from './styles';
|
|
29
|
-
import TerminalList from '
|
|
29
|
+
import { TerminalList } from '../shared';
|
|
30
30
|
var UnlinkedTerminalInfo = function () {
|
|
31
31
|
var t = useTranslation().t;
|
|
32
32
|
var typography = useTheme().typography;
|
|
@@ -78,7 +78,7 @@ var UnlinkedTerminalInfo = function () {
|
|
|
78
78
|
var handleOnBack = function () {
|
|
79
79
|
if (error)
|
|
80
80
|
dispatch(clearError());
|
|
81
|
-
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.
|
|
81
|
+
dispatch(handlePrevScreenStep(CONNECT_FLOWS.terminal.terminalDeviceList));
|
|
82
82
|
};
|
|
83
83
|
var handleOnSelectTerminal = function (terminal) {
|
|
84
84
|
if (error)
|
|
@@ -8,22 +8,4 @@ interface SendRequestContainerProps {
|
|
|
8
8
|
export declare const SendRequestContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
9
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
10
10
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & SendRequestContainerProps, {}, {}>;
|
|
11
|
-
export declare const ScrollContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
14
|
-
export declare const TerminalListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
17
|
-
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
18
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
20
|
-
export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
|
-
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
23
|
-
export declare const Image: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
24
|
-
export declare const Title: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
25
|
-
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
26
|
-
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
27
|
-
export declare const ListItem: import("@emotion/styled").StyledComponent<import("../../../../components/DeviceCard").DeviceCardProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
28
|
-
export declare const StyledRadio: import("@emotion/styled").StyledComponent<import("@mui/material/Radio").RadioProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
29
11
|
export {};
|
|
@@ -12,19 +12,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { alpha, styled } from '@mui/material/styles';
|
|
13
13
|
import Typography from '@mui/material/Typography';
|
|
14
14
|
import Box from '@mui/material/Box';
|
|
15
|
-
import Icon from '../../../../components/Icon';
|
|
16
|
-
import DeviceCard from '../../../../components/DeviceCard';
|
|
17
|
-
import { QRCodeDescription } from '../shared';
|
|
18
|
-
import Radio from '@mui/material/Radio';
|
|
19
15
|
export var ResendText = styled(Typography)(function (_a) {
|
|
20
16
|
var _b = _a.theme, palette = _b.palette, typography = _b.typography, spacing = _b.spacing;
|
|
21
17
|
return (__assign(__assign({ cursor: 'pointer', color: palette.primary.main }, typography.caption), { fontWeight: typography.fontWeightRegular, textAlign: 'end', marginTop: spacing(0.75) }));
|
|
22
18
|
});
|
|
23
|
-
export var SendRequestContainer = styled(
|
|
19
|
+
export var SendRequestContainer = styled(Box, {
|
|
24
20
|
shouldForwardProp: function (prop) { return !['hasError'].includes(prop.toString()); }
|
|
25
21
|
})(function (_a) {
|
|
26
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette, hasError = _a.hasError;
|
|
27
|
-
return (__assign(__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, mt: 2 }), (hasError && {
|
|
22
|
+
var _b = _a.theme, typography = _b.typography, palette = _b.palette, spacing = _b.spacing, hasError = _a.hasError;
|
|
23
|
+
return (__assign(__assign(__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, mt: 2, backgroundColor: palette.common.white, borderWidth: spacing(0.125, 0, 0.125, 0), borderStyle: 'solid', borderColor: palette.divider, padding: spacing(1.5, 2.5, 1.5, 2.5), marginTop: spacing(1), color: palette.text.primary }), typography.body1), (hasError && {
|
|
28
24
|
background: alpha(palette.error.dark, 0.3),
|
|
29
25
|
borderWidth: '1px, 0px, 1px, 0px',
|
|
30
26
|
borderStyle: 'solid',
|
|
@@ -32,67 +28,3 @@ export var SendRequestContainer = styled(QRCodeDescription, {
|
|
|
32
28
|
color: alpha(palette.error.main, 0.7)
|
|
33
29
|
})));
|
|
34
30
|
});
|
|
35
|
-
export var ScrollContainer = styled(Box)(function (_a) {
|
|
36
|
-
var spacing = _a.theme.spacing;
|
|
37
|
-
return ({
|
|
38
|
-
maxHeight: spacing(20.625),
|
|
39
|
-
overflow: 'scroll'
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
export var TerminalListContainer = styled(Box)(function (_a) {
|
|
43
|
-
var spacing = _a.theme.spacing;
|
|
44
|
-
return ({
|
|
45
|
-
display: 'flex',
|
|
46
|
-
justifyContent: 'space-between',
|
|
47
|
-
flexDirection: 'column',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
width: '100%',
|
|
50
|
-
gap: spacing(0.75)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
export var Container = styled(Box)(function (_a) {
|
|
54
|
-
var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, common = _c.common, toastDeviceSelectorDropdown = _c.components.toastDeviceSelectorDropdown;
|
|
55
|
-
return ({
|
|
56
|
-
marginTop: spacing(1),
|
|
57
|
-
border: "1px solid ".concat(toastDeviceSelectorDropdown.border),
|
|
58
|
-
backgroundColor: common.white,
|
|
59
|
-
borderRadius: spacing(1)
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
export var TitleContainer = styled(Box)(function (_a) {
|
|
63
|
-
var _b = _a.theme, spacing = _b.spacing, toastDeviceSelectorDropdown = _b.palette.components.toastDeviceSelectorDropdown;
|
|
64
|
-
return ({
|
|
65
|
-
padding: spacing(1.5, 2, 1.5, 2),
|
|
66
|
-
display: 'flex',
|
|
67
|
-
flexDirection: 'row',
|
|
68
|
-
gap: spacing(0.75),
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
borderBottom: "1px solid ".concat(toastDeviceSelectorDropdown.border)
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
export var Image = styled(Icon)(function (_a) {
|
|
74
|
-
var spacing = _a.theme.spacing;
|
|
75
|
-
return ({
|
|
76
|
-
width: spacing(3),
|
|
77
|
-
height: spacing(3)
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
export var Title = styled(Typography)(function (_a) {
|
|
81
|
-
var _b = _a.theme, typography = _b.typography, palette = _b.palette;
|
|
82
|
-
return (__assign(__assign({}, typography.body2), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
|
|
83
|
-
});
|
|
84
|
-
export var ListItem = styled(DeviceCard)(function (_a) {
|
|
85
|
-
var spacing = _a.theme.spacing;
|
|
86
|
-
return ({
|
|
87
|
-
paddingTop: spacing(1),
|
|
88
|
-
paddingBottom: spacing(1)
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
export var StyledRadio = styled(Radio)(function (_a) {
|
|
92
|
-
var theme = _a.theme;
|
|
93
|
-
return ({
|
|
94
|
-
'&.Mui-checked': {
|
|
95
|
-
color: theme.palette.primary.main
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface HeaderProps {
|
|
4
|
+
onLinkClick?: () => void;
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
sx?: SxProps<Theme>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ onLinkClick, loading, title, sx }: HeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { memo } from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import AddIcon from '@mui/icons-material/Add';
|
|
16
|
+
import Loader from '../../../../components/Loader';
|
|
17
|
+
import { AddIconContainer, HeadContainer, LinkButton, LinkText, TextTypography } from './styles';
|
|
18
|
+
var Header = function (_a) {
|
|
19
|
+
var onLinkClick = _a.onLinkClick, loading = _a.loading, title = _a.title, sx = _a.sx;
|
|
20
|
+
var t = useTranslation().t;
|
|
21
|
+
var getLink = function () {
|
|
22
|
+
if (!onLinkClick)
|
|
23
|
+
return;
|
|
24
|
+
if (loading)
|
|
25
|
+
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 14, style: { height: 28, width: 28, margin: 0 }, toggleAnimation: !!loading });
|
|
26
|
+
return (_jsxs(LinkButton, __assign({ onClick: onLinkClick }, { children: [_jsx(AddIconContainer, { children: _jsx(AddIcon, { fontSize: 'small' }) }), _jsx(LinkText, { children: t('terminal_link_terminal') })] })));
|
|
27
|
+
};
|
|
28
|
+
return (_jsxs(HeadContainer, __assign({ sx: sx }, { children: [_jsx(TextTypography, { children: t(title !== null && title !== void 0 ? title : 'terminal_manage_terminals') }), getLink()] })));
|
|
29
|
+
};
|
|
30
|
+
export default memo(Header);
|
|
@@ -3,7 +3,9 @@ import { TerminalInfo } from '../../../../@types';
|
|
|
3
3
|
interface TerminalListProps {
|
|
4
4
|
selectedTerminal: TerminalInfo;
|
|
5
5
|
list: TerminalInfo[];
|
|
6
|
+
select?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
6
8
|
onClick: (device: TerminalInfo) => void;
|
|
7
9
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ list, onClick, selectedTerminal }: TerminalListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ list, onClick, selectedTerminal, select, loading }: TerminalListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
11
|
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
+
import Icon from '../../../../components/Icon';
|
|
6
|
+
import Loader from '../../../../components/Loader';
|
|
7
|
+
import { getTerminalId, getTerminalIdLabel, getTerminalName } from './utils';
|
|
8
|
+
import { ListContainer, TerminalListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio, ArrowIcon } from './styles';
|
|
9
|
+
var TerminalList = function (_a) {
|
|
10
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
11
|
+
var list = _a.list, onClick = _a.onClick, selectedTerminal = _a.selectedTerminal, _k = _a.select, select = _k === void 0 ? true : _k, loading = _a.loading;
|
|
12
|
+
var t = useTranslation().t;
|
|
13
|
+
var platformImage = ((_d = (_c = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.platform) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.logo) || ICONS_NAMES.platform_image;
|
|
14
|
+
var platformName = (_j = (_h = (_g = (_f = (_e = list[0]) === null || _e === void 0 ? void 0 : _e.platform) === null || _f === void 0 ? void 0 : _f.brand) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.text;
|
|
15
|
+
var getEndComponent = function (terminal) {
|
|
16
|
+
if (loading && (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === (terminal === null || terminal === void 0 ? void 0 : terminal.id))
|
|
17
|
+
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 10, style: { height: 24, width: 24 }, toggleAnimation: !!loading });
|
|
18
|
+
if (select)
|
|
19
|
+
return (_jsx(StyledRadio, { sx: { paddingInlineEnd: 0 }, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, onChange: function () { return onClick(terminal); }, checkedIcon: _jsx(Icon, { src: ICONS_NAMES.radio_checked }), checked: (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === terminal.id }));
|
|
20
|
+
if (!select)
|
|
21
|
+
return _jsx(ArrowIcon, {});
|
|
22
|
+
};
|
|
23
|
+
return (_jsxs(ListContainer, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(TerminalListContainer, { children: list.map(function (terminal, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(terminal); }, name: getTerminalName(terminal), deviceId: getTerminalId(terminal), deviceIdLabel: getTerminalIdLabel(terminal), endAdornment: getEndComponent(terminal) }, index)); }) }) })] }));
|
|
24
|
+
};
|
|
25
|
+
export default memo(TerminalList);
|
|
@@ -20,3 +20,36 @@ export declare const QRCodeDescription: import("@emotion/styled").StyledComponen
|
|
|
20
20
|
export declare const SuccessContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
21
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
22
22
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
23
|
+
export declare const ScrollContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
25
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
26
|
+
export declare const TerminalListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
27
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
28
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
29
|
+
export declare const ListContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
30
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
31
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
32
|
+
export declare const TitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
33
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
34
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
35
|
+
export declare const Image: import("@emotion/styled").StyledComponent<import("../../../../components/Icon").IconProps & import("react").RefAttributes<HTMLImageElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
36
|
+
export declare const Title: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
37
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
38
|
+
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
39
|
+
export declare const ListItem: import("@emotion/styled").StyledComponent<import("../../../../components/DeviceCard").DeviceCardProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
40
|
+
export declare const StyledRadio: import("@emotion/styled").StyledComponent<import("@mui/material/Radio").RadioProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
41
|
+
export declare const ArrowIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").SVGProps<SVGSVGElement>, "ref"> & {
|
|
42
|
+
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
43
|
+
}, "className" | "style" | "classes" | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
44
|
+
export declare const HeadContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
45
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
46
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
47
|
+
export declare const LinkButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
48
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
49
|
+
}, "className" | "style" | "classes" | "color" | "children" | "sx" | "tabIndex" | "action" | "size" | "disabled" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
50
|
+
export declare const AddIconContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
51
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
52
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
53
|
+
export declare const LinkText: import("@emotion/styled").StyledComponent<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
54
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
55
|
+
}, "left" | "right" | "className" | "style" | "classes" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "bottom" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -10,8 +10,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import Box from '@mui/material/Box';
|
|
13
|
+
import Button from '@mui/material/Button';
|
|
13
14
|
import { alpha, styled } from '@mui/material/styles';
|
|
15
|
+
import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
|
|
14
16
|
import Typography from '@mui/material/Typography';
|
|
17
|
+
import Radio from '@mui/material/Radio';
|
|
18
|
+
import Icon from '../../../../components/Icon';
|
|
19
|
+
import DeviceCard from '../../../../components/DeviceCard';
|
|
15
20
|
export var Container = styled(Box)(function () { return ({
|
|
16
21
|
display: 'flex',
|
|
17
22
|
flexDirection: 'column',
|
|
@@ -48,3 +53,103 @@ export var SuccessContainerStyled = styled(Container)(function () { return ({
|
|
|
48
53
|
alignItems: 'center',
|
|
49
54
|
pointerEvents: 'auto'
|
|
50
55
|
}); });
|
|
56
|
+
export var ScrollContainer = styled(Box)(function (_a) {
|
|
57
|
+
var spacing = _a.theme.spacing;
|
|
58
|
+
return ({
|
|
59
|
+
maxHeight: spacing(20.625),
|
|
60
|
+
overflow: 'scroll'
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export var TerminalListContainer = styled(Box)(function (_a) {
|
|
64
|
+
var spacing = _a.theme.spacing;
|
|
65
|
+
return ({
|
|
66
|
+
display: 'flex',
|
|
67
|
+
justifyContent: 'space-between',
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
width: '100%',
|
|
71
|
+
gap: spacing(0.75)
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
export var ListContainer = styled(Box)(function (_a) {
|
|
75
|
+
var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, common = _c.common, toastDeviceSelectorDropdown = _c.components.toastDeviceSelectorDropdown;
|
|
76
|
+
return ({
|
|
77
|
+
marginTop: spacing(1),
|
|
78
|
+
border: "1px solid ".concat(toastDeviceSelectorDropdown.border),
|
|
79
|
+
backgroundColor: common.white,
|
|
80
|
+
borderRadius: spacing(1)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
export var TitleContainer = styled(Box)(function (_a) {
|
|
84
|
+
var _b = _a.theme, spacing = _b.spacing, toastDeviceSelectorDropdown = _b.palette.components.toastDeviceSelectorDropdown;
|
|
85
|
+
return ({
|
|
86
|
+
padding: spacing(1.5, 2, 1.5, 2),
|
|
87
|
+
display: 'flex',
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
gap: spacing(0.75),
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
borderBottom: "1px solid ".concat(toastDeviceSelectorDropdown.border)
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
export var Image = styled(Icon)(function (_a) {
|
|
95
|
+
var spacing = _a.theme.spacing;
|
|
96
|
+
return ({
|
|
97
|
+
width: spacing(3),
|
|
98
|
+
height: spacing(3)
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
export var Title = styled(Typography)(function (_a) {
|
|
102
|
+
var _b = _a.theme, typography = _b.typography, palette = _b.palette;
|
|
103
|
+
return (__assign(__assign({}, typography.body2), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
|
|
104
|
+
});
|
|
105
|
+
export var ListItem = styled(DeviceCard)(function (_a) {
|
|
106
|
+
var spacing = _a.theme.spacing;
|
|
107
|
+
return ({
|
|
108
|
+
paddingTop: spacing(1),
|
|
109
|
+
paddingBottom: spacing(1)
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
export var StyledRadio = styled(Radio)(function (_a) {
|
|
113
|
+
var theme = _a.theme;
|
|
114
|
+
return ({
|
|
115
|
+
'&.Mui-checked': {
|
|
116
|
+
color: theme.palette.primary.main
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
export var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
|
|
121
|
+
var _b = _a.theme, palette = _b.palette, direction = _b.direction;
|
|
122
|
+
return (__assign({ color: palette.components.deviceCard.title, fontSize: '16px' }, (direction === 'rtl' && {
|
|
123
|
+
transform: 'rotate(180deg)'
|
|
124
|
+
})));
|
|
125
|
+
});
|
|
126
|
+
export var HeadContainer = styled(Box)(function (_a) {
|
|
127
|
+
var spacing = _a.theme.spacing;
|
|
128
|
+
return ({
|
|
129
|
+
display: 'flex',
|
|
130
|
+
justifyContent: 'space-between',
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
width: '100%',
|
|
133
|
+
paddingBottom: spacing(2)
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
export var LinkButton = styled(Button)(function (_a) {
|
|
137
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
|
|
138
|
+
return (__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, textTransform: 'none', color: palette.primary.main, display: 'flex', alignItems: 'center', gap: spacing(0.5) }));
|
|
139
|
+
});
|
|
140
|
+
export var AddIconContainer = styled(Box)(function (_a) {
|
|
141
|
+
var _b = _a.theme, spacing = _b.spacing, palette = _b.palette;
|
|
142
|
+
return ({
|
|
143
|
+
background: alpha(palette.primary.main, 0.1),
|
|
144
|
+
height: spacing(2.25),
|
|
145
|
+
width: spacing(2.25),
|
|
146
|
+
display: 'flex',
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
borderRadius: spacing(11.25),
|
|
149
|
+
alignItems: 'center'
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
export var LinkText = styled(Typography)(function (_a) {
|
|
153
|
+
var typography = _a.theme.typography;
|
|
154
|
+
return (__assign({}, typography.button_small));
|
|
155
|
+
});
|
package/build/utils/string.js
CHANGED
|
@@ -205,7 +205,7 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
205
205
|
return 'PASSWORD_CREATE_PASSWORD_STEP';
|
|
206
206
|
}
|
|
207
207
|
if (flow === FlowsTypes.TERMINAL) {
|
|
208
|
-
return CONNECT_FLOWS.terminal.
|
|
208
|
+
return CONNECT_FLOWS.terminal.terminalDeviceList;
|
|
209
209
|
}
|
|
210
210
|
return '';
|
|
211
211
|
};
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
16
|
-
import { AddIconContainer, Container, LinkButton, LinkText } from './styles';
|
|
17
|
-
import { TextTypography } from '../shared';
|
|
18
|
-
var Header = function (_a) {
|
|
19
|
-
var onLinkClick = _a.onLinkClick;
|
|
20
|
-
var t = useTranslation().t;
|
|
21
|
-
return (_jsxs(Container, { children: [_jsx(TextTypography, { children: t('terminal_manage_terminals') }), _jsxs(LinkButton, __assign({ onClick: onLinkClick }, { children: [_jsx(AddIconContainer, { children: _jsx(AddIcon, { fontSize: 'small' }) }), _jsx(LinkText, { children: t('terminal_link_terminal') })] }))] }));
|
|
22
|
-
};
|
|
23
|
-
export default memo(Header);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
-
import { Container, TerminalListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio } from './styles';
|
|
6
|
-
import { getTerminalId, getTerminalIdLabel, getTerminalName } from '../shared';
|
|
7
|
-
import Icon from '../../../../components/Icon';
|
|
8
|
-
var TerminalList = function (_a) {
|
|
9
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
10
|
-
var list = _a.list, onClick = _a.onClick, selectedTerminal = _a.selectedTerminal;
|
|
11
|
-
var t = useTranslation().t;
|
|
12
|
-
var platformImage = ((_d = (_c = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.platform) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.logo) || ICONS_NAMES.platform_image;
|
|
13
|
-
var platformName = (_j = (_h = (_g = (_f = (_e = list[0]) === null || _e === void 0 ? void 0 : _e.platform) === null || _f === void 0 ? void 0 : _f.brand) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.text;
|
|
14
|
-
return (_jsxs(Container, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(TerminalListContainer, { children: list.map(function (terminal, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(terminal); }, name: getTerminalName(terminal), deviceId: getTerminalId(terminal), deviceIdLabel: getTerminalIdLabel(terminal), endAdornment: _jsx(StyledRadio, { sx: { paddingInlineEnd: 0 }, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, onChange: function () { return onClick(terminal); }, checkedIcon: _jsx(Icon, { src: ICONS_NAMES.radio_checked }), checked: (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === terminal.id }) }, index)); }) }) })] }));
|
|
15
|
-
};
|
|
16
|
-
export default memo(TerminalList);
|