code7-leia 0.1.140 → 0.1.143
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/dist/code7-leia.cjs.development.js +88 -86
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +88 -86
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/styles.d.ts +3 -3
- package/dist/components/FileArea/components/Modal/ModalContent.d.ts +2 -2
- package/dist/components/FileArea/components/Modal/index.d.ts +5 -5
- package/dist/components/FileArea/components/Modal/styles.d.ts +8 -8
- package/dist/components/FileArea/styles.d.ts +1 -1
- package/dist/components/TestArea/styles.d.ts +1 -1
- package/dist/interface/Table.d.ts +1 -1
- package/dist/store/modules/reducer.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/EmptyState/index.tsx +7 -7
- package/src/components/EmptyState/styles.tsx +7 -7
- package/src/components/FileArea/components/Modal/ModalContent.tsx +6 -6
- package/src/components/FileArea/components/Modal/index.tsx +27 -27
- package/src/components/FileArea/components/Modal/styles.tsx +15 -15
- package/src/components/FileArea/components/Table/index.tsx +3 -3
- package/src/components/FileArea/index.tsx +11 -11
- package/src/components/FileArea/styles.tsx +2 -2
- package/src/components/TestArea/index.tsx +4 -7
- package/src/components/TestArea/styles.tsx +2 -2
- package/src/interface/Table.ts +1 -1
- package/src/store/modules/reducer.ts +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface ContainerProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
hasborder?: boolean;
|
|
4
|
+
backgroundcolor?: string;
|
|
5
|
+
backgroundicon?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
interface ModalContentProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
maxheight?: string;
|
|
5
|
+
overflowy?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const ModalContent: React.FC<ModalContentProps>;
|
|
8
8
|
export default ModalContent;
|
|
@@ -5,17 +5,17 @@ import ModalHeader from './ModalHeader';
|
|
|
5
5
|
import ModalTitle from './ModalTitle';
|
|
6
6
|
import ModalButtonClose from './ModalButtonClose';
|
|
7
7
|
interface ModalProps {
|
|
8
|
-
|
|
8
|
+
isopen: boolean;
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
maxwidth?: string;
|
|
11
|
+
maxheight?: string;
|
|
12
12
|
className?: string;
|
|
13
13
|
title?: string | React.ReactElement | React.ComponentType;
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
onClose?: () => void;
|
|
16
16
|
contentStyle?: React.CSSProperties;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
isfixed?: boolean;
|
|
18
|
+
zindex?: number;
|
|
19
19
|
}
|
|
20
20
|
declare const Modal: React.FC<ModalProps>;
|
|
21
21
|
export { ModalHeader, ModalTitle, ModalButtonClose, ModalContent, ModalFooter };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface FullScreenProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
isopen: number;
|
|
4
|
+
isfixed: number;
|
|
5
|
+
zindex: number;
|
|
6
6
|
}
|
|
7
7
|
export declare const FullScreen: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FullScreenProps>>;
|
|
8
8
|
interface ModalProps {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
maxwidth?: string;
|
|
10
|
+
maxheight?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const Modal: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ModalProps>>;
|
|
13
13
|
interface ModalContainerProps {
|
|
14
|
-
|
|
14
|
+
maxheight?: string;
|
|
15
15
|
}
|
|
16
16
|
export declare const ModalContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ModalContainerProps>>;
|
|
17
17
|
export declare const ModalHeader: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>;
|
|
18
18
|
export declare const ModalTitle: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
19
19
|
export declare const ModalButtonClose: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>;
|
|
20
20
|
interface ModalContentWrapperProps {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
overflowy?: string;
|
|
22
|
+
maxheight?: string;
|
|
23
23
|
}
|
|
24
24
|
export declare const ModalContentWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ModalContentWrapperProps>>;
|
|
25
25
|
export declare const ModalFooterWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface ContainerProps {
|
|
3
|
-
|
|
3
|
+
isloading?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
|
|
6
6
|
export declare const Header: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface ContainerProps {
|
|
3
|
-
|
|
3
|
+
isloading?: boolean;
|
|
4
4
|
}
|
|
5
5
|
export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
|
|
6
6
|
export declare const Header: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export default function filesReducer(state: {
|
|
2
2
|
files: never[];
|
|
3
3
|
message: string;
|
|
4
|
-
|
|
4
|
+
isloading: boolean;
|
|
5
5
|
isChanging: boolean;
|
|
6
6
|
isOffline: boolean;
|
|
7
7
|
} | undefined, action: any): {
|
|
8
8
|
files: never[];
|
|
9
9
|
message: string;
|
|
10
|
-
|
|
10
|
+
isloading: boolean;
|
|
11
11
|
isChanging: boolean;
|
|
12
12
|
isOffline: boolean;
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ interface EmptyStateProps {
|
|
|
13
13
|
button?: ReactElement;
|
|
14
14
|
backgroundIcon?: string;
|
|
15
15
|
backgroundColor?: string;
|
|
16
|
-
|
|
16
|
+
hasborder?: boolean;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const EmptyState: FC<EmptyStateProps> = ({
|
|
@@ -27,14 +27,14 @@ const EmptyState: FC<EmptyStateProps> = ({
|
|
|
27
27
|
button,
|
|
28
28
|
backgroundIcon,
|
|
29
29
|
backgroundColor,
|
|
30
|
-
|
|
30
|
+
hasborder,
|
|
31
31
|
...rest
|
|
32
32
|
}) => {
|
|
33
33
|
return (
|
|
34
34
|
<S.Container
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
backgroundicon={backgroundIcon}
|
|
36
|
+
backgroundcolor={backgroundColor}
|
|
37
|
+
hasborder={hasborder}
|
|
38
38
|
{...rest}
|
|
39
39
|
>
|
|
40
40
|
<div className="content">
|
|
@@ -70,7 +70,7 @@ EmptyState.propTypes = {
|
|
|
70
70
|
button: PropTypes.element,
|
|
71
71
|
backgroundIcon: PropTypes.string,
|
|
72
72
|
backgroundColor: PropTypes.string,
|
|
73
|
-
|
|
73
|
+
hasborder: PropTypes.bool,
|
|
74
74
|
};
|
|
75
75
|
|
|
76
76
|
EmptyState.defaultProps = {
|
|
@@ -82,7 +82,7 @@ EmptyState.defaultProps = {
|
|
|
82
82
|
widthButton: '140px',
|
|
83
83
|
backgroundIcon: 'var(--neutral-0)',
|
|
84
84
|
backgroundColor: 'var(--absolute-white)',
|
|
85
|
-
|
|
85
|
+
hasborder: true,
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
export default EmptyState;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
interface ContainerProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
hasborder?: boolean;
|
|
5
|
+
backgroundcolor?: string;
|
|
6
|
+
backgroundicon?: string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const Container = styled.div<ContainerProps>`
|
|
@@ -13,8 +13,8 @@ export const Container = styled.div<ContainerProps>`
|
|
|
13
13
|
padding: 24px 0;
|
|
14
14
|
height: 193px;
|
|
15
15
|
|
|
16
|
-
background: ${({
|
|
17
|
-
|
|
16
|
+
background: ${({ hasborder }) =>
|
|
17
|
+
hasborder &&
|
|
18
18
|
`linear-gradient(
|
|
19
19
|
to right,
|
|
20
20
|
#dadce3 50%,
|
|
@@ -26,7 +26,7 @@ export const Container = styled.div<ContainerProps>`
|
|
|
26
26
|
background-position: top, right, bottom, left;
|
|
27
27
|
background-repeat: repeat-x, repeat-y;
|
|
28
28
|
background-size: 40px 1px, 1px 40px;
|
|
29
|
-
background-color: ${({
|
|
29
|
+
background-color: ${({ backgroundcolor }) => backgroundcolor};
|
|
30
30
|
|
|
31
31
|
& .content {
|
|
32
32
|
display: flex;
|
|
@@ -34,7 +34,7 @@ export const Container = styled.div<ContainerProps>`
|
|
|
34
34
|
align-items: center;
|
|
35
35
|
|
|
36
36
|
& > .icon {
|
|
37
|
-
background-color: ${({
|
|
37
|
+
background-color: ${({ backgroundicon }) => backgroundicon};
|
|
38
38
|
border-radius: 16px;
|
|
39
39
|
width: 145px;
|
|
40
40
|
height: 145px;
|
|
@@ -5,13 +5,13 @@ import { ModalContentWrapper } from './styles';
|
|
|
5
5
|
|
|
6
6
|
interface ModalContentProps {
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
maxheight?: string;
|
|
9
|
+
overflowy?: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const ModalContent: React.FC<ModalContentProps> = ({ children,
|
|
12
|
+
const ModalContent: React.FC<ModalContentProps> = ({ children, maxheight = 'max-content', overflowy = 'initial', ...rest }) => {
|
|
13
13
|
return (
|
|
14
|
-
<ModalContentWrapper
|
|
14
|
+
<ModalContentWrapper maxheight={maxheight} overflowy={overflowy} {...rest}>
|
|
15
15
|
{children}
|
|
16
16
|
</ModalContentWrapper>
|
|
17
17
|
);
|
|
@@ -19,8 +19,8 @@ const ModalContent: React.FC<ModalContentProps> = ({ children, maxHeight = 'max-
|
|
|
19
19
|
|
|
20
20
|
ModalContent.propTypes = {
|
|
21
21
|
children: PropTypes.node.isRequired,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
maxheight: PropTypes.string,
|
|
23
|
+
overflowy: PropTypes.string,
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export default ModalContent;
|
|
@@ -10,31 +10,31 @@ import ModalTitle from './ModalTitle';
|
|
|
10
10
|
import ModalButtonClose from './ModalButtonClose';
|
|
11
11
|
|
|
12
12
|
interface ModalProps {
|
|
13
|
-
|
|
13
|
+
isopen: boolean;
|
|
14
14
|
style?: React.CSSProperties;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
maxwidth?: string;
|
|
16
|
+
maxheight?: string;
|
|
17
17
|
className?: string;
|
|
18
18
|
title?: string | React.ReactElement | React.ComponentType;
|
|
19
19
|
children: React.ReactNode;
|
|
20
20
|
onClose?: () => void;
|
|
21
21
|
contentStyle?: React.CSSProperties;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
isfixed?: boolean;
|
|
23
|
+
zindex?: number;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const Modal: React.FC<ModalProps> = ({
|
|
27
|
-
|
|
27
|
+
isopen,
|
|
28
28
|
style,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
maxwidth,
|
|
30
|
+
maxheight,
|
|
31
31
|
className,
|
|
32
32
|
title,
|
|
33
33
|
children,
|
|
34
34
|
onClose,
|
|
35
35
|
contentStyle,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
isfixed,
|
|
37
|
+
zindex,
|
|
38
38
|
}) => {
|
|
39
39
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
40
40
|
|
|
@@ -44,30 +44,30 @@ const Modal: React.FC<ModalProps> = ({
|
|
|
44
44
|
// ESC Key
|
|
45
45
|
27: () => {
|
|
46
46
|
e.preventDefault();
|
|
47
|
-
if (!
|
|
47
|
+
if (!isfixed && onClose) {
|
|
48
48
|
onClose();
|
|
49
49
|
}
|
|
50
50
|
window.removeEventListener('keyup', handleKeyUp, false);
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
if (keys[e.keyCode] &&
|
|
54
|
+
if (keys[e.keyCode] && isopen) {
|
|
55
55
|
keys[e.keyCode]();
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
[onClose,
|
|
58
|
+
[onClose, isopen, isfixed]
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
const handleOutsideClick = useCallback(
|
|
62
62
|
(e: MouseEvent) => {
|
|
63
63
|
if (modalRef.current && modalRef.current.parentNode === e.target) {
|
|
64
|
-
if (!
|
|
64
|
+
if (!isfixed && onClose) {
|
|
65
65
|
onClose();
|
|
66
66
|
}
|
|
67
67
|
document.removeEventListener('click', handleOutsideClick, false);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
[onClose,
|
|
70
|
+
[onClose, isfixed]
|
|
71
71
|
);
|
|
72
72
|
|
|
73
73
|
useEffect(() => {
|
|
@@ -81,9 +81,9 @@ const Modal: React.FC<ModalProps> = ({
|
|
|
81
81
|
}, [handleKeyUp, handleOutsideClick]);
|
|
82
82
|
|
|
83
83
|
return (
|
|
84
|
-
<S.FullScreen
|
|
85
|
-
<S.Modal ref={modalRef} style={style}
|
|
86
|
-
<S.ModalContainer className="styleOverlay"
|
|
84
|
+
<S.FullScreen isfixed={isfixed ? 1 : 0} isopen={isopen ? 1 : 0} zindex={zindex ?? 0}>
|
|
85
|
+
<S.Modal ref={modalRef} style={style} maxwidth={maxwidth} className={className}>
|
|
86
|
+
<S.ModalContainer className="styleOverlay" maxheight={maxheight} style={contentStyle}>
|
|
87
87
|
<S.ModalHeader>
|
|
88
88
|
<S.ModalTitle>{String(title)}</S.ModalTitle>
|
|
89
89
|
<S.ModalButtonClose type="button" onClick={onClose}>
|
|
@@ -98,7 +98,7 @@ const Modal: React.FC<ModalProps> = ({
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
Modal.propTypes = {
|
|
101
|
-
|
|
101
|
+
isopen: PropTypes.bool.isRequired,
|
|
102
102
|
title: PropTypes.oneOfType([
|
|
103
103
|
PropTypes.element,
|
|
104
104
|
PropTypes.string,
|
|
@@ -109,10 +109,10 @@ Modal.propTypes = {
|
|
|
109
109
|
style: PropTypes.objectOf(PropTypes.any),
|
|
110
110
|
contentStyle: PropTypes.objectOf(PropTypes.any),
|
|
111
111
|
className: PropTypes.string,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
maxwidth: PropTypes.string,
|
|
113
|
+
maxheight: PropTypes.string,
|
|
114
|
+
isfixed: PropTypes.bool,
|
|
115
|
+
zindex: PropTypes.number,
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
Modal.defaultProps = {
|
|
@@ -120,11 +120,11 @@ Modal.defaultProps = {
|
|
|
120
120
|
style: {},
|
|
121
121
|
contentStyle: {},
|
|
122
122
|
className: '',
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
maxwidth: '360px',
|
|
124
|
+
maxheight: 'max-content',
|
|
125
|
+
isfixed: false,
|
|
126
126
|
onClose: () => {},
|
|
127
|
-
|
|
127
|
+
zindex: 9999,
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
export { ModalHeader, ModalTitle, ModalButtonClose, ModalContent, ModalFooter };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
3
|
interface FullScreenProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
isopen: number;
|
|
5
|
+
isfixed: number;
|
|
6
|
+
zindex: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const FullScreen = styled.div<FullScreenProps>`
|
|
10
|
-
display: ${({
|
|
11
|
-
cursor: ${({
|
|
10
|
+
display: ${({ isopen }) => (isopen === 1 ? 'flex' : 'none')};
|
|
11
|
+
cursor: ${({ isfixed }) => (isfixed === 0 ? 'pointer' : 'default')};
|
|
12
12
|
|
|
13
13
|
position: fixed;
|
|
14
14
|
top: 0;
|
|
@@ -17,7 +17,7 @@ export const FullScreen = styled.div<FullScreenProps>`
|
|
|
17
17
|
bottom: 0;
|
|
18
18
|
justify-content: center;
|
|
19
19
|
align-items: center;
|
|
20
|
-
z-index: ${({
|
|
20
|
+
z-index: ${({ zindex }) => zindex};
|
|
21
21
|
animation: fadeIn 380ms ease-in-out 1;
|
|
22
22
|
background-color: #2f3845b8;
|
|
23
23
|
backdrop-filter: blur(2px);
|
|
@@ -33,8 +33,8 @@ export const FullScreen = styled.div<FullScreenProps>`
|
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
35
|
interface ModalProps {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
maxwidth?: string;
|
|
37
|
+
maxheight?: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export const Modal = styled.div<ModalProps>`
|
|
@@ -43,7 +43,7 @@ export const Modal = styled.div<ModalProps>`
|
|
|
43
43
|
position: relative;
|
|
44
44
|
cursor: default;
|
|
45
45
|
width: 100%;
|
|
46
|
-
max-width: ${({
|
|
46
|
+
max-width: ${({ maxwidth }) => maxwidth};
|
|
47
47
|
animation: slideIn 350ms cubic-bezier(0.42, 0, 0.21, 1) 1;
|
|
48
48
|
|
|
49
49
|
@keyframes slideIn {
|
|
@@ -64,13 +64,13 @@ export const Modal = styled.div<ModalProps>`
|
|
|
64
64
|
`;
|
|
65
65
|
|
|
66
66
|
interface ModalContainerProps {
|
|
67
|
-
|
|
67
|
+
maxheight?: string;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export const ModalContainer = styled.div<ModalContainerProps>`
|
|
71
71
|
width: 100%;
|
|
72
72
|
overflow-y: auto;
|
|
73
|
-
max-height: ${({
|
|
73
|
+
max-height: ${({ maxheight }) => maxheight};
|
|
74
74
|
`;
|
|
75
75
|
|
|
76
76
|
export const ModalHeader = styled.header`
|
|
@@ -100,14 +100,14 @@ export const ModalButtonClose = styled.button`
|
|
|
100
100
|
`;
|
|
101
101
|
|
|
102
102
|
interface ModalContentWrapperProps {
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
overflowy?: string;
|
|
104
|
+
maxheight?: string;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export const ModalContentWrapper = styled.div<ModalContentWrapperProps>`
|
|
108
108
|
width: 100%;
|
|
109
|
-
overflow-y: ${({
|
|
110
|
-
max-height: ${({
|
|
109
|
+
overflow-y: ${({ overflowy }) => overflowy};
|
|
110
|
+
max-height: ${({ maxheight }) => maxheight};
|
|
111
111
|
padding: var(--spacement-medium);
|
|
112
112
|
`;
|
|
113
113
|
|
|
@@ -8,10 +8,10 @@ import Spinner from '../Spinner';
|
|
|
8
8
|
import { TableProps } from '../../../../interface/Table'
|
|
9
9
|
|
|
10
10
|
const Table = forwardRef(
|
|
11
|
-
({ size = 'medium', children,
|
|
11
|
+
({ size = 'medium', children, isloading = false, className = '', ...props }: TableProps, ref: Ref<HTMLTableElement>) => {
|
|
12
12
|
return (
|
|
13
13
|
<S.TableWrapper className={className}>
|
|
14
|
-
{
|
|
14
|
+
{isloading ? (
|
|
15
15
|
<S.TableLoadingWrapper>
|
|
16
16
|
<Spinner />
|
|
17
17
|
</S.TableLoadingWrapper>
|
|
@@ -28,7 +28,7 @@ Table.propTypes = {
|
|
|
28
28
|
children: PropTypes.node.isRequired,
|
|
29
29
|
className: PropTypes.string,
|
|
30
30
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
31
|
-
|
|
31
|
+
isloading: PropTypes.bool,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export default Table;
|
|
@@ -32,7 +32,7 @@ export const FileArea = () => {
|
|
|
32
32
|
const t = getLanguage(language)
|
|
33
33
|
const dispatch = useDispatch();
|
|
34
34
|
const initFiles = useSelector((state: any) => state.files);
|
|
35
|
-
const
|
|
35
|
+
const isloading = useSelector((state: any) => state.isloading);
|
|
36
36
|
const tags = propTags ? propTags.tags : [];
|
|
37
37
|
|
|
38
38
|
useEffect(() => {
|
|
@@ -105,7 +105,7 @@ export const FileArea = () => {
|
|
|
105
105
|
|
|
106
106
|
const renderFiles = () => {
|
|
107
107
|
return (
|
|
108
|
-
<S.Container
|
|
108
|
+
<S.Container isloading={isloading}>
|
|
109
109
|
<div id='loading' />
|
|
110
110
|
<S.Header>
|
|
111
111
|
<div className='infos'>
|
|
@@ -131,13 +131,13 @@ export const FileArea = () => {
|
|
|
131
131
|
) : <Table>
|
|
132
132
|
<thead>
|
|
133
133
|
<tr>
|
|
134
|
-
<th className="th_file_name">
|
|
134
|
+
<th key="th_file_name" className="th_file_name">
|
|
135
135
|
{t.fileArea.fileName}
|
|
136
136
|
</th>
|
|
137
|
-
<th className="th_pressets">
|
|
137
|
+
<th key="th_pressets" className="th_pressets">
|
|
138
138
|
{t.fileArea.presset}
|
|
139
139
|
</th>
|
|
140
|
-
<th className="th_actions">
|
|
140
|
+
<th key="th_actions" className="th_actions">
|
|
141
141
|
{t.fileArea.actions}
|
|
142
142
|
</th>
|
|
143
143
|
</tr>
|
|
@@ -159,9 +159,9 @@ export const FileArea = () => {
|
|
|
159
159
|
</Table>
|
|
160
160
|
}
|
|
161
161
|
<Modal
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
isopen={modal}
|
|
163
|
+
maxwidth="600px"
|
|
164
|
+
maxheight="max-content"
|
|
165
165
|
onClose={handleOpenModal}
|
|
166
166
|
title={t.fileArea.modal.uploadFile}
|
|
167
167
|
>
|
|
@@ -188,9 +188,9 @@ export const FileArea = () => {
|
|
|
188
188
|
|
|
189
189
|
</Modal>
|
|
190
190
|
<Modal
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
isopen={modalDelete}
|
|
192
|
+
maxwidth="600px"
|
|
193
|
+
maxheight="max-content"
|
|
194
194
|
onClose={() => handleOpenModalDelete('')}
|
|
195
195
|
title={t.fileArea.modal.deleteFileTitle}
|
|
196
196
|
>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
3
|
interface ContainerProps {
|
|
4
|
-
|
|
4
|
+
isloading?: boolean;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export const Container = styled.div<ContainerProps>`
|
|
8
8
|
${(props) =>
|
|
9
|
-
props.
|
|
9
|
+
props.isloading &&
|
|
10
10
|
css`
|
|
11
11
|
#loading {
|
|
12
12
|
position: fixed;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { getLanguage } from '../../utils/getLanguage'
|
|
3
3
|
import * as S from './styles';
|
|
4
4
|
import Select from '../Select'
|
|
@@ -15,17 +15,13 @@ export const TestArea = () => {
|
|
|
15
15
|
const { id, language, personas, propTags } = useSharedProps();
|
|
16
16
|
const t = getLanguage(language)
|
|
17
17
|
const results = useSelector((state: any) => state.message);
|
|
18
|
-
const
|
|
18
|
+
const isloading = useSelector((state: any) => state.isloading);
|
|
19
19
|
const [search, setSearch] = useState('');
|
|
20
20
|
const [profile, setProfile] = useState('');
|
|
21
21
|
const [presset, setPresset] = useState('');
|
|
22
22
|
const dispatch = useDispatch();
|
|
23
23
|
const tags = propTags ? propTags.tags : [];
|
|
24
24
|
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
console.log('isLoading: ', isLoading)
|
|
27
|
-
}, [isLoading])
|
|
28
|
-
|
|
29
25
|
|
|
30
26
|
const optionsPersona = personas && personas.map(persona => {
|
|
31
27
|
return { label: persona.name, value: persona.name }
|
|
@@ -57,7 +53,8 @@ export const TestArea = () => {
|
|
|
57
53
|
|
|
58
54
|
const returnTest = () => {
|
|
59
55
|
return (
|
|
60
|
-
<S.Container
|
|
56
|
+
<S.Container isloading={isloading}>
|
|
57
|
+
<div id='loading' />
|
|
61
58
|
<S.Header>
|
|
62
59
|
<div className='infos'>
|
|
63
60
|
<h2>{t.test}</h2>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
3
|
interface ContainerProps {
|
|
4
|
-
|
|
4
|
+
isloading?: boolean;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
export const Container = styled.div<ContainerProps>`
|
|
9
9
|
${(props) =>
|
|
10
|
-
props.
|
|
10
|
+
props.isloading &&
|
|
11
11
|
css`
|
|
12
12
|
#loading {
|
|
13
13
|
position: fixed;
|
package/src/interface/Table.ts
CHANGED
|
@@ -4,7 +4,7 @@ import types from './types'
|
|
|
4
4
|
const INITIAL_STATE = {
|
|
5
5
|
files: [],
|
|
6
6
|
message: '',
|
|
7
|
-
|
|
7
|
+
isloading: false,
|
|
8
8
|
isChanging: false,
|
|
9
9
|
isOffline: true,
|
|
10
10
|
}
|
|
@@ -22,10 +22,10 @@ export default function filesReducer(state = INITIAL_STATE, action: any) {
|
|
|
22
22
|
draft.message = action.payload.message;
|
|
23
23
|
break;
|
|
24
24
|
case types.LOADING_START:
|
|
25
|
-
draft.
|
|
25
|
+
draft.isloading = true;
|
|
26
26
|
break;
|
|
27
27
|
case types.LOADING_FINISH:
|
|
28
|
-
draft.
|
|
28
|
+
draft.isloading = false;
|
|
29
29
|
break;
|
|
30
30
|
case types.CHANGING_START:
|
|
31
31
|
draft.isChanging = true;
|