@volverjs/ui-vue 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/icons.js +1 -93
- package/dist/components/VvAccordion/VvAccordion.es.js +1 -366
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +2 -702
- package/dist/components/VvAction/VvAction.es.js +1 -302
- package/dist/components/VvAlert/VvAlert.es.js +1 -527
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +1 -730
- package/dist/components/VvAvatar/VvAvatar.es.js +1 -132
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +1 -250
- package/dist/components/VvBadge/VvBadge.es.js +1 -131
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +1 -410
- package/dist/components/VvButton/VvButton.es.js +1 -882
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +1 -214
- package/dist/components/VvCard/VvCard.es.js +1 -152
- package/dist/components/VvCheckbox/VvCheckbox.es.js +1 -741
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +1 -981
- package/dist/components/VvCombobox/VvCombobox.es.js +1 -3463
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +8 -1
- package/dist/components/VvDialog/VvDialog.es.js +1 -317
- package/dist/components/VvDropdown/VvDropdown.es.js +1 -750
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +9 -2
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +1 -448
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +1 -149
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +1 -104
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +1 -281
- package/dist/components/VvIcon/VvIcon.es.js +1 -143
- package/dist/components/VvInputFile/VvInputFile.es.js +1 -1704
- package/dist/components/VvInputText/VvInputText.es.js +4 -2790
- package/dist/components/VvNav/VvNav.es.js +1 -438
- package/dist/components/VvNavItem/VvNavItem.es.js +1 -337
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +1 -24
- package/dist/components/VvProgress/VvProgress.es.js +1 -163
- package/dist/components/VvRadio/VvRadio.es.js +1 -661
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +1 -901
- package/dist/components/VvSelect/VvSelect.es.js +1 -1103
- package/dist/components/VvSelect/VvSelect.vue.d.ts +3 -1
- package/dist/components/VvTab/VvTab.es.js +1 -558
- package/dist/components/VvTextarea/VvTextarea.es.js +2 -1989
- package/dist/components/VvTooltip/VvTooltip.es.js +1 -154
- package/dist/components/index.es.js +6 -8558
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +2 -247
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +2 -311
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +2 -142
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +1 -172
- package/dist/icons.es.js +1 -39
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1 -219
- package/dist/resolvers/unplugin.es.js +1 -187
- package/package.json +33 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue"),require("comlink"),require("pica")):"function"==typeof define&&define.amd?define(["vue","comlink","pica"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["v-contextmenu"]=e(t.vue,t.comlink)}(this,function(t,e){"use strict";function n(e,n){const{x:a,y:o,getBoundingClientRect:l,onScroll:i}=function(e){const n=t.ref(0),a=t.ref(0),o=t.ref();let l=0,i=0,s=0,c=0;const u=t=>{const e=t.target;l=e.scrollLeft-c,i=e.scrollTop-s,a.value=a.value-i,n.value=n.value-l,c=e.scrollLeft,s=e.scrollTop},h=()=>({width:0,height:0,x:n.value,y:a.value,top:a.value,left:n.value,right:n.value,bottom:a.value});t.getCurrentInstance()&&(t.onMounted(()=>{e.value&&(e.value.init({getBoundingClientRect:h}),o.value=r(e.value.$el),o.value&&o.value.addEventListener("scroll",u))}),t.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",u)}));return{x:n,y:a,getBoundingClientRect:h,onScroll:u}}(e),s=t=>{a.value=t.clientX,o.value=t.clientY,t.preventDefault(),e.value.show()},c=t.computed(()=>t.unref(n));return c&&t.getCurrentInstance()&&(t.onMounted(()=>{c.value?.addEventListener("contextmenu",s,!1)}),t.onUnmounted(()=>{c.value?.removeEventListener("contextmenu",s)})),{x:a,y:o,getBoundingClientRect:l,onContextmenu:s,onScroll:i}}function r(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t.reactive(new Map([["default",new Map]]));const a='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m}
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue"),require("comlink"),require("pica")):"function"==typeof define&&define.amd?define(["vue","comlink","pica"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["v-contextmenu"]=e(t.vue,t.comlink)}(this,function(t,e){"use strict";function n(e,n){const{x:a,y:o,getBoundingClientRect:l,onScroll:i}=function(e){const n=t.ref(0),a=t.ref(0),o=t.ref();let l=0,i=0,s=0,c=0;const u=t=>{const e=t.target;l=e.scrollLeft-c,i=e.scrollTop-s,a.value=a.value-i,n.value=n.value-l,c=e.scrollLeft,s=e.scrollTop},h=()=>({width:0,height:0,x:n.value,y:a.value,top:a.value,left:n.value,right:n.value,bottom:a.value});t.getCurrentInstance()&&(t.onMounted(()=>{e.value&&(e.value.init({getBoundingClientRect:h}),o.value=r(e.value.$el),o.value&&o.value.addEventListener("scroll",u))}),t.onUnmounted(()=>{o.value&&o.value.removeEventListener("scroll",u)}));return{x:n,y:a,getBoundingClientRect:h,onScroll:u}}(e),s=t=>{a.value=t.clientX,o.value=t.clientY,t.preventDefault(),e.value.show()},c=t.computed(()=>t.unref(n));return c&&t.getCurrentInstance()&&(t.onMounted(()=>{c.value?.addEventListener("contextmenu",s,!1)}),t.onUnmounted(()=>{c.value?.removeEventListener("contextmenu",s)})),{x:a,y:o,getBoundingClientRect:l,onContextmenu:s,onScroll:i}}function r(t){if(!t)return;let e=t.parentElement;for(;e;){const{overflow:t}=window.getComputedStyle(e);if(t.split(" ").every(t=>"auto"===t||"scroll"===t))return e;e=e.parentElement}return document.documentElement}t.reactive(new Map([["default",new Map]]));const a='!function(){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],e=e=>{let n=0;for(let r=0;r<e.length;r++){let a=e[r];n=83*n+t.indexOf(a)}return n},n=(e,n)=>{var r="";for(let a=1;a<=n;a++){let o=Math.floor(e)/Math.pow(83,n-a)%83;r+=t[Math.floor(o)]}return r},r=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},o=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},i=t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let n=e(t[0]),r=Math.floor(n/9)+1,a=n%9+1;if(t.length!==4+2*a*r)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*a*r}`)},l=t=>{let e=t>>8&255,n=255&t;return[r(t>>16),r(e),r(n)]},c=(t,e)=>{let n=Math.floor(t/361),r=Math.floor(t/19)%19,a=t%19;return[o((n-9)/9,2)*e,o((r-9)/9,2)*e,o((a-9)/9,2)*e]},h=(t,n,r,o)=>{i(t),o|=1;let s=e(t[0]),h=Math.floor(s/9)+1,u=s%9+1,f=(e(t[1])+1)/166,p=new Array(u*h);for(let a=0;a<p.length;a++)if(0===a){let n=e(t.substring(2,6));p[a]=l(n)}else{let n=e(t.substring(4+2*a,6+2*a));p[a]=c(n,f*o)}let m=4*n,g=new Uint8ClampedArray(m*r);for(let e=0;e<r;e++)for(let t=0;t<n;t++){let o=0,s=0,i=0;for(let a=0;a<h;a++)for(let l=0;l<u;l++){let c=Math.cos(Math.PI*t*l/n)*Math.cos(Math.PI*e*a/r),h=p[l+a*u];o+=h[0]*c,s+=h[1]*c,i+=h[2]*c}let l=a(o),c=a(s),f=a(i);g[4*t+0+e*m]=l,g[4*t+1+e*m]=c,g[4*t+2+e*m]=f,g[4*t+3+e*m]=255}return g},u=(t,e,n,a)=>{let o=0,s=0,i=0,l=4*e;for(let h=0;h<e;h++){let e=4*h;for(let c=0;c<n;c++){let n=e+c*l,u=a(h,c);o+=u*r(t[n]),s+=u*r(t[n+1]),i+=u*r(t[n+2])}}let c=1/(e*n);return[o*c,s*c,i*c]},f=(t,e,r,i,l)=>{if(i<1||i>9||l<1||l>9)throw new s("BlurHash must have between 1 and 9 components");if(e*r*4!==t.length)throw new s("Width and height must match the pixels array");let c=[];for(let n=0;n<l;n++)for(let a=0;a<i;a++){let o=0==a&&0==n?1:2,s=u(t,e,r,(t,s)=>o*Math.cos(Math.PI*a*t/e)*Math.cos(Math.PI*n*s/r));c.push(s)}let h,f=c[0],p=c.slice(1),m="";if(m+=n(i-1+9*(l-1),1),p.length>0){let t=Math.max(...p.map(t=>Math.max(...t))),e=Math.floor(Math.max(0,Math.min(82,Math.floor(166*t-.5))));h=(e+1)/166,m+=n(e,1)}else h=1,m+=n(0,1);return m+=n((t=>(a(t[0])<<16)+(a(t[1])<<8)+a(t[2]))(f),4),p.forEach(t=>{m+=n(((t,e)=>19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*o(t[2]/e,.5)+9.5)))))(t,h),2)}),m};const p=Symbol("Comlink.proxy"),m=Symbol("Comlink.endpoint"),g=Symbol("Comlink.releaseProxy"),M=Symbol("Comlink.finalizer"),d=Symbol("Comlink.thrown"),y=t=>"object"==typeof t&&null!==t||"function"==typeof t,w=new Map([["proxy",{canHandle:t=>y(t)&&t[p],serialize(t){const{port1:e,port2:n}=new MessageChannel;return b(t,e),[n,[n]]},deserialize:t=>(t.start(),function(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),P(t,n,[],e)}(t))}],["throw",{canHandle:t=>y(t)&&d in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function b(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(a){if(!a||!a.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,a.origin))return void console.warn(`Invalid origin \'${a.origin}\' for comlink proxy`);const{id:o,type:s,path:i}=Object.assign({path:[]},a.data),l=(a.data.argumentList||[]).map(L);let c;try{const e=i.slice(0,-1).reduce((t,e)=>t[e],t),n=i.reduce((t,e)=>t[e],t);switch(s){case"GET":c=n;break;case"SET":e[i.slice(-1)[0]]=L(a.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[p]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;b(t,n),c=function(t,e){return T.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(h){c={value:h,[d]:0}}Promise.resolve(c).catch(t=>({value:t,[d]:0})).then(n=>{const[a,i]=R(n);e.postMessage(Object.assign(Object.assign({},a),{id:o}),i),"RELEASE"===s&&(e.removeEventListener("message",r),E(e),M in t&&"function"==typeof t[M]&&t[M]())}).catch(t=>{const[n,r]=R({value:new TypeError("Unserializable return value"),[d]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function E(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function v(t){if(t)throw new Error("Proxy has been released and is not useable")}function S(t){return O(t,new Map,{type:"RELEASE"}).then(()=>{E(t)})}const x=new WeakMap,k="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(x.get(t)||0)-1;x.set(t,e),0===e&&S(t)});function P(t,e,n=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(r,s){if(v(a),s===g)return()=>{!function(t){k&&k.unregister(t)}(o),S(t),e.clear(),a=!0};if("then"===s){if(0===n.length)return{then:()=>o};const r=O(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(L);return r.then.bind(r)}return P(t,e,[...n,s])},set(r,o,s){v(a);const[i,l]=R(s);return O(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:i},l).then(L)},apply(r,o,s){v(a);const i=n[n.length-1];if(i===m)return O(t,e,{type:"ENDPOINT"}).then(L);if("bind"===i)return P(t,e,n.slice(0,-1));const[l,c]=A(s);return O(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(L)},construct(r,o){v(a);const[s,i]=A(o);return O(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:s},i).then(L)}});return function(t,e){const n=(x.get(e)||0)+1;x.set(e,n),k&&k.register(t,e,t)}(o,t),o}function A(t){const e=t.map(R);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const T=new WeakMap;function R(t){for(const[e,n]of w)if(n.canHandle(t)){const[r,a]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},a]}return[{type:"RAW",value:t},T.get(t)||[]]}function L(t){switch(t.type){case"HANDLER":return w.get(t.name).deserialize(t.value);case"RAW":return t.value}}function O(t,e,n,r){return new Promise(a=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,a),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}b({ValidationError:s,encode:f,decode:h,isBlurhashValid:t=>{try{i(t)}catch(e){return{result:!1,errorReason:e.message}}return{result:!0}}})}();\n',o="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",a],{type:"text/javascript;charset=utf-8"});e.wrap(new function(t){let e;try{if(e=o&&(self.URL||self.webkitURL).createObjectURL(o),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(a),{name:t?.name})}});return{beforeUpdate(t,e){const{onContextmenu:a,onScroll:o,getBoundingClientRect:l}=n(e);e.value.init({getBoundingClientRect:l}),t.addEventListener("contextmenu",a,!1);const i=r(e.value.$el);i&&i.addEventListener("scroll",o),t.additionalData={onContextmenu:a,onScroll:o,scrollContainerEl:i}},beforeUnmount(t){t?.additionalData?.onContextmenu&&t.removeEventListener("contextmenu",t.additionalData.onContextmenu),t?.additionalData?.onScroll&&t?.additionalData?.scrollContainerEl&&t.additionalData.scrollContainerEl.removeEventListener("scroll",t.additionalData.onScroll)}}});
|
|
@@ -1,172 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var StorageType = /* @__PURE__ */ ((StorageType2) => {
|
|
3
|
-
StorageType2["local"] = "local";
|
|
4
|
-
StorageType2["session"] = "session";
|
|
5
|
-
return StorageType2;
|
|
6
|
-
})(StorageType || {});
|
|
7
|
-
var Side = /* @__PURE__ */ ((Side2) => {
|
|
8
|
-
Side2["left"] = "left";
|
|
9
|
-
Side2["right"] = "right";
|
|
10
|
-
Side2["top"] = "top";
|
|
11
|
-
Side2["bottom"] = "bottom";
|
|
12
|
-
return Side2;
|
|
13
|
-
})(Side || {});
|
|
14
|
-
var Position = /* @__PURE__ */ ((Position2) => {
|
|
15
|
-
Position2["before"] = "before";
|
|
16
|
-
Position2["after"] = "after";
|
|
17
|
-
return Position2;
|
|
18
|
-
})(Position || {});
|
|
19
|
-
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
20
|
-
ButtonType2["button"] = "button";
|
|
21
|
-
ButtonType2["submit"] = "submit";
|
|
22
|
-
ButtonType2["reset"] = "reset";
|
|
23
|
-
return ButtonType2;
|
|
24
|
-
})(ButtonType || {});
|
|
25
|
-
var ActionTag = /* @__PURE__ */ ((ActionTag2) => {
|
|
26
|
-
ActionTag2["nuxtLink"] = "nuxt-link";
|
|
27
|
-
ActionTag2["routerLink"] = "router-link";
|
|
28
|
-
ActionTag2["a"] = "a";
|
|
29
|
-
ActionTag2["button"] = "button";
|
|
30
|
-
return ActionTag2;
|
|
31
|
-
})(ActionTag || {});
|
|
32
|
-
const ModifiersProps = {
|
|
33
|
-
/**
|
|
34
|
-
* Component BEM modifiers
|
|
35
|
-
*/
|
|
36
|
-
modifiers: {
|
|
37
|
-
type: [String, Array],
|
|
38
|
-
default: void 0
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
({
|
|
42
|
-
/**
|
|
43
|
-
* VvIcon position
|
|
44
|
-
*/
|
|
45
|
-
iconPosition: {
|
|
46
|
-
default: Position.before
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
({
|
|
50
|
-
/**
|
|
51
|
-
* Dropdown placement
|
|
52
|
-
*/
|
|
53
|
-
placement: {
|
|
54
|
-
default: Side.bottom
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
({
|
|
58
|
-
/**
|
|
59
|
-
* Button type
|
|
60
|
-
*/
|
|
61
|
-
type: {
|
|
62
|
-
default: ButtonType.button
|
|
63
|
-
},
|
|
64
|
-
/**
|
|
65
|
-
* Default tag for the action
|
|
66
|
-
*/
|
|
67
|
-
defaultTag: {
|
|
68
|
-
default: ActionTag.button
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
({
|
|
72
|
-
storageType: {
|
|
73
|
-
default: StorageType.local
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const VvTooltipProps = {
|
|
77
|
-
...ModifiersProps,
|
|
78
|
-
/**
|
|
79
|
-
* Define the tooltip position
|
|
80
|
-
* @default Side.bottom
|
|
81
|
-
*/
|
|
82
|
-
position: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: Side.bottom
|
|
85
|
-
},
|
|
86
|
-
value: {
|
|
87
|
-
type: String
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
function useModifiers(prefix, modifiers, others) {
|
|
91
|
-
return computed(() => {
|
|
92
|
-
const toReturn = {
|
|
93
|
-
[prefix]: true
|
|
94
|
-
};
|
|
95
|
-
const modifiersArray = typeof modifiers?.value === "string" ? modifiers.value.split(" ") : modifiers?.value;
|
|
96
|
-
if (modifiersArray) {
|
|
97
|
-
if (Array.isArray(modifiersArray)) {
|
|
98
|
-
modifiersArray.forEach((modifier) => {
|
|
99
|
-
if (modifier) {
|
|
100
|
-
toReturn[`${prefix}--${modifier}`] = true;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (others) {
|
|
106
|
-
Object.keys(others.value).forEach((key) => {
|
|
107
|
-
toReturn[`${prefix}--${key}`] = unref(others.value[key]);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return toReturn;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
const __default__ = {
|
|
114
|
-
name: "VvTooltip"
|
|
115
|
-
};
|
|
116
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
117
|
-
...__default__,
|
|
118
|
-
props: VvTooltipProps,
|
|
119
|
-
setup(__props) {
|
|
120
|
-
const props = __props;
|
|
121
|
-
const { modifiers } = toRefs(props);
|
|
122
|
-
const bemCssClasses = useModifiers(
|
|
123
|
-
"vv-tooltip",
|
|
124
|
-
modifiers,
|
|
125
|
-
computed(() => ({
|
|
126
|
-
[props.position]: true
|
|
127
|
-
}))
|
|
128
|
-
);
|
|
129
|
-
return (_ctx, _cache) => {
|
|
130
|
-
return openBlock(), createElementBlock(
|
|
131
|
-
"span",
|
|
132
|
-
{
|
|
133
|
-
class: normalizeClass(unref(bemCssClasses)),
|
|
134
|
-
role: "tooltip",
|
|
135
|
-
inert: ""
|
|
136
|
-
},
|
|
137
|
-
[
|
|
138
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
139
|
-
createTextVNode(
|
|
140
|
-
toDisplayString(_ctx.value),
|
|
141
|
-
1
|
|
142
|
-
/* TEXT */
|
|
143
|
-
)
|
|
144
|
-
])
|
|
145
|
-
],
|
|
146
|
-
2
|
|
147
|
-
/* CLASS */
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
const tooltip = /* @__PURE__ */ (() => {
|
|
153
|
-
return {
|
|
154
|
-
beforeMount(el, binding) {
|
|
155
|
-
const tooltip2 = h(_sfc_main, {
|
|
156
|
-
value: binding.value,
|
|
157
|
-
position: binding.arg
|
|
158
|
-
});
|
|
159
|
-
render(tooltip2, el);
|
|
160
|
-
},
|
|
161
|
-
updated(el, binding) {
|
|
162
|
-
const tooltip2 = h(_sfc_main, {
|
|
163
|
-
value: binding.value,
|
|
164
|
-
position: binding.arg
|
|
165
|
-
});
|
|
166
|
-
render(tooltip2, el);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
})();
|
|
170
|
-
export {
|
|
171
|
-
tooltip as default
|
|
172
|
-
};
|
|
1
|
+
import{computed as t,unref as o,defineComponent as e,toRefs as r,createElementBlock as n,openBlock as a,normalizeClass as i,renderSlot as u,createTextVNode as s,toDisplayString as l,h as p,render as f}from"vue";var b=/* @__PURE__ */(t=>(t.local="local",t.session="session",t))(b||{}),v=/* @__PURE__ */(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(v||{}),c=/* @__PURE__ */(t=>(t.before="before",t.after="after",t))(c||{}),m=/* @__PURE__ */(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(m||{}),d=/* @__PURE__ */(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(d||{});const g={modifiers:{type:[String,Array],default:void 0}};c.before,v.bottom,m.button,d.button,b.local;const y=/* @__PURE__ */e({name:"VvTooltip",props:{...g,position:{type:String,default:v.bottom},value:{type:String}},setup(e){const p=e,{modifiers:f}=r(p),b=function(e,r,n){return t(()=>{const t={[e]:!0},a="string"==typeof r?.value?r.value.split(" "):r?.value;return a&&Array.isArray(a)&&a.forEach(o=>{o&&(t[`${e}--${o}`]=!0)}),n&&Object.keys(n.value).forEach(r=>{t[`${e}--${r}`]=o(n.value[r])}),t})}("vv-tooltip",f,t(()=>({[p.position]:!0})));return(t,e)=>(a(),n("span",{class:i(o(b)),role:"tooltip",inert:""},[u(t.$slots,"default",{},()=>[s(l(t.value),1)])],2))}}),k=/* @__PURE__ */(()=>({beforeMount(t,o){const e=p(y,{value:o.value,position:o.arg});f(e,t)},updated(t,o){const e=p(y,{value:o.value,position:o.arg});f(e,t)}}))();export{k as default};
|