office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
30 lines • 1.93 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var FocusZone_1 = require("office-ui-fabric-react/lib/FocusZone");
var List_1 = require("office-ui-fabric-react/lib/List");
var Image_1 = require("office-ui-fabric-react/lib/Image");
require("./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_1.FocusZone, { direction: FocusZone_1.FocusZoneDirection.vertical },
React.createElement("div", { className: "ms-ListGhostingExample-container", "data-is-scrollable": true },
React.createElement(List_1.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_1.Image, { className: "ms-ListGhostingExample-itemImage", src: isScrolling ? undefined : item.thumbnail, width: 50, height: 50, imageFit: Image_1.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));
exports.ListGhostingExample = ListGhostingExample;
//# sourceMappingURL=List.Ghosting.Example.js.map
;