office-ui-fabric-react
Version:
Reusable React components for building experiences for Office 365.
71 lines • 4.78 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { Shimmer, ShimmerElementsGroup, ShimmerElementType as ElemType } from 'office-ui-fabric-react/lib/Shimmer';
import * as ShimmerExampleStyles from './Shimmer.Example.scss';
var ShimmerCustomElementsExample = /** @class */ (function (_super) {
tslib_1.__extends(ShimmerCustomElementsExample, _super);
function ShimmerCustomElementsExample(props) {
var _this = _super.call(this, props) || this;
_this._getCustomElementsExampleOne = function () {
return (React.createElement("div", {
// tslint:disable-next-line:jsx-ban-props
style: { display: 'flex' } },
React.createElement(ShimmerElementsGroup, { shimmerElements: [
{ type: ElemType.line, width: 40, height: 40 },
{ type: ElemType.gap, width: 10, height: 40 }
] }),
React.createElement(ShimmerElementsGroup, { flexWrap: true, shimmerElements: [
{ type: ElemType.line, width: 300, height: 10 },
{ type: ElemType.line, width: 200, height: 10 },
{ type: ElemType.gap, width: 100, height: 20 }
] })));
};
_this._getCustomElementsExampleTwo = function () {
return (React.createElement("div", {
// tslint:disable-next-line:jsx-ban-props
style: { display: 'flex' } },
React.createElement(ShimmerElementsGroup, { shimmerElements: [{ type: ElemType.circle, height: 40 }, { type: ElemType.gap, width: 10, height: 40 }] }),
React.createElement(ShimmerElementsGroup, { flexWrap: true, shimmerElements: [
{ type: ElemType.line, width: 400, height: 10 },
{ type: ElemType.gap, width: 100, height: 20 },
{ type: ElemType.line, width: 500, height: 10 }
] })));
};
_this._getCustomElementsExampleThree = function () {
return (React.createElement("div", {
// tslint:disable-next-line:jsx-ban-props
style: { display: 'flex' } },
React.createElement(ShimmerElementsGroup, { width: '90px', shimmerElements: [
{ type: ElemType.line, height: 80, width: 80 },
{ type: ElemType.gap, width: 10, height: 80 }
] }),
React.createElement("div", {
// tslint:disable-next-line:jsx-ban-props
style: { display: 'flex', flexWrap: 'wrap', width: '100%' } },
React.createElement(ShimmerElementsGroup, { shimmerElements: [{ type: ElemType.circle, height: 40 }, { type: ElemType.gap, width: 10, height: 40 }] }),
React.createElement(ShimmerElementsGroup, { flexWrap: true, width: 'calc(100% - 50px)', shimmerElements: [
{ type: ElemType.line, width: '90%', height: 10 },
{ type: ElemType.gap, width: '10%', height: 20 },
{ type: ElemType.line, width: '100%', height: 10 }
] }),
React.createElement(ShimmerElementsGroup, { flexWrap: true, width: '100%', shimmerElements: [
{ type: ElemType.line, width: '80%', height: 10, verticalAlign: 'bottom' },
{ type: ElemType.gap, width: '20%', height: 20 },
{ type: ElemType.line, width: '40%', height: 10, verticalAlign: 'bottom' },
{ type: ElemType.gap, width: '2%', height: 20 },
{ type: ElemType.line, width: '58%', height: 10, verticalAlign: 'bottom' }
] }))));
};
return _this;
}
ShimmerCustomElementsExample.prototype.render = function () {
return (React.createElement("div", { className: ShimmerExampleStyles.shimmerExampleContainer },
"Using ShimmerElementsGroup component to build complex structures of the placeholder you need.",
React.createElement(Shimmer, { customElementsGroup: this._getCustomElementsExampleOne(), width: 350 }),
React.createElement(Shimmer, { customElementsGroup: this._getCustomElementsExampleTwo(), width: 550 }),
React.createElement(Shimmer, { customElementsGroup: this._getCustomElementsExampleThree(), width: '90%' })));
};
return ShimmerCustomElementsExample;
}(React.Component));
export { ShimmerCustomElementsExample };
//# sourceMappingURL=Shimmer.CustomElements.Example.js.map