@oneb/ui-vue 0.0.77 → 0.0.78
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/OneBrowserMenu-8b60a8d7.cjs +1 -0
- package/dist/{OneBrowserMenu-2f62dcbe.js → OneBrowserMenu-954210ad.js} +142 -141
- package/dist/button/OneButton.vue.d.ts +2 -0
- package/dist/button/SpinnerIcon.vue.d.ts +2 -0
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/util.d.ts +2 -0
- package/dist/card/OneCard.vue.d.ts +2 -0
- package/dist/card/OneCardBody.vue.d.ts +2 -0
- package/dist/card/OneCardFooter.vue.d.ts +2 -0
- package/dist/card/OneCardHeader.vue.d.ts +2 -0
- package/dist/common/OneAvatar.vue.d.ts +2 -0
- package/dist/dropdown/OneBrowserMenu.vue.d.ts +2 -0
- package/dist/dropdown/OneBrowserMenuGrid.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdown.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdownDivider.vue.d.ts +2 -0
- package/dist/dropdown/OneDropdownItem.vue.d.ts +2 -0
- package/dist/dropdown/OneUserMenu.vue.d.ts +2 -0
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +3 -3
- package/dist/form/OneForm.vue.d.ts +2 -0
- package/dist/form/OneFormFeedback.vue.d.ts +2 -0
- package/dist/form/OneFormField.vue.d.ts +2 -0
- package/dist/form/OneFormInput.vue.d.ts +2 -0
- package/dist/form/OneFormLabel.vue.d.ts +2 -0
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +125 -125
- package/dist/index-176aeb3b.cjs +1 -0
- package/dist/{index-a1adb4e2.js → index-3f2d6084.js} +55 -55
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/layout/IconOneb.vue.d.ts +2 -0
- package/dist/layout/OneMainLayout.vue.d.ts +2 -0
- package/dist/layout/OneSidebar.vue.d.ts +2 -0
- package/dist/layout/OneSidebarLink.vue.d.ts +2 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +244 -244
- package/package.json +1 -1
- package/dist/OneBrowserMenu-1797b765.cjs +0 -1
- package/dist/index-20c83582.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),f=require("./common/index.cjs"),B=require("./XMarkIcon-f94baa4c.cjs"),C=require("./index-176aeb3b.cjs"),N=require("./_plugin-vue_export-helper-f246444f.cjs"),S={title:{type:String},stick:{type:String,default:"right"}},A={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},$=["data-opened"],z={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},x=e.defineComponent({__name:"OneDropdown",props:S,emits:["open","close"],setup(c,{emit:r}){const i=e.ref(!1),l=e.ref(null),a=r,n=c,s=()=>{i.value=!i.value,i.value?a("open"):a("close")};e.provide("OneDropdown",{onToggle:s});const o=e.computed(()=>{const t=l.value!=null&&l.value.getBoundingClientRect.x<270;return l.value!=null&&l.value.getBoundingClientRect().top+270>window.innerHeight?"up"+(t?"-right":"-left"):"down"+(t?"-right":"-left")}),u=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,p)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:l,"data-opened":i.value},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:s,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:s})):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",u.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[t.title?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:s})))],2)):e.createCommentVNode("",!0)]),_:3})],8,$))}}),k=e.defineComponent({__name:"OneDropdownItem",props:A,emits:["click"],setup(c,{emit:r}){const i=r,l=c,a=e.inject("OneDropdown"),n=()=>{a!==void 0&&a.onToggle(),i("click")},s=e.computed(()=>{const o=[];return l.variant==="secondary"?o.push("text-secondary-content hover:bg-secondary-body-hover"):l.variant==="danger"?o.push("text-danger-content hover:bg-danger-10"):l.variant==="warning"?o.push("text-warning-content hover:bg-warning-10"):l.variant==="info"?o.push("text-info-content hover:bg-info-10"):o.push("hover:bg-secondary-body-hover"),o});return(o,u)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",s.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 D(c,r){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 O={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}},_={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}},L=["onClick"],F={class:"flex flex-col items-center pt-5 pb-2 h-full"},j={class:"flex flex-col px-10 py-1 mt-2 text-center"},M={class:"self-center text-base font-medium tracking-wide text-black"},P={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},q={class:"text-left w-full mt-5 px-3"},I=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1),R={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},T=e.defineComponent({__name:"OneUserMenu",props:O,setup(c){const r=c,i=e.computed(()=>{var n;return(n=r.menu)==null?void 0:n.map(s=>{let o={label:s.label};s.icon!=null&&(o={...o,icon:s.icon});const u=typeof s.click=="function"?s.click:()=>{};return{key:s.label,args:o,click:u}})}),l=()=>{typeof r.onAccount=="function"&&r.onAccount()},a=()=>{typeof r.onLogout=="function"&&r.onLogout()};return(n,s)=>(e.openBlock(),e.createBlock(x,{stick:"right"},{button:e.withCtx(({onToggle:o,isExpanded:u})=>{var t,p;return[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[u?"bg-secondary-25":""]])},[e.createVNode(f.OneAvatar,{text:((t=n.user)==null?void 0:t.name)||"",size:n.iconSize,src:(p=n.user)==null?void 0:p.photo_url,rounded:!0},null,8,["text","size","src"])],10,L)]}),menu:e.withCtx(()=>{var o,u,t,p,h;return[e.createElementVNode("div",F,[e.createVNode(f.OneAvatar,{text:((o=n.user)==null?void 0:o.name)||"",size:80,src:(u=n.user)==null?void 0:u.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",j,[e.createElementVNode("div",M,e.toDisplayString((t=n.user)==null?void 0:t.name),1),e.createElementVNode("div",P,e.toDisplayString((p=n.user)==null?void 0:p.email),1)]),typeof r.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l,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(i.value,m=>(e.openBlock(),e.createBlock(k,e.mergeProps({key:m.key,ref_for:!0},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),typeof n.onLogout=="function"?(e.openBlock(),e.createBlock(k,{key:0,icon:e.unref(D),label:n.logoutLabel,class:"rounded py-3",onClick:a},null,8,["icon","label"])):e.createCommentVNode("",!0)]),I,e.createElementVNode("div",R,e.toDisplayString((h=n.app)==null?void 0:h.version),1)])]}),_:1}))}});function b(c,r){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 H(c,r){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 W(c,r){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 E(c,r){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 U=c=>(e.pushScopeId("data-v-4936d4e4"),c=c(),e.popScopeId(),c),X=["data-opened"],G={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},J={class:"flex justify-between items-center pt-3 mb-3"},K={class:"font-semibold text-xl px-3"},Q={class:"grid"},Y={class:"rounded-lg m-3 border"},Z={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},ee={class:"flex justify-between relative"},te={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},oe={key:0},ne={class:"text-xs font-semibold"},re=U(()=>e.createElementVNode("hr",null,null,-1)),le={class:"px-3 py-2"},se={class:"text-secondary-content text-left pb-1 text-xs uppercase"},ce={class:"overflow-auto max-h-full"},ae={key:0,class:"space-y-2"},ie=["onClick"],de={class:"flex"},ue={class:"border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center"},pe={class:"pl-2"},me={class:"text-sm mt-1 font-semibold"},he={class:"text9 mt-1"},fe={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},ke=e.defineComponent({__name:"OneBrowserMenu",props:_,emits:["open","close"],setup(c,{emit:r}){const i=r,l=c,a=e.ref(!1),n=()=>{a.value=!a.value,a.value?i("open"):i("close")},s=e.ref(!1);e.computed(()=>s.value?W:H);const o=()=>{typeof l.onChange=="function"&&l.onChange()},u=t=>{typeof l.onApp=="function"&&l.onApp(t)};return(t,p)=>{var h,m,g,v,y,w;return e.openBlock(),e.createElementBlock("div",{"data-opened":a.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":a.value}])},[e.createVNode(e.unref(b),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),a.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),a.value?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,e.toDisplayString((h=t.workspace)==null?void 0:h.title),1),e.createVNode(e.unref(B.render),{class:"w-6 cursor-pointer",onClick:n})]),e.createElementVNode("div",Q,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createVNode(f.OneAvatar,{text:((m=t.workspace)==null?void 0:m.name)||"",src:(g=t.workspace)==null?void 0:g.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",te,e.toDisplayString((v=t.workspace)==null?void 0:v.name),1)]),s.value?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.workspaces,d=>(e.openBlock(),e.createElementBlock("div",{key:d.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(f.OneAvatar,{text:d.name,src:d.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",ne,e.toDisplayString(d.name),1)]))),128))])):e.createCommentVNode("",!0),re,e.createElementVNode("div",{onClick:o,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((y=t.workspace)==null?void 0:y.changeLabel),1)])]),e.createElementVNode("div",le,[e.createElementVNode("div",se,e.toDisplayString((w=t.workspace)==null?void 0:w.appsLabel),1),e.createElementVNode("div",ce,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.apps,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,onClick:V=>u(d),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",de,[e.createElementVNode("div",ue,[e.createVNode(f.OneAvatar,{text:d.name,src:d.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",pe,[e.createElementVNode("p",me,e.toDisplayString(d.name),1),e.createElementVNode("p",he,e.toDisplayString(d==null?void 0:d.short),1)])]),e.createElementVNode("div",null,[e.createVNode(C._sfc_main,{variant:"touch",icon:e.unref(E),onClick:V=>u(d)},null,8,["icon","onClick"])])],8,ie))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("button",fe,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,X)}}});const ge=N._export_sfc(ke,[["__scopeId","data-v-4936d4e4"]]);exports.OneBrowserMenu=ge;exports._sfc_main=x;exports._sfc_main$1=k;exports._sfc_main$2=T;exports.browserMenuProps=_;exports.render=E;exports.render$1=b;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as $, ref as C, provide as
|
|
1
|
+
import { defineComponent as $, ref as C, provide as R, computed as _, openBlock as o, createElementBlock as r, renderSlot as M, normalizeProps as I, guardReactiveProps as P, createCommentVNode as m, createVNode as v, Transition as T, withCtx as S, normalizeClass as A, toDisplayString as h, inject as V, withModifiers as q, createBlock as k, resolveDynamicComponent as H, createElementVNode as e, Fragment as z, renderList as j, mergeProps as N, unref as b, pushScopeId as W, popScopeId as U } from "vue";
|
|
2
2
|
import { OneAvatar as w } from "./common/index.js";
|
|
3
|
-
import { r as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
3
|
+
import { r as G } from "./XMarkIcon-51ef0691.js";
|
|
4
|
+
import { _ as J } from "./index-3f2d6084.js";
|
|
5
|
+
import { _ as K } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
|
+
const Q = {
|
|
7
7
|
title: {
|
|
8
8
|
type: String
|
|
9
9
|
},
|
|
@@ -11,7 +11,7 @@ const K = {
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: "right"
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, X = {
|
|
15
15
|
variant: {
|
|
16
16
|
type: String,
|
|
17
17
|
default: "primary"
|
|
@@ -22,44 +22,44 @@ const K = {
|
|
|
22
22
|
icon: {
|
|
23
23
|
type: [Function, Object]
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, Y = ["data-opened"], Z = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
28
|
-
},
|
|
28
|
+
}, ee = /* @__PURE__ */ $({
|
|
29
29
|
__name: "OneDropdown",
|
|
30
|
-
props:
|
|
30
|
+
props: Q,
|
|
31
31
|
emits: ["open", "close"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
34
|
-
|
|
32
|
+
setup(a, { emit: i }) {
|
|
33
|
+
const d = C(!1), l = C(null), u = i, s = a, c = () => {
|
|
34
|
+
d.value = !d.value, d.value ? u("open") : u("close");
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
onToggle:
|
|
36
|
+
R("OneDropdown", {
|
|
37
|
+
onToggle: c
|
|
38
38
|
});
|
|
39
|
-
const
|
|
40
|
-
const t =
|
|
41
|
-
return
|
|
42
|
-
}),
|
|
39
|
+
const n = _(() => {
|
|
40
|
+
const t = l.value != null && l.value.getBoundingClientRect.x < 270;
|
|
41
|
+
return l.value != null && l.value.getBoundingClientRect().top + 270 > window.innerHeight ? "up" + (t ? "-right" : "-left") : "down" + (t ? "-right" : "-left");
|
|
42
|
+
}), f = _(() => {
|
|
43
43
|
const t = [
|
|
44
44
|
"absolute z-10 w-fit rounded-md bg-white",
|
|
45
45
|
"py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
|
|
46
46
|
"overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
|
|
47
47
|
];
|
|
48
|
-
return
|
|
48
|
+
return n.value.startsWith("up") ? t.push("bottom-1 mb-10") : n.value.startsWith("down") && t.push("top-1 mt-10"), s.stick === "right" ? t.push("right-0") : s.stick === "left" && t.push("left-0"), t;
|
|
49
49
|
});
|
|
50
|
-
return (t,
|
|
50
|
+
return (t, g) => (o(), r("div", {
|
|
51
51
|
class: "relative inline-block",
|
|
52
52
|
ref_key: "menuRef",
|
|
53
|
-
ref:
|
|
54
|
-
"data-opened":
|
|
53
|
+
ref: l,
|
|
54
|
+
"data-opened": d.value
|
|
55
55
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
M(t.$slots, "button", I(P({ onToggle: c, isExpanded: d.value }))),
|
|
57
|
+
d.value ? (o(), r("div", {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
60
|
-
onClick:
|
|
61
|
-
})) :
|
|
62
|
-
v(
|
|
60
|
+
onClick: c
|
|
61
|
+
})) : m("", !0),
|
|
62
|
+
v(T, {
|
|
63
63
|
"enter-active-class": "transition ease-out duration-100",
|
|
64
64
|
"enter-from-class": "transform opacity-0 scale-95",
|
|
65
65
|
"enter-to-class": "transform opacity-100 scale-100",
|
|
@@ -68,45 +68,45 @@ const K = {
|
|
|
68
68
|
"leave-to-class": "transform opacity-0 scale-95"
|
|
69
69
|
}, {
|
|
70
70
|
default: S(() => [
|
|
71
|
-
|
|
71
|
+
d.value ? (o(), r("div", {
|
|
72
72
|
key: 0,
|
|
73
|
-
class: A(["menu",
|
|
73
|
+
class: A(["menu", f.value]),
|
|
74
74
|
role: "menu",
|
|
75
75
|
"aria-orientation": "vertical",
|
|
76
76
|
tabindex: "-1"
|
|
77
77
|
}, [
|
|
78
|
-
t.title ? (o(), r("div",
|
|
79
|
-
|
|
80
|
-
], 2)) :
|
|
78
|
+
t.title ? (o(), r("div", Z, h(t.title), 1)) : m("", !0),
|
|
79
|
+
M(t.$slots, "menu", I(P({ onToggle: c })))
|
|
80
|
+
], 2)) : m("", !0)
|
|
81
81
|
]),
|
|
82
82
|
_: 3
|
|
83
83
|
})
|
|
84
|
-
], 8,
|
|
84
|
+
], 8, Y));
|
|
85
85
|
}
|
|
86
|
-
}),
|
|
86
|
+
}), D = /* @__PURE__ */ $({
|
|
87
87
|
__name: "OneDropdownItem",
|
|
88
|
-
props:
|
|
88
|
+
props: X,
|
|
89
89
|
emits: ["click"],
|
|
90
|
-
setup(
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
const
|
|
95
|
-
return
|
|
90
|
+
setup(a, { emit: i }) {
|
|
91
|
+
const d = i, l = a, u = V("OneDropdown"), s = () => {
|
|
92
|
+
u !== void 0 && u.onToggle(), d("click");
|
|
93
|
+
}, c = _(() => {
|
|
94
|
+
const n = [];
|
|
95
|
+
return l.variant === "secondary" ? n.push("text-secondary-content hover:bg-secondary-body-hover") : l.variant === "danger" ? n.push("text-danger-content hover:bg-danger-10") : l.variant === "warning" ? n.push("text-warning-content hover:bg-warning-10") : l.variant === "info" ? n.push("text-info-content hover:bg-info-10") : n.push("hover:bg-secondary-body-hover"), n;
|
|
96
96
|
});
|
|
97
|
-
return (
|
|
98
|
-
class: A(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",
|
|
99
|
-
onClick:
|
|
97
|
+
return (n, f) => (o(), r("button", {
|
|
98
|
+
class: A(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", c.value]),
|
|
99
|
+
onClick: q(s, ["prevent"])
|
|
100
100
|
}, [
|
|
101
|
-
|
|
101
|
+
n.icon ? (o(), k(H(n.icon), {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "w-4 h-4"
|
|
104
|
-
})) :
|
|
105
|
-
e("span", null,
|
|
106
|
-
],
|
|
104
|
+
})) : m("", !0),
|
|
105
|
+
e("span", null, h(n.label), 1)
|
|
106
|
+
], 2));
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
function te(
|
|
109
|
+
function te(a, i) {
|
|
110
110
|
return o(), r("svg", {
|
|
111
111
|
xmlns: "http://www.w3.org/2000/svg",
|
|
112
112
|
fill: "none",
|
|
@@ -186,84 +186,85 @@ const oe = {
|
|
|
186
186
|
onApp: {
|
|
187
187
|
type: Function
|
|
188
188
|
}
|
|
189
|
-
}, se = ["onClick"], re = { class: "flex flex-col items-center pt-5 pb-2 h-full" },
|
|
189
|
+
}, se = ["onClick"], re = { class: "flex flex-col items-center pt-5 pb-2 h-full" }, ie = { class: "flex flex-col px-10 py-1 mt-2 text-center" }, le = { class: "self-center text-base font-medium tracking-wide text-black" }, ce = { class: "mt-1 text-xs leading-5 text-blue-500 font-light" }, ae = { class: "text-left w-full mt-5 px-3" }, ue = /* @__PURE__ */ e("div", {
|
|
190
190
|
class: "space-y-2 text-center",
|
|
191
191
|
style: { width: "240px" }
|
|
192
192
|
}, null, -1), de = { class: "-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400" }, Ue = /* @__PURE__ */ $({
|
|
193
193
|
__name: "OneUserMenu",
|
|
194
194
|
props: oe,
|
|
195
|
-
setup(
|
|
196
|
-
const i =
|
|
197
|
-
var
|
|
198
|
-
return (
|
|
199
|
-
let
|
|
200
|
-
|
|
201
|
-
const
|
|
195
|
+
setup(a) {
|
|
196
|
+
const i = a, d = _(() => {
|
|
197
|
+
var s;
|
|
198
|
+
return (s = i.menu) == null ? void 0 : s.map((c) => {
|
|
199
|
+
let n = { label: c.label };
|
|
200
|
+
c.icon != null && (n = { ...n, icon: c.icon });
|
|
201
|
+
const f = typeof c.click == "function" ? c.click : () => {
|
|
202
202
|
};
|
|
203
203
|
return {
|
|
204
|
-
key:
|
|
205
|
-
args:
|
|
206
|
-
click:
|
|
204
|
+
key: c.label,
|
|
205
|
+
args: n,
|
|
206
|
+
click: f
|
|
207
207
|
};
|
|
208
208
|
});
|
|
209
209
|
}), l = () => {
|
|
210
210
|
typeof i.onAccount == "function" && i.onAccount();
|
|
211
|
-
},
|
|
211
|
+
}, u = () => {
|
|
212
212
|
typeof i.onLogout == "function" && i.onLogout();
|
|
213
213
|
};
|
|
214
|
-
return (
|
|
215
|
-
button: S(({ onToggle:
|
|
216
|
-
var
|
|
214
|
+
return (s, c) => (o(), k(ee, { stick: "right" }, {
|
|
215
|
+
button: S(({ onToggle: n, isExpanded: f }) => {
|
|
216
|
+
var t, g;
|
|
217
217
|
return [
|
|
218
218
|
e("button", {
|
|
219
|
-
onClick:
|
|
220
|
-
class: A(["p-1 rounded-full hover:bg-secondary-10", [
|
|
219
|
+
onClick: n,
|
|
220
|
+
class: A(["p-1 rounded-full hover:bg-secondary-10", [f ? "bg-secondary-25" : ""]])
|
|
221
221
|
}, [
|
|
222
222
|
v(w, {
|
|
223
|
-
text: ((
|
|
224
|
-
size:
|
|
225
|
-
src: (g =
|
|
223
|
+
text: ((t = s.user) == null ? void 0 : t.name) || "",
|
|
224
|
+
size: s.iconSize,
|
|
225
|
+
src: (g = s.user) == null ? void 0 : g.photo_url,
|
|
226
226
|
rounded: !0
|
|
227
227
|
}, null, 8, ["text", "size", "src"])
|
|
228
228
|
], 10, se)
|
|
229
229
|
];
|
|
230
230
|
}),
|
|
231
231
|
menu: S(() => {
|
|
232
|
-
var
|
|
232
|
+
var n, f, t, g, y;
|
|
233
233
|
return [
|
|
234
234
|
e("div", re, [
|
|
235
235
|
v(w, {
|
|
236
|
-
text: ((
|
|
236
|
+
text: ((n = s.user) == null ? void 0 : n.name) || "",
|
|
237
237
|
size: 80,
|
|
238
|
-
src: (
|
|
238
|
+
src: (f = s.user) == null ? void 0 : f.photo_url,
|
|
239
239
|
rounded: !0,
|
|
240
240
|
class: "mx-auto"
|
|
241
241
|
}, null, 8, ["text", "src"]),
|
|
242
|
-
e("div",
|
|
243
|
-
e("div",
|
|
244
|
-
e("div", ce,
|
|
242
|
+
e("div", ie, [
|
|
243
|
+
e("div", le, h((t = s.user) == null ? void 0 : t.name), 1),
|
|
244
|
+
e("div", ce, h((g = s.user) == null ? void 0 : g.email), 1)
|
|
245
245
|
]),
|
|
246
246
|
typeof i.onAccount == "function" ? (o(), r("a", {
|
|
247
247
|
key: 0,
|
|
248
248
|
onClick: l,
|
|
249
249
|
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"
|
|
250
|
-
},
|
|
250
|
+
}, h(s.accountLabel), 1)) : m("", !0),
|
|
251
251
|
e("div", ae, [
|
|
252
|
-
(o(!0), r(z, null, j(
|
|
253
|
-
key: x.key
|
|
252
|
+
(o(!0), r(z, null, j(d.value, (x) => (o(), k(D, N({
|
|
253
|
+
key: x.key,
|
|
254
|
+
ref_for: !0
|
|
254
255
|
}, x.args, {
|
|
255
256
|
onClick: x.click
|
|
256
257
|
}), null, 16, ["onClick"]))), 128)),
|
|
257
|
-
typeof
|
|
258
|
+
typeof s.onLogout == "function" ? (o(), k(D, {
|
|
258
259
|
key: 0,
|
|
259
260
|
icon: b(te),
|
|
260
|
-
label:
|
|
261
|
+
label: s.logoutLabel,
|
|
261
262
|
class: "rounded py-3",
|
|
262
|
-
onClick:
|
|
263
|
-
}, null, 8, ["icon", "label"])) :
|
|
263
|
+
onClick: u
|
|
264
|
+
}, null, 8, ["icon", "label"])) : m("", !0)
|
|
264
265
|
]),
|
|
265
266
|
ue,
|
|
266
|
-
e("div", de,
|
|
267
|
+
e("div", de, h((y = s.app) == null ? void 0 : y.version), 1)
|
|
267
268
|
])
|
|
268
269
|
];
|
|
269
270
|
}),
|
|
@@ -271,7 +272,7 @@ const oe = {
|
|
|
271
272
|
}));
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
|
-
function pe(
|
|
275
|
+
function pe(a, i) {
|
|
275
276
|
return o(), r("svg", {
|
|
276
277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
277
278
|
fill: "none",
|
|
@@ -363,7 +364,7 @@ function pe(c, i) {
|
|
|
363
364
|
})
|
|
364
365
|
]);
|
|
365
366
|
}
|
|
366
|
-
function he(
|
|
367
|
+
function he(a, i) {
|
|
367
368
|
return o(), r("svg", {
|
|
368
369
|
xmlns: "http://www.w3.org/2000/svg",
|
|
369
370
|
fill: "none",
|
|
@@ -379,7 +380,7 @@ function he(c, i) {
|
|
|
379
380
|
})
|
|
380
381
|
]);
|
|
381
382
|
}
|
|
382
|
-
function fe(
|
|
383
|
+
function fe(a, i) {
|
|
383
384
|
return o(), r("svg", {
|
|
384
385
|
xmlns: "http://www.w3.org/2000/svg",
|
|
385
386
|
fill: "none",
|
|
@@ -395,7 +396,7 @@ function fe(c, i) {
|
|
|
395
396
|
})
|
|
396
397
|
]);
|
|
397
398
|
}
|
|
398
|
-
function
|
|
399
|
+
function me(a, i) {
|
|
399
400
|
return o(), r("svg", {
|
|
400
401
|
xmlns: "http://www.w3.org/2000/svg",
|
|
401
402
|
fill: "none",
|
|
@@ -411,13 +412,13 @@ function ve(c, i) {
|
|
|
411
412
|
})
|
|
412
413
|
]);
|
|
413
414
|
}
|
|
414
|
-
const
|
|
415
|
+
const ve = (a) => (W("data-v-4936d4e4"), a = a(), U(), a), ge = ["data-opened"], xe = {
|
|
415
416
|
key: 1,
|
|
416
417
|
class: "absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"
|
|
417
418
|
}, ye = { class: "flex justify-between items-center pt-3 mb-3" }, we = { class: "font-semibold text-xl px-3" }, _e = { class: "grid" }, ke = { class: "rounded-lg m-3 border" }, be = {
|
|
418
419
|
class: "space-x-2 flex items-center px-3 py-2",
|
|
419
420
|
style: { width: "300px" }
|
|
420
|
-
}, Ce = { class: "flex justify-between relative" }, $e = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Ae = { key: 0 }, Se = { class: "text-xs font-semibold" }, ze = /* @__PURE__ */
|
|
421
|
+
}, Ce = { class: "flex justify-between relative" }, $e = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, Ae = { key: 0 }, Se = { class: "text-xs font-semibold" }, ze = /* @__PURE__ */ ve(() => /* @__PURE__ */ e("hr", null, null, -1)), je = { class: "px-3 py-2" }, Le = { class: "text-secondary-content text-left pb-1 text-xs uppercase" }, Oe = { class: "overflow-auto max-h-full" }, Fe = {
|
|
421
422
|
key: 0,
|
|
422
423
|
class: "space-y-2"
|
|
423
424
|
}, Be = ["onClick"], Me = { class: "flex" }, Ie = { class: "border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center" }, Pe = { class: "pl-2" }, De = { class: "text-sm mt-1 font-semibold" }, Ee = { class: "text9 mt-1" }, Re = {
|
|
@@ -427,36 +428,36 @@ const ge = (c) => (N("data-v-4936d4e4"), c = c(), W(), c), me = ["data-opened"],
|
|
|
427
428
|
__name: "OneBrowserMenu",
|
|
428
429
|
props: ne,
|
|
429
430
|
emits: ["open", "close"],
|
|
430
|
-
setup(
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
_(() =>
|
|
435
|
-
const
|
|
436
|
-
typeof
|
|
437
|
-
},
|
|
438
|
-
typeof
|
|
431
|
+
setup(a, { emit: i }) {
|
|
432
|
+
const d = i, l = a, u = C(!1), s = () => {
|
|
433
|
+
u.value = !u.value, u.value ? d("open") : d("close");
|
|
434
|
+
}, c = C(!1);
|
|
435
|
+
_(() => c.value ? fe : he);
|
|
436
|
+
const n = () => {
|
|
437
|
+
typeof l.onChange == "function" && l.onChange();
|
|
438
|
+
}, f = (t) => {
|
|
439
|
+
typeof l.onApp == "function" && l.onApp(t);
|
|
439
440
|
};
|
|
440
|
-
return (t,
|
|
441
|
-
var
|
|
442
|
-
return o(), r("div", { "data-opened":
|
|
441
|
+
return (t, g) => {
|
|
442
|
+
var y, x, L, O, F, B;
|
|
443
|
+
return o(), r("div", { "data-opened": u.value }, [
|
|
443
444
|
e("button", {
|
|
444
|
-
onClick:
|
|
445
|
-
class: A(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10", { "bg-secondary-10":
|
|
445
|
+
onClick: s,
|
|
446
|
+
class: A(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10", { "bg-secondary-10": u.value }])
|
|
446
447
|
}, [
|
|
447
448
|
v(b(pe), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
|
|
448
449
|
], 2),
|
|
449
|
-
|
|
450
|
+
u.value ? (o(), r("div", {
|
|
450
451
|
key: 0,
|
|
451
452
|
class: "fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",
|
|
452
|
-
onClick:
|
|
453
|
-
})) :
|
|
454
|
-
|
|
453
|
+
onClick: s
|
|
454
|
+
})) : m("", !0),
|
|
455
|
+
u.value ? (o(), r("div", xe, [
|
|
455
456
|
e("div", ye, [
|
|
456
|
-
e("div", we,
|
|
457
|
-
v(b(
|
|
457
|
+
e("div", we, h((y = t.workspace) == null ? void 0 : y.title), 1),
|
|
458
|
+
v(b(G), {
|
|
458
459
|
class: "w-6 cursor-pointer",
|
|
459
|
-
onClick:
|
|
460
|
+
onClick: s
|
|
460
461
|
})
|
|
461
462
|
]),
|
|
462
463
|
e("div", _e, [
|
|
@@ -464,84 +465,84 @@ const ge = (c) => (N("data-v-4936d4e4"), c = c(), W(), c), me = ["data-opened"],
|
|
|
464
465
|
e("div", be, [
|
|
465
466
|
e("div", Ce, [
|
|
466
467
|
v(w, {
|
|
467
|
-
text: ((
|
|
468
|
-
src: (
|
|
468
|
+
text: ((x = t.workspace) == null ? void 0 : x.name) || "",
|
|
469
|
+
src: (L = t.workspace) == null ? void 0 : L.photo_url,
|
|
469
470
|
size: 44,
|
|
470
471
|
rounded: !1,
|
|
471
472
|
class: "mx-auto"
|
|
472
473
|
}, null, 8, ["text", "src"])
|
|
473
474
|
]),
|
|
474
|
-
e("div", $e,
|
|
475
|
+
e("div", $e, h((O = t.workspace) == null ? void 0 : O.name), 1)
|
|
475
476
|
]),
|
|
476
|
-
|
|
477
|
-
(o(!0), r(z, null, j(t.workspaces, (
|
|
478
|
-
key:
|
|
477
|
+
c.value ? (o(), r("div", Ae, [
|
|
478
|
+
(o(!0), r(z, null, j(t.workspaces, (p) => (o(), r("div", {
|
|
479
|
+
key: p.name,
|
|
479
480
|
class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
|
|
480
481
|
}, [
|
|
481
482
|
v(w, {
|
|
482
|
-
text:
|
|
483
|
-
src:
|
|
483
|
+
text: p.name,
|
|
484
|
+
src: p.photo_url,
|
|
484
485
|
size: 30,
|
|
485
486
|
rounded: !1
|
|
486
487
|
}, null, 8, ["text", "src"]),
|
|
487
|
-
e("span", Se, p
|
|
488
|
+
e("span", Se, h(p.name), 1)
|
|
488
489
|
]))), 128))
|
|
489
|
-
])) :
|
|
490
|
+
])) : m("", !0),
|
|
490
491
|
ze,
|
|
491
492
|
e("div", {
|
|
492
|
-
onClick:
|
|
493
|
+
onClick: n,
|
|
493
494
|
class: "text-center py-2 cursor-pointer",
|
|
494
495
|
style: { "font-size": "10px" }
|
|
495
|
-
},
|
|
496
|
+
}, h((F = t.workspace) == null ? void 0 : F.changeLabel), 1)
|
|
496
497
|
])
|
|
497
498
|
]),
|
|
498
499
|
e("div", je, [
|
|
499
|
-
e("div", Le,
|
|
500
|
+
e("div", Le, h((B = t.workspace) == null ? void 0 : B.appsLabel), 1),
|
|
500
501
|
e("div", Oe, [
|
|
501
502
|
t.apps && t.apps.length ? (o(), r("div", Fe, [
|
|
502
|
-
(o(!0), r(z, null, j(t.apps, (
|
|
503
|
-
key:
|
|
504
|
-
onClick: (
|
|
503
|
+
(o(!0), r(z, null, j(t.apps, (p) => (o(), r("div", {
|
|
504
|
+
key: p.id,
|
|
505
|
+
onClick: (E) => f(p),
|
|
505
506
|
class: "flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"
|
|
506
507
|
}, [
|
|
507
508
|
e("div", Me, [
|
|
508
509
|
e("div", Ie, [
|
|
509
510
|
v(w, {
|
|
510
|
-
text:
|
|
511
|
-
src:
|
|
511
|
+
text: p.name,
|
|
512
|
+
src: p.photo_url,
|
|
512
513
|
size: 44,
|
|
513
514
|
rounded: !1
|
|
514
515
|
}, null, 8, ["text", "src"])
|
|
515
516
|
]),
|
|
516
517
|
e("div", Pe, [
|
|
517
|
-
e("p", De, p
|
|
518
|
-
e("p", Ee, p
|
|
518
|
+
e("p", De, h(p.name), 1),
|
|
519
|
+
e("p", Ee, h(p == null ? void 0 : p.short), 1)
|
|
519
520
|
])
|
|
520
521
|
]),
|
|
521
522
|
e("div", null, [
|
|
522
|
-
v(
|
|
523
|
+
v(J, {
|
|
523
524
|
variant: "touch",
|
|
524
|
-
icon: b(
|
|
525
|
-
onClick: (
|
|
525
|
+
icon: b(me),
|
|
526
|
+
onClick: (E) => f(p)
|
|
526
527
|
}, null, 8, ["icon", "onClick"])
|
|
527
528
|
])
|
|
528
529
|
], 8, Be))), 128))
|
|
529
|
-
])) :
|
|
530
|
-
t.apps && t.apps.length ? (o(), r("button", Re,
|
|
530
|
+
])) : m("", !0),
|
|
531
|
+
t.apps && t.apps.length ? (o(), r("button", Re, h("Дивитися всі"))) : m("", !0)
|
|
531
532
|
])
|
|
532
533
|
])
|
|
533
|
-
])) :
|
|
534
|
-
], 8,
|
|
534
|
+
])) : m("", !0)
|
|
535
|
+
], 8, ge);
|
|
535
536
|
};
|
|
536
537
|
}
|
|
537
538
|
});
|
|
538
|
-
const Ge = /* @__PURE__ */
|
|
539
|
+
const Ge = /* @__PURE__ */ K(Te, [["__scopeId", "data-v-4936d4e4"]]);
|
|
539
540
|
export {
|
|
540
541
|
Ge as O,
|
|
541
|
-
|
|
542
|
-
|
|
542
|
+
ee as _,
|
|
543
|
+
D as a,
|
|
543
544
|
Ue as b,
|
|
544
545
|
ne as c,
|
|
545
546
|
pe as d,
|
|
546
|
-
|
|
547
|
+
me as r
|
|
547
548
|
};
|
package/dist/button/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-176aeb3b.cjs");require("vue");require("../_plugin-vue_export-helper-f246444f.cjs");exports.OneButton=e._sfc_main;
|
package/dist/button/index.js
CHANGED