UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

41 lines 2.08 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; import { ScrollablePane } from 'office-ui-fabric-react/lib/ScrollablePane'; import { Sticky, StickyPositionType } from 'office-ui-fabric-react/lib/Sticky'; import { lorem } from 'office-ui-fabric-react/lib/utilities/exampleData'; import './ScrollablePane.Example.scss'; var colors = ['#eaeaea', '#dadada', '#d0d0d0', '#c8c8c8', '#a6a6a6', '#c7e0f4', '#71afe5', '#eff6fc', '#deecf9']; var ScrollablePaneDefaultExample = /** @class */ (function (_super) { tslib_1.__extends(ScrollablePaneDefaultExample, _super); function ScrollablePaneDefaultExample() { return _super !== null && _super.apply(this, arguments) || this; } ScrollablePaneDefaultExample.prototype.render = function () { var contentAreas = []; for (var i = 0; i < 5; i++) { contentAreas.push(this._createContentArea(i)); } return (React.createElement("div", { style: { height: '900px', position: 'relative', maxHeight: 'inherit' } }, React.createElement(ScrollablePane, { className: "scrollablePaneDefaultExample" }, contentAreas.map(function (ele) { return ele; })))); }; ScrollablePaneDefaultExample.prototype._createContentArea = function (index) { var color = colors.splice(Math.floor(Math.random() * colors.length), 1)[0]; return (React.createElement("div", { key: index, style: { backgroundColor: color } }, React.createElement(Sticky, { stickyPosition: StickyPositionType.Both }, React.createElement("div", { className: "sticky" }, "Sticky Component #", index + 1)), React.createElement("div", { className: "textContent" }, lorem(200)))); }; return ScrollablePaneDefaultExample; }(React.Component)); export { ScrollablePaneDefaultExample }; //# sourceMappingURL=ScrollablePane.Default.Example.js.map