@rkosafo/cai.components 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
import { onMount } from 'svelte';
|
|
81
81
|
import { fade } from 'svelte/transition';
|
|
82
82
|
|
|
83
|
-
let { columns = [], filters = $bindable([]) }: FilterBuilderProps = $props();
|
|
83
|
+
let { columns = [], filters = $bindable([]), onRunQuery }: FilterBuilderProps = $props();
|
|
84
84
|
|
|
85
85
|
// Operator mappings for each type
|
|
86
86
|
const operatorsByType = {
|
|
@@ -543,7 +543,10 @@
|
|
|
543
543
|
<p class="text-sm text-gray-600">Live preview of your filter conditions</p>
|
|
544
544
|
</div>
|
|
545
545
|
<div class="flex items-center">
|
|
546
|
-
<Button
|
|
546
|
+
<Button
|
|
547
|
+
color="blue"
|
|
548
|
+
onclick={() => onRunQuery({ jsonBuild: jsonQuery, sqlBuild: sqlQuery })}>Run Query</Button
|
|
549
|
+
>
|
|
547
550
|
</div>
|
|
548
551
|
</div>
|
|
549
552
|
|
package/dist/types/index.d.ts
CHANGED
|
@@ -737,9 +737,14 @@ export interface FilterBuilderItem {
|
|
|
737
737
|
logicalOperator?: 'AND' | 'OR';
|
|
738
738
|
label?: string;
|
|
739
739
|
}
|
|
740
|
+
export interface FilterBuilderExport {
|
|
741
|
+
sqlBuild: string;
|
|
742
|
+
jsonBuild: any[];
|
|
743
|
+
}
|
|
740
744
|
export interface FilterBuilderProps {
|
|
741
745
|
columns?: FilterBuilderColumnConfig[];
|
|
742
746
|
filters?: FilterBuilderItem[];
|
|
747
|
+
onRunQuery?: (val: FilterBuilderExport) => void;
|
|
743
748
|
}
|
|
744
749
|
export interface ITab {
|
|
745
750
|
id: number | string;
|