Dashboard sipadu mbip
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

BounceLoader.js 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 (b.hasOwnProperty(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 __importStar = (this && this.__importStar) || function (mod) {
  20. if (mod && mod.__esModule) return mod;
  21. var result = {};
  22. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  23. result["default"] = mod;
  24. return result;
  25. };
  26. Object.defineProperty(exports, "__esModule", { value: true });
  27. /** @jsx jsx */
  28. var React = __importStar(require("react"));
  29. var core_1 = require("@emotion/core");
  30. var helpers_1 = require("./helpers");
  31. var bounce = core_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0%, 100% {transform: scale(0)}\n 50% {transform: scale(1.0)}\n"], ["\n 0%, 100% {transform: scale(0)}\n 50% {transform: scale(1.0)}\n"])));
  32. var Loader = /** @class */ (function (_super) {
  33. __extends(Loader, _super);
  34. function Loader() {
  35. var _this = _super !== null && _super.apply(this, arguments) || this;
  36. _this.style = function (i) {
  37. var _a = _this.props, size = _a.size, color = _a.color, sizeUnit = _a.sizeUnit;
  38. return core_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n height: ", ";\n width: ", ";\n background-color: ", ";\n border-radius: 100%;\n opacity: 0.6;\n top: 0;\n left: 0;\n animation-fill-mode: both;\n animation: ", " 2.1s ", " infinite ease-in-out;\n "], ["\n position: absolute;\n height: ", ";\n width: ", ";\n background-color: ", ";\n border-radius: 100%;\n opacity: 0.6;\n top: 0;\n left: 0;\n animation-fill-mode: both;\n animation: ", " 2.1s ", " infinite ease-in-out;\n "])), "" + size + sizeUnit, "" + size + sizeUnit, color, bounce, i === 1 ? "1s" : "0s");
  39. };
  40. _this.wrapper = function () {
  41. var _a = _this.props, size = _a.size, sizeUnit = _a.sizeUnit;
  42. return core_1.css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n width: ", ";\n height: ", ";\n "], ["\n position: relative;\n width: ", ";\n height: ", ";\n "])), "" + size + sizeUnit, "" + size + sizeUnit);
  43. };
  44. return _this;
  45. }
  46. Loader.prototype.render = function () {
  47. var _a = this.props, loading = _a.loading, css = _a.css;
  48. return loading ? (core_1.jsx("div", { css: [this.wrapper(), css] },
  49. core_1.jsx("div", { css: this.style(1) }),
  50. core_1.jsx("div", { css: this.style(2) }))) : null;
  51. };
  52. Loader.defaultProps = helpers_1.sizeDefaults(60);
  53. return Loader;
  54. }(React.PureComponent));
  55. exports.default = Loader;
  56. var templateObject_1, templateObject_2, templateObject_3;