I am trying to use Storybook for an Angular project. The Angular project is utilizing Kendo UI's kendo grid elements throughout component templates.
The issue is any piece of a component template using a kendo element does not show in the Storybook interface when I am running it. If I change to standard html elements, the data does display as expected.
What do I have setup incorrectly that is preventing these custom elements from displaying in Storybook?
Any help or ideas would be appreciated and am happy to provide more context to anything. Some code samples below.
Versions
@angular/core - ^12.1.0<br/>
@progress/kendo-angular-grid - ^5.4.0<br/>
@storybook/angular - ^6.3.4
.storybook/main.js file
component story
component template file
The issue is any piece of a component template using a kendo element does not show in the Storybook interface when I am running it. If I change to standard html elements, the data does display as expected.
What do I have setup incorrectly that is preventing these custom elements from displaying in Storybook?
Any help or ideas would be appreciated and am happy to provide more context to anything. Some code samples below.
Versions
@angular/core - ^12.1.0<br/>
@progress/kendo-angular-grid - ^5.4.0<br/>
@storybook/angular - ^6.3.4
.storybook/main.js file
module.exports = { "stories": [ "../src/**/*.story.mdx", "../src/**/*.story.@(js|jsx|ts|tsx)" ], "addons": [ "@storybook/addon-links", "@storybook/addon-essentials", ], "core": { "builder": "webpack5" } }
component story
import { HttpClientModule } from '@angular/common/http';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { RouterTestingModule } from '@angular/router/testing';
import { moduleMetadata } from '@storybook/angular';
import { Story, Meta } from '@storybook/angular/types-6-0';
import DocumentsComponent from './documents.component';
export default {
title: 'Components/Pages/Documents',
component: DocumentsComponent,
argTypes: {},
decorators: [
moduleMetadata({
imports: [HttpClientModule, RouterTestingModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}),
],
} as Meta;
const Template: Story<DocumentsComponent> = (args: DocumentsComponent) => ({
props: args,
});
export const DocumentsList = Template.bind({});
component template file
<div class="documents">
<button kendoButton (click)="addNew()" class="add-new" icon="plus" look="flat">Add New</button>
<h1>Documents</h1>
<!-- start block added to confirm data was available when rendering -->
<div *ngFor="let data of gridData">
<h2>{{data.id}}</h2>
</div>
<!-- end block added to confirm data was available when rendering -->
<kendo-grid
[data]="gridData"
[sort]="sort"
[sortable]="{ allowUnsort: true, mode: 'multiple' }"
(sortChange)="sortChange($event)"
>
<kendo-grid-column field="id" title="ID" [width]="100"> </kendo-grid-column>
<kendo-grid-column field="assignee.username" title="Assignee" [width]="100"> </kendo-grid-column>
<kendo-grid-column field="status" title="Status" [width]="120">
...