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