@pluginjs/loader
Advanced tools
Comparing version 0.7.9 to 0.7.10
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var Component = _interopDefault(require('@pluginjs/component')); | ||
var classes = require('@pluginjs/classes'); | ||
var dom = require('@pluginjs/dom'); | ||
var styled = require('@pluginjs/styled'); | ||
var decorator = require('@pluginjs/decorator'); | ||
const namespace = 'loader'; | ||
const events = { | ||
READY: 'ready', | ||
DESTROY: 'destroy', | ||
SHOW: 'show', | ||
HIDE: 'hide' | ||
}; | ||
const classes$1 = { | ||
NAMESPACE: 'pj-loader', | ||
LOADER: '{namespace}', | ||
THEME: '{namespace}--{theme}', | ||
SHOW: '{namespace}-show', | ||
SIZE: '{namespace}-{size}', | ||
TEXT: '{namespace}-text', | ||
MASK: '{namespace}-mask' | ||
}; | ||
const methods = ['destroy', 'show', 'hide', 'toggle']; | ||
const defaults = { | ||
theme: 'circle', | ||
// circle, rolling, snake, ripple, dot, ring, clock, flip, windmill | ||
size: null, | ||
// sm, lg | ||
text: null, | ||
background: null, | ||
color: null | ||
}; | ||
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class; | ||
let Loader = (_dec = decorator.themeable(), _dec2 = decorator.styleable(classes$1), _dec3 = decorator.eventable(events), _dec4 = decorator.stateable(), _dec5 = decorator.optionable(defaults, true), _dec6 = decorator.register(namespace, { | ||
methods: methods | ||
}), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = _dec5(_class = _dec6(_class = class Loader extends Component { | ||
constructor(element) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
super(element); | ||
this.setupOptions(options); | ||
this.setupClasses(); | ||
this.setupStates(); | ||
this.initialize(); | ||
} | ||
initialize() { | ||
this.$mask = dom.appendTo(`<div class="${this.classes.MASK}"></div>`, this.element); | ||
this.$loader = dom.appendTo(`<div class="${this.classes.LOADER}"></div>`, this.$mask); | ||
if (this.options.size) { | ||
classes.addClass(this.getClass(this.classes.SIZE, 'size', this.options.size), this.$loader); | ||
} | ||
if (this.options.theme) { | ||
classes.addClass(this.getThemeClass(), this.$loader); | ||
} | ||
if (this.options.background) { | ||
styled.setStyle('background', this.options.background, this.$mask); | ||
} | ||
if (this.options.color) { | ||
styled.setStyle('color', this.options.color, this.$loader); | ||
} | ||
if (this.options.text) { | ||
this.$text = dom.append(`<div class="${this.classes.TEXT}">${this.options.text}</div>`, this.$mask); | ||
} | ||
this.enter('initialized'); | ||
this.trigger(events.READY); | ||
} | ||
destroy() { | ||
if (this.is('initialized')) { | ||
// this.unbind() | ||
if (this.options.text) { | ||
this.$text.remove(); | ||
} | ||
this.$loader.remove(); // if (this.options.theme) { | ||
// removeClass(this.getThemeClass(), this.$loader) | ||
// } | ||
// if (this.is('shown')) { | ||
// removeClass(this.classes.SHOW, this.$mask) | ||
// } | ||
this.$mask.remove(); | ||
this.leave('initialized'); | ||
} | ||
this.trigger(events.DESTROY); | ||
super.destroy(); | ||
} | ||
toggle() { | ||
if (this.is('shown')) { | ||
this.hide(); | ||
} else { | ||
this.show(); | ||
} | ||
} | ||
show() { | ||
if (!this.is('shown')) { | ||
classes.addClass(this.classes.SHOW, this.$mask); | ||
this.enter('shown'); | ||
} | ||
this.trigger(events.SHOW); | ||
} | ||
hide() { | ||
if (this.is('shown')) { | ||
classes.removeClass(this.classes.SHOW, this.$mask); | ||
this.leave('shown'); | ||
} | ||
this.trigger(events.HIDE); | ||
} | ||
}) || _class) || _class) || _class) || _class) || _class) || _class); | ||
module.exports = Loader; | ||
undefined |
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
"use strict";function _interopDefault(s){return s&&"object"==typeof s&&"default"in s?s.default:s}var Component=_interopDefault(require("@pluginjs/component")),classes=require("@pluginjs/classes"),dom=require("@pluginjs/dom"),styled=require("@pluginjs/styled"),decorator=require("@pluginjs/decorator");const namespace="loader",events={READY:"ready",DESTROY:"destroy",SHOW:"show",HIDE:"hide"},classes$1={NAMESPACE:"pj-loader",LOADER:"{namespace}",THEME:"{namespace}--{theme}",SHOW:"{namespace}-show",SIZE:"{namespace}-{size}",TEXT:"{namespace}-text",MASK:"{namespace}-mask"},methods=["destroy","show","hide","toggle"],defaults={theme:"circle",size:null,text:null,background:null,color:null};var _dec,_dec2,_dec3,_dec4,_dec5,_dec6,_class;let Loader=(_dec=decorator.themeable())(_class=(_dec2=decorator.styleable(classes$1))(_class=(_dec3=decorator.eventable(events))(_class=(_dec4=decorator.stateable())(_class=(_dec5=decorator.optionable(defaults,!0))(_class=(_dec6=decorator.register("loader",{methods:methods}))(_class=class extends Component{constructor(s){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(s),this.setupOptions(e),this.setupClasses(),this.setupStates(),this.initialize()}initialize(){this.$mask=dom.appendTo(`<div class="${this.classes.MASK}"></div>`,this.element),this.$loader=dom.appendTo(`<div class="${this.classes.LOADER}"></div>`,this.$mask),this.options.size&&classes.addClass(this.getClass(this.classes.SIZE,"size",this.options.size),this.$loader),this.options.theme&&classes.addClass(this.getThemeClass(),this.$loader),this.options.background&&styled.setStyle("background",this.options.background,this.$mask),this.options.color&&styled.setStyle("color",this.options.color,this.$loader),this.options.text&&(this.$text=dom.append(`<div class="${this.classes.TEXT}">${this.options.text}</div>`,this.$mask)),this.enter("initialized"),this.trigger(events.READY)}destroy(){this.is("initialized")&&(this.options.text&&this.$text.remove(),this.$loader.remove(),this.$mask.remove(),this.leave("initialized")),this.trigger(events.DESTROY),super.destroy()}toggle(){this.is("shown")?this.hide():this.show()}show(){this.is("shown")||(classes.addClass(this.classes.SHOW,this.$mask),this.enter("shown")),this.trigger(events.SHOW)}hide(){this.is("shown")&&(classes.removeClass(this.classes.SHOW,this.$mask),this.leave("shown")),this.trigger(events.HIDE)}})||_class)||_class)||_class)||_class)||_class)||_class;module.exports=Loader; | ||
undefined |
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
import Component from '@pluginjs/component'; | ||
import { addClass, removeClass } from '@pluginjs/classes'; | ||
import { append, appendTo } from '@pluginjs/dom'; | ||
import { setStyle } from '@pluginjs/styled'; | ||
import { eventable, register, stateable, styleable, themeable, optionable } from '@pluginjs/decorator'; | ||
const namespace = 'loader'; | ||
const events = { | ||
READY: 'ready', | ||
DESTROY: 'destroy', | ||
SHOW: 'show', | ||
HIDE: 'hide' | ||
}; | ||
const classes = { | ||
NAMESPACE: 'pj-loader', | ||
LOADER: '{namespace}', | ||
THEME: '{namespace}--{theme}', | ||
SHOW: '{namespace}-show', | ||
SIZE: '{namespace}-{size}', | ||
TEXT: '{namespace}-text', | ||
MASK: '{namespace}-mask' | ||
}; | ||
const methods = ['destroy', 'show', 'hide', 'toggle']; | ||
const defaults = { | ||
theme: 'circle', | ||
// circle, rolling, snake, ripple, dot, ring, clock, flip, windmill | ||
size: null, | ||
// sm, lg | ||
text: null, | ||
background: null, | ||
color: null | ||
}; | ||
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class; | ||
let Loader = (_dec = themeable(), _dec2 = styleable(classes), _dec3 = eventable(events), _dec4 = stateable(), _dec5 = optionable(defaults, true), _dec6 = register(namespace, { | ||
methods: methods | ||
}), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = _dec5(_class = _dec6(_class = class Loader extends Component { | ||
constructor(element) { | ||
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
super(element); | ||
this.setupOptions(options); | ||
this.setupClasses(); | ||
this.setupStates(); | ||
this.initialize(); | ||
} | ||
initialize() { | ||
this.$mask = appendTo(`<div class="${this.classes.MASK}"></div>`, this.element); | ||
this.$loader = appendTo(`<div class="${this.classes.LOADER}"></div>`, this.$mask); | ||
if (this.options.size) { | ||
addClass(this.getClass(this.classes.SIZE, 'size', this.options.size), this.$loader); | ||
} | ||
if (this.options.theme) { | ||
addClass(this.getThemeClass(), this.$loader); | ||
} | ||
if (this.options.background) { | ||
setStyle('background', this.options.background, this.$mask); | ||
} | ||
if (this.options.color) { | ||
setStyle('color', this.options.color, this.$loader); | ||
} | ||
if (this.options.text) { | ||
this.$text = append(`<div class="${this.classes.TEXT}">${this.options.text}</div>`, this.$mask); | ||
} | ||
this.enter('initialized'); | ||
this.trigger(events.READY); | ||
} | ||
destroy() { | ||
if (this.is('initialized')) { | ||
// this.unbind() | ||
if (this.options.text) { | ||
this.$text.remove(); | ||
} | ||
this.$loader.remove(); // if (this.options.theme) { | ||
// removeClass(this.getThemeClass(), this.$loader) | ||
// } | ||
// if (this.is('shown')) { | ||
// removeClass(this.classes.SHOW, this.$mask) | ||
// } | ||
this.$mask.remove(); | ||
this.leave('initialized'); | ||
} | ||
this.trigger(events.DESTROY); | ||
super.destroy(); | ||
} | ||
toggle() { | ||
if (this.is('shown')) { | ||
this.hide(); | ||
} else { | ||
this.show(); | ||
} | ||
} | ||
show() { | ||
if (!this.is('shown')) { | ||
addClass(this.classes.SHOW, this.$mask); | ||
this.enter('shown'); | ||
} | ||
this.trigger(events.SHOW); | ||
} | ||
hide() { | ||
if (this.is('shown')) { | ||
removeClass(this.classes.SHOW, this.$mask); | ||
this.leave('shown'); | ||
} | ||
this.trigger(events.HIDE); | ||
} | ||
}) || _class) || _class) || _class) || _class) || _class) || _class); | ||
export default Loader; | ||
undefined |
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
import Component from"@pluginjs/component";import{addClass,removeClass}from"@pluginjs/classes";import{append,appendTo}from"@pluginjs/dom";import{setStyle}from"@pluginjs/styled";import{eventable,register,stateable,styleable,themeable,optionable}from"@pluginjs/decorator";const namespace="loader",events={READY:"ready",DESTROY:"destroy",SHOW:"show",HIDE:"hide"},classes={NAMESPACE:"pj-loader",LOADER:"{namespace}",THEME:"{namespace}--{theme}",SHOW:"{namespace}-show",SIZE:"{namespace}-{size}",TEXT:"{namespace}-text",MASK:"{namespace}-mask"},methods=["destroy","show","hide","toggle"],defaults={theme:"circle",size:null,text:null,background:null,color:null};var _dec,_dec2,_dec3,_dec4,_dec5,_dec6,_class;let Loader=(_dec=themeable())(_class=(_dec2=styleable(classes))(_class=(_dec3=eventable(events))(_class=(_dec4=stateable())(_class=(_dec5=optionable(defaults,!0))(_class=(_dec6=register("loader",{methods:methods}))(_class=class extends Component{constructor(s){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(s),this.setupOptions(e),this.setupClasses(),this.setupStates(),this.initialize()}initialize(){this.$mask=appendTo(`<div class="${this.classes.MASK}"></div>`,this.element),this.$loader=appendTo(`<div class="${this.classes.LOADER}"></div>`,this.$mask),this.options.size&&addClass(this.getClass(this.classes.SIZE,"size",this.options.size),this.$loader),this.options.theme&&addClass(this.getThemeClass(),this.$loader),this.options.background&&setStyle("background",this.options.background,this.$mask),this.options.color&&setStyle("color",this.options.color,this.$loader),this.options.text&&(this.$text=append(`<div class="${this.classes.TEXT}">${this.options.text}</div>`,this.$mask)),this.enter("initialized"),this.trigger(events.READY)}destroy(){this.is("initialized")&&(this.options.text&&this.$text.remove(),this.$loader.remove(),this.$mask.remove(),this.leave("initialized")),this.trigger(events.DESTROY),super.destroy()}toggle(){this.is("shown")?this.hide():this.show()}show(){this.is("shown")||(addClass(this.classes.SHOW,this.$mask),this.enter("shown")),this.trigger(events.SHOW)}hide(){this.is("shown")&&(removeClass(this.classes.SHOW,this.$mask),this.leave("shown")),this.trigger(events.HIDE)}})||_class)||_class)||_class)||_class)||_class)||_class;export default Loader; | ||
undefined |
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@pluginjs/component'), require('@pluginjs/classes'), require('@pluginjs/dom'), require('@pluginjs/styled'), require('@pluginjs/decorator')) : | ||
typeof define === 'function' && define.amd ? define(['@pluginjs/component', '@pluginjs/classes', '@pluginjs/dom', '@pluginjs/styled', '@pluginjs/decorator'], factory) : | ||
(global['@pluginjs/loader'] = factory(global['@pluginjs/component'],global['@pluginjs/classes'],global['@pluginjs/dom'],global['@pluginjs/styled'],global['@pluginjs/decorator'])); | ||
}(this, (function (Component,classes,dom,styled,decorator) { 'use strict'; | ||
Component = Component && Component.hasOwnProperty('default') ? Component['default'] : Component; | ||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
} | ||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | ||
return o.__proto__ || Object.getPrototypeOf(o); | ||
}; | ||
return _getPrototypeOf(o); | ||
} | ||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
return _setPrototypeOf(o, p); | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
function _possibleConstructorReturn(self, call) { | ||
if (call && (typeof call === "object" || typeof call === "function")) { | ||
return call; | ||
} | ||
return _assertThisInitialized(self); | ||
} | ||
function _superPropBase(object, property) { | ||
while (!Object.prototype.hasOwnProperty.call(object, property)) { | ||
object = _getPrototypeOf(object); | ||
if (object === null) break; | ||
} | ||
return object; | ||
} | ||
function _get(target, property, receiver) { | ||
if (typeof Reflect !== "undefined" && Reflect.get) { | ||
_get = Reflect.get; | ||
} else { | ||
_get = function _get(target, property, receiver) { | ||
var base = _superPropBase(target, property); | ||
if (!base) return; | ||
var desc = Object.getOwnPropertyDescriptor(base, property); | ||
if (desc.get) { | ||
return desc.get.call(receiver); | ||
} | ||
return desc.value; | ||
}; | ||
} | ||
return _get(target, property, receiver || target); | ||
} | ||
var namespace = 'loader'; | ||
var events = { | ||
READY: 'ready', | ||
DESTROY: 'destroy', | ||
SHOW: 'show', | ||
HIDE: 'hide' | ||
}; | ||
var classes$1 = { | ||
NAMESPACE: 'pj-loader', | ||
LOADER: '{namespace}', | ||
THEME: '{namespace}--{theme}', | ||
SHOW: '{namespace}-show', | ||
SIZE: '{namespace}-{size}', | ||
TEXT: '{namespace}-text', | ||
MASK: '{namespace}-mask' | ||
}; | ||
var methods = ['destroy', 'show', 'hide', 'toggle']; | ||
var defaults = { | ||
theme: 'circle', | ||
// circle, rolling, snake, ripple, dot, ring, clock, flip, windmill | ||
size: null, | ||
// sm, lg | ||
text: null, | ||
background: null, | ||
color: null | ||
}; | ||
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class; | ||
var Loader = (_dec = decorator.themeable(), _dec2 = decorator.styleable(classes$1), _dec3 = decorator.eventable(events), _dec4 = decorator.stateable(), _dec5 = decorator.optionable(defaults, true), _dec6 = decorator.register(namespace, { | ||
methods: methods | ||
}), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = _dec5(_class = _dec6(_class = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(Loader, _Component); | ||
function Loader(element) { | ||
var _this; | ||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
_classCallCheck(this, Loader); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(Loader).call(this, element)); | ||
_this.setupOptions(options); | ||
_this.setupClasses(); | ||
_this.setupStates(); | ||
_this.initialize(); | ||
return _this; | ||
} | ||
_createClass(Loader, [{ | ||
key: "initialize", | ||
value: function initialize() { | ||
this.$mask = dom.appendTo("<div class=\"".concat(this.classes.MASK, "\"></div>"), this.element); | ||
this.$loader = dom.appendTo("<div class=\"".concat(this.classes.LOADER, "\"></div>"), this.$mask); | ||
if (this.options.size) { | ||
classes.addClass(this.getClass(this.classes.SIZE, 'size', this.options.size), this.$loader); | ||
} | ||
if (this.options.theme) { | ||
classes.addClass(this.getThemeClass(), this.$loader); | ||
} | ||
if (this.options.background) { | ||
styled.setStyle('background', this.options.background, this.$mask); | ||
} | ||
if (this.options.color) { | ||
styled.setStyle('color', this.options.color, this.$loader); | ||
} | ||
if (this.options.text) { | ||
this.$text = dom.append("<div class=\"".concat(this.classes.TEXT, "\">").concat(this.options.text, "</div>"), this.$mask); | ||
} | ||
this.enter('initialized'); | ||
this.trigger(events.READY); | ||
} | ||
}, { | ||
key: "destroy", | ||
value: function destroy() { | ||
if (this.is('initialized')) { | ||
// this.unbind() | ||
if (this.options.text) { | ||
this.$text.remove(); | ||
} | ||
this.$loader.remove(); // if (this.options.theme) { | ||
// removeClass(this.getThemeClass(), this.$loader) | ||
// } | ||
// if (this.is('shown')) { | ||
// removeClass(this.classes.SHOW, this.$mask) | ||
// } | ||
this.$mask.remove(); | ||
this.leave('initialized'); | ||
} | ||
this.trigger(events.DESTROY); | ||
_get(_getPrototypeOf(Loader.prototype), "destroy", this).call(this); | ||
} | ||
}, { | ||
key: "toggle", | ||
value: function toggle() { | ||
if (this.is('shown')) { | ||
this.hide(); | ||
} else { | ||
this.show(); | ||
} | ||
} | ||
}, { | ||
key: "show", | ||
value: function show() { | ||
if (!this.is('shown')) { | ||
classes.addClass(this.classes.SHOW, this.$mask); | ||
this.enter('shown'); | ||
} | ||
this.trigger(events.SHOW); | ||
} | ||
}, { | ||
key: "hide", | ||
value: function hide() { | ||
if (this.is('shown')) { | ||
classes.removeClass(this.classes.SHOW, this.$mask); | ||
this.leave('shown'); | ||
} | ||
this.trigger(events.HIDE); | ||
} | ||
}]); | ||
return Loader; | ||
}(Component)) || _class) || _class) || _class) || _class) || _class) || _class); | ||
return Loader; | ||
}))); | ||
undefined |
/*! | ||
* @pluginjs/loader v0.7.9 (https://pluginjs.com) | ||
* @pluginjs/loader v0.7.10 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@pluginjs/component"),require("@pluginjs/classes"),require("@pluginjs/dom"),require("@pluginjs/styled"),require("@pluginjs/decorator")):"function"==typeof define&&define.amd?define(["@pluginjs/component","@pluginjs/classes","@pluginjs/dom","@pluginjs/styled","@pluginjs/decorator"],t):e["@pluginjs/loader"]=t(e["@pluginjs/component"],e["@pluginjs/classes"],e["@pluginjs/dom"],e["@pluginjs/styled"],e["@pluginjs/decorator"])}(this,function(e,t,s,i,n){"use strict";function o(e,t){for(var s=0;s<t.length;s++){var i=t[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t,s){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,s){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}(e,t);if(i){var n=Object.getOwnPropertyDescriptor(i,t);return n.get?n.get.call(s):n.value}})(e,t,s||e)}e=e&&e.hasOwnProperty("default")?e.default:e;var u,h={READY:"ready",DESTROY:"destroy",SHOW:"show",HIDE:"hide"};return n.themeable()(u=n.styleable({NAMESPACE:"pj-loader",LOADER:"{namespace}",THEME:"{namespace}--{theme}",SHOW:"{namespace}-show",SIZE:"{namespace}-{size}",TEXT:"{namespace}-text",MASK:"{namespace}-mask"})(u=n.eventable(h)(u=n.stateable()(u=n.optionable({theme:"circle",size:null,text:null,background:null,color:null},!0)(u=n.register("loader",{methods:["destroy","show","hide","toggle"]})(u=function(n){function u(e){var t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=l(this,r(u).call(this,e))).setupOptions(s),t.setupClasses(),t.setupStates(),t.initialize(),t}var p,d,f;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(u,e),p=u,(d=[{key:"initialize",value:function(){this.$mask=s.appendTo('<div class="'.concat(this.classes.MASK,'"></div>'),this.element),this.$loader=s.appendTo('<div class="'.concat(this.classes.LOADER,'"></div>'),this.$mask),this.options.size&&t.addClass(this.getClass(this.classes.SIZE,"size",this.options.size),this.$loader),this.options.theme&&t.addClass(this.getThemeClass(),this.$loader),this.options.background&&i.setStyle("background",this.options.background,this.$mask),this.options.color&&i.setStyle("color",this.options.color,this.$loader),this.options.text&&(this.$text=s.append('<div class="'.concat(this.classes.TEXT,'">').concat(this.options.text,"</div>"),this.$mask)),this.enter("initialized"),this.trigger(h.READY)}},{key:"destroy",value:function(){this.is("initialized")&&(this.options.text&&this.$text.remove(),this.$loader.remove(),this.$mask.remove(),this.leave("initialized")),this.trigger(h.DESTROY),c(r(u.prototype),"destroy",this).call(this)}},{key:"toggle",value:function(){this.is("shown")?this.hide():this.show()}},{key:"show",value:function(){this.is("shown")||(t.addClass(this.classes.SHOW,this.$mask),this.enter("shown")),this.trigger(h.SHOW)}},{key:"hide",value:function(){this.is("shown")&&(t.removeClass(this.classes.SHOW,this.$mask),this.leave("shown")),this.trigger(h.HIDE)}}])&&o(p.prototype,d),f&&o(p,f),u}())||u)||u)||u)||u)||u)||u}); | ||
undefined |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.7.9", | ||
"version": "0.7.10", | ||
"category": "ui", | ||
@@ -41,18 +41,18 @@ "main": "dist/loader.common.js", | ||
"dependencies": { | ||
"@pluginjs/classes": "^0.7.8", | ||
"@pluginjs/component": "^0.7.7", | ||
"@pluginjs/decorator": "^0.7.8", | ||
"@pluginjs/dom": "^0.7.8", | ||
"@pluginjs/events": "^0.7.8", | ||
"@pluginjs/factory": "^0.7.8", | ||
"@pluginjs/is": "^0.7.7", | ||
"@pluginjs/styled": "^0.7.8", | ||
"@pluginjs/styles": "^0.7.3", | ||
"@pluginjs/template": "^0.7.8", | ||
"@pluginjs/utils": "^0.7.8" | ||
"@pluginjs/classes": "^0.7.9", | ||
"@pluginjs/component": "^0.7.8", | ||
"@pluginjs/decorator": "^0.7.9", | ||
"@pluginjs/dom": "^0.7.9", | ||
"@pluginjs/events": "^0.7.9", | ||
"@pluginjs/factory": "^0.7.9", | ||
"@pluginjs/is": "^0.7.8", | ||
"@pluginjs/styled": "^0.7.9", | ||
"@pluginjs/styles": "^0.7.4", | ||
"@pluginjs/template": "^0.7.9", | ||
"@pluginjs/utils": "^0.7.9" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@pluginjs/browserslist-config": "^1.2.4", | ||
"@pluginjs/cli": "^0.7.7", | ||
"@babel/core": "^7.4.4", | ||
"@pluginjs/browserslist-config": "^1.2.5", | ||
"@pluginjs/cli": "^0.7.8", | ||
"babel-jest": "*", | ||
@@ -82,4 +82,3 @@ "jest": "*", | ||
"extends @pluginjs/browserslist-config" | ||
], | ||
"gitHead": "290fd3939aca081ceab305e0d4157ee0d52b45bf" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
27414
14
384
Updated@pluginjs/classes@^0.7.9
Updated@pluginjs/component@^0.7.8
Updated@pluginjs/decorator@^0.7.9
Updated@pluginjs/dom@^0.7.9
Updated@pluginjs/events@^0.7.9
Updated@pluginjs/factory@^0.7.9
Updated@pluginjs/is@^0.7.8
Updated@pluginjs/styled@^0.7.9
Updated@pluginjs/styles@^0.7.4
Updated@pluginjs/template@^0.7.9
Updated@pluginjs/utils@^0.7.9