Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DotLoader.js 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 rotate = core_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 100% {transform: rotate(360deg)}\n"], ["\n 100% {transform: rotate(360deg)}\n"])));
  32. var bounce = core_1.keyframes(templateObject_2 || (templateObject_2 = __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"])));
  33. var Loader = /** @class */ (function (_super) {
  34. __extends(Loader, _super);
  35. function Loader() {
  36. var _this = _super !== null && _super.apply(this, arguments) || this;
  37. _this.style = function (i) {
  38. var _a = _this.props, size = _a.size, sizeUnit = _a.sizeUnit, color = _a.color;
  39. return core_1.css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: absolute;\n top: ", ";\n bottom: ", ";\n height: ", ";\n width: ", ";\n background-color: ", ";\n border-radius: 100%;\n animation-fill-mode: forwards;\n animation: ", " 2s ", " infinite linear;\n "], ["\n position: absolute;\n top: ", ";\n bottom: ", ";\n height: ", ";\n width: ", ";\n background-color: ", ";\n border-radius: 100%;\n animation-fill-mode: forwards;\n animation: ", " 2s ", " infinite linear;\n "])), i % 2 ? "0" : "auto", i % 2 ? "auto" : "0", "" + size / 2 + sizeUnit, "" + size / 2 + sizeUnit, color, bounce, i === 2 ? "-1s" : "0s");
  40. };
  41. _this.wrapper = function () {
  42. var _a = _this.props, size = _a.size, sizeUnit = _a.sizeUnit;
  43. return core_1.css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n width: ", ";\n height: ", ";\n animation-fill-mode: forwards;\n animation: ", " 2s 0s infinite linear;\n "], ["\n position: relative;\n width: ", ";\n height: ", ";\n animation-fill-mode: forwards;\n animation: ", " 2s 0s infinite linear;\n "])), "" + size + sizeUnit, "" + size + sizeUnit, rotate);
  44. };
  45. return _this;
  46. }
  47. Loader.prototype.render = function () {
  48. var _a = this.props, loading = _a.loading, css = _a.css;
  49. return loading ? (core_1.jsx("div", { css: [this.wrapper(), css] },
  50. core_1.jsx("div", { css: this.style(1) }),
  51. core_1.jsx("div", { css: this.style(2) }))) : null;
  52. };
  53. Loader.defaultProps = helpers_1.sizeDefaults(60);
  54. return Loader;
  55. }(React.PureComponent));
  56. exports.default = Loader;
  57. var templateObject_1, templateObject_2, templateObject_3, templateObject_4;