@marimo-team/islands 0.23.2-dev2 → 0.23.2-dev20
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-DIVMRPO5.js} +2 -2
- 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/{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/{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/{kanban-definition-3W4ZIXB7-DHEAKdZt.js → kanban-definition-3W4ZIXB7-C5FK4v7x.js} +3 -3
- package/dist/main.js +264 -130
- 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-H_7QTreh.js} +2133 -2119
- 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/{treemap-GDKQZRPO-bx2ngsgN.js → treemap-GDKQZRPO-5ZsmvXgc.js} +2 -2
- 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/cell/code/cell-editor.tsx +1 -0
- 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/plugins/impl/DataTablePlugin.tsx +7 -20
- 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/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,6 +1,6 @@
|
|
|
1
|
-
import "./chunk-TCCFYFTB-
|
|
1
|
+
import "./chunk-TCCFYFTB-BdE6BTq1.js";
|
|
2
2
|
import "./main-XimWhSi_.js";
|
|
3
|
-
import { n as createRadarServices, t as RadarModule } from "./chunk-TQ3KTPDO-
|
|
3
|
+
import { n as createRadarServices, t as RadarModule } from "./chunk-TQ3KTPDO-BCXCq8f2.js";
|
|
4
4
|
export {
|
|
5
5
|
createRadarServices
|
|
6
6
|
};
|
package/dist/{requirementDiagram-UZGBJVZJ-D0zpQnKC.js → requirementDiagram-UZGBJVZJ-B3nnp0VG.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import "./purify.es-hTCfRGdl.js";
|
|
3
|
-
import { g as utils_default } from "./chunk-S3R3BYOJ-
|
|
3
|
+
import { g as utils_default } from "./chunk-S3R3BYOJ-DVdRer7T.js";
|
|
4
4
|
import { i as log, n as __export, r as __name } from "./src-DbP20yFZ.js";
|
|
5
5
|
import { B as setAccTitle, C as getDiagramTitle, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, v as getAccTitle, z as setAccDescription } from "./chunk-ABZYJK2D-CZYCCtLy.js";
|
|
6
6
|
import "./chunk-HN2XXSSU-DAhNp1ig.js";
|
|
7
7
|
import "./chunk-CVBHYZKI-BXHgce-x.js";
|
|
8
8
|
import "./chunk-ATLVNIR6-DaOzLLgN.js";
|
|
9
9
|
import "./dist-BjWd_Ei9.js";
|
|
10
|
-
import "./chunk-JA3XYJ7Z-
|
|
11
|
-
import "./chunk-JZLCHNYA-
|
|
12
|
-
import "./chunk-QXUST7PY-
|
|
13
|
-
import { r as render, t as getRegisteredLayoutAlgorithm } from "./chunk-N4CR4FBY-
|
|
10
|
+
import "./chunk-JA3XYJ7Z-B2BoMdpr.js";
|
|
11
|
+
import "./chunk-JZLCHNYA-CkHD9mQU.js";
|
|
12
|
+
import "./chunk-QXUST7PY-BnSZbSK7.js";
|
|
13
|
+
import { r as render, t as getRegisteredLayoutAlgorithm } from "./chunk-N4CR4FBY-DDeXUk3y.js";
|
|
14
14
|
import { t as getDiagramElement } from "./chunk-55IACEB6-DRsSqxbU.js";
|
|
15
15
|
import { t as setupViewPortForSVG } from "./chunk-QN33PNHL-B9p5ojHB.js";
|
|
16
16
|
var parser = (function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import "./purify.es-hTCfRGdl.js";
|
|
3
|
-
import { g as utils_default, p as parseFontSize, t as ZERO_WIDTH_SPACE } from "./chunk-S3R3BYOJ-
|
|
3
|
+
import { g as utils_default, p as parseFontSize, t as ZERO_WIDTH_SPACE } from "./chunk-S3R3BYOJ-DVdRer7T.js";
|
|
4
4
|
import { i as log, r as __name, t as select_default } from "./src-DbP20yFZ.js";
|
|
5
5
|
import { B as setAccTitle, C as getDiagramTitle, E as getUrl, H as setConfig2, I as sanitizeText, N as renderKatexSanitized, O as hasKatex, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, c as configureSvgSize, i as calculateMathMLDimensions, r as assignWithDepth_default, s as common_default, v as getAccTitle, y as getConfig, z as setAccDescription } from "./chunk-ABZYJK2D-CZYCCtLy.js";
|
|
6
6
|
import { n as load, t as JSON_SCHEMA } from "./chunk-MI3HLSF2-AKwFNP3m.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { t as layout } from "./dagre-
|
|
2
|
-
import { t as Graph } from "./graphlib-
|
|
1
|
+
import { t as layout } from "./dagre-BLW2E2fh.js";
|
|
2
|
+
import { t as Graph } from "./graphlib-Cr691-na.js";
|
|
3
3
|
import "./purify.es-hTCfRGdl.js";
|
|
4
4
|
import { _ as basis_default } from "./step-qd10PbTJ.js";
|
|
5
5
|
import { t as line_default } from "./line-PAEmCpyD.js";
|
|
6
|
-
import { g as utils_default } from "./chunk-S3R3BYOJ-
|
|
6
|
+
import { g as utils_default } from "./chunk-S3R3BYOJ-DVdRer7T.js";
|
|
7
7
|
import { i as log, r as __name, t as select_default } from "./src-DbP20yFZ.js";
|
|
8
8
|
import { E as getUrl, b as getConfig2, c as configureSvgSize, s as common_default } from "./chunk-ABZYJK2D-CZYCCtLy.js";
|
|
9
9
|
import "./chunk-HN2XXSSU-DAhNp1ig.js";
|
|
10
10
|
import "./chunk-CVBHYZKI-BXHgce-x.js";
|
|
11
11
|
import "./chunk-ATLVNIR6-DaOzLLgN.js";
|
|
12
12
|
import "./dist-BjWd_Ei9.js";
|
|
13
|
-
import "./chunk-JA3XYJ7Z-
|
|
14
|
-
import "./chunk-JZLCHNYA-
|
|
15
|
-
import "./chunk-QXUST7PY-
|
|
16
|
-
import "./chunk-N4CR4FBY-
|
|
13
|
+
import "./chunk-JA3XYJ7Z-B2BoMdpr.js";
|
|
14
|
+
import "./chunk-JZLCHNYA-CkHD9mQU.js";
|
|
15
|
+
import "./chunk-QXUST7PY-BnSZbSK7.js";
|
|
16
|
+
import "./chunk-N4CR4FBY-DDeXUk3y.js";
|
|
17
17
|
import "./chunk-55IACEB6-DRsSqxbU.js";
|
|
18
18
|
import "./chunk-QN33PNHL-B9p5ojHB.js";
|
|
19
|
-
import { i as styles_default, n as stateDiagram_default, t as StateDB } from "./chunk-DI55MBZ5-
|
|
19
|
+
import { i as styles_default, n as stateDiagram_default, t as StateDB } from "./chunk-DI55MBZ5-CYNE3N2j.js";
|
|
20
20
|
var drawStartState = /* @__PURE__ */ __name((e) => e.append("circle").attr("class", "start-state").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit), "drawStartState"), drawDivider = /* @__PURE__ */ __name((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig2().state.textHeight).attr("class", "divider").attr("x2", getConfig2().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), drawSimpleState = /* @__PURE__ */ __name((e, h) => {
|
|
21
21
|
let g = e.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(h.id), _ = g.node().getBBox();
|
|
22
22
|
return e.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", _.width + 2 * getConfig2().state.padding).attr("height", _.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius), g;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "./purify.es-hTCfRGdl.js";
|
|
2
|
-
import "./chunk-S3R3BYOJ-
|
|
2
|
+
import "./chunk-S3R3BYOJ-DVdRer7T.js";
|
|
3
3
|
import { r as __name } from "./src-DbP20yFZ.js";
|
|
4
4
|
import "./chunk-ABZYJK2D-CZYCCtLy.js";
|
|
5
5
|
import "./chunk-HN2XXSSU-DAhNp1ig.js";
|
|
6
6
|
import "./chunk-CVBHYZKI-BXHgce-x.js";
|
|
7
7
|
import "./chunk-ATLVNIR6-DaOzLLgN.js";
|
|
8
8
|
import "./dist-BjWd_Ei9.js";
|
|
9
|
-
import "./chunk-JA3XYJ7Z-
|
|
10
|
-
import "./chunk-JZLCHNYA-
|
|
11
|
-
import "./chunk-QXUST7PY-
|
|
12
|
-
import "./chunk-N4CR4FBY-
|
|
9
|
+
import "./chunk-JA3XYJ7Z-B2BoMdpr.js";
|
|
10
|
+
import "./chunk-JZLCHNYA-CkHD9mQU.js";
|
|
11
|
+
import "./chunk-QXUST7PY-BnSZbSK7.js";
|
|
12
|
+
import "./chunk-N4CR4FBY-DDeXUk3y.js";
|
|
13
13
|
import "./chunk-55IACEB6-DRsSqxbU.js";
|
|
14
14
|
import "./chunk-QN33PNHL-B9p5ojHB.js";
|
|
15
|
-
import { i as styles_default, n as stateDiagram_default, r as stateRenderer_v3_unified_default, t as StateDB } from "./chunk-DI55MBZ5-
|
|
15
|
+
import { i as styles_default, n as stateDiagram_default, r as stateRenderer_v3_unified_default, t as StateDB } from "./chunk-DI55MBZ5-CYNE3N2j.js";
|
|
16
16
|
var diagram = {
|
|
17
17
|
parser: stateDiagram_default,
|
|
18
18
|
get db() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./chunk-TCCFYFTB-
|
|
1
|
+
import "./chunk-TCCFYFTB-BdE6BTq1.js";
|
|
2
2
|
import "./main-XimWhSi_.js";
|
|
3
|
-
import { n as createTreemapServices, t as TreemapModule } from "./chunk-B2363JML-
|
|
3
|
+
import { n as createTreemapServices, t as TreemapModule } from "./chunk-B2363JML-72CRxZbk.js";
|
|
4
4
|
export {
|
|
5
5
|
createTreemapServices
|
|
6
6
|
};
|
|
@@ -5,13 +5,13 @@ import { n as ordinal } from "./ordinal-D7fa8Sey.js";
|
|
|
5
5
|
import { t as range } from "./range-BYuZFTbA.js";
|
|
6
6
|
import "./defaultLocale-qS7DaAmi.js";
|
|
7
7
|
import { t as line_default } from "./line-PAEmCpyD.js";
|
|
8
|
-
import { i as cleanAndMerge } from "./chunk-S3R3BYOJ-
|
|
8
|
+
import { i as cleanAndMerge } from "./chunk-S3R3BYOJ-DVdRer7T.js";
|
|
9
9
|
import { n as initRange } from "./init-Cge3yl4r.js";
|
|
10
10
|
import { i as log, r as __name } from "./src-DbP20yFZ.js";
|
|
11
11
|
import { B as setAccTitle, C as getDiagramTitle, I as sanitizeText, T as getThemeVariables3, U as setDiagramTitle, _ as getAccDescription, a as clear, c as configureSvgSize, d as defaultConfig_default, v as getAccTitle, y as getConfig, z as setAccDescription } from "./chunk-ABZYJK2D-CZYCCtLy.js";
|
|
12
12
|
import { t as selectSvgElement } from "./chunk-EXTU4WIE-jUPSAk3i.js";
|
|
13
13
|
import "./dist-BjWd_Ei9.js";
|
|
14
|
-
import { t as computeDimensionOfText } from "./chunk-JA3XYJ7Z-
|
|
14
|
+
import { t as computeDimensionOfText } from "./chunk-JA3XYJ7Z-B2BoMdpr.js";
|
|
15
15
|
function band() {
|
|
16
16
|
var e = ordinal().unknown(void 0), w = e.domain, T = e.range, D = 0, O = 1, k, A, j = false, M = 0, N = 0, P = 0.5;
|
|
17
17
|
delete e.unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/islands",
|
|
3
|
-
"version": "0.23.2-
|
|
3
|
+
"version": "0.23.2-dev20",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@lezer/lr": "^1.4.8",
|
|
55
55
|
"@lezer/markdown": "^1.6.3",
|
|
56
56
|
"@lezer/python": "^1.1.18",
|
|
57
|
-
"@marimo-team/codemirror-ai": "^0.3.
|
|
57
|
+
"@marimo-team/codemirror-ai": "^0.3.7",
|
|
58
58
|
"@marimo-team/codemirror-languageserver": "^1.16.12",
|
|
59
59
|
"@marimo-team/codemirror-mcp": "^0.1.5",
|
|
60
60
|
"@marimo-team/codemirror-sql": "^0.2.4",
|
|
@@ -142,7 +142,11 @@ export const TableBottomBar = <TData,>({
|
|
|
142
142
|
|
|
143
143
|
return (
|
|
144
144
|
<span>
|
|
145
|
-
{prettifyRowColumnCount(
|
|
145
|
+
{prettifyRowColumnCount({
|
|
146
|
+
numRows: table.getRowCount(),
|
|
147
|
+
totalColumns,
|
|
148
|
+
locale,
|
|
149
|
+
})}
|
|
146
150
|
</span>
|
|
147
151
|
);
|
|
148
152
|
};
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
filterToFilterCondition,
|
|
5
|
+
filtersToFilterGroup,
|
|
6
|
+
Filter,
|
|
7
|
+
} from "../filters";
|
|
8
|
+
import {
|
|
9
|
+
FilterConditionSchema,
|
|
10
|
+
FilterGroupSchema,
|
|
11
|
+
} from "@/plugins/impl/data-frames/schema";
|
|
12
|
+
|
|
13
|
+
describe("filterToFilterCondition", () => {
|
|
14
|
+
it("returns empty array for undefined filter", () => {
|
|
15
|
+
expect(filterToFilterCondition("col", undefined)).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("handles is_null filter", () => {
|
|
19
|
+
const result = filterToFilterCondition(
|
|
20
|
+
"col",
|
|
21
|
+
Filter.number({ operator: "is_null" }),
|
|
22
|
+
);
|
|
23
|
+
expect(result).toEqual([
|
|
24
|
+
{
|
|
25
|
+
column_id: "col",
|
|
26
|
+
operator: "is_null",
|
|
27
|
+
value: undefined,
|
|
28
|
+
type: "condition",
|
|
29
|
+
negate: false,
|
|
30
|
+
},
|
|
31
|
+
]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("handles is_not_null filter", () => {
|
|
35
|
+
const result = filterToFilterCondition(
|
|
36
|
+
"col",
|
|
37
|
+
Filter.number({ operator: "is_not_null" }),
|
|
38
|
+
);
|
|
39
|
+
expect(result).toEqual([
|
|
40
|
+
{
|
|
41
|
+
column_id: "col",
|
|
42
|
+
operator: "is_not_null",
|
|
43
|
+
value: undefined,
|
|
44
|
+
type: "condition",
|
|
45
|
+
negate: false,
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("handles number filter with min only", () => {
|
|
51
|
+
const result = filterToFilterCondition("age", Filter.number({ min: 18 }));
|
|
52
|
+
expect(result).toHaveLength(1);
|
|
53
|
+
expect(result[0]).toMatchObject({
|
|
54
|
+
column_id: "age",
|
|
55
|
+
operator: ">=",
|
|
56
|
+
value: 18,
|
|
57
|
+
type: "condition",
|
|
58
|
+
negate: false,
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("handles number filter with max only", () => {
|
|
63
|
+
const result = filterToFilterCondition("age", Filter.number({ max: 65 }));
|
|
64
|
+
expect(result).toHaveLength(1);
|
|
65
|
+
expect(result[0]).toMatchObject({
|
|
66
|
+
column_id: "age",
|
|
67
|
+
operator: "<=",
|
|
68
|
+
value: 65,
|
|
69
|
+
type: "condition",
|
|
70
|
+
negate: false,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("handles number filter with min and max", () => {
|
|
75
|
+
const result = filterToFilterCondition(
|
|
76
|
+
"age",
|
|
77
|
+
Filter.number({ min: 18, max: 65 }),
|
|
78
|
+
);
|
|
79
|
+
expect(result).toHaveLength(2);
|
|
80
|
+
expect(result[0]).toMatchObject({ operator: ">=", value: 18 });
|
|
81
|
+
expect(result[1]).toMatchObject({ operator: "<=", value: 65 });
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("handles text filter", () => {
|
|
85
|
+
const result = filterToFilterCondition(
|
|
86
|
+
"name",
|
|
87
|
+
Filter.text({ text: "foo", operator: "contains" }),
|
|
88
|
+
);
|
|
89
|
+
expect(result).toEqual([
|
|
90
|
+
{
|
|
91
|
+
column_id: "name",
|
|
92
|
+
operator: "contains",
|
|
93
|
+
value: "foo",
|
|
94
|
+
type: "condition",
|
|
95
|
+
negate: false,
|
|
96
|
+
},
|
|
97
|
+
]);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("handles boolean true filter", () => {
|
|
101
|
+
const result = filterToFilterCondition(
|
|
102
|
+
"active",
|
|
103
|
+
Filter.boolean({ value: true }),
|
|
104
|
+
);
|
|
105
|
+
expect(result).toEqual([
|
|
106
|
+
{
|
|
107
|
+
column_id: "active",
|
|
108
|
+
operator: "is_true",
|
|
109
|
+
value: undefined,
|
|
110
|
+
type: "condition",
|
|
111
|
+
negate: false,
|
|
112
|
+
},
|
|
113
|
+
]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("handles boolean false filter", () => {
|
|
117
|
+
const result = filterToFilterCondition(
|
|
118
|
+
"active",
|
|
119
|
+
Filter.boolean({ value: false }),
|
|
120
|
+
);
|
|
121
|
+
expect(result).toEqual([
|
|
122
|
+
{
|
|
123
|
+
column_id: "active",
|
|
124
|
+
operator: "is_false",
|
|
125
|
+
value: undefined,
|
|
126
|
+
type: "condition",
|
|
127
|
+
negate: false,
|
|
128
|
+
},
|
|
129
|
+
]);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it("handles select in filter", () => {
|
|
133
|
+
const result = filterToFilterCondition(
|
|
134
|
+
"status",
|
|
135
|
+
Filter.select({ options: ["a", "b"], operator: "in" }),
|
|
136
|
+
);
|
|
137
|
+
expect(result).toEqual([
|
|
138
|
+
{
|
|
139
|
+
column_id: "status",
|
|
140
|
+
operator: "in",
|
|
141
|
+
value: ["a", "b"],
|
|
142
|
+
type: "condition",
|
|
143
|
+
negate: false,
|
|
144
|
+
},
|
|
145
|
+
]);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("handles date filter with min and max", () => {
|
|
149
|
+
const min = new Date("2024-01-01");
|
|
150
|
+
const max = new Date("2024-12-31");
|
|
151
|
+
const result = filterToFilterCondition(
|
|
152
|
+
"created",
|
|
153
|
+
Filter.date({ min, max }),
|
|
154
|
+
);
|
|
155
|
+
expect(result).toHaveLength(2);
|
|
156
|
+
expect(result[0]).toMatchObject({
|
|
157
|
+
operator: ">=",
|
|
158
|
+
value: min.toISOString(),
|
|
159
|
+
});
|
|
160
|
+
expect(result[1]).toMatchObject({
|
|
161
|
+
operator: "<=",
|
|
162
|
+
value: max.toISOString(),
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("every condition has type and negate fields", () => {
|
|
167
|
+
const result = filterToFilterCondition(
|
|
168
|
+
"col",
|
|
169
|
+
Filter.number({ min: 1, max: 10 }),
|
|
170
|
+
);
|
|
171
|
+
for (const condition of result) {
|
|
172
|
+
expect(condition).toHaveProperty("type", "condition");
|
|
173
|
+
expect(condition).toHaveProperty("negate", false);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
describe("filtersToFilterGroup", () => {
|
|
179
|
+
it("returns empty AND group for no filters", () => {
|
|
180
|
+
const result = filtersToFilterGroup([]);
|
|
181
|
+
expect(result).toEqual({
|
|
182
|
+
type: "group",
|
|
183
|
+
operator: "and",
|
|
184
|
+
children: [],
|
|
185
|
+
negate: false,
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("wraps single filter in AND group", () => {
|
|
190
|
+
const result = filtersToFilterGroup([
|
|
191
|
+
{ id: "age", value: Filter.number({ min: 18 }) },
|
|
192
|
+
]);
|
|
193
|
+
expect(result.type).toBe("group");
|
|
194
|
+
expect(result.operator).toBe("and");
|
|
195
|
+
expect(result.negate).toBe(false);
|
|
196
|
+
expect(result.children).toHaveLength(1);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("wraps multiple filters in AND group", () => {
|
|
200
|
+
const result = filtersToFilterGroup([
|
|
201
|
+
{ id: "age", value: Filter.number({ min: 18 }) },
|
|
202
|
+
{ id: "name", value: Filter.text({ text: "foo", operator: "contains" }) },
|
|
203
|
+
]);
|
|
204
|
+
expect(result.children).toHaveLength(2);
|
|
205
|
+
expect(result.operator).toBe("and");
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it("flattens multi-condition filters", () => {
|
|
209
|
+
const result = filtersToFilterGroup([
|
|
210
|
+
{ id: "age", value: Filter.number({ min: 18, max: 65 }) },
|
|
211
|
+
]);
|
|
212
|
+
// min + max = 2 conditions
|
|
213
|
+
expect(result.children).toHaveLength(2);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
describe("schema validation", () => {
|
|
218
|
+
it("FilterConditionSchema accepts valid condition", () => {
|
|
219
|
+
const result = FilterConditionSchema.safeParse({
|
|
220
|
+
column_id: "age",
|
|
221
|
+
operator: ">=",
|
|
222
|
+
value: 18,
|
|
223
|
+
});
|
|
224
|
+
expect(result.success).toBe(true);
|
|
225
|
+
if (result.success) {
|
|
226
|
+
expect(result.data.type).toBe("condition");
|
|
227
|
+
expect(result.data.negate).toBe(false);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("FilterConditionSchema defaults type and negate", () => {
|
|
232
|
+
const result = FilterConditionSchema.safeParse({
|
|
233
|
+
column_id: "age",
|
|
234
|
+
operator: "==",
|
|
235
|
+
value: 5,
|
|
236
|
+
});
|
|
237
|
+
expect(result.success).toBe(true);
|
|
238
|
+
if (result.success) {
|
|
239
|
+
expect(result.data.type).toBe("condition");
|
|
240
|
+
expect(result.data.negate).toBe(false);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("FilterConditionSchema accepts negate=true", () => {
|
|
245
|
+
const result = FilterConditionSchema.safeParse({
|
|
246
|
+
column_id: "age",
|
|
247
|
+
operator: "==",
|
|
248
|
+
value: 5,
|
|
249
|
+
negate: true,
|
|
250
|
+
});
|
|
251
|
+
expect(result.success).toBe(true);
|
|
252
|
+
if (result.success) {
|
|
253
|
+
expect(result.data.negate).toBe(true);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("FilterGroupSchema accepts valid group", () => {
|
|
258
|
+
const result = FilterGroupSchema.safeParse({
|
|
259
|
+
type: "group",
|
|
260
|
+
operator: "and",
|
|
261
|
+
children: [{ column_id: "age", operator: ">=", value: 18 }],
|
|
262
|
+
});
|
|
263
|
+
expect(result.success).toBe(true);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it("FilterGroupSchema accepts nested groups", () => {
|
|
267
|
+
const result = FilterGroupSchema.safeParse({
|
|
268
|
+
type: "group",
|
|
269
|
+
operator: "or",
|
|
270
|
+
children: [
|
|
271
|
+
{
|
|
272
|
+
type: "group",
|
|
273
|
+
operator: "and",
|
|
274
|
+
children: [
|
|
275
|
+
{ column_id: "a", operator: "==", value: 1 },
|
|
276
|
+
{ column_id: "b", operator: ">", value: 2 },
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
{ column_id: "c", operator: "==", value: 3 },
|
|
280
|
+
],
|
|
281
|
+
});
|
|
282
|
+
expect(result.success).toBe(true);
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("FilterGroupSchema rejects invalid operator", () => {
|
|
286
|
+
const result = FilterGroupSchema.safeParse({
|
|
287
|
+
type: "group",
|
|
288
|
+
operator: "xor",
|
|
289
|
+
children: [],
|
|
290
|
+
});
|
|
291
|
+
expect(result.success).toBe(false);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it("FilterGroupSchema defaults fields", () => {
|
|
295
|
+
const result = FilterGroupSchema.safeParse({});
|
|
296
|
+
expect(result.success).toBe(true);
|
|
297
|
+
if (result.success) {
|
|
298
|
+
expect(result.data.type).toBe("group");
|
|
299
|
+
expect(result.data.operator).toBe("and");
|
|
300
|
+
expect(result.data.children).toEqual([]);
|
|
301
|
+
expect(result.data.negate).toBe(false);
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
@@ -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") || ""}
|