@nanahoshi/mona-ui 0.1.1 → 0.2.1
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 +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 +54 -150
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +67 -99
- 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 +27 -78
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +17 -39
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +39 -48
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +34 -54
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +42 -29
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +33 -54
- 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 +27 -57
- 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 +36 -63
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +38 -64
- 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 +78 -98
- 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 -59
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +19 -31
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -65
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +43 -29
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +40 -102
- 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 +18 -10
- 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 +28 -13
- 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 +16 -7
- 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 +11 -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,8 +7,7 @@ import { any, exactly, Dictionary, lastOrDefault, range, index, select } from '@
|
|
|
7
7
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
8
8
|
import { PreventableEvent, TakeFirstPipe } from '@nanahoshi/mona-ui/common';
|
|
9
9
|
import { CalendarService } from '@nanahoshi/mona-ui/date-input';
|
|
10
|
-
import { createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
11
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
10
|
+
import { themeRaisedBackdropClasses, createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
12
11
|
import { DateTime } from 'luxon';
|
|
13
12
|
import { skip, fromEvent } from 'rxjs';
|
|
14
13
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -56,17 +55,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
56
55
|
}]
|
|
57
56
|
}] });
|
|
58
57
|
|
|
59
|
-
const
|
|
60
|
-
flex flex-col gap-2 p-2
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
const calendarBaseThemeVariants = cva(`
|
|
59
|
+
flex min-w-64 flex-col gap-2 p-2
|
|
60
|
+
select-none
|
|
61
|
+
bg-(--mona-calendar-background) ${themeRaisedBackdropClasses} text-foreground
|
|
62
|
+
border border-border shadow-(--mona-calendar-shadow)
|
|
64
63
|
data-[invalid='true']:border-error
|
|
65
|
-
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/
|
|
64
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
66
65
|
`, {
|
|
67
66
|
variants: {
|
|
68
67
|
disabled: {
|
|
69
|
-
true: "
|
|
68
|
+
true: "pointer-events-none cursor-not-allowed opacity-50"
|
|
70
69
|
},
|
|
71
70
|
readonly: {
|
|
72
71
|
true: "pointer-events-none"
|
|
@@ -80,7 +79,7 @@ const calendarBaseVariants = cva(`
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
|
-
const
|
|
82
|
+
const calendarHeaderThemeVariants = cva(`
|
|
84
83
|
flex items-center justify-center
|
|
85
84
|
[&>button+button]:not-focus:border-s-0
|
|
86
85
|
[&>button:nth-of-type(2)]:flex-1
|
|
@@ -90,21 +89,22 @@ const calendarHeaderVariants = cva(`
|
|
|
90
89
|
[&>button:nth-of-type(4)]:rounded-es-none
|
|
91
90
|
[&>button]:outline-none
|
|
92
91
|
`);
|
|
93
|
-
const
|
|
94
|
-
|
|
92
|
+
const calendarMonthViewDayThemeVariants = cva(`
|
|
93
|
+
cursor-pointer
|
|
94
|
+
hover:bg-hover active:bg-active
|
|
95
95
|
`, {
|
|
96
96
|
variants: {
|
|
97
97
|
disabled: {
|
|
98
|
-
true: "
|
|
98
|
+
true: "pointer-events-none cursor-not-allowed text-disabled-foreground"
|
|
99
99
|
},
|
|
100
100
|
focused: {
|
|
101
|
-
true: "ring-
|
|
101
|
+
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
102
102
|
},
|
|
103
103
|
outside: {
|
|
104
|
-
true: "
|
|
104
|
+
true: "text-muted-foreground"
|
|
105
105
|
},
|
|
106
106
|
rangePreview: {
|
|
107
|
-
true: "bg-
|
|
107
|
+
true: "bg-active hover:bg-active"
|
|
108
108
|
},
|
|
109
109
|
rounded: {
|
|
110
110
|
none: "rounded-none",
|
|
@@ -117,7 +117,7 @@ const calendarMonthViewDayVariants = cva(`
|
|
|
117
117
|
true: "bg-primary text-primary-foreground hover:bg-primary-hover"
|
|
118
118
|
},
|
|
119
119
|
today: {
|
|
120
|
-
true: "font-bold text-
|
|
120
|
+
true: "font-bold text-foreground"
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
compoundVariants: [
|
|
@@ -131,35 +131,31 @@ const calendarMonthViewDayVariants = cva(`
|
|
|
131
131
|
rounded: "medium"
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
|
-
const
|
|
135
|
-
grid gap-0.5
|
|
136
|
-
justify-center
|
|
137
|
-
[&>div]:h-full [&>div]:flex
|
|
138
|
-
[&>div]:items-center [&>div]:justify-center
|
|
134
|
+
const calendarMonthViewGridThemeVariants = cva(`
|
|
135
|
+
grid justify-center gap-0.5
|
|
139
136
|
[&>div]:aspect-square
|
|
140
|
-
|
|
141
|
-
const calendarMonthViewGridHeaderVariants = cva(`
|
|
142
|
-
grid justify-center
|
|
143
|
-
gap-0.5 font-semibold text-sm
|
|
144
|
-
[&>div]:h-full [&>div]:flex
|
|
137
|
+
[&>div]:flex [&>div]:h-full
|
|
145
138
|
[&>div]:items-center [&>div]:justify-center
|
|
139
|
+
`);
|
|
140
|
+
const calendarMonthViewGridHeaderThemeVariants = cva(`
|
|
141
|
+
grid justify-center gap-0.5
|
|
142
|
+
text-sm font-semibold text-muted-foreground
|
|
146
143
|
[&>div]:aspect-square
|
|
144
|
+
[&>div]:flex [&>div]:h-full
|
|
145
|
+
[&>div]:items-center [&>div]:justify-center
|
|
147
146
|
`);
|
|
148
|
-
const
|
|
149
|
-
grid grid-cols-3 gap-0.5
|
|
150
|
-
|
|
151
|
-
[&>div]:h-full [&>div]:flex
|
|
147
|
+
const calendarYearViewGridThemeVariants = cva(`
|
|
148
|
+
grid grid-cols-3 justify-center gap-0.5
|
|
149
|
+
[&>div]:flex [&>div]:h-12
|
|
152
150
|
[&>div]:items-center [&>div]:justify-center
|
|
153
|
-
[&>div]:h-12
|
|
154
151
|
`);
|
|
155
|
-
const
|
|
156
|
-
py-2
|
|
157
|
-
hover:bg-hover
|
|
158
|
-
active:bg-active
|
|
152
|
+
const calendarYearViewCellThemeVariants = cva(`
|
|
153
|
+
cursor-pointer py-2
|
|
154
|
+
hover:bg-hover active:bg-active
|
|
159
155
|
`, {
|
|
160
156
|
variants: {
|
|
161
157
|
focused: {
|
|
162
|
-
true: "ring-
|
|
158
|
+
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
163
159
|
},
|
|
164
160
|
rounded: {
|
|
165
161
|
none: "rounded-none",
|
|
@@ -170,21 +166,18 @@ const calendarYearViewCellVariants = cva(`
|
|
|
170
166
|
}
|
|
171
167
|
}
|
|
172
168
|
});
|
|
173
|
-
const
|
|
174
|
-
grid grid-cols-4 gap-0.5
|
|
175
|
-
|
|
176
|
-
[&>div]:h-full [&>div]:flex
|
|
169
|
+
const calendarDecadeViewGridThemeVariants = cva(`
|
|
170
|
+
grid grid-cols-4 justify-center gap-0.5
|
|
171
|
+
[&>div]:flex [&>div]:h-12
|
|
177
172
|
[&>div]:items-center [&>div]:justify-center
|
|
178
|
-
[&>div]:h-12
|
|
179
173
|
`);
|
|
180
|
-
const
|
|
181
|
-
py-2
|
|
182
|
-
hover:bg-hover
|
|
183
|
-
active:bg-active
|
|
174
|
+
const calendarDecadeViewCellThemeVariants = cva(`
|
|
175
|
+
cursor-pointer py-2
|
|
176
|
+
hover:bg-hover active:bg-active
|
|
184
177
|
`, {
|
|
185
178
|
variants: {
|
|
186
179
|
focused: {
|
|
187
|
-
true: "ring-
|
|
180
|
+
true: "bg-hover outline-none ring-2 ring-inset ring-focus-indicator/35"
|
|
188
181
|
},
|
|
189
182
|
rounded: {
|
|
190
183
|
none: "rounded-none",
|
|
@@ -196,89 +189,14 @@ const calendarDecadeViewCellVariants = cva(`
|
|
|
196
189
|
}
|
|
197
190
|
});
|
|
198
191
|
|
|
199
|
-
const calendarBaseThemeVariants = (theme) => {
|
|
200
|
-
switch (theme) {
|
|
201
|
-
case "mona":
|
|
202
|
-
return calendarBaseVariants;
|
|
203
|
-
default:
|
|
204
|
-
return calendarBaseVariants;
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
const calendarHeaderThemeVariants = (theme) => {
|
|
208
|
-
switch (theme) {
|
|
209
|
-
case "mona":
|
|
210
|
-
return calendarHeaderVariants;
|
|
211
|
-
default:
|
|
212
|
-
return calendarHeaderVariants;
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
const calendarDecadeViewGridThemeVariants = (theme) => {
|
|
216
|
-
switch (theme) {
|
|
217
|
-
case "mona":
|
|
218
|
-
return calendarDecadeViewGridVariants;
|
|
219
|
-
default:
|
|
220
|
-
return calendarDecadeViewGridVariants;
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const calendarDecadeViewCellThemeVariants = (theme) => {
|
|
224
|
-
switch (theme) {
|
|
225
|
-
case "mona":
|
|
226
|
-
return calendarDecadeViewCellVariants;
|
|
227
|
-
default:
|
|
228
|
-
return calendarDecadeViewCellVariants;
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
const calendarMonthViewDayThemeVariants = (theme) => {
|
|
232
|
-
switch (theme) {
|
|
233
|
-
case "mona":
|
|
234
|
-
return calendarMonthViewDayVariants;
|
|
235
|
-
default:
|
|
236
|
-
return calendarMonthViewDayVariants;
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
const calendarMonthViewGridThemeVariants = (theme) => {
|
|
240
|
-
switch (theme) {
|
|
241
|
-
case "mona":
|
|
242
|
-
return calendarMonthViewGridVariants;
|
|
243
|
-
default:
|
|
244
|
-
return calendarMonthViewGridVariants;
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
const calendarMonthViewGridHeaderThemeVariants = (theme) => {
|
|
248
|
-
switch (theme) {
|
|
249
|
-
case "mona":
|
|
250
|
-
return calendarMonthViewGridHeaderVariants;
|
|
251
|
-
default:
|
|
252
|
-
return calendarMonthViewGridHeaderVariants;
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
const calendarYearViewGridThemeVariants = (theme) => {
|
|
256
|
-
switch (theme) {
|
|
257
|
-
case "mona":
|
|
258
|
-
return calendarYearViewGridVariants;
|
|
259
|
-
default:
|
|
260
|
-
return calendarYearViewGridVariants;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
const calendarYearViewCellThemeVariants = (theme) => {
|
|
264
|
-
switch (theme) {
|
|
265
|
-
case "mona":
|
|
266
|
-
return calendarYearViewCellVariants;
|
|
267
|
-
default:
|
|
268
|
-
return calendarYearViewCellVariants;
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
|
|
272
192
|
class DecadeYearDirective {
|
|
273
193
|
constructor() {
|
|
274
|
-
this.#themeService = inject(ThemeService);
|
|
275
194
|
this.ariaLabel = computed(() => `Year ${this.year()}`, /* @ts-ignore */
|
|
276
195
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
277
196
|
this.baseClass = computed(() => {
|
|
278
|
-
const theme = this.#themeService.theme();
|
|
279
197
|
const focused = this.focused();
|
|
280
198
|
const rounded = this.rounded();
|
|
281
|
-
return calendarDecadeViewCellThemeVariants(
|
|
199
|
+
return calendarDecadeViewCellThemeVariants({ focused, rounded });
|
|
282
200
|
}, /* @ts-ignore */
|
|
283
201
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
284
202
|
this.focused = computed(() => {
|
|
@@ -307,7 +225,6 @@ class DecadeYearDirective {
|
|
|
307
225
|
this.year = input.required(/* @ts-ignore */
|
|
308
226
|
...(ngDevMode ? [{ debugName: "year" }] : /* istanbul ignore next */ []));
|
|
309
227
|
}
|
|
310
|
-
#themeService;
|
|
311
228
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DecadeYearDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
312
229
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: DecadeYearDirective, isStandalone: true, selector: "[monaDecadeYear]", inputs: { navigatedDate: { classPropertyName: "navigatedDate", publicName: "navigatedDate", isSignal: true, isRequired: true, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, year: { classPropertyName: "year", publicName: "year", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "gridcell" }, properties: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-current": "isCurrent() ? 'true' : null", "attr.aria-label": "ariaLabel()", "attr.aria-selected": "selected() ? 'true' : null", "class": "baseClass()" } }, ngImport: i0 }); }
|
|
313
230
|
}
|
|
@@ -369,9 +286,7 @@ const compareDates = (date1, date2, operator) => {
|
|
|
369
286
|
|
|
370
287
|
class MonthDayDirective {
|
|
371
288
|
constructor() {
|
|
372
|
-
this.#themeService = inject(ThemeService);
|
|
373
289
|
this.baseClass = computed(() => {
|
|
374
|
-
const theme = this.#themeService.theme();
|
|
375
290
|
const disabled = this.dayDisabled();
|
|
376
291
|
const focused = this.focused();
|
|
377
292
|
const outside = this.outside();
|
|
@@ -379,7 +294,7 @@ class MonthDayDirective {
|
|
|
379
294
|
const rounded = this.rounded();
|
|
380
295
|
const selected = this.selected();
|
|
381
296
|
const today = this.isToday();
|
|
382
|
-
return calendarMonthViewDayThemeVariants(
|
|
297
|
+
return calendarMonthViewDayThemeVariants({
|
|
383
298
|
disabled,
|
|
384
299
|
focused,
|
|
385
300
|
outside,
|
|
@@ -462,7 +377,6 @@ class MonthDayDirective {
|
|
|
462
377
|
this.value = input.required(/* @ts-ignore */
|
|
463
378
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
464
379
|
}
|
|
465
|
-
#themeService;
|
|
466
380
|
onClick(event) {
|
|
467
381
|
if (this.dayDisabled()) {
|
|
468
382
|
return;
|
|
@@ -477,7 +391,7 @@ class MonthDayDirective {
|
|
|
477
391
|
this.dayPointerEnter.emit(this.entry().key);
|
|
478
392
|
}
|
|
479
393
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MonthDayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
480
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: MonthDayDirective, isStandalone: true, selector: "[monaMonthDay]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: true, transformFunction: null }, entry: { classPropertyName: "entry", publicName: "entry", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, monthBounds: { classPropertyName: "monthBounds", publicName: "monthBounds", isSignal: true, isRequired: true, transformFunction: null }, navigatedDate: { classPropertyName: "navigatedDate", publicName: "navigatedDate", isSignal: true, isRequired: true, transformFunction: null }, rangePreview: { classPropertyName: "rangePreview", publicName: "rangePreview", isSignal: true, isRequired: true, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dayPointerEnter: "dayPointerEnter", daySelect: "daySelect" }, host: { listeners: { "click": "onClick($event)", "pointerenter": "onPointerEnter()" }, properties: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-
|
|
394
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: MonthDayDirective, isStandalone: true, selector: "[monaMonthDay]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: true, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: true, transformFunction: null }, entry: { classPropertyName: "entry", publicName: "entry", isSignal: true, isRequired: true, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null }, monthBounds: { classPropertyName: "monthBounds", publicName: "monthBounds", isSignal: true, isRequired: true, transformFunction: null }, navigatedDate: { classPropertyName: "navigatedDate", publicName: "navigatedDate", isSignal: true, isRequired: true, transformFunction: null }, rangePreview: { classPropertyName: "rangePreview", publicName: "rangePreview", isSignal: true, isRequired: true, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dayPointerEnter: "dayPointerEnter", daySelect: "daySelect" }, host: { attributes: { "role": "button" }, listeners: { "click": "onClick($event)", "pointerenter": "onPointerEnter()" }, properties: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-pressed": "selected() ? 'true' : 'false'", "attr.aria-current": "isToday() ? 'date' : null", "attr.aria-disabled": "dayDisabled() ? 'true' : null", "attr.data-range-preview": "rangePreviewed() ? 'true' : null", "class": "baseClass()" } }, ngImport: i0 }); }
|
|
481
395
|
}
|
|
482
396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MonthDayDirective, decorators: [{
|
|
483
397
|
type: Directive,
|
|
@@ -485,30 +399,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
485
399
|
selector: "[monaMonthDay]",
|
|
486
400
|
host: {
|
|
487
401
|
"[attr.tabindex]": "focused() ? 0 : -1",
|
|
488
|
-
"[attr.aria-
|
|
402
|
+
"[attr.aria-pressed]": "selected() ? 'true' : 'false'",
|
|
489
403
|
"[attr.aria-current]": "isToday() ? 'date' : null",
|
|
490
404
|
"[attr.aria-disabled]": "dayDisabled() ? 'true' : null",
|
|
491
405
|
"[attr.data-range-preview]": "rangePreviewed() ? 'true' : null",
|
|
492
406
|
"[class]": "baseClass()",
|
|
493
407
|
"(click)": "onClick($event)",
|
|
494
|
-
"(pointerenter)": "onPointerEnter()"
|
|
408
|
+
"(pointerenter)": "onPointerEnter()",
|
|
409
|
+
role: "button"
|
|
495
410
|
}
|
|
496
411
|
}]
|
|
497
412
|
}], propDecorators: { dayPointerEnter: [{ type: i0.Output, args: ["dayPointerEnter"] }], daySelect: [{ type: i0.Output, args: ["daySelect"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: true }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: true }] }], entry: [{ type: i0.Input, args: [{ isSignal: true, alias: "entry", required: true }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: true }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: true }] }], monthBounds: [{ type: i0.Input, args: [{ isSignal: true, alias: "monthBounds", required: true }] }], navigatedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigatedDate", required: true }] }], rangePreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangePreview", required: true }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }] } });
|
|
498
413
|
|
|
499
414
|
class YearMonthDirective {
|
|
500
415
|
constructor() {
|
|
501
|
-
this.#themeService = inject(ThemeService);
|
|
502
416
|
this.ariaLabel = computed(() => {
|
|
503
417
|
const monthName = this.monthName();
|
|
504
418
|
return `${monthName} ${this.navigatedDate().getFullYear()}`;
|
|
505
419
|
}, /* @ts-ignore */
|
|
506
420
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
507
421
|
this.baseClass = computed(() => {
|
|
508
|
-
const theme = this.#themeService.theme();
|
|
509
422
|
const focused = this.focused();
|
|
510
423
|
const rounded = this.rounded();
|
|
511
|
-
return calendarYearViewCellThemeVariants(
|
|
424
|
+
return calendarYearViewCellThemeVariants({ focused, rounded });
|
|
512
425
|
}, /* @ts-ignore */
|
|
513
426
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
514
427
|
this.focused = computed(() => {
|
|
@@ -543,7 +456,6 @@ class YearMonthDirective {
|
|
|
543
456
|
this.selectedDate = input(/* @ts-ignore */
|
|
544
457
|
...(ngDevMode ? [undefined, { debugName: "selectedDate" }] : /* istanbul ignore next */ []));
|
|
545
458
|
}
|
|
546
|
-
#themeService;
|
|
547
459
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: YearMonthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
548
460
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: YearMonthDirective, isStandalone: true, selector: "[monaYearMonth]", inputs: { month: { classPropertyName: "month", publicName: "month", isSignal: true, isRequired: true, transformFunction: null }, monthName: { classPropertyName: "monthName", publicName: "monthName", isSignal: true, isRequired: true, transformFunction: null }, navigatedDate: { classPropertyName: "navigatedDate", publicName: "navigatedDate", isSignal: true, isRequired: true, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: true, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "gridcell" }, properties: { "attr.tabindex": "focused() ? 0 : -1", "attr.aria-current": "isCurrent() ? 'date' : null", "attr.aria-label": "ariaLabel()", "attr.aria-selected": "selected() ? 'true' : null", "class": "baseClass()" } }, ngImport: i0 }); }
|
|
549
461
|
}
|
|
@@ -568,7 +480,6 @@ class CalendarComponent {
|
|
|
568
480
|
#hostElementRef;
|
|
569
481
|
#monthDict;
|
|
570
482
|
#outputValue;
|
|
571
|
-
#themeService;
|
|
572
483
|
constructor() {
|
|
573
484
|
this.#calendarService = inject(CalendarService, { optional: true });
|
|
574
485
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -629,7 +540,6 @@ class CalendarComponent {
|
|
|
629
540
|
return [];
|
|
630
541
|
}, /* @ts-ignore */
|
|
631
542
|
...(ngDevMode ? [{ debugName: "#outputValue" }] : /* istanbul ignore next */ []));
|
|
632
|
-
this.#themeService = inject(ThemeService);
|
|
633
543
|
this.ariaLabel = computed(() => {
|
|
634
544
|
const view = this.calendarView();
|
|
635
545
|
const navigatedDate = this.navigatedDate();
|
|
@@ -645,11 +555,10 @@ class CalendarComponent {
|
|
|
645
555
|
}, /* @ts-ignore */
|
|
646
556
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
647
557
|
this.baseClass = computed(() => {
|
|
648
|
-
const theme = this.#themeService.theme();
|
|
649
558
|
const disabled = this.disabled();
|
|
650
559
|
const readonly = this.readonly();
|
|
651
560
|
const rounded = this.rounded() === "full" ? "large" : this.rounded();
|
|
652
|
-
const variantClass = calendarBaseThemeVariants(
|
|
561
|
+
const variantClass = calendarBaseThemeVariants({ disabled, readonly, rounded });
|
|
653
562
|
const userClass = this.userClass();
|
|
654
563
|
return twMerge(variantClass, userClass);
|
|
655
564
|
}, /* @ts-ignore */
|
|
@@ -663,8 +572,7 @@ class CalendarComponent {
|
|
|
663
572
|
}, /* @ts-ignore */
|
|
664
573
|
...(ngDevMode ? [{ debugName: "decadeEnd" }] : /* istanbul ignore next */ []));
|
|
665
574
|
this.decadeGridClass = computed(() => {
|
|
666
|
-
|
|
667
|
-
return calendarDecadeViewGridThemeVariants(theme)();
|
|
575
|
+
return calendarDecadeViewGridThemeVariants();
|
|
668
576
|
}, /* @ts-ignore */
|
|
669
577
|
...(ngDevMode ? [{ debugName: "decadeGridClass" }] : /* istanbul ignore next */ []));
|
|
670
578
|
this.decadeStart = computed(() => {
|
|
@@ -684,11 +592,10 @@ class CalendarComponent {
|
|
|
684
592
|
...(ngDevMode ? [{ debugName: "decadeYears" }] : /* istanbul ignore next */ []));
|
|
685
593
|
this.gridId = createElementControlId();
|
|
686
594
|
this.headerClass = computed(() => {
|
|
687
|
-
|
|
688
|
-
return calendarHeaderThemeVariants(theme)({});
|
|
595
|
+
return calendarHeaderThemeVariants({});
|
|
689
596
|
}, /* @ts-ignore */
|
|
690
597
|
...(ngDevMode ? [{ debugName: "headerClass" }] : /* istanbul ignore next */ []));
|
|
691
|
-
this.invalidState = computed(() => this.
|
|
598
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.isEmptyValue())), /* @ts-ignore */
|
|
692
599
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
693
600
|
this.monthBounds = computed(() => {
|
|
694
601
|
const navigatedDate = this.navigatedDate();
|
|
@@ -708,13 +615,11 @@ class CalendarComponent {
|
|
|
708
615
|
}, /* @ts-ignore */
|
|
709
616
|
...(ngDevMode ? [{ debugName: "monthDictChunked" }] : /* istanbul ignore next */ []));
|
|
710
617
|
this.monthGridClass = computed(() => {
|
|
711
|
-
|
|
712
|
-
return calendarMonthViewGridThemeVariants(theme)();
|
|
618
|
+
return calendarMonthViewGridThemeVariants();
|
|
713
619
|
}, /* @ts-ignore */
|
|
714
620
|
...(ngDevMode ? [{ debugName: "monthGridClass" }] : /* istanbul ignore next */ []));
|
|
715
621
|
this.monthGridHeaderClass = computed(() => {
|
|
716
|
-
|
|
717
|
-
return calendarMonthViewGridHeaderThemeVariants(theme)();
|
|
622
|
+
return calendarMonthViewGridHeaderThemeVariants();
|
|
718
623
|
}, /* @ts-ignore */
|
|
719
624
|
...(ngDevMode ? [{ debugName: "monthGridHeaderClass" }] : /* istanbul ignore next */ []));
|
|
720
625
|
this.months = computed(() => {
|
|
@@ -821,8 +726,7 @@ class CalendarComponent {
|
|
|
821
726
|
this.yearCellTemplate = contentChild(CalendarYearCellTemplateDirective, /* @ts-ignore */
|
|
822
727
|
...(ngDevMode ? [{ debugName: "yearCellTemplate" }] : /* istanbul ignore next */ []));
|
|
823
728
|
this.yearGridClass = computed(() => {
|
|
824
|
-
|
|
825
|
-
return calendarYearViewGridThemeVariants(theme)();
|
|
729
|
+
return calendarYearViewGridThemeVariants();
|
|
826
730
|
}, /* @ts-ignore */
|
|
827
731
|
...(ngDevMode ? [{ debugName: "yearGridClass" }] : /* istanbul ignore next */ []));
|
|
828
732
|
/**
|