@nanahoshi/mona-ui 0.18.6 → 0.20.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/README.md +71 -13
- package/THIRD_PARTY_NOTICES.md +60 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -101
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +39 -21
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +88 -55
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-BuybF7tX.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Dj-SaNzk.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-CYAm4l84.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-B_Gm--X6.mjs} +46 -31
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-X0X487Rm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-CyzJFQIy.mjs} +99 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4874 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +4973 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +66 -29
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +41 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +47 -24
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/locales/package.json +4 -0
- package/package.json +9 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +29 -15
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +7 -1
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +14 -6
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +40 -12
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +50 -2
- package/types/nanahoshi-mona-ui-i18n.d.ts +680 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-locales.d.ts +4889 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +20 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +10 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +11 -4
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -10,6 +10,7 @@ import { CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective
|
|
|
10
10
|
import { CalendarService, TimeSelectorService, datePopupThemeVariants, DateInputPrefixTemplateDirective } from '@nanahoshi/mona-ui/date-input';
|
|
11
11
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
12
12
|
import { DropdownService, DropdownPopupInputToken, DropdownPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
13
|
+
import { injectComponentDirection, MonaI18nService, gregorianDateTime, getLocaleDateTimeInputFormat, parseGregorianDate } from '@nanahoshi/mona-ui/i18n';
|
|
13
14
|
import { themeControlSurfaceClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
14
15
|
import { TextBoxComponent, TextBoxSuffixTemplateDirective, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
|
|
15
16
|
import { TimeSelectorComponent } from '@nanahoshi/mona-ui/time-selector';
|
|
@@ -18,6 +19,17 @@ import { fromEvent, mergeWith } from 'rxjs';
|
|
|
18
19
|
import { twMerge } from 'tailwind-merge';
|
|
19
20
|
import { cva } from 'class-variance-authority';
|
|
20
21
|
|
|
22
|
+
const DATETIME_PICKER_DEFAULT_MESSAGES = {
|
|
23
|
+
calendar: "Calendar",
|
|
24
|
+
cancel: "Cancel",
|
|
25
|
+
date: "Date",
|
|
26
|
+
dateTimePicker: "Date and time picker",
|
|
27
|
+
openDateTimePicker: "Open date and time picker",
|
|
28
|
+
set: "Set",
|
|
29
|
+
time: "Time",
|
|
30
|
+
timePicker: "Time picker"
|
|
31
|
+
};
|
|
32
|
+
|
|
21
33
|
const dateTimePickerBaseThemeVariants = cva(`
|
|
22
34
|
flex items-center
|
|
23
35
|
${themeControlSurfaceClasses} text-foreground
|
|
@@ -88,15 +100,19 @@ const dateTimePickerFooterThemeVariants = cva(`
|
|
|
88
100
|
class DateTimePickerComponent {
|
|
89
101
|
#calendarService;
|
|
90
102
|
#destroyRef;
|
|
103
|
+
#direction;
|
|
91
104
|
#dropdownService;
|
|
92
105
|
#hostElementRef;
|
|
106
|
+
#i18n;
|
|
93
107
|
#id;
|
|
94
108
|
#timeSelectorService;
|
|
95
109
|
constructor() {
|
|
96
110
|
this.#calendarService = inject(CalendarService);
|
|
97
111
|
this.#destroyRef = inject(DestroyRef);
|
|
112
|
+
this.#direction = injectComponentDirection();
|
|
98
113
|
this.#dropdownService = inject(DropdownService);
|
|
99
114
|
this.#hostElementRef = inject(ElementRef);
|
|
115
|
+
this.#i18n = inject(MonaI18nService);
|
|
100
116
|
this.#id = createElementControlId();
|
|
101
117
|
this.#timeSelectorService = inject(TimeSelectorService);
|
|
102
118
|
this.activeView = signal("date", /* @ts-ignore */
|
|
@@ -112,15 +128,24 @@ class DateTimePickerComponent {
|
|
|
112
128
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
113
129
|
this.currentDateString = linkedSignal(() => {
|
|
114
130
|
const value = this.value();
|
|
115
|
-
const format = this.
|
|
131
|
+
const format = this.effectiveFormat();
|
|
132
|
+
const locale = this.#i18n.localeId();
|
|
116
133
|
if (!value) {
|
|
117
134
|
return "";
|
|
118
135
|
}
|
|
119
|
-
return
|
|
136
|
+
return gregorianDateTime(value, locale).toFormat(format);
|
|
120
137
|
}, /* @ts-ignore */
|
|
121
138
|
...(ngDevMode ? [{ debugName: "currentDateString" }] : /* istanbul ignore next */ []));
|
|
122
139
|
this.decadeCellTemplate = contentChild(CalendarDecadeCellTemplateDirective, /* @ts-ignore */
|
|
123
140
|
...(ngDevMode ? [{ debugName: "decadeCellTemplate" }] : /* istanbul ignore next */ []));
|
|
141
|
+
this.effectiveFormat = computed(() => {
|
|
142
|
+
return (this.format() ??
|
|
143
|
+
getLocaleDateTimeInputFormat(this.#i18n.localeId(), {
|
|
144
|
+
hourFormat: this.hourFormat(),
|
|
145
|
+
showSeconds: this.showSeconds()
|
|
146
|
+
}));
|
|
147
|
+
}, /* @ts-ignore */
|
|
148
|
+
...(ngDevMode ? [{ debugName: "effectiveFormat" }] : /* istanbul ignore next */ []));
|
|
124
149
|
this.expanded = computed(() => this.#dropdownService.popupRef() !== null, /* @ts-ignore */
|
|
125
150
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
126
151
|
this.footerClass = computed(() => {
|
|
@@ -149,6 +174,9 @@ class DateTimePickerComponent {
|
|
|
149
174
|
...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
|
|
150
175
|
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
151
176
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
177
|
+
this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
|
|
178
|
+
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
179
|
+
this.messages = this.#i18n.componentMessages("dateTimePicker", DATETIME_PICKER_DEFAULT_MESSAGES);
|
|
152
180
|
this.monthCellTemplate = contentChild(CalendarMonthCellTemplateDirective, /* @ts-ignore */
|
|
153
181
|
...(ngDevMode ? [{ debugName: "monthCellTemplate" }] : /* istanbul ignore next */ []));
|
|
154
182
|
this.navigatedDate = linkedSignal(() => this.value() ?? new Date(), /* @ts-ignore */
|
|
@@ -198,6 +226,7 @@ class DateTimePickerComponent {
|
|
|
198
226
|
/**
|
|
199
227
|
* @description Emits when the popup is about to close. This event is preventable.
|
|
200
228
|
*/
|
|
229
|
+
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
201
230
|
this.close = output();
|
|
202
231
|
/**
|
|
203
232
|
* @description Emits after the popup is closed.
|
|
@@ -215,14 +244,16 @@ class DateTimePickerComponent {
|
|
|
215
244
|
this.disabledDates = input(/* @ts-ignore */
|
|
216
245
|
...(ngDevMode ? [undefined, { debugName: "disabledDates" }] : /* istanbul ignore next */ []));
|
|
217
246
|
/**
|
|
218
|
-
* @description Sets the first day of the week.
|
|
247
|
+
* @description Sets the first day of the week. If not specified, derives from the active locale.
|
|
248
|
+
* @default null
|
|
219
249
|
*/
|
|
220
|
-
this.firstDay = input(
|
|
250
|
+
this.firstDay = input(null, /* @ts-ignore */
|
|
221
251
|
...(ngDevMode ? [{ debugName: "firstDay" }] : /* istanbul ignore next */ []));
|
|
222
252
|
/**
|
|
223
|
-
* @description Sets the date format of the date time picker.
|
|
253
|
+
* @description Sets the date format of the date time picker. If not specified, derives from the active locale, hourFormat, and showSeconds.
|
|
254
|
+
* @default null
|
|
224
255
|
*/
|
|
225
|
-
this.format = input(
|
|
256
|
+
this.format = input(null, /* @ts-ignore */
|
|
226
257
|
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
227
258
|
/**
|
|
228
259
|
* @description Sets the hour format of the time picker.
|
|
@@ -368,10 +399,12 @@ class DateTimePickerComponent {
|
|
|
368
399
|
}
|
|
369
400
|
});
|
|
370
401
|
}
|
|
371
|
-
|
|
372
|
-
this.
|
|
373
|
-
this
|
|
374
|
-
|
|
402
|
+
focus() {
|
|
403
|
+
const input = this.#hostElementRef.nativeElement.querySelector("input");
|
|
404
|
+
if (input && !this.readonly()) {
|
|
405
|
+
input.focus();
|
|
406
|
+
input.setSelectionRange(input.value.length, input.value.length);
|
|
407
|
+
}
|
|
375
408
|
}
|
|
376
409
|
onCalendarValueChange(date) {
|
|
377
410
|
const singleDate = Array.isArray(date) ? null : date;
|
|
@@ -381,6 +414,11 @@ class DateTimePickerComponent {
|
|
|
381
414
|
}
|
|
382
415
|
this.activeView.set("time");
|
|
383
416
|
}
|
|
417
|
+
onCancelClick() {
|
|
418
|
+
this.navigatedDate.set(this.value() ?? new Date());
|
|
419
|
+
this.#dropdownService.popupRef()?.close();
|
|
420
|
+
this.touch.emit();
|
|
421
|
+
}
|
|
384
422
|
onDateInputBlur() {
|
|
385
423
|
if (this.#dropdownService.popupRef()) {
|
|
386
424
|
this.touch.emit();
|
|
@@ -391,14 +429,15 @@ class DateTimePickerComponent {
|
|
|
391
429
|
this.touch.emit();
|
|
392
430
|
return;
|
|
393
431
|
}
|
|
394
|
-
const
|
|
432
|
+
const locale = this.#i18n.localeId();
|
|
433
|
+
const dateTime = parseGregorianDate(this.currentDateString(), this.effectiveFormat(), locale);
|
|
395
434
|
if (this.dateStringEquals(this.value(), dateTime.toJSDate())) {
|
|
396
435
|
this.touch.emit();
|
|
397
436
|
return;
|
|
398
437
|
}
|
|
399
438
|
if (dateTime.isValid) {
|
|
400
439
|
const value = this.value();
|
|
401
|
-
if (value &&
|
|
440
|
+
if (value && gregorianDateTime(value, locale).equals(dateTime)) {
|
|
402
441
|
this.touch.emit();
|
|
403
442
|
return;
|
|
404
443
|
}
|
|
@@ -435,6 +474,9 @@ class DateTimePickerComponent {
|
|
|
435
474
|
this.navigatedDate.set(inRangeDate);
|
|
436
475
|
}
|
|
437
476
|
}
|
|
477
|
+
closePopup() {
|
|
478
|
+
this.#dropdownService.popupRef()?.close();
|
|
479
|
+
}
|
|
438
480
|
compareDatesEqual(date1, date2) {
|
|
439
481
|
return (date1.getFullYear() === date2.getFullYear() &&
|
|
440
482
|
date1.getMonth() === date2.getMonth() &&
|
|
@@ -442,35 +484,12 @@ class DateTimePickerComponent {
|
|
|
442
484
|
}
|
|
443
485
|
dateStringEquals(date1, date2) {
|
|
444
486
|
if (date1 && date2) {
|
|
445
|
-
|
|
446
|
-
|
|
487
|
+
const locale = this.#i18n.localeId();
|
|
488
|
+
return (gregorianDateTime(date1, locale).toFormat(this.effectiveFormat()) ===
|
|
489
|
+
gregorianDateTime(date2, locale).toFormat(this.effectiveFormat()));
|
|
447
490
|
}
|
|
448
491
|
return date1 === date2;
|
|
449
492
|
}
|
|
450
|
-
focus() {
|
|
451
|
-
const input = this.#hostElementRef.nativeElement.querySelector("input");
|
|
452
|
-
if (input && !this.readonly()) {
|
|
453
|
-
input.focus();
|
|
454
|
-
input.setSelectionRange(input.value.length, input.value.length);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
isDateDisabledByInput(date, disabledDates) {
|
|
458
|
-
if (typeof disabledDates === "function") {
|
|
459
|
-
return disabledDates(date);
|
|
460
|
-
}
|
|
461
|
-
else if (disabledDates) {
|
|
462
|
-
return any(disabledDates, d => this.compareDatesEqual(date, d));
|
|
463
|
-
}
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
setCurrentDate(date) {
|
|
467
|
-
this.value.set(date);
|
|
468
|
-
this.updateCurrentDateString(date, this.format());
|
|
469
|
-
this.touch.emit();
|
|
470
|
-
}
|
|
471
|
-
closePopup() {
|
|
472
|
-
this.#dropdownService.popupRef()?.close();
|
|
473
|
-
}
|
|
474
493
|
handleKeydown(event) {
|
|
475
494
|
if (this.disabled() || this.readonly()) {
|
|
476
495
|
return;
|
|
@@ -494,12 +513,12 @@ class DateTimePickerComponent {
|
|
|
494
513
|
}
|
|
495
514
|
if (event.altKey && event.key === "ArrowRight" && popupOpen) {
|
|
496
515
|
event.preventDefault();
|
|
497
|
-
this.activeView.set("time");
|
|
516
|
+
this.activeView.set(this.isRtl() ? "date" : "time");
|
|
498
517
|
return;
|
|
499
518
|
}
|
|
500
519
|
if (event.altKey && event.key === "ArrowLeft" && popupOpen) {
|
|
501
520
|
event.preventDefault();
|
|
502
|
-
this.activeView.set("date");
|
|
521
|
+
this.activeView.set(this.isRtl() ? "time" : "date");
|
|
503
522
|
return;
|
|
504
523
|
}
|
|
505
524
|
if (event.key === "Enter" && popupOpen) {
|
|
@@ -517,6 +536,15 @@ class DateTimePickerComponent {
|
|
|
517
536
|
return;
|
|
518
537
|
}
|
|
519
538
|
}
|
|
539
|
+
isDateDisabledByInput(date, disabledDates) {
|
|
540
|
+
if (typeof disabledDates === "function") {
|
|
541
|
+
return disabledDates(date);
|
|
542
|
+
}
|
|
543
|
+
else if (disabledDates) {
|
|
544
|
+
return any(disabledDates, d => this.compareDatesEqual(date, d));
|
|
545
|
+
}
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
520
548
|
openPopup() {
|
|
521
549
|
if (!this.#dropdownService.popupRef()) {
|
|
522
550
|
this.#dropdownService.triggerPopupOpen$.next({
|
|
@@ -528,6 +556,11 @@ class DateTimePickerComponent {
|
|
|
528
556
|
});
|
|
529
557
|
}
|
|
530
558
|
}
|
|
559
|
+
setCurrentDate(date) {
|
|
560
|
+
this.value.set(date);
|
|
561
|
+
this.updateCurrentDateString(date, this.effectiveFormat());
|
|
562
|
+
this.touch.emit();
|
|
563
|
+
}
|
|
531
564
|
setKeyboardSubscriptions() {
|
|
532
565
|
fromEvent(this.#hostElementRef.nativeElement, "keydown")
|
|
533
566
|
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
@@ -547,13 +580,13 @@ class DateTimePickerComponent {
|
|
|
547
580
|
keyboardEvent.preventDefault();
|
|
548
581
|
this.closePopup();
|
|
549
582
|
}
|
|
550
|
-
else if (keyboardEvent.altKey && keyboardEvent.key === "ArrowRight"
|
|
583
|
+
else if (keyboardEvent.altKey && keyboardEvent.key === "ArrowRight") {
|
|
551
584
|
keyboardEvent.preventDefault();
|
|
552
|
-
this.activeView.set("time");
|
|
585
|
+
this.activeView.set(this.isRtl() ? "date" : "time");
|
|
553
586
|
}
|
|
554
|
-
else if (keyboardEvent.altKey && keyboardEvent.key === "ArrowLeft"
|
|
587
|
+
else if (keyboardEvent.altKey && keyboardEvent.key === "ArrowLeft") {
|
|
555
588
|
keyboardEvent.preventDefault();
|
|
556
|
-
this.activeView.set("date");
|
|
589
|
+
this.activeView.set(this.isRtl() ? "time" : "date");
|
|
557
590
|
}
|
|
558
591
|
else if (keyboardEvent.key === "Enter" && this.activeView() === "time") {
|
|
559
592
|
const target = keyboardEvent.target;
|
|
@@ -578,6 +611,14 @@ class DateTimePickerComponent {
|
|
|
578
611
|
.subscribe(() => this.focus());
|
|
579
612
|
this.setKeyboardSubscriptions();
|
|
580
613
|
}
|
|
614
|
+
updateCurrentDateString(date, format) {
|
|
615
|
+
if (!date) {
|
|
616
|
+
this.currentDateString.set("");
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const dateString = gregorianDateTime(date, this.#i18n.localeId()).toFormat(format);
|
|
620
|
+
this.currentDateString.set(dateString);
|
|
621
|
+
}
|
|
581
622
|
updateDateIfNotInRange(date) {
|
|
582
623
|
const maxDate = this.max();
|
|
583
624
|
const minDate = this.min();
|
|
@@ -589,14 +630,6 @@ class DateTimePickerComponent {
|
|
|
589
630
|
}
|
|
590
631
|
return date;
|
|
591
632
|
}
|
|
592
|
-
updateCurrentDateString(date, format) {
|
|
593
|
-
if (!date) {
|
|
594
|
-
this.currentDateString.set("");
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
const dateString = DateTime.fromJSDate(date).toFormat(format);
|
|
598
|
-
this.currentDateString.set(dateString);
|
|
599
|
-
}
|
|
600
633
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateTimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
601
634
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DateTimePickerComponent, isStandalone: true, selector: "mona-datetime-picker", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, firstDay: { classPropertyName: "firstDay", publicName: "firstDay", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, hourStep: { classPropertyName: "hourStep", publicName: "hourStep", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, popupClass: { classPropertyName: "popupClass", publicName: "popupClass", isSignal: true, isRequired: false, transformFunction: null }, popupHeight: { classPropertyName: "popupHeight", publicName: "popupHeight", isSignal: true, isRequired: false, transformFunction: null }, popupWidth: { classPropertyName: "popupWidth", publicName: "popupWidth", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, readonlyInput: { classPropertyName: "readonlyInput", publicName: "readonlyInput", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, secondStep: { classPropertyName: "secondStep", publicName: "secondStep", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, weekNumber: { classPropertyName: "weekNumber", publicName: "weekNumber", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onDateInputBlur()" }, properties: { "attr.tabindex": "disabled() ? null : -1", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.data-disabled": "disabled() || null", "attr.data-expanded": "expanded()", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "class": "baseClass()" } }, providers: [
|
|
602
635
|
CalendarService,
|
|
@@ -607,7 +640,7 @@ class DateTimePickerComponent {
|
|
|
607
640
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
608
641
|
multi: false
|
|
609
642
|
}
|
|
610
|
-
], queries: [{ propertyName: "decadeCellTemplate", first: true, predicate: CalendarDecadeCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthCellTemplate", first: true, predicate: CalendarMonthCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DateInputPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "yearCellTemplate", first: true, predicate: CalendarYearCellTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["datePopupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownPopupHandlerDirective }], ngImport: i0, template: "<mona-text-box\n (inputBlur)=\"onDateInputBlur()\"\n (valueChange)=\"onDateStringEdit($event)\"\n [clearButton]=\"showClearButton()\"\n [disabled]=\"disabled()\"\n [inputAttributes]=\"inputAttributes()\"\n [invalid]=\"invalid()\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [touched]=\"touched()\"\n [value]=\"currentDateString()\">\n @if (prefixTemplate()) {\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </ng-template>\n }\n <ng-template monaTextBoxSuffixTemplate>\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"size()\"\n [rounded]=\"'none'\"\n class=\"aspect-square h-full w-auto\"\n [attr.aria-label]=\"
|
|
643
|
+
], queries: [{ propertyName: "decadeCellTemplate", first: true, predicate: CalendarDecadeCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "monthCellTemplate", first: true, predicate: CalendarMonthCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DateInputPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "yearCellTemplate", first: true, predicate: CalendarYearCellTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["datePopupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownPopupHandlerDirective }], ngImport: i0, template: "<mona-text-box\n (inputBlur)=\"onDateInputBlur()\"\n (valueChange)=\"onDateStringEdit($event)\"\n [clearButton]=\"showClearButton()\"\n [disabled]=\"disabled()\"\n [inputAttributes]=\"inputAttributes()\"\n [invalid]=\"invalid()\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [touched]=\"touched()\"\n [value]=\"currentDateString()\">\n @if (prefixTemplate()) {\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </ng-template>\n }\n <ng-template monaTextBoxSuffixTemplate>\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"size()\"\n [rounded]=\"'none'\"\n class=\"aspect-square h-full w-auto\"\n [attr.aria-label]=\"messages().openDateTimePicker\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"popupId\"\n (click)=\"onDateInputButtonClick()\"\n [disabled]=\"disabled() || readonly()\"\n [tabindex]=\"-1\">\n <i class=\"ri-calendar-line\"></i>\n </button>\n </ng-template>\n</mona-text-box>\n\n<ng-template #datePopupTemplate>\n <div\n [class]=\"pickerPopupClass()\"\n [id]=\"popupId\"\n class=\"flex h-68 flex-col\"\n aria-modal=\"true\"\n role=\"dialog\"\n [attr.aria-label]=\"messages().dateTimePicker\"\n cdkTrapFocus>\n <div [class]=\"headerClass()\">\n <mona-button-group\n selection=\"single\"\n [allowEmpty]=\"false\"\n class=\"w-full\"\n [disabled]=\"disabled()\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n role=\"tablist\">\n <button monaButton [selected]=\"activeView() === 'date'\" (click)=\"activeView.set('date')\" role=\"tab\">\n {{ messages().date }}\n </button>\n <button monaButton [selected]=\"activeView() === 'time'\" (click)=\"activeView.set('time')\" role=\"tab\">\n {{ messages().time }}\n </button>\n </mona-button-group>\n </div>\n <div class=\"overflow-hidden\">\n @if (activeView() === \"date\") {\n <div class=\"flex h-full items-center justify-center\" [attr.aria-label]=\"messages().calendar\">\n <mona-calendar\n [disabledDates]=\"disabledDates()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n [firstDay]=\"firstDay()\"\n [weekNumber]=\"weekNumber()\"\n [value]=\"navigatedDate()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n (valueChange)=\"onCalendarValueChange($event)\"\n class=\"flex-1 border-none shadow-none\">\n @if (decadeCellTemplate()) {\n <ng-template monaCalendarDecadeCellTemplate let-year>\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\"></ng-container>\n </ng-template>\n }\n @if (monthCellTemplate()) {\n <ng-template monaCalendarMonthCellTemplate let-day let-date=\"date\">\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, date }\"></ng-container>\n </ng-template>\n }\n @if (yearCellTemplate()) {\n <ng-template monaCalendarYearCellTemplate let-year let-text=\"text\">\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year, text }\"></ng-container>\n </ng-template>\n }\n </mona-calendar>\n </div>\n }\n @if (activeView() === \"time\") {\n <div class=\"flex h-full max-h-64 items-center justify-center\" [attr.aria-label]=\"messages().timePicker\">\n <mona-time-selector\n [value]=\"navigatedDate()\"\n (valueChange)=\"onTimeSelectorValueChange($event)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [max]=\"timePickerMax()\"\n [min]=\"timePickerMin()\"\n [footer]=\"false\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [hourStep]=\"hourStep()\"\n [minuteStep]=\"minuteStep()\"\n [secondStep]=\"secondStep()\"\n [hourFormat]=\"hourFormat()\"\n [showSeconds]=\"showSeconds()\"></mona-time-selector>\n </div>\n }\n </div>\n <div [class]=\"footerClass()\">\n <button\n monaButton\n look=\"primary\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onSetDateClick()\">\n {{ messages().set }}\n </button>\n <button\n monaButton\n look=\"default\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onCancelClick()\">\n {{ messages().cancel }}\n </button>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: CalendarComponent, selector: "mona-calendar", inputs: ["disabled", "disabledDates", "firstDay", "invalid", "maxDate", "minDate", "readonly", "required", "rounded", "selection", "touched", "class", "value", "weekNumber"], outputs: ["disabledChange", "touch", "valueChange"] }, { kind: "component", type: TimeSelectorComponent, selector: "mona-time-selector", inputs: ["aria-label", "disabled", "focusOnMount", "footer", "hourFormat", "hourStep", "invalid", "max", "min", "minuteStep", "readonly", "required", "rounded", "secondStep", "showSeconds", "size", "touched", "value"], outputs: ["touch", "valueChange"] }, { kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "directive", type: TextBoxSuffixTemplateDirective, selector: "ng-template[monaTextBoxSuffixTemplate]" }, { kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: CalendarDecadeCellTemplateDirective, selector: "ng-template[monaCalendarDecadeCellTemplate]" }, { kind: "directive", type: CalendarMonthCellTemplateDirective, selector: "ng-template[monaCalendarMonthCellTemplate]" }, { kind: "directive", type: CalendarYearCellTemplateDirective, selector: "ng-template[monaCalendarYearCellTemplate]" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TextBoxPrefixTemplateDirective, selector: "ng-template[monaTextBoxPrefixTemplate]" }] }); }
|
|
611
644
|
}
|
|
612
645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
613
646
|
type: Component,
|
|
@@ -642,7 +675,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
642
675
|
"[attr.data-readonly]": "readonly() || null",
|
|
643
676
|
"[class]": "baseClass()",
|
|
644
677
|
"(blur)": "onDateInputBlur()"
|
|
645
|
-
}, template: "<mona-text-box\n (inputBlur)=\"onDateInputBlur()\"\n (valueChange)=\"onDateStringEdit($event)\"\n [clearButton]=\"showClearButton()\"\n [disabled]=\"disabled()\"\n [inputAttributes]=\"inputAttributes()\"\n [invalid]=\"invalid()\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [touched]=\"touched()\"\n [value]=\"currentDateString()\">\n @if (prefixTemplate()) {\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </ng-template>\n }\n <ng-template monaTextBoxSuffixTemplate>\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"size()\"\n [rounded]=\"'none'\"\n class=\"aspect-square h-full w-auto\"\n [attr.aria-label]=\"
|
|
678
|
+
}, template: "<mona-text-box\n (inputBlur)=\"onDateInputBlur()\"\n (valueChange)=\"onDateStringEdit($event)\"\n [clearButton]=\"showClearButton()\"\n [disabled]=\"disabled()\"\n [inputAttributes]=\"inputAttributes()\"\n [invalid]=\"invalid()\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly() || readonlyInput()\"\n [required]=\"required()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [touched]=\"touched()\"\n [value]=\"currentDateString()\">\n @if (prefixTemplate()) {\n <ng-template monaTextBoxPrefixTemplate>\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </ng-template>\n }\n <ng-template monaTextBoxSuffixTemplate>\n <button\n monaButton\n look=\"ghost\"\n [iconOnly]=\"true\"\n [size]=\"size()\"\n [rounded]=\"'none'\"\n class=\"aspect-square h-full w-auto\"\n [attr.aria-label]=\"messages().openDateTimePicker\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"popupId\"\n (click)=\"onDateInputButtonClick()\"\n [disabled]=\"disabled() || readonly()\"\n [tabindex]=\"-1\">\n <i class=\"ri-calendar-line\"></i>\n </button>\n </ng-template>\n</mona-text-box>\n\n<ng-template #datePopupTemplate>\n <div\n [class]=\"pickerPopupClass()\"\n [id]=\"popupId\"\n class=\"flex h-68 flex-col\"\n aria-modal=\"true\"\n role=\"dialog\"\n [attr.aria-label]=\"messages().dateTimePicker\"\n cdkTrapFocus>\n <div [class]=\"headerClass()\">\n <mona-button-group\n selection=\"single\"\n [allowEmpty]=\"false\"\n class=\"w-full\"\n [disabled]=\"disabled()\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n role=\"tablist\">\n <button monaButton [selected]=\"activeView() === 'date'\" (click)=\"activeView.set('date')\" role=\"tab\">\n {{ messages().date }}\n </button>\n <button monaButton [selected]=\"activeView() === 'time'\" (click)=\"activeView.set('time')\" role=\"tab\">\n {{ messages().time }}\n </button>\n </mona-button-group>\n </div>\n <div class=\"overflow-hidden\">\n @if (activeView() === \"date\") {\n <div class=\"flex h-full items-center justify-center\" [attr.aria-label]=\"messages().calendar\">\n <mona-calendar\n [disabledDates]=\"disabledDates()\"\n [minDate]=\"min()\"\n [maxDate]=\"max()\"\n [firstDay]=\"firstDay()\"\n [weekNumber]=\"weekNumber()\"\n [value]=\"navigatedDate()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n (valueChange)=\"onCalendarValueChange($event)\"\n class=\"flex-1 border-none shadow-none\">\n @if (decadeCellTemplate()) {\n <ng-template monaCalendarDecadeCellTemplate let-year>\n <ng-container\n [ngTemplateOutlet]=\"decadeCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year }\"></ng-container>\n </ng-template>\n }\n @if (monthCellTemplate()) {\n <ng-template monaCalendarMonthCellTemplate let-day let-date=\"date\">\n <ng-container\n [ngTemplateOutlet]=\"monthCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, date }\"></ng-container>\n </ng-template>\n }\n @if (yearCellTemplate()) {\n <ng-template monaCalendarYearCellTemplate let-year let-text=\"text\">\n <ng-container\n [ngTemplateOutlet]=\"yearCellTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: year, text }\"></ng-container>\n </ng-template>\n }\n </mona-calendar>\n </div>\n }\n @if (activeView() === \"time\") {\n <div class=\"flex h-full max-h-64 items-center justify-center\" [attr.aria-label]=\"messages().timePicker\">\n <mona-time-selector\n [value]=\"navigatedDate()\"\n (valueChange)=\"onTimeSelectorValueChange($event)\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n [max]=\"timePickerMax()\"\n [min]=\"timePickerMin()\"\n [footer]=\"false\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [hourStep]=\"hourStep()\"\n [minuteStep]=\"minuteStep()\"\n [secondStep]=\"secondStep()\"\n [hourFormat]=\"hourFormat()\"\n [showSeconds]=\"showSeconds()\"></mona-time-selector>\n </div>\n }\n </div>\n <div [class]=\"footerClass()\">\n <button\n monaButton\n look=\"primary\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onSetDateClick()\">\n {{ messages().set }}\n </button>\n <button\n monaButton\n look=\"default\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onCancelClick()\">\n {{ messages().cancel }}\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
646
679
|
}], ctorParameters: () => [], propDecorators: { decadeCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarDecadeCellTemplateDirective), { isSignal: true }] }], monthCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarMonthCellTemplateDirective), { isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["datePopupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DateInputPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], yearCellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CalendarYearCellTemplateDirective), { isSignal: true }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], firstDay: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDay", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], hourStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourStep", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], open: [{ type: i0.Output, args: ["open"] }], opened: [{ type: i0.Output, args: ["opened"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], popupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupClass", required: false }] }], popupHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupHeight", required: false }] }], popupWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "popupWidth", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], readonlyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonlyInput", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], secondStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondStep", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], weekNumber: [{ type: i0.Input, args: [{ isSignal: true, alias: "weekNumber", required: false }] }] } });
|
|
647
680
|
|
|
648
681
|
/*
|
|
@@ -653,5 +686,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
653
686
|
* Generated bundle index. Do not edit.
|
|
654
687
|
*/
|
|
655
688
|
|
|
656
|
-
export { DateTimePickerComponent };
|
|
689
|
+
export { DATETIME_PICKER_DEFAULT_MESSAGES, DateTimePickerComponent };
|
|
657
690
|
//# sourceMappingURL=nanahoshi-mona-ui-datetime-picker.mjs.map
|