office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
172 lines • 10.4 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { DocumentCard, DocumentCardActions, DocumentCardActivity, DocumentCardLocation, DocumentCardPreview, DocumentCardTitle, DocumentCardLogo, DocumentCardStatus } from 'office-ui-fabric-react/lib/DocumentCard';
import { ImageFit } from 'office-ui-fabric-react/lib/Image';
import { TestImages } from '../../../common/TestImages';
var DocumentCardCompleteExample = /** @class */ (function (_super) {
tslib_1.__extends(DocumentCardCompleteExample, _super);
function DocumentCardCompleteExample() {
return _super !== null && _super.apply(this, arguments) || this;
}
DocumentCardCompleteExample.prototype.render = function () {
var previewProps = {
getOverflowDocumentCountText: function (overflowCount) { return "+" + overflowCount + " more"; },
previewImages: [
{
name: '2016 Conference Presentation',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreview,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
},
{
name: 'New Contoso Collaboration for Conference Presentation Draft',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreviewTwo,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
},
{
name: 'Spec Sheet for design',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreviewThree,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
},
{
name: 'Contoso Marketing Presentation',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreview,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
},
{
name: 'Notes from Ignite conference',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreviewTwo,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
},
{
name: 'FY17 Cost Projections',
url: 'http://bing.com',
previewImageSrc: TestImages.documentPreviewThree,
iconSrc: TestImages.iconPpt,
imageFit: ImageFit.cover,
width: 318,
height: 196
}
]
};
var previewPropsUsingIcon = {
previewImages: [
{
previewIconProps: { iconName: 'OpenFile', styles: { root: { fontSize: 42, color: '#ffffff' } } },
width: 318,
height: 196
}
]
};
var logoProps = {
logoIcon: 'OutlookLogo'
};
return (React.createElement("div", null,
React.createElement(DocumentCard, { onClick: this._onClick },
React.createElement(DocumentCardPreview, tslib_1.__assign({}, previewProps)),
React.createElement(DocumentCardLocation, { location: "Marketing Documents", locationHref: "http://microsoft.com", ariaLabel: "Location, Marketing Documents" }),
React.createElement(DocumentCardTitle, { title: "6 files were uploaded" }),
React.createElement(DocumentCardActivity, { activity: "Created Feb 23, 2016", people: [
{ name: 'Annie Lindqvist', profileImageSrc: TestImages.personaFemale },
{ name: 'Roko Kolar', profileImageSrc: '', initials: 'JH' },
{ name: 'Greta Lundberg', profileImageSrc: TestImages.personaFemale }
] }),
React.createElement(DocumentCardActions, { actions: [
{
iconProps: { iconName: 'Share' },
onClick: function (ev) {
console.log('You clicked the share action.');
ev.preventDefault();
ev.stopPropagation();
},
ariaLabel: 'share action'
},
{
iconProps: { iconName: 'Pin' },
onClick: function (ev) {
console.log('You clicked the pin action.');
ev.preventDefault();
ev.stopPropagation();
},
ariaLabel: 'pin action'
},
{
iconProps: { iconName: 'Ringer' },
onClick: function (ev) {
console.log('You clicked the ringer action.');
ev.preventDefault();
ev.stopPropagation();
},
ariaLabel: 'ringer action'
}
], views: 432 })),
React.createElement("p", null),
"Card Logo, Text Preview CardStatus are used on below examples.",
React.createElement("p", null),
React.createElement(DocumentCard, { onClickHref: "http://bing.com" },
React.createElement(DocumentCardLogo, tslib_1.__assign({}, logoProps)),
React.createElement("div", { className: "ms-ConversationTile-TitlePreviewArea" },
React.createElement(DocumentCardTitle, { title: "Conversation about anual report a very long long name, Title should be truncated on the long name.", shouldTruncate: true }),
React.createElement(DocumentCardTitle, { title: "This is the email content preview, please feel free to give feedback. SharePoint Site Acitivity add conversation card! This is the last.", shouldTruncate: true, showAsSecondaryTitle: true }),
React.createElement(DocumentCardStatus, { statusIcon: "attach", status: " 3 Attachments" })),
React.createElement(DocumentCardActivity, { activity: "Sent March 13, 2018", people: [
{ name: 'Annie Lindqvist', profileImageSrc: TestImages.personaFemale },
{ name: 'Roko Kolar', profileImageSrc: '', initials: 'JH' },
{ name: 'Greta Lundberg', profileImageSrc: TestImages.personaFemale }
] })),
React.createElement("p", null),
React.createElement(DocumentCard, { onClickHref: "http://bing.com" },
React.createElement(DocumentCardLogo, tslib_1.__assign({}, logoProps)),
React.createElement("div", { className: "ms-ConversationTile-TitlePreviewArea" },
React.createElement(DocumentCardTitle, { title: "Conversation about anual Report" }),
React.createElement(DocumentCardTitle, { title: "This is the email content preview, help.", showAsSecondaryTitle: true }),
React.createElement(DocumentCardStatus, { statusIcon: "attach", status: " 3 Attachments" })),
React.createElement(DocumentCardActivity, { activity: "Sent March 13, 2018", people: [
{ name: 'Annie Lindqvist', profileImageSrc: TestImages.personaFemale },
{ name: 'Roko Kolar', profileImageSrc: '', initials: 'JH' },
{ name: 'Greta Lundberg', profileImageSrc: TestImages.personaFemale }
] })),
React.createElement("p", null),
React.createElement(DocumentCard, { onClickHref: "http://bing.com" },
React.createElement(DocumentCardLogo, tslib_1.__assign({}, logoProps)),
React.createElement("div", { className: "ms-ConversationTile-TitlePreviewArea" },
React.createElement(DocumentCardTitle, { title: "Conversation about anual report", shouldTruncate: true }),
React.createElement(DocumentCardTitle, { title: "This is the email content preview, please feel free to give!", shouldTruncate: true, showAsSecondaryTitle: true })),
React.createElement(DocumentCardActivity, { activity: "Sent March 13, 2018", people: [
{ name: 'Annie Lindqvist', profileImageSrc: TestImages.personaFemale },
{ name: 'Roko Kolar', profileImageSrc: '', initials: 'JH' },
{ name: 'Greta Lundberg', profileImageSrc: TestImages.personaFemale }
] })),
React.createElement("p", null),
React.createElement(DocumentCard, { onClickHref: "http://bing.com" },
React.createElement(DocumentCardPreview, tslib_1.__assign({}, previewPropsUsingIcon)),
React.createElement("div", { className: "ms-DocumentCard-details" },
React.createElement(DocumentCardTitle, { title: "View and share files", shouldTruncate: true }),
React.createElement(DocumentCardActivity, { activity: "Created a few minutes ago", people: [{ name: 'Kat Larrson', profileImageSrc: TestImages.personaFemale }] })))));
};
DocumentCardCompleteExample.prototype._onClick = function () {
console.log('You clicked the card.');
};
return DocumentCardCompleteExample;
}(React.Component));
export { DocumentCardCompleteExample };
//# sourceMappingURL=DocumentCard.Complete.Example.js.map