mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
add deprecation messages for select and selectV2
This commit is contained in:
parent
92a68f0f49
commit
81864f817d
@ -1,3 +1,4 @@
|
||||
import deprecate from 'util-deprecate';
|
||||
import KnobManager from './KnobManager';
|
||||
|
||||
export const manager = new KnobManager();
|
||||
@ -46,11 +47,17 @@ export function object(name, value) {
|
||||
}
|
||||
|
||||
export function select(name, options, value) {
|
||||
return manager.knob(name, { type: 'select', options, value });
|
||||
return deprecate(
|
||||
manager.knob(name, { type: 'select', options, value }),
|
||||
'in v4 keys/values of the options argument are reversed'
|
||||
);
|
||||
}
|
||||
|
||||
export function selectV2(name, options, value) {
|
||||
return manager.knob(name, { type: 'select', selectV2: true, options, value });
|
||||
return deprecate(
|
||||
manager.knob(name, { type: 'select', selectV2: true, options, value }),
|
||||
'in v4 selectV2 will be renamed to select'
|
||||
);
|
||||
}
|
||||
|
||||
export function array(name, value, separator = ',') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user