groundfloor-react-ui 1.0.0
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/README.md +20 -0
- package/assets/fonts/Averta/Averta-Black.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BlackItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Bold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-BoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ExtraThinItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Light.woff2 +0 -0
- package/assets/fonts/Averta/Averta-LightItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Regular.woff2 +0 -0
- package/assets/fonts/Averta/Averta-RegularItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBold.woff2 +0 -0
- package/assets/fonts/Averta/Averta-SemiBoldItalic.woff2 +0 -0
- package/assets/fonts/Averta/Averta-Thin.woff2 +0 -0
- package/assets/fonts/Averta/Averta-ThinItalic.woff2 +0 -0
- package/assets/fonts/Beauty/BeautyDemo.woff +0 -0
- package/assets/icons/app-logo.svg +3 -0
- package/assets/icons/arrow-down.svg +3 -0
- package/assets/icons/arrow-rotate.svg +1 -0
- package/assets/icons/arrow-up.svg +3 -0
- package/assets/icons/bell.svg +3 -0
- package/assets/icons/check.svg +3 -0
- package/assets/icons/checkmark.svg +3 -0
- package/assets/icons/chevron-down.svg +3 -0
- package/assets/icons/chevron-left.svg +3 -0
- package/assets/icons/chevron-right.svg +3 -0
- package/assets/icons/cloud-icon.svg +3 -0
- package/assets/icons/connection.svg +3 -0
- package/assets/icons/cross-icon.svg +3 -0
- package/assets/icons/door-internal-active.svg +1 -0
- package/assets/icons/edit-icon.svg +3 -0
- package/assets/icons/ellipses-horizontal.svg +3 -0
- package/assets/icons/ellipses.svg +3 -0
- package/assets/icons/email.svg +3 -0
- package/assets/icons/eye-hide-view.svg +1 -0
- package/assets/icons/eye-hide.svg +1 -0
- package/assets/icons/file-attach-white.svg +3 -0
- package/assets/icons/file-attach.svg +3 -0
- package/assets/icons/functional-equation-regular.svg +147 -0
- package/assets/icons/hamburger-menu.svg +3 -0
- package/assets/icons/heart.svg +18 -0
- package/assets/icons/image.svg +3 -0
- package/assets/icons/info.svg +3 -0
- package/assets/icons/jpg-icon.svg +3 -0
- package/assets/icons/magnifier.svg +3 -0
- package/assets/icons/menu-ellipse-two.svg +1 -0
- package/assets/icons/menu-ellipse.svg +53 -0
- package/assets/icons/pause-all.svg +1 -0
- package/assets/icons/pdf-icon.svg +3 -0
- package/assets/icons/pen-icon.svg +3 -0
- package/assets/icons/plus-outlined.svg +3 -0
- package/assets/icons/resume.svg +1 -0
- package/assets/icons/sign-icon.svg +3 -0
- package/assets/icons/star.svg +3 -0
- package/assets/icons/trash-icon.svg +59 -0
- package/assets/icons/triangle-down.svg +3 -0
- package/assets/icons/users.svg +11 -0
- package/assets/icons/view.svg +3 -0
- package/assets/icons/watcher.svg +3 -0
- package/assets/icons/zoom-in-white.svg +1 -0
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +114 -0
- package/components/Accordion/AccordionSB.js +168 -0
- package/components/Accordion/AccordionSBfooter.js +171 -0
- package/components/Accordion/index.js +4 -0
- package/components/ArrowBar/ArrowBar.js +293 -0
- package/components/ArrowBar/index.js +2 -0
- package/components/Avatar/Avatar.js +167 -0
- package/components/Avatar/AvatarSB.js +226 -0
- package/components/Avatar/AvatarSBfooter.js +226 -0
- package/components/Avatar/index.js +4 -0
- package/components/Banner/Banner.js +65 -0
- package/components/Banner/index.js +2 -0
- package/components/Breadcrumb/Breadcrumb.js +192 -0
- package/components/Breadcrumb/index.js +2 -0
- package/components/Button/PrimaryButton.js +125 -0
- package/components/Button/SecondaryButton.js +114 -0
- package/components/Button/TinyButton.js +94 -0
- package/components/Button/index.js +6 -0
- package/components/Cards/Card.js +48 -0
- package/components/Cards/CardRef.js +64 -0
- package/components/Cards/DocumentCard.js +221 -0
- package/components/Cards/index.js +5 -0
- package/components/Content/Content.js +51 -0
- package/components/Content/index.js +1 -0
- package/components/Divider/Divider.js +63 -0
- package/components/Divider/index.js +2 -0
- package/components/Drawer/Drawer.js +93 -0
- package/components/Drawer/index.js +2 -0
- package/components/ErrorBoundary/ErrorBoundary.js +44 -0
- package/components/ErrorBoundary/index.js +1 -0
- package/components/FilterChip/FilterChip.js +68 -0
- package/components/FilterChip/index.js +1 -0
- package/components/Footer/Footer.js +58 -0
- package/components/Footer/FooterContentLev3.js +96 -0
- package/components/Footer/index.js +2 -0
- package/components/Form/FormComponent.js +273 -0
- package/components/Form/HeaderComponent.js +39 -0
- package/components/Form/StyledComponent.js +323 -0
- package/components/Form/SubmitComponent.js +63 -0
- package/components/Form/index.js +4 -0
- package/components/GroupAvatars/GroupAvatars.js +143 -0
- package/components/GroupAvatars/index.js +1 -0
- package/components/GroupButtons/ButtonPopup.js +192 -0
- package/components/GroupButtons/GroupButtons.js +150 -0
- package/components/GroupButtons/GroupButtonsPopup.js +169 -0
- package/components/GroupButtons/index.js +3 -0
- package/components/GroupStatusCircle/GroupStatusCircle.js +135 -0
- package/components/GroupStatusCircle/index.js +1 -0
- package/components/Header/Header.js +58 -0
- package/components/Header/index.js +1 -0
- package/components/HyperLink/HyperLink.js +114 -0
- package/components/HyperLink/index.js +1 -0
- package/components/Icon/Icon.js +161 -0
- package/components/Icon/index.js +1 -0
- package/components/Images/Image.js +112 -0
- package/components/Images/index.js +2 -0
- package/components/Inputs/CheckBoxEditableInput.js +352 -0
- package/components/Inputs/CheckBoxInput.js +195 -0
- package/components/Inputs/CheckBoxInputMS.js +160 -0
- package/components/Inputs/DateSelect.js +411 -0
- package/components/Inputs/DropdownSelect.js +466 -0
- package/components/Inputs/DropzoneInput.js +335 -0
- package/components/Inputs/NumericInput.js +155 -0
- package/components/Inputs/RadioInput.js +205 -0
- package/components/Inputs/SearchInput.js +18 -0
- package/components/Inputs/Signature.js +278 -0
- package/components/Inputs/TextArea.js +196 -0
- package/components/Inputs/TextInput.js +182 -0
- package/components/Inputs/TextInputClicable.js +198 -0
- package/components/Inputs/TextInputClicableMS.js +255 -0
- package/components/Inputs/TimeInput.js +181 -0
- package/components/Inputs/ToggleSwitch.js +123 -0
- package/components/Inputs/index.js +13 -0
- package/components/Label/Label.js +48 -0
- package/components/Label/index.js +1 -0
- package/components/Loaders/Loader.js +179 -0
- package/components/Loaders/index.js +2 -0
- package/components/Modal/Modal.js +116 -0
- package/components/Modal/ModalComp.js +158 -0
- package/components/Modal/index.js +2 -0
- package/components/Overlay/Overlay.js +159 -0
- package/components/Overlay/index.js +1 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Pagination/index.js +1 -0
- package/components/ProgressBar/ProgressBar.js +84 -0
- package/components/ProgressBar/index.js +1 -0
- package/components/ProgressSteps/ProgressSteps.js +121 -0
- package/components/ProgressSteps/index.js +1 -0
- package/components/Rating/Rating.js +264 -0
- package/components/Rating/index.js +1 -0
- package/components/SecondaryLink/DarkSecondaryLink.js +97 -0
- package/components/SecondaryLink/LightSecondaryLink.js +93 -0
- package/components/SecondaryLink/index.js +3 -0
- package/components/Sidebar/Navbar.js +328 -0
- package/components/Sidebar/Sidebar.js +180 -0
- package/components/Sidebar/index.js +3 -0
- package/components/StatusChip/PrimaryStatusChip.js +78 -0
- package/components/StatusChip/SecondaryStatusChip.js +78 -0
- package/components/StatusChip/SlimPrimaryStatusChip.js +92 -0
- package/components/StatusChip/SlimSecondaryStatusChip.js +93 -0
- package/components/StatusChip/index.js +6 -0
- package/components/StatusCircle/StatusCircle.js +64 -0
- package/components/StatusCircle/index.js +1 -0
- package/components/Tables/Table.js +156 -0
- package/components/Tables/index.js +1 -0
- package/components/Tooltip/Tooltip.js +479 -0
- package/components/Tooltip/index.js +1 -0
- package/components/Typography/Typography.js +78 -0
- package/components/Typography/index.js +2 -0
- package/components/constants/colors.js +33 -0
- package/components/constants/defaultStyle.js +781 -0
- package/components/constants/defaultThemeColor.js +15 -0
- package/components/constants/index.js +7 -0
- package/components/constants/utils.js +31 -0
- package/components/global/FontStyle.js +131 -0
- package/components/global/index.js +1 -0
- package/dist/index.es.js +2302 -0
- package/dist/index.js +2302 -0
- package/index.js +40 -0
- package/package.json +67 -0
- package/rollup.config.js +53 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const sizes = {
|
|
11
|
+
xsm: {
|
|
12
|
+
width: '88px'
|
|
13
|
+
},
|
|
14
|
+
sm: {
|
|
15
|
+
width: '93px'
|
|
16
|
+
},
|
|
17
|
+
md: {
|
|
18
|
+
width: '111px'
|
|
19
|
+
},
|
|
20
|
+
lg: {
|
|
21
|
+
width: '129px'
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const StyledStatusChip = styled.div`
|
|
26
|
+
background: ${({ theme, variant, bgColor }) => bgColor ? bgColor : theme.variant[variant]};
|
|
27
|
+
color: ${({ theme, textColor }) => textColor ? textColor : theme.bgColor};
|
|
28
|
+
border-radius: 13.5px;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: ${({ block, size }) => block ? 'auto' : sizes[size].width};
|
|
34
|
+
height: 28px;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const SlimPrimaryStatusChip = ({ block, style, variant, textColor, bgColor, ...props }) => {
|
|
40
|
+
const theme = useTheme() || defaultThemeColor;
|
|
41
|
+
return (
|
|
42
|
+
<StyledStatusChip
|
|
43
|
+
block={block}
|
|
44
|
+
variant={variant}
|
|
45
|
+
textColor={textColor}
|
|
46
|
+
bgColor={bgColor}
|
|
47
|
+
style={style}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{props.children}
|
|
51
|
+
</StyledStatusChip>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
SlimPrimaryStatusChip.propTypes = {
|
|
56
|
+
/**
|
|
57
|
+
* background color of SlimStatusChip. primary-1, 2, error, etc.
|
|
58
|
+
*/
|
|
59
|
+
variant: PropTypes.string,
|
|
60
|
+
/**
|
|
61
|
+
* How wide should the SlimStatusChip be?
|
|
62
|
+
*/
|
|
63
|
+
size: PropTypes.oneOf(['xsm', 'sm', 'md', 'lg']),
|
|
64
|
+
/**
|
|
65
|
+
* Block width of SlimStatusChip
|
|
66
|
+
*/
|
|
67
|
+
block: PropTypes.bool,
|
|
68
|
+
/**
|
|
69
|
+
* Theme object
|
|
70
|
+
*/
|
|
71
|
+
theme: PropTypes.object,
|
|
72
|
+
/**
|
|
73
|
+
* Optional custom text color
|
|
74
|
+
*/
|
|
75
|
+
textColor: PropTypes.string,
|
|
76
|
+
/**
|
|
77
|
+
* Optional custom background color
|
|
78
|
+
*/
|
|
79
|
+
bgColor: PropTypes.string,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
StyledStatusChip.defaultProps = {
|
|
83
|
+
theme: defaultThemeColor,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
SlimPrimaryStatusChip.defaultProps = {
|
|
87
|
+
theme: defaultThemeColor,
|
|
88
|
+
variant: 'primary-1',
|
|
89
|
+
block: false,
|
|
90
|
+
size: 'sm'
|
|
91
|
+
};
|
|
92
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const sizes = {
|
|
11
|
+
xsm: {
|
|
12
|
+
width: '88px'
|
|
13
|
+
},
|
|
14
|
+
sm: {
|
|
15
|
+
width: '93px'
|
|
16
|
+
},
|
|
17
|
+
md: {
|
|
18
|
+
width: '111px'
|
|
19
|
+
},
|
|
20
|
+
lg: {
|
|
21
|
+
width: '129px'
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const StyledStatusChip = styled.div`
|
|
26
|
+
background: ${({ theme }) => theme.bgColor};
|
|
27
|
+
color: ${({ theme, variant, textColor }) => textColor ? textColor : theme.variant[variant]};
|
|
28
|
+
border: 1px solid ${({ theme, variant, borderColor }) => borderColor ? borderColor : theme.variant[variant]};
|
|
29
|
+
border-radius: 13.5px;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
width: ${({ block, size }) => block ? 'auto' : sizes[size].width};
|
|
35
|
+
height: 27px;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const SlimSecondaryStatusChip = ({ block, style, variant, textColor, borderColor, ...props }) => {
|
|
41
|
+
const theme = useTheme() || defaultThemeColor;
|
|
42
|
+
return (
|
|
43
|
+
<StyledStatusChip
|
|
44
|
+
block={block}
|
|
45
|
+
variant={variant}
|
|
46
|
+
textColor={textColor}
|
|
47
|
+
borderColor={borderColor}
|
|
48
|
+
style={style}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{props.children}
|
|
52
|
+
</StyledStatusChip>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
SlimSecondaryStatusChip.propTypes = {
|
|
57
|
+
/**
|
|
58
|
+
* Color of SlimStatusChip. primary-1, 2, error, etc.
|
|
59
|
+
*/
|
|
60
|
+
variant: PropTypes.string,
|
|
61
|
+
/**
|
|
62
|
+
* How wide should the SlimStatusChip be?
|
|
63
|
+
*/
|
|
64
|
+
size: PropTypes.oneOf(['xsm', 'sm', 'md', 'lg']),
|
|
65
|
+
/**
|
|
66
|
+
* Block width of SlimStatusChip
|
|
67
|
+
*/
|
|
68
|
+
block: PropTypes.bool,
|
|
69
|
+
/**
|
|
70
|
+
* Theme object
|
|
71
|
+
*/
|
|
72
|
+
theme: PropTypes.object,
|
|
73
|
+
/**
|
|
74
|
+
* Optional custom text color
|
|
75
|
+
*/
|
|
76
|
+
textColor: PropTypes.string,
|
|
77
|
+
/**
|
|
78
|
+
* Optional custom border color
|
|
79
|
+
*/
|
|
80
|
+
borderColor: PropTypes.string,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
StyledStatusChip.defaultProps = {
|
|
84
|
+
theme: defaultThemeColor,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
SlimSecondaryStatusChip.defaultProps = {
|
|
88
|
+
theme: defaultThemeColor,
|
|
89
|
+
variant: 'primary-1',
|
|
90
|
+
block: false,
|
|
91
|
+
size: 'sm'
|
|
92
|
+
};
|
|
93
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { useTheme } from 'styled-components';
|
|
4
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Primary UI component for user interaction
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const StyledStatusCircle = styled.div`
|
|
11
|
+
background: ${({ theme, variant, bgColor }) => bgColor ? bgColor : theme.variant[variant]};
|
|
12
|
+
border: 1.3px solid ${({ theme, variant, borderColor }) => borderColor ? borderColor : theme.variant[variant]};
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
width: ${({ size }) => size}px;
|
|
15
|
+
height: ${({ size }) => size}px;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const StatusCircle = ({ variant, bgColor, borderColor, ...props }) => {
|
|
20
|
+
const theme = useTheme() || defaultThemeColor;
|
|
21
|
+
return (
|
|
22
|
+
<StyledStatusCircle
|
|
23
|
+
variant={variant}
|
|
24
|
+
borderColor={borderColor}
|
|
25
|
+
bgColor={bgColor}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
</StyledStatusCircle>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
StatusCircle.propTypes = {
|
|
33
|
+
/**
|
|
34
|
+
* Color of StatusCircle base on the available one among variant theme. primary-1, 2, error, etc.
|
|
35
|
+
*/
|
|
36
|
+
variant: PropTypes.string,
|
|
37
|
+
/**
|
|
38
|
+
* Size of the circle
|
|
39
|
+
*/
|
|
40
|
+
size: PropTypes.number,
|
|
41
|
+
/**
|
|
42
|
+
* Theme object
|
|
43
|
+
*/
|
|
44
|
+
theme: PropTypes.object,
|
|
45
|
+
/**
|
|
46
|
+
* Optional custom border color
|
|
47
|
+
*/
|
|
48
|
+
borderColor: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* Optional custom background color
|
|
51
|
+
*/
|
|
52
|
+
bgColor: PropTypes.string,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
StyledStatusCircle.defaultProps = {
|
|
56
|
+
theme: defaultThemeColor,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
StatusCircle.defaultProps = {
|
|
60
|
+
theme: defaultThemeColor,
|
|
61
|
+
variant: 'primary-1',
|
|
62
|
+
size: 11
|
|
63
|
+
};
|
|
64
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StatusCircle';
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import DataTable from "react-data-table-component";
|
|
4
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Primary UI component for user interaction
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const Table = ({
|
|
12
|
+
theme,
|
|
13
|
+
customStyles,
|
|
14
|
+
type = 'table',
|
|
15
|
+
sortIcon,
|
|
16
|
+
data,
|
|
17
|
+
tableColumns,
|
|
18
|
+
progressPending,
|
|
19
|
+
defaultSortFieldId,
|
|
20
|
+
handleOnSort,
|
|
21
|
+
sortServer,
|
|
22
|
+
progressComponent,
|
|
23
|
+
responsive,
|
|
24
|
+
conditionalRowStyles,
|
|
25
|
+
fixedHeader,
|
|
26
|
+
fixedHeaderScrollHeight,
|
|
27
|
+
...props }) => {
|
|
28
|
+
|
|
29
|
+
let tableStyle = {}
|
|
30
|
+
|
|
31
|
+
if (theme) {
|
|
32
|
+
if (theme[type]) {
|
|
33
|
+
|
|
34
|
+
tableStyle = theme[type];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if (customStyles) {
|
|
40
|
+
for (const property in customStyles) {
|
|
41
|
+
tableStyle[property] = customStyles[property]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
|
|
47
|
+
<DataTable
|
|
48
|
+
responsive={responsive}
|
|
49
|
+
data={data}
|
|
50
|
+
columns={tableColumns}
|
|
51
|
+
noHeader={true}
|
|
52
|
+
highlightOnHover
|
|
53
|
+
sortIcon={sortIcon}
|
|
54
|
+
progressPending={progressPending}
|
|
55
|
+
customStyles={tableStyle}
|
|
56
|
+
defaultSortFieldId={defaultSortFieldId}
|
|
57
|
+
progressComponent={progressComponent ? progressComponent : undefined}
|
|
58
|
+
sortServer={sortServer}
|
|
59
|
+
onSort={(columnInfo, direction, event) => {
|
|
60
|
+
handleOnSort(columnInfo, direction, event)
|
|
61
|
+
}}
|
|
62
|
+
conditionalRowStyles={conditionalRowStyles}
|
|
63
|
+
fixedHeader={fixedHeader}
|
|
64
|
+
fixedHeaderScrollHeight={fixedHeaderScrollHeight}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
Table.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* Theme object
|
|
77
|
+
*/
|
|
78
|
+
theme: PropTypes.object,
|
|
79
|
+
/**
|
|
80
|
+
* Optional component to override the default sorting icon (must be downward)
|
|
81
|
+
*/
|
|
82
|
+
sortIcon: PropTypes.any,
|
|
83
|
+
/**
|
|
84
|
+
* Data array of the actual data to display.
|
|
85
|
+
*/
|
|
86
|
+
data: PropTypes.array,
|
|
87
|
+
/**
|
|
88
|
+
* Data array of the columns to display.
|
|
89
|
+
*/
|
|
90
|
+
tableColumns: PropTypes.array,
|
|
91
|
+
/**
|
|
92
|
+
* Optional display a message while data are loading
|
|
93
|
+
*/
|
|
94
|
+
progressPending: PropTypes.bool,
|
|
95
|
+
/**
|
|
96
|
+
* Custom component to display while data are loading
|
|
97
|
+
*/
|
|
98
|
+
progressComponent: PropTypes.any,
|
|
99
|
+
/**
|
|
100
|
+
* Optional to set a column to be pre-sorted
|
|
101
|
+
*/
|
|
102
|
+
defaultSortFieldId: PropTypes.number,
|
|
103
|
+
/**
|
|
104
|
+
* Optional disables internal sorting for use with server-side/remote sorting
|
|
105
|
+
*/
|
|
106
|
+
sortServer: PropTypes.bool,
|
|
107
|
+
/**
|
|
108
|
+
* Optional function that is triggered when a column is sort
|
|
109
|
+
*/
|
|
110
|
+
handleOnSort: PropTypes.any,
|
|
111
|
+
/**
|
|
112
|
+
* Optional makes the table horizontally scrollable on smaller screen widths
|
|
113
|
+
*/
|
|
114
|
+
responsive: PropTypes.bool,
|
|
115
|
+
/**
|
|
116
|
+
* Optional array of objects that allow apply conditional style base on data value
|
|
117
|
+
*/
|
|
118
|
+
conditionalRowStyles: PropTypes.array,
|
|
119
|
+
/**
|
|
120
|
+
* Optional makes the table header fixed allowing you to scroll the table body
|
|
121
|
+
*/
|
|
122
|
+
fixedHeader: PropTypes.bool,
|
|
123
|
+
/**
|
|
124
|
+
* Optional to set height of the table
|
|
125
|
+
*/
|
|
126
|
+
fixedHeaderScrollHeight: PropTypes.string,
|
|
127
|
+
/**
|
|
128
|
+
* Optional to override style of the table
|
|
129
|
+
* Default style:
|
|
130
|
+
* https://github.com/jbetancur/react-data-table-component/blob/master/src/DataTable/styles.ts
|
|
131
|
+
*/
|
|
132
|
+
customStyle: PropTypes.object,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
Table.defaultProps = {
|
|
136
|
+
theme: defaultStyles,
|
|
137
|
+
sortIcon: <Icon
|
|
138
|
+
icon={'arrow-down'}
|
|
139
|
+
size={11}
|
|
140
|
+
color={'#333333'}
|
|
141
|
+
style={{
|
|
142
|
+
transform: 'scaleX(0.7) scaleY(0.7) translate(5px, -3px)',
|
|
143
|
+
}}
|
|
144
|
+
/>,
|
|
145
|
+
data: [],
|
|
146
|
+
tableColumns: [],
|
|
147
|
+
progressPending: false,
|
|
148
|
+
defaultSortFieldId: null,
|
|
149
|
+
handleOnSort: (columnInfo, direction, event) => { console.log(columnInfo, direction, event) },
|
|
150
|
+
sortServer: null,
|
|
151
|
+
progressComponent: undefined,
|
|
152
|
+
responsive: true,
|
|
153
|
+
fixedHeader: true,
|
|
154
|
+
fixedHeaderScrollHeight: '100vh',
|
|
155
|
+
};
|
|
156
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Table';
|