@illinois-grad/grad-vue 6.0.5 → 6.0.6
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 +65 -0
- package/dist/components/GToggle.vue.d.ts +71 -0
- package/dist/{grad-vue-Dfq5ZPeu.js → grad-vue-HOjq8hB5.js} +94 -29
- package/dist/{grad-vue-Dfq5ZPeu.js.map → grad-vue-HOjq8hB5.js.map} +1 -1
- package/dist/grad-vue-elements.css +32 -31
- package/dist/grad-vue-elements.d.ts +3 -0
- package/dist/grad-vue-elements.js +446 -380
- package/dist/grad-vue-elements.js.map +1 -1
- package/dist/grad-vue.css +1 -1
- package/dist/grad-vue.d.ts +2 -1
- package/dist/grad-vue.js +2 -2
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.js +4 -4
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -2936,6 +2936,71 @@
|
|
|
2936
2936
|
}
|
|
2937
2937
|
]
|
|
2938
2938
|
},
|
|
2939
|
+
{
|
|
2940
|
+
"kind": "javascript-module",
|
|
2941
|
+
"path": "dist/web-components.js",
|
|
2942
|
+
"declarations": [
|
|
2943
|
+
{
|
|
2944
|
+
"kind": "custom-element",
|
|
2945
|
+
"name": "GToggleElement",
|
|
2946
|
+
"tagName": "g-toggle",
|
|
2947
|
+
"members": [
|
|
2948
|
+
{
|
|
2949
|
+
"kind": "field",
|
|
2950
|
+
"name": "label",
|
|
2951
|
+
"type": {
|
|
2952
|
+
"text": "string"
|
|
2953
|
+
},
|
|
2954
|
+
"optional": false,
|
|
2955
|
+
"description": "Accessible label"
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
"kind": "field",
|
|
2959
|
+
"name": "describedby",
|
|
2960
|
+
"type": {
|
|
2961
|
+
"text": "string"
|
|
2962
|
+
},
|
|
2963
|
+
"optional": true,
|
|
2964
|
+
"description": "ID of an element that describes the input"
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
"kind": "field",
|
|
2968
|
+
"name": "error",
|
|
2969
|
+
"type": {
|
|
2970
|
+
"text": "string"
|
|
2971
|
+
},
|
|
2972
|
+
"optional": true,
|
|
2973
|
+
"description": "Error message"
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
"kind": "field",
|
|
2977
|
+
"name": "disabled",
|
|
2978
|
+
"type": {
|
|
2979
|
+
"text": "boolean"
|
|
2980
|
+
},
|
|
2981
|
+
"optional": true,
|
|
2982
|
+
"description": "Disabled"
|
|
2983
|
+
},
|
|
2984
|
+
{
|
|
2985
|
+
"kind": "field",
|
|
2986
|
+
"name": "modelValue",
|
|
2987
|
+
"type": {
|
|
2988
|
+
"text": "boolean"
|
|
2989
|
+
},
|
|
2990
|
+
"optional": true
|
|
2991
|
+
}
|
|
2992
|
+
],
|
|
2993
|
+
"events": [
|
|
2994
|
+
{
|
|
2995
|
+
"name": "change",
|
|
2996
|
+
"type": {
|
|
2997
|
+
"text": "CustomEvent"
|
|
2998
|
+
}
|
|
2999
|
+
}
|
|
3000
|
+
]
|
|
3001
|
+
}
|
|
3002
|
+
]
|
|
3003
|
+
},
|
|
2939
3004
|
{
|
|
2940
3005
|
"kind": "javascript-module",
|
|
2941
3006
|
"path": "dist/web-components.js",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compact two-state toggle for boolean values.
|
|
3
|
+
*
|
|
4
|
+
* Arrow keys and the 'y' and 'n' keys can be used to set the value when the
|
|
5
|
+
* toggle has focus. A `describedby` prop can be passed with an ID to an
|
|
6
|
+
* element to be used as the `aria-describedby` for the toggle group.
|
|
7
|
+
*
|
|
8
|
+
* When the value changes, `v-model` is updated. A `change` event is also
|
|
9
|
+
* emitted if the value changed from user interaction.
|
|
10
|
+
*
|
|
11
|
+
* Slots:
|
|
12
|
+
* - `label`: Custom label content. Defaults to `label` prop if not provided.
|
|
13
|
+
*/
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
17
|
+
/**
|
|
18
|
+
* Accessible label
|
|
19
|
+
* @demo Toggle
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
/**
|
|
23
|
+
* ID of an element that describes the input
|
|
24
|
+
*/
|
|
25
|
+
describedby?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Error message
|
|
28
|
+
* @demo
|
|
29
|
+
*/
|
|
30
|
+
error?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Disabled
|
|
33
|
+
* @demo
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
} & {
|
|
37
|
+
modelValue?: boolean;
|
|
38
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:modelValue": (value: boolean) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
41
|
+
/**
|
|
42
|
+
* Accessible label
|
|
43
|
+
* @demo Toggle
|
|
44
|
+
*/
|
|
45
|
+
label: string;
|
|
46
|
+
/**
|
|
47
|
+
* ID of an element that describes the input
|
|
48
|
+
*/
|
|
49
|
+
describedby?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Error message
|
|
52
|
+
* @demo
|
|
53
|
+
*/
|
|
54
|
+
error?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Disabled
|
|
57
|
+
* @demo
|
|
58
|
+
*/
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
} & {
|
|
61
|
+
modelValue?: boolean;
|
|
62
|
+
}> & Readonly<{
|
|
63
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
64
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
65
|
+
label?: (props: {}) => any;
|
|
66
|
+
}>;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -4915,10 +4915,75 @@ var xi = { class: "g-table-outer-wrap" }, Si = {
|
|
|
4915
4915
|
}, null, 8, ["errors", "id"])
|
|
4916
4916
|
], 2));
|
|
4917
4917
|
}
|
|
4918
|
+
}), Oo = { class: "g-toggle-wrapper" }, ko = { class: "g-toggle-control" }, Ao = ["for"], jo = [
|
|
4919
|
+
"id",
|
|
4920
|
+
"checked",
|
|
4921
|
+
"disabled",
|
|
4922
|
+
"aria-describedby",
|
|
4923
|
+
"aria-invalid",
|
|
4924
|
+
"aria-errormessage"
|
|
4925
|
+
], Mo = ["id"], No = /* @__PURE__ */ u({
|
|
4926
|
+
__name: "GToggle",
|
|
4927
|
+
props: /*@__PURE__*/ m({
|
|
4928
|
+
label: {},
|
|
4929
|
+
describedby: {},
|
|
4930
|
+
error: {},
|
|
4931
|
+
disabled: { type: Boolean }
|
|
4932
|
+
}, {
|
|
4933
|
+
modelValue: {
|
|
4934
|
+
type: Boolean,
|
|
4935
|
+
default: !1
|
|
4936
|
+
},
|
|
4937
|
+
modelModifiers: {}
|
|
4938
|
+
}),
|
|
4939
|
+
emits: /*@__PURE__*/ m(["change"], ["update:modelValue"]),
|
|
4940
|
+
setup(e, { emit: t }) {
|
|
4941
|
+
let n = e, r = B(e, "modelValue"), i = t;
|
|
4942
|
+
function l(e) {
|
|
4943
|
+
let t = r.value;
|
|
4944
|
+
r.value = e, e !== t && i("change", {
|
|
4945
|
+
was: t,
|
|
4946
|
+
to: e
|
|
4947
|
+
});
|
|
4948
|
+
}
|
|
4949
|
+
function u(e) {
|
|
4950
|
+
n.disabled || l(e);
|
|
4951
|
+
}
|
|
4952
|
+
function d(e) {
|
|
4953
|
+
e.target instanceof HTMLInputElement && u(e.target.checked);
|
|
4954
|
+
}
|
|
4955
|
+
function f(e) {
|
|
4956
|
+
n.disabled || (e.key === "n" || e.key === "N" || e.key === "ArrowLeft" ? (l(!1), e.preventDefault()) : (e.key === "y" || e.key === "Y" || e.key === "ArrowRight") && (l(!0), e.preventDefault()));
|
|
4957
|
+
}
|
|
4958
|
+
let p = z(), m = z();
|
|
4959
|
+
return (t, n) => (w(), o("div", Oo, [s("div", ko, [s("label", {
|
|
4960
|
+
class: "g-label",
|
|
4961
|
+
for: L(m)
|
|
4962
|
+
}, [k(t.$slots, "label", {}, () => [c(N(e.label), 1)])], 8, Ao), s("div", { class: _(["g-toggle", { "g-has-error": e.error }]) }, [s("div", { class: _(["g-toggle-track", [r.value ? "g-right" : "g-left", { "g-disabled": e.disabled }]]) }, [s("span", {
|
|
4963
|
+
class: _(["g-toggle-thumb", r.value ? "g-right" : "g-left"]),
|
|
4964
|
+
"aria-hidden": "true"
|
|
4965
|
+
}, null, 2), s("input", {
|
|
4966
|
+
id: L(m),
|
|
4967
|
+
type: "checkbox",
|
|
4968
|
+
checked: r.value,
|
|
4969
|
+
disabled: e.disabled,
|
|
4970
|
+
"aria-describedby": e.describedby,
|
|
4971
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
4972
|
+
"aria-errormessage": e.error ? L(p) + "-error" : void 0,
|
|
4973
|
+
onChange: d,
|
|
4974
|
+
onKeydown: f
|
|
4975
|
+
}, null, 40, jo)], 2)], 2)]), e.error ? (w(), o("div", {
|
|
4976
|
+
key: 0,
|
|
4977
|
+
id: `${L(p)}-error`,
|
|
4978
|
+
class: "g-form-error",
|
|
4979
|
+
role: "alert",
|
|
4980
|
+
"aria-atomic": "true"
|
|
4981
|
+
}, N(e.error), 9, Mo)) : a("", !0)]));
|
|
4982
|
+
}
|
|
4918
4983
|
});
|
|
4919
4984
|
//#endregion
|
|
4920
4985
|
//#region src/compose/useActiveLink.ts
|
|
4921
|
-
function
|
|
4986
|
+
function Po(e, t, n) {
|
|
4922
4987
|
let r = [
|
|
4923
4988
|
0,
|
|
4924
4989
|
.25,
|
|
@@ -4955,7 +5020,7 @@ function Oo(e, t, n) {
|
|
|
4955
5020
|
}
|
|
4956
5021
|
//#endregion
|
|
4957
5022
|
//#region src/compose/useSidebar.ts
|
|
4958
|
-
function
|
|
5023
|
+
function Fo(e = "(max-width: 800px)") {
|
|
4959
5024
|
let t = z(), n = D(!1), r = ue(e, { ssrWidth: 1e3 });
|
|
4960
5025
|
function i(e) {
|
|
4961
5026
|
if (!r.value || !n.value) return;
|
|
@@ -4986,41 +5051,41 @@ function ko(e = "(max-width: 800px)") {
|
|
|
4986
5051
|
}
|
|
4987
5052
|
//#endregion
|
|
4988
5053
|
//#region src/compose/usePaging.ts
|
|
4989
|
-
function
|
|
5054
|
+
function Io(e) {
|
|
4990
5055
|
let t = /* @__PURE__ */ new Set();
|
|
4991
5056
|
return (e ?? []).filter((e) => !e?.key || t.has(e.key) || e.order !== 1 && e.order !== -1 ? !1 : (t.add(e.key), !0));
|
|
4992
5057
|
}
|
|
4993
|
-
function
|
|
4994
|
-
return e == null ? [] :
|
|
5058
|
+
function Lo(e) {
|
|
5059
|
+
return e == null ? [] : Io((typeof e == "string" ? e.split(",") : e).filter((e) => e !== null).map((e) => e.trim()).filter(Boolean).map((e) => ({
|
|
4995
5060
|
key: e.replace(/^-/, ""),
|
|
4996
5061
|
order: e.startsWith("-") ? -1 : 1
|
|
4997
5062
|
})));
|
|
4998
5063
|
}
|
|
4999
|
-
function
|
|
5000
|
-
let t =
|
|
5064
|
+
function Ro(e) {
|
|
5065
|
+
let t = Io(e);
|
|
5001
5066
|
if (t.length !== 0) return t.map(({ key: e, order: t }) => `${t === -1 ? "-" : ""}${e}`);
|
|
5002
5067
|
}
|
|
5003
|
-
function
|
|
5004
|
-
let n =
|
|
5068
|
+
function zo(e, t = []) {
|
|
5069
|
+
let n = Io(e);
|
|
5005
5070
|
if (n.length === 0) return;
|
|
5006
5071
|
let r = n.map(({ key: e, order: t }) => `${t === -1 ? "-" : ""}${e}`), i = new Set(n.map(({ key: e }) => String(e))), a = n.length === 1 && n[0].order === -1 ? "-" : "";
|
|
5007
5072
|
return t.forEach((e) => {
|
|
5008
5073
|
i.has(e) || r.push(`${a}${e}`);
|
|
5009
5074
|
}), r.join(",");
|
|
5010
5075
|
}
|
|
5011
|
-
function
|
|
5076
|
+
function Bo(e) {
|
|
5012
5077
|
return Array.isArray(e) ? [...e] : e;
|
|
5013
5078
|
}
|
|
5014
|
-
function
|
|
5079
|
+
function Vo(e, t) {
|
|
5015
5080
|
return Array.isArray(e) || Array.isArray(t) ? !Array.isArray(e) || !Array.isArray(t) ? !1 : e.length === t.length && e.every((e, n) => e === t[n]) : e === t;
|
|
5016
5081
|
}
|
|
5017
|
-
function
|
|
5082
|
+
function Ho(e, t) {
|
|
5018
5083
|
return e.length === t.length && e.every((e, n) => {
|
|
5019
5084
|
let r = t[n];
|
|
5020
5085
|
return e.key === r?.key && e.order === r?.order;
|
|
5021
5086
|
});
|
|
5022
5087
|
}
|
|
5023
|
-
function
|
|
5088
|
+
function Uo(e, t) {
|
|
5024
5089
|
if (typeof e == "string") return Number(e);
|
|
5025
5090
|
if (Array.isArray(e)) {
|
|
5026
5091
|
let n = e.find((e) => e !== null);
|
|
@@ -5028,35 +5093,35 @@ function Lo(e, t) {
|
|
|
5028
5093
|
}
|
|
5029
5094
|
return t;
|
|
5030
5095
|
}
|
|
5031
|
-
function
|
|
5096
|
+
function Wo(e = {}) {
|
|
5032
5097
|
let t = e.defaultPageSize ?? 50, n = e.defaultPageOffset ?? 0, i = e.sortKey ?? "sort", a = e.pageSizeKey ?? "pageSize", o = e.pageOffsetKey ?? "pageOffset", s = M([]), c = D(t), l = D(n);
|
|
5033
5098
|
return e.route && e.router && (G(() => e.route?.query[i], (e) => {
|
|
5034
|
-
let t =
|
|
5035
|
-
|
|
5099
|
+
let t = Lo(e);
|
|
5100
|
+
Ho(s.value, t) || (s.value = t);
|
|
5036
5101
|
}, { immediate: !0 }), G(() => e.route?.query[a], (e) => {
|
|
5037
|
-
let n =
|
|
5102
|
+
let n = Uo(e, t);
|
|
5038
5103
|
c.value !== n && (c.value = n);
|
|
5039
5104
|
}, { immediate: !0 }), G(() => e.route?.query[o], (e) => {
|
|
5040
|
-
let t =
|
|
5105
|
+
let t = Uo(e, n);
|
|
5041
5106
|
l.value !== t && (l.value = t);
|
|
5042
5107
|
}, { immediate: !0 }), G([
|
|
5043
5108
|
s,
|
|
5044
5109
|
c,
|
|
5045
5110
|
l
|
|
5046
5111
|
], ([r, s, c]) => {
|
|
5047
|
-
let l = { ...e.route.query }, u =
|
|
5048
|
-
u === void 0 ? delete l[i] : l[i] =
|
|
5112
|
+
let l = { ...e.route.query }, u = Ro(r);
|
|
5113
|
+
u === void 0 ? delete l[i] : l[i] = Bo(u), s === t || s === void 0 ? delete l[a] : l[a] = String(s), c === n || c === void 0 ? delete l[o] : l[o] = String(c);
|
|
5049
5114
|
let d = /* @__PURE__ */ new Set([...Object.keys(e.route.query), ...Object.keys(l)]), f = !1;
|
|
5050
|
-
for (let t of d) if (!
|
|
5115
|
+
for (let t of d) if (!Vo(e.route.query[t], l[t])) {
|
|
5051
5116
|
f = !0;
|
|
5052
5117
|
break;
|
|
5053
5118
|
}
|
|
5054
5119
|
f && e.router.replace({ query: l });
|
|
5055
5120
|
})), {
|
|
5056
5121
|
sort: r({
|
|
5057
|
-
get: () =>
|
|
5122
|
+
get: () => Io(s.value),
|
|
5058
5123
|
set: (e) => {
|
|
5059
|
-
s.value =
|
|
5124
|
+
s.value = Io(e);
|
|
5060
5125
|
}
|
|
5061
5126
|
}),
|
|
5062
5127
|
pageSize: c,
|
|
@@ -5065,7 +5130,7 @@ function Ro(e = {}) {
|
|
|
5065
5130
|
}
|
|
5066
5131
|
//#endregion
|
|
5067
5132
|
//#region src/compose/useTableChanges.ts
|
|
5068
|
-
function
|
|
5133
|
+
function Go() {
|
|
5069
5134
|
let e = j(/* @__PURE__ */ new Map()), t = re(), n = (n) => {
|
|
5070
5135
|
let r = n.column.key, i = n.row.key, a = n.value, o = n.previousValue;
|
|
5071
5136
|
e.has(i) || e.set(i, j(/* @__PURE__ */ new Map()));
|
|
@@ -5169,7 +5234,7 @@ function zo() {
|
|
|
5169
5234
|
}
|
|
5170
5235
|
//#endregion
|
|
5171
5236
|
//#region src/compose/usePersistentTableColumnState.ts
|
|
5172
|
-
function
|
|
5237
|
+
function Ko(e, t) {
|
|
5173
5238
|
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
5174
5239
|
let n = new Set(t.map(({ key: e }) => String(e))), r = {};
|
|
5175
5240
|
for (let [t, i] of Object.entries(e)) {
|
|
@@ -5179,13 +5244,13 @@ function Bo(e, t) {
|
|
|
5179
5244
|
}
|
|
5180
5245
|
return r;
|
|
5181
5246
|
}
|
|
5182
|
-
function
|
|
5247
|
+
function qo(e, t) {
|
|
5183
5248
|
let n = le(e, {});
|
|
5184
5249
|
return G(() => I(t).map(({ key: e }) => String(e)), () => {
|
|
5185
|
-
n.value =
|
|
5250
|
+
n.value = Ko(n.value, I(t));
|
|
5186
5251
|
}, { immediate: !0 }), { columnState: n };
|
|
5187
5252
|
}
|
|
5188
5253
|
//#endregion
|
|
5189
|
-
export {
|
|
5254
|
+
export { _t as $, di as A, Mn as B, za as C, fi as D, Oa as E, Br as F, Sn as G, kn as H, kr as I, on as J, mn as K, pr as L, pi as M, bi as N, ui as O, yi as P, wt as Q, Qn as R, Va as S, Pa as T, Tn as U, An as V, Cn as W, Ft as X, Yt as Y, kt as Z, no as _, Lo as a, Ye as at, Ya as b, Fo as c, je as ct, Do as d, Se as dt, lt as et, xo as f, xe as ft, lo as g, uo as h, Io as i, Je as it, vi as j, _i as k, Po as l, ke as lt, vo as m, Go as n, rt as nt, Ro as o, Be as ot, bo as p, Q as pt, ln as q, zo as r, nt as rt, Wo as s, $ as st, qo as t, it as tt, No as u, Oe as ut, to as v, Fa as w, Ga as x, eo as y, Ln as z };
|
|
5190
5255
|
|
|
5191
|
-
//# sourceMappingURL=grad-vue-
|
|
5256
|
+
//# sourceMappingURL=grad-vue-HOjq8hB5.js.map
|