Skip to content

Commit

Permalink
Multiselect props update (#46)
Browse files Browse the repository at this point in the history
* update multiselect props

Co-authored-by: Sergey Andreev <sergey.and@okwork.io>
  • Loading branch information
elenik72 and Sergey Andreev authored Feb 22, 2022
1 parent 779f73f commit 03dc1d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cadolabs/sphere-ui",
"version": "4.1.1",
"version": "4.1.2",
"main": "dist/index.js",
"license": "MIT",
"repository": "https://github.com/Cado-Labs/sphere-ui",
Expand Down
7 changes: 5 additions & 2 deletions src/components/MultiSelect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const MultiSelect = React.forwardRef(({
id = null,
disabled = false,
showClear = false,
removeIcon = false,
}, ref) => {
const multiselectRef = useRef(ref)

Expand All @@ -55,6 +54,10 @@ export const MultiSelect = React.forwardRef(({
return isFunction ? optionDisabled() : optionDisabled
}

const removeIcon = () => {
return isOptionDisabled() ? false : "pi pi-times-circle"
}

const renderHeader = () => {
return filter ? null : <React.Fragment />
}
Expand Down Expand Up @@ -109,7 +112,7 @@ export const MultiSelect = React.forwardRef(({
selectedItemsLabel={selectedItemsLabel}
showClear={showClear}
display={display}
removeIcon={removeIcon}
removeIcon={removeIcon()}
/>
)
})
1 change: 0 additions & 1 deletion storybook/i18n/locales/stories/multiselect/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ props:
selectedItemsLabel: Function that gets an item in the value and returns the content for it.
showClear: Displays an icon to clear the value.
display: Used mode to display the selected item. Valid values are 'comma' and 'chip'.
removeIcon: Icon of the remove chip element.
1 change: 0 additions & 1 deletion storybook/stories/form/MultiSelect/multiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export const multiSelect = {
{ name: "selectedItemsLabel", type: "string", description: `${I18N_PREFIX}.props.selectedItemsLabel` },
{ name: "showClear", type: "boolean", default: false, description: `${I18N_PREFIX}.props.showClear` },
{ name: "display", type: "string", description: `${I18N_PREFIX}.props.display` },
{ name: "removeIcon", type: "any", default: false, description: `${I18N_PREFIX}.props.removeIcon` },
],
eventDescriptionProps: [
{ name: "onChange", params: onChangeParams, description: `${I18N_PREFIX}.props.onChange` },
Expand Down

0 comments on commit 03dc1d3

Please sign in to comment.