eco-vue-js 0.26.31 → 0.27.1

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,4 +1,4 @@
1
1
  // src/components/EmptyComponent/WEmptyComponent.vue?vue&type=script&lang.ts
2
- var WEmptyComponent = (_props, { slots }) => slots.default?.();
2
+ var WEmptyComponent = (_props, { slots }) => slots.default?.({});
3
3
  WEmptyComponent.inheritAttrs = false;
4
4
  export { WEmptyComponent as default };
@@ -1 +1 @@
1
- {"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAkGA;AA0JA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAkBzC,KAAK,WAAW,GAAG;IACjB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAC;AAmSF,QAAA,MAAM,UAAU;;;qPAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAuGA;AAqKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAqBzC,KAAK,WAAW,GAAG;IACjB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAC;AAySF,QAAA,MAAM,UAAU;;;qPAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -5,29 +5,29 @@ import WTextOverflow_default from "../TextOverflow/WTextOverflow.vue.js";
5
5
  import { useOptionalRoute, useOptionalRouter } from "../../composables/useOptionalRouter.js";
6
6
  import { getRouteTitle, getRouteTitleShort } from "../../utils/useRouteTitle.js";
7
7
  import { isEqualObj, numberCompactFormatter } from "../../utils/utils.js";
8
- import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, withCtx } from "vue";
8
+ import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, withCtx } from "vue";
9
9
  // src/components/Nav/WNavItem.vue?vue&type=script&setup=true&lang.ts
10
10
  var _hoisted_1 = {
11
11
  key: 0,
12
12
  class: "w-nav-item-indicator tone-primary bg-tone-fill absolute left-0 top-0 h-full w-1"
13
13
  };
14
14
  var _hoisted_2 = {
15
- key: 0,
16
- class: "absolute left-3 top-0 flex h-full items-center"
17
- };
18
- var _hoisted_3 = {
19
15
  ref: "anchor",
20
16
  "aria-hidden": "true",
21
17
  class: "w-nav-item-anchor pointer-events-none absolute inset-x-0"
22
18
  };
23
- var _hoisted_4 = { class: "[overflow:inherit]" };
24
- var _hoisted_5 = { class: "flex items-center" };
25
- var _hoisted_6 = { class: "last-not:pr-1 min-w-0 font-normal" };
26
- var _hoisted_7 = { class: "relative inline-flex max-w-full items-center whitespace-nowrap tracking-wide" };
27
- var _hoisted_8 = {
19
+ var _hoisted_3 = { class: "[overflow:inherit]" };
20
+ var _hoisted_4 = {
21
+ key: 0,
22
+ class: "flex items-center"
23
+ };
24
+ var _hoisted_5 = { class: "last-not:pr-1 min-w-0 font-normal" };
25
+ var _hoisted_6 = { class: "relative inline-flex max-w-full items-center whitespace-nowrap tracking-wide" };
26
+ var _hoisted_7 = {
28
27
  key: 0,
29
28
  class: "shrink-0"
30
29
  };
30
+ var INDENT_STEP = 2;
31
31
  var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
32
32
  __name: "WNavItem",
33
33
  props: {
@@ -38,14 +38,16 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
38
38
  skeleton: { type: Boolean },
39
39
  hasActive: { type: Boolean },
40
40
  expand: { type: Boolean },
41
- indent: { type: Boolean },
41
+ indent: {},
42
42
  queryFields: {},
43
+ paramFields: {},
43
44
  hovered: { type: Boolean },
44
45
  even: { type: Boolean },
45
46
  to: {}
46
47
  },
47
48
  setup(__props, { expose: __expose }) {
48
49
  const EXCLUDE_QUERY_FIELDS = ["ordering", "page"];
50
+ const getParamValue = (value) => [value ?? ""].flat().join("/");
49
51
  const props = __props;
50
52
  const route = useOptionalRoute();
51
53
  const router = useOptionalRouter();
@@ -53,11 +55,13 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
53
55
  const isActive = computed(() => {
54
56
  if (!route) return false;
55
57
  if (routeTo.value?.name !== route?.name) return false;
58
+ if (props.paramFields?.some((field) => getParamValue(route.params[field]) !== getParamValue(routeTo.value.params[field]))) return false;
56
59
  return isEqualObj(route.query, routeTo.value.query ?? {}, EXCLUDE_QUERY_FIELDS, props.queryFields);
57
60
  });
58
61
  const routeTitle = computed(() => getRouteTitle(routeTo.value?.matched ?? []));
59
62
  const iconLocal = computed(() => props.icon ?? routeTo.value?.meta?.icon);
60
63
  const titleLocal = computed(() => props.title ?? (routeTitle.value ? getRouteTitleShort(routeTitle.value) : void 0) ?? (typeof routeTo.value?.meta?.titleShort === "string" ? routeTo.value.meta.titleShort : typeof routeTo.value?.meta?.title === "string" ? routeTo.value.meta.title : ""));
64
+ const getIndentLength = (base) => `calc(var(--spacing) * ${base + INDENT_STEP * (props.indent ?? 0)})`;
61
65
  const isTextColor = computed(() => props.hasActive ? !props.indent : isActive.value);
62
66
  __expose({
63
67
  isActive,
@@ -89,25 +93,32 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
89
93
  "enter-from-class": "opacity-0",
90
94
  "leave-to-class": "opacity-0"
91
95
  }, {
92
- default: withCtx(() => [__props.indent && !__props.expand && isActive.value ? (openBlock(), createElementBlock("div", _hoisted_2, [..._cache[0] || (_cache[0] = [createElementVNode("div", { class: "square-1.5 rounded-full bg-(--w-nav-item-dot-color)" }, null, -1)])])) : createCommentVNode("", true)]),
96
+ default: withCtx(() => [__props.indent && !__props.expand && isActive.value ? (openBlock(), createElementBlock("div", {
97
+ key: 0,
98
+ class: "absolute top-0 flex h-full items-center",
99
+ style: normalizeStyle({ left: getIndentLength(1) })
100
+ }, [..._cache[0] || (_cache[0] = [createElementVNode("div", { class: "square-1.5 rounded-full bg-(--w-nav-item-dot-color)" }, null, -1)])], 4)) : createCommentVNode("", true)]),
93
101
  _: 1
94
102
  }),
95
- createElementVNode("span", _hoisted_3, null, 512),
96
- createElementVNode("div", _hoisted_4, [createElementVNode("div", { class: normalizeClass(["w-ripple w-ripple-hover relative grid grid-cols-[1.5rem_1fr_auto] items-center rounded-(--w-nav-item-rounded,var(--radius-lg)) pr-2", {
97
- "before:opacity-10": __props.hovered,
98
- "pl-4": __props.indent,
99
- "pl-2": !__props.indent
100
- }]) }, [
101
- createElementVNode("div", _hoisted_5, [iconLocal.value ? (openBlock(), createBlock(resolveDynamicComponent(iconLocal.value), {
103
+ createElementVNode("span", _hoisted_2, null, 512),
104
+ createElementVNode("div", _hoisted_3, [createElementVNode("div", {
105
+ class: normalizeClass(["w-ripple w-ripple-hover relative grid items-center rounded-(--w-nav-item-rounded,var(--radius-lg)) pr-2", {
106
+ "before:opacity-10": __props.hovered,
107
+ "grid-cols-[1.5rem_1fr_auto]": iconLocal.value || _ctx.$slots.icon,
108
+ "grid-cols-[1fr_auto]": !iconLocal.value && !_ctx.$slots.icon
109
+ }]),
110
+ style: normalizeStyle({ paddingLeft: getIndentLength(2) })
111
+ }, [
112
+ iconLocal.value || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_4, [iconLocal.value ? (openBlock(), createBlock(resolveDynamicComponent(iconLocal.value), {
102
113
  key: 0,
103
114
  class: "square-[1.25em]"
104
- })) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)]),
105
- createElementVNode("div", _hoisted_6, [createElementVNode("span", _hoisted_7, [
115
+ })) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)])) : createCommentVNode("", true),
116
+ createElementVNode("div", _hoisted_5, [createElementVNode("span", _hoisted_6, [
106
117
  createVNode(WTextOverflow_default, { class: "min-w-0 leading-loose" }, {
107
118
  default: withCtx(() => [createTextVNode(toDisplayString(titleLocal.value), 1)]),
108
119
  _: 1
109
120
  }),
110
- !__props.skeleton ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(typeof __props.count === "number" ? `\u00A0(${unref(numberCompactFormatter).format(__props.count)})` : ""), 1)) : (openBlock(), createBlock(WSkeleton_default, {
121
+ !__props.skeleton ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(typeof __props.count === "number" ? `\u00A0(${unref(numberCompactFormatter).format(__props.count)})` : ""), 1)) : (openBlock(), createBlock(WSkeleton_default, {
111
122
  key: 1,
112
123
  class: "w-skeleton-w-10 ml-1 inline-flex shrink-0"
113
124
  })),
@@ -119,7 +130,7 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
119
130
  }, null, 8, ["count"])) : createCommentVNode("", true)
120
131
  ])]),
121
132
  renderSlot(_ctx.$slots, "right")
122
- ], 2)])
133
+ ], 6)])
123
134
  ]),
124
135
  _: 3
125
136
  }, 8, ["to", "class"]);
@@ -1 +1 @@
1
- {"version":3,"file":"WNavItemExpand.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItemExpand.vue"],"names":[],"mappings":"AAiGA;AAuKA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAG/C,OAAO,EAAC,KAAK,KAAK,EAA2D,MAAM,KAAK,CAAA;AAoDxF,KAAK,WAAW,GAAG;IACjB,4HAA4H;IAC5H,OAAO,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;IACvB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;CACrB,CAAC;AAkVF,QAAA,MAAM,UAAU;;;2PAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WNavItemExpand.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItemExpand.vue"],"names":[],"mappings":"AAwGA;AAkLA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAG/C,OAAO,EAAC,KAAK,KAAK,EAA2D,MAAM,KAAK,CAAA;AAwDxF,KAAK,WAAW,GAAG;IACjB,4HAA4H;IAC5H,OAAO,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;IACvB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,KAAK,EAAE,CAAA;CACrB,CAAC;AAwVF,QAAA,MAAM,UAAU;;;2PAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -8,7 +8,7 @@ import WNavItem_default from "./WNavItem.vue.js";
8
8
  import WNavItemTransition_default from "./WNavItemTransition.vue.js";
9
9
  import { useNavGroupDropdown } from "./use/useNavGroupDropdown.js";
10
10
  import WClickOutside_default from "../ClickOutside/WClickOutside.vue.js";
11
- import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
11
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
12
12
  // src/components/Nav/WNavItemExpand.vue?vue&type=script&setup=true&lang.ts
13
13
  var _hoisted_1 = { key: 1 };
14
14
  var _hoisted_2 = { class: "w-nav-bar w-nav-bar-dropdown w-nav-bar-width overflow-y-auto overscroll-contain border border-solid border-line-raised text-start font-normal shadow" };
@@ -20,8 +20,9 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
20
20
  count: {},
21
21
  counter: {},
22
22
  skeleton: { type: Boolean },
23
- indent: { type: Boolean },
23
+ indent: {},
24
24
  queryFields: {},
25
+ paramFields: {},
25
26
  even: { type: Boolean },
26
27
  to: {}
27
28
  },
@@ -33,14 +34,17 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
33
34
  const innerRef = useTemplateRef("inner");
34
35
  const { isOpen: isDropdownOpen, show: showDropdown, hide: hideDropdown, close: closeDropdown } = useNavGroupDropdown();
35
36
  const hasActive = ref(false);
36
- const isActive = computed(() => hasActive.value || (componentRef.value?.isActive ?? false));
37
37
  const hasInnerActive = computed(() => innerRef.value?.some((item) => item.isActive) ?? false);
38
+ const isActive = computed(() => hasInnerActive.value || hasActive.value || (componentRef.value?.isActive ?? false));
38
39
  const isVisible = computed(() => isDropdownOpen.value || isActive.value);
39
40
  const updateHasActive = async () => {
40
41
  await nextTick();
41
42
  hasActive.value = innerRef.value?.some((item) => item.isActive) ?? false;
42
43
  };
43
- watch(hasInnerActive, updateHasActive, { immediate: true });
44
+ watch(hasInnerActive, (value) => {
45
+ hasActive.value = value;
46
+ updateHasActive();
47
+ }, { immediate: true });
44
48
  watch(isActive, updateHasActive, { immediate: true });
45
49
  watch(slotsDefault, updateHasActive, { immediate: true });
46
50
  watch(hasActive, closeDropdown, { immediate: true });
@@ -49,10 +53,11 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
49
53
  isVisible
50
54
  });
51
55
  return (_ctx, _cache) => {
52
- return !slotsDefault.value.length ? (openBlock(), createBlock(WNavItem_default, normalizeProps(mergeProps({ key: 0 }, _ctx.$props)), {
53
- icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
54
- _: 3
55
- }, 16)) : (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(WDropdownMenu_default, {
56
+ return !slotsDefault.value.length ? (openBlock(), createBlock(WNavItem_default, normalizeProps(mergeProps({ key: 0 }, _ctx.$props)), createSlots({ _: 2 }, [_ctx.$slots.icon ? {
57
+ name: "icon",
58
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
59
+ key: "0"
60
+ } : void 0]), 1040)) : (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(WDropdownMenu_default, {
56
61
  "is-open": unref(isDropdownOpen) && !isActive.value,
57
62
  "horizontal-align": unref(HorizontalAlign).RIGHT_OUTER,
58
63
  "parent-element": componentRef.value?.anchorRef ?? void 0,
@@ -74,12 +79,16 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
74
79
  even: __props.even,
75
80
  expand: !__props.to,
76
81
  "query-fields": __props.queryFields,
82
+ "param-fields": __props.paramFields,
77
83
  hovered: unref(isDropdownOpen) && !hasActive.value
78
- }), {
79
- icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
84
+ }), createSlots({
80
85
  right: withCtx(() => [createVNode(unref(IconArrow_default), { class: normalizeClass(["square-3 transition-transform", { "-rotate-90": !hasActive.value && !__props.even }]) }, null, 8, ["class"])]),
81
- _: 3
82
- }, 16, [
86
+ _: 2
87
+ }, [_ctx.$slots.icon ? {
88
+ name: "icon",
89
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
90
+ key: "0"
91
+ } : void 0]), 1040, [
83
92
  "to",
84
93
  "title",
85
94
  "icon",
@@ -91,6 +100,7 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
91
100
  "even",
92
101
  "expand",
93
102
  "query-fields",
103
+ "param-fields",
94
104
  "hovered"
95
105
  ])]),
96
106
  content: withCtx(() => [createVNode(WClickOutside_default, {
@@ -128,7 +138,7 @@ var WNavItemExpand_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
128
138
  ref_for: true,
129
139
  ref: "inner",
130
140
  even: __props.even,
131
- indent: !__props.even
141
+ indent: __props.even ? void 0 : (__props.indent ?? 0) + 1
132
142
  }, null, 8, ["even", "indent"]);
133
143
  }), 128))]),
134
144
  _: 1
@@ -1,6 +1,6 @@
1
1
  import { LinkProps } from '../../types/types';
2
2
  export interface NavItemProps extends LinkProps {
3
- /** Icon before the title. Defaults to the route's `meta.icon`. */
3
+ /** Icon before the title. Defaults to the route's `meta.icon`. Without an icon the title takes its place. */
4
4
  icon?: SVGComponent
5
5
  /** Title of the item. Defaults to the title the route's page registers with `useRouteTitle` while it is open, then the route's `meta.titleShort`, then `meta.title`. */
6
6
  title?: string
@@ -14,10 +14,12 @@ export interface NavItemProps extends LinkProps {
14
14
  hasActive?: boolean
15
15
  /** Marks the item as the toggle of a group without a route of its own. Set by WNavItemExpand. */
16
16
  expand?: boolean
17
- /** Indents the item as a child of a group. Set by WNavItemExpand. */
18
- indent?: boolean
17
+ /** How many groups the item is nested in, which sets its indent. Set by WNavItemExpand. */
18
+ indent?: number
19
19
  /** Query params that must match the current route's for the item to be active, besides its route name. Other params, such as filters, are ignored. */
20
20
  queryFields?: string[]
21
+ /** Route params that must match the current route's for the item to be active, besides its route name. Other route params are ignored. */
22
+ paramFields?: string[]
21
23
  /** Highlights the item as hovered. Set by WNavItemExpand while its menu is open. */
22
24
  hovered?: boolean
23
25
  /** Lays the item out without the indent of a group. Set by WNavItemExpand. */
@@ -25,7 +27,7 @@ export interface NavItemProps extends LinkProps {
25
27
  }
26
28
 
27
29
  export interface NavItemExpandProps extends Partial<LinkProps> {
28
- /** Icon before the title. */
30
+ /** Icon before the title. Without an icon the title takes its place. */
29
31
  icon?: SVGComponent
30
32
  /** Title of the group. */
31
33
  title: string
@@ -35,10 +37,12 @@ export interface NavItemExpandProps extends Partial<LinkProps> {
35
37
  counter?: number
36
38
  /** Shows a placeholder for `count` and hides `counter`, while they load. */
37
39
  skeleton?: boolean
38
- /** Indents the group as a child of another group. */
39
- indent?: boolean
40
+ /** How many groups the group is nested in, which sets its indent. Set by a parent WNavItemExpand. */
41
+ indent?: number
40
42
  /** Query params that must match the current route's for the group's own route to be active. */
41
43
  queryFields?: string[]
44
+ /** Route params that must match the current route's for the group's own route to be active. */
45
+ paramFields?: string[]
42
46
  /** Keeps the items always shown, without indent and without the menu on hover, e.g. for a nav inside a page. */
43
47
  even?: boolean
44
48
  }
@@ -3,7 +3,7 @@ import { ComputedRef } from 'vue';
3
3
  type Router = ReturnType<typeof useRouter>;
4
4
  export type FallbackRouter = {
5
5
  push: Router['push'];
6
- resolve(to: RouteLocationRaw): Pick<ReturnType<Router['resolve']>, 'name' | 'path' | 'query' | 'href' | 'matched'> & {
6
+ resolve(to: RouteLocationRaw): Pick<ReturnType<Router['resolve']>, 'name' | 'path' | 'query' | 'href' | 'matched' | 'params'> & {
7
7
  meta: Record<string, string> | undefined;
8
8
  name: string;
9
9
  };
@@ -16,6 +16,7 @@ export type FallbackRoute = {
16
16
  name: string;
17
17
  path: Route['path'];
18
18
  query: LocationQuery;
19
+ params: Route['params'];
19
20
  hash: Route['hash'];
20
21
  fullPath: Route['fullPath'];
21
22
  matched: Route['matched'];
@@ -1 +1 @@
1
- {"version":3,"file":"useOptionalRouter.d.ts","sourceRoot":"","sources":["../../../src/composables/useOptionalRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,YAAY,CAAA;AAE3G,OAAO,EAAW,KAAK,WAAW,EAAoC,MAAM,KAAK,CAAA;AAkBjF,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAE1C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACpB,OAAO,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAA;IAC7K,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IAC1B,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAmCD,eAAO,MAAM,iBAAiB,QAAO,cAcpC,CAAA;AAED,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,KAAK,EAAE,aAAa,CAAA;IACpB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAQD,eAAO,MAAM,gBAAgB,QAAO,aAiCnC,CAAA;AAUD,eAAO,MAAM,uBAAuB,QAAO,WAAW,CAAC,qBAAqB,GAAG,SAAS,CAAC,GAAG,SAkB3F,CAAA"}
1
+ {"version":3,"file":"useOptionalRouter.d.ts","sourceRoot":"","sources":["../../../src/composables/useOptionalRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,YAAY,CAAA;AAE3G,OAAO,EAAW,KAAK,WAAW,EAAoC,MAAM,KAAK,CAAA;AAkBjF,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;AAE1C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACpB,OAAO,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,GAAG;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAA;IACxL,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IAC1B,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAoCD,eAAO,MAAM,iBAAiB,QAAO,cAcpC,CAAA;AAED,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAA;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,KAAK,EAAE,aAAa,CAAA;IACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACvB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;IAC3B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,CAAA;AAQD,eAAO,MAAM,gBAAgB,QAAO,aAkCnC,CAAA;AAUD,eAAO,MAAM,uBAAuB,QAAO,WAAW,CAAC,qBAAqB,GAAG,SAAS,CAAC,GAAG,SAkB3F,CAAA"}
@@ -19,6 +19,7 @@ var fallbackRouter = {
19
19
  href: typeof to === "string" ? to : "href" in to && typeof to.href === "string" ? to.href : to.path ?? "",
20
20
  path: typeof to === "string" ? to.split(/[?#]/)[0] : "path" in to ? to.path ?? "" : "",
21
21
  query: typeof to === "string" ? {} : to.query ?? {},
22
+ params: {},
22
23
  meta: void 0
23
24
  };
24
25
  return {
@@ -63,6 +64,7 @@ var useOptionalRoute = () => {
63
64
  const url = new URL(window.location.href);
64
65
  return {
65
66
  query: Object.fromEntries(url.searchParams.entries()),
67
+ params: {},
66
68
  name: url.pathname,
67
69
  path: url.pathname,
68
70
  hash: url.hash,
@@ -26,6 +26,8 @@ The `footer` slot is the nav's bottom, such as a back button or the app's versio
26
26
 
27
27
  `WNavItemExpand` groups items under a title. The items show under it while one of them is active; otherwise hovering the group opens them in a menu to the right. One group's menu is open at a time, so moving down the nav switches it. The menu lines up with the group by its top, or by its bottom low on the screen, and shifts to stay on screen when it is taller than the room there — it scrolls once taller than the screen. With `to`, the group is a link of its own. `even` keeps the items always shown and not indented, for a nav inside a page.
28
28
 
29
+ Groups can nest, and each level indents further. Items without an icon, from neither `icon`, the `icon` slot nor `meta.icon`, start with the title.
30
+
29
31
  `WNavItemTransition` wraps a list of items so that the ones added or removed with `v-if` — such as an item for the current record — expand and collapse.
30
32
 
31
33
  The demo below uses `even` to show a group inside a page. Its items link to pages of this site, so the one you're on is active.
@@ -169,15 +171,16 @@ import WNavItem from 'eco-vue-js/dist/components/Nav/WNavItem.vue'
169
171
 
170
172
  | Prop | Type | Default | Description |
171
173
  | --- | --- | --- | --- |
172
- | `icon` | `SVGComponent` | — | Icon before the title. Defaults to the route's `meta.icon`. |
174
+ | `icon` | `SVGComponent` | — | Icon before the title. Defaults to the route's `meta.icon`. Without an icon the title takes its place. |
173
175
  | `title` | `string` | — | Title of the item. Defaults to the title the route's page registers with `useRouteTitle` while it is open, then the route's `meta.titleShort`, then `meta.title`. |
174
176
  | `count` | `number` | — | Number after the title in brackets, such as the number of items on the page it opens. |
175
177
  | `counter` | `number` | — | Number in a badge over the end of the title, such as unread items. Hidden at 0. |
176
178
  | `skeleton` | `boolean` | — | Shows a placeholder for `count` and hides `counter`, while they load. |
177
179
  | `hasActive` | `boolean` | — | Marks the item as the parent of the active item. Set by WNavItemExpand. |
178
180
  | `expand` | `boolean` | — | Marks the item as the toggle of a group without a route of its own. Set by WNavItemExpand. |
179
- | `indent` | `boolean` | — | Indents the item as a child of a group. Set by WNavItemExpand. |
181
+ | `indent` | `number` | — | How many groups the item is nested in, which sets its indent. Set by WNavItemExpand. |
180
182
  | `queryFields` | `string[]` | — | Query params that must match the current route's for the item to be active, besides its route name. Other params, such as filters, are ignored. |
183
+ | `paramFields` | `string[]` | — | Route params that must match the current route's for the item to be active, besides its route name. Other route params are ignored. |
181
184
  | `hovered` | `boolean` | — | Highlights the item as hovered. Set by WNavItemExpand while its menu is open. |
182
185
  | `even` | `boolean` | — | Lays the item out without the indent of a group. Set by WNavItemExpand. |
183
186
  | `to` | `RouteLocationRaw` | **required** | Router location — renders a router link. Needs vue-router installed in the app. |
@@ -199,13 +202,14 @@ import WNavItemExpand from 'eco-vue-js/dist/components/Nav/WNavItemExpand.vue'
199
202
 
200
203
  | Prop | Type | Default | Description |
201
204
  | --- | --- | --- | --- |
202
- | `icon` | `SVGComponent` | — | Icon before the title. |
205
+ | `icon` | `SVGComponent` | — | Icon before the title. Without an icon the title takes its place. |
203
206
  | `title` | `string` | **required** | Title of the group. |
204
207
  | `count` | `number` | — | Number after the title in brackets. |
205
208
  | `counter` | `number` | — | Number in a badge over the end of the title. Hidden at 0. |
206
209
  | `skeleton` | `boolean` | — | Shows a placeholder for `count` and hides `counter`, while they load. |
207
- | `indent` | `boolean` | — | Indents the group as a child of another group. |
210
+ | `indent` | `number` | — | How many groups the group is nested in, which sets its indent. Set by a parent WNavItemExpand. |
208
211
  | `queryFields` | `string[]` | — | Query params that must match the current route's for the group's own route to be active. |
212
+ | `paramFields` | `string[]` | — | Route params that must match the current route's for the group's own route to be active. |
209
213
  | `even` | `boolean` | — | Keeps the items always shown, without indent and without the menu on hover, e.g. for a nav inside a page. |
210
214
  | `to` | `RouteLocationRaw` | — | Router location — renders a router link. Needs vue-router installed in the app. |
211
215
 
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # eco-vue-js
2
2
 
3
- > Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.26.31, the one installed next to them. Start with Getting started and Conventions; each component page lists its props, events and slots with examples.
3
+ > Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.27.1, the one installed next to them. Start with Getting started and Conventions; each component page lists its props, events and slots with examples.
4
4
 
5
5
  Release notes, for what changed between versions: https://github.com/rsmple/eco-vue-js/releases. The docs site, with live demos: https://rsmple.github.io/eco-vue-js/
6
6
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.26.31",
7
+ "version": "0.27.1",
8
8
  "homepage": "https://rsmple.github.io/eco-vue-js/",
9
9
  "dependencies": {
10
10
  "@stylistic/eslint-plugin": "5.10.0",