@illinois-grad/grad-vue 2.4.0 → 2.4.2

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,3171 +0,0 @@
1
- import { defineComponent as A, useSlots as Ie, useAttrs as tt, computed as x, openBlock as u, createBlock as q, resolveDynamicComponent as ve, mergeProps as ae, unref as b, withCtx as U, createElementBlock as v, Fragment as F, createElementVNode as n, renderSlot as P, normalizeClass as O, inject as be, onMounted as re, onBeforeUnmount as de, renderList as Z, createTextVNode as N, toDisplayString as C, createCommentVNode as M, useModel as j, useId as Y, toRef as _e, ref as E, createVNode as W, mergeModels as H, shallowRef as Ge, watch as Q, toValue as Se, nextTick as X, useTemplateRef as fe, Teleport as Me, Transition as we, normalizeStyle as ce, onBeforeMount as je, withModifiers as ue, withDirectives as ke, vShow as lt, getCurrentInstance as Ne, watchEffect as De, reactive as at, toRaw as We, vModelCheckbox as Fe, normalizeProps as ot, guardReactiveProps as st, shallowReactive as nt, provide as rt } from "vue";
2
- import { toArray as it, unrefElement as ut, tryOnScopeDispose as dt, useFocusWithin as ct, useDebounceFn as vt, useClipboard as ft, useResizeObserver as Pe } from "@vueuse/core";
3
- import { createFocusTrap as bt } from "focus-trap";
4
- const gt = { class: "g-btn--icon" }, mt = { class: "g-btn--label" }, pt = {}, se = /* @__PURE__ */ A({
5
- ...pt,
6
- __name: "GButton",
7
- props: {
8
- size: { default: "medium" },
9
- theme: { default: "primary" },
10
- outlined: { type: Boolean, default: !1 },
11
- text: { type: Boolean, default: !1 },
12
- to: { default: void 0 },
13
- component: { default: void 0 },
14
- icon: { default: void 0 }
15
- },
16
- emits: [
17
- "click",
18
- "focus",
19
- "blur",
20
- "keydown",
21
- "keyup",
22
- "mousedown",
23
- "mouseup",
24
- "mouseenter",
25
- "mouseleave"
26
- ],
27
- setup(e) {
28
- const l = e, t = Ie(), a = tt(), o = x(() => [
29
- "g-btn",
30
- `g-btn--${l.size}`,
31
- `g-btn--${l.theme}`,
32
- {
33
- "g-btn--outlined": l.outlined,
34
- "g-btn--text": l.text,
35
- "g-btn--primary": l.theme === "primary",
36
- "g-btn--accent": l.theme === "accent",
37
- "g-btn-has-text": l.text,
38
- "g-btn-has-icon-class": l.icon,
39
- "g-btn-has-icon-svg": !!t.icon
40
- }
41
- ]);
42
- return (s, r) => (u(), q(ve(l.component ? l.component : "button"), ae(b(a), {
43
- to: l.to,
44
- class: o.value,
45
- type: l.to ? void 0 : "button",
46
- onClick: r[0] || (r[0] = (d) => s.$emit("click", d)),
47
- onFocus: r[1] || (r[1] = (d) => s.$emit("focus", d)),
48
- onBlur: r[2] || (r[2] = (d) => s.$emit("blur", d)),
49
- onKeydown: r[3] || (r[3] = (d) => s.$emit("keydown", d)),
50
- onKeyup: r[4] || (r[4] = (d) => s.$emit("keyup", d)),
51
- onMousedown: r[5] || (r[5] = (d) => s.$emit("mousedown", d)),
52
- onMouseup: r[6] || (r[6] = (d) => s.$emit("mouseup", d)),
53
- onMouseenter: r[7] || (r[7] = (d) => s.$emit("mouseenter", d)),
54
- onMouseleave: r[8] || (r[8] = (d) => s.$emit("mouseleave", d))
55
- }), {
56
- default: U(() => [
57
- e.icon || t.icon ? (u(), v(F, { key: 0 }, [
58
- n("span", gt, [
59
- t.icon ? P(s.$slots, "icon", { key: 0 }) : (u(), v("span", {
60
- key: 1,
61
- class: O(e.icon + " g-btn--icon-span"),
62
- "aria-hidden": "true"
63
- }, null, 2))
64
- ]),
65
- n("span", mt, [
66
- P(s.$slots, "default")
67
- ])
68
- ], 64)) : P(s.$slots, "default", { key: 1 })
69
- ]),
70
- _: 3
71
- }, 16, ["to", "class", "type"]));
72
- }
73
- });
74
- function $e(e) {
75
- const l = be("form", null), t = x(() => {
76
- const s = [];
77
- return e.errors && s.push(...e.errors.value.filter(Boolean)), s;
78
- }), a = x(() => t.value.length > 0), o = e.name;
79
- return l && o && (re(() => {
80
- l.registerField(o, {
81
- name: o,
82
- value: e.value,
83
- errors: t
84
- });
85
- }), de(() => {
86
- e.name && l.unregisterField(e.name);
87
- })), {
88
- displayErrors: t,
89
- hasErrors: a
90
- };
91
- }
92
- const ht = ["id"], yt = {}, kt = /* @__PURE__ */ A({
93
- ...yt,
94
- __name: "GFormErrorMessages",
95
- props: {
96
- errors: {},
97
- id: {}
98
- },
99
- setup(e) {
100
- return (l, t) => e.errors.length > 0 ? (u(), v("div", {
101
- key: 0,
102
- class: "g-form-error-messages",
103
- id: e.id,
104
- role: "alert"
105
- }, [
106
- (u(!0), v(F, null, Z(e.errors, (a, o) => (u(), v("div", {
107
- key: o,
108
- class: "g-form-error-message"
109
- }, [
110
- t[0] || (t[0] = n("svg", {
111
- class: "g-form-error-icon",
112
- xmlns: "http://www.w3.org/2000/svg",
113
- viewBox: "0 0 640 640"
114
- }, [
115
- n("path", {
116
- fill: "currentColor",
117
- d: "M320 64C334.7 64 348.2 72.1 355.2 85L571.2 485C577.9 497.4 577.6 512.4 570.4 524.5C563.2 536.6 550.1 544 536 544L104 544C89.9 544 76.8 536.6 69.6 524.5C62.4 512.4 62.1 497.4 68.8 485L284.8 85C291.8 72.1 305.3 64 320 64zM320 416C302.3 416 288 430.3 288 448C288 465.7 302.3 480 320 480C337.7 480 352 465.7 352 448C352 430.3 337.7 416 320 416zM320 224C301.8 224 287.3 239.5 288.6 257.7L296 361.7C296.9 374.2 307.4 384 319.9 384C332.5 384 342.9 374.3 343.8 361.7L351.2 257.7C352.5 239.5 338.1 224 319.8 224z"
118
- })
119
- ], -1)),
120
- N(" " + C(a), 1)
121
- ]))), 128))
122
- ], 8, ht)) : M("", !0);
123
- }
124
- }), z = (e, l) => {
125
- const t = e.__vccOpts || e;
126
- for (const [a, o] of l)
127
- t[a] = o;
128
- return t;
129
- }, Ee = /* @__PURE__ */ z(kt, [["__scopeId", "data-v-8d738358"]]), _t = ["for"], wt = ["id"], $t = {
130
- key: 0,
131
- class: "g-text-input-prefix"
132
- }, Ct = ["value", "placeholder", "disabled", "aria-invalid"], xt = {
133
- key: 1,
134
- class: "g-text-input-suffix"
135
- }, Lt = {}, St = /* @__PURE__ */ A({
136
- ...Lt,
137
- inheritAttrs: !1,
138
- __name: "GTextInput",
139
- props: /* @__PURE__ */ H({
140
- label: { default: void 0 },
141
- placeholder: { default: "" },
142
- disabled: { type: Boolean, default: !1 },
143
- errors: { default: () => [] },
144
- instructions: { default: "" },
145
- prefix: { default: "" },
146
- suffix: { default: "" },
147
- debounce: { default: 100 },
148
- name: { default: void 0 }
149
- }, {
150
- modelValue: { type: String },
151
- modelModifiers: {}
152
- }),
153
- emits: /* @__PURE__ */ H(["change"], ["update:modelValue"]),
154
- setup(e, { emit: l }) {
155
- const t = e, a = j(e, "modelValue"), o = Y(), { displayErrors: s, hasErrors: r } = $e({
156
- name: t.name,
157
- value: a,
158
- errors: _e(t, "errors")
159
- }), d = l, i = E(a.value ?? "");
160
- let c = null;
161
- function g(f) {
162
- if (f !== a.value) {
163
- const p = a.value;
164
- a.value = f, d("change", {
165
- was: p,
166
- to: f
167
- });
168
- }
169
- }
170
- function m(f) {
171
- const p = f.target.value;
172
- i.value = p, c && clearTimeout(c), c = setTimeout(() => {
173
- g(i.value), c = null;
174
- }, t.debounce);
175
- }
176
- function h(f) {
177
- c && (clearTimeout(c), c = null), g(f.target.value);
178
- }
179
- function L(f) {
180
- c && (clearTimeout(c), c = null), setTimeout(() => {
181
- const p = f.target.value;
182
- g(p);
183
- }, 0);
184
- }
185
- function S(f) {
186
- (f.key === "PageUp" || f.key === "PageDown") && (c && (clearTimeout(c), c = null), g(f.target.value)), f.key === "Enter" && g(f.target.value);
187
- }
188
- return (f, p) => (u(), v("div", {
189
- class: O(["g-text-input-wrap", { "g-text-input-has-error": b(r) }])
190
- }, [
191
- t.label ? (u(), v("label", {
192
- key: 0,
193
- for: f.$attrs.id || b(o),
194
- class: "g-text-input-label"
195
- }, C(t.label), 9, _t)) : M("", !0),
196
- f.$slots.instructions || e.instructions ? (u(), v("div", {
197
- key: 1,
198
- id: "instructions-" + b(o),
199
- class: "g-text-input-instructions"
200
- }, [
201
- P(f.$slots, "instructions", {}, () => [
202
- N(C(e.instructions), 1)
203
- ], !0)
204
- ], 8, wt)) : M("", !0),
205
- n("div", {
206
- class: O([{
207
- "g-text-input-field-wrapper": !0
208
- }, `g-text-input-field-wrapper--${e.name || "nameless"}`])
209
- }, [
210
- t.prefix ? (u(), v("span", $t, C(t.prefix), 1)) : M("", !0),
211
- n("input", ae({
212
- value: a.value,
213
- placeholder: t.placeholder,
214
- disabled: t.disabled,
215
- onInput: m,
216
- onBlur: h,
217
- onPaste: L,
218
- onKeydown: S,
219
- type: "text",
220
- class: "g-text-input"
221
- }, {
222
- ...f.$attrs,
223
- id: f.$attrs.id || b(o),
224
- "aria-describedby": f.$slots.instructions || e.instructions ? "instructions-" + b(o) : void 0,
225
- "aria-errormessage": b(r) ? "error-message-" + b(o) : void 0
226
- }, {
227
- "aria-invalid": b(r) ? "true" : "false"
228
- }), null, 16, Ct),
229
- t.suffix ? (u(), v("span", xt, C(t.suffix), 1)) : M("", !0)
230
- ], 2),
231
- W(Ee, {
232
- errors: b(s),
233
- id: "error-message-" + b(o)
234
- }, null, 8, ["errors", "id"])
235
- ], 2));
236
- }
237
- }), Be = /* @__PURE__ */ z(St, [["__scopeId", "data-v-71461d61"]]), qe = 100, Ze = 200, Re = 102;
238
- function Ye() {
239
- window._g_overlay_stack_state || (window._g_overlay_stack_state = {
240
- stack: E([]),
241
- modalStack: E([]),
242
- scrollLockStack: E([]),
243
- updateBodyScrollLock() {
244
- if (typeof document < "u")
245
- if (t.value.length > 0) {
246
- const o = window.innerWidth - document.documentElement.clientWidth;
247
- document.body.classList.add("g-scroll-lock"), document.body.style.paddingRight = `${o}px`, document.body.style.setProperty("--g-scrollbar-width", `${o}px`);
248
- } else
249
- document.body.style.paddingRight = "0", document.body.classList.remove("g-scroll-lock"), document.body.style.removeProperty("--g-scrollbar-width");
250
- }
251
- });
252
- const { stack: e, modalStack: l, scrollLockStack: t, updateBodyScrollLock: a } = window._g_overlay_stack_state;
253
- return { stack: e, modalStack: l, scrollLockStack: t, updateBodyScrollLock: a };
254
- }
255
- function Ce(e, l = !1, t = !1) {
256
- if (!document)
257
- return {};
258
- const { stack: a, modalStack: o, scrollLockStack: s, updateBodyScrollLock: r } = Ye(), d = l ? o : a;
259
- function i() {
260
- d.value.push(e), t && !s.value.includes(e) && (s.value.push(e), r());
261
- }
262
- function c() {
263
- const h = d.value.lastIndexOf(e);
264
- h !== -1 && d.value.splice(h, 1);
265
- const L = s.value.lastIndexOf(e);
266
- L !== -1 && (s.value.splice(L, 1), r());
267
- }
268
- const g = x(() => !l && o.value.length > 0 ? !1 : d.value.length > 0 && d.value[d.value.length - 1] === e), m = x(() => {
269
- const h = d.value.indexOf(e);
270
- return h === -1 ? 0 : (l ? Ze : qe) + h;
271
- });
272
- return de(c), { push: i, pop: c, isTop: g, zIndex: m };
273
- }
274
- function It() {
275
- if (!document)
276
- return {};
277
- const { stack: e, modalStack: l, scrollLockStack: t } = Ye(), a = x(() => l.value.length > 0), o = x(
278
- () => e.value.length > 0 || l.value.length > 0
279
- ), s = x(() => t.value.length > 0);
280
- return { hasModal: a, hasOverlay: o, hasScrollLock: s };
281
- }
282
- function Mt() {
283
- if (typeof window > "u" || !window._g_overlay_stack_state)
284
- return Re;
285
- const { stack: e, modalStack: l } = window._g_overlay_stack_state;
286
- let t = 0;
287
- return e.value.forEach((a, o) => {
288
- t = Math.max(t, qe + o);
289
- }), l.value.forEach((a, o) => {
290
- t = Math.max(t, Ze + o);
291
- }), t > 0 ? t + 1 : Re;
292
- }
293
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
294
- const Et = (e) => e != null;
295
- function Bt(e, l = {}) {
296
- let t;
297
- const { immediate: a, ...o } = l, s = Ge(!1), r = Ge(!1), d = (m) => t && t.activate(m), i = (m) => t && t.deactivate(m), c = () => {
298
- t && (t.pause(), r.value = !0);
299
- }, g = () => {
300
- t && (t.unpause(), r.value = !1);
301
- };
302
- return Q(x(() => it(Se(e)).map((m) => {
303
- const h = Se(m);
304
- return typeof h == "string" ? h : ut(h);
305
- }).filter(Et)), (m) => {
306
- if (m.length)
307
- if (!t)
308
- t = bt(m, {
309
- ...o,
310
- onActivate() {
311
- s.value = !0, l.onActivate && l.onActivate();
312
- },
313
- onDeactivate() {
314
- s.value = !1, l.onDeactivate && l.onDeactivate();
315
- }
316
- }), a && d();
317
- else {
318
- const h = t?.active;
319
- t?.updateContainerElements(m), !h && a && d();
320
- }
321
- }, { flush: "post" }), dt(() => i()), {
322
- hasFocus: s,
323
- isPaused: r,
324
- activate: d,
325
- deactivate: i,
326
- pause: c,
327
- unpause: g
328
- };
329
- }
330
- function Ve(e, l, t = !1) {
331
- const a = E(!1), { activate: o, deactivate: s, pause: r, unpause: d } = Bt(e, {
332
- immediate: !0,
333
- clickOutsideDeactivates: t,
334
- initialFocus: () => {
335
- if (a.value)
336
- return !1;
337
- const i = e.value?.querySelector("[popover-focus]");
338
- if (i)
339
- return i;
340
- const c = e.value?.querySelector("h2");
341
- if (c)
342
- return c;
343
- const g = e.value?.querySelector(
344
- "[aria-selected='true']"
345
- );
346
- if (g)
347
- return g;
348
- },
349
- onPostPause: () => a.value = !0,
350
- onPostUnpause: () => {
351
- X(() => {
352
- a.value = !1;
353
- }).catch((i) => {
354
- console.error(i);
355
- });
356
- }
357
- });
358
- return Q(l, (i) => {
359
- i ? X(() => {
360
- d();
361
- }).catch((c) => {
362
- console.error(c);
363
- }) : r();
364
- }), { activate: o, deactivate: s, pause: r, unpause: d };
365
- }
366
- function Ae(e, l, t, a, o) {
367
- function s(d) {
368
- for (const i of e)
369
- if (i.value?.contains(d.target))
370
- return;
371
- a();
372
- }
373
- function r(d) {
374
- d.key === "Escape" && t.value && l.value && (d.preventDefault(), X(a).catch((i) => {
375
- console.error(i);
376
- }));
377
- }
378
- re(() => {
379
- document.addEventListener("mousedown", s), document.addEventListener("keydown", r);
380
- }), de(() => {
381
- document.removeEventListener("mousedown", s), document.removeEventListener("keydown", r), o();
382
- });
383
- }
384
- function Qe(e, l, t, a) {
385
- const o = a?.gap ?? 8, s = a?.margin ?? 16, r = a?.preferAbove ?? !1;
386
- let d = !1, i = !1, c;
387
- r ? e.top - l.height - o > t.top + s ? (c = e.top - l.height - o, d = !0) : e.bottom + l.height + o <= t.bottom - s ? c = e.bottom + o : (c = t.top + s, i = !0) : e.bottom + l.height + o > t.bottom - s && e.top - l.height - o > t.top + s ? (c = e.top - l.height - o, d = !0) : e.bottom + l.height + o > t.bottom - s && e.top - l.height - o <= t.top + s ? (c = t.top + s, i = !0) : c = e.bottom + o;
388
- let g = e.left + (e.width - l.width) / 2;
389
- g < t.left + s && (g = t.left + s), g + l.width > t.right - s && (g = t.right - l.width - s), g < t.left + s && (g = t.left + s);
390
- const m = e.left + (e.width - l.width) / 2, h = g - m;
391
- return { top: c, left: g, xOffset: h, placedAbove: d, overlay: i };
392
- }
393
- const Vt = { class: "g-popover-wrap" }, At = ["id"], Tt = ["aria-labelledby"], zt = {}, Ot = /* @__PURE__ */ A({
394
- ...zt,
395
- __name: "GPopover",
396
- props: /* @__PURE__ */ H({
397
- minimal: { type: Boolean, default: !1 }
398
- }, {
399
- modelValue: { type: Boolean, default: !1 },
400
- modelModifiers: {}
401
- }),
402
- emits: /* @__PURE__ */ H(["show", "hide"], ["update:modelValue"]),
403
- setup(e, { emit: l }) {
404
- const t = e, a = l, o = j(e, "modelValue"), s = fe("triggerRef"), r = fe("popoverRef"), d = Y(), { push: i, pop: c, isTop: g, zIndex: m } = Ce(d, !0), { activate: h, deactivate: L } = Ve(r, g, !0);
405
- Ae([r, s], g, o, S, c), Q(o, (G) => {
406
- G ? (X(() => {
407
- X(() => h());
408
- }), i(), a("show")) : (L(), c(), a("hide"));
409
- });
410
- function S() {
411
- o.value = !1;
412
- }
413
- function f() {
414
- o.value = !o.value;
415
- }
416
- const p = E({ top: 0, left: 0 }), y = E({ left: "50%" }), T = E(!1), _ = E(!1);
417
- let I = null;
418
- function K() {
419
- if (!s.value || !r.value)
420
- return;
421
- const G = s.value.getBoundingClientRect(), J = r.value.getBoundingClientRect(), R = window.innerWidth - document.documentElement.clientWidth, te = window.innerWidth - R, ee = new DOMRect(0, 0, te, window.innerHeight), { top: oe, left: $, xOffset: V, placedAbove: k, overlay: D } = Qe(G, J, ee, {
422
- gap: t.minimal ? 0 : 8
423
- });
424
- p.value = { top: oe, left: $ }, y.value = {
425
- left: `${J.width / 2 - V}px`,
426
- top: k ? "auto" : void 0,
427
- bottom: k ? "-8px" : void 0
428
- }, T.value = k, _.value = D;
429
- }
430
- return Q(o, (G) => {
431
- G ? X(() => {
432
- K(), window.addEventListener("resize", K), r.value && (I && I.disconnect(), I = new ResizeObserver(
433
- () => K()
434
- ), I.observe(r.value));
435
- }) : (window.removeEventListener("resize", K), I && I.disconnect());
436
- }), de(() => {
437
- window.removeEventListener("resize", K), I && I.disconnect();
438
- }), (G, J) => (u(), v("div", Vt, [
439
- n("div", {
440
- ref_key: "triggerRef",
441
- ref: s,
442
- class: "g-popover-trigger",
443
- id: `${b(d)}-trigger`
444
- }, [
445
- P(G.$slots, "trigger", { toggle: f }, void 0, !0)
446
- ], 8, At),
447
- (u(), q(Me, { to: "#modal-root" }, [
448
- W(we, {
449
- name: "g-popover-expand",
450
- appear: ""
451
- }, {
452
- default: U(() => [
453
- o.value ? (u(), v("div", {
454
- key: 0,
455
- ref_key: "popoverRef",
456
- ref: r,
457
- class: O({
458
- "g-popover": !0,
459
- "g-popover-above": T.value,
460
- "g-popover-below": !T.value,
461
- "g-popover-minimal": e.minimal
462
- }),
463
- role: "dialog",
464
- "aria-modal": "true",
465
- "aria-labelledby": `${b(d)}-trigger`,
466
- style: ce({
467
- top: p.value.top + "px",
468
- left: p.value.left + "px",
469
- zIndex: b(m)
470
- })
471
- }, [
472
- !_.value && !e.minimal ? (u(), v("div", {
473
- key: 0,
474
- class: O(["g-popover-arrow", { "g-popover-arrow-above": T.value }]),
475
- style: ce(y.value),
476
- "aria-hidden": "true"
477
- }, null, 6)) : M("", !0),
478
- P(G.$slots, "default", {}, void 0, !0),
479
- e.minimal ? M("", !0) : (u(), v("button", {
480
- key: 1,
481
- class: "g-popover-close",
482
- type: "button",
483
- "aria-label": "Close popover",
484
- onClick: S
485
- }, [...J[0] || (J[0] = [
486
- n("svg", {
487
- class: "g-popover-close-icon",
488
- xmlns: "http://www.w3.org/2000/svg",
489
- viewBox: "0 0 51.26 51.26",
490
- "aria-hidden": "true"
491
- }, [
492
- n("path", {
493
- fill: "currentColor",
494
- d: "m37.84 32.94-7.63-7.63 7.63-7.63a3.24 3.24 0 0 0-4.58-4.58l-7.63 7.63L18 13.1a3.24 3.24 0 0 0-4.58 4.58L21 25.31l-7.62 7.63A3.24 3.24 0 1 0 18 37.52l7.63-7.63 7.63 7.63a3.24 3.24 0 0 0 4.58-4.58Z"
495
- })
496
- ], -1)
497
- ])]))
498
- ], 14, Tt)) : M("", !0)
499
- ]),
500
- _: 3
501
- })
502
- ]))
503
- ]));
504
- }
505
- }), Te = /* @__PURE__ */ z(Ot, [["__scopeId", "data-v-daea14c9"]]), Gt = ["disabled"], Dt = { class: "g-select-btn-legend" }, Ft = { class: "g-select-btn-row" }, Pt = ["id", "name", "value", "checked", "disabled", "onChange"], Rt = ["for"], Ht = {}, Kt = /* @__PURE__ */ A({
506
- ...Ht,
507
- __name: "GSelectButton",
508
- props: /* @__PURE__ */ H({
509
- options: {},
510
- label: {},
511
- size: { default: "medium" },
512
- name: { default: void 0 },
513
- disabled: { type: Boolean, default: !1 },
514
- errors: { default: () => [] }
515
- }, {
516
- modelValue: { default: () => "" },
517
- modelModifiers: {}
518
- }),
519
- emits: /* @__PURE__ */ H(["change"], ["update:modelValue"]),
520
- setup(e, { emit: l }) {
521
- const t = e, a = l, o = j(e, "modelValue"), s = Y(), { displayErrors: r, hasErrors: d } = $e({
522
- name: t.name,
523
- value: o,
524
- errors: _e(t, "errors")
525
- }), i = x(() => t.options.map((h) => typeof h == "string" ? { label: h, value: h } : h)), c = x(() => [
526
- "g-select-btn-group",
527
- `g-select-btn-group--${t.size}`
528
- ]), g = (h) => [
529
- "g-select-btn",
530
- h ? "g-select-btn--selected" : "",
531
- { "g-select-btn--disabled": t.disabled }
532
- ];
533
- function m(h) {
534
- !t.disabled && h !== o.value && (o.value = h, a("change", h));
535
- }
536
- return (h, L) => (u(), v("fieldset", {
537
- class: O(c.value),
538
- disabled: t.disabled
539
- }, [
540
- n("legend", Dt, C(t.label), 1),
541
- n("div", {
542
- class: O(["g-select-btn-wrapper", { "g-select-btn-has-error": b(d) }])
543
- }, [
544
- n("div", Ft, [
545
- (u(!0), v(F, null, Z(i.value, (S, f) => (u(), v(F, {
546
- key: S.value
547
- }, [
548
- n("input", {
549
- class: "g-select-btn-radio",
550
- type: "radio",
551
- id: `${b(s)}-${S.value}`,
552
- name: t.name || b(s),
553
- value: S.value,
554
- checked: S.value === o.value,
555
- disabled: t.disabled,
556
- onChange: (p) => m(S.value)
557
- }, null, 40, Pt),
558
- n("label", {
559
- for: `${b(s)}-${S.value}`,
560
- class: O(g(S.value === o.value))
561
- }, C(S.label), 11, Rt)
562
- ], 64))), 128))
563
- ]),
564
- W(Ee, {
565
- errors: b(r),
566
- id: "error-message-" + b(s)
567
- }, null, 8, ["errors", "id"])
568
- ], 2)
569
- ], 10, Gt));
570
- }
571
- }), Ut = /* @__PURE__ */ z(Kt, [["__scopeId", "data-v-f2a878c6"]]), jt = ["width", "height"], Nt = ["cx", "cy", "r"], Wt = ["cx", "cy", "r", "stroke-dasharray", "stroke-dashoffset"], qt = ["cx", "cy", "r"], Zt = {}, Yt = /* @__PURE__ */ A({
572
- ...Zt,
573
- __name: "GProgress",
574
- props: {
575
- label: { default: "Loading" },
576
- value: { default: void 0 },
577
- size: { default: "medium" }
578
- },
579
- setup(e) {
580
- const l = e, t = x(
581
- () => l.value && l.value >= 1 && l.value <= 100
582
- ), a = x(() => {
583
- switch (l.size) {
584
- case "tiny":
585
- return 9;
586
- case "small":
587
- return 12;
588
- case "large":
589
- return 24;
590
- default:
591
- return 18;
592
- }
593
- }), o = 4, s = x(() => 2 * Math.PI * a.value), r = x(
594
- () => t.value ? l.value / 100 * s.value : 0
595
- ), d = x(
596
- () => t.value ? {
597
- role: "progressbar",
598
- "aria-valuenow": l.value,
599
- "aria-valuemin": 1,
600
- "aria-valuemax": 100,
601
- "aria-label": l.label
602
- } : {
603
- role: "status",
604
- "aria-label": l.label
605
- }
606
- );
607
- return (i, c) => (u(), v("span", ae({ class: "g-progress" }, d.value), [
608
- (u(), v("svg", {
609
- width: a.value * 2 + o,
610
- height: a.value * 2 + o,
611
- class: O([
612
- "g-progress__svg",
613
- {
614
- "g-progress--determinate": t.value,
615
- "g-progress--indeterminate": !t.value
616
- }
617
- ]),
618
- focusable: "false",
619
- "aria-hidden": "true"
620
- }, [
621
- n("circle", {
622
- class: "g-progress__track",
623
- cx: a.value + o / 2,
624
- cy: a.value + o / 2,
625
- r: a.value,
626
- "stroke-width": o,
627
- fill: "none"
628
- }, null, 8, Nt),
629
- t.value ? (u(), v("circle", {
630
- key: 0,
631
- class: "g-progress__value",
632
- cx: a.value + o / 2,
633
- cy: a.value + o / 2,
634
- r: a.value,
635
- "stroke-width": o,
636
- fill: "none",
637
- "stroke-dasharray": s.value,
638
- "stroke-dashoffset": s.value - r.value,
639
- style: { transform: "rotate(-90deg)", "transform-origin": "center" }
640
- }, null, 8, Wt)) : (u(), v("circle", {
641
- key: 1,
642
- class: "g-progress__spinner",
643
- cx: a.value + o / 2,
644
- cy: a.value + o / 2,
645
- r: a.value,
646
- "stroke-width": o,
647
- fill: "none"
648
- }, null, 8, qt))
649
- ], 10, jt))
650
- ], 16));
651
- }
652
- }), Qt = /* @__PURE__ */ z(Yt, [["__scopeId", "data-v-c010c3b0"]]), Xt = ["id", "aria-labelledby", "aria-describedby"], Jt = { class: "g-alertdialog-inner" }, el = ["id"], tl = ["id"], ll = { class: "g-alertdialog-actions" }, al = {}, ol = /* @__PURE__ */ A({
653
- ...al,
654
- __name: "GAlertDialog",
655
- props: {
656
- label: { default: "Confirmation" },
657
- buttonText: { default: "Continue" },
658
- buttonColor: { default: "primary" }
659
- },
660
- emits: ["cancel", "confirm"],
661
- setup(e, { emit: l }) {
662
- const t = e, a = l, o = E(null), s = E(!0), r = Y(), { pop: d, push: i, isTop: c, zIndex: g } = Ce(r, !0, !0), { deactivate: m, activate: h } = Ve(o, c);
663
- function L() {
664
- a("cancel");
665
- }
666
- return Ae([o], c, s, L, d), re(() => {
667
- i(), h();
668
- }), je(() => {
669
- d(), m();
670
- }), (S, f) => (u(), q(Me, { to: "#modal-root" }, [
671
- W(we, {
672
- name: "g-fade",
673
- appear: ""
674
- }, {
675
- default: U(() => [
676
- n("div", {
677
- id: "alertdialog-" + b(r),
678
- class: "g-alertdialog",
679
- role: "alertdialog",
680
- "aria-modal": "true",
681
- "aria-labelledby": "alertdialog-label-" + b(r),
682
- "aria-describedby": "alertdialog-description-" + b(r),
683
- ref_key: "dialog",
684
- ref: o,
685
- style: ce({ zIndex: b(g) })
686
- }, [
687
- n("div", Jt, [
688
- n("h2", {
689
- id: "alertdialog-label-" + b(r),
690
- class: "g-alertdialog-label"
691
- }, C(t.label), 9, el),
692
- n("div", {
693
- id: "alertdialog-description-" + b(r),
694
- class: "g-alertdialog-content"
695
- }, [
696
- P(S.$slots, "default", {}, void 0, !0)
697
- ], 8, tl),
698
- n("div", ll, [
699
- W(se, {
700
- outlined: "",
701
- onClick: f[0] || (f[0] = (p) => a("cancel"))
702
- }, {
703
- default: U(() => [...f[2] || (f[2] = [
704
- N("Cancel", -1)
705
- ])]),
706
- _: 1
707
- }),
708
- W(se, {
709
- theme: t.buttonColor,
710
- onClick: f[1] || (f[1] = (p) => a("confirm"))
711
- }, {
712
- default: U(() => [
713
- N(C(t.buttonText), 1)
714
- ]),
715
- _: 1
716
- }, 8, ["theme"])
717
- ])
718
- ])
719
- ], 12, Xt)
720
- ]),
721
- _: 3
722
- })
723
- ]));
724
- }
725
- }), $s = /* @__PURE__ */ z(ol, [["__scopeId", "data-v-144faf08"]]), sl = ["id"], nl = { class: "g-select-input-wrap" }, rl = ["id"], il = ["value", "placeholder", "disabled", "aria-controls", "aria-expanded", "aria-activedescendant"], ul = ["id", "aria-controls", "aria-expanded", "aria-activedescendant"], dl = ["id"], cl = ["id", "aria-selected", "onClick"], vl = {
726
- key: 1,
727
- "aria-live": "polite",
728
- class: "g-select-combo-option g-select-option g-select-no-results"
729
- }, fl = {}, bl = /* @__PURE__ */ A({
730
- ...fl,
731
- __name: "GSelect",
732
- props: /* @__PURE__ */ H({
733
- options: {},
734
- label: {},
735
- hiddenLabel: { type: Boolean },
736
- placeholder: {},
737
- disabled: { type: Boolean, default: !1 },
738
- name: { default: void 0 },
739
- searchable: { type: Boolean, default: !1 },
740
- clearButton: { type: Boolean },
741
- compact: { type: Boolean, default: !1 },
742
- errors: { default: () => [] }
743
- }, {
744
- modelValue: {},
745
- modelModifiers: {}
746
- }),
747
- emits: /* @__PURE__ */ H(["change"], ["update:modelValue"]),
748
- setup(e, { emit: l }) {
749
- const t = e, a = l, o = j(e, "modelValue"), s = Y(), r = E(null), d = E(null), i = E(!1), c = E(0), g = E(!1), m = E(!1), { push: h, pop: L, isTop: S } = Ce(s), { displayErrors: f, hasErrors: p } = $e({
750
- name: t.name,
751
- value: o,
752
- errors: _e(t, "errors")
753
- }), y = E("below"), T = E(null), _ = x(() => {
754
- const w = {};
755
- return T.value !== null && (w.maxHeight = `${T.value}px`), y.value === "above" ? (w.top = "auto", w.bottom = "100%") : (w.top = "100%", w.bottom = "auto"), w;
756
- });
757
- function I() {
758
- if (!i.value || !r.value)
759
- return;
760
- const w = r.value.getBoundingClientRect(), B = window.innerHeight - w.bottom, le = w.top, ie = d.value?.scrollHeight ?? 200, xe = Math.min(200, ie), Le = 8;
761
- if (B >= xe) {
762
- y.value = "below", T.value = Math.max(0, Math.floor(B - Le));
763
- return;
764
- }
765
- if (B < xe && le > B) {
766
- y.value = "above", T.value = Math.max(0, Math.floor(le - Le));
767
- return;
768
- }
769
- y.value = "below", T.value = Math.max(0, Math.floor(B - Le));
770
- }
771
- let K = null;
772
- function G() {
773
- if (K)
774
- return;
775
- const w = () => {
776
- I();
777
- };
778
- window.addEventListener("resize", w, { passive: !0 }), window.addEventListener("scroll", w, {
779
- passive: !0,
780
- capture: !0
781
- }), K = () => {
782
- window.removeEventListener("resize", w), window.removeEventListener("scroll", w, !0), K = null;
783
- };
784
- }
785
- function J() {
786
- K && K();
787
- }
788
- const R = x(() => t.options.map((w) => typeof w == "string" ? { label: w, value: w } : w)), te = E(""), ee = x(() => {
789
- if (!t.searchable || !i.value || !te.value)
790
- return R.value;
791
- const w = te.value.toLowerCase();
792
- return R.value.filter(
793
- (B) => B.label.toLowerCase().includes(w)
794
- );
795
- }), oe = x(() => ee.value.findIndex((w) => w.value === o.value));
796
- Q(
797
- () => o.value,
798
- (w) => {
799
- const B = ee.value.findIndex((le) => le.value === w);
800
- B !== -1 && (c.value = B);
801
- }
802
- ), Q(i, (w) => {
803
- w ? h() : L();
804
- }), Q(i, (w) => {
805
- w ? (G(), X(() => {
806
- I();
807
- })) : (J(), y.value = "below", T.value = null);
808
- });
809
- function $() {
810
- if (!t.disabled && (i.value = !0, X(() => {
811
- I();
812
- }), t.searchable)) {
813
- te.value = "";
814
- const w = ee.value.findIndex(
815
- (B) => B.value === o.value
816
- );
817
- c.value = w !== -1 ? w : 0, X(() => {
818
- k.value && k.value.focus();
819
- });
820
- }
821
- }
822
- function V() {
823
- i.value = !1, t.searchable && (te.value = "");
824
- }
825
- de(() => {
826
- J();
827
- });
828
- const k = E(null);
829
- function D(w) {
830
- if (!t.disabled && t.searchable) {
831
- if (m.value) {
832
- m.value = !1;
833
- return;
834
- }
835
- $();
836
- }
837
- }
838
- function ne(w) {
839
- if (!t.searchable) return;
840
- i.value || $(), te.value = w.target.value;
841
- const B = ee.value.findIndex(
842
- (le) => le.value === o.value
843
- );
844
- c.value = B !== -1 ? B : 0;
845
- }
846
- function ge(w) {
847
- const B = w.relatedTarget;
848
- if (g.value) {
849
- g.value = !1;
850
- return;
851
- }
852
- B && d.value && d.value.contains(B) || (t.searchable && (te.value = ""), V());
853
- }
854
- function me(w) {
855
- const B = ee.value[w];
856
- B && B.value !== o.value && (o.value = B.value, a("change", B.value)), m.value = !0, V(), setTimeout(() => {
857
- m.value = !1;
858
- }, 100);
859
- }
860
- function pe() {
861
- t.disabled || (i.value ? V() : $());
862
- }
863
- function he(w) {
864
- if (t.disabled)
865
- return;
866
- const B = ee.value.length - 1;
867
- if (!i.value && ["ArrowDown", "ArrowUp", "Enter", " "].includes(w.key)) {
868
- w.preventDefault(), $();
869
- return;
870
- }
871
- switch (w.key) {
872
- case "ArrowDown":
873
- w.preventDefault(), i.value ? (c.value = Math.min(B, c.value + 1), ye()) : $();
874
- break;
875
- case "ArrowUp":
876
- w.preventDefault(), i.value ? (c.value = Math.max(0, c.value - 1), ye()) : $();
877
- break;
878
- case "Home":
879
- w.preventDefault(), c.value = 0, ye();
880
- break;
881
- case "End":
882
- w.preventDefault(), c.value = B, ye();
883
- break;
884
- case "Enter":
885
- case " ":
886
- w.preventDefault(), i.value ? me(c.value) : $();
887
- break;
888
- case "Escape":
889
- S.value && (w.preventDefault(), setTimeout(() => {
890
- V();
891
- }, 0));
892
- break;
893
- }
894
- }
895
- function Je(w) {
896
- me(w);
897
- }
898
- function et() {
899
- g.value = !0;
900
- }
901
- function ye() {
902
- X(() => {
903
- const w = document.getElementById(
904
- `${s}-option-${c.value}`
905
- );
906
- w && w.scrollIntoView({ block: "nearest" });
907
- });
908
- }
909
- const ze = x(() => t.clearButton && o.value !== null && o.value !== void 0 && !t.disabled);
910
- function Oe() {
911
- t.disabled || (o.value = null, a("change", null), t.searchable && (te.value = ""));
912
- }
913
- return de(() => {
914
- L();
915
- }), (w, B) => (u(), v("div", {
916
- class: O(["g-select-root g-select-combo", { "g-select-open": i.value, "g-select-compact": e.compact, "g-select-has-error": b(p) }])
917
- }, [
918
- e.hiddenLabel ? M("", !0) : (u(), v("div", {
919
- key: 0,
920
- id: b(s) + "-label",
921
- class: "g-select-combo-label g-select-label"
922
- }, C(t.label), 9, sl)),
923
- n("div", nl, [
924
- t.searchable ? (u(), v("div", {
925
- key: 0,
926
- class: "g-select-combo-input g-select-control",
927
- id: b(s)
928
- }, [
929
- n("input", ae(
930
- {
931
- ref_key: "comboRef",
932
- ref: r,
933
- type: "text",
934
- name: "comboInput",
935
- class: ["g-select-search-input", { "g-select-clearable": e.clearButton }],
936
- value: i.value ? te.value : R.value[oe.value] ? R.value[oe.value].label : "",
937
- placeholder: i.value ? "" : e.placeholder,
938
- disabled: t.disabled,
939
- onFocus: D,
940
- onInput: ne,
941
- onKeydown: he,
942
- onBlur: ge,
943
- "aria-autocomplete": "list",
944
- "aria-controls": b(s) + "-listbox",
945
- "aria-expanded": i.value ? "true" : "false",
946
- "aria-haspopup": "listbox",
947
- "aria-activedescendant": i.value ? b(s) + "-option-" + c.value : void 0
948
- },
949
- e.hiddenLabel ? { "aria-label": t.label } : { "aria-labelledby": b(s) + "-label" },
950
- {
951
- role: "combobox",
952
- autocomplete: "off"
953
- }
954
- ), null, 16, il),
955
- ze.value ? (u(), v("button", {
956
- key: 0,
957
- type: "button",
958
- class: "g-select-clear-btn",
959
- onClick: Oe
960
- }, [...B[0] || (B[0] = [
961
- n("svg", {
962
- role: "img",
963
- "aria-label": "Clear Selection",
964
- xmlns: "http://www.w3.org/2000/svg",
965
- viewBox: "0 0 51.26 51.26",
966
- width: "1.125em"
967
- }, [
968
- n("path", {
969
- fill: "currentColor",
970
- d: "m37.84 32.94-7.63-7.63 7.63-7.63a3.24 3.24 0 0 0-4.58-4.58l-7.63 7.63L18 13.1a3.24 3.24 0 0 0-4.58 4.58L21 25.31l-7.62 7.63A3.24 3.24 0 1 0 18 37.52l7.63-7.63 7.63 7.63a3.24 3.24 0 0 0 4.58-4.58Z"
971
- })
972
- ], -1)
973
- ])])) : M("", !0),
974
- B[1] || (B[1] = n("svg", {
975
- class: "g-select-caret",
976
- xmlns: "http://www.w3.org/2000/svg",
977
- viewBox: "0 0 51.26 51.26",
978
- "aria-hidden": "true",
979
- width: "1.125em"
980
- }, [
981
- n("path", {
982
- fill: "currentColor",
983
- d: "M38.75 24.13a1.36 1.36 0 0 1 0 2.36l-12.44 7.18-12.43 7.18a1.36 1.36 0 0 1-2.05-1.18V11a1.36 1.36 0 0 1 2.05-1.18L26.31 17Z"
984
- })
985
- ], -1))
986
- ], 8, rl)) : (u(), v("div", ae(
987
- {
988
- key: 1,
989
- ref_key: "comboRef",
990
- ref: r,
991
- id: b(s),
992
- class: ["g-select-combo-button g-select-control", { "g-select-clearable": e.clearButton }],
993
- role: "combobox",
994
- "aria-controls": b(s) + "-listbox",
995
- "aria-expanded": i.value ? "true" : "false",
996
- "aria-haspopup": "listbox"
997
- },
998
- e.hiddenLabel ? { "aria-label": t.label } : { "aria-labelledby": b(s) + "-label" },
999
- {
1000
- "aria-activedescendant": i.value ? b(s) + "-option-" + c.value : void 0,
1001
- tabindex: "0",
1002
- onClick: pe,
1003
- onKeydown: he,
1004
- onFocus: D,
1005
- onBlur: ge
1006
- }
1007
- ), [
1008
- N(C(R.value[oe.value] ? R.value[oe.value].label : "") + " ", 1),
1009
- ze.value ? (u(), v("button", {
1010
- key: 0,
1011
- type: "button",
1012
- class: "g-select-clear-btn",
1013
- onClick: ue(Oe, ["stop"])
1014
- }, [...B[2] || (B[2] = [
1015
- n("svg", {
1016
- role: "img",
1017
- "aria-label": "Clear Selection",
1018
- xmlns: "http://www.w3.org/2000/svg",
1019
- viewBox: "0 0 51.26 51.26",
1020
- width: "1.125em"
1021
- }, [
1022
- n("path", {
1023
- fill: "currentColor",
1024
- d: "m37.84 32.94-7.63-7.63 7.63-7.63a3.24 3.24 0 0 0-4.58-4.58l-7.63 7.63L18 13.1a3.24 3.24 0 0 0-4.58 4.58L21 25.31l-7.62 7.63A3.24 3.24 0 1 0 18 37.52l7.63-7.63 7.63 7.63a3.24 3.24 0 0 0 4.58-4.58Z"
1025
- })
1026
- ], -1)
1027
- ])])) : M("", !0),
1028
- B[3] || (B[3] = n("svg", {
1029
- class: "g-select-caret",
1030
- xmlns: "http://www.w3.org/2000/svg",
1031
- viewBox: "0 0 51.26 51.26",
1032
- "aria-hidden": "true",
1033
- width: "1.125em"
1034
- }, [
1035
- n("path", {
1036
- fill: "currentColor",
1037
- d: "M38.75 24.13a1.36 1.36 0 0 1 0 2.36l-12.44 7.18-12.43 7.18a1.36 1.36 0 0 1-2.05-1.18V11a1.36 1.36 0 0 1 2.05-1.18L26.31 17Z"
1038
- })
1039
- ], -1))
1040
- ], 16, ul)),
1041
- ke(n("div", ae(
1042
- {
1043
- ref_key: "listboxRef",
1044
- ref: d,
1045
- class: ["g-select-combo-menu g-select-list", {
1046
- "g-select-combo-menu--above": y.value === "above"
1047
- }],
1048
- style: _.value,
1049
- role: "listbox",
1050
- id: b(s) + "-listbox"
1051
- },
1052
- e.hiddenLabel ? { "aria-label": t.label } : { "aria-labelledby": b(s) + "-label" },
1053
- { tabindex: "-1" }
1054
- ), [
1055
- ee.value.length > 0 ? (u(!0), v(F, { key: 0 }, Z(ee.value, (le, ie) => (u(), v("div", {
1056
- key: le.value,
1057
- id: b(s) + "-option-" + ie,
1058
- class: O(["g-select-combo-option g-select-option", {
1059
- "g-select-option-current": ie === c.value,
1060
- "ilw-theme-blue": le.value === o.value
1061
- }]),
1062
- role: "option",
1063
- "aria-selected": le.value === o.value ? "true" : "false",
1064
- onMousedown: et,
1065
- onClick: (xe) => Je(ie)
1066
- }, [
1067
- P(w.$slots, "option", {
1068
- option: le,
1069
- selected: le.value === o.value,
1070
- index: ie
1071
- }, () => [
1072
- N(C(le.label), 1)
1073
- ], !0)
1074
- ], 42, cl))), 128)) : (u(), v("div", vl, " No results found. "))
1075
- ], 16, dl), [
1076
- [lt, i.value]
1077
- ])
1078
- ]),
1079
- W(Ee, {
1080
- errors: b(f),
1081
- id: "error-message-" + b(s)
1082
- }, null, 8, ["errors", "id"])
1083
- ], 2));
1084
- }
1085
- }), Xe = /* @__PURE__ */ z(bl, [["__scopeId", "data-v-f2abeeaa"]]), gl = ["aria-label"], ml = ["placeholder", "value", "aria-expanded", "aria-controls", "aria-activedescendant"], pl = {
1086
- key: 0,
1087
- class: "g-search-dropdown"
1088
- }, hl = {
1089
- "aria-live": "polite",
1090
- class: "g-search-result-count"
1091
- }, yl = ["id"], kl = ["aria-label"], _l = { class: "g-search-group-label" }, wl = ["id", "onMousedown", "aria-selected"], $l = ["id", "onMousedown", "aria-selected"], Cl = {}, Cs = /* @__PURE__ */ A({
1092
- ...Cl,
1093
- __name: "GSearch",
1094
- props: /* @__PURE__ */ H({
1095
- results: {},
1096
- placeholder: { default: "Search..." },
1097
- label: { default: "Search" },
1098
- auto: { type: Boolean, default: !0 },
1099
- loading: { type: Boolean }
1100
- }, {
1101
- modelValue: { default: () => "" },
1102
- modelModifiers: {}
1103
- }),
1104
- emits: /* @__PURE__ */ H(["select", "submit"], ["update:modelValue"]),
1105
- setup(e, { emit: l }) {
1106
- const t = j(e, "modelValue"), a = e, o = l, s = E(null), r = E(null), d = E(!0), i = E(-1), c = x(() => Array.isArray(a.results) && a.results.length && "items" in a.results[0] ? a.results.flatMap((I) => I.items) : a.results), g = x(() => c.value.length);
1107
- function m(I) {
1108
- const K = I.target.value;
1109
- t.value = K, a.auto && K.length > 1 && (d.value = !1);
1110
- }
1111
- function h() {
1112
- X(() => {
1113
- const I = r.value?.querySelector('[aria-selected="true"]');
1114
- I && I.scrollIntoView({ block: "nearest" });
1115
- });
1116
- }
1117
- const { focused: L } = ct(s);
1118
- function S(I) {
1119
- const K = I.altKey;
1120
- if (I.key === "ArrowDown") {
1121
- if (!g.value)
1122
- return;
1123
- I.preventDefault(), d.value = !1, K || (i.value = (i.value + 1) % g.value, h());
1124
- } else if (I.key === "ArrowUp") {
1125
- if (!g.value)
1126
- return;
1127
- I.preventDefault(), d.value = !1, i.value = (i.value - 1 + g.value) % g.value, h();
1128
- } else if (I.key === "Enter")
1129
- d.value ? (o("submit", t.value), d.value = !1, I.preventDefault()) : f(c.value[i.value]);
1130
- else if (I.key === "Escape") {
1131
- if (!g.value)
1132
- return;
1133
- I.preventDefault(), y.value || (t.value = ""), d.value = !0, i.value = -1;
1134
- }
1135
- ["Backspace", "Delete", "Clear", "Undo"].includes(I.key) && (d.value = !0);
1136
- }
1137
- function f(I) {
1138
- o("select", I), t.value = "", d.value = !0, i.value = -1;
1139
- }
1140
- const p = x(() => !!a.loading), y = x(() => L.value && !d.value), T = vt(() => {
1141
- o("submit", t.value);
1142
- }, 300);
1143
- Q(
1144
- () => t.value,
1145
- (I) => {
1146
- I ? a.auto && T() : i.value = -1;
1147
- }
1148
- );
1149
- const _ = Y();
1150
- return (I, K) => (u(), v("div", {
1151
- class: "g-search",
1152
- role: "search",
1153
- "aria-label": a.label
1154
- }, [
1155
- n("form", {
1156
- class: "g-search-form",
1157
- onSubmit: K[0] || (K[0] = ue((G) => f(null), ["prevent"]))
1158
- }, [
1159
- n("input", {
1160
- ref_key: "inputRef",
1161
- ref: s,
1162
- class: "g-search-input",
1163
- name: "search",
1164
- type: "search",
1165
- placeholder: a.placeholder,
1166
- value: t.value,
1167
- onInput: m,
1168
- onKeydown: S,
1169
- role: "combobox",
1170
- "aria-expanded": y.value,
1171
- "aria-autocomplete": "list",
1172
- "aria-controls": `${b(_)}-list`,
1173
- "aria-activedescendant": i.value >= 0 ? "g-search-option-" + c.value[i.value].id : void 0
1174
- }, null, 40, ml),
1175
- n("button", {
1176
- type: "submit",
1177
- class: "g-search-submit",
1178
- "aria-label": "Submit search",
1179
- onKeydown: S
1180
- }, [
1181
- p.value ? (u(), q(Qt, {
1182
- key: 0,
1183
- size: "tiny"
1184
- })) : M("", !0),
1185
- K[1] || (K[1] = n("svg", {
1186
- role: "img",
1187
- "aria-label": "Search",
1188
- xmlns: "http://www.w3.org/2000/svg",
1189
- viewBox: "0 0 51.26 51.26"
1190
- }, [
1191
- n("path", {
1192
- fill: "currentColor",
1193
- d: "M30 9.76A14.05 14.05 0 1 0 28.3 31l11.3 13a3.34 3.34 0 0 0 4.72-4.72L31.44 27.86A14.05 14.05 0 0 0 30 9.76ZM27.27 27a10.26 10.26 0 1 1 0-14.5 10.25 10.25 0 0 1 0 14.5Z"
1194
- })
1195
- ], -1))
1196
- ], 32)
1197
- ], 32),
1198
- y.value ? (u(), v("div", pl, [
1199
- n("div", hl, [
1200
- p.value ? M("", !0) : (u(), v(F, { key: 0 }, [
1201
- N(C(g.value) + " result" + C(g.value === 1 ? "" : "s"), 1)
1202
- ], 64))
1203
- ]),
1204
- n("div", {
1205
- role: "listbox",
1206
- id: `${b(_)}-list`,
1207
- ref_key: "listboxRef",
1208
- ref: r,
1209
- "aria-label": "Search results"
1210
- }, [
1211
- g.value > 0 && "items" in a.results[0] ? (u(!0), v(F, { key: 0 }, Z(a.results, (G, J) => (u(), v("div", {
1212
- key: G.type,
1213
- class: "g-search-group",
1214
- role: "group",
1215
- "aria-label": G.label
1216
- }, [
1217
- P(I.$slots, "group", { group: G }, () => [
1218
- n("div", _l, C(G.label), 1)
1219
- ]),
1220
- (u(!0), v(F, null, Z(G.items, (R, te) => (u(), v("div", {
1221
- key: R.id,
1222
- id: "g-search-option-" + R.id,
1223
- class: O(["g-search-option", {
1224
- "g-search-option-active": c.value[i.value] && c.value[i.value].id === R.id
1225
- }]),
1226
- role: "option",
1227
- onMousedown: ue((ee) => f(R), ["prevent"]),
1228
- "aria-selected": c.value[i.value] && c.value[i.value].id === R.id
1229
- }, [
1230
- P(I.$slots, "option", { option: R }, () => [
1231
- N(C(R.title), 1)
1232
- ])
1233
- ], 42, wl))), 128))
1234
- ], 8, kl))), 128)) : g.value > 0 ? (u(!0), v(F, { key: 1 }, Z(c.value, (G, J) => (u(), v("div", {
1235
- key: G.id,
1236
- id: "g-search-option-" + G.id,
1237
- class: O(["g-search-option", {
1238
- "g-search-option-active": i.value === J
1239
- }]),
1240
- role: "option",
1241
- onMousedown: ue((R) => f(G), ["prevent"]),
1242
- "aria-selected": i.value === J
1243
- }, [
1244
- P(I.$slots, "option", { option: G }, () => [
1245
- N(C(G.title), 1)
1246
- ])
1247
- ], 42, $l))), 128)) : M("", !0)
1248
- ], 8, yl)
1249
- ])) : M("", !0)
1250
- ], 8, gl));
1251
- }
1252
- }), xl = {
1253
- class: /* @__PURE__ */ O({
1254
- "g-app-header": !0
1255
- })
1256
- }, Ll = { class: "g-app-header__brand" }, Sl = {
1257
- class: "g-app-header__brand-text",
1258
- href: "/"
1259
- }, Il = {
1260
- key: 0,
1261
- class: "g-app-header__block-i-container"
1262
- }, Ml = { class: "g-app-header__title" }, El = { class: "g-app-header__app-controls-wrap" }, Bl = {}, Vl = /* @__PURE__ */ A({
1263
- ...Bl,
1264
- __name: "GAppHeader",
1265
- props: {
1266
- illinois: { type: Boolean, default: !1 },
1267
- brand: { default: "GRAD" }
1268
- },
1269
- setup(e) {
1270
- return (l, t) => (u(), v("header", xl, [
1271
- t[1] || (t[1] = n("div", { class: "g-app-header__background" }, [
1272
- n("div", { class: "g-app-header__background-pattern" }),
1273
- n("div", { class: "g-app-header__background-gradient" })
1274
- ], -1)),
1275
- n("div", Ll, [
1276
- P(l.$slots, "left", {}, () => [
1277
- n("a", Sl, C(e.brand), 1)
1278
- ], !0)
1279
- ]),
1280
- e.illinois ? (u(), v("div", Il, [...t[0] || (t[0] = [
1281
- n("svg", {
1282
- class: "g-app-header__block-i",
1283
- role: "img",
1284
- width: "55",
1285
- viewBox: "0 0 55 79",
1286
- xmlns: "http://www.w3.org/2000/svg"
1287
- }, [
1288
- n("title", null, "Block I logo"),
1289
- n("path", {
1290
- class: "g-app-header__block-i-outline",
1291
- d: "M54.2 21.1V0H0v21.1h12v36.1H0v21.1h54.2V57.2h-12V21.1z"
1292
- }),
1293
- n("path", {
1294
- class: "g-app-header__block-i-fill",
1295
- d: "M42.1 18.1h9V3H3v15h9c1.7 0 3 1.3 3 3v36.1c0 1.7-1.3 3-3 3H3v15h48.1v-15h-9c-1.7 0-3-1.3-3-3v-36c0-1.7 1.4-3 3-3z"
1296
- })
1297
- ], -1)
1298
- ])])) : P(l.$slots, "icon", { key: 1 }, void 0, !0),
1299
- n("div", Ml, [
1300
- P(l.$slots, "title", {}, void 0, !0)
1301
- ]),
1302
- n("div", El, [
1303
- P(l.$slots, "app-controls", { class: "g-app-header__app-controls" }, void 0, !0)
1304
- ])
1305
- ]));
1306
- }
1307
- }), xs = /* @__PURE__ */ z(Vl, [["__scopeId", "data-v-bff91eee"]]), Al = ["id"], Tl = {}, zl = /* @__PURE__ */ A({
1308
- ...Tl,
1309
- __name: "GSidebar",
1310
- props: {
1311
- backgroundColor: { default: "" },
1312
- backgroundImage: { default: "none" },
1313
- theme: { default: "dark" },
1314
- topOffset: { default: "" },
1315
- topOffsetVar: { default: "" },
1316
- width: { default: "300px" }
1317
- },
1318
- setup(e) {
1319
- const l = e, t = be(
1320
- "sidebar",
1321
- // This isn't required, so the default value just avoids compiler warnings
1322
- () => {
1323
- },
1324
- !0
1325
- ), a = x(() => l.backgroundImage ? l.backgroundImage : l.theme === "light" ? "none" : "url('https://gradcdn.blob.core.windows.net/public/sidebar-bg2.jpg')"), o = x(() => l.backgroundColor ? l.backgroundColor : l.theme === "light" ? "#f9f9f9" : "#030913"), s = x(() => l.topOffsetVar ? `var(${l.topOffsetVar})` : l.topOffset ? l.topOffset : "var(--g-toolbar-height)"), r = Y();
1326
- function d(i) {
1327
- i.key === "Escape" && t?.isCollapsible?.value && t?.open?.value && (t.open.value = !1, document.getElementById(`${t.id}-hamburger`)?.focus());
1328
- }
1329
- return (i, c) => (u(), v("div", {
1330
- ref: "sidebar-ref",
1331
- id: `${b(t)?.id ?? b(r)}-sidebar`,
1332
- class: O(["g-sidebar", [
1333
- `g-sidebar__${e.theme}`,
1334
- {
1335
- "g-sidebar--collapsible": b(t)?.isCollapsible?.value,
1336
- "g-sidebar--closed": !b(t)?.open?.value && b(t)?.isCollapsible?.value,
1337
- "g-sidebar--open": b(t)?.open?.value && b(t)?.isCollapsible?.value
1338
- }
1339
- ]]),
1340
- style: ce({
1341
- backgroundImage: a.value,
1342
- backgroundColor: o.value,
1343
- "--g-sidebar-top-offset": s.value,
1344
- "--g-sidebar-width": e.width ?? "300px",
1345
- width: "var(--g-sidebar-width)"
1346
- }),
1347
- onKeydown: d
1348
- }, [
1349
- P(i.$slots, "default", {}, void 0, !0)
1350
- ], 46, Al));
1351
- }
1352
- }), Ls = /* @__PURE__ */ z(zl, [["__scopeId", "data-v-73cb863d"]]), Ol = ["id"], Gl = { class: "g-sidebar-menu__list" }, Dl = ["href", "aria-current", "onClick"], Fl = {}, Pl = /* @__PURE__ */ A({
1353
- ...Fl,
1354
- __name: "GSidebarMenu",
1355
- props: /* @__PURE__ */ H({
1356
- title: {},
1357
- items: {},
1358
- offset: { default: 70 },
1359
- spy: { type: Boolean, default: !0 },
1360
- theme: { default: "light" },
1361
- compact: { type: Boolean, default: !1 }
1362
- }, {
1363
- modelValue: { default: null, type: String },
1364
- modelModifiers: {}
1365
- }),
1366
- emits: ["update:modelValue"],
1367
- setup(e) {
1368
- const l = e, t = j(e, "modelValue"), a = x(() => l.spy && t.value ? "#" + t.value : null), o = fe("content");
1369
- re(() => {
1370
- Q(
1371
- t,
1372
- () => {
1373
- X(() => {
1374
- const c = o.value?.querySelector(
1375
- ".g-sidebar-menu__is-active"
1376
- );
1377
- c && c.scrollIntoView({ block: "nearest" });
1378
- });
1379
- },
1380
- { immediate: !0 }
1381
- );
1382
- });
1383
- const s = Ne(), r = x(() => s?.appContext?.components?.RouterLink ?? null);
1384
- function d(c, g) {
1385
- if (!g.href || !g.href.startsWith("#"))
1386
- return;
1387
- const m = g.href.slice(1), h = document.getElementById(m)?.querySelector("h2, h3, h4, h5");
1388
- h && (c.preventDefault(), h.setAttribute("tabindex", "-1"), h.focus(), h.scrollIntoView({ block: "start" }), history.replaceState(null, "", g.href));
1389
- }
1390
- const i = Y();
1391
- return (c, g) => (u(), v("nav", ae({
1392
- class: ["g-sidebar-menu", [
1393
- `g-sidebar-menu__${l.theme}`,
1394
- { "g-sidebar-menu--compact": l.compact }
1395
- ]]
1396
- }, {
1397
- "aria-labelledby": e.title ? b(i) : void 0,
1398
- "aria-label": e.title ? void 0 : "Sidebar Menu"
1399
- }), [
1400
- e.title ? (u(), v("h2", {
1401
- key: 0,
1402
- id: b(i),
1403
- class: "g-sidebar-menu__title"
1404
- }, C(e.title), 9, Ol)) : M("", !0),
1405
- g[0] || (g[0] = n("div", { class: "g-sidebar-menu__divider" }, null, -1)),
1406
- n("div", {
1407
- class: "g-sidebar-menu__content",
1408
- ref_key: "content",
1409
- ref: o
1410
- }, [
1411
- n("ul", Gl, [
1412
- (u(!0), v(F, null, Z(e.items, (m) => (u(), v("li", {
1413
- key: m.href || m.to,
1414
- class: "g-sidebar-menu__item",
1415
- ref_for: !0,
1416
- ref: "listItems"
1417
- }, [
1418
- m.to && r.value ? (u(), q(ve(r.value), {
1419
- key: 0,
1420
- class: "g-sidebar-menu__link",
1421
- to: m.to
1422
- }, {
1423
- default: U(() => [
1424
- N(C(m.label), 1)
1425
- ]),
1426
- _: 2
1427
- }, 1032, ["to"])) : (u(), v("a", {
1428
- key: 1,
1429
- class: O(["g-sidebar-menu__link", {
1430
- "g-sidebar-menu__is-active": a.value === (m.href || "")
1431
- }]),
1432
- href: m.href || m.to || "#",
1433
- "aria-current": a.value === (m.href || "") ? "location" : void 0,
1434
- onClick: (h) => d(h, m)
1435
- }, C(m.label), 11, Dl))
1436
- ]))), 128))
1437
- ])
1438
- ], 512)
1439
- ], 16));
1440
- }
1441
- }), Ss = /* @__PURE__ */ z(Pl, [["__scopeId", "data-v-e228c589"]]);
1442
- let Rl = 1;
1443
- function Hl(e, l) {
1444
- const t = document.createElement("div");
1445
- return t.className = "v-gtooltip", t.textContent = e, t.setAttribute("role", "tooltip"), t.setAttribute("id", l), t;
1446
- }
1447
- function He(e, l) {
1448
- const t = e.getBoundingClientRect(), a = l.getBoundingClientRect(), o = new DOMRect(0, 0, window.innerWidth, window.innerHeight), { top: s, left: r, placedAbove: d } = Qe(t, a, o, {
1449
- gap: 8,
1450
- margin: 8,
1451
- preferAbove: !0
1452
- }), g = (t.left + t.width / 2 - r) / a.width * 100;
1453
- l.style.setProperty("--v-gtooltip-arrow-x", `${g}%`), l.classList.remove("v-gtooltip-bottom"), d || l.classList.add("v-gtooltip-bottom"), l.style.left = `${r}px`, l.style.top = `${s}px`, l.style.zIndex = `${Mt()}`, l.style.opacity = "1";
1454
- }
1455
- function Kl(e) {
1456
- e.style.opacity = "0";
1457
- }
1458
- const Ul = {
1459
- mounted(e, l) {
1460
- const t = E(null), a = E(!1), o = E(!1), s = E(l.value);
1461
- let r = null, d;
1462
- e.getAttribute("aria-describedby") ? d = e.getAttribute("aria-describedby") : (d = `v-gtooltip-${++Rl}`, e.setAttribute("aria-describedby", d));
1463
- const i = () => {
1464
- t.value || (t.value = Hl(s.value, d), (document.getElementById("modal-root") ?? document.body).appendChild(t.value), r = new ResizeObserver(() => {
1465
- t.value && (a.value || o.value) && He(e, t.value);
1466
- }), r.observe(t.value));
1467
- };
1468
- De(() => {
1469
- t.value && (t.value.textContent = s.value);
1470
- }), De(() => {
1471
- a.value || o.value ? (i(), t.value && He(e, t.value)) : t.value && (Kl(t.value), setTimeout(() => {
1472
- e.dispatchEvent(new CustomEvent("tooltip-hide"));
1473
- }, 150));
1474
- });
1475
- const c = () => {
1476
- a.value = !0;
1477
- }, g = () => {
1478
- a.value = !1;
1479
- }, m = () => {
1480
- o.value = !0;
1481
- }, h = () => {
1482
- o.value = !1;
1483
- }, L = (S) => {
1484
- (S.key === "Escape" || S.key === "Esc") && (a.value = !1, o.value = !1);
1485
- };
1486
- e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", g), e.addEventListener("focus", m), e.addEventListener("blur", h), e.addEventListener("keydown", L), i(), e._v_gtooltip = {
1487
- onMouseEnter: c,
1488
- onMouseLeave: g,
1489
- onFocus: m,
1490
- onBlur: h,
1491
- onKeyDown: L,
1492
- tooltip: t,
1493
- tooltipText: s,
1494
- isHovered: a,
1495
- isFocused: o,
1496
- resizeObserver: r,
1497
- tooltipId: d
1498
- };
1499
- },
1500
- updated(e, l) {
1501
- const t = e._v_gtooltip;
1502
- t && t.tooltipText && (t.tooltipText.value = l.value);
1503
- },
1504
- unmounted(e) {
1505
- const l = e._v_gtooltip;
1506
- l && l.tooltip && l.tooltip.value && (l.resizeObserver && l.resizeObserver.disconnect(), l.tooltip.value.remove(), l.tooltip.value = null), e.removeEventListener("mouseenter", l.onMouseEnter), e.removeEventListener("mouseleave", l.onMouseLeave), e.removeEventListener("focus", l.onFocus), e.removeEventListener("blur", l.onBlur), e.removeEventListener("keydown", l.onKeyDown), e.removeAttribute("aria-describedby");
1507
- }
1508
- }, jl = { class: "g-clipboard-text" }, Nl = {}, Wl = /* @__PURE__ */ A({
1509
- ...Nl,
1510
- __name: "GClipboard",
1511
- props: {
1512
- text: {},
1513
- hideText: { type: Boolean },
1514
- copyLabel: {}
1515
- },
1516
- setup(e) {
1517
- const l = e, t = Ul, { text: a, copy: o, copied: s, isSupported: r } = ft({
1518
- source: l.text
1519
- }), d = E(l.copyLabel ?? "Copy to clipboard"), i = () => {
1520
- r.value ? (o(), d.value = "Copied") : d.value = "Copy not supported";
1521
- }, c = () => {
1522
- d.value = l.copyLabel ?? "Copy to clipboard";
1523
- };
1524
- return (g, m) => (u(), v("div", jl, [
1525
- e.hideText ? M("", !0) : (u(), v(F, { key: 0 }, [
1526
- N(C(l.text), 1)
1527
- ], 64)),
1528
- ke((u(), v("button", {
1529
- type: "button",
1530
- "aria-label": "Copy",
1531
- onClick: i,
1532
- onTooltipHide: c,
1533
- class: "g-clipboard-text-button"
1534
- }, [...m[0] || (m[0] = [
1535
- n("svg", {
1536
- class: "g-clipboard-svg",
1537
- xmlns: "http://www.w3.org/2000/svg",
1538
- viewBox: "0 0 640 640",
1539
- height: "1.125rem",
1540
- role: "none presentation"
1541
- }, [
1542
- n("path", {
1543
- fill: "currentColor",
1544
- d: "M480 400L288 400C279.2 400 272 392.8 272 384L272 128C272 119.2 279.2 112 288 112L421.5 112C425.7 112 429.8 113.7 432.8 116.7L491.3 175.2C494.3 178.2 496 182.3 496 186.5L496 384C496 392.8 488.8 400 480 400zM288 448L480 448C515.3 448 544 419.3 544 384L544 186.5C544 169.5 537.3 153.2 525.3 141.2L466.7 82.7C454.7 70.7 438.5 64 421.5 64L288 64C252.7 64 224 92.7 224 128L224 384C224 419.3 252.7 448 288 448zM160 192C124.7 192 96 220.7 96 256L96 512C96 547.3 124.7 576 160 576L352 576C387.3 576 416 547.3 416 512L416 496L368 496L368 512C368 520.8 360.8 528 352 528L160 528C151.2 528 144 520.8 144 512L144 256C144 247.2 151.2 240 160 240L176 240L176 192L160 192z"
1545
- })
1546
- ], -1)
1547
- ])], 32)), [
1548
- [b(t), d.value]
1549
- ])
1550
- ]));
1551
- }
1552
- }), Is = /* @__PURE__ */ z(Wl, [["__scopeId", "data-v-8c42c870"]]), ql = { class: "g-history-scroller-wrapper" }, Zl = {
1553
- key: 0,
1554
- class: "g-history-shadow g-history-shadow--top",
1555
- "aria-hidden": "true"
1556
- }, Yl = {
1557
- key: 1,
1558
- class: "g-history-shadow g-history-shadow--bottom",
1559
- "aria-hidden": "true"
1560
- }, Ql = ["role", "aria-label"], Xl = {}, Jl = /* @__PURE__ */ A({
1561
- ...Xl,
1562
- __name: "GHistoryScroller",
1563
- props: {
1564
- label: {},
1565
- entries: { default: () => [] }
1566
- },
1567
- setup(e) {
1568
- const l = e, t = E(null), a = E(null), o = E(!0), s = E(!0);
1569
- async function r({ focusLast: c = !1 } = {}) {
1570
- if (t.value && (t.value.scrollTop = t.value.scrollHeight), c && a.value) {
1571
- const g = a.value.querySelectorAll(".g-history-entry");
1572
- if (g.length > 0) {
1573
- const m = g[g.length - 1];
1574
- await X(), m.focus();
1575
- }
1576
- }
1577
- }
1578
- function d() {
1579
- if (!t.value) return;
1580
- const { scrollTop: c, scrollHeight: g, clientHeight: m } = t.value;
1581
- o.value = c + m >= g - 2, s.value = c <= 2;
1582
- }
1583
- re(() => {
1584
- X(r);
1585
- }), Pe(t, () => {
1586
- o.value && r();
1587
- }), Pe(a, () => {
1588
- o.value && r();
1589
- }), Q(
1590
- () => l.entries,
1591
- async () => {
1592
- o.value && (await X(), r());
1593
- }
1594
- );
1595
- const i = x(() => [...l.entries].reverse());
1596
- return (c, g) => (u(), v("div", ql, [
1597
- s.value ? M("", !0) : (u(), v("div", Zl)),
1598
- o.value ? M("", !0) : (u(), v("div", Yl)),
1599
- n("div", {
1600
- ref_key: "scrollerRef",
1601
- ref: t,
1602
- class: "g-history-scroller",
1603
- role: e.label ? "log" : void 0,
1604
- "aria-label": e.label,
1605
- onScroll: d
1606
- }, [
1607
- W(se, {
1608
- class: O(["g-scroll-to-bottom-btn", { "scroll-to-bottom-btn--hidden": o.value }]),
1609
- size: "small",
1610
- type: "button",
1611
- onClick: g[0] || (g[0] = () => r({ focusLast: !0 })),
1612
- "aria-label": "Jump to Latest"
1613
- }, {
1614
- default: U(() => [...g[1] || (g[1] = [
1615
- n("svg", {
1616
- "aria-hidden": "true",
1617
- xmlns: "http://www.w3.org/2000/svg",
1618
- viewBox: "0 0 640 640",
1619
- height: "1.25rem"
1620
- }, [
1621
- n("path", {
1622
- fill: "currentColor",
1623
- d: "M303.5 569C312.9 578.4 328.1 578.4 337.4 569L505.4 401C514.8 391.6 514.8 376.4 505.4 367.1C496 357.8 480.8 357.7 471.5 367.1L344.5 494.1L344.5 88C344.5 74.7 333.8 64 320.5 64C307.2 64 296.5 74.7 296.5 88L296.5 494.1L169.5 367.1C160.1 357.7 144.9 357.7 135.6 367.1C126.3 376.5 126.2 391.7 135.6 401L303.6 569z"
1624
- })
1625
- ], -1)
1626
- ])]),
1627
- _: 1
1628
- }, 8, ["class"]),
1629
- n("div", {
1630
- role: "list",
1631
- ref_key: "contentRef",
1632
- ref: a,
1633
- class: "g-history-list"
1634
- }, [
1635
- (u(!0), v(F, null, Z(i.value, (m) => (u(), v("div", {
1636
- role: "listitem",
1637
- key: m.id,
1638
- class: "g-history-entry",
1639
- tabindex: "-1"
1640
- }, [
1641
- P(c.$slots, "default", { entry: m }, void 0, !0)
1642
- ]))), 128))
1643
- ], 512)
1644
- ], 40, Ql)
1645
- ]));
1646
- }
1647
- }), Ms = /* @__PURE__ */ z(Jl, [["__scopeId", "data-v-dde35ac8"]]), ea = { class: "g-three-way-toggle-wrapper" }, ta = { class: "g-three-way-toggle-control" }, la = ["id"], aa = ["aria-labelledby", "aria-describedby", "disabled", "aria-invalid", "aria-errormessage"], oa = { key: 0 }, sa = { key: 1 }, na = { key: 2 }, ra = ["for"], ia = ["id", "name", "checked", "disabled"], ua = ["for"], da = ["id", "name", "checked", "disabled"], ca = ["for"], va = ["id", "name", "checked", "disabled"], fa = ["id"], ba = {}, ga = /* @__PURE__ */ A({
1648
- ...ba,
1649
- __name: "GThreeWayToggle",
1650
- props: /* @__PURE__ */ H({
1651
- label: {},
1652
- describedby: {},
1653
- error: {},
1654
- disabled: { type: Boolean }
1655
- }, {
1656
- modelValue: { type: [Boolean, null], default: () => null },
1657
- modelModifiers: {}
1658
- }),
1659
- emits: /* @__PURE__ */ H(["change"], ["update:modelValue"]),
1660
- setup(e, { emit: l }) {
1661
- const t = e, a = j(e, "modelValue"), o = l;
1662
- function s(f) {
1663
- const p = a.value;
1664
- a.value = f, f !== p && o("change", {
1665
- was: p,
1666
- to: f
1667
- });
1668
- }
1669
- function r(f) {
1670
- t.disabled || (a.value === f ? s(null) : s(f));
1671
- }
1672
- function d(f) {
1673
- t.disabled || a.value === f && s(null);
1674
- }
1675
- const i = Y(), c = x(() => `g-three-way-toggle-${i}`), g = Y(), m = Y(), h = Y(), L = x(() => a.value === !1 ? "g-left" : a.value === !0 ? "g-right" : "g-center");
1676
- function S(f) {
1677
- t.disabled || (f.key === "n" || f.key === "N" ? (s(!1), f.preventDefault()) : (f.key === "y" || f.key === "Y") && (s(!0), f.preventDefault()));
1678
- }
1679
- return (f, p) => (u(), v("div", ea, [
1680
- n("div", ta, [
1681
- n("span", {
1682
- class: "g-label",
1683
- id: b(i)
1684
- }, [
1685
- P(f.$slots, "label", {}, () => [
1686
- N(C(e.label), 1)
1687
- ], !0)
1688
- ], 8, la),
1689
- n("fieldset", {
1690
- class: O(["g-three-way-toggle", { "g-has-error": e.error }]),
1691
- role: "radiogroup",
1692
- "aria-labelledby": b(i),
1693
- "aria-describedby": e.describedby,
1694
- disabled: e.disabled,
1695
- "aria-invalid": e.error ? "true" : void 0,
1696
- "aria-errormessage": e.error ? b(i) + "-error" : void 0
1697
- }, [
1698
- n("div", {
1699
- class: O(["g-toggle-track", [L.value, { "g-disabled": e.disabled }]])
1700
- }, [
1701
- n("span", {
1702
- class: O(["g-toggle-thumb", L.value]),
1703
- "aria-hidden": "true"
1704
- }, [
1705
- a.value === !1 ? (u(), v("span", oa, "NO")) : a.value === !0 ? (u(), v("span", sa, "YES")) : (u(), v("span", na))
1706
- ], 2),
1707
- n("label", {
1708
- for: b(g),
1709
- class: "g-toggle-option g-left",
1710
- onClick: p[1] || (p[1] = (y) => d(!1)),
1711
- onKeydown: S
1712
- }, [
1713
- n("input", {
1714
- type: "radio",
1715
- id: b(g),
1716
- name: c.value,
1717
- checked: a.value === !1,
1718
- value: "false",
1719
- disabled: e.disabled,
1720
- onChange: p[0] || (p[0] = (y) => r(!1))
1721
- }, null, 40, ia),
1722
- p[5] || (p[5] = n("span", { class: "ilw-sr-only" }, "No", -1))
1723
- ], 40, ra),
1724
- n("label", {
1725
- for: b(m),
1726
- class: "g-toggle-option g-center",
1727
- onKeydown: S
1728
- }, [
1729
- n("input", {
1730
- type: "radio",
1731
- id: b(m),
1732
- name: c.value,
1733
- checked: a.value === null,
1734
- disabled: e.disabled,
1735
- onChange: p[2] || (p[2] = (y) => r(null))
1736
- }, null, 40, da),
1737
- p[6] || (p[6] = n("span", { class: "ilw-sr-only" }, "Unset", -1))
1738
- ], 40, ua),
1739
- n("label", {
1740
- for: b(h),
1741
- class: "g-toggle-option g-right",
1742
- onClick: p[4] || (p[4] = (y) => d(!0)),
1743
- onKeydown: S
1744
- }, [
1745
- n("input", {
1746
- type: "radio",
1747
- id: b(h),
1748
- name: c.value,
1749
- value: "true",
1750
- checked: a.value === !0,
1751
- disabled: e.disabled,
1752
- onChange: p[3] || (p[3] = (y) => r(!0))
1753
- }, null, 40, va),
1754
- p[7] || (p[7] = n("span", { class: "ilw-sr-only" }, "Yes", -1))
1755
- ], 40, ca)
1756
- ], 2)
1757
- ], 10, aa)
1758
- ]),
1759
- e.error ? (u(), v("div", {
1760
- key: 0,
1761
- id: `${b(i)}-error`,
1762
- class: "g-form-error",
1763
- role: "alert",
1764
- "aria-atomic": "true"
1765
- }, C(e.error), 9, fa)) : M("", !0)
1766
- ]));
1767
- }
1768
- }), Es = /* @__PURE__ */ z(ga, [["__scopeId", "data-v-b5b2babc"]]), ma = {
1769
- ref: "tableBodyRef",
1770
- class: "efficient-table-body"
1771
- }, pa = ["aria-rowindex"], ha = {
1772
- key: 0,
1773
- class: "table-group-checkbox"
1774
- }, ya = ["colspan"], ka = ["aria-rowindex", "onMousedown", "onClick"], _a = ["checked", "onClick", "aria-label", "name"], wa = ["id"], $a = {
1775
- key: 0,
1776
- class: "editable-cell"
1777
- }, Ca = {
1778
- key: 0,
1779
- class: "cell-prefix"
1780
- }, xa = ["value", "onChange", "aria-labelledby", "aria-invalid", "name"], La = ["value"], Sa = ["value", "onInput", "aria-labelledby", "aria-invalid", "aria-errormessage", "name"], Ia = {
1781
- key: 3,
1782
- class: "cell-suffix"
1783
- }, Ma = ["id"], Ea = {}, Ba = /* @__PURE__ */ A({
1784
- ...Ea,
1785
- __name: "GTableBody",
1786
- props: {
1787
- data: {},
1788
- groupBy: {},
1789
- columns: {},
1790
- groupRender: { type: Function },
1791
- rowClickable: { type: Boolean },
1792
- rowClass: { type: Function },
1793
- startIndex: {},
1794
- bulkSelectionEnabled: { type: Boolean },
1795
- selectedRows: {},
1796
- tableId: {},
1797
- changeTracker: {}
1798
- },
1799
- emits: ["row-click", "toggle-row", "cell-change"],
1800
- setup(e, { emit: l }) {
1801
- const t = e, a = l;
1802
- function o(f, p) {
1803
- t.bulkSelectionEnabled && f.shiftKey && !f.target.closest("a,button,[tabindex],input") && f.preventDefault();
1804
- }
1805
- function s(f, p) {
1806
- if (!t.rowClickable && !t.bulkSelectionEnabled || f.target.closest("a,button,[tabindex],input"))
1807
- return;
1808
- const y = f.target.closest(
1809
- "tr"
1810
- );
1811
- if (y) {
1812
- if (t.bulkSelectionEnabled)
1813
- y.querySelector(
1814
- "input[type=checkbox]"
1815
- ) && d(p, f.shiftKey);
1816
- else if (t.rowClickable) {
1817
- const _ = y.querySelector("a[href]")?.getAttribute("href");
1818
- _ && a("row-click", _);
1819
- }
1820
- }
1821
- }
1822
- function r(f) {
1823
- return t.selectedRows?.includes(f) ?? !1;
1824
- }
1825
- function d(f, p = !1) {
1826
- a("toggle-row", f, p);
1827
- }
1828
- function i(f, p, y) {
1829
- const _ = f.target.value;
1830
- a("cell-change", { row: p, column: y, value: _ });
1831
- }
1832
- function c(f, p) {
1833
- const y = `${t.tableId}-th-${String(p.key)}`;
1834
- return p.editable?.labelKey ? `${`${t.tableId}-td-${f.key}-${p.editable.labelKey}`} ${y} ` : y;
1835
- }
1836
- const g = x(
1837
- () => {
1838
- for (const f of t.columns)
1839
- if (f.editable?.labelKey)
1840
- return f.editable.labelKey;
1841
- }
1842
- );
1843
- function m(f) {
1844
- return f.key === g.value;
1845
- }
1846
- function h(f, p) {
1847
- return t.changeTracker ? t.changeTracker.hasChange(f.key, p.key) : !1;
1848
- }
1849
- function L(f, p) {
1850
- return t.changeTracker ? t.changeTracker.hasError(f.key, p.key) : !1;
1851
- }
1852
- function S(f, p) {
1853
- if (t.changeTracker)
1854
- return t.changeTracker.getError(f.key, p.key);
1855
- }
1856
- return (f, p) => (u(), v("tbody", ma, [
1857
- (u(!0), v(F, null, Z(e.data, (y, T) => (u(), v(F, {
1858
- key: y.key
1859
- }, [
1860
- e.groupBy && (T === 0 || y[e.groupBy] !== e.data[T - 1][e.groupBy]) ? (u(), v("tr", {
1861
- key: 0,
1862
- "aria-rowindex": e.startIndex + T + 2
1863
- }, [
1864
- e.bulkSelectionEnabled ? (u(), v("td", ha)) : M("", !0),
1865
- n("td", {
1866
- colspan: e.columns.length,
1867
- class: "table-group-row"
1868
- }, [
1869
- e.groupRender ? (u(), q(ve(e.groupRender(y[e.groupBy], y)), { key: 0 })) : (u(), v(F, { key: 1 }, [
1870
- N(C(y[e.groupBy]), 1)
1871
- ], 64))
1872
- ], 8, ya)
1873
- ], 8, pa)) : M("", !0),
1874
- n("tr", {
1875
- class: O([
1876
- "efficient-table-row",
1877
- {
1878
- "row-striped": T % 2 === 1,
1879
- "row-clickable": e.rowClickable || e.bulkSelectionEnabled
1880
- },
1881
- e.rowClass ? e.rowClass(y) : void 0
1882
- ]),
1883
- "aria-rowindex": e.startIndex + T + 2,
1884
- onMousedown: (_) => o(_, y.key),
1885
- onClick: (_) => s(_, y.key)
1886
- }, [
1887
- e.bulkSelectionEnabled ? (u(), v("td", {
1888
- key: 0,
1889
- class: "td-checkbox",
1890
- onClick: p[0] || (p[0] = ue(() => {
1891
- }, ["stop"]))
1892
- }, [
1893
- n("input", {
1894
- type: "checkbox",
1895
- checked: r(y.key),
1896
- onClick: (_) => d(y.key, _.shiftKey),
1897
- "aria-label": `Select row ${y.key}`,
1898
- name: `row-${y.key}-checkbox`,
1899
- class: "g-bulk-select-checkbox"
1900
- }, null, 8, _a)
1901
- ])) : M("", !0),
1902
- (u(!0), v(F, null, Z(e.columns, (_) => (u(), v("td", {
1903
- key: _.key,
1904
- id: m(_) ? `${e.tableId}-td-${y.key}-${String(_.key)}` : void 0,
1905
- class: O([
1906
- _.editable ? "editable-td" : "",
1907
- h(y, _) ? "g-cell-changed" : "",
1908
- L(y, _) ? "g-cell-error" : "",
1909
- typeof _.tdClass == "function" ? _.tdClass(y) : _.tdClass
1910
- ])
1911
- }, [
1912
- _.editable ? (u(), v("div", $a, [
1913
- _.editable.prefix ? (u(), v("span", Ca, C(_.editable.prefix), 1)) : M("", !0),
1914
- _.editable.type === "select" ? (u(), v("select", {
1915
- key: 1,
1916
- value: y[_.key],
1917
- onChange: (I) => i(I, y, _),
1918
- "aria-labelledby": c(y, _),
1919
- "aria-invalid": L(y, _),
1920
- name: `row-${y.key}-${String(_.key)}-select`,
1921
- class: "editable-input editable-select"
1922
- }, [
1923
- (u(!0), v(F, null, Z(_.editable.options, (I) => (u(), v("option", {
1924
- key: I.value,
1925
- value: I.value
1926
- }, C(I.label), 9, La))), 128))
1927
- ], 40, xa)) : (u(), v("input", ae({
1928
- key: 2,
1929
- value: y[_.key]
1930
- }, { ref_for: !0 }, _.editable.inputAttributes, {
1931
- onInput: (I) => i(I, y, _),
1932
- "aria-labelledby": c(y, _),
1933
- "aria-invalid": L(y, _),
1934
- "aria-errormessage": L(y, _) ? `${e.tableId}-error-${y.key}-${String(_.key)}` : void 0,
1935
- name: `row-${y.key}-${String(_.key)}-input`,
1936
- class: "editable-input",
1937
- style: {
1938
- paddingLeft: _.editable.prefix ? "1.5rem" : void 0,
1939
- paddingRight: _.editable.suffix ? "2rem" : void 0
1940
- }
1941
- }), null, 16, Sa)),
1942
- _.editable.suffix ? (u(), v("span", Ia, C(_.editable.suffix), 1)) : M("", !0)
1943
- ])) : _.display ? (u(), q(ve(_.display(y)), { key: 1 })) : (u(), v(F, { key: 2 }, [
1944
- N(C(y[_.key]), 1)
1945
- ], 64)),
1946
- L(y, _) ? (u(), v("div", {
1947
- key: 3,
1948
- role: "alert",
1949
- class: "g-cell-error-message",
1950
- id: `${e.tableId}-error-${y.key}-${String(_.key)}`
1951
- }, C(S(y, _)), 9, Ma)) : M("", !0)
1952
- ], 10, wa))), 128))
1953
- ], 42, ka)
1954
- ], 64))), 128))
1955
- ], 512));
1956
- }
1957
- });
1958
- function Ke(e) {
1959
- if (!(Array.isArray(e) && e.length === 0) && !(e === null || e === !1 || e === ""))
1960
- return e;
1961
- }
1962
- function Bs(e) {
1963
- return Object.fromEntries(
1964
- Object.entries(e).filter(([l, t]) => t && (!Array.isArray(t) || t.length > 0))
1965
- );
1966
- }
1967
- function Vs(e) {
1968
- if (e != null)
1969
- return Array.isArray(e) ? e.filter(
1970
- (l) => l != null
1971
- ) : [e];
1972
- }
1973
- function As(e) {
1974
- let l = {};
1975
- for (let [t, a] of Object.entries(We(e)))
1976
- Array.isArray(a) ? a.length > 0 && (l[t] = a) : a === !0 ? l[t] = "true" : l[t] = a || void 0;
1977
- return l;
1978
- }
1979
- function Va(e) {
1980
- const l = {};
1981
- return Object.keys(e).forEach((t) => {
1982
- const a = e[t];
1983
- a != null && a !== "" && a !== !1 && (Array.isArray(a) ? a.length > 0 && (l[t] = a.map((o) => String(o))) : l[t] = String(a));
1984
- }), l;
1985
- }
1986
- function Aa(e, l = {}) {
1987
- const t = at(
1988
- Object.fromEntries(
1989
- Object.entries(e).map(([d, i]) => [d, i])
1990
- )
1991
- ), a = l.syncWith;
1992
- if (a) {
1993
- if (a.value) {
1994
- const d = Se(a);
1995
- Object.keys(e).forEach((i) => {
1996
- if (d[i] !== void 0) {
1997
- const c = d[i];
1998
- typeof c == "string" && (c.includes(",") ? t[i] = c.split(",") : t[i] = c);
1999
- }
2000
- });
2001
- }
2002
- Q(
2003
- t,
2004
- (d) => {
2005
- a.value = Va(d);
2006
- },
2007
- { deep: !0 }
2008
- );
2009
- }
2010
- const o = x(() => {
2011
- for (const d of Object.keys(e))
2012
- if (Ke(t[d]))
2013
- return !0;
2014
- return !1;
2015
- }), s = () => {
2016
- Object.keys(t).forEach((d) => {
2017
- t[d] = void 0;
2018
- });
2019
- }, r = x(() => {
2020
- const d = {};
2021
- for (const i of Object.keys(e))
2022
- d[i] = !!Ke(t[i]);
2023
- return d;
2024
- });
2025
- return {
2026
- filters: t,
2027
- isFiltered: o,
2028
- clearFilters: s,
2029
- filteredColumns: r
2030
- };
2031
- }
2032
- const Ta = { class: "g-table-outer-wrap" }, za = {
2033
- key: 0,
2034
- class: "g-table-controls"
2035
- }, Oa = { class: "g-clear-filters-wrap" }, Ga = {
2036
- key: 0,
2037
- class: "pagination"
2038
- }, Da = { class: "g-result-count" }, Fa = ["aria-label", "aria-rowcount"], Pa = { class: "g-table-head" }, Ra = { "aria-rowindex": "1" }, Ha = {
2039
- key: 0,
2040
- scope: "col",
2041
- class: "g-th g-th-checkbox"
2042
- }, Ka = ["checked", "indeterminate", "aria-label"], Ua = ["id", "aria-sort"], ja = { class: "th-inner" }, Na = ["onClick"], Wa = {
2043
- key: 0,
2044
- class: "sort-indicator"
2045
- }, qa = ["aria-label"], Za = {
2046
- key: 1,
2047
- class: "g-column-head"
2048
- }, Ya = ["onClick", "aria-label"], Qa = { key: 1 }, Xa = { class: "g-filter-toggle" }, Ja = ["onUpdate:modelValue", "id", "aria-describedby"], eo = ["for"], to = ["id"], lo = {
2049
- key: 2,
2050
- class: "g-multi-select"
2051
- }, ao = ["onUpdate:modelValue", "id", "value"], oo = ["for"], so = {
2052
- key: 1,
2053
- class: "g-bulk-actions-toolbar"
2054
- }, no = { class: "g-selected-count" }, ro = { class: "g-bulk-actions" }, io = {}, uo = /* @__PURE__ */ A({
2055
- ...io,
2056
- __name: "GTable",
2057
- props: /* @__PURE__ */ H({
2058
- label: {},
2059
- data: {},
2060
- columns: {},
2061
- resultCount: {},
2062
- groupBy: {},
2063
- groupRender: {},
2064
- filtering: {},
2065
- rowClickable: { type: Boolean },
2066
- rowClass: {},
2067
- startIndex: {},
2068
- bulkSelectionEnabled: { type: Boolean, default: !1 },
2069
- bulkActions: { default: () => [] },
2070
- changeTracker: {},
2071
- showPagination: { type: Boolean, default: !1 }
2072
- }, {
2073
- sortField: {},
2074
- sortFieldModifiers: {},
2075
- sortOrder: {},
2076
- sortOrderModifiers: {},
2077
- filter: {
2078
- default: () => ({})
2079
- },
2080
- filterModifiers: {},
2081
- selectedRows: {
2082
- default: () => []
2083
- },
2084
- selectedRowsModifiers: {}
2085
- }),
2086
- emits: /* @__PURE__ */ H(["row-click", "bulk-action", "cell-change"], ["update:sortField", "update:sortOrder", "update:filter", "update:selectedRows"]),
2087
- setup(e, { emit: l }) {
2088
- const t = j(e, "sortField"), a = j(e, "sortOrder"), o = j(e, "filter"), s = j(e, "selectedRows"), r = e, d = l;
2089
- function i($) {
2090
- $.sortable && (t.value === $.key ? a.value === 1 ? a.value = -1 : a.value === -1 && (t.value = void 0, a.value = 1) : (t.value = $.key, a.value = 1));
2091
- }
2092
- let c = r.filtering;
2093
- c || (c = Aa({}));
2094
- const { filters: g, filteredColumns: m, isFiltered: h, clearFilters: L } = c, S = x(() => r.data.map(($) => $.key)), f = x(() => s.value.filter(($) => S.value.includes($))), p = x(() => !r.bulkSelectionEnabled || r.data.length === 0 ? !1 : f.value.length === S.value.length), y = x(() => !r.bulkSelectionEnabled || r.data.length === 0 ? !1 : f.value.length > 0 && f.value.length < S.value.length), T = E(null);
2095
- function _() {
2096
- if (p.value)
2097
- s.value = s.value.filter(
2098
- ($) => !S.value.includes($)
2099
- );
2100
- else {
2101
- const $ = new Set(s.value);
2102
- S.value.forEach((V) => $.add(V)), s.value = Array.from($);
2103
- }
2104
- }
2105
- function I($, V = !1) {
2106
- if (V && T.value) {
2107
- const k = S.value.indexOf(T.value), D = S.value.indexOf($);
2108
- if (k !== -1 && D !== -1) {
2109
- const ne = Math.min(k, D), ge = Math.max(k, D), me = S.value.slice(ne, ge + 1), pe = new Set(s.value);
2110
- me.forEach((he) => pe.add(he)), s.value = Array.from(pe);
2111
- }
2112
- } else
2113
- s.value.includes($) ? s.value = s.value.filter(
2114
- (k) => k !== $
2115
- ) : s.value = [...s.value, $];
2116
- T.value = $;
2117
- }
2118
- function K($) {
2119
- d("row-click", $);
2120
- }
2121
- function G($) {
2122
- d("bulk-action", $, s.value);
2123
- }
2124
- function J($) {
2125
- let V = $.value;
2126
- const k = $.column.key, D = We($.row[k]);
2127
- $.column.editable?.inputAttributes?.type === "number" && (V = $.value === "" ? null : Number($.value)), $.row[k] = V;
2128
- const ne = {
2129
- row: $.row,
2130
- column: $.column,
2131
- value: V,
2132
- previousValue: D
2133
- };
2134
- d("cell-change", ne);
2135
- }
2136
- const R = Y(), te = Ie(), ee = x(() => r.showPagination ? !0 : !!te.pagination), oe = x(() => !!(h.value || ee.value));
2137
- return re(() => {
2138
- r.rowClickable && r.bulkSelectionEnabled && console.warn(
2139
- "GTable: rowClickable and bulkSelectionEnabled cannot be used together. rowClickable will be ignored."
2140
- );
2141
- for (const $ of r.columns)
2142
- if ($.editable && $.display && console.warn(
2143
- `GTable: Column "${String($.key)}" has both 'editable' and 'display' configured. 'display' will be ignored.`
2144
- ), $.filter && $.filter.type === "multi-select" && !Array.isArray(o.value[$.key])) {
2145
- let V = o.value[$.key];
2146
- o.value[$.key] = V ? [V] : [];
2147
- }
2148
- }), Q(
2149
- () => r.columns,
2150
- ($) => {
2151
- for (const V of $)
2152
- if (V.filter && V.filter.type === "multi-select" && !Array.isArray(o.value[V.key])) {
2153
- let k = o.value[V.key];
2154
- o.value[V.key] = k ? [k] : [];
2155
- }
2156
- },
2157
- { immediate: !0 }
2158
- ), ($, V) => (u(), v("div", Ta, [
2159
- oe.value ? (u(), v("div", za, [
2160
- n("div", Oa, [
2161
- b(h) ? (u(), q(se, {
2162
- key: 0,
2163
- outlined: "",
2164
- size: "small",
2165
- class: "clear-filters",
2166
- onClick: b(L)
2167
- }, {
2168
- default: U(() => [...V[0] || (V[0] = [
2169
- n("svg", {
2170
- xmlns: "http://www.w3.org/2000/svg",
2171
- viewBox: "0 0 51.26 51.26",
2172
- height: "1em",
2173
- "aria-hidden": "true"
2174
- }, [
2175
- n("path", {
2176
- fill: "currentColor",
2177
- d: "m37.84 32.94-7.63-7.63 7.63-7.63a3.24 3.24 0 0 0-4.58-4.58l-7.63 7.63L18 13.1a3.24 3.24 0 0 0-4.58 4.58L21 25.31l-7.62 7.63A3.24 3.24 0 1 0 18 37.52l7.63-7.63 7.63 7.63a3.24 3.24 0 0 0 4.58-4.58Z"
2178
- })
2179
- ], -1),
2180
- n("span", { class: "g-clear-filters-text" }, " Clear Filters ", -1)
2181
- ])]),
2182
- _: 1
2183
- }, 8, ["onClick"])) : M("", !0)
2184
- ]),
2185
- ee.value ? (u(), v("div", Ga, [
2186
- P($.$slots, "pagination", {}, void 0, !0)
2187
- ])) : M("", !0),
2188
- n("span", Da, C(r.resultCount || e.data.length) + " results", 1)
2189
- ])) : M("", !0),
2190
- n("table", {
2191
- class: "g-table",
2192
- ref: "tableRef",
2193
- "aria-label": e.label,
2194
- "aria-rowcount": r.resultCount || e.data.length
2195
- }, [
2196
- n("thead", Pa, [
2197
- n("tr", Ra, [
2198
- e.bulkSelectionEnabled ? (u(), v("th", Ha, [
2199
- n("input", {
2200
- type: "checkbox",
2201
- checked: p.value,
2202
- indeterminate: y.value,
2203
- onChange: _,
2204
- "aria-label": p.value ? "Deselect all rows" : "Select all rows",
2205
- class: "g-bulk-select-checkbox"
2206
- }, null, 40, Ka)
2207
- ])) : M("", !0),
2208
- (u(!0), v(F, null, Z(e.columns, (k) => (u(), v("th", {
2209
- key: k.key,
2210
- id: `${b(R)}-th-${String(k.key)}`,
2211
- "aria-sort": t.value === k.key ? a.value === 1 ? "ascending" : "descending" : "none",
2212
- class: O([
2213
- "g-th",
2214
- { sorted: t.value === k.key },
2215
- { filtered: b(m)[k.key] }
2216
- ]),
2217
- scope: "col"
2218
- }, [
2219
- n("div", ja, [
2220
- k.sortable ? (u(), v("button", {
2221
- key: 0,
2222
- type: "button",
2223
- class: "g-column-head",
2224
- onClick: (D) => i(k)
2225
- }, [
2226
- N(C(k.label) + " ", 1),
2227
- t.value === k.key ? (u(), v("span", Wa, [
2228
- (u(), v("svg", {
2229
- xmlns: "http://www.w3.org/2000/svg",
2230
- viewBox: "0 0 640 640",
2231
- height: "1.5em",
2232
- role: "img",
2233
- "aria-label": a.value === 1 ? "Sorted ascending" : "Sorted descending",
2234
- style: ce({
2235
- transform: `rotate(${a.value === 1 ? 0 : 180}deg)`
2236
- })
2237
- }, [...V[1] || (V[1] = [
2238
- n("path", {
2239
- fill: "currentColor",
2240
- d: "M300.3 199.2C312.9 188.9 331.4 189.7 343.1 201.4L471.1 329.4C480.3 338.6 483 352.3 478 364.3C473 376.3 461.4 384 448.5 384L192.5 384C179.6 384 167.9 376.2 162.9 364.2C157.9 352.2 160.7 338.5 169.9 329.4L297.9 201.4L300.3 199.2z"
2241
- }, null, -1)
2242
- ])], 12, qa))
2243
- ])) : M("", !0)
2244
- ], 8, Na)) : (u(), v("span", Za, C(k.label), 1)),
2245
- k.filter ? (u(), q(Te, { key: 2 }, {
2246
- trigger: U(({ toggle: D }) => [
2247
- n("button", {
2248
- onClick: ue(D, ["stop"]),
2249
- "aria-label": b(m)[k.key] ? "Column Filtered" : "Filter Column",
2250
- class: O(["g-filter-btn", {
2251
- "g-active": b(m)[k.key]
2252
- }]),
2253
- type: "button"
2254
- }, [...V[2] || (V[2] = [
2255
- n("svg", {
2256
- xmlns: "http://www.w3.org/2000/svg",
2257
- viewBox: "0 0 640 640",
2258
- height: "1.5em",
2259
- "aria-hidden": "true"
2260
- }, [
2261
- n("path", {
2262
- fill: "currentColor",
2263
- d: "M96 128C83.1 128 71.4 135.8 66.4 147.8C61.4 159.8 64.2 173.5 73.4 182.6L256 365.3L256 480C256 488.5 259.4 496.6 265.4 502.6L329.4 566.6C338.6 575.8 352.3 578.5 364.3 573.5C376.3 568.5 384 556.9 384 544L384 365.3L566.6 182.7C575.8 173.5 578.5 159.8 573.5 147.8C568.5 135.8 556.9 128 544 128L96 128z"
2264
- })
2265
- ], -1)
2266
- ])], 10, Ya)
2267
- ]),
2268
- default: U(() => [
2269
- k.filter.type === "select" ? (u(), q(Xe, {
2270
- key: 0,
2271
- modelValue: o.value[k.key],
2272
- "onUpdate:modelValue": (D) => o.value[k.key] = D,
2273
- options: k.filter.options,
2274
- class: "g-filter-select",
2275
- label: "Filter select",
2276
- searchable: "",
2277
- "clear-button": ""
2278
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : k.filter.type === "toggle" ? (u(), v("div", Qa, [
2279
- n("div", Xa, [
2280
- ke(n("input", {
2281
- type: "checkbox",
2282
- "onUpdate:modelValue": (D) => o.value[k.key] = D,
2283
- id: `${b(R)}-filter-${String(k.key)}`,
2284
- "aria-describedby": k.filter.description ? `${b(R)}-filter-description-${String(k.key)}` : void 0
2285
- }, null, 8, Ja), [
2286
- [Fe, o.value[k.key]]
2287
- ]),
2288
- n("label", {
2289
- for: `${b(R)}-filter-${String(k.key)}`
2290
- }, C(k.filter.label), 9, eo),
2291
- k.filter.description ? (u(), v("span", {
2292
- key: 0,
2293
- class: "g-filter-description",
2294
- id: `${b(R)}-filter-description-${String(k.key)}`
2295
- }, C(k.filter.description), 9, to)) : M("", !0)
2296
- ])
2297
- ])) : k.filter.type === "multi-select" ? (u(), v("fieldset", lo, [
2298
- V[4] || (V[4] = n("legend", { class: "g-multi-select-legend" }, " Include values ", -1)),
2299
- (u(!0), v(F, null, Z(k.filter.options, (D) => (u(), v("div", {
2300
- key: D.value
2301
- }, [
2302
- ke(n("input", {
2303
- type: "checkbox",
2304
- "onUpdate:modelValue": (ne) => o.value[k.key] = ne,
2305
- id: `filter-${String(k.key)}-${D.value}`,
2306
- value: D.value,
2307
- name: "filter-multiselect"
2308
- }, null, 8, ao), [
2309
- [Fe, o.value[k.key]]
2310
- ]),
2311
- n("label", {
2312
- for: `filter-${String(k.key)}-${D.value}`
2313
- }, C(D.label), 9, oo)
2314
- ]))), 128)),
2315
- o.value[k.key] && o.value[k.key].length ? (u(), q(se, {
2316
- key: 0,
2317
- class: "clear-multiselect-btn",
2318
- theme: "accent",
2319
- size: "small",
2320
- onClick: (D) => o.value[k.key] = []
2321
- }, {
2322
- default: U(() => [...V[3] || (V[3] = [
2323
- N(" Clear ", -1)
2324
- ])]),
2325
- _: 1
2326
- }, 8, ["onClick"])) : M("", !0)
2327
- ])) : M("", !0)
2328
- ]),
2329
- _: 2
2330
- }, 1024)) : M("", !0)
2331
- ])
2332
- ], 10, Ua))), 128))
2333
- ])
2334
- ]),
2335
- W(Ba, {
2336
- data: e.data,
2337
- columns: e.columns,
2338
- "group-by": e.groupBy,
2339
- "group-render": e.groupRender,
2340
- "row-clickable": e.rowClickable,
2341
- "row-class": e.rowClass,
2342
- "start-index": e.startIndex,
2343
- "bulk-selection-enabled": e.bulkSelectionEnabled,
2344
- "selected-rows": s.value,
2345
- "table-id": b(R),
2346
- "change-tracker": e.changeTracker,
2347
- onRowClick: K,
2348
- onToggleRow: I,
2349
- onCellChange: J
2350
- }, null, 8, ["data", "columns", "group-by", "group-render", "row-clickable", "row-class", "start-index", "bulk-selection-enabled", "selected-rows", "table-id", "change-tracker"])
2351
- ], 8, Fa),
2352
- e.bulkSelectionEnabled && s.value.length > 0 ? (u(), v("div", so, [
2353
- n("span", no, C(s.value.length) + " row" + C(s.value.length === 1 ? "" : "s") + " selected", 1),
2354
- n("ul", ro, [
2355
- (u(!0), v(F, null, Z(e.bulkActions, (k) => (u(), v("li", {
2356
- key: k.id
2357
- }, [
2358
- W(se, {
2359
- theme: k.theme || "accent",
2360
- onClick: (D) => G(k.id),
2361
- size: "small"
2362
- }, {
2363
- default: U(() => [
2364
- N(C(k.label) + " " + C(s.value.length) + " row" + C(s.value.length === 1 ? "" : "s"), 1)
2365
- ]),
2366
- _: 2
2367
- }, 1032, ["theme", "onClick"])
2368
- ]))), 128))
2369
- ])
2370
- ])) : M("", !0)
2371
- ]));
2372
- }
2373
- }), Ts = /* @__PURE__ */ z(uo, [["__scopeId", "data-v-8ca5e7b3"]]), co = {
2374
- class: "g-pagination",
2375
- "aria-label": "Pagination"
2376
- }, vo = ["disabled"], fo = ["disabled"], bo = { class: "page-range" }, go = ["disabled"], mo = ["disabled"], po = ["value"], ho = ["value"], yo = {}, ko = /* @__PURE__ */ A({
2377
- ...yo,
2378
- __name: "GTablePagination",
2379
- props: /* @__PURE__ */ H({
2380
- start: {},
2381
- pageSize: {},
2382
- total: {},
2383
- pageSizes: {}
2384
- }, {
2385
- start: {},
2386
- startModifiers: {},
2387
- pageSize: {},
2388
- pageSizeModifiers: {}
2389
- }),
2390
- emits: ["update:start", "update:pageSize"],
2391
- setup(e) {
2392
- const l = e, t = x(() => Math.max(1, Math.ceil(l.total / l.pageSize))), a = j(e, "start"), o = j(e, "pageSize"), s = x(() => a.value ?? l.start), r = x(() => o.value ?? l.pageSize), d = x(() => l.total === 0 ? 0 : s.value + 1), i = x(() => l.total === 0 ? 0 : Math.min(s.value + r.value, l.total)), c = x(() => Math.floor(s.value / r.value) + 1);
2393
- function g(h) {
2394
- h < 1 || h > t.value || (a.value = (h - 1) * r.value);
2395
- }
2396
- function m(h) {
2397
- o.value = parseInt(h.target.value, 10);
2398
- }
2399
- return (h, L) => (u(), v("nav", co, [
2400
- n("button", {
2401
- class: "first-page g-pagination-button",
2402
- disabled: c.value === 1,
2403
- onClick: L[0] || (L[0] = (S) => g(1))
2404
- }, [...L[4] || (L[4] = [
2405
- n("svg", {
2406
- role: "img",
2407
- "aria-label": "First Page",
2408
- height: "2em",
2409
- xmlns: "http://www.w3.org/2000/svg",
2410
- width: "2em",
2411
- viewBox: "0 0 24 24",
2412
- fill: "none",
2413
- stroke: "currentColor",
2414
- "stroke-width": "2",
2415
- "stroke-linecap": "round",
2416
- "stroke-linejoin": "round"
2417
- }, [
2418
- n("path", {
2419
- stroke: "none",
2420
- d: "M0 0h24v24H0z",
2421
- fill: "none"
2422
- }),
2423
- n("path", { d: "M11 7l-5 5l5 5" }),
2424
- n("path", { d: "M17 7l-5 5l5 5" })
2425
- ], -1)
2426
- ])], 8, vo),
2427
- n("button", {
2428
- class: "prev-page g-pagination-button",
2429
- disabled: c.value === 1,
2430
- onClick: L[1] || (L[1] = (S) => g(c.value - 1))
2431
- }, [...L[5] || (L[5] = [
2432
- n("svg", {
2433
- role: "img",
2434
- "aria-label": "Previous Page",
2435
- xmlns: "http://www.w3.org/2000/svg",
2436
- width: "2em",
2437
- height: "2em",
2438
- viewBox: "0 0 24 24",
2439
- fill: "none",
2440
- stroke: "currentColor",
2441
- "stroke-width": "2",
2442
- "stroke-linecap": "round",
2443
- "stroke-linejoin": "round"
2444
- }, [
2445
- n("path", {
2446
- stroke: "none",
2447
- d: "M0 0h24v24H0z",
2448
- fill: "none"
2449
- }),
2450
- n("path", { d: "M15 6l-6 6l6 6" })
2451
- ], -1)
2452
- ])], 8, fo),
2453
- n("span", bo, C(d.value) + " to " + C(i.value), 1),
2454
- n("button", {
2455
- class: "next-page g-pagination-button",
2456
- disabled: c.value === t.value,
2457
- onClick: L[2] || (L[2] = (S) => g(c.value + 1))
2458
- }, [...L[6] || (L[6] = [
2459
- n("svg", {
2460
- role: "img",
2461
- "aria-label": "Next Page",
2462
- xmlns: "http://www.w3.org/2000/svg",
2463
- width: "2em",
2464
- height: "2em",
2465
- viewBox: "0 0 24 24",
2466
- fill: "none",
2467
- stroke: "currentColor",
2468
- "stroke-width": "2",
2469
- "stroke-linecap": "round",
2470
- "stroke-linejoin": "round"
2471
- }, [
2472
- n("path", {
2473
- stroke: "none",
2474
- d: "M0 0h24v24H0z",
2475
- fill: "none"
2476
- }),
2477
- n("path", { d: "M9 6l6 6l-6 6" })
2478
- ], -1)
2479
- ])], 8, go),
2480
- n("button", {
2481
- class: "last-page g-pagination-button",
2482
- disabled: c.value === t.value,
2483
- onClick: L[3] || (L[3] = (S) => g(t.value))
2484
- }, [...L[7] || (L[7] = [
2485
- n("svg", {
2486
- role: "img",
2487
- "aria-label": "Last Page",
2488
- xmlns: "http://www.w3.org/2000/svg",
2489
- width: "2em",
2490
- height: "2em",
2491
- viewBox: "0 0 24 24",
2492
- fill: "none",
2493
- stroke: "currentColor",
2494
- "stroke-width": "2",
2495
- "stroke-linecap": "round",
2496
- "stroke-linejoin": "round"
2497
- }, [
2498
- n("path", {
2499
- stroke: "none",
2500
- d: "M0 0h24v24H0z",
2501
- fill: "none"
2502
- }),
2503
- n("path", { d: "M7 7l5 5l-5 5" }),
2504
- n("path", { d: "M13 7l5 5l-5 5" })
2505
- ], -1)
2506
- ])], 8, mo),
2507
- n("select", {
2508
- id: "page-size-select",
2509
- class: "page-size-select",
2510
- value: o.value,
2511
- onChange: m
2512
- }, [
2513
- (u(!0), v(F, null, Z(l.pageSizes || [10, 25, 50, 100], (S) => (u(), v("option", {
2514
- key: S,
2515
- value: S
2516
- }, C(S), 9, ho))), 128))
2517
- ], 40, po),
2518
- L[8] || (L[8] = n("label", {
2519
- class: "page-size-label",
2520
- for: "page-size-select"
2521
- }, "per page", -1))
2522
- ]));
2523
- }
2524
- }), zs = /* @__PURE__ */ z(ko, [["__scopeId", "data-v-d0b070eb"]]), _o = ["id"], wo = { class: "g-modal-inner" }, $o = { class: "g-modal-header" }, Co = ["id"], xo = ["id"], Lo = {}, So = /* @__PURE__ */ A({
2525
- ...Lo,
2526
- __name: "GModal",
2527
- props: {
2528
- label: {},
2529
- describedby: { default: void 0 },
2530
- hiddenLabel: { type: Boolean, default: !1 },
2531
- size: { default: "medium" },
2532
- classes: {}
2533
- },
2534
- emits: ["close"],
2535
- setup(e, { emit: l }) {
2536
- const t = e, a = l, o = fe("dialog"), s = E(!0), r = Y(), { pop: d, push: i, isTop: c, zIndex: g } = Ce(r, !0, !0), { deactivate: m, activate: h } = Ve(o, c);
2537
- function L() {
2538
- a("close");
2539
- }
2540
- Ae([o], c, s, L, d), re(() => {
2541
- i(), h();
2542
- }), je(() => {
2543
- d(), m();
2544
- });
2545
- const S = x(() => {
2546
- let f = [`g-modal--${t.size}`];
2547
- return t.classes && (f = f.concat(Array.isArray(t.classes) ? t.classes : [t.classes])), f;
2548
- });
2549
- return (f, p) => (u(), q(Me, { to: "#modal-root" }, [
2550
- W(we, {
2551
- name: "g-fade",
2552
- appear: ""
2553
- }, {
2554
- default: U(() => [
2555
- n("div", ae({
2556
- id: "modal-" + b(r),
2557
- class: ["g-modal", S.value],
2558
- role: "dialog",
2559
- "aria-modal": "true"
2560
- }, {
2561
- "aria-labelledby": e.hiddenLabel ? void 0 : "modal-label-" + b(r),
2562
- "aria-label": e.hiddenLabel ? e.label : void 0,
2563
- "aria-describedby": e.describedby ? e.describedby : void 0
2564
- }, {
2565
- ref_key: "dialog",
2566
- ref: o,
2567
- style: { zIndex: b(g) }
2568
- }), [
2569
- n("div", wo, [
2570
- n("div", $o, [
2571
- e.hiddenLabel ? M("", !0) : (u(), v("h2", {
2572
- key: 0,
2573
- id: "modal-label-" + b(r),
2574
- class: "g-modal-label",
2575
- tabindex: "-1"
2576
- }, C(e.label), 9, Co)),
2577
- n("button", {
2578
- class: "g-modal-close",
2579
- onClick: L,
2580
- "aria-label": "Close"
2581
- }, [...p[0] || (p[0] = [
2582
- n("svg", {
2583
- viewBox: "0 0 24 24",
2584
- width: "24",
2585
- height: "24",
2586
- "aria-hidden": "true"
2587
- }, [
2588
- n("path", {
2589
- fill: "currentColor",
2590
- d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
2591
- })
2592
- ], -1)
2593
- ])])
2594
- ]),
2595
- n("div", {
2596
- id: "modal-description-" + b(r),
2597
- class: "g-modal-content"
2598
- }, [
2599
- P(f.$slots, "default", {}, void 0, !0)
2600
- ], 8, xo)
2601
- ])
2602
- ], 16, _o)
2603
- ]),
2604
- _: 3
2605
- })
2606
- ]));
2607
- }
2608
- }), Os = /* @__PURE__ */ z(So, [["__scopeId", "data-v-56d8c6a1"]]), Io = ["id", "aria-expanded", "aria-label", "aria-controls"], Mo = {}, Eo = /* @__PURE__ */ A({
2609
- ...Mo,
2610
- __name: "GHamburgerMenu",
2611
- props: {
2612
- label: { default: "Main Navigation" }
2613
- },
2614
- emits: ["toggle"],
2615
- setup(e, { emit: l }) {
2616
- const t = be("sidebar"), a = l;
2617
- function o() {
2618
- a("toggle"), t?.toggle();
2619
- }
2620
- function s(d) {
2621
- d.key === "Escape" && t?.open?.value && (t.open.value = !1);
2622
- }
2623
- const r = Y();
2624
- return (d, i) => (u(), v("button", {
2625
- id: `${b(t)?.id ?? b(r)}-hamburger`,
2626
- class: O(["g-hamburger-button", {
2627
- "g-hamburger-button--open": b(t)?.open?.value,
2628
- "g-hamburger-button--collapsible": b(t)?.isCollapsible?.value
2629
- }]),
2630
- onClick: o,
2631
- onKeydown: s,
2632
- "aria-expanded": b(t)?.open?.value ? "true" : "false",
2633
- "aria-label": e.label,
2634
- "aria-controls": b(t) ? `${b(t).id}-sidebar` : void 0
2635
- }, [...i[0] || (i[0] = [
2636
- n("svg", {
2637
- xmlns: "http://www.w3.org/2000/svg",
2638
- viewBox: "0 0 51.26 51.26"
2639
- }, [
2640
- n("g", { fill: "currentColor" }, [
2641
- n("path", { d: "M11.6 16.52h28.06a3.24 3.24 0 1 0 0-6.48H11.6a3.24 3.24 0 0 0 0 6.48ZM39.66 22.07H11.6a3.24 3.24 0 0 0 0 6.48h28.06a3.24 3.24 0 1 0 0-6.48ZM39.66 34.1H11.6a3.24 3.24 0 0 0 0 6.48h28.06a3.24 3.24 0 1 0 0-6.48Z" })
2642
- ])
2643
- ], -1)
2644
- ])], 42, Io));
2645
- }
2646
- }), Gs = /* @__PURE__ */ z(Eo, [["__scopeId", "data-v-fccc9f00"]]), Bo = {}, Vo = /* @__PURE__ */ A({
2647
- ...Bo,
2648
- __name: "GDetailList",
2649
- props: {
2650
- variant: { default: "grid" }
2651
- },
2652
- setup(e) {
2653
- const l = e;
2654
- return (t, a) => (u(), v("dl", {
2655
- class: O(["g-detail-list", `g-detail-list--${l.variant}`])
2656
- }, [
2657
- P(t.$slots, "default", {}, void 0, !0)
2658
- ], 2));
2659
- }
2660
- }), Ds = /* @__PURE__ */ z(Vo, [["__scopeId", "data-v-b851df7b"]]), Ao = { class: "g-detail-list-item" }, To = { class: "g-detail-list-item__label" }, zo = { class: "g-detail-list-item__value" }, Fs = /* @__PURE__ */ A({
2661
- __name: "GDetailListItem",
2662
- props: {
2663
- label: {}
2664
- },
2665
- setup(e) {
2666
- return (l, t) => (u(), v("div", Ao, [
2667
- n("dt", To, [
2668
- P(l.$slots, "label", {}, () => [
2669
- N(C(e.label), 1)
2670
- ])
2671
- ]),
2672
- n("dd", zo, [
2673
- P(l.$slots, "default")
2674
- ])
2675
- ]));
2676
- }
2677
- }), Oo = {
2678
- key: 0,
2679
- class: "g-scroll-lock-overlay"
2680
- }, Go = {}, Ps = /* @__PURE__ */ A({
2681
- ...Go,
2682
- __name: "GOverlay",
2683
- setup(e) {
2684
- const { hasScrollLock: l } = It();
2685
- return (t, a) => (u(), q(we, { name: "g-fade" }, {
2686
- default: U(() => [
2687
- b(l) ? (u(), v("div", Oo)) : M("", !0)
2688
- ]),
2689
- _: 1
2690
- }));
2691
- }
2692
- }), Do = { class: "popover-content" }, Fo = { class: "year-dropdown" }, Po = { class: "month-selector" }, Ro = {}, Ho = /* @__PURE__ */ A({
2693
- ...Ro,
2694
- __name: "GTermSelectorControl",
2695
- props: /* @__PURE__ */ H({
2696
- termYears: { default: () => ["2026"] },
2697
- termNames: { default: () => ["Spring", "Summer", "Fall"] },
2698
- yearLabel: { default: "Select Year" },
2699
- periodLabel: { default: "Term" }
2700
- }, {
2701
- modelValue: {
2702
- default: () => ({ year: "2026", name: "Spring" })
2703
- },
2704
- modelModifiers: {}
2705
- }),
2706
- emits: ["update:modelValue"],
2707
- setup(e) {
2708
- const l = j(e, "modelValue");
2709
- return (t, a) => (u(), v("div", Do, [
2710
- n("div", Fo, [
2711
- W(Xe, {
2712
- modelValue: l.value.year,
2713
- "onUpdate:modelValue": a[0] || (a[0] = (o) => l.value.year = o),
2714
- options: e.termYears,
2715
- label: e.yearLabel
2716
- }, null, 8, ["modelValue", "options", "label"])
2717
- ]),
2718
- n("div", Po, [
2719
- W(Ut, {
2720
- modelValue: l.value.name,
2721
- "onUpdate:modelValue": a[1] || (a[1] = (o) => l.value.name = o),
2722
- options: e.termNames,
2723
- "allow-empty": !1,
2724
- label: e.periodLabel
2725
- }, null, 8, ["modelValue", "options", "label"])
2726
- ])
2727
- ]));
2728
- }
2729
- }), Ko = /* @__PURE__ */ z(Ho, [["__scopeId", "data-v-43c70980"]]), Uo = { class: "g-term-selector" }, jo = { class: "g-term-label" }, No = {
2730
- class: "popover-title",
2731
- tabindex: "-1"
2732
- }, Wo = {}, qo = /* @__PURE__ */ A({
2733
- ...Wo,
2734
- __name: "GTermSelector",
2735
- props: /* @__PURE__ */ H({
2736
- title: { default: "Period Selection" },
2737
- yearLabel: {},
2738
- periodLabel: {},
2739
- termYears: { default: () => ["2026"] },
2740
- termNames: { default: () => ["Spring", "Summer", "Fall"] }
2741
- }, {
2742
- modelValue: {
2743
- default: () => ({ year: "2026", name: "Spring" })
2744
- },
2745
- modelModifiers: {}
2746
- }),
2747
- emits: ["update:modelValue"],
2748
- setup(e) {
2749
- const l = j(e, "modelValue");
2750
- return (t, a) => (u(), v("div", Uo, [
2751
- W(Te, null, {
2752
- trigger: U(({ toggle: o }) => [
2753
- W(se, {
2754
- class: "g-term-selector-button",
2755
- theme: "none",
2756
- outlined: "",
2757
- onClick: o
2758
- }, {
2759
- default: U(() => [
2760
- a[0] || (a[0] = n("span", { class: "g-calendar-icon" }, [
2761
- n("svg", {
2762
- role: "none presentation",
2763
- xmlns: "http://www.w3.org/2000/svg",
2764
- viewBox: "0 0 640 640"
2765
- }, [
2766
- n("path", { d: "M224 64C206.3 64 192 78.3 192 96L192 128L160 128C124.7 128 96 156.7 96 192L96 240L544 240L544 192C544 156.7 515.3 128 480 128L448 128L448 96C448 78.3 433.7 64 416 64C398.3 64 384 78.3 384 96L384 128L256 128L256 96C256 78.3 241.7 64 224 64zM96 288L96 480C96 515.3 124.7 544 160 544L480 544C515.3 544 544 515.3 544 480L544 288L96 288z" })
2767
- ])
2768
- ], -1)),
2769
- n("span", jo, C(l.value?.name) + " " + C(l.value?.year), 1),
2770
- a[1] || (a[1] = n("span", { class: "g-caret" }, [
2771
- n("svg", {
2772
- role: "none presentation",
2773
- xmlns: "http://www.w3.org/2000/svg",
2774
- viewBox: "0 0 640 640"
2775
- }, [
2776
- n("path", { d: "M300.3 440.8C312.9 451 331.4 450.3 343.1 438.6L471.1 310.6C480.3 301.4 483 287.7 478 275.7C473 263.7 461.4 256 448.5 256L192.5 256C179.6 256 167.9 263.8 162.9 275.8C157.9 287.8 160.7 301.5 169.9 310.6L297.9 438.6L300.3 440.8z" })
2777
- ])
2778
- ], -1))
2779
- ]),
2780
- _: 1
2781
- }, 8, ["onClick"])
2782
- ]),
2783
- default: U(() => [
2784
- n("h2", No, C(e.title), 1),
2785
- W(Ko, ot(st(t.$props)), null, 16)
2786
- ]),
2787
- _: 1
2788
- })
2789
- ]));
2790
- }
2791
- }), Rs = /* @__PURE__ */ z(qo, [["__scopeId", "data-v-674777ba"]]), Zo = { class: "g-user-menu" }, Yo = ["aria-label", "aria-expanded", "onClick"], Qo = { class: "g-user-menu__popover" }, Xo = { class: "g-user-menu__list" }, Jo = {}, es = /* @__PURE__ */ A({
2792
- ...Jo,
2793
- __name: "GUserMenu",
2794
- props: {
2795
- initials: {},
2796
- email: {},
2797
- color: { default: "var(--g-surface-700)" },
2798
- label: { default: "User menu" }
2799
- },
2800
- setup(e) {
2801
- const t = `${Y()}-email`, a = E(!1), o = fe("emailHeading");
2802
- Ne()?.appContext?.components?.RouterLink;
2803
- const r = Ie();
2804
- return (d, i) => (u(), v("div", Zo, [
2805
- W(Te, {
2806
- modelValue: a.value,
2807
- "onUpdate:modelValue": i[0] || (i[0] = (c) => a.value = c),
2808
- minimal: ""
2809
- }, {
2810
- trigger: U(({ toggle: c }) => [
2811
- n("button", {
2812
- class: "g-user-menu__avatar",
2813
- style: ce({ backgroundColor: e.color }),
2814
- "aria-label": e.initials + " - " + e.label,
2815
- "aria-expanded": a.value,
2816
- "aria-haspopup": "menu",
2817
- onClick: c
2818
- }, C(e.initials), 13, Yo)
2819
- ]),
2820
- default: U(() => [
2821
- n("div", Qo, [
2822
- n("h2", {
2823
- id: t,
2824
- ref_key: "emailHeading",
2825
- ref: o,
2826
- class: "g-user-menu__email",
2827
- tabindex: "-1"
2828
- }, C(e.email), 513),
2829
- n("nav", {
2830
- class: "g-user-menu__nav",
2831
- "aria-labelledby": t
2832
- }, [
2833
- n("ul", Xo, [
2834
- (u(!0), v(F, null, Z(r.default(), (c, g) => (u(), v("li", { key: g }, [
2835
- (u(), q(ve(c)))
2836
- ]))), 128))
2837
- ])
2838
- ])
2839
- ])
2840
- ]),
2841
- _: 1
2842
- }, 8, ["modelValue"])
2843
- ]));
2844
- }
2845
- }), Hs = /* @__PURE__ */ z(es, [["__scopeId", "data-v-63bcc080"]]), ts = {}, ls = /* @__PURE__ */ A({
2846
- ...ts,
2847
- __name: "GCurrencyInput",
2848
- props: /* @__PURE__ */ H({
2849
- label: { default: void 0 },
2850
- placeholder: { default: "" },
2851
- disabled: { type: Boolean, default: !1 },
2852
- errors: { default: () => [] },
2853
- instructions: { default: "" },
2854
- name: { default: void 0 }
2855
- }, {
2856
- modelValue: { type: String },
2857
- modelModifiers: {}
2858
- }),
2859
- emits: ["update:modelValue"],
2860
- setup(e) {
2861
- const l = e, t = j(e, "modelValue");
2862
- return (a, o) => (u(), q(Be, ae({
2863
- modelValue: t.value,
2864
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
2865
- name: l.name,
2866
- label: l.label,
2867
- placeholder: l.placeholder,
2868
- disabled: l.disabled,
2869
- errors: l.errors,
2870
- instructions: l.instructions,
2871
- prefix: "$",
2872
- type: "number",
2873
- step: "0.01",
2874
- min: "0"
2875
- }, a.$attrs), null, 16, ["modelValue", "name", "label", "placeholder", "disabled", "errors", "instructions"]));
2876
- }
2877
- }), Ks = /* @__PURE__ */ z(ls, [["__scopeId", "data-v-5b5133d7"]]), as = {}, os = /* @__PURE__ */ A({
2878
- ...as,
2879
- __name: "GEmailInput",
2880
- props: /* @__PURE__ */ H({
2881
- label: { default: void 0 },
2882
- placeholder: { default: "" },
2883
- disabled: { type: Boolean, default: !1 },
2884
- errors: { default: () => [] },
2885
- instructions: { default: "" },
2886
- name: { default: void 0 }
2887
- }, {
2888
- modelValue: { type: String },
2889
- modelModifiers: {}
2890
- }),
2891
- emits: ["update:modelValue"],
2892
- setup(e) {
2893
- const l = j(e, "modelValue");
2894
- return (t, a) => (u(), q(Be, ae({
2895
- modelValue: l.value,
2896
- "onUpdate:modelValue": a[0] || (a[0] = (o) => l.value = o),
2897
- name: e.name,
2898
- label: e.label,
2899
- placeholder: e.placeholder,
2900
- disabled: e.disabled,
2901
- errors: e.errors,
2902
- instructions: e.instructions,
2903
- type: "email"
2904
- }, t.$attrs), null, 16, ["modelValue", "name", "label", "placeholder", "disabled", "errors", "instructions"]));
2905
- }
2906
- }), Us = /* @__PURE__ */ z(os, [["__scopeId", "data-v-6873e4b7"]]), ss = {}, ns = /* @__PURE__ */ A({
2907
- ...ss,
2908
- __name: "GDateInput",
2909
- props: /* @__PURE__ */ H({
2910
- label: { default: void 0 },
2911
- placeholder: { default: "" },
2912
- disabled: { type: Boolean, default: !1 },
2913
- errors: { default: () => [] },
2914
- instructions: { default: "" },
2915
- name: { default: void 0 }
2916
- }, {
2917
- modelValue: { type: String },
2918
- modelModifiers: {}
2919
- }),
2920
- emits: ["update:modelValue"],
2921
- setup(e) {
2922
- const l = e, t = j(e, "modelValue");
2923
- return (a, o) => (u(), q(Be, ae({
2924
- modelValue: t.value,
2925
- "onUpdate:modelValue": o[0] || (o[0] = (s) => t.value = s),
2926
- name: l.name,
2927
- label: l.label,
2928
- placeholder: l.placeholder,
2929
- disabled: l.disabled,
2930
- errors: l.errors,
2931
- instructions: l.instructions,
2932
- type: "date"
2933
- }, a.$attrs), null, 16, ["modelValue", "name", "label", "placeholder", "disabled", "errors", "instructions"]));
2934
- }
2935
- }), Ue = /* @__PURE__ */ z(ns, [["__scopeId", "data-v-ce786dcc"]]), rs = { class: "g-date-range-input" }, is = {
2936
- key: 0,
2937
- class: "g-date-range-input__label"
2938
- }, us = {
2939
- key: 1,
2940
- class: "g-date-range-input__instructions"
2941
- }, ds = { class: "g-date-range-input__fields" }, cs = {
2942
- key: 2,
2943
- class: "g-date-range-input__errors",
2944
- role: "alert"
2945
- }, vs = {}, fs = /* @__PURE__ */ A({
2946
- ...vs,
2947
- __name: "GDateRangeInput",
2948
- props: /* @__PURE__ */ H({
2949
- label: { default: void 0 },
2950
- startLabel: { default: "Start Date" },
2951
- endLabel: { default: "End Date" },
2952
- disabled: { type: Boolean, default: !1 },
2953
- errors: { default: () => [] },
2954
- instructions: { default: "" },
2955
- name: { default: void 0 }
2956
- }, {
2957
- modelValue: {
2958
- default: () => ({ start: null, end: null })
2959
- },
2960
- modelModifiers: {}
2961
- }),
2962
- emits: ["update:modelValue"],
2963
- setup(e) {
2964
- const l = e, t = j(e, "modelValue"), a = E(t.value.start || null), o = E(t.value.end || null), { displayErrors: s } = $e({
2965
- name: l.name,
2966
- value: t,
2967
- errors: _e(l, "errors")
2968
- });
2969
- return Q([a, o], () => {
2970
- t.value = {
2971
- start: a.value,
2972
- end: o.value
2973
- };
2974
- }), Q(
2975
- t,
2976
- (r) => {
2977
- r.start !== a.value && (a.value = r.start), r.end !== o.value && (o.value = r.end);
2978
- },
2979
- { deep: !0 }
2980
- ), (r, d) => (u(), v("div", rs, [
2981
- l.label ? (u(), v("div", is, C(l.label), 1)) : M("", !0),
2982
- l.instructions ? (u(), v("div", us, C(l.instructions), 1)) : M("", !0),
2983
- n("div", ds, [
2984
- W(Ue, {
2985
- modelValue: a.value,
2986
- "onUpdate:modelValue": d[0] || (d[0] = (i) => a.value = i),
2987
- label: l.startLabel,
2988
- disabled: l.disabled,
2989
- class: "g-date-range-input__field"
2990
- }, null, 8, ["modelValue", "label", "disabled"]),
2991
- W(Ue, {
2992
- modelValue: o.value,
2993
- "onUpdate:modelValue": d[1] || (d[1] = (i) => o.value = i),
2994
- label: l.endLabel,
2995
- disabled: l.disabled,
2996
- class: "g-date-range-input__field"
2997
- }, null, 8, ["modelValue", "label", "disabled"])
2998
- ]),
2999
- b(s).length > 0 ? (u(), v("div", cs, [
3000
- (u(!0), v(F, null, Z(b(s), (i, c) => (u(), v("div", {
3001
- key: c,
3002
- class: "g-date-range-input__error"
3003
- }, C(i), 1))), 128))
3004
- ])) : M("", !0)
3005
- ]));
3006
- }
3007
- }), js = /* @__PURE__ */ z(fs, [["__scopeId", "data-v-3d32594b"]]);
3008
- function bs() {
3009
- const e = nt({}), l = E(!1), t = x(() => {
3010
- const i = {};
3011
- return Object.entries(e).forEach(([c, g]) => {
3012
- g && g.value && (i[c] = g.value.value);
3013
- }), i;
3014
- }), a = x(() => {
3015
- const i = {};
3016
- return Object.entries(e).forEach(([c, g]) => {
3017
- const m = g.errors.value;
3018
- m && m.length > 0 && (i[c] = m);
3019
- }), i;
3020
- }), o = x(() => Object.keys(a.value).length > 0);
3021
- function s(i, c) {
3022
- e[i] = c;
3023
- }
3024
- function r(i) {
3025
- delete e[i];
3026
- }
3027
- async function d(i) {
3028
- if (!l.value) {
3029
- l.value = !0;
3030
- try {
3031
- await i(t.value);
3032
- } finally {
3033
- l.value = !1;
3034
- }
3035
- }
3036
- }
3037
- return {
3038
- fields: e,
3039
- values: t,
3040
- errors: a,
3041
- isSubmitting: l,
3042
- hasErrors: o,
3043
- registerField: s,
3044
- unregisterField: r,
3045
- submit: d
3046
- };
3047
- }
3048
- const gs = ["action", "method"], ms = {}, ps = /* @__PURE__ */ A({
3049
- ...ms,
3050
- __name: "GForm",
3051
- props: /* @__PURE__ */ H({
3052
- action: { default: void 0 },
3053
- method: { default: "post" }
3054
- }, {
3055
- modelValue: { default: () => ({}) },
3056
- modelModifiers: {}
3057
- }),
3058
- emits: /* @__PURE__ */ H(["submit"], ["update:modelValue"]),
3059
- setup(e, { emit: l }) {
3060
- const t = e, a = j(e, "modelValue"), o = l, s = be("form", null), r = s || bs();
3061
- s || rt("form", r), Q(
3062
- () => r.values.value,
3063
- (i) => {
3064
- a.value = { ...i };
3065
- },
3066
- { deep: !0 }
3067
- ), Q(
3068
- () => a.value,
3069
- (i) => {
3070
- i && Object.entries(i).forEach(([c, g]) => {
3071
- const m = r.fields[c];
3072
- m && m.value.value !== g && (m.value.value = g);
3073
- });
3074
- },
3075
- { deep: !0, immediate: !0 }
3076
- );
3077
- async function d(i) {
3078
- i.preventDefault(), await r.submit(async (c) => {
3079
- o("submit", c);
3080
- });
3081
- }
3082
- return (i, c) => (u(), v("form", {
3083
- onSubmit: d,
3084
- action: t.action,
3085
- method: t.method,
3086
- class: "g-form",
3087
- novalidate: ""
3088
- }, [
3089
- P(i.$slots, "default", {
3090
- isSubmitting: b(r).isSubmitting.value,
3091
- hasErrors: b(r).hasErrors.value,
3092
- values: b(r).values.value,
3093
- errors: b(r).errors.value
3094
- }, void 0, !0)
3095
- ], 40, gs));
3096
- }
3097
- }), Ns = /* @__PURE__ */ z(ps, [["__scopeId", "data-v-29e80182"]]), hs = {}, ys = /* @__PURE__ */ A({
3098
- ...hs,
3099
- __name: "GSubmitButton",
3100
- props: {
3101
- disabled: { type: Boolean, default: !1 },
3102
- loadingText: { default: "Submitting..." },
3103
- variant: { default: "primary" }
3104
- },
3105
- setup(e) {
3106
- const l = e, t = be("form", null), a = x(() => l.disabled || (t?.isSubmitting.value ?? !1)), o = x(() => t?.isSubmitting.value ?? !1);
3107
- return (s, r) => (u(), q(se, {
3108
- type: "submit",
3109
- disabled: a.value,
3110
- variant: l.variant,
3111
- class: "g-submit-button"
3112
- }, {
3113
- default: U(() => [
3114
- o.value ? (u(), v(F, { key: 0 }, [
3115
- N(C(l.loadingText), 1)
3116
- ], 64)) : P(s.$slots, "default", { key: 1 }, () => [
3117
- r[0] || (r[0] = N("Submit", -1))
3118
- ], !0)
3119
- ]),
3120
- _: 3
3121
- }, 8, ["disabled", "variant"]));
3122
- }
3123
- }), Ws = /* @__PURE__ */ z(ys, [["__scopeId", "data-v-231894ab"]]);
3124
- export {
3125
- Be as A,
3126
- Es as B,
3127
- Hs as C,
3128
- Vs as D,
3129
- Qe as E,
3130
- Ke as F,
3131
- $s as G,
3132
- As as H,
3133
- Bs as I,
3134
- Va as J,
3135
- Aa as K,
3136
- bs as L,
3137
- $e as M,
3138
- Ae as N,
3139
- Ve as O,
3140
- Ce as P,
3141
- It as Q,
3142
- Ul as V,
3143
- se as _,
3144
- xs as a,
3145
- Is as b,
3146
- Ks as c,
3147
- Ue as d,
3148
- js as e,
3149
- Ds as f,
3150
- Fs as g,
3151
- Us as h,
3152
- Ns as i,
3153
- Gs as j,
3154
- Ms as k,
3155
- Os as l,
3156
- Ps as m,
3157
- Te as n,
3158
- Qt as o,
3159
- Cs as p,
3160
- Xe as q,
3161
- Ut as r,
3162
- Ls as s,
3163
- Ss as t,
3164
- Ws as u,
3165
- Ts as v,
3166
- Ba as w,
3167
- zs as x,
3168
- Rs as y,
3169
- Ko as z
3170
- };
3171
- //# sourceMappingURL=main-BtQAK04Y.js.map