|
|
@ -1,14 +1,24 @@ |
|
|
|
import { UITypes } from 'nocodb-sdk' |
|
|
|
import { UITypes } from 'nocodb-sdk' |
|
|
|
|
|
|
|
|
|
|
|
const numericUITypes = [UITypes.Duration, UITypes.Currency, UITypes.Percent, UITypes.Number, UITypes.Rating, UITypes.Rollup] |
|
|
|
const numericUITypes: UITypes[] = [ |
|
|
|
|
|
|
|
UITypes.Duration, |
|
|
|
|
|
|
|
UITypes.Currency, |
|
|
|
|
|
|
|
UITypes.Percent, |
|
|
|
|
|
|
|
UITypes.Number, |
|
|
|
|
|
|
|
UITypes.Decimal, |
|
|
|
|
|
|
|
UITypes.Rating, |
|
|
|
|
|
|
|
UITypes.Rollup, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
export const comparisonOpList: { |
|
|
|
export const comparisonOpList = ( |
|
|
|
|
|
|
|
fieldUiType: UITypes, |
|
|
|
|
|
|
|
): { |
|
|
|
text: string |
|
|
|
text: string |
|
|
|
value: string |
|
|
|
value: string |
|
|
|
ignoreVal?: boolean |
|
|
|
ignoreVal?: boolean |
|
|
|
includedTypes?: UITypes[] |
|
|
|
includedTypes?: UITypes[] |
|
|
|
excludedTypes?: UITypes[] |
|
|
|
excludedTypes?: UITypes[] |
|
|
|
}[] = [ |
|
|
|
}[] => [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
text: 'is checked', |
|
|
|
text: 'is checked', |
|
|
|
value: 'checked', |
|
|
|
value: 'checked', |
|
|
@ -22,12 +32,12 @@ export const comparisonOpList: { |
|
|
|
includedTypes: [UITypes.Checkbox], |
|
|
|
includedTypes: [UITypes.Checkbox], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
text: 'is equal', |
|
|
|
text: numericUITypes.includes(fieldUiType) ? '=' : 'is equal', |
|
|
|
value: 'eq', |
|
|
|
value: 'eq', |
|
|
|
excludedTypes: [UITypes.Checkbox, UITypes.MultiSelect, UITypes.Attachment], |
|
|
|
excludedTypes: [UITypes.Checkbox, UITypes.MultiSelect, UITypes.Attachment], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
text: 'is not equal', |
|
|
|
text: numericUITypes.includes(fieldUiType) ? '!=' : 'is not equal', |
|
|
|
value: 'neq', |
|
|
|
value: 'neq', |
|
|
|
excludedTypes: [UITypes.Checkbox, UITypes.MultiSelect, UITypes.Attachment], |
|
|
|
excludedTypes: [UITypes.Checkbox, UITypes.MultiSelect, UITypes.Attachment], |
|
|
|
}, |
|
|
|
}, |
|
|
|