@nanahoshi/mona-ui 0.24.11 → 0.25.0
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/README.md +9 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -10
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +37 -20
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +239 -47
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +184 -31
- package/fesm2022/nanahoshi-mona-ui-button.mjs +47 -11
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +17 -13
- package/fesm2022/nanahoshi-mona-ui-card.mjs +54 -30
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +27 -22
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +112 -31
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +131 -89
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +59 -19
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +118 -41
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +243 -212
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +155 -86
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +161 -131
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +12 -11
- package/fesm2022/nanahoshi-mona-ui-common.mjs +18 -1
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +25 -24
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +202 -33
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +31 -10
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-DhKLnW06.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-2tVhD2hK.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-voGbKOiB.mjs → nanahoshi-mona-ui-grid-grid-list.component-BAN70Wcn.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-HQ1Kv6R9.mjs → nanahoshi-mona-ui-grid-grid-row.component-C_kCaA5b.mjs} +7 -7
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-PNLJFcuH.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-BsNfrAHz.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BO19AVwC.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CEfVa7eo.mjs} +27 -29
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +39 -4
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +5 -5
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +183 -47
- package/fesm2022/nanahoshi-mona-ui-label.mjs +111 -15
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +33 -4
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +14 -13
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +13 -12
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +192 -56
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +3 -1
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +60 -29
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +334 -37
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +84 -30
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +274 -108
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +127 -37
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +595 -170
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +3 -2
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +323 -166
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +167 -82
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +273 -165
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +219 -132
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +84 -32
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +337 -116
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +10 -12
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +21 -8
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +444 -88
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +10 -9
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +15 -14
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +17 -3
- package/fesm2022/nanahoshi-mona-ui-window.mjs +1 -1
- package/i18n/catalogs/en-US.messages.json +33 -4
- package/locales/ar-sa/ar-sa.messages.json +33 -4
- package/locales/de-de/de-de.messages.json +33 -4
- package/locales/es-es/es-es.messages.json +33 -4
- package/locales/fr-fr/fr-fr.messages.json +33 -4
- package/locales/id-id/id-id.messages.json +33 -4
- package/locales/it-it/it-it.messages.json +33 -4
- package/locales/ja-jp/ja-jp.messages.json +33 -4
- package/locales/ko-kr/ko-kr.messages.json +33 -4
- package/locales/pt-br/pt-br.messages.json +33 -4
- package/locales/ru-ru/ru-ru.messages.json +33 -4
- package/locales/tr-tr/tr-tr.messages.json +33 -4
- package/locales/zh-cn/zh-cn.messages.json +33 -4
- package/locales/zh-tw/zh-tw.messages.json +33 -4
- package/package.json +2 -1
- package/styles.css +156 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +1 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +18 -11
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +62 -14
- package/types/nanahoshi-mona-ui-button-group.d.ts +86 -16
- package/types/nanahoshi-mona-ui-button.d.ts +26 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +1 -0
- package/types/nanahoshi-mona-ui-card.d.ts +22 -6
- package/types/nanahoshi-mona-ui-check-box.d.ts +54 -13
- package/types/nanahoshi-mona-ui-chip.d.ts +31 -18
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +21 -5
- package/types/nanahoshi-mona-ui-collapsible.d.ts +20 -11
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +62 -36
- package/types/nanahoshi-mona-ui-color-palette.d.ts +65 -27
- package/types/nanahoshi-mona-ui-color-picker.d.ts +64 -23
- package/types/nanahoshi-mona-ui-combo-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-common.d.ts +28 -2
- package/types/nanahoshi-mona-ui-date-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +1 -0
- package/types/nanahoshi-mona-ui-editor.d.ts +1 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +51 -7
- package/types/nanahoshi-mona-ui-fieldset.d.ts +18 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +0 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +38 -3
- package/types/nanahoshi-mona-ui-internal.d.ts +95 -14
- package/types/nanahoshi-mona-ui-label.d.ts +17 -2
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +29 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +29 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +1 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +1 -0
- package/types/nanahoshi-mona-ui-otp-input.d.ts +49 -12
- package/types/nanahoshi-mona-ui-placeholder.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +21 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +165 -20
- package/types/nanahoshi-mona-ui-rating.d.ts +21 -6
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +59 -27
- package/types/nanahoshi-mona-ui-segmented.d.ts +52 -24
- package/types/nanahoshi-mona-ui-sidebar.d.ts +104 -41
- package/types/nanahoshi-mona-ui-skeleton.d.ts +1 -1
- package/types/nanahoshi-mona-ui-slider.d.ts +99 -35
- package/types/nanahoshi-mona-ui-spinner.d.ts +9 -5
- package/types/nanahoshi-mona-ui-splitter.d.ts +31 -10
- package/types/nanahoshi-mona-ui-stepper.d.ts +58 -12
- package/types/nanahoshi-mona-ui-switch.d.ts +32 -10
- package/types/nanahoshi-mona-ui-tabs.d.ts +75 -20
- package/types/nanahoshi-mona-ui-text-area.d.ts +7 -7
- package/types/nanahoshi-mona-ui-text-box.d.ts +2 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +392 -15
- package/types/nanahoshi-mona-ui-time-picker.d.ts +1 -0
- package/types/nanahoshi-mona-ui-time-selector.d.ts +1 -0
- package/types/nanahoshi-mona-ui-tooltip.d.ts +7 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { computed, input, Directive, output, viewChild, TemplateRef, Component,
|
|
4
|
-
import { LucideChevronRight } from '@lucide/angular';
|
|
3
|
+
import { computed, input, Directive, InjectionToken, inject, ElementRef, booleanAttribute, output, contentChild, viewChild, TemplateRef, forwardRef, Component, Injector, linkedSignal, contentChildren, afterNextRender } from '@angular/core';
|
|
4
|
+
import { LucideChevronRight, LucideEllipsis } from '@lucide/angular';
|
|
5
5
|
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
|
+
import { fromEvent } from 'rxjs';
|
|
8
10
|
|
|
9
11
|
const breadcrumbListThemeVariants = cva(`
|
|
10
12
|
flex list-none items-center gap-1 overflow-hidden px-2 py-1
|
|
11
|
-
select-none
|
|
12
13
|
`, {
|
|
13
14
|
variants: {
|
|
14
15
|
disabled: {
|
|
@@ -17,41 +18,74 @@ const breadcrumbListThemeVariants = cva(`
|
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
});
|
|
21
|
+
/**
|
|
22
|
+
* `min-w-0`, or a flex item never gets narrower than its text, and nothing inside it ever truncates. The other items
|
|
23
|
+
* shrink faster than the current page, so it's the one that stays readable. The current page keeps a factor of 1 rather
|
|
24
|
+
* than a fraction, because flexbox only takes that fraction of the overflow once it's the last item left to shrink.
|
|
25
|
+
*/
|
|
26
|
+
const breadcrumbListItemWrapperThemeVariants = cva(`flex min-w-0 items-center`, {
|
|
27
|
+
variants: {
|
|
28
|
+
current: {
|
|
29
|
+
true: "",
|
|
30
|
+
false: "shrink-[10]"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
/** Inset focus, because the list clips anything outside it. */
|
|
20
35
|
const breadcrumbListItemThemeVariants = cva(`
|
|
21
|
-
flex h-full items-center
|
|
36
|
+
flex h-full max-w-full min-w-0 items-center px-1
|
|
22
37
|
cursor-pointer
|
|
23
|
-
|
|
24
|
-
bg-transparent border-0 rounded-sm outline-none
|
|
38
|
+
bg-transparent border-0 rounded-sm
|
|
25
39
|
transition-colors duration-100 ease-in-out
|
|
26
|
-
|
|
27
|
-
active:bg-active active:text-foreground
|
|
28
|
-
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
40
|
+
focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-indicator
|
|
29
41
|
`, {
|
|
30
42
|
variants: {
|
|
31
43
|
disabled: {
|
|
32
44
|
true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
|
|
45
|
+
false: "text-muted-foreground hover:bg-hover hover:text-foreground active:bg-active active:text-foreground"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
disabled: false
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
/** Text in a flex item only truncates from a block of its own, and an icon beside it has to stay on the same line. */
|
|
53
|
+
const breadcrumbItemContentThemeVariants = cva(`min-w-0 truncate [&_svg]:inline`);
|
|
54
|
+
const breadcrumbLinkThemeVariants = cva(`
|
|
55
|
+
block max-w-full min-w-0 truncate rounded-sm px-1 [&_svg]:inline
|
|
56
|
+
transition-colors duration-100 ease-in-out
|
|
57
|
+
focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus-indicator
|
|
58
|
+
`, {
|
|
59
|
+
variants: {
|
|
60
|
+
current: {
|
|
61
|
+
true: "font-medium text-foreground",
|
|
33
62
|
false: ""
|
|
34
63
|
},
|
|
35
|
-
|
|
36
|
-
true: "",
|
|
64
|
+
disabled: {
|
|
65
|
+
true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
|
|
37
66
|
false: ""
|
|
38
67
|
}
|
|
39
68
|
},
|
|
40
|
-
compoundVariants: [
|
|
69
|
+
compoundVariants: [
|
|
70
|
+
{
|
|
71
|
+
current: false,
|
|
72
|
+
disabled: false,
|
|
73
|
+
class: "text-muted-foreground hover:bg-hover hover:text-foreground active:bg-active active:text-foreground"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
41
76
|
defaultVariants: {
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
current: false,
|
|
78
|
+
disabled: false
|
|
44
79
|
}
|
|
45
80
|
});
|
|
46
|
-
const breadcrumbCurrentItemThemeVariants = cva(`
|
|
81
|
+
const breadcrumbCurrentItemThemeVariants = cva(`block min-w-0 cursor-default truncate font-medium text-foreground [&_svg]:inline`);
|
|
47
82
|
|
|
48
83
|
class BreadcrumbItemDirective {
|
|
49
84
|
constructor() {
|
|
50
85
|
this.baseClass = computed(() => {
|
|
51
86
|
const disabled = this.disabled();
|
|
52
|
-
const listDisabled = this.listDisabled();
|
|
53
87
|
const userClass = this.userClass();
|
|
54
|
-
return twMerge(breadcrumbListItemThemeVariants({ disabled
|
|
88
|
+
return twMerge(breadcrumbListItemThemeVariants({ disabled }), userClass);
|
|
55
89
|
}, /* @ts-ignore */
|
|
56
90
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
57
91
|
/**
|
|
@@ -60,12 +94,6 @@ class BreadcrumbItemDirective {
|
|
|
60
94
|
*/
|
|
61
95
|
this.disabled = input(false, /* @ts-ignore */
|
|
62
96
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
63
|
-
/**
|
|
64
|
-
* @description Reflects whether the parent breadcrumb is disabled. Controls compound disabled styling when only individual items are disabled.
|
|
65
|
-
* @default false
|
|
66
|
-
*/
|
|
67
|
-
this.listDisabled = input(false, /* @ts-ignore */
|
|
68
|
-
...(ngDevMode ? [{ debugName: "listDisabled" }] : /* istanbul ignore next */ []));
|
|
69
97
|
/**
|
|
70
98
|
* @description Additional CSS classes merged onto the breadcrumb item via `tailwind-merge`.
|
|
71
99
|
* @default ""
|
|
@@ -73,7 +101,7 @@ class BreadcrumbItemDirective {
|
|
|
73
101
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
74
102
|
}
|
|
75
103
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
76
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbItemDirective, isStandalone: true, selector: "button[monaBreadcrumbItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
104
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbItemDirective, isStandalone: true, selector: "button[monaBreadcrumbItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "disabled": "disabled()" } }, ngImport: i0 }); }
|
|
77
105
|
}
|
|
78
106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemDirective, decorators: [{
|
|
79
107
|
type: Directive,
|
|
@@ -84,7 +112,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
84
112
|
"[disabled]": "disabled()"
|
|
85
113
|
}
|
|
86
114
|
}]
|
|
87
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }],
|
|
115
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
88
116
|
|
|
89
117
|
class BreadcrumbSeparatorTemplateDirective {
|
|
90
118
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbSeparatorTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -100,43 +128,158 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
100
128
|
// Generated from i18n/catalogs/en-US.messages.json by scripts/generate-locale-catalogs.ts. Do not edit.
|
|
101
129
|
// Edit the JSON file and run `npm run generate:locale-catalogs`.
|
|
102
130
|
const BREADCRUMB_DEFAULT_MESSAGES = {
|
|
103
|
-
breadcrumb: "Breadcrumb"
|
|
131
|
+
breadcrumb: "Breadcrumb",
|
|
132
|
+
showFullPath: "Show full path"
|
|
104
133
|
};
|
|
105
134
|
|
|
135
|
+
const BREADCRUMB_CONTEXT = new InjectionToken("MONA_BREADCRUMB_CONTEXT");
|
|
136
|
+
const BREADCRUMB_ITEM_CONTEXT = new InjectionToken("MONA_BREADCRUMB_ITEM_CONTEXT");
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Makes a projected anchor the item's link, so the browser and the router treat it as one: ctrl-click, copy link, `href`,
|
|
140
|
+
* `routerLink`, `target`. The item then renders no button around it.
|
|
141
|
+
*/
|
|
142
|
+
class BreadcrumbLinkDirective {
|
|
143
|
+
#item;
|
|
144
|
+
constructor() {
|
|
145
|
+
this.#item = inject(BREADCRUMB_ITEM_CONTEXT, { optional: true });
|
|
146
|
+
this.current = computed(() => this.#item?.current() ?? false, /* @ts-ignore */
|
|
147
|
+
...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
148
|
+
this.disabled = computed(() => this.#item?.effectiveDisabled() ?? false, /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
150
|
+
this.linkClass = computed(() => {
|
|
151
|
+
const variantClass = breadcrumbLinkThemeVariants({ current: this.current(), disabled: this.disabled() });
|
|
152
|
+
return twMerge(variantClass, this.userClass());
|
|
153
|
+
}, /* @ts-ignore */
|
|
154
|
+
...(ngDevMode ? [{ debugName: "linkClass" }] : /* istanbul ignore next */ []));
|
|
155
|
+
/**
|
|
156
|
+
* @description Additional CSS classes merged onto the link via `tailwind-merge`.
|
|
157
|
+
* @default ""
|
|
158
|
+
*/
|
|
159
|
+
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
160
|
+
const host = inject(ElementRef).nativeElement;
|
|
161
|
+
// In the capture phase, so a disabled link stops a click before `routerLink`'s own listener can act on it.
|
|
162
|
+
fromEvent(host, "click", { capture: true })
|
|
163
|
+
.pipe(takeUntilDestroyed())
|
|
164
|
+
.subscribe(event => {
|
|
165
|
+
if (this.disabled()) {
|
|
166
|
+
event.preventDefault();
|
|
167
|
+
event.stopImmediatePropagation();
|
|
168
|
+
}
|
|
169
|
+
else if (!this.current()) {
|
|
170
|
+
this.#item?.itemClick.emit(event);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
175
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbLinkDirective, isStandalone: true, selector: "a[monaBreadcrumbLink]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-current": "current() ? 'page' : null", "attr.aria-disabled": "disabled() ? true : null", "attr.tabindex": "disabled() ? -1 : null", "class": "linkClass()" } }, ngImport: i0 }); }
|
|
176
|
+
}
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbLinkDirective, decorators: [{
|
|
178
|
+
type: Directive,
|
|
179
|
+
args: [{
|
|
180
|
+
selector: "a[monaBreadcrumbLink]",
|
|
181
|
+
host: {
|
|
182
|
+
"[attr.aria-current]": "current() ? 'page' : null",
|
|
183
|
+
"[attr.aria-disabled]": "disabled() ? true : null",
|
|
184
|
+
"[attr.tabindex]": "disabled() ? -1 : null",
|
|
185
|
+
"[class]": "linkClass()"
|
|
186
|
+
}
|
|
187
|
+
}]
|
|
188
|
+
}], ctorParameters: () => [], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
189
|
+
|
|
106
190
|
class BreadcrumbItemComponent {
|
|
107
191
|
constructor() {
|
|
192
|
+
this.#breadcrumb = inject(BREADCRUMB_CONTEXT, { optional: true });
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
this.current = computed(() => this.#breadcrumb?.currentItem() === this, /* @ts-ignore */
|
|
197
|
+
...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
108
198
|
/**
|
|
109
199
|
* @description Renders this item with reduced visual emphasis and removes pointer interaction.
|
|
110
200
|
* Has no visual effect when the parent breadcrumb is also disabled.
|
|
111
201
|
* @default false
|
|
112
202
|
*/
|
|
113
|
-
this.disabled = input(false, /*
|
|
114
|
-
|
|
203
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
this.effectiveDisabled = computed(() => !!this.#breadcrumb?.disabled() || this.disabled(), /* @ts-ignore */
|
|
208
|
+
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
115
209
|
/**
|
|
116
|
-
* @description Emitted when the item is clicked or activated via keyboard.
|
|
117
|
-
* Not emitted when this is the
|
|
210
|
+
* @description Emitted with the click when the item is clicked or activated via keyboard.
|
|
211
|
+
* Not emitted when this is the current-page item or when the item is disabled.
|
|
118
212
|
*/
|
|
119
213
|
this.itemClick = output();
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
217
|
+
this.link = contentChild(BreadcrumbLinkDirective, /* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
|
|
219
|
+
/**
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
120
222
|
this.templateRef = viewChild.required(TemplateRef, /* @ts-ignore */
|
|
121
223
|
...(ngDevMode ? [{ debugName: "templateRef" }] : /* istanbul ignore next */ []));
|
|
122
224
|
}
|
|
225
|
+
#breadcrumb;
|
|
123
226
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
124
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
|
|
227
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: BreadcrumbItemComponent, isStandalone: true, selector: "mona-breadcrumb-item", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, providers: [{ provide: BREADCRUMB_ITEM_CONTEXT, useExisting: forwardRef(() => BreadcrumbItemComponent) }], queries: [{ propertyName: "link", first: true, predicate: BreadcrumbLinkDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }); }
|
|
125
228
|
}
|
|
126
229
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
|
|
127
230
|
type: Component,
|
|
128
|
-
args: [{ selector: "mona-breadcrumb-item", template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
129
|
-
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
231
|
+
args: [{ selector: "mona-breadcrumb-item", providers: [{ provide: BREADCRUMB_ITEM_CONTEXT, useExisting: forwardRef(() => BreadcrumbItemComponent) }], template: "<ng-template>\n <ng-content></ng-content>\n</ng-template>\n" }]
|
|
232
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], link: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbLinkDirective), { isSignal: true }] }], templateRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }] } });
|
|
130
233
|
|
|
234
|
+
function numberOrNull(value) {
|
|
235
|
+
if (value == null || value === "") {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
const parsed = Number(value);
|
|
239
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
240
|
+
}
|
|
131
241
|
class BreadcrumbComponent {
|
|
132
242
|
constructor() {
|
|
133
243
|
this.#i18n = inject(MonaI18nService);
|
|
244
|
+
this.#injector = inject(Injector);
|
|
134
245
|
this.currentItemClass = computed(() => {
|
|
135
246
|
return breadcrumbCurrentItemThemeVariants();
|
|
136
247
|
}, /* @ts-ignore */
|
|
137
248
|
...(ngDevMode ? [{ debugName: "currentItemClass" }] : /* istanbul ignore next */ []));
|
|
249
|
+
this.entries = computed(() => {
|
|
250
|
+
const items = this.itemComponents();
|
|
251
|
+
const hidden = this.hiddenCount();
|
|
252
|
+
const entries = [];
|
|
253
|
+
items.forEach((item, index) => {
|
|
254
|
+
if (hidden > 0 && index === 1) {
|
|
255
|
+
entries.push({ index: hidden, item: null, key: "expand" });
|
|
256
|
+
}
|
|
257
|
+
if (hidden === 0 || index === 0 || index > hidden) {
|
|
258
|
+
entries.push({ index, item, key: item });
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
return entries;
|
|
262
|
+
}, /* @ts-ignore */
|
|
263
|
+
...(ngDevMode ? [{ debugName: "entries" }] : /* istanbul ignore next */ []));
|
|
264
|
+
this.expanded = linkedSignal({ ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), source: () => this.itemComponents(), computation: () => false });
|
|
265
|
+
this.hasItems = computed(() => this.itemComponents().length > 0, /* @ts-ignore */
|
|
266
|
+
...(ngDevMode ? [{ debugName: "hasItems" }] : /* istanbul ignore next */ []));
|
|
267
|
+
this.hiddenCount = computed(() => {
|
|
268
|
+
const maxItems = this.maxItems();
|
|
269
|
+
const count = this.itemComponents().length;
|
|
270
|
+
if (maxItems === null || this.expanded()) {
|
|
271
|
+
return 0;
|
|
272
|
+
}
|
|
273
|
+
// The first and last items are always kept, so nothing lower than two means anything.
|
|
274
|
+
return Math.max(count - Math.max(Math.trunc(maxItems), 2), 0);
|
|
275
|
+
}, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
|
|
138
277
|
this.itemComponents = contentChildren(BreadcrumbItemComponent, /* @ts-ignore */
|
|
139
278
|
...(ngDevMode ? [{ debugName: "itemComponents" }] : /* istanbul ignore next */ []));
|
|
279
|
+
this.itemContentClass = computed(() => {
|
|
280
|
+
return breadcrumbItemContentThemeVariants();
|
|
281
|
+
}, /* @ts-ignore */
|
|
282
|
+
...(ngDevMode ? [{ debugName: "itemContentClass" }] : /* istanbul ignore next */ []));
|
|
140
283
|
this.listClass = computed(() => {
|
|
141
284
|
const disabled = this.disabled();
|
|
142
285
|
const userClass = this.userClass();
|
|
@@ -144,6 +287,8 @@ class BreadcrumbComponent {
|
|
|
144
287
|
return twMerge(variantClass, userClass);
|
|
145
288
|
}, /* @ts-ignore */
|
|
146
289
|
...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
|
|
290
|
+
this.listElement = viewChild("list", /* @ts-ignore */
|
|
291
|
+
...(ngDevMode ? [{ debugName: "listElement" }] : /* istanbul ignore next */ []));
|
|
147
292
|
this.messages = this.#i18n.componentMessages("breadcrumb", BREADCRUMB_DEFAULT_MESSAGES);
|
|
148
293
|
this.separatorTemplate = contentChild(BreadcrumbSeparatorTemplateDirective, { ...(ngDevMode ? { debugName: "separatorTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
149
294
|
/**
|
|
@@ -152,12 +297,30 @@ class BreadcrumbComponent {
|
|
|
152
297
|
* @default ""
|
|
153
298
|
*/
|
|
154
299
|
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
300
|
+
/**
|
|
301
|
+
* @internal
|
|
302
|
+
*/
|
|
303
|
+
this.currentItem = computed(() => {
|
|
304
|
+
return this.lastItemCurrent() ? (this.itemComponents().at(-1) ?? null) : null;
|
|
305
|
+
}, /* @ts-ignore */
|
|
306
|
+
...(ngDevMode ? [{ debugName: "currentItem" }] : /* istanbul ignore next */ []));
|
|
155
307
|
/**
|
|
156
308
|
* @description Renders the entire breadcrumb with reduced visual emphasis and removes pointer interaction from all items.
|
|
157
309
|
* @default false
|
|
158
310
|
*/
|
|
159
|
-
this.disabled = input(false, /*
|
|
160
|
-
|
|
311
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
312
|
+
/**
|
|
313
|
+
* @description Treats the last item as the current page: not a button, and marked `aria-current="page"`. Turn it off
|
|
314
|
+
* for a trail that ends before the page you're on.
|
|
315
|
+
* @default true
|
|
316
|
+
*/
|
|
317
|
+
this.lastItemCurrent = input(true, { ...(ngDevMode ? { debugName: "lastItemCurrent" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
318
|
+
/**
|
|
319
|
+
* @description The most items to show before the middle of the trail collapses behind a button that shows it again.
|
|
320
|
+
* The first and last items always stay, so anything below 2 counts as 2. `null` never collapses.
|
|
321
|
+
* @default null
|
|
322
|
+
*/
|
|
323
|
+
this.maxItems = input(null, { ...(ngDevMode ? { debugName: "maxItems" } : /* istanbul ignore next */ {}), transform: numberOrNull });
|
|
161
324
|
/**
|
|
162
325
|
* @description Additional CSS classes merged onto the breadcrumb list via `tailwind-merge`.
|
|
163
326
|
* @default ""
|
|
@@ -165,24 +328,53 @@ class BreadcrumbComponent {
|
|
|
165
328
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
166
329
|
}
|
|
167
330
|
#i18n;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
331
|
+
#injector;
|
|
332
|
+
/**
|
|
333
|
+
* Shows the whole trail. The button that was just activated goes away, so focus moves to the first item it revealed.
|
|
334
|
+
*/
|
|
335
|
+
expand() {
|
|
336
|
+
const firstRevealed = 1;
|
|
337
|
+
const lastRevealed = this.hiddenCount();
|
|
338
|
+
this.expanded.set(true);
|
|
339
|
+
afterNextRender({
|
|
340
|
+
read: () => {
|
|
341
|
+
const list = this.listElement()?.nativeElement;
|
|
342
|
+
for (let index = firstRevealed; index <= lastRevealed; index++) {
|
|
343
|
+
const target = list
|
|
344
|
+
?.querySelector(`li[data-item-index="${index}"]`)
|
|
345
|
+
?.querySelector("a:not([aria-disabled='true']), button:not(:disabled)");
|
|
346
|
+
if (target) {
|
|
347
|
+
target.focus();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
list?.querySelector("a:not([aria-disabled='true']), button:not(:disabled)")?.focus();
|
|
352
|
+
}
|
|
353
|
+
}, { injector: this.#injector });
|
|
354
|
+
}
|
|
355
|
+
listItemClass(current) {
|
|
356
|
+
return breadcrumbListItemWrapperThemeVariants({ current });
|
|
357
|
+
}
|
|
358
|
+
onItemClick(item, event) {
|
|
359
|
+
if (!item.effectiveDisabled()) {
|
|
360
|
+
item.itemClick.emit(event);
|
|
171
361
|
}
|
|
172
|
-
item.itemClick.emit();
|
|
173
362
|
}
|
|
174
363
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
175
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
364
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BreadcrumbComponent, isStandalone: true, selector: "mona-breadcrumb", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, lastItemCurrent: { classPropertyName: "lastItemCurrent", publicName: "lastItemCurrent", isSignal: true, isRequired: false, transformFunction: null }, maxItems: { classPropertyName: "maxItems", publicName: "maxItems", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-label": "hasItems() ? ariaLabel() || messages().breadcrumb : null", "attr.role": "hasItems() ? 'navigation' : null" }, classAttribute: "block max-w-full min-w-0" }, providers: [{ provide: BREADCRUMB_CONTEXT, useExisting: forwardRef(() => BreadcrumbComponent) }], queries: [{ propertyName: "itemComponents", predicate: BreadcrumbItemComponent, isSignal: true }, { propertyName: "separatorTemplate", first: true, predicate: BreadcrumbSeparatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "listElement", first: true, predicate: ["list"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (itemComponents().length > 0) {\n <ol #list role=\"list\" [class]=\"listClass()\">\n @for (entry of entries(); track entry.key) {\n @let item = entry.item;\n @if (item) {\n <li [class]=\"listItemClass(item.current())\" [attr.data-item-index]=\"entry.index\">\n @if (item.link()) {\n <!-- The anchor is the item, with its own classes and aria-current. -->\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n } @else if (item.current()) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"item.effectiveDisabled()\"\n (click)=\"onItemClick(item, $event)\">\n <span [class]=\"itemContentClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n </button>\n }\n </li>\n } @else {\n <li class=\"shrink-0\">\n <button\n type=\"button\"\n monaBreadcrumbItem\n data-breadcrumb-expand\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"messages().showFullPath\"\n (click)=\"expand()\">\n <svg lucideEllipsis [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n </li>\n }\n\n @if (!$last) {\n <li class=\"shrink-0\" aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n </ol>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: BreadcrumbItemDirective, selector: "button[monaBreadcrumbItem]", inputs: ["disabled", "class"] }, { kind: "component", type: LucideChevronRight, selector: "svg[lucideChevronRight]" }, { kind: "component", type: LucideEllipsis, selector: "svg[lucideEllipsis], svg[lucideMoreHorizontal]" }] }); }
|
|
176
365
|
}
|
|
177
366
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
178
367
|
type: Component,
|
|
179
|
-
args: [{ selector: "mona-breadcrumb", imports: [NgTemplateOutlet, BreadcrumbItemDirective, LucideChevronRight], host: {
|
|
180
|
-
|
|
181
|
-
"[attr.
|
|
182
|
-
|
|
183
|
-
|
|
368
|
+
args: [{ selector: "mona-breadcrumb", imports: [NgTemplateOutlet, BreadcrumbItemDirective, LucideChevronRight, LucideEllipsis], providers: [{ provide: BREADCRUMB_CONTEXT, useExisting: forwardRef(() => BreadcrumbComponent) }], host: {
|
|
369
|
+
"[attr.aria-label]": "hasItems() ? ariaLabel() || messages().breadcrumb : null",
|
|
370
|
+
"[attr.role]": "hasItems() ? 'navigation' : null",
|
|
371
|
+
// In a flex parent the host is the flex item, and it would otherwise never get narrower than the trail's text:
|
|
372
|
+
// min-w-0 for one that shrinks along its row, max-w-full for one sized to fit across a column.
|
|
373
|
+
class: "block max-w-full min-w-0"
|
|
374
|
+
}, template: "@if (itemComponents().length > 0) {\n <ol #list role=\"list\" [class]=\"listClass()\">\n @for (entry of entries(); track entry.key) {\n @let item = entry.item;\n @if (item) {\n <li [class]=\"listItemClass(item.current())\" [attr.data-item-index]=\"entry.index\">\n @if (item.link()) {\n <!-- The anchor is the item, with its own classes and aria-current. -->\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n } @else if (item.current()) {\n <span aria-current=\"page\" [class]=\"currentItemClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n } @else {\n <button\n type=\"button\"\n monaBreadcrumbItem\n [disabled]=\"item.effectiveDisabled()\"\n (click)=\"onItemClick(item, $event)\">\n <span [class]=\"itemContentClass()\">\n <ng-container [ngTemplateOutlet]=\"item.templateRef()\"></ng-container>\n </span>\n </button>\n }\n </li>\n } @else {\n <li class=\"shrink-0\">\n <button\n type=\"button\"\n monaBreadcrumbItem\n data-breadcrumb-expand\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"messages().showFullPath\"\n (click)=\"expand()\">\n <svg lucideEllipsis [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n </li>\n }\n\n @if (!$last) {\n <li class=\"shrink-0\" aria-hidden=\"true\" role=\"presentation\">\n @if (separatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"separatorTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: entry.index }\"></ng-container>\n } @else {\n <svg lucideChevronRight [size]=\"18\" class=\"rtl:rotate-180\"></svg>\n }\n </li>\n }\n }\n </ol>\n}\n" }]
|
|
375
|
+
}], propDecorators: { itemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BreadcrumbItemComponent), { isSignal: true }] }], listElement: [{ type: i0.ViewChild, args: ["list", { isSignal: true }] }], separatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BreadcrumbSeparatorTemplateDirective), { ...{
|
|
184
376
|
read: TemplateRef
|
|
185
|
-
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
377
|
+
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], lastItemCurrent: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastItemCurrent", required: false }] }], maxItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxItems", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
186
378
|
|
|
187
379
|
/*
|
|
188
380
|
* Public API Surface of @nanahoshi/mona-ui/breadcrumb
|
|
@@ -192,5 +384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
192
384
|
* Generated bundle index. Do not edit.
|
|
193
385
|
*/
|
|
194
386
|
|
|
195
|
-
export { BREADCRUMB_DEFAULT_MESSAGES, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbSeparatorTemplateDirective };
|
|
387
|
+
export { BREADCRUMB_DEFAULT_MESSAGES, BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbLinkDirective, BreadcrumbSeparatorTemplateDirective };
|
|
196
388
|
//# sourceMappingURL=nanahoshi-mona-ui-breadcrumb.mjs.map
|