/*! Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. */ import * as React from 'react'; import Screener from 'screener-storybook/src/screener'; import { storiesOf } from '@storybook/react'; import { FabricDecorator } from '../utilities'; import { Dropdown, DropdownMenuItemType, IDropdownProps, Icon, IDropdownOption, } from 'office-ui-fabric-react'; storiesOf('Dropdown', module) .addDecorator(FabricDecorator) .addDecorator(story => ( {story()} )) .addStory( 'Root', () => ( ), { rtl: true }, ) .addStory('Disabled option selected', () => ( )) .addStory( 'Multiselect', () => ( ), { rtl: true }, ) .addStory( 'Custom Dropdown', () => ( { return (
); }} onRenderTitle={(options: IDropdownOption[]): JSX.Element => { const option = options[0]; return (
{option.data && option.data.icon && (
); }} onRenderOption={(option: IDropdownOption): JSX.Element => { return (
{option.data && option.data.icon && (
); }} onRenderCaretDown={(props: IDropdownProps): JSX.Element => { return ; }} options={[ { key: 'Header', text: 'Actions', itemType: DropdownMenuItemType.Header }, { key: 'A', text: 'Option a', data: { icon: 'Memo' } }, { key: 'B', text: 'Option b', data: { icon: 'Print' } }, { key: 'C', text: 'Option c', data: { icon: 'ShoppingCart' } }, { key: 'D', text: 'Option d', data: { icon: 'Train' } }, { key: 'E', text: 'Option e', data: { icon: 'Repair' } }, { key: 'divider_2', text: '-', itemType: DropdownMenuItemType.Divider }, { key: 'Header2', text: 'People', itemType: DropdownMenuItemType.Header }, { key: 'F', text: 'Option f', data: { icon: 'Running' } }, { key: 'G', text: 'Option g', data: { icon: 'EmojiNeutral' } }, { key: 'H', text: 'Option h', data: { icon: 'ChatInviteFriend' } }, { key: 'I', text: 'Option i', data: { icon: 'SecurityGroup' } }, { key: 'J', text: 'Option j', data: { icon: 'AddGroup' } }, ]} /> ), { rtl: true }, ) .addStory('Required', () => ( )) .addStory('Required without label', () => ( )); storiesOf('Dropdown Disabled', module) .addDecorator(FabricDecorator) .addDecorator(story => ( {story()} )) .addStory('Root', () => ( ));