UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

28 lines 1.81 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { FocusZone, FocusZoneDirection } from 'office-ui-fabric-react/lib/FocusZone'; import { List } from 'office-ui-fabric-react/lib/List'; import { Image, ImageFit } from 'office-ui-fabric-react/lib/Image'; import './List.Ghosting.Example.scss'; var ListGhostingExample = /** @class */ (function (_super) { tslib_1.__extends(ListGhostingExample, _super); function ListGhostingExample(props) { return _super.call(this, props) || this; } ListGhostingExample.prototype.render = function () { var items = this.props.items; return (React.createElement(FocusZone, { direction: FocusZoneDirection.vertical }, React.createElement("div", { className: "ms-ListGhostingExample-container", "data-is-scrollable": true }, React.createElement(List, { items: items, onRenderCell: this._onRenderCell })))); }; ListGhostingExample.prototype._onRenderCell = function (item, index, isScrolling) { return (React.createElement("div", { className: "ms-ListGhostingExample-itemCell", "data-is-focusable": true }, React.createElement(Image, { className: "ms-ListGhostingExample-itemImage", src: isScrolling ? undefined : item.thumbnail, width: 50, height: 50, imageFit: ImageFit.cover }), React.createElement("div", { className: "ms-ListGhostingExample-itemContent" }, React.createElement("div", { className: "ms-ListGhostingExample-itemName" }, item.name), React.createElement("div", { className: "ms-ListGhostingExample-itemIndex" }, "Item " + index)))); }; return ListGhostingExample; }(React.Component)); export { ListGhostingExample }; //# sourceMappingURL=List.Ghosting.Example.js.map