@nanahoshi/mona-ui 0.1.0 → 0.2.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/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
- package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +57 -87
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +31 -5
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +6 -6
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -8
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +7 -8
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +3 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +7 -8
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +13 -14
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -2,15 +2,13 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive, signal, Injectable, inject, DestroyRef, ElementRef, computed, contentChild, TemplateRef, viewChild, input, output, model, afterNextRender, effect, untracked, forwardRef, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import {
|
|
5
|
+
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 { createElementControlId, restoreOverlayScroll, rxFromResize } from '@nanahoshi/mona-ui/internal';
|
|
9
|
+
import { themeControlSurfaceClasses, createElementControlId, restoreOverlayScroll, rxFromResize } from '@nanahoshi/mona-ui/internal';
|
|
10
10
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
11
11
|
import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
12
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
13
|
-
import { none } from '@mirei/ts-collections';
|
|
14
12
|
import { filter, tap } from 'rxjs';
|
|
15
13
|
import { twMerge } from 'tailwind-merge';
|
|
16
14
|
import { cva } from 'class-variance-authority';
|
|
@@ -40,23 +38,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
40
38
|
type: Injectable
|
|
41
39
|
}] });
|
|
42
40
|
|
|
43
|
-
const
|
|
44
|
-
flex items-center justify-between
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
const multiSelectBaseThemeVariants = cva(`
|
|
42
|
+
flex items-center justify-between
|
|
43
|
+
cursor-pointer
|
|
44
|
+
${themeControlSurfaceClasses} text-foreground
|
|
45
|
+
border border-input-border shadow-(--shadow-control) outline-none
|
|
46
|
+
transition-[color,box-shadow,border] duration-(--mona-motion-standard) ease-in-out
|
|
47
|
+
data-[readonly='true']:cursor-default
|
|
48
|
+
focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
50
49
|
`, {
|
|
51
50
|
variants: {
|
|
52
51
|
disabled: {
|
|
53
|
-
true:
|
|
52
|
+
true: `
|
|
53
|
+
pointer-events-none cursor-not-allowed
|
|
54
|
+
bg-disabled-background text-disabled-foreground
|
|
55
|
+
border-disabled-border shadow-none
|
|
56
|
+
`
|
|
54
57
|
},
|
|
55
58
|
focused: {
|
|
56
|
-
true: "ring-
|
|
59
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35"
|
|
57
60
|
},
|
|
58
61
|
invalid: {
|
|
59
|
-
true: "border-error ring-
|
|
62
|
+
true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
|
|
60
63
|
false: ""
|
|
61
64
|
},
|
|
62
65
|
rounded: {
|
|
@@ -71,10 +74,17 @@ const multiSelectBaseVariants = cva(`
|
|
|
71
74
|
medium: "min-h-9 text-sm",
|
|
72
75
|
large: "min-h-10 text-md"
|
|
73
76
|
}
|
|
74
|
-
}
|
|
77
|
+
},
|
|
78
|
+
compoundVariants: [
|
|
79
|
+
{
|
|
80
|
+
focused: true,
|
|
81
|
+
invalid: true,
|
|
82
|
+
class: "border-error ring-error/35"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
75
85
|
});
|
|
76
|
-
const
|
|
77
|
-
flex flex-1 items-center gap-1
|
|
86
|
+
const multiSelectItemContainerThemeVariants = cva(`
|
|
87
|
+
flex flex-1 flex-wrap items-center gap-1 p-1
|
|
78
88
|
`, {
|
|
79
89
|
variants: {
|
|
80
90
|
rounded: {
|
|
@@ -86,8 +96,8 @@ const multiSelectItemContainerVariants = cva(`
|
|
|
86
96
|
}
|
|
87
97
|
}
|
|
88
98
|
});
|
|
89
|
-
const
|
|
90
|
-
const
|
|
99
|
+
const multiSelectAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
|
|
100
|
+
const multiSelectIndicatorContainerThemeVariants = cva(`self-center`, {
|
|
91
101
|
variants: {
|
|
92
102
|
size: {
|
|
93
103
|
small: "h-8",
|
|
@@ -97,39 +107,6 @@ const multiSelectIndicatorContainerVariants = cva(`self-center`, {
|
|
|
97
107
|
}
|
|
98
108
|
});
|
|
99
109
|
|
|
100
|
-
const multiSelectBaseThemeVariants = (theme) => {
|
|
101
|
-
switch (theme) {
|
|
102
|
-
case "mona":
|
|
103
|
-
return multiSelectBaseVariants;
|
|
104
|
-
default:
|
|
105
|
-
return multiSelectBaseVariants;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const multiSelectItemContainerThemeVariants = (theme) => {
|
|
109
|
-
switch (theme) {
|
|
110
|
-
case "mona":
|
|
111
|
-
return multiSelectItemContainerVariants;
|
|
112
|
-
default:
|
|
113
|
-
return multiSelectItemContainerVariants;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const multiSelectAffixContainerThemeVariants = (theme) => {
|
|
117
|
-
switch (theme) {
|
|
118
|
-
case "mona":
|
|
119
|
-
return multiSelectAffixContainerVariants;
|
|
120
|
-
default:
|
|
121
|
-
return multiSelectAffixContainerVariants;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
const multiSelectIndicatorContainerThemeVariants = (theme) => {
|
|
125
|
-
switch (theme) {
|
|
126
|
-
case "mona":
|
|
127
|
-
return multiSelectIndicatorContainerVariants;
|
|
128
|
-
default:
|
|
129
|
-
return multiSelectIndicatorContainerVariants;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
110
|
class MultiSelectComponent {
|
|
134
111
|
#destroyRef;
|
|
135
112
|
#dropdownService;
|
|
@@ -137,7 +114,6 @@ class MultiSelectComponent {
|
|
|
137
114
|
#listService;
|
|
138
115
|
#multiSelectService;
|
|
139
116
|
#popupRef;
|
|
140
|
-
#themeService;
|
|
141
117
|
constructor() {
|
|
142
118
|
this.#destroyRef = inject(DestroyRef);
|
|
143
119
|
this.#dropdownService = inject(DropdownService);
|
|
@@ -145,25 +121,22 @@ class MultiSelectComponent {
|
|
|
145
121
|
this.#listService = inject((ListService));
|
|
146
122
|
this.#multiSelectService = inject(MultiSelectService);
|
|
147
123
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
148
|
-
this.#themeService = inject(ThemeService);
|
|
149
124
|
this.activeDescendant = computed(() => {
|
|
150
125
|
const highlightedItem = this.#listService.highlightedItem();
|
|
151
126
|
return highlightedItem ? highlightedItem.uid : null;
|
|
152
127
|
}, /* @ts-ignore */
|
|
153
128
|
...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
154
129
|
this.affixClass = computed(() => {
|
|
155
|
-
|
|
156
|
-
return multiSelectAffixContainerThemeVariants(theme)();
|
|
130
|
+
return multiSelectAffixContainerThemeVariants();
|
|
157
131
|
}, /* @ts-ignore */
|
|
158
132
|
...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
|
|
159
133
|
this.baseClass = computed(() => {
|
|
160
|
-
const theme = this.#themeService.theme();
|
|
161
134
|
const disabled = this.disabled();
|
|
162
135
|
const focused = this.#popupRef() != null;
|
|
163
136
|
const invalid = this.invalidState();
|
|
164
137
|
const rounded = this.rounded();
|
|
165
138
|
const size = this.size();
|
|
166
|
-
const variantClass = multiSelectBaseThemeVariants(
|
|
139
|
+
const variantClass = multiSelectBaseThemeVariants({ disabled, focused, invalid, rounded, size });
|
|
167
140
|
const userClass = this.userClass();
|
|
168
141
|
return twMerge(variantClass, userClass);
|
|
169
142
|
}, /* @ts-ignore */
|
|
@@ -176,25 +149,22 @@ class MultiSelectComponent {
|
|
|
176
149
|
this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && none(this.value())), /* @ts-ignore */
|
|
177
150
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
178
151
|
this.indicatorClass = computed(() => {
|
|
179
|
-
const theme = this.#themeService.theme();
|
|
180
152
|
const size = this.size();
|
|
181
|
-
return multiSelectIndicatorContainerThemeVariants(
|
|
153
|
+
return multiSelectIndicatorContainerThemeVariants({ size });
|
|
182
154
|
}, /* @ts-ignore */
|
|
183
155
|
...(ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []));
|
|
184
156
|
this.itemContainerClass = computed(() => {
|
|
185
|
-
const theme = this.#themeService.theme();
|
|
186
157
|
const rounded = this.rounded();
|
|
187
|
-
return multiSelectItemContainerThemeVariants(
|
|
158
|
+
return multiSelectItemContainerThemeVariants({ rounded });
|
|
188
159
|
}, /* @ts-ignore */
|
|
189
160
|
...(ngDevMode ? [{ debugName: "itemContainerClass" }] : /* istanbul ignore next */ []));
|
|
190
161
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
191
162
|
this.listId = createElementControlId();
|
|
192
163
|
this.listPopupClass = computed(() => {
|
|
193
|
-
const theme = this.#themeService.theme();
|
|
194
164
|
const rounded = this.rounded();
|
|
195
165
|
const size = this.size();
|
|
196
166
|
const userClass = this.popupClass();
|
|
197
|
-
const variantClass = dropdownPopupThemeVariants(
|
|
167
|
+
const variantClass = dropdownPopupThemeVariants({ rounded, size });
|
|
198
168
|
return twMerge(variantClass, userClass);
|
|
199
169
|
}, /* @ts-ignore */
|
|
200
170
|
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
@@ -522,7 +492,7 @@ class MultiSelectComponent {
|
|
|
522
492
|
}
|
|
523
493
|
}
|
|
524
494
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
525
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MultiSelectComponent, isStandalone: true, selector: "mona-multi-select", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, checkboxes: { classPropertyName: "checkboxes", publicName: "checkboxes", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.
|
|
495
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MultiSelectComponent, isStandalone: true, selector: "mona-multi-select", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, checkboxes: { classPropertyName: "checkboxes", publicName: "checkboxes", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.role": "'combobox'", "attr.tabindex": "disabled() ? null : 0", "class": "baseClass()" } }, providers: [
|
|
526
496
|
ListService,
|
|
527
497
|
DropdownService,
|
|
528
498
|
MultiSelectService,
|
|
@@ -536,7 +506,7 @@ class MultiSelectComponent {
|
|
|
536
506
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
537
507
|
multi: false
|
|
538
508
|
}
|
|
539
|
-
], 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()) {\
|
|
509
|
+
], 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 @let itemLabel = remainingCount === 1 ? \"item\" : \"items\";\n + {{ remainingCount }} {{ itemLabel }}\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=\"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"] }] }); }
|
|
540
510
|
}
|
|
541
511
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
542
512
|
type: Component,
|
|
@@ -557,7 +527,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
557
527
|
], imports: [
|
|
558
528
|
ChipComponent,
|
|
559
529
|
NgTemplateOutlet,
|
|
560
|
-
FontAwesomeModule,
|
|
561
530
|
ListComponent,
|
|
562
531
|
ListGroupHeaderTemplateDirective,
|
|
563
532
|
ListItemTemplateDirective,
|
|
@@ -578,12 +547,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
578
547
|
"[attr.aria-labelledby]": "ariaLabelledBy()",
|
|
579
548
|
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
580
549
|
"[attr.aria-required]": "required() ? true : undefined",
|
|
550
|
+
"[attr.data-disabled]": "disabled() || null",
|
|
551
|
+
"[attr.data-invalid]": "invalidState() || null",
|
|
552
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
581
553
|
"[attr.role]": "'combobox'",
|
|
582
554
|
"[attr.tabindex]": "disabled() ? null : 0",
|
|
583
|
-
"[attr.data-invalid]": "invalidState() || null",
|
|
584
555
|
"[class]": "baseClass()",
|
|
585
556
|
"(blur)": "onBlur()"
|
|
586
|
-
}, template: "@if (prefixTemplate()) {\
|
|
557
|
+
}, 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 @let itemLabel = remainingCount === 1 ? \"item\" : \"items\";\n + {{ remainingCount }} {{ itemLabel }}\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=\"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" }]
|
|
587
558
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
|
|
588
559
|
read: TemplateRef
|
|
589
560
|
}, 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 }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
@@ -2,8 +2,8 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, DestroyRef, computed, signal, TemplateRef, viewChild, ViewContainerRef, input, afterNextRender, Component, ApplicationRef, DOCUMENT as DOCUMENT$1, createComponent, Injectable } from '@angular/core';
|
|
3
3
|
import { interval, takeWhile, asyncScheduler, Subject, take } from 'rxjs';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
7
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';
|
|
@@ -13,7 +13,7 @@ import { ProgressBarComponent } from '@nanahoshi/mona-ui/progress-bar';
|
|
|
13
13
|
//---------------------------------
|
|
14
14
|
// Notification Container Component
|
|
15
15
|
//---------------------------------
|
|
16
|
-
const
|
|
16
|
+
const notificationContainerBaseThemeVariants = cva(`p-2 z-40000`, {
|
|
17
17
|
variants: {
|
|
18
18
|
position: {
|
|
19
19
|
bottom: "bottom-0 left-1/2 -translate-x-1/2",
|
|
@@ -35,31 +35,29 @@ const notificationContainerBaseVariants = cva(`p-2 z-40000`, {
|
|
|
35
35
|
//-----------------------
|
|
36
36
|
// Notification Component
|
|
37
37
|
//-----------------------
|
|
38
|
-
const
|
|
39
|
-
absolute top-0 right-0
|
|
40
|
-
|
|
41
|
-
[&>svg.lucide]
|
|
42
|
-
[&>svg.lucide]:-mt-1
|
|
38
|
+
const notificationActionThemeVariants = cva(`
|
|
39
|
+
absolute top-0 right-0 flex h-auto items-start
|
|
40
|
+
[&>svg.lucide]:cursor-pointer
|
|
41
|
+
[&>svg.lucide]:-mt-1
|
|
43
42
|
`);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
border border-border
|
|
43
|
+
const notificationBaseThemeVariants = cva(`
|
|
44
|
+
relative mb-2 flex h-fit w-fit flex-col overflow-hidden
|
|
45
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
46
|
+
border border-border shadow-(--shadow-overlay)
|
|
49
47
|
`);
|
|
50
|
-
const
|
|
51
|
-
flex flex-1 p-2 ps-0 pe-8
|
|
48
|
+
const notificationBodyThemeVariants = cva(`
|
|
49
|
+
flex flex-1 p-2 ps-0 pe-8
|
|
52
50
|
`);
|
|
53
|
-
const
|
|
54
|
-
flex flex-1
|
|
51
|
+
const notificationContentThemeVariants = cva(`
|
|
52
|
+
flex w-full flex-1 items-center
|
|
55
53
|
`);
|
|
56
|
-
const
|
|
57
|
-
w-full flex flex-row items-center
|
|
58
|
-
|
|
59
|
-
select-none
|
|
54
|
+
const notificationHeaderThemeVariants = cva(`
|
|
55
|
+
flex w-full flex-1 flex-row items-center
|
|
56
|
+
text-sm font-medium
|
|
57
|
+
select-none
|
|
60
58
|
`);
|
|
61
|
-
const
|
|
62
|
-
flex items-center justify-center px-4
|
|
59
|
+
const notificationIconThemeVariants = cva(`
|
|
60
|
+
flex items-center justify-center px-4
|
|
63
61
|
`, {
|
|
64
62
|
variants: {
|
|
65
63
|
type: {
|
|
@@ -70,86 +68,15 @@ const notificationIconVariants = cva(`
|
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
|
-
const
|
|
74
|
-
text-sm text-foreground
|
|
71
|
+
const notificationTextThemeVariants = cva(`
|
|
72
|
+
text-sm text-foreground
|
|
75
73
|
`);
|
|
76
74
|
|
|
77
|
-
const notificationContainerBaseThemeVariants = (theme) => {
|
|
78
|
-
switch (theme) {
|
|
79
|
-
case "mona":
|
|
80
|
-
return notificationContainerBaseVariants;
|
|
81
|
-
default:
|
|
82
|
-
return notificationContainerBaseVariants;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const notificationActionThemeVariants = (theme) => {
|
|
86
|
-
switch (theme) {
|
|
87
|
-
case "mona":
|
|
88
|
-
return notificationActionVariants;
|
|
89
|
-
default:
|
|
90
|
-
return notificationActionVariants;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const notificationBaseThemeVariants = (theme) => {
|
|
94
|
-
switch (theme) {
|
|
95
|
-
case "mona":
|
|
96
|
-
return notificationBaseVariants;
|
|
97
|
-
default:
|
|
98
|
-
return notificationBaseVariants;
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const notificationBodyThemeVariants = (theme) => {
|
|
102
|
-
switch (theme) {
|
|
103
|
-
case "mona":
|
|
104
|
-
return notificationBodyVariants;
|
|
105
|
-
default:
|
|
106
|
-
return notificationBodyVariants;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
const notificationContentThemeVariants = (theme) => {
|
|
110
|
-
switch (theme) {
|
|
111
|
-
case "mona":
|
|
112
|
-
return notificationContentVariants;
|
|
113
|
-
default:
|
|
114
|
-
return notificationContentVariants;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
const notificationHeaderThemeVariants = (theme) => {
|
|
118
|
-
switch (theme) {
|
|
119
|
-
case "mona":
|
|
120
|
-
return notificationHeaderVariants;
|
|
121
|
-
default:
|
|
122
|
-
return notificationHeaderVariants;
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const notificationIconThemeVariants = (theme) => {
|
|
126
|
-
switch (theme) {
|
|
127
|
-
case "mona":
|
|
128
|
-
return notificationIconVariants;
|
|
129
|
-
default:
|
|
130
|
-
return notificationIconVariants;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
const notificationTextThemeVariants = (theme) => {
|
|
134
|
-
switch (theme) {
|
|
135
|
-
case "mona":
|
|
136
|
-
return notificationTextVariants;
|
|
137
|
-
default:
|
|
138
|
-
return notificationTextVariants;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
// type NotificationBaseVariantProps = VariantProps<ReturnType<typeof notificationBaseThemeVariants>>;
|
|
142
|
-
// type NotificationBaseVariantInput = VariantInputs<NotificationBaseVariantProps>;
|
|
143
|
-
//
|
|
144
|
-
// export type NotificationVariantProps = NotificationBaseVariantProps;
|
|
145
|
-
// export type NotificationVariantInput = NotificationBaseVariantInput;
|
|
146
|
-
|
|
147
75
|
class NotificationComponent {
|
|
148
76
|
#destroyRef;
|
|
149
77
|
#document;
|
|
150
78
|
#isUrgent;
|
|
151
79
|
#paused;
|
|
152
|
-
#themeService;
|
|
153
80
|
constructor() {
|
|
154
81
|
this.#destroyRef = inject(DestroyRef);
|
|
155
82
|
this.#document = inject(DOCUMENT);
|
|
@@ -157,27 +84,22 @@ class NotificationComponent {
|
|
|
157
84
|
...(ngDevMode ? [{ debugName: "#isUrgent" }] : /* istanbul ignore next */ []));
|
|
158
85
|
this.#paused = signal(false, /* @ts-ignore */
|
|
159
86
|
...(ngDevMode ? [{ debugName: "#paused" }] : /* istanbul ignore next */ []));
|
|
160
|
-
this.#themeService = inject(ThemeService);
|
|
161
87
|
this.actionClass = computed(() => {
|
|
162
|
-
|
|
163
|
-
return notificationActionThemeVariants(theme)();
|
|
88
|
+
return notificationActionThemeVariants();
|
|
164
89
|
}, /* @ts-ignore */
|
|
165
90
|
...(ngDevMode ? [{ debugName: "actionClass" }] : /* istanbul ignore next */ []));
|
|
166
91
|
this.ariaLive = computed(() => (this.#isUrgent() ? "assertive" : "polite"), /* @ts-ignore */
|
|
167
92
|
...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
168
93
|
this.baseClass = computed(() => {
|
|
169
|
-
|
|
170
|
-
return notificationBaseThemeVariants(theme)();
|
|
94
|
+
return notificationBaseThemeVariants();
|
|
171
95
|
}, /* @ts-ignore */
|
|
172
96
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
173
97
|
this.bodyClass = computed(() => {
|
|
174
|
-
|
|
175
|
-
return notificationBodyThemeVariants(theme)();
|
|
98
|
+
return notificationBodyThemeVariants();
|
|
176
99
|
}, /* @ts-ignore */
|
|
177
100
|
...(ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []));
|
|
178
101
|
this.contentClass = computed(() => {
|
|
179
|
-
|
|
180
|
-
return notificationContentThemeVariants(theme)();
|
|
102
|
+
return notificationContentThemeVariants();
|
|
181
103
|
}, /* @ts-ignore */
|
|
182
104
|
...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
|
|
183
105
|
this.contentComponent = computed(() => {
|
|
@@ -192,14 +114,12 @@ class NotificationComponent {
|
|
|
192
114
|
...(ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []));
|
|
193
115
|
this.contentHost = viewChild("contentHost", { ...(ngDevMode ? { debugName: "contentHost" } : /* istanbul ignore next */ {}), read: ViewContainerRef });
|
|
194
116
|
this.headerClass = computed(() => {
|
|
195
|
-
|
|
196
|
-
return notificationHeaderThemeVariants(theme)();
|
|
117
|
+
return notificationHeaderThemeVariants();
|
|
197
118
|
}, /* @ts-ignore */
|
|
198
119
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
199
120
|
this.iconClass = computed(() => {
|
|
200
|
-
const theme = this.#themeService.theme();
|
|
201
121
|
const type = this.type();
|
|
202
|
-
return notificationIconThemeVariants(
|
|
122
|
+
return notificationIconThemeVariants({ type });
|
|
203
123
|
}, /* @ts-ignore */
|
|
204
124
|
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
205
125
|
this.isStringContent = computed(() => typeof this.data().options.content === "string", /* @ts-ignore */
|
|
@@ -215,8 +135,7 @@ class NotificationComponent {
|
|
|
215
135
|
this.role = computed(() => (this.#isUrgent() ? "alert" : "status"), /* @ts-ignore */
|
|
216
136
|
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
217
137
|
this.textClass = computed(() => {
|
|
218
|
-
|
|
219
|
-
return notificationTextThemeVariants(theme)();
|
|
138
|
+
return notificationTextThemeVariants();
|
|
220
139
|
}, /* @ts-ignore */
|
|
221
140
|
...(ngDevMode ? [{ debugName: "textClass" }] : /* istanbul ignore next */ []));
|
|
222
141
|
this.type = computed(() => this.data().options.type ?? "info", /* @ts-ignore */
|
|
@@ -270,7 +189,7 @@ class NotificationComponent {
|
|
|
270
189
|
});
|
|
271
190
|
}
|
|
272
191
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
273
|
-
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`;\
|
|
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()\">{{ data().options.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]=\"data().options.closeTitle || 'Close'\"\n [attr.aria-label]=\"data().options.closeTitle || 'Close'\"\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: ["aria-label", "aria-valuetext", "animate", "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", "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]" }] }); }
|
|
274
193
|
}
|
|
275
194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationComponent, decorators: [{
|
|
276
195
|
type: Component,
|
|
@@ -288,17 +207,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
288
207
|
"(pointerleave)": "onInteractionEnd()",
|
|
289
208
|
"(focusin)": "onInteractionStart()",
|
|
290
209
|
"(focusout)": "onInteractionEnd()"
|
|
291
|
-
}, template: "@let width = typeof data().options.width === \"string\" ? data().options.width : `${data().options.width}px`;\
|
|
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()\">{{ data().options.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]=\"data().options.closeTitle || 'Close'\"\n [attr.aria-label]=\"data().options.closeTitle || 'Close'\"\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"] }]
|
|
292
211
|
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ["contentHost", { ...{ read: ViewContainerRef }, isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }] } });
|
|
293
212
|
|
|
294
213
|
class NotificationContainerComponent {
|
|
295
214
|
constructor() {
|
|
296
|
-
this.#themeService = inject(ThemeService);
|
|
297
215
|
this.baseClass = computed(() => {
|
|
298
|
-
const theme = this.#themeService.theme();
|
|
299
216
|
const position = this.position();
|
|
300
217
|
const positionType = this.positionType();
|
|
301
|
-
return notificationContainerBaseThemeVariants(
|
|
218
|
+
return notificationContainerBaseThemeVariants({ position, positionType });
|
|
302
219
|
}, /* @ts-ignore */
|
|
303
220
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
304
221
|
this.enterAnimClass = computed(() => this.position().startsWith("bottom") ? "notification-enter-bottom" : "notification-enter-top", /* @ts-ignore */
|
|
@@ -312,7 +229,6 @@ class NotificationContainerComponent {
|
|
|
312
229
|
this.positionType = signal("fixed", /* @ts-ignore */
|
|
313
230
|
...(ngDevMode ? [{ debugName: "positionType" }] : /* istanbul ignore next */ []));
|
|
314
231
|
}
|
|
315
|
-
#themeService;
|
|
316
232
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NotificationContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
317
233
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NotificationContainerComponent, isStandalone: true, selector: "mona-notification-container", host: { properties: { "class": "baseClass()" } }, ngImport: i0, 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", dependencies: [{ kind: "component", type: NotificationComponent, selector: "mona-notification", inputs: ["data"] }] }); }
|
|
318
234
|
}
|