-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish Combobox - MegaMenu classnames
- Loading branch information
Showing
13 changed files
with
466 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,62 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
import { Popover } from '../Popover/Popover'; | ||
|
||
// ------------------------------------------- Combobox Input ------------------------------------------ | ||
export const ComboboxInput = ({ placeholder, menu, compact, className, ...props }) => { | ||
return ( | ||
<div className={`fd-combobox-input${className ? ' ' + className : ''}`} {...props}> | ||
<Popover | ||
noArrow | ||
control={ | ||
<div className='fd-combobox-control'> | ||
<div | ||
className={`fd-input-group fd-input-group--after${ | ||
compact ? ' fd-input-group--compact' : '' | ||
}`}> | ||
<input | ||
type='text' | ||
className={`fd-input${compact ? ' fd-input--compact' : ''}`} | ||
id='' | ||
placeholder={placeholder} /> | ||
<span className='fd-input-group__addon fd-input-group__addon--after fd-input-group__addon--button'> | ||
<button className=' fd-button--light sap-icon--navigation-down-arrow' /> | ||
</span> | ||
</div> | ||
</div> | ||
const comboboxInputClasses = classnames( | ||
'fd-combobox-input', | ||
className | ||
); | ||
|
||
const popoverClasses = classnames( | ||
'fd-input-group', | ||
'fd-input-group--after', | ||
{ | ||
'fd-input-group--compact': compact | ||
} | ||
); | ||
|
||
const popoverInputClasses = classnames( | ||
'fd-input', | ||
{ | ||
'fd-input--compact': compact | ||
} | ||
body={menu} /> | ||
</div> | ||
); | ||
); | ||
|
||
return ( | ||
<div className={comboboxInputClasses} {...props}> | ||
<Popover | ||
noArrow | ||
control={ | ||
<div className='fd-combobox-control'> | ||
<div | ||
className={popoverClasses}> | ||
<input | ||
type='text' | ||
className={popoverInputClasses} | ||
id='' | ||
placeholder={placeholder} /> | ||
<span className='fd-input-group__addon fd-input-group__addon--after fd-input-group__addon--button'> | ||
<button className=' fd-button--light sap-icon--navigation-down-arrow' /> | ||
</span> | ||
</div> | ||
</div> | ||
} | ||
body={menu} /> | ||
</div> | ||
); | ||
}; | ||
|
||
ComboboxInput.propTypes = { | ||
menu: PropTypes.object.isRequired, | ||
className: PropTypes.string, | ||
compact: PropTypes.bool, | ||
placeholder: PropTypes.string | ||
menu: PropTypes.object.isRequired, | ||
className: PropTypes.string, | ||
compact: PropTypes.bool, | ||
placeholder: PropTypes.string | ||
}; | ||
|
||
ComboboxInput.defaultTypes = { | ||
compact: false, | ||
placeholder: '' | ||
compact: false, | ||
placeholder: '' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.