@oneb/ui-vue 0.0.46 → 0.0.48

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.
Files changed (39) hide show
  1. package/dist/OneBrowserMenu.vue_vue_type_script_setup_true_lang-9e476cc1.cjs +1 -0
  2. package/dist/{OneBrowserMenu.vue_vue_type_script_setup_true_lang-5cfc15cc.js → OneBrowserMenu.vue_vue_type_script_setup_true_lang-d28539b7.js} +111 -111
  3. package/dist/button/index.cjs +1 -1
  4. package/dist/button/index.js +1 -1
  5. package/dist/dropdown/index.cjs +1 -1
  6. package/dist/dropdown/index.js +1 -1
  7. package/dist/form/index.cjs +1 -1
  8. package/dist/form/index.js +125 -125
  9. package/dist/index-3615f53c.cjs +1 -0
  10. package/dist/{index-72d69e4e.js → index-f136b5ea.js} +51 -51
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/layout/index.cjs +1 -1
  14. package/dist/layout/index.js +203 -200
  15. package/package.json +1 -1
  16. package/dist/OneBrowserMenu.vue_vue_type_script_setup_true_lang-a90b1310.cjs +0 -1
  17. package/dist/button/OneButton.vue.d.ts +0 -2
  18. package/dist/button/SpinnerIcon.vue.d.ts +0 -2
  19. package/dist/button/util.d.ts +0 -2
  20. package/dist/card/OneCard.vue.d.ts +0 -2
  21. package/dist/card/OneCardBody.vue.d.ts +0 -2
  22. package/dist/card/OneCardFooter.vue.d.ts +0 -2
  23. package/dist/card/OneCardHeader.vue.d.ts +0 -2
  24. package/dist/common/OneAvatar.vue.d.ts +0 -2
  25. package/dist/dropdown/OneBrowserMenu.vue.d.ts +0 -2
  26. package/dist/dropdown/OneDropdown.vue.d.ts +0 -2
  27. package/dist/dropdown/OneDropdownDivider.vue.d.ts +0 -2
  28. package/dist/dropdown/OneDropdownItem.vue.d.ts +0 -2
  29. package/dist/dropdown/OneUserMenu.vue.d.ts +0 -2
  30. package/dist/form/OneForm.vue.d.ts +0 -2
  31. package/dist/form/OneFormFeedback.vue.d.ts +0 -2
  32. package/dist/form/OneFormField.vue.d.ts +0 -2
  33. package/dist/form/OneFormInput.vue.d.ts +0 -2
  34. package/dist/form/OneFormLabel.vue.d.ts +0 -2
  35. package/dist/index-e804f148.cjs +0 -1
  36. package/dist/layout/IconOneb.vue.d.ts +0 -2
  37. package/dist/layout/OneMainLayout.vue.d.ts +0 -2
  38. package/dist/layout/OneSidebar.vue.d.ts +0 -2
  39. package/dist/layout/OneSidebarLink.vue.d.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),p=require("./common/index.cjs"),g={title:{type:String},stick:{type:String,default:"right"}},y={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},k=["data-opened"],x={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},f=e.defineComponent({__name:"OneDropdown",props:g,emits:["open","close"],setup(d,{emit:s}){const i=e.ref(!1),c=e.ref(null),r=s,l=d,n=()=>{i.value=!i.value,i.value?r("open"):r("close")};e.provide("OneDropdown",{onToggle:n});const t=e.computed(()=>{const o=c.value!=null&&c.value.offsetLeft<270;return c.value!=null&&c.value.offsetTop+270>window.innerHeight?"up"+(o?"-right":"-left"):"down"+(o?"-right":"-left")}),a=e.computed(()=>{const o=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return t.value.startsWith("up")?o.push("bottom-1 mb-10"):t.value.startsWith("down")&&o.push("top-1 mt-10"),l.stick==="right"?o.push("right-0"):l.stick==="left"&&o.push("left-0"),o});return(o,u)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:c,"data-opened":i.value},[e.renderSlot(o.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:n,isExpanded:i.value}))),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:n})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",a.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[o.title?(e.openBlock(),e.createElementBlock("div",x,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:n})))],2)):e.createCommentVNode("",!0)]),_:3})],8,k))}}),h=e.defineComponent({__name:"OneDropdownItem",props:y,emits:["click"],setup(d,{emit:s}){const i=s,c=d,r=e.inject("OneDropdown"),l=()=>{r!==void 0&&r.onToggle(),i("click")},n=e.computed(()=>{const t=[];return c.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):c.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):c.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):c.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",n.value]),onClick:e.withModifiers(l,["prevent"])},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],2))}});function v(d,s){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})])}const w={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},onAccount:{type:Function},onLogout:{type:Function}},b={workspace:{type:Object,required:!0},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Apps"},changeLabel:{type:String,default:"Change"},onChange:{type:Function},onApp:{type:Function}},_=["onClick"],C={class:"flex flex-col items-center pt-6 pb-3 h-full"},V={class:"flex flex-col px-10 py-1 mt-2 text-center"},E={class:"self-center text-base font-medium tracking-wide text-black"},N={class:"mt-1 text-xs leading-5 text-blue-500"},B={class:"text-left w-full mt-5"},S=e.createElementVNode("div",{class:"space-y-2 text-center py-6",style:{width:"240px"}},null,-1),$=e.createElementVNode("div",{class:"pb-2 flex-shrink-0 mt-auto pt-6 text-xs leading-3 text-gray-400"},"v.1.0.0 (beta)",-1),z=e.defineComponent({__name:"OneUserMenu",props:w,setup(d){const s=d,i=e.computed(()=>{var l;return(l=s.menu)==null?void 0:l.map(n=>{let t={label:n.label};n.icon!=null&&(t={...t,icon:n.icon});const a=typeof n.click=="function"?n.click:()=>{};return{key:n.label,args:t,click:a}})}),c=()=>{typeof s.onAccount=="function"&&s.onAccount()},r=()=>{typeof s.onLogout=="function"&&s.onLogout()};return(l,n)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:a})=>{var o,u;return[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[a?"bg-secondary-25":""]])},[e.createVNode(p.OneAvatar,{text:((o=l.user)==null?void 0:o.name)||"",size:l.iconSize,src:(u=l.user)==null?void 0:u.photo_url,rounded:!0},null,8,["text","size","src"])],10,_)]}),menu:e.withCtx(()=>{var t,a,o,u;return[e.createElementVNode("div",C,[e.createVNode(p.OneAvatar,{text:((t=l.user)==null?void 0:t.name)||"",size:80,src:(a=l.user)==null?void 0:a.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",V,[e.createElementVNode("div",E,e.toDisplayString((o=l.user)==null?void 0:o.name),1),e.createElementVNode("div",N,e.toDisplayString((u=l.user)==null?void 0:u.email),1)]),typeof s.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:c,class:"cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"}," Обліковий запис 1B ")):e.createCommentVNode("",!0),e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createBlock(h,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(h,{icon:e.unref(v),label:l.logoutLabel,class:"rounded",onClick:r},null,8,["icon","label"])]),S,$])]}),_:1}))}});function A(d,s){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}const L=["onClick"],D={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},O={class:"flex-shrink-0"},P={class:"w-full text-left"},j={class:"flex-shrink-0"},F={class:"px-3 py-2 border-t border-secondary-stroke"},M={class:"text-secondary-content text-left pb-1 text-sm"},T={class:"grid grid-cols-3 gap-1"},q=["onClick"],R={class:"block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg"},H={class:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1"},I=e.defineComponent({__name:"OneBrowserMenu",props:b,setup(d){const s=d,i=()=>{typeof s.onChange=="function"&&s.onChange()},c=r=>{typeof s.onApp=="function"&&s.onApp(r)};return(r,l)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:n,isExpanded:t})=>[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[t?"bg-secondary-25":""]])},[e.createVNode(e.unref(A),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${r.iconSize}px; height: ${r.iconSize}px`)},null,8,["style"])],10,L)]),menu:e.withCtx(()=>{var n,t,a;return[e.createElementVNode("div",D,[e.createElementVNode("div",O,[e.createVNode(p.OneAvatar,{text:((n=r.workspace)==null?void 0:n.name)||"",src:(t=r.workspace)==null?void 0:t.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",P,e.toDisplayString((a=r.workspace)==null?void 0:a.name),1),e.createElementVNode("div",j,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:i},e.toDisplayString(r.changeLabel),1)])]),e.createElementVNode("div",F,[e.createElementVNode("div",M,e.toDisplayString(r.appsTitle),1),e.createElementVNode("div",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.apps,o=>(e.openBlock(),e.createElementBlock("button",{key:o.id,onClick:u=>c(o),class:"p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",style:{width:"88px",height:"88px"}},[e.createElementVNode("span",R,[e.createVNode(p.OneAvatar,{text:o.name,src:o.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("span",H,e.toDisplayString(o.name),1)],8,q))),128))])])]}),_:1}))}});exports._sfc_main=f;exports._sfc_main$1=h;exports._sfc_main$2=z;exports._sfc_main$3=I;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- import type { ButtonSizeType, ButtonVariantType } from "./button";
2
- export declare const makeButtonClassList: (variant?: ButtonVariantType, size?: ButtonSizeType) => any[];
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),g=require("./_plugin-vue_export-helper-f246444f.cjs");const h={},f={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}},v=e.createElementVNode("circle",{style:{"stroke-linecap":"round",animation:"one-sp-ico-dash 1.7s ease-in-out infinite"},class:"opacity-75",cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1),y=[v];function k(n,r){return e.openBlock(),e.createElementBlock("svg",f,y)}const c=g._export_sfc(h,[["render",k]]),w={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},icon:{type:[Function,Object]},isLoading:{type:Boolean},isSubmit:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},iconClass:{type:[String,Array]},iconAfter:{type:[Function,Object]}},_=["relative inline-flex","border","items-center justify-center","font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2 focus:ring-offset-2","transition-colors duration-200"],x={sm:["px-2 py-1 text-sm"],md:["px-3 py-2"],lg:["px-4 py-3"]},C={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"],secondary:["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"],none:["rounded-md border-transparent text-gray-500"]},B=(n="primary",r="md")=>{const o=[];return o.push(..._),o.push(...C[n]??[]),n!=="touch"&&o.push(...x[r]??[]),o},z=["disabled","title","type"],L=e.defineComponent({__name:"OneButton",props:w,emits:["click"],setup(n,{emit:r}){const o=r,s=n,u=()=>{o("click")},a=e.computed(()=>s.icon),i=e.computed(()=>s.iconAfter),d=e.computed(()=>{const t=B(s.variant,s.size);return s.variant==="touch"&&s.active&&t.push("bg-primary-body-active"),t}),p=e.computed(()=>s.disabled||s.isLoading),m=e.computed(()=>s.label&&s.label.length>0&&s.variant!=="touch"),b=e.computed(()=>{const t=["inline-block text-ellipsis overflow-hidden"];return a.value!=null&&t.push("ml-2"),i.value!=null&&t.push("mr-2"),t}),l=e.computed(()=>{const t=[];return s.size==="sm"?t.push("w-3 h-3"):s.size==="lg"?t.push("w-5 h-5"):t.push("w-4 h-4"),typeof s.iconClass=="string"?t.push(s.iconClass):s.iconClass instanceof Array&&t.push(...s.iconClass),t});return(t,S)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(d.value),disabled:p.value,title:t.label,type:t.isSubmit?"submit":"button",onClick:e.withModifiers(u,["stop"])},[a.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c,{key:0,class:e.normalizeClass(l.value)},null,8,["class"])):a.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{key:1,class:e.normalizeClass(l.value)},null,8,["class"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(b.value)},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),i.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c,{key:3,class:e.normalizeClass(l.value)},null,8,["class"])):i.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:4,class:e.normalizeClass(l.value)},null,8,["class"])):e.createCommentVNode("",!0)],10,z))}});exports.SpinnerIcon=c;exports._sfc_main=L;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;