From 2ef4b534e38f24ca496a9309e1187b1b9709b01e Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Fri, 16 Aug 2024 16:51:04 +0200 Subject: [PATCH] filter refactor WIP --- .../web/src/datagrid/DataFilterControl.svelte | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/packages/web/src/datagrid/DataFilterControl.svelte b/packages/web/src/datagrid/DataFilterControl.svelte index 4728336e..dbc28531 100644 --- a/packages/web/src/datagrid/DataFilterControl.svelte +++ b/packages/web/src/datagrid/DataFilterControl.svelte @@ -89,6 +89,19 @@ ); } + if (structuredFilterType.supportStringInclusion) { + res.push( + { divider: true }, + + { onClick: () => openFilterWindow('+'), text: 'Contains...' }, + { onClick: () => openFilterWindow('~'), text: 'Does Not Contain...' }, + { onClick: () => openFilterWindow('^'), text: 'Begins With...' }, + { onClick: () => openFilterWindow('!^'), text: 'Does Not Begin With...' }, + { onClick: () => openFilterWindow('$'), text: 'Ends With...' }, + { onClick: () => openFilterWindow('!$'), text: 'Does Not End With...' } + ); + } + if (structuredFilterType.supportBooleanValues) { res.push( { onClick: () => setFilter('TRUE'), text: 'Is True' }, @@ -103,8 +116,46 @@ ); } + if (structuredFilterType.supportDatetimeSymbols) { + res.push( + { divider: true }, + + { onClick: () => setFilter('TOMORROW'), text: 'Tomorrow' }, + { onClick: () => setFilter('TODAY'), text: 'Today' }, + { onClick: () => setFilter('YESTERDAY'), text: 'Yesterday' }, + + { divider: true }, + + { onClick: () => setFilter('NEXT WEEK'), text: 'Next Week' }, + { onClick: () => setFilter('THIS WEEK'), text: 'This Week' }, + { onClick: () => setFilter('LAST WEEK'), text: 'Last Week' }, + + { divider: true }, + + { onClick: () => setFilter('NEXT MONTH'), text: 'Next Month' }, + { onClick: () => setFilter('THIS MONTH'), text: 'This Month' }, + { onClick: () => setFilter('LAST MONTH'), text: 'Last Month' }, + + { divider: true }, + + { onClick: () => setFilter('NEXT YEAR'), text: 'Next Year' }, + { onClick: () => setFilter('THIS YEAR'), text: 'This Year' }, + { onClick: () => setFilter('LAST YEAR'), text: 'Last Year' } + ); + } + + if (structuredFilterType.supportDatetimeComparison) { + res.push( + { divider: true }, + { onClick: () => openFilterWindow('<='), text: 'Before...' }, + { onClick: () => openFilterWindow('>='), text: 'After...' }, + { onClick: () => openFilterWindow('>=;<='), text: 'Between...' } + ); + } + if (structuredFilterType.supportSqlCondition) { res.push( + { divider: true }, { onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' }, { onClick: () => openFilterWindow('sqlRight'), text: 'SQL condition - right side ...' } );