UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

1 lines 5.53 kB
define([], function() { return "import * as React from 'react';\r\nimport { DocumentCard } from './DocumentCard';\r\nimport { DocumentCardTitle } from './DocumentCardTitle';\r\nimport { DocumentCardPreview } from './DocumentCardPreview';\r\nimport { DocumentCardLocation } from './DocumentCardLocation';\r\nimport { DocumentCardActivity } from './DocumentCardActivity';\r\nimport { DocumentCardActions } from './DocumentCardActions';\r\nimport { PersonaInitialsColor } from '../../Persona';\r\nimport { ImageFit } from '../../Image';\r\nimport { IButtonProps } from '../../Button';\r\n\r\nexport interface IDocumentCardProps extends React.Props<DocumentCard> {\r\n /**\r\n * The type of DocumentCard to display.\r\n * @default DocumentCardType.normal\r\n */\r\n type?: DocumentCardType;\r\n\r\n /**\r\n * Function to call when the card is clicked.\r\n */\r\n onClick?: (ev?: React.MouseEvent<HTMLElement>) => void;\r\n\r\n /**\r\n * A URL to navigate to when the card is clicked. If a function has also been provided,\r\n * it will be used instead of the URL.\r\n */\r\n onClickHref?: string;\r\n\r\n /**\r\n * Optional class for document card.\r\n */\r\n className?: string;\r\n\r\n /**\r\n * Hex color value of the line below the card, which should correspond to the document type.\r\n * This should only be supplied when using the 'compact' card layout.\r\n */\r\n accentColor?: string;\r\n}\r\n\r\nexport enum DocumentCardType {\r\n /**\r\n * Standard DocumentCard.\r\n */\r\n normal,\r\n /**\r\n * Compact layout. Displays the preview beside the details, rather than above.\r\n */\r\n compact\r\n}\r\n\r\nexport interface IDocumentCardPreviewProps extends React.Props<DocumentCardPreview> {\r\n /**\r\n * One or more preview images to display.\r\n */\r\n previewImages: IDocumentCardPreviewImage[];\r\n\r\n /**\r\n * The function return string that will describe the number of overflow documents.\r\n * such as (overflowCount: number) => `+${ overflowCount } more`,\r\n */\r\n getOverflowDocumentCountText?: (overflowCount: number) => string;\r\n}\r\n\r\nexport interface IDocumentCardPreviewImage {\r\n /**\r\n * File name for the document this preview represents.\r\n */\r\n name?: string;\r\n\r\n /**\r\n * URL to view the file.\r\n */\r\n url?: string;\r\n\r\n /**\r\n * Path to the preview image.\r\n */\r\n previewImageSrc?: string;\r\n\r\n /**\r\n * Path to the image to display if the preview image won't load.\r\n */\r\n errorImageSrc?: string;\r\n\r\n /**\r\n * Path to the icon associated with this document type.\r\n */\r\n iconSrc?: string;\r\n\r\n /**\r\n * If provided, forces the preview image to be this width.\r\n */\r\n width?: number;\r\n\r\n /**\r\n * If provided, forces the preview image to be this height.\r\n */\r\n height?: number;\r\n\r\n /**\r\n * Used to determine how to size the image to fit the dimensions of the component.\r\n * If both dimensions are provided, then the image is fit using ImageFit.scale, otherwise ImageFit.none is used.\r\n */\r\n imageFit?: ImageFit;\r\n\r\n /**\r\n * Hex color value of the line below the preview, which should correspond to the document type.\r\n */\r\n accentColor?: string;\r\n}\r\n\r\nexport interface IDocumentCardTitleProps extends React.Props<DocumentCardTitle> {\r\n /**\r\n * Title text. If the card represents more than one document, this should be the title of one document and a \"+X\" string. For example, a collection of four documents would have a string of \"Document.docx +3\".\r\n */\r\n title: string;\r\n\r\n /**\r\n * Whether we truncate the title to fit within the box. May have a performance impact.\r\n * @defaultvalue true\r\n */\r\n shouldTruncate?: boolean;\r\n}\r\n\r\nexport interface IDocumentCardLocationProps extends React.Props<DocumentCardLocation> {\r\n /**\r\n * Text for the location of the document.\r\n */\r\n location: string;\r\n\r\n /**\r\n * URL to navigate to for this location.\r\n */\r\n locationHref?: string;\r\n\r\n /**\r\n * Function to call when the location is clicked.\r\n */\r\n onClick?: (ev?: React.MouseEvent<HTMLElement>) => void;\r\n\r\n /**\r\n * Aria label for the link to the document location.\r\n */\r\n ariaLabel?: string;\r\n}\r\n\r\nexport interface IDocumentCardActivityProps extends React.Props<DocumentCardActivity> {\r\n /**\r\n * Describes the activity that has taken place, such as \"Created Feb 23, 2016\".\r\n */\r\n activity: string;\r\n\r\n /**\r\n * One or more people who are involved in this activity.\r\n */\r\n people: IDocumentCardActivityPerson[];\r\n}\r\n\r\nexport interface IDocumentCardActivityPerson {\r\n /**\r\n * The name of the person.\r\n */\r\n name: string;\r\n\r\n /**\r\n * Path to the profile photo of the person.\r\n */\r\n profileImageSrc: string;\r\n\r\n /**\r\n * The user's initials to display in the profile photo area when there is no image.\r\n */\r\n initials?: string;\r\n\r\n /**\r\n * The background color when the user's initials are displayed.\r\n * @defaultvalue PersonaInitialsColor.blue\r\n */\r\n initialsColor?: PersonaInitialsColor;\r\n}\r\n\r\nexport interface IDocumentCardActionsProps extends React.Props<DocumentCardActions> {\r\n /**\r\n * The actions available for this document.\r\n */\r\n actions: IButtonProps[];\r\n\r\n /**\r\n * The number of views this document has received.\r\n */\r\n views?: Number;\r\n}\r\n"; });