@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
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, inject, ElementRef, computed, afterNextRender, ChangeDetectionStrategy, Component, signal, DOCUMENT, Injector, forwardRef, Injectable, DestroyRef, contentChild, TemplateRef, output, input, effect } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Subject, map, takeUntil, take } from 'rxjs';
|
|
5
4
|
import { PopupDataInjectionToken, PopupCloseEvent, PopupCloseSource, PopupService } from '@nanahoshi/mona-ui/popup';
|
|
5
|
+
import { Subject, map, takeUntil, take } from 'rxjs';
|
|
6
6
|
import { PreventableEvent, AnyPipe } from '@nanahoshi/mona-ui/common';
|
|
7
|
-
import { createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
|
|
7
|
+
import { themeOverlaySurfaceClasses, createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
import * as i1 from '@angular/cdk/a11y';
|
|
9
9
|
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
10
10
|
import { NgTemplateOutlet } from '@angular/common';
|
|
11
11
|
import { LucideOctagonAlert, LucideCircleCheckBig, LucideBadgeInfo, LucideOctagonX, LucideBadgeQuestionMark, LucideX, LucideDynamicIcon } from '@lucide/angular';
|
|
12
12
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
13
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
14
13
|
import { cva } from 'class-variance-authority';
|
|
15
14
|
|
|
16
15
|
class DialogContentTemplateDirective {
|
|
@@ -85,12 +84,10 @@ class DialogActionEvent extends PreventableEvent {
|
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
const
|
|
89
|
-
flex flex-col gap-0.5
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
border border-border shadow-sm
|
|
93
|
-
outline-none overflow-hidden
|
|
87
|
+
const dialogBaseThemeVariants = cva(`
|
|
88
|
+
flex h-full w-full flex-col gap-0.5 overflow-hidden
|
|
89
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
90
|
+
border border-border shadow-(--shadow-overlay) outline-none
|
|
94
91
|
`, {
|
|
95
92
|
variants: {
|
|
96
93
|
rounded: {
|
|
@@ -104,12 +101,11 @@ const dialogBaseVariants = cva(`
|
|
|
104
101
|
rounded: "medium"
|
|
105
102
|
}
|
|
106
103
|
});
|
|
107
|
-
const
|
|
108
|
-
flex flex-row gap-1
|
|
104
|
+
const dialogContentContainerThemeVariants = cva(`
|
|
105
|
+
flex flex-1 flex-row gap-1
|
|
109
106
|
`);
|
|
110
|
-
const
|
|
111
|
-
flex flex-col gap-0 pb-2
|
|
112
|
-
w-full h-full pr-2
|
|
107
|
+
const dialogBodyThemeVariants = cva(`
|
|
108
|
+
flex h-full w-full flex-col gap-0 pr-2 pb-2
|
|
113
109
|
`, {
|
|
114
110
|
variants: {
|
|
115
111
|
hasIcon: {
|
|
@@ -118,18 +114,18 @@ const dialogBodyVariants = cva(`
|
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
116
|
});
|
|
121
|
-
const
|
|
122
|
-
flex flex-row gap-2
|
|
123
|
-
|
|
117
|
+
const dialogHeaderThemeVariants = cva(`
|
|
118
|
+
flex flex-row gap-2 pt-4
|
|
119
|
+
select-none
|
|
124
120
|
`);
|
|
125
|
-
const
|
|
126
|
-
flex items-start justify-center pt-8 pr-4 pl-6
|
|
121
|
+
const dialogIconContainerThemeVariants = cva(`
|
|
122
|
+
flex items-start justify-center pt-8 pr-4 pl-6
|
|
127
123
|
`);
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
[&>span]:absolute [&>span]:flex [&>span]:rounded-full
|
|
131
|
-
[&>span]:-top-3 [&>span]:-right-3 [&>span]:-bottom-3 [&>span]:-left-3
|
|
132
|
-
[&>span]:
|
|
124
|
+
const dialogIconThemeVariants = cva(`
|
|
125
|
+
relative h-fit w-fit rounded-full border p-1.5
|
|
126
|
+
[&>span]:absolute [&>span]:flex [&>span]:rounded-full
|
|
127
|
+
[&>span]:-top-3 [&>span]:-right-3 [&>span]:-bottom-3 [&>span]:-left-3
|
|
128
|
+
[&>span]:min-h-full [&>span]:min-w-full [&>span]:border
|
|
133
129
|
`, {
|
|
134
130
|
variants: {
|
|
135
131
|
type: {
|
|
@@ -144,27 +140,29 @@ const dialogIconVariants = cva(`
|
|
|
144
140
|
type: "info"
|
|
145
141
|
}
|
|
146
142
|
});
|
|
147
|
-
const
|
|
148
|
-
flex flex-1 items-center justify-start
|
|
143
|
+
const dialogTitleContainerThemeVariants = cva(`
|
|
144
|
+
flex flex-1 items-center justify-start p-1
|
|
145
|
+
select-none
|
|
149
146
|
`);
|
|
150
|
-
const
|
|
151
|
-
flex items-start justify-end
|
|
147
|
+
const dialogCloseButtonContainerThemeVariants = cva(`
|
|
148
|
+
flex items-start justify-end
|
|
152
149
|
`);
|
|
153
|
-
const
|
|
154
|
-
text-lg font-semibold leading-none tracking-tight
|
|
150
|
+
const dialogTitleThemeVariants = cva(`
|
|
151
|
+
text-lg font-semibold leading-none tracking-tight
|
|
155
152
|
`);
|
|
156
|
-
const
|
|
157
|
-
text-sm text-muted-foreground
|
|
158
|
-
select-none
|
|
153
|
+
const dialogDescriptionThemeVariants = cva(`
|
|
154
|
+
text-sm text-muted-foreground
|
|
155
|
+
select-none
|
|
159
156
|
`);
|
|
160
|
-
const
|
|
161
|
-
flex-1 overflow-auto p-1
|
|
157
|
+
const dialogContentThemeVariants = cva(`
|
|
158
|
+
flex-1 overflow-auto p-1
|
|
159
|
+
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
162
160
|
`);
|
|
163
|
-
const
|
|
164
|
-
flex flex-row
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
const dialogFooterThemeVariants = cva(`
|
|
162
|
+
flex flex-row gap-2 px-4 py-2
|
|
163
|
+
select-none
|
|
164
|
+
bg-surface-muted
|
|
165
|
+
border-t border-border-subtle
|
|
168
166
|
`, {
|
|
169
167
|
variants: {
|
|
170
168
|
layout: {
|
|
@@ -185,108 +183,10 @@ const dialogFooterVariants = cva(`
|
|
|
185
183
|
}
|
|
186
184
|
});
|
|
187
185
|
|
|
188
|
-
const dialogBaseThemeVariants = (theme) => {
|
|
189
|
-
switch (theme) {
|
|
190
|
-
case "mona":
|
|
191
|
-
return dialogBaseVariants;
|
|
192
|
-
default:
|
|
193
|
-
return dialogBaseVariants;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const dialogIconThemeVariants = (theme) => {
|
|
197
|
-
switch (theme) {
|
|
198
|
-
case "mona":
|
|
199
|
-
return dialogIconVariants;
|
|
200
|
-
default:
|
|
201
|
-
return dialogIconVariants;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
const dialogBodyThemeVariants = (theme) => {
|
|
205
|
-
switch (theme) {
|
|
206
|
-
case "mona":
|
|
207
|
-
return dialogBodyVariants;
|
|
208
|
-
default:
|
|
209
|
-
return dialogBodyVariants;
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
const dialogContentContainerThemeVariants = (theme) => {
|
|
213
|
-
switch (theme) {
|
|
214
|
-
case "mona":
|
|
215
|
-
return dialogContentContainerVariants;
|
|
216
|
-
default:
|
|
217
|
-
return dialogContentContainerVariants;
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
const dialogHeaderThemeVariants = (theme) => {
|
|
221
|
-
switch (theme) {
|
|
222
|
-
case "mona":
|
|
223
|
-
return dialogHeaderVariants;
|
|
224
|
-
default:
|
|
225
|
-
return dialogHeaderVariants;
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
const dialogIconContainerThemeVariants = (theme) => {
|
|
229
|
-
switch (theme) {
|
|
230
|
-
case "mona":
|
|
231
|
-
return dialogIconContainerVariants;
|
|
232
|
-
default:
|
|
233
|
-
return dialogIconContainerVariants;
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
const dialogTitleContainerThemeVariants = (theme) => {
|
|
237
|
-
switch (theme) {
|
|
238
|
-
case "mona":
|
|
239
|
-
return dialogTitleContainerVariants;
|
|
240
|
-
default:
|
|
241
|
-
return dialogTitleContainerVariants;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
const dialogCloseButtonContainerThemeVariants = (theme) => {
|
|
245
|
-
switch (theme) {
|
|
246
|
-
case "mona":
|
|
247
|
-
return dialogCloseButtonContainerVariants;
|
|
248
|
-
default:
|
|
249
|
-
return dialogCloseButtonContainerVariants;
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const dialogTitleThemeVariants = (theme) => {
|
|
253
|
-
switch (theme) {
|
|
254
|
-
case "mona":
|
|
255
|
-
return dialogTitleVariants;
|
|
256
|
-
default:
|
|
257
|
-
return dialogTitleVariants;
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
const dialogDescriptionThemeVariants = (theme) => {
|
|
261
|
-
switch (theme) {
|
|
262
|
-
case "mona":
|
|
263
|
-
return dialogDescriptionVariants;
|
|
264
|
-
default:
|
|
265
|
-
return dialogDescriptionVariants;
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
const dialogContentThemeVariants = (theme) => {
|
|
269
|
-
switch (theme) {
|
|
270
|
-
case "mona":
|
|
271
|
-
return dialogContentVariants;
|
|
272
|
-
default:
|
|
273
|
-
return dialogContentVariants;
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
const dialogFooterThemeVariants = (theme) => {
|
|
277
|
-
switch (theme) {
|
|
278
|
-
case "mona":
|
|
279
|
-
return dialogFooterVariants;
|
|
280
|
-
default:
|
|
281
|
-
return dialogFooterVariants;
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
|
|
285
186
|
class DialogContentComponent {
|
|
286
187
|
#hostElementRef;
|
|
287
188
|
#iconMap;
|
|
288
189
|
#injectedData;
|
|
289
|
-
#themeService;
|
|
290
190
|
#trapFocus;
|
|
291
191
|
constructor() {
|
|
292
192
|
this.#hostElementRef = inject(ElementRef);
|
|
@@ -298,33 +198,27 @@ class DialogContentComponent {
|
|
|
298
198
|
warning: { color: "var(--color-warning)", icon: LucideOctagonAlert }
|
|
299
199
|
};
|
|
300
200
|
this.#injectedData = inject(PopupDataInjectionToken);
|
|
301
|
-
this.#themeService = inject(ThemeService);
|
|
302
201
|
this.#trapFocus = inject(CdkTrapFocus);
|
|
303
202
|
this.baseClass = computed(() => {
|
|
304
|
-
const theme = this.#themeService.theme();
|
|
305
203
|
const rounded = this.dialogData().rounded;
|
|
306
|
-
return dialogBaseThemeVariants(
|
|
204
|
+
return dialogBaseThemeVariants({ rounded });
|
|
307
205
|
}, /* @ts-ignore */
|
|
308
206
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
309
207
|
this.bodyClass = computed(() => {
|
|
310
|
-
const theme = this.#themeService.theme();
|
|
311
208
|
const hasIcon = this.dialogData().type != null;
|
|
312
|
-
return dialogBodyThemeVariants(
|
|
209
|
+
return dialogBodyThemeVariants({ hasIcon });
|
|
313
210
|
}, /* @ts-ignore */
|
|
314
211
|
...(ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []));
|
|
315
212
|
this.closeButtonContainerClass = computed(() => {
|
|
316
|
-
|
|
317
|
-
return dialogCloseButtonContainerThemeVariants(theme)();
|
|
213
|
+
return dialogCloseButtonContainerThemeVariants();
|
|
318
214
|
}, /* @ts-ignore */
|
|
319
215
|
...(ngDevMode ? [{ debugName: "closeButtonContainerClass" }] : /* istanbul ignore next */ []));
|
|
320
216
|
this.contentClass = computed(() => {
|
|
321
|
-
|
|
322
|
-
return dialogContentThemeVariants(theme)();
|
|
217
|
+
return dialogContentThemeVariants();
|
|
323
218
|
}, /* @ts-ignore */
|
|
324
219
|
...(ngDevMode ? [{ debugName: "contentClass" }] : /* istanbul ignore next */ []));
|
|
325
220
|
this.contentContainerClass = computed(() => {
|
|
326
|
-
|
|
327
|
-
return dialogContentContainerThemeVariants(theme)();
|
|
221
|
+
return dialogContentContainerThemeVariants();
|
|
328
222
|
}, /* @ts-ignore */
|
|
329
223
|
...(ngDevMode ? [{ debugName: "contentContainerClass" }] : /* istanbul ignore next */ []));
|
|
330
224
|
this.describedById = computed(() => {
|
|
@@ -333,8 +227,7 @@ class DialogContentComponent {
|
|
|
333
227
|
}, /* @ts-ignore */
|
|
334
228
|
...(ngDevMode ? [{ debugName: "describedById" }] : /* istanbul ignore next */ []));
|
|
335
229
|
this.descriptionClass = computed(() => {
|
|
336
|
-
|
|
337
|
-
return dialogDescriptionThemeVariants(theme)();
|
|
230
|
+
return dialogDescriptionThemeVariants();
|
|
338
231
|
}, /* @ts-ignore */
|
|
339
232
|
...(ngDevMode ? [{ debugName: "descriptionClass" }] : /* istanbul ignore next */ []));
|
|
340
233
|
this.descriptionId = createElementControlId();
|
|
@@ -342,15 +235,13 @@ class DialogContentComponent {
|
|
|
342
235
|
...(ngDevMode ? [{ debugName: "dialogData" }] : /* istanbul ignore next */ []));
|
|
343
236
|
this.dialogReference = this.#injectedData.dialogReference;
|
|
344
237
|
this.footerClass = computed(() => {
|
|
345
|
-
const theme = this.#themeService.theme();
|
|
346
238
|
const layout = this.dialogData().actionsLayout;
|
|
347
239
|
const rounded = this.dialogData().rounded;
|
|
348
|
-
return dialogFooterThemeVariants(
|
|
240
|
+
return dialogFooterThemeVariants({ layout, rounded });
|
|
349
241
|
}, /* @ts-ignore */
|
|
350
242
|
...(ngDevMode ? [{ debugName: "footerClass" }] : /* istanbul ignore next */ []));
|
|
351
243
|
this.headerClass = computed(() => {
|
|
352
|
-
|
|
353
|
-
return dialogHeaderThemeVariants(theme)();
|
|
244
|
+
return dialogHeaderThemeVariants();
|
|
354
245
|
}, /* @ts-ignore */
|
|
355
246
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
356
247
|
this.headerId = createElementControlId();
|
|
@@ -360,14 +251,12 @@ class DialogContentComponent {
|
|
|
360
251
|
}, /* @ts-ignore */
|
|
361
252
|
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
362
253
|
this.iconClass = computed(() => {
|
|
363
|
-
const theme = this.#themeService.theme();
|
|
364
254
|
const type = this.dialogData().type;
|
|
365
|
-
return dialogIconThemeVariants(
|
|
255
|
+
return dialogIconThemeVariants({ type });
|
|
366
256
|
}, /* @ts-ignore */
|
|
367
257
|
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
368
258
|
this.iconContainerClass = computed(() => {
|
|
369
|
-
|
|
370
|
-
return dialogIconContainerThemeVariants(theme)();
|
|
259
|
+
return dialogIconContainerThemeVariants();
|
|
371
260
|
}, /* @ts-ignore */
|
|
372
261
|
...(ngDevMode ? [{ debugName: "iconContainerClass" }] : /* istanbul ignore next */ []));
|
|
373
262
|
this.role = computed(() => {
|
|
@@ -376,13 +265,11 @@ class DialogContentComponent {
|
|
|
376
265
|
}, /* @ts-ignore */
|
|
377
266
|
...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
378
267
|
this.titleClass = computed(() => {
|
|
379
|
-
|
|
380
|
-
return dialogTitleThemeVariants(theme)();
|
|
268
|
+
return dialogTitleThemeVariants();
|
|
381
269
|
}, /* @ts-ignore */
|
|
382
270
|
...(ngDevMode ? [{ debugName: "titleClass" }] : /* istanbul ignore next */ []));
|
|
383
271
|
this.titleContainerClass = computed(() => {
|
|
384
|
-
|
|
385
|
-
return dialogTitleContainerThemeVariants(theme)();
|
|
272
|
+
return dialogTitleContainerThemeVariants();
|
|
386
273
|
}, /* @ts-ignore */
|
|
387
274
|
...(ngDevMode ? [{ debugName: "titleContainerClass" }] : /* istanbul ignore next */ []));
|
|
388
275
|
this.#trapFocus.autoCapture = true;
|
|
@@ -412,7 +299,7 @@ class DialogContentComponent {
|
|
|
412
299
|
focusElement(dialogElement, element);
|
|
413
300
|
}
|
|
414
301
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
415
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DialogContentComponent, isStandalone: true, selector: "ng-component", host: { properties: { "class": "baseClass()", "attr.aria-describedby": "describedById()", "attr.aria-labelledby": "headerId", "attr.role": "role()" } }, hostDirectives: [{ directive: i1.CdkTrapFocus }], ngImport: i0, template: "@let dialogIcon = icon();\
|
|
302
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DialogContentComponent, isStandalone: true, selector: "ng-component", host: { properties: { "class": "baseClass()", "attr.aria-describedby": "describedById()", "attr.aria-labelledby": "headerId", "attr.role": "role()" } }, hostDirectives: [{ directive: i1.CdkTrapFocus }], ngImport: i0, template: "@let dialogIcon = icon();\n@let data = dialogData();\n\n<div [class]=\"contentContainerClass()\">\n @if (dialogIcon) {\n <div [class]=\"iconContainerClass()\">\n @if (data.iconTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.iconTemplate\"></ng-container>\n } @else {\n <div [class]=\"iconClass()\">\n <span aria-hidden=\"true\"></span>\n <svg [lucideIcon]=\"dialogIcon.icon\" [size]=\"24\" [style.color]=\"dialogIcon.color\"></svg>\n </div>\n }\n </div>\n }\n <div [class]=\"bodyClass()\">\n <div [class]=\"headerClass()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (data.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.titleTemplate\"></ng-container>\n } @else {\n <h2 [class]=\"titleClass()\">{{ data.title }}</h2>\n }\n </div>\n @if (data.closable) {\n <div [class]=\"closeButtonContainerClass()\">\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"Close dialog\"\n (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n\n @let descriptionTemplateId = data.descriptionTemplate ? descriptionId : undefined;\n <div class=\"p-1\" [attr.id]=\"descriptionTemplateId\">\n @if (data.descriptionTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTemplate\"></ng-container>\n } @else if (data.description) {\n <p [id]=\"descriptionId\" [class]=\"descriptionClass()\">{{ data.description }}</p>\n }\n </div>\n\n <div [class]=\"contentClass()\">\n @if (data.content) {\n <ng-container [ngTemplateOutlet]=\"data.content\"></ng-container>\n } @else if (data.text) {\n <p class=\"select-none\">{{ data.text }}</p>\n }\n </div>\n </div>\n</div>\n\n@if (data.footerTemplate || (data.actions | monaAny)) {\n @if (data.footerTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.footerTemplate\"></ng-container>\n } @else {\n <div [class]=\"footerClass()\">\n @for (action of data.actions; track $index) {\n <button\n monaButton\n type=\"button\"\n [class]=\"action.cssClass || ''\"\n [iconOnly]=\"action.iconOnly || false\"\n [look]=\"action.look\"\n [rounded]=\"action.rounded || data.rounded\"\n (click)=\"onActionClick(action)\">\n {{ action.text }}\n </button>\n }\n </div>\n }\n}\n", dependencies: [{ 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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "pipe", type: AnyPipe, name: "monaAny" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
416
303
|
}
|
|
417
304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
418
305
|
type: Component,
|
|
@@ -421,7 +308,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
421
308
|
"[attr.aria-describedby]": "describedById()",
|
|
422
309
|
"[attr.aria-labelledby]": "headerId",
|
|
423
310
|
"[attr.role]": "role()"
|
|
424
|
-
}, hostDirectives: [CdkTrapFocus], template: "@let dialogIcon = icon();\
|
|
311
|
+
}, hostDirectives: [CdkTrapFocus], template: "@let dialogIcon = icon();\n@let data = dialogData();\n\n<div [class]=\"contentContainerClass()\">\n @if (dialogIcon) {\n <div [class]=\"iconContainerClass()\">\n @if (data.iconTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.iconTemplate\"></ng-container>\n } @else {\n <div [class]=\"iconClass()\">\n <span aria-hidden=\"true\"></span>\n <svg [lucideIcon]=\"dialogIcon.icon\" [size]=\"24\" [style.color]=\"dialogIcon.color\"></svg>\n </div>\n }\n </div>\n }\n <div [class]=\"bodyClass()\">\n <div [class]=\"headerClass()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (data.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.titleTemplate\"></ng-container>\n } @else {\n <h2 [class]=\"titleClass()\">{{ data.title }}</h2>\n }\n </div>\n @if (data.closable) {\n <div [class]=\"closeButtonContainerClass()\">\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"Close dialog\"\n (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n\n @let descriptionTemplateId = data.descriptionTemplate ? descriptionId : undefined;\n <div class=\"p-1\" [attr.id]=\"descriptionTemplateId\">\n @if (data.descriptionTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTemplate\"></ng-container>\n } @else if (data.description) {\n <p [id]=\"descriptionId\" [class]=\"descriptionClass()\">{{ data.description }}</p>\n }\n </div>\n\n <div [class]=\"contentClass()\">\n @if (data.content) {\n <ng-container [ngTemplateOutlet]=\"data.content\"></ng-container>\n } @else if (data.text) {\n <p class=\"select-none\">{{ data.text }}</p>\n }\n </div>\n </div>\n</div>\n\n@if (data.footerTemplate || (data.actions | monaAny)) {\n @if (data.footerTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.footerTemplate\"></ng-container>\n } @else {\n <div [class]=\"footerClass()\">\n @for (action of data.actions; track $index) {\n <button\n monaButton\n type=\"button\"\n [class]=\"action.cssClass || ''\"\n [iconOnly]=\"action.iconOnly || false\"\n [look]=\"action.look\"\n [rounded]=\"action.rounded || data.rounded\"\n (click)=\"onActionClick(action)\">\n {{ action.text }}\n </button>\n }\n </div>\n }\n}\n" }]
|
|
425
312
|
}], ctorParameters: () => [] });
|
|
426
313
|
|
|
427
314
|
class DialogRef {
|