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 |
|---|---|---|---|---|---|---|---|
function Column() {
return <div />;
} | A column is a vertical element of a table that contains data.
The Column component is an abstraction that allows us to represent data of the same data type.
Both components (Table and Column) are related and should be implemented together.
@category DataView | Column | javascript | nexxtway/react-rainbow | src/components/Column/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Column/index.js | MIT |
handlePlusMouseDown = event => {
event.preventDefault();
inputRef.current.focus();
const val = getValue(Number(value));
if (val < min) return onChange(getNormalizedValue(min));
return onChange(getNormalizedValue(val + step));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handlePlusMouseDown | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
handlePlusMouseDown = event => {
event.preventDefault();
inputRef.current.focus();
const val = getValue(Number(value));
if (val < min) return onChange(getNormalizedValue(min));
return onChange(getNormalizedValue(val + step));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handlePlusMouseDown | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
handleMinusMouseDown = event => {
event.preventDefault();
inputRef.current.focus();
const val = getValue(Number(value));
if (val > max) return onChange(getNormalizedValue(max));
return onChange(getNormalizedValue(val - step));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handleMinusMouseDown | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
handleMinusMouseDown = event => {
event.preventDefault();
inputRef.current.focus();
const val = getValue(Number(value));
if (val > max) return onChange(getNormalizedValue(max));
return onChange(getNormalizedValue(val - step));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handleMinusMouseDown | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
handleEvents = (event, callback) => {
if (event.target.value === '') {
return callback();
}
return callback(Number(event.target.value));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handleEvents | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
handleEvents = (event, callback) => {
if (event.target.value === '') {
return callback();
}
return callback(Number(event.target.value));
} | CounterInput is a component that lets you enter a number. You can increase and decrease the value using your mouse or by simply typing the number.
@category Form | handleEvents | javascript | nexxtway/react-rainbow | src/components/CounterInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/CounterInput/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
this.modalRootEl = `${rootElement}_modal`;
this.calendarRootEl = `${rootElement}_modal_calendar`;
} | Create a new PageDatePicker page object.
@constructor
@param {string} rootElement - The selector of the PageDatePicker root element. | constructor | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async getValue() {
return $(this.rootElement)
.$('input[type="text"]')
.getValue();
} | Returns the value of the input element.
@method
@returns {string} | getValue | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async clickLabel() {
await $(this.rootElement)
.$('label')
.click();
} | Clicks the input label element.
@method | clickLabel | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async clickDay(day) {
const calendar = await PageCalendar(this.calendarRootEl);
await calendar.clickDay(day);
} | Clicks the calendar specific day button element.
@method | clickDay | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async isOpen() {
return (
(await $(this.modalRootEl).isDisplayed()) &&
(await $(this.modalRootEl)
.$('h1')
.isDisplayed()) &&
(await $(this.modalRootEl)
.$('select')
.isDisplayed())
);
} | Returns true when the DatePicker modal is open, false otherwise.
@method
@returns {bool} | isOpen | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async hasFocusInput() {
return (await $(this.rootElement).$('input[type="text"]')).isFocused();
} | Returns true when the DatePicker has focus.
@method
@returns {bool} | hasFocusInput | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async getDate() {
return $(this.modalRootEl)
.$('h1')
.getText();
} | Returns the date displayed on top of the DatePicker.
@method
@returns {string} | getDate | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async waitUntilOpen() {
await browser.waitUntil(async () => await this.isOpen());
} | Wait until the DatePicker modal is open.
@method | waitUntilOpen | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
async waitUntilClose() {
await browser.waitUntil(async () => !(await this.isOpen()));
} | Wait until the DatePicker modal is closed.
@method | waitUntilClose | javascript | nexxtway/react-rainbow | src/components/DatePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DatePicker/pageObject/index.js | MIT |
openModal = event => {
if (!readOnly) {
setIsOpen(true);
onClick(event);
}
} | A DateTimePicker is used to select a day and a time.
@category Form | openModal | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
openModal = event => {
if (!readOnly) {
setIsOpen(true);
onClick(event);
}
} | A DateTimePicker is used to select a day and a time.
@category Form | openModal | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
handleKeyDown = ({ keyCode }) => {
const shouldOpenModal = (keyCode === ENTER_KEY || keyCode === SPACE_KEY) && !readOnly;
if (shouldOpenModal) {
setIsOpen(true);
}
} | A DateTimePicker is used to select a day and a time.
@category Form | handleKeyDown | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
handleKeyDown = ({ keyCode }) => {
const shouldOpenModal = (keyCode === ENTER_KEY || keyCode === SPACE_KEY) && !readOnly;
if (shouldOpenModal) {
setIsOpen(true);
}
} | A DateTimePicker is used to select a day and a time.
@category Form | handleKeyDown | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
handleChange = (...args) => {
closeModal();
onChange(...args);
} | A DateTimePicker is used to select a day and a time.
@category Form | handleChange | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
handleChange = (...args) => {
closeModal();
onChange(...args);
} | A DateTimePicker is used to select a day and a time.
@category Form | handleChange | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
this.modalRootEl = `${rootElement}_modal`;
} | Create a new PageDateTimePicker page object.
@constructor
@param {string} rootElement - The selector of the PageDateTimePicker root element. | constructor | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async getTimeValue() {
return new PageTimeSelect(this.modalRootEl).getValue();
} | Returns the selected time value.
@method
@returns {string} | getTimeValue | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async getValue() {
return $(this.rootElement)
.$('input[type="text"]')
.getValue();
} | Returns the value of the input element.
@method
@returns {string} | getValue | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async clickLabel() {
await $(this.rootElement)
.$('label')
.click();
} | Clicks the input label element.
@method | clickLabel | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async clickDay(day) {
const calendar = await PageCalendar(this.modalRootEl);
await calendar.clickDay(day);
} | Clicks the calendar specific day button element.
@method | clickDay | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async clickOKButton() {
await $(this.modalRootEl)
.$('button[id="time-picker_ok-button"]')
.click();
} | Clicks the OK button element
@method | clickOKButton | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async clickCancelButton() {
await $(this.modalRootEl)
.$('button[id="time-picker_cancel-button"]')
.click();
} | Clicks the Cancel button element
@method | clickCancelButton | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async isOpen() {
return (
(await $(this.modalRootEl).isDisplayed()) &&
(await $(this.modalRootEl)
.$('button[id="time-picker_ok-button"]')
.isDisplayed()) &&
(await $(this.modalRootEl)
.$('button[id="time-picker_cancel-button"]'... | Returns true when the picker modal is open, false otherwise.
@method
@returns {bool} | isOpen | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async waitUntilOpen() {
await browser.waitUntil(async () => await this.isOpen());
} | Wait until the modal is open.
@method | waitUntilOpen | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
async waitUntilClose() {
await browser.waitUntil(async () => !(await this.isOpen()));
} | Wait until the modal is closed.
@method | waitUntilClose | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
} | Create a new PageTimeSelect page object.
@constructor
@param {string} rootElement - The selector of the PageTimeSelect root element. | constructor | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/pageTimeSelect.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/pageTimeSelect.js | MIT |
async getValue() {
const hour = await (await $(this.rootElement).$('input[data-id=hour]')).getValue();
const minutes = await (await $(this.rootElement).$('input[data-id=minutes]')).getValue();
const meridian = await (await $(this.rootElement).$(
'input[aria-label="am-pm selector"]',
... | Returns the text representing the current selected time.
@method
@returns {string} | getValue | javascript | nexxtway/react-rainbow | src/components/DateTimePicker/pageObject/pageTimeSelect.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DateTimePicker/pageObject/pageTimeSelect.js | MIT |
function Drawer(props) {
const {
id,
isOpen,
hideCloseButton,
onRequestClose,
onOpened,
header,
footer,
size,
slideFrom,
children,
className,
style,
} = props;
const headerId = useUniqueIdentifier('drawer-header'... | Drawers are surfaces containing supplementary content on your app.
@category Layout | Drawer | javascript | nexxtway/react-rainbow | src/components/Drawer/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/index.js | MIT |
onSlideEnd = () => {
if (drawerState === DrawerState.OPENING) {
setDrawerState(DrawerState.OPENED);
} else if (drawerState === DrawerState.CLOSING) {
setDrawerState(DrawerState.CLOSED);
}
} | Drawers are surfaces containing supplementary content on your app.
@category Layout | onSlideEnd | javascript | nexxtway/react-rainbow | src/components/Drawer/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/index.js | MIT |
onSlideEnd = () => {
if (drawerState === DrawerState.OPENING) {
setDrawerState(DrawerState.OPENED);
} else if (drawerState === DrawerState.CLOSING) {
setDrawerState(DrawerState.CLOSED);
}
} | Drawers are surfaces containing supplementary content on your app.
@category Layout | onSlideEnd | javascript | nexxtway/react-rainbow | src/components/Drawer/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/index.js | MIT |
handleKeyPressed = event => {
event.stopPropagation();
if (isOpen && event.keyCode === ESCAPE_KEY && containerRef.current.contains(event.target)) {
closeDrawer();
}
if (event.keyCode === TAB_KEY) {
manageTab(drawerRef.current, event);
}
return null... | Drawers are surfaces containing supplementary content on your app.
@category Layout | handleKeyPressed | javascript | nexxtway/react-rainbow | src/components/Drawer/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/index.js | MIT |
handleKeyPressed = event => {
event.stopPropagation();
if (isOpen && event.keyCode === ESCAPE_KEY && containerRef.current.contains(event.target)) {
closeDrawer();
}
if (event.keyCode === TAB_KEY) {
manageTab(drawerRef.current, event);
}
return null... | Drawers are surfaces containing supplementary content on your app.
@category Layout | handleKeyPressed | javascript | nexxtway/react-rainbow | src/components/Drawer/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/index.js | MIT |
function getPointOutsideDrawer(drawerPosition, drawerSize) {
const x = drawerPosition.x > 0 ? drawerPosition.x - 2 : drawerSize.width + 2;
const y = Math.round(drawerSize.height / 2);
return { x, y };
} | Drawer page object class.
@class
@tutorial drawer | getPointOutsideDrawer | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
} | Create a new PageDrawer page object.
@constructor
@param {string} rootElement - The selector of the PageDrawer root element. | constructor | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async clickCloseButton() {
await $(this.rootElement)
.$('[id="drawer-close-button"]')
.click();
} | Clicks the close button element.
@method | clickCloseButton | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async clickBackDrop() {
await $(this.rootElement)
.$('[id="drawer-close-button"]')
.waitForDisplayed();
const section = await $(this.rootElement).$('section[role="dialog"]');
const { x, y } = getPointOutsideDrawer(
await section.getLocation(),
awa... | Clicks the drawer's backdrop element.
@method | clickBackDrop | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async isOpen() {
return (
(await $(this.rootElement).isExisting()) &&
(await $(this.rootElement)
.$('section[role="dialog"]')
.isDisplayed()) &&
(await $(this.rootElement)
.$('[id="drawer-close-button"]')
.isDisp... | Returns true when the drawer is open, false otherwise.
@method
@returns {bool} | isOpen | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async hasFocusCloseButton() {
return $(this.rootElement)
.$('[id="drawer-close-button"]')
.isFocused();
} | Returns true when the closeButton has focus.
@method
@returns {bool} | hasFocusCloseButton | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async waitUntilOpen() {
await browser.pause(1000);
await browser.waitUntil(async () => await this.isOpen());
} | Wait until the open transition has finished.
@method | waitUntilOpen | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
async waitUntilClose() {
await browser.pause(1000);
await browser.waitUntil(async () => !(await $(this.rootElement).isExisting()));
} | Wait until the close transition has finished.
@method | waitUntilClose | javascript | nexxtway/react-rainbow | src/components/Drawer/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Drawer/pageObject/index.js | MIT |
DynamicMenuItem = props => {
const { renderIf, disabled, rowData: row, ...rest } = props;
const shouldRender = typeof renderIf === 'function' ? renderIf({ row }) : true;
const isDisabled = typeof disabled === 'function' ? disabled({ row }) : false;
if (shouldRender) {
// eslint-disable-next-li... | A DynamicMenuItem is a menu item meant to be used in the action column of Table. This component adds two new props
that allows to render the item conditionally based on row data.
@category DataView | DynamicMenuItem | javascript | nexxtway/react-rainbow | src/components/DynamicMenuItem/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DynamicMenuItem/index.js | MIT |
DynamicMenuItem = props => {
const { renderIf, disabled, rowData: row, ...rest } = props;
const shouldRender = typeof renderIf === 'function' ? renderIf({ row }) : true;
const isDisabled = typeof disabled === 'function' ? disabled({ row }) : false;
if (shouldRender) {
// eslint-disable-next-li... | A DynamicMenuItem is a menu item meant to be used in the action column of Table. This component adds two new props
that allows to render the item conditionally based on row data.
@category DataView | DynamicMenuItem | javascript | nexxtway/react-rainbow | src/components/DynamicMenuItem/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/DynamicMenuItem/index.js | MIT |
function GMap(props) {
const { apiKey, ...rest } = props;
// eslint-disable-next-line react-hooks/exhaustive-deps
const Component = useCallback(
scriptLoader(`${googleMapApiUrl}?key=${apiKey}&libraries=places`)(MapComponent),
[apiKey],
);
// eslint-disable-next-line react/jsx-props-... | The GMap component is used to find a location. | GMap | javascript | nexxtway/react-rainbow | src/components/GMap/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/GMap/index.js | MIT |
function GoogleAddressLookup(props) {
const { apiKey, ...rest } = props;
// eslint-disable-next-line react-hooks/exhaustive-deps
const Component = useCallback(
scriptLoader(`${googleMapApiUrl}?key=${apiKey}&libraries=places`)(PlacesLookupComponent),
[apiKey],
);
// eslint-disable-n... | The GoogleAddressLookup component is used to find a location.
@category Form | GoogleAddressLookup | javascript | nexxtway/react-rainbow | src/components/GoogleAddressLookup/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/GoogleAddressLookup/index.js | MIT |
handleBlur = () => {
if (!isClickTooltip.current) {
setIsFocused(false);
}
} | HelpText is a popup that displays information related to an element. | handleBlur | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleBlur = () => {
if (!isClickTooltip.current) {
setIsFocused(false);
}
} | HelpText is a popup that displays information related to an element. | handleBlur | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleButtonMouseLeave = () => {
if (!isFocused) {
setTimeout(() => {
if (!isHoverTooltip.current) closeOverlay();
}, 50);
}
} | HelpText is a popup that displays information related to an element. | handleButtonMouseLeave | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleButtonMouseLeave = () => {
if (!isFocused) {
setTimeout(() => {
if (!isHoverTooltip.current) closeOverlay();
}, 50);
}
} | HelpText is a popup that displays information related to an element. | handleButtonMouseLeave | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseDown = () => {
isClickTooltip.current = true;
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseDown | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseDown = () => {
isClickTooltip.current = true;
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseDown | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseUp = () => {
isClickTooltip.current = false;
setTimeout(() => triggerRef.current.focus());
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseUp | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseUp = () => {
isClickTooltip.current = false;
setTimeout(() => triggerRef.current.focus());
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseUp | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseEnter = () => {
isHoverTooltip.current = true;
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseEnter | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseEnter = () => {
isHoverTooltip.current = true;
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseEnter | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseLeave = () => {
isHoverTooltip.current = false;
if (!isFocused) {
closeOverlay();
}
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseLeave | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleTooltipMouseLeave = () => {
isHoverTooltip.current = false;
if (!isFocused) {
closeOverlay();
}
} | HelpText is a popup that displays information related to an element. | handleTooltipMouseLeave | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleKeyPressed = event => {
if (event.keyCode === ESCAPE_KEY) {
event.preventDefault();
closeOverlay();
}
} | HelpText is a popup that displays information related to an element. | handleKeyPressed | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
handleKeyPressed = event => {
if (event.keyCode === ESCAPE_KEY) {
event.preventDefault();
closeOverlay();
}
} | HelpText is a popup that displays information related to an element. | handleKeyPressed | javascript | nexxtway/react-rainbow | src/components/HelpText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HelpText/index.js | MIT |
function HighlightedText(props) {
const { style, className, parts, hitComponent, textComponent, isInline } = props;
const finalHitContainer = hitComponent || DefaultHitContainer;
const finalTextContainer = textComponent || DefaultTextContainer;
return (
<HighlighContainer className={className} ... | HighlightedText is a component that highlights a part of a text. | HighlightedText | javascript | nexxtway/react-rainbow | src/components/HighlightedText/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/HighlightedText/index.js | MIT |
constructor(props) {
super(props);
this.inputRef = React.createRef();
} | Text inputs are used for freeform data entry.
@category Form | constructor | javascript | nexxtway/react-rainbow | src/components/Input/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/index.js | MIT |
render() {
const { type } = this.props;
if (type === 'radio') {
return <InputRadio ref={this.inputRef} {...this.props} />;
}
if (type === 'checkbox') {
return <InputCheckbox ref={this.inputRef} {...this.props} />;
}
return <InputBase ref={this.inp... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/index.js | MIT |
render() {
const {
className,
style,
value,
label,
error,
placeholder,
onChange,
disabled,
readOnly,
tabIndex,
onFocus,
onBlur,
onClick,
onKeyDo... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/inputBase/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/inputBase/index.js | MIT |
render() {
const {
name,
value,
onChange,
tabIndex,
onFocus,
onBlur,
onClick,
onKeyDown,
disabled,
checked,
ariaLabelledBy,
ariaDescribedBy,
error,
... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/inputCheckbox/checkbox.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/inputCheckbox/checkbox.js | MIT |
render() {
const {
className,
style,
value,
onChange,
label,
error,
disabled,
tabIndex,
onFocus,
onBlur,
onClick,
onKeyDown,
bottomHelpText,
id,... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/inputCheckbox/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/inputCheckbox/index.js | MIT |
render() {
const {
className,
style,
value,
onChange,
label,
error,
disabled,
tabIndex,
onFocus,
onBlur,
onClick,
onKeyDown,
bottomHelpText,
id,... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/inputRadio/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/inputRadio/index.js | MIT |
render() {
const {
name,
value,
onChange,
tabIndex,
onFocus,
onBlur,
onClick,
onKeyDown,
disabled,
checked,
ariaLabelledBy,
ariaDescribedBy,
error,
... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/inputRadio/radio.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/inputRadio/radio.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
} | Create a new Input page object.
@constructor
@param {string} rootElement - The selector of the Input root element. | constructor | javascript | nexxtway/react-rainbow | src/components/Input/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/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/Input/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/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/Input/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/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/Input/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/pageObject/index.js | MIT |
renderInput() {
const { props } = this;
const { readOnly, isCentered, valueAlignment } = props;
const alignment = getValueAlignment({ valueAlignment, isCentered });
if (readOnly) {
return (
<StyledReadonlyInput
// eslint-disable-next-line ... | Sets blur on the element.
@public | renderInput | javascript | nexxtway/react-rainbow | src/components/Input/pickerInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/pickerInput/index.js | MIT |
render() {
const {
className,
style,
label,
error,
readOnly,
icon,
bottomHelpText,
required,
id,
hideLabel,
labelAlignment,
iconPosition,
size,
} = ... | Sets blur on the element.
@public | render | javascript | nexxtway/react-rainbow | src/components/Input/pickerInput/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Input/pickerInput/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
} | Create a new PageInternalDropdown page object.
@constructor
@param {string} rootElement - The selector of the PageInternalDropdown root element. | constructor | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async hoverScrollUpArrow() {
const upArrow = await $(this.rootElement).$('[data-id="internal-dropdown-arrow-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/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async hoverScrollDownArrow() {
const downArrow = await $(this.rootElement).$('[data-id="internal-dropdown-arrow-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/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async getOptionsLength() {
return (await $(this.rootElement).$$('li[data-selected="false"]')).length;
} | Get the number of registered options.
@method
@returns {number} | getOptionsLength | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async getOption(optionIndex) {
const activeOptions = await $(this.rootElement).$$('li[data-selected="false"]');
const option = activeOptions[optionIndex];
if (option && !option.error) {
return new PageOption(option, await this[privateGetMenuBoundsRect]());
}
return nu... | 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/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async arrowDownExists() {
return $(this.rootElement)
.$('[data-id="internal-dropdown-arrow-down"]')
.isExisting();
} | Returns true when the arrow to scroll down exits, false otherwise.
@method
@returns {bool} | arrowDownExists | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async arrowUpExists() {
return $(this.rootElement)
.$('[data-id="internal-dropdown-arrow-up"]')
.isExisting();
} | Returns true when the arrow to scroll down exits, false otherwise.
@method
@returns {bool} | arrowUpExists | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async emptyMessageExist() {
return $(this.rootElement)
.$('[data-id="internal-dropdown-empty-message"]')
.isExisting();
} | Returns true when the search no results found, false otherwise.
@method
@returns {bool} | emptyMessageExist | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
async isLoading() {
return $(this.rootElement)
.$('ul[role="presentation"] > div > div')
.isExisting();
} | Returns true when loading indicator is visible.
@method
@returns {bool} | isLoading | javascript | nexxtway/react-rainbow | src/components/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/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/InternalDropdown/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalDropdown/pageObject/index.js | MIT |
InternalOverlay = props => {
const {
render: ContentComponent,
isVisible,
triggerElementRef,
positionResolver,
onOpened,
children,
keepScrollEnabled,
} = props;
const containerRef = useRef();
const [contentMeta, updateContentMeta] = useState(false)... | This component implements the positioning of a component (inserted in the DOM at the body level) based on a trigger DOM element. By the way of example, you can think of the use case of a Menu Options, Tooltip, Popup that should be floating on top of all the elements and it should be correctly positioned based on the co... | InternalOverlay | javascript | nexxtway/react-rainbow | src/components/InternalOverlay/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalOverlay/index.js | MIT |
InternalOverlay = props => {
const {
render: ContentComponent,
isVisible,
triggerElementRef,
positionResolver,
onOpened,
children,
keepScrollEnabled,
} = props;
const containerRef = useRef();
const [contentMeta, updateContentMeta] = useState(false)... | This component implements the positioning of a component (inserted in the DOM at the body level) based on a trigger DOM element. By the way of example, you can think of the use case of a Menu Options, Tooltip, Popup that should be floating on top of all the elements and it should be correctly positioned based on the co... | InternalOverlay | javascript | nexxtway/react-rainbow | src/components/InternalOverlay/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalOverlay/index.js | MIT |
constructor(rootElement) {
this.rootElement = rootElement;
} | Create a nre InternalOverlay page object
@constructor
@param {string} rootElement | constructor | javascript | nexxtway/react-rainbow | src/components/InternalOverlay/pageObject/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalOverlay/pageObject/index.js | MIT |
handleOpen = () => {
const triggerRect = resolveElement(triggerElementRef).getBoundingClientRect();
const tooltipRect = tooltipRef.current.getBoundingClientRect();
if (tooltipRect.bottom < triggerRect.top) {
setPos('top');
} else if (tooltipRect.top > triggerRect.bottom) {
... | A Tooltip is a small piece of contextual information about an element on the screen, which is displayed when a user hovers or focuses on the element it is describing.
@category Internal | handleOpen | javascript | nexxtway/react-rainbow | src/components/InternalTooltip/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalTooltip/index.js | MIT |
handleOpen = () => {
const triggerRect = resolveElement(triggerElementRef).getBoundingClientRect();
const tooltipRect = tooltipRef.current.getBoundingClientRect();
if (tooltipRect.bottom < triggerRect.top) {
setPos('top');
} else if (tooltipRect.top > triggerRect.bottom) {
... | A Tooltip is a small piece of contextual information about an element on the screen, which is displayed when a user hovers or focuses on the element it is describing.
@category Internal | handleOpen | javascript | nexxtway/react-rainbow | src/components/InternalTooltip/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/InternalTooltip/index.js | MIT |
LoadingShape = props => {
const { className, style, shape, variant } = props;
const shapeRef = useRef();
const isImage = variant === 'image';
const isAvatar = variant === 'avatar';
useEffect(() => {
const element = shapeRef.current;
if (shape === 'square' || shape === 'circle') {
... | LoadingShape can be used to display a placeholder where content
is being loaded asynchronously. | LoadingShape | javascript | nexxtway/react-rainbow | src/components/LoadingShape/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/LoadingShape/index.js | MIT |
LoadingShape = props => {
const { className, style, shape, variant } = props;
const shapeRef = useRef();
const isImage = variant === 'image';
const isAvatar = variant === 'avatar';
useEffect(() => {
const element = shapeRef.current;
if (shape === 'square' || shape === 'circle') {
... | LoadingShape can be used to display a placeholder where content
is being loaded asynchronously. | LoadingShape | javascript | nexxtway/react-rainbow | src/components/LoadingShape/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/LoadingShape/index.js | MIT |
constructor(props) {
super(props);
const normalizedOptions = getNormalizedOptions(props.options || []);
this.state = {
searchValue: '',
isOpen: false,
isFocused: false,
options: normalizedOptions,
focusedItemIndex: getInitialFocusedInde... | 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 | constructor | javascript | nexxtway/react-rainbow | src/components/Lookup/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js | MIT |
componentDidUpdate(prevProps, prevState) {
const {
options: prevOptions,
preferredSelectedOption: prevPreferredSelectedOption,
} = prevProps;
const { options, preferredSelectedOption } = this.props;
if (prevOptions !== options) {
const normalizedOption... | 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 | componentDidUpdate | javascript | nexxtway/react-rainbow | src/components/Lookup/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js | MIT |
getValue() {
const { value } = this.props;
if (typeof value === 'object' && !Array.isArray(value)) {
return value;
}
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 | getValue | javascript | nexxtway/react-rainbow | src/components/Lookup/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js | MIT |
getErrorMessageId() {
const { error } = this.props;
if (error) {
return this.errorMessageId;
}
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 | getErrorMessageId | javascript | nexxtway/react-rainbow | src/components/Lookup/index.js | https://github.com/nexxtway/react-rainbow/blob/master/src/components/Lookup/index.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.