kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
51 lines (50 loc) • 10.5 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _templateObject, _templateObject2, _templateObject3; // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var animationName = (0, _styledComponents.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"])));
var Loader = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n border-left-color: ", ";\n animation: _preloader_spin_ 500ms linear infinite;\n border-radius: 50%;\n border-top-color: transparent;\n border-bottom-color: transparent;\n border-right-color: transparent;\n cursor: wait;\n border-style: solid;\n display: block;\n animation-name: ", ";\n}"])), function (props) {
return props.color || props.theme.primaryBtnBgd;
}, animationName);
var LoadingWrapper = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n border-radius: 50%;\n border: 3px solid ", ";\n padding: 2px;\n"])), function (props) {
return props.borderColor || props.theme.borderColorLT;
});
var LoadingSpinner = function LoadingSpinner(_ref) {
var _ref$size = _ref.size,
size = _ref$size === void 0 ? 32 : _ref$size,
_ref$color = _ref.color,
color = _ref$color === void 0 ? '' : _ref$color,
_ref$borderColor = _ref.borderColor,
borderColor = _ref$borderColor === void 0 ? '' : _ref$borderColor,
_ref$strokeWidth = _ref.strokeWidth,
strokeWidth = _ref$strokeWidth === void 0 ? 3 : _ref$strokeWidth,
_ref$gap = _ref.gap,
gap = _ref$gap === void 0 ? 2 : _ref$gap;
return /*#__PURE__*/_react["default"].createElement(LoadingWrapper, {
style: {
width: "".concat(size, "px"),
height: "".concat(size, "px"),
padding: "".concat(gap, "px"),
borderColor: borderColor
}
}, /*#__PURE__*/_react["default"].createElement(Loader, {
color: color,
style: {
width: "".concat(size - strokeWidth * 2 - gap * 2, "px"),
height: "".concat(size - strokeWidth * 2 - gap * 2, "px"),
borderWidth: strokeWidth
}
}));
};
var _default = exports["default"] = LoadingSpinner;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9zdHlsZWRDb21wb25lbnRzIiwiX2ludGVyb3BSZXF1aXJlV2lsZGNhcmQiLCJfdGVtcGxhdGVPYmplY3QiLCJfdGVtcGxhdGVPYmplY3QyIiwiX3RlbXBsYXRlT2JqZWN0MyIsIl9nZXRSZXF1aXJlV2lsZGNhcmRDYWNoZSIsImUiLCJXZWFrTWFwIiwiciIsInQiLCJfX2VzTW9kdWxlIiwiX3R5cGVvZiIsImhhcyIsImdldCIsIm4iLCJfX3Byb3RvX18iLCJhIiwiT2JqZWN0IiwiZGVmaW5lUHJvcGVydH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