@oneb/ui-vue 0.4.3 → 0.4.6
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/OneDropdownAuto.vue_vue_type_script_setup_true_lang-06aedc97.cjs +1 -0
- package/dist/{OneDropdownAuto.vue_vue_type_script_setup_true_lang-2c508e8a.js → OneDropdownAuto.vue_vue_type_script_setup_true_lang-89baa790.js} +13 -14
- package/dist/OneHelpMenu-457f1517.cjs +1 -0
- package/dist/{OneHelpMenu-2a2051d7.js → OneHelpMenu-fb4ee252.js} +65 -48
- package/dist/buttonGroup/index.cjs +1 -1
- package/dist/buttonGroup/index.js +6 -5
- package/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.js +7 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +93 -77
- package/dist/errorsPage/index.cjs +1 -1
- package/dist/errorsPage/index.js +49 -46
- package/dist/index.cjs +1 -1
- package/dist/index.js +232 -233
- package/dist/infobox/index.cjs +1 -1
- package/dist/infobox/index.js +6 -4
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +15 -15
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +22 -18
- package/dist/style.css +1 -1
- package/dist/toast/index.cjs +1 -1
- package/dist/toast/index.js +1 -0
- package/dist/userList/index.cjs +1 -1
- package/dist/userList/index.js +5 -6
- package/package.json +1 -2
- package/dist/OneDropdownAuto.vue_vue_type_script_setup_true_lang-bf923b04.cjs +0 -1
- package/dist/OneHelpMenu-78d9348a.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),v=require("./dropdown-5cb64ab7.cjs"),a=require("@floating-ui/dom"),k=["data-opened"],w={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},x=e.defineComponent({__name:"OneDropdownAuto",props:v.dropdownProps,emits:["open","close"],setup(p,{emit:m}){const i=p,o=e.ref(!1),n=e.ref(null),s=e.ref(null);let l=null;const c=()=>{!s.value||!n.value||a.computePosition(s.value,n.value,{placement:i.stick?i.stick:"bottom-start",strategy:"fixed",middleware:[a.offset(5),a.flip(),a.shift({padding:8})]}).then(({x:t,y:d})=>{n.value&&Object.assign(n.value.style,{left:`${t}px`,top:`${d}px`})})};e.watch(o,t=>{t&&s.value&&n.value?(c(),l=a.autoUpdate(s.value,n.value,c)):l&&(l(),l=null)}),e.onBeforeUnmount(()=>{l&&l()});const u=m,r=()=>{o.value=!o.value,o.value?u("open"):u("close")};e.provide("OneDropdown",{onToggle:r});const f=e.computed(()=>["fixed z-[10000] 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(t,d)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block","data-opened":o.value},[e.createElementVNode("div",{ref_key:"buttonRef",ref:s},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:r,isExpanded:o.value})))],512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-[9999]",onClick:r})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"menuRef",ref:n,class:e.normalizeClass(["menu",f.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1",style:{display:"none"}},[t.title?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:r})))],2),[[e.vShow,o.value]])]))],8,k))}});exports._sfc_main=x;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { defineComponent as g, ref as i, watch as b, onBeforeUnmount as _, provide as C, computed as R, openBlock as a, createElementBlock as r, createElementVNode as
|
|
1
|
+
import { defineComponent as g, ref as i, watch as b, onBeforeUnmount as _, provide as C, computed as R, openBlock as a, createElementBlock as r, createElementVNode as f, renderSlot as m, normalizeProps as v, guardReactiveProps as x, createBlock as z, Teleport as B, createCommentVNode as w, withDirectives as D, normalizeClass as E, toDisplayString as P, vShow as $ } from "vue";
|
|
2
2
|
import { d as O } from "./dropdown-c81fb945.js";
|
|
3
|
-
import { autoUpdate as S, computePosition as U, offset as A,
|
|
4
|
-
import { flip as N } from "@floating-ui/vue";
|
|
3
|
+
import { autoUpdate as S, computePosition as U, offset as A, flip as L, shift as N } from "@floating-ui/dom";
|
|
5
4
|
const T = ["data-opened"], V = {
|
|
6
5
|
key: 0,
|
|
7
6
|
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
8
|
-
},
|
|
7
|
+
}, F = /* @__PURE__ */ g({
|
|
9
8
|
__name: "OneDropdownAuto",
|
|
10
9
|
props: O,
|
|
11
10
|
emits: ["open", "close"],
|
|
12
11
|
setup(y, { emit: h }) {
|
|
13
12
|
const u = y, t = i(!1), o = i(null), l = i(null);
|
|
14
13
|
let n = null;
|
|
15
|
-
const
|
|
14
|
+
const c = () => {
|
|
16
15
|
!l.value || !o.value || U(l.value, o.value, {
|
|
17
16
|
placement: u.stick ? u.stick : "bottom-start",
|
|
18
17
|
strategy: "fixed",
|
|
19
|
-
middleware: [A(5),
|
|
18
|
+
middleware: [A(5), L(), N({ padding: 8 })]
|
|
20
19
|
}).then(({ x: e, y: d }) => {
|
|
21
20
|
o.value && Object.assign(o.value.style, {
|
|
22
21
|
left: `${e}px`,
|
|
@@ -25,12 +24,12 @@ const T = ["data-opened"], V = {
|
|
|
25
24
|
});
|
|
26
25
|
};
|
|
27
26
|
b(t, (e) => {
|
|
28
|
-
e && l.value && o.value ? (
|
|
27
|
+
e && l.value && o.value ? (c(), n = S(l.value, o.value, c)) : n && (n(), n = null);
|
|
29
28
|
}), _(() => {
|
|
30
29
|
n && n();
|
|
31
30
|
});
|
|
32
|
-
const
|
|
33
|
-
t.value = !t.value, t.value ?
|
|
31
|
+
const p = h, s = () => {
|
|
32
|
+
t.value = !t.value, t.value ? p("open") : p("close");
|
|
34
33
|
};
|
|
35
34
|
C("OneDropdown", {
|
|
36
35
|
onToggle: s
|
|
@@ -44,11 +43,11 @@ const T = ["data-opened"], V = {
|
|
|
44
43
|
class: "relative inline-block",
|
|
45
44
|
"data-opened": t.value
|
|
46
45
|
}, [
|
|
47
|
-
|
|
46
|
+
f("div", {
|
|
48
47
|
ref_key: "buttonRef",
|
|
49
48
|
ref: l
|
|
50
49
|
}, [
|
|
51
|
-
|
|
50
|
+
m(e.$slots, "button", v(x({ onToggle: s, isExpanded: t.value })))
|
|
52
51
|
], 512),
|
|
53
52
|
(a(), z(B, { to: "body" }, [
|
|
54
53
|
t.value ? (a(), r("div", {
|
|
@@ -56,7 +55,7 @@ const T = ["data-opened"], V = {
|
|
|
56
55
|
class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
|
|
57
56
|
onClick: s
|
|
58
57
|
})) : w("", !0),
|
|
59
|
-
D(
|
|
58
|
+
D(f("div", {
|
|
60
59
|
ref_key: "menuRef",
|
|
61
60
|
ref: o,
|
|
62
61
|
class: E(["menu", k.value]),
|
|
@@ -66,7 +65,7 @@ const T = ["data-opened"], V = {
|
|
|
66
65
|
style: { display: "none" }
|
|
67
66
|
}, [
|
|
68
67
|
e.title ? (a(), r("div", V, P(e.title), 1)) : w("", !0),
|
|
69
|
-
|
|
68
|
+
m(e.$slots, "menu", v(x({ onToggle: s })))
|
|
70
69
|
], 2), [
|
|
71
70
|
[$, t.value]
|
|
72
71
|
])
|
|
@@ -75,5 +74,5 @@ const T = ["data-opened"], V = {
|
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
F as _
|
|
79
78
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),V=require("./dropdown-5cb64ab7.cjs"),_=require("@floating-ui/dom"),w=require("./OneAvatar.vue_vue_type_script_setup_true_lang-2d9f44f1.cjs"),B=require("./i18n/index.cjs"),N=require("./XMarkIcon-f94baa4c.cjs"),C=require("./ChevronDownIcon-6889ac87.cjs"),$=require("./ChevronUpIcon-64a673e1.cjs"),D=require("./ChevronRightIcon-2992cf0d.cjs"),j=require("./button/index.cjs"),A=require("./_plugin-vue_export-helper-f246444f.cjs"),O=["data-opened"],q={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},I={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},F=e.defineComponent({__name:"OneDropdown",props:V.dropdownProps,emits:["open","close"],setup(h,{emit:u}){const c=e.ref(!1),d=e.ref(null),v=e.ref(null),s=e.ref(null),r=u,t=h,a=()=>{c.value=!c.value,c.value?r("open"):r("close")};let p=null;const f=()=>{t.trigger==="hover"&&(p&&(clearTimeout(p),p=null),c.value||(c.value=!0,r("open")))},i=()=>{t.trigger==="hover"&&(p=setTimeout(()=>{c.value&&(c.value=!1,r("close"))},100))};e.provide("OneDropdown",{onToggle:a});let m=null;function x(){!v.value||!s.value||_.computePosition(v.value,s.value,{placement:t.stick?t.stick:"bottom-start",strategy:"fixed",middleware:[_.offset(t.offset),_.flip(),_.shift({padding:8})]}).then(({x:o,y:l})=>{s.value&&Object.assign(s.value.style,{left:`${o}px`,top:`${l}px`,visibility:"visible"})})}e.watch(c,async o=>{t.appendBody&&(o?(await e.nextTick(),v.value&&s.value&&(s.value.style.visibility="hidden",x(),m=_.autoUpdate(v.value,s.value,x))):m&&(m(),m=null))}),e.onBeforeUnmount(()=>{m&&m()});const k=e.computed(()=>{var y;if(t.appendBody)return"";const o=(y=d.value)==null?void 0:y.getBoundingClientRect(),l=o?o.x<270:!1;return o&&o.top+270>window.innerHeight?"up"+(l?"-right":"-left"):"down"+(l?"-right":"-left")}),g=e.computed(()=>{const o=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return k.value.startsWith("up")?o.push("bottom-1 mb-10"):k.value.startsWith("down")&&o.push("top-1 mt-10"),t.stick==="right"?o.push("right-0"):t.stick==="left"&&o.push("left-0"),o}),n=e.computed(()=>["fixed z-[10000] 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,l)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"containerRef",ref:d,"data-opened":c.value,onMouseenter:f,onMouseleave:i},[e.createElementVNode("div",{ref_key:"buttonRef",ref:v},[e.renderSlot(o.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:a,isExpanded:c.value})))],512),t.appendBody?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[c.value&&o.trigger==="click"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-[9999]",onClick:a})):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(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"menuRef",ref:s,class:e.normalizeClass(["menu",n.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1",onMouseenter:f,onMouseleave:i},[o.title?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:a})))],34)):e.createCommentVNode("",!0)]),_:3})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value&&o.trigger==="click"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:a})):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(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",g.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[o.title?(e.openBlock(),e.createElementBlock("div",I,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:a})))],2)):e.createCommentVNode("",!0)]),_:3})],64))],40,O))}}),b=e.defineComponent({__name:"OneDropdownItem",props:V.dropdownItemProps,emits:["click"],setup(h,{emit:u}){const c=u,d=h,v=e.inject("OneDropdown"),s=()=>{v!==void 0&&v.onToggle(),c("click")},r=e.computed(()=>{const t=[];return d.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):d.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):d.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):d.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,a)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",r.value]),onClick:e.withModifiers(s,["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 P(h,u){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 T={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},onAccount:{type:Function},onLogout:{type:Function},t:{type:Function}},S={workspace:{type:Object,required:!1},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},onChange:{type:Function},onApp:{type:Function},t:{type:Function}},H={help:{type:Object},helpSlug:{type:String},t:{type:Function}},R=["onClick"],U={class:"flex flex-col items-center pt-5 pb-2 h-full"},W={class:"flex flex-col px-10 py-1 mt-2 text-center"},X={class:"self-center text-base font-medium tracking-wide text-black"},G={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},J={class:"text-left w-full mt-5 px-3"},K={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},Q=e.defineComponent({__name:"OneUserMenu",props:T,setup(h){const u=h,c=B.useOnebI18n(),d=e.computed(()=>u.t??c),v=e.computed(()=>{var t;return(t=u.menu)==null?void 0:t.map(a=>{let p={label:a.label};a.icon!=null&&(p={...p,icon:a.icon});const f=typeof a.click=="function"?a.click:()=>{};return{key:a.label,args:p,click:f}})}),s=()=>{typeof u.onAccount=="function"&&u.onAccount()},r=()=>{typeof u.onLogout=="function"&&u.onLogout()};return(t,a)=>(e.openBlock(),e.createBlock(F,{stick:"right"},{button:e.withCtx(({onToggle:p,isExpanded:f})=>{var i,m;return[e.createElementVNode("button",{type:"button",onClick:p,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[f?"bg-secondary-25":""]])},[e.createVNode(w._sfc_main,{text:((i=t.user)==null?void 0:i.name)||"",size:t.iconSize,src:(m=t.user)==null?void 0:m.photo_url,rounded:!0},null,8,["text","size","src"])],10,R)]}),menu:e.withCtx(()=>{var p,f,i,m,x;return[e.createElementVNode("div",U,[e.createVNode(w._sfc_main,{text:((p=t.user)==null?void 0:p.name)||"",size:80,src:(f=t.user)==null?void 0:f.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",W,[e.createElementVNode("div",X,e.toDisplayString((i=t.user)==null?void 0:i.name),1),e.createElementVNode("div",G,e.toDisplayString((m=t.user)==null?void 0:m.email),1)]),typeof u.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s,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(d.value("ui.layout.account")),1)):e.createCommentVNode("",!0),e.createElementVNode("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,k=>(e.openBlock(),e.createBlock(b,e.mergeProps({key:k.key},{ref_for:!0},k.args,{onClick:k.click}),null,16,["onClick"]))),128)),typeof t.onLogout=="function"?(e.openBlock(),e.createBlock(b,{key:0,icon:e.unref(P),label:d.value("ui.layout.logout"),class:"rounded py-3",onClick:r},null,8,["icon","label"])):e.createCommentVNode("",!0)]),a[0]||(a[0]=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1)),e.createElementVNode("div",K,e.toDisplayString((x=t.app)==null?void 0:x.version),1)])]}),_:1}))}});function M(h,u){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}const Y=["data-opened"],Z={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},ee={class:"flex justify-between items-center pt-3 mb-3"},te={class:"font-semibold text-xl px-3"},oe={class:"grid"},ne={class:"rounded-lg m-3 border"},le={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},re={class:"flex justify-between relative"},se={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},ce={key:0},ae={class:"text-xs font-semibold"},ie={class:"px-3 py-2"},ue={class:"text-secondary-content text-left pb-1 text-xs uppercase"},de={class:"overflow-auto max-h-full"},pe={key:0,class:"space-y-2"},me=["onClick"],he={class:"flex"},fe={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"},ke={class:"text-sm mt-1 font-semibold"},xe={class:"text9 mt-1"},ge={key:1,type:"button",class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},ye=e.defineComponent({__name:"OneBrowserMenu",props:S,emits:["open","close"],setup(h,{emit:u}){const c=u,d=h,v=B.useOnebI18n(),s=e.computed(()=>d.t??v),r=e.ref(!1),t=()=>{r.value=!r.value,r.value?c("open"):c("close")},a=e.ref(!1);e.computed(()=>a.value?$.render:C.render);const p=()=>{typeof d.onChange=="function"&&d.onChange()},f=i=>{typeof d.onApp=="function"&&d.onApp(i)};return(i,m)=>{var x,k,g;return e.openBlock(),e.createElementBlock("div",{"data-opened":r.value},[e.createElementVNode("button",{type:"button",onClick:t,class:e.normalizeClass(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex",{"bg-secondary-10":r.value}])},[e.createVNode(e.unref(M),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",onClick:t})):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,e.toDisplayString(s.value("ui.layout.workspaces")),1),e.createVNode(e.unref(N.render),{class:"w-6 cursor-pointer",onClick:t})]),e.createElementVNode("div",oe,[e.createElementVNode("div",ne,[e.createElementVNode("div",le,[e.createElementVNode("div",re,[e.createVNode(w._sfc_main,{text:((x=i.workspace)==null?void 0:x.name)||"",src:(k=i.workspace)==null?void 0:k.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",se,e.toDisplayString((g=i.workspace)==null?void 0:g.name),1)]),a.value?(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.workspaces,n=>(e.openBlock(),e.createElementBlock("div",{key:n.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(w._sfc_main,{text:n.name,src:n.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",ae,e.toDisplayString(n.name),1)]))),128))])):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("div",{onClick:p,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString(s.value("ui.layout.change_workspace")),1)])]),e.createElementVNode("div",ie,[e.createElementVNode("div",ue,e.toDisplayString(s.value("ui.layout.apps")),1),e.createElementVNode("div",de,[i.apps&&i.apps.length?(e.openBlock(),e.createElementBlock("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.apps,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,onClick:o=>f(n),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",he,[e.createElementVNode("div",fe,[e.createVNode(w._sfc_main,{text:n.name,src:n.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",ve,[e.createElementVNode("p",ke,e.toDisplayString(n.name),1),e.createElementVNode("p",xe,e.toDisplayString(n==null?void 0:n.short),1)])]),e.createElementVNode("div",null,[e.createVNode(j.OneButton,{variant:"touch",icon:e.unref(D.render),onClick:o=>f(n)},null,8,["icon","onClick"])])],8,me))),128))])):e.createCommentVNode("",!0),i.apps&&i.apps.length?(e.openBlock(),e.createElementBlock("button",ge,e.toDisplayString(s.value("ui.layout.view_all")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,Y)}}});const _e=A._export_sfc(ye,[["__scopeId","data-v-46157886"]]);function E(h,u){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 we(h,u){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 z(h,u){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"})])}function L(h,u){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.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})])}function be(h,u){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:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})])}const Be=["data-opened"],Ee={key:1,class:"absolute top-0 right-0 h-screen max-w-96 bg-white px-3 z-10 flex flex-col"},Ve={class:"flex justify-between items-center pt-3 mb-3"},Ne={class:"font-semibold text-xl px-3"},Ce={key:0,class:"grid grid-cols-3 bg-[#FAFAFA] rounded-xl text-[#525B66] mb-2"},$e=["onClick"],Ae={class:"uppercase text-[8px]"},Fe={class:"overflow-y-auto grid rounded-xl"},Se={class:"max-h-full bg-[#FAFAFA]"},Me={key:0,class:"space-y-2"},ze=["onClick"],Le={class:"flex"},De={class:"pl-2"},je={class:"text-sm mt-1 font-semibold"},Oe={class:"text-[10px] mt-1 text-[#979CA9]"},qe={class:"mt-auto"},Ie={key:0},Pe=["onClick"],Te={class:"flex items-center space-x-3"},He={class:"h-16"},Re={key:0,class:"bg-[#FAFAFA] rounded-lg p-3"},Ue={class:"flex justify-between"},We=["onClick"],Xe={key:0,class:"tooltip-text min-w-[70px]"},Ge={class:"flex justify-between mb-4"},Je=["href"],Ke={class:"flex flex-nowrap items-center w-max h-[24px]"},Qe={class:"whitespace-nowrap overflow-hidden text-ellipsis text-left flex-shrink w-full text-[#525B66]"},Ye={class:"py-[8px] pl-0 pr-[8px]"},Ze=e.defineComponent({__name:"OneHelpMenu",props:H,emits:["open","close"],setup(h,{emit:u}){const c=u,d=h,v=B.useOnebI18n(),s=e.computed(()=>d.t??v),r=e.computed(()=>{const n=d.help??{};return{label:n.label??s.value("ui.help.title"),social:n.social??s.value("ui.help.social"),socialButt:n.socialButt??s.value("ui.help.social"),buttMore:n.buttMore??s.value("ui.help.more"),buttNoMore:n.buttNoMore??s.value("ui.help.hide"),helpButton:n.helpButton??[{name:s.value("ui.help.support"),link:"https://t.me/onebapp_bot",icon:L},{name:s.value("ui.help.reference"),link:d.helpSlug?`https://oneb.app/help/${d.helpSlug}`:"https://oneb.app/help",icon:E},{name:s.value("ui.help.leave_request"),link:"https://oneb.app/support",icon:be}],helpList:n.helpList??[],video:n.video??[],socialList:n.socialList??[],termsOffer:n.termsOffer??[{name:s.value("ui.help.terms"),link:"https://oneb.app/terms-of-service"},{name:s.value("ui.help.offer"),link:"https://oneb.app/offer"}]}}),t=e.ref(!1),a=()=>{t.value=!t.value,t.value?c("open"):c("close")},p=e.computed(()=>k.value?$.render:C.render),f=e.ref(3),i=e.computed(()=>{var o;const n=((o=r.value.helpList)==null?void 0:o.length)||0;return f.value===n});e.computed(()=>(r.value.helpList||[]).slice(0,f.value));const m=()=>{var o;const n=((o=r.value.helpList)==null?void 0:o.length)||0;f.value=i.value?3:n},x=(n,o)=>{n&&o&&typeof o.openLink=="function"?o.openLink(o):n&&window.open(n,"_blank")},k=e.ref(!1),g=()=>{k.value=!k.value};return(n,o)=>(e.openBlock(),e.createElementBlock("div",{"data-opened":t.value},[e.createElementVNode("button",{type:"button",onClick:a,class:e.normalizeClass(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex",{"bg-secondary-10":t.value}])},[e.createVNode(e.unref(E),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),t.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:a})):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,e.toDisplayString(r.value.label),1),e.createVNode(e.unref(N.render),{class:"w-6 cursor-pointer",onClick:a})]),r.value.helpButton?(e.openBlock(),e.createElementBlock("div",Ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.helpButton,l=>(e.openBlock(),e.createElementBlock("button",{type:"button",key:l.name,onClick:y=>x(l.link,l),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",Ae,e.toDisplayString(l.name),1)],8,$e))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Fe,[e.createElementVNode("div",Se,[r.value.helpList&&r.value.helpList.length?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.helpList,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,onClick:y=>x(l.link,l),class:"flex justify-between items-center rounded-lg hover:bg-slate-100 p-2 cursor-pointer hover:text-[#4089E0]"},[e.createElementVNode("div",Le,[e.createElementVNode("div",De,[e.createElementVNode("p",je,e.toDisplayString(l.name),1),e.createElementVNode("p",Oe,e.toDisplayString(l.category),1)])])],8,ze))),128))])):e.createCommentVNode("",!0)])]),r.value.helpList&&r.value.helpList.length<0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",onClick:m,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(i.value?r.value.buttNoMore:r.value.buttMore),1)):e.createCommentVNode("",!0),e.createElementVNode("div",qe,[r.value.video?(e.openBlock(),e.createElementBlock("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.video,l=>(e.openBlock(),e.createElementBlock("button",{type:"button",key:l.id,onClick:y=>x(l.link,l),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(we),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(l.name),1)],8,Pe))),128))])):e.createCommentVNode("",!0),r.value.socialList?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",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",Te,[e.createVNode(e.unref(z),{class:"w-6 h-6"}),e.createElementVNode("span",null,e.toDisplayString(r.value.socialButt),1)]),e.createVNode(e.unref(p),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),e.createElementVNode("div",He,[k.value?(e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.socialList,l=>(e.openBlock(),e.createElementBlock("button",{type:"button",key:l.id,onClick:y=>x(l.link,l),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",Xe,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,We))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.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",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("span",Ye,e.toDisplayString(l.name),1)])])],8,Je))),128))])])])):e.createCommentVNode("",!0)],8,Be))}});const et=A._export_sfc(Ze,[["__scopeId","data-v-78263033"]]);exports.OneBrowserMenu=_e;exports.OneHelpMenu=et;exports._sfc_main=F;exports._sfc_main$1=b;exports._sfc_main$2=Q;exports.browserMenuProps=S;exports.render=M;exports.render$1=z;exports.render$2=L;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineComponent as S, ref as F, provide as J, watch as K, nextTick as Q, onBeforeUnmount as X, computed as C, openBlock as t, createElementBlock as o, createElementVNode as e, renderSlot as E, normalizeProps as H, guardReactiveProps as P, createBlock as B, Teleport as Y, createCommentVNode as h, createVNode as
|
|
1
|
+
import { defineComponent as S, ref as F, provide as J, watch as K, nextTick as Q, onBeforeUnmount as X, computed as C, openBlock as t, createElementBlock as o, createElementVNode as e, renderSlot as E, normalizeProps as H, guardReactiveProps as P, createBlock as B, Teleport as Y, createCommentVNode as h, createVNode as g, Transition as R, withCtx as T, normalizeClass as L, toDisplayString as d, Fragment as $, inject as Z, withModifiers as ee, resolveDynamicComponent as I, renderList as M, mergeProps as te, unref as A } from "vue";
|
|
2
2
|
import { d as oe, a as ne } from "./dropdown-c81fb945.js";
|
|
3
|
-
import { autoUpdate as se, computePosition as le, offset as re,
|
|
4
|
-
import { flip as ae } from "@floating-ui/vue";
|
|
3
|
+
import { autoUpdate as se, computePosition as le, offset as re, flip as ie, shift as ae } from "@floating-ui/dom";
|
|
5
4
|
import { _ as O } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
|
|
6
5
|
import { useOnebI18n as V } from "./i18n/index.js";
|
|
7
6
|
import { r as q } from "./XMarkIcon-51ef0691.js";
|
|
@@ -25,7 +24,7 @@ const de = ["data-opened"], pe = {
|
|
|
25
24
|
c.value = !c.value, c.value ? i("open") : i("close");
|
|
26
25
|
};
|
|
27
26
|
let m = null;
|
|
28
|
-
const
|
|
27
|
+
const y = () => {
|
|
29
28
|
n.trigger === "hover" && (m && (clearTimeout(m), m = null), c.value || (c.value = !0, i("open")));
|
|
30
29
|
}, p = () => {
|
|
31
30
|
n.trigger === "hover" && (m = setTimeout(() => {
|
|
@@ -40,7 +39,7 @@ const de = ["data-opened"], pe = {
|
|
|
40
39
|
!w.value || !a.value || le(w.value, a.value, {
|
|
41
40
|
placement: n.stick ? n.stick : "bottom-start",
|
|
42
41
|
strategy: "fixed",
|
|
43
|
-
middleware: [re(n.offset),
|
|
42
|
+
middleware: [re(n.offset), ie(), ae({ padding: 8 })]
|
|
44
43
|
}).then(({ x: s, y: r }) => {
|
|
45
44
|
a.value && Object.assign(a.value.style, {
|
|
46
45
|
left: `${s}px`,
|
|
@@ -77,7 +76,7 @@ const de = ["data-opened"], pe = {
|
|
|
77
76
|
ref_key: "containerRef",
|
|
78
77
|
ref: v,
|
|
79
78
|
"data-opened": c.value,
|
|
80
|
-
onMouseenter:
|
|
79
|
+
onMouseenter: y,
|
|
81
80
|
onMouseleave: p
|
|
82
81
|
}, [
|
|
83
82
|
e("div", {
|
|
@@ -95,7 +94,7 @@ const de = ["data-opened"], pe = {
|
|
|
95
94
|
class: "fixed top-0 left-0 w-screen h-screen z-[9999]",
|
|
96
95
|
onClick: u
|
|
97
96
|
})) : h("", !0),
|
|
98
|
-
|
|
97
|
+
g(R, {
|
|
99
98
|
"enter-active-class": "transition ease-out duration-100",
|
|
100
99
|
"enter-from-class": "transform opacity-0 scale-95",
|
|
101
100
|
"enter-to-class": "transform opacity-100 scale-100",
|
|
@@ -112,7 +111,7 @@ const de = ["data-opened"], pe = {
|
|
|
112
111
|
role: "menu",
|
|
113
112
|
"aria-orientation": "vertical",
|
|
114
113
|
tabindex: "-1",
|
|
115
|
-
onMouseenter:
|
|
114
|
+
onMouseenter: y,
|
|
116
115
|
onMouseleave: p
|
|
117
116
|
}, [
|
|
118
117
|
s.title ? (t(), o("div", pe, d(s.title), 1)) : h("", !0),
|
|
@@ -127,7 +126,7 @@ const de = ["data-opened"], pe = {
|
|
|
127
126
|
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
128
127
|
onClick: u
|
|
129
128
|
})) : h("", !0),
|
|
130
|
-
|
|
129
|
+
g(R, {
|
|
131
130
|
"enter-active-class": "transition ease-out duration-100",
|
|
132
131
|
"enter-from-class": "transform opacity-0 scale-95",
|
|
133
132
|
"enter-to-class": "transform opacity-100 scale-100",
|
|
@@ -164,6 +163,7 @@ const de = ["data-opened"], pe = {
|
|
|
164
163
|
return v.variant === "secondary" ? n.push("text-secondary-content hover:bg-secondary-body-hover") : v.variant === "danger" ? n.push("text-danger-content hover:bg-danger-10") : v.variant === "warning" ? n.push("text-warning-content hover:bg-warning-10") : v.variant === "info" ? n.push("text-info-content hover:bg-info-10") : n.push("hover:bg-secondary-body-hover"), n;
|
|
165
164
|
});
|
|
166
165
|
return (n, u) => (t(), o("button", {
|
|
166
|
+
type: "button",
|
|
167
167
|
class: L(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", i.value]),
|
|
168
168
|
onClick: ee(a, ["prevent"])
|
|
169
169
|
}, [
|
|
@@ -253,7 +253,7 @@ const me = {
|
|
|
253
253
|
t: {
|
|
254
254
|
type: Function
|
|
255
255
|
}
|
|
256
|
-
},
|
|
256
|
+
}, ye = ["onClick"], ge = { class: "flex flex-col items-center pt-5 pb-2 h-full" }, we = { class: "flex flex-col px-10 py-1 mt-2 text-center" }, ke = { class: "self-center text-base font-medium tracking-wide text-black" }, be = { class: "mt-1 text-xs leading-5 text-blue-500 font-light" }, Ce = { class: "text-left w-full mt-5 px-3" }, $e = { class: "-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400" }, Rt = /* @__PURE__ */ S({
|
|
257
257
|
__name: "OneUserMenu",
|
|
258
258
|
props: me,
|
|
259
259
|
setup(_) {
|
|
@@ -262,12 +262,12 @@ const me = {
|
|
|
262
262
|
return (n = f.menu) == null ? void 0 : n.map((u) => {
|
|
263
263
|
let m = { label: u.label };
|
|
264
264
|
u.icon != null && (m = { ...m, icon: u.icon });
|
|
265
|
-
const
|
|
265
|
+
const y = typeof u.click == "function" ? u.click : () => {
|
|
266
266
|
};
|
|
267
267
|
return {
|
|
268
268
|
key: u.label,
|
|
269
269
|
args: m,
|
|
270
|
-
click:
|
|
270
|
+
click: y
|
|
271
271
|
};
|
|
272
272
|
});
|
|
273
273
|
}), a = () => {
|
|
@@ -276,30 +276,31 @@ const me = {
|
|
|
276
276
|
typeof f.onLogout == "function" && f.onLogout();
|
|
277
277
|
};
|
|
278
278
|
return (n, u) => (t(), B(fe, { stick: "right" }, {
|
|
279
|
-
button: T(({ onToggle: m, isExpanded:
|
|
279
|
+
button: T(({ onToggle: m, isExpanded: y }) => {
|
|
280
280
|
var p, x;
|
|
281
281
|
return [
|
|
282
282
|
e("button", {
|
|
283
|
+
type: "button",
|
|
283
284
|
onClick: m,
|
|
284
|
-
class: L(["p-1 rounded-full hover:bg-secondary-10", [
|
|
285
|
+
class: L(["p-1 rounded-full hover:bg-secondary-10", [y ? "bg-secondary-25" : ""]])
|
|
285
286
|
}, [
|
|
286
|
-
|
|
287
|
+
g(O, {
|
|
287
288
|
text: ((p = n.user) == null ? void 0 : p.name) || "",
|
|
288
289
|
size: n.iconSize,
|
|
289
290
|
src: (x = n.user) == null ? void 0 : x.photo_url,
|
|
290
291
|
rounded: !0
|
|
291
292
|
}, null, 8, ["text", "size", "src"])
|
|
292
|
-
], 10,
|
|
293
|
+
], 10, ye)
|
|
293
294
|
];
|
|
294
295
|
}),
|
|
295
296
|
menu: T(() => {
|
|
296
|
-
var m,
|
|
297
|
+
var m, y, p, x, b;
|
|
297
298
|
return [
|
|
298
|
-
e("div",
|
|
299
|
-
|
|
299
|
+
e("div", ge, [
|
|
300
|
+
g(O, {
|
|
300
301
|
text: ((m = n.user) == null ? void 0 : m.name) || "",
|
|
301
302
|
size: 80,
|
|
302
|
-
src: (
|
|
303
|
+
src: (y = n.user) == null ? void 0 : y.photo_url,
|
|
303
304
|
rounded: !0,
|
|
304
305
|
class: "mx-auto"
|
|
305
306
|
}, null, 8, ["text", "src"]),
|
|
@@ -441,6 +442,7 @@ const Fe = ["data-opened"], Me = {
|
|
|
441
442
|
class: "space-y-2"
|
|
442
443
|
}, De = ["onClick"], Ne = { class: "flex" }, qe = { class: "border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center" }, Ue = { class: "pl-2" }, We = { class: "text-sm mt-1 font-semibold" }, Ge = { class: "text9 mt-1" }, Je = {
|
|
443
444
|
key: 1,
|
|
445
|
+
type: "button",
|
|
444
446
|
class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"
|
|
445
447
|
}, Ke = /* @__PURE__ */ S({
|
|
446
448
|
__name: "OneBrowserMenu",
|
|
@@ -453,17 +455,18 @@ const Fe = ["data-opened"], Me = {
|
|
|
453
455
|
C(() => u.value ? W : U);
|
|
454
456
|
const m = () => {
|
|
455
457
|
typeof v.onChange == "function" && v.onChange();
|
|
456
|
-
},
|
|
458
|
+
}, y = (p) => {
|
|
457
459
|
typeof v.onApp == "function" && v.onApp(p);
|
|
458
460
|
};
|
|
459
461
|
return (p, x) => {
|
|
460
462
|
var b, k, z;
|
|
461
463
|
return t(), o("div", { "data-opened": i.value }, [
|
|
462
464
|
e("button", {
|
|
465
|
+
type: "button",
|
|
463
466
|
onClick: n,
|
|
464
467
|
class: L(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex", { "bg-secondary-10": i.value }])
|
|
465
468
|
}, [
|
|
466
|
-
|
|
469
|
+
g(A(Ae), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
|
|
467
470
|
], 2),
|
|
468
471
|
i.value ? (t(), o("div", {
|
|
469
472
|
key: 0,
|
|
@@ -473,7 +476,7 @@ const Fe = ["data-opened"], Me = {
|
|
|
473
476
|
i.value ? (t(), o("div", Me, [
|
|
474
477
|
e("div", Be, [
|
|
475
478
|
e("div", ze, d(a.value("ui.layout.workspaces")), 1),
|
|
476
|
-
|
|
479
|
+
g(A(q), {
|
|
477
480
|
class: "w-6 cursor-pointer",
|
|
478
481
|
onClick: n
|
|
479
482
|
})
|
|
@@ -482,7 +485,7 @@ const Fe = ["data-opened"], Me = {
|
|
|
482
485
|
e("div", Le, [
|
|
483
486
|
e("div", Oe, [
|
|
484
487
|
e("div", Se, [
|
|
485
|
-
|
|
488
|
+
g(O, {
|
|
486
489
|
text: ((b = p.workspace) == null ? void 0 : b.name) || "",
|
|
487
490
|
src: (k = p.workspace) == null ? void 0 : k.photo_url,
|
|
488
491
|
size: 44,
|
|
@@ -497,7 +500,7 @@ const Fe = ["data-opened"], Me = {
|
|
|
497
500
|
key: l.name,
|
|
498
501
|
class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
|
|
499
502
|
}, [
|
|
500
|
-
|
|
503
|
+
g(O, {
|
|
501
504
|
text: l.name,
|
|
502
505
|
src: l.photo_url,
|
|
503
506
|
size: 30,
|
|
@@ -520,12 +523,12 @@ const Fe = ["data-opened"], Me = {
|
|
|
520
523
|
p.apps && p.apps.length ? (t(), o("div", Re, [
|
|
521
524
|
(t(!0), o($, null, M(p.apps, (l) => (t(), o("div", {
|
|
522
525
|
key: l.id,
|
|
523
|
-
onClick: (s) =>
|
|
526
|
+
onClick: (s) => y(l),
|
|
524
527
|
class: "flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"
|
|
525
528
|
}, [
|
|
526
529
|
e("div", Ne, [
|
|
527
530
|
e("div", qe, [
|
|
528
|
-
|
|
531
|
+
g(O, {
|
|
529
532
|
text: l.name,
|
|
530
533
|
src: l.photo_url,
|
|
531
534
|
size: 44,
|
|
@@ -538,10 +541,10 @@ const Fe = ["data-opened"], Me = {
|
|
|
538
541
|
])
|
|
539
542
|
]),
|
|
540
543
|
e("div", null, [
|
|
541
|
-
|
|
544
|
+
g(ue, {
|
|
542
545
|
variant: "touch",
|
|
543
546
|
icon: A(ce),
|
|
544
|
-
onClick: (s) =>
|
|
547
|
+
onClick: (s) => y(l)
|
|
545
548
|
}, null, 8, ["icon", "onClick"])
|
|
546
549
|
])
|
|
547
550
|
], 8, De))), 128))
|
|
@@ -554,7 +557,7 @@ const Fe = ["data-opened"], Me = {
|
|
|
554
557
|
};
|
|
555
558
|
}
|
|
556
559
|
});
|
|
557
|
-
const
|
|
560
|
+
const Dt = /* @__PURE__ */ G(Ke, [["__scopeId", "data-v-46157886"]]);
|
|
558
561
|
function N(_, f) {
|
|
559
562
|
return t(), o("svg", {
|
|
560
563
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -649,7 +652,7 @@ const et = ["data-opened"], tt = {
|
|
|
649
652
|
}, lt = ["onClick"], rt = { class: "uppercase text-[8px]" }, it = { class: "overflow-y-auto grid rounded-xl" }, at = { class: "max-h-full bg-[#FAFAFA]" }, ct = {
|
|
650
653
|
key: 0,
|
|
651
654
|
class: "space-y-2"
|
|
652
|
-
}, ut = ["onClick"], dt = { class: "flex" }, pt = { class: "pl-2" }, ht = { class: "text-sm mt-1 font-semibold" }, ft = { class: "text-[10px] mt-1 text-[#979CA9]" }, vt = { class: "mt-auto" }, mt = { key: 0 }, xt = ["onClick"], _t = { class: "flex items-center space-x-3" },
|
|
655
|
+
}, ut = ["onClick"], dt = { class: "flex" }, pt = { class: "pl-2" }, ht = { class: "text-sm mt-1 font-semibold" }, ft = { class: "text-[10px] mt-1 text-[#979CA9]" }, vt = { class: "mt-auto" }, mt = { key: 0 }, xt = ["onClick"], _t = { class: "flex items-center space-x-3" }, yt = { class: "h-16" }, gt = {
|
|
653
656
|
key: 0,
|
|
654
657
|
class: "bg-[#FAFAFA] rounded-lg p-3"
|
|
655
658
|
}, wt = { class: "flex justify-between" }, kt = ["onClick"], bt = {
|
|
@@ -669,13 +672,21 @@ const et = ["data-opened"], tt = {
|
|
|
669
672
|
buttMore: l.buttMore ?? a.value("ui.help.more"),
|
|
670
673
|
buttNoMore: l.buttNoMore ?? a.value("ui.help.hide"),
|
|
671
674
|
helpButton: l.helpButton ?? [
|
|
672
|
-
{
|
|
675
|
+
{
|
|
676
|
+
name: a.value("ui.help.support"),
|
|
677
|
+
link: "https://t.me/onebapp_bot",
|
|
678
|
+
icon: Ye
|
|
679
|
+
},
|
|
673
680
|
{
|
|
674
681
|
name: a.value("ui.help.reference"),
|
|
675
682
|
link: v.helpSlug ? `https://oneb.app/help/${v.helpSlug}` : "https://oneb.app/help",
|
|
676
683
|
icon: N
|
|
677
684
|
},
|
|
678
|
-
{
|
|
685
|
+
{
|
|
686
|
+
name: a.value("ui.help.leave_request"),
|
|
687
|
+
link: "https://oneb.app/support",
|
|
688
|
+
icon: Ze
|
|
689
|
+
}
|
|
679
690
|
],
|
|
680
691
|
helpList: l.helpList ?? [],
|
|
681
692
|
video: l.video ?? [],
|
|
@@ -687,16 +698,16 @@ const et = ["data-opened"], tt = {
|
|
|
687
698
|
};
|
|
688
699
|
}), n = F(!1), u = () => {
|
|
689
700
|
n.value = !n.value, n.value ? c("open") : c("close");
|
|
690
|
-
}, m = C(() => k.value ? W : U),
|
|
701
|
+
}, m = C(() => k.value ? W : U), y = F(3), p = C(() => {
|
|
691
702
|
var s;
|
|
692
703
|
const l = ((s = i.value.helpList) == null ? void 0 : s.length) || 0;
|
|
693
|
-
return
|
|
704
|
+
return y.value === l;
|
|
694
705
|
});
|
|
695
|
-
C(() => (i.value.helpList || []).slice(0,
|
|
706
|
+
C(() => (i.value.helpList || []).slice(0, y.value));
|
|
696
707
|
const x = () => {
|
|
697
708
|
var s;
|
|
698
709
|
const l = ((s = i.value.helpList) == null ? void 0 : s.length) || 0;
|
|
699
|
-
|
|
710
|
+
y.value = p.value ? 3 : l;
|
|
700
711
|
}, b = (l, s) => {
|
|
701
712
|
l && s && typeof s.openLink == "function" ? s.openLink(s) : l && window.open(l, "_blank");
|
|
702
713
|
}, k = F(!1), z = () => {
|
|
@@ -704,10 +715,11 @@ const et = ["data-opened"], tt = {
|
|
|
704
715
|
};
|
|
705
716
|
return (l, s) => (t(), o("div", { "data-opened": n.value }, [
|
|
706
717
|
e("button", {
|
|
718
|
+
type: "button",
|
|
707
719
|
onClick: u,
|
|
708
720
|
class: L(["sm:p-1 sm:w-[44px] sm:h-[44px] w-8 h-8 rounded-md hover:bg-secondary-10 flex", { "bg-secondary-10": n.value }])
|
|
709
721
|
}, [
|
|
710
|
-
|
|
722
|
+
g(A(N), { class: "text-secondary-base w-full p-1 hover:text-blue-600 m-auto" })
|
|
711
723
|
], 2),
|
|
712
724
|
n.value ? (t(), o("div", {
|
|
713
725
|
key: 0,
|
|
@@ -717,13 +729,14 @@ const et = ["data-opened"], tt = {
|
|
|
717
729
|
n.value ? (t(), o("div", tt, [
|
|
718
730
|
e("div", ot, [
|
|
719
731
|
e("div", nt, d(i.value.label), 1),
|
|
720
|
-
|
|
732
|
+
g(A(q), {
|
|
721
733
|
class: "w-6 cursor-pointer",
|
|
722
734
|
onClick: u
|
|
723
735
|
})
|
|
724
736
|
]),
|
|
725
737
|
i.value.helpButton ? (t(), o("div", st, [
|
|
726
738
|
(t(!0), o($, null, M(i.value.helpButton, (r) => (t(), o("button", {
|
|
739
|
+
type: "button",
|
|
727
740
|
key: r.name,
|
|
728
741
|
onClick: (j) => b(r.link, r),
|
|
729
742
|
class: "grid justify-center space-y-2 hover:bg-slate-100 p-3 rounded-xl hover:text-blue-500"
|
|
@@ -754,35 +767,39 @@ const et = ["data-opened"], tt = {
|
|
|
754
767
|
]),
|
|
755
768
|
i.value.helpList && i.value.helpList.length < 0 ? (t(), o("button", {
|
|
756
769
|
key: 1,
|
|
770
|
+
type: "button",
|
|
757
771
|
onClick: x,
|
|
758
772
|
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"
|
|
759
773
|
}, d(p.value ? i.value.buttNoMore : i.value.buttMore), 1)) : h("", !0),
|
|
760
774
|
e("div", vt, [
|
|
761
775
|
i.value.video ? (t(), o("div", mt, [
|
|
762
776
|
(t(!0), o($, null, M(i.value.video, (r) => (t(), o("button", {
|
|
777
|
+
type: "button",
|
|
763
778
|
key: r.id,
|
|
764
779
|
onClick: (j) => b(r.link, r),
|
|
765
780
|
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"
|
|
766
781
|
}, [
|
|
767
|
-
|
|
782
|
+
g(A(Qe), { class: "w-6 h-6" }),
|
|
768
783
|
e("span", null, d(r.name), 1)
|
|
769
784
|
], 8, xt))), 128))
|
|
770
785
|
])) : h("", !0),
|
|
771
786
|
i.value.socialList ? (t(), o("button", {
|
|
772
787
|
key: 1,
|
|
788
|
+
type: "button",
|
|
773
789
|
onClick: z,
|
|
774
790
|
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"
|
|
775
791
|
}, [
|
|
776
792
|
e("div", _t, [
|
|
777
|
-
|
|
793
|
+
g(A(Xe), { class: "w-6 h-6" }),
|
|
778
794
|
e("span", null, d(i.value.socialButt), 1)
|
|
779
795
|
]),
|
|
780
|
-
|
|
796
|
+
g(A(m), { class: "w-4 h-4" })
|
|
781
797
|
])) : h("", !0),
|
|
782
|
-
e("div",
|
|
783
|
-
k.value ? (t(), o("div",
|
|
798
|
+
e("div", yt, [
|
|
799
|
+
k.value ? (t(), o("div", gt, [
|
|
784
800
|
e("div", wt, [
|
|
785
801
|
(t(!0), o($, null, M(i.value.socialList, (r) => (t(), o("button", {
|
|
802
|
+
type: "button",
|
|
786
803
|
key: r.id,
|
|
787
804
|
onClick: (j) => b(r.link, r),
|
|
788
805
|
class: "flex items-center space-x-2 p-2 rounded-lg hover:bg-slate-100 hover:text-blue-500 tooltip"
|
|
@@ -814,13 +831,13 @@ const et = ["data-opened"], tt = {
|
|
|
814
831
|
], 8, et));
|
|
815
832
|
}
|
|
816
833
|
});
|
|
817
|
-
const
|
|
834
|
+
const Nt = /* @__PURE__ */ G(Bt, [["__scopeId", "data-v-78263033"]]);
|
|
818
835
|
export {
|
|
819
|
-
|
|
836
|
+
Dt as O,
|
|
820
837
|
fe as _,
|
|
821
838
|
D as a,
|
|
822
|
-
|
|
823
|
-
|
|
839
|
+
Rt as b,
|
|
840
|
+
Nt as c,
|
|
824
841
|
xe as d,
|
|
825
842
|
Xe as e,
|
|
826
843
|
Ye as f,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r={buttons:{type:Array,default:[]},modelValue:{required:!1,type:[String,Number,Array,Boolean,Object,null]}},u={class:"flex text-xs space-x-0.5 bg-gray-100 p-0.5 rounded-md"},a=["onClick"],s=e.defineComponent({__name:"OneButtonGroup",props:r,emits:["update:modelValue"],setup(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r={buttons:{type:Array,default:[]},modelValue:{required:!1,type:[String,Number,Array,Boolean,Object,null]}},u={class:"flex text-xs space-x-0.5 bg-gray-100 p-0.5 rounded-md"},a=["onClick"],s=e.defineComponent({__name:"OneButtonGroup",props:r,emits:["update:modelValue"],setup(p,{emit:l}){const n=l;return(o,c)=>(e.openBlock(),e.createElementBlock("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.buttons,t=>(e.openBlock(),e.createElementBlock("button",{type:"button",key:t.key,class:e.normalizeClass([{"bg-white":t.key==o.modelValue,"text-blue-600":t.key==o.modelValue},"h-[32px] w-full transition-all px-3 rounded-md hover:text-blue-600"]),onClick:i=>n("update:modelValue",t.key)},e.toDisplayString(t.label),11,a))),128))]))}});exports.OneButtonGroup=s;
|
|
@@ -8,24 +8,25 @@ const i = {
|
|
|
8
8
|
required: !1,
|
|
9
9
|
type: [String, Number, Array, Boolean, Object, null]
|
|
10
10
|
}
|
|
11
|
-
}, m = { class: "flex text-xs space-x-0.5 bg-gray-100 p-0.5 rounded-md" }, c = ["onClick"],
|
|
11
|
+
}, m = { class: "flex text-xs space-x-0.5 bg-gray-100 p-0.5 rounded-md" }, c = ["onClick"], f = /* @__PURE__ */ s({
|
|
12
12
|
__name: "OneButtonGroup",
|
|
13
13
|
props: i,
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(y, { emit:
|
|
16
|
-
const
|
|
15
|
+
setup(y, { emit: n }) {
|
|
16
|
+
const r = n;
|
|
17
17
|
return (t, k) => (o(), l("div", m, [
|
|
18
18
|
(o(!0), l(a, null, u(t.buttons, (e) => (o(), l("button", {
|
|
19
|
+
type: "button",
|
|
19
20
|
key: e.key,
|
|
20
21
|
class: p([{
|
|
21
22
|
"bg-white": e.key == t.modelValue,
|
|
22
23
|
"text-blue-600": e.key == t.modelValue
|
|
23
24
|
}, "h-[32px] w-full transition-all px-3 rounded-md hover:text-blue-600"]),
|
|
24
|
-
onClick: (_) =>
|
|
25
|
+
onClick: (_) => r("update:modelValue", e.key)
|
|
25
26
|
}, d(e.label), 11, c))), 128))
|
|
26
27
|
]));
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
f as OneButtonGroup
|
|
31
32
|
};
|