Allow removing filter on Dropdown Widget
This commit is contained in:
parent
a63ea5102c
commit
b447aa8345
|
|
@ -259,7 +259,7 @@ class DropDownComponent extends React.Component<DropDownComponentProps> {
|
||||||
<StyledSingleDropDown
|
<StyledSingleDropDown
|
||||||
className={this.props.isLoading ? Classes.SKELETON : ""}
|
className={this.props.isLoading ? Classes.SKELETON : ""}
|
||||||
items={this.props.options}
|
items={this.props.options}
|
||||||
filterable={true}
|
filterable={this.props.isFilterable}
|
||||||
itemRenderer={this.renderSingleSelectItem}
|
itemRenderer={this.renderSingleSelectItem}
|
||||||
onItemSelect={this.onItemSelect}
|
onItemSelect={this.onItemSelect}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
|
|
@ -414,6 +414,7 @@ export interface DropDownComponentProps extends ComponentProps {
|
||||||
selectedIndexArr: number[];
|
selectedIndexArr: number[];
|
||||||
options: DropdownOption[];
|
options: DropdownOption[];
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
|
isFilterable: boolean;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,15 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
||||||
isBindProperty: true,
|
isBindProperty: true,
|
||||||
isTriggerProperty: false,
|
isTriggerProperty: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
propertyName: "isFilterable",
|
||||||
|
label: "Filterable",
|
||||||
|
helpText: "Makes the dropdown list filterable",
|
||||||
|
controlType: "SWITCH",
|
||||||
|
isJSConvertible: true,
|
||||||
|
isBindProperty: true,
|
||||||
|
isTriggerProperty: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
propertyName: "isRequired",
|
propertyName: "isRequired",
|
||||||
label: "Required",
|
label: "Required",
|
||||||
|
|
@ -111,6 +120,7 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
||||||
options: VALIDATION_TYPES.OPTIONS_DATA,
|
options: VALIDATION_TYPES.OPTIONS_DATA,
|
||||||
selectionType: VALIDATION_TYPES.TEXT,
|
selectionType: VALIDATION_TYPES.TEXT,
|
||||||
isRequired: VALIDATION_TYPES.BOOLEAN,
|
isRequired: VALIDATION_TYPES.BOOLEAN,
|
||||||
|
isFilterable: VALIDATION_TYPES.BOOLEAN,
|
||||||
// onOptionChange: VALIDATION_TYPES.ACTION_SELECTOR,
|
// onOptionChange: VALIDATION_TYPES.ACTION_SELECTOR,
|
||||||
selectedOptionValues: VALIDATION_TYPES.ARRAY,
|
selectedOptionValues: VALIDATION_TYPES.ARRAY,
|
||||||
selectedOptionLabels: VALIDATION_TYPES.ARRAY,
|
selectedOptionLabels: VALIDATION_TYPES.ARRAY,
|
||||||
|
|
@ -180,6 +190,7 @@ class DropdownWidget extends BaseWidget<DropdownWidgetProps, WidgetState> {
|
||||||
selectedIndexArr={computedSelectedIndexArr}
|
selectedIndexArr={computedSelectedIndexArr}
|
||||||
label={`${this.props.label}`}
|
label={`${this.props.label}`}
|
||||||
isLoading={this.props.isLoading}
|
isLoading={this.props.isLoading}
|
||||||
|
isFilterable={this.props.isFilterable}
|
||||||
disabled={this.props.isDisabled}
|
disabled={this.props.isDisabled}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
@ -277,6 +288,7 @@ export interface DropdownWidgetProps extends WidgetProps, WithMeta {
|
||||||
onOptionChange?: string;
|
onOptionChange?: string;
|
||||||
defaultOptionValue?: string | string[];
|
defaultOptionValue?: string | string[];
|
||||||
isRequired: boolean;
|
isRequired: boolean;
|
||||||
|
isFilterable: boolean;
|
||||||
selectedOptionValue: string;
|
selectedOptionValue: string;
|
||||||
selectedOptionValueArr: string[];
|
selectedOptionValueArr: string[];
|
||||||
selectedOptionLabels: string[];
|
selectedOptionLabels: string[];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user