@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.
- package/dist/components/collapsible/UluTab.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluTabPanel.vue.d.ts.map +1 -1
- package/dist/components/collapsible/UluTabPanels.vue.d.ts.map +1 -1
- package/dist/components/utils/UluRouteAnnouncer.vue.d.ts +2 -0
- package/dist/components/utils/UluRouteAnnouncer.vue.js +25 -21
- package/dist/mcp-data.json +4604 -4572
- package/lib/components/collapsible/UluTab.vue +4 -2
- package/lib/components/collapsible/UluTabPanel.vue +4 -2
- package/lib/components/collapsible/UluTabPanels.vue +4 -2
- package/lib/components/utils/UluRouteAnnouncer.vue +28 -16
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluTab.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTab.vue"],"names":[],"mappings":"
|
|
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":"
|
|
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":"
|
|
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
|
|
2
|
-
import { useRoute as _ } from "vue-router";
|
|
3
|
-
import { getRouteTitle as
|
|
4
|
-
const
|
|
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
|
|
11
|
-
* - to/from are
|
|
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) =>
|
|
32
|
-
}
|
|
31
|
+
default: (r) => T(r)
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Enable debug logging
|
|
35
|
+
*/
|
|
36
|
+
debug: Boolean
|
|
33
37
|
},
|
|
34
38
|
setup(r) {
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const e =
|
|
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
|
|
41
|
-
|
|
42
|
-
async (e,
|
|
43
|
-
if (
|
|
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
|
|
46
|
-
|
|
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,
|
|
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:
|
|
54
|
-
},
|
|
57
|
+
ref: a
|
|
58
|
+
}, y(n.value), 513)) : g("", !0);
|
|
55
59
|
}
|
|
56
60
|
};
|
|
57
61
|
export {
|
|
58
|
-
|
|
62
|
+
b as default
|
|
59
63
|
};
|