@ulu/frontend-vue 0.6.10 → 0.6.12

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.
@@ -4,17 +4,20 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
4
4
  $slots: S;
5
5
  });
6
6
  declare const __VLS_component: import('vue').DefineComponent<{}, {
7
+ $emit: (event: "change", ...args: any[]) => void;
7
8
  vertical: boolean;
8
9
  sticky: boolean;
9
10
  transparent: boolean;
10
11
  modifiers?: string | unknown[] | undefined;
11
12
  defaultIndex?: number | undefined;
13
+ selectedIndex?: number | undefined;
12
14
  $props: {
13
15
  readonly vertical?: boolean | undefined;
14
16
  readonly sticky?: boolean | undefined;
15
17
  readonly transparent?: boolean | undefined;
16
18
  readonly modifiers?: string | unknown[] | undefined;
17
19
  readonly defaultIndex?: number | undefined;
20
+ readonly selectedIndex?: number | undefined;
18
21
  };
19
22
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
20
23
  type __VLS_TemplateResult = {
@@ -1 +1 @@
1
- {"version":3,"file":"UluTabGroup.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabGroup.vue"],"names":[],"mappings":"AAeA;wBA2KqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAVjC;;;;;;;;;;;;;2OAOG"}
1
+ {"version":3,"file":"UluTabGroup.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/UluTabGroup.vue"],"names":[],"mappings":"AAiBA;wBAwMqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;2OAQG"}
@@ -1,15 +1,19 @@
1
- import { computed as n, createBlock as i, openBlock as l, unref as a, withCtx as c, createElementVNode as d, mergeProps as u, renderSlot as f, normalizeProps as p, guardReactiveProps as m } from "vue";
2
- import { TabGroup as v } from "@headlessui/vue";
3
- import { useModifiers as b } from "../../composables/useModifiers.js";
4
- const y = /* @__PURE__ */ Object.assign({
1
+ import { computed as l, createBlock as i, openBlock as d, unref as s, withCtx as c, createElementVNode as u, mergeProps as m, renderSlot as f, normalizeProps as p, guardReactiveProps as v } from "vue";
2
+ import { TabGroup as b } from "@headlessui/vue";
3
+ import { useModifiers as x } from "../../composables/useModifiers.js";
4
+ const B = /* @__PURE__ */ Object.assign({
5
5
  inheritAttrs: !1
6
6
  }, {
7
7
  __name: "UluTabGroup",
8
8
  props: {
9
9
  /**
10
- * Active tab index by default
10
+ * Active tab index by default (uncontrolled)
11
11
  */
12
12
  defaultIndex: Number,
13
+ /**
14
+ * Actively selected tab index (controlled)
15
+ */
16
+ selectedIndex: Number,
13
17
  /**
14
18
  * Whether or not to use vertical layout
15
19
  */
@@ -27,31 +31,34 @@ const y = /* @__PURE__ */ Object.assign({
27
31
  */
28
32
  modifiers: [String, Array]
29
33
  },
30
- setup(t) {
31
- const e = t, { resolvedModifiers: s } = b({
32
- props: e,
34
+ emits: ["change"],
35
+ setup(e) {
36
+ const t = e, { resolvedModifiers: o } = x({
37
+ props: t,
33
38
  baseClass: "tabs",
34
- internal: n(() => ({
35
- vertical: e.vertical,
36
- sticky: e.sticky,
37
- transparent: e.transparent
39
+ internal: l(() => ({
40
+ vertical: t.vertical,
41
+ sticky: t.sticky,
42
+ transparent: t.transparent
38
43
  }))
39
44
  });
40
- return (r, k) => (l(), i(a(v), {
41
- defaultIndex: t.defaultIndex,
42
- vertical: t.vertical
45
+ return (r, n) => (d(), i(s(b), {
46
+ defaultIndex: e.defaultIndex,
47
+ selectedIndex: e.selectedIndex,
48
+ vertical: e.vertical,
49
+ onChange: n[0] || (n[0] = (a) => r.$emit("change", a))
43
50
  }, {
44
- default: c((o) => [
45
- d("div", u(r.$attrs, {
46
- class: ["tabs", a(s)]
51
+ default: c((a) => [
52
+ u("div", m(r.$attrs, {
53
+ class: ["tabs", s(o)]
47
54
  }), [
48
- f(r.$slots, "default", p(m(o)))
55
+ f(r.$slots, "default", p(v(a)))
49
56
  ], 16)
50
57
  ]),
51
58
  _: 3
52
- }, 8, ["defaultIndex", "vertical"]));
59
+ }, 8, ["defaultIndex", "selectedIndex", "vertical"]));
53
60
  }
54
61
  });
55
62
  export {
56
- y as default
63
+ B as default
57
64
  };
@@ -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
  };