@illinois-grad/grad-vue 3.0.15 → 3.0.16

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.
@@ -131,7 +131,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
131
131
  headingLevel: "h2" | "h3";
132
132
  smallHeading: boolean;
133
133
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
134
- default?: (props: {}) => any;
134
+ default?: () => any;
135
+ heading?: () => any;
135
136
  }>;
136
137
  type __VLS_WithSlots<T, S> = T & {
137
138
  new (): {
@@ -115,34 +115,34 @@ var he = { class: "g-btn--icon" }, ge = { class: "g-btn--label" }, Q = /* @__PUR
115
115
  }
116
116
  },
117
117
  setup(e) {
118
- let t = e, n = B();
118
+ let t = e, n = H(), l = d(), u = B(), f = (l?.ce)?._slots?.heading?.length > 0, p = r(() => !!t.heading || !!n.heading || f);
119
119
  E("g-tree-menu-list-type", t.listType), E("g-tree-menu-expanded-storage", t.storageKey ? fe(t.storageKey, {}) : null);
120
- let l = D(/* @__PURE__ */ new Map());
121
- E("g-tree-menu-expandable-items", l);
122
- let u = O({
120
+ let m = D(/* @__PURE__ */ new Map());
121
+ E("g-tree-menu-expandable-items", m);
122
+ let v = O({
123
123
  expanded: !0,
124
124
  version: 0
125
125
  });
126
- E("g-tree-menu-expand-all-signal", u);
127
- let d = r(() => {
128
- if (l.size === 0) return !1;
129
- for (let e of l.values()) if (!e) return !1;
126
+ E("g-tree-menu-expand-all-signal", v);
127
+ let y = r(() => {
128
+ if (m.size === 0) return !1;
129
+ for (let e of m.values()) if (!e) return !1;
130
130
  return !0;
131
131
  });
132
- function f() {
133
- let e = !d.value;
134
- u.value = {
132
+ function b() {
133
+ let e = !y.value;
134
+ v.value = {
135
135
  expanded: e,
136
- version: u.value.version + 1
136
+ version: v.value.version + 1
137
137
  };
138
138
  }
139
- function p(e) {
139
+ function x(e) {
140
140
  return e.querySelector("a, button, [tabindex='0']") || e;
141
141
  }
142
- function m(e) {
142
+ function S(e) {
143
143
  return Array.from(e.querySelectorAll("[data-tree-primary]"));
144
144
  }
145
- function v(e) {
145
+ function C(e) {
146
146
  let t = e.currentTarget, n = document.activeElement;
147
147
  if (!t.contains(n) || ![
148
148
  "ArrowUp",
@@ -152,16 +152,16 @@ var he = { class: "g-btn--icon" }, ge = { class: "g-btn--label" }, Q = /* @__PUR
152
152
  "Home",
153
153
  "End"
154
154
  ].includes(e.key)) return;
155
- let r = n.closest(".g-tree-menu__item"), i = r?.querySelector("[data-tree-primary]") ?? null, a = m(t), o = i ? a.indexOf(i) : -1;
155
+ let r = n.closest(".g-tree-menu__item"), i = r?.querySelector("[data-tree-primary]") ?? null, a = S(t), o = i ? a.indexOf(i) : -1;
156
156
  switch (e.key) {
157
157
  case "ArrowDown": {
158
158
  let e = a[o + 1];
159
- e && p(e).focus();
159
+ e && x(e).focus();
160
160
  break;
161
161
  }
162
162
  case "ArrowUp": {
163
163
  let e = a[o - 1];
164
- e && p(e).focus();
164
+ e && x(e).focus();
165
165
  break;
166
166
  }
167
167
  case "ArrowRight":
@@ -171,48 +171,48 @@ var he = { class: "g-btn--icon" }, ge = { class: "g-btn--label" }, Q = /* @__PUR
171
171
  e && e.click();
172
172
  } else {
173
173
  let e = a[o + 1];
174
- e && p(e).focus();
174
+ e && x(e).focus();
175
175
  }
176
176
  break;
177
177
  case "ArrowLeft":
178
178
  if (!r) break;
179
179
  if (r.querySelector("[aria-expanded='true']") !== null) {
180
180
  let e = r.querySelector(".g-tree-menu__toggle-btn");
181
- e && e.click(), i && g(() => p(i).focus());
181
+ e && e.click(), i && g(() => x(i).focus());
182
182
  } else {
183
183
  let e = r.parentElement?.closest(".g-tree-menu__item");
184
184
  if (e) {
185
185
  let t = e.querySelector("[data-tree-primary]");
186
- t && p(t).focus();
186
+ t && x(t).focus();
187
187
  }
188
188
  }
189
189
  break;
190
190
  case "Home":
191
- a.length > 0 && p(a[0]).focus();
191
+ a.length > 0 && x(a[0]).focus();
192
192
  break;
193
193
  case "End":
194
- a.length > 0 && p(a[a.length - 1]).focus();
194
+ a.length > 0 && x(a[a.length - 1]).focus();
195
195
  break;
196
196
  }
197
197
  e.preventDefault();
198
198
  }
199
- return (r, l) => (T(), o("nav", h({ class: ["g-tree-menu", [`g-tree-menu--${t.theme}`, { "g-tree-menu--small-heading": e.smallHeading }]] }, {
200
- "aria-labelledby": e.heading ? R(n) : void 0,
201
- "aria-label": e.heading ? void 0 : "Tree Menu"
202
- }, { onKeydown: v }), [
203
- e.heading ? (T(), i(j(e.headingLevel), {
199
+ return (n, r) => (T(), o("nav", h({ class: ["g-tree-menu", [`g-tree-menu--${t.theme}`, { "g-tree-menu--small-heading": e.smallHeading }]] }, {
200
+ "aria-labelledby": p.value ? R(u) : void 0,
201
+ "aria-label": p.value ? void 0 : "Tree Menu"
202
+ }, { onKeydown: C }), [
203
+ p.value ? (T(), i(j(e.headingLevel), {
204
204
  key: 0,
205
- id: R(n),
205
+ id: R(u),
206
206
  class: "g-tree-menu__title"
207
207
  }, {
208
- default: J(() => [c(P(e.heading), 1)]),
209
- _: 1
208
+ default: J(() => [A(n.$slots, "heading", {}, () => [c(P(e.heading), 1)])]),
209
+ _: 3
210
210
  }, 8, ["id"])) : a("", !0),
211
211
  s("div", _e, [e.smallHeading ? a("", !0) : (T(), o("div", ve)), e.showExpandAll ? (T(), o("div", ye, [s("button", {
212
212
  class: "g-tree-menu__expand-all-btn",
213
- onClick: f
213
+ onClick: b
214
214
  }, [(T(), o("svg", {
215
- class: _(["g-tree-menu__expand-all-icon", { "g-tree-menu__expand-all-icon--collapse": d.value }]),
215
+ class: _(["g-tree-menu__expand-all-icon", { "g-tree-menu__expand-all-icon--collapse": y.value }]),
216
216
  role: "none",
217
217
  viewBox: "0 0 24 24",
218
218
  fill: "none",
@@ -220,8 +220,8 @@ var he = { class: "g-btn--icon" }, ge = { class: "g-btn--label" }, Q = /* @__PUR
220
220
  "stroke-width": "2.5",
221
221
  "stroke-linecap": "round",
222
222
  "stroke-linejoin": "round"
223
- }, [...l[0] ||= [s("polyline", { points: "7 8 12 13 17 8" }, null, -1), s("polyline", { points: "7 13 12 18 17 13" }, null, -1)]], 2)), c(" " + P(d.value ? "Collapse all" : "Expand all"), 1)])])) : a("", !0)]),
224
- s("div", be, [A(r.$slots, "default")])
223
+ }, [...r[0] ||= [s("polyline", { points: "7 8 12 13 17 8" }, null, -1), s("polyline", { points: "7 13 12 18 17 13" }, null, -1)]], 2)), c(" " + P(y.value ? "Collapse all" : "Expand all"), 1)])])) : a("", !0)]),
224
+ s("div", be, [A(n.$slots, "default")])
225
225
  ], 16));
226
226
  }
227
227
  }), Se = /* @__PURE__ */ u({
@@ -4385,4 +4385,4 @@ function Oa() {
4385
4385
  //#endregion
4386
4386
  export { $, rr as A, tn as B, Sr as C, wr as D, xr as E, yn as F, pt as G, jt as H, hn as I, $e as J, at as K, pn as L, Dn as M, Sn as N, Tr as O, bn as P, Re as Q, fn as R, ii as S, Cr as T, Tt as U, Gt as V, bt as W, Ke as X, Qe as Y, qe as Z, Di as _, ya as a, Q as at, yi as b, aa as c, Wi as d, ke as et, Ui as f, ki as g, Ni as h, Ta as i, xe as it, Hn as j, yr as k, Qi as l, Li as m, Da as n, Ee as nt, ca as o, Hi as p, et as q, Ea as r, Se as rt, sa as s, Oa as t, De as tt, Zi as u, Ci as v, br as w, pi as x, Si as y, ln as z };
4387
4387
 
4388
- //# sourceMappingURL=grad-vue-N0uyBUx2.js.map
4388
+ //# sourceMappingURL=grad-vue-CLV2d1M0.js.map