Browse Source

feat(nc-gui): use MultiSelect for SingleSelect columns for anyof / nanyof filters

pull/5106/head
Wing-Kam Wong 2 years ago
parent
commit
42b38ec843
  1. 34
      packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue

34
packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue

@ -112,22 +112,24 @@ const booleanOptions = [
{ value: null, label: 'unset' }, { value: null, label: 'unset' },
] ]
const componentMap: Partial<Record<FilterType, any>> = { const componentMap: Partial<Record<FilterType, any>> = $computed(() => {
// use MultiSelect for SingleSelect columns for anyof / nanyof filters return {
isSingleSelect: ['anyof', 'nanyof'].includes(props.filter.comparison_op) ? MultiSelect : SingleSelect, // use MultiSelect for SingleSelect columns for anyof / nanyof filters
isMultiSelect: MultiSelect, isSingleSelect: ['anyof', 'nanyof'].includes(props.filter.comparison_op) ? MultiSelect : SingleSelect,
isDate: DatePicker, isMultiSelect: MultiSelect,
isYear: YearPicker, isDate: DatePicker,
isDateTime: DateTimePicker, isYear: YearPicker,
isTime: TimePicker, isDateTime: DateTimePicker,
isRating: Rating, isTime: TimePicker,
isDuration: Duration, isRating: Rating,
isPercent: Percent, isDuration: Duration,
isCurrency: Currency, isPercent: Percent,
isDecimal: Decimal, isCurrency: Currency,
isInt: Integer, isDecimal: Decimal,
isFloat: Float, isInt: Integer,
} isFloat: Float,
}
})
const filterType = $computed(() => { const filterType = $computed(() => {
return Object.keys(componentMap).find((key) => checkType(key as FilterType)) return Object.keys(componentMap).find((key) => checkType(key as FilterType))

Loading…
Cancel
Save