nightshade 1.5.0 → 2.0.0-dev.3

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