/* eslint-disable no-console */
import React from "react";
import { DataEditorAll as DataEditor } from "../../data-editor-all.js";
import {
BeautifulWrapper,
Description,
MoreInfo,
useMockDataGenerator,
defaultProps,
} from "../../data-editor/stories/utils.js";
import { SimpleThemeWrapper } from "../../stories/story-utils.js";
export default {
title: "Glide-Data-Grid/DataEditor Demos",
decorators: [
(Story: React.ComponentType) => (
The data grid should respect being obscured by other elements
This is mostly a test area because its hard to test with unit tests.
>
}>
),
],
};
export const ObscuredDataGrid: React.VFC = () => {
const { cols, getCellContent, setCellValue } = useMockDataGenerator(60, false);
return (
console.log("onItemHovered", x)}
onCellClicked={x => console.log("onCellClicked", x)}
onHeaderClicked={x => console.log("onHeaderClicked", x)}
onCellContextMenu={x => console.log("onCellContextMenu", x)}
onHeaderContextMenu={x => console.log("onHeaderContextMenu", x)}
columns={cols}
rowMarkers={"both"}
onPaste={true} // we want to allow paste to just call onCellEdited
onCellEdited={setCellValue} // Sets the mock cell content
trailingRowOptions={{
// How to get the trailing row to look right
sticky: true,
tint: true,
hint: "New row...",
}}
rows={10_000}
/>
);
};