@illinois-grad/grad-vue 6.0.5 → 6.0.7

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