vue-functions
Advanced tools
Comparing version 2.0.1 to 2.0.2
/*! | ||
* vue-functions v2.0.1 | ||
* vue-functions v2.0.2 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* vue-functions v2.0.1 | ||
* vue-functions v2.0.2 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
/*! | ||
* vue-functions v2.0.1 | ||
* vue-functions v2.0.2 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
* Released under the MIT License. | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vueFunctions={})}(this,(function(t){"use strict";var e=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}};var r=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var o=function(t){return e(t)||r(t)||n()};function i(t,e){return t(e={exports:{}},e.exports),e.exports}var a=i((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=m(a,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function f(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(L([])));v&&v!==e&&r.call(v,o)&&(p=v);var y=h.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function w(t){var e;this._invoke=function(n,o){function i(){return new Promise((function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return e("throw",t,i,a)}))}a(c.arg)}(n,o,e,i)}))}return e=e?e.then(i,i):i()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return l.prototype=y.constructor=h,h.constructor=l,h[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o){var i=new w(c(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),c=(i((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e})),i((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e})));var u=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t},s=(i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=u(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),i((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e})),i((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=m(a,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function f(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(L([])));v&&v!==e&&r.call(v,o)&&(p=v);var y=h.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function w(t){var e;this._invoke=function(n,o){function i(){return new Promise((function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return e("throw",t,i,a)}))}a(c.arg)}(n,o,e,i)}))}return e=e?e.then(i,i):i()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return l.prototype=y.constructor=h,h.constructor=l,h[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o){var i=new w(c(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}))),f=s.mark(p);function l(t){return"[object Object]"===Object.prototype.toString.call(t)}function h(t){return"function"==typeof t}function p(t){var e,r,n,o,i,a,c,u,h,p,d,v,y,g,w=arguments;return s.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if((e=w.length>1&&void 0!==w[1]?w[1]:{}).reverse){s.next=30;break}if(null==t.length){s.next=14;break}r=0;case 4:if(!(r<t.length)){s.next=12;break}if(n={value:t[r],index:r},e.exclude&&e.exclude(n)){s.next=9;break}return s.next=9,n;case 9:r++,s.next=4;break;case 12:s.next=28;break;case 14:if(!l(t)){s.next=27;break}o=0,i=Object.keys(t);case 16:if(!(o<i.length)){s.next=25;break}if(a=i[o],c={value:t[a],key:a},e.exclude&&e.exclude(c)){s.next=22;break}return s.next=22,c;case 22:o++,s.next=16;break;case 25:s.next=28;break;case 27:throw"Unsupported type";case 28:s.next=58;break;case 30:if(null==t.length){s.next=42;break}u=t.length-1;case 32:if(!(u>=0)){s.next=40;break}if(h={value:t[u],index:u},e.exclude&&e.exclude(h)){s.next=37;break}return s.next=37,h;case 37:u--,s.next=32;break;case 40:s.next=58;break;case 42:if(!l(t)){s.next=57;break}(p=Object.keys(t)).reverse(),d=0,v=p;case 46:if(!(d<v.length)){s.next=55;break}if(y=v[d],g={value:t[y],key:y},e.exclude&&e.exclude(g)){s.next=52;break}return s.next=52,g;case 52:d++,s.next=46;break;case 55:s.next=58;break;case 57:throw"Unsupported type";case 58:case"end":return s.stop()}}),f)}var d=a.mark(v);function v(t){var e,r;return a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=a.keys(t);case 1:if((n.t1=n.t0()).done){n.next=9;break}if(e=n.t1.value,"$"===(r=e.substr(0,1))||"_"===r){n.next=7;break}return n.next=7,{key:e,value:t[e]};case 7:n.next=1;break;case 9:case"end":return n.stop()}}),d)}var y={data:function(){return{windowSize:{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight}}},methods:{updateWindowSize:function(){Object.assign(this.windowSize,{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight})}},created:function(){var t=this;this._windowSize_onresize=function(){t.updateWindowSize(),t.$emit("window-resize")},function(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.addEventListener?t.addEventListener.apply(t,[e,r].concat(o)):t.attachEvent&&t.attachEvent.apply(t,["on".concat(e),r].concat(o))}(window,"resize",this._windowSize_onresize)},beforeDestroy:function(){!function(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.removeEventListener?t.removeEventListener.apply(t,[e,r].concat(o)):t.detachEvent&&t.detachEvent.apply(t,["on".concat(e),r].concat(o))}(window,"resize",this._windowSize_onresize)}};var g={methods:{_getNonPropHooksByName:function(t){if(this._hooks)return this._hooks[t]},addHook:function(t,e){this._getNonPropHooksByName(t)||(this._hooks||(this._hooks={}),this._hooks[t]||(this._hooks[t]=[])),this._hooks[t].push(e)},removeHook:function(t,e){var r=this._getNonPropHooksByName(t);r&&function(t,e){for(var r,n=0;(r=t.indexOf(e))>-1;)t.splice(r,1),n++}(r,e)},hasHook:function(t){return this._getNonPropHooksByName(t)||this[t]},executeHook:function(t,e){var r=this._getNonPropHooksByName(t).slice();if(r)return this[t]&&h(this[t])&&r.push((function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return this[t].apply(this,n)})),function(t){var e=function(){},r=!0,n=!1,o=void 0;try{for(var i,a=p(t,{reverse:!0})[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){e=c(i.value.value,e)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return e;function c(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.apply(void 0,[e].concat(n))}}}(r).apply(void 0,o(e))}}};t.doWatch=function(t,e){var r,n;return function o(){var i=e.call(t,r);n=t.$watch(i,(function(t){n(),r=t,o()}))}(),function(){return n&&n()}},t.hookHelper=g,t.isPropTrue=function(t){return""===t||t},t.iterateObjectWithoutDollarDash=v,t.registerPreventURLChange=function(t,e,r){var n=!1,o="It looks like you have been editing something.\nIf you leave before saving, your changes will be lost.";e.beforeEach((function(e,i,a){n?window.confirm(r||o)?(t.allowURLChange(),a()):a(!1):a()}));var i=function(t){var e=r||o;return t.returnValue=e,e};t.preventURLChange=t.prototype.$preventURLChange=function(t){null!=t&&(r=t),n||(n=!0,window.addEventListener("beforeunload",i))},t.allowURLChange=t.prototype.$allowURLChange=function(){n=!1,window.removeEventListener("beforeunload",i)}},t.updatablePropsEvenUnbound=function(t){t=h(t)?t():Object.assign({},t);var e={},r=function(r){var n=t[r];n.$localName||(n.$localName="localProps_".concat(r)),n.$localSetter||(n.$localSetter=function(t){return t});var o={};e[r]=o,Object.keys(t[r]).forEach((function(t){"$"!==t[0]&&(o[t]=n[t])}))};for(var n in t)r(n);for(var o={props:e,computed:{},watch:{},data:function(){for(var e={localValueOfUpdatableProps:{}},r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];e.localValueOfUpdatableProps[o]=this[o]}return e}},i=function(){var e=c[a],r=t[e];o.watch[e]=function(t){this.localValueOfUpdatableProps[e]=r.$localSetter(t,this)};var n=r.$localName;o.computed[n]={get:function(){return this.localValueOfUpdatableProps[e]},set:function(t){"value"===e?this.$emit("input",t):this.$emit("update:".concat(e),t),this.localValueOfUpdatableProps[e]=r.$localSetter(t,this)}}},a=0,c=Object.keys(t);a<c.length;a++)i();return o},t.watchAsync=function(t,e,r,n){var o=[],i=-1;return u(),a;function a(){o.forEach((function(t){return t()})),o=[]}function c(e,r){var n,i=!0,a=t.$watch((function(){return e.call(t,c)}),(function(t){n=t,i?i=!1:u()}),{immediate:!0,deep:r&&r.deep});return o.push(a),n}function u(){a();var o=e.call(t,c),u=++i;void 0;var s,f=function(e){u===i&&(0===u?n&&n.immediate&&r.call(t,e,void 0):r.call(t,e,void 0))};s=o,"[object Promise]"===Object.prototype.toString.call(s)?o.then(f):f(o)}},t.windowSize=y,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vueFunctions={})}(this,(function(t){"use strict";var e=function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}};var r=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var o=function(t){return e(t)||r(t)||n()};function i(t,e){return t(e={exports:{}},e.exports),e.exports}var a=i((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function c(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=m(a,r);if(c){if(c===s)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var s={};function f(){}function l(){}function h(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,v=d&&d(d(_([])));v&&v!==e&&r.call(v,o)&&(p=v);var y=h.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function w(t){var e;this._invoke=function(n,o){function i(){return new Promise((function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return e("throw",t,i,a)}))}a(c.arg)}(n,o,e,i)}))}return e=e?e.then(i,i):i()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function _(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return l.prototype=y.constructor=h,h.constructor=l,h[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(w.prototype),w.prototype[i]=function(){return this},t.AsyncIterator=w,t.async=function(e,r,n,o){var i=new w(c(e,r,n,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},g(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),c=(i((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e})),i((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e})));var u=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t},s=(i((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=u(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),i((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e})),a.mark(h));function f(t){return"[object Object]"===Object.prototype.toString.call(t)}function l(t){return"function"==typeof t}function h(t){var e,r,n,o,i,c,u,l,h,p,d,v,y,g,w=arguments;return a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if((e=w.length>1&&void 0!==w[1]?w[1]:{}).reverse){a.next=30;break}if(null==t.length){a.next=14;break}r=0;case 4:if(!(r<t.length)){a.next=12;break}if(n={value:t[r],index:r},e.exclude&&e.exclude(n)){a.next=9;break}return a.next=9,n;case 9:r++,a.next=4;break;case 12:a.next=28;break;case 14:if(!f(t)){a.next=27;break}o=0,i=Object.keys(t);case 16:if(!(o<i.length)){a.next=25;break}if(c=i[o],u={value:t[c],key:c},e.exclude&&e.exclude(u)){a.next=22;break}return a.next=22,u;case 22:o++,a.next=16;break;case 25:a.next=28;break;case 27:throw"Unsupported type";case 28:a.next=58;break;case 30:if(null==t.length){a.next=42;break}l=t.length-1;case 32:if(!(l>=0)){a.next=40;break}if(h={value:t[l],index:l},e.exclude&&e.exclude(h)){a.next=37;break}return a.next=37,h;case 37:l--,a.next=32;break;case 40:a.next=58;break;case 42:if(!f(t)){a.next=57;break}(p=Object.keys(t)).reverse(),d=0,v=p;case 46:if(!(d<v.length)){a.next=55;break}if(y=v[d],g={value:t[y],key:y},e.exclude&&e.exclude(g)){a.next=52;break}return a.next=52,g;case 52:d++,a.next=46;break;case 55:a.next=58;break;case 57:throw"Unsupported type";case 58:case"end":return a.stop()}}),s)}var p=a.mark(d);function d(t){var e,r;return a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=a.keys(t);case 1:if((n.t1=n.t0()).done){n.next=9;break}if(e=n.t1.value,"$"===(r=e.substr(0,1))||"_"===r){n.next=7;break}return n.next=7,{key:e,value:t[e]};case 7:n.next=1;break;case 9:case"end":return n.stop()}}),p)}var v={data:function(){return{windowSize:{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight}}},methods:{updateWindowSize:function(){Object.assign(this.windowSize,{innerWidth:window.innerWidth,innerHeight:window.innerHeight,outerWidth:window.outerWidth,outerHeight:window.outerHeight})}},created:function(){var t=this;this._windowSize_onresize=function(){t.updateWindowSize(),t.$emit("window-resize")},function(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.addEventListener?t.addEventListener.apply(t,[e,r].concat(o)):t.attachEvent&&t.attachEvent.apply(t,["on".concat(e),r].concat(o))}(window,"resize",this._windowSize_onresize)},beforeDestroy:function(){!function(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.removeEventListener?t.removeEventListener.apply(t,[e,r].concat(o)):t.detachEvent&&t.detachEvent.apply(t,["on".concat(e),r].concat(o))}(window,"resize",this._windowSize_onresize)}};var y={methods:{_getNonPropHooksByName:function(t){if(this._hooks)return this._hooks[t]},addHook:function(t,e){this._getNonPropHooksByName(t)||(this._hooks||(this._hooks={}),this._hooks[t]||(this._hooks[t]=[])),this._hooks[t].push(e)},removeHook:function(t,e){var r=this._getNonPropHooksByName(t);r&&function(t,e){for(var r,n=0;(r=t.indexOf(e))>-1;)t.splice(r,1),n++}(r,e)},hasHook:function(t){return this._getNonPropHooksByName(t)||this[t]},executeHook:function(t,e){var r=this._getNonPropHooksByName(t).slice();if(r)return this[t]&&l(this[t])&&r.push((function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return this[t].apply(this,n)})),function(t){var e=function(){},r=!0,n=!1,o=void 0;try{for(var i,a=h(t,{reverse:!0})[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){e=c(i.value.value,e)}}catch(t){n=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(n)throw o}}return e;function c(t,e){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.apply(void 0,[e].concat(n))}}}(r).apply(void 0,o(e))}}};t.doWatch=function(t,e){var r,n;return function o(){var i=e.call(t,r);n=t.$watch(i,(function(t){n(),r=t,o()}))}(),function(){return n&&n()}},t.hookHelper=y,t.isPropTrue=function(t){return""===t||t},t.iterateObjectWithoutDollarDash=d,t.registerPreventURLChange=function(t,e,r){var n=!1,o="It looks like you have been editing something.\nIf you leave before saving, your changes will be lost.";e.beforeEach((function(e,i,a){n?window.confirm(r||o)?(t.allowURLChange(),a()):a(!1):a()}));var i=function(t){var e=r||o;return t.returnValue=e,e};t.preventURLChange=t.prototype.$preventURLChange=function(t){null!=t&&(r=t),n||(n=!0,window.addEventListener("beforeunload",i))},t.allowURLChange=t.prototype.$allowURLChange=function(){n=!1,window.removeEventListener("beforeunload",i)}},t.updatablePropsEvenUnbound=function(t){t=l(t)?t():Object.assign({},t);var e={},r=function(r){var n=t[r];n.$localName||(n.$localName="localProps_".concat(r)),n.$localSetter||(n.$localSetter=function(t){return t});var o={};e[r]=o,Object.keys(t[r]).forEach((function(t){"$"!==t[0]&&(o[t]=n[t])}))};for(var n in t)r(n);for(var o={props:e,computed:{},watch:{},data:function(){for(var e={localValueOfUpdatableProps:{}},r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];e.localValueOfUpdatableProps[o]=this[o]}return e}},i=function(){var e=c[a],r=t[e];o.watch[e]=function(t){this.localValueOfUpdatableProps[e]=r.$localSetter(t,this)};var n=r.$localName;o.computed[n]={get:function(){return this.localValueOfUpdatableProps[e]},set:function(t){"value"===e?this.$emit("input",t):this.$emit("update:".concat(e),t),this.localValueOfUpdatableProps[e]=r.$localSetter(t,this)}}},a=0,c=Object.keys(t);a<c.length;a++)i();return o},t.watchAsync=function(t,e,r,n){var o=[],i=-1;return u(),a;function a(){o.forEach((function(t){return t()})),o=[]}function c(e,r){var n,i=!0,a=t.$watch((function(){return e.call(t,c)}),(function(t){n=t,i?i=!1:u()}),{immediate:!0,deep:r&&r.deep});return o.push(a),n}function u(){a();var o=e.call(t,c),u=++i;void 0;var s,f=function(e){u===i&&(0===u?n&&n.immediate&&r.call(t,e,void 0):r.call(t,e,void 0))};s=o,"[object Promise]"===Object.prototype.toString.call(s)?o.then(f):f(o)}},t.windowSize=v,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "vue-functions", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "", | ||
@@ -11,6 +11,3 @@ "main": "dist/vue-functions.cjs.js", | ||
"scripts": { | ||
"build": "node scripts/build.js", | ||
"dev": "rollup -w -c scripts/config.js --environment TARGET:umd", | ||
"build:esm": "rollup -c scripts/config.js --environment TARGET:esm", | ||
"dev:esm": "rollup -w -c scripts/config.js --environment TARGET:esm" | ||
"build": "rogo" | ||
}, | ||
@@ -27,9 +24,9 @@ "author": "phphe <phphe@outlook.com> (https://github.com/phphe)", | ||
"devDependencies": { | ||
"rollup-helper": "^2.0.12" | ||
"rogo": "^1.0.0" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.7.7", | ||
"helper-js": "^1.4.21" | ||
"helper-js": "^1.4.27" | ||
}, | ||
"license": "MIT" | ||
} |
Sorry, the diff of this file is too big to display
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
77641
1874
Updatedhelper-js@^1.4.27