@marimo-team/islands 0.22.1-dev4 → 0.22.1-dev6
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 +84 -72
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/data-table/TableBottomBar.tsx +6 -1
- package/src/components/data-table/charts/charts.tsx +40 -11
- package/src/components/data-table/data-table.tsx +5 -1
- package/src/components/data-table/loading-table.tsx +4 -1
- package/src/css/app/Cell.css +22 -1
- package/src/css/table.css +17 -0
- package/src/plugins/impl/DataTablePlugin.tsx +1 -0
package/dist/main.js
CHANGED
|
@@ -33496,8 +33496,8 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33496
33496
|
function _temp2$23(e, r) {
|
|
33497
33497
|
return e + r;
|
|
33498
33498
|
}
|
|
33499
|
-
const TableBottomBar = ({ pagination: e, totalColumns: r, selection: c, onRowSelectionChange: d, table: f, getRowIds: h, showPageSizeSelector: _, tableLoading: v }) => {
|
|
33500
|
-
let { locale:
|
|
33499
|
+
const TableBottomBar = ({ pagination: e, totalColumns: r, selection: c, onRowSelectionChange: d, table: f, getRowIds: h, showPageSizeSelector: _, tableLoading: v, part: S }) => {
|
|
33500
|
+
let { locale: w } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), E = (e2) => {
|
|
33501
33501
|
if (!d) return;
|
|
33502
33502
|
if (!e2) {
|
|
33503
33503
|
d({});
|
|
@@ -33532,6 +33532,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33532
33532
|
});
|
|
33533
33533
|
};
|
|
33534
33534
|
return (0, import_jsx_runtime.jsxs)("div", {
|
|
33535
|
+
part: S,
|
|
33535
33536
|
className: "flex lg:grid lg:grid-cols-[1fr_auto_1fr] items-center shrink-0 pt-1",
|
|
33536
33537
|
children: [
|
|
33537
33538
|
(0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -33540,12 +33541,12 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33540
33541
|
(0, import_jsx_runtime.jsx)("div", {
|
|
33541
33542
|
className: "flex items-center gap-1",
|
|
33542
33543
|
children: (() => {
|
|
33543
|
-
let { rowSelection: e2, cellSelection: d2 } = f.getState(), h2 = Object.keys(e2).length, _2 = f.getIsAllPageRowsSelected(), v2 = f.getRowCount(), y = h2 === v2,
|
|
33544
|
-
return
|
|
33544
|
+
let { rowSelection: e2, cellSelection: d2 } = f.getState(), h2 = Object.keys(e2).length, _2 = f.getIsAllPageRowsSelected(), v2 = f.getRowCount(), y = h2 === v2, S2 = c === "single-cell" || c === "multi-cell";
|
|
33545
|
+
return S2 && (h2 = d2.length, _2 = false, y = false), _2 && !y ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
33545
33546
|
children: [
|
|
33546
33547
|
(0, import_jsx_runtime.jsxs)("span", {
|
|
33547
33548
|
children: [
|
|
33548
|
-
prettyNumber(h2,
|
|
33549
|
+
prettyNumber(h2, w),
|
|
33549
33550
|
" selected"
|
|
33550
33551
|
]
|
|
33551
33552
|
}),
|
|
@@ -33555,10 +33556,10 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33555
33556
|
variant: "link",
|
|
33556
33557
|
className: "h-4 print:hidden",
|
|
33557
33558
|
onMouseDown: Events.preventFocus,
|
|
33558
|
-
onClick: () =>
|
|
33559
|
+
onClick: () => E(true),
|
|
33559
33560
|
children: [
|
|
33560
33561
|
"Select all ",
|
|
33561
|
-
prettyNumber(v2,
|
|
33562
|
+
prettyNumber(v2, w)
|
|
33562
33563
|
]
|
|
33563
33564
|
})
|
|
33564
33565
|
]
|
|
@@ -33566,7 +33567,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33566
33567
|
children: [
|
|
33567
33568
|
(0, import_jsx_runtime.jsxs)("span", {
|
|
33568
33569
|
children: [
|
|
33569
|
-
prettyNumber(h2,
|
|
33570
|
+
prettyNumber(h2, w),
|
|
33570
33571
|
" selected"
|
|
33571
33572
|
]
|
|
33572
33573
|
}),
|
|
@@ -33577,13 +33578,13 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
|
|
|
33577
33578
|
className: "h-4 print:hidden",
|
|
33578
33579
|
onMouseDown: Events.preventFocus,
|
|
33579
33580
|
onClick: () => {
|
|
33580
|
-
|
|
33581
|
+
S2 ? f.resetCellSelection && f.resetCellSelection() : E(false);
|
|
33581
33582
|
},
|
|
33582
33583
|
children: "Clear selection"
|
|
33583
33584
|
})
|
|
33584
33585
|
]
|
|
33585
33586
|
}) : (0, import_jsx_runtime.jsx)("span", {
|
|
33586
|
-
children: prettifyRowColumnCount(f.getRowCount(), r,
|
|
33587
|
+
children: prettifyRowColumnCount(f.getRowCount(), r, w)
|
|
33587
33588
|
});
|
|
33588
33589
|
})()
|
|
33589
33590
|
}),
|
|
@@ -34202,6 +34203,7 @@ Defaulting to \`null\`.`;
|
|
|
34202
34203
|
(0, import_jsx_runtime.jsxs)(CellSelectionProvider, {
|
|
34203
34204
|
children: [
|
|
34204
34205
|
(0, import_jsx_runtime.jsxs)("div", {
|
|
34206
|
+
part: "table-wrapper",
|
|
34205
34207
|
className: cn(r || "rounded-md border overflow-hidden"),
|
|
34206
34208
|
children: [
|
|
34207
34209
|
(0, import_jsx_runtime.jsx)(TableTopBar, {
|
|
@@ -34238,6 +34240,7 @@ Defaulting to \`null\`.`;
|
|
|
34238
34240
|
]
|
|
34239
34241
|
}),
|
|
34240
34242
|
(0, import_jsx_runtime.jsx)(TableBottomBar, {
|
|
34243
|
+
part: "table-footer",
|
|
34241
34244
|
totalColumns: v,
|
|
34242
34245
|
pagination: e9,
|
|
34243
34246
|
selection: _,
|
|
@@ -36436,6 +36439,7 @@ ${E}`,
|
|
|
36436
36439
|
}), r[5] = h, r[6] = w);
|
|
36437
36440
|
let E;
|
|
36438
36441
|
r[7] !== y || r[8] !== w ? (E = (0, import_jsx_runtime.jsx)("div", {
|
|
36442
|
+
part: "table-wrapper",
|
|
36439
36443
|
className: y,
|
|
36440
36444
|
children: w
|
|
36441
36445
|
}), r[7] = y, r[8] = w, r[9] = E) : E = r[9];
|
|
@@ -43990,68 +43994,71 @@ ${c}
|
|
|
43990
43994
|
return r ? r.length > 0 : false;
|
|
43991
43995
|
}
|
|
43992
43996
|
var import_compiler_runtime$69 = require_compiler_runtime(), NEW_CHART_TYPE = "bar", DEFAULT_TAB_NAME = "table", CHART_HEIGHT = 290, CHART_MAX_ROWS = 5e4, CHART_MAX_COLUMNS = 50;
|
|
43993
|
-
const TablePanel = (e) => {
|
|
43994
|
-
let
|
|
43995
|
-
if (!
|
|
43997
|
+
const TablePanel = ({ cellId: e, data: r, dataTable: c, totalRows: d, columns: f, getDataUrl: h, fieldTypes: _, displayHeader: v, onCloseChartBuilder: y }) => {
|
|
43998
|
+
let [S, w] = useAtom(tabsStorageAtom), E = e ? S.get(e) ?? [] : [], [O, M] = (0, import_react.useState)(DEFAULT_TAB_NAME), [I, z] = (0, import_react.useState)(E.length), G = (0, import_react.useRef)(v);
|
|
43999
|
+
if (v && !G.current && E.length === 0 && e) {
|
|
44000
|
+
G.current = v;
|
|
44001
|
+
let r2 = getChartTabName(0, NEW_CHART_TYPE), c2 = new Map(S);
|
|
44002
|
+
c2.set(e, [
|
|
44003
|
+
{
|
|
44004
|
+
tabName: r2,
|
|
44005
|
+
chartType: NEW_CHART_TYPE,
|
|
44006
|
+
config: getChartDefaults()
|
|
44007
|
+
}
|
|
44008
|
+
]), w(c2), z(1), M(r2);
|
|
44009
|
+
}
|
|
44010
|
+
if (G.current = v, !v || E.length === 0 && !v) return c;
|
|
43996
44011
|
let q = () => {
|
|
43997
|
-
if (!
|
|
43998
|
-
let
|
|
43999
|
-
|
|
44000
|
-
...
|
|
44012
|
+
if (!e) return;
|
|
44013
|
+
let r2 = getChartTabName(I, NEW_CHART_TYPE), c2 = new Map(S);
|
|
44014
|
+
c2.set(e, [
|
|
44015
|
+
...E,
|
|
44001
44016
|
{
|
|
44002
|
-
tabName:
|
|
44017
|
+
tabName: r2,
|
|
44003
44018
|
chartType: NEW_CHART_TYPE,
|
|
44004
44019
|
config: getChartDefaults()
|
|
44005
44020
|
}
|
|
44006
|
-
]),
|
|
44007
|
-
}, Z7 = (
|
|
44008
|
-
if (!
|
|
44009
|
-
let r2 = new Map(
|
|
44010
|
-
|
|
44011
|
-
}, Q7 = (
|
|
44012
|
-
|
|
44013
|
-
|
|
44014
|
-
|
|
44015
|
-
|
|
44016
|
-
|
|
44017
|
-
|
|
44018
|
-
|
|
44019
|
-
|
|
44020
|
-
|
|
44021
|
-
|
|
44022
|
-
if (!c) return;
|
|
44023
|
-
let d2 = w.get(c) ?? [], f2 = d2.findIndex((r3) => r3.tabName === e2);
|
|
44021
|
+
]), w(c2), z(I + 1), M(r2);
|
|
44022
|
+
}, Z7 = (r2) => {
|
|
44023
|
+
if (!e) return;
|
|
44024
|
+
let c2 = E.findIndex((e2) => e2.tabName === r2), d2 = E.filter((e2) => e2.tabName !== r2), f2 = new Map(S);
|
|
44025
|
+
f2.set(e, d2), w(f2), d2.length === 0 ? y == null ? void 0 : y() : r2 === O && (c2 < d2.length ? M(d2[c2].tabName) : M(d2[d2.length - 1].tabName));
|
|
44026
|
+
}, Q7 = ({ tabName: r2, chartType: c2, chartConfig: d2 }) => {
|
|
44027
|
+
if (!e) return;
|
|
44028
|
+
let f2 = new Map(S);
|
|
44029
|
+
f2.set(e, E.map((e2) => e2.tabName === r2 ? {
|
|
44030
|
+
...e2,
|
|
44031
|
+
chartType: c2,
|
|
44032
|
+
config: d2
|
|
44033
|
+
} : e2)), w(f2);
|
|
44034
|
+
}, $7 = (r2, c2) => {
|
|
44035
|
+
if (!e) return;
|
|
44036
|
+
let d2 = S.get(e) ?? [], f2 = d2.findIndex((e2) => e2.tabName === r2);
|
|
44024
44037
|
if (f2 === -1) return;
|
|
44025
|
-
let h2 = d2.map((
|
|
44026
|
-
...
|
|
44027
|
-
chartType:
|
|
44028
|
-
tabName: getChartTabName(f2,
|
|
44029
|
-
} :
|
|
44030
|
-
|
|
44031
|
-
},
|
|
44032
|
-
|
|
44033
|
-
|
|
44034
|
-
className: "text-xs",
|
|
44035
|
-
value: DEFAULT_TAB_NAME,
|
|
44036
|
-
onClick: () => G(DEFAULT_TAB_NAME),
|
|
44037
|
-
children: "Table"
|
|
44038
|
-
}), r[4] = n9) : n9 = r[4];
|
|
44039
|
-
let r9;
|
|
44040
|
-
return r[5] === f ? r9 = r[6] : (r9 = (0, import_jsx_runtime.jsx)(TabsContent, {
|
|
44041
|
-
className: "mt-1 overflow-hidden",
|
|
44042
|
-
value: DEFAULT_TAB_NAME,
|
|
44043
|
-
children: f
|
|
44044
|
-
}), r[5] = f, r[6] = r9), (0, import_jsx_runtime.jsxs)(Tabs, {
|
|
44045
|
-
value: z,
|
|
44038
|
+
let h2 = d2.map((e2) => e2.tabName === r2 ? {
|
|
44039
|
+
...e2,
|
|
44040
|
+
chartType: c2,
|
|
44041
|
+
tabName: getChartTabName(f2, c2)
|
|
44042
|
+
} : e2);
|
|
44043
|
+
w(new Map(S).set(e, h2)), M(h2[f2].tabName);
|
|
44044
|
+
}, e9 = d === "too_many" || d > CHART_MAX_ROWS || f > CHART_MAX_COLUMNS;
|
|
44045
|
+
return (0, import_jsx_runtime.jsxs)(Tabs, {
|
|
44046
|
+
value: O,
|
|
44046
44047
|
className: "-mt-1",
|
|
44047
44048
|
children: [
|
|
44048
44049
|
(0, import_jsx_runtime.jsxs)(TabsList, {
|
|
44050
|
+
part: "table-tabs",
|
|
44049
44051
|
children: [
|
|
44050
|
-
|
|
44051
|
-
|
|
44052
|
+
(0, import_jsx_runtime.jsx)(TabsTrigger, {
|
|
44053
|
+
className: "text-xs",
|
|
44054
|
+
value: DEFAULT_TAB_NAME,
|
|
44055
|
+
onClick: () => M(DEFAULT_TAB_NAME),
|
|
44056
|
+
children: "Table"
|
|
44057
|
+
}),
|
|
44058
|
+
E.map((e2, r2) => (0, import_jsx_runtime.jsxs)(TabsTrigger, {
|
|
44052
44059
|
className: "text-xs",
|
|
44053
44060
|
value: e2.tabName,
|
|
44054
|
-
onClick: () =>
|
|
44061
|
+
onClick: () => M(e2.tabName),
|
|
44055
44062
|
children: [
|
|
44056
44063
|
e2.tabName,
|
|
44057
44064
|
(0, import_jsx_runtime.jsx)(X, {
|
|
@@ -44071,29 +44078,33 @@ ${c}
|
|
|
44071
44078
|
})
|
|
44072
44079
|
]
|
|
44073
44080
|
}),
|
|
44074
|
-
|
|
44075
|
-
|
|
44081
|
+
(0, import_jsx_runtime.jsx)(TabsContent, {
|
|
44082
|
+
className: "mt-1 overflow-hidden",
|
|
44083
|
+
value: DEFAULT_TAB_NAME,
|
|
44084
|
+
children: c
|
|
44085
|
+
}),
|
|
44086
|
+
E.map((e2, d2) => (0, import_jsx_runtime.jsx)(TabsContent, {
|
|
44076
44087
|
value: e2.tabName,
|
|
44077
44088
|
className: "h-[400px] mt-1",
|
|
44078
44089
|
children: (0, import_jsx_runtime.jsx)(ChartPanel, {
|
|
44079
|
-
tableData:
|
|
44090
|
+
tableData: r,
|
|
44080
44091
|
chartConfig: e2.config,
|
|
44081
44092
|
chartType: e2.chartType,
|
|
44082
|
-
saveChart: (
|
|
44093
|
+
saveChart: (r2) => {
|
|
44083
44094
|
Q7({
|
|
44084
44095
|
tabName: e2.tabName,
|
|
44085
44096
|
chartType: e2.chartType,
|
|
44086
|
-
chartConfig:
|
|
44097
|
+
chartConfig: r2
|
|
44087
44098
|
});
|
|
44088
44099
|
},
|
|
44089
|
-
saveChartType: (
|
|
44090
|
-
|
|
44100
|
+
saveChartType: (r2) => {
|
|
44101
|
+
$7(e2.tabName, r2);
|
|
44091
44102
|
},
|
|
44092
|
-
getDataUrl:
|
|
44093
|
-
fieldTypes:
|
|
44094
|
-
isLargeDataset:
|
|
44103
|
+
getDataUrl: h,
|
|
44104
|
+
fieldTypes: _ ?? inferFieldTypes(c.props.data),
|
|
44105
|
+
isLargeDataset: e9
|
|
44095
44106
|
})
|
|
44096
|
-
},
|
|
44107
|
+
}, d2))
|
|
44097
44108
|
]
|
|
44098
44109
|
});
|
|
44099
44110
|
};
|
|
@@ -45918,6 +45929,7 @@ ${c}
|
|
|
45918
45929
|
let j9 = A9, M9;
|
|
45919
45930
|
r[91] !== d || r[92] !== j9 || r[93] !== (o9 == null ? void 0 : o9.rows) || r[94] !== Z7 || r[95] !== e.fieldTypes || r[96] !== e.get_data_url || r[97] !== e.showChartBuilder || r[98] !== e.totalColumns || r[99] !== e.totalRows ? (M9 = e.showChartBuilder ? (0, import_jsx_runtime.jsx)(TablePanel, {
|
|
45920
45931
|
displayHeader: Z7,
|
|
45932
|
+
onCloseChartBuilder: () => Q7(false),
|
|
45921
45933
|
data: (o9 == null ? void 0 : o9.rows) || [],
|
|
45922
45934
|
columns: e.totalColumns,
|
|
45923
45935
|
totalRows: e.totalRows,
|
|
@@ -65415,7 +65427,7 @@ ${c}
|
|
|
65415
65427
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
65416
65428
|
}
|
|
65417
65429
|
}
|
|
65418
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-
|
|
65430
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-dev6"), showCodeInRunModeAtom = atom(true);
|
|
65419
65431
|
atom(null);
|
|
65420
65432
|
var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
|
|
65421
65433
|
constructor() {
|