mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.8 KiB
74 lines
1.8 KiB
import { CommonModule } from '@angular/common';
|
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
import { MatRadioModule } from '@angular/material/radio';
|
|
import { IonIcon } from '@ionic/angular/standalone';
|
|
import { moduleMetadata } from '@storybook/angular';
|
|
import type { Meta, StoryObj } from '@storybook/angular';
|
|
import { addIcons } from 'ionicons';
|
|
import { gridOutline, reorderFourOutline } from 'ionicons/icons';
|
|
|
|
import { GfToggleComponent } from './toggle.component';
|
|
|
|
addIcons({ gridOutline, reorderFourOutline });
|
|
|
|
export default {
|
|
title: 'Toggle',
|
|
component: GfToggleComponent,
|
|
decorators: [
|
|
moduleMetadata({
|
|
imports: [CommonModule, IonIcon, MatRadioModule, ReactiveFormsModule]
|
|
})
|
|
]
|
|
} as Meta<GfToggleComponent>;
|
|
|
|
type Story = StoryObj<GfToggleComponent>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
defaultValue: '1d',
|
|
isDisabled: false,
|
|
isLoading: false,
|
|
options: [
|
|
{ label: 'Today', value: '1d' },
|
|
{ label: 'YTD', value: 'ytd' },
|
|
{ label: '1Y', value: '1y' },
|
|
{ label: '5Y', value: '5y' },
|
|
{ label: 'Max', value: 'max' }
|
|
]
|
|
}
|
|
};
|
|
|
|
export const Disabled: Story = {
|
|
args: {
|
|
defaultValue: '1d',
|
|
isDisabled: true,
|
|
isLoading: false,
|
|
options: [
|
|
{ label: 'Today', value: '1d' },
|
|
{ label: 'YTD', value: 'ytd' },
|
|
{ label: '1Y', value: '1y' },
|
|
{ label: '5Y', value: '5y' },
|
|
{ label: 'Max', value: 'max' }
|
|
]
|
|
}
|
|
};
|
|
|
|
export const WithIcons: Story = {
|
|
args: {
|
|
defaultValue: 'TABLE',
|
|
isDisabled: false,
|
|
isLoading: false,
|
|
options: [
|
|
{
|
|
iconName: 'reorder-four-outline',
|
|
title: 'Table',
|
|
value: 'TABLE'
|
|
},
|
|
{
|
|
iconName: 'grid-outline',
|
|
title: 'Chart',
|
|
value: 'CHART'
|
|
}
|
|
]
|
|
}
|
|
};
|
|
|