office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
26 lines • 2 kB
JavaScript
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/FocusZone", "office-ui-fabric-react/lib/List", "office-ui-fabric-react/lib/Image", "./List.Ghosting.Example.scss"], function (require, exports, tslib_1, React, FocusZone_1, List_1, Image_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
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