import { storiesOf } from '@storybook/angular'; import { withKnobs, text, number, boolean, array, select, color, date, button } from '@storybook/addon-knobs'; import { withNotes } from '@storybook/addon-notes'; import { action, configureActions } from '@storybook/addon-actions'; import { moduleMetadata } from '@storybook/angular'; import { LoaderComponent, ButtonComponent, InputComponent, SvgIconComponent } from '../../src/angular/components'; import { FormElementsModule } from '../../src/angular/form-elements/form-elements.module'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { CommonModule } from '@angular/common'; import { LoaderService } from '../../src/angular/loader/loader.service'; import { LoaderSize } from '../../src/angular/loader/loader.component'; storiesOf('Loader', module) .addDecorator(withKnobs) .addDecorator(withNotes) .addDecorator( moduleMetadata({ declarations: [ LoaderComponent, ButtonComponent, InputComponent, SvgIconComponent ], imports: [ CommonModule, FormsModule, ReactiveFormsModule ], providers: [ LoaderService ] }) ) .add('Relative loader', () => { const _size = select('size', Object.values(LoaderSize), LoaderSize.large); const _name = text('name', 'RelativeLoader'); const _active = boolean('active', false); return { props: { activateLogger: (loader) => { loader.activate(); action('Loader activated')(); }, deactivateLogger: (loader) => { loader.deactivate(); action('Loader deactivated')(); }, _size, _name, _active }, template: `