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,466 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import Select, { components } from "react-select";
|
|
5
|
+
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
6
|
+
import defaultStyles from '../constants/defaultStyle';
|
|
7
|
+
import getDefaultStyles from '../constants/utils';
|
|
8
|
+
import { Label } from '../Label';
|
|
9
|
+
import { Icon } from "../Icon";
|
|
10
|
+
// import { LoadingIndicatorProps } from 'react-select';
|
|
11
|
+
|
|
12
|
+
const Wrapper = styled.div`
|
|
13
|
+
|
|
14
|
+
.master-dropdown,
|
|
15
|
+
.new-select {
|
|
16
|
+
.master-dropdown__menu,
|
|
17
|
+
.new-select__menu {
|
|
18
|
+
margin: 0 0 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border: 0;
|
|
21
|
+
box-shadow: 0px 8px 40px rgba(56, 66, 100, 0.228174);
|
|
22
|
+
border-bottom-left-radius: 4.32px;
|
|
23
|
+
border-bottom-right-radius: 4.32px;select-manage-page
|
|
24
|
+
border-top-left-radius: 0;
|
|
25
|
+
border-top-right-radius: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
border: 0.5px solid ${defaultThemeColor.neutral['neutral-4']};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.new-select__dropdown-indicator{
|
|
31
|
+
padding-top:0px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.master-dropdown__single-value {
|
|
35
|
+
.input-label {
|
|
36
|
+
max-width: 250px;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
|
|
40
|
+
&:hover {
|
|
41
|
+
max-width: 100%;
|
|
42
|
+
overflow: visible;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.master-dropdown__menu-list,
|
|
48
|
+
.new-select__menu-list {
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.master-dropdown__menu-list {
|
|
54
|
+
max-height: 110px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.master-dropdown__control,
|
|
58
|
+
.new-select__control {
|
|
59
|
+
border:${({ isValid, }) => !isValid ? '0.5px solid ' + defaultThemeColor.ui['error'] :
|
|
60
|
+
'0.5px solid ' + defaultThemeColor.neutral['neutral-4']};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.master-dropdown__option,
|
|
64
|
+
.new-select__option {
|
|
65
|
+
color: ${defaultThemeColor.textColor};
|
|
66
|
+
font-size: 14px;
|
|
67
|
+
padding-top: 3px;
|
|
68
|
+
padding-bottom: 3px;
|
|
69
|
+
margin: 8px 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.get-selection__option:first-child {
|
|
73
|
+
margin-top: -113px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.master-dropdown__option--is-focused,
|
|
77
|
+
.master-dropdown__option:hover,
|
|
78
|
+
.new-select__option--is-focused,
|
|
79
|
+
.new-select__option:hover {
|
|
80
|
+
background-color: ${defaultThemeColor.neutral['neutral-5']};
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.new-select__control:hover,
|
|
85
|
+
.new-select__control--is-focused {
|
|
86
|
+
border: ${({ isValid, }) => !isValid ? '0.5px solid ' + defaultThemeColor.ui['error'] : '0.5px solid ' + defaultThemeColor.primary['primary-1']};
|
|
87
|
+
box-shadow: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
.master-dropdown__option--is-selected,
|
|
92
|
+
.new-select__option--is-selected {
|
|
93
|
+
background: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.master-dropdown__value-container,
|
|
97
|
+
.new-select__value-container {
|
|
98
|
+
padding: 0.375rem 0.75rem 0.5rem;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.default-select {
|
|
103
|
+
.default-select__control {
|
|
104
|
+
height: 39px;
|
|
105
|
+
// max-height: 39px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.default-select__value-container--has-value {
|
|
109
|
+
padding: 0 8px 4px 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.default-select__indicator {
|
|
113
|
+
padding: 0 8px 0 8px;
|
|
114
|
+
padding-top: 0px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.default-select__control--is-focused {
|
|
118
|
+
border-width: 1px;
|
|
119
|
+
outline: none;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.multiValue-wrapper{
|
|
124
|
+
width:100%;
|
|
125
|
+
display:flex;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.text-main-alt {
|
|
131
|
+
color: ${defaultThemeColor.textColor} !important;
|
|
132
|
+
font-size:14px;
|
|
133
|
+
}
|
|
134
|
+
.text-more-alt{
|
|
135
|
+
font-size:12px;
|
|
136
|
+
color:#6B747F
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
.css-mohuvp-dummyInput-DummyInput{
|
|
140
|
+
height:0px;
|
|
141
|
+
}
|
|
142
|
+
.css-14el2xx-placeholder{
|
|
143
|
+
font-size: ${({ placeholderSize }) => placeholderSize + 'px'};
|
|
144
|
+
}
|
|
145
|
+
.css-6j8wv5-Input{
|
|
146
|
+
margin:0px;
|
|
147
|
+
padding-top:0px;
|
|
148
|
+
}
|
|
149
|
+
.custom-loader{
|
|
150
|
+
animation: loader 3s;
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
@keyframes loader {
|
|
154
|
+
50% {transform: rotate(0deg);}
|
|
155
|
+
100% {transform: rotate(360deg);}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.new-select__menu {
|
|
159
|
+
z-Index: 2;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
`
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
const LabelWrapper = styled.div`
|
|
166
|
+
|
|
167
|
+
// Default style
|
|
168
|
+
display: flex;
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
//Set the styles from the default styles object
|
|
172
|
+
${({ theme, labelWrapperStyle }) => {
|
|
173
|
+
return getDefaultStyles(theme, labelWrapperStyle);
|
|
174
|
+
}}
|
|
175
|
+
// custom styles
|
|
176
|
+
${({ customLabelStyles }) => customLabelStyles}
|
|
177
|
+
`
|
|
178
|
+
const IconDiv = styled.div`
|
|
179
|
+
margin-left: 6px;
|
|
180
|
+
margin-top:-14px;
|
|
181
|
+
cursor:pointer;
|
|
182
|
+
`;
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
export const DropdownSelect = ({ customWrapperStyles, customLabelStyles, labelStyle, label, isRequired, optionArr, selectedValue, setSelectedValue, placeHolder, dropdownType, isDisabled, isValid, clearSelected, isClearSelected, isLoading, height, placeholderSize, ...props }) => {
|
|
186
|
+
const DropdownIndicator = p => {
|
|
187
|
+
return (
|
|
188
|
+
<components.DropdownIndicator {...p}>
|
|
189
|
+
{isClearSelected == true ?
|
|
190
|
+
<IconDiv onClick={() => { clearSelected() }}>
|
|
191
|
+
<Icon icon='cross-icon'
|
|
192
|
+
color={'black'}
|
|
193
|
+
size={8} />
|
|
194
|
+
</IconDiv>
|
|
195
|
+
: null}
|
|
196
|
+
<IconDiv>
|
|
197
|
+
<Icon icon='triangle-down'
|
|
198
|
+
color={'black'}
|
|
199
|
+
size={8} />
|
|
200
|
+
</IconDiv>
|
|
201
|
+
</components.DropdownIndicator>
|
|
202
|
+
);
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// const LoadingIndicator = (LoadingIndicatorProps) => {
|
|
206
|
+
// return (
|
|
207
|
+
// <div className='custom-loader'>
|
|
208
|
+
// <Icon icon='arrow-rotate' color='black' />
|
|
209
|
+
// </div>
|
|
210
|
+
// );
|
|
211
|
+
// };
|
|
212
|
+
|
|
213
|
+
const Option = p => {
|
|
214
|
+
const checkboxStyle = {
|
|
215
|
+
width: '15px',
|
|
216
|
+
height: '15px',
|
|
217
|
+
borderRadius: '2px',
|
|
218
|
+
padding: '3px 4px',
|
|
219
|
+
fontSize: '8px',
|
|
220
|
+
lineHeight: '10px',
|
|
221
|
+
};
|
|
222
|
+
const checked = (
|
|
223
|
+
<div style={{ ...checkboxStyle, backgroundColor: p?.data?.color ?? '#2E56F4' }}>
|
|
224
|
+
<Icon icon='check-icon' color='white' />
|
|
225
|
+
</div>
|
|
226
|
+
)
|
|
227
|
+
const unchecked = (
|
|
228
|
+
<div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }} ></div>
|
|
229
|
+
)
|
|
230
|
+
return (
|
|
231
|
+
<components.Option {...p}>
|
|
232
|
+
<div style={{ display: 'flex', justifyContent: 'start', alignItems: 'center', width: '100%' }}>
|
|
233
|
+
{p.isSelected ? checked : unchecked}
|
|
234
|
+
<div className='text-main-alt' style={{ marginLeft: '10px' }}>
|
|
235
|
+
{p.label}
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</components.Option>
|
|
239
|
+
);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// const ValueContainer = p => {
|
|
243
|
+
// if (props.value.length < 1) {
|
|
244
|
+
// return (
|
|
245
|
+
// <components.ValueContainer {...p}>
|
|
246
|
+
// {p.children}
|
|
247
|
+
// </components.ValueContainer>
|
|
248
|
+
// );
|
|
249
|
+
// }
|
|
250
|
+
// let firstSelected = props.value[0].label;
|
|
251
|
+
// let moreComp = (
|
|
252
|
+
// <div className='ml-auto'>
|
|
253
|
+
// & {props.value.length - 1} more
|
|
254
|
+
// </div>
|
|
255
|
+
// )
|
|
256
|
+
// return (
|
|
257
|
+
// <components.ValueContainer {...p}>
|
|
258
|
+
// <div className="d-flex w-100">
|
|
259
|
+
// <div>
|
|
260
|
+
// {firstSelected}
|
|
261
|
+
// </div>
|
|
262
|
+
// {props.value.length > 1 && moreComp}
|
|
263
|
+
// </div>
|
|
264
|
+
// </components.ValueContainer>
|
|
265
|
+
// );
|
|
266
|
+
// };
|
|
267
|
+
|
|
268
|
+
const MultiValue = ({ getValue, index, ...p }) => {
|
|
269
|
+
const firstSelected = p?.data?.label || 'Select';
|
|
270
|
+
const len = getValue().length
|
|
271
|
+
return !index && (
|
|
272
|
+
<div className='multiValue-wrapper'>
|
|
273
|
+
<div className='text-main-alt'>
|
|
274
|
+
{firstSelected}
|
|
275
|
+
</div>
|
|
276
|
+
{len > 1 && <div className={`text-more-alt`}>
|
|
277
|
+
& {len - 1} more
|
|
278
|
+
</div>}
|
|
279
|
+
</div>
|
|
280
|
+
)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
const stylesComp = {
|
|
286
|
+
|
|
287
|
+
control: base => ({
|
|
288
|
+
...base,
|
|
289
|
+
border: '1px solid #d4d7e3',
|
|
290
|
+
height: `${height}px`,
|
|
291
|
+
minHeight: `${height}px`,
|
|
292
|
+
minWidth: '226px',
|
|
293
|
+
}),
|
|
294
|
+
dropdownIndicator: base => ({
|
|
295
|
+
...base,
|
|
296
|
+
height: `${height}px`,
|
|
297
|
+
display: 'flex',
|
|
298
|
+
justifyContent: 'center',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
}),
|
|
301
|
+
valueContainer: base => ({
|
|
302
|
+
...base,
|
|
303
|
+
height: `${height}px`,
|
|
304
|
+
padding: '4px 8px'
|
|
305
|
+
}),
|
|
306
|
+
indicatorsContainer: base => ({
|
|
307
|
+
...base,
|
|
308
|
+
padding: 0,
|
|
309
|
+
height: `${height}px`,
|
|
310
|
+
}),
|
|
311
|
+
menu: base => ({
|
|
312
|
+
...base,
|
|
313
|
+
border: 'none',
|
|
314
|
+
marginTop: '1px',
|
|
315
|
+
borderTopRightRadius: '0px',
|
|
316
|
+
borderTopLeftRadius: '0px',
|
|
317
|
+
outline: 'none',
|
|
318
|
+
boxShadow: '0px 6px 20px rgba(56, 66, 100, 0.15)',
|
|
319
|
+
borderRadius: '4.32px',
|
|
320
|
+
fontSize: '14px'
|
|
321
|
+
|
|
322
|
+
}),
|
|
323
|
+
singleValue: base => ({
|
|
324
|
+
...base,
|
|
325
|
+
fontSize: '14px',
|
|
326
|
+
}),
|
|
327
|
+
input: base => ({
|
|
328
|
+
...base,
|
|
329
|
+
fontSize: '14px',
|
|
330
|
+
}),
|
|
331
|
+
option: (provided, state) => ({
|
|
332
|
+
...provided,
|
|
333
|
+
backgroundColor: state.isSelected ? '#F0F3F8' : 'white',
|
|
334
|
+
padding: '10px',
|
|
335
|
+
cursor: 'pointer',
|
|
336
|
+
color: '#081348'
|
|
337
|
+
}),
|
|
338
|
+
...props.styles,
|
|
339
|
+
}
|
|
340
|
+
return (
|
|
341
|
+
<Wrapper style={customWrapperStyles} isValid={isValid} placeholderSize={placeholderSize}
|
|
342
|
+
>
|
|
343
|
+
{label && <LabelWrapper theme={defaultStyles}
|
|
344
|
+
labelWrapperStyle={'selectComp-label-wrapper'} style={customLabelStyles}>
|
|
345
|
+
<Label
|
|
346
|
+
themeColor={defaultThemeColor}
|
|
347
|
+
customStyles={labelStyle}
|
|
348
|
+
type={'label-text'}
|
|
349
|
+
text={label}
|
|
350
|
+
style={{ marginBottom: '10px' }}
|
|
351
|
+
/>
|
|
352
|
+
{isRequired && <div style={{
|
|
353
|
+
marginLeft: '4px',
|
|
354
|
+
color: `${defaultThemeColor.ui['error']}`
|
|
355
|
+
}} >*</div>}
|
|
356
|
+
</LabelWrapper>}
|
|
357
|
+
{dropdownType === 'singleSelect' ?
|
|
358
|
+
<Select
|
|
359
|
+
components={{
|
|
360
|
+
DropdownIndicator,
|
|
361
|
+
// LoadingIndicator,
|
|
362
|
+
IndicatorSeparator: () => null,
|
|
363
|
+
ClearIndicator: () => null
|
|
364
|
+
}}
|
|
365
|
+
className="select-manage-page"
|
|
366
|
+
// className="new-select"
|
|
367
|
+
classNamePrefix="new-select"
|
|
368
|
+
name={"select-dropdown mb-1"}
|
|
369
|
+
options={optionArr}
|
|
370
|
+
placeholder={placeHolder}
|
|
371
|
+
isDisabled={isDisabled}
|
|
372
|
+
value={{
|
|
373
|
+
value: selectedValue ? selectedValue.value : '',
|
|
374
|
+
label: selectedValue ? selectedValue.label : ''
|
|
375
|
+
}}
|
|
376
|
+
styles={stylesComp}
|
|
377
|
+
onChange={setSelectedValue}
|
|
378
|
+
isLoading={isLoading}
|
|
379
|
+
{...props}
|
|
380
|
+
/>
|
|
381
|
+
:
|
|
382
|
+
<Select
|
|
383
|
+
components={{
|
|
384
|
+
DropdownIndicator,
|
|
385
|
+
MultiValue,
|
|
386
|
+
Option,
|
|
387
|
+
// LoadingIndicator: () => null,
|
|
388
|
+
IndicatorSeparator: () => null,
|
|
389
|
+
ClearIndicator: () => null
|
|
390
|
+
}}
|
|
391
|
+
className="select-manage-page"
|
|
392
|
+
classNamePrefix="new-select"
|
|
393
|
+
name={"select-dropdown mb-1"}
|
|
394
|
+
onChange={setSelectedValue}
|
|
395
|
+
placeholder={placeHolder}
|
|
396
|
+
value={selectedValue}
|
|
397
|
+
options={optionArr}
|
|
398
|
+
styles={stylesComp}
|
|
399
|
+
isMulti={true}
|
|
400
|
+
isDisabled={isDisabled}
|
|
401
|
+
isClearable={props.isClearable}
|
|
402
|
+
hideSelectedOptions={false}
|
|
403
|
+
closeMenuOnSelect={false}
|
|
404
|
+
onMenuClose={props.onMenuClose}
|
|
405
|
+
isSearchable={false}
|
|
406
|
+
isLoading={isLoading}
|
|
407
|
+
|
|
408
|
+
{...props}
|
|
409
|
+
/>
|
|
410
|
+
}
|
|
411
|
+
</Wrapper>
|
|
412
|
+
)
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
DropdownSelect.propTypes = {
|
|
416
|
+
/**
|
|
417
|
+
* Label of SelectBox
|
|
418
|
+
*/
|
|
419
|
+
label: PropTypes.string,
|
|
420
|
+
/**
|
|
421
|
+
* Label Style of SelectBox
|
|
422
|
+
*/
|
|
423
|
+
labelStyle: PropTypes.object,
|
|
424
|
+
/**
|
|
425
|
+
* SelectBox Options
|
|
426
|
+
*/
|
|
427
|
+
optionArr: PropTypes.array,
|
|
428
|
+
/**
|
|
429
|
+
* SelectBox Selected value. This is a array of object must be with this format:
|
|
430
|
+
[{
|
|
431
|
+
label:string,
|
|
432
|
+
value:string
|
|
433
|
+
}]
|
|
434
|
+
*/
|
|
435
|
+
selectedValue: PropTypes.object,
|
|
436
|
+
/**
|
|
437
|
+
* Function to set selected value
|
|
438
|
+
*/
|
|
439
|
+
setSelectedValue: PropTypes.func,
|
|
440
|
+
/**
|
|
441
|
+
* SelectBox Placeholder
|
|
442
|
+
*/
|
|
443
|
+
placeHolder: PropTypes.string,
|
|
444
|
+
/**
|
|
445
|
+
* SelectBox Placeholder's font size
|
|
446
|
+
*/
|
|
447
|
+
placeholderSize: PropTypes.number,
|
|
448
|
+
/**
|
|
449
|
+
* This Function will be called if cross button pressed
|
|
450
|
+
*/
|
|
451
|
+
clearSelected: PropTypes.func,
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
DropdownSelect.defaultProps = {
|
|
455
|
+
label: '',
|
|
456
|
+
labelStyle: {},
|
|
457
|
+
optionArr: [],
|
|
458
|
+
selectedValue: {},
|
|
459
|
+
setSelectedValue: undefined,
|
|
460
|
+
placeHolder: '',
|
|
461
|
+
isValid: true,
|
|
462
|
+
isClearSelected: false,
|
|
463
|
+
height: 31,
|
|
464
|
+
placeholderSize: 14
|
|
465
|
+
}
|
|
466
|
+
|