@pluginjs/loader
Advanced tools
Comparing version 0.7.4 to 0.7.5
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (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; |
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (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; |
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
@@ -5,0 +5,0 @@ */ |
/*! | ||
* @pluginjs/loader v0.7.4 (https://pluginjs.com) | ||
* Copyright 2018 Creation Studio Limited | ||
* @pluginjs/loader v0.7.5 (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}); |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"category": "ui", | ||
@@ -41,18 +41,18 @@ "main": "dist/loader.common.js", | ||
"dependencies": { | ||
"@pluginjs/classes": "^0.7.4", | ||
"@pluginjs/component": "^0.7.4", | ||
"@pluginjs/decorator": "^0.7.4", | ||
"@pluginjs/dom": "^0.7.4", | ||
"@pluginjs/events": "^0.7.4", | ||
"@pluginjs/factory": "^0.7.4", | ||
"@pluginjs/is": "^0.7.4", | ||
"@pluginjs/styled": "^0.7.4", | ||
"@pluginjs/classes": "^0.7.5", | ||
"@pluginjs/component": "^0.7.5", | ||
"@pluginjs/decorator": "^0.7.5", | ||
"@pluginjs/dom": "^0.7.5", | ||
"@pluginjs/events": "^0.7.5", | ||
"@pluginjs/factory": "^0.7.5", | ||
"@pluginjs/is": "^0.7.5", | ||
"@pluginjs/styled": "^0.7.5", | ||
"@pluginjs/styles": "^0.7.1", | ||
"@pluginjs/template": "^0.7.4", | ||
"@pluginjs/utils": "^0.7.4" | ||
"@pluginjs/template": "^0.7.5", | ||
"@pluginjs/utils": "^0.7.5" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.1.5", | ||
"@babel/core": "^7.2.2", | ||
"@pluginjs/browserslist-config": "^1.2.2", | ||
"@pluginjs/cli": "^0.7.4", | ||
"@pluginjs/cli": "^0.7.5", | ||
"babel-jest": "*", | ||
@@ -83,3 +83,3 @@ "jest": "*", | ||
], | ||
"gitHead": "15dd296725c971ec08d33abd1c655b205a52ade6" | ||
"gitHead": "a5b515ae1dc38f5f84fb18c70c322d361050593c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Updated@pluginjs/classes@^0.7.5
Updated@pluginjs/component@^0.7.5
Updated@pluginjs/decorator@^0.7.5
Updated@pluginjs/dom@^0.7.5
Updated@pluginjs/events@^0.7.5
Updated@pluginjs/factory@^0.7.5
Updated@pluginjs/is@^0.7.5
Updated@pluginjs/styled@^0.7.5
Updated@pluginjs/template@^0.7.5
Updated@pluginjs/utils@^0.7.5