@oneb/ui-vue 0.2.13 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1063 +1,20 @@
1
- import { d as Gt, e as Kt, _ as Jt, f as Qt } from "../OneHelpMenu-adc595d0.js";
2
- import { O as bn, a as An, c as Rn, b as On } from "../OneHelpMenu-adc595d0.js";
3
- import { defineComponent as Bt, ref as Q, watch as Zt, onBeforeUnmount as te, provide as ee, computed as $t, openBlock as L, createElementBlock as F, createElementVNode as y, renderSlot as At, normalizeProps as Rt, guardReactiveProps as Ot, createCommentVNode as Z, withDirectives as ne, normalizeClass as Mt, toDisplayString as S, vShow as oe, createBlock as ie, withCtx as _t, createVNode as ct, unref as se, normalizeStyle as re, Fragment as le, renderList as ce } from "vue";
4
- import { _ as ae } from "../_plugin-vue_export-helper-dad06003.js";
5
- import { _ as Ct } from "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
1
+ import { O as m, _ as O, a as d, c as w, b as D } from "../OneHelpMenu-7eb95bc3.js";
2
+ import { b as M, _ as c, a as b, c as f } from "../index-0e39841a.js";
3
+ import "vue";
4
+ import "../OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
6
5
  import "../XMarkIcon-51ef0691.js";
6
+ import "../ChevronRightIcon-8df1af46.js";
7
7
  import "../button/index.js";
8
8
  import "../SpinnerIcon-24e552a8.js";
9
- const ft = Math.min, V = Math.max, tt = Math.round, J = Math.floor, C = (t) => ({
10
- x: t,
11
- y: t
12
- }), fe = {
13
- left: "right",
14
- right: "left",
15
- bottom: "top",
16
- top: "bottom"
17
- }, ue = {
18
- start: "end",
19
- end: "start"
20
- };
21
- function pt(t, e) {
22
- return typeof t == "function" ? t(e) : t;
23
- }
24
- function W(t) {
25
- return t.split("-")[0];
26
- }
27
- function ot(t) {
28
- return t.split("-")[1];
29
- }
30
- function de(t) {
31
- return t === "x" ? "y" : "x";
32
- }
33
- function Nt(t) {
34
- return t === "y" ? "height" : "width";
35
- }
36
- function q(t) {
37
- return ["top", "bottom"].includes(W(t)) ? "y" : "x";
38
- }
39
- function Vt(t) {
40
- return de(q(t));
41
- }
42
- function pe(t, e, o) {
43
- o === void 0 && (o = !1);
44
- const n = ot(t), i = Vt(t), r = Nt(i);
45
- let s = i === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
46
- return e.reference[r] > e.floating[r] && (s = et(s)), [s, et(s)];
47
- }
48
- function me(t) {
49
- const e = et(t);
50
- return [ut(t), e, ut(e)];
51
- }
52
- function ut(t) {
53
- return t.replace(/start|end/g, (e) => ue[e]);
54
- }
55
- function he(t, e, o) {
56
- const n = ["left", "right"], i = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
57
- switch (t) {
58
- case "top":
59
- case "bottom":
60
- return o ? e ? i : n : e ? n : i;
61
- case "left":
62
- case "right":
63
- return e ? r : s;
64
- default:
65
- return [];
66
- }
67
- }
68
- function ge(t, e, o, n) {
69
- const i = ot(t);
70
- let r = he(W(t), o === "start", n);
71
- return i && (r = r.map((s) => s + "-" + i), e && (r = r.concat(r.map(ut)))), r;
72
- }
73
- function et(t) {
74
- return t.replace(/left|right|bottom|top/g, (e) => fe[e]);
75
- }
76
- function we(t) {
77
- return {
78
- top: 0,
79
- right: 0,
80
- bottom: 0,
81
- left: 0,
82
- ...t
83
- };
84
- }
85
- function xe(t) {
86
- return typeof t != "number" ? we(t) : {
87
- top: t,
88
- right: t,
89
- bottom: t,
90
- left: t
91
- };
92
- }
93
- function nt(t) {
94
- const {
95
- x: e,
96
- y: o,
97
- width: n,
98
- height: i
99
- } = t;
100
- return {
101
- width: n,
102
- height: i,
103
- top: o,
104
- left: e,
105
- right: e + n,
106
- bottom: o + i,
107
- x: e,
108
- y: o
109
- };
110
- }
111
- function kt(t, e, o) {
112
- let {
113
- reference: n,
114
- floating: i
115
- } = t;
116
- const r = q(e), s = Vt(e), l = Nt(s), c = W(e), a = r === "y", f = n.x + n.width / 2 - i.width / 2, u = n.y + n.height / 2 - i.height / 2, p = n[l] / 2 - i[l] / 2;
117
- let d;
118
- switch (c) {
119
- case "top":
120
- d = {
121
- x: f,
122
- y: n.y - i.height
123
- };
124
- break;
125
- case "bottom":
126
- d = {
127
- x: f,
128
- y: n.y + n.height
129
- };
130
- break;
131
- case "right":
132
- d = {
133
- x: n.x + n.width,
134
- y: u
135
- };
136
- break;
137
- case "left":
138
- d = {
139
- x: n.x - i.width,
140
- y: u
141
- };
142
- break;
143
- default:
144
- d = {
145
- x: n.x,
146
- y: n.y
147
- };
148
- }
149
- switch (ot(e)) {
150
- case "start":
151
- d[s] -= p * (o && a ? -1 : 1);
152
- break;
153
- case "end":
154
- d[s] += p * (o && a ? -1 : 1);
155
- break;
156
- }
157
- return d;
158
- }
159
- const ye = async (t, e, o) => {
160
- const {
161
- placement: n = "bottom",
162
- strategy: i = "absolute",
163
- middleware: r = [],
164
- platform: s
165
- } = o, l = r.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(e));
166
- let a = await s.getElementRects({
167
- reference: t,
168
- floating: e,
169
- strategy: i
170
- }), {
171
- x: f,
172
- y: u
173
- } = kt(a, n, c), p = n, d = {}, m = 0;
174
- for (let g = 0; g < l.length; g++) {
175
- const {
176
- name: w,
177
- fn: h
178
- } = l[g], {
179
- x: v,
180
- y: b,
181
- data: A,
182
- reset: x
183
- } = await h({
184
- x: f,
185
- y: u,
186
- initialPlacement: n,
187
- placement: p,
188
- strategy: i,
189
- middlewareData: d,
190
- rects: a,
191
- platform: s,
192
- elements: {
193
- reference: t,
194
- floating: e
195
- }
196
- });
197
- f = v ?? f, u = b ?? u, d = {
198
- ...d,
199
- [w]: {
200
- ...d[w],
201
- ...A
202
- }
203
- }, x && m <= 50 && (m++, typeof x == "object" && (x.placement && (p = x.placement), x.rects && (a = x.rects === !0 ? await s.getElementRects({
204
- reference: t,
205
- floating: e,
206
- strategy: i
207
- }) : x.rects), {
208
- x: f,
209
- y: u
210
- } = kt(a, p, c)), g = -1);
211
- }
212
- return {
213
- x: f,
214
- y: u,
215
- placement: p,
216
- strategy: i,
217
- middlewareData: d
218
- };
219
- };
220
- async function ve(t, e) {
221
- var o;
222
- e === void 0 && (e = {});
223
- const {
224
- x: n,
225
- y: i,
226
- platform: r,
227
- rects: s,
228
- elements: l,
229
- strategy: c
230
- } = t, {
231
- boundary: a = "clippingAncestors",
232
- rootBoundary: f = "viewport",
233
- elementContext: u = "floating",
234
- altBoundary: p = !1,
235
- padding: d = 0
236
- } = pt(e, t), m = xe(d), w = l[p ? u === "floating" ? "reference" : "floating" : u], h = nt(await r.getClippingRect({
237
- element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
238
- boundary: a,
239
- rootBoundary: f,
240
- strategy: c
241
- })), v = u === "floating" ? {
242
- x: n,
243
- y: i,
244
- width: s.floating.width,
245
- height: s.floating.height
246
- } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), A = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
247
- x: 1,
248
- y: 1
249
- } : {
250
- x: 1,
251
- y: 1
252
- }, x = nt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
253
- elements: l,
254
- rect: v,
255
- offsetParent: b,
256
- strategy: c
257
- }) : v);
258
- return {
259
- top: (h.top - x.top + m.top) / A.y,
260
- bottom: (x.bottom - h.bottom + m.bottom) / A.y,
261
- left: (h.left - x.left + m.left) / A.x,
262
- right: (x.right - h.right + m.right) / A.x
263
- };
264
- }
265
- const be = function(t) {
266
- return t === void 0 && (t = {}), {
267
- name: "flip",
268
- options: t,
269
- async fn(e) {
270
- var o, n;
271
- const {
272
- placement: i,
273
- middlewareData: r,
274
- rects: s,
275
- initialPlacement: l,
276
- platform: c,
277
- elements: a
278
- } = e, {
279
- mainAxis: f = !0,
280
- crossAxis: u = !0,
281
- fallbackPlacements: p,
282
- fallbackStrategy: d = "bestFit",
283
- fallbackAxisSideDirection: m = "none",
284
- flipAlignment: g = !0,
285
- ...w
286
- } = pt(t, e);
287
- if ((o = r.arrow) != null && o.alignmentOffset)
288
- return {};
289
- const h = W(i), v = q(l), b = W(l) === l, A = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), x = p || (b || !g ? [et(l)] : me(l)), j = m !== "none";
290
- !p && j && x.push(...ge(l, g, m, A));
291
- const M = [l, ...x], lt = await ve(e, w), K = [];
292
- let U = ((n = r.flip) == null ? void 0 : n.overflows) || [];
293
- if (f && K.push(lt[h]), u) {
294
- const B = pe(i, s, A);
295
- K.push(lt[B[0]], lt[B[1]]);
296
- }
297
- if (U = [...U, {
298
- placement: i,
299
- overflows: K
300
- }], !K.every((B) => B <= 0)) {
301
- var xt, yt;
302
- const B = (((xt = r.flip) == null ? void 0 : xt.index) || 0) + 1, bt = M[B];
303
- if (bt)
304
- return {
305
- data: {
306
- index: B,
307
- overflows: U
308
- },
309
- reset: {
310
- placement: bt
311
- }
312
- };
313
- let Y = (yt = U.filter((N) => N.overflows[0] <= 0).sort((N, T) => N.overflows[1] - T.overflows[1])[0]) == null ? void 0 : yt.placement;
314
- if (!Y)
315
- switch (d) {
316
- case "bestFit": {
317
- var vt;
318
- const N = (vt = U.filter((T) => {
319
- if (j) {
320
- const D = q(T.placement);
321
- return D === v || // Create a bias to the `y` side axis due to horizontal
322
- // reading directions favoring greater width.
323
- D === "y";
324
- }
325
- return !0;
326
- }).map((T) => [T.placement, T.overflows.filter((D) => D > 0).reduce((D, Xt) => D + Xt, 0)]).sort((T, D) => T[1] - D[1])[0]) == null ? void 0 : vt[0];
327
- N && (Y = N);
328
- break;
329
- }
330
- case "initialPlacement":
331
- Y = l;
332
- break;
333
- }
334
- if (i !== Y)
335
- return {
336
- reset: {
337
- placement: Y
338
- }
339
- };
340
- }
341
- return {};
342
- }
343
- };
344
- };
345
- async function Ae(t, e) {
346
- const {
347
- placement: o,
348
- platform: n,
349
- elements: i
350
- } = t, r = await (n.isRTL == null ? void 0 : n.isRTL(i.floating)), s = W(o), l = ot(o), c = q(o) === "y", a = ["left", "top"].includes(s) ? -1 : 1, f = r && c ? -1 : 1, u = pt(e, t);
351
- let {
352
- mainAxis: p,
353
- crossAxis: d,
354
- alignmentAxis: m
355
- } = typeof u == "number" ? {
356
- mainAxis: u,
357
- crossAxis: 0,
358
- alignmentAxis: null
359
- } : {
360
- mainAxis: u.mainAxis || 0,
361
- crossAxis: u.crossAxis || 0,
362
- alignmentAxis: u.alignmentAxis
363
- };
364
- return l && typeof m == "number" && (d = l === "end" ? m * -1 : m), c ? {
365
- x: d * f,
366
- y: p * a
367
- } : {
368
- x: p * a,
369
- y: d * f
370
- };
371
- }
372
- const Re = function(t) {
373
- return t === void 0 && (t = 0), {
374
- name: "offset",
375
- options: t,
376
- async fn(e) {
377
- var o, n;
378
- const {
379
- x: i,
380
- y: r,
381
- placement: s,
382
- middlewareData: l
383
- } = e, c = await Ae(e, t);
384
- return s === ((o = l.offset) == null ? void 0 : o.placement) && (n = l.arrow) != null && n.alignmentOffset ? {} : {
385
- x: i + c.x,
386
- y: r + c.y,
387
- data: {
388
- ...c,
389
- placement: s
390
- }
391
- };
392
- }
393
- };
394
- };
395
- function it() {
396
- return typeof window < "u";
397
- }
398
- function I(t) {
399
- return zt(t) ? (t.nodeName || "").toLowerCase() : "#document";
400
- }
401
- function R(t) {
402
- var e;
403
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
404
- }
405
- function E(t) {
406
- var e;
407
- return (e = (zt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
408
- }
409
- function zt(t) {
410
- return it() ? t instanceof Node || t instanceof R(t).Node : !1;
411
- }
412
- function O(t) {
413
- return it() ? t instanceof Element || t instanceof R(t).Element : !1;
414
- }
415
- function k(t) {
416
- return it() ? t instanceof HTMLElement || t instanceof R(t).HTMLElement : !1;
417
- }
418
- function Et(t) {
419
- return !it() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof R(t).ShadowRoot;
420
- }
421
- function G(t) {
422
- const {
423
- overflow: e,
424
- overflowX: o,
425
- overflowY: n,
426
- display: i
427
- } = _(t);
428
- return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(i);
429
- }
430
- function Oe(t) {
431
- return ["table", "td", "th"].includes(I(t));
432
- }
433
- function st(t) {
434
- return [":popover-open", ":modal"].some((e) => {
435
- try {
436
- return t.matches(e);
437
- } catch {
438
- return !1;
439
- }
440
- });
441
- }
442
- function mt(t) {
443
- const e = ht(), o = O(t) ? _(t) : t;
444
- return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
445
- }
446
- function _e(t) {
447
- let e = P(t);
448
- for (; k(e) && !H(e); ) {
449
- if (mt(e))
450
- return e;
451
- if (st(e))
452
- return null;
453
- e = P(e);
454
- }
455
- return null;
456
- }
457
- function ht() {
458
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
459
- }
460
- function H(t) {
461
- return ["html", "body", "#document"].includes(I(t));
462
- }
463
- function _(t) {
464
- return R(t).getComputedStyle(t);
465
- }
466
- function rt(t) {
467
- return O(t) ? {
468
- scrollLeft: t.scrollLeft,
469
- scrollTop: t.scrollTop
470
- } : {
471
- scrollLeft: t.scrollX,
472
- scrollTop: t.scrollY
473
- };
474
- }
475
- function P(t) {
476
- if (I(t) === "html")
477
- return t;
478
- const e = (
479
- // Step into the shadow DOM of the parent of a slotted node.
480
- t.assignedSlot || // DOM Element detected.
481
- t.parentNode || // ShadowRoot detected.
482
- Et(t) && t.host || // Fallback.
483
- E(t)
484
- );
485
- return Et(e) ? e.host : e;
486
- }
487
- function Wt(t) {
488
- const e = P(t);
489
- return H(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : k(e) && G(e) ? e : Wt(e);
490
- }
491
- function X(t, e, o) {
492
- var n;
493
- e === void 0 && (e = []), o === void 0 && (o = !0);
494
- const i = Wt(t), r = i === ((n = t.ownerDocument) == null ? void 0 : n.body), s = R(i);
495
- if (r) {
496
- const l = dt(s);
497
- return e.concat(s, s.visualViewport || [], G(i) ? i : [], l && o ? X(l) : []);
498
- }
499
- return e.concat(i, X(i, [], o));
500
- }
501
- function dt(t) {
502
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
503
- }
504
- function Ht(t) {
505
- const e = _(t);
506
- let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
507
- const i = k(t), r = i ? t.offsetWidth : o, s = i ? t.offsetHeight : n, l = tt(o) !== r || tt(n) !== s;
508
- return l && (o = r, n = s), {
509
- width: o,
510
- height: n,
511
- $: l
512
- };
513
- }
514
- function gt(t) {
515
- return O(t) ? t : t.contextElement;
516
- }
517
- function z(t) {
518
- const e = gt(t);
519
- if (!k(e))
520
- return C(1);
521
- const o = e.getBoundingClientRect(), {
522
- width: n,
523
- height: i,
524
- $: r
525
- } = Ht(e);
526
- let s = (r ? tt(o.width) : o.width) / n, l = (r ? tt(o.height) : o.height) / i;
527
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
528
- x: s,
529
- y: l
530
- };
531
- }
532
- const Ce = /* @__PURE__ */ C(0);
533
- function It(t) {
534
- const e = R(t);
535
- return !ht() || !e.visualViewport ? Ce : {
536
- x: e.visualViewport.offsetLeft,
537
- y: e.visualViewport.offsetTop
538
- };
539
- }
540
- function ke(t, e, o) {
541
- return e === void 0 && (e = !1), !o || e && o !== R(t) ? !1 : e;
542
- }
543
- function $(t, e, o, n) {
544
- e === void 0 && (e = !1), o === void 0 && (o = !1);
545
- const i = t.getBoundingClientRect(), r = gt(t);
546
- let s = C(1);
547
- e && (n ? O(n) && (s = z(n)) : s = z(t));
548
- const l = ke(r, o, n) ? It(r) : C(0);
549
- let c = (i.left + l.x) / s.x, a = (i.top + l.y) / s.y, f = i.width / s.x, u = i.height / s.y;
550
- if (r) {
551
- const p = R(r), d = n && O(n) ? R(n) : n;
552
- let m = p, g = dt(m);
553
- for (; g && n && d !== m; ) {
554
- const w = z(g), h = g.getBoundingClientRect(), v = _(g), b = h.left + (g.clientLeft + parseFloat(v.paddingLeft)) * w.x, A = h.top + (g.clientTop + parseFloat(v.paddingTop)) * w.y;
555
- c *= w.x, a *= w.y, f *= w.x, u *= w.y, c += b, a += A, m = R(g), g = dt(m);
556
- }
557
- }
558
- return nt({
559
- width: f,
560
- height: u,
561
- x: c,
562
- y: a
563
- });
564
- }
565
- function wt(t, e) {
566
- const o = rt(t).scrollLeft;
567
- return e ? e.left + o : $(E(t)).left + o;
568
- }
569
- function jt(t, e, o) {
570
- o === void 0 && (o = !1);
571
- const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - (o ? 0 : (
572
- // RTL <body> scrollbar.
573
- wt(t, n)
574
- )), r = n.top + e.scrollTop;
575
- return {
576
- x: i,
577
- y: r
578
- };
579
- }
580
- function Ee(t) {
581
- let {
582
- elements: e,
583
- rect: o,
584
- offsetParent: n,
585
- strategy: i
586
- } = t;
587
- const r = i === "fixed", s = E(n), l = e ? st(e.floating) : !1;
588
- if (n === s || l && r)
589
- return o;
590
- let c = {
591
- scrollLeft: 0,
592
- scrollTop: 0
593
- }, a = C(1);
594
- const f = C(0), u = k(n);
595
- if ((u || !u && !r) && ((I(n) !== "body" || G(s)) && (c = rt(n)), k(n))) {
596
- const d = $(n);
597
- a = z(n), f.x = d.x + n.clientLeft, f.y = d.y + n.clientTop;
598
- }
599
- const p = s && !u && !r ? jt(s, c, !0) : C(0);
600
- return {
601
- width: o.width * a.x,
602
- height: o.height * a.y,
603
- x: o.x * a.x - c.scrollLeft * a.x + f.x + p.x,
604
- y: o.y * a.y - c.scrollTop * a.y + f.y + p.y
605
- };
606
- }
607
- function Le(t) {
608
- return Array.from(t.getClientRects());
609
- }
610
- function Te(t) {
611
- const e = E(t), o = rt(t), n = t.ownerDocument.body, i = V(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = V(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
612
- let s = -o.scrollLeft + wt(t);
613
- const l = -o.scrollTop;
614
- return _(n).direction === "rtl" && (s += V(e.clientWidth, n.clientWidth) - i), {
615
- width: i,
616
- height: r,
617
- x: s,
618
- y: l
619
- };
620
- }
621
- function De(t, e) {
622
- const o = R(t), n = E(t), i = o.visualViewport;
623
- let r = n.clientWidth, s = n.clientHeight, l = 0, c = 0;
624
- if (i) {
625
- r = i.width, s = i.height;
626
- const a = ht();
627
- (!a || a && e === "fixed") && (l = i.offsetLeft, c = i.offsetTop);
628
- }
629
- return {
630
- width: r,
631
- height: s,
632
- x: l,
633
- y: c
634
- };
635
- }
636
- function Se(t, e) {
637
- const o = $(t, !0, e === "fixed"), n = o.top + t.clientTop, i = o.left + t.clientLeft, r = k(t) ? z(t) : C(1), s = t.clientWidth * r.x, l = t.clientHeight * r.y, c = i * r.x, a = n * r.y;
638
- return {
639
- width: s,
640
- height: l,
641
- x: c,
642
- y: a
643
- };
644
- }
645
- function Lt(t, e, o) {
646
- let n;
647
- if (e === "viewport")
648
- n = De(t, o);
649
- else if (e === "document")
650
- n = Te(E(t));
651
- else if (O(e))
652
- n = Se(e, o);
653
- else {
654
- const i = It(t);
655
- n = {
656
- x: e.x - i.x,
657
- y: e.y - i.y,
658
- width: e.width,
659
- height: e.height
660
- };
661
- }
662
- return nt(n);
663
- }
664
- function Ut(t, e) {
665
- const o = P(t);
666
- return o === e || !O(o) || H(o) ? !1 : _(o).position === "fixed" || Ut(o, e);
667
- }
668
- function Fe(t, e) {
669
- const o = e.get(t);
670
- if (o)
671
- return o;
672
- let n = X(t, [], !1).filter((l) => O(l) && I(l) !== "body"), i = null;
673
- const r = _(t).position === "fixed";
674
- let s = r ? P(t) : t;
675
- for (; O(s) && !H(s); ) {
676
- const l = _(s), c = mt(s);
677
- !c && l.position === "fixed" && (i = null), (r ? !c && !i : !c && l.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || G(s) && !c && Ut(t, s)) ? n = n.filter((f) => f !== s) : i = l, s = P(s);
678
- }
679
- return e.set(t, n), n;
680
- }
681
- function Pe(t) {
682
- let {
683
- element: e,
684
- boundary: o,
685
- rootBoundary: n,
686
- strategy: i
687
- } = t;
688
- const s = [...o === "clippingAncestors" ? st(e) ? [] : Fe(e, this._c) : [].concat(o), n], l = s[0], c = s.reduce((a, f) => {
689
- const u = Lt(e, f, i);
690
- return a.top = V(u.top, a.top), a.right = ft(u.right, a.right), a.bottom = ft(u.bottom, a.bottom), a.left = V(u.left, a.left), a;
691
- }, Lt(e, l, i));
692
- return {
693
- width: c.right - c.left,
694
- height: c.bottom - c.top,
695
- x: c.left,
696
- y: c.top
697
- };
698
- }
699
- function Be(t) {
700
- const {
701
- width: e,
702
- height: o
703
- } = Ht(t);
704
- return {
705
- width: e,
706
- height: o
707
- };
708
- }
709
- function $e(t, e, o) {
710
- const n = k(e), i = E(e), r = o === "fixed", s = $(t, !0, r, e);
711
- let l = {
712
- scrollLeft: 0,
713
- scrollTop: 0
714
- };
715
- const c = C(0);
716
- if (n || !n && !r)
717
- if ((I(e) !== "body" || G(i)) && (l = rt(e)), n) {
718
- const p = $(e, !0, r, e);
719
- c.x = p.x + e.clientLeft, c.y = p.y + e.clientTop;
720
- } else
721
- i && (c.x = wt(i));
722
- const a = i && !n && !r ? jt(i, l) : C(0), f = s.left + l.scrollLeft - c.x - a.x, u = s.top + l.scrollTop - c.y - a.y;
723
- return {
724
- x: f,
725
- y: u,
726
- width: s.width,
727
- height: s.height
728
- };
729
- }
730
- function at(t) {
731
- return _(t).position === "static";
732
- }
733
- function Tt(t, e) {
734
- if (!k(t) || _(t).position === "fixed")
735
- return null;
736
- if (e)
737
- return e(t);
738
- let o = t.offsetParent;
739
- return E(t) === o && (o = o.ownerDocument.body), o;
740
- }
741
- function Yt(t, e) {
742
- const o = R(t);
743
- if (st(t))
744
- return o;
745
- if (!k(t)) {
746
- let i = P(t);
747
- for (; i && !H(i); ) {
748
- if (O(i) && !at(i))
749
- return i;
750
- i = P(i);
751
- }
752
- return o;
753
- }
754
- let n = Tt(t, e);
755
- for (; n && Oe(n) && at(n); )
756
- n = Tt(n, e);
757
- return n && H(n) && at(n) && !mt(n) ? o : n || _e(t) || o;
758
- }
759
- const Me = async function(t) {
760
- const e = this.getOffsetParent || Yt, o = this.getDimensions, n = await o(t.floating);
761
- return {
762
- reference: $e(t.reference, await e(t.floating), t.strategy),
763
- floating: {
764
- x: 0,
765
- y: 0,
766
- width: n.width,
767
- height: n.height
768
- }
769
- };
770
- };
771
- function Ne(t) {
772
- return _(t).direction === "rtl";
773
- }
774
- const Ve = {
775
- convertOffsetParentRelativeRectToViewportRelativeRect: Ee,
776
- getDocumentElement: E,
777
- getClippingRect: Pe,
778
- getOffsetParent: Yt,
779
- getElementRects: Me,
780
- getClientRects: Le,
781
- getDimensions: Be,
782
- getScale: z,
783
- isElement: O,
784
- isRTL: Ne
785
- };
786
- function qt(t, e) {
787
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
788
- }
789
- function ze(t, e) {
790
- let o = null, n;
791
- const i = E(t);
792
- function r() {
793
- var l;
794
- clearTimeout(n), (l = o) == null || l.disconnect(), o = null;
795
- }
796
- function s(l, c) {
797
- l === void 0 && (l = !1), c === void 0 && (c = 1), r();
798
- const a = t.getBoundingClientRect(), {
799
- left: f,
800
- top: u,
801
- width: p,
802
- height: d
803
- } = a;
804
- if (l || e(), !p || !d)
805
- return;
806
- const m = J(u), g = J(i.clientWidth - (f + p)), w = J(i.clientHeight - (u + d)), h = J(f), b = {
807
- rootMargin: -m + "px " + -g + "px " + -w + "px " + -h + "px",
808
- threshold: V(0, ft(1, c)) || 1
809
- };
810
- let A = !0;
811
- function x(j) {
812
- const M = j[0].intersectionRatio;
813
- if (M !== c) {
814
- if (!A)
815
- return s();
816
- M ? s(!1, M) : n = setTimeout(() => {
817
- s(!1, 1e-7);
818
- }, 1e3);
819
- }
820
- M === 1 && !qt(a, t.getBoundingClientRect()) && s(), A = !1;
821
- }
822
- try {
823
- o = new IntersectionObserver(x, {
824
- ...b,
825
- // Handle <iframe>s
826
- root: i.ownerDocument
827
- });
828
- } catch {
829
- o = new IntersectionObserver(x, b);
830
- }
831
- o.observe(t);
832
- }
833
- return s(!0), r;
834
- }
835
- function We(t, e, o, n) {
836
- n === void 0 && (n = {});
837
- const {
838
- ancestorScroll: i = !0,
839
- ancestorResize: r = !0,
840
- elementResize: s = typeof ResizeObserver == "function",
841
- layoutShift: l = typeof IntersectionObserver == "function",
842
- animationFrame: c = !1
843
- } = n, a = gt(t), f = i || r ? [...a ? X(a) : [], ...X(e)] : [];
844
- f.forEach((h) => {
845
- i && h.addEventListener("scroll", o, {
846
- passive: !0
847
- }), r && h.addEventListener("resize", o);
848
- });
849
- const u = a && l ? ze(a, o) : null;
850
- let p = -1, d = null;
851
- s && (d = new ResizeObserver((h) => {
852
- let [v] = h;
853
- v && v.target === a && d && (d.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
854
- var b;
855
- (b = d) == null || b.observe(e);
856
- })), o();
857
- }), a && !c && d.observe(a), d.observe(e));
858
- let m, g = c ? $(t) : null;
859
- c && w();
860
- function w() {
861
- const h = $(t);
862
- g && !qt(g, h) && o(), g = h, m = requestAnimationFrame(w);
863
- }
864
- return o(), () => {
865
- var h;
866
- f.forEach((v) => {
867
- i && v.removeEventListener("scroll", o), r && v.removeEventListener("resize", o);
868
- }), u == null || u(), (h = d) == null || h.disconnect(), d = null, c && cancelAnimationFrame(m);
869
- };
870
- }
871
- const Dt = Re, St = be, Ft = (t, e, o) => {
872
- const n = /* @__PURE__ */ new Map(), i = {
873
- platform: Ve,
874
- ...o
875
- }, r = {
876
- ...i.platform,
877
- _c: n
878
- };
879
- return ye(t, e, {
880
- ...i,
881
- platform: r
882
- });
883
- }, He = ["data-opened"], Ie = {
884
- key: 0,
885
- class: "text-sm text-secondary-content px-3 py-2 text-left"
886
- }, gn = /* @__PURE__ */ Bt({
887
- __name: "OneDropdownAuto",
888
- props: Gt,
889
- emits: ["open", "close"],
890
- setup(t, { emit: e }) {
891
- const o = t, n = Q(!1), i = Q(null), r = Q(null);
892
- let s = null;
893
- Zt(n, (f) => {
894
- f && r.value && i.value ? (Ft(r.value, i.value, {
895
- placement: o.stick ? o.stick : "bottom-start",
896
- // Розташування меню нижче кнопки, вирівняне зліва
897
- middleware: [Dt(5), St()]
898
- // Відступ у 4px від кнопки
899
- }).then(({ x: u, y: p }) => {
900
- Object.assign(i.value.style, {
901
- left: `${u}px`,
902
- top: `${p}px`
903
- });
904
- }), s = We(r.value, i.value, () => {
905
- Ft(r.value, i.value, {
906
- placement: o.stick ? o.stick : "bottom-start",
907
- middleware: [Dt(4), St()]
908
- }).then(({ x: u, y: p }) => {
909
- Object.assign(i.value.style, {
910
- left: `${u}px`,
911
- top: `${p}px`
912
- });
913
- });
914
- })) : s && (s(), s = null);
915
- }), te(() => {
916
- s && s();
917
- });
918
- const l = e, c = () => {
919
- n.value = !n.value, n.value ? l("open") : l("close");
920
- };
921
- ee("OneDropdown", {
922
- onToggle: c
923
- });
924
- const a = $t(() => [
925
- "absolute z-10 w-fit rounded-md bg-white",
926
- "py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
927
- "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
928
- ]);
929
- return (f, u) => (L(), F("div", {
930
- class: "relative inline-block",
931
- "data-opened": n.value
932
- }, [
933
- y("div", {
934
- ref_key: "buttonRef",
935
- ref: r
936
- }, [
937
- At(f.$slots, "button", Rt(Ot({ onToggle: c, isExpanded: n.value })))
938
- ], 512),
939
- n.value ? (L(), F("div", {
940
- key: 0,
941
- class: "fixed top-0 left-0 w-screen h-screen z-10",
942
- onClick: c
943
- })) : Z("", !0),
944
- ne(y("div", {
945
- ref_key: "menuRef",
946
- ref: i,
947
- class: Mt(["menu", a.value]),
948
- role: "menu",
949
- "aria-orientation": "vertical",
950
- tabindex: "-1",
951
- style: { display: "none" }
952
- }, [
953
- f.title ? (L(), F("div", Ie, S(f.title), 1)) : Z("", !0),
954
- At(f.$slots, "menu", Rt(Ot({ onToggle: c })))
955
- ], 2), [
956
- [oe, n.value]
957
- ])
958
- ], 8, He));
959
- }
960
- }), je = {}, Ue = { class: "border-t border-secondary-stroke my-1" };
961
- function Ye(t, e) {
962
- return L(), F("div", Ue);
963
- }
964
- const wn = /* @__PURE__ */ ae(je, [["render", Ye]]), qe = ["onClick"], Xe = { class: "grid" }, Ge = { class: "font-semibold px-3" }, Ke = { class: "rounded-lg m-3 border" }, Je = {
965
- class: "space-x-2 flex items-center px-3 py-2",
966
- style: { width: "300px" }
967
- }, Qe = { class: "flex-shrink-0" }, Ze = { class: "w-full text-left" }, tn = { class: "flex-shrink-0" }, en = { class: "px-3 py-2" }, nn = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, on = {
968
- key: 0,
969
- class: "space-y-2"
970
- }, sn = ["onClick"], rn = { class: "pl-2" }, ln = { class: "text-sm mt-1" }, cn = { class: "text-xs mt-1" }, Pt = 3, xn = /* @__PURE__ */ Bt({
971
- __name: "OneBrowserMenuGrid",
972
- props: Kt,
973
- setup(t) {
974
- const e = t, o = () => {
975
- typeof e.onChange == "function" && e.onChange();
976
- }, n = Q(!1), i = $t(() => e.apps ? n.value ? e.apps : e.apps.slice(0, Pt) : []), r = () => {
977
- n.value = !n.value;
978
- }, s = (l) => {
979
- typeof e.onApp == "function" && e.onApp(l);
980
- };
981
- return (l, c) => (L(), ie(Jt, { stick: "right" }, {
982
- button: _t(({ onToggle: a, isExpanded: f }) => [
983
- y("button", {
984
- onClick: a,
985
- class: Mt(["p-1 rounded-md hover:bg-secondary-10", [f ? "bg-secondary-25" : ""]])
986
- }, [
987
- ct(se(Qt), {
988
- class: "text-secondary-base",
989
- style: re(`width: ${l.iconSize}px; height: ${l.iconSize}px`)
990
- }, null, 8, ["style"])
991
- ], 10, qe)
992
- ]),
993
- menu: _t(() => {
994
- var a, f, u, p;
995
- return [
996
- y("div", Xe, [
997
- y("div", Ge, S((a = l.workspace) == null ? void 0 : a.title), 1),
998
- y("div", Ke, [
999
- y("div", Je, [
1000
- y("div", Qe, [
1001
- ct(Ct, {
1002
- text: ((f = l.workspace) == null ? void 0 : f.name) || "",
1003
- src: (u = l.workspace) == null ? void 0 : u.photo_url,
1004
- size: 44,
1005
- rounded: !1,
1006
- class: "mx-auto"
1007
- }, null, 8, ["text", "src"])
1008
- ]),
1009
- y("div", Ze, S((p = l.workspace) == null ? void 0 : p.name), 1),
1010
- y("div", tn, [
1011
- y("button", {
1012
- class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
1013
- onClick: o
1014
- }, S(l.changeLabel), 1)
1015
- ])
1016
- ]),
1017
- c[0] || (c[0] = y("hr", null, null, -1))
1018
- ])
1019
- ]),
1020
- y("div", en, [
1021
- y("div", nn, S(l.appsTitle), 1),
1022
- y("div", null, [
1023
- l.apps && l.apps.length ? (L(), F("div", on, [
1024
- (L(!0), F(le, null, ce(i.value, (d) => (L(), F("div", {
1025
- key: d.id,
1026
- onClick: (m) => s(d),
1027
- class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
1028
- }, [
1029
- ct(Ct, {
1030
- text: d.name,
1031
- src: d.photo_url,
1032
- size: 44,
1033
- rounded: !1
1034
- }, null, 8, ["text", "src"]),
1035
- y("div", rn, [
1036
- y("p", ln, S(d.name), 1),
1037
- y("p", cn, S(d.short), 1)
1038
- ])
1039
- ], 8, sn))), 128))
1040
- ])) : Z("", !0),
1041
- l.apps && l.apps.length > Pt ? (L(), F("button", {
1042
- key: 1,
1043
- onClick: r,
1044
- class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
1045
- }, S(n.value ? "Приховати" : "Дивитися всі"), 1)) : Z("", !0)
1046
- ])
1047
- ])
1048
- ];
1049
- }),
1050
- _: 1
1051
- }));
1052
- }
1053
- });
9
+ import "../_plugin-vue_export-helper-dad06003.js";
1054
10
  export {
1055
- bn as OneBrowserMenu,
1056
- xn as OneBrowserMenuGrid,
1057
- Jt as OneDropdown,
1058
- gn as OneDropdownAuto,
1059
- wn as OneDropdownDivider,
1060
- An as OneDropdownItem,
1061
- Rn as OneHelpMenu,
1062
- On as OneUserMenu
11
+ m as OneBrowserMenu,
12
+ M as OneBrowserMenuGrid,
13
+ O as OneDropdown,
14
+ c as OneDropdownAuto,
15
+ b as OneDropdownDivider,
16
+ d as OneDropdownItem,
17
+ f as OneDropdownSelect,
18
+ w as OneHelpMenu,
19
+ D as OneUserMenu
1063
20
  };