mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
Merge pull request #12672 from ToolJet/feat/multiselect-label
Added toggle for showing 'All options selected' label in multiselect
This commit is contained in:
commit
0bed40ab3f
6 changed files with 35 additions and 1 deletions
|
|
@ -539,6 +539,17 @@ export function Select({ componentMeta, darkMode, ...restProps }) {
|
|||
currentState,
|
||||
allComponents
|
||||
)}
|
||||
{isMultiSelect &&
|
||||
renderElement(
|
||||
component,
|
||||
componentMeta,
|
||||
paramUpdated,
|
||||
dataQueries,
|
||||
'showAllSelectedLabel',
|
||||
'properties',
|
||||
currentState,
|
||||
allComponents
|
||||
)}
|
||||
{isSortingEnabled &&
|
||||
renderElement(
|
||||
component,
|
||||
|
|
|
|||
|
|
@ -121,6 +121,12 @@ export const multiselectV2Config = {
|
|||
},
|
||||
accordian: 'Options',
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show "All items are selected"',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
accordian: 'Options',
|
||||
},
|
||||
optionsLoadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Options loading state',
|
||||
|
|
@ -339,6 +345,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
showClearBtn: { value: '{{true}}' },
|
||||
showSearchInput: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export const MultiselectV2 = ({
|
|||
loadingState: multiSelectLoadingState,
|
||||
optionsLoadingState,
|
||||
sort,
|
||||
showAllSelectedLabel,
|
||||
showClearBtn,
|
||||
showSearchInput,
|
||||
} = properties;
|
||||
|
|
@ -544,6 +545,7 @@ export const MultiselectV2 = ({
|
|||
icon={icon}
|
||||
doShowIcon={iconVisibility}
|
||||
containerRef={valueContainerRef}
|
||||
showAllSelectedLabel={showAllSelectedLabel}
|
||||
iconColor={iconColor}
|
||||
optionsLoadingState={optionsLoadingState && advanced}
|
||||
darkMode={darkMode}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,12 @@ export const multiselectV2Config = {
|
|||
},
|
||||
accordian: 'Options',
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show "All items are selected"',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
accordian: 'Options',
|
||||
},
|
||||
optionsLoadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Options loading state',
|
||||
|
|
@ -339,6 +345,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
showClearBtn: { value: '{{true}}' },
|
||||
showSearchInput: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
|
|
|
|||
|
|
@ -121,6 +121,12 @@ export const multiselectV2Config = {
|
|||
},
|
||||
accordian: 'Options',
|
||||
},
|
||||
showAllSelectedLabel: {
|
||||
type: 'toggle',
|
||||
displayName: 'Show "All items are selected"',
|
||||
validation: { schema: { type: 'boolean' }, defaultValue: true },
|
||||
accordian: 'Options',
|
||||
},
|
||||
optionsLoadingState: {
|
||||
type: 'toggle',
|
||||
displayName: 'Options loading state',
|
||||
|
|
@ -339,6 +345,7 @@ export const multiselectV2Config = {
|
|||
optionsLoadingState: { value: '{{false}}' },
|
||||
sort: { value: 'asc' },
|
||||
placeholder: { value: 'Select the options' },
|
||||
showAllSelectedLabel: { value: '{{true}}' },
|
||||
showClearBtn: { value: '{{true}}' },
|
||||
showSearchInput: { value: '{{true}}' },
|
||||
visibility: { value: '{{true}}' },
|
||||
|
|
|
|||
Loading…
Reference in a new issue