@ulu/frontend-vue 0.6.9 → 0.6.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"UluTab.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTab.vue"],"names":[],"mappings":"AAKA;wBAyEqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
1
+ {"version":3,"file":"UluTab.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTab.vue"],"names":[],"mappings":"AAOA;wBA4EqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"UluTabPanel.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabPanel.vue"],"names":[],"mappings":"AAKA;wBAyEqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
1
+ {"version":3,"file":"UluTabPanel.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabPanel.vue"],"names":[],"mappings":"AAOA;wBA4EqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"UluTabPanels.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabPanels.vue"],"names":[],"mappings":"AAKA;wBAwEqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
1
+ {"version":3,"file":"UluTabPanels.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabPanels.vue"],"names":[],"mappings":"AAOA;wBA2EqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AATjC,6SAMG"}
@@ -2,10 +2,12 @@ declare const _default: import('vue').DefineComponent<{}, {
2
2
  validator: Function;
3
3
  exclude: unknown[];
4
4
  getTitle: Function;
5
+ debug: boolean;
5
6
  $props: {
6
7
  readonly validator?: Function | undefined;
7
8
  readonly exclude?: unknown[] | undefined;
8
9
  readonly getTitle?: Function | undefined;
10
+ readonly debug?: boolean | undefined;
9
11
  };
10
12
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
11
13
  el: HTMLParagraphElement;
@@ -1,14 +1,14 @@
1
- import { ref as s, computed as f, watch as d, nextTick as p, createElementBlock as m, createCommentVNode as h, openBlock as y, toDisplayString as v } from "vue";
2
- import { useRoute as _ } from "vue-router";
3
- import { getRouteTitle as g } from "../../utils/router.js";
4
- const A = {
1
+ import { ref as d, computed as f, watch as p, nextTick as h, createElementBlock as m, createCommentVNode as g, openBlock as v, toDisplayString as y } from "vue";
2
+ import { useRoute as R, useRouter as _, START_LOCATION as A } from "vue-router";
3
+ import { getRouteTitle as T } from "../../utils/router.js";
4
+ const b = {
5
5
  __name: "UluRouteAnnouncer",
6
6
  props: {
7
7
  /**
8
8
  * Allow user to bypass this functionality
9
9
  * - Function should return true if the page should be announced
10
- * - Function is passed (to, from, $route) => {}
11
- * - to/from are path strings
10
+ * - Function is passed (to, from) => {}
11
+ * - to/from are RouteLocationNormalizedLoaded objects
12
12
  */
13
13
  validator: {
14
14
  type: Function,
@@ -28,32 +28,36 @@ const A = {
28
28
  */
29
29
  getTitle: {
30
30
  type: Function,
31
- default: (r) => g(r)
32
- }
31
+ default: (r) => T(r)
32
+ },
33
+ /**
34
+ * Enable debug logging
35
+ */
36
+ debug: Boolean
33
37
  },
34
38
  setup(r) {
35
- const n = r, t = _(), u = s(null), l = f(() => {
36
- if (!t) return "";
37
- const e = n.getTitle(t);
39
+ const t = r, l = R(), c = _(), a = d(null), n = f(() => {
40
+ if (!l || l.matched.length === 0) return "";
41
+ const e = t.getTitle(l);
38
42
  return e || console.warn("RouteAnnouncer: No page title!"), e;
39
43
  });
40
- return t ? d(
41
- () => t.path,
42
- async (e, a) => {
43
- if (t.hash)
44
+ return c ? p(
45
+ c.currentRoute,
46
+ async (e, o) => {
47
+ if (o === A || o.matched.length === 0 || e.hash)
44
48
  return;
45
- const c = n.validator(e, a, t), i = n.exclude.some((o) => o.endsWith("*") ? e.startsWith(o.slice(0, o.length - 1)) : e === o);
46
- c && !i && (await p(), u.value?.focus());
49
+ const s = t.validator(e, o), i = t.exclude.some((u) => u.endsWith("*") ? e.path.startsWith(u.slice(0, u.length - 1)) : e.path === u);
50
+ n.value && s && !i && (t.debug && console.log("RouteAnnouncer: Focused title:", n.value), await h(), a.value?.focus());
47
51
  }
48
- ) : console.error("RouteAnnouncer: No route found (install vue-router)."), (e, a) => l.value ? (y(), m("p", {
52
+ ) : console.error("RouteAnnouncer: No route found (install vue-router)."), (e, o) => n.value ? (v(), m("p", {
49
53
  key: 0,
50
54
  tabindex: "-1",
51
55
  class: "hidden-visually",
52
56
  ref_key: "el",
53
- ref: u
54
- }, v(l.value), 513)) : h("", !0);
57
+ ref: a
58
+ }, y(n.value), 513)) : g("", !0);
55
59
  }
56
60
  };
57
61
  export {
58
- A as default
62
+ b as default
59
63
  };