vue-loading-overlay
Advanced tools
Comparing version 6.0.2 to 6.0.3
@@ -15,3 +15,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 935: | ||
/***/ 657: | ||
/***/ ((__unused_webpack_module, exports) => { | ||
@@ -119,8 +119,7 @@ | ||
} else { | ||
var _el$parentNode; | ||
(_el$parentNode = el.parentNode) === null || _el$parentNode === void 0 ? void 0 : _el$parentNode.removeChild(el); | ||
el.parentNode?.removeChild(el); | ||
} | ||
} // Taken from https://github.com/moyoujun/vue3-loading-overlay/blob/master/src/index.ts | ||
} | ||
// Taken from https://github.com/moyoujun/vue3-loading-overlay/blob/master/src/index.ts | ||
function createComponent(component, props, parentContainer) { | ||
@@ -139,3 +138,3 @@ let slots = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
const MayBeHTMLElement = hasWindow() ? window.HTMLElement : Object; | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/js/Component.vue?vue&type=template&id=fdbca6ec | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/js/Component.vue?vue&type=template&id=fdbca6ec | ||
@@ -183,3 +182,2 @@ const _hoisted_1 = ["aria-busy"]; | ||
}, | ||
methods: { | ||
@@ -189,10 +187,14 @@ focusIn(event) { | ||
if (!this.isActive) return; | ||
if ( // Event target is the loading div element itself | ||
event.target === this.$el || // Event target is inside the loading div | ||
this.$el.contains(event.target)) return; // Use container as parent when available otherwise use parent element when isFullPage is false | ||
if ( | ||
// Event target is the loading div element itself | ||
event.target === this.$el || | ||
// Event target is inside the loading div | ||
this.$el.contains(event.target)) return; | ||
// Use container as parent when available otherwise use parent element when isFullPage is false | ||
let parent = this.container ? this.container : this.isFullPage ? null : this.$el.parentElement; | ||
if ( // Always prevent when loading is full screen | ||
this.isFullPage || // When a parent exist means loader is running inside a container | ||
if ( | ||
// Always prevent when loading is full screen | ||
this.isFullPage || | ||
// When a parent exist means loader is running inside a container | ||
// When loading is NOT full screen and event target is inside the given container | ||
@@ -204,16 +206,11 @@ parent && parent.contains(event.target)) { | ||
} | ||
}, | ||
beforeUnmount() { | ||
document.removeEventListener('focusin', this.focusIn); | ||
} | ||
}); | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/spinner.vue?vue&type=template&id=1ed0a811 | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/spinner.vue?vue&type=template&id=1ed0a811 | ||
const spinnervue_type_template_id_1ed0a811_hoisted_1 = ["width", "height", "stroke"]; | ||
const spinnervue_type_template_id_1ed0a811_hoisted_2 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.createStaticVNode)("<g fill=\"none\" fill-rule=\"evenodd\"><g transform=\"translate(1 1)\" stroke-width=\"2\"><circle stroke-opacity=\".25\" cx=\"18\" cy=\"18\" r=\"18\"></circle><path d=\"M36 18c0-9.94-8.06-18-18-18\"><animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 18 18\" to=\"360 18 18\" dur=\"0.8s\" repeatCount=\"indefinite\"></animateTransform></path></g></g>", 1); | ||
const _hoisted_3 = [spinnervue_type_template_id_1ed0a811_hoisted_2]; | ||
@@ -231,3 +228,3 @@ function spinnervue_type_template_id_1ed0a811_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/spinner.vue?vue&type=script&lang=js | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/spinner.vue?vue&type=script&lang=js | ||
@@ -253,4 +250,4 @@ /* harmony default export */ const spinnervue_type_script_lang_js = ((0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.defineComponent)({ | ||
// EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/exportHelper.js | ||
var exportHelper = __webpack_require__(935); | ||
// EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/exportHelper.js | ||
var exportHelper = __webpack_require__(657); | ||
;// CONCATENATED MODULE: ./src/loaders/spinner.vue | ||
@@ -265,8 +262,6 @@ | ||
/* harmony default export */ const spinner = (__exports__); | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/dots.vue?vue&type=template&id=6ecfb4ba | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/dots.vue?vue&type=template&id=6ecfb4ba | ||
const dotsvue_type_template_id_6ecfb4ba_hoisted_1 = ["fill", "width", "height"]; | ||
const dotsvue_type_template_id_6ecfb4ba_hoisted_2 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.createStaticVNode)("<circle cx=\"15\" cy=\"15\" r=\"15\"><animate attributeName=\"r\" from=\"15\" to=\"15\" begin=\"0s\" dur=\"0.8s\" values=\"15;9;15\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate><animate attributeName=\"fill-opacity\" from=\"1\" to=\"1\" begin=\"0s\" dur=\"0.8s\" values=\"1;.5;1\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate></circle><circle cx=\"60\" cy=\"15\" r=\"9\" fill-opacity=\"0.3\"><animate attributeName=\"r\" from=\"9\" to=\"9\" begin=\"0s\" dur=\"0.8s\" values=\"9;15;9\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate><animate attributeName=\"fill-opacity\" from=\"0.5\" to=\"0.5\" begin=\"0s\" dur=\"0.8s\" values=\".5;1;.5\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate></circle><circle cx=\"105\" cy=\"15\" r=\"15\"><animate attributeName=\"r\" from=\"15\" to=\"15\" begin=\"0s\" dur=\"0.8s\" values=\"15;9;15\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate><animate attributeName=\"fill-opacity\" from=\"1\" to=\"1\" begin=\"0s\" dur=\"0.8s\" values=\"1;.5;1\" calcMode=\"linear\" repeatCount=\"indefinite\"></animate></circle>", 3); | ||
const _hoisted_5 = [dotsvue_type_template_id_6ecfb4ba_hoisted_2]; | ||
@@ -284,3 +279,3 @@ function dotsvue_type_template_id_6ecfb4ba_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/dots.vue?vue&type=script&lang=js | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/dots.vue?vue&type=script&lang=js | ||
@@ -315,8 +310,6 @@ /* harmony default export */ const dotsvue_type_script_lang_js = ((0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.defineComponent)({ | ||
/* harmony default export */ const dots = (dots_exports_); | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/bars.vue?vue&type=template&id=f81ac1c0 | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/bars.vue?vue&type=template&id=f81ac1c0 | ||
const barsvue_type_template_id_f81ac1c0_hoisted_1 = ["height", "width", "fill"]; | ||
const barsvue_type_template_id_f81ac1c0_hoisted_2 = /*#__PURE__*/(0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.createStaticVNode)("<rect x=\"0\" y=\"13\" width=\"4\" height=\"5\"><animate attributeName=\"height\" attributeType=\"XML\" values=\"5;21;5\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate><animate attributeName=\"y\" attributeType=\"XML\" values=\"13; 5; 13\" begin=\"0s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate></rect><rect x=\"10\" y=\"13\" width=\"4\" height=\"5\"><animate attributeName=\"height\" attributeType=\"XML\" values=\"5;21;5\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate><animate attributeName=\"y\" attributeType=\"XML\" values=\"13; 5; 13\" begin=\"0.15s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate></rect><rect x=\"20\" y=\"13\" width=\"4\" height=\"5\"><animate attributeName=\"height\" attributeType=\"XML\" values=\"5;21;5\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate><animate attributeName=\"y\" attributeType=\"XML\" values=\"13; 5; 13\" begin=\"0.3s\" dur=\"0.6s\" repeatCount=\"indefinite\"></animate></rect>", 3); | ||
const barsvue_type_template_id_f81ac1c0_hoisted_5 = [barsvue_type_template_id_f81ac1c0_hoisted_2]; | ||
@@ -334,3 +327,3 @@ function barsvue_type_template_id_f81ac1c0_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/bars.vue?vue&type=script&lang=js | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/loaders/bars.vue?vue&type=script&lang=js | ||
@@ -374,3 +367,3 @@ /* harmony default export */ const barsvue_type_script_lang_js = ((0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.defineComponent)({ | ||
}); | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.2.5_rhsdbzevgb5tizdhlla5jsbgyu/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.0_webpack@5.74.0/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/js/Component.vue?vue&type=script&lang=js | ||
;// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@9.1.2_la66t7xldg4uecmyawueag5wkm/node_modules/babel-loader/lib/index.js!./node_modules/.pnpm/vue-loader@17.0.1_fsjtiqkk4imwn72zedmhnjvnrm/node_modules/vue-loader/dist/index.js??ruleSet[1].rules[5].use[0]!./src/js/Component.vue?vue&type=script&lang=js | ||
@@ -400,3 +393,2 @@ | ||
}, | ||
/** | ||
@@ -406,3 +398,2 @@ * Allow user to hide the loader | ||
canCancel: Boolean, | ||
/** | ||
@@ -428,3 +419,2 @@ * Do something on cancel | ||
emits: ['hide', 'update:active'], | ||
data() { | ||
@@ -436,7 +426,5 @@ return { | ||
}, | ||
mounted() { | ||
document.addEventListener('keyup', this.keyPress); | ||
}, | ||
methods: { | ||
@@ -452,3 +440,2 @@ /** | ||
}, | ||
/** | ||
@@ -460,9 +447,9 @@ * Hide and destroy component if it's programmatic. | ||
this.$emit('update:active', false); | ||
if (this.programmatic) { | ||
this.isActive = false; // Timeout for the animation complete before destroying | ||
this.isActive = false; | ||
// Timeout for the animation complete before destroying | ||
setTimeout(() => { | ||
const parent = this.$el.parentElement; // unmount the component | ||
const parent = this.$el.parentElement; | ||
// unmount the component | ||
(0,external_commonjs_vue_commonjs2_vue_amd_vue_root_Vue_.render)(null, parent); | ||
@@ -473,3 +460,2 @@ removeElement(parent); | ||
}, | ||
disableScroll() { | ||
@@ -480,3 +466,2 @@ if (this.isFullPage && this.lockScroll) { | ||
}, | ||
enableScroll() { | ||
@@ -487,3 +472,2 @@ if (this.isFullPage && this.lockScroll) { | ||
}, | ||
/** | ||
@@ -496,3 +480,2 @@ * Key press event to hide on ESC. | ||
} | ||
}, | ||
@@ -503,3 +486,2 @@ watch: { | ||
}, | ||
isActive(value) { | ||
@@ -512,3 +494,2 @@ if (value) { | ||
} | ||
}, | ||
@@ -522,9 +503,6 @@ computed: { | ||
} | ||
}, | ||
beforeUnmount() { | ||
document.removeEventListener('keyup', this.keyPress); | ||
} | ||
})); | ||
@@ -558,3 +536,4 @@ ;// CONCATENATED MODULE: ./src/js/Component.vue?vue&type=script&lang=js | ||
}; | ||
const propsData = { ...globalProps, | ||
const propsData = { | ||
...globalProps, | ||
...props, | ||
@@ -564,3 +543,2 @@ ...forceProps | ||
let container = propsData.container; | ||
if (!propsData.container) { | ||
@@ -570,4 +548,4 @@ container = document.body; | ||
} | ||
const mergedSlots = { ...globalSlots, | ||
const mergedSlots = { | ||
...globalSlots, | ||
...slots | ||
@@ -580,3 +558,2 @@ }; | ||
} | ||
}; | ||
@@ -588,3 +565,2 @@ } | ||
const LoadingPlugin = function (app) { | ||
@@ -597,3 +573,2 @@ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
}; | ||
/* harmony default export */ const src = (Component); | ||
@@ -600,0 +575,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("VueLoading",["vue"],t):"object"==typeof exports?exports.VueLoading=t(require("vue")):e.VueLoading=t(e.Vue)}(this,(e=>(()=>{"use strict";var t={935:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{const i=e.__vccOpts||e;for(const[e,n]of t)i[e]=n;return i}},976:t=>{t.exports=e}},i={};function n(e){var o=i[e];if(void 0!==o)return o.exports;var a=i[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Component:()=>N,LoadingPlugin:()=>x,default:()=>L,useLoading:()=>k});var e=n(976);function t(t,i,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=(0,e.h)(t,i,o),r=document.createElement("div");return r.classList.add("vld-container"),n.appendChild(r),(0,e.render)(a,r),a.component}const i="undefined"!=typeof window?window.HTMLElement:Object,a=["aria-busy"],r={class:"vl-icon"};const l={mounted(){this.enforceFocus&&document.addEventListener("focusin",this.focusIn)},methods:{focusIn(e){if(!this.isActive)return;if(e.target===this.$el||this.$el.contains(e.target))return;let t=this.container?this.container:this.isFullPage?null:this.$el.parentElement;(this.isFullPage||t&&t.contains(e.target))&&(e.preventDefault(),this.$el.focus())}},beforeUnmount(){document.removeEventListener("focusin",this.focusIn)}},c=["width","height","stroke"],s=[(0,e.createStaticVNode)('<g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".25" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"></animateTransform></path></g></g>',1)];const d=(0,e.defineComponent)({name:"spinner",props:{color:{type:String,default:"#000"},height:{type:Number,default:64},width:{type:Number,default:64}}});var u=n(935);const h=(0,u.default)(d,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,stroke:t.color},s,8,c)}]]),m=["fill","width","height"],p=[(0,e.createStaticVNode)('<circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle>',3)];const f=(0,e.defineComponent)({name:"dots",props:{color:{type:String,default:"#000"},height:{type:Number,default:240},width:{type:Number,default:60}}}),g=(0,u.default)(f,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:t.color,width:t.width,height:t.height},p,8,m)}]]),v=["height","width","fill"],b=[(0,e.createStaticVNode)('<rect x="0" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="10" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="20" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)];const y=(0,e.defineComponent)({name:"bars",props:{color:{type:String,default:"#000"},height:{type:Number,default:40},width:{type:Number,default:40}}}),w={Spinner:h,Dots:g,Bars:(0,u.default)(y,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:t.height,width:t.width,fill:t.color},b,8,v)}]])},S=(0,e.defineComponent)({name:"VueLoading",mixins:[l],props:{active:Boolean,programmatic:Boolean,container:[Object,Function,i],isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:Boolean,transition:{type:String,default:"fade"},canCancel:Boolean,onCancel:{type:Function,default:()=>{}},color:String,backgroundColor:String,opacity:Number,width:Number,height:Number,zIndex:Number,loader:{type:String,default:"spinner"}},components:w,emits:["hide","update:active"],data(){return{isActive:this.active}},mounted(){document.addEventListener("keyup",this.keyPress)},methods:{cancel(){this.canCancel&&this.isActive&&(this.hide(),this.onCancel.apply(null,arguments))},hide(){this.$emit("hide"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout((()=>{const t=this.$el.parentElement;var i,n;(0,e.render)(null,t),void 0!==(i=t).remove?i.remove():null===(n=i.parentNode)||void 0===n||n.removeChild(i)}),150))},disableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.add("vl-shown")},enableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.remove("vl-shown")},keyPress(e){27===e.keyCode&&this.cancel()}},watch:{active(e){this.isActive=e},isActive(e){e?this.disableScroll():this.enableScroll()}},computed:{bgStyle(){return{background:this.backgroundColor,opacity:this.opacity}}},beforeUnmount(){document.removeEventListener("keyup",this.keyPress)}}),C=(0,u.default)(S,[["render",function(t,i,n,o,l,c){return(0,e.openBlock)(),(0,e.createBlock)(e.Transition,{name:t.transition},{default:(0,e.withCtx)((()=>[(0,e.withDirectives)((0,e.createElementVNode)("div",{tabindex:"0",class:(0,e.normalizeClass)(["vl-overlay vl-active",{"vl-full-page":t.isFullPage}]),"aria-busy":t.isActive,"aria-label":"Loading",style:(0,e.normalizeStyle)({zIndex:t.zIndex})},[(0,e.createElementVNode)("div",{class:"vl-background",onClick:i[0]||(i[0]=(0,e.withModifiers)((function(){return t.cancel&&t.cancel(...arguments)}),["prevent"])),style:(0,e.normalizeStyle)(t.bgStyle)},null,4),(0,e.createElementVNode)("div",r,[(0,e.renderSlot)(t.$slots,"before"),(0,e.renderSlot)(t.$slots,"default",{},(()=>[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.loader),{color:t.color,width:t.width,height:t.height},null,8,["color","width","height"]))])),(0,e.renderSlot)(t.$slots,"after")])],14,a),[[e.vShow,t.isActive]])])),_:3},8,["name"])}]]),N=C;function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{show(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;const a={...e,...n,programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0};let r=a.container;a.container||(r=document.body,a.isFullPage=!0);const l={...i,...o};return{hide:t(N,a,r,l).ctx.hide}}}}const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=k(t,i);e.config.globalProperties.$loading=n,e.provide("$loading",n)},L=C})(),o})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("VueLoading",["vue"],t):"object"==typeof exports?exports.VueLoading=t(require("vue")):e.VueLoading=t(e.Vue)}(this,(e=>(()=>{"use strict";var t={657:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t)=>{const i=e.__vccOpts||e;for(const[e,n]of t)i[e]=n;return i}},976:t=>{t.exports=e}},i={};function n(e){var o=i[e];if(void 0!==o)return o.exports;var a=i[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Component:()=>N,LoadingPlugin:()=>x,default:()=>L,useLoading:()=>k});var e=n(976);function t(t,i,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=(0,e.h)(t,i,o),r=document.createElement("div");return r.classList.add("vld-container"),n.appendChild(r),(0,e.render)(a,r),a.component}const i="undefined"!=typeof window?window.HTMLElement:Object,a=["aria-busy"],r={class:"vl-icon"};const l={mounted(){this.enforceFocus&&document.addEventListener("focusin",this.focusIn)},methods:{focusIn(e){if(!this.isActive)return;if(e.target===this.$el||this.$el.contains(e.target))return;let t=this.container?this.container:this.isFullPage?null:this.$el.parentElement;(this.isFullPage||t&&t.contains(e.target))&&(e.preventDefault(),this.$el.focus())}},beforeUnmount(){document.removeEventListener("focusin",this.focusIn)}},c=["width","height","stroke"],s=[(0,e.createStaticVNode)('<g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".25" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"></animateTransform></path></g></g>',1)];const d=(0,e.defineComponent)({name:"spinner",props:{color:{type:String,default:"#000"},height:{type:Number,default:64},width:{type:Number,default:64}}});var u=n(657);const h=(0,u.default)(d,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,stroke:t.color},s,8,c)}]]),m=["fill","width","height"],p=[(0,e.createStaticVNode)('<circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle>',3)];const f=(0,e.defineComponent)({name:"dots",props:{color:{type:String,default:"#000"},height:{type:Number,default:240},width:{type:Number,default:60}}}),g=(0,u.default)(f,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:t.color,width:t.width,height:t.height},p,8,m)}]]),v=["height","width","fill"],b=[(0,e.createStaticVNode)('<rect x="0" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="10" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="20" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)];const y=(0,e.defineComponent)({name:"bars",props:{color:{type:String,default:"#000"},height:{type:Number,default:40},width:{type:Number,default:40}}}),w={Spinner:h,Dots:g,Bars:(0,u.default)(y,[["render",function(t,i,n,o,a,r){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:t.height,width:t.width,fill:t.color},b,8,v)}]])},S=(0,e.defineComponent)({name:"VueLoading",mixins:[l],props:{active:Boolean,programmatic:Boolean,container:[Object,Function,i],isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:Boolean,transition:{type:String,default:"fade"},canCancel:Boolean,onCancel:{type:Function,default:()=>{}},color:String,backgroundColor:String,opacity:Number,width:Number,height:Number,zIndex:Number,loader:{type:String,default:"spinner"}},components:w,emits:["hide","update:active"],data(){return{isActive:this.active}},mounted(){document.addEventListener("keyup",this.keyPress)},methods:{cancel(){this.canCancel&&this.isActive&&(this.hide(),this.onCancel.apply(null,arguments))},hide(){this.$emit("hide"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout((()=>{const t=this.$el.parentElement;var i;(0,e.render)(null,t),void 0!==(i=t).remove?i.remove():i.parentNode?.removeChild(i)}),150))},disableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.add("vl-shown")},enableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.remove("vl-shown")},keyPress(e){27===e.keyCode&&this.cancel()}},watch:{active(e){this.isActive=e},isActive(e){e?this.disableScroll():this.enableScroll()}},computed:{bgStyle(){return{background:this.backgroundColor,opacity:this.opacity}}},beforeUnmount(){document.removeEventListener("keyup",this.keyPress)}}),C=(0,u.default)(S,[["render",function(t,i,n,o,l,c){return(0,e.openBlock)(),(0,e.createBlock)(e.Transition,{name:t.transition},{default:(0,e.withCtx)((()=>[(0,e.withDirectives)((0,e.createElementVNode)("div",{tabindex:"0",class:(0,e.normalizeClass)(["vl-overlay vl-active",{"vl-full-page":t.isFullPage}]),"aria-busy":t.isActive,"aria-label":"Loading",style:(0,e.normalizeStyle)({zIndex:t.zIndex})},[(0,e.createElementVNode)("div",{class:"vl-background",onClick:i[0]||(i[0]=(0,e.withModifiers)((function(){return t.cancel&&t.cancel(...arguments)}),["prevent"])),style:(0,e.normalizeStyle)(t.bgStyle)},null,4),(0,e.createElementVNode)("div",r,[(0,e.renderSlot)(t.$slots,"before"),(0,e.renderSlot)(t.$slots,"default",{},(()=>[((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.loader),{color:t.color,width:t.width,height:t.height},null,8,["color","width","height"]))])),(0,e.renderSlot)(t.$slots,"after")])],14,a),[[e.vShow,t.isActive]])])),_:3},8,["name"])}]]),N=C;function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{show(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;const a={...e,...n,programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0};let r=a.container;a.container||(r=document.body,a.isFullPage=!0);const l={...i,...o};return{hide:t(N,a,r,l).ctx.hide}}}}const x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=k(t,i);e.config.globalProperties.$loading=n,e.provide("$loading",n)},L=C})(),o})())); |
{ | ||
"name": "vue-loading-overlay", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "Vue.js component for full screen loading indicator.", | ||
@@ -40,21 +40,21 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.19.1", | ||
"@babel/preset-env": "^7.19.1", | ||
"@vue/compiler-sfc": "^3.2.39", | ||
"@vue/test-utils": "^2.0.2", | ||
"@vue/vue3-jest": "^29.1.0", | ||
"babel-jest": "^29.0.3", | ||
"babel-loader": "^8.2.5", | ||
"bootstrap": "^4", | ||
"css-loader": "^6.7.1", | ||
"@babel/core": "^7.20.12", | ||
"@babel/preset-env": "^7.20.2", | ||
"@vue/compiler-sfc": "^3.2.47", | ||
"@vue/test-utils": "^2.2.9", | ||
"@vue/vue3-jest": "^29.2.2", | ||
"babel-jest": "^29.4.1", | ||
"babel-loader": "^9.1.2", | ||
"bootstrap": "^4.6.2", | ||
"css-loader": "^6.7.3", | ||
"file-loader": "^6.2.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"jest": "^29.0.3", | ||
"jest-environment-jsdom": "^29.0.3", | ||
"mini-css-extract-plugin": "^2.6.1", | ||
"jest": "^29.4.1", | ||
"jest-environment-jsdom": "^29.4.1", | ||
"mini-css-extract-plugin": "^2.7.2", | ||
"style-loader": "^3.3.1", | ||
"vue": "^3.2.39", | ||
"vue-loader": "^17.0.0", | ||
"webpack": "^5.74.0", | ||
"webpack-cli": "^4.10.0", | ||
"vue": "^3.2.47", | ||
"vue-loader": "^17.0.1", | ||
"webpack": "^5.75.0", | ||
"webpack-cli": "^5.0.1", | ||
"webpack-dev-server": "^4.11.1" | ||
@@ -61,0 +61,0 @@ }, |
@@ -6,3 +6,3 @@ # Vue Loading Overlay Component | ||
[![npm-version](https://badgen.net/npm/v/vue-loading-overlay)](https://www.npmjs.com/package/vue-loading-overlay) | ||
[![github-tag](https://badgen.net/github/tag/ankurk91/vue-loading-overlay)](https://github.com/ankurk91/vue-loading-overlay/) | ||
[![github-tag](https://badgen.net/github/tag/ankurk91/vue-loading-overlay)](https://github.com/ankurk91/vue-loading-overlay/tags) | ||
[![build](https://github.com/ankurk91/vue-loading-overlay/workflows/build/badge.svg)](https://github.com/ankurk91/vue-loading-overlay/actions) | ||
@@ -225,3 +225,3 @@ [![license](https://badgen.net/github/license/ankurk91/vue-loading-overlay)](LICENSE.txt) | ||
```js | ||
app.use(VueLoading, { | ||
app.use(LoadingPlugin, { | ||
// props | ||
@@ -264,3 +264,3 @@ color: 'red' | ||
* Clone this repo | ||
* Make sure you have node-js `>=18.12` and [pnpm](https://pnpm.io/) `>=7.12` pre-installed | ||
* Make sure you have node-js `>=18.12` and [pnpm](https://pnpm.io/) `>=7.18` pre-installed | ||
* Install dependencies `pnpm install` | ||
@@ -267,0 +267,0 @@ * Run webpack dev server `npm start` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57033
710