office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
1 lines • 6.21 kB
JavaScript
module.exports = "import * as React from 'react';\nimport {\n GroupedList\n} from './GroupedList';\nimport {\n IListProps\n} from '../List';\nimport { IRenderFunction } from '../../common/IRenderFunction';\nimport {\n IDragDropContext,\n IDragDropEvents,\n IDragDropHelper\n} from '../../utilities/dragdrop/index';\nimport {\n ISelection,\n SelectionMode\n} from '../../utilities/selection/index';\nimport { IViewport } from '../../utilities/decorators/withViewport';\n\nexport interface IGroupedList {\n /**\n * Ensures that the list content is updated. Call this in cases where the list prop updates don't change, but the list\n * still needs to be re-evaluated. For example, if a sizer bar is adjusted and causes the list width to change, you can\n * call this to force a re-evaluation. Be aware that this can be an expensive operation and should be done sparingly.\n */\n forceUpdate: () => void;\n\n /**\n * Toggles the collapsed state of all the groups in the list.\n */\n toggleCollapseAll: (allCollapsed: boolean) => void;\n}\n\nexport interface IGroupedListProps extends React.Props<GroupedList> {\n /** Optional class name to add to the root element. */\n className?: string;\n\n /** Map of callback functions related to drag and drop functionality. */\n dragDropEvents?: IDragDropEvents;\n\n /** helper to manage drag/drop across item and groups */\n dragDropHelper?: IDragDropHelper;\n\n /** Event names and corresponding callbacks that will be registered to groups and rendered elements */\n eventsToRegister?: [{ eventName: string, callback: (context: IDragDropContext, event?: any) => void }];\n\n /** Optional override properties to render groups. */\n groupProps?: IGroupRenderProps;\n\n /** Optional grouping instructions. */\n groups?: IGroup[];\n\n /** List of items to render. */\n items: any[];\n\n /** Optional properties to pass through to the list components being rendered. */\n listProps?: IListProps;\n\n /** Rendering callback to render the group items. */\n onRenderCell: (\n nestingDepth?: number,\n item?: any,\n index?: number\n ) => React.ReactNode;\n\n /** Optional selection model to track selection state. */\n selection?: ISelection;\n\n /** Controls how/if the list manages selection. */\n selectionMode?: SelectionMode;\n\n /** Optional Viewport, provided by the parent component. */\n viewport?: IViewport;\n\n /** Optional callback when the group expand state changes between all collapsed and at least one group is expanded. */\n onGroupExpandStateChanged?: (isSomeGroupExpanded: boolean) => void;\n}\n\nexport interface IGroup {\n /**\n * Unique identifier for the group.\n */\n key: string;\n\n /**\n * Display name for the group, rendered on the header.\n */\n name: string;\n\n /**\n * Start index for the group within the given items.\n */\n startIndex: number;\n\n /**\n * How many items should be rendered within the group.\n */\n count: number;\n\n /**\n * Nested groups, if any.\n */\n children?: IGroup[];\n\n /**\n * Number indicating the level of nested groups.\n */\n level?: number;\n\n /**\n * @deprecated\n * This is no longer supported. Selection state will be controled by the selection store only. Will be removed in 1.0.0.\n */\n isSelected?: boolean;\n\n /**\n * If all the items in the group are collapsed.\n */\n isCollapsed?: boolean;\n\n /**\n * If the items within the group are summarized or showing all.\n */\n isShowingAll?: boolean;\n\n /**\n * If drag/drop is enabled for the group header.\n */\n isDropEnabled?: boolean;\n\n /**\n * Arbitrary data required to be preserved by the caller.\n */\n data?: any;\n\n /**\n * Optional accessibility label (aria-label) attribute that will be stamped on to the element.\n * If none is specified, the arai-label attribute will contain the group name\n */\n ariaLabel?: string;\n}\n\nexport interface IGroupRenderProps {\n /** Boolean indicating if all groups are in collapsed state. */\n isAllGroupsCollapsed?: boolean;\n\n /** Grouping item limit. */\n getGroupItemLimit?: (group: IGroup) => number;\n\n /** Callback for when all groups are expanded or collapsed. */\n onToggleCollapseAll?: (isAllCollapsed: boolean) => void;\n\n /** Information to pass in to the group header. */\n headerProps?: IGroupDividerProps;\n\n /** Information to pass in to the group footer. */\n footerProps?: IGroupDividerProps;\n\n /**\n * Override which allows the caller to provide a custom header.\n */\n onRenderHeader?: IRenderFunction<IGroupDividerProps>;\n\n /**\n * Override which allows the caller to provider a customer footer.\n */\n onRenderFooter?: IRenderFunction<IGroupDividerProps>;\n}\n\nexport interface IGroupDividerProps {\n /** Callback to determine if a group has missing items and needs to load them from the server. */\n isGroupLoading?: (group: IGroup) => boolean;\n\n /** Text shown on group headers to indicate the group is being loaded. */\n loadingText?: string;\n\n /** The group to be rendered by the header. */\n group?: IGroup;\n\n /** The index of the group. */\n groupIndex?: number;\n\n /** The indent level of the group. */\n groupLevel?: number;\n\n /** If all items in the group are selected. */\n isSelected?: boolean;\n\n /** A reference to the viewport in which the header is rendered. */\n viewport?: IViewport;\n\n /** The selection mode of the list the group lives within. */\n selectionMode?: SelectionMode;\n\n /** Text to display for the group footer show all link. */\n showAllLinkText?: string;\n\n /** Callback for when the \"Show All\" link in group footer is clicked */\n onToggleSummarize?: (group: IGroup) => void;\n\n /** Callback for when the group header is clicked. */\n onGroupHeaderClick?: (group: IGroup) => void;\n\n /** Callback for when the group is expanded or collapsed. */\n onToggleCollapse?: (group: IGroup) => void;\n\n /** Callback for when the group is selected. */\n onToggleSelectGroup?: (group: IGroup) => void;\n\n /** Determines if the group selection check box is shown for collapsed groups. */\n isCollapsedGroupSelectVisible?: boolean;\n}\n";