eco-vue-js 0.24.0 → 0.25.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.
Files changed (56) hide show
  1. package/dist/components/Button/WButtonCopy.vue.d.ts +2 -0
  2. package/dist/components/Button/WButtonCopy.vue.d.ts.map +1 -1
  3. package/dist/components/Button/WButtonCopy.vue_vue_type_script_setup_true_lang.js +11 -6
  4. package/dist/components/Button/WButtonTab.vue.d.ts +3 -0
  5. package/dist/components/Button/WButtonTab.vue.d.ts.map +1 -1
  6. package/dist/components/Button/WButtonTab.vue_vue_type_script_setup_true_lang.js +94 -88
  7. package/dist/components/Chip/WChip.vue.d.ts +5 -0
  8. package/dist/components/Chip/WChip.vue.d.ts.map +1 -1
  9. package/dist/components/Chip/WChip.vue_vue_type_script_setup_true_lang.js +10 -4
  10. package/dist/components/HeaderBar/WHeaderBar.vue.d.ts +1 -1
  11. package/dist/components/HeaderBar/WHeaderBar.vue.d.ts.map +1 -1
  12. package/dist/components/HeaderBar/WHeaderBar.vue_vue_type_script_setup_true_lang.js +63 -7
  13. package/dist/components/Link/WLink.vue.d.ts.map +1 -1
  14. package/dist/components/Link/WLink.vue_vue_type_script_setup_true_lang.js +1 -1
  15. package/dist/components/Nav/WNavItem.vue.d.ts.map +1 -1
  16. package/dist/components/Nav/WNavItem.vue_vue_type_script_setup_true_lang.js +28 -20
  17. package/dist/components/Nav/types.d.ts +1 -1
  18. package/dist/components/Notify/WNotify.vue_vue_type_script_setup_true_lang.js +3 -3
  19. package/dist/components/Notify/models/NotifyType.d.ts +1 -1
  20. package/dist/components/Notify/models/NotifyType.d.ts.map +1 -1
  21. package/dist/components/Notify/models/NotifyType.js +1 -1
  22. package/dist/components/Notify/models/notifyCenter.d.ts.map +1 -1
  23. package/dist/components/Notify/models/notifyCenter.js +4 -2
  24. package/dist/components/RouterLink/WRouterLink.vue.d.ts +2 -0
  25. package/dist/components/RouterLink/WRouterLink.vue.d.ts.map +1 -1
  26. package/dist/components/RouterLink/WRouterLink.vue_vue_type_script_setup_true_lang.js +5 -1
  27. package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
  28. package/dist/components/Tabs/WTabs.vue_vue_type_script_setup_true_lang.js +19 -5
  29. package/dist/components/Tabs/WTabsItem.vue_vue_type_script_setup_true_lang.js +2 -1
  30. package/dist/components/Tabs/components/TabTitleButton.vue.d.ts +2 -0
  31. package/dist/components/Tabs/components/TabTitleButton.vue.d.ts.map +1 -1
  32. package/dist/components/Tabs/components/TabTitleButton.vue_vue_type_script_setup_true_lang.js +5 -2
  33. package/dist/components/Tabs/types.d.ts +7 -0
  34. package/dist/components/Tabs/types.d.ts.map +1 -1
  35. package/dist/composables/useOptionalRouter.d.ts +6 -2
  36. package/dist/composables/useOptionalRouter.d.ts.map +1 -1
  37. package/dist/composables/useOptionalRouter.js +21 -2
  38. package/dist/main.d.ts +1 -0
  39. package/dist/main.d.ts.map +1 -1
  40. package/dist/main.js +3 -2
  41. package/dist/utils/SemanticType.d.ts +9 -0
  42. package/dist/utils/SemanticType.d.ts.map +1 -1
  43. package/dist/utils/SemanticType.js +15 -1
  44. package/dist/utils/useRouteTitle.d.ts +22 -0
  45. package/dist/utils/useRouteTitle.d.ts.map +1 -0
  46. package/dist/utils/useRouteTitle.js +75 -0
  47. package/docs/components/button.md +2 -1
  48. package/docs/components/chip.md +26 -6
  49. package/docs/components/header-bar.md +30 -1
  50. package/docs/components/links.md +1 -0
  51. package/docs/components/nav-bar.md +1 -1
  52. package/docs/components/notify.md +2 -2
  53. package/docs/components/tabs.md +13 -0
  54. package/docs/llms.txt +1 -1
  55. package/docs/recipes/list-with-fields.md +0 -1
  56. package/package.json +4 -1
@@ -1,6 +1,8 @@
1
1
  type __VLS_Props = {
2
2
  /** Text copied to the clipboard on click. */
3
3
  value: string;
4
+ /** Lays the button out as a regular block instead of sizing it to one line of the surrounding text. */
5
+ noInline?: boolean;
4
6
  };
5
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
8
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"WButtonCopy.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonCopy.vue"],"names":[],"mappings":"AAoBA;AA2CA,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAyEF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"WButtonCopy.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonCopy.vue"],"names":[],"mappings":"AA0BA;AAmDA,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,uGAAuG;IACvG,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAyFF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,21 +1,26 @@
1
1
  import WTooltip_default from "../Tooltip/WTooltip.vue.js";
2
2
  import { useCopy } from "../../utils/useCopy.js";
3
- import { createBlock, createElementBlock, createVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, toRef, unref, withModifiers } from "vue";
3
+ import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveDynamicComponent, toRef, unref, withModifiers } from "vue";
4
4
  //#region src/components/Button/WButtonCopy.vue?vue&type=script&setup=true&lang.ts
5
+ var _hoisted_1 = { class: "select-none relative inline-grid items-center justify-center min-w-[1.25em]" };
6
+ var _hoisted_2 = { class: "w-hover-circle relative" };
5
7
  var WButtonCopy_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
6
8
  __name: "WButtonCopy",
7
- props: { value: {} },
9
+ props: {
10
+ value: {},
11
+ noInline: { type: Boolean }
12
+ },
8
13
  setup(__props) {
9
14
  const { doCopy, iconCopy, copied } = useCopy(toRef(__props, "value"));
10
15
  return (_ctx, _cache) => {
11
- return openBlock(), createElementBlock("button", {
12
- class: "text-description w-hover-circle relative inline-block cursor-pointer select-none",
16
+ return openBlock(), createElementBlock("span", _hoisted_1, [!__props.noInline ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode("\xA0")], 64)) : createCommentVNode("", true), createElementVNode("button", {
17
+ class: normalizeClass(["text-description inline-block p-2 -m-2 w-hover-circle-trigger cursor-pointer", __props.noInline ? void 0 : "absolute"]),
13
18
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(doCopy)(), ["stop"]))
14
- }, [(openBlock(), createBlock(resolveDynamicComponent(unref(iconCopy)), { class: normalizeClass(["square-[1.25em] mt-[-0.125em]", { "tone-primary text-tone": unref(copied) }]) }, null, 8, ["class"])), createVNode(WTooltip_default, {
19
+ }, [createElementVNode("div", _hoisted_2, [(openBlock(), createBlock(resolveDynamicComponent(unref(iconCopy)), { class: normalizeClass(["square-[1.25em]", { "tone-primary text-tone": unref(copied) }]) }, null, 8, ["class"]))]), createVNode(WTooltip_default, {
15
20
  class: "pointer-events-none",
16
21
  text: "Copy",
17
22
  "no-touch": ""
18
- })]);
23
+ })], 2)]);
19
24
  };
20
25
  }
21
26
  });
@@ -1,3 +1,4 @@
1
+ import { LinkProps } from '../../types/types';
1
2
  type __VLS_Props = {
2
3
  /** Marks the button as the open tab: primary text and an underline. */
3
4
  active?: boolean;
@@ -25,6 +26,8 @@ type __VLS_Props = {
25
26
  enableOverflow?: boolean;
26
27
  /** Number shown in a badge after the title, tinted while the tab is open. */
27
28
  count?: number;
29
+ /** Router location — renders a link that replaces the current history entry, unless `disabled`. */
30
+ to?: LinkProps['to'];
28
31
  };
29
32
  type __VLS_Slots = {
30
33
  /** Content of the button, replacing the title, icon, count and status icon. */
@@ -1 +1 @@
1
- {"version":3,"file":"WButtonTab.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonTab.vue"],"names":[],"mappings":"AAgJA;AAgNA,KAAK,WAAW,GAAG;IACjB,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AASF,KAAK,WAAW,GAAG;IACjB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAA;IACvF,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAA;CACzF,CAAC;AAgVF,QAAA,MAAM,UAAU;;;;kFAGd,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":"WButtonTab.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonTab.vue"],"names":[],"mappings":"AAiJA;AA4MA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAa5C,KAAK,WAAW,GAAG;IACjB,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mGAAmG;IACnG,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;CACrB,CAAC;AASF,KAAK,WAAW,GAAG;IACjB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAA;IACvF,uDAAuD;IACvD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAA;CACzF,CAAC;AA0WF,QAAA,MAAM,UAAU;;;;kFAGd,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,14 +1,14 @@
1
1
  import { numberFormatter } from "../../utils/utils.js";
2
+ import WRouterLink_default from "../RouterLink/WRouterLink.vue.js";
2
3
  import IconCheckCircle_default from "../../assets/icons/IconCheckCircle.js";
3
4
  import IconClose_default from "../../assets/icons/IconClose.js";
4
5
  import IconNegativeInfo_default from "../../assets/icons/IconNegativeInfo.js";
5
6
  import WEmptyComponent_default from "../EmptyComponent/WEmptyComponent.vue.js";
6
7
  import WStatusIcon_default from "../Status/WStatusIcon.vue.js";
7
8
  import WTextOverflow_default from "../TextOverflow/WTextOverflow.vue.js";
8
- import { Suspense, Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, normalizeClass, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
9
+ import { Suspense, Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
9
10
  //#region src/components/Button/WButtonTab.vue?vue&type=script&setup=true&lang.ts
10
- var _hoisted_1 = ["disabled"];
11
- var _hoisted_2 = {
11
+ var _hoisted_1 = {
12
12
  key: 0,
13
13
  class: "p-8"
14
14
  };
@@ -27,107 +27,113 @@ var WButtonTab_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
27
27
  statusIcon: { type: Boolean },
28
28
  showHasValue: { type: Boolean },
29
29
  enableOverflow: { type: Boolean },
30
- count: {}
30
+ count: {},
31
+ to: {}
31
32
  },
32
33
  emits: ["click"],
33
34
  setup(__props) {
34
35
  return (_ctx, _cache) => {
35
- return openBlock(), createElementBlock("button", {
36
- disabled: __props.disabled,
37
- class: normalizeClass(["w-ripple-trigger grid select-none grid-cols-[auto_1fr] font-semibold outline-none", {
36
+ return openBlock(), createBlock(resolveDynamicComponent(__props.to && !__props.disabled ? WRouterLink_default : "button"), mergeProps(__props.to && !__props.disabled ? {
37
+ to: __props.to,
38
+ replace: true
39
+ } : { disabled: __props.disabled }, {
40
+ class: ["w-ripple-trigger grid select-none grid-cols-[auto_1fr] font-semibold outline-none", {
38
41
  "tone-primary text-tone": !__props.hasError && __props.active,
39
42
  "tone-negative text-tone": __props.hasError,
40
43
  "tone-positive text-tone": !__props.active && !__props.hasError && __props.hasValue && __props.showHasValue,
41
44
  "text-description": !__props.active && !__props.hasError && (!__props.showHasValue || !__props.hasValue),
42
45
  "cursor-not-allowed opacity-50": __props.disabled,
43
46
  "cursor-pointer": !__props.disabled
44
- }]),
47
+ }],
45
48
  onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabled && _ctx.$emit("click", $event))
46
- }, [__props.indicator ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", { class: normalizeClass(["text-surface rounded-full bg-inherit p-1 outline transition-[outline-width] duration-500", {
47
- "tone-negative bg-tone-fill outline-tone/10": __props.hasError,
48
- "tone-positive bg-tone-fill outline-tone/10": !__props.hasError && __props.hasValue && __props.showHasValue,
49
- "bg-track-strong outline-track-strong/10": !__props.hasError && (!__props.showHasValue || !__props.hasValue),
50
- "outline-[1.5rem]": __props.active
51
- }]) }, [__props.hasError ? (openBlock(), createBlock(unref(IconNegativeInfo_default), {
52
- key: 0,
53
- class: "size-8"
54
- })) : __props.hasValue ? (openBlock(), createBlock(unref(IconCheckCircle_default), {
55
- key: 1,
56
- class: "size-8"
57
- })) : (openBlock(), createBlock(unref(IconClose_default), {
58
- key: 2,
59
- class: "size-8"
60
- }))], 2)])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["relative col-start-2 self-start", {
61
- "mt-3.5": __props.indicator,
62
- "w-ripple w-ripple-hover": !__props.disabled
63
- }]) }, [
64
- _ctx.$slots.title ? renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({
65
- hasChanges: __props.hasChanges,
66
- hasError: __props.hasError,
67
- hasValue: __props.hasValue
68
- })), void 0, void 0, 0) : (openBlock(), createElementBlock("div", {
49
+ }), {
50
+ default: withCtx(() => [__props.indicator ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", { class: normalizeClass(["text-surface rounded-full bg-inherit p-1 outline transition-[outline-width] duration-500", {
51
+ "tone-negative bg-tone-fill outline-tone/10": __props.hasError,
52
+ "tone-positive bg-tone-fill outline-tone/10": !__props.hasError && __props.hasValue && __props.showHasValue,
53
+ "bg-track-strong outline-track-strong/10": !__props.hasError && (!__props.showHasValue || !__props.hasValue),
54
+ "outline-[1.5rem]": __props.active
55
+ }]) }, [__props.hasError ? (openBlock(), createBlock(unref(IconNegativeInfo_default), {
56
+ key: 0,
57
+ class: "size-8"
58
+ })) : __props.hasValue ? (openBlock(), createBlock(unref(IconCheckCircle_default), {
69
59
  key: 1,
70
- class: normalizeClass(["group/overflow grid grid-cols-[1fr_auto] items-center py-2", {
71
- "justify-center text-center": !__props.side,
72
- "text-start": __props.side
73
- }])
74
- }, [
75
- createElementVNode("div", { class: normalizeClass(["whitespace-nowrap px-3", { "sm-not:pl---inner-margin": __props.side }]) }, [(openBlock(), createBlock(resolveDynamicComponent(__props.enableOverflow ? WTextOverflow_default : WEmptyComponent_default), null, {
76
- default: withCtx(() => [
77
- __props.icon !== void 0 ? (openBlock(), createBlock(Suspense, { key: 0 }, {
78
- fallback: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("svg", { class: "square-[1.25em] -mt-1 inline" }, [createElementVNode("g")], -1)])]),
79
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon), { class: "square-[1.25em] -mt-1 inline" }))]),
80
- _: 1
81
- })) : createCommentVNode("", true),
82
- createTextVNode(" " + toDisplayString(__props.title) + " ", 1),
83
- __props.count !== void 0 ? (openBlock(), createElementBlock("span", {
84
- key: 1,
85
- class: normalizeClass(["ml-0.5 inline-block min-w-[1.75em] rounded-full px-1.5 text-center text-xs/5 tabular-nums", __props.active && !__props.hasError ? "bg-tone-soft" : "bg-surface-muted text-description"])
86
- }, toDisplayString(unref(numberFormatter).format(__props.count)), 3)) : createCommentVNode("", true)
87
- ]),
88
- _: 1
89
- }))], 2),
90
- __props.statusIcon ? (openBlock(), createBlock(WStatusIcon_default, {
91
- key: 0,
92
- "has-value": __props.hasValue,
93
- "has-error": __props.hasError,
94
- class: "sm-not:mr---inner-margin square-4 ml-auto mr-4"
95
- }, null, 8, ["has-value", "has-error"])) : createCommentVNode("", true),
96
- renderSlot(_ctx.$slots, "suffix", normalizeProps(guardReactiveProps({
60
+ class: "size-8"
61
+ })) : (openBlock(), createBlock(unref(IconClose_default), {
62
+ key: 2,
63
+ class: "size-8"
64
+ }))], 2)])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["relative col-start-2 self-start", {
65
+ "mt-3.5": __props.indicator,
66
+ "w-ripple w-ripple-hover": !__props.disabled
67
+ }]) }, [
68
+ _ctx.$slots.title ? renderSlot(_ctx.$slots, "title", normalizeProps(guardReactiveProps({
97
69
  hasChanges: __props.hasChanges,
98
70
  hasError: __props.hasError,
99
71
  hasValue: __props.hasValue
100
- })))
101
- ], 2)),
102
- createVNode(Transition, {
103
- "enter-active-class": "transition-opacity",
104
- "leave-active-class": "transition-opacity",
105
- "enter-from-class": "opacity-0",
106
- "leave-to-class": "opacity-0"
107
- }, {
108
- default: withCtx(() => [__props.hasChanges ? (openBlock(), createElementBlock("div", {
109
- key: 0,
110
- class: normalizeClass(["square-2 absolute right-1 top-1 rounded-full", {
111
- "tone-info bg-tone-fill": !__props.hasError,
112
- "tone-negative bg-tone-fill": __props.hasError
72
+ })), void 0, void 0, 0) : (openBlock(), createElementBlock("div", {
73
+ key: 1,
74
+ class: normalizeClass(["group/overflow grid grid-cols-[1fr_auto] items-center py-2", {
75
+ "justify-center text-center": !__props.side,
76
+ "text-start": __props.side
113
77
  }])
114
- }, null, 2)) : createCommentVNode("", true)]),
115
- _: 1
116
- }),
117
- createVNode(Transition, {
118
- "enter-active-class": "transition-[scale,opacity] origin-center duration-300",
119
- "leave-active-class": "transition-[scale,opacity] origin-center duration-300",
120
- "enter-from-class": "scale-x-0 opacity-0",
121
- "leave-to-class": "scale-x-0 opacity-0",
122
- css: !__props.indicator
123
- }, {
124
- default: withCtx(() => [__props.active || __props.indicator ? (openBlock(), createElementBlock("div", {
125
- key: 0,
126
- class: normalizeClass(["absolute inset-x-0 bg-current bottom-0 h-0.5 rounded-sm", { "sm-not:left---inner-margin": __props.side }])
127
- }, null, 2)) : createCommentVNode("", true)]),
128
- _: 1
129
- }, 8, ["css"])
130
- ], 2)], 10, _hoisted_1);
78
+ }, [
79
+ createElementVNode("div", { class: normalizeClass(["whitespace-nowrap px-3", { "sm-not:pl---inner-margin": __props.side }]) }, [(openBlock(), createBlock(resolveDynamicComponent(__props.enableOverflow ? WTextOverflow_default : WEmptyComponent_default), null, {
80
+ default: withCtx(() => [
81
+ __props.icon !== void 0 ? (openBlock(), createBlock(Suspense, { key: 0 }, {
82
+ fallback: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("svg", { class: "square-[1.25em] -mt-1 inline" }, [createElementVNode("g")], -1)])]),
83
+ default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon), { class: "square-[1.25em] -mt-1 inline" }))]),
84
+ _: 1
85
+ })) : createCommentVNode("", true),
86
+ createTextVNode(" " + toDisplayString(__props.title) + " ", 1),
87
+ __props.count !== void 0 ? (openBlock(), createElementBlock("span", {
88
+ key: 1,
89
+ class: normalizeClass(["ml-0.5 inline-block min-w-[1.75em] rounded-full px-1.5 text-center text-xs/5 tabular-nums", __props.active && !__props.hasError ? "bg-tone-soft" : "bg-surface-muted text-description"])
90
+ }, toDisplayString(unref(numberFormatter).format(__props.count)), 3)) : createCommentVNode("", true)
91
+ ]),
92
+ _: 1
93
+ }))], 2),
94
+ __props.statusIcon ? (openBlock(), createBlock(WStatusIcon_default, {
95
+ key: 0,
96
+ "has-value": __props.hasValue,
97
+ "has-error": __props.hasError,
98
+ class: "sm-not:mr---inner-margin square-4 ml-auto mr-4"
99
+ }, null, 8, ["has-value", "has-error"])) : createCommentVNode("", true),
100
+ renderSlot(_ctx.$slots, "suffix", normalizeProps(guardReactiveProps({
101
+ hasChanges: __props.hasChanges,
102
+ hasError: __props.hasError,
103
+ hasValue: __props.hasValue
104
+ })))
105
+ ], 2)),
106
+ createVNode(Transition, {
107
+ "enter-active-class": "transition-opacity",
108
+ "leave-active-class": "transition-opacity",
109
+ "enter-from-class": "opacity-0",
110
+ "leave-to-class": "opacity-0"
111
+ }, {
112
+ default: withCtx(() => [__props.hasChanges ? (openBlock(), createElementBlock("div", {
113
+ key: 0,
114
+ class: normalizeClass(["square-2 absolute right-1 top-1 rounded-full", {
115
+ "tone-info bg-tone-fill": !__props.hasError,
116
+ "tone-negative bg-tone-fill": __props.hasError
117
+ }])
118
+ }, null, 2)) : createCommentVNode("", true)]),
119
+ _: 1
120
+ }),
121
+ createVNode(Transition, {
122
+ "enter-active-class": "transition-[scale,opacity] origin-center duration-300",
123
+ "leave-active-class": "transition-[scale,opacity] origin-center duration-300",
124
+ "enter-from-class": "scale-x-0 opacity-0",
125
+ "leave-to-class": "scale-x-0 opacity-0",
126
+ css: !__props.indicator
127
+ }, {
128
+ default: withCtx(() => [__props.active || __props.indicator ? (openBlock(), createElementBlock("div", {
129
+ key: 0,
130
+ class: normalizeClass(["absolute inset-x-0 bg-current bottom-0 h-0.5 rounded-sm", { "sm-not:left---inner-margin": __props.side }])
131
+ }, null, 2)) : createCommentVNode("", true)]),
132
+ _: 1
133
+ }, 8, ["css"])
134
+ ], 2)]),
135
+ _: 3
136
+ }, 16, ["class"]);
131
137
  };
132
138
  }
133
139
  });
@@ -4,6 +4,10 @@ type __VLS_Props = {
4
4
  text?: string;
5
5
  /** Color scheme of the chip. */
6
6
  semanticType?: SemanticType;
7
+ /** Renders a rounded pill with a tinted background and colored text instead of a filled box. */
8
+ soft?: boolean;
9
+ /** Icon shown before the label. */
10
+ icon?: SVGComponent;
7
11
  /** Shows a placeholder instead of the chip. When unset, inherits the skeleton state provided by a parent. */
8
12
  skeleton?: boolean;
9
13
  };
@@ -14,6 +18,7 @@ type __VLS_Slots = {
14
18
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
19
  text: string;
16
20
  skeleton: boolean;
21
+ icon: SVGComponent;
17
22
  semanticType: SemanticType;
18
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
19
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1 +1 @@
1
- {"version":3,"file":"WChip.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/WChip.vue"],"names":[],"mappings":"AAgBA;AAmDA,OAAO,EAAC,YAAY,EAAyB,MAAM,sBAAsB,CAAA;AAGzE,KAAK,WAAW,GAAG;IACf,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAUJ,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;AAgEF,QAAA,MAAM,UAAU;UAlFL,MAAM;cAIF,OAAO;kBAFH,YAAY;6EAmF7B,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WChip.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/WChip.vue"],"names":[],"mappings":"AAwBA;AAmEA,OAAO,EAAC,YAAY,EAAqD,MAAM,sBAAsB,CAAA;AAGrG,KAAK,WAAW,GAAG;IACf,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,gGAAgG;IAChG,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,mCAAmC;IACnC,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAWJ,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;AA6EF,QAAA,MAAM,UAAU;UApGL,MAAM;cAQF,OAAO;UAFX,YAAY;kBAJJ,YAAY;6EAqG7B,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,13 +1,15 @@
1
- import { SemanticType, useSemanticTypeChipMap } from "../../utils/SemanticType.js";
1
+ import { SemanticType, useSemanticTypeChipMap, useSemanticTypeChipSoftMap } from "../../utils/SemanticType.js";
2
2
  import WSkeleton_default from "../Skeleton/WSkeleton.vue.js";
3
3
  import { useComponentStatesSkeleton } from "../../utils/useComponentStates.js";
4
- import { createBlock, createElementBlock, createTextVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref } from "vue";
4
+ import { createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref } from "vue";
5
5
  //#region src/components/Chip/WChip.vue?vue&type=script&setup=true&lang.ts
6
6
  var WChip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
7
7
  __name: "WChip",
8
8
  props: {
9
9
  text: { default: void 0 },
10
10
  semanticType: { default: SemanticType.SECONDARY },
11
+ soft: { type: Boolean },
12
+ icon: { default: void 0 },
11
13
  skeleton: {
12
14
  type: Boolean,
13
15
  default: void 0
@@ -16,14 +18,18 @@ var WChip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
16
18
  setup(__props) {
17
19
  const { isSkeleton } = useComponentStatesSkeleton(__props);
18
20
  const semanticTypeChipMap = useSemanticTypeChipMap();
21
+ const semanticTypeChipSoftMap = useSemanticTypeChipSoftMap();
19
22
  return (_ctx, _cache) => {
20
23
  return unref(isSkeleton) ? (openBlock(), createBlock(WSkeleton_default, {
21
24
  key: 0,
22
25
  class: "w-skeleton-h-5 max-w-28"
23
26
  })) : (openBlock(), createElementBlock("div", {
24
27
  key: 1,
25
- class: normalizeClass(["w-max rounded-md px-2 py-0.5 text-xs font-semibold", unref(semanticTypeChipMap)[__props.semanticType]])
26
- }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 2));
28
+ class: normalizeClass(["w-max", __props.soft ? ["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium", unref(semanticTypeChipSoftMap)[__props.semanticType]] : ["rounded-md px-2 py-0.5 text-xs font-semibold", unref(semanticTypeChipMap)[__props.semanticType]]])
29
+ }, [__props.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), {
30
+ key: 0,
31
+ class: "square-[1em] shrink-0"
32
+ })) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 2));
27
33
  };
28
34
  }
29
35
  });
@@ -1,5 +1,5 @@
1
1
  type __VLS_Props = {
2
- /** Title of the page. The `title` slot replaces it. */
2
+ /** Title of the page. The `title` slot replaces it. Without both, the header shows the titles of the current route: a breadcrumb of its parents and the page title, see `useRouteTitle`. */
3
3
  title?: string;
4
4
  };
5
5
  type __VLS_Slots = {
@@ -1 +1 @@
1
- {"version":3,"file":"WHeaderBar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/HeaderBar/WHeaderBar.vue"],"names":[],"mappings":"AAuDA;AAoIA,KAAK,WAAW,GAAG;IACjB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAC;AA2LF,QAAA,MAAM,UAAU,kSAEd,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":"WHeaderBar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/HeaderBar/WHeaderBar.vue"],"names":[],"mappings":"AA+HA;AA0NA,KAAK,WAAW,GAAG;IACjB,4LAA4L;IAC5L,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAGF,KAAK,WAAW,GAAG;IACjB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAC;AAqUF,QAAA,MAAM,UAAU,kSAEd,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,13 +1,41 @@
1
1
  import { wBaseZIndex } from "../../utils/utils.js";
2
+ import WRouterLink_default from "../RouterLink/WRouterLink.vue.js";
3
+ import WSkeleton_default from "../Skeleton/WSkeleton.vue.js";
4
+ import WTooltip_default from "../Tooltip/WTooltip.vue.js";
2
5
  import IconSearch_default from "../../assets/icons/IconSearch.js";
6
+ import { getRouteTitleShort, useRouteTitles } from "../../utils/useRouteTitle.js";
3
7
  import { useHeader } from "./use/useHeader.js";
4
8
  import { useHeaderSearch } from "./use/useHeaderSearch.js";
5
9
  import { useHeaderSearchVisible } from "./use/useHeaderSearchVisible.js";
6
- import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, vShow, withDirectives } from "vue";
10
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives } from "vue";
7
11
  //#region src/components/HeaderBar/WHeaderBar.vue?vue&type=script&setup=true&lang.ts
8
- var _hoisted_1 = { class: "text-accent sm:text-2.5xl flex-1 truncate text-xl font-semibold" };
9
- var _hoisted_2 = { class: "w-ripple w-ripple-hover sm-not:px---inner-margin relative flex h-full items-center px-(--w-list-padding,1rem)" };
12
+ var _hoisted_1 = {
13
+ key: 0,
14
+ class: "text-accent sm:text-2.5xl flex-1 truncate text-xl font-semibold"
15
+ };
16
+ var _hoisted_2 = {
17
+ key: 1,
18
+ class: "flex min-w-0 flex-1 items-baseline gap-2 text-lg leading-tight sm:text-xl"
19
+ };
10
20
  var _hoisted_3 = {
21
+ key: 0,
22
+ "aria-label": "Breadcrumb",
23
+ class: "sm-not:hidden text-description flex shrink-0 items-baseline gap-2"
24
+ };
25
+ var _hoisted_4 = {
26
+ key: 1,
27
+ class: "max-w-64 truncate"
28
+ };
29
+ var _hoisted_5 = {
30
+ key: 1,
31
+ class: "text-accent min-w-0 truncate font-semibold"
32
+ };
33
+ var _hoisted_6 = {
34
+ key: 2,
35
+ class: "flex min-w-max flex-1 items-center self-center"
36
+ };
37
+ var _hoisted_7 = { class: "w-ripple w-ripple-hover sm-not:px---inner-margin relative flex h-full items-center px-(--w-list-padding,1rem)" };
38
+ var _hoisted_8 = {
11
39
  key: 0,
12
40
  class: "xl-not:pl---header-height px---inner-margin grid items-center"
13
41
  };
@@ -19,6 +47,9 @@ var WHeaderBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
19
47
  const { headerPadding, updateHeaderHeight } = useHeader();
20
48
  const { search } = useHeaderSearch();
21
49
  const { visible, updateVisible } = useHeaderSearchVisible();
50
+ const { titles } = useRouteTitles();
51
+ const parentTitles = computed(() => titles.value.slice(0, -1));
52
+ const currentTitle = computed(() => titles.value.at(-1));
22
53
  const elementRef = useTemplateRef("element");
23
54
  const isTransparent = ref(false);
24
55
  let timeout;
@@ -57,16 +88,41 @@ var WHeaderBar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
57
88
  style: normalizeStyle({ "--header-height-padding": unref(headerPadding) + "px" })
58
89
  }, null, 6)),
59
90
  withDirectives(createElementVNode("div", { class: normalizeClass(["pl---inner-margin xl-not:pl---header-height relative flex items-center", { "pr---inner-margin": !unref(search) }]) }, [
60
- createElementVNode("h1", _hoisted_1, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])]),
91
+ __props.title !== void 0 || _ctx.$slots.title ? (openBlock(), createElementBlock("h1", _hoisted_1, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)])])) : (openBlock(), createElementBlock("div", _hoisted_2, [
92
+ parentTitles.value.length ? (openBlock(), createElementBlock("nav", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(parentTitles.value, (item, index) => {
93
+ return openBlock(), createElementBlock(Fragment, { key: index }, [item.to ? (openBlock(), createBlock(WRouterLink_default, {
94
+ key: 0,
95
+ to: item.to,
96
+ class: "hover:text-accent max-w-64 truncate no-underline transition-colors"
97
+ }, {
98
+ default: withCtx(() => [unref(getRouteTitleShort)(item) !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(unref(getRouteTitleShort)(item)), 1)], 64)) : (openBlock(), createBlock(WSkeleton_default, {
99
+ key: 1,
100
+ class: "inline-flex w-24"
101
+ }))]),
102
+ _: 2
103
+ }, 1032, ["to"])) : (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(getRouteTitleShort)(item)), 1)), _cache[1] || (_cache[1] = createElementVNode("span", {
104
+ "aria-hidden": "true",
105
+ class: "opacity-50"
106
+ }, "/", -1))], 64);
107
+ }), 128))])) : createCommentVNode("", true),
108
+ currentTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_5, [currentTitle.value.title !== void 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(currentTitle.value.title) + " ", 1), createVNode(WTooltip_default, {
109
+ text: currentTitle.value.title,
110
+ "overflow-only": ""
111
+ }, null, 8, ["text"])], 64)) : (openBlock(), createBlock(WSkeleton_default, {
112
+ key: 1,
113
+ class: "inline-flex w-40"
114
+ }))])) : createCommentVNode("", true),
115
+ currentTitle.value?.suffix ? (openBlock(), createElementBlock("div", _hoisted_6, [(openBlock(), createBlock(resolveDynamicComponent(currentTitle.value.suffix)))])) : createCommentVNode("", true)
116
+ ])),
61
117
  renderSlot(_ctx.$slots, "right"),
62
118
  unref(search) ? (openBlock(), createElementBlock("button", {
63
- key: 0,
119
+ key: 2,
64
120
  class: "w-ripple-trigger sm:pr---inner-margin h-full select-none",
65
121
  "aria-label": "Open search",
66
122
  onClick: _cache[0] || (_cache[0] = ($event) => unref(updateVisible)(true))
67
- }, [createElementVNode("div", _hoisted_2, [createVNode(unref(IconSearch_default), { class: "square-[1.25em] text-accent" })])])) : createCommentVNode("", true)
123
+ }, [createElementVNode("div", _hoisted_7, [createVNode(unref(IconSearch_default), { class: "square-[1.25em] text-accent" })])])) : createCommentVNode("", true)
68
124
  ], 2), [[vShow, !unref(visible)]]),
69
- unref(search) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(search), (slot, index) => {
125
+ unref(search) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_8, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(search), (slot, index) => {
70
126
  return openBlock(), createBlock(resolveDynamicComponent(slot), { key: index });
71
127
  }), 128))], 512)), [[vShow, unref(visible)]]) : createCommentVNode("", true)
72
128
  ], 4);
@@ -1 +1 @@
1
- {"version":3,"file":"WLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/WLink.vue"],"names":[],"mappings":"AAcA;AA8DA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAM5C,OAAO,EAAC,YAAY,EAAiD,MAAM,sBAAsB,CAAA;AAEjG,UAAU,KAAM,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;IAChD,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,gEAAgE;IAChE,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAgBD,KAAK,WAAW,GAAG;IACjB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;AAiFF,QAAA,MAAM,UAAU;;UAzGP,MAAM;UAIN,YAAY;kBAFJ,YAAY;UARpB,MAAM;YAEJ,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM;SAE1C,MAAM;6EA8GZ,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/WLink.vue"],"names":[],"mappings":"AAcA;AA8DA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAM5C,OAAO,EAAC,YAAY,EAAiD,MAAM,sBAAsB,CAAA;AAEjG,UAAU,KAAM,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;IAChD,mCAAmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6CAA6C;IAC7C,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,gEAAgE;IAChE,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAgBD,KAAK,WAAW,GAAG;IACjB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;AA+EF,QAAA,MAAM,UAAU;;UAvGP,MAAM;UAIN,YAAY;kBAFJ,YAAY;UARpB,MAAM;YAEJ,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM;SAE1C,MAAM;6EA4GZ,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -26,7 +26,7 @@ var WLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
26
26
  to: __props.to,
27
27
  target: __props.target,
28
28
  rel: __props.rel
29
- }, { class: ["cursor-pointer overflow-hidden truncate whitespace-normal font-normal no-underline hover:underline", unref(semanticTypeTextMap)[__props.semanticType]] }), {
29
+ }, { class: ["cursor-pointer whitespace-normal font-normal no-underline hover:underline", unref(semanticTypeTextMap)[__props.semanticType]] }), {
30
30
  default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon ?? unref(IconLink_default)), { class: normalizeClass(["square-[1.25em] mr-[0.25em] mt-[-0.25em] inline rounded-[0.5em] p-px", unref(semanticTypeChipMap)[__props.semanticType]]) }, null, 8, ["class"])), renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])]),
31
31
  _: 3
32
32
  }, 16, ["class"]);
@@ -1 +1 @@
1
- {"version":3,"file":"WNavItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Nav/WNavItem.vue"],"names":[],"mappings":"AAyFA;AAuIA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;AAgBzC,KAAK,WAAW,GAAG;IACjB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;IACjB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAC;AA+PF,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":"AA4FA;AAgJA,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;AAmRF,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"}
@@ -3,6 +3,8 @@ import WCounter_default from "../Counter/WCounter.vue.js";
3
3
  import WRouterLink_default from "../RouterLink/WRouterLink.vue.js";
4
4
  import WSkeleton_default from "../Skeleton/WSkeleton.vue.js";
5
5
  import { useOptionalRoute, useOptionalRouter } from "../../composables/useOptionalRouter.js";
6
+ import WTextOverflow_default from "../TextOverflow/WTextOverflow.vue.js";
7
+ import { getRouteTitle, getRouteTitleShort } from "../../utils/useRouteTitle.js";
6
8
  import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
7
9
  //#region src/components/Nav/WNavItem.vue?vue&type=script&setup=true&lang.ts
8
10
  var _hoisted_1 = {
@@ -15,11 +17,12 @@ var _hoisted_2 = {
15
17
  };
16
18
  var _hoisted_3 = { class: "[overflow:inherit]" };
17
19
  var _hoisted_4 = { class: "flex items-center" };
18
- var _hoisted_5 = { class: "last-not:pr-1 whitespace-nowrap font-normal" };
19
- var _hoisted_6 = { class: "relative" };
20
- var _hoisted_7 = { class: "tracking-wide" };
21
- var _hoisted_8 = { class: "leading-loose" };
22
- var _hoisted_9 = { key: 0 };
20
+ var _hoisted_5 = { class: "last-not:pr-1 min-w-0 font-normal" };
21
+ var _hoisted_6 = { class: "relative inline-flex max-w-full items-center whitespace-nowrap tracking-wide" };
22
+ var _hoisted_7 = {
23
+ key: 0,
24
+ class: "shrink-0"
25
+ };
23
26
  var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
24
27
  __name: "WNavItem",
25
28
  props: {
@@ -47,13 +50,15 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
47
50
  if (routeTo.value?.name !== route?.name) return false;
48
51
  return isEqualObj(route.query, routeTo.value.query ?? {}, EXCLUDE_QUERY_FIELDS, props.queryFields);
49
52
  });
50
- const titleLocal = computed(() => props.title ?? (typeof routeTo.value?.meta?.titleShort === "string" ? routeTo.value.meta.titleShort : typeof routeTo.value?.meta?.title === "string" ? routeTo.value.meta.title : ""));
53
+ const routeTitle = computed(() => getRouteTitle(routeTo.value?.matched.at(-1)));
54
+ const iconLocal = computed(() => props.icon ?? routeTo.value?.meta?.icon);
55
+ 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 : ""));
51
56
  const isTextColor = computed(() => props.hasActive ? !props.indent : isActive.value);
52
57
  __expose({ isActive });
53
58
  return (_ctx, _cache) => {
54
59
  return openBlock(), createBlock(WRouterLink_default, {
55
60
  to: __props.to,
56
- class: normalizeClass(["w-ripple-trigger relative block py-1 no-underline", {
61
+ class: normalizeClass(["w-ripple-trigger group/overflow relative block py-1 no-underline", {
57
62
  "tone-primary text-tone": isTextColor.value,
58
63
  "text-accent": !isTextColor.value,
59
64
  "px-1": __props.even,
@@ -84,23 +89,26 @@ var WNavItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
84
89
  "pl-4": __props.indent,
85
90
  "pl-2": !__props.indent
86
91
  }]) }, [
87
- createElementVNode("div", _hoisted_4, [__props.icon ?? routeTo.value?.meta?.icon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon ?? routeTo.value?.meta?.icon), {
92
+ createElementVNode("div", _hoisted_4, [iconLocal.value ? (openBlock(), createBlock(resolveDynamicComponent(iconLocal.value), {
88
93
  key: 0,
89
94
  class: "square-[1.25em]"
90
95
  })) : renderSlot(_ctx.$slots, "icon", {}, void 0, void 0, 1)]),
91
- createElementVNode("div", _hoisted_5, [createElementVNode("span", _hoisted_6, [createElementVNode("span", _hoisted_7, [
92
- createElementVNode("span", _hoisted_8, toDisplayString(titleLocal.value), 1),
93
- _cache[1] || (_cache[1] = createTextVNode("\xA0", -1)),
94
- !__props.skeleton ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(typeof __props.count === "number" ? `(${unref(numberCompactFormatter).format(__props.count)})` : ""), 1)) : (openBlock(), createBlock(WSkeleton_default, {
96
+ createElementVNode("div", _hoisted_5, [createElementVNode("span", _hoisted_6, [
97
+ createVNode(WTextOverflow_default, { class: "min-w-0 leading-loose" }, {
98
+ default: withCtx(() => [createTextVNode(toDisplayString(titleLocal.value), 1)]),
99
+ _: 1
100
+ }),
101
+ !__props.skeleton ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(typeof __props.count === "number" ? `\u00A0(${unref(numberCompactFormatter).format(__props.count)})` : ""), 1)) : (openBlock(), createBlock(WSkeleton_default, {
95
102
  key: 1,
96
- class: "inline-flex max-w-10"
97
- }))
98
- ]), !__props.skeleton && __props.counter !== void 0 && __props.counter !== 0 ? (openBlock(), createBlock(WCounter_default, {
99
- key: 0,
100
- count: __props.counter,
101
- trigger: 1,
102
- class: "text-2xs absolute -top-2.5 right-[-1em]"
103
- }, null, 8, ["count"])) : createCommentVNode("", true)])]),
103
+ class: "ml-1 inline-flex max-w-10 shrink-0"
104
+ })),
105
+ !__props.skeleton && __props.counter !== void 0 && __props.counter !== 0 ? (openBlock(), createBlock(WCounter_default, {
106
+ key: 2,
107
+ count: __props.counter,
108
+ trigger: 1,
109
+ class: "text-2xs absolute -top-2.5 right-[-1em]"
110
+ }, null, 8, ["count"])) : createCommentVNode("", true)
111
+ ])]),
104
112
  renderSlot(_ctx.$slots, "right")
105
113
  ], 2)])
106
114
  ]),
@@ -2,7 +2,7 @@ import { LinkProps } from '../../types/types';
2
2
  export interface NavItemProps extends LinkProps {
3
3
  /** Icon before the title. Defaults to the route's `meta.icon`. */
4
4
  icon?: SVGComponent
5
- /** Title of the item. Defaults to the route's `meta.titleShort`, then `meta.title`. */
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
7
7
  /** Number after the title in brackets, such as the number of items on the page it opens. */
8
8
  count?: number
@@ -20,9 +20,9 @@ var WNotify_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
20
20
  return (_ctx, _cache) => {
21
21
  return openBlock(), createElementBlock("div", {
22
22
  class: normalizeClass(["sm-not:top-[max(env(safe-area-inset-top),0.5rem)] fixed isolate z-10000", {
23
- "sm:top-(--w-top-inner,0.5rem)": isTop.value,
24
- "sm:bottom-[calc(var(--w-bottom-inner,0.5rem)+0.5rem)]": !isTop.value,
25
- "right-(--w-right-inner,0.5rem)": !isCenter.value,
23
+ "sm:top-[max(env(safe-area-inset-top),0.5rem)]": isTop.value,
24
+ "sm:bottom-[max(env(safe-area-inset-bottom),0.5rem)]": !isTop.value,
25
+ "right-[max(env(safe-area-inset-right),0.5rem)]": !isCenter.value,
26
26
  "left-1/2 -translate-x-1/2": isCenter.value
27
27
  }]),
28
28
  onPointerenter: _cache[1] || (_cache[1] = ($event) => unref(setToastsPaused)(true)),