@marimo-team/islands 0.23.9-dev2 → 0.23.9-dev4
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/{ConnectedDataExplorerComponent-2lBNiUv6.js → ConnectedDataExplorerComponent-OzrfMM5L.js} +20 -20
- package/dist/ErrorBoundary-rULOrC_p.js +175 -0
- package/dist/{ImageComparisonComponent-CNHIsPDj.js → ImageComparisonComponent-CHrI72em.js} +1 -1
- package/dist/{Plot-4wn-lMVn.js → Plot-CAYS29h9.js} +1 -1
- package/dist/{_baseUniq-CxZRxRRo.js → _baseUniq-B_2Hw7zG.js} +3 -3
- package/dist/{any-language-editor-VWs_7v27.js → any-language-editor-DfdpyDv_.js} +23 -23
- package/dist/architecture-7HQA4BMR-Kyc44TmC.js +6 -0
- package/dist/{architectureDiagram-VXUJARFQ-CXVJxFhH.js → architectureDiagram-VXUJARFQ-CT2SuxNw.js} +15 -15
- package/dist/{arrays-CldYf7p7.js → arrays-sEtDRoG4.js} +1 -1
- package/dist/{blockDiagram-VD42YOAC-DGDaxR8I.js → blockDiagram-VD42YOAC-Dy7hlFla.js} +7 -7
- package/dist/{button-Dj4BTre0.js → button-C5K9fIPF.js} +2 -2
- package/dist/{c4Diagram-YG6GDRKO-C2hc6ne8.js → c4Diagram-YG6GDRKO-BXlAmZ8Z.js} +4 -4
- package/dist/{capabilities-C9rrYCzf.js → capabilities-BceAxrAW.js} +2 -2
- package/dist/{channel-BBoIVUrJ.js → channel-D_PHgcig.js} +1 -1
- package/dist/{chat-ui-D3XBept8.js → chat-ui-BDI3FMI8.js} +29 -29
- package/dist/{check-BcUIXnUT.js → check-DTbrK0zt.js} +1 -1
- package/dist/{chunk-4F5CHEZ2-BZq7Kom7.js → chunk-4F5CHEZ2-D9nGEHV8.js} +1 -1
- package/dist/{chunk-5FQGJX7Z-BOg95xG5.js → chunk-5FQGJX7Z-BNjes6Yx.js} +5 -5
- package/dist/{chunk-ABZYJK2D-D0cLy8Bb.js → chunk-ABZYJK2D-Dz0-H2B5.js} +1 -1
- package/dist/{chunk-ATLVNIR6-BXsEjlHF.js → chunk-ATLVNIR6-o0Z5MZLd.js} +1 -1
- package/dist/{chunk-B2363JML-D9-XOau1.js → chunk-B2363JML-KEJpLGGP.js} +1 -1
- package/dist/{chunk-B4BG7PRW-Q1usn6T3.js → chunk-B4BG7PRW-BL98U9B4.js} +4 -4
- package/dist/{chunk-DI55MBZ5-D1qLYNrb.js → chunk-DI55MBZ5-Dwkn0LWm.js} +4 -4
- package/dist/{chunk-EXTU4WIE-BKNXdLmD.js → chunk-EXTU4WIE-9sNjmQrB.js} +1 -1
- package/dist/{chunk-FRFDVMJY-BSBUAX7r.js → chunk-FRFDVMJY-DzQqMWrl.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-D6c6cOBG.js → chunk-JA3XYJ7Z-C32Y7Epf.js} +2 -2
- package/dist/{chunk-JZLCHNYA-BvsPHJmL.js → chunk-JZLCHNYA-C6ftyVMN.js} +4 -4
- package/dist/{chunk-N4CR4FBY-8ycT-O9a.js → chunk-N4CR4FBY-DUhGZhZs.js} +5 -5
- package/dist/{chunk-PL6DKKU2-B0MTXvyc.js → chunk-PL6DKKU2-D7km-08O.js} +1 -1
- package/dist/{chunk-QN33PNHL-Bb-eUBW3.js → chunk-QN33PNHL-0K6SDYn3.js} +1 -1
- package/dist/{chunk-QXUST7PY-DV8yRwBd.js → chunk-QXUST7PY-DMhsRpYK.js} +5 -5
- package/dist/{chunk-S3R3BYOJ-mQeCz5CE.js → chunk-S3R3BYOJ-oAe3dEbO.js} +3 -3
- package/dist/{chunk-SJTYNZTY-CEG4F0pB.js → chunk-SJTYNZTY-BkJrPRFC.js} +1 -1
- package/dist/{chunk-TCCFYFTB-d3HOqL2I.js → chunk-TCCFYFTB-D58KeXnC.js} +6 -6
- package/dist/{chunk-TQ3KTPDO-DiCtqVSi.js → chunk-TQ3KTPDO-D_yA_wAb.js} +1 -1
- package/dist/{chunk-TZMSLE5B-BqW10dHe.js → chunk-TZMSLE5B-yBKS_DQU.js} +1 -1
- package/dist/{chunk-UMXZTB3W-97iS1iEl.js → chunk-UMXZTB3W-D7uwvNjd.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG--Yh__LHb.js → classDiagram-2ON5EDUG-QjoAcuFE.js} +10 -10
- package/dist/{classDiagram-v2-WZHVMYZB-BC7X7Xtc.js → classDiagram-v2-WZHVMYZB-bUCv4gu2.js} +10 -10
- package/dist/{clone-BuIIsfA8.js → clone-Q4Fqwn6q.js} +1 -1
- package/dist/{code-block-37QAKDTI-BsGy1AOJ.js → code-block-37QAKDTI-m92Yc8pv.js} +2 -2
- package/dist/{code-visibility-Dt0Aq6-t.js → code-visibility-VZebNmSs.js} +7073 -7439
- package/dist/{constants-D0gkYoE2.js → constants-T20xxyNf.js} +2 -2
- package/dist/{copy-DLf4aN7I.js → copy-BuQpJEzp.js} +2 -2
- package/dist/{dagre-6UL2VRFP-DRBWoQUw.js → dagre-6UL2VRFP-J0JKgwOt.js} +11 -11
- package/dist/{dagre-VYEPqXIV.js → dagre-By_QsQgc.js} +11 -11
- package/dist/{data-grid-overlay-editor-efe5ZagF.js → data-grid-overlay-editor-mfEJ5475.js} +2 -2
- package/dist/{diagram-PSM6KHXK-H66ATWP2.js → diagram-PSM6KHXK-DYgJuNk9.js} +18 -18
- package/dist/{diagram-QEK2KX5R-DItl5Wns.js → diagram-QEK2KX5R-CKdBR2sb.js} +14 -14
- package/dist/{diagram-S2PKOQOG-CtuW_ZuL.js → diagram-S2PKOQOG-Dpi7mo5W.js} +14 -14
- package/dist/dist-0Fif7jnk.js +5 -0
- package/dist/{dist-Dh3wkoyH.js → dist-4j4c7bjm.js} +2 -2
- package/dist/{dist-CDFZi-QD.js → dist-B3P2fFpz.js} +1 -1
- package/dist/{dist-BNyrZfqT.js → dist-B3pZ0Ab6.js} +2 -2
- package/dist/dist-B5h_9sHB.js +6 -0
- package/dist/dist-B9M6R5ye.js +5 -0
- package/dist/dist-BCt3tnck.js +8 -0
- package/dist/{dist-BrBucRXs.js → dist-BTfv03uy.js} +2 -2
- package/dist/dist-BUIJwMwn.js +8 -0
- package/dist/{dist-CYEylvZA.js → dist-BbbIBDiQ.js} +1 -1
- package/dist/{dist-KnujRhFL.js → dist-BcuoonNH.js} +4 -4
- package/dist/{dist-DJ6zJQZ4.js → dist-Bde4a2kU.js} +2 -2
- package/dist/{dist-t_qL7eB8.js → dist-Bfwsv11D.js} +2 -2
- package/dist/{dist-CNtV21T_.js → dist-BhM8gdSO.js} +4 -4
- package/dist/{dist-nuW5EDYT.js → dist-BotSqB48.js} +2 -2
- package/dist/dist-BpquMd3k.js +5 -0
- package/dist/dist-BzJsqYfz.js +5 -0
- package/dist/{dist-D029TiHd.js → dist-Bz_sYWbr.js} +2 -2
- package/dist/{dist-D3ZI9nhS.js → dist-C1BYNeCR.js} +4 -4
- package/dist/{dist-Bc5pmZIw.js → dist-C5VC_yzu.js} +1 -1
- package/dist/dist-CA5ELXAf.js +6 -0
- package/dist/dist-CLBRs6Uv.js +5 -0
- package/dist/{dist-Dhk6FMb0.js → dist-CLJWPTX2.js} +3 -3
- package/dist/{dist-C34oIrQ9.js → dist-CLUtPrdy.js} +1 -1
- package/dist/dist-CStVCMbq.js +5 -0
- package/dist/{dist-B8RaFTRF.js → dist-CUCNs1ja.js} +2 -2
- package/dist/dist-CZRIEY3Y.js +8 -0
- package/dist/{dist-UcOPnRMa.js → dist-CcXxepx6.js} +3 -3
- package/dist/dist-CuUHbFD0.js +5 -0
- package/dist/{dist-B8BjrFUE.js → dist-Cy1WxgBD.js} +5 -5
- package/dist/{dist-WdPUFc56.js → dist-D4CewLk6.js} +1 -1
- package/dist/{dist-DMZNjfX4.js → dist-DRfcqpxJ.js} +2 -2
- package/dist/dist-DV7Iabxb.js +8 -0
- package/dist/{dist-usPCDYx8.js → dist-D_bzzWBm.js} +1 -1
- package/dist/{dist-BvCfQQQE.js → dist-DgnE8F-r.js} +1 -1
- package/dist/{dist-JEhxD_cn.js → dist-DhHh0jLg.js} +1 -1
- package/dist/{dist-DGAfI2rB.js → dist-DqAWR3CS.js} +2 -2
- package/dist/{dist--sWVZwjW.js → dist-Du8WkPuU.js} +1 -1
- package/dist/dist-DuEeHMvL.js +5 -0
- package/dist/{dist-BTyJtnNg.js → dist-DxvORzUR.js} +1 -1
- package/dist/{dist-B507mf_I.js → dist-RqXTaiir.js} +2 -2
- package/dist/{dist-Yrfc6L0I.js → dist-fQ0ViXGs.js} +3 -3
- package/dist/{dist-B4LJpMEg.js → dist-h2c8sZvT.js} +1 -1
- package/dist/{dist-C2ej4eOH.js → dist-luvabDEB.js} +2 -2
- package/dist/{dist-B52GXZbd.js → dist-p2qyWijU.js} +2 -2
- package/dist/{erDiagram-Q2GNP2WA--19X2kU5.js → erDiagram-Q2GNP2WA-BU-m41EQ.js} +10 -10
- package/dist/{error-banner-CVkfBUT3.js → error-banner-5bz0L9hS.js} +3 -3
- package/dist/{esm-CWp0KQeK.js → esm-BfhQmZjp.js} +4 -4
- package/dist/{esm-DjNnlmpf.js → esm-Duie8iU-.js} +23 -23
- package/dist/{extends-vAi97cpa.js → extends-BgdxCfYu.js} +6 -6
- package/dist/{flatten-CzBvFdvC.js → flatten-Bbw7g6-K.js} +1 -1
- package/dist/{flowDiagram-NV44I4VS-DQmWlo7f.js → flowDiagram-NV44I4VS-CRoXKjGq.js} +10 -10
- package/dist/{formats-Dsy9kkZu.js → formats-DQ5qjo_Q.js} +4 -4
- package/dist/{ganttDiagram-JELNMOA3-BOGXJ8Lk.js → ganttDiagram-JELNMOA3-7mq5f9cO.js} +7 -7
- package/dist/{gitGraph-G5XIXVHT-DGlbae5m.js → gitGraph-G5XIXVHT-DiniR35k.js} +3 -3
- package/dist/{gitGraphDiagram-V2S2FVAM-DjzxfF0P.js → gitGraphDiagram-V2S2FVAM-Dfuokq6w.js} +13 -13
- package/dist/{glide-data-editor-DucgdjRo.js → glide-data-editor-DqRY9naW.js} +557 -557
- package/dist/{graphlib-CVPKjKCS.js → graphlib-Ns7y5crs.js} +5 -5
- package/dist/{hasIn-COs6vImh.js → hasIn-Deg7jl_j.js} +3 -3
- package/dist/{html-to-image-CpggM7u1.js → html-to-image-CiSinpSR.js} +109 -109
- package/dist/{info-VBDWY6EO-D2lvLLw5.js → info-VBDWY6EO-DVZvGhkQ.js} +3 -3
- package/dist/{infoDiagram-HS3SLOUP-ChNufFsP.js → infoDiagram-HS3SLOUP-CEnzWruK.js} +13 -13
- package/dist/{input-D4kjoQUB.js → input-CZD2z6X2.js} +70 -67
- package/dist/{isEmpty-Dd8mx_WL.js → isEmpty-CJJMn-QP.js} +1 -1
- package/dist/{isSymbol-BvIfMnn6.js → isSymbol-CoUCgMCM.js} +1 -1
- package/dist/{journeyDiagram-XKPGCS4Q-BO_O4Ij1.js → journeyDiagram-XKPGCS4Q-8XYSU1GI.js} +3 -3
- package/dist/{kanban-definition-3W4ZIXB7-CPpiiiWk.js → kanban-definition-3W4ZIXB7--9pT9z1R.js} +7 -7
- package/dist/{label-BLqV33b1.js → label-LWtdw5i8.js} +3 -3
- package/dist/{linear-2NnK4cxi.js → linear-B5-AFRiR.js} +2 -2
- package/dist/{loader-Dr8Qem8p.js → loader-BWLPpjKK.js} +2 -2
- package/dist/main.js +1141 -987
- package/dist/{memoize-C9ltv0Cw.js → memoize-BOtf2yFf.js} +1 -1
- package/dist/{merge-CHn7Yx0N.js → merge-Be1CqGnU.js} +1 -1
- package/dist/mermaid-4DMBBIKO-DIdL224_.js +6 -0
- package/dist/{mermaid-DO-Daq7u.js → mermaid-IU93XzmY.js} +44 -44
- package/dist/{mermaid-parser.core-DreccfmS.js → mermaid-parser.core-C3XRsazI.js} +8 -8
- package/dist/{min-BNz2lZfk.js → min-Dtgc8txR.js} +4 -4
- package/dist/{mindmap-definition-VGOIOE7T-CC1_Vl0f.js → mindmap-definition-VGOIOE7T-B-4mnfFG.js} +9 -9
- package/dist/{now-Sgq5m3D-.js → now-Ch98bJO_.js} +2 -2
- package/dist/{number-overlay-editor-CpKi64Fy.js → number-overlay-editor-D-a0qCT8.js} +1 -1
- package/dist/{once-rJImu7SE.js → once-DPuqGUeo.js} +1 -1
- package/dist/{packet-DYOGHKS2-CmWtF3uO.js → packet-DYOGHKS2-34raHOiB.js} +3 -3
- package/dist/{pick-CRAXxDYn.js → pick-D1Qo8s2C.js} +4 -4
- package/dist/{pie-VRWISCQL-B6u8vus8.js → pie-VRWISCQL-BaLlzZa3.js} +3 -3
- package/dist/{pieDiagram-ADFJNKIX-Di34MOFQ.js → pieDiagram-ADFJNKIX-Cr3cNpZY.js} +15 -15
- package/dist/{precisionRound-CnHPY_5v.js → precisionRound-Tqb4mg-H.js} +1 -1
- package/dist/{process-output-X8TR20AK.js → process-output-5qJjMRKh.js} +4 -4
- package/dist/{quadrantDiagram-AYHSOK5B-B9kVk1ny.js → quadrantDiagram-AYHSOK5B-BuNL8Q93.js} +4 -4
- package/dist/{radar-ZZBFDIW7-XAmXSa8s.js → radar-ZZBFDIW7-Ci7bfoZa.js} +3 -3
- package/dist/{react-vega-Dh6-UKKe.js → react-vega-B0sAlDTL.js} +9 -9
- package/dist/react-vega-B6ncY2Tp.js +9 -0
- package/dist/{requirementDiagram-UZGBJVZJ-BxGfGYEx.js → requirementDiagram-UZGBJVZJ-BG2lLUN1.js} +9 -9
- package/dist/{reveal-component-Cj2fUG1Q.js → reveal-component-DZtPMEoM.js} +28 -28
- package/dist/{sankeyDiagram-TZEHDZUN-D09PBJ-n.js → sankeyDiagram-TZEHDZUN-DMal8sps.js} +3 -3
- package/dist/{sequenceDiagram-WL72ISMW-t_Dpemj0.js → sequenceDiagram-WL72ISMW-DT6Tk-Eo.js} +4 -4
- package/dist/{spec-hVaaZsY5.js → spec-a6DaqW__.js} +4 -4
- package/dist/{stateDiagram-FKZM4ZOC-B18gTP_j.js → stateDiagram-FKZM4ZOC-CB_lodq3.js} +12 -12
- package/dist/{stateDiagram-v2-4FDKWEC3-B6e_t14A.js → stateDiagram-v2-4FDKWEC3-E0RGjKsm.js} +10 -10
- package/dist/stex-KfRnSHzF.js +4 -0
- package/dist/{strings-BiIhGaI8.js → strings-Bu3vlb6W.js} +7 -7
- package/dist/style.css +1 -1
- package/dist/{swiper-component-DlD2GU2g.js → swiper-component-B2t5sN1q.js} +3 -3
- package/dist/{time-C1SGcFMH.js → time-CsmIF9YZ.js} +3 -3
- package/dist/{timeline-definition-IT6M3QCI-DJnh1ks5.js → timeline-definition-IT6M3QCI-NfSKRvH0.js} +2 -2
- package/dist/{toDate-CIpC_34u.js → toDate-ZVVIBmdk.js} +5 -5
- package/dist/{tooltip-DRaMBu06.js → tooltip-C5FYOpQc.js} +4 -4
- package/dist/{treemap-GDKQZRPO-Du95DV6u.js → treemap-GDKQZRPO-Cl6OQh8D.js} +3 -3
- package/dist/{types-Dzuoc3LN.js → types-CVvp1fKr.js} +2 -9
- package/dist/{useAsyncData-C56Khv_R.js → useAsyncData-C008zUPi.js} +2 -2
- package/dist/{useDateFormatter-B_9k85Ex.js → useDateFormatter-BA4FCquG.js} +2 -2
- package/dist/{useDeepCompareMemoize-Dt98v2ua.js → useDeepCompareMemoize-BrA3_n61.js} +1 -1
- package/dist/{useIframeCapabilities-BkYHTrss.js → useIframeCapabilities-C4JTXTIh.js} +1 -1
- package/dist/{useLifecycle-BF6-z62y.js → useLifecycle-BNaoJ5a4.js} +4 -4
- package/dist/{useTheme-DykuNHR2.js → useTheme-7O0YWlE5.js} +3 -3
- package/dist/{vega-component-cSdqoAxe.js → vega-component-DJNmOdUj.js} +18 -18
- package/dist/{vega-loader.browser-3_z8GoFC.js → vega-loader.browser-CZ-J8Py3.js} +3 -3
- package/dist/{xychartDiagram-PRI3JC2R-Dk2d_bX0.js → xychartDiagram-PRI3JC2R-BvwftqMA.js} +9 -9
- package/dist/{zod-BWkcDORu.js → zod-CoBiJ5v4.js} +3 -3
- package/package.json +1 -1
- package/src/components/data-table/__tests__/column-header.test.tsx +110 -277
- package/src/components/data-table/__tests__/date-filter-inputs.test.tsx +33 -0
- package/src/components/data-table/__tests__/filter-pill-editor.test.tsx +75 -38
- package/src/components/data-table/__tests__/filter-pills.test.tsx +287 -0
- package/src/components/data-table/__tests__/filter-test-utils.ts +47 -0
- package/src/components/data-table/__tests__/filters.test.ts +5 -5
- package/src/components/data-table/add-filter-button.tsx +85 -0
- package/src/components/data-table/column-header.tsx +92 -691
- package/src/components/data-table/context-menu.tsx +26 -12
- package/src/components/data-table/data-table.tsx +89 -57
- package/src/components/data-table/date-filter-inputs.tsx +13 -10
- package/src/components/data-table/filter-by-values-picker.tsx +13 -19
- package/src/components/data-table/filter-editor-context.tsx +34 -0
- package/src/components/data-table/filter-pill-editor.tsx +152 -175
- package/src/components/data-table/filter-pills.tsx +190 -153
- package/src/components/data-table/filters/builders.ts +102 -0
- package/src/components/data-table/filters/defaults.ts +31 -0
- package/src/components/data-table/filters/format.ts +131 -0
- package/src/components/data-table/filters/guards.ts +51 -0
- package/src/components/data-table/filters/index.ts +7 -0
- package/src/components/data-table/filters/operators.ts +76 -0
- package/src/components/data-table/filters/serialize.ts +186 -0
- package/src/components/data-table/filters/types.ts +33 -0
- package/src/components/data-table/header-items.tsx +6 -83
- package/src/components/data-table/value-chips.tsx +52 -0
- package/src/components/dependency-graph/minimap-content.tsx +2 -2
- package/src/components/ui/number-field.tsx +13 -1
- package/src/utils/dates.ts +39 -0
- package/dist/ErrorBoundary-D3wrPNma.js +0 -167
- package/dist/architecture-7HQA4BMR-CS9jOrqM.js +0 -6
- package/dist/dist-21ButRCu.js +0 -8
- package/dist/dist-B--tLnAP.js +0 -5
- package/dist/dist-BoHGySTM.js +0 -5
- package/dist/dist-ByAz19Qc.js +0 -5
- package/dist/dist-C1Ap5CYU.js +0 -5
- package/dist/dist-C93EysN4.js +0 -5
- package/dist/dist-CY-lVor6.js +0 -8
- package/dist/dist-CYDuv4bR.js +0 -8
- package/dist/dist-Cfo5EE2t.js +0 -6
- package/dist/dist-CjivSDvN.js +0 -5
- package/dist/dist-Cqwx-MH7.js +0 -5
- package/dist/dist-DbpcoFAV.js +0 -6
- package/dist/dist-FUNenbiQ.js +0 -5
- package/dist/dist-zhSud5X3.js +0 -8
- package/dist/mermaid-4DMBBIKO-B7VQMwJx.js +0 -6
- package/dist/react-vega-Cavbrg4l.js +0 -9
- package/dist/stex-ChDHQs3R.js +0 -4
- package/src/components/data-table/__tests__/column-header.test.ts +0 -65
- package/src/components/data-table/filters.ts +0 -386
- /package/dist/{_baseFor-BGiY-cm1.js → _baseFor-4jw-lnCC.js} +0 -0
- /package/dist/{clsx-CyyyQ8Ue.js → clsx-CIWA5tNO.js} +0 -0
- /package/dist/{defaultLocale-DoeErsX2.js → defaultLocale-BoHTsDG6.js} +0 -0
- /package/dist/{defaultLocale-BpsHxBd7.js → defaultLocale-u-3osm0P.js} +0 -0
- /package/dist/{dist-CCADb07R.js → dist-DNdhYsgW.js} +0 -0
- /package/dist/{emotion-is-prop-valid.esm-DtW2o230.js → emotion-is-prop-valid.esm-DzSb5hsH.js} +0 -0
- /package/dist/{invariant-UcGKQEhF.js → invariant-wRzNXIsJ.js} +0 -0
- /package/dist/{jsx-runtime-COBk7ree.js → jsx-runtime-DebpN0FN.js} +0 -0
- /package/dist/{main-CThhXnXU.js → main-Tj_-QTyF.js} +0 -0
- /package/dist/{micromark-factory-space-CwHmg6iz.js → micromark-factory-space-DF2w36zS.js} +0 -0
- /package/dist/{ordinal-B43ZeR68.js → ordinal-ArJavP1Q.js} +0 -0
- /package/dist/{purify.es-DT70lfR0.js → purify.es-H92eMd9-.js} +0 -0
- /package/dist/{range-BOiA8qqU.js → range-C-rmrM1O.js} +0 -0
- /package/dist/{react-dom-BWRJ_g_k.js → react-dom-BTJzcVJ9.js} +0 -0
- /package/dist/{stex-DrxP7bb3.js → stex-BIsgBmK4.js} +0 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import type { ColumnFiltersState } from "@tanstack/react-table";
|
|
3
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
4
|
+
import { beforeAll, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
6
|
+
import { AddFilterButton } from "../add-filter-button";
|
|
7
|
+
import { FilterPills } from "../filter-pills";
|
|
8
|
+
import { buildEditorSnapshot } from "../filter-pill-editor";
|
|
9
|
+
import { Filter, type Snapshot } from "../filters";
|
|
10
|
+
import {
|
|
11
|
+
buildFilterTestTable,
|
|
12
|
+
type FilterColumnSpec,
|
|
13
|
+
} from "./filter-test-utils";
|
|
14
|
+
|
|
15
|
+
const renderWithProviders = (ui: React.ReactElement) =>
|
|
16
|
+
render(<TooltipProvider>{ui}</TooltipProvider>);
|
|
17
|
+
|
|
18
|
+
beforeAll(() => {
|
|
19
|
+
global.HTMLElement.prototype.scrollIntoView = () => {
|
|
20
|
+
// jsdom does not implement scrollIntoView; cmdk calls it on selection.
|
|
21
|
+
};
|
|
22
|
+
if (!global.HTMLElement.prototype.hasPointerCapture) {
|
|
23
|
+
global.HTMLElement.prototype.hasPointerCapture = () => false;
|
|
24
|
+
}
|
|
25
|
+
if (!global.HTMLElement.prototype.scrollTo) {
|
|
26
|
+
global.HTMLElement.prototype.scrollTo = () => {
|
|
27
|
+
// noop for jsdom
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const DEFAULT_COLUMNS: FilterColumnSpec[] = [
|
|
33
|
+
{ id: "name", filterType: "text" },
|
|
34
|
+
{ id: "age", filterType: "number" },
|
|
35
|
+
{ id: "when", filterType: "date" },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const mockTable = (specs: FilterColumnSpec[] = DEFAULT_COLUMNS) =>
|
|
39
|
+
buildFilterTestTable(specs).table;
|
|
40
|
+
|
|
41
|
+
describe("FilterPills — strip gating", () => {
|
|
42
|
+
it("renders nothing when there are no filters and no pending add-snapshot", () => {
|
|
43
|
+
const { container } = renderWithProviders(
|
|
44
|
+
<FilterPills
|
|
45
|
+
filters={[]}
|
|
46
|
+
table={mockTable()}
|
|
47
|
+
addFilterSnapshot={null}
|
|
48
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
49
|
+
/>,
|
|
50
|
+
);
|
|
51
|
+
expect(container.firstChild).toBeNull();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("renders the strip and + button when at least one filter exists", () => {
|
|
55
|
+
const filters: ColumnFiltersState = [
|
|
56
|
+
{
|
|
57
|
+
id: "age",
|
|
58
|
+
value: Filter.number({ operator: ">", value: 18 }),
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
renderWithProviders(
|
|
62
|
+
<FilterPills
|
|
63
|
+
filters={filters}
|
|
64
|
+
table={mockTable()}
|
|
65
|
+
addFilterSnapshot={null}
|
|
66
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
67
|
+
/>,
|
|
68
|
+
);
|
|
69
|
+
expect(screen.getByLabelText("Add filter")).toBeInTheDocument();
|
|
70
|
+
expect(screen.getByLabelText("Edit filter on age")).toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("mounts the strip with no filters when a pending add-snapshot is set", () => {
|
|
74
|
+
const table = mockTable();
|
|
75
|
+
const snapshot: Snapshot = buildEditorSnapshot(table.getAllColumns()[0]);
|
|
76
|
+
renderWithProviders(
|
|
77
|
+
<FilterPills
|
|
78
|
+
filters={[]}
|
|
79
|
+
table={table}
|
|
80
|
+
addFilterSnapshot={snapshot}
|
|
81
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
82
|
+
/>,
|
|
83
|
+
);
|
|
84
|
+
expect(screen.getByLabelText("Add filter")).toBeInTheDocument();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
describe("AddFilterButton", () => {
|
|
89
|
+
it("does not render when there are no editable columns", () => {
|
|
90
|
+
const table = mockTable([{ id: "opaque" }]);
|
|
91
|
+
const { container } = renderWithProviders(
|
|
92
|
+
<AddFilterButton
|
|
93
|
+
table={table}
|
|
94
|
+
snapshot={null}
|
|
95
|
+
onSnapshotChange={vi.fn()}
|
|
96
|
+
/>,
|
|
97
|
+
);
|
|
98
|
+
expect(container.firstChild).toBeNull();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("seeds the editor with the first editable column's dtype default on click", () => {
|
|
102
|
+
const table = mockTable();
|
|
103
|
+
const onSnapshotChange = vi.fn();
|
|
104
|
+
renderWithProviders(
|
|
105
|
+
<AddFilterButton
|
|
106
|
+
table={table}
|
|
107
|
+
snapshot={null}
|
|
108
|
+
onSnapshotChange={onSnapshotChange}
|
|
109
|
+
/>,
|
|
110
|
+
);
|
|
111
|
+
fireEvent.click(screen.getByLabelText("Add filter"));
|
|
112
|
+
expect(onSnapshotChange).toHaveBeenCalledTimes(1);
|
|
113
|
+
expect(onSnapshotChange).toHaveBeenCalledWith({
|
|
114
|
+
columnId: "name",
|
|
115
|
+
value: { type: "text", operator: "contains" },
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("clears the snapshot when the popover closes", () => {
|
|
120
|
+
const onSnapshotChange = vi.fn();
|
|
121
|
+
const snapshot: Snapshot = {
|
|
122
|
+
columnId: "age",
|
|
123
|
+
value: Filter.number({ operator: ">", value: 5 }),
|
|
124
|
+
};
|
|
125
|
+
renderWithProviders(
|
|
126
|
+
<AddFilterButton
|
|
127
|
+
table={mockTable()}
|
|
128
|
+
snapshot={snapshot}
|
|
129
|
+
onSnapshotChange={onSnapshotChange}
|
|
130
|
+
/>,
|
|
131
|
+
);
|
|
132
|
+
// Pressing Escape closes the popover via radix.
|
|
133
|
+
fireEvent.keyDown(document.body, { key: "Escape" });
|
|
134
|
+
expect(onSnapshotChange).toHaveBeenCalledWith(null);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("renders the editor when a snapshot is provided", () => {
|
|
138
|
+
renderWithProviders(
|
|
139
|
+
<AddFilterButton
|
|
140
|
+
table={mockTable()}
|
|
141
|
+
snapshot={{
|
|
142
|
+
columnId: "age",
|
|
143
|
+
value: Filter.number({ operator: ">", value: 7 }),
|
|
144
|
+
}}
|
|
145
|
+
onSnapshotChange={vi.fn()}
|
|
146
|
+
/>,
|
|
147
|
+
);
|
|
148
|
+
expect(screen.getByLabelText("Apply filter")).toBeInTheDocument();
|
|
149
|
+
expect(screen.getByDisplayValue("7")).toBeInTheDocument();
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
describe("FilterPills — pill edit", () => {
|
|
154
|
+
it("opens the editor with the pill's snapshot when clicked", () => {
|
|
155
|
+
const filters: ColumnFiltersState = [
|
|
156
|
+
{
|
|
157
|
+
id: "age",
|
|
158
|
+
value: Filter.number({ operator: ">", value: 42 }),
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
renderWithProviders(
|
|
162
|
+
<FilterPills
|
|
163
|
+
filters={filters}
|
|
164
|
+
table={mockTable()}
|
|
165
|
+
addFilterSnapshot={null}
|
|
166
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
167
|
+
/>,
|
|
168
|
+
);
|
|
169
|
+
fireEvent.click(screen.getByLabelText("Edit filter on age"));
|
|
170
|
+
expect(screen.getByLabelText("Apply filter")).toBeInTheDocument();
|
|
171
|
+
expect(screen.getByDisplayValue("42")).toBeInTheDocument();
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it("splices in place via editIndex when applying an edit", () => {
|
|
175
|
+
const { table, setColumnFilters } = buildFilterTestTable(DEFAULT_COLUMNS);
|
|
176
|
+
const filters: ColumnFiltersState = [
|
|
177
|
+
{
|
|
178
|
+
id: "name",
|
|
179
|
+
value: Filter.text({ operator: "contains", text: "foo" }),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: "age",
|
|
183
|
+
value: Filter.number({ operator: ">", value: 1 }),
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
renderWithProviders(
|
|
187
|
+
<FilterPills
|
|
188
|
+
filters={filters}
|
|
189
|
+
table={table}
|
|
190
|
+
addFilterSnapshot={null}
|
|
191
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
192
|
+
/>,
|
|
193
|
+
);
|
|
194
|
+
fireEvent.click(screen.getByLabelText("Edit filter on age"));
|
|
195
|
+
fireEvent.click(screen.getByLabelText("Apply filter"));
|
|
196
|
+
|
|
197
|
+
const updater = setColumnFilters.mock.calls[0][0];
|
|
198
|
+
const next = updater(filters);
|
|
199
|
+
expect(next).toHaveLength(2);
|
|
200
|
+
expect(next[0].id).toBe("name");
|
|
201
|
+
expect(next[1]).toEqual({
|
|
202
|
+
id: "age",
|
|
203
|
+
value: { type: "number", operator: ">", value: 1 },
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
describe("FilterPills — column-header trigger integration", () => {
|
|
209
|
+
it("opens the editor under the + button with a column-header-supplied snapshot", () => {
|
|
210
|
+
// Simulates what DataTable does when column-header calls
|
|
211
|
+
// requestAddFilter({ columnId: "name" }): it computes a snapshot via
|
|
212
|
+
// buildEditorSnapshot and passes it down as addFilterSnapshot.
|
|
213
|
+
const table = mockTable();
|
|
214
|
+
const snapshot = buildEditorSnapshot(table.getColumn("name")!);
|
|
215
|
+
renderWithProviders(
|
|
216
|
+
<FilterPills
|
|
217
|
+
filters={[]}
|
|
218
|
+
table={table}
|
|
219
|
+
addFilterSnapshot={snapshot}
|
|
220
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
221
|
+
/>,
|
|
222
|
+
);
|
|
223
|
+
expect(screen.getByLabelText("Apply filter")).toBeInTheDocument();
|
|
224
|
+
// Default text operator is "contains" — the text input renders.
|
|
225
|
+
expect(screen.getByPlaceholderText("Text…")).toBeInTheDocument();
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it("pre-selects 'in' operator when column-header 'Filter by values' is used", () => {
|
|
229
|
+
const table = mockTable();
|
|
230
|
+
const snapshot = buildEditorSnapshot(table.getColumn("name")!, {
|
|
231
|
+
operator: "in",
|
|
232
|
+
});
|
|
233
|
+
renderWithProviders(
|
|
234
|
+
<FilterPills
|
|
235
|
+
filters={[]}
|
|
236
|
+
table={table}
|
|
237
|
+
addFilterSnapshot={snapshot}
|
|
238
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
239
|
+
/>,
|
|
240
|
+
);
|
|
241
|
+
expect(snapshot.value).toEqual({
|
|
242
|
+
type: "text",
|
|
243
|
+
operator: "in",
|
|
244
|
+
values: [],
|
|
245
|
+
});
|
|
246
|
+
expect(screen.getByLabelText("Apply filter")).toBeInTheDocument();
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe("FilterPills — overflow", () => {
|
|
251
|
+
it("does not render the 'See all' button when there is no overflow", () => {
|
|
252
|
+
const filters: ColumnFiltersState = [
|
|
253
|
+
{ id: "age", value: Filter.number({ operator: ">", value: 5 }) },
|
|
254
|
+
];
|
|
255
|
+
renderWithProviders(
|
|
256
|
+
<FilterPills
|
|
257
|
+
filters={filters}
|
|
258
|
+
table={mockTable()}
|
|
259
|
+
addFilterSnapshot={null}
|
|
260
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
261
|
+
/>,
|
|
262
|
+
);
|
|
263
|
+
expect(screen.queryByLabelText("See all filters")).toBeNull();
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe("FilterPill — value truncation", () => {
|
|
268
|
+
it("renders the value with truncation classes inside a tooltip trigger", () => {
|
|
269
|
+
const filters: ColumnFiltersState = [
|
|
270
|
+
{
|
|
271
|
+
id: "name",
|
|
272
|
+
value: Filter.text({ operator: "contains", text: "x".repeat(100) }),
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
renderWithProviders(
|
|
276
|
+
<FilterPills
|
|
277
|
+
filters={filters}
|
|
278
|
+
table={mockTable()}
|
|
279
|
+
addFilterSnapshot={null}
|
|
280
|
+
onAddFilterSnapshotChange={vi.fn()}
|
|
281
|
+
/>,
|
|
282
|
+
);
|
|
283
|
+
const valueSpan = screen.getByText(/^"x{100}"$/);
|
|
284
|
+
expect(valueSpan.className).toMatch(/overflow-hidden/);
|
|
285
|
+
expect(valueSpan.className).toMatch(/text-ellipsis/);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ColumnDef,
|
|
5
|
+
getCoreRowModel,
|
|
6
|
+
type Table,
|
|
7
|
+
useReactTable,
|
|
8
|
+
} from "@tanstack/react-table";
|
|
9
|
+
import { renderHook } from "@testing-library/react";
|
|
10
|
+
import { vi } from "vitest";
|
|
11
|
+
import type { FilterType } from "../filters";
|
|
12
|
+
|
|
13
|
+
export interface FilterColumnSpec {
|
|
14
|
+
id: string;
|
|
15
|
+
filterType?: FilterType;
|
|
16
|
+
dtype?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FilterTestHarness {
|
|
20
|
+
table: Table<unknown>;
|
|
21
|
+
setColumnFilters: ReturnType<typeof vi.fn>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function buildFilterTestTable(
|
|
25
|
+
specs: FilterColumnSpec[],
|
|
26
|
+
): FilterTestHarness {
|
|
27
|
+
const setColumnFilters = vi.fn();
|
|
28
|
+
const columns: Array<ColumnDef<unknown>> = specs.map((spec) => ({
|
|
29
|
+
id: spec.id,
|
|
30
|
+
accessorFn: () => undefined,
|
|
31
|
+
header: spec.id,
|
|
32
|
+
meta: {
|
|
33
|
+
...(spec.filterType !== undefined ? { filterType: spec.filterType } : {}),
|
|
34
|
+
...(spec.dtype !== undefined ? { dtype: spec.dtype } : {}),
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
const { result } = renderHook(() =>
|
|
38
|
+
useReactTable<unknown>({
|
|
39
|
+
data: [],
|
|
40
|
+
columns,
|
|
41
|
+
locale: "en-US",
|
|
42
|
+
getCoreRowModel: getCoreRowModel(),
|
|
43
|
+
onColumnFiltersChange: setColumnFilters,
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
return { table: result.current, setColumnFilters };
|
|
47
|
+
}
|
|
@@ -172,7 +172,7 @@ describe("filterToFilterCondition", () => {
|
|
|
172
172
|
it("handles boolean true filter", () => {
|
|
173
173
|
const result = filterToFilterCondition(
|
|
174
174
|
"active",
|
|
175
|
-
Filter.boolean({
|
|
175
|
+
Filter.boolean({ operator: "is_true" }),
|
|
176
176
|
);
|
|
177
177
|
expect(result).toEqual([
|
|
178
178
|
{
|
|
@@ -187,7 +187,7 @@ describe("filterToFilterCondition", () => {
|
|
|
187
187
|
it("handles boolean false filter", () => {
|
|
188
188
|
const result = filterToFilterCondition(
|
|
189
189
|
"active",
|
|
190
|
-
Filter.boolean({
|
|
190
|
+
Filter.boolean({ operator: "is_false" }),
|
|
191
191
|
);
|
|
192
192
|
expect(result).toEqual([
|
|
193
193
|
{
|
|
@@ -199,16 +199,16 @@ describe("filterToFilterCondition", () => {
|
|
|
199
199
|
]);
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
it("handles
|
|
202
|
+
it("handles number in filter", () => {
|
|
203
203
|
const result = filterToFilterCondition(
|
|
204
204
|
"status",
|
|
205
|
-
Filter.
|
|
205
|
+
Filter.number({ operator: "in", values: [1, 2] }),
|
|
206
206
|
);
|
|
207
207
|
expect(result).toEqual([
|
|
208
208
|
{
|
|
209
209
|
column_id: "status",
|
|
210
210
|
operator: "in",
|
|
211
|
-
value: [
|
|
211
|
+
value: [1, 2],
|
|
212
212
|
type: "condition",
|
|
213
213
|
negate: false,
|
|
214
214
|
},
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
"use no memo";
|
|
3
|
+
|
|
4
|
+
import type { Column, Table } from "@tanstack/react-table";
|
|
5
|
+
import { PlusIcon } from "lucide-react";
|
|
6
|
+
import type { CalculateTopKRows } from "@/plugins/impl/DataTablePlugin";
|
|
7
|
+
import { Button } from "../ui/button";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
9
|
+
import {
|
|
10
|
+
buildEditorSnapshot,
|
|
11
|
+
editableColumns,
|
|
12
|
+
FilterPillEditor,
|
|
13
|
+
} from "./filter-pill-editor";
|
|
14
|
+
import type { Snapshot } from "./filters";
|
|
15
|
+
|
|
16
|
+
interface AddFilterButtonProps<TData> {
|
|
17
|
+
table: Table<TData>;
|
|
18
|
+
calculateTopKRows?: CalculateTopKRows;
|
|
19
|
+
snapshot: Snapshot | null;
|
|
20
|
+
onSnapshotChange: (snapshot: Snapshot | null) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const AddFilterButton = <TData,>({
|
|
24
|
+
table,
|
|
25
|
+
calculateTopKRows,
|
|
26
|
+
snapshot,
|
|
27
|
+
onSnapshotChange,
|
|
28
|
+
}: AddFilterButtonProps<TData>) => {
|
|
29
|
+
const columns = editableColumns(table);
|
|
30
|
+
|
|
31
|
+
if (columns.length === 0) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const handleOpenChange = (open: boolean) => {
|
|
36
|
+
if (!open) {
|
|
37
|
+
onSnapshotChange(null);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (snapshot === null) {
|
|
41
|
+
onSnapshotChange(
|
|
42
|
+
buildEditorSnapshot(columns[0] as Column<unknown, unknown>),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Popover
|
|
49
|
+
open={snapshot !== null}
|
|
50
|
+
onOpenChange={handleOpenChange}
|
|
51
|
+
modal={false}
|
|
52
|
+
>
|
|
53
|
+
<PopoverTrigger asChild={true}>
|
|
54
|
+
<Button
|
|
55
|
+
type="button"
|
|
56
|
+
size="icon"
|
|
57
|
+
variant="ghost"
|
|
58
|
+
className="h-5 w-5 -mr-1 rounded-full text-muted-foreground hover:text-foreground"
|
|
59
|
+
aria-label="Add filter"
|
|
60
|
+
>
|
|
61
|
+
<PlusIcon className="h-3.5 w-3.5" aria-hidden={true} />
|
|
62
|
+
</Button>
|
|
63
|
+
</PopoverTrigger>
|
|
64
|
+
{snapshot !== null && (
|
|
65
|
+
<PopoverContent
|
|
66
|
+
className="w-auto p-0"
|
|
67
|
+
align="start"
|
|
68
|
+
alignOffset={-10}
|
|
69
|
+
sideOffset={10}
|
|
70
|
+
avoidCollisions={true}
|
|
71
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
72
|
+
onCloseAutoFocus={(e) => e.preventDefault()}
|
|
73
|
+
>
|
|
74
|
+
<FilterPillEditor
|
|
75
|
+
key={`${snapshot.columnId}:${snapshot.value.operator}`}
|
|
76
|
+
snapshot={snapshot}
|
|
77
|
+
table={table}
|
|
78
|
+
calculateTopKRows={calculateTopKRows}
|
|
79
|
+
onClose={() => onSnapshotChange(null)}
|
|
80
|
+
/>
|
|
81
|
+
</PopoverContent>
|
|
82
|
+
)}
|
|
83
|
+
</Popover>
|
|
84
|
+
);
|
|
85
|
+
};
|