From 2981cc5e98e12c571f3f3b83a0505780dddf3ce0 Mon Sep 17 00:00:00 2001 From: matt kaufman Date: Wed, 11 Dec 2024 10:16:10 -0500 Subject: [PATCH] add stories --- stories/props/eventIdAccessor.mdx | 10 +++++++ stories/props/eventIdAccessor.stories.js | 33 ++++++++++++++++++++++++ stories/props/storyDefaults.js | 1 + 3 files changed, 44 insertions(+) create mode 100644 stories/props/eventIdAccessor.mdx create mode 100644 stories/props/eventIdAccessor.stories.js diff --git a/stories/props/eventIdAccessor.mdx b/stories/props/eventIdAccessor.mdx new file mode 100644 index 000000000..1d21142aa --- /dev/null +++ b/stories/props/eventIdAccessor.mdx @@ -0,0 +1,10 @@ +import { Canvas, Story } from '@storybook/addon-docs' + +# eventIdAccessor + +- type: `string | function (event: Object) => string` +- default: 'id' + +The id of the event. Must resolve to a string. Used as the key for the event in the DOM. If not provided, the event will be given a key of 'evt\_'. + + diff --git a/stories/props/eventIdAccessor.stories.js b/stories/props/eventIdAccessor.stories.js new file mode 100644 index 000000000..47ff82106 --- /dev/null +++ b/stories/props/eventIdAccessor.stories.js @@ -0,0 +1,33 @@ +import React from 'react' +import { Calendar } from '../../src' +import { accessorStoryArgs } from './storyDefaults' +import mdx from './eventIdAccessor.mdx' + +export default { + title: 'props', + component: Calendar, + argTypes: { + localizer: { control: { type: null } }, + events: { control: { type: null } }, + defaultDate: { + control: { + type: null, + }, + }, + }, + parameters: { + docs: { + page: mdx, + }, + }, +} + +const Template = (args) => ( +
+ +
+) + +export const EventIdAccessor = Template.bind({}) +EventIdAccessor.storyName = 'eventIdAccessor' +EventIdAccessor.args = accessorStoryArgs diff --git a/stories/props/storyDefaults.js b/stories/props/storyDefaults.js index 110ee0fc8..a77d18c70 100644 --- a/stories/props/storyDefaults.js +++ b/stories/props/storyDefaults.js @@ -28,6 +28,7 @@ export const accessorStoryArgs = { titleAccessor: 'label', tooltipAccessor: 'label', startAccessor: 'startDate', + idAccessor: 'id', } /** END Specific to event key accessors */