@illinois-grad/grad-vue 6.0.6 → 6.0.8

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.
@@ -2951,9 +2951,18 @@
2951
2951
  "type": {
2952
2952
  "text": "string"
2953
2953
  },
2954
- "optional": false,
2954
+ "optional": true,
2955
2955
  "description": "Accessible label"
2956
2956
  },
2957
+ {
2958
+ "kind": "field",
2959
+ "name": "externalLabel",
2960
+ "type": {
2961
+ "text": "string"
2962
+ },
2963
+ "optional": true,
2964
+ "description": "ID of an externally provided label element"
2965
+ },
2957
2966
  {
2958
2967
  "kind": "field",
2959
2968
  "name": "describedby",
@@ -18,7 +18,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
18
18
  * Accessible label
19
19
  * @demo Toggle
20
20
  */
21
- label: string;
21
+ label?: string;
22
+ /**
23
+ * ID of an externally provided label element
24
+ */
25
+ externalLabel?: string;
22
26
  /**
23
27
  * ID of an element that describes the input
24
28
  */
@@ -42,7 +46,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
42
46
  * Accessible label
43
47
  * @demo Toggle
44
48
  */
45
- label: string;
49
+ label?: string;
50
+ /**
51
+ * ID of an externally provided label element
52
+ */
53
+ externalLabel?: string;
46
54
  /**
47
55
  * ID of an element that describes the input
48
56
  */
@@ -4915,17 +4915,19 @@ 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 = [
4918
+ }), Oo = { class: "g-toggle-wrapper" }, ko = ["for"], Ao = [
4919
4919
  "id",
4920
4920
  "checked",
4921
4921
  "disabled",
4922
+ "aria-labelledby",
4922
4923
  "aria-describedby",
4923
4924
  "aria-invalid",
4924
4925
  "aria-errormessage"
4925
- ], Mo = ["id"], No = /* @__PURE__ */ u({
4926
+ ], jo = ["id"], Mo = /* @__PURE__ */ u({
4926
4927
  __name: "GToggle",
4927
4928
  props: /*@__PURE__*/ m({
4928
4929
  label: {},
4930
+ externalLabel: {},
4929
4931
  describedby: {},
4930
4932
  error: {},
4931
4933
  disabled: { type: Boolean }
@@ -4956,10 +4958,11 @@ var xi = { class: "g-table-outer-wrap" }, Si = {
4956
4958
  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
4959
  }
4958
4960
  let p = z(), m = z();
4959
- return (t, n) => (w(), o("div", Oo, [s("div", ko, [s("label", {
4961
+ 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", {
4962
+ key: 0,
4960
4963
  class: "g-label",
4961
4964
  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", {
4965
+ }, [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", {
4963
4966
  class: _(["g-toggle-thumb", r.value ? "g-right" : "g-left"]),
4964
4967
  "aria-hidden": "true"
4965
4968
  }, null, 2), s("input", {
@@ -4967,23 +4970,24 @@ var xi = { class: "g-table-outer-wrap" }, Si = {
4967
4970
  type: "checkbox",
4968
4971
  checked: r.value,
4969
4972
  disabled: e.disabled,
4973
+ "aria-labelledby": e.externalLabel,
4970
4974
  "aria-describedby": e.describedby,
4971
4975
  "aria-invalid": e.error ? "true" : void 0,
4972
4976
  "aria-errormessage": e.error ? L(p) + "-error" : void 0,
4973
4977
  onChange: d,
4974
4978
  onKeydown: f
4975
- }, null, 40, jo)], 2)], 2)]), e.error ? (w(), o("div", {
4979
+ }, null, 40, Ao)], 2)], 2)], 2), e.error ? (w(), o("div", {
4976
4980
  key: 0,
4977
4981
  id: `${L(p)}-error`,
4978
4982
  class: "g-form-error",
4979
4983
  role: "alert",
4980
4984
  "aria-atomic": "true"
4981
- }, N(e.error), 9, Mo)) : a("", !0)]));
4985
+ }, N(e.error), 9, jo)) : a("", !0)]));
4982
4986
  }
4983
4987
  });
4984
4988
  //#endregion
4985
4989
  //#region src/compose/useActiveLink.ts
4986
- function Po(e, t, n) {
4990
+ function No(e, t, n) {
4987
4991
  let r = [
4988
4992
  0,
4989
4993
  .25,
@@ -5020,7 +5024,7 @@ function Po(e, t, n) {
5020
5024
  }
5021
5025
  //#endregion
5022
5026
  //#region src/compose/useSidebar.ts
5023
- function Fo(e = "(max-width: 800px)") {
5027
+ function Po(e = "(max-width: 800px)") {
5024
5028
  let t = z(), n = D(!1), r = ue(e, { ssrWidth: 1e3 });
5025
5029
  function i(e) {
5026
5030
  if (!r.value || !n.value) return;
@@ -5051,41 +5055,41 @@ function Fo(e = "(max-width: 800px)") {
5051
5055
  }
5052
5056
  //#endregion
5053
5057
  //#region src/compose/usePaging.ts
5054
- function Io(e) {
5058
+ function Fo(e) {
5055
5059
  let t = /* @__PURE__ */ new Set();
5056
5060
  return (e ?? []).filter((e) => !e?.key || t.has(e.key) || e.order !== 1 && e.order !== -1 ? !1 : (t.add(e.key), !0));
5057
5061
  }
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) => ({
5062
+ function Io(e) {
5063
+ return e == null ? [] : Fo((typeof e == "string" ? e.split(",") : e).filter((e) => e !== null).map((e) => e.trim()).filter(Boolean).map((e) => ({
5060
5064
  key: e.replace(/^-/, ""),
5061
5065
  order: e.startsWith("-") ? -1 : 1
5062
5066
  })));
5063
5067
  }
5064
- function Ro(e) {
5065
- let t = Io(e);
5068
+ function Lo(e) {
5069
+ let t = Fo(e);
5066
5070
  if (t.length !== 0) return t.map(({ key: e, order: t }) => `${t === -1 ? "-" : ""}${e}`);
5067
5071
  }
5068
- function zo(e, t = []) {
5069
- let n = Io(e);
5072
+ function Ro(e, t = []) {
5073
+ let n = Fo(e);
5070
5074
  if (n.length === 0) return;
5071
5075
  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 ? "-" : "";
5072
5076
  return t.forEach((e) => {
5073
5077
  i.has(e) || r.push(`${a}${e}`);
5074
5078
  }), r.join(",");
5075
5079
  }
5076
- function Bo(e) {
5080
+ function zo(e) {
5077
5081
  return Array.isArray(e) ? [...e] : e;
5078
5082
  }
5079
- function Vo(e, t) {
5083
+ function Bo(e, t) {
5080
5084
  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;
5081
5085
  }
5082
- function Ho(e, t) {
5086
+ function Vo(e, t) {
5083
5087
  return e.length === t.length && e.every((e, n) => {
5084
5088
  let r = t[n];
5085
5089
  return e.key === r?.key && e.order === r?.order;
5086
5090
  });
5087
5091
  }
5088
- function Uo(e, t) {
5092
+ function Ho(e, t) {
5089
5093
  if (typeof e == "string") return Number(e);
5090
5094
  if (Array.isArray(e)) {
5091
5095
  let n = e.find((e) => e !== null);
@@ -5093,35 +5097,35 @@ function Uo(e, t) {
5093
5097
  }
5094
5098
  return t;
5095
5099
  }
5096
- function Wo(e = {}) {
5100
+ function Uo(e = {}) {
5097
5101
  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);
5098
5102
  return e.route && e.router && (G(() => e.route?.query[i], (e) => {
5099
- let t = Lo(e);
5100
- Ho(s.value, t) || (s.value = t);
5103
+ let t = Io(e);
5104
+ Vo(s.value, t) || (s.value = t);
5101
5105
  }, { immediate: !0 }), G(() => e.route?.query[a], (e) => {
5102
- let n = Uo(e, t);
5106
+ let n = Ho(e, t);
5103
5107
  c.value !== n && (c.value = n);
5104
5108
  }, { immediate: !0 }), G(() => e.route?.query[o], (e) => {
5105
- let t = Uo(e, n);
5109
+ let t = Ho(e, n);
5106
5110
  l.value !== t && (l.value = t);
5107
5111
  }, { immediate: !0 }), G([
5108
5112
  s,
5109
5113
  c,
5110
5114
  l
5111
5115
  ], ([r, s, c]) => {
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);
5116
+ let l = { ...e.route.query }, u = Lo(r);
5117
+ 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);
5114
5118
  let d = /* @__PURE__ */ new Set([...Object.keys(e.route.query), ...Object.keys(l)]), f = !1;
5115
- for (let t of d) if (!Vo(e.route.query[t], l[t])) {
5119
+ for (let t of d) if (!Bo(e.route.query[t], l[t])) {
5116
5120
  f = !0;
5117
5121
  break;
5118
5122
  }
5119
5123
  f && e.router.replace({ query: l });
5120
5124
  })), {
5121
5125
  sort: r({
5122
- get: () => Io(s.value),
5126
+ get: () => Fo(s.value),
5123
5127
  set: (e) => {
5124
- s.value = Io(e);
5128
+ s.value = Fo(e);
5125
5129
  }
5126
5130
  }),
5127
5131
  pageSize: c,
@@ -5130,7 +5134,7 @@ function Wo(e = {}) {
5130
5134
  }
5131
5135
  //#endregion
5132
5136
  //#region src/compose/useTableChanges.ts
5133
- function Go() {
5137
+ function Wo() {
5134
5138
  let e = j(/* @__PURE__ */ new Map()), t = re(), n = (n) => {
5135
5139
  let r = n.column.key, i = n.row.key, a = n.value, o = n.previousValue;
5136
5140
  e.has(i) || e.set(i, j(/* @__PURE__ */ new Map()));
@@ -5234,7 +5238,7 @@ function Go() {
5234
5238
  }
5235
5239
  //#endregion
5236
5240
  //#region src/compose/usePersistentTableColumnState.ts
5237
- function Ko(e, t) {
5241
+ function Go(e, t) {
5238
5242
  if (!e || typeof e != "object" || Array.isArray(e)) return {};
5239
5243
  let n = new Set(t.map(({ key: e }) => String(e))), r = {};
5240
5244
  for (let [t, i] of Object.entries(e)) {
@@ -5244,13 +5248,13 @@ function Ko(e, t) {
5244
5248
  }
5245
5249
  return r;
5246
5250
  }
5247
- function qo(e, t) {
5251
+ function Ko(e, t) {
5248
5252
  let n = le(e, {});
5249
5253
  return G(() => I(t).map(({ key: e }) => String(e)), () => {
5250
- n.value = Ko(n.value, I(t));
5254
+ n.value = Go(n.value, I(t));
5251
5255
  }, { immediate: !0 }), { columnState: n };
5252
5256
  }
5253
5257
  //#endregion
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 };
5258
+ 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 };
5255
5259
 
5256
- //# sourceMappingURL=grad-vue-HOjq8hB5.js.map
5260
+ //# sourceMappingURL=grad-vue-DfQuQs4s.js.map