@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
|
@@ -7,7 +7,6 @@ import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
|
7
7
|
import { PreventableEvent, ContainsPipe } from '@nanahoshi/mona-ui/common';
|
|
8
8
|
import { ListService } from '@nanahoshi/mona-ui/internal/list';
|
|
9
9
|
import { ListViewComponent, ListViewSelectableDirective, ListViewItemTemplateDirective, ListViewNavigableDirective, ListViewNoDataTemplateDirective, ListViewFooterTemplateDirective, ListViewHeaderTemplateDirective } from '@nanahoshi/mona-ui/list-view';
|
|
10
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
11
10
|
import { ImmutableList } from '@mirei/ts-collections';
|
|
12
11
|
import { Subject, ReplaySubject, sample, delay, filter, tap, scan, startWith, switchMap } from 'rxjs';
|
|
13
12
|
import { cva } from 'class-variance-authority';
|
|
@@ -133,7 +132,7 @@ class ListBoxTransferEvent extends PreventableEvent {
|
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
const
|
|
135
|
+
const listBoxBaseThemeVariants = cva(`
|
|
137
136
|
flex gap-1
|
|
138
137
|
[&_mona-list-view]:w-full
|
|
139
138
|
`, {
|
|
@@ -171,7 +170,7 @@ const listBoxBaseVariants = cva(`
|
|
|
171
170
|
}
|
|
172
171
|
]
|
|
173
172
|
});
|
|
174
|
-
const
|
|
173
|
+
const listBoxToolbarThemeVariants = cva(`
|
|
175
174
|
flex gap-1
|
|
176
175
|
items-center justify-center
|
|
177
176
|
`, {
|
|
@@ -183,37 +182,18 @@ const listBoxToolbarVariants = cva(`
|
|
|
183
182
|
}
|
|
184
183
|
});
|
|
185
184
|
|
|
186
|
-
const listBoxBaseThemeVariants = (theme) => {
|
|
187
|
-
switch (theme) {
|
|
188
|
-
case "mona":
|
|
189
|
-
return listBoxBaseVariants;
|
|
190
|
-
default:
|
|
191
|
-
return listBoxBaseVariants;
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
const listBoxToolbarThemeVariants = (theme) => {
|
|
195
|
-
switch (theme) {
|
|
196
|
-
case "mona":
|
|
197
|
-
return listBoxToolbarVariants;
|
|
198
|
-
default:
|
|
199
|
-
return listBoxToolbarVariants;
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
|
|
203
185
|
class ListBoxComponent {
|
|
204
186
|
#dataStateChange$;
|
|
205
187
|
#destroyRef;
|
|
206
188
|
#hostElementRef;
|
|
207
189
|
#listService;
|
|
208
190
|
#notifySelectionChange$;
|
|
209
|
-
#themeService;
|
|
210
191
|
constructor() {
|
|
211
192
|
this.#dataStateChange$ = new Subject();
|
|
212
193
|
this.#destroyRef = inject(DestroyRef);
|
|
213
194
|
this.#hostElementRef = inject(ElementRef);
|
|
214
195
|
this.#listService = inject(ListService);
|
|
215
196
|
this.#notifySelectionChange$ = new ReplaySubject(1);
|
|
216
|
-
this.#themeService = inject(ThemeService);
|
|
217
197
|
/**
|
|
218
198
|
* The list box (`this` or the connected list box) that currently holds the selection; falling back to `this`
|
|
219
199
|
* when neither side has a selection. Used by actions that make sense to run on `this` even with no selection
|
|
@@ -232,14 +212,13 @@ class ListBoxComponent {
|
|
|
232
212
|
}, /* @ts-ignore */
|
|
233
213
|
...(ngDevMode ? [{ debugName: "activeListBox" }] : /* istanbul ignore next */ []));
|
|
234
214
|
this.baseClasses = computed(() => {
|
|
235
|
-
const theme = this.#themeService.theme();
|
|
236
215
|
const rounded = this.rounded();
|
|
237
216
|
const size = this.size();
|
|
238
217
|
const toolbarOptions = this.toolbarOptions();
|
|
239
218
|
const position = toolbarOptions?.position ?? "right";
|
|
240
219
|
const direction = position === "left" || position === "right" ? "horizontal" : "vertical";
|
|
241
220
|
const reversed = position === "left" || position === "top";
|
|
242
|
-
return listBoxBaseThemeVariants(
|
|
221
|
+
return listBoxBaseThemeVariants({ direction, reversed, rounded, size });
|
|
243
222
|
}, /* @ts-ignore */
|
|
244
223
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
245
224
|
this.footerTemplate = contentChild(ListBoxFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
@@ -266,11 +245,10 @@ class ListBoxComponent {
|
|
|
266
245
|
}, /* @ts-ignore */
|
|
267
246
|
...(ngDevMode ? [{ debugName: "selectableOptions" }] : /* istanbul ignore next */ []));
|
|
268
247
|
this.toolbarClasses = computed(() => {
|
|
269
|
-
const theme = this.#themeService.theme();
|
|
270
248
|
const toolbarOptions = this.toolbarOptions();
|
|
271
249
|
const position = toolbarOptions?.position ?? "right";
|
|
272
250
|
const direction = position === "left" || position === "right" ? "vertical" : "horizontal";
|
|
273
|
-
return listBoxToolbarThemeVariants(
|
|
251
|
+
return listBoxToolbarThemeVariants({ direction });
|
|
274
252
|
}, /* @ts-ignore */
|
|
275
253
|
...(ngDevMode ? [{ debugName: "toolbarClasses" }] : /* istanbul ignore next */ []));
|
|
276
254
|
this.toolbarOptions = computed(() => {
|
|
@@ -4,7 +4,6 @@ import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, Temp
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { ListService, ListComponent, ListHeaderTemplateDirective, ListFooterTemplateDirective, ListGroupHeaderTemplateDirective, ListItemTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
6
6
|
import { PagerComponent } from '@nanahoshi/mona-ui/pager';
|
|
7
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
8
7
|
import { ImmutableSet } from '@mirei/ts-collections';
|
|
9
8
|
import { fromEvent, filter } from 'rxjs';
|
|
10
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -65,11 +64,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
65
64
|
}]
|
|
66
65
|
}] });
|
|
67
66
|
|
|
68
|
-
const
|
|
69
|
-
flex flex-col
|
|
70
|
-
|
|
71
|
-
bg-background text-foreground
|
|
67
|
+
const listViewBaseThemeVariants = cva(`
|
|
68
|
+
flex h-full flex-col overflow-hidden
|
|
69
|
+
bg-surface text-foreground
|
|
72
70
|
border border-border
|
|
71
|
+
outline-none
|
|
73
72
|
`, {
|
|
74
73
|
variants: {
|
|
75
74
|
rounded: {
|
|
@@ -86,20 +85,10 @@ const listViewBaseVariants = cva(`
|
|
|
86
85
|
}
|
|
87
86
|
});
|
|
88
87
|
|
|
89
|
-
const listViewBaseThemeVariants = (theme) => {
|
|
90
|
-
switch (theme) {
|
|
91
|
-
case "mona":
|
|
92
|
-
return listViewBaseVariants;
|
|
93
|
-
default:
|
|
94
|
-
return listViewBaseVariants;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
88
|
class ListViewComponent {
|
|
99
89
|
#destroyRef;
|
|
100
90
|
#hostElementRef;
|
|
101
91
|
#scrollBottomEnabled;
|
|
102
|
-
#themeService;
|
|
103
92
|
#scrollSubscription;
|
|
104
93
|
constructor() {
|
|
105
94
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -109,13 +98,11 @@ class ListViewComponent {
|
|
|
109
98
|
return !pageableOptions.enabled;
|
|
110
99
|
}, /* @ts-ignore */
|
|
111
100
|
...(ngDevMode ? [{ debugName: "#scrollBottomEnabled" }] : /* istanbul ignore next */ []));
|
|
112
|
-
this.#themeService = inject(ThemeService);
|
|
113
101
|
this.#scrollSubscription = null;
|
|
114
102
|
this.baseClasses = computed(() => {
|
|
115
|
-
const theme = this.#themeService.theme();
|
|
116
103
|
const rounded = this.rounded();
|
|
117
104
|
const size = this.size();
|
|
118
|
-
const variantClasses = listViewBaseThemeVariants(
|
|
105
|
+
const variantClasses = listViewBaseThemeVariants({ rounded, size });
|
|
119
106
|
const userClass = this.userClass();
|
|
120
107
|
return twMerge(variantClasses, userClass);
|
|
121
108
|
}, /* @ts-ignore */
|
|
@@ -5,10 +5,10 @@ import { PopupMenuToken, preparePopupMenuItems, PopupMenuItemType, PopupMenuTemp
|
|
|
5
5
|
import { v4 } from 'uuid';
|
|
6
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
7
7
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
9
8
|
import { Subject, startWith, pairwise, tap } from 'rxjs';
|
|
10
9
|
import { twMerge } from 'tailwind-merge';
|
|
11
10
|
import { cva } from 'class-variance-authority';
|
|
11
|
+
import { themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
12
12
|
|
|
13
13
|
class MenuIconTemplateDirective {
|
|
14
14
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenuIconTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -392,10 +392,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
392
392
|
}]
|
|
393
393
|
}] });
|
|
394
394
|
|
|
395
|
-
const
|
|
395
|
+
const contextMenuContentThemeVariants = cva(`
|
|
396
396
|
w-full gap-4 overflow-hidden
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
398
|
+
border border-border shadow-(--shadow-overlay)
|
|
399
399
|
`, {
|
|
400
400
|
variants: {
|
|
401
401
|
rounded: {
|
|
@@ -411,8 +411,8 @@ const contextMenuContentVariants = cva(`
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
|
-
const
|
|
415
|
-
const
|
|
414
|
+
const contextMenuDividerThemeVariants = cva(`-mx-0.5 my-1 h-px bg-border-subtle`);
|
|
415
|
+
const menuItemGroupHeaderThemeVariants = cva(`inline-flex w-full select-none px-2 py-1 font-bold text-muted-foreground`, {
|
|
416
416
|
variants: {
|
|
417
417
|
size: {
|
|
418
418
|
small: "text-xs",
|
|
@@ -421,27 +421,20 @@ const menuItemGroupHeaderVariants = cva(`font-bold inline-flex select-none px-2
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
|
-
const
|
|
425
|
-
const
|
|
426
|
-
const
|
|
427
|
-
const
|
|
428
|
-
const
|
|
429
|
-
relative flex cursor-default select-none items-center px-2 py-1.5
|
|
430
|
-
outline-none
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
data-[disabled='true']:pointer-events-none
|
|
440
|
-
data-[disabled='true']:cursor-not-allowed
|
|
441
|
-
data-[disabled='true']:opacity-50
|
|
442
|
-
|
|
443
|
-
data-[focused]:bg-accent
|
|
444
|
-
data-[focused]:text-accent-foreground
|
|
424
|
+
const menuItemIconThemeVariants = cva(`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`);
|
|
425
|
+
const menuItemLinkThemeVariants = cva(`flex h-3.5 w-3.5 items-center justify-center`);
|
|
426
|
+
const menuItemShortcutThemeVariants = cva(`flex flex-1 items-center justify-end text-xs text-muted-foreground`);
|
|
427
|
+
const menuItemTextThemeVariants = cva(`flex flex-1 items-center justify-start gap-2`);
|
|
428
|
+
const menuItemThemeVariants = cva(`
|
|
429
|
+
relative flex cursor-default select-none items-center gap-4 px-2 py-1.5
|
|
430
|
+
text-foreground outline-none
|
|
431
|
+
hover:bg-[var(--mona-menu-item-hover-background,var(--color-hover))] hover:text-foreground
|
|
432
|
+
focus-within:bg-[var(--mona-menu-item-hover-background,var(--color-hover))]
|
|
433
|
+
focus-within:text-foreground focus-within:outline-none
|
|
434
|
+
data-[disabled='true']:pointer-events-none data-[disabled='true']:cursor-not-allowed
|
|
435
|
+
data-[disabled='true']:text-disabled-foreground
|
|
436
|
+
data-[focused]:bg-[var(--mona-menu-item-hover-background,var(--color-hover))]
|
|
437
|
+
data-[focused]:text-foreground
|
|
445
438
|
`, {
|
|
446
439
|
variants: {
|
|
447
440
|
size: {
|
|
@@ -451,15 +444,16 @@ const menuItemVariants = cva(`
|
|
|
451
444
|
}
|
|
452
445
|
}
|
|
453
446
|
});
|
|
454
|
-
const
|
|
455
|
-
flex items-center justify-center
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
data-[disabled='true']:
|
|
447
|
+
const menubarBaseThemeVariants = cva(`
|
|
448
|
+
flex items-center justify-center gap-1 overflow-hidden
|
|
449
|
+
bg-(--mona-menubar-background)
|
|
450
|
+
[background-image:var(--mona-menubar-background-image,var(--mona-effect-raised-background-image,none))]
|
|
451
|
+
[backdrop-filter:var(--mona-menubar-backdrop-filter,var(--mona-effect-raised-backdrop-filter,none))]
|
|
452
|
+
[-webkit-backdrop-filter:var(--mona-menubar-backdrop-filter,var(--mona-effect-raised-backdrop-filter,none))]
|
|
453
|
+
text-foreground
|
|
454
|
+
border border-border-subtle shadow-(--mona-menubar-shadow)
|
|
455
|
+
data-[disabled='true']:pointer-events-none data-[disabled='true']:cursor-not-allowed
|
|
456
|
+
data-[disabled='true']:text-disabled-foreground data-[disabled='true']:opacity-50
|
|
463
457
|
`, {
|
|
464
458
|
variants: {
|
|
465
459
|
rounded: {
|
|
@@ -475,21 +469,16 @@ const menubarBaseVariants = cva(`
|
|
|
475
469
|
}
|
|
476
470
|
}
|
|
477
471
|
});
|
|
478
|
-
const
|
|
479
|
-
h-full
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
data-[disabled='true']:pointer-events-none
|
|
489
|
-
data-[disabled='true']:cursor-not-allowed
|
|
490
|
-
data-[disabled='true']:opacity-50
|
|
491
|
-
data-[active='true']:bg-accent
|
|
492
|
-
data-[active='true']:text-accent-foreground
|
|
472
|
+
const menubarListItemThemeVariants = cva(`
|
|
473
|
+
flex h-full items-center justify-center px-2 py-1.5
|
|
474
|
+
cursor-pointer text-foreground outline-none
|
|
475
|
+
hover:bg-[var(--mona-menu-item-hover-background,var(--color-hover))] hover:text-foreground
|
|
476
|
+
focus-within:bg-[var(--mona-menu-item-hover-background,var(--color-hover))]
|
|
477
|
+
focus-within:text-foreground focus-within:outline-none
|
|
478
|
+
data-[disabled='true']:pointer-events-none data-[disabled='true']:cursor-not-allowed
|
|
479
|
+
data-[disabled='true']:text-disabled-foreground
|
|
480
|
+
data-[active='true']:bg-[var(--mona-menu-item-hover-background,var(--color-selected))]
|
|
481
|
+
data-[active='true']:text-[var(--mona-menu-item-hover-foreground,var(--color-selected-foreground))]
|
|
493
482
|
`, {
|
|
494
483
|
variants: {
|
|
495
484
|
rounded: {
|
|
@@ -500,119 +489,26 @@ const menubarListItemVariants = cva(`
|
|
|
500
489
|
}
|
|
501
490
|
}
|
|
502
491
|
});
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
p-1
|
|
492
|
+
const menubarListThemeVariants = cva(`
|
|
493
|
+
flex h-full w-full list-none items-center p-1
|
|
494
|
+
select-none
|
|
507
495
|
`);
|
|
508
496
|
|
|
509
|
-
const contextMenuContentThemeVariants = (theme) => {
|
|
510
|
-
switch (theme) {
|
|
511
|
-
case "mona":
|
|
512
|
-
return contextMenuContentVariants;
|
|
513
|
-
default:
|
|
514
|
-
return contextMenuContentVariants;
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
const contextMenuDividerThemeVariants = (theme) => {
|
|
518
|
-
switch (theme) {
|
|
519
|
-
case "mona":
|
|
520
|
-
return contextMenuDividerVariants;
|
|
521
|
-
default:
|
|
522
|
-
return contextMenuDividerVariants;
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
const menuItemGroupHeaderThemeVariants = (theme) => {
|
|
526
|
-
switch (theme) {
|
|
527
|
-
case "mona":
|
|
528
|
-
return menuItemGroupHeaderVariants;
|
|
529
|
-
default:
|
|
530
|
-
return menuItemGroupHeaderVariants;
|
|
531
|
-
}
|
|
532
|
-
};
|
|
533
|
-
const menuItemIconThemeVariants = (theme) => {
|
|
534
|
-
switch (theme) {
|
|
535
|
-
case "mona":
|
|
536
|
-
return menuItemIconVariants;
|
|
537
|
-
default:
|
|
538
|
-
return menuItemIconVariants;
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
const menuItemLinkThemeVariants = (theme) => {
|
|
542
|
-
switch (theme) {
|
|
543
|
-
case "mona":
|
|
544
|
-
return menuItemLinkVariants;
|
|
545
|
-
default:
|
|
546
|
-
return menuItemLinkVariants;
|
|
547
|
-
}
|
|
548
|
-
};
|
|
549
|
-
const menuItemShortcutThemeVariants = (theme) => {
|
|
550
|
-
switch (theme) {
|
|
551
|
-
case "mona":
|
|
552
|
-
return menuItemShortcutVariants;
|
|
553
|
-
default:
|
|
554
|
-
return menuItemShortcutVariants;
|
|
555
|
-
}
|
|
556
|
-
};
|
|
557
|
-
const menuItemTextThemeVariants = (theme) => {
|
|
558
|
-
switch (theme) {
|
|
559
|
-
case "mona":
|
|
560
|
-
return menuItemTextVariants;
|
|
561
|
-
default:
|
|
562
|
-
return menuItemTextVariants;
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
const menuItemThemeVariants = (theme) => {
|
|
566
|
-
switch (theme) {
|
|
567
|
-
case "mona":
|
|
568
|
-
return menuItemVariants;
|
|
569
|
-
default:
|
|
570
|
-
return menuItemVariants;
|
|
571
|
-
}
|
|
572
|
-
};
|
|
573
|
-
const menubarBaseThemeVariants = (theme) => {
|
|
574
|
-
switch (theme) {
|
|
575
|
-
case "mona":
|
|
576
|
-
return menubarBaseVariants;
|
|
577
|
-
default:
|
|
578
|
-
return menubarBaseVariants;
|
|
579
|
-
}
|
|
580
|
-
};
|
|
581
|
-
const menubarListItemThemeVariants = (theme) => {
|
|
582
|
-
switch (theme) {
|
|
583
|
-
case "mona":
|
|
584
|
-
return menubarListItemVariants;
|
|
585
|
-
default:
|
|
586
|
-
return menubarListItemVariants;
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
const menubarListThemeVariants = (theme) => {
|
|
590
|
-
switch (theme) {
|
|
591
|
-
case "mona":
|
|
592
|
-
return menubarListVariants;
|
|
593
|
-
default:
|
|
594
|
-
return menubarListVariants;
|
|
595
|
-
}
|
|
596
|
-
};
|
|
597
|
-
|
|
598
497
|
class MenubarComponent {
|
|
599
498
|
#destroyRef;
|
|
600
499
|
#document;
|
|
601
500
|
#hostElementRef;
|
|
602
|
-
#themeService;
|
|
603
501
|
constructor() {
|
|
604
502
|
this.#destroyRef = inject(DestroyRef);
|
|
605
503
|
this.#document = inject(DOCUMENT);
|
|
606
504
|
this.#hostElementRef = inject((ElementRef));
|
|
607
|
-
this.#themeService = inject(ThemeService);
|
|
608
505
|
this.activeIndex = signal(0, /* @ts-ignore */
|
|
609
506
|
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
610
507
|
this.baseClasses = computed(() => {
|
|
611
|
-
const theme = this.#themeService.theme();
|
|
612
508
|
const rounded = this.rounded();
|
|
613
509
|
const size = this.size();
|
|
614
510
|
const userClasses = this.userClasses();
|
|
615
|
-
const variants = menubarBaseThemeVariants(
|
|
511
|
+
const variants = menubarBaseThemeVariants({ rounded, size });
|
|
616
512
|
return twMerge(variants, userClasses);
|
|
617
513
|
}, /* @ts-ignore */
|
|
618
514
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -625,14 +521,12 @@ class MenubarComponent {
|
|
|
625
521
|
this.iconTemplate = contentChild(MenuIconTemplateDirective, { ...(ngDevMode ? { debugName: "iconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
|
|
626
522
|
descendants: false });
|
|
627
523
|
this.listClasses = computed(() => {
|
|
628
|
-
|
|
629
|
-
return menubarListThemeVariants(theme)();
|
|
524
|
+
return menubarListThemeVariants();
|
|
630
525
|
}, /* @ts-ignore */
|
|
631
526
|
...(ngDevMode ? [{ debugName: "listClasses" }] : /* istanbul ignore next */ []));
|
|
632
527
|
this.listItemClasses = computed(() => {
|
|
633
|
-
const theme = this.#themeService.theme();
|
|
634
528
|
const rounded = this.rounded();
|
|
635
|
-
return menubarListItemThemeVariants(
|
|
529
|
+
return menubarListItemThemeVariants({ rounded });
|
|
636
530
|
}, /* @ts-ignore */
|
|
637
531
|
...(ngDevMode ? [{ debugName: "listItemClasses" }] : /* istanbul ignore next */ []));
|
|
638
532
|
this.menuItemIconTemplate = contentChild(MenuItemIconTemplateDirective, { ...(ngDevMode ? { debugName: "menuItemIconTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef,
|
|
@@ -919,7 +813,7 @@ class MenubarComponent {
|
|
|
919
813
|
this.currentPopupMenu()?.openMenuViaKeyboard();
|
|
920
814
|
}
|
|
921
815
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
922
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClick: "menuItemClick" }, host: { properties: { "class": "baseClasses()", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "groupTemplate", first: true, predicate: MenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: MenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemIconTemplate", first: true, predicate: MenuItemIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemShortcutTemplate", first: true, predicate: MenuItemShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemTextTemplate", first: true, predicate: MenuItemTextTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuList", predicate: MenuComponent, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: MenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuComponents", predicate: PopupMenuComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
|
|
816
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: MenubarComponent, isStandalone: true, selector: "mona-menubar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClasses: { classPropertyName: "userClasses", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuItemClick: "menuItemClick" }, host: { properties: { "class": "baseClasses()", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "groupTemplate", first: true, predicate: MenuGroupTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "iconTemplate", first: true, predicate: MenuIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemIconTemplate", first: true, predicate: MenuItemIconTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemShortcutTemplate", first: true, predicate: MenuItemShortcutTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuItemTextTemplate", first: true, predicate: MenuItemTextTemplateDirective, read: TemplateRef, isSignal: true }, { propertyName: "menuList", predicate: MenuComponent, isSignal: true }, { propertyName: "textTemplate", first: true, predicate: MenuTextTemplateDirective, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupMenuComponents", predicate: PopupMenuComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"disabled() || item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PopupMenuComponent, selector: "mona-popup-menu", inputs: ["anchor", "anchorConnectionPoint", "items", "id", "minWidth", "offset", "popupConnectionPoint", "precise", "rounded", "size", "target", "trigger", "width"], outputs: ["close", "menuClick", "navigate", "open"] }, { kind: "directive", type: PopupMenuTextTemplateDirective, selector: "ng-template[monaPopupMenuTextTemplate]" }, { kind: "directive", type: PopupMenuIconTemplateDirective, selector: "ng-template[monaPopupMenuIconTemplate]" }, { kind: "directive", type: PopupMenuShortcutTemplateDirective, selector: "ng-template[monaPopupMenuShortcutTemplate]" }, { kind: "directive", type: PopupMenuGroupTemplateDirective, selector: "ng-template[monaPopupMenuGroupTemplate]" }] }); }
|
|
923
817
|
}
|
|
924
818
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MenubarComponent, decorators: [{
|
|
925
819
|
type: Component,
|
|
@@ -933,7 +827,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
933
827
|
], host: {
|
|
934
828
|
"[class]": "baseClasses()",
|
|
935
829
|
"[attr.data-disabled]": "disabled()"
|
|
936
|
-
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n" }]
|
|
830
|
+
}, template: "<ul\n [class]=\"listClasses()\"\n role=\"menubar\"\n [attr.aria-disabled]=\"disabled()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledby() || null\">\n @for (item of menuList(); track item; let i = $index) {\n @let menuIconTemplate = item.iconTemplate() ?? iconTemplate() ?? null;\n @let menuTextTemplate = item.textTemplate() ?? textTemplate() ?? null;\n @let menuId = item.uid + \"-menu\";\n <li\n [class]=\"listItemClasses()\"\n [attr.data-disabled]=\"disabled() || item.disabled()\"\n [attr.data-active]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu\"\n [attr.data-mid]=\"item.uid\"\n [attr.tabindex]=\"disabled() || item.disabled() ? -1 : i === activeIndex() ? 0 : -1\"\n [attr.role]=\"'menuitem'\"\n [attr.aria-haspopup]=\"'menu'\"\n [attr.aria-expanded]=\"\n currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? 'true' : 'false'\n \"\n [attr.aria-controls]=\"currentPopupMenu() != null && currentPopupMenu() === item.popupMenu ? menuId : null\"\n [attr.aria-disabled]=\"disabled() || item.disabled()\"\n (pointerenter)=\"onMenuPointerEnter(item, listItemElement, popupMenu)\"\n (keydown)=\"onMenuKeyDown($event, item, popupMenu)\"\n (click)=\"onMenuClick($event, item)\"\n (focus)=\"onMenuFocus(i)\"\n (blur)=\"onMenuBlur($event)\"\n #listItemElement>\n @if (menuIconTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"menuIconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\"></ng-container>\n }\n @if (!menuTextTemplate) {\n <span>{{ item.text() }}</span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"menuTextTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item.text(), items: item.menuItems() }\">\n </ng-container>\n }\n </li>\n <mona-popup-menu\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [target]=\"listItemElement\"\n [anchorConnectionPoint]=\"'bottomleft'\"\n [popupConnectionPoint]=\"'topleft'\"\n (menuClick)=\"onMenuItemClick($event)\"\n (navigate)=\"navigate$.next($event)\"\n [trigger]=\"'click'\"\n [offset]=\"{ horizontal: 0, vertical: 2 }\"\n (close)=\"onPopupMenuClose()\"\n (open)=\"onPopupMenuOpen(popupMenu, listItemElement)\"\n [items]=\"item.menuItems()\"\n [id]=\"menuId\"\n #popupMenu>\n @if (groupTemplate()) {\n <ng-template monaPopupMenuGroupTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (menuItemIconTemplate()) {\n <ng-template monaPopupMenuIconTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemIconTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemShortcutTemplate()) {\n <ng-template monaPopupMenuShortcutTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemShortcutTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n @if (menuItemTextTemplate()) {\n <ng-template monaPopupMenuTextTemplate let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuItemTextTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-container>\n </ng-template>\n }\n </mona-popup-menu>\n }\n</ul>\n" }]
|
|
937
831
|
}], ctorParameters: () => [], propDecorators: { groupTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => MenuGroupTemplateDirective), { ...{
|
|
938
832
|
read: TemplateRef,
|
|
939
833
|
descendants: false
|