mirror of https://github.com/Squidex/squidex.git
4 changed files with 96 additions and 3 deletions
@ -1 +1 @@ |
|||||
<img *ngIf="imageSource" [style.width]="imageSize" [style.height]="imageSize" [src]="imageSource | sqxSafeUrl"> |
<img *ngIf="imageSource" [style.width]="imageSize" [style.height]="imageSize" [src]="imageSource | sqxSafeUrl" (error)="unsetImage()"> |
||||
@ -0,0 +1,77 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
||||
|
*/ |
||||
|
|
||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
||||
|
import { moduleMetadata } from '@storybook/angular'; |
||||
|
import { Meta, Story } from '@storybook/angular/types-6-0'; |
||||
|
import { AvatarComponent, SqxFrameworkModule } from '@app/framework'; |
||||
|
|
||||
|
export default { |
||||
|
title: 'Framework/Avatar', |
||||
|
component: AvatarComponent, |
||||
|
argTypes: { |
||||
|
image: { |
||||
|
control: 'text', |
||||
|
}, |
||||
|
identifier: { |
||||
|
control: 'text', |
||||
|
}, |
||||
|
size: { |
||||
|
control: 'number', |
||||
|
}, |
||||
|
}, |
||||
|
decorators: [ |
||||
|
moduleMetadata({ |
||||
|
imports: [ |
||||
|
BrowserAnimationsModule, |
||||
|
SqxFrameworkModule, |
||||
|
SqxFrameworkModule.forRoot(), |
||||
|
], |
||||
|
}), |
||||
|
], |
||||
|
} as Meta; |
||||
|
|
||||
|
const Template: Story<AvatarComponent> = (args: AvatarComponent) => ({ |
||||
|
props: args, |
||||
|
}); |
||||
|
|
||||
|
export const Empty = Template.bind({}); |
||||
|
|
||||
|
Empty.args = { |
||||
|
}; |
||||
|
|
||||
|
export const Image = Template.bind({}); |
||||
|
|
||||
|
Image.args = { |
||||
|
image: 'https://via.placeholder.com/50', |
||||
|
}; |
||||
|
|
||||
|
export const InvalidImage = Template.bind({}); |
||||
|
|
||||
|
InvalidImage.args = { |
||||
|
image: 'https://invalid-url', |
||||
|
}; |
||||
|
|
||||
|
export const Identifier = Template.bind({}); |
||||
|
|
||||
|
Identifier.args = { |
||||
|
identifier: 'image', |
||||
|
}; |
||||
|
|
||||
|
export const Large = Template.bind({}); |
||||
|
|
||||
|
Large.args = { |
||||
|
identifier: 'image', |
||||
|
size: 200, |
||||
|
}; |
||||
|
|
||||
|
export const InvalidImageWithFallback = Template.bind({}); |
||||
|
|
||||
|
InvalidImageWithFallback.args = { |
||||
|
image: 'https://invalid-url', |
||||
|
identifier: 'image', |
||||
|
}; |
||||
Loading…
Reference in new issue