1 | "use strict";
|
2 | var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
3 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
4 | return cooked;
|
5 | };
|
6 | var __extends = (this && this.__extends) || (function () {
|
7 | var extendStatics = function (d, b) {
|
8 | extendStatics = Object.setPrototypeOf ||
|
9 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
10 | function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
11 | return extendStatics(d, b);
|
12 | };
|
13 | return function (d, b) {
|
14 | extendStatics(d, b);
|
15 | function __() { this.constructor = d; }
|
16 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
17 | };
|
18 | })();
|
19 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
20 | if (k2 === undefined) k2 = k;
|
21 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
22 | }) : (function(o, m, k, k2) {
|
23 | if (k2 === undefined) k2 = k;
|
24 | o[k2] = m[k];
|
25 | }));
|
26 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
27 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
28 | }) : function(o, v) {
|
29 | o["default"] = v;
|
30 | });
|
31 | var __importStar = (this && this.__importStar) || function (mod) {
|
32 | if (mod && mod.__esModule) return mod;
|
33 | var result = {};
|
34 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
35 | __setModuleDefault(result, mod);
|
36 | return result;
|
37 | };
|
38 | Object.defineProperty(exports, "__esModule", { value: true });
|
39 |
|
40 | var React = __importStar(require("react"));
|
41 | var react_1 = require("@emotion/react");
|
42 | var proptypes_1 = require("./helpers/proptypes");
|
43 | var helpers_1 = require("./helpers");
|
44 | var sync = react_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 33% {transform: translateY(10px)}\n 66% {transform: translateY(-10px)}\n 100% {transform: translateY(0)}\n"], ["\n 33% {transform: translateY(10px)}\n 66% {transform: translateY(-10px)}\n 100% {transform: translateY(0)}\n"])));
|
45 | var Loader = (function (_super) {
|
46 | __extends(Loader, _super);
|
47 | function Loader() {
|
48 | var _this = _super !== null && _super.apply(this, arguments) || this;
|
49 | _this.style = function (i) {
|
50 | var _a = _this.props, color = _a.color, size = _a.size, margin = _a.margin, speedMultiplier = _a.speedMultiplier;
|
51 | return react_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n margin: ", ";\n border-radius: 100%;\n display: inline-block;\n animation: ", " ", "s ", "s infinite ease-in-out;\n animation-fill-mode: both;\n "], ["\n background-color: ", ";\n width: ", ";\n height: ", ";\n margin: ", ";\n border-radius: 100%;\n display: inline-block;\n animation: ", " ", "s ", "s infinite ease-in-out;\n animation-fill-mode: both;\n "])), color, helpers_1.cssValue(size), helpers_1.cssValue(size), helpers_1.cssValue(margin), sync, 0.6 / speedMultiplier, i * 0.07);
|
52 | };
|
53 | return _this;
|
54 | }
|
55 | Loader.prototype.render = function () {
|
56 | var _a = this.props, loading = _a.loading, css = _a.css;
|
57 | return loading ? (react_1.jsx("span", { css: [css] },
|
58 | react_1.jsx("span", { css: this.style(1) }),
|
59 | react_1.jsx("span", { css: this.style(2) }),
|
60 | react_1.jsx("span", { css: this.style(3) }))) : null;
|
61 | };
|
62 | Loader.defaultProps = proptypes_1.sizeMarginDefaults(15);
|
63 | return Loader;
|
64 | }(React.PureComponent));
|
65 | exports.default = Loader;
|
66 | var templateObject_1, templateObject_2;
|