UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

39 lines 2.29 kB
define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/ScrollablePane", "office-ui-fabric-react/lib/Sticky", "@uifabric/example-app-base", "./ScrollablePane.Example.scss"], function (require, exports, tslib_1, React, ScrollablePane_1, Sticky_1, example_app_base_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 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 < 4; i++) { contentAreas.push(this._createContentArea(i)); } return (React.createElement(ScrollablePane_1.ScrollablePane, { className: 'scrollablePaneDefaultExample' }, contentAreas.map(function (ele) { return ele; }))); }; ScrollablePaneDefaultExample.prototype._getRandomColor = function () { var letters = 'BCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++) { color += letters[Math.floor(Math.random() * letters.length)]; } return color; }; ScrollablePaneDefaultExample.prototype._createContentArea = function (index) { var style = this._getRandomColor(); return (React.createElement("div", { key: index }, React.createElement(Sticky_1.Sticky, { stickyPosition: Sticky_1.StickyPositionType.Both, stickyClassName: 'largeFont', stickyBackgroundColor: style }, React.createElement("div", { className: 'sticky' }, "Sticky Component #", index + 1)), React.createElement("div", { className: 'textContent' }, example_app_base_1.lorem(200)))); }; return ScrollablePaneDefaultExample; }(React.Component)); exports.ScrollablePaneDefaultExample = ScrollablePaneDefaultExample; }); //# sourceMappingURL=ScrollablePane.Default.Example.js.map