@nanahoshi/mona-ui 0.19.0 → 0.20.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/THIRD_PARTY_NOTICES.md +60 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +46 -36
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +120 -99
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +109 -99
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +19 -13
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +27 -17
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +37 -27
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +5 -4
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3 -3
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-DLqCAee3.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-Bd2twji1.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs → nanahoshi-mona-ui-grid-grid-list.component-hakVMhqu.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-CtEs5t9x.mjs} +28 -17
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-DoAGYLzr.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BIK61ieq.mjs} +19 -10
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +3722 -16
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +4973 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +46 -38
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +23 -13
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +14 -5
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +25 -16
- package/locales/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +19 -18
- package/types/nanahoshi-mona-ui-calendar.d.ts +25 -21
- package/types/nanahoshi-mona-ui-combo-box.d.ts +23 -22
- package/types/nanahoshi-mona-ui-date-picker.d.ts +7 -4
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +8 -5
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +18 -17
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +6 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +12 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +49 -2
- package/types/nanahoshi-mona-ui-locales.d.ts +4889 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +20 -19
- package/types/nanahoshi-mona-ui-pager.d.ts +1 -0
- package/types/nanahoshi-mona-ui-stepper.d.ts +2 -1
- package/types/nanahoshi-mona-ui-time-picker.d.ts +4 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
2
2
|
import { NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, DestroyRef, ElementRef,
|
|
4
|
+
import { inject, DestroyRef, ElementRef, signal, computed, linkedSignal, contentChild, viewChild, TemplateRef, output, input, model, effect, untracked, afterNextRender, forwardRef, Component } from '@angular/core';
|
|
5
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { any } from '@mirei/ts-collections';
|
|
7
7
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
@@ -9,8 +9,8 @@ import { ButtonGroupComponent } from '@nanahoshi/mona-ui/button-group';
|
|
|
9
9
|
import { CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective, CalendarComponent } from '@nanahoshi/mona-ui/calendar';
|
|
10
10
|
import { CalendarService, TimeSelectorService, datePopupThemeVariants, DateInputPrefixTemplateDirective } from '@nanahoshi/mona-ui/date-input';
|
|
11
11
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
12
|
-
import { DropdownService,
|
|
13
|
-
import { injectComponentDirection, MonaI18nService, gregorianDateTime, parseGregorianDate } from '@nanahoshi/mona-ui/i18n';
|
|
12
|
+
import { DropdownService, DROPDOWN_POPUP_INPUT_TOKEN, DropdownPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
13
|
+
import { injectComponentDirection, MonaI18nService, gregorianDateTime, getLocaleDateTimeInputFormat, parseGregorianDate } from '@nanahoshi/mona-ui/i18n';
|
|
14
14
|
import { themeControlSurfaceClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
15
15
|
import { TextBoxComponent, TextBoxSuffixTemplateDirective, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
|
|
16
16
|
import { TimeSelectorComponent } from '@nanahoshi/mona-ui/time-selector';
|
|
@@ -115,8 +115,6 @@ class DateTimePickerComponent {
|
|
|
115
115
|
this.#i18n = inject(MonaI18nService);
|
|
116
116
|
this.#id = createElementControlId();
|
|
117
117
|
this.#timeSelectorService = inject(TimeSelectorService);
|
|
118
|
-
this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
|
|
119
|
-
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
120
118
|
this.activeView = signal("date", /* @ts-ignore */
|
|
121
119
|
...(ngDevMode ? [{ debugName: "activeView" }] : /* istanbul ignore next */ []));
|
|
122
120
|
this.baseClass = computed(() => {
|
|
@@ -130,7 +128,7 @@ class DateTimePickerComponent {
|
|
|
130
128
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
131
129
|
this.currentDateString = linkedSignal(() => {
|
|
132
130
|
const value = this.value();
|
|
133
|
-
const format = this.
|
|
131
|
+
const format = this.effectiveFormat();
|
|
134
132
|
const locale = this.#i18n.localeId();
|
|
135
133
|
if (!value) {
|
|
136
134
|
return "";
|
|
@@ -140,6 +138,14 @@ class DateTimePickerComponent {
|
|
|
140
138
|
...(ngDevMode ? [{ debugName: "currentDateString" }] : /* istanbul ignore next */ []));
|
|
141
139
|
this.decadeCellTemplate = contentChild(CalendarDecadeCellTemplateDirective, /* @ts-ignore */
|
|
142
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 */ []));
|
|
143
149
|
this.expanded = computed(() => this.#dropdownService.popupRef() !== null, /* @ts-ignore */
|
|
144
150
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
145
151
|
this.footerClass = computed(() => {
|
|
@@ -168,6 +174,8 @@ class DateTimePickerComponent {
|
|
|
168
174
|
...(ngDevMode ? [{ debugName: "inputAttributes" }] : /* istanbul ignore next */ []));
|
|
169
175
|
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
170
176
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
177
|
+
this.isRtl = computed(() => this.#direction() === "rtl", /* @ts-ignore */
|
|
178
|
+
...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
|
|
171
179
|
this.messages = this.#i18n.componentMessages("dateTimePicker", DATETIME_PICKER_DEFAULT_MESSAGES);
|
|
172
180
|
this.monthCellTemplate = contentChild(CalendarMonthCellTemplateDirective, /* @ts-ignore */
|
|
173
181
|
...(ngDevMode ? [{ debugName: "monthCellTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -236,14 +244,16 @@ class DateTimePickerComponent {
|
|
|
236
244
|
this.disabledDates = input(/* @ts-ignore */
|
|
237
245
|
...(ngDevMode ? [undefined, { debugName: "disabledDates" }] : /* istanbul ignore next */ []));
|
|
238
246
|
/**
|
|
239
|
-
* @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
|
|
240
249
|
*/
|
|
241
|
-
this.firstDay = input(
|
|
250
|
+
this.firstDay = input(null, /* @ts-ignore */
|
|
242
251
|
...(ngDevMode ? [{ debugName: "firstDay" }] : /* istanbul ignore next */ []));
|
|
243
252
|
/**
|
|
244
|
-
* @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
|
|
245
255
|
*/
|
|
246
|
-
this.format = input(
|
|
256
|
+
this.format = input(null, /* @ts-ignore */
|
|
247
257
|
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
248
258
|
/**
|
|
249
259
|
* @description Sets the hour format of the time picker.
|
|
@@ -420,7 +430,7 @@ class DateTimePickerComponent {
|
|
|
420
430
|
return;
|
|
421
431
|
}
|
|
422
432
|
const locale = this.#i18n.localeId();
|
|
423
|
-
const dateTime = parseGregorianDate(this.currentDateString(), this.
|
|
433
|
+
const dateTime = parseGregorianDate(this.currentDateString(), this.effectiveFormat(), locale);
|
|
424
434
|
if (this.dateStringEquals(this.value(), dateTime.toJSDate())) {
|
|
425
435
|
this.touch.emit();
|
|
426
436
|
return;
|
|
@@ -475,8 +485,8 @@ class DateTimePickerComponent {
|
|
|
475
485
|
dateStringEquals(date1, date2) {
|
|
476
486
|
if (date1 && date2) {
|
|
477
487
|
const locale = this.#i18n.localeId();
|
|
478
|
-
return (gregorianDateTime(date1, locale).toFormat(this.
|
|
479
|
-
gregorianDateTime(date2, locale).toFormat(this.
|
|
488
|
+
return (gregorianDateTime(date1, locale).toFormat(this.effectiveFormat()) ===
|
|
489
|
+
gregorianDateTime(date2, locale).toFormat(this.effectiveFormat()));
|
|
480
490
|
}
|
|
481
491
|
return date1 === date2;
|
|
482
492
|
}
|
|
@@ -548,7 +558,7 @@ class DateTimePickerComponent {
|
|
|
548
558
|
}
|
|
549
559
|
setCurrentDate(date) {
|
|
550
560
|
this.value.set(date);
|
|
551
|
-
this.updateCurrentDateString(date, this.
|
|
561
|
+
this.updateCurrentDateString(date, this.effectiveFormat());
|
|
552
562
|
this.touch.emit();
|
|
553
563
|
}
|
|
554
564
|
setKeyboardSubscriptions() {
|
|
@@ -626,11 +636,11 @@ class DateTimePickerComponent {
|
|
|
626
636
|
DropdownService,
|
|
627
637
|
TimeSelectorService,
|
|
628
638
|
{
|
|
629
|
-
provide:
|
|
639
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
630
640
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
631
641
|
multi: false
|
|
632
642
|
}
|
|
633
|
-
], 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", "
|
|
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]" }] }); }
|
|
634
644
|
}
|
|
635
645
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
636
646
|
type: Component,
|
|
@@ -639,7 +649,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
639
649
|
DropdownService,
|
|
640
650
|
TimeSelectorService,
|
|
641
651
|
{
|
|
642
|
-
provide:
|
|
652
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
643
653
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
644
654
|
multi: false
|
|
645
655
|
}
|
|
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { Directive, inject, DestroyRef, ElementRef, linkedSignal, computed, contentChild, TemplateRef, viewChild, input, output, model, effect, untracked, afterNextRender, forwardRef, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
6
|
-
import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken,
|
|
6
|
+
import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
7
7
|
import { themeControlSurfaceClasses, createElementControlId, isTypeaheadKey, setupTypeahead } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
9
9
|
import { ListService, ListComponent, ListItemTemplateDirective, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
@@ -141,11 +141,11 @@ class DropdownListComponent {
|
|
|
141
141
|
this.footerTemplate = contentChild(DropdownFooterTemplateDirective, { ...(ngDevMode ? { debugName: "footerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
142
142
|
this.groupHeaderTemplate = contentChild(DropdownGroupHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "groupHeaderTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
143
143
|
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
144
|
-
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
145
144
|
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && this.value() == null)), /* @ts-ignore */
|
|
146
145
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
147
146
|
this.isEmpty = computed(() => !this.#listService.viewItems().any(), /* @ts-ignore */
|
|
148
147
|
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
148
|
+
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
149
149
|
this.listId = createElementControlId();
|
|
150
150
|
this.listPopupClass = computed(() => {
|
|
151
151
|
const rounded = this.rounded();
|
|
@@ -218,18 +218,18 @@ class DropdownListComponent {
|
|
|
218
218
|
*/
|
|
219
219
|
this.disabled = model(false, /* @ts-ignore */
|
|
220
220
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
221
|
-
/**
|
|
222
|
-
* @description Predicate or field name used to determine whether an individual item is disabled.
|
|
223
|
-
* @default undefined
|
|
224
|
-
*/
|
|
225
|
-
this.itemDisabled = input(/* @ts-ignore */
|
|
226
|
-
...(ngDevMode ? [undefined, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []));
|
|
227
221
|
/**
|
|
228
222
|
* @description Marks the field as invalid. Set automatically by the `FormField` directive when bound via `[formField]`.
|
|
229
223
|
* @default false
|
|
230
224
|
*/
|
|
231
225
|
this.invalid = input(false, /* @ts-ignore */
|
|
232
226
|
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
227
|
+
/**
|
|
228
|
+
* @description Predicate or field name used to determine whether an individual item is disabled.
|
|
229
|
+
* @default undefined
|
|
230
|
+
*/
|
|
231
|
+
this.itemDisabled = input(/* @ts-ignore */
|
|
232
|
+
...(ngDevMode ? [undefined, { debugName: "itemDisabled" }] : /* istanbul ignore next */ []));
|
|
233
233
|
/**
|
|
234
234
|
* @description Displays a loading indicator and prevents interaction while an operation is in progress.
|
|
235
235
|
* @default false
|
|
@@ -321,6 +321,14 @@ class DropdownListComponent {
|
|
|
321
321
|
* @default ""
|
|
322
322
|
*/
|
|
323
323
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
324
|
+
/**
|
|
325
|
+
* @description Currently selected value, two-way bindable and compatible with Signal Forms via `[formField]`.
|
|
326
|
+
* Object mode returns the selected data item; primitive mode (see {@link valuePrimitive}) returns the value
|
|
327
|
+
* resolved through {@link valueField}. `null` represents no selection.
|
|
328
|
+
* @default null
|
|
329
|
+
*/
|
|
330
|
+
this.value = model(null, /* @ts-ignore */
|
|
331
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
324
332
|
/**
|
|
325
333
|
* @description Property name or accessor used to derive the value from a data item.
|
|
326
334
|
* It is used for stable item identity, matching externally supplied values, and primitive
|
|
@@ -342,14 +350,6 @@ class DropdownListComponent {
|
|
|
342
350
|
*/
|
|
343
351
|
this.valuePrimitive = input(false, /* @ts-ignore */
|
|
344
352
|
...(ngDevMode ? [{ debugName: "valuePrimitive" }] : /* istanbul ignore next */ []));
|
|
345
|
-
/**
|
|
346
|
-
* @description Currently selected value, two-way bindable and compatible with Signal Forms via `[formField]`.
|
|
347
|
-
* Object mode returns the selected data item; primitive mode (see {@link valuePrimitive}) returns the value
|
|
348
|
-
* resolved through {@link valueField}. `null` represents no selection.
|
|
349
|
-
* @default null
|
|
350
|
-
*/
|
|
351
|
-
this.value = model(null, /* @ts-ignore */
|
|
352
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
353
353
|
effect(() => {
|
|
354
354
|
const value = this.value();
|
|
355
355
|
const valueField = this.valueField();
|
|
@@ -381,10 +381,17 @@ class DropdownListComponent {
|
|
|
381
381
|
});
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
+
focus() {
|
|
385
|
+
this.#hostElementRef.nativeElement?.focus();
|
|
386
|
+
}
|
|
384
387
|
setValue(value) {
|
|
385
388
|
this.updateValue(value);
|
|
386
389
|
}
|
|
387
|
-
onBlur() {
|
|
390
|
+
onBlur(event) {
|
|
391
|
+
const popupElement = this.#dropdownService.popupRef()?.overlayRef.overlayElement;
|
|
392
|
+
if (popupElement && event?.relatedTarget instanceof Node && popupElement.contains(event.relatedTarget)) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
388
395
|
this.touch.emit();
|
|
389
396
|
}
|
|
390
397
|
onItemSelect(event) {
|
|
@@ -399,6 +406,12 @@ class DropdownListComponent {
|
|
|
399
406
|
this.closePopup();
|
|
400
407
|
}
|
|
401
408
|
}
|
|
409
|
+
onPopupPointerDown(event) {
|
|
410
|
+
const target = event.target;
|
|
411
|
+
if (target?.tagName !== "INPUT") {
|
|
412
|
+
event.preventDefault();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
402
415
|
onValueClear(event) {
|
|
403
416
|
if (this.readonly() || (event instanceof KeyboardEvent && event.key !== "Enter" && event.key !== " ")) {
|
|
404
417
|
return;
|
|
@@ -431,9 +444,6 @@ class DropdownListComponent {
|
|
|
431
444
|
this.#navigatedItem.set(nextItem.data);
|
|
432
445
|
}
|
|
433
446
|
}
|
|
434
|
-
focus() {
|
|
435
|
-
this.#hostElementRef.nativeElement?.focus();
|
|
436
|
-
}
|
|
437
447
|
getControlValue(dataItem) {
|
|
438
448
|
const value = this.valuePrimitive() ? this.#listService.getDataItemValue(dataItem) : dataItem;
|
|
439
449
|
return value;
|
|
@@ -551,7 +561,7 @@ class DropdownListComponent {
|
|
|
551
561
|
}
|
|
552
562
|
}
|
|
553
563
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
554
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DropdownListComponent, isStandalone: true, selector: "mona-dropdown-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null },
|
|
564
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DropdownListComponent, isStandalone: true, selector: "mona-dropdown-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, valuePrimitive: { classPropertyName: "valuePrimitive", publicName: "valuePrimitive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", value: "valueChange" }, host: { listeners: { "blur": "onBlur($event)" }, properties: { "attr.aria-activedescendant": "activeDescendant()", "attr.aria-busy": "loading() ? 'true' : undefined", "attr.aria-controls": "listId", "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-expanded": "expanded()", "attr.aria-haspopup": "'listbox'", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-label": "effectiveAriaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy()", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "disabled() || null", "attr.data-invalid": "invalidState() || null", "attr.data-readonly": "readonly() || null", "attr.role": "'combobox'", "attr.tabindex": "disabled() ? null : 0", "class": "baseClass()" } }, providers: [
|
|
555
565
|
ListService,
|
|
556
566
|
DropdownService,
|
|
557
567
|
DropdownListService,
|
|
@@ -561,11 +571,11 @@ class DropdownListComponent {
|
|
|
561
571
|
multi: false
|
|
562
572
|
},
|
|
563
573
|
{
|
|
564
|
-
provide:
|
|
574
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
565
575
|
useExisting: forwardRef(() => DropdownListComponent),
|
|
566
576
|
multi: false
|
|
567
577
|
}
|
|
568
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "valueTemplate", first: true, predicate: DropdownListValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (selectedListItem() && showClearButton() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
578
|
+
], queries: [{ propertyName: "footerTemplate", first: true, predicate: DropdownFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: DropdownGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: DropdownHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: DropdownItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: DropdownNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "prefixTemplate", first: true, predicate: DropdownPrefixTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "valueTemplate", first: true, predicate: DropdownListValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (selectedListItem() && showClearButton() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
569
579
|
}
|
|
570
580
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, decorators: [{
|
|
571
581
|
type: Component,
|
|
@@ -579,7 +589,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
579
589
|
multi: false
|
|
580
590
|
},
|
|
581
591
|
{
|
|
582
|
-
provide:
|
|
592
|
+
provide: DROPDOWN_POPUP_INPUT_TOKEN,
|
|
583
593
|
useExisting: forwardRef(() => DropdownListComponent),
|
|
584
594
|
multi: false
|
|
585
595
|
}
|
|
@@ -611,11 +621,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
611
621
|
"[attr.role]": "'combobox'",
|
|
612
622
|
"[attr.tabindex]": "disabled() ? null : 0",
|
|
613
623
|
"[class]": "baseClass()",
|
|
614
|
-
"(blur)": "onBlur()"
|
|
615
|
-
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (selectedListItem() && showClearButton() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n" }]
|
|
624
|
+
"(blur)": "onBlur($event)"
|
|
625
|
+
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<span [class]=\"valueContainerClass()\">\n @if (!valueTemplate()) {\n <span>\n @if (selectedListItem()) {\n <span>{{ valueText() }}</span>\n } @else {\n <span>{{ placeholder() }}</span>\n }\n </span>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: selectedDataItem() }\"></ng-container>\n }\n</span>\n\n@if (selectedListItem() && showClearButton() && !loading()) {\n <mona-indicator-icon\n preset=\"clear\"\n [interactive]=\"true\"\n [label]=\"messages().clear\"\n (activate)=\"onValueClear($event)\"></mona-indicator-icon>\n}\n\n@if (loading()) {\n <mona-indicator-icon preset=\"loading\" [size]=\"12\"></mona-indicator-icon>\n}\n\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<span monaDropdownLiveRegion></span>\n\n<ng-template #popupTemplate>\n <div [class]=\"listPopupClass()\" (pointerdown)=\"onPopupPointerDown($event)\">\n <mona-list [listId]=\"listId\" [focusOnMount]=\"false\" [size]=\"size()\" (itemSelect)=\"onItemSelect($event)\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-group>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: group }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate()\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate()\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate()\"></ng-container>\n </ng-template>\n }\n </mona-list>\n </div>\n</ng-template>\n" }]
|
|
616
626
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
|
|
617
627
|
read: TemplateRef
|
|
618
|
-
}, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], valueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownListValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }],
|
|
628
|
+
}, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], prefixTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownPrefixTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], valueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownListValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], closed: [{ type: i0.Output, args: ["closed"] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", 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 }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", 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"] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], valuePrimitive: [{ type: i0.Input, args: [{ isSignal: true, alias: "valuePrimitive", required: false }] }] } });
|
|
619
629
|
|
|
620
630
|
/*
|
|
621
631
|
* Public API Surface of @nanahoshi/mona-ui/dropdown-list
|
|
@@ -12,7 +12,7 @@ import { themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
|
12
12
|
|
|
13
13
|
const DropdownDataInputToken = new InjectionToken("DROPDOWN_DATA_INPUT");
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const DROPDOWN_POPUP_INPUT_TOKEN = new InjectionToken("DROPDOWN_POPUP_INPUT");
|
|
16
16
|
|
|
17
17
|
class DropdownFilterableDirective {
|
|
18
18
|
#defaultOptions;
|
|
@@ -317,6 +317,7 @@ class DropdownService {
|
|
|
317
317
|
...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
|
|
318
318
|
this.restoreFocus = signal("auto", /* @ts-ignore */
|
|
319
319
|
...(ngDevMode ? [{ debugName: "restoreFocus" }] : /* istanbul ignore next */ []));
|
|
320
|
+
this.touch$ = new Subject();
|
|
320
321
|
this.triggerPopupOpen$ = new Subject();
|
|
321
322
|
this.triggerPopupToggle$ = new Subject();
|
|
322
323
|
}
|
|
@@ -337,7 +338,7 @@ class DropdownPopupHandlerDirective {
|
|
|
337
338
|
#destroyRef = inject(DestroyRef);
|
|
338
339
|
#dropdownService = inject(DropdownService);
|
|
339
340
|
#hostElementRef = inject((ElementRef));
|
|
340
|
-
#host = inject(
|
|
341
|
+
#host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
|
|
341
342
|
#popupService = inject(PopupService);
|
|
342
343
|
constructor() {
|
|
343
344
|
afterNextRender({
|
|
@@ -466,7 +467,7 @@ class DropdownListPopupHandlerDirective {
|
|
|
466
467
|
#destroyRef = inject(DestroyRef);
|
|
467
468
|
#dropdownListService = inject(DropdownListService, { optional: true });
|
|
468
469
|
#dropdownService = inject(DropdownService);
|
|
469
|
-
#host = inject(
|
|
470
|
+
#host = inject(DROPDOWN_POPUP_INPUT_TOKEN);
|
|
470
471
|
#hostElementRef = inject(ElementRef);
|
|
471
472
|
#listService = inject(ListService);
|
|
472
473
|
#popupClosed$ = toObservable(this.#dropdownService.popupRef).pipe(filter(popupRef => !!popupRef), switchMap(popupRef => popupRef.closed.pipe(take(1))));
|
|
@@ -703,5 +704,5 @@ const dropdownPopupThemeVariants = cva(`
|
|
|
703
704
|
* Generated bundle index. Do not edit.
|
|
704
705
|
*/
|
|
705
706
|
|
|
706
|
-
export { DROPDOWNS_DEFAULT_MESSAGES, DropdownDataHandlerDirective, DropdownDataInputToken, DropdownFilterableDirective, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownGroupableDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, DropdownListPopupHandlerDirective, DropdownListService, DropdownLiveRegionDirective, DropdownNoDataTemplateDirective, DropdownPopupHandlerDirective,
|
|
707
|
+
export { DROPDOWNS_DEFAULT_MESSAGES, DROPDOWN_POPUP_INPUT_TOKEN, DropdownDataHandlerDirective, DropdownDataInputToken, DropdownFilterableDirective, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownGroupableDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, DropdownListPopupHandlerDirective, DropdownListService, DropdownLiveRegionDirective, DropdownNoDataTemplateDirective, DropdownPopupHandlerDirective, DropdownPrefixTemplateDirective, DropdownService, DropdownSuffixTemplateDirective, DropdownVirtualScrollDirective, dropdownPopupThemeVariants };
|
|
707
708
|
//# sourceMappingURL=nanahoshi-mona-ui-dropdowns.mjs.map
|
|
@@ -913,7 +913,7 @@ class EditorFontFamilyComponent {
|
|
|
913
913
|
this.editorService.editor.chain().focus().setFontFamily(fontFamily).run();
|
|
914
914
|
}
|
|
915
915
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
916
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontFamilyComponent, isStandalone: true, selector: "mona-editor-font-family", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontFamily\">\n <ng-template monaDropDownListItemTemplate let-font>\n <span [style.font-family]=\"font\">{{ font }}</span>\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "
|
|
916
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontFamilyComponent, isStandalone: true, selector: "mona-editor-font-family", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontFamily\">\n <ng-template monaDropDownListItemTemplate let-font>\n <span [style.font-family]=\"font\">{{ font }}</span>\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "invalid", "itemDisabled", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "value", "valueField", "valuePrimitive"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DropdownItemTemplateDirective, selector: " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate] " }] }); }
|
|
917
917
|
}
|
|
918
918
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, decorators: [{
|
|
919
919
|
type: Component,
|
|
@@ -997,7 +997,7 @@ class EditorFontSizeComponent {
|
|
|
997
997
|
this.editorService.editor.chain().focus().setFontSize(fontSize).run();
|
|
998
998
|
}
|
|
999
999
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1000
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontSizeComponent, isStandalone: true, selector: "mona-editor-font-size", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n [placeholder]=\"messages().fontSize\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontSize\"></mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "
|
|
1000
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontSizeComponent, isStandalone: true, selector: "mona-editor-font-size", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n [placeholder]=\"messages().fontSize\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontSize\"></mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "invalid", "itemDisabled", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "value", "valueField", "valuePrimitive"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
1001
1001
|
}
|
|
1002
1002
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, decorators: [{
|
|
1003
1003
|
type: Component,
|
|
@@ -1063,7 +1063,7 @@ class EditorHeadingsComponent {
|
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1066
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorHeadingsComponent, isStandalone: true, selector: "mona-editor-headings", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData()\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n [title]=\"messages().format\">\n <ng-template monaDropDownListItemTemplate let-dataItem>\n @switch (dataItem.value) {\n @case (HeadingType.Heading1) {\n <h1 class=\"m-0 text-2xl font-bold\">{{ dataItem.text }}</h1>\n }\n @case (HeadingType.Heading2) {\n <h2 class=\"m-0 text-xl font-bold\">{{ dataItem.text }}</h2>\n }\n @case (HeadingType.Heading3) {\n <h3 class=\"m-0 text-lg font-bold\">{{ dataItem.text }}</h3>\n }\n @case (HeadingType.Heading4) {\n <h4 class=\"m-0 text-base font-bold\">{{ dataItem.text }}</h4>\n }\n @case (HeadingType.Heading5) {\n <h5 class=\"m-0 text-sm font-bold\">{{ dataItem.text }}</h5>\n }\n @case (HeadingType.Heading6) {\n <h6 class=\"m-0 text-xs font-bold\">{{ dataItem.text }}</h6>\n }\n @case (HeadingType.Paragraph) {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n @default {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n }\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "
|
|
1066
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorHeadingsComponent, isStandalone: true, selector: "mona-editor-headings", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData()\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n [title]=\"messages().format\">\n <ng-template monaDropDownListItemTemplate let-dataItem>\n @switch (dataItem.value) {\n @case (HeadingType.Heading1) {\n <h1 class=\"m-0 text-2xl font-bold\">{{ dataItem.text }}</h1>\n }\n @case (HeadingType.Heading2) {\n <h2 class=\"m-0 text-xl font-bold\">{{ dataItem.text }}</h2>\n }\n @case (HeadingType.Heading3) {\n <h3 class=\"m-0 text-lg font-bold\">{{ dataItem.text }}</h3>\n }\n @case (HeadingType.Heading4) {\n <h4 class=\"m-0 text-base font-bold\">{{ dataItem.text }}</h4>\n }\n @case (HeadingType.Heading5) {\n <h5 class=\"m-0 text-sm font-bold\">{{ dataItem.text }}</h5>\n }\n @case (HeadingType.Heading6) {\n <h6 class=\"m-0 text-xs font-bold\">{{ dataItem.text }}</h6>\n }\n @case (HeadingType.Paragraph) {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n @default {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n }\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "invalid", "itemDisabled", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "value", "valueField", "valuePrimitive"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DropdownItemTemplateDirective, selector: " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate] " }] }); }
|
|
1067
1067
|
}
|
|
1068
1068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, decorators: [{
|
|
1069
1069
|
type: Component,
|
|
@@ -702,7 +702,7 @@ class FilterMenuComponent {
|
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
704
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
705
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FilterMenuComponent, isStandalone: true, selector: "mona-filter-menu", inputs: { dateOptions: { classPropertyName: "dateOptions", publicName: "dateOptions", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, operators: { classPropertyName: "operators", publicName: "operators", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply", field: "fieldChange", operators: "operatorsChange", type: "typeChange", value: "valueChange" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "<div [class]=\"filterMenuItemClass()\">\n @if (type() === \"string\") {\n <mona-dropdown-list\n [data]=\"stringFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n <mona-text-box\n [ngModel]=\"stringFilterValues()[0]\"\n (ngModelChange)=\"stringFilterValues.set([$event, stringFilterValues()[1]])\"\n [size]=\"size()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-text-box>\n }\n\n @if (type() === \"number\") {\n <mona-dropdown-list\n [data]=\"numericFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n <mona-numeric-text-box\n [ngModel]=\"numberFilterValues()[0]\"\n (ngModelChange)=\"numberFilterValues.set([$event, numberFilterValues()[1]])\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-numeric-text-box>\n }\n\n @if (type() === \"date\") {\n <mona-dropdown-list\n [data]=\"dateFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n\n @if (type() === \"date\") {\n <mona-date-picker\n [ngModel]=\"dateFilterValues()[0]\"\n (ngModelChange)=\"dateFilterValues.set([$event, dateFilterValues()[1]])\"\n [format]=\"effectiveDateOptions().format\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-date-picker>\n }\n }\n\n @if (type() === \"boolean\") {\n <mona-dropdown-list\n [data]=\"booleanFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n }\n</div>\n@if (firstFilterValid()) {\n <div [class]=\"filterMenuItemClass()\">\n <mona-button-group selection=\"single\" [size]=\"size()\" [rounded]=\"rounded()\" [disabled]=\"!firstFilterValid()\">\n @for (item of connectorDataItems(); track item.value) {\n <button\n monaButton\n [selected]=\"item.value === selectedConnectorItem()?.value\"\n (selectedChange)=\"onConnectorChange(item, $event)\">\n {{ item.text }}\n </button>\n }\n </mona-button-group>\n </div>\n}\n@if (!!selectedConnectorItem()) {\n <div [class]=\"filterMenuItemClass()\">\n @if (type() === \"string\") {\n <mona-dropdown-list\n [data]=\"stringFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n <mona-text-box\n [ngModel]=\"stringFilterValues()[1]\"\n (ngModelChange)=\"stringFilterValues.set([stringFilterValues()[0], $event])\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-text-box>\n }\n\n @if (type() === \"number\") {\n <mona-dropdown-list\n [data]=\"numericFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n\n <mona-numeric-text-box\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"numberFilterValues()[1]\"\n (ngModelChange)=\"numberFilterValues.set([numberFilterValues()[0], $event])\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-numeric-text-box>\n }\n\n @if (type() === \"date\") {\n <mona-dropdown-list\n [data]=\"dateFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n\n @if (type() === \"date\") {\n <mona-date-picker\n [ngModel]=\"dateFilterValues()[1]\"\n (ngModelChange)=\"dateFilterValues.set([dateFilterValues()[0], $event])\"\n [format]=\"effectiveDateOptions().format\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-date-picker>\n }\n }\n\n @if (type() === \"boolean\") {\n <mona-dropdown-list\n [data]=\"booleanFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n }\n </div>\n}\n<div [class]=\"`${filterMenuItemClass()} ${filterMenuActionsClass()}`\">\n <button\n monaButton\n (click)=\"onFilterApply()\"\n [look]=\"'primary'\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"applyDisabled()\">\n {{ messages().apply }}\n </button>\n <button monaButton (click)=\"onFilterClear()\" [look]=\"'default'\" [size]=\"size()\" [rounded]=\"rounded()\">{{ messages().clear }}</button>\n</div>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "valuePrimitive", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "invalid", "maxValue", "minValue", "nullable", "readonly", "required", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "component", type: DatePickerComponent, selector: "mona-date-picker", inputs: ["disabled", "disabledDates", "firstDay", "format", "invalid", "max", "min", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "readonlyInput", "required", "rounded", "showClearButton", "size", "touched", "class", "value", "weekNumber"], outputs: ["close", "closed", "open", "opened", "touch", "valueChange"] }, { 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: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "pipe", type: ValuelessOperatorPipe, name: "valuelessOperator" }, { kind: "pipe", type: OperatorFilterPipe, name: "operatorFilter" }] }); }
|
|
705
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FilterMenuComponent, isStandalone: true, selector: "mona-filter-menu", inputs: { dateOptions: { classPropertyName: "dateOptions", publicName: "dateOptions", isSignal: true, isRequired: false, transformFunction: null }, field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, operators: { classPropertyName: "operators", publicName: "operators", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apply: "apply", field: "fieldChange", operators: "operatorsChange", type: "typeChange", value: "valueChange" }, host: { properties: { "class": "baseClass()" } }, ngImport: i0, template: "<div [class]=\"filterMenuItemClass()\">\n @if (type() === \"string\") {\n <mona-dropdown-list\n [data]=\"stringFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n <mona-text-box\n [ngModel]=\"stringFilterValues()[0]\"\n (ngModelChange)=\"stringFilterValues.set([$event, stringFilterValues()[1]])\"\n [size]=\"size()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-text-box>\n }\n\n @if (type() === \"number\") {\n <mona-dropdown-list\n [data]=\"numericFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n <mona-numeric-text-box\n [ngModel]=\"numberFilterValues()[0]\"\n (ngModelChange)=\"numberFilterValues.set([$event, numberFilterValues()[1]])\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-numeric-text-box>\n }\n\n @if (type() === \"date\") {\n <mona-dropdown-list\n [data]=\"dateFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n\n @if (type() === \"date\") {\n <mona-date-picker\n [ngModel]=\"dateFilterValues()[0]\"\n (ngModelChange)=\"dateFilterValues.set([$event, dateFilterValues()[1]])\"\n [format]=\"effectiveDateOptions().format\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[0]?.value | valuelessOperator\"></mona-date-picker>\n }\n }\n\n @if (type() === \"boolean\") {\n <mona-dropdown-list\n [data]=\"booleanFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [ngModel]=\"selectedFilterMenuDataItemList()[0]\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n (ngModelChange)=\"onFilterOperatorChange(0, $event)\"></mona-dropdown-list>\n }\n</div>\n@if (firstFilterValid()) {\n <div [class]=\"filterMenuItemClass()\">\n <mona-button-group selection=\"single\" [size]=\"size()\" [rounded]=\"rounded()\" [disabled]=\"!firstFilterValid()\">\n @for (item of connectorDataItems(); track item.value) {\n <button\n monaButton\n [selected]=\"item.value === selectedConnectorItem()?.value\"\n (selectedChange)=\"onConnectorChange(item, $event)\">\n {{ item.text }}\n </button>\n }\n </mona-button-group>\n </div>\n}\n@if (!!selectedConnectorItem()) {\n <div [class]=\"filterMenuItemClass()\">\n @if (type() === \"string\") {\n <mona-dropdown-list\n [data]=\"stringFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n <mona-text-box\n [ngModel]=\"stringFilterValues()[1]\"\n (ngModelChange)=\"stringFilterValues.set([stringFilterValues()[0], $event])\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-text-box>\n }\n\n @if (type() === \"number\") {\n <mona-dropdown-list\n [data]=\"numericFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n\n <mona-numeric-text-box\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"numberFilterValues()[1]\"\n (ngModelChange)=\"numberFilterValues.set([numberFilterValues()[0], $event])\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-numeric-text-box>\n }\n\n @if (type() === \"date\") {\n <mona-dropdown-list\n [data]=\"dateFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n\n @if (type() === \"date\") {\n <mona-date-picker\n [ngModel]=\"dateFilterValues()[1]\"\n (ngModelChange)=\"dateFilterValues.set([dateFilterValues()[0], $event])\"\n [format]=\"effectiveDateOptions().format\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"selectedFilterMenuDataItemList()[1]?.value | valuelessOperator\"></mona-date-picker>\n }\n }\n\n @if (type() === \"boolean\") {\n <mona-dropdown-list\n [data]=\"booleanFilterMenuDataItems() | operatorFilter: operators()\"\n textField=\"text\"\n valueField=\"value\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [ngModel]=\"selectedFilterMenuDataItemList()[1]\"\n (ngModelChange)=\"onFilterOperatorChange(1, $event)\"></mona-dropdown-list>\n }\n </div>\n}\n<div [class]=\"`${filterMenuItemClass()} ${filterMenuActionsClass()}`\">\n <button\n monaButton\n (click)=\"onFilterApply()\"\n [look]=\"'primary'\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [disabled]=\"applyDisabled()\">\n {{ messages().apply }}\n </button>\n <button monaButton (click)=\"onFilterClear()\" [look]=\"'default'\" [size]=\"size()\" [rounded]=\"rounded()\">{{ messages().clear }}</button>\n</div>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "invalid", "itemDisabled", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "value", "valueField", "valuePrimitive"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "invalid", "maxValue", "minValue", "nullable", "readonly", "required", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "component", type: DatePickerComponent, selector: "mona-date-picker", inputs: ["disabled", "disabledDates", "firstDay", "format", "invalid", "max", "min", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "readonlyInput", "required", "rounded", "showClearButton", "size", "touched", "class", "value", "weekNumber"], outputs: ["close", "closed", "open", "opened", "touch", "valueChange"] }, { 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: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "pipe", type: ValuelessOperatorPipe, name: "valuelessOperator" }, { kind: "pipe", type: OperatorFilterPipe, name: "operatorFilter" }] }); }
|
|
706
706
|
}
|
|
707
707
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FilterMenuComponent, decorators: [{
|
|
708
708
|
type: Component,
|