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