@oneb/ui-vue 0.0.18 → 0.0.20

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("../OneBrowserMenu.vue_vue_type_script_setup_true_lang-24874222.cjs");require("../common/index.cjs");const w={items:{required:!0,type:Array},slim:{type:Boolean,default:!0}},y={route:{required:!1,type:[Object,String]},routeName:{required:!1,type:String},handler:{required:!1,type:Function,default(){return()=>{}}},label:{type:String,required:!0},icon:{type:[Function,Object]},exact:{type:Boolean,required:!1,default:!1},slim:{type:Boolean,default:!0}},_={sidebarItems:w.items,logoSrc:{type:String},helpUrl:{type:String},app:{required:!0,type:Object},user:{type:Object,required:!0},labels:{type:Object},handlers:{type:Object}},x={class:"flex flex-nowrap items-center transition-all w-full h-[24px]"},N={class:"whitespace-nowrap overflow-hidden text-ellipsis transition-all text-left flex-shrink pl-1.5 w-full"},B=e.defineComponent({__name:"OneSidebarLink",props:y,setup(a){const l=a,n=e.computed(()=>l.route!=null?l.route:l.routeName!=null?{name:l.routeName}:"/");return(o,t)=>{const r=e.resolveComponent("RouterLink");return e.openBlock(),e.createBlock(r,{to:n.value,class:e.normalizeClass(["flex items-center w-full p-[8px] rounded-lg text-sm font-medium hover:bg-primary-10-hover hover:text-primary-base transition-all text-primary-content",[o.slim?"w-[44px] h-[44px] justify-center":"h-[44px] justify-start"]]),"active-class":o.exact?"":"bg-primary-10 !text-primary-base","exact-active-class":o.exact?"bg-primary-10 !text-primary-base":"",exact:o.exact},{default:e.withCtx(()=>[e.createElementVNode("div",x,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"w-[24px] h-[24px] flex-shrink-0"})):e.createCommentVNode("",!0),e.createElementVNode("div",N,e.toDisplayString(o.label),1)])]),_:1},8,["to","active-class","exact-active-class","exact","class"])}}}),V={class:"space-y-2 p-2"},b=e.defineComponent({__name:"OneSidebar",props:w,setup(a){return(l,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,o=>(e.openBlock(),e.createBlock(B,{key:o.label,icon:o.icon,label:o.label,route:o.route,"route-name":o.routeName,exact:o.exact||!1,slim:l.slim},null,8,["icon","label","route","route-name","exact","slim"]))),128))])]))}});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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})])}function C(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:"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"})])}const S={class:"min-h-screen relative"},O={class:"header h-[56px] flex items-center flex-nowrap absolute top-0 left-0 w-full"},j={class:"p-2 flex-shrink-0"},L={class:"w-10 h-10 bg-white rounded-lg border border-secondary-stroke flex items-center flex-shrink-0"},q=["src"],$={class:"whitespace-nowrap"},M={class:"text-xs whitespace-nowrap"},z={class:"w-full"},A={class:"w-full flex justify-end pr-2"},D={class:"flex items-center space-x-4"},I={key:0,class:"sm:block flex-shrink-0 hidden"},P=["href"],R={class:"body w-full h-full"},F=e.defineComponent({__name:"OneMainLayout",props:_,setup(a){const l=a,n=e.ref(window.localStorage.getItem("sidebar-slim")==="1");e.watch(n,t=>{window.localStorage.setItem("sidebar-slim",String(t?1:0))});const o=e.computed(()=>{var t,r;return{name:((t=l.app)==null?void 0:t.workspace)||"",photo_url:((r=l.app)==null?void 0:r.photo_url)||""}});return(t,r)=>{var s,c,i,p,u,d,m,h,f,g;const v=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",O,[e.createElementVNode("div",j,[e.createElementVNode("button",{onClick:r[0]||(r[0]=U=>n.value=!n.value),class:"w-[44px] h-[44px] p-[8px] flex items-center justify-center hover:text-secondary-content"},[e.createVNode(e.unref(E),{class:"w-[24px] h-[24px]"})])]),e.createElementVNode("div",L,[t.logoSrc!=null?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.logoSrc,class:"w-8 h-8 mx-auto",alt:"logo"},null,8,q)):e.createCommentVNode("",!0)]),t.app!=null?(e.openBlock(),e.createBlock(v,{key:0,to:"/",class:"pl-2 max-w-xs"},{default:e.withCtx(()=>[e.createElementVNode("div",$,e.toDisplayString(t.app.name),1),e.createElementVNode("div",M,e.toDisplayString(t.app.workspace),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",z,[e.createElementVNode("div",A,[e.createElementVNode("div",D,[e.renderSlot(t.$slots,"before-header-menu"),t.helpUrl?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("a",{href:t.helpUrl,target:"_blank",title:"Help",class:"block btn-touch text-gray-dark"},[e.createVNode(e.unref(C),{class:"w-6 h-6 text-gray-600"})],8,P)])):e.createCommentVNode("",!0),e.createVNode(k._sfc_main$3,{workspace:o.value,apps:((s=t.app)==null?void 0:s.apps)||[],"change-label":((c=t.labels)==null?void 0:c.change)||"Change","apps-title":((i=t.labels)==null?void 0:i.apps)||"Apps","on-app":(p=t.handlers)==null?void 0:p.onApp,"on-change":(u=t.handlers)==null?void 0:u.onChange,onOpen:(d=t.handlers)==null?void 0:d.onBrowse},null,8,["workspace","apps","change-label","apps-title","on-app","on-change","onOpen"]),e.createVNode(k._sfc_main$2,{user:t.user,"account-label":((m=t.labels)==null?void 0:m.account)||"Account","logout-label":((h=t.labels)==null?void 0:h.logout)||"Logout","on-account":(f=t.handlers)==null?void 0:f.onAccount,"on-logout":(g=t.handlers)==null?void 0:g.onLogout},null,8,["user","account-label","logout-label","on-account","on-logout"])])])])]),e.createElementVNode("div",{class:e.normalizeClass(["sidebar absolute top-[56px] left-0 h-full overflow-hidden bg-white lg:bg-transparent transition-all",[n.value?"w-0 lg:w-[60px]":"w-full lg:w-60"]])},[e.createVNode(b,{slim:n.value,items:t.sidebarItems},null,8,["slim","items"])],2),e.createElementVNode("div",R,[e.createElementVNode("div",{class:e.normalizeClass(["content transition-all pt-[56px]",[n.value?"pl-0 lg:pl-[60px]":"pl-0 lg:pl-60"]])},[e.renderSlot(t.$slots,"default")],2)])])}}});exports.OneMainLayout=F;exports.OneSidebar=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("../OneBrowserMenu.vue_vue_type_script_setup_true_lang-24874222.cjs");require("../common/index.cjs");const g={items:{required:!0,type:Array},slim:{type:Boolean,default:!0}},_={route:{required:!1,type:[Object,String]},routeName:{required:!1,type:String},handler:{required:!1,type:Function,default(){return()=>{}}},label:{type:String,required:!0},icon:{type:[Function,Object]},exact:{type:Boolean,required:!1,default:!1},slim:{type:Boolean,default:!0}},x={sidebarItems:g.items,logoSrc:{type:String},helpUrl:{type:String},app:{required:!0,type:Object},user:{type:Object,required:!0},labels:{type:Object},handlers:{type:Object}},N={class:"flex flex-nowrap items-center transition-all w-full h-[24px]"},B={class:"whitespace-nowrap overflow-hidden text-ellipsis transition-all text-left flex-shrink pl-1.5 w-full"},V=e.defineComponent({__name:"OneSidebarLink",props:_,setup(r){const l=r,n=e.computed(()=>l.route!=null?l.route:l.routeName!=null?{name:l.routeName}:"/");return(o,s)=>{const t=e.resolveComponent("RouterLink");return e.openBlock(),e.createBlock(t,{to:n.value,class:e.normalizeClass(["flex items-center w-full p-[8px] rounded-lg text-sm font-medium hover:bg-primary-10-hover hover:text-primary-base transition-all text-primary-content",[o.slim?"w-[44px] h-[44px] justify-center":"h-[44px] justify-start"]]),"active-class":o.exact?"":"bg-primary-10 !text-primary-base","exact-active-class":o.exact?"bg-primary-10 !text-primary-base":"",exact:o.exact},{default:e.withCtx(()=>[e.createElementVNode("div",N,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"w-[24px] h-[24px] flex-shrink-0 transition-all"})):e.createCommentVNode("",!0),e.createElementVNode("div",B,e.toDisplayString(o.label),1)])]),_:1},8,["to","active-class","exact-active-class","exact","class"])}}}),E={class:"space-y-2 p-2"},v=e.defineComponent({__name:"OneSidebar",props:g,setup(r){return(l,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,o=>(e.openBlock(),e.createBlock(V,{key:o.label,icon:o.icon,label:o.label,route:o.route,"route-name":o.routeName,exact:o.exact||!1,slim:l.slim},null,8,["icon","label","route","route-name","exact","slim"]))),128))])]))}});function C(r,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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})])}function S(r,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:"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"})])}const O={class:"min-h-screen relative"},j={class:"header h-[56px] flex items-center flex-nowrap absolute top-0 left-0 w-full"},L={class:"p-2 flex-shrink-0"},q={class:"w-10 h-10 bg-white rounded-lg border border-secondary-stroke flex items-center flex-shrink-0"},$=["src"],M={class:"whitespace-nowrap"},z={class:"text-xs whitespace-nowrap"},A={class:"w-full"},D={class:"w-full flex justify-end pr-2"},I={class:"flex items-center space-x-4"},P={key:0,class:"sm:block flex-shrink-0 hidden"},R=["href"],F={class:"body w-full h-full"},U=e.defineComponent({__name:"OneMainLayout",props:x,setup(r){const l=r,n=e.ref(window.localStorage.getItem("sidebar-slim")==="1");e.watch(n,t=>{window.localStorage.setItem("sidebar-slim",String(t?1:0))});const o=()=>{window.document.body.offsetWidth<1024&&!n.value&&(n.value=!0)},s=e.computed(()=>{var t,a;return{name:((t=l.app)==null?void 0:t.workspace)||"",photo_url:((a=l.app)==null?void 0:a.photo_url)||""}});return(t,a)=>{var c,i,p,u,d,m,h,f,k,w;const y=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",j,[e.createElementVNode("div",L,[e.createElementVNode("button",{onClick:a[0]||(a[0]=H=>n.value=!n.value),class:"w-[44px] h-[44px] p-[8px] flex items-center justify-center hover:text-secondary-content"},[e.createVNode(e.unref(C),{class:"w-[24px] h-[24px]"})])]),e.createElementVNode("div",q,[t.logoSrc!=null?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.logoSrc,class:"w-8 h-8 mx-auto",alt:"logo"},null,8,$)):e.createCommentVNode("",!0)]),t.app!=null?(e.openBlock(),e.createBlock(y,{key:0,to:"/",class:"pl-2 max-w-xs"},{default:e.withCtx(()=>[e.createElementVNode("div",M,e.toDisplayString(t.app.name),1),e.createElementVNode("div",z,e.toDisplayString(t.app.workspace),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",A,[e.createElementVNode("div",D,[e.createElementVNode("div",I,[e.renderSlot(t.$slots,"before-header-menu"),t.helpUrl?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("a",{href:t.helpUrl,target:"_blank",title:"Help",class:"block btn-touch text-gray-dark"},[e.createVNode(e.unref(S),{class:"w-6 h-6 text-gray-600"})],8,R)])):e.createCommentVNode("",!0),e.createVNode(b._sfc_main$3,{workspace:s.value,apps:((c=t.app)==null?void 0:c.apps)||[],"change-label":((i=t.labels)==null?void 0:i.change)||"Change","apps-title":((p=t.labels)==null?void 0:p.apps)||"Apps","on-app":(u=t.handlers)==null?void 0:u.onApp,"on-change":(d=t.handlers)==null?void 0:d.onChange,onOpen:(m=t.handlers)==null?void 0:m.onBrowse},null,8,["workspace","apps","change-label","apps-title","on-app","on-change","onOpen"]),e.createVNode(b._sfc_main$2,{user:t.user,"account-label":((h=t.labels)==null?void 0:h.account)||"Account","logout-label":((f=t.labels)==null?void 0:f.logout)||"Logout","on-account":(k=t.handlers)==null?void 0:k.onAccount,"on-logout":(w=t.handlers)==null?void 0:w.onLogout},null,8,["user","account-label","logout-label","on-account","on-logout"])])])])]),e.createElementVNode("div",{class:e.normalizeClass(["sidebar absolute top-[56px] left-0 h-full overflow-hidden bg-white lg:bg-transparent transition-all z-50",[n.value?"w-0 lg:w-[60px]":"w-full lg:w-60"]]),onClick:o},[e.createVNode(v,{slim:n.value,items:t.sidebarItems},null,8,["slim","items"])],2),e.createElementVNode("div",F,[e.createElementVNode("div",{class:e.normalizeClass(["content transition-all pt-[56px]",[n.value?"pl-0 lg:pl-[60px]":"pl-0 lg:pl-60"]])},[e.renderSlot(t.$slots,"default")],2)])])}}});exports.OneMainLayout=U;exports.OneSidebar=v;
@@ -1,7 +1,7 @@
1
- import { defineComponent as m, computed as C, resolveComponent as L, openBlock as o, createBlock as u, normalizeClass as d, withCtx as $, createElementVNode as t, resolveDynamicComponent as N, createCommentVNode as c, toDisplayString as h, createElementBlock as a, Fragment as M, renderList as A, ref as I, watch as R, createVNode as p, unref as O, renderSlot as j } from "vue";
2
- import { c as z, b as F } from "../OneBrowserMenu.vue_vue_type_script_setup_true_lang-197489be.js";
1
+ import { defineComponent as m, computed as L, resolveComponent as $, openBlock as n, createBlock as u, normalizeClass as d, withCtx as B, createElementVNode as t, resolveDynamicComponent as M, createCommentVNode as p, toDisplayString as h, createElementBlock as r, Fragment as A, renderList as z, ref as I, watch as R, createVNode as c, unref as O, renderSlot as j } from "vue";
2
+ import { c as F, b as P } from "../OneBrowserMenu.vue_vue_type_script_setup_true_lang-197489be.js";
3
3
  import "../common/index.js";
4
- const B = {
4
+ const q = {
5
5
  items: {
6
6
  required: !0,
7
7
  type: Array
@@ -10,7 +10,7 @@ const B = {
10
10
  type: Boolean,
11
11
  default: !0
12
12
  }
13
- }, P = {
13
+ }, U = {
14
14
  route: {
15
15
  required: !1,
16
16
  type: [Object, String]
@@ -43,8 +43,8 @@ const B = {
43
43
  type: Boolean,
44
44
  default: !0
45
45
  }
46
- }, U = {
47
- sidebarItems: B.items,
46
+ }, V = {
47
+ sidebarItems: q.items,
48
48
  logoSrc: {
49
49
  type: String
50
50
  },
@@ -65,54 +65,54 @@ const B = {
65
65
  handlers: {
66
66
  type: Object
67
67
  }
68
- }, V = { class: "flex flex-nowrap items-center transition-all w-full h-[24px]" }, D = { class: "whitespace-nowrap overflow-hidden text-ellipsis transition-all text-left flex-shrink pl-1.5 w-full" }, E = /* @__PURE__ */ m({
68
+ }, D = { class: "flex flex-nowrap items-center transition-all w-full h-[24px]" }, E = { class: "whitespace-nowrap overflow-hidden text-ellipsis transition-all text-left flex-shrink pl-1.5 w-full" }, H = /* @__PURE__ */ m({
69
69
  __name: "OneSidebarLink",
70
- props: P,
71
- setup(i) {
72
- const l = i, r = C(() => l.route != null ? l.route : l.routeName != null ? { name: l.routeName } : "/");
73
- return (s, e) => {
74
- const n = L("RouterLink");
75
- return o(), u(n, {
76
- to: r.value,
77
- class: d(["flex items-center w-full p-[8px] rounded-lg text-sm font-medium hover:bg-primary-10-hover hover:text-primary-base transition-all text-primary-content", [s.slim ? "w-[44px] h-[44px] justify-center" : "h-[44px] justify-start"]]),
78
- "active-class": s.exact ? "" : "bg-primary-10 !text-primary-base",
79
- "exact-active-class": s.exact ? "bg-primary-10 !text-primary-base" : "",
80
- exact: s.exact
70
+ props: U,
71
+ setup(a) {
72
+ const s = a, l = L(() => s.route != null ? s.route : s.routeName != null ? { name: s.routeName } : "/");
73
+ return (o, f) => {
74
+ const e = $("RouterLink");
75
+ return n(), u(e, {
76
+ to: l.value,
77
+ class: d(["flex items-center w-full p-[8px] rounded-lg text-sm font-medium hover:bg-primary-10-hover hover:text-primary-base transition-all text-primary-content", [o.slim ? "w-[44px] h-[44px] justify-center" : "h-[44px] justify-start"]]),
78
+ "active-class": o.exact ? "" : "bg-primary-10 !text-primary-base",
79
+ "exact-active-class": o.exact ? "bg-primary-10 !text-primary-base" : "",
80
+ exact: o.exact
81
81
  }, {
82
- default: $(() => [
83
- t("div", V, [
84
- s.icon ? (o(), u(N(s.icon), {
82
+ default: B(() => [
83
+ t("div", D, [
84
+ o.icon ? (n(), u(M(o.icon), {
85
85
  key: 0,
86
- class: "w-[24px] h-[24px] flex-shrink-0"
87
- })) : c("", !0),
88
- t("div", D, h(s.label), 1)
86
+ class: "w-[24px] h-[24px] flex-shrink-0 transition-all"
87
+ })) : p("", !0),
88
+ t("div", E, h(o.label), 1)
89
89
  ])
90
90
  ]),
91
91
  _: 1
92
92
  }, 8, ["to", "active-class", "exact-active-class", "exact", "class"]);
93
93
  };
94
94
  }
95
- }), H = { class: "space-y-2 p-2" }, G = /* @__PURE__ */ m({
95
+ }), W = { class: "space-y-2 p-2" }, G = /* @__PURE__ */ m({
96
96
  __name: "OneSidebar",
97
- props: B,
98
- setup(i) {
99
- return (l, r) => (o(), a("div", null, [
100
- t("div", H, [
101
- (o(!0), a(M, null, A(l.items, (s) => (o(), u(E, {
102
- key: s.label,
103
- icon: s.icon,
104
- label: s.label,
105
- route: s.route,
106
- "route-name": s.routeName,
107
- exact: s.exact || !1,
108
- slim: l.slim
97
+ props: q,
98
+ setup(a) {
99
+ return (s, l) => (n(), r("div", null, [
100
+ t("div", W, [
101
+ (n(!0), r(A, null, z(s.items, (o) => (n(), u(H, {
102
+ key: o.label,
103
+ icon: o.icon,
104
+ label: o.label,
105
+ route: o.route,
106
+ "route-name": o.routeName,
107
+ exact: o.exact || !1,
108
+ slim: s.slim
109
109
  }, null, 8, ["icon", "label", "route", "route-name", "exact", "slim"]))), 128))
110
110
  ])
111
111
  ]));
112
112
  }
113
113
  });
114
- function J(i, l) {
115
- return o(), a("svg", {
114
+ function J(a, s) {
115
+ return n(), r("svg", {
116
116
  xmlns: "http://www.w3.org/2000/svg",
117
117
  fill: "none",
118
118
  viewBox: "0 0 24 24",
@@ -127,8 +127,8 @@ function J(i, l) {
127
127
  })
128
128
  ]);
129
129
  }
130
- function K(i, l) {
131
- return o(), a("svg", {
130
+ function K(a, s) {
131
+ return n(), r("svg", {
132
132
  xmlns: "http://www.w3.org/2000/svg",
133
133
  fill: "none",
134
134
  viewBox: "0 0 24 24",
@@ -143,101 +143,104 @@ function K(i, l) {
143
143
  })
144
144
  ]);
145
145
  }
146
- const Q = { class: "min-h-screen relative" }, T = { class: "header h-[56px] flex items-center flex-nowrap absolute top-0 left-0 w-full" }, W = { class: "p-2 flex-shrink-0" }, X = { class: "w-10 h-10 bg-white rounded-lg border border-secondary-stroke flex items-center flex-shrink-0" }, Y = ["src"], Z = { class: "whitespace-nowrap" }, ee = { class: "text-xs whitespace-nowrap" }, te = { class: "w-full" }, se = { class: "w-full flex justify-end pr-2" }, le = { class: "flex items-center space-x-4" }, oe = {
146
+ const Q = { class: "min-h-screen relative" }, T = { class: "header h-[56px] flex items-center flex-nowrap absolute top-0 left-0 w-full" }, X = { class: "p-2 flex-shrink-0" }, Y = { class: "w-10 h-10 bg-white rounded-lg border border-secondary-stroke flex items-center flex-shrink-0" }, Z = ["src"], ee = { class: "whitespace-nowrap" }, te = { class: "text-xs whitespace-nowrap" }, oe = { class: "w-full" }, se = { class: "w-full flex justify-end pr-2" }, le = { class: "flex items-center space-x-4" }, ne = {
147
147
  key: 0,
148
148
  class: "sm:block flex-shrink-0 hidden"
149
- }, re = ["href"], ne = { class: "body w-full h-full" }, ue = /* @__PURE__ */ m({
149
+ }, re = ["href"], ae = { class: "body w-full h-full" }, de = /* @__PURE__ */ m({
150
150
  __name: "OneMainLayout",
151
- props: U,
152
- setup(i) {
153
- const l = i, r = I(window.localStorage.getItem("sidebar-slim") === "1");
154
- R(r, (e) => {
151
+ props: V,
152
+ setup(a) {
153
+ const s = a, l = I(window.localStorage.getItem("sidebar-slim") === "1");
154
+ R(l, (e) => {
155
155
  window.localStorage.setItem("sidebar-slim", String(e ? 1 : 0));
156
156
  });
157
- const s = C(() => {
158
- var e, n;
157
+ const o = () => {
158
+ window.document.body.offsetWidth < 1024 && !l.value && (l.value = !0);
159
+ }, f = L(() => {
160
+ var e, i;
159
161
  return {
160
- name: ((e = l.app) == null ? void 0 : e.workspace) || "",
161
- photo_url: ((n = l.app) == null ? void 0 : n.photo_url) || ""
162
+ name: ((e = s.app) == null ? void 0 : e.workspace) || "",
163
+ photo_url: ((i = s.app) == null ? void 0 : i.photo_url) || ""
162
164
  };
163
165
  });
164
- return (e, n) => {
165
- var f, b, w, g, v, y, x, k, _, S;
166
- const q = L("RouterLink");
167
- return o(), a("div", Q, [
166
+ return (e, i) => {
167
+ var b, w, g, v, y, k, x, _, S, C;
168
+ const N = $("RouterLink");
169
+ return n(), r("div", Q, [
168
170
  t("div", T, [
169
- t("div", W, [
171
+ t("div", X, [
170
172
  t("button", {
171
- onClick: n[0] || (n[0] = (ae) => r.value = !r.value),
173
+ onClick: i[0] || (i[0] = (ie) => l.value = !l.value),
172
174
  class: "w-[44px] h-[44px] p-[8px] flex items-center justify-center hover:text-secondary-content"
173
175
  }, [
174
- p(O(J), { class: "w-[24px] h-[24px]" })
176
+ c(O(J), { class: "w-[24px] h-[24px]" })
175
177
  ])
176
178
  ]),
177
- t("div", X, [
178
- e.logoSrc != null ? (o(), a("img", {
179
+ t("div", Y, [
180
+ e.logoSrc != null ? (n(), r("img", {
179
181
  key: 0,
180
182
  src: e.logoSrc,
181
183
  class: "w-8 h-8 mx-auto",
182
184
  alt: "logo"
183
- }, null, 8, Y)) : c("", !0)
185
+ }, null, 8, Z)) : p("", !0)
184
186
  ]),
185
- e.app != null ? (o(), u(q, {
187
+ e.app != null ? (n(), u(N, {
186
188
  key: 0,
187
189
  to: "/",
188
190
  class: "pl-2 max-w-xs"
189
191
  }, {
190
- default: $(() => [
191
- t("div", Z, h(e.app.name), 1),
192
- t("div", ee, h(e.app.workspace), 1)
192
+ default: B(() => [
193
+ t("div", ee, h(e.app.name), 1),
194
+ t("div", te, h(e.app.workspace), 1)
193
195
  ]),
194
196
  _: 1
195
- })) : c("", !0),
196
- t("div", te, [
197
+ })) : p("", !0),
198
+ t("div", oe, [
197
199
  t("div", se, [
198
200
  t("div", le, [
199
201
  j(e.$slots, "before-header-menu"),
200
- e.helpUrl ? (o(), a("div", oe, [
202
+ e.helpUrl ? (n(), r("div", ne, [
201
203
  t("a", {
202
204
  href: e.helpUrl,
203
205
  target: "_blank",
204
206
  title: "Help",
205
207
  class: "block btn-touch text-gray-dark"
206
208
  }, [
207
- p(O(K), { class: "w-6 h-6 text-gray-600" })
209
+ c(O(K), { class: "w-6 h-6 text-gray-600" })
208
210
  ], 8, re)
209
- ])) : c("", !0),
210
- p(z, {
211
- workspace: s.value,
212
- apps: ((f = e.app) == null ? void 0 : f.apps) || [],
213
- "change-label": ((b = e.labels) == null ? void 0 : b.change) || "Change",
214
- "apps-title": ((w = e.labels) == null ? void 0 : w.apps) || "Apps",
215
- "on-app": (g = e.handlers) == null ? void 0 : g.onApp,
216
- "on-change": (v = e.handlers) == null ? void 0 : v.onChange,
217
- onOpen: (y = e.handlers) == null ? void 0 : y.onBrowse
211
+ ])) : p("", !0),
212
+ c(F, {
213
+ workspace: f.value,
214
+ apps: ((b = e.app) == null ? void 0 : b.apps) || [],
215
+ "change-label": ((w = e.labels) == null ? void 0 : w.change) || "Change",
216
+ "apps-title": ((g = e.labels) == null ? void 0 : g.apps) || "Apps",
217
+ "on-app": (v = e.handlers) == null ? void 0 : v.onApp,
218
+ "on-change": (y = e.handlers) == null ? void 0 : y.onChange,
219
+ onOpen: (k = e.handlers) == null ? void 0 : k.onBrowse
218
220
  }, null, 8, ["workspace", "apps", "change-label", "apps-title", "on-app", "on-change", "onOpen"]),
219
- p(F, {
221
+ c(P, {
220
222
  user: e.user,
221
223
  "account-label": ((x = e.labels) == null ? void 0 : x.account) || "Account",
222
- "logout-label": ((k = e.labels) == null ? void 0 : k.logout) || "Logout",
223
- "on-account": (_ = e.handlers) == null ? void 0 : _.onAccount,
224
- "on-logout": (S = e.handlers) == null ? void 0 : S.onLogout
224
+ "logout-label": ((_ = e.labels) == null ? void 0 : _.logout) || "Logout",
225
+ "on-account": (S = e.handlers) == null ? void 0 : S.onAccount,
226
+ "on-logout": (C = e.handlers) == null ? void 0 : C.onLogout
225
227
  }, null, 8, ["user", "account-label", "logout-label", "on-account", "on-logout"])
226
228
  ])
227
229
  ])
228
230
  ])
229
231
  ]),
230
232
  t("div", {
231
- class: d(["sidebar absolute top-[56px] left-0 h-full overflow-hidden bg-white lg:bg-transparent transition-all", [r.value ? "w-0 lg:w-[60px]" : "w-full lg:w-60"]])
233
+ class: d(["sidebar absolute top-[56px] left-0 h-full overflow-hidden bg-white lg:bg-transparent transition-all z-50", [l.value ? "w-0 lg:w-[60px]" : "w-full lg:w-60"]]),
234
+ onClick: o
232
235
  }, [
233
- p(G, {
234
- slim: r.value,
236
+ c(G, {
237
+ slim: l.value,
235
238
  items: e.sidebarItems
236
239
  }, null, 8, ["slim", "items"])
237
240
  ], 2),
238
- t("div", ne, [
241
+ t("div", ae, [
239
242
  t("div", {
240
- class: d(["content transition-all pt-[56px]", [r.value ? "pl-0 lg:pl-[60px]" : "pl-0 lg:pl-60"]])
243
+ class: d(["content transition-all pt-[56px]", [l.value ? "pl-0 lg:pl-[60px]" : "pl-0 lg:pl-60"]])
241
244
  }, [
242
245
  j(e.$slots, "default")
243
246
  ], 2)
@@ -247,6 +250,6 @@ const Q = { class: "min-h-screen relative" }, T = { class: "header h-[56px] flex
247
250
  }
248
251
  });
249
252
  export {
250
- ue as OneMainLayout,
253
+ de as OneMainLayout,
251
254
  G as OneSidebar
252
255
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [