@marimo-team/islands 0.23.10-dev3 → 0.23.10-dev30
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-CyV83R2m.js → ConnectedDataExplorerComponent-DmBropAy.js} +31 -31
- package/dist/{ErrorBoundary-rULOrC_p.js → ErrorBoundary-DpbaKVv7.js} +1 -1
- package/dist/{any-language-editor-DfdpyDv_.js → any-language-editor-DNmoSiWL.js} +20 -20
- package/dist/assets/__vite-browser-external-eshhtsgZ.js +1 -0
- package/dist/assets/worker-CC0Oul9k.js +73 -0
- package/dist/{chat-ui-C1tL1pML.js → chat-ui-D6oraHT2.js} +76 -76
- package/dist/{check-DTbrK0zt.js → check-BCaJeT-J.js} +1 -1
- package/dist/{code-visibility-DfnO0DcH.js → code-visibility-wR7WSQ4c.js} +2166 -1292
- package/dist/{copy-BuQpJEzp.js → copy-UqRYxiOg.js} +33 -33
- package/dist/dist-7QfXoMdB.js +5 -0
- package/dist/{dist-DgnE8F-r.js → dist-A2846XWO.js} +1 -1
- package/dist/dist-BEXXyZig.js +5 -0
- package/dist/{dist-B3pZ0Ab6.js → dist-BR_gyG9L.js} +3 -3
- package/dist/{dist-CcXxepx6.js → dist-BSAt6RhH.js} +27 -27
- package/dist/{dist-Bde4a2kU.js → dist-BY018Paw.js} +8 -8
- package/dist/dist-BYj57OV4.js +5 -0
- package/dist/{dist-CUCNs1ja.js → dist-BaoDKvdy.js} +2 -2
- package/dist/{dist-Cy1WxgBD.js → dist-Bf7SHuNp.js} +5 -5
- package/dist/{dist-Bz_sYWbr.js → dist-Bk75fBZA.js} +2 -2
- package/dist/dist-BlSvQzNr.js +5 -0
- package/dist/{dist-C5VC_yzu.js → dist-BzEzfugY.js} +1 -1
- package/dist/dist-CCBlxAgS.js +8 -0
- package/dist/dist-CIDTVIUf.js +5 -0
- package/dist/{dist-CLUtPrdy.js → dist-CIYBwstr.js} +1 -1
- package/dist/{dist-BotSqB48.js → dist-C_Y3oV3C.js} +12 -12
- package/dist/{dist-BTfv03uy.js → dist-CcWX6tmx.js} +2 -2
- package/dist/{dist-BhM8gdSO.js → dist-CoXAujgg.js} +4 -4
- package/dist/{dist-4j4c7bjm.js → dist-CpxNdDkw.js} +3 -3
- package/dist/dist-CqQyhAM8.js +8 -0
- package/dist/dist-CwRu2Xzh.js +5 -0
- package/dist/{dist-BcuoonNH.js → dist-CxJDU6Bh.js} +9 -9
- package/dist/{dist-DxvORzUR.js → dist-D-W5ny5a.js} +8 -8
- package/dist/dist-D8CDTVgf.js +6 -0
- package/dist/dist-D8DNB0nO.js +8 -0
- package/dist/dist-DL6N_q-A.js +5 -0
- package/dist/{dist-BbbIBDiQ.js → dist-DMjWuVs8.js} +1 -1
- package/dist/dist-DOFbNV_b.js +8 -0
- package/dist/dist-DPrYzMY0.js +6 -0
- package/dist/{dist-h2c8sZvT.js → dist-DZORgqKY.js} +1 -1
- package/dist/{dist-B3P2fFpz.js → dist-DZo4nSS0.js} +14 -14
- package/dist/{dist-D4CewLk6.js → dist-Dax--nl9.js} +1 -1
- package/dist/{dist-DRfcqpxJ.js → dist-DgGbNavJ.js} +2 -2
- package/dist/{dist-C1BYNeCR.js → dist-Dk6PV_d3.js} +10 -10
- package/dist/{dist-fQ0ViXGs.js → dist-Dv_Y15yk.js} +107 -107
- package/dist/{dist-Bfwsv11D.js → dist-DyyjKEYf.js} +2 -2
- package/dist/{dist-p2qyWijU.js → dist-GZXUmt0b.js} +2 -2
- package/dist/{dist-CLJWPTX2.js → dist-LTU8Hdvn.js} +3 -3
- package/dist/{dist-DqAWR3CS.js → dist-M9Vag9Y0.js} +20 -20
- package/dist/{dist-DNdhYsgW.js → dist-U4F-tbMs.js} +79 -62
- package/dist/{dist-RqXTaiir.js → dist-abid3KgM.js} +11 -11
- package/dist/dist-cdmMjgsn.js +5 -0
- package/dist/dist-hT4QzYX-.js +1247 -0
- package/dist/{dist-luvabDEB.js → dist-t9Kf7xqC.js} +2 -2
- package/dist/{error-banner-5bz0L9hS.js → error-banner-Cc0I3C9e.js} +1 -1
- package/dist/esm-BaH2eg5-.js +1171 -0
- package/dist/{esm-Duie8iU-.js → esm-ga2Bf3O2.js} +43 -43
- package/dist/{extends-BgdxCfYu.js → extends-D_hDsj6R.js} +4 -4
- package/dist/{formats-DHxc-FdY.js → formats-C4wO47tk.js} +1 -1
- package/dist/{glide-data-editor-BOmK9ETQ.js → glide-data-editor-Qhu8oCX-.js} +12 -12
- package/dist/{html-to-image-CNa5ok96.js → html-to-image-UEH5lFDZ.js} +2318 -2275
- package/dist/{input-_2sjvfne.js → input-CMYy4hzj.js} +187 -185
- package/dist/{label-LWtdw5i8.js → label-CC4ytI1X.js} +1 -1
- package/dist/main.js +6941 -6913
- package/dist/{mermaid-lXOw5Py9.js → mermaid-zuLgJ8J8.js} +4 -4
- package/dist/{process-output-DKr4f1di.js → process-output-CyMLTogj.js} +3 -3
- package/dist/{reveal-component-UdMnCK5U.js → reveal-component-BjnkUAZ9.js} +697 -619
- package/dist/{spec-B96zNUEA.js → spec-X7FwLJni.js} +4 -4
- package/dist/{strings-Bu3vlb6W.js → strings-J57tzLr3.js} +47 -46
- package/dist/style.css +1 -1
- package/dist/{toDate-x-WRDCH7.js → toDate-d8RCRrRd.js} +2 -2
- package/dist/{tooltip-C5FYOpQc.js → tooltip-DpcyNkQ2.js} +2 -2
- package/dist/{types-CVvp1fKr.js → types-ChtMFmZ2.js} +1 -1
- package/dist/{useAsyncData-iRgKDT5s.js → useAsyncData-PonK__yh.js} +1 -1
- package/dist/{useDateFormatter-BA4FCquG.js → useDateFormatter-QB-3MpYr.js} +2 -2
- package/dist/{useDeepCompareMemoize-CkQ57VS2.js → useDeepCompareMemoize-D3NGWke6.js} +1 -1
- package/dist/{useLifecycle-BBO9PIph.js → useLifecycle-00mO3OSS.js} +2 -2
- package/dist/{useTheme-DHIrRQOe.js → useTheme-DEhDzATN.js} +1 -1
- package/dist/{vega-component-Dq-SH463.js → vega-component-9h1ACS78.js} +8 -8
- package/dist/{zod-CoBiJ5v4.js → zod-aLSua2NL.js} +24 -23
- package/package.json +3 -3
- package/src/components/data-table/TableBottomBar.tsx +1 -15
- package/src/components/data-table/TableTopBar.tsx +8 -13
- package/src/components/data-table/__tests__/TableBottomBar.test.tsx +6 -12
- package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +227 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +154 -12
- package/src/components/data-table/column-visibility-dropdown.tsx +204 -0
- package/src/components/data-table/data-table.tsx +1 -1
- package/src/components/data-table/filter-by-values-picker.tsx +39 -17
- package/src/components/data-table/filter-pills.tsx +1 -1
- package/src/components/data-table/hover-tooltip/__tests__/content.test.ts +60 -0
- package/src/components/data-table/hover-tooltip/content.ts +44 -0
- package/src/components/data-table/hover-tooltip/hover-tooltip.tsx +55 -0
- package/src/components/data-table/hover-tooltip/use-table-hover-tooltip.ts +159 -0
- package/src/components/data-table/renderers.tsx +27 -43
- package/src/components/datasources/__tests__/filter-empty.test.ts +183 -0
- package/src/components/datasources/datasources.tsx +92 -3
- package/src/components/editor/cell/cell-context-menu.tsx +15 -2
- package/src/components/editor/cell/code/language-toggle.tsx +7 -1
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +97 -52
- package/src/components/editor/chrome/wrapper/lazy-panels.ts +91 -0
- package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -0
- package/src/components/editor/documentation.css +35 -0
- package/src/components/editor/file-tree/file-explorer.tsx +8 -18
- package/src/components/editor/file-tree/tree-actions.tsx +46 -1
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +20 -0
- package/src/components/editor/renderers/slides-layout/types.ts +1 -0
- package/src/components/slides/__tests__/minimap-actions.test.tsx +166 -0
- package/src/components/slides/__tests__/reveal-component.test.ts +425 -0
- package/src/components/slides/minimap.tsx +127 -10
- package/src/components/slides/reveal-component.tsx +287 -61
- package/src/components/slides/slide-cell-view.tsx +26 -2
- package/src/components/slides/slide-form.tsx +26 -4
- package/src/components/storage/__tests__/storage-inspector.test.ts +53 -0
- package/src/components/storage/storage-inspector.tsx +68 -48
- package/src/components/ui/__tests__/use-toast.test.ts +75 -0
- package/src/components/ui/combobox.tsx +51 -32
- package/src/components/ui/reorderable-list.tsx +13 -0
- package/src/components/ui/select-core/__tests__/use-select-list.test.ts +294 -0
- package/src/components/ui/select-core/__tests__/utils.test.ts +222 -0
- package/src/components/ui/select-core/index.ts +16 -0
- package/src/components/ui/select-core/option-row.tsx +33 -0
- package/src/components/ui/select-core/render-slot.ts +20 -0
- package/src/components/ui/select-core/select-list.tsx +248 -0
- package/src/components/ui/select-core/types.ts +44 -0
- package/src/components/ui/select-core/use-select-list.ts +347 -0
- package/src/components/ui/select-core/utils.ts +121 -0
- package/src/components/ui/use-toast.ts +33 -13
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -28
- package/src/core/cells/__tests__/cell.test.ts +29 -2
- package/src/core/cells/cell.ts +5 -1
- package/src/core/codemirror/go-to-definition/commands.ts +4 -3
- package/src/core/codemirror/language/languages/python.ts +2 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +3 -1
- package/src/core/codemirror/lsp/__tests__/markdown-renderer.test.ts +41 -0
- package/src/core/codemirror/lsp/markdown-renderer.ts +59 -0
- package/src/core/datasets/data-source-connections.ts +2 -0
- package/src/core/network/__tests__/requests-static.test.ts +30 -0
- package/src/core/network/requests-static.ts +14 -10
- package/src/core/wasm/worker/bootstrap.ts +12 -4
- package/src/plugins/impl/MultiselectPlugin.tsx +19 -142
- package/src/plugins/impl/SearchableSelect.tsx +16 -97
- package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +5 -2
- package/src/plugins/impl/__tests__/MultiSelectPlugin.test.ts +1 -1
- package/src/plugins/layout/DownloadPlugin.tsx +1 -1
- package/src/utils/lazy.ts +6 -1
- package/dist/assets/__vite-browser-external-Ci2ZQfXU.js +0 -1
- package/dist/assets/worker-ip3AI_sN.js +0 -73
- package/dist/dist-0Fif7jnk.js +0 -5
- package/dist/dist-B5h_9sHB.js +0 -6
- package/dist/dist-B9M6R5ye.js +0 -5
- package/dist/dist-BCt3tnck.js +0 -8
- package/dist/dist-BUIJwMwn.js +0 -8
- package/dist/dist-BpquMd3k.js +0 -5
- package/dist/dist-BzJsqYfz.js +0 -5
- package/dist/dist-CA5ELXAf.js +0 -6
- package/dist/dist-CLBRs6Uv.js +0 -5
- package/dist/dist-CStVCMbq.js +0 -5
- package/dist/dist-CZRIEY3Y.js +0 -8
- package/dist/dist-CuUHbFD0.js +0 -5
- package/dist/dist-DV7Iabxb.js +0 -8
- package/dist/dist-DhHh0jLg.js +0 -1247
- package/dist/dist-DuEeHMvL.js +0 -5
- package/dist/esm-BfhQmZjp.js +0 -1171
- package/src/plugins/impl/multiselectFilterFn.tsx +0 -22
- /package/src/components/{data-table → ui}/value-chips.tsx +0 -0
|
@@ -4,9 +4,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { t as __commonJSMin } from "./chunk-BNovOVIE.js";
|
|
5
5
|
import { _ as Logger } from "./button-C5K9fIPF.js";
|
|
6
6
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
7
|
-
import { u as createLucideIcon } from "./dist-
|
|
7
|
+
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
8
8
|
import { r as KnownQueryParams } from "./constants-T20xxyNf.js";
|
|
9
|
-
import { b as atom, d as store, m as isIslands, p as waitFor } from "./useTheme-
|
|
9
|
+
import { b as atom, d as store, m as isIslands, p as waitFor } from "./useTheme-DEhDzATN.js";
|
|
10
10
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
11
11
|
var CircleQuestionMark = createLucideIcon("circle-question-mark", [
|
|
12
12
|
["circle", {
|
|
@@ -2,9 +2,9 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { f as createSlottable, g as cn, m as useComposedRefs } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, s as Root, t as Anchor } from "./dist-
|
|
5
|
+
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, s as Root, t as Anchor } from "./dist-Dk6PV_d3.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import {
|
|
7
|
+
import { Q as withSmartCollisionBoundary, Z as withFullScreenAsRoot, _t as createContextScope, at as Portal, ct as DismissableLayer, dt as useId, et as StyleNamespace, ft as Presence, ht as composeEventHandlers, pt as useControllableState, vt as Primitive } from "./zod-aLSua2NL.js";
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [createPopperScope]), usePopperScope = createPopperScope(), PROVIDER_NAME = "TooltipProvider", DEFAULT_DELAY_DURATION = 700, TOOLTIP_OPEN = "tooltip.open", [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME), TooltipProvider$1 = (n) => {
|
|
9
9
|
let { __scopeTooltip: j, delayDuration: M = DEFAULT_DELAY_DURATION, skipDelayDuration: N = 300, disableHoverableContent: P = false, children: F } = n, I = import_react.useRef(true), L = import_react.useRef(false), R = import_react.useRef(0);
|
|
10
10
|
return import_react.useEffect(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as createLucideIcon } from "./dist-
|
|
1
|
+
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
2
2
|
var Pencil = createLucideIcon("pencil", [["path", {
|
|
3
3
|
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
4
4
|
key: "1a8usu"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
4
|
-
import { T as useEvent_default } from "./useTheme-
|
|
4
|
+
import { T as useEvent_default } from "./useTheme-DEhDzATN.js";
|
|
5
5
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
6
6
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), Result = {
|
|
7
7
|
error(e, s) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import { u as createLucideIcon } from "./dist-
|
|
4
|
-
import {
|
|
3
|
+
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
4
|
+
import { E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./strings-J57tzLr3.js";
|
|
5
5
|
var ChartPie = createLucideIcon("chart-pie", [["path", {
|
|
6
6
|
d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
|
|
7
7
|
key: "pzmjnu"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import { w as dequal } from "./useTheme-
|
|
3
|
+
import { w as dequal } from "./useTheme-DEhDzATN.js";
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
5
|
function useDeepCompareMemoize(e) {
|
|
6
6
|
let i = import_react.useRef(e);
|
|
@@ -2,9 +2,9 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { _ as Logger, g as cn, r as cva } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { u as createLucideIcon } from "./dist-
|
|
5
|
+
import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import { b as atom, v as useSetAtom } from "./useTheme-
|
|
7
|
+
import { b as atom, v as useSetAtom } from "./useTheme-DEhDzATN.js";
|
|
8
8
|
var Calendar = createLucideIcon("calendar", [
|
|
9
9
|
["path", {
|
|
10
10
|
d: "M8 2v4",
|
|
@@ -2,7 +2,7 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { _ as Logger, a as OverridingHotkeyProvider, s as resolvePlatform } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-
|
|
5
|
+
import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-aLSua2NL.js";
|
|
6
6
|
import { t as merge_default } from "./merge-Be1CqGnU.js";
|
|
7
7
|
var import_react = /* @__PURE__ */ __toESM(require_react()), useInsertionEffect = typeof window < "u" ? import_react.useInsertionEffect || import_react.useLayoutEffect : () => {
|
|
8
8
|
};
|
|
@@ -2,23 +2,23 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { _ as Logger, c as Objects, g as cn, h as Events } from "./button-C5K9fIPF.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-
|
|
5
|
+
import { c as asRemoteURL, v as CircleQuestionMark } from "./toDate-d8RCRrRd.js";
|
|
6
6
|
import "./react-dom-BTJzcVJ9.js";
|
|
7
7
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
8
|
-
import "./zod-
|
|
9
|
-
import { n as ErrorBanner } from "./error-banner-
|
|
10
|
-
import { t as Tooltip } from "./tooltip-
|
|
8
|
+
import "./zod-aLSua2NL.js";
|
|
9
|
+
import { n as ErrorBanner } from "./error-banner-Cc0I3C9e.js";
|
|
10
|
+
import { t as Tooltip } from "./tooltip-DpcyNkQ2.js";
|
|
11
11
|
import { i as debounce_default } from "./constants-T20xxyNf.js";
|
|
12
|
-
import { T as useEvent_default, n as useTheme } from "./useTheme-
|
|
12
|
+
import { T as useEvent_default, n as useTheme } from "./useTheme-DEhDzATN.js";
|
|
13
13
|
import { s as uniq } from "./arrays-sEtDRoG4.js";
|
|
14
|
-
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-
|
|
14
|
+
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-C4wO47tk.js";
|
|
15
15
|
import { n as formats } from "./vega-loader.browser-CZ-J8Py3.js";
|
|
16
16
|
import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-BWLPpjKK.js";
|
|
17
17
|
import { t as j } from "./react-vega-B0sAlDTL.js";
|
|
18
18
|
import "./defaultLocale-u-3osm0P.js";
|
|
19
19
|
import "./defaultLocale-BoHTsDG6.js";
|
|
20
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
21
|
-
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-
|
|
20
|
+
import { t as useAsyncData } from "./useAsyncData-PonK__yh.js";
|
|
21
|
+
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-D3NGWke6.js";
|
|
22
22
|
import { t as Semaphore } from "./semaphore-CNDGTzkX.js";
|
|
23
23
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
24
24
|
function fixRelativeUrl(e) {
|
|
@@ -11758,7 +11758,7 @@ var external_exports = /* @__PURE__ */ __export({
|
|
|
11758
11758
|
config(en_default());
|
|
11759
11759
|
var zod_default = external_exports;
|
|
11760
11760
|
export {
|
|
11761
|
-
|
|
11761
|
+
isInVscodeExtension as $,
|
|
11762
11762
|
looseObject as A,
|
|
11763
11763
|
union as B,
|
|
11764
11764
|
any as C,
|
|
@@ -11775,59 +11775,60 @@ export {
|
|
|
11775
11775
|
number$1 as N,
|
|
11776
11776
|
lazy as O,
|
|
11777
11777
|
object as P,
|
|
11778
|
-
|
|
11778
|
+
withSmartCollisionBoundary as Q,
|
|
11779
11779
|
string$1 as R,
|
|
11780
11780
|
_null as S,
|
|
11781
11781
|
boolean$1 as T,
|
|
11782
11782
|
ZodError as U,
|
|
11783
11783
|
unknown as V,
|
|
11784
11784
|
toJSONSchema as W,
|
|
11785
|
-
|
|
11785
|
+
useFullScreenElement as X,
|
|
11786
11786
|
MAX_HEIGHT_OFFSET as Y,
|
|
11787
|
-
|
|
11787
|
+
withFullScreenAsRoot as Z,
|
|
11788
11788
|
ZodString as _,
|
|
11789
|
-
|
|
11789
|
+
createContextScope as _t,
|
|
11790
11790
|
ZodIssueCode as a,
|
|
11791
|
-
|
|
11791
|
+
Portal as at,
|
|
11792
11792
|
_enum as b,
|
|
11793
11793
|
ZodBoolean as c,
|
|
11794
|
-
|
|
11794
|
+
DismissableLayer as ct,
|
|
11795
11795
|
ZodDiscriminatedUnion as d,
|
|
11796
|
-
|
|
11797
|
-
|
|
11796
|
+
useId as dt,
|
|
11797
|
+
StyleNamespace as et,
|
|
11798
11798
|
ZodEnum as f,
|
|
11799
|
-
|
|
11799
|
+
Presence as ft,
|
|
11800
11800
|
ZodOptional as g,
|
|
11801
|
-
|
|
11801
|
+
createContext2 as gt,
|
|
11802
11802
|
ZodObject as h,
|
|
11803
|
-
|
|
11803
|
+
composeEventHandlers as ht,
|
|
11804
11804
|
string as i,
|
|
11805
|
-
|
|
11805
|
+
useFocusGuards as it,
|
|
11806
11806
|
nan as j,
|
|
11807
11807
|
literal as k,
|
|
11808
11808
|
ZodDate as l,
|
|
11809
|
-
|
|
11809
|
+
Root as lt,
|
|
11810
11810
|
ZodNumber as m,
|
|
11811
|
-
|
|
11811
|
+
useLayoutEffect2 as mt,
|
|
11812
11812
|
date as n,
|
|
11813
|
-
|
|
11813
|
+
Combination_default as nt,
|
|
11814
11814
|
ZodAny as o,
|
|
11815
|
-
|
|
11815
|
+
FocusScope as ot,
|
|
11816
11816
|
ZodLiteral as p,
|
|
11817
|
-
|
|
11817
|
+
useControllableState as pt,
|
|
11818
11818
|
$ZodError as q,
|
|
11819
11819
|
number as r,
|
|
11820
|
-
|
|
11820
|
+
__awaiter as rt,
|
|
11821
11821
|
ZodArray as s,
|
|
11822
|
-
|
|
11822
|
+
Branch as st,
|
|
11823
11823
|
zod_default as t,
|
|
11824
|
-
|
|
11824
|
+
hideOthers as tt,
|
|
11825
11825
|
ZodDefault as u,
|
|
11826
|
-
|
|
11826
|
+
useCallbackRef$1 as ut,
|
|
11827
11827
|
ZodType as v,
|
|
11828
|
-
|
|
11828
|
+
Primitive as vt,
|
|
11829
11829
|
array as w,
|
|
11830
11830
|
_instanceof as x,
|
|
11831
11831
|
ZodUnion as y,
|
|
11832
|
+
dispatchDiscreteCustomEvent as yt,
|
|
11832
11833
|
tuple as z
|
|
11833
11834
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/islands",
|
|
3
|
-
"version": "0.23.10-
|
|
3
|
+
"version": "0.23.10-dev30",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
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
|
-
"@marimo-team/codemirror-sql": "^0.2.
|
|
60
|
+
"@marimo-team/codemirror-sql": "^0.2.8",
|
|
61
61
|
"@marimo-team/llm-info": "workspace:*",
|
|
62
62
|
"@marimo-team/marimo-api": "workspace:*",
|
|
63
63
|
"@marimo-team/react-slotz": "^0.2.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"partysocket": "1.1.13",
|
|
124
124
|
"path-to-regexp": "^8.4.0",
|
|
125
125
|
"plotly.js": "^3.3.1",
|
|
126
|
-
"pyodide": "0.
|
|
126
|
+
"pyodide": "314.0.0",
|
|
127
127
|
"radix-ui": "1.4.3",
|
|
128
128
|
"react-arborist": "^3.4.3",
|
|
129
129
|
"react-aria": "3.47.0",
|
|
@@ -7,10 +7,6 @@ import type { GetRowIds } from "@/plugins/impl/DataTablePlugin";
|
|
|
7
7
|
import { cn } from "@/utils/cn";
|
|
8
8
|
import { Events } from "@/utils/events";
|
|
9
9
|
import { prettyNumber } from "@/utils/numbers";
|
|
10
|
-
import {
|
|
11
|
-
PANEL_TYPES,
|
|
12
|
-
type PanelType,
|
|
13
|
-
} from "../editor/chrome/panels/context-aware-panel/context-aware-panel";
|
|
14
10
|
import { Button } from "../ui/button";
|
|
15
11
|
import { toast } from "../ui/use-toast";
|
|
16
12
|
import { getColumnCountForDisplay } from "./hooks/use-column-visibility";
|
|
@@ -27,7 +23,6 @@ interface TableBottomBarProps<TData> {
|
|
|
27
23
|
getRowIds?: GetRowIds;
|
|
28
24
|
showPageSizeSelector?: boolean;
|
|
29
25
|
tableLoading?: boolean;
|
|
30
|
-
togglePanel?: (panelType: PanelType) => void;
|
|
31
26
|
part?: string;
|
|
32
27
|
className?: string;
|
|
33
28
|
}
|
|
@@ -41,7 +36,6 @@ export const TableBottomBar = <TData,>({
|
|
|
41
36
|
getRowIds,
|
|
42
37
|
showPageSizeSelector,
|
|
43
38
|
tableLoading,
|
|
44
|
-
togglePanel,
|
|
45
39
|
part,
|
|
46
40
|
className,
|
|
47
41
|
}: TableBottomBarProps<TData>) => {
|
|
@@ -159,15 +153,7 @@ export const TableBottomBar = <TData,>({
|
|
|
159
153
|
return (
|
|
160
154
|
<span className="flex items-center gap-1">
|
|
161
155
|
<span>{rowsAndColumns}</span>
|
|
162
|
-
{hiddenSuffix &&
|
|
163
|
-
<button
|
|
164
|
-
type="button"
|
|
165
|
-
className="text-xs underline-offset-2 hover:underline cursor-pointer"
|
|
166
|
-
onClick={() => togglePanel?.(PANEL_TYPES.COLUMN_EXPLORER)}
|
|
167
|
-
>
|
|
168
|
-
{hiddenSuffix}
|
|
169
|
-
</button>
|
|
170
|
-
)}
|
|
156
|
+
{hiddenSuffix && <span className="text-xs">{hiddenSuffix}</span>}
|
|
171
157
|
</span>
|
|
172
158
|
);
|
|
173
159
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
"use no memo";
|
|
3
3
|
|
|
4
|
+
import type { Table } from "@tanstack/react-table";
|
|
4
5
|
import { useDebounce } from "@uidotdev/usehooks";
|
|
5
6
|
import {
|
|
6
7
|
ChartSplineIcon,
|
|
@@ -17,13 +18,15 @@ import {
|
|
|
17
18
|
} from "../editor/chrome/panels/context-aware-panel/context-aware-panel";
|
|
18
19
|
import { Spinner } from "../icons/spinner";
|
|
19
20
|
import { Button } from "../ui/button";
|
|
21
|
+
import { ColumnVisibilityDropdown } from "./column-visibility-dropdown";
|
|
20
22
|
import { type ExportActionProps, ExportMenu } from "./export-actions";
|
|
21
23
|
|
|
22
24
|
const NOOP_ON_SEARCH = () => {
|
|
23
25
|
/** no-op*/
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
interface TableTopBarProps extends Partial<ExportActionProps> {
|
|
28
|
+
interface TableTopBarProps<TData> extends Partial<ExportActionProps> {
|
|
29
|
+
table: Table<TData>;
|
|
27
30
|
enableSearch: boolean;
|
|
28
31
|
searchQuery?: string;
|
|
29
32
|
onSearchQueryChange?: (query: string) => void;
|
|
@@ -38,7 +41,8 @@ interface TableTopBarProps extends Partial<ExportActionProps> {
|
|
|
38
41
|
sizeBytesIsLoading?: boolean;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
|
-
export const TableTopBar
|
|
44
|
+
export const TableTopBar = <TData,>({
|
|
45
|
+
table,
|
|
42
46
|
enableSearch,
|
|
43
47
|
searchQuery,
|
|
44
48
|
onSearchQueryChange,
|
|
@@ -52,7 +56,7 @@ export const TableTopBar: React.FC<TableTopBarProps> = ({
|
|
|
52
56
|
downloadAs,
|
|
53
57
|
sizeBytes,
|
|
54
58
|
sizeBytesIsLoading,
|
|
55
|
-
}) => {
|
|
59
|
+
}: TableTopBarProps<TData>) => {
|
|
56
60
|
const [internalValue, setInternalValue] = useState(searchQuery || "");
|
|
57
61
|
const debouncedSearch = useDebounce(internalValue, 500);
|
|
58
62
|
const onSearch = useEvent(onSearchQueryChange ?? NOOP_ON_SEARCH);
|
|
@@ -62,16 +66,6 @@ export const TableTopBar: React.FC<TableTopBarProps> = ({
|
|
|
62
66
|
onSearch(debouncedSearch);
|
|
63
67
|
}, [debouncedSearch, onSearch]);
|
|
64
68
|
|
|
65
|
-
const hasAnyAction =
|
|
66
|
-
(enableSearch && onSearchQueryChange) ||
|
|
67
|
-
showChartBuilder ||
|
|
68
|
-
showTableExplorer ||
|
|
69
|
-
downloadAs;
|
|
70
|
-
|
|
71
|
-
if (!hasAnyAction) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
69
|
return (
|
|
76
70
|
<div className="flex items-center h-10 px-2 border-b gap-2">
|
|
77
71
|
{onSearchQueryChange && enableSearch && (
|
|
@@ -106,6 +100,7 @@ export const TableTopBar: React.FC<TableTopBarProps> = ({
|
|
|
106
100
|
)}
|
|
107
101
|
|
|
108
102
|
<div className="flex items-center shrink-0">
|
|
103
|
+
<ColumnVisibilityDropdown table={table} />
|
|
109
104
|
{showChartBuilder && (
|
|
110
105
|
<Button
|
|
111
106
|
variant="text"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
|
5
5
|
import { render, screen } from "@testing-library/react";
|
|
6
|
-
import { describe, expect, it
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
7
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
8
8
|
import { CellSelectionProvider } from "../range-focus/provider";
|
|
9
9
|
import { TableBottomBar } from "../TableBottomBar";
|
|
@@ -11,7 +11,6 @@ import { TableBottomBar } from "../TableBottomBar";
|
|
|
11
11
|
function renderWithTable(opts: {
|
|
12
12
|
totalColumns: number;
|
|
13
13
|
hiddenColumns?: string[];
|
|
14
|
-
togglePanel?: (panelType: string) => void;
|
|
15
14
|
}) {
|
|
16
15
|
const Wrapper = () => {
|
|
17
16
|
const table = useReactTable({
|
|
@@ -34,7 +33,6 @@ function renderWithTable(opts: {
|
|
|
34
33
|
pagination={false}
|
|
35
34
|
totalColumns={opts.totalColumns}
|
|
36
35
|
table={table}
|
|
37
|
-
togglePanel={opts.togglePanel}
|
|
38
36
|
/>
|
|
39
37
|
);
|
|
40
38
|
};
|
|
@@ -60,14 +58,10 @@ describe("TableBottomBar — hidden column count", () => {
|
|
|
60
58
|
expect(screen.getByText(/\(1 hidden\)/)).toBeInTheDocument();
|
|
61
59
|
});
|
|
62
60
|
|
|
63
|
-
it("
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
togglePanel,
|
|
69
|
-
});
|
|
70
|
-
screen.getByText(/\(1 hidden\)/).click();
|
|
71
|
-
expect(togglePanel).toHaveBeenCalledWith("column-explorer");
|
|
61
|
+
it("renders '(n hidden)' as inert text, not a button", () => {
|
|
62
|
+
renderWithTable({ totalColumns: 3, hiddenColumns: ["col1"] });
|
|
63
|
+
const suffix = screen.getByText(/\(1 hidden\)/);
|
|
64
|
+
expect(suffix.tagName).toBe("SPAN");
|
|
65
|
+
expect(suffix.closest("button")).toBeNull();
|
|
72
66
|
});
|
|
73
67
|
});
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ColumnDef,
|
|
5
|
+
getCoreRowModel,
|
|
6
|
+
useReactTable,
|
|
7
|
+
} from "@tanstack/react-table";
|
|
8
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
9
|
+
import { beforeAll, describe, expect, it } from "vitest";
|
|
10
|
+
import { ColumnVisibilityDropdown } from "../column-visibility-dropdown";
|
|
11
|
+
import { INDEX_COLUMN_NAME, SELECT_COLUMN_ID } from "../types";
|
|
12
|
+
|
|
13
|
+
beforeAll(() => {
|
|
14
|
+
global.HTMLElement.prototype.scrollIntoView = () => {
|
|
15
|
+
// jsdom does not implement scrollIntoView; cmdk calls it on selection.
|
|
16
|
+
};
|
|
17
|
+
if (!global.HTMLElement.prototype.hasPointerCapture) {
|
|
18
|
+
global.HTMLElement.prototype.hasPointerCapture = () => false;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
type Row = Record<string, unknown>;
|
|
23
|
+
|
|
24
|
+
const TEST_COLUMNS: ColumnDef<Row>[] = [
|
|
25
|
+
{ id: SELECT_COLUMN_ID, accessorKey: SELECT_COLUMN_ID },
|
|
26
|
+
{ id: INDEX_COLUMN_NAME, accessorKey: INDEX_COLUMN_NAME },
|
|
27
|
+
{ id: "__m_column__0", accessorKey: "__m_column__0" },
|
|
28
|
+
{
|
|
29
|
+
id: "customer_name",
|
|
30
|
+
accessorKey: "customer_name",
|
|
31
|
+
meta: { dataType: "string" },
|
|
32
|
+
},
|
|
33
|
+
{ id: "cust_age", accessorKey: "cust_age", meta: { dataType: "integer" } },
|
|
34
|
+
{
|
|
35
|
+
id: "order_total",
|
|
36
|
+
accessorKey: "order_total",
|
|
37
|
+
meta: { dataType: "number" },
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
interface HarnessProps {
|
|
42
|
+
initiallyHidden?: string[];
|
|
43
|
+
nonHideable?: string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function Harness({ initiallyHidden = [], nonHideable = [] }: HarnessProps) {
|
|
47
|
+
const table = useReactTable<Row>({
|
|
48
|
+
data: [],
|
|
49
|
+
columns: TEST_COLUMNS.map((column) =>
|
|
50
|
+
nonHideable.includes(column.id as string)
|
|
51
|
+
? { ...column, enableHiding: false }
|
|
52
|
+
: column,
|
|
53
|
+
),
|
|
54
|
+
getCoreRowModel: getCoreRowModel(),
|
|
55
|
+
locale: "en-US",
|
|
56
|
+
initialState: {
|
|
57
|
+
columnVisibility: Object.fromEntries(
|
|
58
|
+
initiallyHidden.map((id) => [id, false]),
|
|
59
|
+
),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return <ColumnVisibilityDropdown table={table} />;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function renderAndOpen(props?: HarnessProps) {
|
|
66
|
+
const result = render(<Harness {...(props ?? {})} />);
|
|
67
|
+
fireEvent.click(screen.getByTestId("column-visibility-trigger"));
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getOptionTexts(): string[] {
|
|
72
|
+
return screen.getAllByRole("option").map((el) => el.textContent ?? "");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getColumnOption(name: string): HTMLElement {
|
|
76
|
+
const option = screen
|
|
77
|
+
.getAllByRole("option")
|
|
78
|
+
.find((el) => el.textContent === name);
|
|
79
|
+
if (!option) {
|
|
80
|
+
throw new Error(`No option for column ${name}`);
|
|
81
|
+
}
|
|
82
|
+
return option;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getSearchInput() {
|
|
86
|
+
return screen.getByPlaceholderText("Search columns...");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
describe("ColumnVisibilityDropdown", () => {
|
|
90
|
+
it("renders user columns and excludes select/index/nameless columns", () => {
|
|
91
|
+
renderAndOpen();
|
|
92
|
+
expect(screen.getByText("customer_name")).toBeInTheDocument();
|
|
93
|
+
expect(screen.getByText("cust_age")).toBeInTheDocument();
|
|
94
|
+
expect(screen.getByText("order_total")).toBeInTheDocument();
|
|
95
|
+
expect(screen.queryByText(SELECT_COLUMN_ID)).not.toBeInTheDocument();
|
|
96
|
+
expect(screen.queryByText(INDEX_COLUMN_NAME)).not.toBeInTheDocument();
|
|
97
|
+
expect(screen.queryByText("__m_column__0")).not.toBeInTheDocument();
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("lists hidden columns before shown columns", () => {
|
|
101
|
+
renderAndOpen({ initiallyHidden: ["cust_age"] });
|
|
102
|
+
expect(getOptionTexts()).toEqual([
|
|
103
|
+
"Show all",
|
|
104
|
+
"cust_age",
|
|
105
|
+
"customer_name",
|
|
106
|
+
"order_total",
|
|
107
|
+
]);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("toggling a hidden column flips the icon without moving the row", () => {
|
|
111
|
+
renderAndOpen({ initiallyHidden: ["cust_age"] });
|
|
112
|
+
expect(
|
|
113
|
+
getColumnOption("cust_age").querySelector(".lucide-eye-off"),
|
|
114
|
+
).not.toBeNull();
|
|
115
|
+
|
|
116
|
+
fireEvent.click(getColumnOption("cust_age"));
|
|
117
|
+
|
|
118
|
+
expect(getOptionTexts()).toEqual([
|
|
119
|
+
"Show all",
|
|
120
|
+
"cust_age",
|
|
121
|
+
"customer_name",
|
|
122
|
+
"order_total",
|
|
123
|
+
]);
|
|
124
|
+
expect(
|
|
125
|
+
getColumnOption("cust_age").querySelector(".lucide-eye-off"),
|
|
126
|
+
).toBeNull();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("re-sorts on reopen after a toggle", () => {
|
|
130
|
+
renderAndOpen({ initiallyHidden: ["cust_age"] });
|
|
131
|
+
// Hide customer_name: it stays in the shown section until reopen.
|
|
132
|
+
fireEvent.click(getColumnOption("customer_name"));
|
|
133
|
+
expect(getOptionTexts()).toEqual([
|
|
134
|
+
"Show all",
|
|
135
|
+
"cust_age",
|
|
136
|
+
"customer_name",
|
|
137
|
+
"order_total",
|
|
138
|
+
]);
|
|
139
|
+
|
|
140
|
+
const trigger = screen.getByTestId("column-visibility-trigger");
|
|
141
|
+
fireEvent.click(trigger);
|
|
142
|
+
fireEvent.click(trigger);
|
|
143
|
+
|
|
144
|
+
// Reopen sorts both hidden columns first, preserving table order.
|
|
145
|
+
expect(getOptionTexts()).toEqual([
|
|
146
|
+
"Show all",
|
|
147
|
+
"customer_name",
|
|
148
|
+
"cust_age",
|
|
149
|
+
"order_total",
|
|
150
|
+
]);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it("filters columns with smartMatch", () => {
|
|
154
|
+
renderAndOpen();
|
|
155
|
+
fireEvent.change(getSearchInput(), { target: { value: "cust" } });
|
|
156
|
+
expect(screen.getByText("customer_name")).toBeInTheDocument();
|
|
157
|
+
expect(screen.getByText("cust_age")).toBeInTheDocument();
|
|
158
|
+
expect(screen.queryByText("order_total")).not.toBeInTheDocument();
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("shows 'No results.' when nothing matches", () => {
|
|
162
|
+
renderAndOpen();
|
|
163
|
+
fireEvent.change(getSearchInput(), { target: { value: "xyz" } });
|
|
164
|
+
expect(screen.getByText("No results.")).toBeInTheDocument();
|
|
165
|
+
expect(screen.queryByText("customer_name")).not.toBeInTheDocument();
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("disables 'Show all' when no columns are hidden", () => {
|
|
169
|
+
renderAndOpen();
|
|
170
|
+
expect(getColumnOption("Show all")).toHaveAttribute(
|
|
171
|
+
"aria-disabled",
|
|
172
|
+
"true",
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("'Show all' restores hidden columns", () => {
|
|
177
|
+
renderAndOpen({ initiallyHidden: ["cust_age", "order_total"] });
|
|
178
|
+
fireEvent.click(getColumnOption("Show all"));
|
|
179
|
+
|
|
180
|
+
expect(
|
|
181
|
+
getColumnOption("cust_age").querySelector(".lucide-eye-off"),
|
|
182
|
+
).toBeNull();
|
|
183
|
+
expect(
|
|
184
|
+
getColumnOption("order_total").querySelector(".lucide-eye-off"),
|
|
185
|
+
).toBeNull();
|
|
186
|
+
expect(getColumnOption("Show all")).toHaveAttribute(
|
|
187
|
+
"aria-disabled",
|
|
188
|
+
"true",
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("hides and shows matching columns via bulk actions while searching", () => {
|
|
193
|
+
renderAndOpen();
|
|
194
|
+
fireEvent.change(getSearchInput(), { target: { value: "cust" } });
|
|
195
|
+
expect(screen.queryByText(/Show all/)).not.toBeInTheDocument();
|
|
196
|
+
|
|
197
|
+
fireEvent.click(getColumnOption("Hide 2 matching"));
|
|
198
|
+
expect(
|
|
199
|
+
getColumnOption("customer_name").querySelector(".lucide-eye-off"),
|
|
200
|
+
).not.toBeNull();
|
|
201
|
+
expect(
|
|
202
|
+
getColumnOption("cust_age").querySelector(".lucide-eye-off"),
|
|
203
|
+
).not.toBeNull();
|
|
204
|
+
expect(screen.queryByText(/Hide \d+ matching/)).not.toBeInTheDocument();
|
|
205
|
+
|
|
206
|
+
fireEvent.click(getColumnOption("Show 2 matching"));
|
|
207
|
+
expect(
|
|
208
|
+
getColumnOption("customer_name").querySelector(".lucide-eye-off"),
|
|
209
|
+
).toBeNull();
|
|
210
|
+
expect(screen.queryByText(/Show \d+ matching/)).not.toBeInTheDocument();
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("offers both bulk actions when matches are mixed", () => {
|
|
214
|
+
renderAndOpen({ initiallyHidden: ["cust_age"] });
|
|
215
|
+
fireEvent.change(getSearchInput(), { target: { value: "cust" } });
|
|
216
|
+
expect(screen.getByText(/Hide 1 matching/)).toBeInTheDocument();
|
|
217
|
+
expect(screen.getByText(/Show 1 matching/)).toBeInTheDocument();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it("renders non-hideable columns disabled and without an eye toggle", () => {
|
|
221
|
+
renderAndOpen({ nonHideable: ["customer_name"] });
|
|
222
|
+
const option = getColumnOption("customer_name");
|
|
223
|
+
expect(option).toHaveAttribute("aria-disabled", "true");
|
|
224
|
+
expect(option.querySelector(".lucide-eye")).toBeNull();
|
|
225
|
+
expect(option.querySelector(".lucide-eye-off")).toBeNull();
|
|
226
|
+
});
|
|
227
|
+
});
|