@marimo-team/islands 0.19.10-dev35 → 0.19.10-dev38
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/main.js +250 -244
- package/package.json +1 -1
- package/src/components/data-table/TableActions.tsx +8 -1
- package/src/components/data-table/data-table.tsx +2 -0
- package/src/components/data-table/download-actions.tsx +6 -1
- package/src/core/wasm/__tests__/store.test.ts +33 -0
- package/src/core/wasm/bridge.ts +2 -1
- package/src/core/wasm/store.ts +13 -1
- package/src/plugins/impl/DataTablePlugin.tsx +4 -0
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +4 -0
package/dist/main.js
CHANGED
|
@@ -62110,7 +62110,7 @@ Defaulting to \`null\`.`;
|
|
|
62110
62110
|
}
|
|
62111
62111
|
];
|
|
62112
62112
|
const DownloadAs = (e) => {
|
|
62113
|
-
let r = (0, import_compiler_runtime$104.c)(
|
|
62113
|
+
let r = (0, import_compiler_runtime$104.c)(19), { locale: c } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), d;
|
|
62114
62114
|
r[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = (0, import_jsx_runtime.jsxs)(Button, {
|
|
62115
62115
|
"data-testid": "download-as-button",
|
|
62116
62116
|
size: "xs",
|
|
@@ -62159,31 +62159,31 @@ Defaulting to \`null\`.`;
|
|
|
62159
62159
|
children: f
|
|
62160
62160
|
}), r[6] = O) : O = r[6];
|
|
62161
62161
|
let M;
|
|
62162
|
-
r[7]
|
|
62162
|
+
r[7] !== v || r[8] !== e.downloadFileName ? (M = options.map((r2) => (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
62163
62163
|
onSelect: async () => {
|
|
62164
|
-
let
|
|
62165
|
-
downloadByURL(
|
|
62164
|
+
let c2 = await v(r2.format), d2 = r2.format, f2 = (e.downloadFileName ?? "").trim();
|
|
62165
|
+
downloadByURL(c2, `${Filenames.withoutExtension(f2) || "download"}.${d2}`);
|
|
62166
62166
|
},
|
|
62167
62167
|
children: [
|
|
62168
|
-
(0, import_jsx_runtime.jsx)(
|
|
62168
|
+
(0, import_jsx_runtime.jsx)(r2.icon, {
|
|
62169
62169
|
className: "mo-dropdown-icon"
|
|
62170
62170
|
}),
|
|
62171
|
-
|
|
62171
|
+
r2.label
|
|
62172
62172
|
]
|
|
62173
|
-
},
|
|
62173
|
+
}, r2.label)), r[7] = v, r[8] = e.downloadFileName, r[9] = M) : M = r[9];
|
|
62174
62174
|
let I;
|
|
62175
|
-
r[
|
|
62175
|
+
r[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = (0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}), r[10] = I) : I = r[10];
|
|
62176
62176
|
let z;
|
|
62177
|
-
r[
|
|
62177
|
+
r[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = (0, import_jsx_runtime.jsxs)(DropdownMenuSubTrigger, {
|
|
62178
62178
|
children: [
|
|
62179
62179
|
(0, import_jsx_runtime.jsx)(ClipboardList, {
|
|
62180
62180
|
className: "mo-dropdown-icon"
|
|
62181
62181
|
}),
|
|
62182
62182
|
"Copy to clipboard"
|
|
62183
62183
|
]
|
|
62184
|
-
}), r[
|
|
62184
|
+
}), r[11] = z) : z = r[11];
|
|
62185
62185
|
let G;
|
|
62186
|
-
r[
|
|
62186
|
+
r[12] === S ? G = r[13] : (G = clipboardOptions.map((e2) => (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
62187
62187
|
onSelect: async () => {
|
|
62188
62188
|
try {
|
|
62189
62189
|
await S(e2.format);
|
|
@@ -62212,18 +62212,18 @@ Defaulting to \`null\`.`;
|
|
|
62212
62212
|
]
|
|
62213
62213
|
})
|
|
62214
62214
|
]
|
|
62215
|
-
}, e2.label)), r[
|
|
62215
|
+
}, e2.label)), r[12] = S, r[13] = G);
|
|
62216
62216
|
let q;
|
|
62217
|
-
r[
|
|
62217
|
+
r[14] === G ? q = r[15] : (q = (0, import_jsx_runtime.jsxs)(DropdownMenuSub, {
|
|
62218
62218
|
children: [
|
|
62219
62219
|
z,
|
|
62220
62220
|
(0, import_jsx_runtime.jsx)(DropdownMenuSubContent, {
|
|
62221
62221
|
children: G
|
|
62222
62222
|
})
|
|
62223
62223
|
]
|
|
62224
|
-
}), r[
|
|
62224
|
+
}), r[14] = G, r[15] = q);
|
|
62225
62225
|
let IY;
|
|
62226
|
-
return r[
|
|
62226
|
+
return r[16] !== M || r[17] !== q ? (IY = (0, import_jsx_runtime.jsxs)(DropdownMenu, {
|
|
62227
62227
|
modal: false,
|
|
62228
62228
|
children: [
|
|
62229
62229
|
O,
|
|
@@ -62237,7 +62237,7 @@ Defaulting to \`null\`.`;
|
|
|
62237
62237
|
]
|
|
62238
62238
|
})
|
|
62239
62239
|
]
|
|
62240
|
-
}), r[
|
|
62240
|
+
}), r[16] = M, r[17] = q, r[18] = IY) : IY = r[18], IY;
|
|
62241
62241
|
};
|
|
62242
62242
|
function fetchJson(e) {
|
|
62243
62243
|
return fetchText(e).then(jsonParseWithSpecialChar);
|
|
@@ -62495,7 +62495,7 @@ Defaulting to \`null\`.`;
|
|
|
62495
62495
|
const prettifyRowColumnCount = (e, r, c) => [
|
|
62496
62496
|
e === "too_many" ? "Unknown" : prettifyRowCount(e, c),
|
|
62497
62497
|
`${prettyNumber(r, c)} ${new PluralWord("column").pluralize(r)}`
|
|
62498
|
-
].join(", "), TableActions = ({ enableSearch: e, onSearchQueryChange: r, isSearchEnabled: c, setIsSearchEnabled: d, pagination: f, totalColumns: _, selection: v, onRowSelectionChange: y, table: S, downloadAs: E,
|
|
62498
|
+
].join(", "), TableActions = ({ enableSearch: e, onSearchQueryChange: r, isSearchEnabled: c, setIsSearchEnabled: d, pagination: f, totalColumns: _, selection: v, onRowSelectionChange: y, table: S, downloadAs: E, downloadFileName: O, getRowIds: M, toggleDisplayHeader: I, showChartBuilder: z, showColumnExplorer: G, showRowExplorer: q, showPageSizeSelector: IY, togglePanel: LY, isPanelOpen: RY, tableLoading: zY }) => (0, import_jsx_runtime.jsxs)("div", {
|
|
62499
62499
|
className: "flex items-center shrink-0 pt-1",
|
|
62500
62500
|
children: [
|
|
62501
62501
|
r && e && (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
@@ -62510,41 +62510,41 @@ Defaulting to \`null\`.`;
|
|
|
62510
62510
|
})
|
|
62511
62511
|
})
|
|
62512
62512
|
}),
|
|
62513
|
-
|
|
62513
|
+
z && (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
62514
62514
|
content: "Chart builder",
|
|
62515
62515
|
children: (0, import_jsx_runtime.jsx)(Button, {
|
|
62516
62516
|
variant: "text",
|
|
62517
62517
|
size: "xs",
|
|
62518
62518
|
className: "mb-0 print:hidden",
|
|
62519
|
-
onClick:
|
|
62519
|
+
onClick: I,
|
|
62520
62520
|
children: (0, import_jsx_runtime.jsx)(ChartSpline, {
|
|
62521
62521
|
className: "w-4 h-4 text-muted-foreground"
|
|
62522
62522
|
})
|
|
62523
62523
|
})
|
|
62524
62524
|
}),
|
|
62525
|
-
|
|
62525
|
+
LY && RY !== void 0 && (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
62526
62526
|
children: [
|
|
62527
|
-
|
|
62527
|
+
q && (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
62528
62528
|
content: "Toggle row viewer",
|
|
62529
62529
|
children: (0, import_jsx_runtime.jsx)(Button, {
|
|
62530
62530
|
variant: "text",
|
|
62531
62531
|
size: "xs",
|
|
62532
|
-
onClick: () =>
|
|
62532
|
+
onClick: () => LY("row-viewer"),
|
|
62533
62533
|
className: "print:hidden",
|
|
62534
62534
|
children: (0, import_jsx_runtime.jsx)(PanelRight, {
|
|
62535
|
-
className: cn("w-4 h-4 text-muted-foreground",
|
|
62535
|
+
className: cn("w-4 h-4 text-muted-foreground", RY("row-viewer") && "text-primary")
|
|
62536
62536
|
})
|
|
62537
62537
|
})
|
|
62538
62538
|
}),
|
|
62539
|
-
|
|
62539
|
+
G && (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
62540
62540
|
content: "Toggle column explorer",
|
|
62541
62541
|
children: (0, import_jsx_runtime.jsx)(Button, {
|
|
62542
62542
|
variant: "text",
|
|
62543
62543
|
size: "xs",
|
|
62544
|
-
onClick: () =>
|
|
62544
|
+
onClick: () => LY("column-explorer"),
|
|
62545
62545
|
className: "print:hidden",
|
|
62546
62546
|
children: (0, import_jsx_runtime.jsx)(ChartColumnStacked, {
|
|
62547
|
-
className: cn("w-4 h-4 text-muted-foreground",
|
|
62547
|
+
className: cn("w-4 h-4 text-muted-foreground", RY("column-explorer") && "text-primary")
|
|
62548
62548
|
})
|
|
62549
62549
|
})
|
|
62550
62550
|
})
|
|
@@ -62568,11 +62568,11 @@ Defaulting to \`null\`.`;
|
|
|
62568
62568
|
]);
|
|
62569
62569
|
y(Object.fromEntries(e3));
|
|
62570
62570
|
};
|
|
62571
|
-
if (!
|
|
62571
|
+
if (!M) {
|
|
62572
62572
|
r2();
|
|
62573
62573
|
return;
|
|
62574
62574
|
}
|
|
62575
|
-
|
|
62575
|
+
M({}).then((e3) => {
|
|
62576
62576
|
if (e3.error) {
|
|
62577
62577
|
toast({
|
|
62578
62578
|
title: "Not available",
|
|
@@ -62588,32 +62588,33 @@ Defaulting to \`null\`.`;
|
|
|
62588
62588
|
});
|
|
62589
62589
|
},
|
|
62590
62590
|
table: S,
|
|
62591
|
-
tableLoading:
|
|
62592
|
-
showPageSizeSelector:
|
|
62591
|
+
tableLoading: zY,
|
|
62592
|
+
showPageSizeSelector: IY
|
|
62593
62593
|
}),
|
|
62594
62594
|
(0, import_jsx_runtime.jsx)("div", {
|
|
62595
62595
|
className: "ml-auto",
|
|
62596
62596
|
children: E && (0, import_jsx_runtime.jsx)(DownloadAs, {
|
|
62597
|
-
downloadAs: E
|
|
62597
|
+
downloadAs: E,
|
|
62598
|
+
downloadFileName: O
|
|
62598
62599
|
})
|
|
62599
62600
|
})
|
|
62600
62601
|
]
|
|
62601
|
-
}), DataTable = (0, import_react.memo)(({ wrapperClassName: e, className: r, maxHeight: c, columns: d, data: f, selection: _, totalColumns: v, totalRows: y, manualSorting: S = false, sorting: w, setSorting: E, rowSelection: O, cellSelection: M, cellStyling: I, hoverTemplate: z, cellHoverTexts: G, paginationState: q, setPaginationState: IY, downloadAs: LY,
|
|
62602
|
-
let [
|
|
62602
|
+
}), DataTable = (0, import_react.memo)(({ wrapperClassName: e, className: r, maxHeight: c, columns: d, data: f, selection: _, totalColumns: v, totalRows: y, manualSorting: S = false, sorting: w, setSorting: E, rowSelection: O, cellSelection: M, cellStyling: I, hoverTemplate: z, cellHoverTexts: G, paginationState: q, setPaginationState: IY, downloadAs: LY, downloadFileName: RY, manualPagination: zY = false, pagination: BY = false, onRowSelectionChange: VY, onCellSelectionChange: HY, getRowIds: UY, enableSearch: WY = false, searchQuery: GY, onSearchQueryChange: KY, showFilters: qY = false, filters: JY, onFiltersChange: YY, reloading: XY, freezeColumnsLeft: ZY, freezeColumnsRight: QY, toggleDisplayHeader: $Y, showChartBuilder: eX, showPageSizeSelector: tX, showColumnExplorer: nX, showRowExplorer: rX, togglePanel: iX, isPanelOpen: aX, viewedRowIdx: oX, onViewedRowChange: sX }) => {
|
|
62603
|
+
let [cX, lX] = import_react.useState(false), [uX, dX] = import_react.useState(false), { locale: fX } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), { columnPinning: pX, setColumnPinning: mX } = useColumnPinning(ZY, QY);
|
|
62603
62604
|
import_react.useEffect(() => {
|
|
62604
62605
|
let e2;
|
|
62605
|
-
return
|
|
62606
|
-
|
|
62607
|
-
}, 300) :
|
|
62606
|
+
return XY ? e2 = setTimeout(() => {
|
|
62607
|
+
dX(true);
|
|
62608
|
+
}, 300) : dX(false), () => {
|
|
62608
62609
|
e2 && clearTimeout(e2);
|
|
62609
62610
|
};
|
|
62610
62611
|
}, [
|
|
62611
|
-
|
|
62612
|
+
XY
|
|
62612
62613
|
]);
|
|
62613
|
-
function
|
|
62614
|
-
return q ? r2 + (
|
|
62614
|
+
function hX(e2, r2) {
|
|
62615
|
+
return q ? r2 + (zY ? q.pageIndex * q.pageSize : 0) : r2;
|
|
62615
62616
|
}
|
|
62616
|
-
let
|
|
62617
|
+
let gX = useReactTable({
|
|
62617
62618
|
_features: [
|
|
62618
62619
|
ColumnPinning,
|
|
62619
62620
|
ColumnWrappingFeature,
|
|
@@ -62634,12 +62635,12 @@ Defaulting to \`null\`.`;
|
|
|
62634
62635
|
getRowId: (e2, r2) => {
|
|
62635
62636
|
let c2 = getStableRowId(e2);
|
|
62636
62637
|
if (c2) return c2;
|
|
62637
|
-
let d2 =
|
|
62638
|
+
let d2 = hX(e2, r2);
|
|
62638
62639
|
return String(d2);
|
|
62639
62640
|
}
|
|
62640
62641
|
} : {},
|
|
62641
|
-
locale:
|
|
62642
|
-
manualPagination:
|
|
62642
|
+
locale: fX,
|
|
62643
|
+
manualPagination: zY,
|
|
62643
62644
|
getPaginationRowModel: getPaginationRowModel(),
|
|
62644
62645
|
...E ? {
|
|
62645
62646
|
onSortingChange: E
|
|
@@ -62648,24 +62649,24 @@ Defaulting to \`null\`.`;
|
|
|
62648
62649
|
enableMultiSort: true,
|
|
62649
62650
|
getSortedRowModel: getSortedRowModel(),
|
|
62650
62651
|
manualFiltering: true,
|
|
62651
|
-
enableColumnFilters:
|
|
62652
|
+
enableColumnFilters: qY,
|
|
62652
62653
|
getFilteredRowModel: getFilteredRowModel(),
|
|
62653
|
-
onColumnFiltersChange:
|
|
62654
|
-
onRowSelectionChange:
|
|
62655
|
-
onCellSelectionChange:
|
|
62654
|
+
onColumnFiltersChange: YY,
|
|
62655
|
+
onRowSelectionChange: VY,
|
|
62656
|
+
onCellSelectionChange: HY,
|
|
62656
62657
|
enableCellSelection: _ === "single-cell" || _ === "multi-cell",
|
|
62657
62658
|
enableMultiCellSelection: _ === "multi-cell",
|
|
62658
|
-
onColumnPinningChange:
|
|
62659
|
+
onColumnPinningChange: mX,
|
|
62659
62660
|
enableFocusRow: true,
|
|
62660
|
-
onFocusRowChange:
|
|
62661
|
+
onFocusRowChange: sX,
|
|
62661
62662
|
state: {
|
|
62662
62663
|
...w ? {
|
|
62663
62664
|
sorting: w
|
|
62664
62665
|
} : {},
|
|
62665
|
-
columnFilters:
|
|
62666
|
+
columnFilters: JY,
|
|
62666
62667
|
...q ? {
|
|
62667
62668
|
pagination: q
|
|
62668
|
-
} :
|
|
62669
|
+
} : BY && !q ? {} : {
|
|
62669
62670
|
pagination: {
|
|
62670
62671
|
pageIndex: 0,
|
|
62671
62672
|
pageSize: f.length
|
|
@@ -62674,14 +62675,14 @@ Defaulting to \`null\`.`;
|
|
|
62674
62675
|
rowSelection: O ?? {},
|
|
62675
62676
|
cellSelection: M ?? [],
|
|
62676
62677
|
cellStyling: I,
|
|
62677
|
-
columnPinning:
|
|
62678
|
+
columnPinning: pX,
|
|
62678
62679
|
cellHoverTemplate: z,
|
|
62679
62680
|
cellHoverTexts: G ?? {}
|
|
62680
62681
|
}
|
|
62681
|
-
}),
|
|
62682
|
+
}), _X = (aX == null ? void 0 : aX("row-viewer")) ?? false, vX = import_react.useRef(null);
|
|
62682
62683
|
return import_react.useEffect(() => {
|
|
62683
|
-
if (!
|
|
62684
|
-
let e2 =
|
|
62684
|
+
if (!vX.current) return;
|
|
62685
|
+
let e2 = vX.current.parentElement;
|
|
62685
62686
|
e2 && (c ? (e2.style.maxHeight = `${c}px`, e2.style.overflow || (e2.style.overflow = "auto")) : e2.style.removeProperty("max-height"));
|
|
62686
62687
|
}, [
|
|
62687
62688
|
c
|
|
@@ -62689,34 +62690,34 @@ Defaulting to \`null\`.`;
|
|
|
62689
62690
|
className: cn(e, "flex flex-col space-y-1"),
|
|
62690
62691
|
children: [
|
|
62691
62692
|
(0, import_jsx_runtime.jsx)(FilterPills, {
|
|
62692
|
-
filters:
|
|
62693
|
-
table:
|
|
62693
|
+
filters: JY,
|
|
62694
|
+
table: gX
|
|
62694
62695
|
}),
|
|
62695
62696
|
(0, import_jsx_runtime.jsxs)("div", {
|
|
62696
62697
|
className: cn(r || "rounded-md border overflow-hidden"),
|
|
62697
62698
|
children: [
|
|
62698
|
-
|
|
62699
|
-
value:
|
|
62700
|
-
onHide: () =>
|
|
62701
|
-
handleSearch:
|
|
62702
|
-
hidden: !
|
|
62703
|
-
reloading:
|
|
62699
|
+
KY && WY && (0, import_jsx_runtime.jsx)(SearchBar, {
|
|
62700
|
+
value: GY || "",
|
|
62701
|
+
onHide: () => lX(false),
|
|
62702
|
+
handleSearch: KY,
|
|
62703
|
+
hidden: !cX,
|
|
62704
|
+
reloading: XY
|
|
62704
62705
|
}),
|
|
62705
62706
|
(0, import_jsx_runtime.jsxs)(Table, {
|
|
62706
62707
|
className: "relative",
|
|
62707
|
-
ref:
|
|
62708
|
+
ref: vX,
|
|
62708
62709
|
children: [
|
|
62709
|
-
|
|
62710
|
+
uX && (0, import_jsx_runtime.jsx)("thead", {
|
|
62710
62711
|
className: "absolute top-0 left-0 h-[3px] w-1/2 bg-primary animate-slide"
|
|
62711
62712
|
}),
|
|
62712
|
-
renderTableHeader(
|
|
62713
|
+
renderTableHeader(gX, !!c),
|
|
62713
62714
|
(0, import_jsx_runtime.jsx)(CellSelectionProvider, {
|
|
62714
62715
|
children: (0, import_jsx_runtime.jsx)(DataTableBody, {
|
|
62715
|
-
table:
|
|
62716
|
+
table: gX,
|
|
62716
62717
|
columns: d,
|
|
62717
|
-
rowViewerPanelOpen:
|
|
62718
|
-
getRowIndex:
|
|
62719
|
-
viewedRowIdx:
|
|
62718
|
+
rowViewerPanelOpen: _X,
|
|
62719
|
+
getRowIndex: hX,
|
|
62720
|
+
viewedRowIdx: oX
|
|
62720
62721
|
})
|
|
62721
62722
|
})
|
|
62722
62723
|
]
|
|
@@ -62724,25 +62725,26 @@ Defaulting to \`null\`.`;
|
|
|
62724
62725
|
]
|
|
62725
62726
|
}),
|
|
62726
62727
|
(0, import_jsx_runtime.jsx)(TableActions, {
|
|
62727
|
-
enableSearch:
|
|
62728
|
+
enableSearch: WY,
|
|
62728
62729
|
totalColumns: v,
|
|
62729
|
-
onSearchQueryChange:
|
|
62730
|
-
isSearchEnabled:
|
|
62731
|
-
setIsSearchEnabled:
|
|
62732
|
-
pagination:
|
|
62730
|
+
onSearchQueryChange: KY,
|
|
62731
|
+
isSearchEnabled: cX,
|
|
62732
|
+
setIsSearchEnabled: lX,
|
|
62733
|
+
pagination: BY,
|
|
62733
62734
|
selection: _,
|
|
62734
|
-
onRowSelectionChange:
|
|
62735
|
-
table:
|
|
62735
|
+
onRowSelectionChange: VY,
|
|
62736
|
+
table: gX,
|
|
62736
62737
|
downloadAs: LY,
|
|
62737
|
-
|
|
62738
|
-
|
|
62739
|
-
|
|
62740
|
-
|
|
62741
|
-
|
|
62742
|
-
|
|
62743
|
-
|
|
62744
|
-
|
|
62745
|
-
|
|
62738
|
+
downloadFileName: RY,
|
|
62739
|
+
getRowIds: UY,
|
|
62740
|
+
toggleDisplayHeader: $Y,
|
|
62741
|
+
showChartBuilder: eX,
|
|
62742
|
+
showPageSizeSelector: tX,
|
|
62743
|
+
showColumnExplorer: nX,
|
|
62744
|
+
showRowExplorer: rX,
|
|
62745
|
+
togglePanel: iX,
|
|
62746
|
+
isPanelOpen: aX,
|
|
62747
|
+
tableLoading: XY
|
|
62746
62748
|
})
|
|
62747
62749
|
]
|
|
62748
62750
|
});
|
|
@@ -73304,7 +73306,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
|
|
|
73304
73306
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
73305
73307
|
}
|
|
73306
73308
|
}
|
|
73307
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.10-
|
|
73309
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.19.10-dev38"), showCodeInRunModeAtom = atom(true);
|
|
73308
73310
|
atom(null);
|
|
73309
73311
|
var import_compiler_runtime$88 = require_compiler_runtime();
|
|
73310
73312
|
function useKeydownOnElement(e, r) {
|
|
@@ -83558,7 +83560,8 @@ ${c}
|
|
|
83558
83560
|
hoverTemplate: string$2().optional(),
|
|
83559
83561
|
cellHoverTexts: cellHoverTextSchema,
|
|
83560
83562
|
lazy: boolean$2().default(false),
|
|
83561
|
-
preload: boolean$2().default(false)
|
|
83563
|
+
preload: boolean$2().default(false),
|
|
83564
|
+
downloadFileName: string$2().optional()
|
|
83562
83565
|
})).withFunctions({
|
|
83563
83566
|
download_as: DownloadAsSchema,
|
|
83564
83567
|
get_column_summaries: rpc.input(looseObject({})).output(object$1({
|
|
@@ -83855,8 +83858,8 @@ ${c}
|
|
|
83855
83858
|
}), r[98] = sX, r[99] = _X, r[100] = vX) : vX = r[100], vX;
|
|
83856
83859
|
});
|
|
83857
83860
|
LoadingDataTableComponent.displayName = "LoadingDataTableComponent";
|
|
83858
|
-
var DataTableComponent = ({ label: e, data: r, totalRows: c, maxColumns: d, pagination: f, selection: _, value: v, showFilters: y, showDownload: S, showPageSizeSelector: w, showColumnExplorer: E, showRowExplorer: O, showChartBuilder: M, showDataTypes: I, rowHeaders: z, fieldTypes: G, paginationState: q, setPaginationState: IY, download_as: LY, columnSummaries: RY, className: zY, setValue: BY, sorting: VY, setSorting: HY, enableSearch: UY, searchQuery: WY, setSearchQuery: GY, filters: KY, setFilters: qY, reloading: JY, freezeColumnsLeft: YY, freezeColumnsRight: XY, textJustifyColumns: ZY, wrappedColumns: QY, headerTooltip: $Y, totalColumns: eX, get_row_ids: tX, cellStyles: nX, hoverTemplate: rX, cellHoverTexts: iX,
|
|
83859
|
-
let
|
|
83861
|
+
var DataTableComponent = ({ label: e, data: r, totalRows: c, maxColumns: d, pagination: f, selection: _, value: v, showFilters: y, showDownload: S, showPageSizeSelector: w, showColumnExplorer: E, showRowExplorer: O, showChartBuilder: M, showDataTypes: I, rowHeaders: z, fieldTypes: G, paginationState: q, setPaginationState: IY, download_as: LY, columnSummaries: RY, className: zY, setValue: BY, sorting: VY, setSorting: HY, enableSearch: UY, searchQuery: WY, setSearchQuery: GY, filters: KY, setFilters: qY, reloading: JY, freezeColumnsLeft: YY, freezeColumnsRight: XY, textJustifyColumns: ZY, wrappedColumns: QY, headerTooltip: $Y, totalColumns: eX, get_row_ids: tX, cellStyles: nX, hoverTemplate: rX, cellHoverTexts: iX, downloadFileName: oX, toggleDisplayHeader: sX, calculate_top_k_rows: cX, preview_column: lX, getRow: uX, cellId: dX, maxHeight: fX }) => {
|
|
83862
|
+
let pX = (0, import_react.useId)(), [mX, hX] = (0, import_react.useState)(0), { isPanelOpen: gX, togglePanel: _X } = usePanelOwnership(pX, dX), vX = (0, import_react.useMemo)(() => {
|
|
83860
83863
|
if (!RY || !G || !RY.stats) return ColumnChartSpecModel.EMPTY;
|
|
83861
83864
|
let e2 = toFieldTypes(G);
|
|
83862
83865
|
return new ColumnChartSpecModel(RY.data || [], e2, RY.stats, RY.bin_values, RY.value_counts, {
|
|
@@ -83865,55 +83868,55 @@ ${c}
|
|
|
83865
83868
|
}, [
|
|
83866
83869
|
G,
|
|
83867
83870
|
RY
|
|
83868
|
-
]),
|
|
83871
|
+
]), yX = useDeepCompareMemoize(G ?? inferFieldTypes(r)), bX = (0, import_react.useMemo)(() => d === "all" ? yX : yX.slice(0, d), [
|
|
83869
83872
|
d,
|
|
83870
|
-
|
|
83871
|
-
]),
|
|
83873
|
+
yX
|
|
83874
|
+
]), xX = useDeepCompareMemoize(z), SX = useDeepCompareMemoize(ZY), CX = useDeepCompareMemoize(QY), wX = useDeepCompareMemoize(vX), TX = bX.length;
|
|
83872
83875
|
G || (I = false);
|
|
83873
|
-
let
|
|
83874
|
-
rowHeaders:
|
|
83876
|
+
let EX = (0, import_react.useMemo)(() => generateColumns({
|
|
83877
|
+
rowHeaders: xX,
|
|
83875
83878
|
selection: _,
|
|
83876
|
-
chartSpecModel:
|
|
83877
|
-
fieldTypes:
|
|
83878
|
-
textJustifyColumns:
|
|
83879
|
-
wrappedColumns:
|
|
83879
|
+
chartSpecModel: wX,
|
|
83880
|
+
fieldTypes: bX,
|
|
83881
|
+
textJustifyColumns: SX,
|
|
83882
|
+
wrappedColumns: CX,
|
|
83880
83883
|
headerTooltip: $Y,
|
|
83881
83884
|
showDataTypes: I,
|
|
83882
|
-
calculateTopKRows:
|
|
83885
|
+
calculateTopKRows: cX
|
|
83883
83886
|
}), [
|
|
83884
83887
|
_,
|
|
83885
83888
|
I,
|
|
83886
|
-
|
|
83887
|
-
bX,
|
|
83888
|
-
yX,
|
|
83889
|
+
wX,
|
|
83889
83890
|
xX,
|
|
83891
|
+
bX,
|
|
83890
83892
|
SX,
|
|
83893
|
+
CX,
|
|
83891
83894
|
$Y,
|
|
83892
|
-
|
|
83893
|
-
]),
|
|
83895
|
+
cX
|
|
83896
|
+
]), DX = (0, import_react.useMemo)(() => Object.fromEntries((v || []).map((e2) => [
|
|
83894
83897
|
e2,
|
|
83895
83898
|
true
|
|
83896
83899
|
])), [
|
|
83897
83900
|
v
|
|
83898
|
-
]),
|
|
83901
|
+
]), OX = useEvent_default((e2) => {
|
|
83899
83902
|
if (_ === "single") {
|
|
83900
83903
|
let r2 = Functions.asUpdater(e2)({});
|
|
83901
83904
|
BY(Object.keys(r2).slice(0, 1));
|
|
83902
83905
|
}
|
|
83903
83906
|
if (_ === "multi") {
|
|
83904
|
-
let r2 = Functions.asUpdater(e2)(
|
|
83907
|
+
let r2 = Functions.asUpdater(e2)(DX);
|
|
83905
83908
|
BY(Object.keys(r2));
|
|
83906
83909
|
}
|
|
83907
|
-
}),
|
|
83908
|
-
if (
|
|
83910
|
+
}), kX = useEvent_default((e2) => {
|
|
83911
|
+
if (hX(e2), e2 < 0 || typeof c == "number" && e2 >= c || c === "too_many") return;
|
|
83909
83912
|
let r2 = getPageIndexForRow(e2, q.pageIndex, q.pageSize);
|
|
83910
83913
|
r2 !== null && IY((e3) => ({
|
|
83911
83914
|
...e3,
|
|
83912
83915
|
pageIndex: r2
|
|
83913
83916
|
}));
|
|
83914
|
-
}),
|
|
83915
|
-
_ === "single-cell" && BY(Functions.asUpdater(e2)(
|
|
83916
|
-
}),
|
|
83917
|
+
}), AX = v.filter((e2) => e2 instanceof Object && e2.columnName !== void 0), jX = useEvent_default((e2) => {
|
|
83918
|
+
_ === "single-cell" && BY(Functions.asUpdater(e2)(AX).slice(0, 1)), _ === "multi-cell" && BY(Functions.asUpdater(e2)(AX));
|
|
83919
|
+
}), MX = _ === "multi" || _ === "single", NX = E && lX && gX("column-explorer"), PX = isInVscodeExtension();
|
|
83917
83920
|
return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
83918
83921
|
children: [
|
|
83919
83922
|
c === "too_many" && q.pageSize === r.length && (0, import_jsx_runtime.jsxs)(Banner, {
|
|
@@ -83924,11 +83927,11 @@ ${c}
|
|
|
83924
83927
|
" rows."
|
|
83925
83928
|
]
|
|
83926
83929
|
}),
|
|
83927
|
-
|
|
83930
|
+
TX < eX && TX > 0 && (0, import_jsx_runtime.jsxs)(Banner, {
|
|
83928
83931
|
className: "mb-1 rounded",
|
|
83929
83932
|
children: [
|
|
83930
83933
|
"Result clipped. Showing ",
|
|
83931
|
-
|
|
83934
|
+
TX,
|
|
83932
83935
|
" of ",
|
|
83933
83936
|
eX,
|
|
83934
83937
|
" columns."
|
|
@@ -83938,38 +83941,38 @@ ${c}
|
|
|
83938
83941
|
className: "mb-1 rounded",
|
|
83939
83942
|
children: "Column summaries are unavailable. Filter your data to fewer than 1,000,000 rows."
|
|
83940
83943
|
}),
|
|
83941
|
-
|
|
83944
|
+
gX("row-viewer") && (0, import_jsx_runtime.jsx)(ContextAwarePanelItem, {
|
|
83942
83945
|
children: (0, import_jsx_runtime.jsx)(RowViewerPanel, {
|
|
83943
|
-
getRow:
|
|
83944
|
-
fieldTypes:
|
|
83946
|
+
getRow: uX,
|
|
83947
|
+
fieldTypes: yX,
|
|
83945
83948
|
totalRows: c,
|
|
83946
|
-
rowIdx:
|
|
83947
|
-
setRowIdx:
|
|
83948
|
-
isSelectable:
|
|
83949
|
-
isRowSelected:
|
|
83950
|
-
handleRowSelectionChange:
|
|
83949
|
+
rowIdx: mX,
|
|
83950
|
+
setRowIdx: kX,
|
|
83951
|
+
isSelectable: MX,
|
|
83952
|
+
isRowSelected: DX[mX],
|
|
83953
|
+
handleRowSelectionChange: OX
|
|
83951
83954
|
})
|
|
83952
83955
|
}),
|
|
83953
|
-
|
|
83956
|
+
NX && (0, import_jsx_runtime.jsx)(ContextAwarePanelItem, {
|
|
83954
83957
|
children: (0, import_jsx_runtime.jsx)(ColumnExplorerPanel, {
|
|
83955
|
-
previewColumn:
|
|
83956
|
-
fieldTypes:
|
|
83958
|
+
previewColumn: lX,
|
|
83959
|
+
fieldTypes: yX,
|
|
83957
83960
|
totalRows: c,
|
|
83958
83961
|
totalColumns: eX,
|
|
83959
|
-
tableId:
|
|
83962
|
+
tableId: pX
|
|
83960
83963
|
})
|
|
83961
83964
|
}),
|
|
83962
83965
|
(0, import_jsx_runtime.jsx)(ColumnChartContext, {
|
|
83963
|
-
value:
|
|
83966
|
+
value: vX,
|
|
83964
83967
|
children: (0, import_jsx_runtime.jsx)(Labeled, {
|
|
83965
83968
|
label: e,
|
|
83966
83969
|
align: "top",
|
|
83967
83970
|
fullWidth: true,
|
|
83968
83971
|
children: (0, import_jsx_runtime.jsx)(DataTable, {
|
|
83969
83972
|
data: r,
|
|
83970
|
-
columns:
|
|
83973
|
+
columns: EX,
|
|
83971
83974
|
className: zY,
|
|
83972
|
-
maxHeight:
|
|
83975
|
+
maxHeight: fX,
|
|
83973
83976
|
sorting: VY,
|
|
83974
83977
|
totalRows: c,
|
|
83975
83978
|
totalColumns: eX,
|
|
@@ -83980,12 +83983,13 @@ ${c}
|
|
|
83980
83983
|
selection: _,
|
|
83981
83984
|
paginationState: q,
|
|
83982
83985
|
setPaginationState: IY,
|
|
83983
|
-
rowSelection:
|
|
83984
|
-
cellSelection:
|
|
83986
|
+
rowSelection: DX,
|
|
83987
|
+
cellSelection: AX,
|
|
83985
83988
|
cellStyling: nX,
|
|
83986
83989
|
hoverTemplate: rX,
|
|
83987
83990
|
cellHoverTexts: iX,
|
|
83988
83991
|
downloadAs: S ? LY : void 0,
|
|
83992
|
+
downloadFileName: oX,
|
|
83989
83993
|
enableSearch: UY,
|
|
83990
83994
|
searchQuery: WY,
|
|
83991
83995
|
onSearchQueryChange: GY,
|
|
@@ -83993,20 +83997,20 @@ ${c}
|
|
|
83993
83997
|
filters: KY,
|
|
83994
83998
|
onFiltersChange: qY,
|
|
83995
83999
|
reloading: JY,
|
|
83996
|
-
onRowSelectionChange:
|
|
84000
|
+
onRowSelectionChange: OX,
|
|
83997
84001
|
freezeColumnsLeft: YY,
|
|
83998
84002
|
freezeColumnsRight: XY,
|
|
83999
|
-
onCellSelectionChange:
|
|
84003
|
+
onCellSelectionChange: jX,
|
|
84000
84004
|
getRowIds: tX,
|
|
84001
|
-
toggleDisplayHeader:
|
|
84005
|
+
toggleDisplayHeader: sX,
|
|
84002
84006
|
showChartBuilder: M,
|
|
84003
84007
|
showPageSizeSelector: w,
|
|
84004
|
-
showColumnExplorer: E && !
|
|
84005
|
-
showRowExplorer: O && !
|
|
84006
|
-
togglePanel:
|
|
84007
|
-
isPanelOpen:
|
|
84008
|
-
viewedRowIdx:
|
|
84009
|
-
onViewedRowChange: (e2) =>
|
|
84008
|
+
showColumnExplorer: E && !PX,
|
|
84009
|
+
showRowExplorer: O && !PX,
|
|
84010
|
+
togglePanel: _X,
|
|
84011
|
+
isPanelOpen: gX,
|
|
84012
|
+
viewedRowIdx: mX,
|
|
84013
|
+
onViewedRowChange: (e2) => hX(e2)
|
|
84010
84014
|
})
|
|
84011
84015
|
})
|
|
84012
84016
|
})
|
|
@@ -86688,6 +86692,7 @@ ${c}
|
|
|
86688
86692
|
label: string$2().nullish(),
|
|
86689
86693
|
pageSize: number$2().default(5),
|
|
86690
86694
|
showDownload: boolean$2().default(true),
|
|
86695
|
+
dataframeName: string$2().optional(),
|
|
86691
86696
|
columns: array$2(tuple([
|
|
86692
86697
|
string$2().or(number$2()),
|
|
86693
86698
|
string$2(),
|
|
@@ -86745,37 +86750,37 @@ ${c}
|
|
|
86745
86750
|
transforms: []
|
|
86746
86751
|
};
|
|
86747
86752
|
const DataFrameComponent = (0, import_react.memo)((e) => {
|
|
86748
|
-
let r = (0, import_compiler_runtime$39.c)(
|
|
86749
|
-
r[0] ===
|
|
86750
|
-
let
|
|
86751
|
-
r[2] ===
|
|
86752
|
-
|
|
86753
|
-
], r[2] =
|
|
86754
|
-
let { data:
|
|
86755
|
-
r[4] ===
|
|
86756
|
-
let { url:
|
|
86757
|
-
r[6] ===
|
|
86753
|
+
let r = (0, import_compiler_runtime$39.c)(70), { columns: c, dataframeName: d, pageSize: f, showDownload: _, lazy: v, value: y, setValue: S, get_dataframe: w, get_column_values: E, search: O, download_as: M, host: I } = e, z;
|
|
86754
|
+
r[0] === w ? z = r[1] : (z = () => w({}), r[0] = w, r[1] = z);
|
|
86755
|
+
let G = y == null ? void 0 : y.transforms, q;
|
|
86756
|
+
r[2] === G ? q = r[3] : (q = [
|
|
86757
|
+
G
|
|
86758
|
+
], r[2] = G, r[3] = q);
|
|
86759
|
+
let { data: IY, error: LY, isPending: RY } = useAsyncData(z, q), zY;
|
|
86760
|
+
r[4] === IY ? zY = r[5] : (zY = IY || {}, r[4] = IY, r[5] = zY);
|
|
86761
|
+
let { url: BY, total_rows: VY, row_headers: HY, field_types: UY, column_types_per_step: WY, python_code: GY, sql_code: KY } = zY, qY = UY == null ? void 0 : UY.length, [JY, YY] = (0, import_react.useState)(y || EMPTY), XY = (0, import_react.useRef)(null), ZY;
|
|
86762
|
+
r[6] === v ? ZY = r[7] : (ZY = (e2) => {
|
|
86758
86763
|
var _a2;
|
|
86759
|
-
|
|
86760
|
-
}, r[6] =
|
|
86761
|
-
let
|
|
86762
|
-
r[8] ===
|
|
86763
|
-
|
|
86764
|
-
}, r[8] =
|
|
86765
|
-
let
|
|
86766
|
-
r[10] !==
|
|
86767
|
-
let e2 =
|
|
86768
|
-
(
|
|
86769
|
-
}, r[10] =
|
|
86770
|
-
let
|
|
86771
|
-
r[13] !==
|
|
86772
|
-
|
|
86773
|
-
|
|
86774
|
-
|
|
86775
|
-
|
|
86776
|
-
], r[13] =
|
|
86777
|
-
let
|
|
86778
|
-
r[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
86764
|
+
v && e2 !== "transform" && ((_a2 = XY.current) == null ? void 0 : _a2.submit());
|
|
86765
|
+
}, r[6] = v, r[7] = ZY);
|
|
86766
|
+
let QY = ZY, $Y = (0, import_react.useRef)(JY), eX;
|
|
86767
|
+
r[8] === JY ? eX = r[9] : (eX = () => {
|
|
86768
|
+
$Y.current = JY;
|
|
86769
|
+
}, r[8] = JY, r[9] = eX), (0, import_react.useEffect)(eX);
|
|
86770
|
+
let tX;
|
|
86771
|
+
r[10] !== S || r[11] !== (y == null ? void 0 : y.transforms.length) ? (tX = () => {
|
|
86772
|
+
let e2 = $Y.current;
|
|
86773
|
+
(y == null ? void 0 : y.transforms.length) !== e2.transforms.length && S(e2);
|
|
86774
|
+
}, r[10] = S, r[11] = y == null ? void 0 : y.transforms.length, r[12] = tX) : tX = r[12];
|
|
86775
|
+
let nX = y == null ? void 0 : y.transforms.length, rX;
|
|
86776
|
+
r[13] !== IY || r[14] !== S || r[15] !== nX ? (rX = [
|
|
86777
|
+
IY,
|
|
86778
|
+
nX,
|
|
86779
|
+
$Y,
|
|
86780
|
+
S
|
|
86781
|
+
], r[13] = IY, r[14] = S, r[15] = nX, r[16] = rX) : rX = r[16], (0, import_react.useEffect)(tX, rX);
|
|
86782
|
+
let iX;
|
|
86783
|
+
r[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (iX = (0, import_jsx_runtime.jsxs)(TabsTrigger, {
|
|
86779
86784
|
value: "transform",
|
|
86780
86785
|
className: "text-xs py-1",
|
|
86781
86786
|
children: [
|
|
@@ -86784,9 +86789,9 @@ ${c}
|
|
|
86784
86789
|
}),
|
|
86785
86790
|
"Transform"
|
|
86786
86791
|
]
|
|
86787
|
-
}), r[17] =
|
|
86788
|
-
let
|
|
86789
|
-
r[18] ===
|
|
86792
|
+
}), r[17] = iX) : iX = r[17];
|
|
86793
|
+
let aX;
|
|
86794
|
+
r[18] === GY ? aX = r[19] : (aX = GY && (0, import_jsx_runtime.jsxs)(TabsTrigger, {
|
|
86790
86795
|
value: "python-code",
|
|
86791
86796
|
className: "text-xs py-1",
|
|
86792
86797
|
children: [
|
|
@@ -86795,9 +86800,9 @@ ${c}
|
|
|
86795
86800
|
}),
|
|
86796
86801
|
"Python Code"
|
|
86797
86802
|
]
|
|
86798
|
-
}), r[18] =
|
|
86799
|
-
let
|
|
86800
|
-
r[20] ===
|
|
86803
|
+
}), r[18] = GY, r[19] = aX);
|
|
86804
|
+
let oX;
|
|
86805
|
+
r[20] === KY ? oX = r[21] : (oX = KY && (0, import_jsx_runtime.jsxs)(TabsTrigger, {
|
|
86801
86806
|
value: "sql-code",
|
|
86802
86807
|
className: "text-xs py-1",
|
|
86803
86808
|
children: [
|
|
@@ -86806,111 +86811,112 @@ ${c}
|
|
|
86806
86811
|
}),
|
|
86807
86812
|
"SQL Code"
|
|
86808
86813
|
]
|
|
86809
|
-
}), r[20] =
|
|
86810
|
-
let oX;
|
|
86811
|
-
r[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (oX = (0, import_jsx_runtime.jsx)("div", {
|
|
86812
|
-
className: "grow"
|
|
86813
|
-
}), r[22] = oX) : oX = r[22];
|
|
86814
|
+
}), r[20] = KY, r[21] = oX);
|
|
86814
86815
|
let sX;
|
|
86815
|
-
r[
|
|
86816
|
+
r[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (sX = (0, import_jsx_runtime.jsx)("div", {
|
|
86817
|
+
className: "grow"
|
|
86818
|
+
}), r[22] = sX) : sX = r[22];
|
|
86819
|
+
let cX;
|
|
86820
|
+
r[23] !== aX || r[24] !== oX ? (cX = (0, import_jsx_runtime.jsxs)(TabsList, {
|
|
86816
86821
|
className: "h-8",
|
|
86817
86822
|
children: [
|
|
86818
|
-
rX,
|
|
86819
86823
|
iX,
|
|
86820
86824
|
aX,
|
|
86821
|
-
oX
|
|
86825
|
+
oX,
|
|
86826
|
+
sX
|
|
86822
86827
|
]
|
|
86823
|
-
}), r[23] =
|
|
86824
|
-
let cX;
|
|
86825
|
-
r[26] === LY ? cX = r[27] : (cX = LY && (0, import_jsx_runtime.jsx)(Spinner, {
|
|
86826
|
-
size: "small"
|
|
86827
|
-
}), r[26] = LY, r[27] = cX);
|
|
86828
|
+
}), r[23] = aX, r[24] = oX, r[25] = cX) : cX = r[25];
|
|
86828
86829
|
let lX;
|
|
86829
|
-
r[
|
|
86830
|
+
r[26] === RY ? lX = r[27] : (lX = RY && (0, import_jsx_runtime.jsx)(Spinner, {
|
|
86831
|
+
size: "small"
|
|
86832
|
+
}), r[26] = RY, r[27] = lX);
|
|
86833
|
+
let uX;
|
|
86834
|
+
r[28] !== cX || r[29] !== lX ? (uX = (0, import_jsx_runtime.jsxs)("div", {
|
|
86830
86835
|
className: "flex items-center gap-2",
|
|
86831
86836
|
children: [
|
|
86832
|
-
|
|
86833
|
-
|
|
86837
|
+
cX,
|
|
86838
|
+
lX
|
|
86834
86839
|
]
|
|
86835
|
-
}), r[28] =
|
|
86836
|
-
let uX;
|
|
86837
|
-
r[31] !== y || r[32] !== v ? (uX = (e2) => {
|
|
86838
|
-
isEqual_default(e2, v) || (y(e2), JY(e2));
|
|
86839
|
-
}, r[31] = y, r[32] = v, r[33] = uX) : uX = r[33];
|
|
86840
|
+
}), r[28] = cX, r[29] = lX, r[30] = uX) : uX = r[30];
|
|
86840
86841
|
let dX;
|
|
86841
|
-
r[
|
|
86842
|
+
r[31] !== S || r[32] !== y ? (dX = (e2) => {
|
|
86843
|
+
isEqual_default(e2, y) || (S(e2), YY(e2));
|
|
86844
|
+
}, r[31] = S, r[32] = y, r[33] = dX) : dX = r[33];
|
|
86845
|
+
let fX;
|
|
86846
|
+
r[34] !== WY || r[35] !== c || r[36] !== E || r[37] !== JY || r[38] !== v || r[39] !== dX ? (fX = (0, import_jsx_runtime.jsx)(TabsContent, {
|
|
86842
86847
|
value: "transform",
|
|
86843
86848
|
className: "mt-1 border rounded-t overflow-hidden",
|
|
86844
86849
|
children: (0, import_jsx_runtime.jsx)(TransformPanel, {
|
|
86845
|
-
ref:
|
|
86846
|
-
initialValue:
|
|
86850
|
+
ref: XY,
|
|
86851
|
+
initialValue: JY,
|
|
86847
86852
|
columns: c,
|
|
86848
|
-
onChange:
|
|
86849
|
-
onInvalidChange:
|
|
86850
|
-
getColumnValues:
|
|
86851
|
-
columnTypesPerStep:
|
|
86852
|
-
lazy:
|
|
86853
|
+
onChange: dX,
|
|
86854
|
+
onInvalidChange: YY,
|
|
86855
|
+
getColumnValues: E,
|
|
86856
|
+
columnTypesPerStep: WY,
|
|
86857
|
+
lazy: v
|
|
86853
86858
|
})
|
|
86854
|
-
}), r[34] =
|
|
86855
|
-
let
|
|
86856
|
-
r[41] ===
|
|
86859
|
+
}), r[34] = WY, r[35] = c, r[36] = E, r[37] = JY, r[38] = v, r[39] = dX, r[40] = fX) : fX = r[40];
|
|
86860
|
+
let pX;
|
|
86861
|
+
r[41] === GY ? pX = r[42] : (pX = GY && (0, import_jsx_runtime.jsx)(TabsContent, {
|
|
86857
86862
|
value: "python-code",
|
|
86858
86863
|
className: "mt-1 border rounded-t overflow-hidden",
|
|
86859
86864
|
children: (0, import_jsx_runtime.jsx)(ReadonlyCode, {
|
|
86860
86865
|
minHeight: "215px",
|
|
86861
86866
|
maxHeight: "215px",
|
|
86862
|
-
code:
|
|
86867
|
+
code: GY,
|
|
86863
86868
|
language: "python"
|
|
86864
86869
|
})
|
|
86865
|
-
}), r[41] =
|
|
86866
|
-
let
|
|
86867
|
-
r[43] ===
|
|
86870
|
+
}), r[41] = GY, r[42] = pX);
|
|
86871
|
+
let mX;
|
|
86872
|
+
r[43] === KY ? mX = r[44] : (mX = KY && (0, import_jsx_runtime.jsx)(TabsContent, {
|
|
86868
86873
|
value: "sql-code",
|
|
86869
86874
|
className: "mt-1 border rounded-t overflow-hidden",
|
|
86870
86875
|
children: (0, import_jsx_runtime.jsx)(ReadonlyCode, {
|
|
86871
86876
|
minHeight: "215px",
|
|
86872
86877
|
maxHeight: "215px",
|
|
86873
|
-
code:
|
|
86878
|
+
code: KY,
|
|
86874
86879
|
language: "sql"
|
|
86875
86880
|
})
|
|
86876
|
-
}), r[43] =
|
|
86877
|
-
let
|
|
86878
|
-
r[45] !==
|
|
86881
|
+
}), r[43] = KY, r[44] = mX);
|
|
86882
|
+
let hX;
|
|
86883
|
+
r[45] !== QY || r[46] !== uX || r[47] !== fX || r[48] !== pX || r[49] !== mX ? (hX = (0, import_jsx_runtime.jsxs)(Tabs, {
|
|
86879
86884
|
defaultValue: "transform",
|
|
86880
|
-
onValueChange:
|
|
86885
|
+
onValueChange: QY,
|
|
86881
86886
|
children: [
|
|
86882
|
-
|
|
86883
|
-
dX,
|
|
86887
|
+
uX,
|
|
86884
86888
|
fX,
|
|
86885
|
-
pX
|
|
86889
|
+
pX,
|
|
86890
|
+
mX
|
|
86886
86891
|
]
|
|
86887
|
-
}), r[45] =
|
|
86888
|
-
let
|
|
86889
|
-
r[51] ===
|
|
86890
|
-
error:
|
|
86891
|
-
}), r[51] =
|
|
86892
|
-
let
|
|
86893
|
-
r[53] !==
|
|
86892
|
+
}), r[45] = QY, r[46] = uX, r[47] = fX, r[48] = pX, r[49] = mX, r[50] = hX) : hX = r[50];
|
|
86893
|
+
let gX;
|
|
86894
|
+
r[51] === LY ? gX = r[52] : (gX = LY && (0, import_jsx_runtime.jsx)(ErrorBanner, {
|
|
86895
|
+
error: LY
|
|
86896
|
+
}), r[51] = LY, r[52] = gX);
|
|
86897
|
+
let _X = BY || "", vX = VY ?? 0, yX = qY ?? 0, bX = HY || Arrays.EMPTY, xX = VY && VY > 5 || false, SX;
|
|
86898
|
+
r[53] !== d || r[54] !== M || r[55] !== UY || r[56] !== I || r[57] !== f || r[58] !== O || r[59] !== _ || r[60] !== _X || r[61] !== vX || r[62] !== yX || r[63] !== bX || r[64] !== xX ? (SX = (0, import_jsx_runtime.jsx)(LoadingDataTableComponent, {
|
|
86894
86899
|
label: null,
|
|
86895
86900
|
className: "rounded-b border-x border-b",
|
|
86896
|
-
data:
|
|
86901
|
+
data: _X,
|
|
86897
86902
|
hasStableRowId: false,
|
|
86898
|
-
totalRows:
|
|
86899
|
-
totalColumns:
|
|
86903
|
+
totalRows: vX,
|
|
86904
|
+
totalColumns: yX,
|
|
86900
86905
|
maxColumns: "all",
|
|
86901
|
-
pageSize:
|
|
86906
|
+
pageSize: f,
|
|
86902
86907
|
pagination: true,
|
|
86903
|
-
fieldTypes:
|
|
86904
|
-
rowHeaders:
|
|
86905
|
-
showDownload:
|
|
86906
|
-
|
|
86908
|
+
fieldTypes: UY,
|
|
86909
|
+
rowHeaders: bX,
|
|
86910
|
+
showDownload: _,
|
|
86911
|
+
downloadFileName: d,
|
|
86912
|
+
download_as: M,
|
|
86907
86913
|
enableSearch: false,
|
|
86908
86914
|
showFilters: false,
|
|
86909
|
-
search:
|
|
86915
|
+
search: O,
|
|
86910
86916
|
showColumnSummaries: false,
|
|
86911
86917
|
showDataTypes: true,
|
|
86912
86918
|
get_column_summaries: getColumnSummaries,
|
|
86913
|
-
showPageSizeSelector:
|
|
86919
|
+
showPageSizeSelector: xX,
|
|
86914
86920
|
showColumnExplorer: false,
|
|
86915
86921
|
showRowExplorer: true,
|
|
86916
86922
|
showChartBuilder: false,
|
|
@@ -86918,16 +86924,16 @@ ${c}
|
|
|
86918
86924
|
setValue: Functions.NOOP,
|
|
86919
86925
|
selection: null,
|
|
86920
86926
|
lazy: false,
|
|
86921
|
-
host:
|
|
86922
|
-
}), r[53] =
|
|
86923
|
-
let
|
|
86924
|
-
return r[
|
|
86927
|
+
host: I
|
|
86928
|
+
}), r[53] = d, r[54] = M, r[55] = UY, r[56] = I, r[57] = f, r[58] = O, r[59] = _, r[60] = _X, r[61] = vX, r[62] = yX, r[63] = bX, r[64] = xX, r[65] = SX) : SX = r[65];
|
|
86929
|
+
let CX;
|
|
86930
|
+
return r[66] !== hX || r[67] !== gX || r[68] !== SX ? (CX = (0, import_jsx_runtime.jsxs)("div", {
|
|
86925
86931
|
children: [
|
|
86926
|
-
mX,
|
|
86927
86932
|
hX,
|
|
86928
|
-
|
|
86933
|
+
gX,
|
|
86934
|
+
SX
|
|
86929
86935
|
]
|
|
86930
|
-
}), r[
|
|
86936
|
+
}), r[66] = hX, r[67] = gX, r[68] = SX, r[69] = CX) : CX = r[69], CX;
|
|
86931
86937
|
});
|
|
86932
86938
|
DataFrameComponent.displayName = "DataFrameComponent";
|
|
86933
86939
|
function getColumnSummaries() {
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ interface TableActionsProps<TData> {
|
|
|
30
30
|
onRowSelectionChange?: (value: RowSelectionState) => void;
|
|
31
31
|
table: Table<TData>;
|
|
32
32
|
downloadAs?: DownloadActionProps["downloadAs"];
|
|
33
|
+
downloadFileName?: string;
|
|
33
34
|
getRowIds?: GetRowIds;
|
|
34
35
|
toggleDisplayHeader?: () => void;
|
|
35
36
|
showChartBuilder?: boolean;
|
|
@@ -52,6 +53,7 @@ export const TableActions = <TData,>({
|
|
|
52
53
|
onRowSelectionChange,
|
|
53
54
|
table,
|
|
54
55
|
downloadAs,
|
|
56
|
+
downloadFileName,
|
|
55
57
|
getRowIds,
|
|
56
58
|
toggleDisplayHeader,
|
|
57
59
|
showChartBuilder,
|
|
@@ -182,7 +184,12 @@ export const TableActions = <TData,>({
|
|
|
182
184
|
/>
|
|
183
185
|
)}
|
|
184
186
|
<div className="ml-auto">
|
|
185
|
-
{downloadAs &&
|
|
187
|
+
{downloadAs && (
|
|
188
|
+
<DownloadAs
|
|
189
|
+
downloadAs={downloadAs}
|
|
190
|
+
downloadFileName={downloadFileName}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
186
193
|
</div>
|
|
187
194
|
</div>
|
|
188
195
|
);
|
|
@@ -116,6 +116,7 @@ const DataTableInternal = <TData,>({
|
|
|
116
116
|
paginationState,
|
|
117
117
|
setPaginationState,
|
|
118
118
|
downloadAs,
|
|
119
|
+
downloadFileName,
|
|
119
120
|
manualPagination = false,
|
|
120
121
|
pagination = false,
|
|
121
122
|
onRowSelectionChange,
|
|
@@ -334,6 +335,7 @@ const DataTableInternal = <TData,>({
|
|
|
334
335
|
onRowSelectionChange={onRowSelectionChange}
|
|
335
336
|
table={table}
|
|
336
337
|
downloadAs={downloadAs}
|
|
338
|
+
downloadFileName={downloadFileName}
|
|
337
339
|
getRowIds={getRowIds}
|
|
338
340
|
toggleDisplayHeader={toggleDisplayHeader}
|
|
339
341
|
showChartBuilder={showChartBuilder}
|
|
@@ -14,6 +14,7 @@ import { logNever } from "@/utils/assertNever";
|
|
|
14
14
|
import { copyToClipboard } from "@/utils/copy";
|
|
15
15
|
import { downloadByURL } from "@/utils/download";
|
|
16
16
|
import { prettyError } from "@/utils/errors";
|
|
17
|
+
import { Filenames } from "@/utils/filenames";
|
|
17
18
|
import {
|
|
18
19
|
jsonParseWithSpecialChar,
|
|
19
20
|
jsonToMarkdown,
|
|
@@ -36,6 +37,7 @@ type DownloadFormat = "csv" | "json" | "parquet";
|
|
|
36
37
|
|
|
37
38
|
export interface DownloadActionProps {
|
|
38
39
|
downloadAs: (req: { format: DownloadFormat }) => Promise<string>;
|
|
40
|
+
downloadFileName?: string;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const options = [
|
|
@@ -158,7 +160,10 @@ export const DownloadAs: React.FC<DownloadActionProps> = (props) => {
|
|
|
158
160
|
onSelect={async () => {
|
|
159
161
|
const downloadUrl = await getDownloadUrl(option.format);
|
|
160
162
|
const ext = option.format;
|
|
161
|
-
|
|
163
|
+
const rawName = (props.downloadFileName ?? "").trim();
|
|
164
|
+
const baseName =
|
|
165
|
+
Filenames.withoutExtension(rawName) || "download";
|
|
166
|
+
downloadByURL(downloadUrl, `${baseName}.${ext}`);
|
|
162
167
|
}}
|
|
163
168
|
>
|
|
164
169
|
<option.icon className="mo-dropdown-icon" />
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import { codeAtom } from "../../saving/file-state";
|
|
4
|
+
import { store } from "../../state/jotai";
|
|
3
5
|
import {
|
|
4
6
|
CompositeFileStore,
|
|
5
7
|
domElementFileStore,
|
|
6
8
|
localStorageFileStore,
|
|
9
|
+
mountConfigFileStore,
|
|
10
|
+
notebookFileStore,
|
|
7
11
|
} from "../store";
|
|
8
12
|
|
|
9
13
|
describe("localStorageFileStore", () => {
|
|
@@ -53,3 +57,32 @@ describe("CompositeFileStore", () => {
|
|
|
53
57
|
expect(saved).toHaveBeenCalledTimes(3);
|
|
54
58
|
});
|
|
55
59
|
});
|
|
60
|
+
|
|
61
|
+
describe("mountConfigFileStore", () => {
|
|
62
|
+
it("returns null when no code is set", () => {
|
|
63
|
+
store.set(codeAtom, undefined);
|
|
64
|
+
expect(mountConfigFileStore.readFile()).toBeNull();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("returns code when set", () => {
|
|
68
|
+
store.set(codeAtom, "print('hello')");
|
|
69
|
+
expect(mountConfigFileStore.readFile()).toBe("print('hello')");
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("does not save files", () => {
|
|
73
|
+
store.set(codeAtom, "original");
|
|
74
|
+
mountConfigFileStore.saveFile("new content");
|
|
75
|
+
expect(mountConfigFileStore.readFile()).toBe("original");
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
describe("notebookFileStore priority", () => {
|
|
80
|
+
it("prefers mount config over marimo-code and URL", () => {
|
|
81
|
+
store.set(codeAtom, "mount config code");
|
|
82
|
+
const element = document.createElement("marimo-code");
|
|
83
|
+
element.textContent = "marimo-code element";
|
|
84
|
+
document.body.replaceChildren(element);
|
|
85
|
+
|
|
86
|
+
expect(notebookFileStore.readFile()).toBe("mount config code");
|
|
87
|
+
});
|
|
88
|
+
});
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -29,6 +29,7 @@ import type {
|
|
|
29
29
|
SaveUserConfigurationRequest,
|
|
30
30
|
Snippets,
|
|
31
31
|
} from "../network/types";
|
|
32
|
+
import { filenameAtom } from "../saving/file-state";
|
|
32
33
|
import { store } from "../state/jotai";
|
|
33
34
|
import { BasicTransport } from "../websocket/transports/basic";
|
|
34
35
|
import type { IConnectionTransport } from "../websocket/transports/transport";
|
|
@@ -146,7 +147,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
146
147
|
|
|
147
148
|
const code = await notebookFileStore.readFile();
|
|
148
149
|
const fallbackCode = await fallbackFileStore.readFile();
|
|
149
|
-
const filename = PyodideRouter.getFilename();
|
|
150
|
+
const filename = store.get(filenameAtom) ?? PyodideRouter.getFilename();
|
|
150
151
|
const userConfig = store.get(userConfigAtom);
|
|
151
152
|
|
|
152
153
|
const queryParameters: Record<string, string | string[]> = {};
|
package/src/core/wasm/store.ts
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
compressToEncodedURIComponent,
|
|
5
5
|
decompressFromEncodedURIComponent,
|
|
6
6
|
} from "lz-string";
|
|
7
|
+
import { codeAtom } from "@/core/saving/file-state";
|
|
8
|
+
import { store } from "@/core/state/jotai";
|
|
7
9
|
import { TypedLocalStorage } from "@/utils/storage/typed";
|
|
8
10
|
import { PyodideRouter } from "./router";
|
|
9
11
|
|
|
@@ -67,6 +69,15 @@ const remoteDefaultFileStore: FileStore = {
|
|
|
67
69
|
},
|
|
68
70
|
};
|
|
69
71
|
|
|
72
|
+
export const mountConfigFileStore: FileStore = {
|
|
73
|
+
saveFile(_contents: string) {
|
|
74
|
+
// Read-only: mount config code is set via codeAtom
|
|
75
|
+
},
|
|
76
|
+
readFile() {
|
|
77
|
+
return store.get(codeAtom) ?? null;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
70
81
|
const emptyFileStore: FileStore = {
|
|
71
82
|
saveFile(contents: string) {
|
|
72
83
|
// Do nothing
|
|
@@ -112,7 +123,8 @@ export class CompositeFileStore implements FileStore {
|
|
|
112
123
|
}
|
|
113
124
|
|
|
114
125
|
export const notebookFileStore = new CompositeFileStore([
|
|
115
|
-
// Prefer <marimo-code>, then URL
|
|
126
|
+
// Prefer mount config, then <marimo-code>, then URL
|
|
127
|
+
mountConfigFileStore,
|
|
116
128
|
domElementFileStore,
|
|
117
129
|
urlFileStore,
|
|
118
130
|
]);
|
|
@@ -195,6 +195,7 @@ interface Data<T> {
|
|
|
195
195
|
hasStableRowId: boolean;
|
|
196
196
|
lazy: boolean;
|
|
197
197
|
cellHoverTexts?: Record<string, Record<string, string | null>> | null;
|
|
198
|
+
downloadFileName?: string;
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
@@ -278,6 +279,7 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
|
|
|
278
279
|
// If lazy, this will preload the first page of data
|
|
279
280
|
// without user confirmation.
|
|
280
281
|
preload: z.boolean().default(false),
|
|
282
|
+
downloadFileName: z.string().optional(),
|
|
281
283
|
}),
|
|
282
284
|
)
|
|
283
285
|
.withFunctions<DataTableFunctions>({
|
|
@@ -752,6 +754,7 @@ const DataTableComponent = ({
|
|
|
752
754
|
cellStyles,
|
|
753
755
|
hoverTemplate,
|
|
754
756
|
cellHoverTexts,
|
|
757
|
+
downloadFileName,
|
|
755
758
|
toggleDisplayHeader,
|
|
756
759
|
calculate_top_k_rows,
|
|
757
760
|
preview_column,
|
|
@@ -981,6 +984,7 @@ const DataTableComponent = ({
|
|
|
981
984
|
hoverTemplate={hoverTemplate}
|
|
982
985
|
cellHoverTexts={cellHoverTexts}
|
|
983
986
|
downloadAs={showDownload ? downloadAs : undefined}
|
|
987
|
+
downloadFileName={downloadFileName}
|
|
984
988
|
enableSearch={enableSearch}
|
|
985
989
|
searchQuery={searchQuery}
|
|
986
990
|
onSearchQueryChange={setSearchQuery}
|
|
@@ -48,6 +48,7 @@ type TableData<T> = T[] | CsvURL;
|
|
|
48
48
|
interface Data {
|
|
49
49
|
label?: string | null;
|
|
50
50
|
columns: ColumnDataTypes;
|
|
51
|
+
dataframeName?: string;
|
|
51
52
|
pageSize: number;
|
|
52
53
|
showDownload: boolean;
|
|
53
54
|
lazy: boolean;
|
|
@@ -93,6 +94,7 @@ export const DataFramePlugin = createPlugin<S>("marimo-dataframe")
|
|
|
93
94
|
label: z.string().nullish(),
|
|
94
95
|
pageSize: z.number().default(5),
|
|
95
96
|
showDownload: z.boolean().default(true),
|
|
97
|
+
dataframeName: z.string().optional(),
|
|
96
98
|
columns: z
|
|
97
99
|
.array(z.tuple([z.string().or(z.number()), z.string(), z.string()]))
|
|
98
100
|
.transform((value) => {
|
|
@@ -176,6 +178,7 @@ const EMPTY: Transformations = {
|
|
|
176
178
|
export const DataFrameComponent = memo(
|
|
177
179
|
({
|
|
178
180
|
columns,
|
|
181
|
+
dataframeName,
|
|
179
182
|
pageSize,
|
|
180
183
|
showDownload,
|
|
181
184
|
lazy,
|
|
@@ -326,6 +329,7 @@ export const DataFrameComponent = memo(
|
|
|
326
329
|
fieldTypes={field_types}
|
|
327
330
|
rowHeaders={row_headers || Arrays.EMPTY}
|
|
328
331
|
showDownload={showDownload}
|
|
332
|
+
downloadFileName={dataframeName}
|
|
329
333
|
download_as={download_as}
|
|
330
334
|
enableSearch={false}
|
|
331
335
|
showFilters={false}
|