@oneb/ui-vue 0.0.8 → 0.0.9
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/card/index.cjs +1 -1
- package/dist/card/index.js +24 -22
- package/dist/common/avatar.d.ts +21 -0
- package/dist/common/index.cjs +1 -0
- package/dist/common/index.d.ts +2 -0
- package/dist/common/index.js +72 -0
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +450 -8
- package/dist/form/form.d.ts +1 -1
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +140 -135
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +15 -14
- package/package.json +5 -1
- package/dist/index-8ee43fa4.js +0 -519
- package/dist/index-f88ecb85.cjs +0 -1
package/dist/card/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../_plugin-vue_export-helper-f246444f.cjs"),n={},s={class:"mb-4 bg-white border border-block rounded"};function c(r,t){return e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(r.$slots,"default")])}const d=o._export_sfc(n,[["render",c]]),l={},a={class:"p-3"};function i(r,t){return e.openBlock(),e.createElementBlock("div",a,[e.renderSlot(r.$slots,"default")])}const _=o._export_sfc(l,[["render",i]]),p={title:{type:String,required:!1},description:{type:String,required:!1}},u={class:"p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke"},f={class:"w-full"},m={key:0,class:"text-lg font-medium"},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../_plugin-vue_export-helper-f246444f.cjs"),n={},s={class:"mb-4 bg-white border border-block rounded"};function c(r,t){return e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(r.$slots,"default")])}const d=o._export_sfc(n,[["render",c]]),l={},a={class:"p-3 xl:p-6 space-y-3 xl:space-y-4"};function i(r,t){return e.openBlock(),e.createElementBlock("div",a,[e.renderSlot(r.$slots,"default")])}const _=o._export_sfc(l,[["render",i]]),p={title:{type:String,required:!1},description:{type:String,required:!1}},u={class:"p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke"},f={class:"w-full"},m={key:0,class:"text-lg font-medium"},y={key:1,class:"text-xs text-gray-700 pt-2"},k={class:"flex items-center space-x-2"},b=e.defineComponent({__name:"OneCardHeader",props:p,setup(r){return(t,C)=>(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",f,[t.title?(e.openBlock(),e.createElementBlock("p",m,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",k,[e.renderSlot(t.$slots,"default")])]))}}),h={},B={class:"p-3 xl:p-6 rounded-b border-t border-secondary-stroke"},x={class:"flex items-center justify-end space-x-3"};function $(r,t){return e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",x,[e.renderSlot(r.$slots,"default")])])}const g=o._export_sfc(h,[["render",$]]);exports.OneCard=d;exports.OneCardBody=_;exports.OneCardFooter=g;exports.OneCardHeader=b;
|
package/dist/card/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { openBlock as s, createElementBlock as r, renderSlot as o, defineComponent as i, createElementVNode as n, toDisplayString as d, createCommentVNode as a } from "vue";
|
|
2
|
+
import { _ as c } from "../_plugin-vue_export-helper-dad06003.js";
|
|
3
3
|
const _ = {}, l = { class: "mb-4 bg-white border border-block rounded" };
|
|
4
4
|
function p(t, e) {
|
|
5
|
-
return
|
|
5
|
+
return s(), r("div", l, [
|
|
6
6
|
o(t.$slots, "default")
|
|
7
7
|
]);
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const H = /* @__PURE__ */ c(_, [["render", p]]), f = {}, u = { class: "p-3 xl:p-6 space-y-3 xl:space-y-4" };
|
|
10
10
|
function m(t, e) {
|
|
11
|
-
return
|
|
11
|
+
return s(), r("div", u, [
|
|
12
12
|
o(t.$slots, "default")
|
|
13
13
|
]);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const j = /* @__PURE__ */ c(f, [["render", m]]), h = {
|
|
16
16
|
title: {
|
|
17
17
|
type: String,
|
|
18
18
|
required: !1
|
|
@@ -21,36 +21,38 @@ const H = /* @__PURE__ */ n(f, [["render", m]]), b = {
|
|
|
21
21
|
type: String,
|
|
22
22
|
required: !1
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, y = { class: "p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke" }, b = { class: "w-full" }, $ = {
|
|
25
25
|
key: 0,
|
|
26
26
|
class: "text-lg font-medium"
|
|
27
|
-
},
|
|
27
|
+
}, x = {
|
|
28
28
|
key: 1,
|
|
29
29
|
class: "text-xs text-gray-700 pt-2"
|
|
30
|
-
},
|
|
30
|
+
}, g = { class: "flex items-center space-x-2" }, q = /* @__PURE__ */ i({
|
|
31
31
|
__name: "OneCardHeader",
|
|
32
|
-
props:
|
|
32
|
+
props: h,
|
|
33
33
|
setup(t) {
|
|
34
|
-
return (e,
|
|
35
|
-
|
|
36
|
-
e.title ? (
|
|
37
|
-
e.description ? (
|
|
34
|
+
return (e, S) => (s(), r("div", y, [
|
|
35
|
+
n("div", b, [
|
|
36
|
+
e.title ? (s(), r("p", $, d(e.title), 1)) : a("", !0),
|
|
37
|
+
e.description ? (s(), r("p", x, d(e.description), 1)) : a("", !0)
|
|
38
38
|
]),
|
|
39
|
-
|
|
39
|
+
n("div", g, [
|
|
40
40
|
o(e.$slots, "default")
|
|
41
41
|
])
|
|
42
42
|
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
|
|
44
|
+
}), k = {}, v = { class: "p-3 xl:p-6 rounded-b border-t border-secondary-stroke" }, C = { class: "flex items-center justify-end space-x-3" };
|
|
45
|
+
function O(t, e) {
|
|
46
|
+
return s(), r("div", v, [
|
|
47
|
+
n("div", C, [
|
|
48
|
+
o(t.$slots, "default")
|
|
49
|
+
])
|
|
48
50
|
]);
|
|
49
51
|
}
|
|
50
|
-
const E = /* @__PURE__ */
|
|
52
|
+
const E = /* @__PURE__ */ c(k, [["render", O]]);
|
|
51
53
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
H as OneCard,
|
|
55
|
+
j as OneCardBody,
|
|
54
56
|
E as OneCardFooter,
|
|
55
57
|
q as OneCardHeader
|
|
56
58
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from "vue";
|
|
2
|
+
export declare const avatarProps: {
|
|
3
|
+
size: {
|
|
4
|
+
type: PropType<string | number>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
rounded: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
text: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: boolean;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
src: {
|
|
17
|
+
type: PropType<string>;
|
|
18
|
+
required: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type AvatarProps = ExtractPropTypes<typeof avatarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1,default:""},src:{type:[String,null],required:!1}},m=["src"],y=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,n=e.computed(()=>{const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(l=>l.slice(0,1)).join("").toUpperCase()}),a=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),c=e.computed(()=>{const r=t.text.split("").map(o=>o.charCodeAt(0)).reduce((o,d)=>o+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),i=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(i.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full h-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(c.value),class:"block"},[n.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(a.value)},e.toDisplayString(n.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=y;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent as f, computed as r, openBlock as s, createElementBlock as n, normalizeStyle as a, toDisplayString as y, createCommentVNode as g } from "vue";
|
|
2
|
+
const x = {
|
|
3
|
+
size: {
|
|
4
|
+
type: [String, Number],
|
|
5
|
+
default: "50"
|
|
6
|
+
},
|
|
7
|
+
rounded: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: !1
|
|
10
|
+
},
|
|
11
|
+
text: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: !1,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
src: {
|
|
17
|
+
type: [String, null],
|
|
18
|
+
required: !1
|
|
19
|
+
}
|
|
20
|
+
}, v = ["src"], S = /* @__PURE__ */ f({
|
|
21
|
+
__name: "OneAvatar",
|
|
22
|
+
props: x,
|
|
23
|
+
setup(c) {
|
|
24
|
+
const e = c, i = r(() => {
|
|
25
|
+
const t = e.text.trim().split(" ");
|
|
26
|
+
return t.length < 2 ? e.text.slice(0, 2).toUpperCase() : t.map((l) => l.slice(0, 1)).join("").toUpperCase();
|
|
27
|
+
}), u = r(() => ({
|
|
28
|
+
fill: "rgba(255, 255, 255, .75)",
|
|
29
|
+
fontSize: `${Number(e.size) * 0.4}px`
|
|
30
|
+
})), d = r(() => {
|
|
31
|
+
const t = e.text.split("").map((o) => o.charCodeAt(0)).reduce((o, h) => o + h, 0), m = `hsl(${360 / 26 * t}, 68%, 48%)`;
|
|
32
|
+
return {
|
|
33
|
+
width: `${e.size}px`,
|
|
34
|
+
height: `${e.size}px`,
|
|
35
|
+
borderRadius: e.rounded ? "100%" : "9%",
|
|
36
|
+
background: m
|
|
37
|
+
};
|
|
38
|
+
}), p = r(() => ({
|
|
39
|
+
width: `${e.size}px`,
|
|
40
|
+
height: `${e.size}px`,
|
|
41
|
+
borderRadius: e.rounded ? "100%" : "9%"
|
|
42
|
+
}));
|
|
43
|
+
return (t, l) => (s(), n("div", {
|
|
44
|
+
style: a(p.value),
|
|
45
|
+
class: "overflow-hidden"
|
|
46
|
+
}, [
|
|
47
|
+
t.src ? (s(), n("img", {
|
|
48
|
+
key: 0,
|
|
49
|
+
src: t.src,
|
|
50
|
+
alt: "",
|
|
51
|
+
class: "w-full h-full"
|
|
52
|
+
}, null, 8, v)) : (s(), n("svg", {
|
|
53
|
+
key: 1,
|
|
54
|
+
style: a(d.value),
|
|
55
|
+
class: "block"
|
|
56
|
+
}, [
|
|
57
|
+
i.value ? (s(), n("text", {
|
|
58
|
+
key: 0,
|
|
59
|
+
x: "50%",
|
|
60
|
+
y: "50%",
|
|
61
|
+
"text-anchor": "middle",
|
|
62
|
+
"dominant-baseline": "central",
|
|
63
|
+
class: "font-light",
|
|
64
|
+
style: a(u.value)
|
|
65
|
+
}, y(i.value), 5)) : g("", !0)
|
|
66
|
+
], 4))
|
|
67
|
+
], 4));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
S as OneAvatar
|
|
72
|
+
};
|
package/dist/dropdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-f88ecb85.cjs");require("vue");require("../_plugin-vue_export-helper-f246444f.cjs");exports.OneBrowserMenu=e._sfc_main$3;exports.OneDropdown=e._sfc_main;exports.OneDropdownDivider=e.OneDropdownDivider;exports.OneDropdownItem=e._sfc_main$1;exports.OneUserMenu=e._sfc_main$2;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),g=require("../_plugin-vue_export-helper-f246444f.cjs"),h=require("../common/index.cjs"),k={title:{type:String},stick:{type:String,default:"right"}},y={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},w=["data-opened"],v={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},f=e.defineComponent({__name:"OneDropdown",props:k,emits:["open"],setup(a,{emit:l}){const d=a,s=e.ref(!1),n=e.ref(null),r=()=>{s.value=!s.value,s.value&&l("open")};e.provide("OneDropdown",{onToggle:r});const t=e.computed(()=>{const o=n.value!=null&&n.value.offsetLeft<270;return n.value!=null&&n.value.offsetTop+270>window.innerHeight?"up"+(o?"-right":"-left"):"down"+(o?"-right":"-left")}),c=e.computed(()=>{const o=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return t.value==="up"?o.push("bottom-1 mb-10"):t.value==="down"?o.push("top-1 mt-10"):t.value==="up-right"?o.push("left-0 bottom-1 mb-10"):t.value==="down-right"&&o.push("left-0 top-1 mt-10"),d.stick==="right"?o.push("right-0"):d.stick==="left"&&o.push("left-0"),o});return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:n,"data-opened":s.value},[e.renderSlot(o.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:r,isExpanded:s.value}))),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:r})):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(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",c.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[o.title?(e.openBlock(),e.createElementBlock("div",v,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:r})))],2)):e.createCommentVNode("",!0)]),_:3})],8,w))}}),x=["onClick"],p=e.defineComponent({__name:"OneDropdownItem",props:y,emits:["click"],setup(a,{emit:l}){const d=a,s=e.inject("OneDropdown"),n=()=>{s!==void 0&&s.onToggle(),l("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,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",r.value]),onClick:e.withModifiers(n,["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)],10,x))}}),b={},_={class:"border-t border-secondary-stroke my-1"};function C(a,l){return e.openBlock(),e.createElementBlock("div",_)}const V=g._export_sfc(b,[["render",C]]);function E(a,l){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 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})])}function N(a,l){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 B={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},onAccount:{type:Function},onLogout:{type:Function}},S={workspace:{type:Object,required:!0},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Apps"},changeLabel:{type:String,default:"Change"},onChange:{type:Function},onApp:{type:Function}},z=["onClick"],O={class:"space-y-2 text-center py-6",style:{width:"240px"}},A={class:"text-sm text-secondary-content"},D={class:"px-2"},$=e.defineComponent({__name:"OneUserMenu",props:B,setup(a){const l=a,d=e.computed(()=>{var r;return(r=l.menu)==null?void 0:r.map(t=>{let c={label:t.label};t.icon!=null&&(c={...c,icon:t.icon});const o=typeof t.click=="function"?t.click:()=>{};return{key:t.label,args:c,click:o}})}),s=()=>{typeof l.onAccount=="function"&&l.onAccount()},n=()=>{typeof l.onLogout=="function"&&l.onLogout()};return(r,t)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:c,isExpanded:o})=>{var i,u;return[e.createElementVNode("button",{onClick:c,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[o?"bg-secondary-25":""]])},[e.createVNode(h.OneAvatar,{text:((i=r.user)==null?void 0:i.name)||"",size:r.iconSize,src:(u=r.user)==null?void 0:u.photo_url,rounded:!0},null,8,["text","size","src"])],10,z)]}),menu:e.withCtx(()=>{var c,o,i,u;return[e.createElementVNode("div",O,[e.createElementVNode("div",null,[e.createVNode(h.OneAvatar,{text:((c=r.user)==null?void 0:c.name)||"",size:80,src:(o=r.user)==null?void 0:o.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",null,[e.createElementVNode("div",null,e.toDisplayString((i=r.user)==null?void 0:i.name),1),e.createElementVNode("div",A,e.toDisplayString((u=r.user)==null?void 0:u.email),1)])]),e.createElementVNode("div",D,[e.createVNode(p,{icon:e.unref(E),label:r.accountLabel,class:"rounded",onClick:s},null,8,["icon","label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createBlock(p,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(p,{icon:e.unref(N),label:r.logoutLabel,class:"rounded",onClick:n},null,8,["icon","label"])])]}),_:1}))}});function L(a,l){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 M=["onClick"],P={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},j={class:"flex-shrink-0"},F={class:"w-full text-left"},T={class:"flex-shrink-0"},q={class:"px-3 py-2 border-t border-secondary-stroke"},H={class:"text-secondary-content text-left pb-1 text-sm"},I={class:"grid grid-cols-3 gap-1"},R=["onClick"],U={class:"block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg"},G={class:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1"},J=e.defineComponent({__name:"OneBrowserMenu",props:S,setup(a){const l=a,d=()=>{typeof l.onChange=="function"&&l.onChange()},s=n=>{typeof l.onApp=="function"&&l.onApp(n)};return(n,r)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:c})=>[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[c?"bg-secondary-25":""]])},[e.createVNode(e.unref(L),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${n.iconSize}px; height: ${n.iconSize}px`)},null,8,["style"])],10,M)]),menu:e.withCtx(()=>{var t,c,o;return[e.createElementVNode("div",P,[e.createElementVNode("div",j,[e.createVNode(h.OneAvatar,{text:((t=n.workspace)==null?void 0:t.name)||"",src:(c=n.workspace)==null?void 0:c.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",F,e.toDisplayString((o=n.workspace)==null?void 0:o.name),1),e.createElementVNode("div",T,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:d},e.toDisplayString(n.changeLabel),1)])]),e.createElementVNode("div",q,[e.createElementVNode("div",H,e.toDisplayString(n.appsTitle),1),e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.apps,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:u=>s(i),class:"p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",style:{width:"88px",height:"88px"}},[e.createElementVNode("span",U,[e.createVNode(h.OneAvatar,{text:i.name,src:i.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("span",G,e.toDisplayString(i.name),1)],8,R))),128))])])]}),_:1}))}});exports.OneBrowserMenu=J;exports.OneDropdown=f;exports.OneDropdownDivider=V;exports.OneDropdownItem=p;exports.OneUserMenu=$;
|