diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..bff5d65
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+language: node_js
+cache:
+ directories:
+ - node_modules
+# Add additional versions here as appropriate.
+node_js:
+- "stable"
+# Lint errors should trigger a failure.
+script: npm run build
+deploy:
+ provider: npm
+ email: $NPM_EMAIL
+ api_key: $NPM_API_KEY
+ skip_cleanup: true
+ # tag: beta # uncomment for beta release
+ on:
+ tags: true
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..9197584
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,25 @@
+MIT License
+-----------
+
+Copyright (c) 2019 Ondřej Chrastina
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 1aa23b4..53a2baa 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,22 @@
-# @chevtek/react-spinners
+# @simply007org/react-spinners
+
+[](https://travis-ci.org/@Simply007/react-spinners)
+
+[](https://www.npmjs.com/package/@simply007org/react-spinners)
+[](https://www.npmjs.com/package/@simply007org/react-spinners)
+[](@simply007org/react-spinners)
+
A library for easily managing loading spinners in complex React applications.
-### Install
+:star: This library is basically a clone of [@chevtek/react-spinners](https://github.com/Chevtek/react-spinners) with [this pull request merged](https://github.com/Chevtek/react-spinners/pull/3).
+
+## Install
-> $ npm i @chevtek/react-spinners --save
+> $ npm i @simply007org/react-spinners --save
If you're running npm v8 or higher then `--save` is implied if you don't include it.
-### Quick Start
+## Quick Start
First import the `Spinner` component and use it anywhere in your app.
@@ -15,7 +24,7 @@ First import the `Spinner` component and use it anywhere in your app.
// ./src/App.jsx
import * as React from 'react';
-import { Spinner } from '@chevtek/react-spinners';
+import { Spinner } from '@simply007org/react-spinners';
export default class YourComponent extends React.Component {
...
@@ -37,7 +46,7 @@ Now just import the `spinnerService` wherever you need it.
```javascript
// ./src/services/yourService.js
-import { spinnerService } from '@chevtek/react-spinners';
+import { spinnerService } from '@simply007org/react-spinners';
function beginSomeOperation() {
spinnerService.show('mySpinner');
@@ -47,10 +56,10 @@ function beginSomeOperation() {
}
```
-`@chevtek/react-spinners` contains a singleton instance of `SpinnerService` for your convenience and as you've seen above all you have to do is import and use it. Optionally, you can create your own instance of the `SpinnerService` and pass that to your `Spinner` components instead. This is useful in certain situations such as centralizing all your dependencies to be used for dependency injection.
+`@Simply/react-spinners` contains a singleton instance of `SpinnerService` for your convenience and as you've seen above all you have to do is import and use it. Optionally, you can create your own instance of the `SpinnerService` and pass that to your `Spinner` components instead. This is useful in certain situations such as centralizing all your dependencies to be used for dependency injection.
```jsx
-import { Spinner, SpinnerServie } from '@chevtek/react-spinners';
+import { Spinner, SpinnerServie } from '@simply007org/react-spinners';
const yourCustomSpinnerService = new SpinnerService();
@@ -71,11 +80,11 @@ In this way you can declare the spinner service in a centralized location and ha
---
-### Spinner Component
+## Spinner Component
The spinner component gives you several options.
-#### name: string
+### name: string
The name attribute is required. It is what you must pass to the service when trying to show/hide that specific spinner.
@@ -83,7 +92,7 @@ The name attribute is required. It is what you must pass to the service when try
```
-#### group: string
+### group: string
Optionally a group name may be specified so that you can show/hide groups of spinners.
@@ -97,7 +106,7 @@ Optionally a group name may be specified so that you can show/hide groups of spi
this.spinnerService.showGroup('foo');
```
-#### show: boolean
+### show: boolean
By default all spinners are hidden when first registered. You can set a spinner to be visible by default by setting the `show` property to `true`.
@@ -105,7 +114,7 @@ By default all spinners are hidden when first registered. You can set a spinner
```
-#### loadingImage: string
+### loadingImage: string
Passing in a loading image is the simplest way to create a quick spinner.
@@ -115,7 +124,7 @@ Passing in a loading image is the simplest way to create a quick spinner.
If you want to disable the loading image entirely then simply do not specify the `loadingImage` property and an image won't be used. If you don't include the `loadingImage` option then be sure to specify some custom markup within the spinner component itself so it can be used instead.
-#### Content Projection
+### Content Projection
If you need more control over the kind of spinner you want to display, beyond just a simple animated image. You are able to supply any custom markup that you need by simply nesting it within the spinner component. Any content will be projeced into the spinner template below the `loadingImage` if one was specified.
@@ -129,12 +138,12 @@ Content projection is the most common way to use the `SpinnerComponent` as it al
---
-### Spinner Service
+## Spinner Service
The most common way of interacting with your spinners is via the `spinnerService`. This service can be injected just like any other Angular service. Once you have reference to the service you can take advantage of several methods.
```javascript
-import { spinnerService } from '@chevtek/react-spinners';
+import { spinnerService } from '@simply007org/react-spinners';
import * as axios from 'axios'; // replace with your preferred ajax request library
@@ -152,7 +161,7 @@ function loadData() {
}
```
-#### show(spinnerName: string): void
+### show(spinnerName: string): void
The `show` method allows you to display a specific spinner by name.
@@ -164,11 +173,11 @@ The `show` method allows you to display a specific spinner by name.
spinnerService.show('mySpinner');
```
-#### hide(spinnerName: string): void
+### hide(spinnerName: string): void
Works exactly like `show` but hides the spinner element.
-#### showGroup(groupName: string): void
+### showGroup(groupName: string): void
The `showGroup` method allows you to display all spinners with the same group name.
@@ -184,18 +193,18 @@ spinnerService.showGroup('foo');
Spinners 1 and 2 would show but spinner 3 would not since it is not part of group "foo".
-#### hideGroup(groupName: string): void
+### hideGroup(groupName: string): void
Works exactly the same as `showGroup` except it hides the spinners instead.
-#### showAll: void
+### showAll: void
Hopefully it's obvious that this method will show every single spinner registered with the service. This method is rarely used but is there for parity just in case.
-#### hideAll(): void
+### hideAll(): void
The `hideAll` method is identical to `showAll` except it hides every spinner that is registered. This method also isn't used very often but is extremely useful in global error handlers. We all know how much users ***HATE*** frozen spinners, right?
-#### isShowing(spinnerName: string): boolean
+### isShowing(spinnerName: string): boolean
-The `isShowing` method returns a boolean indicating whether or not the specified spinner is currently showing.
\ No newline at end of file
+The `isShowing` method returns a boolean indicating whether or not the specified spinner is currently showing.
diff --git a/dist/index.js b/dist/index.js
index 53d98e5..b7f617f 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,258 +1,2 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["reactSpinners"] = factory();
- else
- root["reactSpinners"] = factory();
-})(typeof self !== 'undefined' ? self : this, function() {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
-/******/ });
-/******/ }
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 1);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-var SpinnerService = /** @class */ (function () {
- function SpinnerService() {
- this.spinnerCache = new Set();
- }
- SpinnerService.prototype._register = function (spinner) {
- this.spinnerCache.add(spinner);
- };
- SpinnerService.prototype._unregister = function (spinnerToRemove) {
- var _this = this;
- this.spinnerCache.forEach(function (spinner) {
- if (spinner === spinnerToRemove) {
- _this.spinnerCache.delete(spinner);
- }
- });
- };
- SpinnerService.prototype._unregisterGroup = function (spinnerGroup) {
- var _this = this;
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.group === spinnerGroup) {
- _this.spinnerCache.delete(spinner);
- }
- });
- };
- SpinnerService.prototype._unregisterAll = function () {
- this.spinnerCache.clear();
- };
- SpinnerService.prototype.show = function (spinnerName) {
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.name === spinnerName) {
- spinner.show = true;
- }
- });
- };
- SpinnerService.prototype.hide = function (spinnerName) {
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.name === spinnerName) {
- spinner.show = false;
- }
- });
- };
- SpinnerService.prototype.showGroup = function (spinnerGroup) {
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.group === spinnerGroup) {
- spinner.show = true;
- }
- });
- };
- SpinnerService.prototype.hideGroup = function (spinnerGroup) {
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.group === spinnerGroup) {
- spinner.show = false;
- }
- });
- };
- SpinnerService.prototype.showAll = function () {
- this.spinnerCache.forEach(function (spinner) { return spinner.show = true; });
- };
- SpinnerService.prototype.hideAll = function () {
- this.spinnerCache.forEach(function (spinner) { return spinner.show = false; });
- };
- SpinnerService.prototype.isShowing = function (spinnerName) {
- var showing = undefined;
- this.spinnerCache.forEach(function (spinner) {
- if (spinner.name === spinnerName) {
- showing = spinner.show;
- }
- });
- return showing;
- };
- return SpinnerService;
-}());
-exports.SpinnerService = SpinnerService;
-var spinnerService = new SpinnerService();
-exports.spinnerService = spinnerService;
-
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-var Spinner_component_1 = __webpack_require__(2);
-exports.Spinner = Spinner_component_1.SpinnerComponent;
-var spinner_service_1 = __webpack_require__(0);
-exports.SpinnerService = spinner_service_1.SpinnerService;
-exports.spinnerService = spinner_service_1.spinnerService;
-
-
-/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-Object.defineProperty(exports, "__esModule", { value: true });
-var React = __webpack_require__(3);
-var spinner_service_1 = __webpack_require__(0);
-var SpinnerComponent = /** @class */ (function (_super) {
- __extends(SpinnerComponent, _super);
- function SpinnerComponent() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.spinnerService = spinner_service_1.spinnerService;
- return _this;
- }
- Object.defineProperty(SpinnerComponent.prototype, "show", {
- get: function () {
- return this.state.show;
- },
- set: function (show) {
- this.setState({ show: show });
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(SpinnerComponent.prototype, "name", {
- get: function () {
- return this.props.name;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(SpinnerComponent.prototype, "group", {
- get: function () {
- return this.props.group;
- },
- enumerable: true,
- configurable: true
- });
- SpinnerComponent.prototype.componentWillMount = function () {
- this.state = {
- show: this.props.hasOwnProperty('show') ? this.props.show : false
- };
- if (this.props.hasOwnProperty('spinnerService')) {
- this.spinnerService = this.props.spinnerService;
- }
- this.spinnerService._register(this);
- };
- SpinnerComponent.prototype.componentWillUnmount = function () {
- this.spinnerService._unregister(this);
- };
- SpinnerComponent.prototype.render = function () {
- if (this.state.show) {
- var loadingImage = this.props.loadingImage;
- return (React.createElement("div", { style: { display: 'inline-block' } },
- loadingImage && React.createElement("img", { src: loadingImage }),
- this.props.children));
- }
- return (React.createElement("div", { style: { display: 'inline-block' } }));
- };
- return SpinnerComponent;
-}(React.Component));
-exports.SpinnerComponent = SpinnerComponent;
-
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports) {
-
-module.exports = require("react");
-
-/***/ })
-/******/ ]);
-});
+!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.reactSpinners=n():e.reactSpinners=n()}(window,function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(){this.spinnerCache=new Set}return e.prototype._register=function(e){this.spinnerCache.add(e)},e.prototype._unregister=function(e){var n=this;this.spinnerCache.forEach(function(t){t===e&&n.spinnerCache.delete(t)})},e.prototype._unregisterGroup=function(e){var n=this;this.spinnerCache.forEach(function(t){t.group===e&&n.spinnerCache.delete(t)})},e.prototype._unregisterAll=function(){this.spinnerCache.clear()},e.prototype.show=function(e){this.spinnerCache.forEach(function(n){n.name===e&&(n.show=!0)})},e.prototype.hide=function(e){this.spinnerCache.forEach(function(n){n.name===e&&(n.show=!1)})},e.prototype.showGroup=function(e){this.spinnerCache.forEach(function(n){n.group===e&&(n.show=!0)})},e.prototype.hideGroup=function(e){this.spinnerCache.forEach(function(n){n.group===e&&(n.show=!1)})},e.prototype.showAll=function(){this.spinnerCache.forEach(function(e){return e.show=!0})},e.prototype.hideAll=function(){this.spinnerCache.forEach(function(e){return e.show=!1})},e.prototype.isShowing=function(e){var n=void 0;return this.spinnerCache.forEach(function(t){t.name===e&&(n=t.show)}),n},e}();n.SpinnerService=r;var o=new r;n.spinnerService=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t(2);n.Spinner=r.SpinnerComponent;var o=t(0);n.SpinnerService=o.SpinnerService,n.spinnerService=o.spinnerService},function(e,n,t){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])},function(e,n){function t(){this.constructor=e}r(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(n,"__esModule",{value:!0});var i=t(3),p=t(0),s=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.spinnerService=p.spinnerService,n}return o(n,e),Object.defineProperty(n.prototype,"show",{get:function(){return this.state.show},set:function(e){this.setState({show:e})},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this.props.name},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"group",{get:function(){return this.props.group},enumerable:!0,configurable:!0}),n.prototype.componentWillMount=function(){this.setState({show:!!this.props.hasOwnProperty("show")&&this.props.show}),this.props.hasOwnProperty("spinnerService")&&(this.spinnerService=this.props.spinnerService),this.spinnerService._register(this)},n.prototype.componentWillUnmount=function(){this.spinnerService._unregister(this)},n.prototype.render=function(){if(this.state.show){var e=this.props.loadingImage;return i.createElement("div",{style:{display:"inline-block"}},e&&i.createElement("img",{src:e}),this.props.children)}return i.createElement("div",{style:{display:"inline-block"}})},n}(i.Component);n.SpinnerComponent=s},function(e,n){e.exports=require("react")}])});
//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/index.js.map b/dist/index.js.map
index 3ddb5fa..d9a94d7 100644
--- a/dist/index.js.map
+++ b/dist/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 61e2db83e38d2ba34f63","webpack:///./src/spinner.service.ts","webpack:///./src/index.ts","webpack:///./src/Spinner.component.tsx","webpack:///external \"react\""],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA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AChD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QAClD,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,+CAAoB,GAApB;QACE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,iCAAM,GAAN;QACE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YACZ,0CAAY,CAAgB;YACpC,MAAM,CAAC,CACL,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;gBACnC,YAAY,IAAI,6BAAK,GAAG,EAAE,YAAY,GAAI;gBAC1C,IAAI,CAAC,KAAK,CAAC,QAAQ,CACjB,CACP,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,CAAC,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,GAAQ,CAAC,CAAC;IAC3D,CAAC;IACH,uBAAC;AAAD,CAAC,CAhDqC,KAAK,CAAC,SAAS,GAgDpD;AAhDY,4CAAgB;;;;;;;AChB7B,kC","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"reactSpinners\"] = factory();\n\telse\n\t\troot[\"reactSpinners\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 61e2db83e38d2ba34f63","import { SpinnerComponent } from './Spinner.component';\n\nexport class SpinnerService {\n private spinnerCache = new Set();\n\n _register(spinner: SpinnerComponent): void {\n this.spinnerCache.add(spinner);\n }\n\n _unregister(spinnerToRemove: SpinnerComponent): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner === spinnerToRemove) {\n this.spinnerCache.delete(spinner);\n }\n });\n }\n\n _unregisterGroup(spinnerGroup: string): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner.group === spinnerGroup) {\n this.spinnerCache.delete(spinner);\n }\n });\n }\n\n _unregisterAll(): void {\n this.spinnerCache.clear();\n }\n\n show(spinnerName: string): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner.name === spinnerName) {\n spinner.show = true;\n }\n });\n }\n\n hide(spinnerName: string): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner.name === spinnerName) {\n spinner.show = false;\n }\n });\n }\n\n showGroup(spinnerGroup: string): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner.group === spinnerGroup) {\n spinner.show = true;\n }\n });\n }\n\n hideGroup(spinnerGroup: string): void {\n this.spinnerCache.forEach(spinner => {\n if (spinner.group === spinnerGroup) {\n spinner.show = false;\n }\n });\n }\n\n showAll(): void {\n this.spinnerCache.forEach(spinner => spinner.show = true);\n }\n\n hideAll(): void {\n this.spinnerCache.forEach(spinner => spinner.show = false);\n }\n\n isShowing(spinnerName: string): boolean | undefined {\n let showing = undefined;\n this.spinnerCache.forEach(spinner => {\n if (spinner.name === spinnerName) {\n showing = spinner.show;\n }\n });\n return showing;\n }\n}\n\nconst spinnerService = new SpinnerService();\nexport { spinnerService }\n\n\n// WEBPACK FOOTER //\n// ./src/spinner.service.ts","export { SpinnerComponent as Spinner, ISpinnerProps, ISpinnerState } from './Spinner.component';\nexport { SpinnerService, spinnerService } from './spinner.service';\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","import * as React from \"react\";\nimport { SpinnerService, spinnerService } from './spinner.service';\n\nexport interface ISpinnerProps {\n name: string,\n spinnerService?: SpinnerService\n group?: string,\n loadingImage?: string,\n show?: boolean,\n style?: object\n}\n\nexport interface ISpinnerState {\n show: boolean\n}\n\nexport class SpinnerComponent extends React.Component {\n\n private spinnerService = spinnerService;\n\n set show(show: boolean) {\n this.setState({ show });\n }\n\n get show() {\n return this.state.show;\n }\n\n get name() {\n return this.props.name;\n }\n\n get group() {\n return this.props.group;\n }\n\n componentWillMount() {\n this.state = {\n show: this.props.hasOwnProperty('show') ? this.props.show : false\n };\n\n if (this.props.hasOwnProperty('spinnerService')) {\n this.spinnerService = this.props.spinnerService;\n }\n\n this.spinnerService._register(this);\n }\n\n componentWillUnmount() {\n this.spinnerService._unregister(this);\n }\n\n render() {\n if (this.state.show) {\n const { loadingImage } = this.props;\n return (\n