@marimo-team/islands 0.23.2-dev25 → 0.23.2-dev27
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.
- package/dist/_basePickBy-C-mod5Dp.js +34 -0
- package/dist/{_baseUniq-C87CckHL.js → _baseUniq-Be_p_Ty6.js} +2 -2
- package/dist/{architecture-7HQA4BMR-BHdkAMvZ.js → architecture-7HQA4BMR-kNyKQXbB.js} +2 -2
- package/dist/{architectureDiagram-VXUJARFQ-B3YQo9At.js → architectureDiagram-VXUJARFQ-Dx_Dniiw.js} +11 -11
- package/dist/{blockDiagram-VD42YOAC-CpQ3TKEN.js → blockDiagram-VD42YOAC-D3hGPvEt.js} +4 -4
- package/dist/{c4Diagram-YG6GDRKO-CZSU4uqU.js → c4Diagram-YG6GDRKO-CtY1WMbV.js} +1 -1
- package/dist/{chat-ui-CNHw9Osh.js → chat-ui-CQtPb6Dj.js} +4 -4
- package/dist/{chunk-4F5CHEZ2-D5mClyDv.js → chunk-4F5CHEZ2-oWcaQSBe.js} +1 -1
- package/dist/{chunk-B2363JML-Br0eA2T3.js → chunk-B2363JML-72CRxZbk.js} +1 -1
- package/dist/{chunk-B4BG7PRW-4BjV11Br.js → chunk-B4BG7PRW-ChYfc4rf.js} +2 -2
- package/dist/{chunk-DI55MBZ5-DITY3EyP.js → chunk-DI55MBZ5-CYNE3N2j.js} +2 -2
- package/dist/{chunk-FRFDVMJY-DnEvEFRR.js → chunk-FRFDVMJY-Dgl-7l0K.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-BcPEfxk_.js → chunk-JA3XYJ7Z-B2BoMdpr.js} +1 -1
- package/dist/{chunk-JZLCHNYA-2bnLL3xL.js → chunk-JZLCHNYA-CkHD9mQU.js} +2 -2
- package/dist/{chunk-N4CR4FBY-CpZSuGSU.js → chunk-N4CR4FBY-DDeXUk3y.js} +4 -4
- package/dist/{chunk-PL6DKKU2-DnId6G-x.js → chunk-PL6DKKU2-CpBHhdj8.js} +1 -1
- package/dist/{chunk-QXUST7PY-Ch6F5Obl.js → chunk-QXUST7PY-BnSZbSK7.js} +3 -3
- package/dist/{chunk-S3R3BYOJ-B0UOFJwq.js → chunk-S3R3BYOJ-DVdRer7T.js} +1 -1
- package/dist/{chunk-SJTYNZTY-BsBZnJUj.js → chunk-SJTYNZTY-DPOwAZc-.js} +1 -1
- package/dist/{chunk-TCCFYFTB-Clbl-fTg.js → chunk-TCCFYFTB-BdE6BTq1.js} +6 -6
- package/dist/{chunk-TQ3KTPDO-CFkSQ30e.js → chunk-TQ3KTPDO-BCXCq8f2.js} +1 -1
- package/dist/{chunk-UMXZTB3W-D-A834Bq.js → chunk-UMXZTB3W-C5Hu2atA.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-DrmbGANl.js → classDiagram-2ON5EDUG-sUXB0Obe.js} +6 -6
- package/dist/{classDiagram-2ON5EDUG-C8-zE3Zv.js → classDiagram-v2-WZHVMYZB-JeF9-idj.js} +6 -6
- package/dist/{clone-DZFQCtFJ.js → clone-B48LSK6I.js} +1 -1
- package/dist/{constants-CvyfaCvs.js → constants-CcdcOQyC.js} +2 -1
- package/dist/{dagre-6UL2VRFP-OMItEBnY.js → dagre-6UL2VRFP-Bs_DhCUk.js} +9 -9
- package/dist/{dagre-QVd-lCXU.js → dagre-BLW2E2fh.js} +19 -8
- package/dist/{diagram-PSM6KHXK-CkKbohWI.js → diagram-PSM6KHXK-VB3japmQ.js} +10 -10
- package/dist/{diagram-QEK2KX5R-DjUMpVcx.js → diagram-QEK2KX5R-B8nm2JL9.js} +10 -10
- package/dist/{diagram-S2PKOQOG-b-c0d-wZ.js → diagram-S2PKOQOG-D6PR_2iv.js} +10 -10
- package/dist/{erDiagram-Q2GNP2WA-CDhLaOZ1.js → erDiagram-Q2GNP2WA-gjAse7Jb.js} +5 -5
- package/dist/{flowDiagram-NV44I4VS-BDi4O4CL.js → flowDiagram-NV44I4VS-CQTSZWcI.js} +5 -5
- package/dist/{ganttDiagram-JELNMOA3-BpZE6kVp.js → ganttDiagram-JELNMOA3-aktqk_om.js} +1 -1
- package/dist/{gitGraph-G5XIXVHT-B_c6xFJv.js → gitGraph-G5XIXVHT-Cy06nzLg.js} +2 -2
- package/dist/{gitGraphDiagram-V2S2FVAM-iQnXzbPM.js → gitGraphDiagram-V2S2FVAM-C1ntKO33.js} +10 -10
- package/dist/{glide-data-editor-BFqEJGJW.js → glide-data-editor-DBgJAMqf.js} +2 -2
- package/dist/{graphlib-BV1_gi0C.js → graphlib-Cr691-na.js} +3 -3
- package/dist/{hasIn-DnfJcYpY.js → hasIn-BDDmuo1w.js} +1 -1
- package/dist/{info-VBDWY6EO-BTyzxmhr.js → info-VBDWY6EO-BIO6A8nW.js} +2 -2
- package/dist/{infoDiagram-HS3SLOUP-OYrX6uO3.js → infoDiagram-HS3SLOUP-CtfUf0g_.js} +9 -9
- package/dist/{input-CSVEkmaZ.js → input-Czatnqbz.js} +1 -1
- package/dist/{kanban-definition-3W4ZIXB7-DHEAKdZt.js → kanban-definition-3W4ZIXB7-C5FK4v7x.js} +3 -3
- package/dist/main.js +367 -183
- package/dist/{mermaid-BbhZNQeB.js → mermaid-CcM8GHeT.js} +29 -29
- package/dist/{mermaid-parser.core-ntCgyx0x.js → mermaid-parser.core-fZdPSYor.js} +8 -8
- package/dist/min-DAIOAwWK.js +102 -0
- package/dist/{mindmap-definition-VGOIOE7T-CxEUZZvY.js → mindmap-definition-VGOIOE7T-BvrQf8XZ.js} +5 -5
- package/dist/{packet-DYOGHKS2-BhvnpoGi.js → packet-DYOGHKS2-DDx1z7B-.js} +2 -2
- package/dist/pick-DfX21dj2.js +18 -0
- package/dist/{pie-VRWISCQL-dILuA3iG.js → pie-VRWISCQL-BgRtyDMT.js} +2 -2
- package/dist/{pieDiagram-ADFJNKIX-U3LrUqAS.js → pieDiagram-ADFJNKIX-DAhjFwJD.js} +10 -10
- package/dist/{process-output-Bekznt_B.js → process-output-CzeGyEyz.js} +2138 -2124
- package/dist/{radar-ZZBFDIW7-DwFrOJDj.js → radar-ZZBFDIW7-xwh47Yzn.js} +2 -2
- package/dist/{requirementDiagram-UZGBJVZJ-D0zpQnKC.js → requirementDiagram-UZGBJVZJ-B3nnp0VG.js} +5 -5
- package/dist/{sequenceDiagram-WL72ISMW-D1BJxLjH.js → sequenceDiagram-WL72ISMW-D2mpRRG2.js} +1 -1
- package/dist/{stateDiagram-FKZM4ZOC-B1S8jGMn.js → stateDiagram-FKZM4ZOC-QD9Wuca0.js} +8 -8
- package/dist/{stateDiagram-v2-4FDKWEC3-BH5ozUbc.js → stateDiagram-v2-4FDKWEC3-DnUhJ525.js} +6 -6
- package/dist/{toDate-B1AzlBoW.js → toDate-BxaMtnNb.js} +1 -1
- package/dist/{treemap-GDKQZRPO-bx2ngsgN.js → treemap-GDKQZRPO-5ZsmvXgc.js} +2 -2
- package/dist/{types-pwjdK009.js → types-DZvw9zQT.js} +1 -1
- package/dist/{useDeepCompareMemoize-CsyOnnjc.js → useDeepCompareMemoize-BOrrcIxj.js} +1 -1
- package/dist/{vega-component-KBJXEDZz.js → vega-component-CrVeizNZ.js} +3 -3
- package/dist/{xychartDiagram-PRI3JC2R-CuAZiqHS.js → xychartDiagram-PRI3JC2R-BMsB7VdF.js} +2 -2
- package/package.json +2 -2
- package/src/components/data-table/TableBottomBar.tsx +5 -1
- package/src/components/data-table/__tests__/filters.test.ts +304 -0
- package/src/components/data-table/__tests__/pagination.test.tsx +46 -132
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
- package/src/components/data-table/filters.ts +87 -33
- package/src/components/data-table/pagination.tsx +189 -76
- package/src/components/data-table/types.ts +0 -4
- package/src/components/editor/Output.tsx +1 -1
- package/src/components/editor/actions/useNotebookActions.tsx +12 -0
- package/src/components/editor/cell/code/cell-editor.tsx +1 -0
- package/src/core/cells/__tests__/apply-transaction.test.ts +42 -0
- package/src/core/cells/__tests__/logs.test.ts +101 -0
- package/src/core/cells/logs.ts +9 -1
- package/src/core/codemirror/__tests__/__snapshots__/setup.test.ts.snap +4 -14
- package/src/core/codemirror/cells/extensions.ts +0 -4
- package/src/core/codemirror/keymaps/keymaps.ts +69 -2
- package/src/core/codemirror/language/languages/python.ts +9 -9
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +8 -1
- package/src/core/codemirror/lsp/federated-lsp.ts +2 -2
- package/src/core/codemirror/lsp/notebook-lsp.ts +2 -2
- package/src/core/codemirror/lsp/utils.ts +21 -6
- package/src/core/constants.ts +1 -0
- package/src/plugins/impl/DataTablePlugin.tsx +7 -20
- package/src/plugins/impl/TabsPlugin.tsx +18 -12
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +4 -4
- package/src/plugins/impl/data-frames/schema.ts +41 -9
- package/src/plugins/impl/data-frames/utils/operators.ts +2 -0
- package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +16 -0
- package/src/plugins/impl/plotly/__tests__/PlotlyPlugin.test.tsx +50 -0
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +82 -0
- package/src/plugins/impl/plotly/selection.ts +62 -3
- package/dist/_basePickBy-Sow3pJjS.js +0 -41
- package/dist/min-Ds3gG0Ff.js +0 -96
- package/dist/range-fJeId9Ri.js +0 -30
- /package/dist/{isEmpty-B7FX9wKt.js → isEmpty-D3lf6gH3.js} +0 -0
- /package/dist/{memoize-CSTI9eOX.js → memoize-DEvRzlwP.js} +0 -0
|
@@ -1,144 +1,58 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import { expect, test } from "vitest";
|
|
4
|
-
import {
|
|
5
|
-
import type { PageRange } from "../types";
|
|
4
|
+
import { matchingPageRanges } from "../pagination";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
test("empty prefix returns no ranges", () => {
|
|
7
|
+
expect(matchingPageRanges("", 500)).toEqual([]);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test("zero prefix returns no ranges", () => {
|
|
11
|
+
expect(matchingPageRanges("0", 500)).toEqual([]);
|
|
12
|
+
});
|
|
13
13
|
|
|
14
|
-
test("
|
|
15
|
-
expect(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"9",
|
|
26
|
-
"10",
|
|
27
|
-
"...",
|
|
28
|
-
"96",
|
|
29
|
-
"97",
|
|
30
|
-
"98",
|
|
31
|
-
"99",
|
|
32
|
-
"100",
|
|
33
|
-
"101",
|
|
34
|
-
"102",
|
|
35
|
-
"103",
|
|
36
|
-
"104",
|
|
37
|
-
"105",
|
|
38
|
-
"...",
|
|
39
|
-
"191",
|
|
40
|
-
"192",
|
|
41
|
-
"193",
|
|
42
|
-
"194",
|
|
43
|
-
"195",
|
|
44
|
-
"196",
|
|
45
|
-
"197",
|
|
46
|
-
"198",
|
|
47
|
-
"199",
|
|
48
|
-
"200",
|
|
49
|
-
]
|
|
50
|
-
`);
|
|
14
|
+
test("leading-zero prefix returns no ranges", () => {
|
|
15
|
+
expect(matchingPageRanges("01", 500)).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("single digit prefix", () => {
|
|
19
|
+
expect(matchingPageRanges("5", 500)).toEqual([
|
|
20
|
+
[5, 5],
|
|
21
|
+
[50, 59],
|
|
22
|
+
[500, 500],
|
|
23
|
+
]);
|
|
24
|
+
});
|
|
51
25
|
|
|
52
|
-
|
|
53
|
-
expect(
|
|
54
|
-
|
|
55
|
-
|
|
26
|
+
test("single digit prefix with exact totalPages boundary", () => {
|
|
27
|
+
expect(matchingPageRanges("5", 55)).toEqual([
|
|
28
|
+
[5, 5],
|
|
29
|
+
[50, 55],
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("multi-digit prefix", () => {
|
|
34
|
+
expect(matchingPageRanges("12", 5000)).toEqual([
|
|
35
|
+
[12, 12],
|
|
36
|
+
[120, 129],
|
|
37
|
+
[1200, 1299],
|
|
38
|
+
]);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("prefix larger than totalPages returns no ranges", () => {
|
|
42
|
+
expect(matchingPageRanges("999", 100)).toEqual([]);
|
|
43
|
+
});
|
|
56
44
|
|
|
57
|
-
|
|
58
|
-
expect(
|
|
59
|
-
expect(getLabels(1)).not.toEqual(getLabels(95));
|
|
60
|
-
expect(getLabels(1)).not.toEqual(getLabels(106));
|
|
61
|
-
expect(getLabels(1)).not.toEqual(getLabels(190));
|
|
45
|
+
test("prefix equal to totalPages", () => {
|
|
46
|
+
expect(matchingPageRanges("100", 100)).toEqual([[100, 100]]);
|
|
62
47
|
});
|
|
63
48
|
|
|
64
|
-
test("
|
|
65
|
-
expect(
|
|
66
|
-
[
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"3",
|
|
70
|
-
"4",
|
|
71
|
-
"5",
|
|
72
|
-
"6",
|
|
73
|
-
"7",
|
|
74
|
-
"8",
|
|
75
|
-
"9",
|
|
76
|
-
"10",
|
|
77
|
-
"...",
|
|
78
|
-
"50",
|
|
79
|
-
"...",
|
|
80
|
-
"96",
|
|
81
|
-
"97",
|
|
82
|
-
"98",
|
|
83
|
-
"99",
|
|
84
|
-
"100",
|
|
85
|
-
"101",
|
|
86
|
-
"102",
|
|
87
|
-
"103",
|
|
88
|
-
"104",
|
|
89
|
-
"105",
|
|
90
|
-
"...",
|
|
91
|
-
"191",
|
|
92
|
-
"192",
|
|
93
|
-
"193",
|
|
94
|
-
"194",
|
|
95
|
-
"195",
|
|
96
|
-
"196",
|
|
97
|
-
"197",
|
|
98
|
-
"198",
|
|
99
|
-
"199",
|
|
100
|
-
"200",
|
|
101
|
-
]
|
|
102
|
-
`);
|
|
49
|
+
test("prefix 1 with small totalPages", () => {
|
|
50
|
+
expect(matchingPageRanges("1", 10)).toEqual([
|
|
51
|
+
[1, 1],
|
|
52
|
+
[10, 10],
|
|
53
|
+
]);
|
|
103
54
|
});
|
|
104
55
|
|
|
105
|
-
test("
|
|
106
|
-
expect(
|
|
107
|
-
[
|
|
108
|
-
"1",
|
|
109
|
-
"2",
|
|
110
|
-
"3",
|
|
111
|
-
"4",
|
|
112
|
-
"5",
|
|
113
|
-
"6",
|
|
114
|
-
"7",
|
|
115
|
-
"8",
|
|
116
|
-
"9",
|
|
117
|
-
"10",
|
|
118
|
-
"...",
|
|
119
|
-
"96",
|
|
120
|
-
"97",
|
|
121
|
-
"98",
|
|
122
|
-
"99",
|
|
123
|
-
"100",
|
|
124
|
-
"101",
|
|
125
|
-
"102",
|
|
126
|
-
"103",
|
|
127
|
-
"104",
|
|
128
|
-
"105",
|
|
129
|
-
"...",
|
|
130
|
-
"150",
|
|
131
|
-
"...",
|
|
132
|
-
"191",
|
|
133
|
-
"192",
|
|
134
|
-
"193",
|
|
135
|
-
"194",
|
|
136
|
-
"195",
|
|
137
|
-
"196",
|
|
138
|
-
"197",
|
|
139
|
-
"198",
|
|
140
|
-
"199",
|
|
141
|
-
"200",
|
|
142
|
-
]
|
|
143
|
-
`);
|
|
56
|
+
test("prefix 1 with totalPages=1", () => {
|
|
57
|
+
expect(matchingPageRanges("1", 1)).toEqual([[1, 1]]);
|
|
144
58
|
});
|
|
@@ -74,7 +74,7 @@ export const ColumnExplorerPanel = ({
|
|
|
74
74
|
return (
|
|
75
75
|
<div className="mb-3">
|
|
76
76
|
<span className="text-xs font-semibold ml-2 flex">
|
|
77
|
-
{prettifyRowColumnCount(totalRows, totalColumns, locale)}
|
|
77
|
+
{prettifyRowColumnCount({ numRows: totalRows, totalColumns, locale })}
|
|
78
78
|
<CopyClipboardIcon
|
|
79
79
|
tooltip="Copy column names"
|
|
80
80
|
value={columns?.map(([columnName]) => columnName).join(",\n") || ""}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
"use no memo";
|
|
3
3
|
|
|
4
|
-
import type { RowData } from "@tanstack/react-table";
|
|
4
|
+
import type { ColumnFiltersState, RowData } from "@tanstack/react-table";
|
|
5
5
|
import type { DataType } from "@/core/kernel/messages";
|
|
6
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
FilterConditionType,
|
|
8
|
+
FilterGroupType,
|
|
9
|
+
} from "@/plugins/impl/data-frames/schema";
|
|
7
10
|
import type { ColumnId } from "@/plugins/impl/data-frames/types";
|
|
8
11
|
import type { OperatorType } from "@/plugins/impl/data-frames/utils/operators";
|
|
9
12
|
import { assertNever } from "@/utils/assertNever";
|
|
@@ -84,28 +87,34 @@ export type ColumnFilterForType<T extends FilterType> = T extends FilterType
|
|
|
84
87
|
export function filterToFilterCondition(
|
|
85
88
|
columnIdString: string,
|
|
86
89
|
filter: ColumnFilterValue | undefined,
|
|
87
|
-
):
|
|
90
|
+
): FilterConditionType[] {
|
|
88
91
|
if (!filter) {
|
|
89
92
|
return [];
|
|
90
93
|
}
|
|
91
94
|
const columnId = columnIdString as ColumnId;
|
|
92
95
|
|
|
93
96
|
if (filter.operator === "is_null" || filter.operator === "is_not_null") {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
return [
|
|
98
|
+
{
|
|
99
|
+
column_id: columnId,
|
|
100
|
+
operator: filter.operator,
|
|
101
|
+
value: undefined,
|
|
102
|
+
type: "condition",
|
|
103
|
+
negate: false,
|
|
104
|
+
},
|
|
105
|
+
];
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
switch (filter.type) {
|
|
102
109
|
case "number": {
|
|
103
|
-
const conditions:
|
|
110
|
+
const conditions: FilterConditionType[] = [];
|
|
104
111
|
if (filter.min !== undefined) {
|
|
105
112
|
conditions.push({
|
|
106
113
|
column_id: columnId,
|
|
107
114
|
operator: ">=",
|
|
108
115
|
value: filter.min,
|
|
116
|
+
type: "condition",
|
|
117
|
+
negate: false,
|
|
109
118
|
});
|
|
110
119
|
}
|
|
111
120
|
if (filter.max !== undefined) {
|
|
@@ -113,23 +122,31 @@ export function filterToFilterCondition(
|
|
|
113
122
|
column_id: columnId,
|
|
114
123
|
operator: "<=",
|
|
115
124
|
value: filter.max,
|
|
125
|
+
type: "condition",
|
|
126
|
+
negate: false,
|
|
116
127
|
});
|
|
117
128
|
}
|
|
118
129
|
return conditions;
|
|
119
130
|
}
|
|
120
131
|
case "text":
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
column_id: columnId,
|
|
135
|
+
operator: filter.operator,
|
|
136
|
+
value: filter.text,
|
|
137
|
+
type: "condition",
|
|
138
|
+
negate: false,
|
|
139
|
+
},
|
|
140
|
+
];
|
|
126
141
|
case "datetime": {
|
|
127
|
-
const conditions:
|
|
142
|
+
const conditions: FilterConditionType[] = [];
|
|
128
143
|
if (filter.min !== undefined) {
|
|
129
144
|
conditions.push({
|
|
130
145
|
column_id: columnId,
|
|
131
146
|
operator: ">=",
|
|
132
147
|
value: filter.min.toISOString(),
|
|
148
|
+
type: "condition",
|
|
149
|
+
negate: false,
|
|
133
150
|
});
|
|
134
151
|
}
|
|
135
152
|
if (filter.max !== undefined) {
|
|
@@ -137,17 +154,21 @@ export function filterToFilterCondition(
|
|
|
137
154
|
column_id: columnId,
|
|
138
155
|
operator: "<=",
|
|
139
156
|
value: filter.max.toISOString(),
|
|
157
|
+
type: "condition",
|
|
158
|
+
negate: false,
|
|
140
159
|
});
|
|
141
160
|
}
|
|
142
161
|
return conditions;
|
|
143
162
|
}
|
|
144
163
|
case "date": {
|
|
145
|
-
const conditions:
|
|
164
|
+
const conditions: FilterConditionType[] = [];
|
|
146
165
|
if (filter.min !== undefined) {
|
|
147
166
|
conditions.push({
|
|
148
167
|
column_id: columnId,
|
|
149
168
|
operator: ">=",
|
|
150
169
|
value: filter.min.toISOString(),
|
|
170
|
+
type: "condition",
|
|
171
|
+
negate: false,
|
|
151
172
|
});
|
|
152
173
|
}
|
|
153
174
|
if (filter.max !== undefined) {
|
|
@@ -155,17 +176,21 @@ export function filterToFilterCondition(
|
|
|
155
176
|
column_id: columnId,
|
|
156
177
|
operator: "<=",
|
|
157
178
|
value: filter.max.toISOString(),
|
|
179
|
+
type: "condition",
|
|
180
|
+
negate: false,
|
|
158
181
|
});
|
|
159
182
|
}
|
|
160
183
|
return conditions;
|
|
161
184
|
}
|
|
162
185
|
case "time": {
|
|
163
|
-
const conditions:
|
|
186
|
+
const conditions: FilterConditionType[] = [];
|
|
164
187
|
if (filter.min !== undefined) {
|
|
165
188
|
conditions.push({
|
|
166
189
|
column_id: columnId,
|
|
167
190
|
operator: ">=",
|
|
168
191
|
value: filter.min.toISOString(),
|
|
192
|
+
type: "condition",
|
|
193
|
+
negate: false,
|
|
169
194
|
});
|
|
170
195
|
}
|
|
171
196
|
if (filter.max !== undefined) {
|
|
@@ -173,24 +198,34 @@ export function filterToFilterCondition(
|
|
|
173
198
|
column_id: columnId,
|
|
174
199
|
operator: "<=",
|
|
175
200
|
value: filter.max.toISOString(),
|
|
201
|
+
type: "condition",
|
|
202
|
+
negate: false,
|
|
176
203
|
});
|
|
177
204
|
}
|
|
178
205
|
return conditions;
|
|
179
206
|
}
|
|
180
207
|
case "boolean":
|
|
181
208
|
if (filter.value) {
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
209
|
+
return [
|
|
210
|
+
{
|
|
211
|
+
column_id: columnId,
|
|
212
|
+
operator: "is_true",
|
|
213
|
+
value: undefined,
|
|
214
|
+
type: "condition",
|
|
215
|
+
negate: false,
|
|
216
|
+
},
|
|
217
|
+
];
|
|
187
218
|
}
|
|
188
219
|
if (!filter.value) {
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
220
|
+
return [
|
|
221
|
+
{
|
|
222
|
+
column_id: columnId,
|
|
223
|
+
operator: "is_false",
|
|
224
|
+
value: undefined,
|
|
225
|
+
type: "condition",
|
|
226
|
+
negate: false,
|
|
227
|
+
},
|
|
228
|
+
];
|
|
194
229
|
}
|
|
195
230
|
|
|
196
231
|
return [];
|
|
@@ -200,16 +235,35 @@ export function filterToFilterCondition(
|
|
|
200
235
|
Logger.warn("Invalid operator for select filter", {
|
|
201
236
|
operator: filter.operator,
|
|
202
237
|
});
|
|
203
|
-
operator = "in";
|
|
238
|
+
operator = "in";
|
|
204
239
|
}
|
|
205
|
-
return
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
240
|
+
return [
|
|
241
|
+
{
|
|
242
|
+
column_id: columnId,
|
|
243
|
+
operator,
|
|
244
|
+
value: filter.options,
|
|
245
|
+
type: "condition",
|
|
246
|
+
negate: false,
|
|
247
|
+
},
|
|
248
|
+
];
|
|
210
249
|
}
|
|
211
250
|
|
|
212
251
|
default:
|
|
213
252
|
assertNever(filter);
|
|
214
253
|
}
|
|
215
254
|
}
|
|
255
|
+
|
|
256
|
+
export function filtersToFilterGroup(
|
|
257
|
+
columnFilters: ColumnFiltersState,
|
|
258
|
+
): FilterGroupType {
|
|
259
|
+
const conditions = columnFilters.flatMap((filter) =>
|
|
260
|
+
filterToFilterCondition(filter.id, filter.value as ColumnFilterValue),
|
|
261
|
+
);
|
|
262
|
+
// To maintain existing behavior "and" all the conditions
|
|
263
|
+
return {
|
|
264
|
+
type: "group",
|
|
265
|
+
operator: "and",
|
|
266
|
+
children: conditions,
|
|
267
|
+
negate: false,
|
|
268
|
+
};
|
|
269
|
+
}
|