@nanahoshi/mona-ui 0.1.1 → 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 +38 -53
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +53 -149
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +48 -95
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +26 -77
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +16 -38
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -46
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +32 -52
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +40 -27
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +51 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +32 -53
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
- 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 +26 -56
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +35 -62
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +37 -63
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +47 -92
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -58
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -30
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +40 -61
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +41 -27
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +35 -99
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
- package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
- 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 +2 -1
- 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 +2 -3
- 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 -5
- 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 +6 -7
- 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-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
- package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- 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 +6 -7
- 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 +12 -13
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
- 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
|
@@ -6,10 +6,9 @@ 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
12
|
import { filter, tap } from 'rxjs';
|
|
14
13
|
import { twMerge } from 'tailwind-merge';
|
|
15
14
|
import { cva } from 'class-variance-authority';
|
|
@@ -39,23 +38,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
39
38
|
type: Injectable
|
|
40
39
|
}] });
|
|
41
40
|
|
|
42
|
-
const
|
|
41
|
+
const multiSelectBaseThemeVariants = cva(`
|
|
43
42
|
flex items-center justify-between
|
|
44
|
-
border border-input-border outline-none
|
|
45
|
-
bg-background text-foreground shadow-xs
|
|
46
43
|
cursor-pointer
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
49
49
|
`, {
|
|
50
50
|
variants: {
|
|
51
51
|
disabled: {
|
|
52
|
-
true:
|
|
52
|
+
true: `
|
|
53
|
+
pointer-events-none cursor-not-allowed
|
|
54
|
+
bg-disabled-background text-disabled-foreground
|
|
55
|
+
border-disabled-border shadow-none
|
|
56
|
+
`
|
|
53
57
|
},
|
|
54
58
|
focused: {
|
|
55
|
-
true: "ring-
|
|
59
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35"
|
|
56
60
|
},
|
|
57
61
|
invalid: {
|
|
58
|
-
true: "border-error ring-
|
|
62
|
+
true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
|
|
59
63
|
false: ""
|
|
60
64
|
},
|
|
61
65
|
rounded: {
|
|
@@ -70,10 +74,17 @@ const multiSelectBaseVariants = cva(`
|
|
|
70
74
|
medium: "min-h-9 text-sm",
|
|
71
75
|
large: "min-h-10 text-md"
|
|
72
76
|
}
|
|
73
|
-
}
|
|
77
|
+
},
|
|
78
|
+
compoundVariants: [
|
|
79
|
+
{
|
|
80
|
+
focused: true,
|
|
81
|
+
invalid: true,
|
|
82
|
+
class: "border-error ring-error/35"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
74
85
|
});
|
|
75
|
-
const
|
|
76
|
-
flex flex-1 items-center gap-1
|
|
86
|
+
const multiSelectItemContainerThemeVariants = cva(`
|
|
87
|
+
flex flex-1 flex-wrap items-center gap-1 p-1
|
|
77
88
|
`, {
|
|
78
89
|
variants: {
|
|
79
90
|
rounded: {
|
|
@@ -85,8 +96,8 @@ const multiSelectItemContainerVariants = cva(`
|
|
|
85
96
|
}
|
|
86
97
|
}
|
|
87
98
|
});
|
|
88
|
-
const
|
|
89
|
-
const
|
|
99
|
+
const multiSelectAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
|
|
100
|
+
const multiSelectIndicatorContainerThemeVariants = cva(`self-center`, {
|
|
90
101
|
variants: {
|
|
91
102
|
size: {
|
|
92
103
|
small: "h-8",
|
|
@@ -96,39 +107,6 @@ const multiSelectIndicatorContainerVariants = cva(`self-center`, {
|
|
|
96
107
|
}
|
|
97
108
|
});
|
|
98
109
|
|
|
99
|
-
const multiSelectBaseThemeVariants = (theme) => {
|
|
100
|
-
switch (theme) {
|
|
101
|
-
case "mona":
|
|
102
|
-
return multiSelectBaseVariants;
|
|
103
|
-
default:
|
|
104
|
-
return multiSelectBaseVariants;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const multiSelectItemContainerThemeVariants = (theme) => {
|
|
108
|
-
switch (theme) {
|
|
109
|
-
case "mona":
|
|
110
|
-
return multiSelectItemContainerVariants;
|
|
111
|
-
default:
|
|
112
|
-
return multiSelectItemContainerVariants;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
const multiSelectAffixContainerThemeVariants = (theme) => {
|
|
116
|
-
switch (theme) {
|
|
117
|
-
case "mona":
|
|
118
|
-
return multiSelectAffixContainerVariants;
|
|
119
|
-
default:
|
|
120
|
-
return multiSelectAffixContainerVariants;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const multiSelectIndicatorContainerThemeVariants = (theme) => {
|
|
124
|
-
switch (theme) {
|
|
125
|
-
case "mona":
|
|
126
|
-
return multiSelectIndicatorContainerVariants;
|
|
127
|
-
default:
|
|
128
|
-
return multiSelectIndicatorContainerVariants;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
110
|
class MultiSelectComponent {
|
|
133
111
|
#destroyRef;
|
|
134
112
|
#dropdownService;
|
|
@@ -136,7 +114,6 @@ class MultiSelectComponent {
|
|
|
136
114
|
#listService;
|
|
137
115
|
#multiSelectService;
|
|
138
116
|
#popupRef;
|
|
139
|
-
#themeService;
|
|
140
117
|
constructor() {
|
|
141
118
|
this.#destroyRef = inject(DestroyRef);
|
|
142
119
|
this.#dropdownService = inject(DropdownService);
|
|
@@ -144,25 +121,22 @@ class MultiSelectComponent {
|
|
|
144
121
|
this.#listService = inject((ListService));
|
|
145
122
|
this.#multiSelectService = inject(MultiSelectService);
|
|
146
123
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
147
|
-
this.#themeService = inject(ThemeService);
|
|
148
124
|
this.activeDescendant = computed(() => {
|
|
149
125
|
const highlightedItem = this.#listService.highlightedItem();
|
|
150
126
|
return highlightedItem ? highlightedItem.uid : null;
|
|
151
127
|
}, /* @ts-ignore */
|
|
152
128
|
...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
153
129
|
this.affixClass = computed(() => {
|
|
154
|
-
|
|
155
|
-
return multiSelectAffixContainerThemeVariants(theme)();
|
|
130
|
+
return multiSelectAffixContainerThemeVariants();
|
|
156
131
|
}, /* @ts-ignore */
|
|
157
132
|
...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
|
|
158
133
|
this.baseClass = computed(() => {
|
|
159
|
-
const theme = this.#themeService.theme();
|
|
160
134
|
const disabled = this.disabled();
|
|
161
135
|
const focused = this.#popupRef() != null;
|
|
162
136
|
const invalid = this.invalidState();
|
|
163
137
|
const rounded = this.rounded();
|
|
164
138
|
const size = this.size();
|
|
165
|
-
const variantClass = multiSelectBaseThemeVariants(
|
|
139
|
+
const variantClass = multiSelectBaseThemeVariants({ disabled, focused, invalid, rounded, size });
|
|
166
140
|
const userClass = this.userClass();
|
|
167
141
|
return twMerge(variantClass, userClass);
|
|
168
142
|
}, /* @ts-ignore */
|
|
@@ -175,25 +149,22 @@ class MultiSelectComponent {
|
|
|
175
149
|
this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && none(this.value())), /* @ts-ignore */
|
|
176
150
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
177
151
|
this.indicatorClass = computed(() => {
|
|
178
|
-
const theme = this.#themeService.theme();
|
|
179
152
|
const size = this.size();
|
|
180
|
-
return multiSelectIndicatorContainerThemeVariants(
|
|
153
|
+
return multiSelectIndicatorContainerThemeVariants({ size });
|
|
181
154
|
}, /* @ts-ignore */
|
|
182
155
|
...(ngDevMode ? [{ debugName: "indicatorClass" }] : /* istanbul ignore next */ []));
|
|
183
156
|
this.itemContainerClass = computed(() => {
|
|
184
|
-
const theme = this.#themeService.theme();
|
|
185
157
|
const rounded = this.rounded();
|
|
186
|
-
return multiSelectItemContainerThemeVariants(
|
|
158
|
+
return multiSelectItemContainerThemeVariants({ rounded });
|
|
187
159
|
}, /* @ts-ignore */
|
|
188
160
|
...(ngDevMode ? [{ debugName: "itemContainerClass" }] : /* istanbul ignore next */ []));
|
|
189
161
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
190
162
|
this.listId = createElementControlId();
|
|
191
163
|
this.listPopupClass = computed(() => {
|
|
192
|
-
const theme = this.#themeService.theme();
|
|
193
164
|
const rounded = this.rounded();
|
|
194
165
|
const size = this.size();
|
|
195
166
|
const userClass = this.popupClass();
|
|
196
|
-
const variantClass = dropdownPopupThemeVariants(
|
|
167
|
+
const variantClass = dropdownPopupThemeVariants({ rounded, size });
|
|
197
168
|
return twMerge(variantClass, userClass);
|
|
198
169
|
}, /* @ts-ignore */
|
|
199
170
|
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
@@ -521,7 +492,7 @@ class MultiSelectComponent {
|
|
|
521
492
|
}
|
|
522
493
|
}
|
|
523
494
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
524
|
-
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: [
|
|
525
496
|
ListService,
|
|
526
497
|
DropdownService,
|
|
527
498
|
MultiSelectService,
|
|
@@ -576,9 +547,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
576
547
|
"[attr.aria-labelledby]": "ariaLabelledBy()",
|
|
577
548
|
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
578
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",
|
|
579
553
|
"[attr.role]": "'combobox'",
|
|
580
554
|
"[attr.tabindex]": "disabled() ? null : 0",
|
|
581
|
-
"[attr.data-invalid]": "invalidState() || null",
|
|
582
555
|
"[class]": "baseClass()",
|
|
583
556
|
"(blur)": "onBlur()"
|
|
584
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" }]
|
|
@@ -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,30 +35,28 @@ const notificationContainerBaseVariants = cva(`p-2 z-40000`, {
|
|
|
35
35
|
//-----------------------
|
|
36
36
|
// Notification Component
|
|
37
37
|
//-----------------------
|
|
38
|
-
const
|
|
39
|
-
absolute top-0 right-0
|
|
40
|
-
flex items-start h-auto
|
|
38
|
+
const notificationActionThemeVariants = cva(`
|
|
39
|
+
absolute top-0 right-0 flex h-auto items-start
|
|
41
40
|
[&>svg.lucide]:cursor-pointer
|
|
42
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
|
|
48
|
+
const notificationBodyThemeVariants = cva(`
|
|
51
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
|
-
|
|
54
|
+
const notificationHeaderThemeVariants = cva(`
|
|
55
|
+
flex w-full flex-1 flex-row items-center
|
|
56
|
+
text-sm font-medium
|
|
59
57
|
select-none
|
|
60
58
|
`);
|
|
61
|
-
const
|
|
59
|
+
const notificationIconThemeVariants = cva(`
|
|
62
60
|
flex items-center justify-center px-4
|
|
63
61
|
`, {
|
|
64
62
|
variants: {
|
|
@@ -70,86 +68,15 @@ const notificationIconVariants = cva(`
|
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
});
|
|
73
|
-
const
|
|
71
|
+
const notificationTextThemeVariants = cva(`
|
|
74
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 */
|
|
@@ -293,12 +212,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
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
|
}
|