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