@illinois-grad/grad-vue 2.4.2 → 2.5.1
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/custom-elements.json +2349 -0
- package/dist/components/GButton.vue.d.ts +10 -1
- package/dist/components/GCurrencyInput.vue.d.ts +15 -2
- package/dist/components/GDateInput.vue.d.ts +15 -2
- package/dist/components/GDateRangeInput.vue.d.ts +14 -1
- package/dist/components/GEmailInput.vue.d.ts +2 -2
- package/dist/components/GForm.vue.d.ts +15 -2
- package/dist/components/GHamburgerMenu.vue.d.ts +13 -0
- package/dist/components/GModal.vue.d.ts +1 -7
- package/dist/components/GPopover.vue.d.ts +24 -8
- package/dist/components/GProgress.vue.d.ts +1 -1
- package/dist/components/GSearch.vue.d.ts +1 -1
- package/dist/components/GSelect.vue.d.ts +14 -1
- package/dist/components/GSelectButton.vue.d.ts +14 -1
- package/dist/components/GSidebar.vue.d.ts +15 -1
- package/dist/components/GSubmitButton.vue.d.ts +15 -0
- package/dist/components/GTextInput.vue.d.ts +15 -2
- package/dist/components/GTooltip.vue.d.ts +37 -0
- package/dist/components/term/GTermSelectorControl.vue.d.ts +2 -2
- package/dist/compose/tooltipDom.d.ts +6 -0
- package/dist/compose/useCustomElementAttrs.d.ts +14 -0
- package/dist/compose/useFormField.d.ts +4 -0
- package/dist/compose/useOverlayFocus.d.ts +1 -1
- package/dist/compose/useWebComponentForm.d.ts +2 -0
- package/dist/compose/useWebComponentSidebar.d.ts +9 -0
- package/dist/grad-vue-V6VDJQTJ.js +3478 -0
- package/dist/grad-vue-V6VDJQTJ.js.map +1 -0
- package/dist/grad-vue-elements.css +2 -0
- package/dist/grad-vue-elements.d.ts +179 -0
- package/dist/grad-vue-elements.js +8063 -0
- package/dist/grad-vue-elements.js.map +1 -0
- package/dist/grad-vue.css +2 -1
- package/dist/grad-vue.d.ts +4 -1
- package/dist/grad-vue.js +2 -240
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.js +9 -12
- package/dist/plugin.js.map +1 -1
- package/package.json +15 -3
- package/dist/grad-vue.js.map +0 -1
- package/dist/main-D8BC78tE.js +0 -3394
- package/dist/main-D8BC78tE.js.map +0 -1
package/dist/grad-vue.js
CHANGED
|
@@ -1,240 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ref as V, useId as O, onMounted as A, watch as F, onBeforeUnmount as R, shallowReactive as S, computed as w } from "vue";
|
|
4
|
-
function N(r, i, o) {
|
|
5
|
-
const h = [0, 0.25, 0.5, 0.75, 1], f = `${-i}px 0px 0px 0px`, l = /* @__PURE__ */ new Map(), a = V(
|
|
6
|
-
Array.from(T(r)?.children || [])
|
|
7
|
-
);
|
|
8
|
-
x(
|
|
9
|
-
r,
|
|
10
|
-
() => {
|
|
11
|
-
a.value = Array.from(
|
|
12
|
-
T(r)?.children || []
|
|
13
|
-
);
|
|
14
|
-
},
|
|
15
|
-
{ childList: !0 }
|
|
16
|
-
);
|
|
17
|
-
const { stop: m } = L(
|
|
18
|
-
a,
|
|
19
|
-
(d) => {
|
|
20
|
-
const v = a.value[a.value.length - 1];
|
|
21
|
-
for (const u of d)
|
|
22
|
-
l.set(
|
|
23
|
-
u.target,
|
|
24
|
-
u.isIntersecting ? Math.ceil(100 * u.intersectionRatio) / 100 : 0
|
|
25
|
-
), u.target === v && u.intersectionRatio === 1 && l.set(u.target, Number.POSITIVE_INFINITY);
|
|
26
|
-
let p = null, E = 0;
|
|
27
|
-
for (const u of l.keys()) {
|
|
28
|
-
const G = l.get(u) || 0;
|
|
29
|
-
G <= E || (u.getBoundingClientRect(), p = u, E = G);
|
|
30
|
-
}
|
|
31
|
-
p instanceof HTMLElement ? o.value = p.id : o.value = "";
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
threshold: h,
|
|
35
|
-
root: null,
|
|
36
|
-
rootMargin: f,
|
|
37
|
-
immediate: !0
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
return { stop: m };
|
|
41
|
-
}
|
|
42
|
-
function Q(r = "(max-width: 800px)") {
|
|
43
|
-
const i = O(), o = V(!1), h = B(r, {
|
|
44
|
-
ssrWidth: 1e3
|
|
45
|
-
});
|
|
46
|
-
function f(a) {
|
|
47
|
-
if (!h.value || !o.value)
|
|
48
|
-
return;
|
|
49
|
-
const m = a.target, d = document.getElementById(`${i}-sidebar`);
|
|
50
|
-
d && (d.contains(m) || setTimeout(() => {
|
|
51
|
-
o.value = !1;
|
|
52
|
-
}, 5));
|
|
53
|
-
}
|
|
54
|
-
function l(a) {
|
|
55
|
-
if (!h.value || !o.value)
|
|
56
|
-
return;
|
|
57
|
-
const m = a.target, d = document.getElementById(`${i}-sidebar`), v = document.getElementById(`${i}-hamburger`);
|
|
58
|
-
d && (d.contains(m) || v?.contains(m) || setTimeout(() => {
|
|
59
|
-
o.value = !1;
|
|
60
|
-
}, 5));
|
|
61
|
-
}
|
|
62
|
-
return A(() => {
|
|
63
|
-
F(
|
|
64
|
-
h,
|
|
65
|
-
(a) => {
|
|
66
|
-
a ? (document.addEventListener("mousedown", f), document.addEventListener("focusin", l)) : (document.removeEventListener("mousedown", f), document.removeEventListener("focusin", l));
|
|
67
|
-
},
|
|
68
|
-
{ immediate: !0 }
|
|
69
|
-
);
|
|
70
|
-
}), R(() => {
|
|
71
|
-
document.removeEventListener("mousedown", f), document.removeEventListener("focusin", l);
|
|
72
|
-
}), {
|
|
73
|
-
id: i,
|
|
74
|
-
open: o,
|
|
75
|
-
isCollapsible: h,
|
|
76
|
-
toggle: () => o.value = !o.value
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function $() {
|
|
80
|
-
const r = S(/* @__PURE__ */ new Map()), i = D(), o = (e) => {
|
|
81
|
-
const n = e.column.key, t = e.row.key, s = e.value, c = e.previousValue;
|
|
82
|
-
r.has(t) || r.set(
|
|
83
|
-
t,
|
|
84
|
-
S(/* @__PURE__ */ new Map())
|
|
85
|
-
);
|
|
86
|
-
const g = r.get(
|
|
87
|
-
t
|
|
88
|
-
), C = g.get(n), y = C ? C.previousValue : c, M = C?.error;
|
|
89
|
-
if (s === y)
|
|
90
|
-
g.delete(n), g.size === 0 && r.delete(t), i.trigger({
|
|
91
|
-
rowKey: t,
|
|
92
|
-
columnKey: n,
|
|
93
|
-
row: e.row,
|
|
94
|
-
previousValue: y,
|
|
95
|
-
newValue: null
|
|
96
|
-
});
|
|
97
|
-
else {
|
|
98
|
-
const b = {
|
|
99
|
-
rowKey: t,
|
|
100
|
-
columnKey: n,
|
|
101
|
-
row: e.row,
|
|
102
|
-
previousValue: y,
|
|
103
|
-
newValue: s
|
|
104
|
-
};
|
|
105
|
-
M !== void 0 && (b.error = M), g.set(n, b), i.trigger(b);
|
|
106
|
-
}
|
|
107
|
-
}, h = w(() => {
|
|
108
|
-
const e = [];
|
|
109
|
-
return r.forEach((n) => {
|
|
110
|
-
n.forEach((t) => {
|
|
111
|
-
e.push({ ...t });
|
|
112
|
-
});
|
|
113
|
-
}), e;
|
|
114
|
-
}), f = () => {
|
|
115
|
-
const e = /* @__PURE__ */ new Map();
|
|
116
|
-
return r.forEach((n, t) => {
|
|
117
|
-
const s = { key: t };
|
|
118
|
-
n.forEach((c, g) => {
|
|
119
|
-
s[g] = c.newValue;
|
|
120
|
-
}), e.set(t, s);
|
|
121
|
-
}), e;
|
|
122
|
-
}, l = w(() => r.size > 0), a = (e, n) => {
|
|
123
|
-
const t = r.get(e);
|
|
124
|
-
return t ? t.has(n) : !1;
|
|
125
|
-
}, m = (e, n) => {
|
|
126
|
-
const t = r.get(e);
|
|
127
|
-
return t ? t.get(n)?.newValue : void 0;
|
|
128
|
-
}, d = () => {
|
|
129
|
-
r.clear();
|
|
130
|
-
}, v = (e) => {
|
|
131
|
-
r.delete(e);
|
|
132
|
-
}, p = (e) => e.map((n) => {
|
|
133
|
-
const t = r.get(n.key);
|
|
134
|
-
if (!t || t.size === 0)
|
|
135
|
-
return n;
|
|
136
|
-
const s = { ...n };
|
|
137
|
-
return t.forEach((c, g) => {
|
|
138
|
-
s[g] = c.newValue;
|
|
139
|
-
}), s;
|
|
140
|
-
}), E = w(() => {
|
|
141
|
-
let e = 0;
|
|
142
|
-
return r.forEach((n) => {
|
|
143
|
-
e += n.size;
|
|
144
|
-
}), e;
|
|
145
|
-
}), u = w(
|
|
146
|
-
() => h.value.some(
|
|
147
|
-
(e) => e.error !== void 0 && e.error !== ""
|
|
148
|
-
)
|
|
149
|
-
), G = (e, n, t) => {
|
|
150
|
-
const s = r.get(e);
|
|
151
|
-
if (!s) return;
|
|
152
|
-
const c = s.get(n);
|
|
153
|
-
if (!c) return;
|
|
154
|
-
const g = { ...c, error: t };
|
|
155
|
-
s.set(n, g);
|
|
156
|
-
}, k = (e, n) => {
|
|
157
|
-
const t = r.get(e);
|
|
158
|
-
if (!t) return;
|
|
159
|
-
const s = t.get(n);
|
|
160
|
-
if (!s) return;
|
|
161
|
-
const c = { ...s };
|
|
162
|
-
delete c.error, t.set(n, c);
|
|
163
|
-
}, I = (e, n) => {
|
|
164
|
-
const t = r.get(e);
|
|
165
|
-
return t ? t.get(n)?.error : void 0;
|
|
166
|
-
};
|
|
167
|
-
return {
|
|
168
|
-
trackChange: o,
|
|
169
|
-
changes: h,
|
|
170
|
-
getChangesByRow: f,
|
|
171
|
-
hasChanges: l,
|
|
172
|
-
hasChange: a,
|
|
173
|
-
getChange: m,
|
|
174
|
-
clearChanges: d,
|
|
175
|
-
clearRowChanges: v,
|
|
176
|
-
applyChangesToData: p,
|
|
177
|
-
changeCount: E,
|
|
178
|
-
hasErrors: u,
|
|
179
|
-
setError: G,
|
|
180
|
-
clearError: k,
|
|
181
|
-
getError: I,
|
|
182
|
-
hasError: (e, n) => {
|
|
183
|
-
const t = I(e, n);
|
|
184
|
-
return t !== void 0 && t !== "";
|
|
185
|
-
},
|
|
186
|
-
onChange: i.on
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
export {
|
|
190
|
-
W as GAlertDialog,
|
|
191
|
-
_ as GAppHeader,
|
|
192
|
-
j as GButton,
|
|
193
|
-
q as GClipboard,
|
|
194
|
-
J as GCurrencyInput,
|
|
195
|
-
Y as GDateInput,
|
|
196
|
-
X as GDateRangeInput,
|
|
197
|
-
Z as GDetailList,
|
|
198
|
-
ee as GDetailListItem,
|
|
199
|
-
te as GEmailInput,
|
|
200
|
-
ne as GForm,
|
|
201
|
-
re as GHamburgerMenu,
|
|
202
|
-
se as GHistoryScroller,
|
|
203
|
-
oe as GModal,
|
|
204
|
-
ae as GOverlay,
|
|
205
|
-
ue as GPopover,
|
|
206
|
-
ce as GProgress,
|
|
207
|
-
ie as GSearch,
|
|
208
|
-
le as GSelect,
|
|
209
|
-
ge as GSelectButton,
|
|
210
|
-
he as GSidebar,
|
|
211
|
-
de as GSidebarMenu,
|
|
212
|
-
me as GSubmitButton,
|
|
213
|
-
fe as GTable,
|
|
214
|
-
ve as GTableBody,
|
|
215
|
-
pe as GTablePagination,
|
|
216
|
-
Ee as GTermSelector,
|
|
217
|
-
Ge as GTermSelectorControl,
|
|
218
|
-
we as GTextInput,
|
|
219
|
-
Ce as GThreeWayToggle,
|
|
220
|
-
ye as GTreeMenu,
|
|
221
|
-
be as GUserMenu,
|
|
222
|
-
Ie as VGtooltip,
|
|
223
|
-
Me as asArray,
|
|
224
|
-
Te as calculatePopoverPosition,
|
|
225
|
-
Se as emptyAsUndefined,
|
|
226
|
-
Ve as filterAsQuery,
|
|
227
|
-
ke as filterOmitEmpty,
|
|
228
|
-
xe as filtersToQueryParams,
|
|
229
|
-
N as useActiveLinkContent,
|
|
230
|
-
Le as useFiltering,
|
|
231
|
-
Be as useForm,
|
|
232
|
-
De as useFormField,
|
|
233
|
-
Oe as useOverlayEscape,
|
|
234
|
-
Ae as useOverlayFocus,
|
|
235
|
-
Fe as useOverlayStack,
|
|
236
|
-
Re as useOverlayStackState,
|
|
237
|
-
Q as useSidebar,
|
|
238
|
-
$ as useTableChanges
|
|
239
|
-
};
|
|
240
|
-
//# sourceMappingURL=grad-vue.js.map
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, Q as g, R as _, S as v, T as y, U as b, V as x, W as S, X as C, Y as w, Z as T, _ as E, a as D, b as O, c as k, d as A, f as j, g as M, h as N, i as P, j as F, k as I, l as L, m as R, n as z, o as B, p as V, q as H, r as U, s as W, t as G, u as K, v as q, w as J, x as Y, y as X, z as Z } from "./grad-vue-V6VDJQTJ.js";
|
|
2
|
+
export { d as GAlertDialog, h as GAppHeader, g as GButton, I as GClipboard, L as GCurrencyInput, W as GDateInput, B as GDateRangeInput, N as GDetailList, R as GDetailListItem, k as GEmailInput, D as GForm, M as GHamburgerMenu, m as GHistoryScroller, E as GModal, V as GOverlay, x as GPopover, _ as GProgress, a as GSearch, c as GSelect, Z as GSelectButton, f as GSidebar, F as GSidebarMenu, P as GSubmitButton, X as GTable, i as GTableBody, q as GTablePagination, A as GTermSelector, j as GTermSelectorControl, H as GTextInput, r as GThreeWayToggle, t as GTooltip, T as GTreeMenu, K as GUserMenu, e as VGtooltip, O as asArray, s as calculatePopoverPosition, Y as emptyAsUndefined, v as filterAsQuery, n as filterOmitEmpty, J as filtersToQueryParams, U as useActiveLinkContent, y as useFiltering, C as useForm, l as useFormField, b as useOverlayEscape, S as useOverlayFocus, o as useOverlayStack, u as useOverlayStackState, z as useSidebar, G as useTableChanges, w as useWebComponentForm, p as useWebComponentSidebar };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { App } from "vue";
|
|
2
|
-
import { GAlertDialog, GAppHeader, GButton, GClipboard, GDetailList, GDetailListItem, GHamburgerMenu, GHistoryScroller, GModal, GOverlay, GPopover, GProgress, GSearch, GSelect, GSelectButton, GSidebar, GSidebarMenu, GTable, GTableBody, GTablePagination, GTextInput, GThreeWayToggle, GTreeMenu, GForm, GSubmitButton, VGtooltipDirective } from "./grad-vue.ts";
|
|
2
|
+
import { GAlertDialog, GAppHeader, GButton, GClipboard, GDetailList, GDetailListItem, GHamburgerMenu, GHistoryScroller, GModal, GOverlay, GPopover, GTooltip, GProgress, GSearch, GSelect, GSelectButton, GSidebar, GSidebarMenu, GTable, GTableBody, GTablePagination, GTextInput, GThreeWayToggle, GTreeMenu, GForm, GSubmitButton, VGtooltipDirective } from "./grad-vue.ts";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
install(app: App): void;
|
|
5
5
|
};
|
|
@@ -10,6 +10,7 @@ declare module "vue" {
|
|
|
10
10
|
GButton: typeof GButton;
|
|
11
11
|
GTextInput: typeof GTextInput;
|
|
12
12
|
GPopover: typeof GPopover;
|
|
13
|
+
GTooltip: typeof GTooltip;
|
|
13
14
|
GSelectButton: typeof GSelectButton;
|
|
14
15
|
GProgress: typeof GProgress;
|
|
15
16
|
GAlertDialog: typeof GAlertDialog;
|
package/dist/plugin.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
U as default
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=plugin.js.map
|
|
1
|
+
import { A as e, B as t, D as n, E as r, F as i, I as a, L as o, M as s, O as c, P as l, Q as u, R as d, V as f, Z as p, _ as m, a as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, o as E, p as D, q as O, s as k, u as A, v as j, y as M, z as N } from "./grad-vue-V6VDJQTJ.js";
|
|
2
|
+
//#region src/plugin.ts
|
|
3
|
+
var P = { install(P) {
|
|
4
|
+
P.directive("gtooltip", e), P.component("GAppHeader", l), P.component("GButton", u), P.component("GTextInput", O), P.component("GPopover", f), P.component("GTooltip", t), P.component("GSelectButton", N), P.component("GProgress", d), P.component("GAlertDialog", o), P.component("GSelect", a), P.component("GSearch", i), P.component("GSidebar", s), P.component("GSidebarMenu", S), P.component("GClipboard", C), P.component("GHistoryScroller", c), P.component("GThreeWayToggle", n), P.component("GTable", M), P.component("GTableBody", r), P.component("GTablePagination", j), P.component("GModal", m), P.component("GOverlay", D), P.component("GHamburgerMenu", y), P.component("GDetailList", b), P.component("GDetailListItem", T), P.component("GTermSelector", _), P.component("GTermSelectorControl", v), P.component("GTreeMenu", p), P.component("GUserMenu", A), P.component("GCurrencyInput", w), P.component("GEmailInput", g), P.component("GDateInput", k), P.component("GDateRangeInput", E), P.component("GForm", h), P.component("GSubmitButton", x);
|
|
5
|
+
} };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { P as default };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["../src/plugin.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport {\n GAlertDialog,\n GAppHeader,\n GButton,\n GClipboard,\n GDetailList,\n GDetailListItem,\n GHamburgerMenu,\n GHistoryScroller,\n GModal,\n GOverlay,\n GPopover,\n GProgress,\n GSearch,\n GSelect,\n GSelectButton,\n GSidebar,\n GSidebarMenu,\n GTable,\n GTableBody,\n GTablePagination,\n GTextInput,\n GThreeWayToggle,\n GTermSelector,\n GTermSelectorControl,\n GTreeMenu,\n GUserMenu,\n GCurrencyInput,\n GEmailInput,\n GDateInput,\n GDateRangeInput,\n GForm,\n GSubmitButton,\n VGtooltip,\n VGtooltipDirective,\n} from \"./grad-vue.ts\";\n\n// Export a plugin for installing all components\nexport default {\n install(app: App) {\n app.directive(\"gtooltip\", VGtooltip);\n app.component(\"GAppHeader\", GAppHeader);\n app.component(\"GButton\", GButton);\n app.component(\"GTextInput\", GTextInput);\n app.component(\"GPopover\", GPopover);\n app.component(\"GSelectButton\", GSelectButton);\n app.component(\"GProgress\", GProgress);\n app.component(\"GAlertDialog\", GAlertDialog);\n app.component(\"GSelect\", GSelect);\n app.component(\"GSearch\", GSearch);\n app.component(\"GSidebar\", GSidebar);\n app.component(\"GSidebarMenu\", GSidebarMenu);\n app.component(\"GClipboard\", GClipboard);\n app.component(\"GHistoryScroller\", GHistoryScroller);\n app.component(\"GThreeWayToggle\", GThreeWayToggle);\n app.component(\"GTable\", GTable);\n app.component(\"GTableBody\", GTableBody);\n app.component(\"GTablePagination\", GTablePagination);\n app.component(\"GModal\", GModal);\n app.component(\"GOverlay\", GOverlay);\n app.component(\"GHamburgerMenu\", GHamburgerMenu);\n app.component(\"GDetailList\", GDetailList);\n app.component(\"GDetailListItem\", GDetailListItem);\n app.component(\"GTermSelector\", GTermSelector);\n app.component(\"GTermSelectorControl\", GTermSelectorControl);\n app.component(\"GTreeMenu\", GTreeMenu);\n app.component(\"GUserMenu\", GUserMenu);\n app.component(\"GCurrencyInput\", GCurrencyInput);\n app.component(\"GEmailInput\", GEmailInput);\n app.component(\"GDateInput\", GDateInput);\n app.component(\"GDateRangeInput\", GDateRangeInput);\n app.component(\"GForm\", GForm);\n app.component(\"GSubmitButton\", GSubmitButton);\n },\n};\n\ndeclare module \"vue\" {\n export interface GlobalComponents {\n GAppHeader: typeof GAppHeader;\n GButton: typeof GButton;\n GTextInput: typeof GTextInput;\n GPopover: typeof GPopover;\n GSelectButton: typeof GSelectButton;\n GProgress: typeof GProgress;\n GAlertDialog: typeof GAlertDialog;\n GSelect: typeof GSelect;\n GSearch: typeof GSearch;\n GSidebar: typeof GSidebar;\n GSidebarMenu: typeof GSidebarMenu;\n GClipboard: typeof GClipboard;\n GHistoryScroller: typeof GHistoryScroller;\n GThreeWayToggle: typeof GThreeWayToggle;\n GTable: typeof GTable;\n GTableBody: typeof GTableBody;\n GTablePagination: typeof GTablePagination;\n GModal: typeof GModal;\n GOverlay: typeof GOverlay;\n GHamburgerMenu: typeof GHamburgerMenu;\n GDetailList: typeof GDetailList;\n GDetailListItem: typeof GDetailListItem;\n GTreeMenu: typeof GTreeMenu;\n GForm: typeof GForm;\n GSubmitButton: typeof GSubmitButton;\n }\n\n export interface ComponentCustomProperties {\n vGtooltip: VGtooltipDirective;\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"plugin.js","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { App } from \"vue\";\nimport {\n GAlertDialog,\n GAppHeader,\n GButton,\n GClipboard,\n GDetailList,\n GDetailListItem,\n GHamburgerMenu,\n GHistoryScroller,\n GModal,\n GOverlay,\n GPopover,\n GTooltip,\n GProgress,\n GSearch,\n GSelect,\n GSelectButton,\n GSidebar,\n GSidebarMenu,\n GTable,\n GTableBody,\n GTablePagination,\n GTextInput,\n GThreeWayToggle,\n GTermSelector,\n GTermSelectorControl,\n GTreeMenu,\n GUserMenu,\n GCurrencyInput,\n GEmailInput,\n GDateInput,\n GDateRangeInput,\n GForm,\n GSubmitButton,\n VGtooltip,\n VGtooltipDirective,\n} from \"./grad-vue.ts\";\n\n// Export a plugin for installing all components\nexport default {\n install(app: App) {\n app.directive(\"gtooltip\", VGtooltip);\n app.component(\"GAppHeader\", GAppHeader);\n app.component(\"GButton\", GButton);\n app.component(\"GTextInput\", GTextInput);\n app.component(\"GPopover\", GPopover);\n app.component(\"GTooltip\", GTooltip);\n app.component(\"GSelectButton\", GSelectButton);\n app.component(\"GProgress\", GProgress);\n app.component(\"GAlertDialog\", GAlertDialog);\n app.component(\"GSelect\", GSelect);\n app.component(\"GSearch\", GSearch);\n app.component(\"GSidebar\", GSidebar);\n app.component(\"GSidebarMenu\", GSidebarMenu);\n app.component(\"GClipboard\", GClipboard);\n app.component(\"GHistoryScroller\", GHistoryScroller);\n app.component(\"GThreeWayToggle\", GThreeWayToggle);\n app.component(\"GTable\", GTable);\n app.component(\"GTableBody\", GTableBody);\n app.component(\"GTablePagination\", GTablePagination);\n app.component(\"GModal\", GModal);\n app.component(\"GOverlay\", GOverlay);\n app.component(\"GHamburgerMenu\", GHamburgerMenu);\n app.component(\"GDetailList\", GDetailList);\n app.component(\"GDetailListItem\", GDetailListItem);\n app.component(\"GTermSelector\", GTermSelector);\n app.component(\"GTermSelectorControl\", GTermSelectorControl);\n app.component(\"GTreeMenu\", GTreeMenu);\n app.component(\"GUserMenu\", GUserMenu);\n app.component(\"GCurrencyInput\", GCurrencyInput);\n app.component(\"GEmailInput\", GEmailInput);\n app.component(\"GDateInput\", GDateInput);\n app.component(\"GDateRangeInput\", GDateRangeInput);\n app.component(\"GForm\", GForm);\n app.component(\"GSubmitButton\", GSubmitButton);\n },\n};\n\ndeclare module \"vue\" {\n export interface GlobalComponents {\n GAppHeader: typeof GAppHeader;\n GButton: typeof GButton;\n GTextInput: typeof GTextInput;\n GPopover: typeof GPopover;\n GTooltip: typeof GTooltip;\n GSelectButton: typeof GSelectButton;\n GProgress: typeof GProgress;\n GAlertDialog: typeof GAlertDialog;\n GSelect: typeof GSelect;\n GSearch: typeof GSearch;\n GSidebar: typeof GSidebar;\n GSidebarMenu: typeof GSidebarMenu;\n GClipboard: typeof GClipboard;\n GHistoryScroller: typeof GHistoryScroller;\n GThreeWayToggle: typeof GThreeWayToggle;\n GTable: typeof GTable;\n GTableBody: typeof GTableBody;\n GTablePagination: typeof GTablePagination;\n GModal: typeof GModal;\n GOverlay: typeof GOverlay;\n GHamburgerMenu: typeof GHamburgerMenu;\n GDetailList: typeof GDetailList;\n GDetailListItem: typeof GDetailListItem;\n GTreeMenu: typeof GTreeMenu;\n GForm: typeof GForm;\n GSubmitButton: typeof GSubmitButton;\n }\n\n export interface ComponentCustomProperties {\n vGtooltip: VGtooltipDirective;\n }\n}\n"],"mappings":";;AAwCA,IAAA,IAAe,EACX,QAAQ,GAAU;AAkCd,CAjCA,EAAI,UAAU,YAAY,EAAU,EACpC,EAAI,UAAU,cAAc,EAAW,EACvC,EAAI,UAAU,WAAW,EAAQ,EACjC,EAAI,UAAU,cAAc,EAAW,EACvC,EAAI,UAAU,YAAY,EAAS,EACnC,EAAI,UAAU,YAAY,EAAS,EACnC,EAAI,UAAU,iBAAiB,EAAc,EAC7C,EAAI,UAAU,aAAa,EAAU,EACrC,EAAI,UAAU,gBAAgB,EAAa,EAC3C,EAAI,UAAU,WAAW,EAAQ,EACjC,EAAI,UAAU,WAAW,EAAQ,EACjC,EAAI,UAAU,YAAY,EAAS,EACnC,EAAI,UAAU,gBAAgB,EAAa,EAC3C,EAAI,UAAU,cAAc,EAAW,EACvC,EAAI,UAAU,oBAAoB,EAAiB,EACnD,EAAI,UAAU,mBAAmB,EAAgB,EACjD,EAAI,UAAU,UAAU,EAAO,EAC/B,EAAI,UAAU,cAAc,EAAW,EACvC,EAAI,UAAU,oBAAoB,EAAiB,EACnD,EAAI,UAAU,UAAU,EAAO,EAC/B,EAAI,UAAU,YAAY,EAAS,EACnC,EAAI,UAAU,kBAAkB,EAAe,EAC/C,EAAI,UAAU,eAAe,EAAY,EACzC,EAAI,UAAU,mBAAmB,EAAgB,EACjD,EAAI,UAAU,iBAAiB,EAAc,EAC7C,EAAI,UAAU,wBAAwB,EAAqB,EAC3D,EAAI,UAAU,aAAa,EAAU,EACrC,EAAI,UAAU,aAAa,EAAU,EACrC,EAAI,UAAU,kBAAkB,EAAe,EAC/C,EAAI,UAAU,eAAe,EAAY,EACzC,EAAI,UAAU,cAAc,EAAW,EACvC,EAAI,UAAU,mBAAmB,EAAgB,EACjD,EAAI,UAAU,SAAS,EAAM,EAC7B,EAAI,UAAU,iBAAiB,EAAc;GAEpD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illinois-grad/grad-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Shared Vue.js components for Graduate College apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -24,15 +24,27 @@
|
|
|
24
24
|
"./plugin": {
|
|
25
25
|
"import": "./dist/plugin.js"
|
|
26
26
|
},
|
|
27
|
+
"./grad-vue-elements": {
|
|
28
|
+
"import": "./dist/grad-vue-elements.js"
|
|
29
|
+
},
|
|
30
|
+
"./grad-vue-elements.css": {
|
|
31
|
+
"import": "./dist/grad-vue-elements.css"
|
|
32
|
+
},
|
|
27
33
|
"./grad-vue.css": {
|
|
28
34
|
"import": "./dist/grad-vue.css"
|
|
35
|
+
},
|
|
36
|
+
"./custom-elements": {
|
|
37
|
+
"types": "./dist/custom-elements.d.ts"
|
|
29
38
|
}
|
|
30
39
|
},
|
|
40
|
+
"customElements": "custom-elements.json",
|
|
31
41
|
"files": [
|
|
32
|
-
"dist"
|
|
42
|
+
"dist",
|
|
43
|
+
"custom-elements.json"
|
|
33
44
|
],
|
|
34
45
|
"scripts": {
|
|
35
|
-
"build": "vite build && vue-tsc --emitDeclarationOnly"
|
|
46
|
+
"build": "node --experimental-strip-types ../../scripts/experimental/generate-custom-element-types.ts && vite build && vite build --config vite.web-components.config.ts && vue-tsc --emitDeclarationOnly",
|
|
47
|
+
"build:elements": "vite build --config vite.web-components.config.ts"
|
|
36
48
|
},
|
|
37
49
|
"dependencies": {
|
|
38
50
|
"@vueuse/core": "^14",
|
package/dist/grad-vue.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grad-vue.js","sources":["../src/compose/useActiveLink.ts","../src/compose/useSidebar.ts","../src/compose/useTableChanges.ts"],"sourcesContent":["import { unrefElement, useIntersectionObserver, useMutationObserver } from \"@vueuse/core\";\nimport { ref, Ref } from \"vue\";\n\n/**\n * Monitor a list of elements' intersection with the viewport to update active links.\n *\n * This updates the activeLink store with the active content's ID for use in menus.\n *\n * @param element Children of this element will be observed\n * @param topOffset Offset from the top of the window to consider not visible\n * @param activeId Ref to store the active element ID\n */\nexport function useActiveLinkContent(\n element: Ref<HTMLElement | null>,\n topOffset: number,\n activeId: Ref<string>,\n) {\n const thresholds = [0, 0.25, 0.5, 0.75, 1];\n const rootMargin = `${-topOffset}px 0px 0px 0px`;\n // Track most visible section in viewport\n const visibility = new Map<Element, number>();\n\n // Get the children elements to observe\n const elements = ref<HTMLElement[]>(\n Array.from(unrefElement(element)?.children || []) as HTMLElement[],\n );\n\n // To maintain reactivity, observe for changes in child elements.\n // This works better with Nuxt's rendering than passing an array of refs.\n useMutationObserver(\n element,\n () => {\n elements.value = Array.from(\n unrefElement(element)?.children || [],\n ) as HTMLElement[];\n },\n { childList: true },\n );\n\n const { stop } = useIntersectionObserver(\n elements,\n (entries) => {\n const lastElement = elements.value[elements.value.length - 1];\n\n for (const entry of entries) {\n // Use intersection ratio as visibility score\n // Round up to 2 decimal places since it can sometimes be 0.99x\n // when jumping to it with anchor links.\n visibility.set(\n entry.target,\n entry.isIntersecting ? Math.ceil(100 * entry.intersectionRatio)/100 : 0,\n );\n if (\n entry.target === lastElement &&\n entry.intersectionRatio === 1\n ) {\n // If last element is fully visible, prioritize that\n visibility.set(entry.target, Number.POSITIVE_INFINITY);\n }\n }\n // Pick the element with highest visibility\n let bestEl: Element | null = null;\n let bestScore = 0;\n for (const el of visibility.keys()) {\n const score = visibility.get(el) || 0;\n if (score <= bestScore) {\n continue;\n }\n const rect = (el as HTMLElement).getBoundingClientRect();\n bestEl = el;\n bestScore = score;\n }\n if (bestEl instanceof HTMLElement) {\n activeId.value = bestEl.id;\n } else {\n activeId.value = \"\";\n }\n },\n {\n threshold: thresholds,\n root: null,\n rootMargin,\n immediate: true,\n },\n );\n\n return { stop };\n}\n","import { onBeforeUnmount, onMounted, Ref, ref, useId, watch } from \"vue\";\nimport { useMediaQuery } from \"@vueuse/core\";\n\n/**\n * Composable to manage sidebar state and link components together.\n *\n * @param breakpoint Media query string for when the sidebar should be collapsible\n */\nexport function useSidebar(\n breakpoint: Ref<string> | string = \"(max-width: 800px)\",\n) {\n const id = useId();\n const open = ref(false);\n const isCollapsible: Ref<boolean> = useMediaQuery(breakpoint, {\n ssrWidth: 1000\n });\n\n function onDocumentClick(e: MouseEvent) {\n if (!isCollapsible.value || !open.value) {\n return;\n }\n const target = e.target as HTMLElement;\n const sidebarEl = document.getElementById(`${id}-sidebar`);\n if (!sidebarEl) {\n return;\n }\n if (sidebarEl.contains(target)) {\n return;\n }\n // Very slight delay means if they click the menu button to close it,\n // it won't re-open\n setTimeout(() => {\n open.value = false;\n }, 5);\n }\n function onDocumentFocus(e: FocusEvent) {\n if (!isCollapsible.value || !open.value) {\n return;\n }\n const target = e.target as HTMLElement;\n const sidebarEl = document.getElementById(`${id}-sidebar`);\n const hamburgerEl = document.getElementById(`${id}-hamburger`);\n if (!sidebarEl) {\n return;\n }\n if (sidebarEl.contains(target) || hamburgerEl?.contains(target)) {\n return;\n }\n // Very slight delay means if they click the menu button to close it,\n // it won't re-open\n setTimeout(() => {\n open.value = false;\n }, 5);\n }\n\n onMounted(() => {\n watch(\n isCollapsible,\n (val) => {\n if (val) {\n document.addEventListener(\"mousedown\", onDocumentClick);\n document.addEventListener(\"focusin\", onDocumentFocus);\n } else {\n document.removeEventListener(\"mousedown\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n }\n },\n { immediate: true },\n );\n });\n\n onBeforeUnmount(() => {\n document.removeEventListener(\"mousedown\", onDocumentClick);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n });\n\n return {\n id,\n open,\n isCollapsible,\n toggle: () => (open.value = !open.value),\n };\n}\n","import { computed, ComputedRef, shallowReactive } from \"vue\";\nimport { TableColumn, TableRow } from \"../components/table/TableColumn.ts\";\nimport { createEventHook, EventHook, EventHookOn } from \"@vueuse/core\";\n\nexport type ColumnKey<R extends TableRow> = Extract<keyof R, string>;\n\n/**\n * Represents a single cell change in the table\n */\nexport interface CellChange<\n R extends TableRow = TableRow,\n K extends ColumnKey<R> = ColumnKey<R>,\n> {\n rowKey: string;\n columnKey: K;\n row: R;\n /**\n * Represents the original value before user changes.\n */\n previousValue: R[K];\n /**\n * New value from the change. This will be null in events\n * if the new value is the same as the original.\n */\n newValue: R[K];\n error?: string;\n}\n\nexport interface CellChangeEvent<\n R extends TableRow = TableRow,\n K extends ColumnKey<R> = ColumnKey<R>,\n> {\n rowKey: string;\n columnKey: K;\n row: R;\n previousValue: R[K];\n newValue: R[K] | null;\n error?: string;\n}\n\n/**\n * Payload for the `trackChange` function\n */\nexport interface CellChangePayload<\n T extends TableRow = TableRow,\n K extends ColumnKey<T> = ColumnKey<T>,\n> {\n row: T;\n column: TableColumn<T, K>;\n value: T[K];\n previousValue: T[K];\n}\n\n/**\n * Map of changes organized by row key and column key\n */\nexport type ChangeMap<T extends TableRow> = Map<\n string,\n Map<ColumnKey<T>, CellChange<T>>\n>;\n\n/**\n * Return type for the useTableChanges composable\n */\nexport interface UseTableChangesReturn<T extends TableRow> {\n /**\n * Track a change to a cell\n */\n trackChange: <K extends ColumnKey<T>>(payload: CellChangePayload<T, K>) => void;\n\n /**\n * Reactive array of all current changes\n */\n changes: ComputedRef<CellChange<T>[]>;\n\n /**\n * Get changes organized by row\n */\n getChangesByRow: () => Map<string, Partial<T>>;\n\n /**\n * Reactive flag indicating whether there are any changes\n */\n hasChanges: ComputedRef<boolean>;\n\n /**\n * Check if a specific cell has changes\n */\n hasChange: <K extends ColumnKey<T>>(rowKey: string, columnKey: K) => boolean;\n\n /**\n * Get the changed value for a specific cell, or undefined if no change\n */\n getChange: <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ) => T[K] | undefined;\n\n /**\n * Clear all tracked changes\n */\n clearChanges: () => void;\n\n /**\n * Clear changes for a specific row\n */\n clearRowChanges: (rowKey: string) => void;\n\n /**\n * Apply tracked changes to a new dataset (for merging with updated data)\n */\n applyChangesToData: (data: T[]) => T[];\n\n /**\n * Reactive count of changed cells\n */\n changeCount: ComputedRef<number>;\n\n /**\n * Reactive flag indicating whether any cell has an error\n */\n hasErrors: ComputedRef<boolean>;\n\n /**\n * Set an error message for a specific cell\n */\n setError: <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n error: string,\n ) => void;\n\n /**\n * Clear the error for a specific cell\n */\n clearError: <K extends ColumnKey<T>>(rowKey: string, columnKey: K) => void;\n\n /**\n * Get the error message for a specific cell, or undefined if no error\n */\n getError: <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ) => string | undefined;\n\n /**\n * Check if a specific cell has an error\n */\n hasError: <K extends ColumnKey<T>>(rowKey: string, columnKey: K) => boolean;\n\n /**\n * Event emitted when a cell changes.\n *\n * `newValue` will be null if the cell's value is the same as the original.\n */\n onChange: EventHookOn<CellChangeEvent<T>>;\n}\n\n/**\n * Composable for tracking changes to table data\n *\n * This composable helps manage user edits to table data by:\n * - Tracking which cells have been modified\n * - Storing both old and new values\n * - Providing methods to retrieve just the changes (not full data)\n * - Allowing changes to be applied to updated data for real-time syncing\n *\n * @example\n * ```typescript\n * const changes = useTableChanges<ProductRow>();\n *\n * // Track a change when user edits a cell\n * function handleCellChange(row, column, newValue) {\n * changes.trackChange({\n * row,\n * column,\n * value: newValue,\n * previousValue: row[column.key],\n * });\n * }\n *\n * // Get all changes to submit\n * const changedData = changes.changes.value;\n * await api.updateProducts(changedData);\n *\n * // Apply user changes to fresh data from server\n * const freshData = await api.getProducts();\n * const mergedData = changes.applyChangesToData(freshData);\n * ```\n */\nexport function useTableChanges<\n T extends TableRow,\n>(): UseTableChangesReturn<T> {\n // Store changes in a reactive map: rowKey -> columnKey -> CellChange\n const changeMap = shallowReactive<ChangeMap<T>>(new Map());\n\n const changeEvent = createEventHook<CellChangeEvent<T>>();\n\n /**\n * Track a change to a specific cell\n */\n const trackChange = <K extends ColumnKey<T>>(\n payload: CellChangePayload<T, K>,\n ) => {\n const colKey: K = payload.column.key;\n const rowKey = payload.row.key;\n const newValue: T[K] = payload.value;\n const previousValue: T[K] = payload.previousValue;\n\n if (!changeMap.has(rowKey)) {\n changeMap.set(\n rowKey,\n shallowReactive(new Map<ColumnKey<T>, CellChange<T>>()),\n );\n }\n\n const rowChanges = changeMap.get(\n rowKey,\n )!;\n\n // If there's already a change for this cell, preserve the original previousValue\n const existingChange = rowChanges.get(colKey);\n const originalpreviousValue: T[K] = (existingChange\n ? existingChange.previousValue\n : previousValue) as T[K];\n const existingError = existingChange?.error;\n\n // If the new value equals the original value, remove the change\n if (newValue === originalpreviousValue) {\n rowChanges.delete(colKey);\n // Clean up empty row maps\n if (rowChanges.size === 0) {\n changeMap.delete(rowKey);\n }\n // null newValue means the value was reverted to the original\n changeEvent.trigger({\n rowKey,\n columnKey: colKey,\n row: payload.row,\n previousValue: originalpreviousValue,\n newValue: null,\n });\n } else {\n // Store or update the change, preserving error if it exists\n const updatedChange: CellChange<T, K> = {\n rowKey,\n columnKey: colKey,\n row: payload.row,\n previousValue: originalpreviousValue,\n newValue,\n };\n\n // Preserve error if it exists\n if (existingError !== undefined) {\n updatedChange.error = existingError;\n }\n\n rowChanges.set(colKey, updatedChange);\n changeEvent.trigger(updatedChange);\n }\n };\n\n const changes = computed(() => {\n const result: CellChange<T>[] = [];\n changeMap.forEach((rowChanges) => {\n rowChanges.forEach((change) => {\n result.push({ ...change });\n });\n });\n return result;\n });\n\n /**\n * Get changes organized by row key\n * Returns a map of rowKey -> object with changed fields\n */\n const getChangesByRow = (): Map<string, Partial<T>> => {\n const result = new Map<string, Partial<T>>();\n changeMap.forEach((rowChanges, rowKey) => {\n const rowData: Partial<T> = { key: rowKey } as Partial<T>;\n rowChanges.forEach((change, columnKey) => {\n rowData[columnKey] = change.newValue;\n });\n result.set(rowKey, rowData);\n });\n return result;\n };\n\n const hasChanges = computed<boolean>(() => changeMap.size > 0);\n\n /**\n * Check if a specific cell has changes\n */\n const hasChange = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ): boolean => {\n const rowChanges = changeMap.get(rowKey);\n if (!rowChanges) return false;\n return rowChanges.has(columnKey);\n };\n\n /**\n * Get the changed value for a specific cell\n */\n const getChange = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ): T[K] | undefined => {\n const rowChanges = changeMap.get(rowKey);\n if (!rowChanges) return undefined;\n const change = rowChanges.get(columnKey);\n return change?.newValue as T[K] | undefined;\n };\n\n /**\n * Clear all tracked changes\n */\n const clearChanges = () => {\n changeMap.clear();\n };\n\n /**\n * Clear changes for a specific row\n */\n const clearRowChanges = (rowKey: string) => {\n changeMap.delete(rowKey);\n };\n\n /**\n * Apply tracked changes to a new dataset\n * This is useful when you have fresh data from the server but want to preserve user edits\n */\n const applyChangesToData = (data: T[]): T[] => {\n return data.map((row) => {\n const rowChanges = changeMap.get(row.key);\n if (!rowChanges || rowChanges.size === 0) {\n return row;\n }\n\n // Create a new object with the row data and apply changes\n const updatedRow = { ...row };\n rowChanges.forEach((change, columnKey) => {\n updatedRow[columnKey] = change.newValue;\n });\n\n return updatedRow;\n });\n };\n\n const changeCount = computed<number>(() => {\n let count = 0;\n changeMap.forEach((rowChanges) => {\n count += rowChanges.size;\n });\n return count;\n });\n\n const hasErrors = computed<boolean>(() =>\n changes.value.some(\n (change) => change.error !== undefined && change.error !== \"\",\n ),\n );\n\n /**\n * Set an error message for a specific cell\n */\n const setError = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n error: string,\n ) => {\n const rowChanges = changeMap.get(rowKey);\n if (!rowChanges) return;\n\n const change = rowChanges.get(columnKey);\n if (!change) return;\n\n // With shallowReactive(Map), mutating nested objects won't trigger updates.\n // Replace the map entry so Vue can observe the change.\n const updatedChange: CellChange<T> = { ...change, error };\n rowChanges.set(columnKey, updatedChange);\n };\n\n /**\n * Clear the error for a specific cell\n */\n const clearError = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ) => {\n const rowChanges = changeMap.get(rowKey);\n if (!rowChanges) return;\n\n const change = rowChanges.get(columnKey);\n if (!change) return;\n\n // Replace the map entry so Vue can observe the change.\n const updatedChange: CellChange<T> = { ...change };\n delete updatedChange.error;\n rowChanges.set(columnKey, updatedChange);\n };\n\n /**\n * Get the error message for a specific cell\n */\n const getError = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ): string | undefined => {\n const rowChanges = changeMap.get(rowKey);\n if (!rowChanges) return undefined;\n\n const change = rowChanges.get(columnKey);\n return change?.error;\n };\n\n /**\n * Check if a specific cell has an error\n */\n const hasError = <K extends ColumnKey<T>>(\n rowKey: string,\n columnKey: K,\n ): boolean => {\n const error = getError(rowKey, columnKey);\n return error !== undefined && error !== \"\";\n };\n\n return {\n trackChange,\n changes,\n getChangesByRow,\n hasChanges,\n hasChange,\n getChange,\n clearChanges,\n clearRowChanges,\n applyChangesToData,\n changeCount,\n hasErrors,\n setError,\n clearError,\n getError,\n hasError,\n onChange: changeEvent.on,\n };\n}\n"],"names":["useActiveLinkContent","element","topOffset","activeId","thresholds","rootMargin","visibility","elements","ref","unrefElement","useMutationObserver","stop","useIntersectionObserver","entries","lastElement","entry","bestEl","bestScore","el","score","useSidebar","breakpoint","id","useId","open","isCollapsible","useMediaQuery","onDocumentClick","e","target","sidebarEl","onDocumentFocus","hamburgerEl","onMounted","watch","val","onBeforeUnmount","useTableChanges","changeMap","shallowReactive","changeEvent","createEventHook","trackChange","payload","colKey","rowKey","newValue","previousValue","rowChanges","existingChange","originalpreviousValue","existingError","updatedChange","changes","computed","result","change","getChangesByRow","rowData","columnKey","hasChanges","hasChange","getChange","clearChanges","clearRowChanges","applyChangesToData","data","row","updatedRow","changeCount","count","hasErrors","setError","error","clearError","getError"],"mappings":";;;AAYO,SAASA,EACZC,GACAC,GACAC,GACF;AACE,QAAMC,IAAa,CAAC,GAAG,MAAM,KAAK,MAAM,CAAC,GACnCC,IAAa,GAAG,CAACH,CAAS,kBAE1BI,wBAAiB,IAAA,GAGjBC,IAAWC;AAAA,IACb,MAAM,KAAKC,EAAaR,CAAO,GAAG,YAAY,CAAA,CAAE;AAAA,EAAA;AAKpD,EAAAS;AAAA,IACIT;AAAA,IACA,MAAM;AACF,MAAAM,EAAS,QAAQ,MAAM;AAAA,QACnBE,EAAaR,CAAO,GAAG,YAAY,CAAA;AAAA,MAAC;AAAA,IAE5C;AAAA,IACA,EAAE,WAAW,GAAA;AAAA,EAAK;AAGtB,QAAM,EAAE,MAAAU,MAASC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