Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v-eye

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-eye - npm Package Compare versions

Comparing version 0.4.1-alpha.2 to 0.4.1-alpha.3

LICENSE

10

dist/v-eye.common.js

@@ -375,2 +375,4 @@ module.exports =

}), _defineProperty(_compatConfig$name$in, "render", function render() {
var _this = this;
var $slots = useSlots(this);

@@ -382,3 +384,5 @@ var props = {

props: props
}), $slots.default(this.api));
}), isVue3 ? function () {
return $slots.default(_this.api);
} : $slots.default(this.api));
}), _defineProperty(_compatConfig$name$in, "provide", function provide() {

@@ -914,3 +918,5 @@ return {

props: props
}), $slots.default());
}), isVue3 ? function () {
return $slots.default();
} : $slots.default());
},

@@ -917,0 +923,0 @@ provide: function provide() {

@@ -384,2 +384,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

}), _defineProperty(_compatConfig$name$in, "render", function render() {
var _this = this;
var $slots = useSlots(this);

@@ -391,3 +393,5 @@ var props = {

props: props
}), $slots.default(this.api));
}), isVue3 ? function () {
return $slots.default(_this.api);
} : $slots.default(this.api));
}), _defineProperty(_compatConfig$name$in, "provide", function provide() {

@@ -923,3 +927,5 @@ return {

props: props
}), $slots.default());
}), isVue3 ? function () {
return $slots.default();
} : $slots.default());
},

@@ -926,0 +932,0 @@ provide: function provide() {

2

dist/v-eye.umd.min.js

@@ -1,2 +0,2 @@

(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["v-eye"]=t(require("vue")):e["v-eye"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="4447")}({4447:function(e,t,n){"use strict";n.r(t),n.d(t,"VEye",(function(){return V})),n.d(t,"VEyeManager",(function(){return K})),n.d(t,"VEyeContent",(function(){return ee})),n.d(t,"VEyeSwitch",(function(){return ae}));var r={};if(n.r(r),n.d(r,"VEye",(function(){return V})),n.d(r,"VEyeManager",(function(){return K})),n.d(r,"VEyeContent",(function(){return ee})),n.d(r,"VEyeSwitch",(function(){return ae})),"undefined"!==typeof window){var i=window.document.currentScript,o=n("dc36");i=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var a=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var u=n("8bbf").version||n("8bbf").default.version,c=/^3\./.test(u),l=function(e){var t=s(e);return t};function s(e){return c?e.$slots:e.$scopedSlots}var f={beforeUnmount:c?"beforeUnmount":"beforeDestroy",unmounted:c?"unmounted":"destroyed"},d=0;function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"v-eye-",t=++d;return"".concat(e).concat(t)}var h,m=n("8bbf"),v={type:Boolean,default:!1},y={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VPrimitive",props:{asTemplate:v,tagName:{type:String,default:"div"}},render:function(){var e=l(this);return this.asTemplate?e.default():c?Object(m["h"])(this.tagName,e.default()):Object(m["h"])(this.tagName,{on:this.$listeners},e.default())}};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,E,S=(h={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEye",inject:{manager:{default:null}},emits:["toggle","update:active"],model:{prop:"active",event:"toggle"},props:{asTemplate:v,uid:{type:[String,Number],default:null},active:{type:Boolean,default:!1}},setup:function(e){var t=Object(m["ref"])(null),n=Object(m["ref"])(e.active);return{elementRef:t,internalActive:n}},computed:{$_uid:function(){return null===this.uid||void 0===this.uid?p():this.uid},$_independent:function(){return!this.manager},$_active:function(){return this.$_independent?this.internalActive:this.manager.getIsActive(this.$_uid)},$_attrs:function(){return{"data-v-eye-active":this.$_active?"":null,"data-v-eye-uid":this.$_uid}},api:function(){return{isActive:this.$_active,toggle:this.toggle,setElementRef:this.setElementRef,attrs:this.$_attrs}}},watch:{active:function(e){this.internalActive=e}},mounted:function(){this.$_independent||this.manager.track(this.$_uid,this.setElementRef()),this.$_independent||!1===this.active||console.log("\n This eye can't control himself, it's under manager scope.\n The prop has no effect\n ")}},_(h,f.beforeUnmount,(function(){this.$_independent||this.manager.untrack(this.$_uid)})),_(h,"methods",{setElementRef:function(e){var t;e?this.elementRef=e:(e=document.querySelector('[data-v-eye-uid="'.concat(this.$_uid,"]")),this.elementRef=null!==(t=e)&&void 0!==t?t:c?this.$el.nextElementSibling:this.$el);return this.elementRef},toggle:function(){if(this.$_independent)return this.internalActive=!this.internalActive,this.$emit("toggle",this.internalActive),void this.$emit("update:active",this.internalActive);this.manager.toggle(this.$_uid)}}),_(h,"render",(function(){var e=l(this),t={asTemplate:this.asTemplate};return Object(m["h"])(y,b({},c?t:{props:t}),e.default(this.api))})),_(h,"provide",(function(){return{eye:this}})),h),j=S;function P(e,t,n,r,i,o,a,u){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):i&&(c=u?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var s=l.render;l.render=function(e,t){return c.call(t),s(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}var $=P(j,O,E,!1,null,null,null),V=$.exports;function w(e){return w="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function x(e){return N(e)||M(e)||T(e)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if(e){if("string"===typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function M(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function N(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){if(null==e)return{};var n,r,i=I(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function R(e){var t=k(e,"string");return"symbol"===w(t)?t:String(t)}function k(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var B,F,z=function(e){return void 0===e||null===e},q={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeManager",emits:["change","update:active","mounted"],model:{prop:"active",event:"change"},props:{asTemplate:v,active:{type:[String,Array,Number]},defaultActive:{type:[String,Array,Number]},mandatory:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},watchPropsWithModelSideEffects:{type:Boolean,default:!1}},data:function(){return{injected:[],injectedElMap:{},modelValueInternal:this.defaultActive,api:{track:this.track,untrack:this.untrack,getIsActive:this.getIsActive,toggle:this.toggle}}},computed:{$_modelValueProxy:{get:function(){return this.active||0===this.active?this.serializeModelValue(this.active):this.serializeModelValue(this.modelValueInternal)},set:function(e){this.syncModelValue(e)}}},watch:{active:function(){this._preventActiveWatcher?this._preventActiveWatcher=!1:this.emitModelValueWithDetails(["change"])},mandatory:{immediate:!0,handler:"execMandatorySideEffects"},multiple:{immediate:!0,handler:"execMultipleSideEffects"}},created:function(){!this.multiple||z(this.active)||Array.isArray(this.active)||z(this.defaultActive)||Array.isArray(this.defaultActive)||console.warn("[v-eye]: when using multiple, active/defaultActive must be an array if provided"),this.mandatory&&z(this.active)&&z(this.defaultActive)&&console.warn("[v-eye]: mandatory mode expects an not nil 'active' or 'defaultActive' value")},mounted:function(){this.emitModelValueWithDetails(["mounted"])},methods:{syncModelValue:function(e){this.modelValueInternal=e,this.emitModelValueWithDetails(["change","update:active"],e),this._preventActiveWatcher=!0},serializeModelValue:function(e){return Array.isArray(e)?e:e||0===e?[e]:[]},deserializeModelValue:function(e){return this.multiple?e:e.length?e[e.length-1]:null},emitModelValueWithDetails:function(e,t){var n=this,r=this.getEventParams(null!==t&&void 0!==t?t:this.$_modelValueProxy),i=r.emitValue,o=r.details;e.forEach((function(e){return n.$emit(e,i,o)}))},getEventDetails:function(e){var t=this;return{elements:e.map((function(e){return t.injectedElMap[e]}))}},getEventParams:function(e){return{emitValue:this.deserializeModelValue(e),details:this.getEventDetails(e)}},execMandatorySideEffects:function(e){this.watchPropsWithModelSideEffects&&e&&!this.$_modelValueProxy.length&&(this.$_modelValueProxy=[this.injected[0]])},execMultipleSideEffects:function(e){this.watchPropsWithModelSideEffects&&(!e&&this.$_modelValueProxy.length>1?this.$_modelValueProxy=this.$_modelValueProxy.slice(-1):this.syncModelValue(this.$_modelValueProxy))},track:function(e,t){this.injected.includes(e)||(this.injected.push(e),this.injectedElMap=W(W({},this.injectedElMap),{},L({},e,t)))},untrack:function(e){this.injected=this.injected.filter((function(t){return e!==t}));var t=this.injectedElMap,n=(t[e],C(t,[e].map(R)));this.injectedElMap=n,this.getIsActive(e)&&this.deactivate(e,!0)},getIsActive:function(e){return this.$_modelValueProxy.includes(e)},activate:function(e){this.multiple?this.$_modelValueProxy=[].concat(x(this.$_modelValueProxy),[e]):this.$_modelValueProxy=[e]},deactivate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!this.multiple||this.mandatory&&1===this.$_modelValueProxy.length?(t&&this.mandatory&&(this.$_modelValueProxy=this.injected.slice(-1)),this.$_modelValueProxy.length>1?this.$_modelValueProxy=[e]:this.mandatory||(this.$_modelValueProxy=[])):this.$_modelValueProxy=this.$_modelValueProxy.filter((function(t){return t!==e}))},toggle:function(e){var t=this.getIsActive(e);t?this.deactivate(e):this.activate(e)}},render:function(){var e=l(this),t={asTemplate:this.asTemplate};return Object(m["h"])(y,W({},c?t:{props:t}),e.default())},provide:function(){return{manager:this.api}}},H=q,X=P(H,B,F,!1,null,null,null),K=X.exports,G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.eye.api.isActive?n("v-primitive",e._b({},"v-primitive",{asTemplate:e.asTemplate},!1),[e._t("default",null,null,{toggle:e.eye.api.toggle})],2):e._e()},J=[],Q={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeContent",components:{VPrimitive:y},inject:["eye"],props:{asTemplate:v}},Y=Q,Z=P(Y,G,J,!1,null,null,null),ee=Z.exports,te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-primitive",e._b({on:{click:e.eye.api.toggle}},"v-primitive",{asTemplate:e.asTemplate,tagName:"button",type:"button"},!1),[e._t("default",null,null,e.eye.api)],2)},ne=[],re={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeSwitch",components:{VPrimitive:y},inject:["eye"],props:{asTemplate:v}},ie=re,oe=P(ie,te,ne,!1,null,null,null),ae=oe.exports,ue={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.installed)for(var n in this.installed=!0,r){var i=n.moduleKey,o=n.component;e.component(t.componentName||i,o)}}};"undefined"!==typeof window&&window.Vue&&window.Vue.use(ue);var ce=ue;t["default"]=ce},"8bbf":function(t,n){t.exports=e},dc36:function(e,t,n){var r,i,o;(function(n,a){i=[],r=a,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,u=o.exec(p.stack)||a.exec(p.stack),c=u&&u[1]||!1,l=u&&u[2]||!1,s=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");c===s&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var d=0;d<f.length;d++){if("interactive"===f[d].readyState)return f[d];if(f[d].src===c)return f[d];if(c===s&&f[d].innerHTML&&f[d].innerHTML.trim()===i)return f[d]}return null}}return e}))}})}));
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["v-eye"]=t(require("vue")):e["v-eye"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="4447")}({4447:function(e,t,n){"use strict";n.r(t),n.d(t,"VEye",(function(){return V})),n.d(t,"VEyeManager",(function(){return K})),n.d(t,"VEyeContent",(function(){return ee})),n.d(t,"VEyeSwitch",(function(){return ae}));var r={};if(n.r(r),n.d(r,"VEye",(function(){return V})),n.d(r,"VEyeManager",(function(){return K})),n.d(r,"VEyeContent",(function(){return ee})),n.d(r,"VEyeSwitch",(function(){return ae})),"undefined"!==typeof window){var i=window.document.currentScript,o=n("dc36");i=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var a=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var u=n("8bbf").version||n("8bbf").default.version,c=/^3\./.test(u),l=function(e){var t=s(e);return t};function s(e){return c?e.$slots:e.$scopedSlots}var f={beforeUnmount:c?"beforeUnmount":"beforeDestroy",unmounted:c?"unmounted":"destroyed"},d=0;function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"v-eye-",t=++d;return"".concat(e).concat(t)}var h,m=n("8bbf"),v={type:Boolean,default:!1},y={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VPrimitive",props:{asTemplate:v,tagName:{type:String,default:"div"}},render:function(){var e=l(this);return this.asTemplate?e.default():c?Object(m["h"])(this.tagName,e.default()):Object(m["h"])(this.tagName,{on:this.$listeners},e.default())}};function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O,E,S=(h={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEye",inject:{manager:{default:null}},emits:["toggle","update:active"],model:{prop:"active",event:"toggle"},props:{asTemplate:v,uid:{type:[String,Number],default:null},active:{type:Boolean,default:!1}},setup:function(e){var t=Object(m["ref"])(null),n=Object(m["ref"])(e.active);return{elementRef:t,internalActive:n}},computed:{$_uid:function(){return null===this.uid||void 0===this.uid?p():this.uid},$_independent:function(){return!this.manager},$_active:function(){return this.$_independent?this.internalActive:this.manager.getIsActive(this.$_uid)},$_attrs:function(){return{"data-v-eye-active":this.$_active?"":null,"data-v-eye-uid":this.$_uid}},api:function(){return{isActive:this.$_active,toggle:this.toggle,setElementRef:this.setElementRef,attrs:this.$_attrs}}},watch:{active:function(e){this.internalActive=e}},mounted:function(){this.$_independent||this.manager.track(this.$_uid,this.setElementRef()),this.$_independent||!1===this.active||console.log("\n This eye can't control himself, it's under manager scope.\n The prop has no effect\n ")}},_(h,f.beforeUnmount,(function(){this.$_independent||this.manager.untrack(this.$_uid)})),_(h,"methods",{setElementRef:function(e){var t;e?this.elementRef=e:(e=document.querySelector('[data-v-eye-uid="'.concat(this.$_uid,"]")),this.elementRef=null!==(t=e)&&void 0!==t?t:c?this.$el.nextElementSibling:this.$el);return this.elementRef},toggle:function(){if(this.$_independent)return this.internalActive=!this.internalActive,this.$emit("toggle",this.internalActive),void this.$emit("update:active",this.internalActive);this.manager.toggle(this.$_uid)}}),_(h,"render",(function(){var e=this,t=l(this),n={asTemplate:this.asTemplate};return Object(m["h"])(y,b({},c?n:{props:n}),c?function(){return t.default(e.api)}:t.default(this.api))})),_(h,"provide",(function(){return{eye:this}})),h),j=S;function P(e,t,n,r,i,o,a,u){var c,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):i&&(c=u?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var s=l.render;l.render=function(e,t){return c.call(t),s(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}var $=P(j,O,E,!1,null,null,null),V=$.exports;function w(e){return w="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function x(e){return N(e)||M(e)||T(e)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){if(e){if("string"===typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function M(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function N(e){if(Array.isArray(e))return D(e)}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){if(null==e)return{};var n,r,i=I(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function I(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function R(e){var t=k(e,"string");return"symbol"===w(t)?t:String(t)}function k(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function U(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?U(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var B,F,z=function(e){return void 0===e||null===e},q={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeManager",emits:["change","update:active","mounted"],model:{prop:"active",event:"change"},props:{asTemplate:v,active:{type:[String,Array,Number]},defaultActive:{type:[String,Array,Number]},mandatory:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},watchPropsWithModelSideEffects:{type:Boolean,default:!1}},data:function(){return{injected:[],injectedElMap:{},modelValueInternal:this.defaultActive,api:{track:this.track,untrack:this.untrack,getIsActive:this.getIsActive,toggle:this.toggle}}},computed:{$_modelValueProxy:{get:function(){return this.active||0===this.active?this.serializeModelValue(this.active):this.serializeModelValue(this.modelValueInternal)},set:function(e){this.syncModelValue(e)}}},watch:{active:function(){this._preventActiveWatcher?this._preventActiveWatcher=!1:this.emitModelValueWithDetails(["change"])},mandatory:{immediate:!0,handler:"execMandatorySideEffects"},multiple:{immediate:!0,handler:"execMultipleSideEffects"}},created:function(){!this.multiple||z(this.active)||Array.isArray(this.active)||z(this.defaultActive)||Array.isArray(this.defaultActive)||console.warn("[v-eye]: when using multiple, active/defaultActive must be an array if provided"),this.mandatory&&z(this.active)&&z(this.defaultActive)&&console.warn("[v-eye]: mandatory mode expects an not nil 'active' or 'defaultActive' value")},mounted:function(){this.emitModelValueWithDetails(["mounted"])},methods:{syncModelValue:function(e){this.modelValueInternal=e,this.emitModelValueWithDetails(["change","update:active"],e),this._preventActiveWatcher=!0},serializeModelValue:function(e){return Array.isArray(e)?e:e||0===e?[e]:[]},deserializeModelValue:function(e){return this.multiple?e:e.length?e[e.length-1]:null},emitModelValueWithDetails:function(e,t){var n=this,r=this.getEventParams(null!==t&&void 0!==t?t:this.$_modelValueProxy),i=r.emitValue,o=r.details;e.forEach((function(e){return n.$emit(e,i,o)}))},getEventDetails:function(e){var t=this;return{elements:e.map((function(e){return t.injectedElMap[e]}))}},getEventParams:function(e){return{emitValue:this.deserializeModelValue(e),details:this.getEventDetails(e)}},execMandatorySideEffects:function(e){this.watchPropsWithModelSideEffects&&e&&!this.$_modelValueProxy.length&&(this.$_modelValueProxy=[this.injected[0]])},execMultipleSideEffects:function(e){this.watchPropsWithModelSideEffects&&(!e&&this.$_modelValueProxy.length>1?this.$_modelValueProxy=this.$_modelValueProxy.slice(-1):this.syncModelValue(this.$_modelValueProxy))},track:function(e,t){this.injected.includes(e)||(this.injected.push(e),this.injectedElMap=W(W({},this.injectedElMap),{},L({},e,t)))},untrack:function(e){this.injected=this.injected.filter((function(t){return e!==t}));var t=this.injectedElMap,n=(t[e],C(t,[e].map(R)));this.injectedElMap=n,this.getIsActive(e)&&this.deactivate(e,!0)},getIsActive:function(e){return this.$_modelValueProxy.includes(e)},activate:function(e){this.multiple?this.$_modelValueProxy=[].concat(x(this.$_modelValueProxy),[e]):this.$_modelValueProxy=[e]},deactivate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!this.multiple||this.mandatory&&1===this.$_modelValueProxy.length?(t&&this.mandatory&&(this.$_modelValueProxy=this.injected.slice(-1)),this.$_modelValueProxy.length>1?this.$_modelValueProxy=[e]:this.mandatory||(this.$_modelValueProxy=[])):this.$_modelValueProxy=this.$_modelValueProxy.filter((function(t){return t!==e}))},toggle:function(e){var t=this.getIsActive(e);t?this.deactivate(e):this.activate(e)}},render:function(){var e=l(this),t={asTemplate:this.asTemplate};return Object(m["h"])(y,W({},c?t:{props:t}),c?function(){return e.default()}:e.default())},provide:function(){return{manager:this.api}}},H=q,X=P(H,B,F,!1,null,null,null),K=X.exports,G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.eye.api.isActive?n("v-primitive",e._b({},"v-primitive",{asTemplate:e.asTemplate},!1),[e._t("default",null,null,{toggle:e.eye.api.toggle})],2):e._e()},J=[],Q={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeContent",components:{VPrimitive:y},inject:["eye"],props:{asTemplate:v}},Y=Q,Z=P(Y,G,J,!1,null,null,null),ee=Z.exports,te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-primitive",e._b({on:{click:e.eye.api.toggle}},"v-primitive",{asTemplate:e.asTemplate,tagName:"button",type:"button"},!1),[e._t("default",null,null,e.eye.api)],2)},ne=[],re={compatConfig:{MODE:3,RENDER_FUNCTION:!1,INSTANCE_SCOPED_SLOTS:!1},name:"VEyeSwitch",components:{VPrimitive:y},inject:["eye"],props:{asTemplate:v}},ie=re,oe=P(ie,te,ne,!1,null,null,null),ae=oe.exports,ue={install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.installed)for(var n in this.installed=!0,r){var i=n.moduleKey,o=n.component;e.component(t.componentName||i,o)}}};"undefined"!==typeof window&&window.Vue&&window.Vue.use(ue);var ce=ue;t["default"]=ce},"8bbf":function(t,n){t.exports=e},dc36:function(e,t,n){var r,i,o;(function(n,a){i=[],r=a,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,a=/@([^@]*):(\d+):(\d+)\s*$/gi,u=o.exec(p.stack)||a.exec(p.stack),c=u&&u[1]||!1,l=u&&u[2]||!1,s=document.location.href.replace(document.location.hash,""),f=document.getElementsByTagName("script");c===s&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var d=0;d<f.length;d++){if("interactive"===f[d].readyState)return f[d];if(f[d].src===c)return f[d];if(c===s&&f[d].innerHTML&&f[d].innerHTML.trim()===i)return f[d]}return null}}return e}))}})}));
//# sourceMappingURL=v-eye.umd.min.js.map
{
"name": "v-eye",
"version": "0.4.1-alpha.2",
"version": "0.4.1-alpha.3",
"license": "MIT",

@@ -54,3 +54,4 @@ "repository": "https://github.com/renatodeleao/v-eye",

]
}
},
"gitHead": "f375a11a96dcfb93b026c23566c84503ae777951"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc