Skip to content

Commit 6531e85

Browse files
Scheduler: Add Resources Column Layout story with customizable column count
1 parent 4feac3e commit 6531e85

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

apps/react-storybook/stories/scheduler/SchedulerFormCustomization.stories.tsx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,70 @@ export const CustomizeExistingItems: Story = {
323323
},
324324
};
325325

326+
interface ResourcesColumnLayoutArgs extends Properties {
327+
resourcesColCount: number;
328+
}
329+
330+
export const ResourcesColumnLayout: Story = {
331+
args: {
332+
resourcesColCount: 2,
333+
...baseConfig,
334+
resources,
335+
} as ResourcesColumnLayoutArgs,
336+
argTypes: {
337+
resourcesColCount: {
338+
control: { type: "select" },
339+
options: [1, 2, 3],
340+
},
341+
...iconsShowModeArgType,
342+
} as Record<string, unknown>,
343+
render: (args: ResourcesColumnLayoutArgs) => {
344+
return (
345+
<Scheduler
346+
{...baseConfig}
347+
resources={resources}
348+
editing={
349+
{
350+
form: {
351+
onInitialized: (e) => {
352+
console.log(e.component.option("items"));
353+
},
354+
items: [
355+
{
356+
name: "mainGroup",
357+
items: [
358+
"subjectGroup",
359+
"dateGroup",
360+
"repeatGroup",
361+
{
362+
name: "resourcesGroup",
363+
items: [
364+
"resourcesGroupIcon",
365+
{
366+
name: "resourcesGroupContent",
367+
colCount: args.resourcesColCount,
368+
items: [
369+
"roomId",
370+
"priorityId",
371+
{ name: "assigneeId", colSpan: 2 },
372+
],
373+
},
374+
],
375+
},
376+
"descriptionGroup",
377+
],
378+
},
379+
],
380+
iconsShowMode: args["editing.form.iconsShowMode"],
381+
},
382+
} as Properties["editing"]
383+
}
384+
/>
385+
);
386+
},
387+
};
388+
389+
326390
export const RTL: Story = {
327391
args: {
328392
...baseConfig,

0 commit comments

Comments
 (0)