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