mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Added toggle for showing 'All options selected' label in multiselect
This commit is contained in:
parent
d12143d2b9
commit
30593d1f05
5 changed files with 24 additions and 1 deletions
|
|
@ -142,6 +142,12 @@ export const multiselectV2Config = {
|
|||
accordian: 'Options',
|
||||
isFxNotRequired: true,
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show all options selected label',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
section: 'additionalActions',
|
||||
},
|
||||
loadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Loading state',
|
||||
|
|
@ -327,6 +333,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
loadingState: { value: '{{false}}' },
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ const CustomValueContainer = ({ children, ...props }) => {
|
|||
</Placeholder>
|
||||
) : (
|
||||
<span className="text-truncate" {...props} id="options" style={{ maxWidth: valueContainerWidth }}>
|
||||
{isAllOptionsSelected ? 'All items are selected.' : values.join(', ')}
|
||||
{selectProps?.showAllSelectedLabel && isAllOptionsSelected ? 'All items are selected.' : values.join(', ')}
|
||||
</span>
|
||||
)}
|
||||
{/* Rendering children except Placeholder component to preserve the default behavior of react-select like focus
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export const MultiselectV2 = ({
|
|||
loadingState: multiSelectLoadingState,
|
||||
optionsLoadingState,
|
||||
sort,
|
||||
showAllSelectedLabel,
|
||||
} = properties;
|
||||
const {
|
||||
selectedTextColor,
|
||||
|
|
@ -521,6 +522,7 @@ export const MultiselectV2 = ({
|
|||
doShowIcon={iconVisibility}
|
||||
containerRef={valueContainerRef}
|
||||
showAllOption={showAllOption}
|
||||
showAllSelectedLabel={showAllSelectedLabel}
|
||||
isSelectAllSelected={isSelectAllSelected}
|
||||
setIsSelectAllSelected={(value) => {
|
||||
setIsSelectAllSelected(value);
|
||||
|
|
|
|||
|
|
@ -142,6 +142,12 @@ export const multiselectV2Config = {
|
|||
accordian: 'Options',
|
||||
isFxNotRequired: true,
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show all options selected label',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
section: 'additionalActions',
|
||||
},
|
||||
loadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Loading state',
|
||||
|
|
@ -327,6 +333,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
loadingState: { value: '{{false}}' },
|
||||
|
|
|
|||
|
|
@ -142,6 +142,12 @@ export const multiselectV2Config = {
|
|||
accordian: 'Options',
|
||||
isFxNotRequired: true,
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show all options selected label',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
section: 'additionalActions',
|
||||
},
|
||||
loadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Loading state',
|
||||
|
|
@ -327,6 +333,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
loadingState: { value: '{{false}}' },
|
||||
|
|
|
|||
Loading…
Reference in a new issue