@opens/ui 1.0.3 → 1.0.4
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/dist/yunique_ui.cjs.js +1 -1
- package/dist/yunique_ui.es.js +44 -44
- package/dist/yunique_ui.umd.js +1 -1
- package/package.json +1 -1
package/dist/yunique_ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k={class:"simple-input"},B={class:"yu-flex yu-h-full yu-pl-2"},V={class:"material-icons yu-text-gray-700 yu-my-auto"},E=["placeholder","type","maxlength"],m=e.defineComponent({__name:"icon-text-input",props:{value:null,label:null,icon:null,placeholder:null,type:null,tooltip:null,caract:null,invalid:{type:Boolean}},emits:["blur","focus","input"],setup(t,{emit:l}){const o=t;e.ref(!1);const u=e.ref(o.value);e.ref(!1);const a=e.ref(o.type),r=e.ref(!1);e.watch(r,s=>{if(!s){l("blur");return}l("focus")});function y(){return!(r.value||u.value)}function c(s){l("input",s.target.value)}return(s,n)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",B,[e.createElementVNode("i",V,e.toDisplayString(t.icon),1),e.createElementVNode("p",{class:e.normalizeClass(["yu-text-gray-500 yu-font-plus yu-font-medium yu-p-1 yu-px-2 yu-transition",{"yu-translate-y-2 yu-text-sm":y(),"yu-translate-y-0 yu-text-xs":!y()}])},e.toDisplayString(t.label),3)]),e.withDirectives(e.createElementVNode("input",{class:"yu-pl-8 yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800",placeholder:t.placeholder,onInput:c,onFocus:n[0]||(n[0]=i=>r.value=!0),onBlur:n[1]||(n[1]=i=>r.value=!1),"onUpdate:modelValue":n[2]||(n[2]=i=>u.value=i),type:a.value||t.type,onKeyup:n[3]||(n[3]=e.withKeys(i=>s.$emit("keyup-enter"),["enter"])),maxlength:t.caract},null,40,E),[[e.vModelDynamic,u.value]])]))}}),S=["disabled"],d=e.defineComponent({__name:"text-input",props:{modelValue:null,label:null,invalid:{type:Boolean},disabled:{type:Boolean}},emits:["update:model-value","blur","press-enter"],setup(t,{emit:l}){const o=t,u=e.ref(o.modelValue),a=e.ref(!1);function r(){return!(a.value||u.value)}function y(s){l(s)}function c(s){const n=s.target;l("update:model-value",n.value)}return(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-input",{"yu-border-red-500":t.invalid}])},[e.createElementVNode("p",{class:e.normalizeClass(["yu-text-gray-500 yu-font-plus yu-font-medium yu-p-1 yu-px-2 yu-transition",{"yu-translate-y-1/4 yu-text-sm":r(),"yu-translate-x-0 yu-text-xs":!r()}])},e.toDisplayString(t.label),3),e.withDirectives(e.createElementVNode("input",{class:"yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800 dark:yu-text-gray-200","onUpdate:modelValue":n[0]||(n[0]=i=>u.value=i),type:"text",disabled:t.disabled,onInput:c,onKeyup:n[1]||(n[1]=e.withKeys(i=>y("press-enter"),["enter"])),onFocus:n[2]||(n[2]=i=>a.value=!0),onBlur:n[3]||(n[3]=i=>a.value=!1)},null,40,S),[[e.vModelText,u.value]])],2))}}),N=["checked"],f=e.defineComponent({__name:"switch-checkbox",props:{modelValue:{type:Boolean},invalid:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","change","input"],setup(t,{emit:l}){const o=t,u=e.ref(o.modelValue);return e.ref(!1),e.watch(u,a=>{l("update:modelValue",a)}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"yu-relative yu-inline-block yu-w-10 yu-align-middle yu-select-none yu-transition yu-duration-200 yu-ease-in",onClick:r[0]||(r[0]=y=>u.value=!u.value)},[e.createElementVNode("input",{class:"yu-absolute yu-block yu-w-6 yu-h-6 yu-bg-white yu-border-4 yu-rounded-full yu-appearance-none yu-cursor-pointer toggle-checkbox checked:yu-right-0 checked:yu-border-primary-500",type:"checkbox",checked:u.value},null,8,N),e.createElementVNode("label",{class:e.normalizeClass(["yu-block yu-h-6 yu-overflow-hidden yu-bg-gray-300 yu-rounded-full yu-cursor-pointer yu-toggle-label",{"yu-bg-primary-500":u.value}]),for:"toggle"},null,2)]))}}),g=e.defineComponent({__name:"button-primary",props:{large:{type:Boolean,default:!1},small:{type:Boolean,default:!1},warning:{type:Boolean,default:!1},alert:{type:Boolean,default:!1},success:{type:Boolean,default:!1}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["yu-bg-primary yu-px-5 yu-p-2 yu-w-fit yu-text-base yu-text-white yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate hover:yu-brightness-90 active:yu-scale-95",{"!yu-px-7 !yu-p-4":t.large,"!yu-px-3 !yu-p-1":t.small,"!yu-bg-red-500":t.warning,"!yu-bg-yellow-400":t.alert,"!yu-bg-green-400":t.success}])},[e.renderSlot(l.$slots,"default")],2))}}),v=e.defineComponent({__name:"button-secondary",props:{large:{type:Boolean,default:!1},small:{type:Boolean,default:!1},warning:{type:Boolean,default:!1},alert:{type:Boolean,default:!1},success:{type:Boolean,default:!1}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["yu-text-primary yu-bg-primary yu-text-base yu-w-fit yu-px-5 yu-p-2 yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate !yu-bg-opacity-5 group hover:!yu-bg-opacity-10 active:yu-scale-95 active:!yu-bg-opacity-20",{"!yu-text-lg":t.large,"!yu-text-sm":t.small,"!yu-text-red-500 !yu-bg-red-500":t.warning,"!yu-text-yellow-400 !yu-bg-yellow-400":t.alert,"!yu-text-green-400 !yu-bg-green-400":t.success}])},[e.renderSlot(l.$slots,"default")],2))}}),C={class:"yu-transition yu-text-gray-900 yu-font-plus yu-text-sm yu-p-2 yu-font-semibold yu-rounded-md yu-cursor-pointer yu-flex yu-items-center active:yu-scale-95 hover:yu-bg-primary-500 hover:!yu-bg-opacity-10 hover:yu-text-primary-400"};function _(t,l){return e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default")])}const b=(t,l)=>{const o=t.__vccOpts||t;for(const[u,a]of l)o[u]=a;return o};var D={};const p=b(D,[["render",_]]),z={class:"yu-relative yu-w-full"},I={class:"yu-text-gray-700 yu-font-plus yu-font-medium yu-text-base yu-mr-2"},T={class:"yu-mt-2 yu-w-full yu-bg-white yu-rounded-md yu-flex yu-flex-col yu-gap-1 yu-shadow-md yu-absolute yu-z-10"},x=e.defineComponent({__name:"simple-dropdown",props:{label:{type:String,default:"Dropdown"},icon:{type:String,default:null}},setup(t){const l=e.ref(!1);return(o,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",z,[e.createElementVNode("button",{class:e.normalizeClass(["yu-ml-auto yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95",{"!yu-bg-primary-500 !yu-bg-opacity-10":l.value}]),onClick:u[0]||(u[0]=a=>l.value=!l.value)},[e.withDirectives(e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit",{"yu-text-primary-500":l.value}])},e.toDisplayString(t.icon),3),[[e.vShow,t.icon]]),e.createElementVNode("div",I,e.toDisplayString(t.label),1),e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto",{"yu-text-primary-500 yu-rotate-180":l.value}])}," keyboard_arrow_down",2)],2),e.withDirectives(e.createElementVNode("div",T,[e.createElementVNode("div",{class:"yu-w-full yu-rounded-md yu-p-2",onClick:u[1]||(u[1]=a=>l.value=!1)},[e.renderSlot(o.$slots,"default")])],512),[[e.vShow,l.value]])])]))}}),M={class:"yu-w-fit yu-relative"},P={class:"yu-text-gray-700 yu-font-plus yu-font-medium yu-text-base yu-mr-2"},K={class:"yu-mt-2 yu-w-full yu-bg-white yu-rounded-md yu-shadow-md yu-z-10 yu-absolute"},L={class:"yu-w-full yu-rounded-md yu-p-2 yu-flex yu-flex-col yu-gap-1"},U=e.createElementVNode("div",{class:"yu-text-gray-700 yu-text-xs"},"Selecionar todos",-1),h=e.defineComponent({__name:"select-dropdown",props:{label:{type:String,default:"Dropdown"},icon:{type:String,default:"input"}},emits:["select-all","deselect-all"],setup(t,{emit:l}){const o=e.ref(!1),u=e.ref(!1),a=()=>{if(u.value=!u.value,u.value){l("select-all");return}l("deselect-all")};return(r,y)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("button",{class:e.normalizeClass(["yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95",{"!yu-bg-primary-500 !yu-bg-opacity-10":o.value}]),onClick:y[0]||(y[0]=c=>o.value=!o.value)},[e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit",{"yu-text-primary-500":o.value}])},e.toDisplayString(t.icon),3),e.createElementVNode("div",P,e.toDisplayString(t.label),1),e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto",{"yu-text-primary-500 yu-rotate-180":o.value}])}," keyboard_arrow_down",2)],2),e.withDirectives(e.createElementVNode("div",K,[e.createElementVNode("div",L,[e.createVNode(d,{label:"Dropdown"}),e.createVNode(p,{onClick:y[2]||(y[2]=c=>a())},{default:e.withCtx(()=>[U,e.withDirectives(e.createElementVNode("input",{class:"yu-ml-auto yu-accent-primary-500 yu-border-2 yu-cursor-pointer",type:"checkbox","onUpdate:modelValue":y[1]||(y[1]=c=>u.value=c)},null,512),[[e.vModelCheckbox,u.value]])]),_:1}),e.renderSlot(r.$slots,"default")])],512),[[e.vShow,o.value]])]))}}),j={class:"yu-border yu-border-gray-100 yu-rounded-md yu-py-4 yu-px-3 yu-bg-white yu-flex yu-flex-col yu-justify-center yu-shadow-2xl yu-shadow-gray-100"},q={class:"yu-flex yu-gap-5 yu-px-2"},F={class:"yu-flex yu-flex-col"},O={class:"yu-font-plus yu-flex yu-text-xl yu-text-gray-800 yu-font-bold yu-items-center"},A={class:"yu-font-plus yu-text-xs yu-text-gray-400"},G={class:"yu-font-plus yu-text-gray-400 yu-font-medium yu-text-sm"},w=e.defineComponent({__name:"stat-card",props:{icon:{type:String,default:"assignment"},bad:{type:Boolean,default:!1},good:{type:Boolean,default:!1},comparison:{type:Number,default:0},total:{type:Number,default:100}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",q,[e.createElementVNode("i",{class:e.normalizeClass(["yu-aspect-square material-icons yu-bg-yellow-100 yu-text-yellow-500 yu-h-14 yu-w-14 yu-place-items-center yu-rounded-full !yu-text-1xl !yu-grid",{"!yu-text-red-500 !yu-bg-red-100":t.bad,"!yu-text-green-500 !yu-bg-green-100":t.good}])},e.toDisplayString(t.icon),3),e.createElementVNode("div",F,[e.createElementVNode("div",O,[e.createTextVNode(e.toDisplayString(t.comparison),1),e.createElementVNode("span",A,"/"+e.toDisplayString(t.total),1)]),e.createElementVNode("p",G,[e.renderSlot(l.$slots,"default")])])])]))}}),H={class:"yu-border yu-border-gray-100 yu-rounded-md yu-py-5 yu-px-5 yu-bg-white yu-shadow-md yu-shadow-gray-100"},J={class:"yu-font-plus yu-text-gray-800 yu-font-semibold yu-text-lg"},Q={class:"yu-mt-2 yu-flex yu-flex-col"};function R(t,l){return e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",J,[e.renderSlot(t.$slots,"heading")]),e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"list")])])}var W={};const $=b(W,[["render",R]]);const X={install:t=>{t.component("TextInput",d),t.component("IconTextInput",m),t.component("SwitchCheckbox",f),t.component("ButtonPrimary",g),t.component("ButtonSecondary",v),t.component("SimpleDropdown",x),t.component("SelectDropdown",h),t.component("SimpleDropdownItem",p),t.component("StatCard",w),t.component("ListCard",$)}};exports.ButtonPrimary=g;exports.ButtonSecondary=v;exports.IconTextInput=m;exports.ListCard=$;exports.SelectDropdown=h;exports.SimpleDropdown=x;exports.SimpleDropdownItem=p;exports.StatCard=w;exports.SwitchCheckbox=f;exports.TextInput=d;exports.default=X;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k={class:"simple-input"},B={class:"yu-flex yu-h-full yu-pl-2"},V={class:"material-icons yu-text-gray-700 yu-my-auto"},E=["placeholder","type","maxlength"],m=e.defineComponent({__name:"icon-text-input",props:{value:null,label:null,icon:null,placeholder:null,type:null,tooltip:null,caract:null,invalid:{type:Boolean}},emits:["blur","focus","input"],setup(t,{emit:l}){const o=t;e.ref(!1);const u=e.ref(o.value);e.ref(!1);const a=e.ref(o.type),r=e.ref(!1);e.watch(r,s=>{if(!s){l("blur");return}l("focus")});function y(){return!(r.value||u.value)}function c(s){l("input",s.target.value)}return(s,n)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",B,[e.createElementVNode("i",V,e.toDisplayString(t.icon),1),e.createElementVNode("p",{class:e.normalizeClass(["yu-text-gray-500 yu-font-plus yu-font-medium yu-p-1 yu-px-2 yu-transition",{"yu-translate-y-2 yu-text-sm":y(),"yu-translate-y-0 yu-text-xs":!y()}])},e.toDisplayString(t.label),3)]),e.withDirectives(e.createElementVNode("input",{class:"yu-pl-8 yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800",placeholder:t.placeholder,onInput:c,onFocus:n[0]||(n[0]=i=>r.value=!0),onBlur:n[1]||(n[1]=i=>r.value=!1),"onUpdate:modelValue":n[2]||(n[2]=i=>u.value=i),type:a.value||t.type,onKeyup:n[3]||(n[3]=e.withKeys(i=>s.$emit("keyup-enter"),["enter"])),maxlength:t.caract},null,40,E),[[e.vModelDynamic,u.value]])]))}}),S=["disabled"],d=e.defineComponent({__name:"text-input",props:{modelValue:null,label:null,invalid:{type:Boolean},disabled:{type:Boolean}},emits:["update:model-value","blur","press-enter"],setup(t,{emit:l}){const o=t,u=e.ref(o.modelValue),a=e.ref(!1);function r(){return!(a.value||u.value)}function y(s){l(s)}function c(s){const n=s.target;l("update:model-value",n.value)}return(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-input",{"yu-border-red-500":t.invalid}])},[e.createElementVNode("p",{class:e.normalizeClass(["yu-text-gray-500 yu-font-plus yu-font-medium yu-p-1 yu-px-2 yu-transition",{"yu-translate-y-1/4 yu-text-sm":r(),"yu-translate-x-0 yu-text-xs":!r()}])},e.toDisplayString(t.label),3),e.withDirectives(e.createElementVNode("input",{class:"yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800 dark:yu-text-gray-200","onUpdate:modelValue":n[0]||(n[0]=i=>u.value=i),type:"text",disabled:t.disabled,onInput:c,onKeyup:n[1]||(n[1]=e.withKeys(i=>y("press-enter"),["enter"])),onFocus:n[2]||(n[2]=i=>a.value=!0),onBlur:n[3]||(n[3]=i=>a.value=!1)},null,40,S),[[e.vModelText,u.value]])],2))}}),N=["checked"],f=e.defineComponent({__name:"switch-checkbox",props:{modelValue:{type:Boolean},invalid:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","change","input"],setup(t,{emit:l}){const o=t,u=e.ref(o.modelValue);return e.ref(!1),e.watch(u,a=>{l("update:modelValue",a)}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"yu-relative yu-inline-block yu-w-10 yu-align-middle yu-select-none yu-transition yu-duration-200 yu-ease-in",onClick:r[0]||(r[0]=y=>u.value=!u.value)},[e.createElementVNode("input",{class:"yu-absolute yu-block yu-w-6 yu-h-6 yu-bg-white yu-border-4 yu-rounded-full yu-appearance-none yu-cursor-pointer toggle-checkbox checked:yu-right-0 checked:yu-border-primary-500",type:"checkbox",checked:u.value},null,8,N),e.createElementVNode("label",{class:e.normalizeClass(["yu-block yu-h-6 yu-overflow-hidden yu-bg-gray-300 yu-rounded-full yu-cursor-pointer yu-toggle-label",{"yu-bg-primary-500":u.value}]),for:"toggle"},null,2)]))}}),g=e.defineComponent({__name:"button-primary",props:{large:{type:Boolean,default:!1},small:{type:Boolean,default:!1},warning:{type:Boolean,default:!1},alert:{type:Boolean,default:!1},success:{type:Boolean,default:!1}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["yu-bg-primary yu-px-5 yu-p-2 yu-w-fit yu-text-base yu-text-white yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate hover:yu-brightness-90 active:yu-scale-95",{"!yu-px-7 !yu-p-4":t.large,"!yu-px-3 !yu-p-1":t.small,"!yu-bg-red-500":t.warning,"!yu-bg-yellow-400":t.alert,"!yu-bg-green-400":t.success}])},[e.renderSlot(l.$slots,"default")],2))}}),v=e.defineComponent({__name:"button-secondary",props:{large:{type:Boolean,default:!1},small:{type:Boolean,default:!1},warning:{type:Boolean,default:!1},alert:{type:Boolean,default:!1},success:{type:Boolean,default:!1}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["yu-text-primary yu-bg-primary yu-text-base yu-w-fit yu-px-5 yu-p-2 yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate !yu-bg-opacity-5 group hover:!yu-bg-opacity-10 active:yu-scale-95 active:!yu-bg-opacity-20",{"!yu-text-lg":t.large,"!yu-text-sm":t.small,"!yu-text-red-500 !yu-bg-red-500":t.warning,"!yu-text-yellow-400 !yu-bg-yellow-400":t.alert,"!yu-text-green-400 !yu-bg-green-400":t.success}])},[e.renderSlot(l.$slots,"default")],2))}}),C={class:"yu-transition yu-text-gray-900 yu-font-plus yu-text-sm yu-p-2 yu-font-semibold yu-rounded-md yu-cursor-pointer yu-flex yu-items-center active:yu-scale-95 hover:yu-bg-primary-500 hover:!yu-bg-opacity-10 hover:yu-text-primary-400"};function _(t,l){return e.openBlock(),e.createElementBlock("div",C,[e.renderSlot(t.$slots,"default")])}const b=(t,l)=>{const o=t.__vccOpts||t;for(const[u,a]of l)o[u]=a;return o};var D={};const p=b(D,[["render",_]]),z={class:"yu-relative yu-w-full"},I={class:"yu-text-gray-700 yu-font-plus yu-font-medium yu-text-base yu-mr-2"},T={class:"yu-mt-2 yu-w-full yu-bg-white yu-rounded-md yu-flex yu-flex-col yu-gap-1 yu-shadow-md yu-absolute yu-z-10"},x=e.defineComponent({__name:"simple-dropdown",props:{label:{type:String,default:"Dropdown"},icon:{type:String,default:null}},setup(t){const l=e.ref(!1);return(o,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",z,[e.createElementVNode("button",{class:e.normalizeClass(["yu-w-full yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95",{"!yu-bg-primary-500 !yu-bg-opacity-10":l.value}]),onClick:u[0]||(u[0]=a=>l.value=!l.value)},[e.withDirectives(e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit",{"yu-text-primary-500":l.value}])},e.toDisplayString(t.icon),3),[[e.vShow,t.icon]]),e.createElementVNode("div",I,e.toDisplayString(t.label),1),e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto",{"yu-text-primary-500 yu-rotate-180":l.value}])}," keyboard_arrow_down",2)],2),e.withDirectives(e.createElementVNode("div",T,[e.createElementVNode("div",{class:"yu-w-full yu-rounded-md yu-p-2",onClick:u[1]||(u[1]=a=>l.value=!1)},[e.renderSlot(o.$slots,"default")])],512),[[e.vShow,l.value]])])]))}}),M={class:"yu-w-fit yu-relative"},P={class:"yu-text-gray-700 yu-font-plus yu-font-medium yu-text-base yu-mr-2"},K={class:"yu-mt-2 yu-w-full yu-bg-white yu-rounded-md yu-shadow-md yu-z-10 yu-absolute"},L={class:"yu-w-full yu-rounded-md yu-p-2 yu-flex yu-flex-col yu-gap-1"},U=e.createElementVNode("div",{class:"yu-text-gray-700 yu-text-xs"},"Selecionar todos",-1),h=e.defineComponent({__name:"select-dropdown",props:{label:{type:String,default:"Dropdown"},icon:{type:String,default:"input"}},emits:["select-all","deselect-all"],setup(t,{emit:l}){const o=e.ref(!1),u=e.ref(!1),a=()=>{if(u.value=!u.value,u.value){l("select-all");return}l("deselect-all")};return(r,y)=>(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("button",{class:e.normalizeClass(["yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95",{"!yu-bg-primary-500 !yu-bg-opacity-10":o.value}]),onClick:y[0]||(y[0]=c=>o.value=!o.value)},[e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit",{"yu-text-primary-500":o.value}])},e.toDisplayString(t.icon),3),e.createElementVNode("div",P,e.toDisplayString(t.label),1),e.createElementVNode("i",{class:e.normalizeClass(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto",{"yu-text-primary-500 yu-rotate-180":o.value}])}," keyboard_arrow_down",2)],2),e.withDirectives(e.createElementVNode("div",K,[e.createElementVNode("div",L,[e.createVNode(d,{label:"Dropdown"}),e.createVNode(p,{onClick:y[2]||(y[2]=c=>a())},{default:e.withCtx(()=>[U,e.withDirectives(e.createElementVNode("input",{class:"yu-ml-auto yu-accent-primary-500 yu-border-2 yu-cursor-pointer",type:"checkbox","onUpdate:modelValue":y[1]||(y[1]=c=>u.value=c)},null,512),[[e.vModelCheckbox,u.value]])]),_:1}),e.renderSlot(r.$slots,"default")])],512),[[e.vShow,o.value]])]))}}),j={class:"yu-border yu-border-gray-100 yu-rounded-md yu-py-4 yu-px-3 yu-bg-white yu-flex yu-flex-col yu-justify-center yu-shadow-2xl yu-shadow-gray-100"},q={class:"yu-flex yu-gap-5 yu-px-2"},F={class:"yu-flex yu-flex-col"},O={class:"yu-font-plus yu-flex yu-text-xl yu-text-gray-800 yu-font-bold yu-items-center"},A={class:"yu-font-plus yu-text-xs yu-text-gray-400"},G={class:"yu-font-plus yu-text-gray-400 yu-font-medium yu-text-sm"},w=e.defineComponent({__name:"stat-card",props:{icon:{type:String,default:"assignment"},bad:{type:Boolean,default:!1},good:{type:Boolean,default:!1},comparison:{type:Number,default:0},total:{type:Number,default:100}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",q,[e.createElementVNode("i",{class:e.normalizeClass(["yu-aspect-square material-icons yu-bg-yellow-100 yu-text-yellow-500 yu-h-14 yu-w-14 yu-place-items-center yu-rounded-full !yu-text-1xl !yu-grid",{"!yu-text-red-500 !yu-bg-red-100":t.bad,"!yu-text-green-500 !yu-bg-green-100":t.good}])},e.toDisplayString(t.icon),3),e.createElementVNode("div",F,[e.createElementVNode("div",O,[e.createTextVNode(e.toDisplayString(t.comparison),1),e.createElementVNode("span",A,"/"+e.toDisplayString(t.total),1)]),e.createElementVNode("p",G,[e.renderSlot(l.$slots,"default")])])])]))}}),H={class:"yu-border yu-border-gray-100 yu-rounded-md yu-py-5 yu-px-5 yu-bg-white yu-shadow-md yu-shadow-gray-100"},J={class:"yu-font-plus yu-text-gray-800 yu-font-semibold yu-text-lg"},Q={class:"yu-mt-2 yu-flex yu-flex-col"};function R(t,l){return e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",J,[e.renderSlot(t.$slots,"heading")]),e.createElementVNode("div",Q,[e.renderSlot(t.$slots,"list")])])}var W={};const $=b(W,[["render",R]]);const X={install:t=>{t.component("TextInput",d),t.component("IconTextInput",m),t.component("SwitchCheckbox",f),t.component("ButtonPrimary",g),t.component("ButtonSecondary",v),t.component("SimpleDropdown",x),t.component("SelectDropdown",h),t.component("SimpleDropdownItem",p),t.component("StatCard",w),t.component("ListCard",$)}};exports.ButtonPrimary=g;exports.ButtonSecondary=v;exports.IconTextInput=m;exports.ListCard=$;exports.SelectDropdown=h;exports.SimpleDropdown=x;exports.SimpleDropdownItem=p;exports.StatCard=w;exports.SwitchCheckbox=f;exports.TextInput=d;exports.default=X;
|
package/dist/yunique_ui.es.js
CHANGED
|
@@ -13,11 +13,11 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
13
13
|
},
|
|
14
14
|
emits: ["blur", "focus", "input"],
|
|
15
15
|
setup(e, { emit: u }) {
|
|
16
|
-
const
|
|
16
|
+
const n = e;
|
|
17
17
|
i(!1);
|
|
18
|
-
const l = i(
|
|
18
|
+
const l = i(n.value);
|
|
19
19
|
i(!1);
|
|
20
|
-
const
|
|
20
|
+
const a = i(n.type), s = i(!1);
|
|
21
21
|
$(s, (d) => {
|
|
22
22
|
if (!d) {
|
|
23
23
|
u("blur");
|
|
@@ -31,7 +31,7 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
31
31
|
function b(d) {
|
|
32
32
|
u("input", d.target.value);
|
|
33
33
|
}
|
|
34
|
-
return (d,
|
|
34
|
+
return (d, o) => (p(), f("div", N, [
|
|
35
35
|
t("div", P, [
|
|
36
36
|
t("i", z, c(e.icon), 1),
|
|
37
37
|
t("p", {
|
|
@@ -42,11 +42,11 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
42
42
|
class: "yu-pl-8 yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800",
|
|
43
43
|
placeholder: e.placeholder,
|
|
44
44
|
onInput: b,
|
|
45
|
-
onFocus:
|
|
46
|
-
onBlur:
|
|
47
|
-
"onUpdate:modelValue":
|
|
48
|
-
type:
|
|
49
|
-
onKeyup:
|
|
45
|
+
onFocus: o[0] || (o[0] = (m) => s.value = !0),
|
|
46
|
+
onBlur: o[1] || (o[1] = (m) => s.value = !1),
|
|
47
|
+
"onUpdate:modelValue": o[2] || (o[2] = (m) => l.value = m),
|
|
48
|
+
type: a.value || e.type,
|
|
49
|
+
onKeyup: o[3] || (o[3] = _((m) => d.$emit("keyup-enter"), ["enter"])),
|
|
50
50
|
maxlength: e.caract
|
|
51
51
|
}, null, 40, E), [
|
|
52
52
|
[C, l.value]
|
|
@@ -63,18 +63,18 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
63
63
|
},
|
|
64
64
|
emits: ["update:model-value", "blur", "press-enter"],
|
|
65
65
|
setup(e, { emit: u }) {
|
|
66
|
-
const l = i(e.modelValue),
|
|
66
|
+
const l = i(e.modelValue), a = i(!1);
|
|
67
67
|
function s() {
|
|
68
|
-
return !(
|
|
68
|
+
return !(a.value || l.value);
|
|
69
69
|
}
|
|
70
70
|
function r(d) {
|
|
71
71
|
u(d);
|
|
72
72
|
}
|
|
73
73
|
function b(d) {
|
|
74
|
-
const
|
|
75
|
-
u("update:model-value",
|
|
74
|
+
const o = d.target;
|
|
75
|
+
u("update:model-value", o.value);
|
|
76
76
|
}
|
|
77
|
-
return (d,
|
|
77
|
+
return (d, o) => (p(), f("div", {
|
|
78
78
|
class: y(["simple-input", { "yu-border-red-500": e.invalid }])
|
|
79
79
|
}, [
|
|
80
80
|
t("p", {
|
|
@@ -82,13 +82,13 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
82
82
|
}, c(e.label), 3),
|
|
83
83
|
x(t("input", {
|
|
84
84
|
class: "yu-absolute yu-w-full yu-h-full yu-outline-none yu-bg-transparent yu-appearence-none yu-indent-2 yu-pt-3 yu-font-plus yu-font-semibold yu-text-gray-800 dark:yu-text-gray-200",
|
|
85
|
-
"onUpdate:modelValue":
|
|
85
|
+
"onUpdate:modelValue": o[0] || (o[0] = (m) => l.value = m),
|
|
86
86
|
type: "text",
|
|
87
87
|
disabled: e.disabled,
|
|
88
88
|
onInput: b,
|
|
89
|
-
onKeyup:
|
|
90
|
-
onFocus:
|
|
91
|
-
onBlur:
|
|
89
|
+
onKeyup: o[1] || (o[1] = _((m) => r("press-enter"), ["enter"])),
|
|
90
|
+
onFocus: o[2] || (o[2] = (m) => a.value = !0),
|
|
91
|
+
onBlur: o[3] || (o[3] = (m) => a.value = !1)
|
|
92
92
|
}, null, 40, M), [
|
|
93
93
|
[V, l.value]
|
|
94
94
|
])
|
|
@@ -104,9 +104,9 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
104
104
|
emits: ["update:modelValue", "change", "input"],
|
|
105
105
|
setup(e, { emit: u }) {
|
|
106
106
|
const l = i(e.modelValue);
|
|
107
|
-
return i(!1), $(l, (
|
|
108
|
-
u("update:modelValue",
|
|
109
|
-
}), (
|
|
107
|
+
return i(!1), $(l, (a) => {
|
|
108
|
+
u("update:modelValue", a);
|
|
109
|
+
}), (a, s) => (p(), f("div", {
|
|
110
110
|
class: "yu-relative yu-inline-block yu-w-10 yu-align-middle yu-select-none yu-transition yu-duration-200 yu-ease-in",
|
|
111
111
|
onClick: s[0] || (s[0] = (r) => l.value = !l.value)
|
|
112
112
|
}, [
|
|
@@ -146,7 +146,7 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
setup(e) {
|
|
149
|
-
return (u,
|
|
149
|
+
return (u, n) => (p(), f("button", {
|
|
150
150
|
class: y(["yu-bg-primary yu-px-5 yu-p-2 yu-w-fit yu-text-base yu-text-white yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate hover:yu-brightness-90 active:yu-scale-95", { "!yu-px-7 !yu-p-4": e.large, "!yu-px-3 !yu-p-1": e.small, "!yu-bg-red-500": e.warning, "!yu-bg-yellow-400": e.alert, "!yu-bg-green-400": e.success }])
|
|
151
151
|
}, [
|
|
152
152
|
g(u.$slots, "default")
|
|
@@ -177,7 +177,7 @@ const N = { class: "simple-input" }, P = { class: "yu-flex yu-h-full yu-pl-2" },
|
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
setup(e) {
|
|
180
|
-
return (u,
|
|
180
|
+
return (u, n) => (p(), f("button", {
|
|
181
181
|
class: y(["yu-text-primary yu-bg-primary yu-text-base yu-w-fit yu-px-5 yu-p-2 yu-rounded-md yu-transition-all yu-font-plus yu-font-bold yu-truncate !yu-bg-opacity-5 group hover:!yu-bg-opacity-10 active:yu-scale-95 active:!yu-bg-opacity-20", { "!yu-text-lg": e.large, "!yu-text-sm": e.small, "!yu-text-red-500 !yu-bg-red-500": e.warning, "!yu-text-yellow-400 !yu-bg-yellow-400": e.alert, "!yu-text-green-400 !yu-bg-green-400": e.success }])
|
|
182
182
|
}, [
|
|
183
183
|
g(u.$slots, "default")
|
|
@@ -190,10 +190,10 @@ function A(e, u) {
|
|
|
190
190
|
]);
|
|
191
191
|
}
|
|
192
192
|
const B = (e, u) => {
|
|
193
|
-
const
|
|
194
|
-
for (const [l,
|
|
195
|
-
|
|
196
|
-
return
|
|
193
|
+
const n = e.__vccOpts || e;
|
|
194
|
+
for (const [l, a] of u)
|
|
195
|
+
n[l] = a;
|
|
196
|
+
return n;
|
|
197
197
|
};
|
|
198
198
|
var O = {};
|
|
199
199
|
const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-full" }, H = { class: "yu-text-gray-700 yu-font-plus yu-font-medium yu-text-base yu-mr-2" }, J = { class: "yu-mt-2 yu-w-full yu-bg-white yu-rounded-md yu-flex yu-flex-col yu-gap-1 yu-shadow-md yu-absolute yu-z-10" }, Q = /* @__PURE__ */ v({
|
|
@@ -210,11 +210,11 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
210
210
|
},
|
|
211
211
|
setup(e) {
|
|
212
212
|
const u = i(!1);
|
|
213
|
-
return (
|
|
213
|
+
return (n, l) => (p(), f("div", null, [
|
|
214
214
|
t("div", G, [
|
|
215
215
|
t("button", {
|
|
216
|
-
class: y(["yu-
|
|
217
|
-
onClick: l[0] || (l[0] = (
|
|
216
|
+
class: y(["yu-w-full yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95", { "!yu-bg-primary-500 !yu-bg-opacity-10": u.value }]),
|
|
217
|
+
onClick: l[0] || (l[0] = (a) => u.value = !u.value)
|
|
218
218
|
}, [
|
|
219
219
|
x(t("i", {
|
|
220
220
|
class: y(["material-icons yu-text-gray-700 yu-h-fit", { "yu-text-primary-500": u.value }])
|
|
@@ -229,9 +229,9 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
229
229
|
x(t("div", J, [
|
|
230
230
|
t("div", {
|
|
231
231
|
class: "yu-w-full yu-rounded-md yu-p-2",
|
|
232
|
-
onClick: l[1] || (l[1] = (
|
|
232
|
+
onClick: l[1] || (l[1] = (a) => u.value = !1)
|
|
233
233
|
}, [
|
|
234
|
-
g(
|
|
234
|
+
g(n.$slots, "default")
|
|
235
235
|
])
|
|
236
236
|
], 512), [
|
|
237
237
|
[h, u.value]
|
|
@@ -253,7 +253,7 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
253
253
|
},
|
|
254
254
|
emits: ["select-all", "deselect-all"],
|
|
255
255
|
setup(e, { emit: u }) {
|
|
256
|
-
const
|
|
256
|
+
const n = i(!1), l = i(!1), a = () => {
|
|
257
257
|
if (l.value = !l.value, l.value) {
|
|
258
258
|
u("select-all");
|
|
259
259
|
return;
|
|
@@ -262,22 +262,22 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
262
262
|
};
|
|
263
263
|
return (s, r) => (p(), f("div", R, [
|
|
264
264
|
t("button", {
|
|
265
|
-
class: y(["yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95", { "!yu-bg-primary-500 !yu-bg-opacity-10":
|
|
266
|
-
onClick: r[0] || (r[0] = (b) =>
|
|
265
|
+
class: y(["yu-bg-gray-700 yu-bg-opacity-0 yu-px-3 yu-p-2 yu-rounded-md yu-flex yu-gap-1 yu-transition hover:yu-bg-opacity-10 yu-group active:yu-bg-primary-500 active:!yu-bg-opacity-10 active:yu-scale-95", { "!yu-bg-primary-500 !yu-bg-opacity-10": n.value }]),
|
|
266
|
+
onClick: r[0] || (r[0] = (b) => n.value = !n.value)
|
|
267
267
|
}, [
|
|
268
268
|
t("i", {
|
|
269
|
-
class: y(["material-icons yu-text-gray-700 yu-h-fit", { "yu-text-primary-500":
|
|
269
|
+
class: y(["material-icons yu-text-gray-700 yu-h-fit", { "yu-text-primary-500": n.value }])
|
|
270
270
|
}, c(e.icon), 3),
|
|
271
271
|
t("div", W, c(e.label), 1),
|
|
272
272
|
t("i", {
|
|
273
|
-
class: y(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto", { "yu-text-primary-500 yu-rotate-180":
|
|
273
|
+
class: y(["material-icons yu-text-gray-700 yu-h-fit yu-ml-auto", { "yu-text-primary-500 yu-rotate-180": n.value }])
|
|
274
274
|
}, " keyboard_arrow_down", 2)
|
|
275
275
|
], 2),
|
|
276
276
|
x(t("div", X, [
|
|
277
277
|
t("div", Y, [
|
|
278
278
|
w(k, { label: "Dropdown" }),
|
|
279
279
|
w(S, {
|
|
280
|
-
onClick: r[2] || (r[2] = (b) =>
|
|
280
|
+
onClick: r[2] || (r[2] = (b) => a())
|
|
281
281
|
}, {
|
|
282
282
|
default: D(() => [
|
|
283
283
|
Z,
|
|
@@ -294,11 +294,11 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
294
294
|
g(s.$slots, "default")
|
|
295
295
|
])
|
|
296
296
|
], 512), [
|
|
297
|
-
[h,
|
|
297
|
+
[h, n.value]
|
|
298
298
|
])
|
|
299
299
|
]));
|
|
300
300
|
}
|
|
301
|
-
}), te = { class: "yu-border yu-border-gray-100 yu-rounded-md yu-py-4 yu-px-3 yu-bg-white yu-flex yu-flex-col yu-justify-center yu-shadow-2xl yu-shadow-gray-100" }, ue = { class: "yu-flex yu-gap-5 yu-px-2" }, le = { class: "yu-flex yu-flex-col" },
|
|
301
|
+
}), te = { class: "yu-border yu-border-gray-100 yu-rounded-md yu-py-4 yu-px-3 yu-bg-white yu-flex yu-flex-col yu-justify-center yu-shadow-2xl yu-shadow-gray-100" }, ue = { class: "yu-flex yu-gap-5 yu-px-2" }, le = { class: "yu-flex yu-flex-col" }, ne = { class: "yu-font-plus yu-flex yu-text-xl yu-text-gray-800 yu-font-bold yu-items-center" }, oe = { class: "yu-font-plus yu-text-xs yu-text-gray-400" }, ae = { class: "yu-font-plus yu-text-gray-400 yu-font-medium yu-text-sm" }, ye = /* @__PURE__ */ v({
|
|
302
302
|
__name: "stat-card",
|
|
303
303
|
props: {
|
|
304
304
|
icon: {
|
|
@@ -323,17 +323,17 @@ const S = /* @__PURE__ */ B(O, [["render", A]]), G = { class: "yu-relative yu-w-
|
|
|
323
323
|
}
|
|
324
324
|
},
|
|
325
325
|
setup(e) {
|
|
326
|
-
return (u,
|
|
326
|
+
return (u, n) => (p(), f("div", te, [
|
|
327
327
|
t("div", ue, [
|
|
328
328
|
t("i", {
|
|
329
329
|
class: y(["yu-aspect-square material-icons yu-bg-yellow-100 yu-text-yellow-500 yu-h-14 yu-w-14 yu-place-items-center yu-rounded-full !yu-text-1xl !yu-grid", { "!yu-text-red-500 !yu-bg-red-100": e.bad, "!yu-text-green-500 !yu-bg-green-100": e.good }])
|
|
330
330
|
}, c(e.icon), 3),
|
|
331
331
|
t("div", le, [
|
|
332
|
-
t("div",
|
|
332
|
+
t("div", ne, [
|
|
333
333
|
T(c(e.comparison), 1),
|
|
334
|
-
t("span",
|
|
334
|
+
t("span", oe, "/" + c(e.total), 1)
|
|
335
335
|
]),
|
|
336
|
-
t("p",
|
|
336
|
+
t("p", ae, [
|
|
337
337
|
g(u.$slots, "default")
|
|
338
338
|
])
|
|
339
339
|
])
|