mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-03 05:04:51 +08:00
Merge pull request #10101 from davidcsally/allow-undefined-knobs
Addon-knobs: Allow `text` and `number` to take undefined values
This commit is contained in:
commit
c5bd44f1e8
@ -14,11 +14,8 @@ export interface NumberTypeKnobOptions {
|
||||
step?: number;
|
||||
}
|
||||
|
||||
export interface NumberTypeKnob
|
||||
extends KnobControlConfig<NumberTypeKnobValue>,
|
||||
NumberTypeKnobOptions {
|
||||
value: NumberTypeKnobValue;
|
||||
}
|
||||
export type NumberTypeKnob = KnobControlConfig<NumberTypeKnobValue> &
|
||||
NumberTypeKnobOptions & { value?: NumberTypeKnobValue };
|
||||
|
||||
interface NumberTypeProps extends KnobControlProps<NumberTypeKnobValue | null> {
|
||||
knob: NumberTypeKnob;
|
||||
|
@ -5,7 +5,7 @@ import { Form } from '@storybook/components';
|
||||
import { KnobControlConfig, KnobControlProps } from './types';
|
||||
|
||||
type TextTypeKnobValue = string;
|
||||
export type TextTypeKnob = KnobControlConfig<TextTypeKnobValue>;
|
||||
export type TextTypeKnob = KnobControlConfig<TextTypeKnobValue> & { value?: TextTypeKnobValue };
|
||||
type TextTypeProps = KnobControlProps<TextTypeKnobValue>;
|
||||
|
||||
export default class TextType extends Component<TextTypeProps> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user