@oneb/ui-vue 0.1.35 → 0.1.37
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/{OneHelpMenu-5f545b2a.js → OneHelpMenu-135e0656.js} +3 -2
- package/dist/{OneHelpMenu-05871821.cjs → OneHelpMenu-90df8a83.cjs} +1 -1
- package/dist/dropdown/OneDropdownAuto.vue.d.ts +2 -0
- package/dist/dropdown/dropdown.d.ts +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.d.ts +1 -0
- package/dist/dropdown/index.js +1020 -68
- package/dist/form/form.d.ts +9 -0
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +127 -110
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -5
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +1 -1
- package/package.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),y=require("./common/index.cjs"),S=require("./XMarkIcon-f94baa4c.cjs"),O=require("./index-9f8735d9.cjs"),F=require("./_plugin-vue_export-helper-f246444f.cjs"),P={title:{type:String},stick:{type:String,default:"right"}},q={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},H=["data-opened"],I={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},L=e.defineComponent({__name:"OneDropdown",props:P,emits:["open","close"],setup(d,{emit:c}){const u=e.ref(!1),a=e.ref(null),s=c,n=d,i=()=>{u.value=!u.value,u.value?s("open"):s("close")};e.provide("OneDropdown",{onToggle:i});const o=e.computed(()=>{const t=a.value!=null&&a.value.getBoundingClientRect.x<270;return a.value!=null&&a.value.getBoundingClientRect().top+270>window.innerHeight?"up"+(t?"-right":"-left"):"down"+(t?"-right":"-left")}),m=e.computed(()=>{const t=["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 o.value.startsWith("up")?t.push("bottom-1 mb-10"):o.value.startsWith("down")&&t.push("top-1 mt-10"),n.stick==="right"?t.push("right-0"):n.stick==="left"&&t.push("left-0"),t});return(t,h)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:a,"data-opened":u.value},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:i,isExpanded:u.value}))),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:i})):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(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",m.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[t.title?(e.openBlock(),e.createElementBlock("div",I,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:i})))],2)):e.createCommentVNode("",!0)]),_:3})],8,H))}}),B=e.defineComponent({__name:"OneDropdownItem",props:q,emits:["click"],setup(d,{emit:c}){const u=c,a=d,s=e.inject("OneDropdown"),n=()=>{s!==void 0&&s.onToggle(),u("click")},i=e.computed(()=>{const o=[];return a.variant==="secondary"?o.push("text-secondary-content hover:bg-secondary-body-hover"):a.variant==="danger"?o.push("text-danger-content hover:bg-danger-10"):a.variant==="warning"?o.push("text-warning-content hover:bg-warning-10"):a.variant==="info"?o.push("text-info-content hover:bg-info-10"):o.push("hover:bg-secondary-body-hover"),o});return(o,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",i.value]),onClick:e.withModifiers(n,["prevent"])},[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(o.label),1)],2))}});function T(d,c){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 R={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},D={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},W={help:{type:Object,required:!0}},U=["onClick"],X={class:"flex flex-col items-center pt-5 pb-2 h-full"},G={class:"flex flex-col px-10 py-1 mt-2 text-center"},J={class:"self-center text-base font-medium tracking-wide text-black"},K={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},Q={class:"text-left w-full mt-5 px-3"},Y={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},Z=e.defineComponent({__name:"OneUserMenu",props:R,setup(d){const c=d,u=e.computed(()=>{var n;return(n=c.menu)==null?void 0:n.map(i=>{let o={label:i.label};i.icon!=null&&(o={...o,icon:i.icon});const m=typeof i.click=="function"?i.click:()=>{};return{key:i.label,args:o,click:m}})}),a=()=>{typeof c.onAccount=="function"&&c.onAccount()},s=()=>{typeof c.onLogout=="function"&&c.onLogout()};return(n,i)=>(e.openBlock(),e.createBlock(L,{stick:"right"},{button:e.withCtx(({onToggle:o,isExpanded:m})=>{var t,h;return[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[m?"bg-secondary-25":""]])},[e.createVNode(y.OneAvatar,{text:((t=n.user)==null?void 0:t.name)||"",size:n.iconSize,src:(h=n.user)==null?void 0:h.photo_url,rounded:!0},null,8,["text","size","src"])],10,U)]}),menu:e.withCtx(()=>{var o,m,t,h,v;return[e.createElementVNode("div",X,[e.createVNode(y.OneAvatar,{text:((o=n.user)==null?void 0:o.name)||"",size:80,src:(m=n.user)==null?void 0:m.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",G,[e.createElementVNode("div",J,e.toDisplayString((t=n.user)==null?void 0:t.name),1),e.createElementVNode("div",K,e.toDisplayString((h=n.user)==null?void 0:h.email),1)]),typeof c.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a,class:"cursor-pointer justify-center px-8 py-2 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"},e.toDisplayString(n.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,g=>(e.openBlock(),e.createBlock(B,e.mergeProps({key:g.key,ref_for:!0},g.args,{onClick:g.click}),null,16,["onClick"]))),128)),typeof n.onLogout=="function"?(e.openBlock(),e.createBlock(B,{key:0,icon:e.unref(T),label:n.logoutLabel,class:"rounded py-3",onClick:s},null,8,["icon","label"])):e.createCommentVNode("",!0)]),i[0]||(i[0]=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1)),e.createElementVNode("div",Y,e.toDisplayString((v=n.app)==null?void 0:v.version),1)])]}),_:1}))}});function M(d,c){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"})])}function b(d,c){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:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function E(d,c){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:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}function z(d,c){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:"M8.25 4.5l7.5 7.5-7.5 7.5"})])}const ee=["data-opened"],te={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},oe={class:"flex justify-between items-center pt-3 mb-3"},ne={class:"font-semibold text-xl px-3"},re={class:"grid"},le={class:"rounded-lg m-3 border"},se={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},ce={class:"flex justify-between relative"},ae={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},ie={key:0},de={class:"text-xs font-semibold"},ue={class:"px-3 py-2"},pe={class:"text-secondary-content text-left pb-1 text-xs uppercase"},me={class:"overflow-auto max-h-full"},he={key:0,class:"space-y-2"},ke=["onClick"],fe={class:"flex"},ve={class:"border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center"},ge={class:"pl-2"},xe={class:"text-sm mt-1 font-semibold"},ye={class:"text9 mt-1"},_e={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},we=e.defineComponent({__name:"OneBrowserMenu",props:D,emits:["open","close"],setup(d,{emit:c}){const u=c,a=d,s=e.ref(!1),n=()=>{s.value=!s.value,s.value?u("open"):u("close")},i=e.ref(!1);e.computed(()=>i.value?E:b);const o=()=>{typeof a.onChange=="function"&&a.onChange()},m=t=>{typeof a.onApp=="function"&&a.onApp(t)};return(t,h)=>{var v,g,r,k,f,x;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(M),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",onClick:n})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",oe,[e.createElementVNode("div",ne,e.toDisplayString((v=t.workspace)==null?void 0:v.title),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:n})]),e.createElementVNode("div",re,[e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.createElementVNode("div",ce,[e.createVNode(y.OneAvatar,{text:((g=t.workspace)==null?void 0:g.name)||"",src:(r=t.workspace)==null?void 0:r.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",ae,e.toDisplayString((k=t.workspace)==null?void 0:k.name),1)]),i.value?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.workspaces,p=>(e.openBlock(),e.createElementBlock("div",{key:p.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(y.OneAvatar,{text:p.name,src:p.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",de,e.toDisplayString(p.name),1)]))),128))])):e.createCommentVNode("",!0),h[0]||(h[0]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",{onClick:o,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((f=t.workspace)==null?void 0:f.changeLabel),1)])]),e.createElementVNode("div",ue,[e.createElementVNode("div",pe,e.toDisplayString((x=t.workspace)==null?void 0:x.appsLabel),1),e.createElementVNode("div",me,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.apps,p=>(e.openBlock(),e.createElementBlock("div",{key:p.id,onClick:_=>m(p),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",fe,[e.createElementVNode("div",ve,[e.createVNode(y.OneAvatar,{text:p.name,src:p.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",ge,[e.createElementVNode("p",xe,e.toDisplayString(p.name),1),e.createElementVNode("p",ye,e.toDisplayString(p==null?void 0:p.short),1)])]),e.createElementVNode("div",null,[e.createVNode(O._sfc_main,{variant:"touch",icon:e.unref(z),onClick:_=>m(p)},null,8,["icon","onClick"])])],8,ke))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("button",_e,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,ee)}}});const Be=F._export_sfc(we,[["__scopeId","data-v-4936d4e4"]]);function be(d,c){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:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})])}function Ee(d,c){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:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"})])}function j(d,c){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:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})])}const Ve=["data-opened"],Ne={key:1,class:"absolute top-0 right-0 h-screen max-w-96 bg-white px-3 z-10 flex flex-col"},Ce={class:"flex justify-between items-center pt-3 mb-3"},$e={class:"font-semibold text-xl px-3"},Ae={key:0,class:"grid grid-cols-3 bg-[#FAFAFA] rounded-xl text-[#525B66] mb-2"},Se=["onClick"],Fe={class:"uppercase text-[8px]"},Le={class:"overflow-y-auto grid rounded-xl"},De={class:"max-h-full bg-[#FAFAFA]"},Me={key:0,class:"space-y-2"},ze=["onClick"],je={class:"flex"},Oe={class:"pl-2"},Pe={class:"text-sm mt-1 font-semibold"},qe={class:"text-[10px] mt-1 text-[#979CA9]"},He={class:"mt-auto"},Ie={key:0},Te=["onClick"],Re={class:"flex items-center space-x-3"},We={class:"h-16"},Ue={key:0,class:"bg-[#FAFAFA] rounded-lg p-3"},Xe={class:"flex justify-between"},Ge=["onClick"],Je={key:0,class:"tooltip-text min-w-[70px]"},Ke={class:"flex justify-between mb-4"},Qe=["href"],Ye={class:"flex flex-nowrap items-center w-max h-[24px]"},Ze={class:"whitespace-nowrap overflow-hidden text-ellipsis text-left flex-shrink w-full text-[#525B66]"},et={class:"py-[8px] pl-0 pr-[8px]"},tt=e.defineComponent({__name:"OneHelpMenu",props:W,emits:["open","close"],setup(d,{emit:c}){const u=c,a=d,s=e.ref(!1),n=()=>{s.value=!s.value,s.value?u("open"):u("close")},i=e.computed(()=>v.value?E:b),o=e.ref(3),m=e.computed(()=>{var k,f;const r=((f=(k=a.help)==null?void 0:k.helpList)==null?void 0:f.length)||0;return o.value===r});e.computed(()=>{var k;return(((k=a.help)==null?void 0:k.helpList)||[]).slice(0,o.value)});const t=()=>{var k,f;const r=((f=(k=a.help)==null?void 0:k.helpList)==null?void 0:f.length)||0;o.value=m.value?3:r},h=r=>{r&&window.open(r,"_blank")},v=e.ref(!1),g=()=>{v.value=!v.value};return(r,k)=>{var f,x,p,_,V,N,C,$,A;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(be),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10 flex flex-col",onClick:n})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ce,[e.createElementVNode("div",$e,e.toDisplayString((f=r.help)==null?void 0:f.label),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:n})]),(x=r.help)!=null&&x.helpButton?(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((p=r.help)==null?void 0:p.helpButton,l=>(e.openBlock(),e.createElementBlock("button",{key:l.name,onClick:w=>h(l.link),class:"grid justify-center space-y-2 hover:bg-slate-100 p-3 rounded-xl hover:text-blue-500"},[e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l==null?void 0:l.icon),{class:"w-[16px] h-[16px] mx-auto"}))]),e.createElementVNode("span",Fe,e.toDisplayString(l.name),1)],8,Se))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[e.createElementVNode("div",De,[(_=r.help)!=null&&_.helpList&&r.help.helpList.length?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.helpList,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,onClick:w=>h(l.link),class:"flex justify-between items-center rounded-lg hover:bg-slate-100 p-2 cursor-pointer hover:text-[#4089E0]"},[e.createElementVNode("div",je,[e.createElementVNode("div",Oe,[e.createElementVNode("p",Pe,e.toDisplayString(l.name),1),e.createElementVNode("p",qe,e.toDisplayString(l.category),1)])])],8,ze))),128))])):e.createCommentVNode("",!0)])]),(V=r.help)!=null&&V.helpList&&r.help.helpList.length<0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:t,class:"h-11 w-full bg-[#FAFAFA] hover:bg-slate-100 p-3 text-[#525B66] rounded-b-xl text-xs hover:text-[#4089E0] font-medium"},e.toDisplayString(m.value?r.help.buttNoMore:r.help.buttMore),1)):e.createCommentVNode("",!0),e.createElementVNode("div",He,[(N=r.help)!=null&&N.video?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.video,l=>(e.openBlock(),e.createElementBlock("button",{key:l.id,onClick:w=>h(l.link),class:"flex items-center space-x-3 mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createVNode(e.unref(Ee),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(l.name),1)],8,Te))),128))])):e.createCommentVNode("",!0),(C=r.help)!=null&&C.socialList?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:g,class:"flex items-center justify-between mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createElementVNode("div",Re,[e.createVNode(e.unref(j),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(r.help.socialButt),1)]),e.createVNode(e.unref(i),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),e.createElementVNode("div",We,[v.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(($=r.help)==null?void 0:$.socialList,l=>(e.openBlock(),e.createElementBlock("button",{key:l.id,onClick:w=>h(l.link),class:"flex items-center space-x-2 p-2 rounded-lg hover:bg-slate-100 hover:text-blue-500 tooltip"},[e.createElementVNode("div",null,[l.name?(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString(l.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l==null?void 0:l.icon),{class:"w-[24px] h-[24px] mx-auto"}))])],8,Ge))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((A=r.help)==null?void 0:A.termsOffer,l=>(e.openBlock(),e.createElementBlock("a",{key:l.name,target:"_blank",href:l.link,class:"ml-2 flex items-center rounded-lg text-xs hover:underline font-extralight cursor-pointer"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",et,e.toDisplayString(l.name),1)])])],8,Qe))),128))])])])):e.createCommentVNode("",!0)],8,Ve)}}});const ot=F._export_sfc(tt,[["__scopeId","data-v-83ffa612"]]);exports.OneBrowserMenu=Be;exports.OneHelpMenu=ot;exports._sfc_main=Z;exports._sfc_main$1=L;exports._sfc_main$2=B;exports.browserMenuProps=D;exports.render=E;exports.render$1=b;exports.render$2=z;exports.render$3=j;exports.render$4=M;
|
|
1
|
+
"use strict";const e=require("vue"),y=require("./common/index.cjs"),S=require("./XMarkIcon-f94baa4c.cjs"),P=require("./index-9f8735d9.cjs"),F=require("./_plugin-vue_export-helper-f246444f.cjs"),L={title:{type:String},stick:{type:String,default:"right"}},q={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},H=["data-opened"],I={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},D=e.defineComponent({__name:"OneDropdown",props:L,emits:["open","close"],setup(d,{emit:c}){const u=e.ref(!1),a=e.ref(null),s=c,n=d,i=()=>{u.value=!u.value,u.value?s("open"):s("close")};e.provide("OneDropdown",{onToggle:i});const o=e.computed(()=>{const t=a.value!=null&&a.value.getBoundingClientRect.x<270;return a.value!=null&&a.value.getBoundingClientRect().top+270>window.innerHeight?"up"+(t?"-right":"-left"):"down"+(t?"-right":"-left")}),m=e.computed(()=>{const t=["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 o.value.startsWith("up")?t.push("bottom-1 mb-10"):o.value.startsWith("down")&&t.push("top-1 mt-10"),n.stick==="right"?t.push("right-0"):n.stick==="left"&&t.push("left-0"),t});return(t,h)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:a,"data-opened":u.value},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:i,isExpanded:u.value}))),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:i})):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(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",m.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[t.title?(e.openBlock(),e.createElementBlock("div",I,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:i})))],2)):e.createCommentVNode("",!0)]),_:3})],8,H))}}),B=e.defineComponent({__name:"OneDropdownItem",props:q,emits:["click"],setup(d,{emit:c}){const u=c,a=d,s=e.inject("OneDropdown"),n=()=>{s!==void 0&&s.onToggle(),u("click")},i=e.computed(()=>{const o=[];return a.variant==="secondary"?o.push("text-secondary-content hover:bg-secondary-body-hover"):a.variant==="danger"?o.push("text-danger-content hover:bg-danger-10"):a.variant==="warning"?o.push("text-warning-content hover:bg-warning-10"):a.variant==="info"?o.push("text-info-content hover:bg-info-10"):o.push("hover:bg-secondary-body-hover"),o});return(o,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",i.value]),onClick:e.withModifiers(n,["prevent"])},[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(o.label),1)],2))}});function T(d,c){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 R={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},M={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},W={help:{type:Object,required:!0}},U=["onClick"],X={class:"flex flex-col items-center pt-5 pb-2 h-full"},G={class:"flex flex-col px-10 py-1 mt-2 text-center"},J={class:"self-center text-base font-medium tracking-wide text-black"},K={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},Q={class:"text-left w-full mt-5 px-3"},Y={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},Z=e.defineComponent({__name:"OneUserMenu",props:R,setup(d){const c=d,u=e.computed(()=>{var n;return(n=c.menu)==null?void 0:n.map(i=>{let o={label:i.label};i.icon!=null&&(o={...o,icon:i.icon});const m=typeof i.click=="function"?i.click:()=>{};return{key:i.label,args:o,click:m}})}),a=()=>{typeof c.onAccount=="function"&&c.onAccount()},s=()=>{typeof c.onLogout=="function"&&c.onLogout()};return(n,i)=>(e.openBlock(),e.createBlock(D,{stick:"right"},{button:e.withCtx(({onToggle:o,isExpanded:m})=>{var t,h;return[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[m?"bg-secondary-25":""]])},[e.createVNode(y.OneAvatar,{text:((t=n.user)==null?void 0:t.name)||"",size:n.iconSize,src:(h=n.user)==null?void 0:h.photo_url,rounded:!0},null,8,["text","size","src"])],10,U)]}),menu:e.withCtx(()=>{var o,m,t,h,v;return[e.createElementVNode("div",X,[e.createVNode(y.OneAvatar,{text:((o=n.user)==null?void 0:o.name)||"",size:80,src:(m=n.user)==null?void 0:m.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",G,[e.createElementVNode("div",J,e.toDisplayString((t=n.user)==null?void 0:t.name),1),e.createElementVNode("div",K,e.toDisplayString((h=n.user)==null?void 0:h.email),1)]),typeof c.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a,class:"cursor-pointer justify-center px-8 py-2 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"},e.toDisplayString(n.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,g=>(e.openBlock(),e.createBlock(B,e.mergeProps({key:g.key,ref_for:!0},g.args,{onClick:g.click}),null,16,["onClick"]))),128)),typeof n.onLogout=="function"?(e.openBlock(),e.createBlock(B,{key:0,icon:e.unref(T),label:n.logoutLabel,class:"rounded py-3",onClick:s},null,8,["icon","label"])):e.createCommentVNode("",!0)]),i[0]||(i[0]=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1)),e.createElementVNode("div",Y,e.toDisplayString((v=n.app)==null?void 0:v.version),1)])]}),_:1}))}});function z(d,c){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"})])}function b(d,c){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:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function E(d,c){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:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}function j(d,c){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:"M8.25 4.5l7.5 7.5-7.5 7.5"})])}const ee=["data-opened"],te={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},oe={class:"flex justify-between items-center pt-3 mb-3"},ne={class:"font-semibold text-xl px-3"},re={class:"grid"},le={class:"rounded-lg m-3 border"},se={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},ce={class:"flex justify-between relative"},ae={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},ie={key:0},de={class:"text-xs font-semibold"},ue={class:"px-3 py-2"},pe={class:"text-secondary-content text-left pb-1 text-xs uppercase"},me={class:"overflow-auto max-h-full"},he={key:0,class:"space-y-2"},ke=["onClick"],fe={class:"flex"},ve={class:"border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center"},ge={class:"pl-2"},xe={class:"text-sm mt-1 font-semibold"},ye={class:"text9 mt-1"},_e={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},we=e.defineComponent({__name:"OneBrowserMenu",props:M,emits:["open","close"],setup(d,{emit:c}){const u=c,a=d,s=e.ref(!1),n=()=>{s.value=!s.value,s.value?u("open"):u("close")},i=e.ref(!1);e.computed(()=>i.value?E:b);const o=()=>{typeof a.onChange=="function"&&a.onChange()},m=t=>{typeof a.onApp=="function"&&a.onApp(t)};return(t,h)=>{var v,g,r,k,f,x;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(z),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",onClick:n})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",oe,[e.createElementVNode("div",ne,e.toDisplayString((v=t.workspace)==null?void 0:v.title),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:n})]),e.createElementVNode("div",re,[e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.createElementVNode("div",ce,[e.createVNode(y.OneAvatar,{text:((g=t.workspace)==null?void 0:g.name)||"",src:(r=t.workspace)==null?void 0:r.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",ae,e.toDisplayString((k=t.workspace)==null?void 0:k.name),1)]),i.value?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.workspaces,p=>(e.openBlock(),e.createElementBlock("div",{key:p.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(y.OneAvatar,{text:p.name,src:p.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",de,e.toDisplayString(p.name),1)]))),128))])):e.createCommentVNode("",!0),h[0]||(h[0]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",{onClick:o,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((f=t.workspace)==null?void 0:f.changeLabel),1)])]),e.createElementVNode("div",ue,[e.createElementVNode("div",pe,e.toDisplayString((x=t.workspace)==null?void 0:x.appsLabel),1),e.createElementVNode("div",me,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.apps,p=>(e.openBlock(),e.createElementBlock("div",{key:p.id,onClick:_=>m(p),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",fe,[e.createElementVNode("div",ve,[e.createVNode(y.OneAvatar,{text:p.name,src:p.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",ge,[e.createElementVNode("p",xe,e.toDisplayString(p.name),1),e.createElementVNode("p",ye,e.toDisplayString(p==null?void 0:p.short),1)])]),e.createElementVNode("div",null,[e.createVNode(P._sfc_main,{variant:"touch",icon:e.unref(j),onClick:_=>m(p)},null,8,["icon","onClick"])])],8,ke))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("button",_e,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,ee)}}});const Be=F._export_sfc(we,[["__scopeId","data-v-4936d4e4"]]);function be(d,c){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:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})])}function Ee(d,c){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:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"})])}function O(d,c){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:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})])}const Ve=["data-opened"],Ne={key:1,class:"absolute top-0 right-0 h-screen max-w-96 bg-white px-3 z-10 flex flex-col"},Ce={class:"flex justify-between items-center pt-3 mb-3"},$e={class:"font-semibold text-xl px-3"},Ae={key:0,class:"grid grid-cols-3 bg-[#FAFAFA] rounded-xl text-[#525B66] mb-2"},Se=["onClick"],Fe={class:"uppercase text-[8px]"},Le={class:"overflow-y-auto grid rounded-xl"},De={class:"max-h-full bg-[#FAFAFA]"},Me={key:0,class:"space-y-2"},ze=["onClick"],je={class:"flex"},Oe={class:"pl-2"},Pe={class:"text-sm mt-1 font-semibold"},qe={class:"text-[10px] mt-1 text-[#979CA9]"},He={class:"mt-auto"},Ie={key:0},Te=["onClick"],Re={class:"flex items-center space-x-3"},We={class:"h-16"},Ue={key:0,class:"bg-[#FAFAFA] rounded-lg p-3"},Xe={class:"flex justify-between"},Ge=["onClick"],Je={key:0,class:"tooltip-text min-w-[70px]"},Ke={class:"flex justify-between mb-4"},Qe=["href"],Ye={class:"flex flex-nowrap items-center w-max h-[24px]"},Ze={class:"whitespace-nowrap overflow-hidden text-ellipsis text-left flex-shrink w-full text-[#525B66]"},et={class:"py-[8px] pl-0 pr-[8px]"},tt=e.defineComponent({__name:"OneHelpMenu",props:W,emits:["open","close"],setup(d,{emit:c}){const u=c,a=d,s=e.ref(!1),n=()=>{s.value=!s.value,s.value?u("open"):u("close")},i=e.computed(()=>v.value?E:b),o=e.ref(3),m=e.computed(()=>{var k,f;const r=((f=(k=a.help)==null?void 0:k.helpList)==null?void 0:f.length)||0;return o.value===r});e.computed(()=>{var k;return(((k=a.help)==null?void 0:k.helpList)||[]).slice(0,o.value)});const t=()=>{var k,f;const r=((f=(k=a.help)==null?void 0:k.helpList)==null?void 0:f.length)||0;o.value=m.value?3:r},h=r=>{r&&window.open(r,"_blank")},v=e.ref(!1),g=()=>{v.value=!v.value};return(r,k)=>{var f,x,p,_,V,N,C,$,A;return e.openBlock(),e.createElementBlock("div",{"data-opened":s.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":s.value}])},[e.createVNode(e.unref(be),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10 flex flex-col",onClick:n})):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ce,[e.createElementVNode("div",$e,e.toDisplayString((f=r.help)==null?void 0:f.label),1),e.createVNode(e.unref(S.render),{class:"w-6 cursor-pointer",onClick:n})]),(x=r.help)!=null&&x.helpButton?(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((p=r.help)==null?void 0:p.helpButton,l=>(e.openBlock(),e.createElementBlock("button",{key:l.name,onClick:w=>h(l.link),class:"grid justify-center space-y-2 hover:bg-slate-100 p-3 rounded-xl hover:text-blue-500"},[e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l==null?void 0:l.icon),{class:"w-[16px] h-[16px] mx-auto"}))]),e.createElementVNode("span",Fe,e.toDisplayString(l.name),1)],8,Se))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[e.createElementVNode("div",De,[(_=r.help)!=null&&_.helpList&&r.help.helpList.length?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.helpList,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,onClick:w=>h(l.link),class:"flex justify-between items-center rounded-lg hover:bg-slate-100 p-2 cursor-pointer hover:text-[#4089E0]"},[e.createElementVNode("div",je,[e.createElementVNode("div",Oe,[e.createElementVNode("p",Pe,e.toDisplayString(l.name),1),e.createElementVNode("p",qe,e.toDisplayString(l.category),1)])])],8,ze))),128))])):e.createCommentVNode("",!0)])]),(V=r.help)!=null&&V.helpList&&r.help.helpList.length<0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:t,class:"h-11 w-full bg-[#FAFAFA] hover:bg-slate-100 p-3 text-[#525B66] rounded-b-xl text-xs hover:text-[#4089E0] font-medium"},e.toDisplayString(m.value?r.help.buttNoMore:r.help.buttMore),1)):e.createCommentVNode("",!0),e.createElementVNode("div",He,[(N=r.help)!=null&&N.video?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.help.video,l=>(e.openBlock(),e.createElementBlock("button",{key:l.id,onClick:w=>h(l.link),class:"flex items-center space-x-3 mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createVNode(e.unref(Ee),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(l.name),1)],8,Te))),128))])):e.createCommentVNode("",!0),(C=r.help)!=null&&C.socialList?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:g,class:"flex items-center justify-between mt-2 w-full bg-[#FAFAFA] hover:bg-slate-100 p-4 text-[#525B66] rounded-lg text-sm hover:text-[#4089E0] font-medium"},[e.createElementVNode("div",Re,[e.createVNode(e.unref(O),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(r.help.socialButt),1)]),e.createVNode(e.unref(i),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),e.createElementVNode("div",We,[v.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createElementVNode("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(($=r.help)==null?void 0:$.socialList,l=>(e.openBlock(),e.createElementBlock("button",{key:l.id,onClick:w=>h(l.link),class:"flex items-center space-x-2 p-2 rounded-lg hover:bg-slate-100 hover:text-blue-500 tooltip"},[e.createElementVNode("div",null,[l.name?(e.openBlock(),e.createElementBlock("div",Je,e.toDisplayString(l.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l==null?void 0:l.icon),{class:"w-[24px] h-[24px] mx-auto"}))])],8,Ge))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((A=r.help)==null?void 0:A.termsOffer,l=>(e.openBlock(),e.createElementBlock("a",{key:l.name,target:"_blank",href:l.link,class:"ml-2 flex items-center rounded-lg text-xs hover:underline font-extralight cursor-pointer"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",et,e.toDisplayString(l.name),1)])])],8,Qe))),128))])])])):e.createCommentVNode("",!0)],8,Ve)}}});const ot=F._export_sfc(tt,[["__scopeId","data-v-83ffa612"]]);exports.OneBrowserMenu=Be;exports.OneHelpMenu=ot;exports._sfc_main=Z;exports._sfc_main$1=D;exports._sfc_main$2=B;exports.browserMenuProps=M;exports.dropdownProps=L;exports.render=E;exports.render$1=b;exports.render$2=j;exports.render$3=O;exports.render$4=z;
|
|
@@ -4,7 +4,7 @@ export declare const dropdownProps: {
|
|
|
4
4
|
type: StringConstructor;
|
|
5
5
|
};
|
|
6
6
|
stick: {
|
|
7
|
-
type: PropType<"right" | "left">;
|
|
7
|
+
type: PropType<"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end">;
|
|
8
8
|
default: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
package/dist/dropdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../OneHelpMenu-05871821.cjs"),e=require("vue"),g=require("../_plugin-vue_export-helper-f246444f.cjs"),u=require("../common/index.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-9f8735d9.cjs");const v={},k={class:"border-t border-secondary-stroke my-1"};function x(i,o){return e.openBlock(),e.createElementBlock("div",k)}const b=g._export_sfc(v,[["render",x]]),V=["onClick"],E={class:"grid"},N={class:"font-semibold px-3"},w={class:"rounded-lg m-3 border"},B={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},A={class:"flex-shrink-0"},C={class:"w-full text-left"},O={class:"flex-shrink-0"},D={class:"px-3 py-2"},S={class:"text-secondary-content text-left pb-1 text-sm uppercase"},M={key:0,class:"space-y-2"},$=["onClick"],z={class:"pl-2"},F={class:"text-sm mt-1"},q={class:"text-xs mt-1"},m=3,H=e.defineComponent({__name:"OneBrowserMenuGrid",props:n.browserMenuProps,setup(i){const o=i,_=()=>{typeof o.onChange=="function"&&o.onChange()},r=e.ref(!1),h=e.computed(()=>o.apps?r.value?o.apps:o.apps.slice(0,m):[]),y=()=>{r.value=!r.value},f=t=>{typeof o.onApp=="function"&&o.onApp(t)};return(t,l)=>(e.openBlock(),e.createBlock(n._sfc_main$1,{stick:"right"},{button:e.withCtx(({onToggle:c,isExpanded:a})=>[e.createElementVNode("button",{onClick:c,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[a?"bg-secondary-25":""]])},[e.createVNode(e.unref(n.render$4),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${t.iconSize}px; height: ${t.iconSize}px`)},null,8,["style"])],10,V)]),menu:e.withCtx(()=>{var c,a,d,p;return[e.createElementVNode("div",E,[e.createElementVNode("div",N,e.toDisplayString((c=t.workspace)==null?void 0:c.title),1),e.createElementVNode("div",w,[e.createElementVNode("div",B,[e.createElementVNode("div",A,[e.createVNode(u.OneAvatar,{text:((a=t.workspace)==null?void 0:a.name)||"",src:(d=t.workspace)==null?void 0:d.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",C,e.toDisplayString((p=t.workspace)==null?void 0:p.name),1),e.createElementVNode("div",O,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:_},e.toDisplayString(t.changeLabel),1)])]),l[0]||(l[0]=e.createElementVNode("hr",null,null,-1)),l[1]||(l[1]=e.createElementVNode("div",{class:"text-center py-2",style:{"font-size":"10px"}},"Керувати робочими просторами",-1))])]),e.createElementVNode("div",D,[e.createElementVNode("div",S,e.toDisplayString(t.appsTitle),1),e.createElementVNode("div",null,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:G=>f(s),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[e.createVNode(u.OneAvatar,{text:s.name,src:s.photo_url,size:44,rounded:!1},null,8,["text","src"]),e.createElementVNode("div",z,[e.createElementVNode("p",F,e.toDisplayString(s.name),1),e.createElementVNode("p",q,e.toDisplayString(s.short),1)])],8,$))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length>m?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:y,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},e.toDisplayString(r.value?"Приховати":"Дивитися всі"),1)):e.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=n.OneBrowserMenu;exports.OneDropdown=n._sfc_main$1;exports.OneDropdownItem=n._sfc_main$2;exports.OneHelpMenu=n.OneHelpMenu;exports.OneUserMenu=n._sfc_main;exports.OneBrowserMenuGrid=H;exports.OneDropdownDivider=b;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("../OneHelpMenu-90df8a83.cjs"),c=require("vue"),Pt=require("../_plugin-vue_export-helper-f246444f.cjs"),wt=require("../common/index.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-9f8735d9.cjs");const st=Math.min,P=Math.max,K=Math.round,G=Math.floor,C=t=>({x:t,y:t}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},$t={start:"end",end:"start"};function ct(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Ct(t){return t==="y"?"height":"width"}function j(t){return["top","bottom"].includes($(t))?"y":"x"}function Rt(t){return zt(j(t))}function Wt(t,e,o){o===void 0&&(o=!1);const n=Z(t),i=Rt(t),r=Ct(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=J(s)),[s,J(s)]}function Ht(t){const e=J(t);return[rt(t),e,rt(e)]}function rt(t){return t.replace(/start|end/g,e=>$t[e])}function qt(t,e,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?r:s;default:return[]}}function It(t,e,o,n){const i=Z(t);let r=qt($(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(rt)))),r}function J(t){return t.replace(/left|right|bottom|top/g,e=>Mt[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ut(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function Q(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function yt(t,e,o){let{reference:n,floating:i}=t;const r=j(e),s=Rt(e),l=Ct(s),a=$(e),f=r==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,m=n[l]/2-i[l]/2;let p;switch(a){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(Z(e)){case"start":p[s]-=m*(o&&f?-1:1);break;case"end":p[s]+=m*(o&&f?-1:1);break}return p}const Yt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,l=r.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=yt(f,n,a),m=n,p={},h=0;for(let w=0;w<l.length;w++){const{name:y,fn:g}=l[w],{x:v,y:b,data:E,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:m,strategy:i,middlewareData:p,rects:f,platform:s,elements:{reference:t,floating:e}});u=v??u,d=b??d,p={...p,[y]:{...p[y],...E}},x&&h<=50&&(h++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(f=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:d}=yt(f,m,a)),w=-1)}return{x:u,y:d,placement:m,strategy:i,middlewareData:p}};async function Xt(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=ct(e,t),h=Ut(p),y=l[m?d==="floating"?"reference":"floating":d],g=Q(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(y)))==null||o?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:f,rootBoundary:u,strategy:a})),v=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),E=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},x=Q(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:b,strategy:a}):v);return{top:(g.top-x.top+h.top)/E.y,bottom:(x.bottom-g.bottom+h.bottom)/E.y,left:(g.left-x.left+h.left)/E.x,right:(x.right-g.right+h.right)/E.x}}const Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:f}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:w=!0,...y}=ct(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return{};const g=$(i),v=j(l),b=$(l)===l,E=await(a.isRTL==null?void 0:a.isRTL(f.floating)),x=m||(b||!w?[J(l)]:Ht(l)),H=h!=="none";!m&&H&&x.push(...It(l,w,h,E));const B=[l,...x],ot=await Xt(e,y),X=[];let q=((n=r.flip)==null?void 0:n.overflows)||[];if(u&&X.push(ot[g]),d){const N=Wt(i,s,E);X.push(ot[N[0]],ot[N[1]])}if(q=[...q,{placement:i,overflows:X}],!X.every(N=>N<=0)){var pt,mt;const N=(((pt=r.flip)==null?void 0:pt.index)||0)+1,gt=B[N];if(gt)return{data:{index:N,overflows:q},reset:{placement:gt}};let I=(mt=q.filter(F=>F.overflows[0]<=0).sort((F,S)=>F.overflows[1]-S.overflows[1])[0])==null?void 0:mt.placement;if(!I)switch(p){case"bestFit":{var ht;const F=(ht=q.filter(S=>{if(H){const V=j(S.placement);return V===v||V==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(V=>V>0).reduce((V,Ft)=>V+Ft,0)]).sort((S,V)=>S[1]-V[1])[0])==null?void 0:ht[0];F&&(I=F);break}case"initialPlacement":I=l;break}if(i!==I)return{reset:{placement:I}}}return{}}}};async function Kt(t,e){const{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=$(o),l=Z(o),a=j(o)==="y",f=["left","top"].includes(s)?-1:1,u=r&&a?-1:1,d=ct(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),a?{x:p*u,y:m*f}:{x:m*f,y:p*u}}const Jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await Kt(e,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}};function tt(){return typeof window<"u"}function W(t){return _t(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _(t){var e;return(e=(_t(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function _t(t){return tt()?t instanceof Node||t instanceof k(t).Node:!1}function A(t){return tt()?t instanceof Element||t instanceof k(t).Element:!1}function R(t){return tt()?t instanceof HTMLElement||t instanceof k(t).HTMLElement:!1}function xt(t){return!tt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof k(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function Qt(t){return["table","td","th"].includes(W(t))}function et(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function at(t){const e=ft(),o=A(t)?O(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>o[n]?o[n]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Zt(t){let e=L(t);for(;R(e)&&!z(e);){if(at(e))return e;if(et(e))return null;e=L(e)}return null}function ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(W(t))}function O(t){return k(t).getComputedStyle(t)}function nt(t){return A(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function L(t){if(W(t)==="html")return t;const e=t.assignedSlot||t.parentNode||xt(t)&&t.host||_(t);return xt(e)?e.host:e}function Dt(t){const e=L(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&Y(e)?e:Dt(e)}function U(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=Dt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=k(i);if(r){const l=lt(s);return e.concat(s,s.visualViewport||[],Y(i)?i:[],l&&o?U(l):[])}return e.concat(i,U(i,[],o))}function lt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function St(t){const e=O(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=K(o)!==r||K(n)!==s;return l&&(o=r,n=s),{width:o,height:n,$:l}}function ut(t){return A(t)?t:t.contextElement}function M(t){const e=ut(t);if(!R(e))return C(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=St(e);let s=(r?K(o.width):o.width)/n,l=(r?K(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const te=C(0);function Vt(t){const e=k(t);return!ft()||!e.visualViewport?te:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ee(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==k(t)?!1:e}function T(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=ut(t);let s=C(1);e&&(n?A(n)&&(s=M(n)):s=M(t));const l=ee(r,o,n)?Vt(r):C(0);let a=(i.left+l.x)/s.x,f=(i.top+l.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(r){const m=k(r),p=n&&A(n)?k(n):n;let h=m,w=lt(h);for(;w&&n&&p!==h;){const y=M(w),g=w.getBoundingClientRect(),v=O(w),b=g.left+(w.clientLeft+parseFloat(v.paddingLeft))*y.x,E=g.top+(w.clientTop+parseFloat(v.paddingTop))*y.y;a*=y.x,f*=y.y,u*=y.x,d*=y.y,a+=b,f+=E,h=k(w),w=lt(h)}}return Q({width:u,height:d,x:a,y:f})}function dt(t,e){const o=nt(t).scrollLeft;return e?e.left+o:T(_(t)).left+o}function Lt(t,e,o){o===void 0&&(o=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(o?0:dt(t,n)),r=n.top+e.scrollTop;return{x:i,y:r}}function ne(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=_(n),l=e?et(e.floating):!1;if(n===s||l&&r)return o;let a={scrollLeft:0,scrollTop:0},f=C(1);const u=C(0),d=R(n);if((d||!d&&!r)&&((W(n)!=="body"||Y(s))&&(a=nt(n)),R(n))){const p=T(n);f=M(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const m=s&&!d&&!r?Lt(s,a,!0):C(0);return{width:o.width*f.x,height:o.height*f.y,x:o.x*f.x-a.scrollLeft*f.x+u.x+m.x,y:o.y*f.y-a.scrollTop*f.y+u.y+m.y}}function oe(t){return Array.from(t.getClientRects())}function ie(t){const e=_(t),o=nt(t),n=t.ownerDocument.body,i=P(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=P(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+dt(t);const l=-o.scrollTop;return O(n).direction==="rtl"&&(s+=P(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}function se(t,e){const o=k(t),n=_(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const f=ft();(!f||f&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:r,height:s,x:l,y:a}}function re(t,e){const o=T(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=R(t)?M(t):C(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,f=n*r.y;return{width:s,height:l,x:a,y:f}}function vt(t,e,o){let n;if(e==="viewport")n=se(t,o);else if(e==="document")n=ie(_(t));else if(A(e))n=re(e,o);else{const i=Vt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(n)}function Nt(t,e){const o=L(t);return o===e||!A(o)||z(o)?!1:O(o).position==="fixed"||Nt(o,e)}function le(t,e){const o=e.get(t);if(o)return o;let n=U(t,[],!1).filter(l=>A(l)&&W(l)!=="body"),i=null;const r=O(t).position==="fixed";let s=r?L(t):t;for(;A(s)&&!z(s);){const l=O(s),a=at(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Y(s)&&!a&&Nt(t,s))?n=n.filter(u=>u!==s):i=l,s=L(s)}return e.set(t,n),n}function ce(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?et(e)?[]:le(e,this._c):[].concat(o),n],l=s[0],a=s.reduce((f,u)=>{const d=vt(e,u,i);return f.top=P(d.top,f.top),f.right=st(d.right,f.right),f.bottom=st(d.bottom,f.bottom),f.left=P(d.left,f.left),f},vt(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ae(t){const{width:e,height:o}=St(t);return{width:e,height:o}}function fe(t,e,o){const n=R(e),i=_(e),r=o==="fixed",s=T(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=C(0);if(n||!n&&!r)if((W(e)!=="body"||Y(i))&&(l=nt(e)),n){const m=T(e,!0,r,e);a.x=m.x+e.clientLeft,a.y=m.y+e.clientTop}else i&&(a.x=dt(i));const f=i&&!n&&!r?Lt(i,l):C(0),u=s.left+l.scrollLeft-a.x-f.x,d=s.top+l.scrollTop-a.y-f.y;return{x:u,y:d,width:s.width,height:s.height}}function it(t){return O(t).position==="static"}function bt(t,e){if(!R(t)||O(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return _(t)===o&&(o=o.ownerDocument.body),o}function Tt(t,e){const o=k(t);if(et(t))return o;if(!R(t)){let i=L(t);for(;i&&!z(i);){if(A(i)&&!it(i))return i;i=L(i)}return o}let n=bt(t,e);for(;n&&Qt(n)&&it(n);)n=bt(n,e);return n&&z(n)&&it(n)&&!at(n)?o:n||Zt(t)||o}const ue=async function(t){const e=this.getOffsetParent||Tt,o=this.getDimensions,n=await o(t.floating);return{reference:fe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function de(t){return O(t).direction==="rtl"}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:ne,getDocumentElement:_,getClippingRect:ce,getOffsetParent:Tt,getElementRects:ue,getClientRects:oe,getDimensions:ae,getScale:M,isElement:A,isRTL:de};function Bt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function me(t,e){let o=null,n;const i=_(t);function r(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null}function s(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),r();const f=t.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=f;if(l||e(),!m||!p)return;const h=G(d),w=G(i.clientWidth-(u+m)),y=G(i.clientHeight-(d+p)),g=G(u),b={rootMargin:-h+"px "+-w+"px "+-y+"px "+-g+"px",threshold:P(0,st(1,a))||1};let E=!0;function x(H){const B=H[0].intersectionRatio;if(B!==a){if(!E)return s();B?s(!1,B):n=setTimeout(()=>{s(!1,1e-7)},1e3)}B===1&&!Bt(f,t.getBoundingClientRect())&&s(),E=!1}try{o=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch{o=new IntersectionObserver(x,b)}o.observe(t)}return s(!0),r}function he(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,f=ut(t),u=i||r?[...f?U(f):[],...U(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",o,{passive:!0}),r&&g.addEventListener("resize",o)});const d=f&&l?me(f,o):null;let m=-1,p=null;s&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===f&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),o()}),f&&!a&&p.observe(f),p.observe(e));let h,w=a?T(t):null;a&&y();function y(){const g=T(t);w&&!Bt(w,g)&&o(),w=g,h=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(v=>{i&&v.removeEventListener("scroll",o),r&&v.removeEventListener("resize",o)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const Et=Jt,kt=Gt,At=(t,e,o)=>{const n=new Map,i={platform:pe,...o},r={...i.platform,_c:n};return Yt(t,e,{...i,platform:r})},ge=["data-opened"],we={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},ye=c.defineComponent({__name:"OneDropdownAuto",props:D.dropdownProps,emits:["open","close"],setup(t,{emit:e}){const o=t,n=c.ref(!1),i=c.ref(null),r=c.ref(null);let s=null;c.watch(n,u=>{u&&r.value&&i.value?(At(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[Et(5),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})}),s=he(r.value,i.value,()=>{At(r.value,i.value,{placement:o.stick?o.stick:"bottom-start",middleware:[Et(4),kt()]}).then(({x:d,y:m})=>{Object.assign(i.value.style,{left:`${d}px`,top:`${m}px`})})})):s&&(s(),s=null)}),c.onBeforeUnmount(()=>{s&&s()});const l=e,a=()=>{n.value=!n.value,n.value?l("open"):l("close")};c.provide("OneDropdown",{onToggle:a});const f=c.computed(()=>["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"]);return(u,d)=>(c.openBlock(),c.createElementBlock("div",{class:"relative inline-block","data-opened":n.value},[c.createElementVNode("div",{ref_key:"buttonRef",ref:r},[c.renderSlot(u.$slots,"button",c.normalizeProps(c.guardReactiveProps({onToggle:a,isExpanded:n.value})))],512),n.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:a})):c.createCommentVNode("",!0),c.withDirectives(c.createElementVNode("div",{ref_key:"menuRef",ref:i,class:c.normalizeClass(["menu",f.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1",style:{display:"none"}},[u.title?(c.openBlock(),c.createElementBlock("div",we,c.toDisplayString(u.title),1)):c.createCommentVNode("",!0),c.renderSlot(u.$slots,"menu",c.normalizeProps(c.guardReactiveProps({onToggle:a})))],2),[[c.vShow,n.value]])],8,ge))}}),xe={},ve={class:"border-t border-secondary-stroke my-1"};function be(t,e){return c.openBlock(),c.createElementBlock("div",ve)}const Ee=Pt._export_sfc(xe,[["render",be]]),ke=["onClick"],Ae={class:"grid"},Oe={class:"font-semibold px-3"},Ce={class:"rounded-lg m-3 border"},Re={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},_e={class:"flex-shrink-0"},De={class:"w-full text-left"},Se={class:"flex-shrink-0"},Ve={class:"px-3 py-2"},Le={class:"text-secondary-content text-left pb-1 text-sm uppercase"},Ne={key:0,class:"space-y-2"},Te=["onClick"],Be={class:"pl-2"},Fe={class:"text-sm mt-1"},Pe={class:"text-xs mt-1"},Ot=3,Me=c.defineComponent({__name:"OneBrowserMenuGrid",props:D.browserMenuProps,setup(t){const e=t,o=()=>{typeof e.onChange=="function"&&e.onChange()},n=c.ref(!1),i=c.computed(()=>e.apps?n.value?e.apps:e.apps.slice(0,Ot):[]),r=()=>{n.value=!n.value},s=l=>{typeof e.onApp=="function"&&e.onApp(l)};return(l,a)=>(c.openBlock(),c.createBlock(D._sfc_main$1,{stick:"right"},{button:c.withCtx(({onToggle:f,isExpanded:u})=>[c.createElementVNode("button",{onClick:f,class:c.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[u?"bg-secondary-25":""]])},[c.createVNode(c.unref(D.render$4),{class:"text-secondary-base",style:c.normalizeStyle(`width: ${l.iconSize}px; height: ${l.iconSize}px`)},null,8,["style"])],10,ke)]),menu:c.withCtx(()=>{var f,u,d,m;return[c.createElementVNode("div",Ae,[c.createElementVNode("div",Oe,c.toDisplayString((f=l.workspace)==null?void 0:f.title),1),c.createElementVNode("div",Ce,[c.createElementVNode("div",Re,[c.createElementVNode("div",_e,[c.createVNode(wt.OneAvatar,{text:((u=l.workspace)==null?void 0:u.name)||"",src:(d=l.workspace)==null?void 0:d.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),c.createElementVNode("div",De,c.toDisplayString((m=l.workspace)==null?void 0:m.name),1),c.createElementVNode("div",Se,[c.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:o},c.toDisplayString(l.changeLabel),1)])]),a[0]||(a[0]=c.createElementVNode("hr",null,null,-1)),a[1]||(a[1]=c.createElementVNode("div",{class:"text-center py-2",style:{"font-size":"10px"}},"Керувати робочими просторами",-1))])]),c.createElementVNode("div",Ve,[c.createElementVNode("div",Le,c.toDisplayString(l.appsTitle),1),c.createElementVNode("div",null,[l.apps&&l.apps.length?(c.openBlock(),c.createElementBlock("div",Ne,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,p=>(c.openBlock(),c.createElementBlock("div",{key:p.id,onClick:h=>s(p),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[c.createVNode(wt.OneAvatar,{text:p.name,src:p.photo_url,size:44,rounded:!1},null,8,["text","src"]),c.createElementVNode("div",Be,[c.createElementVNode("p",Fe,c.toDisplayString(p.name),1),c.createElementVNode("p",Pe,c.toDisplayString(p.short),1)])],8,Te))),128))])):c.createCommentVNode("",!0),l.apps&&l.apps.length>Ot?(c.openBlock(),c.createElementBlock("button",{key:1,onClick:r,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},c.toDisplayString(n.value?"Приховати":"Дивитися всі"),1)):c.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=D.OneBrowserMenu;exports.OneDropdown=D._sfc_main$1;exports.OneDropdownItem=D._sfc_main$2;exports.OneHelpMenu=D.OneHelpMenu;exports.OneUserMenu=D._sfc_main;exports.OneBrowserMenuGrid=Me;exports.OneDropdownAuto=ye;exports.OneDropdownDivider=Ee;
|
package/dist/dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as OneDropdown } from './OneDropdown.vue';
|
|
2
|
+
export { default as OneDropdownAuto } from './OneDropdownAuto.vue';
|
|
2
3
|
export { default as OneDropdownItem } from './OneDropdownItem.vue';
|
|
3
4
|
export { default as OneDropdownDivider } from './OneDropdownDivider.vue';
|
|
4
5
|
export { default as OneUserMenu } from './OneUserMenu.vue';
|