diff options
Diffstat (limited to 'public/src/stories')
-rw-r--r-- | public/src/stories/button.stories.ts | 33 | ||||
-rw-r--r-- | public/src/stories/diagram.stories.ts | 22 | ||||
-rw-r--r-- | public/src/stories/index.ts | 1 | ||||
-rw-r--r-- | public/src/stories/loader.stories.ts | 6 | ||||
-rw-r--r-- | public/src/stories/sdc-dropdown.stories.ts | 0 | ||||
-rw-r--r-- | public/src/stories/select-autocomplete.stories.ts | 25 | ||||
-rw-r--r-- | public/src/stories/treeSelect.stories.ts | 40 |
7 files changed, 127 insertions, 0 deletions
diff --git a/public/src/stories/button.stories.ts b/public/src/stories/button.stories.ts new file mode 100644 index 0000000..80411e8 --- /dev/null +++ b/public/src/stories/button.stories.ts @@ -0,0 +1,33 @@ +import { storiesOf } from '@storybook/angular'; +import { action } from '@storybook/addon-actions'; +import { boolean, text } from '@storybook/addon-knobs/angular'; +import { MatButtonModule, MatIconModule } from '@angular/material'; + +storiesOf('Button', module) + .add('Basic', () => ({ + template: ` + <div style="margin:2em;"> + <button mat-raised-button color="primary" (click)="onClick($event)">primary</button> + <button mat-raised-button color="primary" [disabled]="disabled">disabled</button> + <button mat-raised-button class="btn-secondry"> {{ btnText }} </button> + </div> + `, + props: { + disabled: boolean('disabled', true), + btnText: text('btnText', 'secondry'), + onClick: action('click') + }, + moduleMetadata: { + imports: [MatButtonModule] + } + })) + .add('Round', () => ({ + template: ` + <button mat-mini-fab style="background-color:#009FDB"> + <mat-icon class="material-icons">add</mat-icon> + </button> + `, + moduleMetadata: { + imports: [MatButtonModule, MatIconModule] + } + })); diff --git a/public/src/stories/diagram.stories.ts b/public/src/stories/diagram.stories.ts new file mode 100644 index 0000000..00dd922 --- /dev/null +++ b/public/src/stories/diagram.stories.ts @@ -0,0 +1,22 @@ +import { storiesOf } from '@storybook/angular'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { DiagramComponent } from '../app/diagram/diagram.component'; +import { array } from '@storybook/addon-knobs/angular'; + +storiesOf('Diagram', module).add('simple', () => ({ + component: DiagramComponent, + moduleMetadata: { + imports: [], + schemas: [NO_ERRORS_SCHEMA], + declarations: [], + providers: [] + }, + props: { + list: array('list', [ + { source: 'node1dsvsdsvd', target: 'node2' }, + { source: 'node3', target: 'node4' }, + { source: 'node5', target: 'nodedsvsds6' }, + { source: 'node7', target: 'node8' } + ]) + } +})); diff --git a/public/src/stories/index.ts b/public/src/stories/index.ts new file mode 100644 index 0000000..5c1c18f --- /dev/null +++ b/public/src/stories/index.ts @@ -0,0 +1 @@ +declare module '*.md'; diff --git a/public/src/stories/loader.stories.ts b/public/src/stories/loader.stories.ts new file mode 100644 index 0000000..38d6f90 --- /dev/null +++ b/public/src/stories/loader.stories.ts @@ -0,0 +1,6 @@ +import { storiesOf } from '@storybook/angular'; +import { LoaderComponent } from '../app/loader/loader.component'; + +storiesOf('Loader', module).add('simple loader', () => ({ + component: LoaderComponent +})); diff --git a/public/src/stories/sdc-dropdown.stories.ts b/public/src/stories/sdc-dropdown.stories.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/src/stories/sdc-dropdown.stories.ts diff --git a/public/src/stories/select-autocomplete.stories.ts b/public/src/stories/select-autocomplete.stories.ts new file mode 100644 index 0000000..104f0b1 --- /dev/null +++ b/public/src/stories/select-autocomplete.stories.ts @@ -0,0 +1,25 @@ +import { storiesOf } from '@storybook/angular'; +import { action } from '@storybook/addon-actions'; +import { boolean, text, array } from '@storybook/addon-knobs/angular'; +import { NgSelectModule } from '@ng-select/ng-select'; + +storiesOf('select-autocomplete', module).add('select', () => ({ + template: ` + <ng-select [items]="cities" + bindLabel="name" + bindValue="id" + placeholder="Select city" + [(ngModel)]="selectedCityId"> + </ng-select> + `, + props: { + cities: array('cities', [ + { id: 1, name: 'Vilnius' }, + { id: 2, name: 'Kaunas' }, + { id: 3, name: 'PabradÄ—' } + ]) + }, + moduleMetadata: { + imports: [NgSelectModule] + } +})); diff --git a/public/src/stories/treeSelect.stories.ts b/public/src/stories/treeSelect.stories.ts new file mode 100644 index 0000000..9d34c6b --- /dev/null +++ b/public/src/stories/treeSelect.stories.ts @@ -0,0 +1,40 @@ +import { storiesOf } from '@storybook/angular'; +import { TreeModule } from 'angular-tree-component'; +import { MatButtonModule, MatIconModule } from '@angular/material'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { TargetComponent } from '../app/rule-engine/target/target.component'; + +storiesOf('Target', module).add('target component', () => ({ + component: TargetComponent, + moduleMetadata: { + imports: [ + TreeModule, + MatButtonModule, + MatIconModule, + BrowserAnimationsModule + ] + }, + props: { + nodes: [ + { + name: 'commonEventHeader', + children: [ + { + name: 'domain', + children: null, + isRequired: true, + requiredChildren: null, + id: 'event.commonEventHeader.domain' + }, + { + name: 'eventId', + children: null, + isRequired: true, + requiredChildren: null, + id: 'event.commonEventHeader.eventId' + } + ] + } + ] + } +})); |