Skip to content

Commit

Permalink
Add row marker stories
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Feb 3, 2023
1 parent a1c19df commit 54061c6
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions packages/core/src/docs/examples/row-markers.stories.tsx
@@ -0,0 +1,58 @@
import React from "react";
import { DataEditor, DataEditorProps } from "../../data-editor/data-editor";
import {
BeautifulWrapper,
Description,
PropName,
useMockDataGenerator,
defaultProps,
} from "../../data-editor/stories/utils";
import { SimpleThemeWrapper } from "../../stories/story-utils";

export default {
title: "Glide-Data-Grid/DataEditor Demos",

decorators: [
(Story: React.ComponentType) => (
<SimpleThemeWrapper>
<BeautifulWrapper
title="Row markers"
description={
<>
<Description>
Row Markers can be controlled by setting the <PropName>rowMarkers</PropName> prop.
</Description>
</>
}>
<Story />
</BeautifulWrapper>
</SimpleThemeWrapper>
),
],
};

interface RowMarkersProps {
markers: DataEditorProps["rowMarkers"];
}

export const RowMarkers: React.VFC<RowMarkersProps> = p => {
const { cols, getCellContent } = useMockDataGenerator(10, false);

return (
<DataEditor
{...defaultProps}
getCellContent={getCellContent}
rowMarkers={p.markers}
columns={cols}
rows={400}
/>
);
};
(RowMarkers as any).args = {
markers: "both",
};
(RowMarkers as any).argTypes = {
markers: {
control: { type: "select", options: ["both", "checkbox", "number", "none", "clickable-number"] },
},
};

0 comments on commit 54061c6

Please sign in to comment.