import * as React from "react"; import { ComponentProps } from "components/designSystems/appsmith/BaseComponent"; import { MenuItem, Button, ControlGroup, Label, Classes, } from "@blueprintjs/core"; import { SelectionType, DropdownOption } from "widgets/DropdownWidget"; import { Select, MultiSelect, IItemRendererProps } from "@blueprintjs/select"; import _ from "lodash"; import { WIDGET_PADDING } from "constants/WidgetConstants"; import "../../../../node_modules/@blueprintjs/select/lib/css/blueprint-select.css"; import styled from "constants/DefaultTheme"; const SingleDropDown = Select.ofType(); const MultiDropDown = MultiSelect.ofType(); const StyledSingleDropDown = styled(SingleDropDown)` div { flex: 1 1 auto; } span { width: 100%; } .bp3-button { display: flex; width: 100%; align-items: center; justify-content: space-between; } .bp3-button-text { text-overflow: ellipsis; text-align: center; overflow: hidden; } .bp3-icon { width: fit-content; } `; const StyledControlGroup = styled(ControlGroup)` &&& { label { margin: 0 ${WIDGET_PADDING}px 0 0; align-self: center; flex: 0 1 30%; text-align: right; } } `; const DropdownContainer = styled.div` textalign: center; width: 100%; `; const StyledMultiDropDown = styled(MultiDropDown)` .bp3-multi-select { min-width: 0; } `; class DropDownComponent extends React.Component { render() { const selectedItems = this.props.selectedIndexArr ? _.map(this.props.selectedIndexArr, index => { return this.props.options[index]; }) : []; return ( {this.props.selectionType === "SINGLE_SELECT" ? (