nightshade 1.0.2 → 1.1.0

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.
@@ -0,0 +1,1004 @@
1
+ var M = Object.defineProperty;
2
+ var r = (e, n) => M(e, "name", { value: n, configurable: !0 });
3
+ import { openBlock as d, createBlock as b, resolveDynamicComponent as w, normalizeClass as p, withCtx as _, renderSlot as h, createElementBlock as c, createCommentVNode as f, toDisplayString as S, Transition as D, createElementVNode as y, resolveComponent as I, withKeys as x, Fragment as $, renderList as R, Teleport as E, withModifiers as z, normalizeStyle as H, createVNode as L, mergeProps as T } from "vue";
4
+ import { L as F, g as O } from "./ListNavController-drNtDwz9.js";
5
+ const m = /* @__PURE__ */ r((e, n) => {
6
+ const t = e.__vccOpts || e;
7
+ for (const [o, a] of n)
8
+ t[o] = a;
9
+ return t;
10
+ }, "_export_sfc"), P = {
11
+ props: {
12
+ label: { type: String },
13
+ title: { type: String },
14
+ icon: { type: String },
15
+ iconPos: { type: String, default: "left" },
16
+ kind: { type: String, default: "link-default" },
17
+ hoverKind: { type: String },
18
+ customTag: { type: String },
19
+ href: { type: String },
20
+ debounce: { type: Number, default: 0 },
21
+ disabled: { type: Boolean, default: !1 },
22
+ size: { type: String, default: "normal" },
23
+ square: { type: Boolean, default: !1 },
24
+ block: { type: Boolean, default: !1 },
25
+ round: { type: Boolean, default: !1 },
26
+ outline: { type: Boolean, default: !1 },
27
+ pseudoFocus: { type: Boolean, default: !1 },
28
+ pseudoHover: { type: Boolean, default: !1 },
29
+ pseudoActive: { type: Boolean, default: !1 }
30
+ },
31
+ data() {
32
+ return {
33
+ hover: !1,
34
+ blocked: !1
35
+ };
36
+ },
37
+ computed: {
38
+ tagName() {
39
+ return this.customTag ?? "button";
40
+ },
41
+ actualKind() {
42
+ const { kind: e, hoverKind: n, hover: t } = this;
43
+ return t ? n ?? e : e;
44
+ }
45
+ },
46
+ methods: {
47
+ // TODO add debounce
48
+ }
49
+ }, G = {
50
+ key: 0,
51
+ class: "Label"
52
+ };
53
+ function j(e, n, t, o, a, s) {
54
+ return d(), b(w(s.tagName), {
55
+ ref: "button",
56
+ class: p(["Btn button", [
57
+ `Btn-${t.size}`,
58
+ `Btn-${s.actualKind}`,
59
+ `Btn-iconPos-${t.iconPos}`,
60
+ {
61
+ "Btn-disabled": t.disabled || a.blocked,
62
+ "Btn-square": t.square,
63
+ "Btn-round": t.round,
64
+ "Btn-outline": t.outline,
65
+ "Btn-block": t.block,
66
+ "Btn-pseudo-focus": t.pseudoFocus,
67
+ "Btn-pseudo-hover": t.pseudoHover,
68
+ "Btn-pseudo-active": t.pseudoActive
69
+ }
70
+ ]]),
71
+ disabled: t.disabled || a.blocked,
72
+ title: t.title ?? t.label,
73
+ href: t.href,
74
+ onMouseenter: n[0] || (n[0] = (i) => a.hover = !0),
75
+ onMouseleave: n[1] || (n[1] = (i) => a.hover = !1)
76
+ }, {
77
+ default: _(() => [
78
+ h(e.$slots, "icon", {
79
+ hover: a.hover,
80
+ blocked: a.blocked
81
+ }, () => [
82
+ t.icon ? (d(), c("i", {
83
+ key: 0,
84
+ class: p([t.icon, "Icon"])
85
+ }, null, 2)) : f("", !0)
86
+ ], !0),
87
+ t.label ? (d(), c("span", G, S(t.label), 1)) : f("", !0),
88
+ h(e.$slots, "default", {
89
+ hover: a.hover,
90
+ blocked: a.blocked
91
+ }, void 0, !0)
92
+ ]),
93
+ _: 3
94
+ }, 40, ["class", "disabled", "title", "href"]);
95
+ }
96
+ r(j, "_sfc_render$e");
97
+ const K = /* @__PURE__ */ m(P, [["render", j], ["__scopeId", "data-v-43785b81"]]), W = {
98
+ props: {
99
+ dir: { type: String, default: "bottom" },
100
+ align: { type: String, default: "start" }
101
+ }
102
+ }, Z = { class: "Body" };
103
+ function Q(e, n, t, o, a, s) {
104
+ return d(), b(D, {
105
+ name: "fade-" + t.dir,
106
+ appear: ""
107
+ }, {
108
+ default: _(() => [
109
+ y("div", {
110
+ class: p(["Bubble", [
111
+ `Bubble-${t.dir}`,
112
+ `Bubble-${t.align}`
113
+ ]])
114
+ }, [
115
+ n[0] || (n[0] = y("div", { class: "Arrow" }, null, -1)),
116
+ y("div", Z, [
117
+ h(e.$slots, "default", {}, void 0, !0)
118
+ ])
119
+ ], 2)
120
+ ]),
121
+ _: 3
122
+ }, 8, ["name"]);
123
+ }
124
+ r(Q, "_sfc_render$d");
125
+ const q = /* @__PURE__ */ m(W, [["render", Q], ["__scopeId", "data-v-2bf83119"]]), U = {
126
+ props: {
127
+ size: { type: String, default: "normal" }
128
+ }
129
+ };
130
+ function J(e, n, t, o, a, s) {
131
+ return d(), c("div", {
132
+ class: p(["Circle", [
133
+ `Circle-${t.size}`
134
+ ]])
135
+ }, [
136
+ h(e.$slots, "default", {}, void 0, !0)
137
+ ], 2);
138
+ }
139
+ r(J, "_sfc_render$c");
140
+ const X = /* @__PURE__ */ m(U, [["render", J], ["__scopeId", "data-v-48fdb4ac"]]);
141
+ function Y(e, n, t = "b") {
142
+ return e.split("").map((o, a) => n.includes(a) ? `<${t}>${o}</${t}>` : o).join("");
143
+ }
144
+ r(Y, "formatHighlight");
145
+ function V(e) {
146
+ return e.toLowerCase().replace(/[^\p{L}\p{N}]/gu, "");
147
+ }
148
+ r(V, "normalizeToken");
149
+ function g(e, n) {
150
+ const t = /(?:[A-Z]?[a-z0-9]+(?=[A-Z]))|(?:[a-zA-Z0-9]+[^A-Za-z0-9]*)|(?:[^A-Za-z0-9]*(?=[a-zA-Z0-9]))/g;
151
+ t.lastIndex = n;
152
+ const o = t.exec(e);
153
+ return o == null ? e.length : o.index + o[0].length;
154
+ }
155
+ r(g, "nextTokenIdx");
156
+ function N(e) {
157
+ const n = [];
158
+ let t = 0;
159
+ for (; t < e.length; ) {
160
+ const o = g(e, t), a = e.substring(t, o).replace(/[^a-z0-9]/gi, "");
161
+ a.length > 0 && n.push(V(a)), t = o;
162
+ }
163
+ return n;
164
+ }
165
+ r(N, "tokenize");
166
+ const ee = [
167
+ {
168
+ matcher: /* @__PURE__ */ r((e, n) => ne(e, n), "matcher"),
169
+ bias: /* @__PURE__ */ r((e) => e.biasTokensStrict ?? 16, "bias")
170
+ },
171
+ {
172
+ matcher: /* @__PURE__ */ r((e, n) => C(e, n), "matcher"),
173
+ bias: /* @__PURE__ */ r((e) => e.biasLetterTokens ?? 8, "bias")
174
+ },
175
+ {
176
+ matcher: /* @__PURE__ */ r((e, n) => se(e, n), "matcher"),
177
+ bias: /* @__PURE__ */ r((e) => e.biasTokensLenient ?? 4, "bias")
178
+ },
179
+ {
180
+ matcher: /* @__PURE__ */ r((e, n) => ae(e, n), "matcher"),
181
+ bias: /* @__PURE__ */ r((e) => e.biasWildcard ?? 1, "bias")
182
+ }
183
+ ];
184
+ function te(e, n, t = {}) {
185
+ const o = ee.slice().sort((a, s) => {
186
+ const i = a.bias(t), l = s.bias(t);
187
+ return i < l ? 1 : -1;
188
+ });
189
+ for (const a of o) {
190
+ const s = a.bias(t);
191
+ if (s === 0)
192
+ continue;
193
+ const i = a.matcher(e, n);
194
+ if (i.length > 0) {
195
+ const l = oe(i), u = Y(n, i, t.highlightTag ?? "b");
196
+ return {
197
+ score: l * s,
198
+ matches: i,
199
+ highlight: u
200
+ };
201
+ }
202
+ }
203
+ return {
204
+ score: 0,
205
+ matches: [],
206
+ highlight: n
207
+ };
208
+ }
209
+ r(te, "fuzzyMatch");
210
+ function ne(e, n, t = 0) {
211
+ const o = N(e), a = [], s = n.toLowerCase();
212
+ let i = t;
213
+ for (; o.length > 0; ) {
214
+ if (i >= n.length) {
215
+ const k = g(n, t);
216
+ return k < n.length ? C(e, n, k) : [];
217
+ }
218
+ const l = o[0], u = i + l.length;
219
+ if (s.substring(i, u) === l) {
220
+ for (let k = i; k < u; k++)
221
+ a.push(k);
222
+ i = Math.min(g(n, u), g(n, i)), o.shift();
223
+ } else
224
+ i = g(n, i);
225
+ }
226
+ return a;
227
+ }
228
+ r(ne, "matchTokensStrict");
229
+ function C(e, n, t = 0) {
230
+ const o = [];
231
+ let a = t;
232
+ const s = V(e).split("");
233
+ for (; s.length > 0; ) {
234
+ if (a >= n.length) {
235
+ const l = g(n, t);
236
+ return l < n.length ? C(e, n, l) : [];
237
+ }
238
+ s[0] === n.charAt(a).toLowerCase() ? (o.push(a), a += 1, s.shift()) : a = g(n, a);
239
+ }
240
+ return o;
241
+ }
242
+ r(C, "matchLetterTokens");
243
+ function se(e, n) {
244
+ const t = N(e), o = [], a = n.toLowerCase();
245
+ let s = 0;
246
+ e: for (; s < n.length; ) {
247
+ for (const i of t) {
248
+ const l = s + i.length;
249
+ if (a.substring(s, l) === i) {
250
+ for (let v = s; v < l; v++)
251
+ o.push(v);
252
+ s = Math.min(g(n, l), g(n, s));
253
+ continue e;
254
+ }
255
+ }
256
+ s = g(n, s);
257
+ }
258
+ return o;
259
+ }
260
+ r(se, "matchTokensLenient");
261
+ function ae(e, n) {
262
+ const t = [];
263
+ let o = 0;
264
+ e = e.toLowerCase().replace(/\s+/g, "");
265
+ const a = n.toLowerCase();
266
+ for (let s = 0; s < e.length; s++) {
267
+ const i = e.charAt(s).toLowerCase(), l = a.indexOf(i, o);
268
+ if (l === -1)
269
+ return [];
270
+ t.push(l), o = l + 1;
271
+ }
272
+ return t;
273
+ }
274
+ r(ae, "matchWildcard");
275
+ function oe(e) {
276
+ const n = e.length;
277
+ return e.reduce((t, o) => t + n / (1 + o), 0);
278
+ }
279
+ r(oe, "fuzzyMatchScore");
280
+ function ie(e, n, t = {}) {
281
+ const o = [];
282
+ for (const [a, s] of n.entries()) {
283
+ const i = te(e, s, t);
284
+ if (i.score > 0) {
285
+ const { score: l, matches: u, highlight: v } = i;
286
+ o.push({
287
+ score: l,
288
+ matches: u,
289
+ source: s,
290
+ index: a,
291
+ highlight: v
292
+ });
293
+ }
294
+ }
295
+ return o.sort((a, s) => a.score === s.score ? a.source > s.source ? 1 : -1 : a.score > s.score ? -1 : 1);
296
+ }
297
+ r(ie, "fuzzySearch");
298
+ const le = {
299
+ props: {
300
+ dir: { type: String },
301
+ align: { type: String },
302
+ size: { type: String },
303
+ items: { type: Array },
304
+ atCursor: { type: Boolean },
305
+ anchorRef: { type: String },
306
+ anchorDir: { type: String },
307
+ search: { type: Boolean },
308
+ autoDismiss: { type: Boolean, default: !0 }
309
+ },
310
+ emits: ["hide"],
311
+ data() {
312
+ return {
313
+ listNav: new F({
314
+ selector: "[data-menu-item-id]",
315
+ resolveId: /* @__PURE__ */ r((e) => e.getAttribute("data-menu-item-id"), "resolveId")
316
+ }),
317
+ searchQuery: "",
318
+ filteredItems: this.items
319
+ };
320
+ },
321
+ unmounted() {
322
+ this.listNav.destroy();
323
+ },
324
+ methods: {
325
+ initialize() {
326
+ this.listNav.mount(this.$refs.menu);
327
+ },
328
+ isItemSelected(e) {
329
+ return this.listNav.selection.isSelected(String(e));
330
+ },
331
+ activate() {
332
+ const e = this.listNav.selection.getFirst(), n = this.filteredItems[e];
333
+ n && this.activateItem(n);
334
+ },
335
+ activateItem(e) {
336
+ e.disabled || !e.activate || (e.activate(), this.autoDismiss ? this.hide() : e.checked = !e.checked);
337
+ },
338
+ doSearch() {
339
+ const e = this.searchQuery.trim();
340
+ if (!e) {
341
+ this.filteredItems = this.items;
342
+ return;
343
+ }
344
+ const n = ie(e, this.items.map((t) => t.title ?? ""));
345
+ this.filteredItems = n.map((t) => this.items[t.index]);
346
+ },
347
+ selectSearch() {
348
+ this.$refs.search && this.$refs.search.$el.querySelector("input").focus();
349
+ },
350
+ hide() {
351
+ this.$emit("hide");
352
+ }
353
+ }
354
+ }, re = {
355
+ key: 0,
356
+ class: "Separator"
357
+ }, de = ["textContent"], ue = ["data-menu-item-id", "onClick"], ce = { class: "ItemLine" }, fe = { class: "ItemTitle" }, he = {
358
+ key: 1,
359
+ class: "fas fa-check fa-sm"
360
+ }, pe = {
361
+ key: 0,
362
+ class: "ItemDescription"
363
+ };
364
+ function me(e, n, t, o, a, s) {
365
+ const i = I("InputText"), l = I("ContextPopup");
366
+ return d(), b(l, {
367
+ dir: t.dir,
368
+ align: t.align,
369
+ anchorRef: t.anchorRef,
370
+ anchorDir: t.anchorDir,
371
+ onHide: n[4] || (n[4] = (u) => s.hide()),
372
+ onReady: n[5] || (n[5] = (u) => s.initialize())
373
+ }, {
374
+ default: _(() => [
375
+ y("div", {
376
+ ref: "menu",
377
+ class: p(["Menu", {
378
+ "Menu-search": t.search
379
+ }])
380
+ }, [
381
+ t.search ? (d(), b(i, {
382
+ key: 0,
383
+ ref: "search",
384
+ modelValue: a.searchQuery,
385
+ "onUpdate:modelValue": [
386
+ n[0] || (n[0] = (u) => a.searchQuery = u),
387
+ n[1] || (n[1] = (u) => s.doSearch())
388
+ ],
389
+ autoFocus: "",
390
+ class: "Search",
391
+ icon: "fas fa-search",
392
+ placeholder: "Search",
393
+ "data-menu-item-id": "#",
394
+ onKeydown: n[2] || (n[2] = x((u) => s.activate(), ["enter"]))
395
+ }, null, 8, ["modelValue"])) : f("", !0),
396
+ y("div", {
397
+ class: "Items",
398
+ onKeydown: n[3] || (n[3] = x((u) => s.selectSearch(), ["backspace"]))
399
+ }, [
400
+ (d(!0), c($, null, R(a.filteredItems, (u, v) => (d(), c($, { key: v }, [
401
+ u.kind === "separator" ? (d(), c("div", re)) : u.kind === "title" ? (d(), c("div", {
402
+ key: 1,
403
+ class: "SectionTitle",
404
+ textContent: S(u.title)
405
+ }, null, 8, de)) : (d(), c("div", {
406
+ key: 2,
407
+ class: p(["MenuItem", [
408
+ {
409
+ "MenuItem-selected": s.isItemSelected(v),
410
+ "MenuItem-disabled": u.disabled,
411
+ "MenuItem-checked": u.checked
412
+ },
413
+ `MenuItem-${u.kind}`
414
+ ]]),
415
+ "data-menu-item-id": v,
416
+ tabindex: "0",
417
+ onClick: /* @__PURE__ */ r((k) => s.activateItem(u), "onClick")
418
+ }, [
419
+ y("div", ce, [
420
+ u.icon ? (d(), c("i", {
421
+ key: 0,
422
+ class: p([u.icon, "ItemIcon"])
423
+ }, null, 2)) : f("", !0),
424
+ y("div", fe, S(u.title), 1),
425
+ u.checked ? (d(), c("i", he)) : f("", !0)
426
+ ]),
427
+ u.description ? (d(), c("div", pe, S(u.description), 1)) : f("", !0)
428
+ ], 10, ue))
429
+ ], 64))), 128))
430
+ ], 32)
431
+ ], 2)
432
+ ]),
433
+ _: 1
434
+ }, 8, ["dir", "align", "anchorRef", "anchorDir"]);
435
+ }
436
+ r(me, "_sfc_render$b");
437
+ const ye = /* @__PURE__ */ m(le, [["render", me], ["__scopeId", "data-v-1d7ed61a"]]), be = {
438
+ props: {
439
+ dir: { type: String, default: "v" },
440
+ align: { type: String, default: "auto" },
441
+ anchorRef: { type: String },
442
+ anchorDir: { type: String, default: "middle" },
443
+ overlayEnabled: { type: Boolean, default: !0 },
444
+ overlayShown: { type: Boolean, default: !0 }
445
+ },
446
+ emits: [
447
+ "hide",
448
+ "mouseenter",
449
+ "mouseleave",
450
+ "ready",
451
+ "update:overlayShown"
452
+ ],
453
+ data() {
454
+ return {
455
+ pos: {
456
+ x: 0,
457
+ y: 0
458
+ },
459
+ actualDir: "bottom",
460
+ actualAlign: "start",
461
+ ready: !1
462
+ };
463
+ },
464
+ computed: {
465
+ bubbleStyle() {
466
+ const { x: e, y: n } = this.pos;
467
+ return {
468
+ left: `${e}px`,
469
+ top: `${n}px`,
470
+ "pointer-events": "auto"
471
+ };
472
+ }
473
+ },
474
+ mounted() {
475
+ this.$nextTick(() => this.calcPos()), window.addEventListener("resize", this.onResize), window.addEventListener("keydown", this.onWindowKeyDown), this.enableOverlay();
476
+ },
477
+ unmounted() {
478
+ window.removeEventListener("resize", this.onResize), window.removeEventListener("keydown", this.onWindowKeyDown), this.disableOverlay();
479
+ },
480
+ methods: {
481
+ hide() {
482
+ this.$emit("hide");
483
+ },
484
+ calcPos() {
485
+ const e = this.getAnchorEl();
486
+ this.pos = O(e, this.anchorDir), this.calcDirAlign(), this.ready = !0, this.$nextTick(() => this.$emit("ready"));
487
+ },
488
+ calcDirAlign() {
489
+ const e = this.pos.y < window.innerHeight * 0.5, n = this.pos.x < window.innerWidth * 0.5;
490
+ this.align === "auto" ? ["top", "bottom", "v"].includes(this.dir) ? this.actualAlign = n ? "start" : "end" : this.actualAlign = e ? "start" : "end" : this.actualAlign = this.align, this.dir === "v" ? this.actualDir = e ? "bottom" : "top" : this.dir === "h" ? this.actualDir = n ? "right" : "left" : this.actualDir = this.dir;
491
+ },
492
+ getAnchorEl() {
493
+ if (this.anchorRef) {
494
+ const e = this.findRef(this.$parent, this.anchorRef);
495
+ if (e)
496
+ return e;
497
+ }
498
+ return this.$el.parentElement;
499
+ },
500
+ findRef(e, n) {
501
+ const t = e.$refs[n];
502
+ if (t) {
503
+ const o = t.$el ?? t;
504
+ if (o instanceof HTMLElement)
505
+ return o;
506
+ }
507
+ return e.$parent ? this.findRef(e.$parent, n) : null;
508
+ },
509
+ onResize() {
510
+ this.calcPos();
511
+ },
512
+ onWindowKeyDown(e) {
513
+ e.key === "Escape" && this.hide();
514
+ },
515
+ enableOverlay() {
516
+ if (!this.overlayEnabled)
517
+ return;
518
+ const e = document.documentElement, n = e.style.overflow;
519
+ e.dataset.previousOverflow = n, e.style.overflow = "hidden";
520
+ },
521
+ disableOverlay() {
522
+ const e = document.documentElement;
523
+ e.dataset.previousOverflow != null && (e.style.overflow = e.dataset.previousOverflow, delete e.dataset.previousOverflow);
524
+ }
525
+ }
526
+ };
527
+ function ve(e, n, t, o, a, s) {
528
+ const i = I("Bubble");
529
+ return d(), b(E, { to: "#overlays" }, [
530
+ y("div", {
531
+ class: p(["Overlay", {
532
+ "Overlay-enabled": t.overlayEnabled,
533
+ "Overlay-shown": t.overlayShown
534
+ }]),
535
+ onClick: n[3] || (n[3] = z((l) => s.hide(), ["stop"]))
536
+ }, [
537
+ a.ready ? (d(), b(i, {
538
+ key: 0,
539
+ dir: a.actualDir,
540
+ align: a.actualAlign,
541
+ style: H(s.bubbleStyle),
542
+ onMouseenter: n[0] || (n[0] = (l) => e.$emit("mouseenter")),
543
+ onMouseleave: n[1] || (n[1] = (l) => e.$emit("mouseleave")),
544
+ onClick: n[2] || (n[2] = z(() => {
545
+ }, ["stop"]))
546
+ }, {
547
+ default: _(() => [
548
+ h(e.$slots, "default", {}, void 0, !0)
549
+ ]),
550
+ _: 3
551
+ }, 8, ["dir", "align", "style"])) : f("", !0)
552
+ ], 2)
553
+ ]);
554
+ }
555
+ r(ve, "_sfc_render$a");
556
+ const ge = /* @__PURE__ */ m(be, [["render", ve], ["__scopeId", "data-v-55cbd0aa"]]), _e = {
557
+ props: {
558
+ tagName: { type: String, default: "div" },
559
+ align: { type: String, default: "center" },
560
+ justify: { type: String },
561
+ gap: { type: String, default: "1" },
562
+ wrap: { type: Boolean, default: !1 }
563
+ }
564
+ };
565
+ function Se(e, n, t, o, a, s) {
566
+ return d(), b(w(t.tagName), {
567
+ class: p(["HGroup", [
568
+ `HGroup-align-${t.align}`,
569
+ `HGroup-justify-${t.justify}`,
570
+ `HGroup-gap-${t.gap}`,
571
+ {
572
+ "HGroup-wrap": t.wrap
573
+ }
574
+ ]])
575
+ }, {
576
+ default: _(() => [
577
+ h(e.$slots, "default", {}, void 0, !0)
578
+ ]),
579
+ _: 3
580
+ }, 8, ["class"]);
581
+ }
582
+ r(Se, "_sfc_render$9");
583
+ const Ie = /* @__PURE__ */ m(_e, [["render", Se], ["__scopeId", "data-v-0abfef17"]]), ke = {}, we = { class: "HStack" };
584
+ function Be(e, n, t, o, a, s) {
585
+ return d(), c("div", we, [
586
+ h(e.$slots, "default", {}, void 0, !0)
587
+ ]);
588
+ }
589
+ r(Be, "_sfc_render$8");
590
+ const $e = /* @__PURE__ */ m(ke, [["render", Be], ["__scopeId", "data-v-48a370d0"]]), Te = {
591
+ props: {
592
+ dir: { type: String, default: "top" },
593
+ label: { type: String }
594
+ },
595
+ computed: {
596
+ orientation() {
597
+ return this.dir === "top" || this.dir === "bottom" ? "h" : "v";
598
+ }
599
+ }
600
+ }, Ce = { class: "Content" }, xe = ["title"];
601
+ function ze(e, n, t, o, a, s) {
602
+ const i = I("TabCap");
603
+ return d(), c("div", {
604
+ class: p(["Tab", [
605
+ `Tab-${t.dir}`,
606
+ `Tab-${s.orientation}`
607
+ ]])
608
+ }, [
609
+ L(i, {
610
+ class: "TabCap",
611
+ dir: t.dir,
612
+ type: "start"
613
+ }, null, 8, ["dir"]),
614
+ y("div", Ce, [
615
+ h(e.$slots, "default", {}, () => [
616
+ t.label ? (d(), c("div", {
617
+ key: 0,
618
+ class: "TabLabel",
619
+ title: t.label
620
+ }, S(t.label), 9, xe)) : f("", !0)
621
+ ], !0)
622
+ ]),
623
+ L(i, {
624
+ class: "TabCap",
625
+ dir: t.dir,
626
+ type: "end"
627
+ }, null, 8, ["dir"])
628
+ ], 2);
629
+ }
630
+ r(ze, "_sfc_render$7");
631
+ const A = /* @__PURE__ */ m(Te, [["render", ze], ["__scopeId", "data-v-1ba502f2"]]), Le = {
632
+ components: {
633
+ Tab: A
634
+ },
635
+ props: {
636
+ tagName: { default: "label" },
637
+ label: { type: String },
638
+ labelStyle: { type: String, default: "tab" },
639
+ size: { type: String, default: "normal" },
640
+ fixedHeight: { type: Boolean, default: !0 },
641
+ round: { type: Boolean, default: !1 },
642
+ block: { type: Boolean },
643
+ disabled: { type: Boolean, default: !1 },
644
+ invalid: { type: Boolean, default: !1 },
645
+ pseudoFocus: { type: Boolean, default: !1 },
646
+ pseudoHover: { type: Boolean, default: !1 }
647
+ },
648
+ data() {
649
+ return {
650
+ focused: !1
651
+ };
652
+ }
653
+ }, Ve = {
654
+ key: 1,
655
+ class: "Label TextLabel"
656
+ }, Ne = {
657
+ key: 2,
658
+ class: "Label BorderLabel"
659
+ }, Ae = { class: "Container" };
660
+ function Me(e, n, t, o, a, s) {
661
+ const i = I("Tab");
662
+ return d(), b(w(t.tagName), {
663
+ class: p(["InputBase", [
664
+ `InputBase-${t.size}`,
665
+ {
666
+ "InputBase-block": t.block,
667
+ "InputBase-round": t.round,
668
+ "InputBase-disabled": t.disabled,
669
+ "InputBase-invalid": t.invalid,
670
+ "InputBase-fixed-height": t.fixedHeight,
671
+ "InputBase-pseudo-focus": t.pseudoFocus,
672
+ "InputBase-pseudo-hover": t.pseudoHover
673
+ }
674
+ ]]),
675
+ onFocusin: n[0] || (n[0] = (l) => a.focused = !0),
676
+ onFocusout: n[1] || (n[1] = (l) => a.focused = !1)
677
+ }, {
678
+ default: _(() => [
679
+ t.label ? (d(), c($, { key: 0 }, [
680
+ t.labelStyle === "tab" ? (d(), b(i, {
681
+ key: 0,
682
+ class: "Label TabLabel",
683
+ label: t.label
684
+ }, null, 8, ["label"])) : f("", !0),
685
+ t.labelStyle === "text" ? (d(), c("div", Ve, S(t.label), 1)) : f("", !0),
686
+ t.labelStyle === "inline" ? (d(), c("div", Ne, S(t.label), 1)) : f("", !0)
687
+ ], 64)) : f("", !0),
688
+ y("div", Ae, [
689
+ h(e.$slots, "default", {}, void 0, !0)
690
+ ])
691
+ ]),
692
+ _: 3
693
+ }, 40, ["class"]);
694
+ }
695
+ r(Me, "_sfc_render$6");
696
+ const B = /* @__PURE__ */ m(Le, [["render", Me], ["__scopeId", "data-v-42062d04"]]), De = {
697
+ props: {
698
+ ...B.props,
699
+ modelValue: {},
700
+ items: { type: Array, default: /* @__PURE__ */ r(() => [], "default") },
701
+ placeholder: { type: String },
702
+ readonly: { type: Boolean },
703
+ dropdownIcon: {
704
+ type: String,
705
+ default: "fas fa-angle-down"
706
+ },
707
+ search: { type: Boolean, default: !1 }
708
+ },
709
+ emits: [
710
+ "focus",
711
+ "blur",
712
+ "update:modelValue"
713
+ ],
714
+ data() {
715
+ return {
716
+ menuShown: !1
717
+ };
718
+ },
719
+ computed: {
720
+ selectedItem() {
721
+ return this.items.find((e) => (e.value ?? e) === this.modelValue);
722
+ },
723
+ itemTitle() {
724
+ const { selectedItem: e } = this;
725
+ return (e == null ? void 0 : e.title) ?? e;
726
+ },
727
+ itemIcon() {
728
+ const { selectedItem: e } = this;
729
+ return e == null ? void 0 : e.icon;
730
+ }
731
+ },
732
+ methods: {
733
+ onInput(e) {
734
+ this.$emit("update:modelValue", e.target.value);
735
+ },
736
+ selectValue(e) {
737
+ this.$emit("update:modelValue", e), this.menuShown = !1;
738
+ },
739
+ getMenuItems() {
740
+ return this.items.map((e) => {
741
+ const n = typeof e == "string" ? e : e.title, t = typeof e == "string" ? e : e.value;
742
+ return {
743
+ title: n,
744
+ checked: t === this.modelValue,
745
+ disabled: e.disabled,
746
+ description: e.description,
747
+ icon: e.icon ?? void 0,
748
+ activate: /* @__PURE__ */ r(() => {
749
+ this.disabled || this.selectValue(t);
750
+ }, "activate")
751
+ };
752
+ });
753
+ },
754
+ show() {
755
+ this.disabled || (this.menuShown = !0);
756
+ }
757
+ }
758
+ }, Re = {
759
+ key: 1,
760
+ class: "Value"
761
+ }, Ee = {
762
+ key: 2,
763
+ class: "Placeholder"
764
+ };
765
+ function He(e, n, t, o, a, s) {
766
+ const i = I("ContextMenu"), l = I("InputBase");
767
+ return d(), b(l, T({ class: "InputSelect" }, {
768
+ ...e.$attrs,
769
+ ...e.$props
770
+ }, {
771
+ tabindex: "0",
772
+ onClick: n[1] || (n[1] = (u) => s.show())
773
+ }), {
774
+ default: _(() => [
775
+ h(e.$slots, "before", {}, void 0, !0),
776
+ s.itemIcon ? (d(), c("i", {
777
+ key: 0,
778
+ class: p(["Icon", s.itemIcon])
779
+ }, null, 2)) : f("", !0),
780
+ s.selectedItem ? (d(), c("span", Re, S(s.itemTitle), 1)) : f("", !0),
781
+ s.selectedItem ? f("", !0) : (d(), c("span", Ee, S(t.placeholder), 1)),
782
+ y("i", {
783
+ ref: "icon",
784
+ class: p(["DropdownIcon", t.dropdownIcon])
785
+ }, null, 2),
786
+ !e.disabled && a.menuShown ? (d(), b(i, {
787
+ key: 3,
788
+ anchorRef: "icon",
789
+ items: s.getMenuItems(),
790
+ search: t.search,
791
+ overlayShown: !1,
792
+ onHide: n[0] || (n[0] = (u) => a.menuShown = !1)
793
+ }, null, 8, ["items", "search"])) : f("", !0),
794
+ h(e.$slots, "after", {}, void 0, !0)
795
+ ]),
796
+ _: 3
797
+ }, 16);
798
+ }
799
+ r(He, "_sfc_render$5");
800
+ const Fe = /* @__PURE__ */ m(De, [["render", He], ["__scopeId", "data-v-71e0a4c7"]]), Oe = {
801
+ props: {
802
+ ...B.props,
803
+ modelValue: { type: [String, Number] },
804
+ type: { type: String },
805
+ placeholder: { type: String },
806
+ min: { type: Number },
807
+ max: { type: Number },
808
+ step: { type: Number },
809
+ autoFocus: { type: Boolean },
810
+ readonly: { type: Boolean }
811
+ },
812
+ emits: [
813
+ "focus",
814
+ "blur",
815
+ "input",
816
+ "update:modelValue"
817
+ ],
818
+ mounted() {
819
+ var e;
820
+ this.autoFocus && ((e = this.$refs.input) == null || e.focus());
821
+ },
822
+ methods: {
823
+ onInput(e) {
824
+ this.$emit("update:modelValue", e.target.value);
825
+ }
826
+ }
827
+ }, Pe = ["value", "type", "placeholder", "readonly", "disabled", "min", "max", "step"];
828
+ function Ge(e, n, t, o, a, s) {
829
+ const i = I("InputBase");
830
+ return d(), b(i, T({ class: "InputText" }, {
831
+ ...e.$attrs,
832
+ ...e.$props
833
+ }), {
834
+ default: _(() => [
835
+ h(e.$slots, "before", {}, void 0, !0),
836
+ y("input", {
837
+ ref: "input",
838
+ value: t.modelValue,
839
+ type: t.type,
840
+ placeholder: t.placeholder,
841
+ readonly: t.readonly,
842
+ disabled: e.disabled,
843
+ min: t.min,
844
+ max: t.max,
845
+ step: t.step,
846
+ autocomplete: "off",
847
+ onInput: n[0] || (n[0] = (l) => s.onInput(l)),
848
+ onFocus: n[1] || (n[1] = (l) => e.$emit("focus", l)),
849
+ onBlur: n[2] || (n[2] = (l) => e.$emit("blur", l))
850
+ }, null, 40, Pe),
851
+ h(e.$slots, "after", {}, void 0, !0)
852
+ ]),
853
+ _: 3
854
+ }, 16);
855
+ }
856
+ r(Ge, "_sfc_render$4");
857
+ const je = /* @__PURE__ */ m(Oe, [["render", Ge], ["__scopeId", "data-v-26fed2ef"]]), Ke = {
858
+ props: {
859
+ ...B.props,
860
+ modelValue: { type: String },
861
+ placeholder: { type: String },
862
+ rows: { type: Number },
863
+ autoSize: { type: Boolean, default: !0 },
864
+ minRows: { type: Number, default: 2 },
865
+ maxRows: { type: Number, default: 10 },
866
+ autoFocus: { type: Boolean },
867
+ readonly: { type: Boolean }
868
+ },
869
+ emits: [
870
+ "focus",
871
+ "blur",
872
+ "input",
873
+ "update:modelValue"
874
+ ],
875
+ computed: {
876
+ effectiveRows() {
877
+ if (this.autoSize) {
878
+ const e = this.modelValue.split(`
879
+ `).length;
880
+ return Math.max(Math.min(e, this.maxRows), this.minRows);
881
+ }
882
+ return this.rows ?? this.minRows ?? 2;
883
+ }
884
+ },
885
+ mounted() {
886
+ var e;
887
+ this.autoFocus && ((e = this.$refs.input) == null || e.focus());
888
+ },
889
+ methods: {
890
+ onInput(e) {
891
+ this.$emit("update:modelValue", e.target.value);
892
+ }
893
+ }
894
+ }, We = ["value", "placeholder", "readonly", "disabled", "rows"];
895
+ function Ze(e, n, t, o, a, s) {
896
+ const i = I("InputBase");
897
+ return d(), b(i, T({ class: "InputTextarea" }, {
898
+ ...e.$attrs,
899
+ ...e.$props
900
+ }, { fixedHeight: !1 }), {
901
+ default: _(() => [
902
+ h(e.$slots, "before", {}, void 0, !0),
903
+ y("textarea", {
904
+ ref: "input",
905
+ value: t.modelValue,
906
+ placeholder: t.placeholder,
907
+ readonly: t.readonly,
908
+ disabled: e.disabled,
909
+ rows: s.effectiveRows,
910
+ resize: "none",
911
+ autocomplete: "off",
912
+ onInput: n[0] || (n[0] = (l) => s.onInput(l)),
913
+ onFocus: n[1] || (n[1] = (l) => e.$emit("focus", l)),
914
+ onBlur: n[2] || (n[2] = (l) => e.$emit("blur", l))
915
+ }, null, 40, We),
916
+ h(e.$slots, "after", {}, void 0, !0)
917
+ ]),
918
+ _: 3
919
+ }, 16);
920
+ }
921
+ r(Ze, "_sfc_render$3");
922
+ const Qe = /* @__PURE__ */ m(Ke, [["render", Ze], ["__scopeId", "data-v-8ff9214b"]]), qe = {}, Ue = { class: "Sizer" };
923
+ function Je(e, n) {
924
+ return d(), c("div", Ue);
925
+ }
926
+ r(Je, "_sfc_render$2");
927
+ const Xe = /* @__PURE__ */ m(qe, [["render", Je], ["__scopeId", "data-v-2f099547"]]), Ye = {
928
+ props: {
929
+ dir: { type: String, default: "top" },
930
+ type: { type: String, default: "start" }
931
+ }
932
+ };
933
+ function et(e, n, t, o, a, s) {
934
+ return d(), c("svg", {
935
+ class: p(["TabCap", [
936
+ `TabCap-${t.dir}`,
937
+ `TabCap-${t.type}`
938
+ ]]),
939
+ viewBox: "0 0 32 32",
940
+ preserveAspectRatio: "none"
941
+ }, n[0] || (n[0] = [
942
+ y("path", { d: "M0 32 C 16 32 16 0 32 0 L 32 32 z" }, null, -1)
943
+ ]), 2);
944
+ }
945
+ r(et, "_sfc_render$1");
946
+ const tt = /* @__PURE__ */ m(Ye, [["render", et], ["__scopeId", "data-v-3c0176d0"]]), nt = {
947
+ props: {
948
+ tagName: { type: String, default: "div" },
949
+ align: { type: String, default: "stretch" },
950
+ justify: { type: String },
951
+ gap: { type: String, default: "1" }
952
+ }
953
+ };
954
+ function st(e, n, t, o, a, s) {
955
+ return d(), b(w(t.tagName), {
956
+ class: p(["VGroup", [
957
+ `VGroup-align-${t.align}`,
958
+ `VGroup-justify-${t.justify}`,
959
+ `VGroup-gap-${t.gap}`
960
+ ]])
961
+ }, {
962
+ default: _(() => [
963
+ h(e.$slots, "default", {}, void 0, !0)
964
+ ]),
965
+ _: 3
966
+ }, 8, ["class"]);
967
+ }
968
+ r(st, "_sfc_render");
969
+ const at = /* @__PURE__ */ m(nt, [["render", st], ["__scopeId", "data-v-4e4be270"]]), rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
970
+ __proto__: null,
971
+ Btn: K,
972
+ Bubble: q,
973
+ Circle: X,
974
+ ContextMenu: ye,
975
+ ContextPopup: ge,
976
+ HGroup: Ie,
977
+ HStack: $e,
978
+ InputBase: B,
979
+ InputSelect: Fe,
980
+ InputText: je,
981
+ InputTextarea: Qe,
982
+ Sizer: Xe,
983
+ Tab: A,
984
+ TabCap: tt,
985
+ VGroup: at
986
+ }, Symbol.toStringTag, { value: "Module" }));
987
+ export {
988
+ K as B,
989
+ X as C,
990
+ Ie as H,
991
+ B as I,
992
+ Xe as S,
993
+ A as T,
994
+ at as V,
995
+ q as a,
996
+ ye as b,
997
+ ge as c,
998
+ $e as d,
999
+ Fe as e,
1000
+ je as f,
1001
+ Qe as g,
1002
+ tt as h,
1003
+ rt as i
1004
+ };