forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(DualList): Add item disability functionality. (patternfly#1071)
- Loading branch information
1 parent
1430bda
commit ddc0e8e
Showing
8 changed files
with
137 additions
and
42 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
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
29 changes: 29 additions & 0 deletions
29
...nfly-3/patternfly-react/src/components/DualListSelector/components/DualListItemTooltip.js
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { OverlayTrigger, Tooltip } from '../../../index'; | ||
|
||
const DualListItemTooltip = ({ id, text, children }) => { | ||
const tooltip = <Tooltip id={id}>{text}</Tooltip>; | ||
return ( | ||
<OverlayTrigger overlay={tooltip} placement="top" trigger={['hover', 'focus']} delayShow={150}> | ||
{children} | ||
</OverlayTrigger> | ||
); | ||
}; | ||
|
||
DualListItemTooltip.propTypes = { | ||
/** unique tooltip ID */ | ||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
/** text to be shown on the tooltip */ | ||
text: PropTypes.string, | ||
/** children nodes */ | ||
children: PropTypes.node | ||
}; | ||
|
||
DualListItemTooltip.defaultProps = { | ||
id: null, | ||
text: null, | ||
children: null | ||
}; | ||
|
||
export default DualListItemTooltip; |
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