-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add min max and disabled props to input counter (#1154)
* fix: add min max and disabled props to input counter * fix: do not set count as min value when it is passed * chore: improve coverage * style: fix button borders and hover inside counter wrapper * feat: allowing set max of digits
- Loading branch information
1 parent
bf91fb9
commit 19f5e6c
Showing
6 changed files
with
136 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,50 @@ | ||
import { Meta } from '@storybook/angular/types-6-0'; | ||
import { moduleMetadata, Story } from '@storybook/angular'; | ||
import { Meta, StoryObj } from '@storybook/angular/types-6-0'; | ||
import { moduleMetadata } from '@storybook/angular'; | ||
import { IonInputCounterComponent } from '../projects/ion/src/lib/input-counter/input-counter.component'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { IonButtonModule } from '../projects/ion/src/lib/button/button.module'; | ||
import { InputCountSize } from 'ion/public-api'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
export default { | ||
title: 'Ion/Data Entry/Input-Counter', | ||
component: IonInputCounterComponent, | ||
argTypes: { | ||
inputSize: { | ||
options: ['sm', 'md'] as InputCountSize[], | ||
control: { type: 'radio' }, | ||
}, | ||
}, | ||
decorators: [ | ||
moduleMetadata({ | ||
imports: [FormsModule, IonButtonModule], | ||
imports: [FormsModule, IonButtonModule, CommonModule], | ||
declarations: [], | ||
}), | ||
], | ||
} as Meta; | ||
} as Meta<IonInputCounterComponent>; | ||
|
||
const Template: Story<IonInputCounterComponent> = ( | ||
args: IonInputCounterComponent | ||
) => ({ | ||
component: IonInputCounterComponent, | ||
props: args, | ||
}); | ||
type Story = StoryObj<IonInputCounterComponent>; | ||
|
||
export const Medium: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const Small: Story = { | ||
args: { | ||
inputSize: 'sm', | ||
}, | ||
}; | ||
|
||
export const Small = Template.bind({}); | ||
Small.args = { | ||
InputSize: 'sm', | ||
export const Disabled: Story = { | ||
args: { | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const Medium = Template.bind({}); | ||
Medium.args = { | ||
InputSize: 'md', | ||
export const WithMaxAndMinValues: Story = { | ||
name: 'With max and min values', | ||
args: { | ||
maxValue: 100, | ||
minValue: 1, | ||
}, | ||
}; |