@oneb/ui-vue 0.0.15 → 0.0.16

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)).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"],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;
@@ -24,7 +24,7 @@ const y = {
24
24
  if (e.text == null || e.text === "")
25
25
  return "";
26
26
  const t = e.text.trim().split(" ");
27
- return t.length < 2 ? e.text.slice(0, 2).toUpperCase() : t.map((l) => l.slice(0, 1)).join("").toUpperCase();
27
+ return t.length < 2 ? e.text.slice(0, 2).toUpperCase() : t.map((l) => l.slice(0, 1)).slice(0, 2).join("").toUpperCase();
28
28
  }), c = r(() => ({
29
29
  fill: "rgba(255, 255, 255, .75)",
30
30
  fontSize: `${Number(e.size) * 0.4}px`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [