@nanahoshi/mona-ui 0.18.6 → 0.20.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 +71 -13
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -101
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +39 -21
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +88 -55
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-BuybF7tX.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Dj-SaNzk.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-CYAm4l84.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-B_Gm--X6.mjs} +46 -31
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-X0X487Rm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CyzJFQIy.mjs} +99 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4874 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +4973 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +66 -29
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +41 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +47 -24
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/locales/package.json +4 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +29 -15
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +7 -1
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +14 -6
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +40 -12
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +50 -2
- package/types/nanahoshi-mona-ui-i18n.d.ts +680 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales.d.ts +4889 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +20 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +10 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +11 -4
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -5,6 +5,7 @@ import { PopupMenuToken, preparePopupMenuItems, PopupMenuItemType, PopupMenuTemp
|
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { injectComponentDirection, MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
8
9
|
import { Subject, startWith, pairwise, tap } from 'rxjs';
|
|
9
10
|
import { twMerge } from 'tailwind-merge';
|
|
10
11
|
import { cva } from 'class-variance-authority';
|
|
@@ -56,12 +57,12 @@ class MenuComponent {
|
|
|
56
57
|
.flatMap(i => i);
|
|
57
58
|
}, /* @ts-ignore */
|
|
58
59
|
...(ngDevMode ? [{ debugName: "menuItems" }] : /* istanbul ignore next */ []));
|
|
59
|
-
this.textTemplate = contentChild(MenuTextTemplateDirective, { ...(ngDevMode ? { debugName: "textTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
60
60
|
/**
|
|
61
61
|
* @description The text of the menu.
|
|
62
62
|
*/
|
|
63
63
|
this.text = input("", /* @ts-ignore */
|
|
64
64
|
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
65
|
+
this.textTemplate = contentChild(MenuTextTemplateDirective, { ...(ngDevMode ? { debugName: "textTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
65
66
|
this.uid = v4();
|
|
66
67
|
this.popupMenu = null;
|
|
67
68
|
}
|
|
@@ -77,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
77
78
|
}]
|
|
78
79
|
}], propDecorators: { menuItemComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PopupMenuToken), { ...{ descendants: false }, isSignal: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], iconTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuIconTemplateDirective), { ...{
|
|
79
80
|
read: TemplateRef
|
|
80
|
-
}, isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }],
|
|
81
|
+
}, isSignal: true }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], textTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuTextTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
81
82
|
|
|
82
83
|
const componentTypeMap = {
|
|
83
84
|
[PopupMenuItemType.CheckboxMenuItem]: "mona-menu-checkbox-item",
|
|
@@ -421,7 +422,7 @@ const menuItemGroupHeaderThemeVariants = cva(`inline-flex w-full select-none px-
|
|
|
421
422
|
}
|
|
422
423
|
}
|
|
423
424
|
});
|
|
424
|
-
const menuItemIconThemeVariants = cva(`absolute
|
|
425
|
+
const menuItemIconThemeVariants = cva(`absolute start-2 flex h-3.5 w-3.5 items-center justify-center`);
|
|
425
426
|
const menuItemLinkThemeVariants = cva(`flex h-3.5 w-3.5 items-center justify-center`);
|
|
426
427
|
const menuItemShortcutThemeVariants = cva(`flex flex-1 items-center justify-end text-xs text-muted-foreground`);
|
|
427
428
|
const menuItemTextThemeVariants = cva(`flex flex-1 items-center justify-start gap-2`);
|
|
@@ -496,12 +497,18 @@ const menubarListThemeVariants = cva(`
|
|
|
496
497
|
|
|
497
498
|
class MenubarComponent {
|
|
498
499
|
#destroyRef;
|
|
500
|
+
#direction;
|
|
499
501
|
#document;
|
|
500
502
|
#hostElementRef;
|
|
503
|
+
#i18n;
|
|
501
504
|
constructor() {
|
|
502
505
|
this.#destroyRef = inject(DestroyRef);
|
|
506
|
+
this.#direction = injectComponentDirection();
|
|
503
507
|
this.#document = inject(DOCUMENT);
|
|
504
508
|
this.#hostElementRef = inject((ElementRef));
|
|
509
|
+
this.#i18n = inject(MonaI18nService);
|
|
510
|
+
this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
|
|
511
|
+
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
505
512
|
this.activeIndex = signal(0, /* @ts-ignore */
|
|
506
513
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
507
514
|
this.baseClasses = computed(() => {
|
|
@@ -561,16 +568,16 @@ class MenubarComponent {
|
|
|
561
568
|
* @description Emits when a menu item is clicked.
|
|
562
569
|
*/
|
|
563
570
|
this.menuItemClick = output();
|
|
564
|
-
/**
|
|
565
|
-
* @description Sets the size of the menubar.
|
|
566
|
-
*/
|
|
567
|
-
this.size = input("medium", /* @ts-ignore */
|
|
568
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
569
571
|
/**
|
|
570
572
|
* @description Sets the rounded style of the menubar.
|
|
571
573
|
*/
|
|
572
574
|
this.rounded = input("medium", /* @ts-ignore */
|
|
573
575
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
576
|
+
/**
|
|
577
|
+
* @description Sets the size of the menubar.
|
|
578
|
+
*/
|
|
579
|
+
this.size = input("medium", /* @ts-ignore */
|
|
580
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
574
581
|
/**
|
|
575
582
|
* @description Additional CSS classes to apply to the menubar, merged with the computed theme classes.
|
|
576
583
|
*/
|
|
@@ -630,6 +637,9 @@ class MenubarComponent {
|
|
|
630
637
|
if (this.disabled()) {
|
|
631
638
|
return;
|
|
632
639
|
}
|
|
640
|
+
const isRtl = this.isRtl();
|
|
641
|
+
const nextMenuKey = isRtl ? "ArrowLeft" : "ArrowRight";
|
|
642
|
+
const prevMenuKey = isRtl ? "ArrowRight" : "ArrowLeft";
|
|
633
643
|
switch (event.key) {
|
|
634
644
|
case "Enter":
|
|
635
645
|
case " ":
|
|
@@ -638,11 +648,11 @@ class MenubarComponent {
|
|
|
638
648
|
popupMenu.openMenuViaKeyboard();
|
|
639
649
|
}
|
|
640
650
|
break;
|
|
641
|
-
case
|
|
651
|
+
case nextMenuKey:
|
|
642
652
|
event.preventDefault();
|
|
643
653
|
this.moveToNextMenu();
|
|
644
654
|
break;
|
|
645
|
-
case
|
|
655
|
+
case prevMenuKey:
|
|
646
656
|
event.preventDefault();
|
|
647
657
|
this.moveToPreviousMenu();
|
|
648
658
|
break;
|
|
@@ -725,7 +735,7 @@ class MenubarComponent {
|
|
|
725
735
|
return -1;
|
|
726
736
|
}
|
|
727
737
|
findPreviousNonDisabledMenuIndex() {
|
|
728
|
-
|
|
738
|
+
const currentIndex = this.findCurrentMenuIndex();
|
|
729
739
|
if (currentIndex == null || currentIndex < 0) {
|
|
730
740
|
const menuList = this.menuList();
|
|
731
741
|
const lastEnabledIndex = menuList
|
|
@@ -783,13 +793,16 @@ class MenubarComponent {
|
|
|
783
793
|
setNavigationSubscription() {
|
|
784
794
|
this.navigate$
|
|
785
795
|
.pipe(takeUntilDestroyed(this.#destroyRef), startWith(null), pairwise(), tap(([prev, next]) => {
|
|
786
|
-
|
|
796
|
+
const isRtl = this.isRtl();
|
|
797
|
+
const nextDir = isRtl ? "left" : "right";
|
|
798
|
+
const prevDir = isRtl ? "right" : "left";
|
|
799
|
+
if (next && next.direction === nextDir && (next.level === 0 || (next.level > 0 && !next.item))) {
|
|
787
800
|
const index = this.findNextNonDisabledMenuIndex();
|
|
788
801
|
if (index >= 0) {
|
|
789
802
|
this.updateCurrentMenuData(index);
|
|
790
803
|
}
|
|
791
804
|
}
|
|
792
|
-
else if (next && prev && next.direction ===
|
|
805
|
+
else if (next && prev && next.direction === prevDir && prev.level === 0 && next.level === 0) {
|
|
793
806
|
const index = this.findPreviousNonDisabledMenuIndex();
|
|
794
807
|
if (index >= 0) {
|
|
795
808
|
this.updateCurrentMenuData(index);
|
|
@@ -813,7 +826,7 @@ class MenubarComponent {
|
|
|
813
826
|
this.currentPopupMenu()?.openMenuViaKeyboard();
|
|
814
827
|
}
|
|
815
828
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
816
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
829
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClick: "menuItemClick" }, host: { properties: { "class": "baseClasses()", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "groupTemplate", first: true, predicate: MenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: MenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemIconTemplate", first: true, predicate: MenuItemIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemShortcutTemplate", first: true, predicate: MenuItemShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemTextTemplate", first: true, predicate: MenuItemTextTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuList", predicate: MenuComponent, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: MenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuComponents", predicate: PopupMenuComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"disabled() || item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width", "class"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
|
|
817
830
|
}
|
|
818
831
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, decorators: [{
|
|
819
832
|
type: Component,
|
|
@@ -827,7 +840,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
827
840
|
], host: {
|
|
828
841
|
"[class]": "baseClasses()",
|
|
829
842
|
"[attr.data-disabled]": "disabled()"
|
|
830
|
-
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"currentPopupMenu()
|
|
843
|
+
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"disabled() || item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() !== null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n" }]
|
|
831
844
|
}], ctorParameters: () => [], propDecorators: { groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuGroupTemplateDirective), { ...{
|
|
832
845
|
read: TemplateRef,
|
|
833
846
|
descendants: false
|
|
@@ -846,7 +859,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
846
859
|
}, isSignal: true }] }], menuList: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MenuComponent), { isSignal: true }] }], popupMenuComponents: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => PopupMenuComponent), { isSignal: true }] }], textTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuTextTemplateDirective), { ...{
|
|
847
860
|
read: TemplateRef,
|
|
848
861
|
descendants: false
|
|
849
|
-
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], menuItemClick: [{ type: i0.Output, args: ["menuItemClick"] }],
|
|
862
|
+
}, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], menuItemClick: [{ type: i0.Output, args: ["menuItemClick"] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClasses: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
850
863
|
|
|
851
864
|
/*
|
|
852
865
|
* Public API Surface of @nanahoshi/mona-ui/menubar
|
|
@@ -6,6 +6,7 @@ import { none } from '@mirei/ts-collections';
|
|
|
6
6
|
import { ChipComponent } from '@nanahoshi/mona-ui/chip';
|
|
7
7
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
8
8
|
import { DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
9
|
+
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
9
10
|
import { themeControlSurfaceClasses, createElementControlId, restoreOverlayScroll, rxFromResize } from '@nanahoshi/mona-ui/internal';
|
|
10
11
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
11
12
|
import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
@@ -24,6 +25,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
24
25
|
}]
|
|
25
26
|
}] });
|
|
26
27
|
|
|
28
|
+
const MULTI_SELECT_DEFAULT_MESSAGES = {
|
|
29
|
+
clear: "Clear",
|
|
30
|
+
itemsCount: (count) => `+ ${count} ${count === 1 ? "item" : "items"}`
|
|
31
|
+
};
|
|
32
|
+
|
|
27
33
|
class MultiSelectService {
|
|
28
34
|
constructor() {
|
|
29
35
|
this.summaryTagTemplate = signal(null, /* @ts-ignore */
|
|
@@ -111,6 +117,7 @@ class MultiSelectComponent {
|
|
|
111
117
|
#destroyRef;
|
|
112
118
|
#dropdownService;
|
|
113
119
|
#hostElementRef;
|
|
120
|
+
#i18n;
|
|
114
121
|
#listService;
|
|
115
122
|
#multiSelectService;
|
|
116
123
|
#popupRef;
|
|
@@ -118,6 +125,7 @@ class MultiSelectComponent {
|
|
|
118
125
|
this.#destroyRef = inject(DestroyRef);
|
|
119
126
|
this.#dropdownService = inject(DropdownService);
|
|
120
127
|
this.#hostElementRef = inject(ElementRef);
|
|
128
|
+
this.#i18n = inject(MonaI18nService);
|
|
121
129
|
this.#listService = inject((ListService));
|
|
122
130
|
this.#multiSelectService = inject(MultiSelectService);
|
|
123
131
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
@@ -168,6 +176,7 @@ class MultiSelectComponent {
|
|
|
168
176
|
return twMerge(variantClass, userClass);
|
|
169
177
|
}, /* @ts-ignore */
|
|
170
178
|
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
179
|
+
this.messages = this.#i18n.componentMessages("multiSelect", MULTI_SELECT_DEFAULT_MESSAGES);
|
|
171
180
|
this.noDataTemplate = contentChild(DropdownNoDataTemplateDirective, { ...(ngDevMode ? { debugName: "noDataTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
172
181
|
this.popupTemplate = viewChild.required("popupTemplate", /* @ts-ignore */
|
|
173
182
|
...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -540,7 +549,7 @@ class MultiSelectComponent {
|
|
|
540
549
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
541
550
|
multi: false
|
|
542
551
|
}
|
|
543
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: MultiSelectTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @let remainingCount = selectedDataItems().length - tagCount();\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n
|
|
552
|
+
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "tagTemplate", first: true, predicate: MultiSelectTagTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @let remainingCount = selectedDataItems().length - tagCount();\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n</div>\n\n@if (showClearButton() && selectedListItems().length !== 0 && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "component", type: ChipComponent, selector: "mona-chip", inputs: ["aria-label", "disabled", "label", "look", "removable", "removeLabel", "removeTabIndex", "rounded", "selected", "size", "tabindex", "toggleable", "class", "value"], outputs: ["contentClick", "remove", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
544
553
|
}
|
|
545
554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
546
555
|
type: Component,
|
|
@@ -588,7 +597,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
588
597
|
"[attr.tabindex]": "disabled() ? null : 0",
|
|
589
598
|
"[class]": "baseClass()",
|
|
590
599
|
"(blur)": "onBlur()"
|
|
591
|
-
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @let remainingCount = selectedDataItems().length - tagCount();\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n
|
|
600
|
+
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<div [class]=\"itemContainerClass()\">\n @for (pair of valueTextMap(); track pair.key) {\n <mona-chip\n look=\"default\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemRemove($event, pair.key!)\">\n @if (tagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"tagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: pair.key!.data }\"></ng-container>\n } @else {\n {{ pair.value }}\n }\n </mona-chip>\n }\n\n @if (tagCount() >= 0 && selectedListItems().length > tagCount()) {\n <mona-chip\n look=\"outline\"\n [tabindex]=\"-1\"\n [removable]=\"true\"\n [removeTabIndex]=\"-1\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (remove)=\"onSelectedItemGroupRemove($event)\">\n @let remainingCount = selectedDataItems().length - tagCount();\n @if (summaryTagTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"summaryTagTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItems(), tagCount: tagCount() }\"></ng-container>\n } @else {\n {{ messages().itemsCount(remainingCount) }}\n }\n </mona-chip>\n }\n</div>\n\n@if (showClearButton() && selectedListItems().length !== 0 && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [class]=\"indicatorClass()\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [class]=\"indicatorClass()\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [class]=\"indicatorClass()\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n" }]
|
|
592
601
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
|
|
593
602
|
read: TemplateRef
|
|
594
603
|
}, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], tagTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MultiSelectTagTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], autoClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClose", required: false }] }], checkboxes: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkboxes", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], open: [{ type: i0.Output, args: ["open"] }], opened: [{ type: i0.Output, args: ["opened"] }], popupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupClass", required: false }] }], popupHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupHeight", required: false }] }], popupWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupWidth", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], valuePrimitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "valuePrimitive", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
@@ -642,5 +651,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
642
651
|
* Generated bundle index. Do not edit.
|
|
643
652
|
*/
|
|
644
653
|
|
|
645
|
-
export { MultiSelectComponent, MultiSelectSummaryTagDirective, MultiSelectSummaryTagTemplateDirective, MultiSelectTagTemplateDirective };
|
|
654
|
+
export { MULTI_SELECT_DEFAULT_MESSAGES, MultiSelectComponent, MultiSelectSummaryTagDirective, MultiSelectSummaryTagTemplateDirective, MultiSelectTagTemplateDirective };
|
|
646
655
|
//# sourceMappingURL=nanahoshi-mona-ui-multi-select.mjs.map
|
|
@@ -8,6 +8,7 @@ import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
|
8
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
9
|
import { LucideOctagonX, LucideBadgeInfo, LucideCircleCheckBig, LucideOctagonAlert, LucideX } from '@lucide/angular';
|
|
10
10
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
11
|
+
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
11
12
|
import { ProgressBarComponent } from '@nanahoshi/mona-ui/progress-bar';
|
|
12
13
|
|
|
13
14
|
//---------------------------------
|
|
@@ -36,7 +37,7 @@ const notificationContainerBaseThemeVariants = cva(`p-2 z-40000`, {
|
|
|
36
37
|
// Notification Component
|
|
37
38
|
//-----------------------
|
|
38
39
|
const notificationActionThemeVariants = cva(`
|
|
39
|
-
absolute top-0
|
|
40
|
+
absolute top-0 end-0 flex h-auto items-start
|
|
40
41
|
[&>svg.lucide]:cursor-pointer
|
|
41
42
|
[&>svg.lucide]:-mt-1
|
|
42
43
|
`);
|
|
@@ -72,18 +73,29 @@ const notificationTextThemeVariants = cva(`
|
|
|
72
73
|
text-sm text-foreground
|
|
73
74
|
`);
|
|
74
75
|
|
|
76
|
+
const NOTIFICATION_DEFAULT_MESSAGES = {
|
|
77
|
+
close: "Close",
|
|
78
|
+
error: "Error",
|
|
79
|
+
info: "Info",
|
|
80
|
+
success: "Success",
|
|
81
|
+
warning: "Warning"
|
|
82
|
+
};
|
|
83
|
+
|
|
75
84
|
class NotificationComponent {
|
|
76
85
|
#destroyRef;
|
|
77
86
|
#document;
|
|
87
|
+
#i18n;
|
|
78
88
|
#isUrgent;
|
|
79
89
|
#paused;
|
|
80
90
|
constructor() {
|
|
81
91
|
this.#destroyRef = inject(DestroyRef);
|
|
82
92
|
this.#document = inject(DOCUMENT);
|
|
93
|
+
this.#i18n = inject(MonaI18nService);
|
|
83
94
|
this.#isUrgent = computed(() => this.type() === "error" || this.type() === "warning", /* @ts-ignore */
|
|
84
95
|
...(ngDevMode ? [{ debugName: "#isUrgent" }] : /* istanbul ignore next */ []));
|
|
85
96
|
this.#paused = signal(false, /* @ts-ignore */
|
|
86
97
|
...(ngDevMode ? [{ debugName: "#paused" }] : /* istanbul ignore next */ []));
|
|
98
|
+
this.messages = this.#i18n.componentMessages("notification", NOTIFICATION_DEFAULT_MESSAGES);
|
|
87
99
|
this.actionClass = computed(() => {
|
|
88
100
|
return notificationActionThemeVariants();
|
|
89
101
|
}, /* @ts-ignore */
|
|
@@ -98,6 +110,10 @@ class NotificationComponent {
|
|
|
98
110
|
return notificationBodyThemeVariants();
|
|
99
111
|
}, /* @ts-ignore */
|
|
100
112
|
...(ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []));
|
|
113
|
+
this.closeTitle = computed(() => {
|
|
114
|
+
return this.data().options.closeTitle ?? this.messages().close;
|
|
115
|
+
}, /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "closeTitle" }] : /* istanbul ignore next */ []));
|
|
101
117
|
this.contentClass = computed(() => {
|
|
102
118
|
return notificationContentThemeVariants();
|
|
103
119
|
}, /* @ts-ignore */
|
|
@@ -140,6 +156,8 @@ class NotificationComponent {
|
|
|
140
156
|
...(ngDevMode ? [{ debugName: "textClass" }] : /* istanbul ignore next */ []));
|
|
141
157
|
this.type = computed(() => this.data().options.type ?? "info", /* @ts-ignore */
|
|
142
158
|
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
159
|
+
this.title = computed(() => this.data().options.title ?? this.messages()[this.type()], /* @ts-ignore */
|
|
160
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
143
161
|
/**
|
|
144
162
|
* @description The notification's internal state, created and managed by `NotificationService`. Not intended to be provided directly by consumers.
|
|
145
163
|
*/
|
|
@@ -189,7 +207,7 @@ class NotificationComponent {
|
|
|
189
207
|
});
|
|
190
208
|
}
|
|
191
209
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
192
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NotificationComponent, isStandalone: true, selector: "mona-notification", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "pointerenter": "onInteractionStart()", "pointerleave": "onInteractionEnd()", "focusin": "onInteractionStart()", "focusout": "onInteractionEnd()" } }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "@let width = typeof data().options.width === \"string\" ? data().options.width : `${data().options.width}px`;\n@let height = typeof data().options.height === \"string\" ? data().options.height : `${data().options.height}px`;\n\n<div\n [class]=\"baseClass()\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\">\n @if (contentTemplate() || contentComponent()) {\n @if (contentTemplate()) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\"></ng-container>\n } @else if (contentComponent()) {\n <ng-container #contentHost></ng-container>\n }\n } @else {\n <div [class]=\"bodyClass()\">\n <div [class]=\"iconClass()\" aria-hidden=\"true\">\n @switch (type()) {\n @case (\"error\") {\n <svg lucideOctagonX aria-hidden=\"true\"></svg>\n }\n @case (\"info\") {\n <svg lucideBadgeInfo aria-hidden=\"true\"></svg>\n }\n @case (\"success\") {\n <svg lucideCircleCheckBig aria-hidden=\"true\"></svg>\n }\n @case (\"warning\") {\n <svg lucideOctagonAlert aria-hidden=\"true\"></svg>\n }\n }\n </div>\n <div class=\"flex flex-col flex-1\">\n <div [class]=\"headerClass()\">{{
|
|
210
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NotificationComponent, isStandalone: true, selector: "mona-notification", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "pointerenter": "onInteractionStart()", "pointerleave": "onInteractionEnd()", "focusin": "onInteractionStart()", "focusout": "onInteractionEnd()" } }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "@let width = typeof data().options.width === \"string\" ? data().options.width : `${data().options.width}px`;\n@let height = typeof data().options.height === \"string\" ? data().options.height : `${data().options.height}px`;\n\n<div\n [class]=\"baseClass()\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\">\n @if (contentTemplate() || contentComponent()) {\n @if (contentTemplate()) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\"></ng-container>\n } @else if (contentComponent()) {\n <ng-container #contentHost></ng-container>\n }\n } @else {\n <div [class]=\"bodyClass()\">\n <div [class]=\"iconClass()\" aria-hidden=\"true\">\n @switch (type()) {\n @case (\"error\") {\n <svg lucideOctagonX aria-hidden=\"true\"></svg>\n }\n @case (\"info\") {\n <svg lucideBadgeInfo aria-hidden=\"true\"></svg>\n }\n @case (\"success\") {\n <svg lucideCircleCheckBig aria-hidden=\"true\"></svg>\n }\n @case (\"warning\") {\n <svg lucideOctagonAlert aria-hidden=\"true\"></svg>\n }\n }\n </div>\n <div class=\"flex flex-col flex-1\">\n <div [class]=\"headerClass()\">{{ title() }}</div>\n <div [class]=\"contentClass()\">\n @if (isStringContent()) {\n <span [class]=\"textClass()\" title=\"{{ data().options.content }}\">{{\n data().options.content\n }}</span>\n }\n </div>\n </div>\n </div>\n @if (data().options.progressBar) {\n <div class=\"w-full h-1\">\n <mona-progress-bar\n [value]=\"progressValue()\"\n [color]=\"progressColor()\"\n [labelVisible]=\"false\"\n [animate]=\"false\"\n rounded=\"none\"\n class=\"h-full\"></mona-progress-bar>\n </div>\n }\n }\n @if (data().options.closable) {\n <div [class]=\"actionClass()\">\n <button\n monaButton\n size=\"small\"\n look=\"link\"\n rounded=\"none\"\n [iconOnly]=\"true\"\n [title]=\"closeTitle()\"\n [attr.aria-label]=\"closeTitle()\"\n (click)=\"close()\">\n <svg lucideX [size]=\"14\" aria-hidden=\"true\"></svg>\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:block}@keyframes notification-slide-in-top{0%{clip-path:inset(0 -20px 100% -20px);transform:translateY(-12px);opacity:0}to{clip-path:inset(-20px);transform:translateY(0);opacity:1}}@keyframes notification-slide-out-top{0%{clip-path:inset(-20px);transform:translateY(0);opacity:1}to{clip-path:inset(0 -20px 100% -20px);transform:translateY(-12px);opacity:0}}@keyframes notification-slide-in-bottom{0%{clip-path:inset(100% -20px 0 -20px);transform:translateY(12px);opacity:0}to{clip-path:inset(-20px);transform:translateY(0);opacity:1}}@keyframes notification-slide-out-bottom{0%{clip-path:inset(-20px);transform:translateY(0);opacity:1}to{clip-path:inset(100% -20px 0 -20px);transform:translateY(12px);opacity:0}}:host.notification-enter-top{animation:notification-slide-in-top .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-enter-bottom{animation:notification-slide-in-bottom .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-leave-top{animation:notification-slide-out-top .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-leave-bottom{animation:notification-slide-out-bottom .3s cubic-bezier(.4,0,.2,1) forwards}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProgressBarComponent, selector: "mona-progress-bar", inputs: ["animate", "aria-label", "aria-valuetext", "color", "disabled", "indeterminate", "labelPosition", "labelStyles", "labelVisible", "max", "min", "rounded", "class", "value"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: LucideOctagonX, selector: "svg[lucideOctagonX], svg[lucideXOctagon]" }, { kind: "component", type: LucideBadgeInfo, selector: "svg[lucideBadgeInfo]" }, { kind: "component", type: LucideCircleCheckBig, selector: "svg[lucideCircleCheckBig], svg[lucideCheckCircle]" }, { kind: "component", type: LucideOctagonAlert, selector: "svg[lucideOctagonAlert], svg[lucideAlertOctagon]" }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] }); }
|
|
193
211
|
}
|
|
194
212
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
195
213
|
type: Component,
|
|
@@ -207,7 +225,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
207
225
|
"(pointerleave)": "onInteractionEnd()",
|
|
208
226
|
"(focusin)": "onInteractionStart()",
|
|
209
227
|
"(focusout)": "onInteractionEnd()"
|
|
210
|
-
}, template: "@let width = typeof data().options.width === \"string\" ? data().options.width : `${data().options.width}px`;\n@let height = typeof data().options.height === \"string\" ? data().options.height : `${data().options.height}px`;\n\n<div\n [class]=\"baseClass()\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\">\n @if (contentTemplate() || contentComponent()) {\n @if (contentTemplate()) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\"></ng-container>\n } @else if (contentComponent()) {\n <ng-container #contentHost></ng-container>\n }\n } @else {\n <div [class]=\"bodyClass()\">\n <div [class]=\"iconClass()\" aria-hidden=\"true\">\n @switch (type()) {\n @case (\"error\") {\n <svg lucideOctagonX aria-hidden=\"true\"></svg>\n }\n @case (\"info\") {\n <svg lucideBadgeInfo aria-hidden=\"true\"></svg>\n }\n @case (\"success\") {\n <svg lucideCircleCheckBig aria-hidden=\"true\"></svg>\n }\n @case (\"warning\") {\n <svg lucideOctagonAlert aria-hidden=\"true\"></svg>\n }\n }\n </div>\n <div class=\"flex flex-col flex-1\">\n <div [class]=\"headerClass()\">{{
|
|
228
|
+
}, template: "@let width = typeof data().options.width === \"string\" ? data().options.width : `${data().options.width}px`;\n@let height = typeof data().options.height === \"string\" ? data().options.height : `${data().options.height}px`;\n\n<div\n [class]=\"baseClass()\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\">\n @if (contentTemplate() || contentComponent()) {\n @if (contentTemplate()) {\n <ng-container [ngTemplateOutlet]=\"contentTemplate()\"></ng-container>\n } @else if (contentComponent()) {\n <ng-container #contentHost></ng-container>\n }\n } @else {\n <div [class]=\"bodyClass()\">\n <div [class]=\"iconClass()\" aria-hidden=\"true\">\n @switch (type()) {\n @case (\"error\") {\n <svg lucideOctagonX aria-hidden=\"true\"></svg>\n }\n @case (\"info\") {\n <svg lucideBadgeInfo aria-hidden=\"true\"></svg>\n }\n @case (\"success\") {\n <svg lucideCircleCheckBig aria-hidden=\"true\"></svg>\n }\n @case (\"warning\") {\n <svg lucideOctagonAlert aria-hidden=\"true\"></svg>\n }\n }\n </div>\n <div class=\"flex flex-col flex-1\">\n <div [class]=\"headerClass()\">{{ title() }}</div>\n <div [class]=\"contentClass()\">\n @if (isStringContent()) {\n <span [class]=\"textClass()\" title=\"{{ data().options.content }}\">{{\n data().options.content\n }}</span>\n }\n </div>\n </div>\n </div>\n @if (data().options.progressBar) {\n <div class=\"w-full h-1\">\n <mona-progress-bar\n [value]=\"progressValue()\"\n [color]=\"progressColor()\"\n [labelVisible]=\"false\"\n [animate]=\"false\"\n rounded=\"none\"\n class=\"h-full\"></mona-progress-bar>\n </div>\n }\n }\n @if (data().options.closable) {\n <div [class]=\"actionClass()\">\n <button\n monaButton\n size=\"small\"\n look=\"link\"\n rounded=\"none\"\n [iconOnly]=\"true\"\n [title]=\"closeTitle()\"\n [attr.aria-label]=\"closeTitle()\"\n (click)=\"close()\">\n <svg lucideX [size]=\"14\" aria-hidden=\"true\"></svg>\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:block}@keyframes notification-slide-in-top{0%{clip-path:inset(0 -20px 100% -20px);transform:translateY(-12px);opacity:0}to{clip-path:inset(-20px);transform:translateY(0);opacity:1}}@keyframes notification-slide-out-top{0%{clip-path:inset(-20px);transform:translateY(0);opacity:1}to{clip-path:inset(0 -20px 100% -20px);transform:translateY(-12px);opacity:0}}@keyframes notification-slide-in-bottom{0%{clip-path:inset(100% -20px 0 -20px);transform:translateY(12px);opacity:0}to{clip-path:inset(-20px);transform:translateY(0);opacity:1}}@keyframes notification-slide-out-bottom{0%{clip-path:inset(-20px);transform:translateY(0);opacity:1}to{clip-path:inset(100% -20px 0 -20px);transform:translateY(12px);opacity:0}}:host.notification-enter-top{animation:notification-slide-in-top .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-enter-bottom{animation:notification-slide-in-bottom .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-leave-top{animation:notification-slide-out-top .3s cubic-bezier(.4,0,.2,1) forwards}:host.notification-leave-bottom{animation:notification-slide-out-bottom .3s cubic-bezier(.4,0,.2,1) forwards}\n"] }]
|
|
211
229
|
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ["contentHost", { ...{ read: ViewContainerRef }, isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
212
230
|
|
|
213
231
|
class NotificationContainerComponent {
|
|
@@ -239,19 +257,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
239
257
|
}, template: "@for (notificationData of notificationDataList(); track notificationData.options.id) {\n <mona-notification [data]=\"notificationData\" [animate.enter]=\"enterAnimClass()\" [animate.leave]=\"leaveAnimClass()\">\n </mona-notification>\n}\n" }]
|
|
240
258
|
}] });
|
|
241
259
|
|
|
242
|
-
function getDefaultTitle(type) {
|
|
243
|
-
switch (type) {
|
|
244
|
-
case "info":
|
|
245
|
-
return "Info";
|
|
246
|
-
case "success":
|
|
247
|
-
return "Success";
|
|
248
|
-
case "warning":
|
|
249
|
-
return "Warning";
|
|
250
|
-
case "error":
|
|
251
|
-
return "Error";
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
260
|
class NotificationService {
|
|
256
261
|
#appRef;
|
|
257
262
|
#document;
|
|
@@ -290,7 +295,7 @@ class NotificationService {
|
|
|
290
295
|
id: options.id ?? `Notification_${v4()}`,
|
|
291
296
|
position,
|
|
292
297
|
type,
|
|
293
|
-
title: options.title
|
|
298
|
+
title: options.title,
|
|
294
299
|
closable: options.closable ?? (options.duration == null ? true : undefined)
|
|
295
300
|
};
|
|
296
301
|
const containerData = this.notificationContainerMap.get(position);
|
|
@@ -448,5 +453,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
448
453
|
* Generated bundle index. Do not edit.
|
|
449
454
|
*/
|
|
450
455
|
|
|
451
|
-
export { NotificationService };
|
|
456
|
+
export { NOTIFICATION_DEFAULT_MESSAGES, NotificationService };
|
|
452
457
|
//# sourceMappingURL=nanahoshi-mona-ui-notification.mjs.map
|