@oneb/ui-vue 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OneBrowserMenu-29074956.js → OneBrowserMenu-072918b3.js} +93 -95
- package/dist/{OneBrowserMenu-8223b11f.cjs → OneBrowserMenu-681ebfd2.cjs} +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +24 -24
- package/dist/dropdown/menu.d.ts +3 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/layout/index.cjs +2 -2
- package/dist/layout/index.js +119 -116
- package/dist/layout/layout.d.ts +9 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as k, ref as
|
|
2
|
-
import { OneAvatar as
|
|
3
|
-
import { r as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
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
7
|
title: {
|
|
8
8
|
type: String
|
|
9
9
|
},
|
|
@@ -11,7 +11,7 @@ const K = {
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: "right"
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, Y = {
|
|
15
15
|
variant: {
|
|
16
16
|
type: String,
|
|
17
17
|
default: "primary"
|
|
@@ -22,18 +22,18 @@ const K = {
|
|
|
22
22
|
icon: {
|
|
23
23
|
type: [Function, Object]
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, Z = ["data-opened"], ee = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "text-sm text-secondary-content px-3 py-2 text-left"
|
|
28
|
-
},
|
|
28
|
+
}, te = /* @__PURE__ */ k({
|
|
29
29
|
__name: "OneDropdown",
|
|
30
|
-
props:
|
|
30
|
+
props: X,
|
|
31
31
|
emits: ["open", "close"],
|
|
32
32
|
setup(u, { emit: a }) {
|
|
33
|
-
const p =
|
|
33
|
+
const p = _(!1), l = _(null), d = a, n = u, c = () => {
|
|
34
34
|
p.value = !p.value, p.value ? d("open") : d("close");
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
V("OneDropdown", {
|
|
37
37
|
onToggle: c
|
|
38
38
|
});
|
|
39
39
|
const t = w(() => {
|
|
@@ -53,13 +53,13 @@ const K = {
|
|
|
53
53
|
ref: l,
|
|
54
54
|
"data-opened": p.value
|
|
55
55
|
}, [
|
|
56
|
-
|
|
56
|
+
I(s.$slots, "button", P(T({ onToggle: c, isExpanded: p.value }))),
|
|
57
57
|
p.value ? (o(), i("div", {
|
|
58
58
|
key: 0,
|
|
59
59
|
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
60
60
|
onClick: c
|
|
61
61
|
})) : g("", !0),
|
|
62
|
-
v(
|
|
62
|
+
v(E, {
|
|
63
63
|
"enter-active-class": "transition ease-out duration-100",
|
|
64
64
|
"enter-from-class": "transform opacity-0 scale-95",
|
|
65
65
|
"enter-to-class": "transform opacity-100 scale-100",
|
|
@@ -75,20 +75,20 @@ const K = {
|
|
|
75
75
|
"aria-orientation": "vertical",
|
|
76
76
|
tabindex: "-1"
|
|
77
77
|
}, [
|
|
78
|
-
s.title ? (o(), i("div",
|
|
79
|
-
|
|
78
|
+
s.title ? (o(), i("div", ee, h(s.title), 1)) : g("", !0),
|
|
79
|
+
I(s.$slots, "menu", P(T({ onToggle: c })))
|
|
80
80
|
], 2)) : g("", !0)
|
|
81
81
|
]),
|
|
82
82
|
_: 3
|
|
83
83
|
})
|
|
84
|
-
], 8,
|
|
84
|
+
], 8, Z));
|
|
85
85
|
}
|
|
86
|
-
}),
|
|
86
|
+
}), D = /* @__PURE__ */ k({
|
|
87
87
|
__name: "OneDropdownItem",
|
|
88
|
-
props:
|
|
88
|
+
props: Y,
|
|
89
89
|
emits: ["click"],
|
|
90
90
|
setup(u, { emit: a }) {
|
|
91
|
-
const p = a, l = u, d =
|
|
91
|
+
const p = a, l = u, d = N("OneDropdown"), n = () => {
|
|
92
92
|
d !== void 0 && d.onToggle(), p("click");
|
|
93
93
|
}, c = w(() => {
|
|
94
94
|
const t = [];
|
|
@@ -96,9 +96,9 @@ const K = {
|
|
|
96
96
|
});
|
|
97
97
|
return (t, m) => (o(), i("button", {
|
|
98
98
|
class: b(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", c.value]),
|
|
99
|
-
onClick:
|
|
99
|
+
onClick: q(n, ["prevent"])
|
|
100
100
|
}, [
|
|
101
|
-
t.icon ? (o(), $(
|
|
101
|
+
t.icon ? (o(), $(H(t.icon), {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "w-4 h-4"
|
|
104
104
|
})) : g("", !0),
|
|
@@ -106,7 +106,7 @@ const K = {
|
|
|
106
106
|
], 2));
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
|
-
function
|
|
109
|
+
function oe(u, a) {
|
|
110
110
|
return o(), i("svg", {
|
|
111
111
|
xmlns: "http://www.w3.org/2000/svg",
|
|
112
112
|
fill: "none",
|
|
@@ -122,7 +122,7 @@ function ee(u, a) {
|
|
|
122
122
|
})
|
|
123
123
|
]);
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const ne = {
|
|
126
126
|
user: {
|
|
127
127
|
type: Object,
|
|
128
128
|
required: !0
|
|
@@ -156,7 +156,7 @@ const te = {
|
|
|
156
156
|
onLogout: {
|
|
157
157
|
type: Function
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, se = {
|
|
160
160
|
workspace: {
|
|
161
161
|
type: Object,
|
|
162
162
|
required: !0
|
|
@@ -186,12 +186,12 @@ const te = {
|
|
|
186
186
|
onApp: {
|
|
187
187
|
type: Function
|
|
188
188
|
}
|
|
189
|
-
},
|
|
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
190
|
class: "space-y-2 text-center",
|
|
191
191
|
style: { width: "240px" }
|
|
192
|
-
}, null, -1),
|
|
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
193
|
__name: "OneUserMenu",
|
|
194
|
-
props:
|
|
194
|
+
props: ne,
|
|
195
195
|
setup(u) {
|
|
196
196
|
const a = u, p = w(() => {
|
|
197
197
|
var n;
|
|
@@ -211,7 +211,7 @@ const te = {
|
|
|
211
211
|
}, d = () => {
|
|
212
212
|
typeof a.onLogout == "function" && a.onLogout();
|
|
213
213
|
};
|
|
214
|
-
return (n, c) => (o(), $(
|
|
214
|
+
return (n, c) => (o(), $(te, { stick: "right" }, {
|
|
215
215
|
button: A(({ onToggle: t, isExpanded: m }) => {
|
|
216
216
|
var s, r;
|
|
217
217
|
return [
|
|
@@ -219,50 +219,50 @@ const te = {
|
|
|
219
219
|
onClick: t,
|
|
220
220
|
class: b(["p-1 rounded-full hover:bg-secondary-10", [m ? "bg-secondary-25" : ""]])
|
|
221
221
|
}, [
|
|
222
|
-
v(
|
|
222
|
+
v(x, {
|
|
223
223
|
text: ((s = n.user) == null ? void 0 : s.name) || "",
|
|
224
224
|
size: n.iconSize,
|
|
225
225
|
src: (r = n.user) == null ? void 0 : r.photo_url,
|
|
226
226
|
rounded: !0
|
|
227
227
|
}, null, 8, ["text", "size", "src"])
|
|
228
|
-
], 10,
|
|
228
|
+
], 10, re)
|
|
229
229
|
];
|
|
230
230
|
}),
|
|
231
231
|
menu: A(() => {
|
|
232
232
|
var t, m, s, r, C;
|
|
233
233
|
return [
|
|
234
|
-
e("div",
|
|
235
|
-
v(
|
|
234
|
+
e("div", ie, [
|
|
235
|
+
v(x, {
|
|
236
236
|
text: ((t = n.user) == null ? void 0 : t.name) || "",
|
|
237
237
|
size: 80,
|
|
238
238
|
src: (m = n.user) == null ? void 0 : m.photo_url,
|
|
239
239
|
rounded: !0,
|
|
240
240
|
class: "mx-auto"
|
|
241
241
|
}, null, 8, ["text", "src"]),
|
|
242
|
-
e("div",
|
|
243
|
-
e("div",
|
|
244
|
-
e("div",
|
|
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
245
|
]),
|
|
246
246
|
typeof a.onAccount == "function" ? (o(), i("a", {
|
|
247
247
|
key: 0,
|
|
248
248
|
onClick: l,
|
|
249
249
|
class: "cursor-pointer justify-center px-8 py-3 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"
|
|
250
250
|
}, h(n.accountLabel), 1)) : g("", !0),
|
|
251
|
-
e("div",
|
|
252
|
-
(o(!0), i(S, null, z(p.value, (y) => (o(), $(
|
|
251
|
+
e("div", ue, [
|
|
252
|
+
(o(!0), i(S, null, z(p.value, (y) => (o(), $(D, R({
|
|
253
253
|
key: y.key
|
|
254
254
|
}, y.args, {
|
|
255
255
|
onClick: y.click
|
|
256
256
|
}), null, 16, ["onClick"]))), 128)),
|
|
257
|
-
v(
|
|
258
|
-
icon:
|
|
257
|
+
v(D, {
|
|
258
|
+
icon: L(oe),
|
|
259
259
|
label: n.logoutLabel,
|
|
260
260
|
class: "rounded py-3",
|
|
261
261
|
onClick: d
|
|
262
262
|
}, null, 8, ["icon", "label"])
|
|
263
263
|
]),
|
|
264
|
-
|
|
265
|
-
e("div",
|
|
264
|
+
de,
|
|
265
|
+
e("div", pe, h((C = n.app) == null ? void 0 : C.version), 1)
|
|
266
266
|
])
|
|
267
267
|
];
|
|
268
268
|
}),
|
|
@@ -270,7 +270,7 @@ const te = {
|
|
|
270
270
|
}));
|
|
271
271
|
}
|
|
272
272
|
});
|
|
273
|
-
function
|
|
273
|
+
function he(u, a) {
|
|
274
274
|
return o(), i("svg", {
|
|
275
275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
276
276
|
fill: "none",
|
|
@@ -362,7 +362,7 @@ function de(u, a) {
|
|
|
362
362
|
})
|
|
363
363
|
]);
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function fe(u, a) {
|
|
366
366
|
return o(), i("svg", {
|
|
367
367
|
xmlns: "http://www.w3.org/2000/svg",
|
|
368
368
|
fill: "none",
|
|
@@ -378,7 +378,7 @@ function pe(u, a) {
|
|
|
378
378
|
})
|
|
379
379
|
]);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function me(u, a) {
|
|
382
382
|
return o(), i("svg", {
|
|
383
383
|
xmlns: "http://www.w3.org/2000/svg",
|
|
384
384
|
fill: "none",
|
|
@@ -394,70 +394,68 @@ function he(u, a) {
|
|
|
394
394
|
})
|
|
395
395
|
]);
|
|
396
396
|
}
|
|
397
|
-
const
|
|
397
|
+
const ve = (u) => (U("data-v-4c90d46e"), u = u(), G(), u), ge = ["data-opened"], ye = {
|
|
398
398
|
key: 1,
|
|
399
399
|
class: "absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"
|
|
400
|
-
},
|
|
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
401
|
class: "space-x-2 flex items-center px-3 py-2",
|
|
402
402
|
style: { width: "300px" }
|
|
403
|
-
},
|
|
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
404
|
key: 0,
|
|
405
405
|
class: "space-y-2"
|
|
406
|
-
},
|
|
406
|
+
}, Me = ["onClick"], Ie = { class: "pl-2" }, Pe = { class: "text-sm mt-1 font-semibold" }, Te = { class: "text-xs mt-1" }, De = {
|
|
407
407
|
key: 1,
|
|
408
408
|
class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"
|
|
409
|
-
},
|
|
409
|
+
}, Ve = /* @__PURE__ */ k({
|
|
410
410
|
__name: "OneBrowserMenu",
|
|
411
|
-
props:
|
|
411
|
+
props: se,
|
|
412
412
|
emits: ["open", "close"],
|
|
413
413
|
setup(u, { emit: a }) {
|
|
414
|
-
const p = a, l = u, d =
|
|
414
|
+
const p = a, l = u, d = _(!1), n = () => {
|
|
415
415
|
d.value = !d.value, d.value ? p("open") : p("close");
|
|
416
|
-
}, c =
|
|
417
|
-
x(!1);
|
|
418
|
-
const m = () => {
|
|
416
|
+
}, c = _(!1), t = w(() => c.value ? me : fe), m = () => {
|
|
419
417
|
typeof l.onChange == "function" && l.onChange();
|
|
420
418
|
}, s = (r) => {
|
|
421
419
|
typeof l.onApp == "function" && l.onApp(r);
|
|
422
420
|
};
|
|
423
421
|
return (r, C) => {
|
|
424
|
-
var y,
|
|
422
|
+
var y, O, j, F, B, M;
|
|
425
423
|
return o(), i("div", { "data-opened": d.value }, [
|
|
426
424
|
e("button", {
|
|
427
425
|
onClick: n,
|
|
428
426
|
class: b(["p-1 rounded-md hover:bg-secondary-10", { "bg-secondary-10": d.value }])
|
|
429
427
|
}, [
|
|
430
|
-
v(
|
|
428
|
+
v(L(he), { class: "text-secondary-base w-8" })
|
|
431
429
|
], 2),
|
|
432
430
|
d.value ? (o(), i("div", {
|
|
433
431
|
key: 0,
|
|
434
432
|
class: "fixed top-0 left-0 w-screen h-screen z-10",
|
|
435
433
|
onClick: n
|
|
436
434
|
})) : g("", !0),
|
|
437
|
-
d.value ? (o(), i("div",
|
|
438
|
-
e("div",
|
|
439
|
-
e("div",
|
|
440
|
-
v(
|
|
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), {
|
|
441
439
|
class: "w-6 cursor-pointer",
|
|
442
440
|
onClick: n
|
|
443
441
|
})
|
|
444
442
|
]),
|
|
445
|
-
e("div",
|
|
446
|
-
e("div",
|
|
447
|
-
e("div",
|
|
448
|
-
e("div",
|
|
449
|
-
v(
|
|
450
|
-
text: ((
|
|
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) || "",
|
|
451
449
|
src: (j = r.workspace) == null ? void 0 : j.photo_url,
|
|
452
450
|
size: 44,
|
|
453
451
|
rounded: !1,
|
|
454
452
|
class: "mx-auto"
|
|
455
453
|
}, null, 8, ["text", "src"])
|
|
456
454
|
]),
|
|
457
|
-
e("div",
|
|
458
|
-
|
|
459
|
-
e("div",
|
|
460
|
-
v(
|
|
455
|
+
e("div", Ae, [
|
|
456
|
+
W(h((F = r.workspace) == null ? void 0 : F.name) + " ", 1),
|
|
457
|
+
e("div", $e, [
|
|
458
|
+
v(K, {
|
|
461
459
|
variant: "touch",
|
|
462
460
|
icon: t.value,
|
|
463
461
|
onClick: m
|
|
@@ -465,63 +463,63 @@ const fe = (u) => (R("data-v-10078238"), u = u(), W(), u), me = ["data-opened"],
|
|
|
465
463
|
])
|
|
466
464
|
])
|
|
467
465
|
]),
|
|
468
|
-
c.value ? (o(), i("div",
|
|
466
|
+
c.value ? (o(), i("div", Se, [
|
|
469
467
|
(o(!0), i(S, null, z(r.workspaces, (f) => (o(), i("div", {
|
|
470
468
|
key: f.name,
|
|
471
469
|
class: "flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"
|
|
472
470
|
}, [
|
|
473
|
-
v(
|
|
471
|
+
v(x, {
|
|
474
472
|
text: f.name,
|
|
475
473
|
src: f.photo_url,
|
|
476
474
|
size: 30,
|
|
477
475
|
rounded: !1
|
|
478
476
|
}, null, 8, ["text", "src"]),
|
|
479
|
-
e("span",
|
|
477
|
+
e("span", ze, h(f.name), 1)
|
|
480
478
|
]))), 128))
|
|
481
479
|
])) : g("", !0),
|
|
482
|
-
|
|
480
|
+
Le,
|
|
483
481
|
e("div", {
|
|
484
482
|
onClick: m,
|
|
485
483
|
class: "text-center py-2 cursor-pointer",
|
|
486
484
|
style: { "font-size": "10px" }
|
|
487
|
-
}, h(r.changeLabel), 1)
|
|
485
|
+
}, h((B = r.workspace) == null ? void 0 : B.changeLabel), 1)
|
|
488
486
|
])
|
|
489
487
|
]),
|
|
490
|
-
e("div",
|
|
491
|
-
e("div",
|
|
492
|
-
e("div",
|
|
493
|
-
r.apps && r.apps.length ? (o(), i("div",
|
|
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, [
|
|
494
492
|
(o(!0), i(S, null, z(r.apps, (f) => (o(), i("div", {
|
|
495
493
|
key: f.id,
|
|
496
|
-
onClick: (
|
|
494
|
+
onClick: (Ee) => s(f),
|
|
497
495
|
class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
|
|
498
496
|
}, [
|
|
499
|
-
v(
|
|
497
|
+
v(x, {
|
|
500
498
|
text: f.name,
|
|
501
499
|
src: f.photo_url,
|
|
502
500
|
size: 44,
|
|
503
501
|
rounded: !1
|
|
504
502
|
}, null, 8, ["text", "src"]),
|
|
505
|
-
e("div",
|
|
506
|
-
e("p",
|
|
507
|
-
e("p",
|
|
503
|
+
e("div", Ie, [
|
|
504
|
+
e("p", Pe, h(f.name), 1),
|
|
505
|
+
e("p", Te, h(f == null ? void 0 : f.short), 1)
|
|
508
506
|
])
|
|
509
|
-
], 8,
|
|
507
|
+
], 8, Me))), 128))
|
|
510
508
|
])) : g("", !0),
|
|
511
|
-
r.apps && r.apps.length ? (o(), i("button",
|
|
509
|
+
r.apps && r.apps.length ? (o(), i("button", De, h("Дивитися всі"))) : g("", !0)
|
|
512
510
|
])
|
|
513
511
|
])
|
|
514
512
|
])) : g("", !0)
|
|
515
|
-
], 8,
|
|
513
|
+
], 8, ge);
|
|
516
514
|
};
|
|
517
515
|
}
|
|
518
516
|
});
|
|
519
|
-
const
|
|
517
|
+
const Ge = /* @__PURE__ */ Q(Ve, [["__scopeId", "data-v-4c90d46e"]]);
|
|
520
518
|
export {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
519
|
+
Ge as O,
|
|
520
|
+
te as _,
|
|
521
|
+
D as a,
|
|
522
|
+
Ue as b,
|
|
523
|
+
se as c,
|
|
524
|
+
he as r
|
|
527
525
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h=require("./common/index.cjs"),b=require("./XMarkIcon-f94baa4c.cjs"),E=require("./index-e804f148.cjs"),V=require("./_plugin-vue_export-helper-f246444f.cjs"),N={title:{type:String},stick:{type:String,default:"right"}},C={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},B=["data-opened"],S={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},x=e.defineComponent({__name:"OneDropdown",props:N,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",S,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,B))}}),g=e.defineComponent({__name:"OneDropdownItem",props:C,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 A(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 $={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}},w={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}},z=["onClick"],D={class:"flex flex-col items-center pt-5 pb-2 h-full"},O={class:"flex flex-col px-10 py-1 mt-2 text-center"},L={class:"self-center text-base font-medium tracking-wide text-black"},F={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},j={class:"text-left w-full mt-5 px-3"},M=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1),P={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},I=e.defineComponent({__name:"OneUserMenu",props:$,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(x,{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,z)]}),menu:e.withCtx(()=>{var t,p,n,r,f;return[e.createElementVNode("div",D,[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",O,[e.createElementVNode("div",L,e.toDisplayString((n=o.user)==null?void 0:n.name),1),e.createElementVNode("div",F,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",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createBlock(g,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(g,{icon:e.unref(A),label:o.logoutLabel,class:"rounded py-3",onClick:i},null,8,["icon","label"])]),M,e.createElementVNode("div",P,e.toDisplayString((f=o.app)==null?void 0:f.version),1)])]}),_:1}))}});function _(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 q(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 T(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 H=a=>(e.pushScopeId("data-v-10078238"),a=a(),e.popScopeId(),a),R=["data-opened"],W={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white z-10"},U={class:"flex justify-between items-center pt-3 mb-3"},X={class:"font-semibold text-xl px-3"},G={class:"grid"},J={class:"rounded-lg m-3 border"},K={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},Q={class:"flex justify-between relative"},Y={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},Z={clsss:"flex justify-end absolute right-0"},ee={key:0},te={class:"text-xs font-semibold"},oe=H(()=>e.createElementVNode("hr",null,null,-1)),ne={class:"px-3 py-2"},re={class:"text-secondary-content text-left pb-1 text-xs uppercase"},se={class:"overflow-auto max-h-full"},le={key:0,class:"space-y-2"},ce=["onClick"],ae={class:"pl-2"},ie={class:"text-sm mt-1 font-semibold"},de={class:"text-xs mt-1"},ue={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},pe=e.defineComponent({__name:"OneBrowserMenu",props:w,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?T:q);e.ref(!1);const p=()=>{typeof s.onChange=="function"&&s.onChange()},n=r=>{typeof s.onApp=="function"&&s.onApp(r)};return(r,f)=>{var m,k,v,y;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(_),{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",W,[e.createElementVNode("div",U,[e.createElementVNode("div",X,e.toDisplayString((m=r.workspace)==null?void 0:m.label),1),e.createVNode(e.unref(b.render),{class:"w-6 cursor-pointer",onClick:o})]),e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(h.OneAvatar,{text:((k=r.workspace)==null?void 0:k.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",Y,[e.createTextVNode(e.toDisplayString((y=r.workspace)==null?void 0:y.name)+" ",1),e.createElementVNode("div",Z,[e.createVNode(E._sfc_main,{variant:"touch",icon:t.value,onClick:p},null,8,["icon"])])])]),l.value?(e.openBlock(),e.createElementBlock("div",ee,[(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",te,e.toDisplayString(u.name),1)]))),128))])):e.createCommentVNode("",!0),oe,e.createElementVNode("div",{onClick:p,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString(r.changeLabel),1)])]),e.createElementVNode("div",ne,[e.createElementVNode("div",re,e.toDisplayString(r.appsTitle),1),e.createElementVNode("div",se,[r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.apps,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,onClick:he=>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",ae,[e.createElementVNode("p",ie,e.toDisplayString(u.name),1),e.createElementVNode("p",de,e.toDisplayString(u==null?void 0:u.inf),1)])],8,ce))),128))])):e.createCommentVNode("",!0),r.apps&&r.apps.length?(e.openBlock(),e.createElementBlock("button",ue,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,R)}}});const me=V._export_sfc(pe,[["__scopeId","data-v-10078238"]]);exports.OneBrowserMenu=me;exports._sfc_main=x;exports._sfc_main$1=g;exports._sfc_main$2=I;exports.browserMenuProps=w;exports.render=_;
|
|
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;
|
package/dist/dropdown/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../OneBrowserMenu-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../OneBrowserMenu-681ebfd2.cjs"),e=require("vue"),f=require("../_plugin-vue_export-helper-f246444f.cjs"),p=require("../common/index.cjs");require("../XMarkIcon-f94baa4c.cjs");require("../index-e804f148.cjs");const g={},v={class:"border-t border-secondary-stroke my-1"};function k(a,o){return e.openBlock(),e.createElementBlock("div",v)}const x=f._export_sfc(g,[["render",k]]),b=["onClick"],V={class:"grid"},w={class:"font-semibold px-3"},E={class:"rounded-lg m-3 border"},N={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},B={class:"flex-shrink-0"},A={class:"w-full text-left"},C={class:"flex-shrink-0"},D=e.createElementVNode("hr",null,null,-1),O=e.createElementVNode("div",{class:"text-center py-2",style:{"font-size":"10px"}},"Керувати робочими просторами",-1),S={class:"px-3 py-2"},M={class:"text-secondary-content text-left pb-1 text-sm uppercase"},z={key:0,class:"space-y-2"},F=["onClick"],$={class:"pl-2"},q={class:"text-sm mt-1"},G={class:"text-xs mt-1"},u=3,L=e.defineComponent({__name:"OneBrowserMenuGrid",props:n.browserMenuProps,setup(a){const o=a,m=()=>{typeof o.onChange=="function"&&o.onChange()},r=e.ref(!1),_=e.computed(()=>o.apps?r.value?o.apps:o.apps.slice(0,u):[]),h=()=>{r.value=!r.value},y=t=>{typeof o.onApp=="function"&&o.onApp(t)};return(t,P)=>(e.openBlock(),e.createBlock(n._sfc_main,{stick:"right"},{button:e.withCtx(({onToggle:c,isExpanded:l})=>[e.createElementVNode("button",{onClick:c,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[l?"bg-secondary-25":""]])},[e.createVNode(e.unref(n.render),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${t.iconSize}px; height: ${t.iconSize}px`)},null,8,["style"])],10,b)]),menu:e.withCtx(()=>{var c,l,i,d;return[e.createElementVNode("div",V,[e.createElementVNode("div",w,e.toDisplayString((c=t.workspace)==null?void 0:c.title),1),e.createElementVNode("div",E,[e.createElementVNode("div",N,[e.createElementVNode("div",B,[e.createVNode(p.OneAvatar,{text:((l=t.workspace)==null?void 0:l.name)||"",src:(i=t.workspace)==null?void 0:i.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",A,e.toDisplayString((d=t.workspace)==null?void 0:d.name),1),e.createElementVNode("div",C,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:m},e.toDisplayString(t.changeLabel),1)])]),D,O])]),e.createElementVNode("div",S,[e.createElementVNode("div",M,e.toDisplayString(t.appsTitle),1),e.createElementVNode("div",null,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,onClick:T=>y(s),class:"flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"},[e.createVNode(p.OneAvatar,{text:s.name,src:s.photo_url,size:44,rounded:!1},null,8,["text","src"]),e.createElementVNode("div",$,[e.createElementVNode("p",q,e.toDisplayString(s.name),1),e.createElementVNode("p",G,e.toDisplayString(s.short),1)])],8,F))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length>u?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:h,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"},e.toDisplayString(r.value?"Приховати":"Дивитися всі"),1)):e.createCommentVNode("",!0)])])]}),_:1}))}});exports.OneBrowserMenu=n.OneBrowserMenu;exports.OneDropdown=n._sfc_main;exports.OneDropdownItem=n._sfc_main$1;exports.OneUserMenu=n._sfc_main$2;exports.OneBrowserMenuGrid=L;exports.OneDropdownDivider=x;
|