@illinois-grad/grad-vue 0.1.0 → 1.0.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.
- package/LICENSE +20 -20
- package/README.md +59 -7
- package/dist/components/GAlertDialog.vue.d.ts +11 -2
- package/dist/components/GAppHeader.vue.d.ts +30 -4
- package/dist/components/GButton.vue.d.ts +12 -0
- package/dist/components/GClipboard.vue.d.ts +13 -0
- package/dist/components/GDetailList.vue.d.ts +35 -0
- package/dist/components/GHamburgerMenu.vue.d.ts +15 -0
- package/dist/components/GHistoryScroller.vue.d.ts +30 -0
- package/dist/components/GModal.vue.d.ts +39 -0
- package/dist/components/GOverlay.vue.d.ts +3 -0
- package/dist/components/GPopover.vue.d.ts +18 -26
- package/dist/components/GProgress.vue.d.ts +13 -4
- package/dist/components/GSearch.vue.d.ts +20 -7
- package/dist/components/GSelect.vue.d.ts +38 -5
- package/dist/components/GSelectButton.vue.d.ts +22 -8
- package/dist/components/GSidebar.vue.d.ts +42 -0
- package/dist/components/GSidebarMenu.vue.d.ts +39 -0
- package/dist/components/GTable.vue.d.ts +74 -0
- package/dist/components/GTextInput.vue.d.ts +30 -1
- package/dist/components/GThreeWayToggle.vue.d.ts +29 -0
- package/dist/components/detail-list/GDetailListItem.vue.d.ts +21 -0
- package/dist/components/table/GTableBody.vue.d.ts +36 -0
- package/dist/components/table/GTablePagination.vue.d.ts +20 -0
- package/dist/components/table/TableColumn.d.ts +35 -0
- package/dist/compose/useActiveLink.d.ts +13 -0
- package/dist/compose/useFiltering.d.ts +14 -0
- package/dist/compose/useOverlayStack.d.ts +20 -6
- package/dist/compose/useSidebar.d.ts +12 -0
- package/dist/directives/v-gtooltip.d.ts +4 -0
- package/dist/grad-vue.css +1 -1
- package/dist/grad-vue.d.ts +34 -19
- package/dist/grad-vue.js +145 -942
- package/dist/grad-vue.js.map +1 -1
- package/dist/main-BA2FBasv.js +2427 -0
- package/dist/main-BA2FBasv.js.map +1 -0
- package/dist/plugin.d.ts +35 -0
- package/dist/plugin.js +12 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +35 -11
package/dist/grad-vue.js
CHANGED
|
@@ -1,958 +1,161 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
"g-btn--outlined": n.outlined,
|
|
32
|
-
"g-btn--text": n.text,
|
|
33
|
-
"ilw-theme-blue": n.theme === "primary",
|
|
34
|
-
"ilw-theme-orange": n.theme === "accent"
|
|
35
|
-
}
|
|
36
|
-
]);
|
|
37
|
-
return (t, s) => (p(), fe(ye(n.component ? n.component : "button"), K(_(e), {
|
|
38
|
-
to: n.to,
|
|
39
|
-
class: u.value,
|
|
40
|
-
type: n.to ? void 0 : "button",
|
|
41
|
-
onClick: s[0] || (s[0] = (l) => t.$emit("click", l)),
|
|
42
|
-
onFocus: s[1] || (s[1] = (l) => t.$emit("focus", l)),
|
|
43
|
-
onBlur: s[2] || (s[2] = (l) => t.$emit("blur", l)),
|
|
44
|
-
onKeydown: s[3] || (s[3] = (l) => t.$emit("keydown", l)),
|
|
45
|
-
onKeyup: s[4] || (s[4] = (l) => t.$emit("keyup", l)),
|
|
46
|
-
onMousedown: s[5] || (s[5] = (l) => t.$emit("mousedown", l)),
|
|
47
|
-
onMouseup: s[6] || (s[6] = (l) => t.$emit("mouseup", l)),
|
|
48
|
-
onMouseenter: s[7] || (s[7] = (l) => t.$emit("mouseenter", l)),
|
|
49
|
-
onMouseleave: s[8] || (s[8] = (l) => t.$emit("mouseleave", l))
|
|
50
|
-
}), {
|
|
51
|
-
default: X(() => [
|
|
52
|
-
M(t.$slots, "default")
|
|
53
|
-
]),
|
|
54
|
-
_: 3
|
|
55
|
-
}, 16, ["to", "class", "type"]));
|
|
56
|
-
}
|
|
57
|
-
}), Ae = ["value", "placeholder", "disabled", "aria-invalid"], Me = /* @__PURE__ */ E({
|
|
58
|
-
inheritAttrs: !1,
|
|
59
|
-
__name: "GTextInput",
|
|
60
|
-
props: /* @__PURE__ */ ie({
|
|
61
|
-
placeholder: { default: "" },
|
|
62
|
-
disabled: { type: Boolean, default: !1 },
|
|
63
|
-
error: { default: "" }
|
|
64
|
-
}, {
|
|
65
|
-
modelValue: { type: String },
|
|
66
|
-
modelModifiers: {}
|
|
67
|
-
}),
|
|
68
|
-
emits: /* @__PURE__ */ ie(["change"], ["update:modelValue"]),
|
|
69
|
-
setup(a, { emit: n }) {
|
|
70
|
-
const e = a, u = _e(a, "modelValue"), t = n, s = k(u.value ?? "");
|
|
71
|
-
let l = null;
|
|
72
|
-
function o(f) {
|
|
73
|
-
if (f !== u.value) {
|
|
74
|
-
const $ = u.value;
|
|
75
|
-
u.value = f, t("change", {
|
|
76
|
-
was: $,
|
|
77
|
-
to: f
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function i(f) {
|
|
82
|
-
const $ = f.target.value;
|
|
83
|
-
s.value = $, l && clearTimeout(l), l = setTimeout(() => {
|
|
84
|
-
o(s.value), l = null;
|
|
85
|
-
}, 3e3);
|
|
86
|
-
}
|
|
87
|
-
function r(f) {
|
|
88
|
-
l && (clearTimeout(l), l = null), o(f.target.value);
|
|
89
|
-
}
|
|
90
|
-
function w(f) {
|
|
91
|
-
l && (clearTimeout(l), l = null), setTimeout(() => {
|
|
92
|
-
const $ = f.target.value;
|
|
93
|
-
o($);
|
|
94
|
-
}, 0);
|
|
95
|
-
}
|
|
96
|
-
function b(f) {
|
|
97
|
-
(f.key === "PageUp" || f.key === "PageDown") && (l && (clearTimeout(l), l = null), o(f.target.value)), f.key === "Enter" && o(f.target.value);
|
|
98
|
-
}
|
|
99
|
-
return (f, $) => (p(), m("div", {
|
|
100
|
-
class: S(["g-text-input-wrap", { "g-text-input-has-error": e.error }])
|
|
101
|
-
}, [
|
|
102
|
-
v("input", K({
|
|
103
|
-
value: u.value,
|
|
104
|
-
placeholder: e.placeholder,
|
|
105
|
-
disabled: e.disabled,
|
|
106
|
-
onInput: i,
|
|
107
|
-
onBlur: r,
|
|
108
|
-
onPaste: w,
|
|
109
|
-
onKeydown: b,
|
|
110
|
-
type: "text",
|
|
111
|
-
class: "g-text-input"
|
|
112
|
-
}, f.$attrs, {
|
|
113
|
-
"aria-invalid": e.error ? "true" : "false"
|
|
114
|
-
}), null, 16, Ae)
|
|
115
|
-
], 2));
|
|
116
|
-
}
|
|
117
|
-
}), W = (a, n) => {
|
|
118
|
-
const e = a.__vccOpts || a;
|
|
119
|
-
for (const [u, t] of n)
|
|
120
|
-
e[u] = t;
|
|
121
|
-
return e;
|
|
122
|
-
}, Le = /* @__PURE__ */ W(Me, [["__scopeId", "data-v-cbaa5e3a"]]), me = k([]), ee = k([]);
|
|
123
|
-
function se(a = !1) {
|
|
124
|
-
const n = ne(), e = a ? ee : me;
|
|
125
|
-
function u() {
|
|
126
|
-
e.value.push(n);
|
|
127
|
-
}
|
|
128
|
-
function t() {
|
|
129
|
-
const l = e.value.lastIndexOf(n);
|
|
130
|
-
l !== -1 && e.value.splice(l, 1);
|
|
131
|
-
}
|
|
132
|
-
const s = x(() => !a && ee.value.length > 0 ? !1 : e.value.length > 0 && e.value[e.value.length - 1] === n);
|
|
133
|
-
return te(t), { push: u, pop: t, isTop: s, id: n };
|
|
134
|
-
}
|
|
135
|
-
function Et() {
|
|
136
|
-
const a = x(() => ee.value.length > 0), n = x(() => me.value.length > 0 || ee.value.length > 0);
|
|
137
|
-
return { hasModal: a, hasOverlay: n };
|
|
138
|
-
}
|
|
139
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
140
|
-
const Oe = (a) => a != null;
|
|
141
|
-
function Ee(a, n = {}) {
|
|
142
|
-
let e;
|
|
143
|
-
const { immediate: u, ...t } = n, s = re(!1), l = re(!1), o = (b) => e && e.activate(b), i = (b) => e && e.deactivate(b), r = () => {
|
|
144
|
-
e && (e.pause(), l.value = !0);
|
|
145
|
-
}, w = () => {
|
|
146
|
-
e && (e.unpause(), l.value = !1);
|
|
147
|
-
};
|
|
148
|
-
return F(x(() => Be(de(a)).map((b) => {
|
|
149
|
-
const f = de(b);
|
|
150
|
-
return typeof f == "string" ? f : Ie(f);
|
|
151
|
-
}).filter(Oe)), (b) => {
|
|
152
|
-
if (b.length)
|
|
153
|
-
if (!e)
|
|
154
|
-
e = Se(b, {
|
|
155
|
-
...t,
|
|
156
|
-
onActivate() {
|
|
157
|
-
s.value = !0, n.onActivate && n.onActivate();
|
|
158
|
-
},
|
|
159
|
-
onDeactivate() {
|
|
160
|
-
s.value = !1, n.onDeactivate && n.onDeactivate();
|
|
161
|
-
}
|
|
162
|
-
}), u && o();
|
|
163
|
-
else {
|
|
164
|
-
const f = e?.active;
|
|
165
|
-
e?.updateContainerElements(b), !f && u && o();
|
|
1
|
+
import { e as w, G as j, _ as k, j as C, s as F, t as D, r as V, k as H, p as W, q as $, b as q, d as N, g as R, f as Q, c as _, h as U, i as Y, m as z, n as J, o as K, a as X, l as Z, V as ee, u as te, v as se, w as ne, x as oe, y as re } from "./main-BA2FBasv.js";
|
|
2
|
+
import { unrefElement as g, useMutationObserver as p, useIntersectionObserver as h, useMediaQuery as G } from "@vueuse/core";
|
|
3
|
+
import { ref as v, useId as E, watch as b, onBeforeUnmount as S, toValue as O, computed as y } from "vue";
|
|
4
|
+
function L(i, r, e) {
|
|
5
|
+
const s = [0, 0.25, 0.5, 0.75, 1], c = `${-r}px 0px 0px 0px`, u = /* @__PURE__ */ new Map(), a = v(
|
|
6
|
+
Array.from(g(i)?.children || [])
|
|
7
|
+
);
|
|
8
|
+
p(
|
|
9
|
+
i,
|
|
10
|
+
() => {
|
|
11
|
+
a.value = Array.from(
|
|
12
|
+
g(i)?.children || []
|
|
13
|
+
);
|
|
14
|
+
},
|
|
15
|
+
{ childList: !0 }
|
|
16
|
+
);
|
|
17
|
+
const { stop: t } = h(
|
|
18
|
+
a,
|
|
19
|
+
(n) => {
|
|
20
|
+
const o = a.value[a.value.length - 1];
|
|
21
|
+
for (const l of n)
|
|
22
|
+
u.set(
|
|
23
|
+
l.target,
|
|
24
|
+
l.isIntersecting ? Math.ceil(100 * l.intersectionRatio) / 100 : 0
|
|
25
|
+
), l.target === o && l.intersectionRatio === 1 && u.set(l.target, Number.POSITIVE_INFINITY);
|
|
26
|
+
let d = null, f = 0;
|
|
27
|
+
for (const l of u.keys()) {
|
|
28
|
+
const m = u.get(l) || 0;
|
|
29
|
+
m <= f || (l.getBoundingClientRect(), d = l, f = m);
|
|
166
30
|
}
|
|
167
|
-
|
|
168
|
-
hasFocus: s,
|
|
169
|
-
isPaused: l,
|
|
170
|
-
activate: o,
|
|
171
|
-
deactivate: i,
|
|
172
|
-
pause: r,
|
|
173
|
-
unpause: w
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function be(a, n) {
|
|
177
|
-
const e = k(!1), { activate: u, deactivate: t, pause: s, unpause: l } = Ee(a, {
|
|
178
|
-
immediate: !0,
|
|
179
|
-
initialFocus: () => {
|
|
180
|
-
if (e.value)
|
|
181
|
-
return !1;
|
|
182
|
-
const o = a.value?.querySelector("h2");
|
|
183
|
-
if (o)
|
|
184
|
-
return o;
|
|
185
|
-
const i = a.value?.querySelector("[popover-focus]");
|
|
186
|
-
if (i)
|
|
187
|
-
return i;
|
|
188
|
-
const r = a.value?.querySelector("[aria-selected='true']");
|
|
189
|
-
if (r)
|
|
190
|
-
return r;
|
|
31
|
+
d instanceof HTMLElement ? e.value = d.id : e.value = "";
|
|
191
32
|
},
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return
|
|
200
|
-
o ? l() : s();
|
|
201
|
-
}), { activate: u, deactivate: t, pause: s, unpause: l };
|
|
33
|
+
{
|
|
34
|
+
threshold: s,
|
|
35
|
+
root: null,
|
|
36
|
+
rootMargin: c,
|
|
37
|
+
immediate: !0
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
return { stop: t };
|
|
202
41
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
42
|
+
function x(i = "(max-width: 800px)") {
|
|
43
|
+
const r = E(), e = v(!1), s = G(i, {
|
|
44
|
+
ssrWidth: 1e3
|
|
45
|
+
});
|
|
46
|
+
function c(a) {
|
|
47
|
+
if (!s.value || !e.value)
|
|
48
|
+
return;
|
|
49
|
+
const t = a.target, n = document.getElementById(`${r}-sidebar`);
|
|
50
|
+
n && (n.contains(t) || setTimeout(() => {
|
|
51
|
+
e.value = !1;
|
|
52
|
+
}, 5));
|
|
209
53
|
}
|
|
210
|
-
function
|
|
211
|
-
|
|
54
|
+
function u(a) {
|
|
55
|
+
if (!s.value || !e.value)
|
|
56
|
+
return;
|
|
57
|
+
const t = a.target, n = document.getElementById(`${r}-sidebar`), o = document.getElementById(`${r}-hamburger`);
|
|
58
|
+
n && (n.contains(t) || o?.contains(t) || setTimeout(() => {
|
|
59
|
+
e.value = !1;
|
|
60
|
+
}, 5));
|
|
212
61
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
62
|
+
return document && b(
|
|
63
|
+
s,
|
|
64
|
+
(a) => {
|
|
65
|
+
a ? (document.addEventListener("mousedown", c), document.addEventListener("focusin", u)) : (document.removeEventListener("mousedown", c), document.removeEventListener("focusin", u));
|
|
66
|
+
},
|
|
67
|
+
{ immediate: !0 }
|
|
68
|
+
), S(() => {
|
|
69
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("focusin", u);
|
|
70
|
+
}), {
|
|
71
|
+
id: r,
|
|
72
|
+
open: e,
|
|
73
|
+
isCollapsible: s,
|
|
74
|
+
toggle: () => e.value = !e.value
|
|
75
|
+
};
|
|
218
76
|
}
|
|
219
|
-
function
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
const b = a.left + (a.width - n.width) / 2, f = w - b;
|
|
226
|
-
return { top: r, left: w, xOffset: f, placedAbove: o, overlay: i };
|
|
77
|
+
function I(i) {
|
|
78
|
+
const r = {};
|
|
79
|
+
return Object.keys(i).forEach((e) => {
|
|
80
|
+
const s = i[e];
|
|
81
|
+
s != null && s !== "" && s !== !1 && (Array.isArray(s) ? s.length > 0 && (r[e] = s.map((c) => String(c))) : r[e] = String(s));
|
|
82
|
+
}), r;
|
|
227
83
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
t.value = h;
|
|
241
|
-
}
|
|
242
|
-
), F(t, (h) => {
|
|
243
|
-
u("update:modelValue", h), h ? (N(() => {
|
|
244
|
-
N(() => w());
|
|
245
|
-
}), o(), u("show")) : (b(), i(), u("hide"));
|
|
246
|
-
});
|
|
247
|
-
function f() {
|
|
248
|
-
t.value = !1;
|
|
249
|
-
}
|
|
250
|
-
function $() {
|
|
251
|
-
t.value = !t.value;
|
|
252
|
-
}
|
|
253
|
-
const y = k({ top: 0, left: 0 }), V = k({ left: "50%" }), B = k(!1), D = k(!1);
|
|
254
|
-
let c = null;
|
|
255
|
-
function C() {
|
|
256
|
-
if (!s.value || !l.value)
|
|
257
|
-
return;
|
|
258
|
-
const h = s.value.getBoundingClientRect(), L = l.value.getBoundingClientRect(), I = window.innerWidth - document.documentElement.clientWidth, U = window.innerWidth - I, Y = new DOMRect(
|
|
259
|
-
window.scrollX,
|
|
260
|
-
window.scrollY,
|
|
261
|
-
U,
|
|
262
|
-
window.innerHeight
|
|
263
|
-
), { top: j, left: le, xOffset: ae, placedAbove: P, overlay: q } = Pe(h, L, Y, {
|
|
264
|
-
gap: e.minimal ? 0 : 8
|
|
84
|
+
function M(i, r = {}) {
|
|
85
|
+
const e = v({}), s = r.syncWith;
|
|
86
|
+
if (s) {
|
|
87
|
+
if (s.value) {
|
|
88
|
+
const t = O(s);
|
|
89
|
+
Object.keys(i).forEach((n) => {
|
|
90
|
+
if (t[n] !== void 0) {
|
|
91
|
+
const o = t[n];
|
|
92
|
+
typeof o == "string" && (o.includes(",") ? e.value[n] = o.split(
|
|
93
|
+
","
|
|
94
|
+
) : e.value[n] = o);
|
|
95
|
+
}
|
|
265
96
|
});
|
|
266
|
-
y.value = { top: j, left: le }, V.value = {
|
|
267
|
-
left: `${L.width / 2 - ae}px`,
|
|
268
|
-
top: P ? "auto" : void 0,
|
|
269
|
-
bottom: P ? "-8px" : void 0
|
|
270
|
-
}, B.value = P, D.value = q;
|
|
271
|
-
}
|
|
272
|
-
return F(t, (h) => {
|
|
273
|
-
h ? N(() => {
|
|
274
|
-
C(), window.addEventListener("resize", C), l.value && (c && c.disconnect(), c = new ResizeObserver(
|
|
275
|
-
() => C()
|
|
276
|
-
), c.observe(l.value));
|
|
277
|
-
}) : (window.removeEventListener("resize", C), c && c.disconnect());
|
|
278
|
-
}), te(() => {
|
|
279
|
-
window.removeEventListener("resize", C), c && c.disconnect();
|
|
280
|
-
}), (h, L) => (p(), m(z, null, [
|
|
281
|
-
v("div", {
|
|
282
|
-
ref_key: "triggerRef",
|
|
283
|
-
ref: s,
|
|
284
|
-
class: "g-popover-trigger"
|
|
285
|
-
}, [
|
|
286
|
-
M(h.$slots, "trigger", { onToggle: $ }, void 0, !0)
|
|
287
|
-
], 512),
|
|
288
|
-
R(ke, {
|
|
289
|
-
name: "g-popover-expand",
|
|
290
|
-
appear: ""
|
|
291
|
-
}, {
|
|
292
|
-
default: X(() => [
|
|
293
|
-
t.value ? (p(), m("div", {
|
|
294
|
-
key: 0,
|
|
295
|
-
ref_key: "popoverRef",
|
|
296
|
-
ref: l,
|
|
297
|
-
class: S({
|
|
298
|
-
"g-popover": !0,
|
|
299
|
-
"g-popover-above": B.value,
|
|
300
|
-
"g-popover-below": !B.value,
|
|
301
|
-
"g-popover-minimal": a.minimal
|
|
302
|
-
}),
|
|
303
|
-
role: "dialog",
|
|
304
|
-
"aria-modal": "true",
|
|
305
|
-
style: ve({
|
|
306
|
-
top: y.value.top + "px",
|
|
307
|
-
left: y.value.left + "px"
|
|
308
|
-
})
|
|
309
|
-
}, [
|
|
310
|
-
!D.value && !a.minimal ? (p(), m("div", {
|
|
311
|
-
key: 0,
|
|
312
|
-
class: S(["g-popover-arrow", { "g-popover-arrow-above": B.value }]),
|
|
313
|
-
style: ve(V.value),
|
|
314
|
-
"aria-hidden": "true"
|
|
315
|
-
}, null, 6)) : O("", !0),
|
|
316
|
-
M(h.$slots, "content", {}, void 0, !0),
|
|
317
|
-
a.minimal ? O("", !0) : (p(), m("button", {
|
|
318
|
-
key: 1,
|
|
319
|
-
class: "p-button p-button-text g-popover-close fa-regular fa-close",
|
|
320
|
-
type: "button",
|
|
321
|
-
"aria-label": "Close popover",
|
|
322
|
-
onClick: f
|
|
323
|
-
}))
|
|
324
|
-
], 6)) : O("", !0)
|
|
325
|
-
]),
|
|
326
|
-
_: 3
|
|
327
|
-
})
|
|
328
|
-
], 64));
|
|
329
|
-
}
|
|
330
|
-
}), Fe = /* @__PURE__ */ W(ze, [["__scopeId", "data-v-1c60db92"]]), Ke = ["disabled"], He = { class: "g-select-btn-legend" }, We = { class: "g-select-btn-row" }, Ne = ["id", "name", "value", "checked", "disabled", "onChange"], Ue = ["for"], qe = /* @__PURE__ */ E({
|
|
331
|
-
__name: "GSelectButton",
|
|
332
|
-
props: {
|
|
333
|
-
options: {},
|
|
334
|
-
modelValue: {},
|
|
335
|
-
size: { default: "medium" },
|
|
336
|
-
theme: { default: "primary" },
|
|
337
|
-
name: { default: void 0 },
|
|
338
|
-
disabled: { type: Boolean, default: !1 },
|
|
339
|
-
label: {}
|
|
340
|
-
},
|
|
341
|
-
emits: ["update:modelValue", "change"],
|
|
342
|
-
setup(a, { emit: n }) {
|
|
343
|
-
const e = a, u = n, t = ne(), s = x(() => e.options.map((r) => typeof r == "string" ? { label: r, value: r } : r)), l = x(() => ["g-select-btn-group", `g-select-btn-group--${e.size}`]), o = (r) => [
|
|
344
|
-
"g-select-btn",
|
|
345
|
-
`g-select-btn--${e.theme}`,
|
|
346
|
-
r ? "g-select-btn--selected" : "",
|
|
347
|
-
{ "g-select-btn--disabled": e.disabled }
|
|
348
|
-
];
|
|
349
|
-
function i(r) {
|
|
350
|
-
!e.disabled && r !== e.modelValue && (u("update:modelValue", r), u("change", r));
|
|
351
97
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
(p(!0), m(z, null, Q(s.value, (b, f) => (p(), m(z, {
|
|
359
|
-
key: b.value
|
|
360
|
-
}, [
|
|
361
|
-
v("input", {
|
|
362
|
-
class: "g-select-btn-radio",
|
|
363
|
-
type: "radio",
|
|
364
|
-
id: `${_(t)}-${b.value}`,
|
|
365
|
-
name: e.name || _(t),
|
|
366
|
-
value: b.value,
|
|
367
|
-
checked: b.value === e.modelValue,
|
|
368
|
-
disabled: e.disabled,
|
|
369
|
-
onChange: ($) => i(b.value)
|
|
370
|
-
}, null, 40, Ne),
|
|
371
|
-
v("label", {
|
|
372
|
-
for: `${_(t)}-${b.value}`,
|
|
373
|
-
class: S(o(b.value === e.modelValue))
|
|
374
|
-
}, T(b.label), 11, Ue)
|
|
375
|
-
], 64))), 128))
|
|
376
|
-
])
|
|
377
|
-
], 10, Ke));
|
|
378
|
-
}
|
|
379
|
-
}), Qe = /* @__PURE__ */ W(qe, [["__scopeId", "data-v-18075a0b"]]), Xe = ["width", "height"], Ye = ["cx", "cy", "r"], je = ["cx", "cy", "r", "stroke-dasharray", "stroke-dashoffset"], Je = ["cx", "cy", "r"], G = 4, Ze = /* @__PURE__ */ E({
|
|
380
|
-
__name: "GProgress",
|
|
381
|
-
props: {
|
|
382
|
-
value: { default: void 0 },
|
|
383
|
-
size: { default: "medium" },
|
|
384
|
-
ariaLabel: { default: "Loading" }
|
|
385
|
-
},
|
|
386
|
-
setup(a) {
|
|
387
|
-
const n = a, e = x(() => typeof n.value == "number" && n.value >= 1 && n.value <= 100), u = x(() => {
|
|
388
|
-
switch (n.size) {
|
|
389
|
-
case "small":
|
|
390
|
-
return 12;
|
|
391
|
-
case "large":
|
|
392
|
-
return 24;
|
|
393
|
-
default:
|
|
394
|
-
return 18;
|
|
395
|
-
}
|
|
396
|
-
}), t = x(() => 2 * Math.PI * u.value), s = x(() => e.value ? n.value / 100 * t.value : 0), l = x(
|
|
397
|
-
() => e.value ? {
|
|
398
|
-
role: "progressbar",
|
|
399
|
-
"aria-valuenow": n.value,
|
|
400
|
-
"aria-valuemin": 1,
|
|
401
|
-
"aria-valuemax": 100,
|
|
402
|
-
"aria-label": n.ariaLabel
|
|
403
|
-
} : { role: "status", "aria-label": n.ariaLabel }
|
|
98
|
+
b(
|
|
99
|
+
() => e.value,
|
|
100
|
+
(t) => {
|
|
101
|
+
s.value = I(t);
|
|
102
|
+
},
|
|
103
|
+
{ deep: !0 }
|
|
404
104
|
);
|
|
405
|
-
return (o, i) => (p(), m("span", K({ class: "g-progress" }, l.value), [
|
|
406
|
-
(p(), m("svg", {
|
|
407
|
-
width: u.value * 2 + G,
|
|
408
|
-
height: u.value * 2 + G,
|
|
409
|
-
class: S([
|
|
410
|
-
"g-progress__svg",
|
|
411
|
-
{ "g-progress--determinate": e.value, "g-progress--indeterminate": !e.value }
|
|
412
|
-
]),
|
|
413
|
-
focusable: "false",
|
|
414
|
-
"aria-hidden": "true"
|
|
415
|
-
}, [
|
|
416
|
-
v("circle", {
|
|
417
|
-
class: "g-progress__track",
|
|
418
|
-
cx: u.value + G / 2,
|
|
419
|
-
cy: u.value + G / 2,
|
|
420
|
-
r: u.value,
|
|
421
|
-
"stroke-width": G,
|
|
422
|
-
fill: "none"
|
|
423
|
-
}, null, 8, Ye),
|
|
424
|
-
e.value ? (p(), m("circle", {
|
|
425
|
-
key: 0,
|
|
426
|
-
class: "g-progress__value",
|
|
427
|
-
cx: u.value + G / 2,
|
|
428
|
-
cy: u.value + G / 2,
|
|
429
|
-
r: u.value,
|
|
430
|
-
"stroke-width": G,
|
|
431
|
-
fill: "none",
|
|
432
|
-
"stroke-dasharray": t.value,
|
|
433
|
-
"stroke-dashoffset": t.value - s.value,
|
|
434
|
-
style: { transform: "rotate(-90deg)", "transform-origin": "center" }
|
|
435
|
-
}, null, 8, je)) : (p(), m("circle", {
|
|
436
|
-
key: 1,
|
|
437
|
-
class: "g-progress__spinner",
|
|
438
|
-
cx: u.value + G / 2,
|
|
439
|
-
cy: u.value + G / 2,
|
|
440
|
-
r: u.value,
|
|
441
|
-
"stroke-width": G,
|
|
442
|
-
fill: "none"
|
|
443
|
-
}, null, 8, Je))
|
|
444
|
-
], 10, Xe))
|
|
445
|
-
], 16));
|
|
446
|
-
}
|
|
447
|
-
}), Re = /* @__PURE__ */ W(Ze, [["__scopeId", "data-v-ba4cca36"]]), et = ["id", "aria-labelledby", "aria-describedby"], tt = { class: "g-alertdialog-inner" }, lt = ["id"], at = ["id"], ot = { class: "g-alertdialog-actions" }, nt = /* @__PURE__ */ E({
|
|
448
|
-
__name: "GAlertDialog",
|
|
449
|
-
props: {
|
|
450
|
-
label: { default: "Confirmation" },
|
|
451
|
-
buttonText: { default: "Continue" },
|
|
452
|
-
buttonColor: { default: "primary" }
|
|
453
|
-
},
|
|
454
|
-
emits: ["cancel", "confirm"],
|
|
455
|
-
setup(a, { emit: n }) {
|
|
456
|
-
const e = a, u = n, t = k(null), s = k(!0), { id: l, pop: o, push: i, isTop: r } = se(!0), { deactivate: w, activate: b } = be(t, r);
|
|
457
|
-
function f() {
|
|
458
|
-
s.value = !1;
|
|
459
|
-
}
|
|
460
|
-
return ge([t], r, s, f, o), pe(() => {
|
|
461
|
-
i(), b();
|
|
462
|
-
}), we(() => {
|
|
463
|
-
o(), w();
|
|
464
|
-
}), ($, y) => (p(), fe($e, { to: "#modal-root" }, [
|
|
465
|
-
v("div", {
|
|
466
|
-
id: "alertdialog-" + _(l),
|
|
467
|
-
class: "g-alertdialog",
|
|
468
|
-
role: "alertdialog",
|
|
469
|
-
"aria-modal": "true",
|
|
470
|
-
"aria-labelledby": "alertdialog-label-" + _(l),
|
|
471
|
-
"aria-describedby": "alertdialog-description-" + _(l),
|
|
472
|
-
ref_key: "dialog",
|
|
473
|
-
ref: t
|
|
474
|
-
}, [
|
|
475
|
-
v("div", tt, [
|
|
476
|
-
v("h2", {
|
|
477
|
-
id: "alertdialog-label-" + _(l),
|
|
478
|
-
class: "g-alertdialog-label"
|
|
479
|
-
}, T(e.label), 9, lt),
|
|
480
|
-
v("div", {
|
|
481
|
-
id: "alertdialog-description-" + _(l),
|
|
482
|
-
class: "g-alertdialog-content"
|
|
483
|
-
}, [
|
|
484
|
-
M($.$slots, "default", {}, void 0, !0)
|
|
485
|
-
], 8, at),
|
|
486
|
-
v("div", ot, [
|
|
487
|
-
R(oe, {
|
|
488
|
-
outlined: "",
|
|
489
|
-
onClick: y[0] || (y[0] = (V) => u("cancel"))
|
|
490
|
-
}, {
|
|
491
|
-
default: X(() => [...y[2] || (y[2] = [
|
|
492
|
-
H("Cancel", -1)
|
|
493
|
-
])]),
|
|
494
|
-
_: 1
|
|
495
|
-
}),
|
|
496
|
-
R(oe, {
|
|
497
|
-
theme: e.buttonColor,
|
|
498
|
-
onClick: y[1] || (y[1] = (V) => u("confirm"))
|
|
499
|
-
}, {
|
|
500
|
-
default: X(() => [
|
|
501
|
-
H(T(e.buttonText), 1)
|
|
502
|
-
]),
|
|
503
|
-
_: 1
|
|
504
|
-
}, 8, ["theme"])
|
|
505
|
-
])
|
|
506
|
-
])
|
|
507
|
-
], 8, et)
|
|
508
|
-
]));
|
|
509
105
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
__name: "GSelect",
|
|
516
|
-
props: {
|
|
517
|
-
modelValue: {},
|
|
518
|
-
options: {},
|
|
519
|
-
label: {},
|
|
520
|
-
hiddenLabel: { type: Boolean },
|
|
521
|
-
disabled: { type: Boolean, default: !1 },
|
|
522
|
-
name: { default: void 0 },
|
|
523
|
-
searchable: { type: Boolean, default: !1 },
|
|
524
|
-
clearButton: { type: Boolean }
|
|
525
|
-
},
|
|
526
|
-
emits: ["update:modelValue", "change"],
|
|
527
|
-
setup(a, { emit: n }) {
|
|
528
|
-
const e = a, u = n, t = ne(), s = k(null), l = k(null), o = k(!1), i = k(0), r = k(!1), { push: w, pop: b, isTop: f } = se(), $ = x(() => e.options.map((d) => typeof d == "string" ? { label: d, value: d } : d)), y = k(""), V = x(() => {
|
|
529
|
-
if (!e.searchable || !o.value || !y.value)
|
|
530
|
-
return $.value;
|
|
531
|
-
const d = y.value.toLowerCase();
|
|
532
|
-
return $.value.filter((g) => g.label.toLowerCase().includes(d));
|
|
533
|
-
}), B = x(() => V.value.findIndex((d) => d.value === e.modelValue));
|
|
534
|
-
F(
|
|
535
|
-
() => e.modelValue,
|
|
536
|
-
(d) => {
|
|
537
|
-
const g = V.value.findIndex((A) => A.value === d);
|
|
538
|
-
g !== -1 && (i.value = g);
|
|
539
|
-
}
|
|
540
|
-
), F(o, (d) => {
|
|
541
|
-
d ? w() : b();
|
|
106
|
+
const c = y(() => Object.values(e.value).some(
|
|
107
|
+
(t) => t != null && t !== !1 && (!Array.isArray(t) || t.length > 0)
|
|
108
|
+
)), u = () => {
|
|
109
|
+
Object.keys(e.value).forEach((t) => {
|
|
110
|
+
e.value[t] = void 0;
|
|
542
111
|
});
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
C.value && C.value.focus();
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
function c() {
|
|
553
|
-
o.value = !1, e.searchable && (y.value = "");
|
|
554
|
-
}
|
|
555
|
-
const C = k(null);
|
|
556
|
-
function h(d) {
|
|
557
|
-
e.disabled || e.searchable && D();
|
|
558
|
-
}
|
|
559
|
-
function L(d) {
|
|
560
|
-
if (!e.searchable) return;
|
|
561
|
-
o.value || D(), y.value = d.target.value;
|
|
562
|
-
const g = V.value.findIndex((A) => A.value === e.modelValue);
|
|
563
|
-
i.value = g !== -1 ? g : 0;
|
|
564
|
-
}
|
|
565
|
-
function I(d) {
|
|
566
|
-
const g = d.relatedTarget;
|
|
567
|
-
if (r.value) {
|
|
568
|
-
r.value = !1;
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
g && l.value && l.value.contains(g) || (e.searchable && (y.value = ""), c());
|
|
572
|
-
}
|
|
573
|
-
function U(d) {
|
|
574
|
-
const g = V.value[d];
|
|
575
|
-
g && g.value !== e.modelValue && (u("update:modelValue", g.value), u("change", g.value)), c();
|
|
576
|
-
}
|
|
577
|
-
function Y() {
|
|
578
|
-
e.disabled || (o.value ? c() : D());
|
|
579
|
-
}
|
|
580
|
-
function j(d) {
|
|
581
|
-
if (e.disabled)
|
|
582
|
-
return;
|
|
583
|
-
const g = V.value.length - 1;
|
|
584
|
-
if (!o.value && ["ArrowDown", "ArrowUp", "Enter", " "].includes(d.key)) {
|
|
585
|
-
d.preventDefault(), D();
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
switch (d.key) {
|
|
589
|
-
case "ArrowDown":
|
|
590
|
-
d.preventDefault(), o.value ? (i.value = Math.min(g, i.value + 1), P()) : D();
|
|
591
|
-
break;
|
|
592
|
-
case "ArrowUp":
|
|
593
|
-
d.preventDefault(), o.value ? (i.value = Math.max(0, i.value - 1), P()) : D();
|
|
594
|
-
break;
|
|
595
|
-
case "Home":
|
|
596
|
-
d.preventDefault(), i.value = 0, P();
|
|
597
|
-
break;
|
|
598
|
-
case "End":
|
|
599
|
-
d.preventDefault(), i.value = g, P();
|
|
600
|
-
break;
|
|
601
|
-
case "Enter":
|
|
602
|
-
case " ":
|
|
603
|
-
d.preventDefault(), o.value ? U(i.value) : D();
|
|
604
|
-
break;
|
|
605
|
-
case "Escape":
|
|
606
|
-
f.value && (d.preventDefault(), setTimeout(() => {
|
|
607
|
-
c();
|
|
608
|
-
}, 0));
|
|
609
|
-
break;
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
function le(d) {
|
|
613
|
-
U(d);
|
|
614
|
-
}
|
|
615
|
-
function ae() {
|
|
616
|
-
r.value = !0;
|
|
617
|
-
}
|
|
618
|
-
function P() {
|
|
619
|
-
N(() => {
|
|
620
|
-
const d = document.getElementById(`${t}-option-${i.value}`);
|
|
621
|
-
d && d.scrollIntoView({ block: "nearest" });
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
const q = x(() => e.clearButton && e.modelValue !== null && e.modelValue !== void 0 && !e.disabled);
|
|
625
|
-
function ue() {
|
|
626
|
-
e.disabled || (u("update:modelValue", null), u("change", null), e.searchable && (y.value = ""));
|
|
627
|
-
}
|
|
628
|
-
return te(() => {
|
|
629
|
-
b();
|
|
630
|
-
}), (d, g) => (p(), m("div", {
|
|
631
|
-
class: S(["g-select-root g-select-combo", { "g-select-open": o.value }])
|
|
632
|
-
}, [
|
|
633
|
-
a.hiddenLabel ? O("", !0) : (p(), m("div", {
|
|
634
|
-
key: 0,
|
|
635
|
-
id: _(t) + "-label",
|
|
636
|
-
class: "g-select-combo-label g-select-label"
|
|
637
|
-
}, T(e.label), 9, ut)),
|
|
638
|
-
e.searchable ? (p(), m("div", K({
|
|
639
|
-
key: 1,
|
|
640
|
-
class: "g-select-combo-input g-select-control",
|
|
641
|
-
id: _(t),
|
|
642
|
-
role: "combobox",
|
|
643
|
-
"aria-controls": _(t) + "-listbox",
|
|
644
|
-
"aria-expanded": o.value ? "true" : "false",
|
|
645
|
-
"aria-haspopup": "listbox"
|
|
646
|
-
}, a.hiddenLabel ? { "aria-label": e.label } : { "aria-labelledby": _(t) + "-label" }, {
|
|
647
|
-
"aria-activedescendant": o.value ? _(t) + "-option-" + i.value : void 0
|
|
648
|
-
}), [
|
|
649
|
-
v("input", K({
|
|
650
|
-
ref_key: "comboInputRef",
|
|
651
|
-
ref: C,
|
|
652
|
-
type: "text",
|
|
653
|
-
name: "comboInput",
|
|
654
|
-
class: ["g-select-search-input", { "g-select-clearable": q.value }],
|
|
655
|
-
value: o.value ? y.value : $.value[B.value] ? $.value[B.value].label : "",
|
|
656
|
-
placeholder: o.value ? "" : e.label,
|
|
657
|
-
disabled: e.disabled,
|
|
658
|
-
onFocus: h,
|
|
659
|
-
onInput: L,
|
|
660
|
-
onKeydown: j,
|
|
661
|
-
onBlur: I,
|
|
662
|
-
"aria-autocomplete": "list",
|
|
663
|
-
"aria-controls": _(t) + "-listbox",
|
|
664
|
-
"aria-expanded": o.value ? "true" : "false",
|
|
665
|
-
"aria-haspopup": "listbox",
|
|
666
|
-
"aria-activedescendant": o.value ? _(t) + "-option-" + i.value : void 0
|
|
667
|
-
}, a.hiddenLabel ? { "aria-label": e.label } : { "aria-labelledby": _(t) + "-label" }, {
|
|
668
|
-
role: "combobox",
|
|
669
|
-
autocomplete: "off"
|
|
670
|
-
}), null, 16, rt),
|
|
671
|
-
q.value ? (p(), m("button", {
|
|
672
|
-
key: 0,
|
|
673
|
-
type: "button",
|
|
674
|
-
class: "g-select-clear-btn",
|
|
675
|
-
"aria-label": "Clear selection",
|
|
676
|
-
onClick: ue
|
|
677
|
-
}, [...g[0] || (g[0] = [
|
|
678
|
-
v("span", {
|
|
679
|
-
"aria-hidden": "true",
|
|
680
|
-
class: "fa fa-regular fa-close"
|
|
681
|
-
}, null, -1)
|
|
682
|
-
])])) : O("", !0),
|
|
683
|
-
g[1] || (g[1] = v("span", { class: "fa fa-caret-down g-select-caret" }, null, -1))
|
|
684
|
-
], 16, it)) : (p(), m("div", K({
|
|
685
|
-
key: 2,
|
|
686
|
-
ref_key: "comboRef",
|
|
687
|
-
ref: s,
|
|
688
|
-
id: _(t),
|
|
689
|
-
class: "g-select-combo-button g-select-control",
|
|
690
|
-
role: "combobox",
|
|
691
|
-
"aria-controls": _(t) + "-listbox",
|
|
692
|
-
"aria-expanded": o.value ? "true" : "false",
|
|
693
|
-
"aria-haspopup": "listbox"
|
|
694
|
-
}, a.hiddenLabel ? { "aria-label": e.label } : { "aria-labelledby": _(t) + "-label" }, {
|
|
695
|
-
"aria-activedescendant": o.value ? _(t) + "-option-" + i.value : void 0,
|
|
696
|
-
tabindex: "0",
|
|
697
|
-
onClick: Y,
|
|
698
|
-
onKeydown: j,
|
|
699
|
-
onFocus: h,
|
|
700
|
-
onBlur: I
|
|
701
|
-
}), [
|
|
702
|
-
H(T($.value[B.value] ? $.value[B.value].label : "") + " ", 1),
|
|
703
|
-
q.value ? (p(), m("button", {
|
|
704
|
-
key: 0,
|
|
705
|
-
type: "button",
|
|
706
|
-
class: "g-select-clear-btn",
|
|
707
|
-
"aria-label": "Clear selection",
|
|
708
|
-
onClick: Z(ue, ["stop"])
|
|
709
|
-
}, [...g[2] || (g[2] = [
|
|
710
|
-
v("span", {
|
|
711
|
-
"aria-hidden": "true",
|
|
712
|
-
class: "fa fa-regular fa-close"
|
|
713
|
-
}, null, -1)
|
|
714
|
-
])])) : O("", !0),
|
|
715
|
-
g[3] || (g[3] = v("span", { class: "fa fa-caret-down g-select-caret" }, null, -1))
|
|
716
|
-
], 16, dt)),
|
|
717
|
-
xe(v("div", K({
|
|
718
|
-
ref_key: "listboxRef",
|
|
719
|
-
ref: l,
|
|
720
|
-
class: "g-select-combo-menu g-select-list",
|
|
721
|
-
role: "listbox",
|
|
722
|
-
id: _(t) + "-listbox"
|
|
723
|
-
}, a.hiddenLabel ? { "aria-label": e.label } : { "aria-labelledby": _(t) + "-label" }, { tabindex: "-1" }), [
|
|
724
|
-
V.value.length > 0 ? (p(!0), m(z, { key: 0 }, Q(V.value, (A, J) => (p(), m("div", {
|
|
725
|
-
key: A.value,
|
|
726
|
-
id: _(t) + "-option-" + J,
|
|
727
|
-
class: S(["g-select-combo-option g-select-option", {
|
|
728
|
-
"g-select-option-current": J === i.value,
|
|
729
|
-
"ilw-theme-blue": A.value === a.modelValue
|
|
730
|
-
}]),
|
|
731
|
-
role: "option",
|
|
732
|
-
"aria-selected": A.value === a.modelValue ? "true" : "false",
|
|
733
|
-
onMousedown: ae,
|
|
734
|
-
onClick: (At) => le(J)
|
|
735
|
-
}, [
|
|
736
|
-
M(d.$slots, "option", {
|
|
737
|
-
option: A,
|
|
738
|
-
selected: A.value === a.modelValue,
|
|
739
|
-
index: J
|
|
740
|
-
}, () => [
|
|
741
|
-
H(T(A.label), 1)
|
|
742
|
-
], !0)
|
|
743
|
-
], 42, vt))), 128)) : (p(), m("div", ft, "No results found."))
|
|
744
|
-
], 16, ct), [
|
|
745
|
-
[Ve, o.value]
|
|
746
|
-
])
|
|
747
|
-
], 2));
|
|
748
|
-
}
|
|
749
|
-
}), mt = /* @__PURE__ */ W(pt, [["__scopeId", "data-v-1081b550"]]), bt = ["aria-label"], gt = ["placeholder", "value", "aria-expanded", "aria-activedescendant"], ht = {
|
|
750
|
-
type: "submit",
|
|
751
|
-
class: "g-search-submit",
|
|
752
|
-
"aria-label": "Submit search"
|
|
753
|
-
}, yt = {
|
|
754
|
-
key: 0,
|
|
755
|
-
class: "fa fa-solid fa-circle-notch fa-spin",
|
|
756
|
-
"aria-hidden": "true"
|
|
757
|
-
}, _t = {
|
|
758
|
-
key: 1,
|
|
759
|
-
class: "fa fa-magnifying-glass",
|
|
760
|
-
"aria-hidden": "true"
|
|
761
|
-
}, kt = {
|
|
762
|
-
"aria-live": "polite",
|
|
763
|
-
class: "g-search-result-count"
|
|
764
|
-
}, wt = ["aria-label"], $t = { class: "g-search-group-label" }, xt = ["id", "onMousedown", "aria-selected"], Vt = ["id", "onMousedown", "aria-selected"], Ct = /* @__PURE__ */ E({
|
|
765
|
-
__name: "GSearch",
|
|
766
|
-
props: {
|
|
767
|
-
modelValue: {},
|
|
768
|
-
results: {},
|
|
769
|
-
placeholder: { default: "Search..." },
|
|
770
|
-
ariaLabel: { default: "Search" },
|
|
771
|
-
auto: { type: Boolean },
|
|
772
|
-
loading: { type: [Boolean, null] }
|
|
773
|
-
},
|
|
774
|
-
emits: ["update:modelValue", "select", "submit"],
|
|
775
|
-
setup(a, { emit: n }) {
|
|
776
|
-
const e = a, u = n, t = k(null), s = k(null), l = k(!1), o = k(-1), i = x(() => Array.isArray(e.results) && e.results.length && "items" in e.results[0] ? e.results.flatMap((c) => c.items) : e.results), r = x(() => i.value.length);
|
|
777
|
-
function w(c) {
|
|
778
|
-
l.value = !1;
|
|
779
|
-
const C = c.target.value;
|
|
780
|
-
u("update:modelValue", C);
|
|
781
|
-
}
|
|
782
|
-
function b() {
|
|
783
|
-
N(() => {
|
|
784
|
-
const c = s.value?.querySelector('[aria-selected="true"]');
|
|
785
|
-
c && c.scrollIntoView({ block: "nearest" });
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
const { focused: f } = Te(t);
|
|
789
|
-
function $(c) {
|
|
790
|
-
if (!r.value)
|
|
791
|
-
return;
|
|
792
|
-
const C = c.altKey;
|
|
793
|
-
c.key === "ArrowDown" ? (c.preventDefault(), l.value = !1, C || (o.value = (o.value + 1) % r.value, b())) : c.key === "ArrowUp" ? (c.preventDefault(), l.value = !1, o.value = (o.value - 1 + r.value) % r.value, b()) : c.key === "Enter" ? y(i.value[o.value]) : c.key === "Escape" && (c.preventDefault(), B.value || u("update:modelValue", ""), l.value = !0, o.value = -1);
|
|
794
|
-
}
|
|
795
|
-
function y(c) {
|
|
796
|
-
u("select", c), u("update:modelValue", ""), l.value = !0, o.value = -1;
|
|
112
|
+
}, a = y(() => {
|
|
113
|
+
const t = {};
|
|
114
|
+
for (const n of Object.keys(i)) {
|
|
115
|
+
const o = e.value[n];
|
|
116
|
+
t[n] = o != null && (!Array.isArray(o) || o.length > 0);
|
|
797
117
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
class: "g-search",
|
|
808
|
-
role: "search",
|
|
809
|
-
"aria-label": e.ariaLabel
|
|
810
|
-
}, [
|
|
811
|
-
v("form", {
|
|
812
|
-
class: "g-search-form",
|
|
813
|
-
onSubmit: C[0] || (C[0] = Z((h) => y(null), ["prevent"]))
|
|
814
|
-
}, [
|
|
815
|
-
v("input", {
|
|
816
|
-
ref_key: "inputRef",
|
|
817
|
-
ref: t,
|
|
818
|
-
class: "g-search-input",
|
|
819
|
-
name: "search",
|
|
820
|
-
type: "search",
|
|
821
|
-
placeholder: e.placeholder,
|
|
822
|
-
value: e.modelValue,
|
|
823
|
-
onInput: w,
|
|
824
|
-
onKeydown: $,
|
|
825
|
-
role: "combobox",
|
|
826
|
-
"aria-expanded": B.value,
|
|
827
|
-
"aria-autocomplete": "list",
|
|
828
|
-
"aria-controls": "g-search-list",
|
|
829
|
-
"aria-activedescendant": o.value >= 0 ? "g-search-option-" + i.value[o.value].id : void 0
|
|
830
|
-
}, null, 40, gt),
|
|
831
|
-
v("button", ht, [
|
|
832
|
-
V.value ? (p(), m("i", yt)) : (p(), m("i", _t))
|
|
833
|
-
])
|
|
834
|
-
], 32),
|
|
835
|
-
B.value ? (p(), m("div", {
|
|
836
|
-
key: 0,
|
|
837
|
-
class: "g-search-dropdown",
|
|
838
|
-
role: "listbox",
|
|
839
|
-
id: "g-search-list",
|
|
840
|
-
ref_key: "listboxRef",
|
|
841
|
-
ref: s,
|
|
842
|
-
"aria-label": "Search results"
|
|
843
|
-
}, [
|
|
844
|
-
v("div", kt, [
|
|
845
|
-
V.value ? O("", !0) : (p(), m(z, { key: 0 }, [
|
|
846
|
-
H(T(r.value) + " result" + T(r.value === 1 ? "" : "s"), 1)
|
|
847
|
-
], 64))
|
|
848
|
-
]),
|
|
849
|
-
r.value > 0 && "items" in e.results[0] ? (p(!0), m(z, { key: 0 }, Q(e.results, (h, L) => (p(), m("div", {
|
|
850
|
-
key: h.type,
|
|
851
|
-
class: "g-search-group",
|
|
852
|
-
role: "group",
|
|
853
|
-
"aria-label": h.label
|
|
854
|
-
}, [
|
|
855
|
-
M(c.$slots, "group", { group: h }, () => [
|
|
856
|
-
v("div", $t, T(h.label), 1)
|
|
857
|
-
]),
|
|
858
|
-
(p(!0), m(z, null, Q(h.items, (I, U) => (p(), m("div", {
|
|
859
|
-
key: I.id,
|
|
860
|
-
id: "g-search-option-" + I.id,
|
|
861
|
-
class: S(["g-search-option", { "g-search-option-active": i.value[o.value] && i.value[o.value].id === I.id }]),
|
|
862
|
-
role: "option",
|
|
863
|
-
onMousedown: Z((Y) => y(I), ["prevent"]),
|
|
864
|
-
"aria-selected": i.value[o.value] && i.value[o.value].id === I.id
|
|
865
|
-
}, [
|
|
866
|
-
M(c.$slots, "option", { option: I }, () => [
|
|
867
|
-
H(T(I.title), 1)
|
|
868
|
-
])
|
|
869
|
-
], 42, xt))), 128))
|
|
870
|
-
], 8, wt))), 128)) : r.value > 0 ? (p(!0), m(z, { key: 1 }, Q(i.value, (h, L) => (p(), m("div", {
|
|
871
|
-
key: h.id,
|
|
872
|
-
id: "g-search-option-" + h.id,
|
|
873
|
-
class: S(["g-search-option", { "g-search-option-active": o.value === L }]),
|
|
874
|
-
role: "option",
|
|
875
|
-
onMousedown: Z((I) => y(h), ["prevent"]),
|
|
876
|
-
"aria-selected": o.value === L
|
|
877
|
-
}, [
|
|
878
|
-
M(c.$slots, "option", { option: h }, () => [
|
|
879
|
-
H(T(h.title), 1)
|
|
880
|
-
])
|
|
881
|
-
], 42, Vt))), 128)) : O("", !0)
|
|
882
|
-
], 512)) : O("", !0)
|
|
883
|
-
], 8, bt));
|
|
884
|
-
}
|
|
885
|
-
}), Bt = {
|
|
886
|
-
class: /* @__PURE__ */ S({
|
|
887
|
-
"g-app-header": !0
|
|
888
|
-
})
|
|
889
|
-
}, It = { class: "g-app-header__brand" }, Dt = { class: "g-app-header__title" }, Tt = { class: "g-app-header__app-controls-wrap" }, Gt = /* @__PURE__ */ E({
|
|
890
|
-
__name: "GAppHeader",
|
|
891
|
-
setup(a) {
|
|
892
|
-
return (n, e) => {
|
|
893
|
-
const u = Ce("router-link");
|
|
894
|
-
return p(), m("header", Bt, [
|
|
895
|
-
e[1] || (e[1] = v("div", { class: "g-app-header__background" }, [
|
|
896
|
-
v("div", { class: "g-app-header__background-pattern" }),
|
|
897
|
-
v("div", { class: "g-app-header__background-gradient" })
|
|
898
|
-
], -1)),
|
|
899
|
-
v("div", It, [
|
|
900
|
-
R(u, { to: "/" }, {
|
|
901
|
-
default: X(() => [...e[0] || (e[0] = [
|
|
902
|
-
v("em", null, "GRAD", -1)
|
|
903
|
-
])]),
|
|
904
|
-
_: 1
|
|
905
|
-
})
|
|
906
|
-
]),
|
|
907
|
-
e[2] || (e[2] = v("div", { class: "g-app-header__block-i-container" }, [
|
|
908
|
-
v("svg", {
|
|
909
|
-
class: "g-app-header__block-i",
|
|
910
|
-
role: "img",
|
|
911
|
-
width: "55",
|
|
912
|
-
viewBox: "0 0 55 79",
|
|
913
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
914
|
-
}, [
|
|
915
|
-
v("title", null, "Block I logo"),
|
|
916
|
-
v("path", {
|
|
917
|
-
class: "g-app-header__block-i-outline",
|
|
918
|
-
d: "M54.2 21.1V0H0v21.1h12v36.1H0v21.1h54.2V57.2h-12V21.1z"
|
|
919
|
-
}),
|
|
920
|
-
v("path", {
|
|
921
|
-
class: "g-app-header__block-i-fill",
|
|
922
|
-
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"
|
|
923
|
-
})
|
|
924
|
-
])
|
|
925
|
-
], -1)),
|
|
926
|
-
v("div", Dt, [
|
|
927
|
-
M(n.$slots, "title", {}, void 0, !0)
|
|
928
|
-
]),
|
|
929
|
-
e[3] || (e[3] = v("div", { id: "header-title" }, null, -1)),
|
|
930
|
-
v("div", Tt, [
|
|
931
|
-
M(n.$slots, "app-controls", { class: "g-app-header__app-controls" }, void 0, !0)
|
|
932
|
-
])
|
|
933
|
-
]);
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
}), St = /* @__PURE__ */ W(Gt, [["__scopeId", "data-v-d6761670"]]), Pt = {
|
|
937
|
-
install(a) {
|
|
938
|
-
a.component("GAppHeader", St), a.component("GButton", oe), a.component("GTextInput", Le), a.component("GPopover", Fe), a.component("GSelectButton", Qe), a.component("GProgress", Re), a.component("GAlertDialog", st), a.component("GSelect", mt), a.component("GSearch", Ct);
|
|
939
|
-
}
|
|
940
|
-
};
|
|
118
|
+
return t;
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
filters: e,
|
|
122
|
+
isFiltered: c,
|
|
123
|
+
clearFilters: u,
|
|
124
|
+
filteredColumns: a
|
|
125
|
+
};
|
|
126
|
+
}
|
|
941
127
|
export {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
128
|
+
w as GAlertDialog,
|
|
129
|
+
j as GAppHeader,
|
|
130
|
+
k as GButton,
|
|
131
|
+
C as GClipboard,
|
|
132
|
+
F as GDetailList,
|
|
133
|
+
D as GDetailListItem,
|
|
134
|
+
V as GHamburgerMenu,
|
|
135
|
+
H as GHistoryScroller,
|
|
136
|
+
W as GModal,
|
|
137
|
+
$ as GOverlay,
|
|
138
|
+
q as GPopover,
|
|
139
|
+
N as GProgress,
|
|
140
|
+
R as GSearch,
|
|
141
|
+
Q as GSelect,
|
|
142
|
+
_ as GSelectButton,
|
|
143
|
+
U as GSidebar,
|
|
144
|
+
Y as GSidebarMenu,
|
|
145
|
+
z as GTable,
|
|
146
|
+
J as GTableBody,
|
|
147
|
+
K as GTablePagination,
|
|
148
|
+
X as GTextInput,
|
|
149
|
+
Z as GThreeWayToggle,
|
|
150
|
+
ee as VGtooltip,
|
|
151
|
+
te as calculatePopoverPosition,
|
|
152
|
+
I as filtersToQueryParams,
|
|
153
|
+
L as useActiveLinkContent,
|
|
154
|
+
M as useFiltering,
|
|
155
|
+
se as useOverlayEscape,
|
|
156
|
+
ne as useOverlayFocus,
|
|
157
|
+
oe as useOverlayStack,
|
|
158
|
+
re as useOverlayStackState,
|
|
159
|
+
x as useSidebar
|
|
957
160
|
};
|
|
958
161
|
//# sourceMappingURL=grad-vue.js.map
|