groundfloor-react-ui 1.2.8 → 1.2.10
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/index.es.js +461 -430
- package/dist/index.js +469 -438
- package/package.json +15 -43
- package/rollup.config.js +6 -6
- 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 +0 -3
- package/assets/icons/arrow-down.svg +0 -3
- package/assets/icons/arrow-rotate.svg +0 -1
- package/assets/icons/arrow-up.svg +0 -3
- package/assets/icons/bell.svg +0 -3
- package/assets/icons/check.svg +0 -3
- package/assets/icons/checkmark.svg +0 -3
- package/assets/icons/chevron-down.svg +0 -3
- package/assets/icons/chevron-left.svg +0 -3
- package/assets/icons/chevron-right.svg +0 -3
- package/assets/icons/cloud-icon.svg +0 -3
- package/assets/icons/connection.svg +0 -3
- package/assets/icons/cross-icon.svg +0 -3
- package/assets/icons/default.svg +0 -1
- package/assets/icons/door-internal-active.svg +0 -1
- package/assets/icons/edit-icon.svg +0 -3
- package/assets/icons/ellipses-horizontal.svg +0 -3
- package/assets/icons/ellipses.svg +0 -3
- package/assets/icons/email.svg +0 -3
- package/assets/icons/eye-hide-view.svg +0 -1
- package/assets/icons/eye-hide.svg +0 -1
- package/assets/icons/file-attach-white.svg +0 -3
- package/assets/icons/file-attach.svg +0 -3
- package/assets/icons/file-icon.svg +0 -1
- package/assets/icons/file-upload.svg +0 -3
- package/assets/icons/functional-equation-regular.svg +0 -147
- package/assets/icons/hamburger-menu.svg +0 -3
- package/assets/icons/heart.svg +0 -18
- package/assets/icons/image.svg +0 -3
- package/assets/icons/info.svg +0 -3
- package/assets/icons/jpg-icon.svg +0 -3
- package/assets/icons/magnifier.svg +0 -3
- package/assets/icons/menu-ellipse-two.svg +0 -1
- package/assets/icons/menu-ellipse.svg +0 -53
- package/assets/icons/pause-all.svg +0 -1
- package/assets/icons/pdf-icon.svg +0 -3
- package/assets/icons/pen-icon.svg +0 -3
- package/assets/icons/plus-outlined.svg +0 -3
- package/assets/icons/resume.svg +0 -1
- package/assets/icons/sign-icon.svg +0 -3
- package/assets/icons/star.svg +0 -3
- package/assets/icons/trash-icon.svg +0 -59
- package/assets/icons/triangle-down.svg +0 -3
- package/assets/icons/users.svg +0 -11
- package/assets/icons/view.svg +0 -3
- package/assets/icons/watcher.svg +0 -3
- package/assets/icons/zoom-in-white.svg +0 -1
- package/assets/styles/global.css +0 -0
- package/assets/styles/global.scss +0 -0
- package/components/Accordion/Accordion.js +0 -167
- package/components/Accordion/AccordionSB.js +0 -170
- package/components/Accordion/AccordionSBfooter.js +0 -171
- package/components/Accordion/index.js +0 -4
- package/components/ArrowBar/ArrowBar.js +0 -276
- package/components/ArrowBar/index.js +0 -2
- package/components/Avatar/Avatar.js +0 -171
- package/components/Avatar/AvatarSB.js +0 -255
- package/components/Avatar/AvatarSBfooter.js +0 -279
- package/components/Avatar/index.js +0 -4
- package/components/Banner/Banner.js +0 -70
- package/components/Banner/index.js +0 -2
- package/components/Breadcrumb/Breadcrumb.js +0 -225
- package/components/Breadcrumb/index.js +0 -2
- package/components/Button/PrimaryButton.js +0 -167
- package/components/Button/SecondaryButton.js +0 -156
- package/components/Button/TinyButton.js +0 -101
- package/components/Button/index.js +0 -6
- package/components/Cards/Card.js +0 -43
- package/components/Cards/CardRef.js +0 -71
- package/components/Cards/DocumentCard.js +0 -215
- package/components/Cards/index.js +0 -5
- package/components/Content/Content.js +0 -50
- package/components/Content/index.js +0 -1
- package/components/DesignComponent/StyledComponent/StyledComponent.js +0 -326
- package/components/DesignComponent/StyledComponent/index.js +0 -1
- package/components/DesignComponent/index.js +0 -1
- package/components/Divider/Divider.js +0 -56
- package/components/Divider/index.js +0 -2
- package/components/Drawer/Drawer.js +0 -84
- package/components/Drawer/index.js +0 -2
- package/components/ErrorBoundary/ErrorBoundary.js +0 -44
- package/components/ErrorBoundary/index.js +0 -1
- package/components/FilterChip/FilterChip.js +0 -70
- package/components/FilterChip/index.js +0 -1
- package/components/Footer/Footer.js +0 -57
- package/components/Footer/FooterContent.js +0 -98
- package/components/Footer/index.js +0 -3
- package/components/Form/FormComponent.js +0 -244
- package/components/Form/HeaderComponent.js +0 -64
- package/components/Form/SubmitComponent.js +0 -63
- package/components/Form/index.js +0 -5
- package/components/GroupAvatars/GroupAvatars.js +0 -139
- package/components/GroupAvatars/index.js +0 -1
- package/components/GroupButtons/ButtonPopup.js +0 -191
- package/components/GroupButtons/GroupButtons.js +0 -150
- package/components/GroupButtons/GroupButtonsPopup.js +0 -163
- package/components/GroupButtons/index.js +0 -3
- package/components/GroupStatusCircle/GroupStatusCircle.js +0 -135
- package/components/GroupStatusCircle/index.js +0 -1
- package/components/Header/Header.js +0 -58
- package/components/Header/index.js +0 -1
- package/components/HyperLink/HyperLink.js +0 -114
- package/components/HyperLink/index.js +0 -1
- package/components/Icon/Icon.js +0 -176
- package/components/Icon/index.js +0 -1
- package/components/Images/Image.js +0 -107
- package/components/Images/index.js +0 -2
- package/components/Inputs/CheckBoxInput.js +0 -339
- package/components/Inputs/ColorInput.js +0 -145
- package/components/Inputs/DateSelect.js +0 -461
- package/components/Inputs/DropdownSelect.js +0 -690
- package/components/Inputs/DropzoneInput.js +0 -450
- package/components/Inputs/NumericInput.js +0 -166
- package/components/Inputs/PasswordInput.js +0 -242
- package/components/Inputs/RadioInput.js +0 -292
- package/components/Inputs/SearchInput.js +0 -19
- package/components/Inputs/Signature.js +0 -369
- package/components/Inputs/TextArea.js +0 -214
- package/components/Inputs/TextInput.js +0 -235
- package/components/Inputs/TimeInput.js +0 -186
- package/components/Inputs/ToggleSwitch.js +0 -157
- package/components/Inputs/index.js +0 -15
- package/components/Label/Label.js +0 -48
- package/components/Label/index.js +0 -1
- package/components/Loaders/Loader.js +0 -179
- package/components/Loaders/index.js +0 -2
- package/components/Modal/ModalComp.js +0 -216
- package/components/Modal/index.js +0 -1
- package/components/Overlay/Overlay.js +0 -158
- package/components/Overlay/index.js +0 -1
- package/components/Pagination/Pagination.js +0 -59
- package/components/Pagination/index.js +0 -1
- package/components/ProgressBar/ProgressBar.js +0 -101
- package/components/ProgressBar/index.js +0 -1
- package/components/ProgressSteps/ProgressSteps.js +0 -121
- package/components/ProgressSteps/index.js +0 -1
- package/components/Rating/Rating.js +0 -258
- package/components/Rating/index.js +0 -1
- package/components/SecondaryLink/DarkSecondaryLink.js +0 -97
- package/components/SecondaryLink/LightSecondaryLink.js +0 -93
- package/components/SecondaryLink/index.js +0 -3
- package/components/Sidebar/Navbar.js +0 -306
- package/components/Sidebar/Sidebar.js +0 -207
- package/components/Sidebar/index.js +0 -3
- package/components/StatusChip/PrimaryStatusChip.js +0 -78
- package/components/StatusChip/SecondaryStatusChip.js +0 -78
- package/components/StatusChip/SlimPrimaryStatusChip.js +0 -92
- package/components/StatusChip/SlimSecondaryStatusChip.js +0 -93
- package/components/StatusChip/index.js +0 -6
- package/components/StatusCircle/StatusCircle.js +0 -64
- package/components/StatusCircle/index.js +0 -1
- package/components/Tables/Table.js +0 -178
- package/components/Tables/index.js +0 -1
- package/components/Tooltip/Tooltip.js +0 -581
- package/components/Tooltip/index.js +0 -1
- package/components/Typography/Typography.js +0 -77
- package/components/Typography/index.js +0 -2
- package/components/constants/colors.js +0 -33
- package/components/constants/defaultStyle.js +0 -801
- package/components/constants/defaultThemeColor.js +0 -16
- package/components/constants/index.js +0 -7
- package/components/constants/utils.js +0 -31
- package/components/global/FontStyle.js +0 -131
- package/components/global/index.js +0 -1
- package/index.js +0 -41
|
@@ -1,690 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import Select, { components } from 'react-select';
|
|
4
|
-
import AsyncSelect from 'react-select/async';
|
|
5
|
-
import styled, { useTheme } from 'styled-components';
|
|
6
|
-
import defaultStyles from '../constants/defaultStyle';
|
|
7
|
-
import defaultThemeColor from '../constants/defaultThemeColor';
|
|
8
|
-
import getDefaultStyles from '../constants/utils';
|
|
9
|
-
import { Icon } from '../Icon';
|
|
10
|
-
import { Label } from '../Label';
|
|
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
|
-
}
|
|
28
|
-
|
|
29
|
-
.new-select__dropdown-indicator{
|
|
30
|
-
padding-top:0px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.master-dropdown__single-value {
|
|
34
|
-
.input-label {
|
|
35
|
-
max-width: 250px;
|
|
36
|
-
overflow: hidden;
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
|
-
|
|
39
|
-
&:hover {
|
|
40
|
-
max-width: 100%;
|
|
41
|
-
overflow: visible;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.master-dropdown__menu-list,
|
|
47
|
-
.new-select__menu-list {
|
|
48
|
-
margin: 0;
|
|
49
|
-
padding: 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.master-dropdown__menu-list {
|
|
53
|
-
max-height: 110px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.master-dropdown__option,
|
|
59
|
-
.new-select__option {
|
|
60
|
-
color: ${({ theme }) => theme.textColor};
|
|
61
|
-
padding-top: 3px;
|
|
62
|
-
padding-bottom: 3px;
|
|
63
|
-
margin: 8px 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.get-selection__option:first-child {
|
|
67
|
-
margin-top: -113px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.master-dropdown__option--is-focused,
|
|
71
|
-
.master-dropdown__option:hover,
|
|
72
|
-
.new-select__option--is-focused,
|
|
73
|
-
.new-select__option:hover {
|
|
74
|
-
background-color: ${({ theme }) => theme.neutral['neutral-5']};
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.new-select__control:hover,
|
|
79
|
-
.new-select__control--is-focused {
|
|
80
|
-
|
|
81
|
-
box-shadow: none;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.master-dropdown__option--is-selected,
|
|
86
|
-
.new-select__option--is-selected {
|
|
87
|
-
background: transparent;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.master-dropdown__value-container,
|
|
91
|
-
.new-select__value-container {
|
|
92
|
-
padding: 0.375rem 0.75rem 0.5rem;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.default-select {
|
|
97
|
-
.default-select__control {
|
|
98
|
-
height: 39px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.default-select__value-container--has-value {
|
|
102
|
-
padding: 0 8px 4px 8px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.default-select__indicator {
|
|
106
|
-
padding: 0 8px 0 8px;
|
|
107
|
-
padding-top: 0px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.default-select__control--is-focused {
|
|
111
|
-
outline: none;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.text-main-alt {
|
|
118
|
-
color:${({ theme }) => theme.textColor} !important;
|
|
119
|
-
margin-right: 0px;
|
|
120
|
-
}
|
|
121
|
-
.text-main-alt-value {
|
|
122
|
-
color:${({ theme }) => theme.textColor} !important;
|
|
123
|
-
white-space: nowrap;
|
|
124
|
-
overflow: hidden;
|
|
125
|
-
text-overflow: ellipsis;
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
.text-more-alt{
|
|
129
|
-
font-size:12px;
|
|
130
|
-
color: ${({ theme }) => theme.neutral['neutral-2']};
|
|
131
|
-
padding-right: 0px;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
.css-mohuvp-dummyInput-DummyInput{
|
|
136
|
-
height:0px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.css-6j8wv5-Input{
|
|
140
|
-
margin:0px;
|
|
141
|
-
padding-top:0px;
|
|
142
|
-
}
|
|
143
|
-
.new-select__menu {
|
|
144
|
-
z-Index: 2;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.new-select__input-container{
|
|
148
|
-
margin:0px;
|
|
149
|
-
padding:0px;
|
|
150
|
-
}
|
|
151
|
-
.new-select__input{
|
|
152
|
-
margin:0px;
|
|
153
|
-
padding:0px;
|
|
154
|
-
}
|
|
155
|
-
.new-select__control:hover,
|
|
156
|
-
.new-select__control--is-focused {
|
|
157
|
-
border: 1px solid ${({ theme }) => theme.primary['primary-1']};
|
|
158
|
-
}
|
|
159
|
-
`;
|
|
160
|
-
|
|
161
|
-
Wrapper.defaultProps = {
|
|
162
|
-
theme: defaultThemeColor,
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const LabelWrapper = styled.div`
|
|
166
|
-
// Default style
|
|
167
|
-
display: flex;
|
|
168
|
-
|
|
169
|
-
//Set the styles from the default styles object
|
|
170
|
-
${({ inBuiltCss, labelWrapperStyle }) => {
|
|
171
|
-
return getDefaultStyles(inBuiltCss, labelWrapperStyle);
|
|
172
|
-
}}
|
|
173
|
-
// custom styles
|
|
174
|
-
${({ customLabelStyles }) => customLabelStyles}
|
|
175
|
-
`;
|
|
176
|
-
const IconDiv = styled.div`
|
|
177
|
-
margin-left: 6px;
|
|
178
|
-
margin-top: -14px;
|
|
179
|
-
cursor: pointer;
|
|
180
|
-
`;
|
|
181
|
-
|
|
182
|
-
export const DropdownSelect = ({
|
|
183
|
-
label,
|
|
184
|
-
labelStyle,
|
|
185
|
-
optionArr,
|
|
186
|
-
selectedValue,
|
|
187
|
-
setSelectedValue,
|
|
188
|
-
placeHolder,
|
|
189
|
-
isClearable,
|
|
190
|
-
isValid,
|
|
191
|
-
height,
|
|
192
|
-
fontSize,
|
|
193
|
-
loadOptions,
|
|
194
|
-
onInputChange,
|
|
195
|
-
clearSelected,
|
|
196
|
-
customWrapperStyles,
|
|
197
|
-
customLabelStyles,
|
|
198
|
-
isRequired,
|
|
199
|
-
dropdownType,
|
|
200
|
-
isDisabled,
|
|
201
|
-
|
|
202
|
-
isLoading,
|
|
203
|
-
id,
|
|
204
|
-
iconName,
|
|
205
|
-
iconColor,
|
|
206
|
-
iconSize,
|
|
207
|
-
showIndicator,
|
|
208
|
-
leftIcon,
|
|
209
|
-
leftIconColor,
|
|
210
|
-
leftIconSize,
|
|
211
|
-
...props
|
|
212
|
-
}) => {
|
|
213
|
-
const activeTheme = useTheme() || defaultThemeColor;
|
|
214
|
-
|
|
215
|
-
const DropdownIndicator = (p) => {
|
|
216
|
-
const dropdown = (
|
|
217
|
-
<components.DropdownIndicator {...p}>
|
|
218
|
-
<IconDiv>
|
|
219
|
-
<Icon icon={iconName} color={iconColor} size={iconSize} />
|
|
220
|
-
</IconDiv>
|
|
221
|
-
</components.DropdownIndicator>
|
|
222
|
-
);
|
|
223
|
-
return showIndicator === true ? dropdown : null;
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const ClearIndicator = (p) => {
|
|
227
|
-
return (
|
|
228
|
-
<components.ClearIndicator {...p}>
|
|
229
|
-
{isClearable ? (
|
|
230
|
-
<IconDiv
|
|
231
|
-
onClick={() => {
|
|
232
|
-
clearSelected();
|
|
233
|
-
p.clearValue();
|
|
234
|
-
}}
|
|
235
|
-
>
|
|
236
|
-
<Icon icon='cross-icon' color={'black'} size={8} />
|
|
237
|
-
</IconDiv>
|
|
238
|
-
) : null}
|
|
239
|
-
</components.ClearIndicator>
|
|
240
|
-
);
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
const LeftIcon = ({ getValue, children, ...props }) => {
|
|
244
|
-
const len = getValue().length;
|
|
245
|
-
|
|
246
|
-
return (
|
|
247
|
-
<components.ValueContainer {...props}>
|
|
248
|
-
{leftIcon === '' ? null : (
|
|
249
|
-
<IconDiv
|
|
250
|
-
style={{
|
|
251
|
-
paddingTop: '10px',
|
|
252
|
-
paddingRight: '8px',
|
|
253
|
-
marginLeft: '0',
|
|
254
|
-
marginTop: '-16px',
|
|
255
|
-
}}
|
|
256
|
-
>
|
|
257
|
-
<Icon icon={leftIcon} color={leftIconColor} size={leftIconSize} />
|
|
258
|
-
</IconDiv>
|
|
259
|
-
)}
|
|
260
|
-
|
|
261
|
-
{children}
|
|
262
|
-
{len > 1 && <span className={`text-more-alt`}>& {len - 1} more</span>}
|
|
263
|
-
</components.ValueContainer>
|
|
264
|
-
);
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const Option = (p) => {
|
|
270
|
-
const checkboxStyle = {
|
|
271
|
-
width: '15px',
|
|
272
|
-
height: '15px',
|
|
273
|
-
borderRadius: '2px',
|
|
274
|
-
padding: '4px',
|
|
275
|
-
fontSize: '8px',
|
|
276
|
-
lineHeight: '10px',
|
|
277
|
-
minWidth: '15px',
|
|
278
|
-
minHeight: '15px',
|
|
279
|
-
};
|
|
280
|
-
const checked = (
|
|
281
|
-
<div
|
|
282
|
-
style={{
|
|
283
|
-
...checkboxStyle,
|
|
284
|
-
backgroundColor: p?.data?.color ?? activeTheme.primary['primary-1'],
|
|
285
|
-
}}
|
|
286
|
-
>
|
|
287
|
-
<Icon icon='check-icon' color='white' />
|
|
288
|
-
</div>
|
|
289
|
-
);
|
|
290
|
-
const unchecked = (
|
|
291
|
-
<div style={{ ...checkboxStyle, backgroundColor: '#e0e7ff' }}></div>
|
|
292
|
-
);
|
|
293
|
-
return (
|
|
294
|
-
<components.Option {...p}>
|
|
295
|
-
<div
|
|
296
|
-
style={{
|
|
297
|
-
display: 'flex',
|
|
298
|
-
justifyContent: 'start',
|
|
299
|
-
alignItems: 'center',
|
|
300
|
-
width: '100%',
|
|
301
|
-
}}
|
|
302
|
-
>
|
|
303
|
-
{p.isSelected ? checked : unchecked}
|
|
304
|
-
<div className='text-main-alt' style={{ marginLeft: '10px' }}>
|
|
305
|
-
{p.label}
|
|
306
|
-
</div>
|
|
307
|
-
</div>
|
|
308
|
-
</components.Option>
|
|
309
|
-
);
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
const MultiValue = ({ index, ...p }) => {
|
|
313
|
-
const firstSelected = p?.data?.label || 'Select';
|
|
314
|
-
return !index && <span className='text-main-alt-value'>{firstSelected}</span>;
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
const stylesComp = {
|
|
318
|
-
control: (base, state) => ({
|
|
319
|
-
...base,
|
|
320
|
-
border: !isValid
|
|
321
|
-
? '1px solid ' + activeTheme.ui['error']
|
|
322
|
-
: '1px solid ' + activeTheme.border,
|
|
323
|
-
minWidth: '226px',
|
|
324
|
-
height: `${height}px`,
|
|
325
|
-
minHeight: `${height}px`,
|
|
326
|
-
boxShadow: (state.isSelected || state.isFocused) && 'none',
|
|
327
|
-
}),
|
|
328
|
-
placeholder: (base) => ({
|
|
329
|
-
...base,
|
|
330
|
-
fontSize: fontSize + 'px',
|
|
331
|
-
marginLeft: '0px',
|
|
332
|
-
}),
|
|
333
|
-
dropdownIndicator: (base) => ({
|
|
334
|
-
...base,
|
|
335
|
-
height: `${height}px`,
|
|
336
|
-
display: 'flex',
|
|
337
|
-
justifyContent: 'center',
|
|
338
|
-
alignItems: 'center',
|
|
339
|
-
paddingLeft: '0px',
|
|
340
|
-
}),
|
|
341
|
-
clearIndicator: (base) => ({
|
|
342
|
-
...base,
|
|
343
|
-
height: `${height}px`,
|
|
344
|
-
display: 'flex',
|
|
345
|
-
justifyContent: 'center',
|
|
346
|
-
alignItems: 'center',
|
|
347
|
-
paddingLeft: '0px',
|
|
348
|
-
}),
|
|
349
|
-
valueContainer: (base) => ({
|
|
350
|
-
...base,
|
|
351
|
-
display: 'flex',
|
|
352
|
-
justifyContent: 'space-between',
|
|
353
|
-
fontSize: fontSize + 'px',
|
|
354
|
-
}),
|
|
355
|
-
indicatorsContainer: (base) => ({
|
|
356
|
-
...base,
|
|
357
|
-
padding: 0,
|
|
358
|
-
height: `${height}px`,
|
|
359
|
-
}),
|
|
360
|
-
menu: (base) => ({
|
|
361
|
-
...base,
|
|
362
|
-
border: 'none',
|
|
363
|
-
marginTop: '1px',
|
|
364
|
-
borderTopRightRadius: '0px',
|
|
365
|
-
borderTopLeftRadius: '0px',
|
|
366
|
-
outline: 'none',
|
|
367
|
-
boxShadow: '0px 6px 20px rgba(56, 66, 100, 0.15)',
|
|
368
|
-
borderRadius: '4.32px',
|
|
369
|
-
fontSize: fontSize + 'px',
|
|
370
|
-
width: '100%',
|
|
371
|
-
minWidth: '226px',
|
|
372
|
-
}),
|
|
373
|
-
singleValue: (base) => ({
|
|
374
|
-
...base,
|
|
375
|
-
fontSize: fontSize + 'px',
|
|
376
|
-
marginLeft: '0px',
|
|
377
|
-
width: 'auto',
|
|
378
|
-
}),
|
|
379
|
-
multiValue: (base) => ({
|
|
380
|
-
...base,
|
|
381
|
-
marginLeft: '0px',
|
|
382
|
-
width: 'auto',
|
|
383
|
-
}),
|
|
384
|
-
input: (base) => ({
|
|
385
|
-
...base,
|
|
386
|
-
fontSize: fontSize + 'px',
|
|
387
|
-
}),
|
|
388
|
-
option: (provided, state) => ({
|
|
389
|
-
...provided,
|
|
390
|
-
backgroundColor:
|
|
391
|
-
state.isSelected || state.isFocused
|
|
392
|
-
? activeTheme.neutral['neutral-5']
|
|
393
|
-
: activeTheme.bgColor,
|
|
394
|
-
padding: '10px',
|
|
395
|
-
cursor: 'pointer',
|
|
396
|
-
color: '#081348',
|
|
397
|
-
width: 'inherit',
|
|
398
|
-
}),
|
|
399
|
-
|
|
400
|
-
...props.styles,
|
|
401
|
-
};
|
|
402
|
-
return (
|
|
403
|
-
<Wrapper
|
|
404
|
-
style={customWrapperStyles}
|
|
405
|
-
isValid={isValid}
|
|
406
|
-
fontSize={fontSize}
|
|
407
|
-
theme={activeTheme}
|
|
408
|
-
>
|
|
409
|
-
{label && (
|
|
410
|
-
<LabelWrapper
|
|
411
|
-
inBuiltCss={defaultStyles}
|
|
412
|
-
labelWrapperStyle={'selectComp-label-wrapper'}
|
|
413
|
-
style={customLabelStyles}
|
|
414
|
-
>
|
|
415
|
-
<Label
|
|
416
|
-
customStyles={labelStyle}
|
|
417
|
-
type={'label-text'}
|
|
418
|
-
text={label}
|
|
419
|
-
style={{ marginBottom: '7px', paddingBottom: '0px' }}
|
|
420
|
-
/>
|
|
421
|
-
{isRequired && (
|
|
422
|
-
<div
|
|
423
|
-
style={{
|
|
424
|
-
marginLeft: '4px',
|
|
425
|
-
color: `${activeTheme.ui['error']}`,
|
|
426
|
-
}}
|
|
427
|
-
>
|
|
428
|
-
*
|
|
429
|
-
</div>
|
|
430
|
-
)}
|
|
431
|
-
</LabelWrapper>
|
|
432
|
-
)}
|
|
433
|
-
{dropdownType === 'multiSelect' ? (
|
|
434
|
-
<Select
|
|
435
|
-
components={{
|
|
436
|
-
DropdownIndicator,
|
|
437
|
-
MultiValue,
|
|
438
|
-
Option,
|
|
439
|
-
ValueContainer: LeftIcon,
|
|
440
|
-
// ValueContainer,
|
|
441
|
-
IndicatorSeparator: () => null,
|
|
442
|
-
ClearIndicator,
|
|
443
|
-
}}
|
|
444
|
-
className='select-manage-page'
|
|
445
|
-
classNamePrefix='new-select'
|
|
446
|
-
name={'select-dropdown'}
|
|
447
|
-
onChange={setSelectedValue}
|
|
448
|
-
placeholder={placeHolder}
|
|
449
|
-
value={selectedValue}
|
|
450
|
-
options={optionArr}
|
|
451
|
-
styles={stylesComp}
|
|
452
|
-
isMulti={true}
|
|
453
|
-
isDisabled={isDisabled}
|
|
454
|
-
hideSelectedOptions={false}
|
|
455
|
-
closeMenuOnSelect={false}
|
|
456
|
-
isSearchable={true}
|
|
457
|
-
isLoading={isLoading}
|
|
458
|
-
id={id}
|
|
459
|
-
isClearable={isClearable}
|
|
460
|
-
{...props}
|
|
461
|
-
/>
|
|
462
|
-
) : dropdownType === 'asyncSingleSelect' ? (
|
|
463
|
-
<AsyncSelect
|
|
464
|
-
loadOptions={loadOptions}
|
|
465
|
-
defaultOptions
|
|
466
|
-
onInputChange={onInputChange}
|
|
467
|
-
styles={stylesComp}
|
|
468
|
-
components={{
|
|
469
|
-
DropdownIndicator,
|
|
470
|
-
ValueContainer: LeftIcon,
|
|
471
|
-
// ValueContainer,
|
|
472
|
-
IndicatorSeparator: () => null,
|
|
473
|
-
ClearIndicator,
|
|
474
|
-
}}
|
|
475
|
-
className='select-manage-page'
|
|
476
|
-
classNamePrefix='new-select'
|
|
477
|
-
name={'select-dropdown'}
|
|
478
|
-
placeholder={placeHolder}
|
|
479
|
-
onChange={setSelectedValue}
|
|
480
|
-
isLoading={isLoading}
|
|
481
|
-
isDisabled={isDisabled}
|
|
482
|
-
id={id}
|
|
483
|
-
isClearable={isClearable}
|
|
484
|
-
{...props}
|
|
485
|
-
/>
|
|
486
|
-
) : dropdownType === 'asyncMultiSelect' ? (
|
|
487
|
-
<AsyncSelect
|
|
488
|
-
components={{
|
|
489
|
-
DropdownIndicator,
|
|
490
|
-
MultiValue,
|
|
491
|
-
ValueContainer: LeftIcon,
|
|
492
|
-
// ValueContainer,
|
|
493
|
-
Option,
|
|
494
|
-
IndicatorSeparator: () => null,
|
|
495
|
-
ClearIndicator,
|
|
496
|
-
}}
|
|
497
|
-
className='select-manage-page'
|
|
498
|
-
classNamePrefix='new-select'
|
|
499
|
-
name={'select-dropdown'}
|
|
500
|
-
onChange={setSelectedValue}
|
|
501
|
-
placeholder={placeHolder}
|
|
502
|
-
styles={stylesComp}
|
|
503
|
-
isMulti={true}
|
|
504
|
-
isDisabled={isDisabled}
|
|
505
|
-
hideSelectedOptions={false}
|
|
506
|
-
closeMenuOnSelect={false}
|
|
507
|
-
isSearchable={true}
|
|
508
|
-
isLoading={isLoading}
|
|
509
|
-
loadOptions={loadOptions}
|
|
510
|
-
defaultOptions
|
|
511
|
-
onInputChange={onInputChange}
|
|
512
|
-
id={id}
|
|
513
|
-
isClearable={isClearable}
|
|
514
|
-
{...props}
|
|
515
|
-
/>
|
|
516
|
-
) : (
|
|
517
|
-
<Select
|
|
518
|
-
components={{
|
|
519
|
-
DropdownIndicator,
|
|
520
|
-
ValueContainer: LeftIcon,
|
|
521
|
-
// ValueContainer,
|
|
522
|
-
IndicatorSeparator: () => null,
|
|
523
|
-
ClearIndicator,
|
|
524
|
-
}}
|
|
525
|
-
className='select-manage-page'
|
|
526
|
-
classNamePrefix='new-select'
|
|
527
|
-
name={'select-dropdown'}
|
|
528
|
-
options={optionArr}
|
|
529
|
-
placeholder={placeHolder}
|
|
530
|
-
isDisabled={isDisabled}
|
|
531
|
-
value={{
|
|
532
|
-
value: selectedValue ? selectedValue.value : '',
|
|
533
|
-
label: selectedValue ? selectedValue.label : '',
|
|
534
|
-
}}
|
|
535
|
-
styles={stylesComp}
|
|
536
|
-
onChange={setSelectedValue}
|
|
537
|
-
isLoading={isLoading}
|
|
538
|
-
id={id}
|
|
539
|
-
isClearable={isClearable}
|
|
540
|
-
{...props}
|
|
541
|
-
/>
|
|
542
|
-
)}
|
|
543
|
-
</Wrapper>
|
|
544
|
-
);
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
DropdownSelect.propTypes = {
|
|
548
|
-
/**
|
|
549
|
-
* Label of SelectBox
|
|
550
|
-
*/
|
|
551
|
-
label: PropTypes.string,
|
|
552
|
-
/**
|
|
553
|
-
* Label Style of SelectBox
|
|
554
|
-
*/
|
|
555
|
-
labelStyle: PropTypes.object,
|
|
556
|
-
/**
|
|
557
|
-
* SelectBox Options
|
|
558
|
-
*/
|
|
559
|
-
optionArr: PropTypes.array,
|
|
560
|
-
/**
|
|
561
|
-
* SelectBox Selected value. This is a array of object must be with this format:
|
|
562
|
-
[{
|
|
563
|
-
label:string,
|
|
564
|
-
value:string
|
|
565
|
-
}]
|
|
566
|
-
*/
|
|
567
|
-
selectedValue: PropTypes.object,
|
|
568
|
-
/**
|
|
569
|
-
* Function to set selected value
|
|
570
|
-
*/
|
|
571
|
-
setSelectedValue: PropTypes.func,
|
|
572
|
-
/**
|
|
573
|
-
* SelectBox Placeholder
|
|
574
|
-
*/
|
|
575
|
-
placeHolder: PropTypes.string,
|
|
576
|
-
/**
|
|
577
|
-
* SelectBox Placeholder's font size
|
|
578
|
-
*/
|
|
579
|
-
fontSize: PropTypes.number,
|
|
580
|
-
/**
|
|
581
|
-
* This Function will be called if cross button pressed
|
|
582
|
-
*/
|
|
583
|
-
clearSelected: PropTypes.func,
|
|
584
|
-
/**
|
|
585
|
-
* callback function to get value
|
|
586
|
-
*/
|
|
587
|
-
loadOptions: PropTypes.func,
|
|
588
|
-
/**
|
|
589
|
-
* onchange function
|
|
590
|
-
*/
|
|
591
|
-
onInputChange: PropTypes.func,
|
|
592
|
-
/**
|
|
593
|
-
* wrapper styles
|
|
594
|
-
*/
|
|
595
|
-
customWrapperStyles: PropTypes.object,
|
|
596
|
-
/**
|
|
597
|
-
* label styles
|
|
598
|
-
*/
|
|
599
|
-
customLabelStyles: PropTypes.object,
|
|
600
|
-
/**
|
|
601
|
-
* Mandatory or not
|
|
602
|
-
*/
|
|
603
|
-
isRequired: PropTypes.bool,
|
|
604
|
-
/**
|
|
605
|
-
* default dropdown type
|
|
606
|
-
*/
|
|
607
|
-
dropdownType: PropTypes.string,
|
|
608
|
-
/**
|
|
609
|
-
* disabled or not
|
|
610
|
-
*/
|
|
611
|
-
isDisabled: PropTypes.bool,
|
|
612
|
-
/**
|
|
613
|
-
* show loader or not
|
|
614
|
-
*/
|
|
615
|
-
isLoading: PropTypes.bool,
|
|
616
|
-
/**
|
|
617
|
-
* valid or not
|
|
618
|
-
*/
|
|
619
|
-
isValid: PropTypes.bool,
|
|
620
|
-
/**
|
|
621
|
-
* height of the component
|
|
622
|
-
*/
|
|
623
|
-
height: PropTypes.number,
|
|
624
|
-
/**
|
|
625
|
-
* clearable or not
|
|
626
|
-
*/
|
|
627
|
-
isClearable: PropTypes.bool,
|
|
628
|
-
/**
|
|
629
|
-
* id of the select
|
|
630
|
-
*/
|
|
631
|
-
id: PropTypes.string,
|
|
632
|
-
/**
|
|
633
|
-
* iconName of the select
|
|
634
|
-
*/
|
|
635
|
-
iconName: PropTypes.string,
|
|
636
|
-
/**
|
|
637
|
-
* iconColor of the select
|
|
638
|
-
*/
|
|
639
|
-
iconColor: PropTypes.string,
|
|
640
|
-
/**
|
|
641
|
-
* iconSize of the select
|
|
642
|
-
*/
|
|
643
|
-
iconSize: PropTypes.number,
|
|
644
|
-
/**
|
|
645
|
-
* leftIcon of the select
|
|
646
|
-
*/
|
|
647
|
-
leftIcon: PropTypes.string,
|
|
648
|
-
/**
|
|
649
|
-
* iconColor of the select
|
|
650
|
-
*/
|
|
651
|
-
leftIconColor: PropTypes.string,
|
|
652
|
-
/**
|
|
653
|
-
* iconSize of the select
|
|
654
|
-
*/
|
|
655
|
-
leftIconSize: PropTypes.number,
|
|
656
|
-
/**
|
|
657
|
-
* to show or hide indicator
|
|
658
|
-
*/
|
|
659
|
-
showIndicator: PropTypes.bool,
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
DropdownSelect.defaultProps = {
|
|
663
|
-
label: '',
|
|
664
|
-
labelStyle: {},
|
|
665
|
-
optionArr: [],
|
|
666
|
-
selectedValue: {},
|
|
667
|
-
setSelectedValue: undefined,
|
|
668
|
-
placeHolder: 'Select an option',
|
|
669
|
-
isValid: true,
|
|
670
|
-
isClearable: false,
|
|
671
|
-
height: 31,
|
|
672
|
-
fontSize: 14,
|
|
673
|
-
loadOptions: () => { },
|
|
674
|
-
onInputChange: () => { },
|
|
675
|
-
clearSelected: () => { },
|
|
676
|
-
customWrapperStyles: () => { },
|
|
677
|
-
customLabelStyles: () => { },
|
|
678
|
-
isRequired: false,
|
|
679
|
-
dropdownType: 'singleSelect',
|
|
680
|
-
isDisabled: false,
|
|
681
|
-
isLoading: false,
|
|
682
|
-
id: '',
|
|
683
|
-
iconName: 'triangle-down',
|
|
684
|
-
iconColor: 'black',
|
|
685
|
-
iconSize: 8,
|
|
686
|
-
leftIcon: '',
|
|
687
|
-
leftIconColor: 'black',
|
|
688
|
-
leftIconSize: 10,
|
|
689
|
-
showIndicator: true,
|
|
690
|
-
};
|