@marimo-team/islands 0.23.7-dev5 → 0.23.7-dev50
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-PmilQqXR.js → ConnectedDataExplorerComponent-2lBNiUv6.js} +14 -14
- package/dist/{ErrorBoundary-Da4UeYxT.js → ErrorBoundary-D3wrPNma.js} +1 -1
- package/dist/{any-language-editor-BVR0l12r.js → any-language-editor-VWs_7v27.js} +15 -15
- package/dist/apl-Bdc61P1y.js +4 -0
- package/dist/{arc-CHF8PiiF.js → arc-DfkSnvZm.js} +2 -2
- package/dist/{architecture-7HQA4BMR-D0JB_3hE.js → architecture-7HQA4BMR-CS9jOrqM.js} +1 -1
- package/dist/{architectureDiagram-VXUJARFQ-BXQEUDtK.js → architectureDiagram-VXUJARFQ-CXVJxFhH.js} +16 -16
- package/dist/asciiarmor-DVRHDGzT.js +4 -0
- package/dist/asn1-BmuKfkfu.js +4 -0
- package/dist/assets/__vite-browser-external-CAdMKBac.js +1 -0
- package/dist/assets/worker-CpBbwbQo.js +73 -0
- package/dist/{blockDiagram-VD42YOAC-DhJe-Y9i.js → blockDiagram-VD42YOAC-DGDaxR8I.js} +11 -11
- package/dist/brainfuck-DPrRpyTV.js +4 -0
- package/dist/{button-CA5pI2YF.js → button-Dj4BTre0.js} +5 -0
- package/dist/{c4Diagram-YG6GDRKO-9dSfzOFR.js → c4Diagram-YG6GDRKO-C2hc6ne8.js} +5 -5
- package/dist/{capabilities-6laDasij.js → capabilities-C9rrYCzf.js} +1 -1
- package/dist/{channel-MqYIiKgS.js → channel-BBoIVUrJ.js} +1 -1
- package/dist/{chat-ui-B-gbqk_F.js → chat-ui-D8ZxPNTR.js} +626 -234
- package/dist/{check-CFM2mVDr.js → check-BcUIXnUT.js} +1 -1
- package/dist/{chunk-4BX2VUAB-BwfrWBqN.js → chunk-4BX2VUAB-CzXltWHN.js} +1 -1
- package/dist/{chunk-55IACEB6-D8THf2mi.js → chunk-55IACEB6-B-1mjMMC.js} +1 -1
- package/dist/{chunk-5FQGJX7Z-CO1e63h_.js → chunk-5FQGJX7Z-BOg95xG5.js} +2 -2
- package/dist/{chunk-ABZYJK2D-BrBb_0yY.js → chunk-ABZYJK2D-D0cLy8Bb.js} +2 -2
- package/dist/{chunk-ATLVNIR6-D-0XqNah.js → chunk-ATLVNIR6-BXsEjlHF.js} +2 -2
- package/dist/{chunk-B4BG7PRW-8iRKvugR.js → chunk-B4BG7PRW-Q1usn6T3.js} +7 -7
- package/dist/{chunk-CVBHYZKI-B6xhgaBd.js → chunk-CVBHYZKI-B_c5YBcW.js} +1 -1
- package/dist/{chunk-DI55MBZ5-C0_2D4m4.js → chunk-DI55MBZ5-D1qLYNrb.js} +6 -6
- package/dist/{chunk-EXTU4WIE-Jiw9ca1u.js → chunk-EXTU4WIE-BKNXdLmD.js} +2 -2
- package/dist/{chunk-FMBD7UC4-CHdus51S.js → chunk-FMBD7UC4-Ie8M9q0W.js} +1 -1
- package/dist/{chunk-HN2XXSSU-2Vfbq-kU.js → chunk-HN2XXSSU-E3n-Ys7Z.js} +1 -1
- package/dist/{chunk-JA3XYJ7Z-6wbaigKe.js → chunk-JA3XYJ7Z-D6c6cOBG.js} +3 -3
- package/dist/{chunk-JZLCHNYA-_rfptlUP.js → chunk-JZLCHNYA-BvsPHJmL.js} +6 -6
- package/dist/{chunk-MI3HLSF2-Do0-KRc0.js → chunk-MI3HLSF2-CUYEasXO.js} +1 -1
- package/dist/{chunk-N4CR4FBY-DIZG9dVD.js → chunk-N4CR4FBY-8ycT-O9a.js} +7 -7
- package/dist/{chunk-QN33PNHL-Cc64y40m.js → chunk-QN33PNHL-Bb-eUBW3.js} +2 -2
- package/dist/{chunk-QXUST7PY-BDG0-0Or.js → chunk-QXUST7PY-DV8yRwBd.js} +10 -10
- package/dist/{chunk-QZHKN3VN-B_Mdb8GC.js → chunk-QZHKN3VN-DRjXVwuJ.js} +1 -1
- package/dist/{chunk-S3R3BYOJ-DphMP0FA.js → chunk-S3R3BYOJ-mQeCz5CE.js} +4 -4
- package/dist/{chunk-TZMSLE5B-C9LUoYkc.js → chunk-TZMSLE5B-BqW10dHe.js} +3 -3
- package/dist/classDiagram-2ON5EDUG--Yh__LHb.js +30 -0
- package/dist/classDiagram-v2-WZHVMYZB-BC7X7Xtc.js +30 -0
- package/dist/{clike-sBZrGeF8.js → clike-DTxNUn7l.js} +1 -1
- package/dist/clojure-DEttQW5T.js +4 -0
- package/dist/cmake-jNlx_DaM.js +4 -0
- package/dist/cobol-BvvIm5MJ.js +4 -0
- package/dist/{code-block-37QAKDTI-0JNwiPGv.js → code-block-37QAKDTI-BsGy1AOJ.js} +1 -1
- package/dist/{code-visibility-D8E8Ctez.js → code-visibility-DjsEQuRb.js} +1403 -1080
- package/dist/coffeescript-DTpBMyFU.js +4 -0
- package/dist/commonlisp-BmmUG8jb.js +4 -0
- package/dist/{copy-TGGAUEWp.js → copy-DLf4aN7I.js} +2 -2
- package/dist/{cose-bilkent-S5V4N54A-DXHZkJKX.js → cose-bilkent-S5V4N54A-kjoZoid4.js} +2 -2
- package/dist/crystal-BxyqmEWC.js +4 -0
- package/dist/css-BGoCtuG3.js +4 -0
- package/dist/cypher-BmCbdl3u.js +4 -0
- package/dist/d-CFrlbjZt.js +4 -0
- package/dist/{dagre-6UL2VRFP-tH87fkPA.js → dagre-6UL2VRFP-DRBWoQUw.js} +10 -10
- package/dist/{data-grid-overlay-editor-CWUN78-s.js → data-grid-overlay-editor-efe5ZagF.js} +2 -2
- package/dist/{diagram-PSM6KHXK-2VjPSCDn.js → diagram-PSM6KHXK-H66ATWP2.js} +18 -18
- package/dist/{diagram-QEK2KX5R-CiLmNyta.js → diagram-QEK2KX5R-DItl5Wns.js} +14 -14
- package/dist/{diagram-S2PKOQOG-Zha_1CLx.js → diagram-S2PKOQOG-CtuW_ZuL.js} +14 -14
- package/dist/diff-D6XwL6P8.js +4 -0
- package/dist/{dist-Brkazupz.js → dist--sWVZwjW.js} +1 -1
- package/dist/{dist-FN0ZA_8F.js → dist-21ButRCu.js} +1 -1
- package/dist/{dist-BetEKbPG.js → dist-B8RaFTRF.js} +1 -1
- package/dist/dist-BoHGySTM.js +5 -0
- package/dist/dist-ByAz19Qc.js +5 -0
- package/dist/dist-C93EysN4.js +5 -0
- package/dist/{dist-BHnX0ia_.js → dist-CY-lVor6.js} +1 -1
- package/dist/{dist-YP-G7W0f.js → dist-CYDuv4bR.js} +1 -1
- package/dist/{dist-CMjD5MQb.js → dist-Cfo5EE2t.js} +1 -1
- package/dist/dist-CjivSDvN.js +5 -0
- package/dist/dist-Cqwx-MH7.js +5 -0
- package/dist/{dist-ESg7xyoD.js → dist-D3ZI9nhS.js} +2 -2
- package/dist/{dist-DkC6YEo0.js → dist-DMZNjfX4.js} +1 -1
- package/dist/{dist-ChC1BhqM.js → dist-DbpcoFAV.js} +1 -1
- package/dist/dist-FUNenbiQ.js +5 -0
- package/dist/{dist-BEOU2g1b.js → dist-zhSud5X3.js} +1 -1
- package/dist/{dockerfile-COvlVLcE.js → dockerfile-twL37N91.js} +1 -1
- package/dist/dtd-Bw0lRN0-.js +4 -0
- package/dist/dylan-B55eBHTt.js +4 -0
- package/dist/ecl-C8G4p0wn.js +4 -0
- package/dist/eiffel-BmH46VJl.js +4 -0
- package/dist/elm-DhzeFqkl.js +4 -0
- package/dist/{erDiagram-Q2GNP2WA-biHZS05w.js → erDiagram-Q2GNP2WA--19X2kU5.js} +14 -14
- package/dist/erlang-CY-wdlsU.js +4 -0
- package/dist/{error-banner-DnBPzEWg.js → error-banner-CVkfBUT3.js} +2 -2
- package/dist/{esm-Dd1z1auZ.js → esm-CWp0KQeK.js} +1 -1
- package/dist/{esm-CYEyrE3Y.js → esm-DjNnlmpf.js} +96 -96
- package/dist/{extends-CzJgxo2J.js → extends-vAi97cpa.js} +4 -4
- package/dist/{factor-C2GT7jfQ.js → factor-CajWS6mS.js} +1 -1
- package/dist/factor-DWkgl0xw.js +4 -0
- package/dist/{flowDiagram-NV44I4VS-CWWlUpBR.js → flowDiagram-NV44I4VS-DQmWlo7f.js} +16 -16
- package/dist/{formats-CgaK7Gmx.js → formats-CpgZM9BM.js} +3 -3
- package/dist/forth-Cij_ie2t.js +4 -0
- package/dist/fortran-Br3X9cfm.js +4 -0
- package/dist/{ganttDiagram-JELNMOA3-D7B2c4Z9.js → ganttDiagram-JELNMOA3-BOGXJ8Lk.js} +7 -7
- package/dist/gas-DYsGcMN2.js +4 -0
- package/dist/gherkin-eVgXQ0fQ.js +4 -0
- package/dist/{gitGraph-G5XIXVHT-BdepdFa_.js → gitGraph-G5XIXVHT-DGlbae5m.js} +1 -1
- package/dist/{gitGraphDiagram-V2S2FVAM-CtLvNR1S.js → gitGraphDiagram-V2S2FVAM-DjzxfF0P.js} +14 -14
- package/dist/{glide-data-editor-CvlvtPWJ.js → glide-data-editor-DucgdjRo.js} +13 -13
- package/dist/groovy-_NFHIXG7.js +4 -0
- package/dist/haskell-D6xNG_bH.js +4 -0
- package/dist/haxe-sU_rzAwn.js +5 -0
- package/dist/{html-to-image-hMMPiNe_.js → html-to-image-DaPPaVDP.js} +2395 -2301
- package/dist/idl-Ds_VbrUx.js +4 -0
- package/dist/{info-VBDWY6EO--JNA2rNu.js → info-VBDWY6EO-D2lvLLw5.js} +1 -1
- package/dist/{infoDiagram-HS3SLOUP-BbZyOxsP.js → infoDiagram-HS3SLOUP-ChNufFsP.js} +12 -12
- package/dist/{input-BAOe64zx.js → input-D4kjoQUB.js} +8 -6
- package/dist/javascript-CztfIl0i.js +4 -0
- package/dist/{journeyDiagram-XKPGCS4Q-BU2mjjzl.js → journeyDiagram-XKPGCS4Q-BO_O4Ij1.js} +6 -6
- package/dist/julia-DDv40QMV.js +4 -0
- package/dist/{kanban-definition-3W4ZIXB7-BlmczUuw.js → kanban-definition-3W4ZIXB7-CPpiiiWk.js} +11 -11
- package/dist/{katex-qPqrBHZ8.js → katex-9-9QRhxz.js} +1 -1
- package/dist/{label-BCWi-Oqu.js → label-BLqV33b1.js} +2 -2
- package/dist/{line-BWRi3U3S.js → line-C5s_12ee.js} +3 -3
- package/dist/{linear-DnHwODZa.js → linear-2NnK4cxi.js} +2 -2
- package/dist/livescript-BEOngLLc.js +4 -0
- package/dist/{loader-BvW0-YWZ.js → loader-Dr8Qem8p.js} +1 -1
- package/dist/lua-9-7BhQ4Y.js +4 -0
- package/dist/main.js +1299 -1260
- package/dist/mathematica-DDa0Pfxm.js +4 -0
- package/dist/mbox-iO03mmoE.js +4 -0
- package/dist/{mermaid-4DMBBIKO-CG1ECj5W.js → mermaid-4DMBBIKO-B7VQMwJx.js} +1 -1
- package/dist/{mermaid-CEbzCxCc.js → mermaid-DO-Daq7u.js} +46 -46
- package/dist/{mermaid-parser.core-CleJseNW.js → mermaid-parser.core-DreccfmS.js} +7 -7
- package/dist/{mhchem-BwoRNwg_.js → mhchem-yiCCuiEF.js} +1 -1
- package/dist/{mindmap-definition-VGOIOE7T-CcSYqYP9.js → mindmap-definition-VGOIOE7T-CC1_Vl0f.js} +13 -13
- package/dist/mirc-C9z5LT4X.js +4 -0
- package/dist/mllike-jGJbdm_C.js +6 -0
- package/dist/modelica-DzF7oIEL.js +4 -0
- package/dist/mscgen-DB-u125o.js +6 -0
- package/dist/mumps-CRTFHhzh.js +4 -0
- package/dist/nsis-C4NPTuox.js +4 -0
- package/dist/{nsis-B5K1qoyo.js → nsis-ClF3r5Tr.js} +1 -1
- package/dist/ntriples-BCOoGph1.js +4 -0
- package/dist/{number-overlay-editor-_GnlYFHC.js → number-overlay-editor-CpKi64Fy.js} +1 -1
- package/dist/octave-DTwNlazz.js +4 -0
- package/dist/{ordinal-2jIulmcR.js → ordinal-B43ZeR68.js} +1 -1
- package/dist/oz-DD38AzSz.js +4 -0
- package/dist/{packet-DYOGHKS2-CBxXGWNr.js → packet-DYOGHKS2-CmWtF3uO.js} +1 -1
- package/dist/pascal-BohSp9jV.js +4 -0
- package/dist/perl-f5OutoPM.js +4 -0
- package/dist/{pie-VRWISCQL-Bmdnqjip.js → pie-VRWISCQL-B6u8vus8.js} +1 -1
- package/dist/{pieDiagram-ADFJNKIX-DNyLF5H2.js → pieDiagram-ADFJNKIX-Di34MOFQ.js} +19 -19
- package/dist/pig-Dv7wSmHb.js +4 -0
- package/dist/powershell-rYgjKB39.js +4 -0
- package/dist/{process-output-Bza_GK7Q.js → process-output-n0RJTxcC.js} +30 -25
- package/dist/properties-BFUNLRDN.js +4 -0
- package/dist/protobuf-B9QJQPPv.js +4 -0
- package/dist/{pug-tjbzJCFk.js → pug-B_rby2yb.js} +1 -1
- package/dist/pug-DzvWpaMC.js +4 -0
- package/dist/puppet-B_K-n_xK.js +4 -0
- package/dist/python-CAiFcaA2.js +4 -0
- package/dist/q-cLeFIBLK.js +4 -0
- package/dist/{quadrantDiagram-AYHSOK5B-rXwjifrj.js → quadrantDiagram-AYHSOK5B-B9kVk1ny.js} +3 -3
- package/dist/r-04Y-Wco3.js +4 -0
- package/dist/{radar-ZZBFDIW7-BmCWDffL.js → radar-ZZBFDIW7-XAmXSa8s.js} +1 -1
- package/dist/{react-vega-B-rkEqtS.js → react-vega-Cavbrg4l.js} +1 -1
- package/dist/{react-vega-k9ODWPlI.js → react-vega-Dh6-UKKe.js} +13 -13
- package/dist/{requirementDiagram-UZGBJVZJ-DBdrMVbs.js → requirementDiagram-UZGBJVZJ-BxGfGYEx.js} +13 -13
- package/dist/{reveal-component-Ycn2n8kH.js → reveal-component-pQBz0vEK.js} +10 -10
- package/dist/rpm-FUdrIia9.js +5 -0
- package/dist/ruby-DMjFXuEW.js +4 -0
- package/dist/{sankeyDiagram-TZEHDZUN-CxmzalGv.js → sankeyDiagram-TZEHDZUN-D09PBJ-n.js} +4 -4
- package/dist/sas-DzHZxjXK.js +4 -0
- package/dist/scheme-DxHd_Rb9.js +4 -0
- package/dist/semaphore-CNDGTzkX.js +46 -0
- package/dist/{sequenceDiagram-WL72ISMW-CVCDsJ9h.js → sequenceDiagram-WL72ISMW-t_Dpemj0.js} +7 -7
- package/dist/shell-C8Kwypgf.js +4 -0
- package/dist/sieve-DdyqOKXZ.js +4 -0
- package/dist/smalltalk-pB7X1D9y.js +4 -0
- package/dist/sparql-NhBO6oOa.js +4 -0
- package/dist/{spec-DSIuqd3f.js → spec-hVaaZsY5.js} +4 -4
- package/dist/{src-BY0BGg6V.js → src-Bf2iLOlr.js} +1 -1
- package/dist/{stateDiagram-FKZM4ZOC-D_2djEhW.js → stateDiagram-FKZM4ZOC-B18gTP_j.js} +16 -16
- package/dist/stateDiagram-v2-4FDKWEC3-B6e_t14A.js +29 -0
- package/dist/{step-DGAGWg3y.js → step-CWipAYTY.js} +1 -1
- package/dist/{strings-B_FOH6eV.js → strings-BiIhGaI8.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/stylus-SfWSnzPv.js +4 -0
- package/dist/swift-jRPdq2zR.js +4 -0
- package/dist/{swiper-component-KkEVUDd3.js → swiper-component-DlD2GU2g.js} +2 -2
- package/dist/tcl-_hpTHGX3.js +4 -0
- package/dist/textile-C9h8slqH.js +4 -0
- package/dist/{time-CMdrp3hw.js → time-C1SGcFMH.js} +2 -2
- package/dist/{timeline-definition-IT6M3QCI-E4NzxCs3.js → timeline-definition-IT6M3QCI-DJnh1ks5.js} +3 -3
- package/dist/{toDate-CHtl9vts.js → toDate-CJWlVNGD.js} +3 -3
- package/dist/toml-DWvtinD4.js +4 -0
- package/dist/{tooltip-B0mtKTXm.js → tooltip-DRaMBu06.js} +3 -3
- package/dist/{treemap-GDKQZRPO-CoKHPxa7.js → treemap-GDKQZRPO-Du95DV6u.js} +1 -1
- package/dist/troff-Dwo_A0y7.js +4 -0
- package/dist/ttcn-V--CPFKq.js +4 -0
- package/dist/ttcn-cfg-CPSMchTG.js +4 -0
- package/dist/turtle-B4rPGBWu.js +4 -0
- package/dist/{types-DBtDeUKD.js → types-Dzuoc3LN.js} +1 -1
- package/dist/{useAsyncData-B6hCGywC.js → useAsyncData-C56Khv_R.js} +1 -1
- package/dist/{useDateFormatter-B3mCQMP3.js → useDateFormatter-B_9k85Ex.js} +2 -2
- package/dist/{useDeepCompareMemoize-CmwDuYUH.js → useDeepCompareMemoize-Dt98v2ua.js} +1 -1
- package/dist/{useIframeCapabilities-DbdLoEDm.js → useIframeCapabilities-BkYHTrss.js} +1 -1
- package/dist/{useLifecycle-CjMjllqy.js → useLifecycle-BF6-z62y.js} +3 -3
- package/dist/{useTheme-CByZUW0p.js → useTheme-DykuNHR2.js} +2 -2
- package/dist/vb-DaMBBd4j.js +4 -0
- package/dist/vbscript-BMJQqcE2.js +4 -0
- package/dist/{vega-component-CC8TqWWV.js → vega-component-BtvQ-Kc4.js} +26 -24
- package/dist/velocity-CGq2QRq2.js +4 -0
- package/dist/verilog-CUNo8F5u.js +4 -0
- package/dist/vhdl-CCzA0msW.js +4 -0
- package/dist/webidl-CqIMDIBL.js +4 -0
- package/dist/xquery-XC5Kbr-1.js +4 -0
- package/dist/{xychartDiagram-PRI3JC2R-CuxTvjw5.js → xychartDiagram-PRI3JC2R-Dk2d_bX0.js} +10 -10
- package/dist/yacas-CGOv7Dzy.js +4 -0
- package/dist/z80-CXhVmi-f.js +4 -0
- package/dist/{zod-BxdsqRPd.js → zod-BWkcDORu.js} +1 -1
- package/package.json +3 -3
- package/src/components/chat/chat-components.tsx +47 -0
- package/src/components/chat/chat-display.tsx +41 -7
- package/src/components/chat/chat-panel.tsx +37 -10
- package/src/components/chat/chat-utils.ts +42 -20
- package/src/components/chat/reasoning-accordion.tsx +14 -3
- package/src/components/chat/tool-call/shared.ts +13 -0
- package/src/components/chat/tool-call/tool-approval-card.tsx +62 -0
- package/src/components/chat/tool-call/tool-args.tsx +26 -0
- package/src/components/chat/tool-call/tool-call-view.tsx +99 -0
- package/src/components/chat/tool-call/tool-error-card.tsx +81 -0
- package/src/components/chat/tool-call/tool-history-row.tsx +153 -0
- package/src/components/chat/tool-call/tool-result.tsx +101 -0
- package/src/components/data-table/TableTopBar.tsx +5 -1
- package/src/components/data-table/__tests__/column-header.test.ts +3 -1
- package/src/components/data-table/__tests__/column-header.test.tsx +203 -0
- package/src/components/data-table/__tests__/filter-by-values-picker.test.tsx +112 -0
- package/src/components/data-table/__tests__/filter-pill-editor.test.tsx +175 -0
- package/src/components/data-table/__tests__/filters.test.ts +112 -36
- package/src/components/data-table/charts/components/form-fields.tsx +1 -0
- package/src/components/data-table/column-header.tsx +210 -157
- package/src/components/data-table/data-table.tsx +5 -0
- package/src/components/data-table/download-policy/atoms.ts +10 -0
- package/src/components/data-table/export-actions.tsx +31 -4
- package/src/components/data-table/filter-by-values-picker.tsx +70 -9
- package/src/components/data-table/filter-pill-editor.tsx +289 -144
- package/src/components/data-table/filter-pills.tsx +49 -8
- package/src/components/data-table/filters.ts +131 -36
- package/src/components/data-table/header-items.tsx +8 -1
- package/src/components/data-table/operator-labels.ts +25 -0
- package/src/components/data-table/regex-input.tsx +61 -0
- package/src/components/editor/actions/pair-with-agent-modal.tsx +140 -49
- package/src/components/editor/actions/useNotebookActions.tsx +3 -1
- package/src/components/editor/app-container.tsx +7 -1
- package/src/components/editor/chrome/panels/context-aware-panel/context-aware-panel.tsx +10 -2
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +1 -0
- package/src/components/editor/chrome/wrapper/footer.tsx +4 -1
- package/src/components/editor/chrome/wrapper/panels.tsx +4 -1
- package/src/components/editor/chrome/wrapper/sidebar.tsx +4 -1
- package/src/components/editor/controls/Controls.tsx +11 -3
- package/src/components/editor/file-tree/requesting-tree.tsx +27 -25
- package/src/components/editor/file-tree/upload.tsx +23 -24
- package/src/components/editor/header/__tests__/status.test.tsx +108 -0
- package/src/components/editor/header/status.tsx +44 -10
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +106 -0
- package/src/components/editor/navigation/__tests__/navigation.test.ts +70 -0
- package/src/components/editor/navigation/clipboard.ts +99 -25
- package/src/components/editor/navigation/navigation.ts +15 -1
- package/src/components/editor/notebook-cell.tsx +3 -0
- package/src/components/home/components.tsx +6 -0
- package/src/components/pages/run-page.tsx +4 -1
- package/src/components/ui/combobox.tsx +24 -5
- package/src/components/ui/number-field.tsx +2 -0
- package/src/core/ai/tools/__tests__/registry.test.ts +10 -12
- package/src/core/ai/tools/registry.ts +9 -5
- package/src/core/cells/__tests__/cells.test.ts +187 -0
- package/src/core/cells/__tests__/pending-cut-service.test.tsx +123 -0
- package/src/core/cells/cells.ts +102 -17
- package/src/core/cells/document-changes.ts +6 -1
- package/src/core/cells/pending-cut-service.ts +55 -0
- package/src/core/cells/utils.ts +11 -0
- package/src/core/codemirror/cells/extensions.ts +10 -0
- package/src/core/codemirror/markdown/__tests__/commands.test.ts +3 -3
- package/src/core/codemirror/markdown/commands.ts +1 -2
- package/src/core/edit-app.tsx +2 -1
- package/src/core/hotkeys/hotkeys.ts +5 -0
- package/src/core/islands/worker/worker.tsx +3 -2
- package/src/core/network/requests-network.ts +21 -3
- package/src/core/network/types.ts +12 -1
- package/src/core/run-app.tsx +2 -1
- package/src/core/wasm/__tests__/utils.test.ts +34 -0
- package/src/core/wasm/bridge.ts +14 -1
- package/src/core/wasm/utils.ts +14 -0
- package/src/core/wasm/worker/bootstrap.ts +3 -2
- package/src/core/wasm/worker/worker.ts +3 -2
- package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +155 -0
- package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +137 -0
- package/src/core/websocket/transports/basic.ts +2 -0
- package/src/core/websocket/transports/transport.ts +1 -0
- package/src/core/websocket/useMarimoKernelConnection.tsx +130 -55
- package/src/core/websocket/useWebSocket.tsx +5 -2
- package/src/css/app/Cell.css +10 -0
- package/src/plugins/core/__test__/sanitize.test.ts +30 -0
- package/src/plugins/impl/DataTablePlugin.tsx +12 -0
- package/src/plugins/impl/DropdownPlugin.tsx +12 -1
- package/src/plugins/impl/MultiselectPlugin.tsx +4 -0
- package/src/plugins/impl/SearchableSelect.tsx +11 -1
- package/src/plugins/impl/TabsPlugin.tsx +35 -7
- package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +56 -0
- package/src/plugins/impl/__tests__/TabsPlugin.test.tsx +154 -0
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +6 -0
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +48 -36
- package/src/plugins/impl/data-frames/schema.ts +4 -1
- package/src/plugins/impl/vega/resolve-data.ts +8 -1
- package/src/utils/__tests__/id-tree.test.ts +71 -0
- package/src/utils/__tests__/semaphore.test.ts +218 -0
- package/src/utils/fileToBase64.ts +8 -7
- package/src/utils/id-tree.tsx +89 -0
- package/src/utils/semaphore.ts +88 -0
- package/dist/apl-BKoVld9y.js +0 -4
- package/dist/asciiarmor-DQrKIjoo.js +0 -4
- package/dist/asn1-BZvnj0dq.js +0 -4
- package/dist/assets/__vite-browser-external-rrUYDKRl.js +0 -1
- package/dist/assets/worker-Bfy15ViQ.js +0 -73
- package/dist/brainfuck-D558nlUv.js +0 -4
- package/dist/classDiagram-2ON5EDUG-CBHMR6ZU.js +0 -30
- package/dist/classDiagram-v2-WZHVMYZB-BsUtUGM_.js +0 -30
- package/dist/clojure-Cq8mTSrE.js +0 -4
- package/dist/cmake-D8HCovWK.js +0 -4
- package/dist/cobol-UolN-9iU.js +0 -4
- package/dist/coffeescript-VdNuWrt5.js +0 -4
- package/dist/commonlisp-ALX7fpDc.js +0 -4
- package/dist/crystal-PbyO9Q_s.js +0 -4
- package/dist/css-DFklJkr_.js +0 -4
- package/dist/cypher-BifNeYlv.js +0 -4
- package/dist/d-BA-JP4PJ.js +0 -4
- package/dist/diff-CtkDpav4.js +0 -4
- package/dist/dist-BuBwsFva.js +0 -5
- package/dist/dist-BzmEQ9u7.js +0 -5
- package/dist/dist-Cih01ssx.js +0 -5
- package/dist/dist-CqfONiY9.js +0 -5
- package/dist/dist-D0iD0Fi9.js +0 -5
- package/dist/dist-DtNLXm8d.js +0 -5
- package/dist/dtd-DW3_UFEG.js +0 -4
- package/dist/dylan-pDhodO2N.js +0 -4
- package/dist/ecl-BJT8-YD7.js +0 -4
- package/dist/eiffel-Dmns-9vS.js +0 -4
- package/dist/elm-Da4sO4Bz.js +0 -4
- package/dist/erlang-C-zBsDi7.js +0 -4
- package/dist/factor-4xPWlWB5.js +0 -4
- package/dist/forth-l-c75zSd.js +0 -4
- package/dist/fortran-DIujSODW.js +0 -4
- package/dist/gas-CXnG5g_b.js +0 -4
- package/dist/gherkin-VPeqd4-X.js +0 -4
- package/dist/groovy-CphhZQgg.js +0 -4
- package/dist/haskell-CCvlS5Iq.js +0 -4
- package/dist/haxe-C_bi66fP.js +0 -5
- package/dist/idl-1DcP4Dm8.js +0 -4
- package/dist/javascript-DUIGhBvO.js +0 -4
- package/dist/julia-Cs2G4PQi.js +0 -4
- package/dist/livescript-DMtVFaAN.js +0 -4
- package/dist/lua-BAoLtdJg.js +0 -4
- package/dist/mathematica-C_NoFtbo.js +0 -4
- package/dist/mbox-DcFJFYrH.js +0 -4
- package/dist/mirc-71dccf_u.js +0 -4
- package/dist/mllike-CWcOFVDq.js +0 -6
- package/dist/modelica-Ape2VXxx.js +0 -4
- package/dist/mscgen-Cc6TwbSN.js +0 -6
- package/dist/mumps-h-ZbdkJ9.js +0 -4
- package/dist/nsis-C0p3m7JW.js +0 -4
- package/dist/ntriples-c9lEeT5w.js +0 -4
- package/dist/octave-DzEgB_74.js +0 -4
- package/dist/oz-CAxvHkyQ.js +0 -4
- package/dist/pascal-BJzu1sgP.js +0 -4
- package/dist/perl--IrOzZ2Z.js +0 -4
- package/dist/pig-CiBKKNhC.js +0 -4
- package/dist/powershell-KY0j6Qop.js +0 -4
- package/dist/properties-BW8q3ziV.js +0 -4
- package/dist/protobuf-BGaeuTGV.js +0 -4
- package/dist/pug-DjOKK-4J.js +0 -4
- package/dist/puppet-DWm2o6zX.js +0 -4
- package/dist/python-Bp2gezZy.js +0 -4
- package/dist/q-DljPshos.js +0 -4
- package/dist/r-BajPMnEu.js +0 -4
- package/dist/rpm-BKx-ZZ62.js +0 -5
- package/dist/ruby-DJq_HNKc.js +0 -4
- package/dist/sas-WANvpcOU.js +0 -4
- package/dist/scheme-CliBbhGF.js +0 -4
- package/dist/shell-BwhrNUvM.js +0 -4
- package/dist/sieve-BIVePvMp.js +0 -4
- package/dist/smalltalk-D6G48JmY.js +0 -4
- package/dist/sparql-jjc3BmEP.js +0 -4
- package/dist/stateDiagram-v2-4FDKWEC3-Cv9Av10H.js +0 -29
- package/dist/stylus-WPBPQ4PE.js +0 -4
- package/dist/swift-O1Qy6iCm.js +0 -4
- package/dist/tcl-BAFdhvsi.js +0 -4
- package/dist/textile-DFuzhNLG.js +0 -4
- package/dist/toml-DRSTeely.js +0 -4
- package/dist/troff-B_ZjwBW0.js +0 -4
- package/dist/ttcn-CAyiB3ic.js +0 -4
- package/dist/ttcn-cfg-BS5_BGBJ.js +0 -4
- package/dist/turtle-CUBEDy3E.js +0 -4
- package/dist/vb-DY9S6-U2.js +0 -4
- package/dist/vbscript-gaHC39Jq.js +0 -4
- package/dist/velocity-TfCOtJZ_.js +0 -4
- package/dist/verilog-c2JOX8mv.js +0 -4
- package/dist/vhdl-dHBirRiO.js +0 -4
- package/dist/webidl-Bauj-i07.js +0 -4
- package/dist/xquery-CtaEAOt8.js +0 -4
- package/dist/yacas-BZ85agQP.js +0 -4
- package/dist/z80-hCgR-L4U.js +0 -4
- package/src/components/chat/tool-call-accordion.tsx +0 -247
- /package/dist/{ImageComparisonComponent-DaocPIse.js → ImageComparisonComponent-CNHIsPDj.js} +0 -0
- /package/dist/{Plot-PIeIvFnD.js → Plot-4wn-lMVn.js} +0 -0
- /package/dist/{apl-Dt8GMXYg.js → apl-BCgCq9iM.js} +0 -0
- /package/dist/{array-B-MVxRIF.js → array-tvvEqPy7.js} +0 -0
- /package/dist/{asciiarmor-CitDQ85h.js → asciiarmor-BtqU-KJQ.js} +0 -0
- /package/dist/{asn1-abrf9SMK.js → asn1-Dmb-dTMx.js} +0 -0
- /package/dist/{asterisk-BUZwqih-.js → asterisk-DaVJJDnV.js} +0 -0
- /package/dist/{brainfuck-BL-Boof0.js → brainfuck-C1HoZKlE.js} +0 -0
- /package/dist/{chunk-4F5CHEZ2-C6tO9vjs.js → chunk-4F5CHEZ2-BZq7Kom7.js} +0 -0
- /package/dist/{chunk-B2363JML-Ds8wZXyP.js → chunk-B2363JML-D9-XOau1.js} +0 -0
- /package/dist/{chunk-DR5Q36YT-CP69aZS_.js → chunk-DR5Q36YT-BflwErH1.js} +0 -0
- /package/dist/{chunk-FRFDVMJY-BgQv1HBE.js → chunk-FRFDVMJY-BSBUAX7r.js} +0 -0
- /package/dist/{chunk-PL6DKKU2-DHfTUHy8.js → chunk-PL6DKKU2-B0MTXvyc.js} +0 -0
- /package/dist/{chunk-SJTYNZTY-Diciw4sx.js → chunk-SJTYNZTY-CEG4F0pB.js} +0 -0
- /package/dist/{chunk-TQ3KTPDO-CQfP9npd.js → chunk-TQ3KTPDO-DiCtqVSi.js} +0 -0
- /package/dist/{chunk-UMXZTB3W-MSKeGL7W.js → chunk-UMXZTB3W-97iS1iEl.js} +0 -0
- /package/dist/{click-outside-container-BZgN7xS_.js → click-outside-container-BDd67_1U.js} +0 -0
- /package/dist/{clike-RWg7anhx.js → clike-CdT0yHjt.js} +0 -0
- /package/dist/{clojure-DaojKHow.js → clojure-CdyrCpUv.js} +0 -0
- /package/dist/{cmake-DN-_v0XE.js → cmake-BFlPxym7.js} +0 -0
- /package/dist/{cobol-C3VpMyux.js → cobol-CcJXewp8.js} +0 -0
- /package/dist/{coffeescript-DIkz3Tbt.js → coffeescript-DnKuIKRo.js} +0 -0
- /package/dist/{colors-Cn2p_FA3.js → colors-CQAOa8cK.js} +0 -0
- /package/dist/{common-keywords-hbLeU7VU.js → common-keywords-FBrXPTcz.js} +0 -0
- /package/dist/{commonlisp-CB1boOiP.js → commonlisp-B-kok83Z.js} +0 -0
- /package/dist/{crystal-DI2oCml6.js → crystal-FYRYjI1I.js} +0 -0
- /package/dist/{css-BdEVwQDV.js → css-B45lc2V3.js} +0 -0
- /package/dist/{cypher-BNHToqxU.js → cypher-DZMLyVY_.js} +0 -0
- /package/dist/{cytoscape.esm-WbbDoCfu.js → cytoscape.esm-ayF70frT.js} +0 -0
- /package/dist/{d-D7we7I1b.js → d-x-VVT4o9.js} +0 -0
- /package/dist/{diff-Cia6fzjN.js → diff-Dxe2mpXk.js} +0 -0
- /package/dist/{dist-BK-3fF4P.js → dist-B4LJpMEg.js} +0 -0
- /package/dist/{dist-CxdUraQr.js → dist-B507mf_I.js} +0 -0
- /package/dist/{dist-C89sHDXk.js → dist-BGdYVvOu.js} +0 -0
- /package/dist/{dist-DquyVv5H.js → dist-BNyrZfqT.js} +0 -0
- /package/dist/{dist-Zn0KNbo9.js → dist-Bc5pmZIw.js} +0 -0
- /package/dist/{dist-C-J0pt5p.js → dist-BvCfQQQE.js} +0 -0
- /package/dist/{dist-D9r7Cmw7.js → dist-C2ej4eOH.js} +0 -0
- /package/dist/{dist-HVuryI1a.js → dist-C34oIrQ9.js} +0 -0
- /package/dist/{dist-CGLzXdrt.js → dist-CDFZi-QD.js} +0 -0
- /package/dist/{dist-C9fmTOin.js → dist-CYEylvZA.js} +0 -0
- /package/dist/{dist-DadjmS-4.js → dist-DJ6zJQZ4.js} +0 -0
- /package/dist/{dist-CtCY55Jf.js → dist-Dh3wkoyH.js} +0 -0
- /package/dist/{dist-C474qFoq.js → dist-Dhk6FMb0.js} +0 -0
- /package/dist/{dist-DZjQ_MBo.js → dist-KnujRhFL.js} +0 -0
- /package/dist/{dist-CinA9Enb.js → dist-WdPUFc56.js} +0 -0
- /package/dist/{dist-DBLeRrPp.js → dist-t_qL7eB8.js} +0 -0
- /package/dist/{dist-CyFFzJTb.js → dist-usPCDYx8.js} +0 -0
- /package/dist/{dtd-H4Hubdwp.js → dtd-C9VM_Wfu.js} +0 -0
- /package/dist/{duckdb-keywords-CZ_ZTscu.js → duckdb-keywords-CvJhR_Yd.js} +0 -0
- /package/dist/{dylan-fVO6rnq3.js → dylan-DTSnEIFO.js} +0 -0
- /package/dist/{ebnf-WEXPLEWb.js → ebnf-2D4Ctp3y.js} +0 -0
- /package/dist/{ecl-B94VPjNR.js → ecl-N04ptnRK.js} +0 -0
- /package/dist/{eiffel-C_R6TusS.js → eiffel-Dd8rpqr_.js} +0 -0
- /package/dist/{elm-DzCHbO2g.js → elm-GT2E866W.js} +0 -0
- /package/dist/{erlang-BGNkx6JU.js → erlang-Cf0Bp5pY.js} +0 -0
- /package/dist/{esm-Bb_hbWan.js → esm-BaaaPNGl.js} +0 -0
- /package/dist/{fcl-B_Gv5Jfx.js → fcl-Ccj8Z5Xd.js} +0 -0
- /package/dist/{forth-Bybw0cJ7.js → forth-wd_XzGTg.js} +0 -0
- /package/dist/{fortran-C6PoCLkI.js → fortran-DcwUTZFe.js} +0 -0
- /package/dist/{gas-BBlhenj4.js → gas-DeALIER3.js} +0 -0
- /package/dist/{gherkin-NXtNG85X.js → gherkin-CKTqaJNX.js} +0 -0
- /package/dist/{groovy-BoFYK9xM.js → groovy-Bwdp_d8D.js} +0 -0
- /package/dist/{haskell-BtBdvQ1n.js → haskell-DCdCcPLK.js} +0 -0
- /package/dist/{haxe-D--o6dr0.js → haxe-DAyktQWJ.js} +0 -0
- /package/dist/{http-Dc2fv19V.js → http-_DVAYWoR.js} +0 -0
- /package/dist/{idl-AqTq5l7e.js → idl-CBuZiRYu.js} +0 -0
- /package/dist/{init-D-g0ONX1.js → init-uv0kkh4g.js} +0 -0
- /package/dist/{javascript-DvwNVye9.js → javascript-DzigE11c.js} +0 -0
- /package/dist/{julia-DoKiagZC.js → julia-PwfB-0Cm.js} +0 -0
- /package/dist/{katex-B7pMJpE0.js → katex-C_XRmjAP.js} +0 -0
- /package/dist/{livescript-DxBZMiWB.js → livescript-BJLz1EbT.js} +0 -0
- /package/dist/{lua-DmS_0NTu.js → lua-ZC-XC2jf.js} +0 -0
- /package/dist/{math-BYK36kWZ.js → math-DFcdCCU8.js} +0 -0
- /package/dist/{mathematica-ChlDFeIC.js → mathematica-DCYMx6qB.js} +0 -0
- /package/dist/{mbox-CguZuODr.js → mbox-OxMK_9XI.js} +0 -0
- /package/dist/{mirc-CFtY8dqz.js → mirc-nJVyhA0H.js} +0 -0
- /package/dist/{mllike-C0EJrEOk.js → mllike-DRO89bsU.js} +0 -0
- /package/dist/{modelica-C1kO1nfS.js → modelica-Don3E6ZD.js} +0 -0
- /package/dist/{mscgen-DEYdr7AY.js → mscgen-DJfqD3bN.js} +0 -0
- /package/dist/{mumps-B3NVJs2V.js → mumps-SjGTvDYL.js} +0 -0
- /package/dist/{nginx-ComVAAGN.js → nginx-DasThI7R.js} +0 -0
- /package/dist/{node-sql-parser-DNGGJ-Rw.js → node-sql-parser-B8nBD36q.js} +0 -0
- /package/dist/{ntriples-DHol9X9H.js → ntriples-CNBKRl3I.js} +0 -0
- /package/dist/{octave-CYGz0bfo.js → octave-DdeVHNlx.js} +0 -0
- /package/dist/{oz-kPxb2ni5.js → oz-CcKSoNvN.js} +0 -0
- /package/dist/{pascal-bZ0yrJKy.js → pascal-6leftwNj.js} +0 -0
- /package/dist/{path-Du6n3sOU.js → path-BGaWgPKg.js} +0 -0
- /package/dist/{perl-z4hvqyqz.js → perl-BhJIwWzN.js} +0 -0
- /package/dist/{pig-DZO8QDF9.js → pig-r-xDHqRf.js} +0 -0
- /package/dist/{powershell-BSuaDQEC.js → powershell-D-BELeNi.js} +0 -0
- /package/dist/{properties-BXhGLlIx.js → properties-CnuDhbll.js} +0 -0
- /package/dist/{protobuf-DM6iybWV.js → protobuf-CO8RBhvX.js} +0 -0
- /package/dist/{puppet-Bn05sQT8.js → puppet-NmXHjLy8.js} +0 -0
- /package/dist/{python-Cvnhm0g7.js → python-DAQXi720.js} +0 -0
- /package/dist/{q-B9V8hzex.js → q-DlikXfV0.js} +0 -0
- /package/dist/{r-Cf0gFqmq.js → r-CuohilwT.js} +0 -0
- /package/dist/{rpm-D-LMkTV1.js → rpm-0Pjwp0Pb.js} +0 -0
- /package/dist/{ruby-DeuPikpK.js → ruby-Dq8NJTDG.js} +0 -0
- /package/dist/{sas-C9tjgAo9.js → sas-CuwonyVP.js} +0 -0
- /package/dist/{scheme-D1_bUF0G.js → scheme-CYU-RRIf.js} +0 -0
- /package/dist/{shell-CJBmnks3.js → shell-COPmX2qE.js} +0 -0
- /package/dist/{sieve-1fSV75CF.js → sieve-B_3zyLne.js} +0 -0
- /package/dist/{simple-mode-B90Wdavj.js → simple-mode-DSBniks8.js} +0 -0
- /package/dist/{smalltalk-sZNPD0HO.js → smalltalk-DRft7iPv.js} +0 -0
- /package/dist/{solr-DTkyqJ-Z.js → solr-RZ9uTl59.js} +0 -0
- /package/dist/{sparql-oHc1nm77.js → sparql-CN6qj55H.js} +0 -0
- /package/dist/{spreadsheet-CER0raqY.js → spreadsheet-BNNUNXA2.js} +0 -0
- /package/dist/{sql-ByOoEONQ.js → sql-B4x8IkwU.js} +0 -0
- /package/dist/{stylus-KzkX6zRB.js → stylus-Bn_ZjOQ3.js} +0 -0
- /package/dist/{swift-DqVxZvKo.js → swift-BLUJhMbz.js} +0 -0
- /package/dist/{tcl-BtWSwXfA.js → tcl-C86fxecl.js} +0 -0
- /package/dist/{textile-CWDbn9Ql.js → textile-DmHh2rsK.js} +0 -0
- /package/dist/{tiddlywiki-Cr9xyOY1.js → tiddlywiki-DI0mF2WJ.js} +0 -0
- /package/dist/{tiki-D5JONyfZ.js → tiki-2HU6XLLn.js} +0 -0
- /package/dist/{timer-D7JVdX9U.js → timer-YZl28NYN.js} +0 -0
- /package/dist/{toml-BfehlgmL.js → toml-GWANRNAD.js} +0 -0
- /package/dist/{treemap-qFGzn7xk.js → treemap-D-ka1hvx.js} +0 -0
- /package/dist/{troff-BZBk6AAu.js → troff-BHTsomIy.js} +0 -0
- /package/dist/{ttcn-DVwvXg0_.js → ttcn-DQuhn5Mn.js} +0 -0
- /package/dist/{ttcn-cfg-gjbVLf1L.js → ttcn-cfg-HjFYtdB-.js} +0 -0
- /package/dist/{turtle-CgxKXorV.js → turtle-nCay33Nv.js} +0 -0
- /package/dist/{vb-B9kSwTdM.js → vb-BG-XlqqJ.js} +0 -0
- /package/dist/{vbscript-DrUKSCdb.js → vbscript-B6vyW0-D.js} +0 -0
- /package/dist/{velocity-AlMYTnMy.js → velocity-CWegueqO.js} +0 -0
- /package/dist/{verilog-DLUaM05j.js → verilog-CzSQm4cG.js} +0 -0
- /package/dist/{vhdl-DUJOtSmO.js → vhdl-DqnNVL7r.js} +0 -0
- /package/dist/{webidl-CQp4aHk_.js → webidl-DXEUpDWH.js} +0 -0
- /package/dist/{xquery-IxkjlwOD.js → xquery-Ba_NB5bD.js} +0 -0
- /package/dist/{yacas-Bnctn5w8.js → yacas-HKQU6hyk.js} +0 -0
- /package/dist/{z80-DrFwhx53.js → z80-CXkHXLdj.js} +0 -0
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
import type { Column, Table } from "@tanstack/react-table";
|
|
5
5
|
import { CheckIcon, MinusIcon, Trash2Icon, XIcon } from "lucide-react";
|
|
6
|
-
import { useId, useState } from "react";
|
|
6
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
7
7
|
import type { CalculateTopKRows } from "@/plugins/impl/DataTablePlugin";
|
|
8
|
+
import type { OperatorType } from "@/plugins/impl/data-frames/utils/operators";
|
|
8
9
|
import { Combobox, ComboboxItem } from "../ui/combobox";
|
|
9
10
|
import { Input } from "../ui/input";
|
|
10
11
|
import { NumberField } from "../ui/number-field";
|
|
@@ -17,67 +18,68 @@ import {
|
|
|
17
18
|
} from "../ui/select";
|
|
18
19
|
import { Button } from "../ui/button";
|
|
19
20
|
import { FilterByValuesPicker } from "./filter-by-values-picker";
|
|
20
|
-
import {
|
|
21
|
+
import { RegexInput } from "./regex-input";
|
|
22
|
+
import {
|
|
23
|
+
type ColumnFilterValue,
|
|
24
|
+
Filter,
|
|
25
|
+
MEMBERSHIP_OPS,
|
|
26
|
+
NUMBER_COMPARISON_OPS,
|
|
27
|
+
type NumberComparisonOp,
|
|
28
|
+
NUMBER_OPS,
|
|
29
|
+
TEXT_OPS,
|
|
30
|
+
TEXT_SCALAR_OPS,
|
|
31
|
+
type TextScalarOp,
|
|
32
|
+
} from "./filters";
|
|
33
|
+
import { OPERATOR_LABELS } from "./operator-labels";
|
|
21
34
|
import { Tooltip } from "../ui/tooltip";
|
|
22
35
|
|
|
23
|
-
// Editable filter types in this editor — date/datetime/time are read-only
|
|
24
|
-
// Will add support for rest in next PR
|
|
25
36
|
type EditableFilterType = "number" | "text" | "boolean" | "select";
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| "is_not_null"
|
|
39
|
-
| "in"
|
|
40
|
-
| "not_in";
|
|
41
|
-
|
|
42
|
-
// will be expanded by a follow up PR
|
|
43
|
-
const OPERATORS_BY_TYPE: Record<EditableFilterType, UiOperator[]> = {
|
|
44
|
-
number: ["between", "is_null", "is_not_null"],
|
|
45
|
-
text: ["contains", "is_null", "is_not_null"],
|
|
46
|
-
boolean: ["is_true", "is_false", "is_null", "is_not_null"],
|
|
47
|
-
select: ["in", "not_in"],
|
|
38
|
+
const BOOLEAN_OPS = ["is_true", "is_false", "is_null", "is_not_null"] as const;
|
|
39
|
+
const SELECT_OPS = MEMBERSHIP_OPS;
|
|
40
|
+
|
|
41
|
+
const OPERATORS_BY_TYPE: Record<
|
|
42
|
+
EditableFilterType,
|
|
43
|
+
ReadonlyArray<OperatorType>
|
|
44
|
+
> = {
|
|
45
|
+
number: NUMBER_OPS,
|
|
46
|
+
text: TEXT_OPS,
|
|
47
|
+
boolean: BOOLEAN_OPS,
|
|
48
|
+
select: SELECT_OPS,
|
|
48
49
|
};
|
|
49
50
|
|
|
50
|
-
const DEFAULT_OPERATOR: Record<EditableFilterType,
|
|
51
|
+
const DEFAULT_OPERATOR: Record<EditableFilterType, OperatorType> = {
|
|
51
52
|
number: "between",
|
|
52
53
|
text: "contains",
|
|
53
54
|
boolean: "is_true",
|
|
54
55
|
select: "in",
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
const
|
|
58
|
-
between: "Between",
|
|
59
|
-
contains: "Contains",
|
|
60
|
-
is_true: "Is true",
|
|
61
|
-
is_false: "Is false",
|
|
62
|
-
is_null: "Is null",
|
|
63
|
-
is_not_null: "Is not null",
|
|
64
|
-
in: "Is in",
|
|
65
|
-
not_in: "Not in",
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const OPERATORS_WITHOUT_VALUE = new Set<UiOperator>([
|
|
58
|
+
const OPERATORS_WITHOUT_VALUE = new Set<OperatorType>([
|
|
69
59
|
"is_true",
|
|
70
60
|
"is_false",
|
|
71
61
|
"is_null",
|
|
72
62
|
"is_not_null",
|
|
63
|
+
"is_empty",
|
|
73
64
|
]);
|
|
74
65
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
const NUMBER_COMPARISON_SET: ReadonlySet<OperatorType> = new Set(
|
|
67
|
+
NUMBER_COMPARISON_OPS,
|
|
68
|
+
);
|
|
69
|
+
const TEXT_SCALAR_SET: ReadonlySet<OperatorType> = new Set(TEXT_SCALAR_OPS);
|
|
70
|
+
|
|
71
|
+
const isNumberComparisonOp = (op: OperatorType): op is NumberComparisonOp =>
|
|
72
|
+
NUMBER_COMPARISON_SET.has(op);
|
|
73
|
+
const isTextScalarOp = (op: OperatorType): op is TextScalarOp =>
|
|
74
|
+
TEXT_SCALAR_SET.has(op);
|
|
75
|
+
|
|
76
|
+
type DraftValue =
|
|
77
|
+
| { kind: "between"; min?: number; max?: number }
|
|
78
|
+
| { kind: "single-number"; value?: number }
|
|
79
|
+
| { kind: "single-text"; text?: string }
|
|
80
|
+
| { kind: "multi-text"; values?: string[] }
|
|
81
|
+
| { kind: "options"; options?: unknown[] }
|
|
82
|
+
| { kind: "none" };
|
|
81
83
|
|
|
82
84
|
interface Snapshot {
|
|
83
85
|
columnId: string;
|
|
@@ -92,7 +94,7 @@ interface FilterPillEditorProps<TData> {
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
export const FilterPillEditor = <TData,>({
|
|
95
|
-
snapshot,
|
|
97
|
+
snapshot,
|
|
96
98
|
table,
|
|
97
99
|
calculateTopKRows,
|
|
98
100
|
onClose,
|
|
@@ -102,13 +104,13 @@ export const FilterPillEditor = <TData,>({
|
|
|
102
104
|
const valueId = useId();
|
|
103
105
|
|
|
104
106
|
const snapshotType = getEditableType(snapshot.value);
|
|
105
|
-
const snapshotOperator =
|
|
107
|
+
const snapshotOperator = snapshot.value.operator as OperatorType;
|
|
106
108
|
const snapshotDraft = toDraftValue(snapshot.value);
|
|
107
109
|
|
|
108
110
|
const [draftColumnId, setDraftColumnId] = useState<string>(snapshot.columnId);
|
|
109
111
|
const [draftType, setDraftType] = useState<EditableFilterType>(snapshotType);
|
|
110
112
|
const [draftOperator, setDraftOperator] =
|
|
111
|
-
useState<
|
|
113
|
+
useState<OperatorType>(snapshotOperator);
|
|
112
114
|
const [draftValue, setDraftValue] = useState<DraftValue>(snapshotDraft);
|
|
113
115
|
|
|
114
116
|
const editableColumns = table.getAllColumns().filter((c) => {
|
|
@@ -118,18 +120,11 @@ export const FilterPillEditor = <TData,>({
|
|
|
118
120
|
);
|
|
119
121
|
});
|
|
120
122
|
|
|
121
|
-
// if we switch back to pre-edit column+operator
|
|
122
|
-
// restore the original value as well
|
|
123
123
|
const rehydrateIfMatchesSnapshot = (args: {
|
|
124
124
|
id: string;
|
|
125
|
-
|
|
126
|
-
operator: UiOperator;
|
|
125
|
+
operator: OperatorType;
|
|
127
126
|
}) => {
|
|
128
|
-
if (
|
|
129
|
-
args.id === snapshot.columnId &&
|
|
130
|
-
args.type === snapshotType &&
|
|
131
|
-
args.operator === snapshotOperator
|
|
132
|
-
) {
|
|
127
|
+
if (args.id === snapshot.columnId && args.operator === snapshotOperator) {
|
|
133
128
|
setDraftValue(snapshotDraft);
|
|
134
129
|
}
|
|
135
130
|
};
|
|
@@ -147,34 +142,42 @@ export const FilterPillEditor = <TData,>({
|
|
|
147
142
|
nextOperator = DEFAULT_OPERATOR[nextColumnType];
|
|
148
143
|
setDraftType(nextColumnType);
|
|
149
144
|
setDraftOperator(nextOperator);
|
|
150
|
-
setDraftValue(
|
|
145
|
+
setDraftValue(emptyDraftFor(nextColumnType, nextOperator));
|
|
151
146
|
}
|
|
152
147
|
setDraftColumnId(nextColumnId);
|
|
153
148
|
rehydrateIfMatchesSnapshot({
|
|
154
149
|
id: nextColumnId,
|
|
155
|
-
type: nextColumnType,
|
|
156
150
|
operator: nextOperator,
|
|
157
151
|
});
|
|
158
152
|
};
|
|
159
153
|
|
|
160
|
-
const handleOperatorChange = (nextOp:
|
|
154
|
+
const handleOperatorChange = (nextOp: OperatorType) => {
|
|
161
155
|
setDraftOperator(nextOp);
|
|
156
|
+
const nextEmpty = emptyDraftFor(draftType, nextOp);
|
|
157
|
+
if (nextEmpty.kind !== draftValue.kind) {
|
|
158
|
+
setDraftValue(nextEmpty);
|
|
159
|
+
}
|
|
162
160
|
rehydrateIfMatchesSnapshot({
|
|
163
161
|
id: draftColumnId,
|
|
164
|
-
type: draftType,
|
|
165
162
|
operator: nextOp,
|
|
166
163
|
});
|
|
167
164
|
};
|
|
168
165
|
|
|
166
|
+
const pendingValue = buildFilterValue({
|
|
167
|
+
type: draftType,
|
|
168
|
+
operator: draftOperator,
|
|
169
|
+
draft: draftValue,
|
|
170
|
+
});
|
|
171
|
+
const applyDisabled = pendingValue === undefined;
|
|
172
|
+
const applyTooltip = applyDisabled
|
|
173
|
+
? getMissingValueMessage(draftType, draftOperator)
|
|
174
|
+
: "Apply filter";
|
|
175
|
+
|
|
169
176
|
const handleApply = () => {
|
|
170
|
-
|
|
171
|
-
type: draftType,
|
|
172
|
-
operator: draftOperator,
|
|
173
|
-
draft: draftValue,
|
|
174
|
-
});
|
|
175
|
-
if (!value) {
|
|
177
|
+
if (!pendingValue) {
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
180
|
+
const value = pendingValue;
|
|
178
181
|
table.setColumnFilters((filters) => {
|
|
179
182
|
const dropIds = new Set([snapshot.columnId, draftColumnId]);
|
|
180
183
|
const filtered = filters.filter((f) => !dropIds.has(f.id));
|
|
@@ -191,9 +194,29 @@ export const FilterPillEditor = <TData,>({
|
|
|
191
194
|
};
|
|
192
195
|
|
|
193
196
|
const showValueSlot = !OPERATORS_WITHOUT_VALUE.has(draftOperator);
|
|
197
|
+
const operatorOptions = OPERATORS_BY_TYPE[draftType];
|
|
198
|
+
|
|
199
|
+
const valueSlotRef = useRef<HTMLDivElement>(null);
|
|
200
|
+
const operatorTriggerRef = useRef<HTMLButtonElement>(null);
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
const firstInput = valueSlotRef.current?.querySelector<HTMLElement>(
|
|
203
|
+
'input, [role="combobox"], button',
|
|
204
|
+
);
|
|
205
|
+
if (firstInput) {
|
|
206
|
+
firstInput.focus();
|
|
207
|
+
} else {
|
|
208
|
+
operatorTriggerRef.current?.focus();
|
|
209
|
+
}
|
|
210
|
+
}, [draftType, draftOperator]);
|
|
194
211
|
|
|
195
212
|
return (
|
|
196
|
-
<
|
|
213
|
+
<form
|
|
214
|
+
className="flex flex-row gap-4 items-end p-3"
|
|
215
|
+
onSubmit={(e) => {
|
|
216
|
+
e.preventDefault();
|
|
217
|
+
handleApply();
|
|
218
|
+
}}
|
|
219
|
+
>
|
|
197
220
|
<div className="flex flex-col gap-1">
|
|
198
221
|
<label className="text-xs text-muted-foreground" htmlFor={columnId}>
|
|
199
222
|
Column
|
|
@@ -218,14 +241,19 @@ export const FilterPillEditor = <TData,>({
|
|
|
218
241
|
Operator
|
|
219
242
|
</label>
|
|
220
243
|
<Select
|
|
244
|
+
key={draftType}
|
|
221
245
|
value={draftOperator}
|
|
222
|
-
onValueChange={(v) => handleOperatorChange(v as
|
|
246
|
+
onValueChange={(v) => handleOperatorChange(v as OperatorType)}
|
|
223
247
|
>
|
|
224
|
-
<SelectTrigger
|
|
248
|
+
<SelectTrigger
|
|
249
|
+
ref={operatorTriggerRef}
|
|
250
|
+
id={operatorId}
|
|
251
|
+
className="h-6 mb-1 bg-transparent"
|
|
252
|
+
>
|
|
225
253
|
<SelectValue />
|
|
226
254
|
</SelectTrigger>
|
|
227
255
|
<SelectContent>
|
|
228
|
-
{
|
|
256
|
+
{operatorOptions.map((op) => (
|
|
229
257
|
<SelectItem key={op} value={op}>
|
|
230
258
|
{OPERATOR_LABELS[op]}
|
|
231
259
|
</SelectItem>
|
|
@@ -234,13 +262,14 @@ export const FilterPillEditor = <TData,>({
|
|
|
234
262
|
</Select>
|
|
235
263
|
</div>
|
|
236
264
|
{showValueSlot && (
|
|
237
|
-
<div className="flex flex-col gap-1">
|
|
265
|
+
<div ref={valueSlotRef} className="flex flex-col gap-1">
|
|
238
266
|
<label htmlFor={valueId} className="text-xs text-muted-foreground">
|
|
239
267
|
Value
|
|
240
268
|
</label>
|
|
241
269
|
<ValueSlot
|
|
242
270
|
id={valueId}
|
|
243
271
|
type={draftType}
|
|
272
|
+
operator={draftOperator}
|
|
244
273
|
value={draftValue}
|
|
245
274
|
onChange={setDraftValue}
|
|
246
275
|
column={table.getColumn(draftColumnId) ?? null}
|
|
@@ -249,17 +278,19 @@ export const FilterPillEditor = <TData,>({
|
|
|
249
278
|
</div>
|
|
250
279
|
)}
|
|
251
280
|
<div className="flex gap-1 mb-1">
|
|
252
|
-
<Tooltip content=
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
281
|
+
<Tooltip content={applyTooltip}>
|
|
282
|
+
<span className="inline-flex">
|
|
283
|
+
<Button
|
|
284
|
+
type="submit"
|
|
285
|
+
size="icon"
|
|
286
|
+
variant="ghost"
|
|
287
|
+
disabled={applyDisabled}
|
|
288
|
+
className="rounded-full text-primary hover:text-primary hover:bg-primary/10"
|
|
289
|
+
aria-label="Apply filter"
|
|
290
|
+
>
|
|
291
|
+
<CheckIcon className="h-3.5 w-3.5" aria-hidden={true} />
|
|
292
|
+
</Button>
|
|
293
|
+
</span>
|
|
263
294
|
</Tooltip>
|
|
264
295
|
<Tooltip content="Close without saving">
|
|
265
296
|
<Button
|
|
@@ -286,13 +317,14 @@ export const FilterPillEditor = <TData,>({
|
|
|
286
317
|
</Button>
|
|
287
318
|
</Tooltip>
|
|
288
319
|
</div>
|
|
289
|
-
</
|
|
320
|
+
</form>
|
|
290
321
|
);
|
|
291
322
|
};
|
|
292
323
|
|
|
293
324
|
interface ValueSlotProps<TData, TValue> {
|
|
294
325
|
id?: string;
|
|
295
326
|
type: EditableFilterType;
|
|
327
|
+
operator: OperatorType;
|
|
296
328
|
value: DraftValue;
|
|
297
329
|
onChange: (next: DraftValue) => void;
|
|
298
330
|
column: Column<TData, TValue> | null;
|
|
@@ -302,26 +334,28 @@ interface ValueSlotProps<TData, TValue> {
|
|
|
302
334
|
const ValueSlot = <TData, TValue>({
|
|
303
335
|
id,
|
|
304
336
|
type,
|
|
337
|
+
operator,
|
|
305
338
|
value,
|
|
306
339
|
onChange,
|
|
307
340
|
column,
|
|
308
341
|
calculateTopKRows,
|
|
309
342
|
}: ValueSlotProps<TData, TValue>) => {
|
|
310
|
-
if (type === "number") {
|
|
343
|
+
if (type === "number" && operator === "between") {
|
|
344
|
+
const v = value.kind === "between" ? value : { kind: "between" as const };
|
|
311
345
|
return (
|
|
312
|
-
<div className="flex gap-1 items-center w-
|
|
346
|
+
<div className="flex gap-1 items-center w-44">
|
|
313
347
|
<NumberField
|
|
314
348
|
id={id}
|
|
315
|
-
value={
|
|
316
|
-
onChange={(
|
|
349
|
+
value={v.min}
|
|
350
|
+
onChange={(n) => onChange({ kind: "between", min: n, max: v.max })}
|
|
317
351
|
aria-label="min"
|
|
318
352
|
placeholder="min"
|
|
319
353
|
className="border-input flex-1 min-w-0"
|
|
320
354
|
/>
|
|
321
355
|
<MinusIcon className="h-5 w-5 text-muted-foreground shrink-0" />
|
|
322
356
|
<NumberField
|
|
323
|
-
value={
|
|
324
|
-
onChange={(
|
|
357
|
+
value={v.max}
|
|
358
|
+
onChange={(n) => onChange({ kind: "between", min: v.min, max: n })}
|
|
325
359
|
aria-label="max"
|
|
326
360
|
placeholder="max"
|
|
327
361
|
className="border-input flex-1 min-w-0"
|
|
@@ -329,26 +363,78 @@ const ValueSlot = <TData, TValue>({
|
|
|
329
363
|
</div>
|
|
330
364
|
);
|
|
331
365
|
}
|
|
332
|
-
if (type === "
|
|
366
|
+
if (type === "number" && isNumberComparisonOp(operator)) {
|
|
367
|
+
const v =
|
|
368
|
+
value.kind === "single-number"
|
|
369
|
+
? value
|
|
370
|
+
: { kind: "single-number" as const };
|
|
371
|
+
return (
|
|
372
|
+
<NumberField
|
|
373
|
+
id={id}
|
|
374
|
+
value={v.value}
|
|
375
|
+
onChange={(n) => onChange({ kind: "single-number", value: n })}
|
|
376
|
+
aria-label="value"
|
|
377
|
+
placeholder="value"
|
|
378
|
+
className="border-input w-24 min-w-0"
|
|
379
|
+
/>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
if (
|
|
383
|
+
type === "text" &&
|
|
384
|
+
(operator === "in" || operator === "not_in") &&
|
|
385
|
+
column
|
|
386
|
+
) {
|
|
387
|
+
const v =
|
|
388
|
+
value.kind === "multi-text" ? value : { kind: "multi-text" as const };
|
|
389
|
+
return (
|
|
390
|
+
<div className="w-48">
|
|
391
|
+
<FilterByValuesPicker
|
|
392
|
+
column={column}
|
|
393
|
+
calculateTopKRows={calculateTopKRows}
|
|
394
|
+
chosenValues={v.values ?? []}
|
|
395
|
+
onChange={(next) =>
|
|
396
|
+
onChange({ kind: "multi-text", values: next.map(String) })
|
|
397
|
+
}
|
|
398
|
+
creatable={true}
|
|
399
|
+
/>
|
|
400
|
+
</div>
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
if (type === "text" && isTextScalarOp(operator)) {
|
|
404
|
+
const v =
|
|
405
|
+
value.kind === "single-text" ? value : { kind: "single-text" as const };
|
|
406
|
+
if (operator === "regex") {
|
|
407
|
+
return (
|
|
408
|
+
<RegexInput
|
|
409
|
+
id={id}
|
|
410
|
+
value={v.text ?? ""}
|
|
411
|
+
onChange={(text) => onChange({ kind: "single-text", text })}
|
|
412
|
+
className="w-40"
|
|
413
|
+
/>
|
|
414
|
+
);
|
|
415
|
+
}
|
|
333
416
|
return (
|
|
334
417
|
<Input
|
|
335
418
|
id={id}
|
|
336
419
|
type="text"
|
|
337
|
-
value={
|
|
338
|
-
onChange={(e) =>
|
|
420
|
+
value={v.text ?? ""}
|
|
421
|
+
onChange={(e) =>
|
|
422
|
+
onChange({ kind: "single-text", text: e.target.value })
|
|
423
|
+
}
|
|
339
424
|
placeholder="Text…"
|
|
340
|
-
className="border-input min-w-0"
|
|
425
|
+
className="border-input w-40 min-w-0"
|
|
341
426
|
/>
|
|
342
427
|
);
|
|
343
428
|
}
|
|
344
429
|
if (type === "select" && column) {
|
|
430
|
+
const v = value.kind === "options" ? value : { kind: "options" as const };
|
|
345
431
|
return (
|
|
346
432
|
<div className="flex w-48">
|
|
347
433
|
<FilterByValuesPicker
|
|
348
434
|
column={column}
|
|
349
435
|
calculateTopKRows={calculateTopKRows}
|
|
350
|
-
chosenValues={
|
|
351
|
-
onChange={(values) => onChange({
|
|
436
|
+
chosenValues={v.options ?? []}
|
|
437
|
+
onChange={(values) => onChange({ kind: "options", options: values })}
|
|
352
438
|
/>
|
|
353
439
|
</div>
|
|
354
440
|
);
|
|
@@ -369,43 +455,74 @@ function getEditableType(value: ColumnFilterValue): EditableFilterType {
|
|
|
369
455
|
if (value.type === "select") {
|
|
370
456
|
return "select";
|
|
371
457
|
}
|
|
372
|
-
// date/datetime/time fall back to text; callers should guard. supported in future
|
|
373
458
|
return "text";
|
|
374
459
|
}
|
|
375
460
|
|
|
376
|
-
function
|
|
377
|
-
if (value.operator === "is_null") {
|
|
378
|
-
return "is_null";
|
|
379
|
-
}
|
|
380
|
-
if (value.operator === "is_not_null") {
|
|
381
|
-
return "is_not_null";
|
|
382
|
-
}
|
|
461
|
+
function toDraftValue(value: ColumnFilterValue): DraftValue {
|
|
383
462
|
if (value.type === "number") {
|
|
384
|
-
|
|
463
|
+
switch (value.operator) {
|
|
464
|
+
case "between":
|
|
465
|
+
return { kind: "between", min: value.min, max: value.max };
|
|
466
|
+
case "is_null":
|
|
467
|
+
case "is_not_null":
|
|
468
|
+
return { kind: "none" };
|
|
469
|
+
default:
|
|
470
|
+
return { kind: "single-number", value: value.value };
|
|
471
|
+
}
|
|
385
472
|
}
|
|
386
473
|
if (value.type === "text") {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
474
|
+
switch (value.operator) {
|
|
475
|
+
case "in":
|
|
476
|
+
case "not_in":
|
|
477
|
+
return { kind: "multi-text", values: [...value.values] };
|
|
478
|
+
case "is_null":
|
|
479
|
+
case "is_not_null":
|
|
480
|
+
case "is_empty":
|
|
481
|
+
return { kind: "none" };
|
|
482
|
+
default:
|
|
483
|
+
return { kind: "single-text", text: value.text };
|
|
484
|
+
}
|
|
391
485
|
}
|
|
392
486
|
if (value.type === "select") {
|
|
393
|
-
return
|
|
487
|
+
return { kind: "options", options: [...value.options] };
|
|
394
488
|
}
|
|
395
|
-
return "
|
|
489
|
+
return { kind: "none" };
|
|
396
490
|
}
|
|
397
491
|
|
|
398
|
-
function
|
|
399
|
-
|
|
400
|
-
|
|
492
|
+
function emptyDraftFor(
|
|
493
|
+
type: EditableFilterType,
|
|
494
|
+
operator: OperatorType,
|
|
495
|
+
): DraftValue {
|
|
496
|
+
if (OPERATORS_WITHOUT_VALUE.has(operator)) {
|
|
497
|
+
return { kind: "none" };
|
|
401
498
|
}
|
|
402
|
-
if (
|
|
403
|
-
return
|
|
499
|
+
if (type === "number") {
|
|
500
|
+
return operator === "between"
|
|
501
|
+
? { kind: "between" }
|
|
502
|
+
: { kind: "single-number" };
|
|
404
503
|
}
|
|
405
|
-
if (
|
|
406
|
-
return
|
|
504
|
+
if (type === "text") {
|
|
505
|
+
return operator === "in" || operator === "not_in"
|
|
506
|
+
? { kind: "multi-text", values: [] }
|
|
507
|
+
: { kind: "single-text" };
|
|
407
508
|
}
|
|
408
|
-
|
|
509
|
+
if (type === "select") {
|
|
510
|
+
return { kind: "options", options: [] };
|
|
511
|
+
}
|
|
512
|
+
return { kind: "none" };
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function getMissingValueMessage(
|
|
516
|
+
type: EditableFilterType,
|
|
517
|
+
operator: OperatorType,
|
|
518
|
+
): string {
|
|
519
|
+
if (type === "number" && operator === "between") {
|
|
520
|
+
return "Min and max are required";
|
|
521
|
+
}
|
|
522
|
+
if (type === "text" && (operator === "in" || operator === "not_in")) {
|
|
523
|
+
return "Pick at least one value";
|
|
524
|
+
}
|
|
525
|
+
return "Value is required";
|
|
409
526
|
}
|
|
410
527
|
|
|
411
528
|
function buildFilterValue({
|
|
@@ -414,51 +531,79 @@ function buildFilterValue({
|
|
|
414
531
|
draft,
|
|
415
532
|
}: {
|
|
416
533
|
type: EditableFilterType;
|
|
417
|
-
operator:
|
|
534
|
+
operator: OperatorType;
|
|
418
535
|
draft: DraftValue;
|
|
419
536
|
}): ColumnFilterValue | undefined {
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return Filter.number({ operator: op });
|
|
537
|
+
if (type === "number") {
|
|
538
|
+
if (operator === "is_null" || operator === "is_not_null") {
|
|
539
|
+
return Filter.number({ operator });
|
|
424
540
|
}
|
|
425
|
-
if (
|
|
426
|
-
|
|
541
|
+
if (operator === "between") {
|
|
542
|
+
if (
|
|
543
|
+
draft.kind !== "between" ||
|
|
544
|
+
draft.min === undefined ||
|
|
545
|
+
draft.max === undefined
|
|
546
|
+
) {
|
|
547
|
+
return undefined;
|
|
548
|
+
}
|
|
549
|
+
return Filter.number({
|
|
550
|
+
operator: "between",
|
|
551
|
+
min: draft.min,
|
|
552
|
+
max: draft.max,
|
|
553
|
+
});
|
|
427
554
|
}
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
if (type === "number") {
|
|
431
|
-
if (draft.min === undefined && draft.max === undefined) {
|
|
555
|
+
if (!isNumberComparisonOp(operator)) {
|
|
432
556
|
return undefined;
|
|
433
557
|
}
|
|
434
|
-
|
|
558
|
+
if (draft.kind !== "single-number" || draft.value === undefined) {
|
|
559
|
+
return undefined;
|
|
560
|
+
}
|
|
561
|
+
return Filter.number({ operator, value: draft.value });
|
|
435
562
|
}
|
|
436
563
|
if (type === "text") {
|
|
437
|
-
if (
|
|
564
|
+
if (
|
|
565
|
+
operator === "is_null" ||
|
|
566
|
+
operator === "is_not_null" ||
|
|
567
|
+
operator === "is_empty"
|
|
568
|
+
) {
|
|
569
|
+
return Filter.text({ operator });
|
|
570
|
+
}
|
|
571
|
+
if (operator === "in" || operator === "not_in") {
|
|
572
|
+
if (
|
|
573
|
+
draft.kind !== "multi-text" ||
|
|
574
|
+
!draft.values ||
|
|
575
|
+
draft.values.length === 0
|
|
576
|
+
) {
|
|
577
|
+
return undefined;
|
|
578
|
+
}
|
|
579
|
+
return Filter.text({ operator, values: draft.values });
|
|
580
|
+
}
|
|
581
|
+
if (!isTextScalarOp(operator)) {
|
|
438
582
|
return undefined;
|
|
439
583
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
});
|
|
584
|
+
if (draft.kind !== "single-text" || !draft.text) {
|
|
585
|
+
return undefined;
|
|
586
|
+
}
|
|
587
|
+
return Filter.text({ operator, text: draft.text });
|
|
444
588
|
}
|
|
445
589
|
if (type === "boolean") {
|
|
446
590
|
if (operator === "is_true") {
|
|
447
|
-
return Filter.boolean({
|
|
448
|
-
value: true,
|
|
449
|
-
operator: "is_true",
|
|
450
|
-
});
|
|
591
|
+
return Filter.boolean({ value: true, operator: "is_true" });
|
|
451
592
|
}
|
|
452
593
|
if (operator === "is_false") {
|
|
453
|
-
return Filter.boolean({
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
});
|
|
594
|
+
return Filter.boolean({ value: false, operator: "is_false" });
|
|
595
|
+
}
|
|
596
|
+
if (operator === "is_null" || operator === "is_not_null") {
|
|
597
|
+
return Filter.boolean({ operator });
|
|
457
598
|
}
|
|
458
599
|
return undefined;
|
|
459
600
|
}
|
|
460
601
|
if (type === "select") {
|
|
461
|
-
if (
|
|
602
|
+
if (
|
|
603
|
+
draft.kind !== "options" ||
|
|
604
|
+
!draft.options ||
|
|
605
|
+
draft.options.length === 0
|
|
606
|
+
) {
|
|
462
607
|
return undefined;
|
|
463
608
|
}
|
|
464
609
|
return Filter.select({
|