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
ShowIf = ({ id, className, style, isTrue, inAnimation, outAnimation, children }) => { const [animation, setAnimation] = useState(); const [isVisible, setIsVisible] = useState(isTrue); const [dimensions, setDimensions] = useState(); const ref = useRef(); useLayoutEffect(() => { if (isTrue) {...
A component that shows its contents when a condition is met. Works similar to `RenderIf`, but `ShowIf` does not remove the elements from the DOM, and animates the content in and out.
ShowIf
javascript
nexxtway/react-rainbow
src/components/ShowIf/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/ShowIf/index.js
MIT
handleAnimationEnd = event => { if (event.animationName.includes('Out')) { setIsVisible(false); } }
A component that shows its contents when a condition is met. Works similar to `RenderIf`, but `ShowIf` does not remove the elements from the DOM, and animates the content in and out.
handleAnimationEnd
javascript
nexxtway/react-rainbow
src/components/ShowIf/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/ShowIf/index.js
MIT
handleAnimationEnd = event => { if (event.animationName.includes('Out')) { setIsVisible(false); } }
A component that shows its contents when a condition is met. Works similar to `RenderIf`, but `ShowIf` does not remove the elements from the DOM, and animates the content in and out.
handleAnimationEnd
javascript
nexxtway/react-rainbow
src/components/ShowIf/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/ShowIf/index.js
MIT
function Sidebar(props) { const { ariaLabel, style, selectedItem, onSelect, className, children, id, hideSelectedItemIndicator, } = props; const context = { selectedItem, onSelect, hideSelectedItemIndicator, }; ...
The Sidebar component is a vertical bar that holds a list of SidebarItems. It helps users to jump from one site section to another without re-rendering the entire content on the page. Note that you have to compose the Sidebar with the SidebarItem component. @category Layout
Sidebar
javascript
nexxtway/react-rainbow
src/components/Sidebar/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Sidebar/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Sidebar page object @constructor @param {string} rootElement - The selector if the Sidebar root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Sidebar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Sidebar/pageObject/index.js
MIT
async getItem(itemPosition) { const items = await $(this.rootElement).$$('li[data-id="sidebar-item-li"]'); if (items[itemPosition]) { return new PageSidebarItem( `${this.rootElement} li[data-id="sidebar-item-li"]:nth-child(${itemPosition + 1})`, ); } ...
Return a new SidebarItem page object of the element in item position. @method @param {number} itemPosition - The base 0 index of the sidebar item
getItem
javascript
nexxtway/react-rainbow
src/components/Sidebar/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Sidebar/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new SidebarItem page object. @constructor @param {string} rootElement - The selector of the SidebarItem root element.
constructor
javascript
nexxtway/react-rainbow
src/components/SidebarItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/SidebarItem/pageObject/index.js
MIT
async isActive() { return $(this.rootElement) .$('[aria-current="page"]') .isExisting(); }
Return true when the sidebar item is active @method @returns {bool}
isActive
javascript
nexxtway/react-rainbow
src/components/SidebarItem/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/SidebarItem/pageObject/index.js
MIT
constructor(props) { super(props); this.sliderId = uniqueId('slider-id'); this.errorMessageId = uniqueId('error-message'); this.sliderRef = React.createRef(); }
An input range slider lets the user specify a numeric value which must be between two specified values. @category Form
constructor
javascript
nexxtway/react-rainbow
src/components/Slider/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Slider/index.js
MIT
getAriaDescribedBy() { const { error } = this.props; if (error) { return this.errorMessageId; } return undefined; }
An input range slider lets the user specify a numeric value which must be between two specified values. @category Form
getAriaDescribedBy
javascript
nexxtway/react-rainbow
src/components/Slider/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Slider/index.js
MIT
render() { const { label, value, name, min, max, step, error, disabled, onBlur, onChange, onClick, onFocus, style, className, labelA...
Sets blur on the element. @public
render
javascript
nexxtway/react-rainbow
src/components/Slider/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Slider/index.js
MIT
function Spinner(props) { const { className, style, assistiveText, isVisible, size, variant, type, children } = props; const currentSize = getSizeValue(size); if (isVisible) { if (type === 'arc') { return ( <StyledSpinnerContainer className={className} style={style}> ...
Spinners should be shown when retrieving data or performing slow, help to reassure the user that the system is actively retrieving data.
Spinner
javascript
nexxtway/react-rainbow
src/components/Spinner/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Spinner/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new StrongPasswordInput page object. @constructor @param {string} rootElement - The selector of the StrongPasswordInput root element.
constructor
javascript
nexxtway/react-rainbow
src/components/StrongPasswordInput/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/StrongPasswordInput/pageObject/index.js
MIT
async hasFocusInput() { return $(this.rootElement) .$('input') .isFocused(); }
Returns true when the input element has focus. @method @returns {bool}
hasFocusInput
javascript
nexxtway/react-rainbow
src/components/StrongPasswordInput/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/StrongPasswordInput/pageObject/index.js
MIT
async setValue(value) { await $(this.rootElement) .$('input') .setValue(value); }
Type in the input element. @method @param {string} value - The value to type in the input element.
setValue
javascript
nexxtway/react-rainbow
src/components/StrongPasswordInput/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/StrongPasswordInput/pageObject/index.js
MIT
async getValue() { return $(this.rootElement) .$('input') .getValue(); }
Get the value typed in the input element. @method @returns {string}
getValue
javascript
nexxtway/react-rainbow
src/components/StrongPasswordInput/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/StrongPasswordInput/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Tab page object. @constructor @param {string} rootElement - The selector of the Tab root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Tab/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tab/pageObject/index.js
MIT
async hasFocus() { return $(this.rootElement) .$('button[role="tab"]') .isFocused(); }
Returns true when the tab item has focus. @method @returns {bool}
hasFocus
javascript
nexxtway/react-rainbow
src/components/Tab/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tab/pageObject/index.js
MIT
async isSelected() { return !!(await $(this.rootElement) .$('button[role="tab"]') .getAttribute('data-active')); }
Returns true when the tab item is selected. @method @returns {bool}
isSelected
javascript
nexxtway/react-rainbow
src/components/Tab/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tab/pageObject/index.js
MIT
async isVisibleWithinViewport() { return $(this.rootElement) .$('button[role="tab"]') .isDisplayedInViewport(); }
Returns true when the tab item is visible in the viewport. @method @returns {bool}
isVisibleWithinViewport
javascript
nexxtway/react-rainbow
src/components/Tab/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tab/pageObject/index.js
MIT
async getLabelText() { return $(this.rootElement).getText(); }
Returns the text of the tab item. @method @returns {string}
getLabelText
javascript
nexxtway/react-rainbow
src/components/Tab/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tab/pageObject/index.js
MIT
constructor(props) { super(props); const { children, showCheckboxColumn, keyField, data, showRowNumberColumn, rowNumberOffset, maxRowSelection, minColumnWidth, maxColumnWidth, selected...
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
constructor
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
componentDidMount() { this.widthObserver = new ResizeSensor( this.resizeTarget.current, debounce(this.updateColumnsAndTableWidth, 200), ); this.updateRows(); this.updateColumnsAndTableWidth(); }
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
componentDidMount
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
componentDidUpdate(prevProps) { const { children: prevChildren, showCheckboxColumn: prevShowCheckboxColumn, maxRowSelection: prevMaxRowSelection, selectedRows: prevSelectedRows, data: prevData, minColumnWidth: prevMinColumnWidth, ...
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
componentDidUpdate
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
getTableWidthFromDom() { const containerElement = this.tableContainerRef.current; if (containerElement) { return containerElement.offsetWidth; } return 0; }
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
getTableWidthFromDom
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
getSelectedRows(rows) { const { data } = this.props; return normalizeData(data).filter((item, index) => rows[index].isSelected); }
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
getSelectedRows
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
getMaxRowSelection() { const { maxRowSelection, data } = this.props; const rowsLength = normalizeData(data).length; const maxRowSelectionNumber = Number(maxRowSelection); if (!isValidMaxRowSelection(maxRowSelection, rowsLength)) { return rowsLength; } return ...
A table lists a collection of data that makes sense when displays them in rows and columns. The data contained in a table is easier to read due to the format, so it can be useful to sort, search, and filter your data. @category DataView
getMaxRowSelection
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
scrollTop() { this.scrollableY.current.scrollTop = 0; }
It will scroll to the top of the Y scrollable container. @public
scrollTop
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
updateRows() { const { keyField, selectedRows, onRowSelection, data } = this.props; const maxRowSelection = this.getMaxRowSelection(); const newRows = getRows({ keyField, rows: normalizeData(data), maxRowSelection, selectedRowsKeys: this.selectedRo...
It will scroll to the top of the Y scrollable container. @public
updateRows
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
updateColumnsAndTableWidth(newColumns) { const { columns } = this.state; const { minColumnWidth, maxColumnWidth } = this.props; const domTableWidth = this.getTableWidthFromDom(); const minColWidth = Number(minColumnWidth) || 50; const maxColWidth = Number(maxColumnWidth) || Infin...
It will scroll to the top of the Y scrollable container. @public
updateColumnsAndTableWidth
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleSelectAllRows() { const { onRowSelection } = this.props; const { rows } = this.state; const maxRowSelection = this.getMaxRowSelection(); this.selectedRowsKeys = {}; const updatedRows = getUpdatedRowsWhenSelectAll({ rows, maxRowSelection, ...
It will scroll to the top of the Y scrollable container. @public
handleSelectAllRows
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleDeselectAllRows() { const { onRowSelection } = this.props; const { rows } = this.state; this.selectedRowsKeys = {}; const updatedRows = getUpdatedRowsWhenDeselectAll(rows); const bulkSelection = getBulkSelectionState({ maxRowSelection: this.getMaxRowSelection()...
It will scroll to the top of the Y scrollable container. @public
handleDeselectAllRows
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleSelectRow(event, isMultiple, rowKeyValue) { const { onRowSelection } = this.props; const { indexes } = this; const { rows } = this.state; const maxRowSelection = this.getMaxRowSelection(); if (maxRowSelection > 1) { const updatedRows = getUpdatedRowsWhenSelect(...
It will scroll to the top of the Y scrollable container. @public
handleSelectRow
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleDeselectRow(event, isMultiple, rowKeyValue) { const { onRowSelection } = this.props; const { indexes } = this; const { rows } = this.state; const maxRowSelection = this.getMaxRowSelection(); const updatedRows = getUpdatedRowsWhenDeselect({ maxRowSelection, ...
It will scroll to the top of the Y scrollable container. @public
handleDeselectRow
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
hasFlexibleColumns() { const { columns } = this.state; return columns.some(column => column.isResized !== true); }
It will scroll to the top of the Y scrollable container. @public
hasFlexibleColumns
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleResize(widthDelta, colIndex) { const { columns, tableWidth } = this.state; if (widthDelta !== 0) { this.setState({ columns: getResizedColumns({ columns, colIndex, widthDelta }), tableWidth: tableWidth + widthDelta, }); } }
It will scroll to the top of the Y scrollable container. @public
handleResize
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
handleSort(event, field, sortDirection) { const { onSort, sortedBy } = this.props; const nextSortDirection = getNextSortDirection(field, sortedBy, sortDirection); onSort(event, field, nextSortDirection); }
It will scroll to the top of the Y scrollable container. @public
handleSort
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
render() { const { id, data, sortedBy, sortDirection, defaultSortDirection, resizeColumnDisabled, rowNumberOffset, minColumnWidth, maxColumnWidth, style, className, isL...
It will scroll to the top of the Y scrollable container. @public
render
javascript
nexxtway/react-rainbow
src/components/Table/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Table page object. @constructor @param {string} rootElement - The selector of the Table root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/index.js
MIT
async selectAllRows() { const headCheckbox = await $(this.rootElement) .$('thead') .$(HEAD_CHECKBOX_INPUT_SELECTOR); if ( !(await headCheckbox.isSelected()) && !(await headCheckbox.getAttribute('indeterminate')) ) { await $(this.rootEle...
Clicks the head checkbox to select the maximum selectable rows. @method
selectAllRows
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/index.js
MIT
async deselectAllRows() { const headCheckbox = await $(this.rootElement) .$('thead') .$(HEAD_CHECKBOX_INPUT_SELECTOR); if ( (await headCheckbox.isSelected()) || (await headCheckbox.getAttribute('indeterminate')) ) { await $(this.rootEle...
Clicks the head checkbox to deselect all selected rows. @method
deselectAllRows
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/index.js
MIT
async getRow(rowPosition) { const rows = await $(this.rootElement).$$('tbody > tr[data-id="table_body-row"]'); if (rows[rowPosition]) { return new PageTableRow( `${this.rootElement} tr[data-id="table_body-row"]:nth-child(${rowPosition + 1})`, ); } ...
Returns a new Row page object of the row in the position passed. @method @param {number} rowPosition - The base 0 index of the row item.
getRow
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/index.js
MIT
async waitUntilDataIsLoaded() { await browser.waitUntil( async () => !(await $(this.rootElement) .$('div[data-id="table_body--loading"]') .isDisplayed()) && (await $(this.rootElement) .$('tr[data-id="table_bo...
Wait until the data is loaded. @method
waitUntilDataIsLoaded
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Row page object. @constructor @param {string} rootElement - The selector of the Row root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/row.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/row.js
MIT
async selectRow() { if (!(await this.isRowSelected())) { await $(this.rootElement) .$(CHECKBOX_LABEL_SELECTOR) .click(); } }
Clicks the row to select. @method
selectRow
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/row.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/row.js
MIT
async deselectRow() { if (await this.isRowSelected()) { await $(this.rootElement) .$(CHECKBOX_LABEL_SELECTOR) .click(); } }
Clicks the row to select. @method
deselectRow
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/row.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/row.js
MIT
async isRowSelected() { return $(this.rootElement) .$(CHECKBOX_INPUT_SELECTOR) .isSelected(); }
Returns true when the row is selected. @method @returns {bool}
isRowSelected
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/row.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/row.js
MIT
async isRowSelectionDisabled() { return !(await $(this.rootElement) .$(CHECKBOX_INPUT_SELECTOR) .isEnabled()); }
Returns true when the row input is disabled. @method @returns {bool}
isRowSelectionDisabled
javascript
nexxtway/react-rainbow
src/components/Table/pageObject/row.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Table/pageObject/row.js
MIT
constructor(props) { super(props); const { data, pageSize } = props; this.state = { activePage: 1, pageItems: getPageItems({ data, activePage: 1, pageSize, }), }; this.handleChange = this.handleCh...
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
constructor
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
componentDidUpdate(prevProps) { const { data, pageSize } = this.props; if (prevProps.data !== data || prevProps.pageSize !== pageSize) { this.updateData(); } }
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
componentDidUpdate
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
updateData() { const { data, pageSize } = this.props; const { activePage } = this.state; const totalPages = Math.ceil(data.length / pageSize); const nextActivePage = activePage <= totalPages ? activePage : 1; this.setState({ activePage: nextActivePage, pag...
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
updateData
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
moveToPage(page) { const { data, pageSize } = this.props; this.setState({ activePage: page, pageItems: getPageItems({ data, activePage: page, pageSize, }), }); this.table.current.scrollTop(); }
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
moveToPage
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
handleSelectChange(event) { const page = Number(event.target.value); this.moveToPage(page); }
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
handleSelectChange
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
render() { const { style, className, paginationAlignment, pageSize, data, children, variant, ...rest } = this.props; const { activePage, pageItems } = this.state; const pages = Math.ceil(data....
This component implements a client-side pagination experience. Basically, it wires up the Table and the Pagination components in a composed manner and keeps the internal state of the active page based on a new prop pageSize. @category DataView
render
javascript
nexxtway/react-rainbow
src/components/TableWithBrowserPagination/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TableWithBrowserPagination/index.js
MIT
constructor(props) { super(props); this.state = { key: Date.now(), areButtonsVisible: false, }; this.isFirstTime = true; this.tabsetRef = React.createRef(); this.resizeTarget = React.createRef(); this.registerTab = this.registerTab.bind(thi...
Tabs make it easy to explore and switch between different views. @category Layout
constructor
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
componentDidMount() { this.widthObserver = new ResizeSensor( this.resizeTarget.current, debounce(this.updateButtonsVisibility, 100), ); }
Tabs make it easy to explore and switch between different views. @category Layout
componentDidMount
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
componentDidUpdate(prevProp) { const { children } = this.props; const { isFirstTime } = this; const areAllChildrenRegistered = children.length === this.tabsetChildren.length; if (isNotSameChildren(children, prevProp.children)) { this.updateButtonsVisibility(); } ...
Tabs make it easy to explore and switch between different views. @category Layout
componentDidUpdate
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
setAsSelectedTab(tabIndex) { this.tabsetChildren[tabIndex].ref.click(); this.tabsetChildren[tabIndex].ref.focus(); }
Tabs make it easy to explore and switch between different views. @category Layout
setAsSelectedTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
updateButtonsVisibility() { const { areButtonsVisible, variant } = this.state; const tabset = this.tabsetRef.current; const { offsetWidth: resizeWidth } = this.resizeTarget.current; const { scrollWidth, scrollLeft, offsetWidth: tabsetWidth } = tabset; const childrenTotalWidth = g...
Tabs make it easy to explore and switch between different views. @category Layout
updateButtonsVisibility
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
handleKeyPressed(event) { if (this.keyHandlerMap[event.keyCode]) { return this.keyHandlerMap[event.keyCode](); } return null; }
Tabs make it easy to explore and switch between different views. @category Layout
handleKeyPressed
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
selectTab(side) { const { activeTabName } = this.props; const { tabsetChildren } = this; const activeTabIndex = getTabIndexFromName(tabsetChildren, activeTabName); if (activeTabIndex === tabsetChildren.length - 1 && side === RIGHT_SIDE) { this.setAsSelectedTab(0); } ...
Tabs make it easy to explore and switch between different views. @category Layout
selectTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
isLeftButtonDisabled() { const { activeTabName } = this.props; const { tabsetChildren } = this; const { screenWidth, scrollLeft } = this; return getLeftButtonDisabledState({ activeTabName, tabsetChildren, screenWidth, scrollLeft, })...
Tabs make it easy to explore and switch between different views. @category Layout
isLeftButtonDisabled
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
isRightButtonDisabled() { const { activeTabName } = this.props; const { tabsetChildren } = this; const { screenWidth, scrollLeft, maxScroll } = this; return getRightButtonDisabledState({ activeTabName, tabsetChildren, screenWidth, scrollLef...
Tabs make it easy to explore and switch between different views. @category Layout
isRightButtonDisabled
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
handleRightButtonClick() { const { screenWidth, tabsetWidth, scrollLeft } = this; if (screenWidth > 600) { return this.tabsetRef.current.scrollTo(scrollLeft + tabsetWidth, 0); } return this.selectTab(RIGHT_SIDE); }
Tabs make it easy to explore and switch between different views. @category Layout
handleRightButtonClick
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
handleLeftButtonClick() { const { screenWidth, tabsetWidth, scrollLeft } = this; if (screenWidth > 600) { return this.tabsetRef.current.scrollTo(scrollLeft - tabsetWidth, 0); } return this.selectTab(LEFT_SIDE); }
Tabs make it easy to explore and switch between different views. @category Layout
handleLeftButtonClick
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
updateTab(tab, nameToUpdate) { const { tabsetChildren } = this; const newTabsetChildren = getUpdatedTabsetChildren(tabsetChildren, tab, nameToUpdate); this.tabsetChildren = newTabsetChildren; this.setState({ key: Date.now() }); }
Tabs make it easy to explore and switch between different views. @category Layout
updateTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
registerTab(tab) { const { tabsetChildren } = this; const [...nodes] = getChildTabNodes(this.tabsetRef.current); const newChildrenRefs = insertChildOrderly(tabsetChildren, tab, nodes); this.tabsetChildren = newChildrenRefs; this.setState({ key: Date.now() }); }
Tabs make it easy to explore and switch between different views. @category Layout
registerTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
unRegisterTab(tabName) { const { tabsetChildren } = this; const newTabsetChildren = tabsetChildren.filter(tab => tab.name !== tabName); this.tabsetChildren = newTabsetChildren; this.setState({ key: Date.now() }); }
Tabs make it easy to explore and switch between different views. @category Layout
unRegisterTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
scrollToSelectedTab(name) { const { tabsetChildren } = this; const tabset = this.tabsetRef.current; const { scrollLeft, offsetWidth: tabsetWidth } = tabset; const tabIndex = getTabIndexFromName(tabsetChildren, name); const isFirstTab = tabIndex === 0; if (isFirstTab) { ...
Tabs make it easy to explore and switch between different views. @category Layout
scrollToSelectedTab
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
handleSelect(event, name) { const { onSelect } = this.props; this.scrollToSelectedTab(name); onSelect(event, name); }
Tabs make it easy to explore and switch between different views. @category Layout
handleSelect
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
render() { const { activeTabName, fullWidth, variant, children, style, className, id } = this.props; const { areButtonsVisible } = this.state; const { screenWidth } = this; const showButtons = areButtonsVisible || screenWidth < 600; const context = { activeTabName, ...
Tabs make it easy to explore and switch between different views. @category Layout
render
javascript
nexxtway/react-rainbow
src/components/Tabset/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Tabset page object. @constructor @param {string} rootElement - The selector of the Tabset root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async getItem(itemPosition) { const items = await $(this.rootElement).$$('li[role="presentation"]'); if (items[itemPosition]) { return new PageTab( `${this.rootElement} li[role="presentation"]:nth-child(${itemPosition + 1})`, ); } return null; ...
Returns a new Tab page object of the element in item position. @method @param {number} itemPosition - The base 0 index of the tab item.
getItem
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async isButtonsVisible() { const buttons = await $(this.rootElement).$$(BUTTON_SELECTOR); if (buttons && buttons.length) { return browser.waitUntil( async () => (await buttons[0].isDisplayed()) && (await buttons[1].isDisplayed()), ); } return false...
Returns true when buttons are visible. @method @returns {bool}
isButtonsVisible
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async isLeftButtonEnabled() { return $(this.rootElement) .$$(BUTTON_SELECTOR)[0] .isEnabled(); }
Returns true when the left button is enabled. @method @returns {bool}
isLeftButtonEnabled
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async isRightButtonEnabled() { return $(this.rootElement) .$$(BUTTON_SELECTOR)[1] .isEnabled(); }
Returns true when the right button is enabled. @method @returns {bool}
isRightButtonEnabled
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async clickLeftButton() { return $(this.rootElement) .$$(BUTTON_SELECTOR)[0] .click(); }
Click the left button. @method @returns {bool}
clickLeftButton
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
async clickRightButton() { return $(this.rootElement) .$$(BUTTON_SELECTOR)[1] .click(); }
Click the right button. @method @returns {bool}
clickRightButton
javascript
nexxtway/react-rainbow
src/components/Tabset/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Tabset/pageObject/index.js
MIT
constructor(props) { super(props); this.textareaRef = React.createRef(); this.textareaId = uniqueId('textarea'); this.inlineTextLabelId = uniqueId('inline-text-label'); this.errorMessageId = uniqueId('error-message'); this.updateFocus = this.updateFocus.bind(this); ...
Textarea inputs are used for freeform data entry. @category Form
constructor
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
componentDidMount() { const { grow } = this.props; if (grow) { return autosize(this.textareaRef.current); } return null; }
Textarea inputs are used for freeform data entry. @category Form
componentDidMount
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
getInlineTextLabelId() { const { bottomHelpText } = this.props; if (bottomHelpText) { return this.inlineTextLabelId; } return undefined; }
Textarea inputs are used for freeform data entry. @category Form
getInlineTextLabelId
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
getErrorMessageId() { const { error } = this.props; if (error) { return this.errorMessageId; } return undefined; }
Textarea inputs are used for freeform data entry. @category Form
getErrorMessageId
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
updateFocus(isFocused, handler) { return (...args) => { this.setState({ isFocused }); handler(...args); }; }
Sets blur on the element. @public
updateFocus
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
render() { const { style, className, onChange, onClick, onFocus, onBlur, onKeyDown, onPaste, value, readOnly, label, error, placeholder, disable...
Sets blur on the element. @public
render
javascript
nexxtway/react-rainbow
src/components/Textarea/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new Textarea page object. @constructor @param {string} rootElement - The selector of the Textarea root element.
constructor
javascript
nexxtway/react-rainbow
src/components/Textarea/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/pageObject/index.js
MIT
async hasFocusTextarea() { return $(this.rootElement) .$('textarea') .isFocused(); }
Returns true when the textarea element has focus. @method @returns {bool}
hasFocusTextarea
javascript
nexxtway/react-rainbow
src/components/Textarea/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/pageObject/index.js
MIT
async setValue(value) { await $(this.rootElement) .$('textarea') .setValue(value); }
It set a value in the textarea. @method @param {string} values - The value to set in the textarea.
setValue
javascript
nexxtway/react-rainbow
src/components/Textarea/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/pageObject/index.js
MIT
async getValue() { return $(this.rootElement) .$('textarea') .getValue(); }
It get the value of the textarea. @method @returns {string}
getValue
javascript
nexxtway/react-rainbow
src/components/Textarea/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/Textarea/pageObject/index.js
MIT
function TimelineMarker(props) { const context = useContext(ActivityTimelineContext); if (context) { // eslint-disable-next-line react/jsx-props-no-spreading return <AccordionTimelineMarker {...props} />; } // eslint-disable-next-line react/jsx-props-no-spreading return <BasicTimelin...
The TimelineMarker displays one event of an item's timeline. It's generally used to compose the ActivityTimeline component. @category Layout
TimelineMarker
javascript
nexxtway/react-rainbow
src/components/TimelineMarker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimelineMarker/index.js
MIT
getTriggerInputValue = () => { return getInputValue(value, placeholder, hour24); }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
getTriggerInputValue
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
getTriggerInputValue = () => { return getInputValue(value, placeholder, hour24); }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
getTriggerInputValue
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
handleKeyDown = event => { const { keyCode } = event; const shouldOpenModal = (keyCode === ENTER_KEY || keyCode === SPACE_KEY) && !readOnly; if (shouldOpenModal) { setIsOpen(true); } }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
handleKeyDown
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
handleKeyDown = event => { const { keyCode } = event; const shouldOpenModal = (keyCode === ENTER_KEY || keyCode === SPACE_KEY) && !readOnly; if (shouldOpenModal) { setIsOpen(true); } }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
handleKeyDown
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
handleClick = event => { if (!readOnly) { setIsOpen(true); onClick(event); } }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
handleClick
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
handleClick = event => { if (!readOnly) { setIsOpen(true); onClick(event); } }
A TimePicker is used to input a time by displaying an interface the user can interact with. @category Form
handleClick
javascript
nexxtway/react-rainbow
src/components/TimePicker/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/index.js
MIT
constructor(rootElement) { this.rootElement = rootElement; }
Create a new TimePicker page object. @constructor @param {string} rootElement - The selector of the TimePicker root element.
constructor
javascript
nexxtway/react-rainbow
src/components/TimePicker/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/pageObject/index.js
MIT
async clickUpButton() { await $(timePickerModalId) .$('button[id="time-picker_up-button"]') .click(); }
Clicks the up button element. @method
clickUpButton
javascript
nexxtway/react-rainbow
src/components/TimePicker/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/pageObject/index.js
MIT
async clickDownButton() { await $(timePickerModalId) .$('button[id="time-picker_down-button"]') .click(); }
Clicks the down button element. @method
clickDownButton
javascript
nexxtway/react-rainbow
src/components/TimePicker/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/pageObject/index.js
MIT
async clickCancelButton() { await $(timePickerModalId) .$('button[id="time-picker_cancel-button"]') .click(); }
Clicks the cancel button element. @method
clickCancelButton
javascript
nexxtway/react-rainbow
src/components/TimePicker/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/pageObject/index.js
MIT
async clickOkButton() { await $(timePickerModalId) .$('button[id="time-picker_ok-button"]') .click(); }
Clicks the OK button element. @method
clickOkButton
javascript
nexxtway/react-rainbow
src/components/TimePicker/pageObject/index.js
https://github.com/nexxtway/react-rainbow/blob/master/src/components/TimePicker/pageObject/index.js
MIT