UNPKG

3.83 kBSource Map (JSON)View Raw
1{"version":3,"file":"BaseExtendedPicker.types.js","sourceRoot":"../src/","sources":["components/ExtendedPicker/BaseExtendedPicker.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Autofill } from '../../Autofill';\nimport { IInputProps } from '../../Pickers';\nimport { IBaseFloatingPickerProps } from '../../FloatingPicker';\nimport { IBaseSelectedItemsListProps } from '../../SelectedItemsList';\nimport { IRefObject } from '../../Utilities';\nimport { IFocusZoneProps } from '../../FocusZone';\n\nexport interface IBaseExtendedPicker<T> {\n /** Forces the picker to resolve */\n forceResolve?: () => void;\n /** Gets the current value of the input. */\n items: T[] | undefined;\n /** Sets focus to the input. */\n focus: () => void;\n}\n\n// Type T is the type of the item that is displayed\n// and searched for by the people picker. For example, if the picker is\n// displaying persona's than type T could either be of Persona or Ipersona props\nexport interface IBaseExtendedPickerProps<T> {\n /**\n * Ref of the component\n */\n componentRef?: IRefObject<IBaseExtendedPicker<T>>;\n\n /**\n * Header/title element for the picker\n */\n headerComponent?: JSX.Element;\n\n /**\n * Initial items that have already been selected and should appear in the people picker.\n */\n defaultSelectedItems?: T[];\n\n /**\n * A callback for when the selected list of items changes.\n */\n onChange?: (items?: T[]) => void;\n\n /**\n * A callback for when text is pasted into the input\n */\n onPaste?: (pastedText: string) => T[];\n\n /**\n * A callback for when the user put focus on the picker\n */\n onFocus?: React.FocusEventHandler<HTMLInputElement | Autofill>;\n\n /**\n * A callback for when the user moves the focus away from the picker\n */\n onBlur?: React.FocusEventHandler<HTMLInputElement | Autofill>;\n\n /**\n * ClassName for the picker.\n */\n className?: string;\n\n /**\n * Function that specifies how the floating picker will appear.\n */\n onRenderFloatingPicker: React.ComponentType<IBaseFloatingPickerProps<T>>;\n\n /**\n * Function that specifies how the floating picker will appear.\n */\n onRenderSelectedItems: React.ComponentType<IBaseSelectedItemsListProps<T>>;\n\n /**\n * Floating picker properties\n */\n floatingPickerProps: IBaseFloatingPickerProps<T>;\n\n /**\n * Selected items list properties\n */\n selectedItemsListProps: IBaseSelectedItemsListProps<T>;\n\n /**\n * Autofill input native props\n * @defaultvalue undefined\n */\n inputProps?: IInputProps;\n\n /**\n * Flag for disabling the picker.\n * @defaultvalue false\n */\n disabled?: boolean;\n\n /**\n * Restrict the amount of selectable items.\n * @defaultvalue undefined\n */\n itemLimit?: number;\n\n /**\n * A callback to process a selection after the user selects a suggestion from the picker.\n * The returned item will be added to the selected items list\n */\n onItemSelected?: (selectedItem?: T) => T | PromiseLike<T>;\n\n /**\n * A callback on when an item was added to the selected item list\n */\n onItemAdded?: (addedItem: T) => void;\n\n /**\n * A callback on when an item or items were removed from the selected item list\n */\n onItemsRemoved?: (removedItems: T[]) => void;\n\n /**\n * If using as a controlled component use selectedItems here instead of the SelectedItemsList\n */\n selectedItems?: T[];\n\n /**\n * If using as a controlled component use suggestionItems here instead of FloatingPicker\n */\n suggestionItems?: T[];\n\n /**\n * Focus zone props\n */\n focusZoneProps?: IFocusZoneProps;\n\n /**\n * Current rendered query string that's corealte to current rendered result\n **/\n currentRenderedQueryString?: string;\n}\n"]}
\No newline at end of file