1
1
/* eslint-disable no-labels */
2
- import { useState , useEffect , useRef } from 'react'
2
+ import React , { useState , useEffect , useRef } from 'react'
3
3
import Chip from './Chip.jsx'
4
4
import CloseIcon from './CloseIcon.jsx'
5
5
import DownIcon from './DownIcon.jsx'
@@ -20,9 +20,9 @@ MultiSelect.defaultProps = {
20
20
limit : null ,
21
21
emptyDataLabel : 'No Data Found' ,
22
22
placeholder : 'Select...' ,
23
- onChange : ( ) => { } ,
24
- onMenuOpen : ( ) => { } ,
25
- onMenuClose : ( ) => { } ,
23
+ onChange : ( ) => { } ,
24
+ onMenuOpen : ( ) => { } ,
25
+ onMenuClose : ( ) => { } ,
26
26
options : [
27
27
{
28
28
label : 'Empty' ,
@@ -73,9 +73,8 @@ function MultiSelect({
73
73
onClickOutside : onMenuClose
74
74
} )
75
75
76
- const calculatedWidth = `calc(100% - ${
77
- clearable && downArrow ? 60 : downArrow || clearable ? 40 : 5
78
- } px)`
76
+ const calculatedWidth = `calc(100% - ${ clearable && downArrow ? 60 : downArrow || clearable ? 40 : 5
77
+ } px)`
79
78
80
79
const getValueObjFromOptios = ( defaultValue , options ) => {
81
80
if ( ! defaultValue ) return [ ]
@@ -401,9 +400,8 @@ function MultiSelect({
401
400
tabIndex = '0'
402
401
onKeyPress = { openMenu }
403
402
style = { { ...style } }
404
- className = { `msl-wrp msl-vars ${ className } ${
405
- disabled ? 'msl-disabled' : ''
406
- } `}
403
+ className = { `msl-wrp msl-vars ${ className } ${ disabled ? 'msl-disabled' : ''
404
+ } `}
407
405
>
408
406
< input name = { name } type = 'hidden' value = { value ?. map ( ( itm ) => itm . value ) } />
409
407
< div data-msl className = { `msl ${ menuOpen && getActiveClass ( ) } ` } >
@@ -507,12 +505,12 @@ function MultiSelect({
507
505
} }
508
506
/>
509
507
) : (
510
- ( ( search && ! search . length ) || ( options && ! options . length ) ) && (
511
- < option className = 'msl-option msl-option-disable' >
512
- { emptyDataLabel }
513
- </ option >
514
- )
515
- ) }
508
+ ( ( search && ! search . length ) || ( options && ! options . length ) ) && (
509
+ < option className = 'msl-option msl-option-disable' >
510
+ { emptyDataLabel }
511
+ </ option >
512
+ )
513
+ ) }
516
514
</ div >
517
515
</ div >
518
516
)
0 commit comments