@oneb/ui-vue 0.1.17 → 0.1.18

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1},src:{type:[String,null],required:!1}},m=["src"],h=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,o=e.computed(()=>{if(t.text==null||t.text==="")return"";const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(l=>l.slice(0,1)).slice(0,2).join("").toUpperCase()}),i=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),a=e.computed(()=>{if(t.text==null)return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"};const r=t.text.split("").map(n=>n.charCodeAt(0)).reduce((n,d)=>n+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),c=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(c.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full h-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(a.value),class:"block"},[o.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(i.value)},e.toDisplayString(o.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1},src:{type:[String,null],required:!1}},m=["src"],y=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,o=e.computed(()=>{if(t.text==null||t.text==="")return"";const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(n=>n.slice(0,1)).slice(0,2).join("").toUpperCase()}),i=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),a=e.computed(()=>{if(t.text==null)return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"};const r=t.text.split("").map(l=>l.charCodeAt(0)).reduce((l,d)=>l+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),c=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(c.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(a.value),class:"block"},[o.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(i.value)},e.toDisplayString(o.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=y;
@@ -55,7 +55,7 @@ const y = {
55
55
  key: 0,
56
56
  src: t.src,
57
57
  alt: "",
58
- class: "w-full h-full"
58
+ class: "w-full"
59
59
  }, null, 8, v)) : (s(), n("svg", {
60
60
  key: 1,
61
61
  style: i(d.value),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [