The communications platform that puts data protection first.
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.
 
 
 
 
 
Rocket.Chat/client/views/admin/settings/inputs/MultiSelectSettingInput.sto...

61 lines
1.3 KiB

import { Field } from '@rocket.chat/fuselage';
import { action } from '@storybook/addon-actions';
import React from 'react';
import MultiSelectSettingInput from './MultiSelectSettingInput';
export default {
title: 'admin/settings/inputs/MultiSelectSettingInput',
component: MultiSelectSettingInput,
decorators: [(storyFn) => <Field>{storyFn()}</Field>],
};
const options = [
{ key: '1', i18nLabel: '1' },
{ key: '2', i18nLabel: '2' },
{ key: '3', i18nLabel: '3' },
];
export const _default = () => (
<MultiSelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={options}
onChangeValue={action('changeValue')}
onChangeEditor={action('changeEditor')}
/>
);
export const disabled = () => (
<MultiSelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={options}
disabled
/>
);
export const withValue = () => (
<MultiSelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
value={[
[1, 'Lorem Ipsum'],
[2, 'Lorem Ipsum'],
]}
/>
);
export const withResetButton = () => (
<MultiSelectSettingInput
_id='setting_id'
label='Label'
placeholder='Placeholder'
values={options}
hasResetButton
onChangeValue={action('changeValue')}
onResetButtonClick={action('resetButtonClick')}
/>
);