code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
getAriaActivedescendant() { const { isFocused, focusedItemIndex } = this.state; const { options } = this.props; const isOpen = isMenuOpen(options, isFocused); if (isOpen) { return `lookup-item-${focusedItemIndex}`; } return undefined; }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
getAriaActivedescendant
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleChange(value) { const { onChange } = this.props; setTimeout(() => this.containerRef.current.focus(), 0); this.setState({ searchValue: '', }); this.closeMenu(); onChange(value); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleChange
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleSearch(event) { const { value } = event.target; this.setState({ searchValue: value, }); this.fireSearch(value); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleSearch
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleFocus() { const { onFocus, value } = this.props; this.openMenu(); const eventValue = value || null; onFocus(eventValue); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleFocus
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleBlur() { const { onBlur, value } = this.props; this.closeMenu(); const eventValue = value || null; onBlur(eventValue); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleBlur
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleClick(event) { const { onClick } = this.props; this.openMenu(); return onClick(event); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleClick
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleRemoveValue() { const { onChange, onSearch } = this.props; onChange(null); onSearch(''); setTimeout(() => this.focus(), 0); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleRemoveValue
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
fireSearch(value) { const { onSearch, debounce } = this.props; if (debounce && value) { this.resetTimeout(); this.timeout = setTimeout(() => { onSearch(value); }, 500); } else { this.resetTimeout(); onSearch(value); ...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
fireSearch
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
clearInput() { const searchValue = ''; this.setState({ searchValue, }); this.fireSearch(searchValue); setTimeout(() => this.focus(), 0); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
clearInput
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
resetTimeout() { if (this.timeout) { clearTimeout(this.timeout); } }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
resetTimeout
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
openMenu() { return this.setState({ isFocused: true, }); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
openMenu
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
closeMenu() { const { options } = this.state; const { preferredSelectedOption } = this.props; return this.setState({ isFocused: false, isOpen: false, focusedItemIndex: getInitialFocusedIndex(options, preferredSelectedOption), }); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
closeMenu
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
isLookupOpen() { const { searchValue, isFocused } = this.state; const { options } = this.props; const isMenuEmpty = isFocused && !!searchValue && Array.isArray(options) && options.length === 0; const isOpen = isMenuOpen(options, isFocused); return isOpen || isMenuEmpt...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
isLookupOpen
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleHover(index) { this.setState({ focusedItemIndex: index, }); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleHover
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleKeyDown(event) { const { searchValue } = this.state; const { keyCode } = event; if (keyCode === ESCAPE_KEY) { if (searchValue) { event.stopPropagation(); } else if (this.isLookupOpen()) { event.stopPropagation(); this...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleKeyDown
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
stopArrowScoll() { if (this.scrollingTimer) { clearTimeout(this.scrollingTimer); } }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
stopArrowScoll
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
scrollTo(offset) { const menu = this.menuRef.current.getRef(); menu.scrollTo(0, offset); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
scrollTo
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
scrollBy(offset) { const menu = this.menuRef.current.getRef(); menu.scrollBy(0, offset); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
scrollBy
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleScrollUpArrowHover() { this.stopArrowScoll(); const menu = this.menuRef.current.getRef(); this.scrollingTimer = setTimeout(() => { if (menu.scrollTop > 0) { menu.scrollBy(0, -1); setTimeout(this.handleScrollUpArrowHover(), 5); } else...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleScrollUpArrowHover
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleScrollDownArrowHover() { this.stopArrowScoll(); const menu = this.menuRef.current.getRef(); this.scrollingTimer = setTimeout(() => { if (!isScrollPositionAtMenuBottom(menu)) { menu.scrollBy(0, 1); setTimeout(this.handleScrollDownArrowHover(), 5)...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleScrollDownArrowHover
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
updateScrollingArrows() { const menu = this.menuRef.current.getRef(); const showScrollUpArrow = menu.scrollTop > 0; const showScrollDownArrow = !isScrollPositionAtMenuBottom(menu); this.setState({ showScrollUpArrow, showScrollDownArrow, }); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
updateScrollingArrows
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleKeyUpPressed() { const { focusedItemIndex, options } = this.state; if (focusedItemIndex > 0) { const prevIndex = focusedItemIndex - 1; const prevFocusedIndex = options[prevIndex].type === 'header' ? focusedItemIndex - 2 : prevIndex; if (prevFocus...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleKeyUpPressed
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
scrollUp(prevFocusedIndex) { const { options } = this.state; const { size } = this.props; const menu = this.menuRef.current.getRef(); const prevIndex = prevFocusedIndex >= 0 ? prevFocusedIndex : 0; const prevFocusedOption = menu.childNodes[prevIndex]; const visibleOptions...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
scrollUp
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleKeyDownPressed() { const { focusedItemIndex, options } = this.state; const lastIndex = options.length - 1; if (focusedItemIndex < lastIndex) { const nextIndex = focusedItemIndex + 1; const nextFocusedIndex = options[nextIndex].type === 'header' ? foc...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleKeyDownPressed
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
scrollDown(nextFocusedIndex) { const { options } = this.state; const { size } = this.props; const menu = this.menuRef.current.getRef(); const nextFocusedOption = menu.childNodes[nextFocusedIndex]; const visibleOptionsAmount = visibleOptionsMap[size] || visibleOptionsMap.medium; ...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
scrollDown
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleKeyEnterPressed() { const { onChange } = this.props; const { focusedItemIndex } = this.state; const { options } = this.state; const value = options[focusedItemIndex]; this.containerRef.current.focus(); this.setState({ searchValue: '', }); ...
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleKeyEnterPressed
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
handleWindowScroll(event) { if (this.menuRef.current && this.menuRef.current.getRef().contains(event.target)) return; this.closeMenu(); }
A Lookup is an autocomplete text input that will search against a database object, it is enhanced by a panel of suggested options. @category Form
handleWindowScroll
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
render() { const { style, className, label, error, size, placeholder, disabled, readOnly, tabIndex, onClick, required, id, name, labelAlignment,...
Sets blur on the element. @public
render
javascript
nexxtway/react-rainbow
src/components/Lookup/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js
MIT
render() { const { value, disabled, readOnly, onClearValue, id, name, tabIndex, required, onClick, errorMessageId, error, borderRadius, } = this.props; ...
Sets blur on the element. @public
render
javascript
nexxtway/react-rainbow
src/components/Lookup/selectedValue.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/selectedValue.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Lookup page object. @constructor @param {string} rootElement - The selector of the Lookup root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async clickCloseButton() { await $(this.rootElement) .$('button[title="close"]') .click(); }
Clicks the close button element. @method
clickCloseButton
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async clickSelectedOptionInput() { await $(this.rootElement) .$('input[type="text"]') .parentElement() .click(); }
Clicks the input with a selected option. @method
clickSelectedOptionInput
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async clickRemoveSelectedOptionButton() { await $(this.rootElement) .$('button[title="Close"]') .click(); }
Clicks the remove selected option button. @method
clickRemoveSelectedOptionButton
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async hasFocusInput() { return $(this.rootElement) .$('input[type="search"]') .isFocused(); }
Returns true when the input element has focus. @method @returns {bool}
hasFocusInput
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async hasFocusSelectedOptionInput() { return $(this.rootElement) .$('input[type="text"]') .isFocused(); }
Returns true when the selected option input element has focus. @method @returns {bool}
hasFocusSelectedOptionInput
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async hasFocusRemoveSelectedOptionButton() { return $(this.rootElement) .$('button[title="Close"]') .isFocused(); }
Returns true when the remove selected option button has focus. @method @returns {bool}
hasFocusRemoveSelectedOptionButton
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async setQuery(value) { await $(this.rootElement) .$('input[type="search"]') .setValue(value); }
Type in the input element. @method @param {string} value - The value to type in the input element.
setQuery
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async getQuery() { return $(this.rootElement) .$('input[type="search"]') .getValue(); }
Get the value typed in the input element. @method @returns {string}
getQuery
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async getOptionsLength() { return (await $('[data-id="lookup-options-container"]').$$('li[role="presentation"]')) .length; }
Get the number of matched options. @method @returns {number}
getOptionsLength
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async getOption(itemPosition) { const items = await $('[data-id="lookup-options-container"]').$$('li[role="presentation"]'); if (items[itemPosition]) { return new PageLookupMenuItem(items[itemPosition]); } return null; }
Returns a new LookupMenuItem page object of the element in item position. @method @param {number} itemPosition - The base 0 index of the LookupMenuItem.
getOption
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async getSelectedOptionLabel() { const content = await $(this.rootElement).$('input[type="text"]'); if (content) { return content.getValue(); } return ''; }
Get the label of the selected option. @method @returns {string}
getSelectedOptionLabel
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async isMenuOpen() { return ( (await $(this.rootElement) .$('div[role="combobox"]') .getAttribute('aria-expanded')) === 'true' ); }
Returns true when the options menu is open, false otherwise. @method @returns {bool}
isMenuOpen
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async isMenuEmpty() { return $('[data-id="lookup-options-empty-container"]').isDisplayed(); }
Returns true when the empty message is displayed, false otherwise. @method @returns {bool}
isMenuEmpty
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async waitUntilOpen() { await browser.waitUntil(async () => this.isMenuOpen()); }
Wait until the options menu is open. @method
waitUntilOpen
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async hoverScrollUpArrow() { const upArrow = await $('[data-id="lookup-options-container"]').$( '[data-id=lookup-arrow-button-up]', ); await upArrow.scrollIntoView(); return upArrow.moveTo(); }
It moves the pointer over the menu scroll up arrow @method
hoverScrollUpArrow
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async mouseLeaveScrollUpArrow() { return (await $(this.rootElement).$('input[type="text"]')).moveTo(); }
It moves the pointer out of the menu scroll up arrow @method
mouseLeaveScrollUpArrow
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async hoverScrollDownArrow() { const downArrow = await $('[data-id="lookup-options-container"]').$( '[data-id="lookup-arrow-button-down"]', ); await downArrow.scrollIntoView(); return downArrow.moveTo(); }
It moves the pointer over the menu scroll down arrow @method
hoverScrollDownArrow
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async mouseLeaveScrollDownArrow() { return (await $(this.rootElement).$('input[type="text"]')).moveTo(); }
It moves the pointer out of the menu scroll down arrow @method
mouseLeaveScrollDownArrow
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async arrowDownExists() { return (await $('[data-id="lookup-options-container"]').$( '[data-id="lookup-arrow-button-down"]', )).isExisting(); }
Returns true when the the arrow to scroll down exits, false otherwise. @method @returns {bool}
arrowDownExists
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
async arrowUpExists() { return (await $('[data-id="lookup-options-container"]').$( '[data-id="lookup-arrow-button-up"]', )).isExisting(); }
Returns true when the the arrow to scroll down exits, false otherwise. @method @returns {bool}
arrowUpExists
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new LookupMenuItem page object. @constructor @param {string} rootElement - The selector of the LookupMenuItem root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/menuItem.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/menuItem.js
MIT
async hover() { const itemElement = await this.rootElement.$('div[role="option"]'); await itemElement.scrollIntoView(); await itemElement.moveTo(); }
It moves the pointer over the menu item. @method
hover
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/menuItem.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/menuItem.js
MIT
async isActive() { return ( (await this.rootElement.$('[role="option"]').getAttribute('aria-selected')) === 'true' ); }
Returns true when the menu item is active. @method @returns {bool}
isActive
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/menuItem.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/menuItem.js
MIT
async isVisible() { return this.rootElement.isDisplayedInViewport(); }
Returns true when the menu item is visible inside the menu container. @method @returns {bool}
isVisible
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/menuItem.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/menuItem.js
MIT
async waitUntilIsVisible() { await browser.waitUntil(async () => this.isVisible()); }
Wait until the option is visible. @method
waitUntilIsVisible
javascript
nexxtway/react-rainbow
src/components/Lookup/pageObject/menuItem.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/pageObject/menuItem.js
MIT
function MapMarker(props) { // eslint-disable-next-line react/jsx-props-no-spreading return <Consumer>{context => <Marker {...props} {...context} />}</Consumer>; }
The MapMarker component is a single section of information that is nested in the GMap component. This component shows you the detailed information of each location that is displayed in the GMap.
MapMarker
javascript
nexxtway/react-rainbow
src/components/MapMarker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MapMarker/index.js
MIT
function MarkdownOutput(props) { const { id, className, style, value, variant } = props; const renderer = variant === 'inline' ? inlineRenderer : defaultRenderer; const result = useMarkdownToReact(value, renderer); return ( <StyledContainer id={id} className={className} style={style} variant={va...
MarkdownOutput renders Markdown text in browser. It is based on highlight.js, to customize the code blocks you can use highlight.js themes. @category Form
MarkdownOutput
javascript
nexxtway/react-rainbow
src/components/MarkdownOutput/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MarkdownOutput/index.js
MIT
function MenuDivider(props) { const { variant, className, style } = props; return <StyledDivider className={className} style={style} variant={variant} role="separator" />; }
The MenuDivider are used for separate content inside the ButtonMenu.
MenuDivider
javascript
nexxtway/react-rainbow
src/components/MenuDivider/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MenuDivider/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new MenuItem page object. @constructor @param {string} rootElement - The selector of the MenuItem root element.
constructor
javascript
nexxtway/react-rainbow
src/components/MenuItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MenuItem/pageObject/index.js
MIT
hasFocus() { return this.rootElement.isFocused(); }
Returns true when the menu item has focus. @method @returns {bool}
hasFocus
javascript
nexxtway/react-rainbow
src/components/MenuItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MenuItem/pageObject/index.js
MIT
async hover() { await this.rootElement.moveTo(); }
It moves the pointer over the menu item. @method
hover
javascript
nexxtway/react-rainbow
src/components/MenuItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MenuItem/pageObject/index.js
MIT
getLabelText() { return this.rootElement.getText(); }
Returns the label text of the menu item. @method @returns {string}
getLabelText
javascript
nexxtway/react-rainbow
src/components/MenuItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MenuItem/pageObject/index.js
MIT
constructor(props) { super(props); this.containerRef = React.createRef(); this.buttonRef = React.createRef(); this.modalRef = React.createRef(); this.contentRef = React.createRef(); this.modalHeadingId = uniqueId('modal-heading'); this.modalContentId = uniqueId('m...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
constructor
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
componentDidMount() { const { isOpen } = this.props; if (isOpen) { this.contentElement = this.contentRef.current; CounterManager.increment(); disableBodyScroll(this.contentRef.current); this.modalTriggerElement = document.activeElement; this.mo...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
componentDidMount
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
componentDidUpdate(prevProps) { const { isOpen, onOpened } = this.props; const { isOpen: prevIsOpen } = prevProps; const wasOpened = isOpen && !prevIsOpen; const wasClosed = !isOpen && prevIsOpen; if (wasOpened) { CounterManager.increment(); this.content...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
componentDidUpdate
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
componentWillUnmount() { const { isOpen } = this.props; if (isOpen) { CounterManager.decrement(); } if (!CounterManager.hasModalsOpen()) { enableBodyScroll(this.contentElement); clearAllBodyScrollLocks(); } this.removeBackdropClickListe...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
componentWillUnmount
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
handleKeyPressed(event) { event.stopPropagation(); const { isOpen } = this.props; if ( isOpen && event.keyCode === ESCAPE_KEY && this.containerRef.current.contains(event.target) ) { this.closeModal(); } if (event.keyCode ===...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
handleKeyPressed
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
handleClick(event) { const { isOpen } = this.props; if (isOpen) { const isClickOutsideModal = !this.modalRef.current.contains(event.target); if (isClickOutsideModal) { return this.closeModal(); } } return null; }
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
handleClick
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
closeModal() { const { onRequestClose } = this.props; return onRequestClose(); }
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
closeModal
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
addBackdropClickListener() { const node = this.containerRef.current; if (node) { node.addEventListener('click', this.handleClick); } }
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
addBackdropClickListener
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
removeBackdropClickListener() { const node = this.containerRef.current; if (node) { node.removeEventListener('click', this.handleClick); } }
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
removeBackdropClickListener
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
render() { const { title, style, className, children, footer, isOpen, id, size, hideCloseButton, borderRadius, } = this.props; if (isOpen) { return createPortal( ...
Modals are used to display content in a layer above the app. This is used in cases such as the creation or editing of a record, as well as various types of messaging. @category Layout
render
javascript
nexxtway/react-rainbow
src/components/Modal/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Modal page object. @constructor @param {string} rootElement - The selector of the Modal root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
async clickCloseButton() { await browser.waitUntil(async () => $(this.rootElement) .$('[id="modal-close-button"]') .isDisplayed(), ); await $(this.rootElement) .$('[id="modal-close-button"]') .click(); }
Clicks the close button element. @method
clickCloseButton
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
async isOpen() { if (await $(this.rootElement).isDisplayed()) { return ( (await $(this.rootElement) .$('section[role="dialog"]') .isDisplayed()) && (await $(this.rootElement) .$('[id="modal-close-button"]') ...
Returns true when the modal is open, false otherwise. @method @returns {bool}
isOpen
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
async hasFocusCloseButton() { return (await $(this.rootElement).$('[id="modal-close-button"]')).isFocused(); }
Returns true when the closeButton has focus. @method @returns {bool}
hasFocusCloseButton
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
async waitUntilOpen() { await browser.waitUntil(async () => await this.isOpen()); }
Wait until the open modal transition has finished. @method
waitUntilOpen
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
async waitUntilClose() { await browser.waitUntil(async () => !(await this.isOpen())); }
Wait until the close modal transition has finished. @method
waitUntilClose
javascript
nexxtway/react-rainbow
src/components/Modal/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Modal/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new PageMonthlyCalendar page object. @constructor @param {string} rootElement - The selector of the PageMonthlyCalendar root element.
constructor
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async clickPrevMonthButton() { await $(this.rootElement) .$$('button[data-id=button-icon-element]')[0] .click(); }
Clicks the previous month button element. @method
clickPrevMonthButton
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async clickNextMonthButton() { await $(this.rootElement) .$$('button[data-id=button-icon-element]')[1] .click(); }
Clicks the next month button element. @method
clickNextMonthButton
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async clickSelectYear() { await $(this.rootElement) .$('select') .click(); }
Clicks the select year element. @method
clickSelectYear
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async getSelectedMonth() { return $(this.rootElement) .$('h3[data-id=month]') .getText(); }
Returns the text of the current selected month element. @method @returns {string}
getSelectedMonth
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async getSelectedYear() { return $(this.rootElement) .$('select') .getValue(); }
Returns the value of the select year element. @method @returns {string}
getSelectedYear
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async setYear(value) { await $(this.rootElement) .$('select') .selectByVisibleText(value); }
Set the value of the year select element @method @param {string}
setYear
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async isPrevMonthButtonDisabled() { const buttonEl = (await $(this.rootElement).$$('button[data-id=button-icon-element]'))[0]; return !(await buttonEl.isEnabled()); }
Returns true when the previous month button element is disabled. @method @returns {bool}
isPrevMonthButtonDisabled
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
async isNextMonthButtonDisabled() { const buttonEl = (await $(this.rootElement).$$('button[data-id=button-icon-element]'))[1]; return !(await buttonEl.isEnabled()); }
Returns true when the next month button element is disabled. @method @returns {bool}
isNextMonthButtonDisabled
javascript
nexxtway/react-rainbow
src/components/MonthlyCalendar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MonthlyCalendar/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new MultiSelect page object. @constructor @param {string} rootElement - The selector of the MultiSelect root element.
constructor
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
async isMenuOpen() { return ( (await $(this.rootElement) .$('div[role="combobox"]') .getAttribute('aria-expanded')) === 'true' ); }
Returns true when the options menu is open, false otherwise. @method @returns {bool}
isMenuOpen
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
async hasTriggerFocus() { return (await $(this.rootElement).$('[role="combobox"] > button')).isFocused(); }
Returns true when the Add button has focus. @method @returns {bool}
hasTriggerFocus
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
async hasInputFocus() { return (await $(this.rootElement).$('[role="textbox"]')).isFocused(); }
Returns true when the textbox input element has focus. @method @returns {bool}
hasInputFocus
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
async getOption(optionIndex) { return (await this[privateGetMenu]()).getOption(optionIndex); }
Returns a new Option page object of the element in item position. @method @param {number} optionIndex - The base 0 index of the Option.
getOption
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
async waitUntilOpen() { await browser.waitUntil(async () => this.isMenuOpen()); }
Wait until the dropdown is open. @method
waitUntilOpen
javascript
nexxtway/react-rainbow
src/components/MultiSelect/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/MultiSelect/pageObject/index.js
MIT
function Notification(props) { const { className, style, icon, title, description, onRequestClose, hideCloseButton } = props; return ( <StyledContainer className={className} style={style}> <StyledAnchor> <RenderIf isTrue={icon}> <Icon icon={icon} /> ...
Notifications serve as a confirmation mechanism & feedback that comes into the page at the top.
Notification
javascript
nexxtway/react-rainbow
src/components/Notification/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Notification/index.js
MIT
function Option(props) { // eslint-disable-next-line react/jsx-props-no-spreading return <Consumer>{values => <OptionItem {...props} {...values} />}</Consumer>; }
This component represents a dropdown list with different options. It allows a user to select one among multiple options. @category Form
Option
javascript
nexxtway/react-rainbow
src/components/Option/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/index.js
MIT
constructor(rootElement, containerRect) { this.rootElement = rootElement; this.containerRect = containerRect; }
Create a new Option page object. @constructor @param {string} rootElement - The selector of the Option root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Option/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/pageObject/index.js
MIT
async hover() { const itemElement = await this.rootElement.$('div[role="option"]'); await itemElement.scrollIntoView(); await itemElement.moveTo(); }
It moves the pointer over the Option @method
hover
javascript
nexxtway/react-rainbow
src/components/Option/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/pageObject/index.js
MIT
async getLabel() { return (await this.rootElement.$('div[role="option"]')).getText(); }
Get the label of the Option. @method @returns {string}
getLabel
javascript
nexxtway/react-rainbow
src/components/Option/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/pageObject/index.js
MIT
async isActive() { return (await this.rootElement.$('div[aria-selected="true"]')).isExisting(); }
Returns true when the Option is active. @method @returns {bool}
isActive
javascript
nexxtway/react-rainbow
src/components/Option/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/pageObject/index.js
MIT
async isSelected() { return (await this.rootElement.getAttribute('data-selected')) === 'true'; }
Returns true when the Option is selected. @method @returns {bool}
isSelected
javascript
nexxtway/react-rainbow
src/components/Option/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Option/pageObject/index.js
MIT