structured filter type => filterBehaviour

This commit is contained in:
Jan Prochazka
2024-08-19 10:26:18 +02:00
parent d0fa565704
commit 2a48e0c4a0
10 changed files with 65 additions and 67 deletions

View File

@@ -20,7 +20,7 @@
export let isReadOnly = false;
export let filterType;
export let structuredFilterType;
export let filterBehaviour;
export let filter;
export let setFilter;
export let showResizeSplitter = false;
@@ -66,35 +66,35 @@
{ onClick: () => filterMultipleValues(), text: 'Filter multiple values' },
];
if (structuredFilterType.supportEquals) {
if (filterBehaviour.supportEquals) {
res.push(
{ onClick: () => openFilterWindow('='), text: 'Equals...' },
{ onClick: () => openFilterWindow('<>'), text: 'Does Not Equal...' }
);
}
if (structuredFilterType.supportExistsTesting) {
if (filterBehaviour.supportExistsTesting) {
res.push(
{ onClick: () => setFilter('EXISTS'), text: 'Field exists' },
{ onClick: () => setFilter('NOT EXISTS'), text: 'Field does not exist' }
);
}
if (structuredFilterType.supportArrayTesting) {
if (filterBehaviour.supportArrayTesting) {
res.push(
{ onClick: () => setFilter('NOT EMPTY ARRAY'), text: 'Array is not empty' },
{ onClick: () => setFilter('EMPTY ARRAY'), text: 'Array is empty' }
);
}
if (structuredFilterType.supportNullTesting) {
if (filterBehaviour.supportNullTesting) {
res.push(
{ onClick: () => setFilter('NULL'), text: 'Is Null' },
{ onClick: () => setFilter('NOT NULL'), text: 'Is Not Null' }
);
}
if (structuredFilterType.supportNumberLikeComparison) {
if (filterBehaviour.supportNumberLikeComparison) {
res.push(
{ onClick: () => openFilterWindow('>'), text: 'Greater Than...' },
{ onClick: () => openFilterWindow('>='), text: 'Greater Than Or Equal To...' },
@@ -103,7 +103,7 @@
);
}
if (structuredFilterType.supportStringInclusion) {
if (filterBehaviour.supportStringInclusion) {
res.push(
{ divider: true },
@@ -116,21 +116,21 @@
);
}
if (structuredFilterType.supportBooleanValues) {
if (filterBehaviour.supportBooleanValues) {
res.push(
{ onClick: () => setFilter('TRUE'), text: 'Is True' },
{ onClick: () => setFilter('FALSE'), text: 'Is False' }
);
}
if (structuredFilterType.supportBooleanValues && structuredFilterType.supportNullTesting) {
if (filterBehaviour.supportBooleanValues && filterBehaviour.supportNullTesting) {
res.push(
{ onClick: () => setFilter('TRUE, NULL'), text: 'Is True or NULL' },
{ onClick: () => setFilter('FALSE, NULL'), text: 'Is False or NULL' }
);
}
if (structuredFilterType.supportDatetimeSymbols) {
if (filterBehaviour.supportDatetimeSymbols) {
res.push(
{ divider: true },
@@ -158,7 +158,7 @@
);
}
if (structuredFilterType.supportDatetimeComparison) {
if (filterBehaviour.supportDatetimeComparison) {
res.push(
{ divider: true },
{ onClick: () => openFilterWindow('<='), text: 'Before...' },
@@ -167,7 +167,7 @@
);
}
if (structuredFilterType.supportSqlCondition) {
if (filterBehaviour.supportSqlCondition) {
res.push(
{ divider: true },
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },

View File

@@ -3,15 +3,15 @@
export let name;
export let filterType;
export let structuredFilterType;
export let filterBehaviour;
function getOptions() {
const res = [];
if (structuredFilterType.supportEquals) {
if (filterBehaviour.supportEquals) {
res.push({ value: '=', label: 'equals' }, { value: '<>', label: 'does not equal' });
}
if (structuredFilterType.supportStringInclusion) {
if (filterBehaviour.supportStringInclusion) {
res.push(
{ value: '+', label: 'contains' },
{ value: '~', label: 'does not contain' },
@@ -22,7 +22,7 @@
);
}
if (structuredFilterType.supportNumberLikeComparison) {
if (filterBehaviour.supportNumberLikeComparison) {
res.push(
{ value: '<', label: 'is smaller' },
{ value: '>', label: 'is greater' },
@@ -31,7 +31,7 @@
);
}
if (structuredFilterType.supportDatetimeComparison) {
if (filterBehaviour.supportDatetimeComparison) {
res.push(
{ value: '<', label: 'is before' },
{ value: '>', label: 'is after' },
@@ -40,15 +40,15 @@
);
}
if (structuredFilterType.supportNullTesting) {
if (filterBehaviour.supportNullTesting) {
res.push({ value: 'NULL', label: 'is NULL' }, { value: 'NOT NULL', label: 'is not NULL' });
}
if (structuredFilterType.supportExistsTesting) {
if (filterBehaviour.supportExistsTesting) {
res.push({ value: 'EXISTS', label: 'field exists' }, { value: 'NOT EXISTS', label: 'field does not exist' });
}
if (structuredFilterType.supportSqlCondition) {
if (filterBehaviour.supportSqlCondition) {
res.push(
{ value: 'sql', label: 'SQL condition' },
{ value: 'sqlRight', label: 'SQL condition - right side only' }