@brizy/ui
Version:
React elements in Brizy style
15 lines (14 loc) • 1.15 kB
JavaScript
import { BRZ_PREFIX } from "../../constants";
import { Dropdown } from "../components/Dropdown";
import { Manager } from "react-popper";
import Downshift from "downshift";
import _ from "underscore";
import React from "react";
import { options } from "../data";
const ref = {
current: document.createElement("div"),
};
const itemToString = (i) => (i ? i.label : "");
export const DropdownTest = (props) => (React.createElement(Manager, null,
React.createElement(Downshift, { initialSelectedItem: "", selectedItem: "", onChange: _.noop, itemToString: itemToString }, ({ getItemProps, getMenuProps, highlightedIndex, selectedItem }) => (React.createElement("div", { className: `${BRZ_PREFIX}-control__select2` },
React.createElement(Dropdown, Object.assign({ options: options, selectRef: ref, className: "", isFixed: false, isLight: true, maxItems: 5, minItems: 1, itemHeight: 30, isMultiple: false, inputValue: "", isOpen: true, highlightedIndex: highlightedIndex !== null && highlightedIndex !== void 0 ? highlightedIndex : undefined, selectedItem: selectedItem, getMenuProps: getMenuProps, getItemProps: getItemProps }, props)))))));