@activecollab/components
Version:
ActiveCollab Components
49 lines • 2.04 kB
JavaScript
import _styled from "styled-components";
import React from "react";
import { StyledInputSelectTrigger } from "./Styles";
import { ArrowDownIcon, ArrowDownSmallIcon } from "../Icons";
import { Select } from "../Select";
import { StyledButton } from "../Trigger/Styles";
export const InputSelect = _ref => {
let onChange = _ref.onChange,
size = _ref.size,
selected = _ref.selected,
options = _ref.options,
_ref$search = _ref.search,
search = _ref$search === void 0 ? false : _ref$search,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$disabledInternal = _ref.disabledInternalSort,
disabledInternalSort = _ref$disabledInternal === void 0 ? true : _ref$disabledInternal,
_ref$keepSameOptionsO = _ref.keepSameOptionsOrder,
keepSameOptionsOrder = _ref$keepSameOptionsO === void 0 ? true : _ref$keepSameOptionsO,
selectedLabel = _ref.selectedLabel,
renderOption = _ref.renderOption,
filterCriteria = _ref.filterCriteria;
return /*#__PURE__*/React.createElement(Select, {
onChange: onChange,
forceCloseMenu: true,
disableSearch: !search,
target: /*#__PURE__*/React.createElement(_StyledStyledButton, {
type: "button"
}, /*#__PURE__*/React.createElement(StyledInputSelectTrigger, {
$disabled: disabled,
$size: size
}, selectedLabel ? selectedLabel : selected, size === "big" ? /*#__PURE__*/React.createElement(ArrowDownIcon, {
fill: "var(--color-theme-700)"
}) : /*#__PURE__*/React.createElement(ArrowDownSmallIcon, {
fill: "var(--color-theme-700)"
}))),
options: options,
disabledInternalSort: disabledInternalSort,
keepSameOptionsOrder: keepSameOptionsOrder,
selected: selected,
renderOption: renderOption,
filterCriteria: filterCriteria
});
};
var _StyledStyledButton = _styled(StyledButton).withConfig({
displayName: "InputSelect___StyledStyledButton",
componentId: "sc-1lmb5y-0"
})(["flex-shrink:0"]);
//# sourceMappingURL=InputSelect.js.map