@oneb/ui-vue 0.0.57 → 0.0.58

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,525 +0,0 @@
1
- import { defineComponent as k, ref as _, provide as V, computed as w, openBlock as o, createElementBlock as i, renderSlot as I, normalizeProps as P, guardReactiveProps as T, createCommentVNode as g, createVNode as v, Transition as E, withCtx as A, normalizeClass as b, toDisplayString as h, inject as N, withModifiers as q, createBlock as $, resolveDynamicComponent as H, createElementVNode as e, Fragment as S, renderList as z, mergeProps as R, unref as L, createTextVNode as W, pushScopeId as U, popScopeId as G } from "vue";
2
- import { OneAvatar as x } from "./common/index.js";
3
- import { r as J } from "./XMarkIcon-51ef0691.js";
4
- import { _ as K } from "./index-72d69e4e.js";
5
- import { _ as Q } from "./_plugin-vue_export-helper-dad06003.js";
6
- const X = {
7
- title: {
8
- type: String
9
- },
10
- stick: {
11
- type: String,
12
- default: "right"
13
- }
14
- }, Y = {
15
- variant: {
16
- type: String,
17
- default: "primary"
18
- },
19
- label: {
20
- type: String
21
- },
22
- icon: {
23
- type: [Function, Object]
24
- }
25
- }, Z = ["data-opened"], ee = {
26
- key: 0,
27
- class: "text-sm text-secondary-content px-3 py-2 text-left"
28
- }, te = /* @__PURE__ */ k({
29
- __name: "OneDropdown",
30
- props: X,
31
- emits: ["open", "close"],
32
- setup(u, { emit: a }) {
33
- const p = _(!1), l = _(null), d = a, n = u, c = () => {
34
- p.value = !p.value, p.value ? d("open") : d("close");
35
- };
36
- V("OneDropdown", {
37
- onToggle: c
38
- });
39
- const t = w(() => {
40
- const s = l.value != null && l.value.offsetLeft < 270;
41
- return l.value != null && l.value.offsetTop + 270 > window.innerHeight ? "up" + (s ? "-right" : "-left") : "down" + (s ? "-right" : "-left");
42
- }), m = w(() => {
43
- const s = [
44
- "absolute z-10 w-fit rounded-md bg-white",
45
- "py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
46
- "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
47
- ];
48
- return t.value.startsWith("up") ? s.push("bottom-1 mb-10") : t.value.startsWith("down") && s.push("top-1 mt-10"), n.stick === "right" ? s.push("right-0") : n.stick === "left" && s.push("left-0"), s;
49
- });
50
- return (s, r) => (o(), i("div", {
51
- class: "relative inline-block",
52
- ref_key: "menuRef",
53
- ref: l,
54
- "data-opened": p.value
55
- }, [
56
- I(s.$slots, "button", P(T({ onToggle: c, isExpanded: p.value }))),
57
- p.value ? (o(), i("div", {
58
- key: 0,
59
- class: "fixed top-0 left-0 w-screen h-screen z-10",
60
- onClick: c
61
- })) : g("", !0),
62
- v(E, {
63
- "enter-active-class": "transition ease-out duration-100",
64
- "enter-from-class": "transform opacity-0 scale-95",
65
- "enter-to-class": "transform opacity-100 scale-100",
66
- "leave-active-class": "transition ease-in duration-75",
67
- "leave-from-class": "transform opacity-100 scale-100",
68
- "leave-to-class": "transform opacity-0 scale-95"
69
- }, {
70
- default: A(() => [
71
- p.value ? (o(), i("div", {
72
- key: 0,
73
- class: b(["menu", m.value]),
74
- role: "menu",
75
- "aria-orientation": "vertical",
76
- tabindex: "-1"
77
- }, [
78
- s.title ? (o(), i("div", ee, h(s.title), 1)) : g("", !0),
79
- I(s.$slots, "menu", P(T({ onToggle: c })))
80
- ], 2)) : g("", !0)
81
- ]),
82
- _: 3
83
- })
84
- ], 8, Z));
85
- }
86
- }), D = /* @__PURE__ */ k({
87
- __name: "OneDropdownItem",
88
- props: Y,
89
- emits: ["click"],
90
- setup(u, { emit: a }) {
91
- const p = a, l = u, d = N("OneDropdown"), n = () => {
92
- d !== void 0 && d.onToggle(), p("click");
93
- }, c = w(() => {
94
- const t = [];
95
- return l.variant === "secondary" ? t.push("text-secondary-content hover:bg-secondary-body-hover") : l.variant === "danger" ? t.push("text-danger-content hover:bg-danger-10") : l.variant === "warning" ? t.push("text-warning-content hover:bg-warning-10") : l.variant === "info" ? t.push("text-info-content hover:bg-info-10") : t.push("hover:bg-secondary-body-hover"), t;
96
- });
97
- return (t, m) => (o(), i("button", {
98
- class: b(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", c.value]),
99
- onClick: q(n, ["prevent"])
100
- }, [
101
- t.icon ? (o(), $(H(t.icon), {
102
- key: 0,
103
- class: "w-4 h-4"
104
- })) : g("", !0),
105
- e("span", null, h(t.label), 1)
106
- ], 2));
107
- }
108
- });
109
- function oe(u, a) {
110
- return o(), i("svg", {
111
- xmlns: "http://www.w3.org/2000/svg",
112
- fill: "none",
113
- viewBox: "0 0 24 24",
114
- "stroke-width": "1.8",
115
- stroke: "currentColor",
116
- "aria-hidden": "true"
117
- }, [
118
- e("path", {
119
- "stroke-linecap": "round",
120
- "stroke-linejoin": "round",
121
- 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"
122
- })
123
- ]);
124
- }
125
- const ne = {
126
- user: {
127
- type: Object,
128
- required: !0
129
- },
130
- menu: {
131
- type: Array,
132
- default: () => []
133
- },
134
- iconSize: {
135
- type: String,
136
- default: "34"
137
- },
138
- app: {
139
- type: Object
140
- },
141
- accountLabel: {
142
- type: String,
143
- default: "Account"
144
- },
145
- logoutLabel: {
146
- type: String,
147
- default: "Logout"
148
- },
149
- versionLabel: {
150
- type: String,
151
- default: ""
152
- },
153
- onAccount: {
154
- type: Function
155
- },
156
- onLogout: {
157
- type: Function
158
- }
159
- }, se = {
160
- workspace: {
161
- type: Object,
162
- required: !0
163
- },
164
- workspaces: {
165
- type: Array
166
- },
167
- apps: {
168
- type: Array,
169
- required: !0
170
- },
171
- iconSize: {
172
- type: String,
173
- default: "24"
174
- },
175
- appsTitle: {
176
- type: String,
177
- default: "Ваші додатки"
178
- },
179
- changeLabel: {
180
- type: String,
181
- default: "Керувати робочими просторами"
182
- },
183
- onChange: {
184
- type: Function
185
- },
186
- onApp: {
187
- type: Function
188
- }
189
- }, re = ["onClick"], ie = { class: "flex flex-col items-center pt-5 pb-2 h-full" }, le = { class: "flex flex-col px-10 py-1 mt-2 text-center" }, ce = { class: "self-center text-base font-medium tracking-wide text-black" }, ae = { class: "mt-1 text-xs leading-5 text-blue-500 font-light" }, ue = { class: "text-left w-full mt-5 px-3" }, de = /* @__PURE__ */ e("div", {
190
- class: "space-y-2 text-center",
191
- style: { width: "240px" }
192
- }, null, -1), pe = { class: "-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400" }, Ue = /* @__PURE__ */ k({
193
- __name: "OneUserMenu",
194
- props: ne,
195
- setup(u) {
196
- const a = u, p = w(() => {
197
- var n;
198
- return (n = a.menu) == null ? void 0 : n.map((c) => {
199
- let t = { label: c.label };
200
- c.icon != null && (t = { ...t, icon: c.icon });
201
- const m = typeof c.click == "function" ? c.click : () => {
202
- };
203
- return {
204
- key: c.label,
205
- args: t,
206
- click: m
207
- };
208
- });
209
- }), l = () => {
210
- typeof a.onAccount == "function" && a.onAccount();
211
- }, d = () => {
212
- typeof a.onLogout == "function" && a.onLogout();
213
- };
214
- return (n, c) => (o(), $(te, { stick: "right" }, {
215
- button: A(({ onToggle: t, isExpanded: m }) => {
216
- var s, r;
217
- return [
218
- e("button", {
219
- onClick: t,
220
- class: b(["p-1 rounded-full hover:bg-secondary-10", [m ? "bg-secondary-25" : ""]])
221
- }, [
222
- v(x, {
223
- text: ((s = n.user) == null ? void 0 : s.name) || "",
224
- size: n.iconSize,
225
- src: (r = n.user) == null ? void 0 : r.photo_url,
226
- rounded: !0
227
- }, null, 8, ["text", "size", "src"])
228
- ], 10, re)
229
- ];
230
- }),
231
- menu: A(() => {
232
- var t, m, s, r, C;
233
- return [
234
- e("div", ie, [
235
- v(x, {
236
- text: ((t = n.user) == null ? void 0 : t.name) || "",
237
- size: 80,
238
- src: (m = n.user) == null ? void 0 : m.photo_url,
239
- rounded: !0,
240
- class: "mx-auto"
241
- }, null, 8, ["text", "src"]),
242
- e("div", le, [
243
- e("div", ce, h((s = n.user) == null ? void 0 : s.name), 1),
244
- e("div", ae, h((r = n.user) == null ? void 0 : r.email), 1)
245
- ]),
246
- typeof a.onAccount == "function" ? (o(), i("a", {
247
- key: 0,
248
- onClick: l,
249
- class: "cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"
250
- }, h(n.accountLabel), 1)) : g("", !0),
251
- e("div", ue, [
252
- (o(!0), i(S, null, z(p.value, (y) => (o(), $(D, R({
253
- key: y.key
254
- }, y.args, {
255
- onClick: y.click
256
- }), null, 16, ["onClick"]))), 128)),
257
- v(D, {
258
- icon: L(oe),
259
- label: n.logoutLabel,
260
- class: "rounded py-3",
261
- onClick: d
262
- }, null, 8, ["icon", "label"])
263
- ]),
264
- de,
265
- e("div", pe, h((C = n.app) == null ? void 0 : C.version), 1)
266
- ])
267
- ];
268
- }),
269
- _: 1
270
- }));
271
- }
272
- });
273
- function he(u, a) {
274
- return o(), i("svg", {
275
- xmlns: "http://www.w3.org/2000/svg",
276
- fill: "none",
277
- viewBox: "0 0 24 24",
278
- "stroke-width": "1.8",
279
- stroke: "currentColor",
280
- "aria-hidden": "true"
281
- }, [
282
- e("rect", {
283
- width: "2.94",
284
- height: "2.94",
285
- x: "17.16",
286
- y: "3.9",
287
- fill: "currentColor",
288
- "stroke-width": "1.8",
289
- rx: "1.1"
290
- }),
291
- e("rect", {
292
- width: "2.94",
293
- height: "2.94",
294
- x: "10.53",
295
- y: "3.9",
296
- fill: "currentColor",
297
- "stroke-width": "1.8",
298
- rx: "1.1"
299
- }),
300
- e("rect", {
301
- width: "2.94",
302
- height: "2.94",
303
- x: "3.9",
304
- y: "3.9",
305
- fill: "currentColor",
306
- "stroke-width": "1.8",
307
- rx: "1.1"
308
- }),
309
- e("rect", {
310
- width: "2.94",
311
- height: "2.94",
312
- x: "17.16",
313
- y: "10.53",
314
- fill: "currentColor",
315
- "stroke-width": "1.8",
316
- rx: "1.1"
317
- }),
318
- e("rect", {
319
- width: "2.94",
320
- height: "2.94",
321
- x: "10.53",
322
- y: "10.53",
323
- fill: "currentColor",
324
- "stroke-width": "1.8",
325
- rx: "1.1"
326
- }),
327
- e("rect", {
328
- width: "2.94",
329
- height: "2.94",
330
- x: "3.9",
331
- y: "10.53",
332
- fill: "currentColor",
333
- "stroke-width": "1.8",
334
- rx: "1.1"
335
- }),
336
- e("rect", {
337
- width: "2.94",
338
- height: "2.94",
339
- x: "17.16",
340
- y: "17.16",
341
- fill: "currentColor",
342
- "stroke-width": "1.8",
343
- rx: "1.1"
344
- }),
345
- e("rect", {
346
- width: "2.94",
347
- height: "2.94",
348
- x: "10.53",
349
- y: "17.16",
350
- fill: "currentColor",
351
- "stroke-width": "1.8",
352
- rx: "1.1"
353
- }),
354
- e("rect", {
355
- width: "2.94",
356
- height: "2.94",
357
- x: "3.9",
358
- y: "17.16",
359
- fill: "currentColor",
360
- "stroke-width": "1.8",
361
- rx: "1.1"
362
- })
363
- ]);
364
- }
365
- function fe(u, a) {
366
- return o(), i("svg", {
367
- xmlns: "http://www.w3.org/2000/svg",
368
- fill: "none",
369
- viewBox: "0 0 24 24",
370
- "stroke-width": "1.8",
371
- stroke: "currentColor",
372
- "aria-hidden": "true"
373
- }, [
374
- e("path", {
375
- "stroke-linecap": "round",
376
- "stroke-linejoin": "round",
377
- d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
378
- })
379
- ]);
380
- }
381
- function me(u, a) {
382
- return o(), i("svg", {
383
- xmlns: "http://www.w3.org/2000/svg",
384
- fill: "none",
385
- viewBox: "0 0 24 24",
386
- "stroke-width": "1.8",
387
- stroke: "currentColor",
388
- "aria-hidden": "true"
389
- }, [
390
- e("path", {
391
- "stroke-linecap": "round",
392
- "stroke-linejoin": "round",
393
- d: "M4.5 15.75l7.5-7.5 7.5 7.5"
394
- })
395
- ]);
396
- }
397
- const ve = (u) => (U("data-v-4c90d46e"), u = u(), G(), u), ge = ["data-opened"], ye = {
398
- key: 1,
399
- class: "absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"
400
- }, xe = { class: "flex justify-between items-center pt-3 mb-3" }, we = { class: "font-semibold text-xl px-3" }, _e = { class: "grid" }, ke = { class: "rounded-lg m-3 border" }, be = {
401
- class: "space-x-2 flex items-center px-3 py-2",
402
- style: { width: "300px" }
403
- }, Ce = { class: "flex justify-between relative" }, Ae = { class: "flex items-center justify-between w-full text-left text-sm font-semibold" }, $e = { clsss: "flex justify-end absolute right-0" }, Se = { key: 0 }, ze = { class: "text-xs font-semibold" }, Le = /* @__PURE__ */ ve(() => /* @__PURE__ */ e("hr", null, null, -1)), Oe = { class: "px-3 py-2" }, je = { class: "text-secondary-content text-left pb-1 text-xs uppercase" }, Fe = { class: "overflow-auto max-h-full" }, Be = {
404
- key: 0,
405
- class: "space-y-2"
406
- }, Me = ["onClick"], Ie = { class: "pl-2" }, Pe = { class: "text-sm mt-1 font-semibold" }, Te = { class: "text-xs mt-1" }, De = {
407
- key: 1,
408
- class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"
409
- }, Ve = /* @__PURE__ */ k({
410
- __name: "OneBrowserMenu",
411
- props: se,
412
- emits: ["open", "close"],
413
- setup(u, { emit: a }) {
414
- const p = a, l = u, d = _(!1), n = () => {
415
- d.value = !d.value, d.value ? p("open") : p("close");
416
- }, c = _(!1), t = w(() => c.value ? me : fe), m = () => {
417
- typeof l.onChange == "function" && l.onChange();
418
- }, s = (r) => {
419
- typeof l.onApp == "function" && l.onApp(r);
420
- };
421
- return (r, C) => {
422
- var y, O, j, F, B, M;
423
- return o(), i("div", { "data-opened": d.value }, [
424
- e("button", {
425
- onClick: n,
426
- class: b(["p-1 rounded-md hover:bg-secondary-10", { "bg-secondary-10": d.value }])
427
- }, [
428
- v(L(he), { class: "text-secondary-base w-8" })
429
- ], 2),
430
- d.value ? (o(), i("div", {
431
- key: 0,
432
- class: "fixed top-0 left-0 w-screen h-screen z-10",
433
- onClick: n
434
- })) : g("", !0),
435
- d.value ? (o(), i("div", ye, [
436
- e("div", xe, [
437
- e("div", we, h((y = r.workspace) == null ? void 0 : y.title), 1),
438
- v(L(J), {
439
- class: "w-6 cursor-pointer",
440
- onClick: n
441
- })
442
- ]),
443
- e("div", _e, [
444
- e("div", ke, [
445
- e("div", be, [
446
- e("div", Ce, [
447
- v(x, {
448
- text: ((O = r.workspace) == null ? void 0 : O.name) || "",
449
- src: (j = r.workspace) == null ? void 0 : j.photo_url,
450
- size: 44,
451
- rounded: !1,
452
- class: "mx-auto"
453
- }, null, 8, ["text", "src"])
454
- ]),
455
- e("div", Ae, [
456
- W(h((F = r.workspace) == null ? void 0 : F.name) + " ", 1),
457
- e("div", $e, [
458
- v(K, {
459
- variant: "touch",
460
- icon: t.value,
461
- onClick: m
462
- }, null, 8, ["icon"])
463
- ])
464
- ])
465
- ]),
466
- c.value ? (o(), i("div", Se, [
467
- (o(!0), i(S, null, z(r.workspaces, (f) => (o(), i("div", {
468
- key: f.name,
469
- class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
470
- }, [
471
- v(x, {
472
- text: f.name,
473
- src: f.photo_url,
474
- size: 30,
475
- rounded: !1
476
- }, null, 8, ["text", "src"]),
477
- e("span", ze, h(f.name), 1)
478
- ]))), 128))
479
- ])) : g("", !0),
480
- Le,
481
- e("div", {
482
- onClick: m,
483
- class: "text-center py-2 cursor-pointer",
484
- style: { "font-size": "10px" }
485
- }, h((B = r.workspace) == null ? void 0 : B.changeLabel), 1)
486
- ])
487
- ]),
488
- e("div", Oe, [
489
- e("div", je, h((M = r.workspace) == null ? void 0 : M.appsLabel), 1),
490
- e("div", Fe, [
491
- r.apps && r.apps.length ? (o(), i("div", Be, [
492
- (o(!0), i(S, null, z(r.apps, (f) => (o(), i("div", {
493
- key: f.id,
494
- onClick: (Ee) => s(f),
495
- class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
496
- }, [
497
- v(x, {
498
- text: f.name,
499
- src: f.photo_url,
500
- size: 44,
501
- rounded: !1
502
- }, null, 8, ["text", "src"]),
503
- e("div", Ie, [
504
- e("p", Pe, h(f.name), 1),
505
- e("p", Te, h(f == null ? void 0 : f.short), 1)
506
- ])
507
- ], 8, Me))), 128))
508
- ])) : g("", !0),
509
- r.apps && r.apps.length ? (o(), i("button", De, h("Дивитися всі"))) : g("", !0)
510
- ])
511
- ])
512
- ])) : g("", !0)
513
- ], 8, ge);
514
- };
515
- }
516
- });
517
- const Ge = /* @__PURE__ */ Q(Ve, [["__scopeId", "data-v-4c90d46e"]]);
518
- export {
519
- Ge as O,
520
- te as _,
521
- D as a,
522
- Ue as b,
523
- se as c,
524
- he as r
525
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),h=require("./common/index.cjs"),V=require("./XMarkIcon-f94baa4c.cjs"),N=require("./index-e804f148.cjs"),C=require("./_plugin-vue_export-helper-f246444f.cjs"),B={title:{type:String},stick:{type:String,default:"right"}},S={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},A=["data-opened"],$={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},_=e.defineComponent({__name:"OneDropdown",props:B,emits:["open","close"],setup(a,{emit:c}){const d=e.ref(!1),s=e.ref(null),i=c,o=a,l=()=>{d.value=!d.value,d.value?i("open"):i("close")};e.provide("OneDropdown",{onToggle:l});const t=e.computed(()=>{const n=s.value!=null&&s.value.offsetLeft<270;return s.value!=null&&s.value.offsetTop+270>window.innerHeight?"up"+(n?"-right":"-left"):"down"+(n?"-right":"-left")}),p=e.computed(()=>{const n=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return t.value.startsWith("up")?n.push("bottom-1 mb-10"):t.value.startsWith("down")&&n.push("top-1 mt-10"),o.stick==="right"?n.push("right-0"):o.stick==="left"&&n.push("left-0"),n});return(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:s,"data-opened":d.value},[e.renderSlot(n.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:l,isExpanded:d.value}))),d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:l})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",p.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[n.title?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:l})))],2)):e.createCommentVNode("",!0)]),_:3})],8,A))}}),k=e.defineComponent({__name:"OneDropdownItem",props:S,emits:["click"],setup(a,{emit:c}){const d=c,s=a,i=e.inject("OneDropdown"),o=()=>{i!==void 0&&i.onToggle(),d("click")},l=e.computed(()=>{const t=[];return s.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):s.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):s.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):s.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,p)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",l.value]),onClick:e.withModifiers(o,["prevent"])},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],2))}});function z(a,c){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 D={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},b={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},O=["onClick"],L={class:"flex flex-col items-center pt-5 pb-2 h-full"},F={class:"flex flex-col px-10 py-1 mt-2 text-center"},j={class:"self-center text-base font-medium tracking-wide text-black"},M={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},P={class:"text-left w-full mt-5 px-3"},I=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1),q={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},T=e.defineComponent({__name:"OneUserMenu",props:D,setup(a){const c=a,d=e.computed(()=>{var o;return(o=c.menu)==null?void 0:o.map(l=>{let t={label:l.label};l.icon!=null&&(t={...t,icon:l.icon});const p=typeof l.click=="function"?l.click:()=>{};return{key:l.label,args:t,click:p}})}),s=()=>{typeof c.onAccount=="function"&&c.onAccount()},i=()=>{typeof c.onLogout=="function"&&c.onLogout()};return(o,l)=>(e.openBlock(),e.createBlock(_,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:p})=>{var n,r;return[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[p?"bg-secondary-25":""]])},[e.createVNode(h.OneAvatar,{text:((n=o.user)==null?void 0:n.name)||"",size:o.iconSize,src:(r=o.user)==null?void 0:r.photo_url,rounded:!0},null,8,["text","size","src"])],10,O)]}),menu:e.withCtx(()=>{var t,p,n,r,f;return[e.createElementVNode("div",L,[e.createVNode(h.OneAvatar,{text:((t=o.user)==null?void 0:t.name)||"",size:80,src:(p=o.user)==null?void 0:p.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",F,[e.createElementVNode("div",j,e.toDisplayString((n=o.user)==null?void 0:n.name),1),e.createElementVNode("div",M,e.toDisplayString((r=o.user)==null?void 0:r.email),1)]),typeof c.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s,class:"cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"},e.toDisplayString(o.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createBlock(k,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(k,{icon:e.unref(z),label:o.logoutLabel,class:"rounded py-3",onClick:i},null,8,["icon","label"])]),I,e.createElementVNode("div",q,e.toDisplayString((f=o.app)==null?void 0:f.version),1)])]}),_:1}))}});function E(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}function H(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function R(a,c){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}const W=a=>(e.pushScopeId("data-v-4c90d46e"),a=a(),e.popScopeId(),a),U=["data-opened"],X={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"},G={class:"flex justify-between items-center pt-3 mb-3"},J={class:"font-semibold text-xl px-3"},K={class:"grid"},Q={class:"rounded-lg m-3 border"},Y={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},Z={class:"flex justify-between relative"},ee={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},te={clsss:"flex justify-end absolute right-0"},oe={key:0},ne={class:"text-xs font-semibold"},re=W(()=>e.createElementVNode("hr",null,null,-1)),se={class:"px-3 py-2"},le={class:"text-secondary-content text-left pb-1 text-xs uppercase"},ce={class:"overflow-auto max-h-full"},ae={key:0,class:"space-y-2"},ie=["onClick"],de={class:"pl-2"},ue={class:"text-sm mt-1 font-semibold"},pe={class:"text-xs mt-1"},me={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},he=e.defineComponent({__name:"OneBrowserMenu",props:b,emits:["open","close"],setup(a,{emit:c}){const d=c,s=a,i=e.ref(!1),o=()=>{i.value=!i.value,i.value?d("open"):d("close")},l=e.ref(!1),t=e.computed(()=>l.value?R:H),p=()=>{typeof s.onChange=="function"&&s.onChange()},n=r=>{typeof s.onApp=="function"&&s.onApp(r)};return(r,f)=>{var m,g,v,y,x,w;return e.openBlock(),e.createElementBlock("div",{"data-opened":i.value},[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",{"bg-secondary-10":i.value}])},[e.createVNode(e.unref(E),{class:"text-secondary-base w-8"})],2),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:o})):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",G,[e.createElementVNode("div",J,e.toDisplayString((m=r.workspace)==null?void 0:m.title),1),e.createVNode(e.unref(V.render),{class:"w-6 cursor-pointer",onClick:o})]),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createVNode(h.OneAvatar,{text:((g=r.workspace)==null?void 0:g.name)||"",src:(v=r.workspace)==null?void 0:v.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",ee,[e.createTextVNode(e.toDisplayString((y=r.workspace)==null?void 0:y.name)+" ",1),e.createElementVNode("div",te,[e.createVNode(N._sfc_main,{variant:"touch",icon:t.value,onClick:p},null,8,["icon"])])])]),l.value?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.workspaces,u=>(e.openBlock(),e.createElementBlock("div",{key:u.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(h.OneAvatar,{text:u.name,src:u.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",ne,e.toDisplayString(u.name),1)]))),128))])):e.createCommentVNode("",!0),re,e.createElementVNode("div",{onClick:p,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((x=r.workspace)==null?void 0:x.changeLabel),1)])]),e.createElementVNode("div",se,[e.createElementVNode("div",le,e.toDisplayString((w=r.workspace)==null?void 0:w.appsLabel),1),e.createElementVNode("div",ce,[r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.apps,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,onClick:ke=>n(u),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[e.createVNode(h.OneAvatar,{text:u.name,src:u.photo_url,size:44,rounded:!1},null,8,["text","src"]),e.createElementVNode("div",de,[e.createElementVNode("p",ue,e.toDisplayString(u.name),1),e.createElementVNode("p",pe,e.toDisplayString(u==null?void 0:u.short),1)])],8,ie))),128))])):e.createCommentVNode("",!0),r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("button",me,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,U)}}});const fe=C._export_sfc(he,[["__scopeId","data-v-4c90d46e"]]);exports.OneBrowserMenu=fe;exports._sfc_main=_;exports._sfc_main$1=k;exports._sfc_main$2=T;exports.browserMenuProps=b;exports.render=E;