@nanahoshi/mona-ui 0.1.0 → 0.1.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/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -11
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -17
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +109 -107
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +80 -80
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +98 -98
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +38 -38
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -25
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -37
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +17 -19
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +11 -13
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +18 -20
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -40
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +14 -16
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +52 -52
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +462 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs +128 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs} +13 -13
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs +240 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs} +120 -120
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +81 -81
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +35 -35
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -50
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -14
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +69 -69
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +12 -12
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +55 -55
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +49 -49
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +96 -96
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +30 -30
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +42 -42
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -39
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -22
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +54 -54
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +11 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +51 -51
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +27 -28
- package/package.json +30 -5
- package/types/nanahoshi-mona-ui-button.d.ts +4 -3
- package/types/nanahoshi-mona-ui-color-picker.d.ts +0 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +2 -2
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-fieldset.d.ts +1 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -2
- package/types/nanahoshi-mona-ui-grid.d.ts +3 -3
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-menubar.d.ts +2 -2
- package/types/nanahoshi-mona-ui-stepper.d.ts +2 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -3,7 +3,7 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
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
|
-
import {
|
|
6
|
+
import { any } from '@mirei/ts-collections';
|
|
7
7
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
8
8
|
import { ButtonGroupComponent } from '@nanahoshi/mona-ui/button-group';
|
|
9
9
|
import { CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective, CalendarComponent } from '@nanahoshi/mona-ui/calendar';
|
|
@@ -14,20 +14,19 @@ import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
|
14
14
|
import { TextBoxComponent, TextBoxSuffixTemplateDirective, TextBoxPrefixTemplateDirective } from '@nanahoshi/mona-ui/text-box';
|
|
15
15
|
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
16
16
|
import { TimeSelectorComponent } from '@nanahoshi/mona-ui/time-selector';
|
|
17
|
-
import { any } from '@mirei/ts-collections';
|
|
18
17
|
import { DateTime } from 'luxon';
|
|
19
18
|
import { fromEvent, mergeWith } from 'rxjs';
|
|
20
19
|
import { twMerge } from 'tailwind-merge';
|
|
21
20
|
import { cva } from 'class-variance-authority';
|
|
22
21
|
|
|
23
|
-
const dateTimePickerBaseVariants = cva(`
|
|
24
|
-
flex items-center w-full
|
|
25
|
-
border border-border
|
|
26
|
-
focus-within:ring-2 focus-within:ring-primary/40 focus-within:border-primary
|
|
27
|
-
data-[invalid='true']:border-error
|
|
28
|
-
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
|
|
29
|
-
[&_mona-text-box]:h-full
|
|
30
|
-
[&_mona-text-box]:border-none
|
|
22
|
+
const dateTimePickerBaseVariants = cva(`
|
|
23
|
+
flex items-center w-full
|
|
24
|
+
border border-border
|
|
25
|
+
focus-within:ring-2 focus-within:ring-primary/40 focus-within:border-primary
|
|
26
|
+
data-[invalid='true']:border-error
|
|
27
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
|
|
28
|
+
[&_mona-text-box]:h-full
|
|
29
|
+
[&_mona-text-box]:border-none
|
|
31
30
|
`, {
|
|
32
31
|
variants: {
|
|
33
32
|
focused: {
|
|
@@ -47,14 +46,14 @@ const dateTimePickerBaseVariants = cva(`
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
|
-
const dateTimePickerHeaderVariants = cva(`
|
|
51
|
-
p-2 bg-accent/20 border-b border-border flex items-center
|
|
52
|
-
[&>mona-button-group]:w-full
|
|
53
|
-
[&>mona-button-group>[monaButton]]:flex-1
|
|
49
|
+
const dateTimePickerHeaderVariants = cva(`
|
|
50
|
+
p-2 bg-accent/20 border-b border-border flex items-center
|
|
51
|
+
[&>mona-button-group]:w-full
|
|
52
|
+
[&>mona-button-group>[monaButton]]:flex-1
|
|
54
53
|
`);
|
|
55
|
-
const dateTimePickerFooterVariants = cva(`
|
|
56
|
-
p-2 bg-accent/20 border-t border-border flex items-center justify-between gap-2
|
|
57
|
-
[&>[monaButton]]:flex-1
|
|
54
|
+
const dateTimePickerFooterVariants = cva(`
|
|
55
|
+
p-2 bg-accent/20 border-t border-border flex items-center justify-between gap-2
|
|
56
|
+
[&>[monaButton]]:flex-1
|
|
58
57
|
`);
|
|
59
58
|
|
|
60
59
|
const dateTimePickerBaseThemeVariants = (theme) => {
|
|
@@ -610,7 +609,7 @@ class DateTimePickerComponent {
|
|
|
610
609
|
useExisting: forwardRef(() => DateTimePickerComponent),
|
|
611
610
|
multi: false
|
|
612
611
|
}
|
|
613
|
-
], 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\
|
|
612
|
+
], 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=\"h-full w-auto aspect-square\"\n [attr.aria-label]=\"'Open date and time picker'\"\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 flex-col h-68\"\n aria-modal=\"true\"\n role=\"dialog\"\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 Date\n </button>\n <button monaButton [selected]=\"activeView() === 'time'\" (click)=\"activeView.set('time')\" role=\"tab\">\n Time\n </button>\n </mona-button-group>\n </div>\n <div class=\"overflow-hidden\">\n @if (activeView() === \"date\") {\n <div class=\"h-full flex items-center justify-center\" aria-label=\"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=\"shadow-none border-none flex-1\">\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=\"h-full flex items-center justify-center max-h-64\" aria-label=\"Time picker\">\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 Set\n </button>\n <button\n monaButton\n look=\"default\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onCancelClick()\">\n 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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: CalendarComponent, selector: "mona-calendar", inputs: ["disabled", "disabledDates", "firstDay", "invalid", "maxDate", "minDate", "readonly", "rounded", "selection", "required", "touched", "class", "value", "weekNumber"], outputs: ["disabledChange", "touch", "valueChange"] }, { kind: "component", type: TimeSelectorComponent, selector: "mona-time-selector", inputs: ["ariaLabel", "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]" }] }); }
|
|
614
613
|
}
|
|
615
614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
616
615
|
type: Component,
|
|
@@ -625,7 +624,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
625
624
|
}
|
|
626
625
|
], imports: [
|
|
627
626
|
ButtonDirective,
|
|
628
|
-
FontAwesomeModule,
|
|
629
627
|
CalendarComponent,
|
|
630
628
|
TimeSelectorComponent,
|
|
631
629
|
TextBoxComponent,
|
|
@@ -644,7 +642,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
644
642
|
"[attr.data-invalid]": "invalidState() || null",
|
|
645
643
|
"[class]": "baseClass()",
|
|
646
644
|
"(blur)": "onDateInputBlur()"
|
|
647
|
-
}, template: "<mona-text-box\
|
|
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=\"h-full w-auto aspect-square\"\n [attr.aria-label]=\"'Open date and time picker'\"\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 flex-col h-68\"\n aria-modal=\"true\"\n role=\"dialog\"\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 Date\n </button>\n <button monaButton [selected]=\"activeView() === 'time'\" (click)=\"activeView.set('time')\" role=\"tab\">\n Time\n </button>\n </mona-button-group>\n </div>\n <div class=\"overflow-hidden\">\n @if (activeView() === \"date\") {\n <div class=\"h-full flex items-center justify-center\" aria-label=\"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=\"shadow-none border-none flex-1\">\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=\"h-full flex items-center justify-center max-h-64\" aria-label=\"Time picker\">\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 Set\n </button>\n <button\n monaButton\n look=\"default\"\n [disabled]=\"disabled()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n (click)=\"onCancelClick()\">\n Cancel\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
648
646
|
}], 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 }] }] } });
|
|
649
647
|
|
|
650
648
|
/*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, inject, ElementRef, computed, afterNextRender, ChangeDetectionStrategy, Component, signal, DOCUMENT, Injector, forwardRef, Injectable, DestroyRef, contentChild, TemplateRef, output, input, effect } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Subject, map, takeUntil, take } from 'rxjs';
|
|
5
4
|
import { PopupDataInjectionToken, PopupCloseEvent, PopupCloseSource, PopupService } from '@nanahoshi/mona-ui/popup';
|
|
5
|
+
import { Subject, map, takeUntil, take } from 'rxjs';
|
|
6
6
|
import { PreventableEvent, AnyPipe } from '@nanahoshi/mona-ui/common';
|
|
7
7
|
import { createElementControlId, focusElement, setWindowStyles } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
import * as i1 from '@angular/cdk/a11y';
|
|
@@ -85,12 +85,12 @@ class DialogActionEvent extends PreventableEvent {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
const dialogBaseVariants = cva(`
|
|
89
|
-
flex flex-col gap-0.5
|
|
90
|
-
w-full h-full
|
|
91
|
-
bg-background
|
|
92
|
-
border border-border shadow-sm
|
|
93
|
-
outline-none overflow-hidden
|
|
88
|
+
const dialogBaseVariants = cva(`
|
|
89
|
+
flex flex-col gap-0.5
|
|
90
|
+
w-full h-full
|
|
91
|
+
bg-background text-foreground
|
|
92
|
+
border border-border shadow-sm
|
|
93
|
+
outline-none overflow-hidden
|
|
94
94
|
`, {
|
|
95
95
|
variants: {
|
|
96
96
|
rounded: {
|
|
@@ -104,12 +104,12 @@ const dialogBaseVariants = cva(`
|
|
|
104
104
|
rounded: "medium"
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
const dialogContentContainerVariants = cva(`
|
|
108
|
-
flex flex-row gap-1 flex-1
|
|
107
|
+
const dialogContentContainerVariants = cva(`
|
|
108
|
+
flex flex-row gap-1 flex-1
|
|
109
109
|
`);
|
|
110
|
-
const dialogBodyVariants = cva(`
|
|
111
|
-
flex flex-col gap-0 pb-2
|
|
112
|
-
w-full h-full pr-2
|
|
110
|
+
const dialogBodyVariants = cva(`
|
|
111
|
+
flex flex-col gap-0 pb-2
|
|
112
|
+
w-full h-full pr-2
|
|
113
113
|
`, {
|
|
114
114
|
variants: {
|
|
115
115
|
hasIcon: {
|
|
@@ -118,18 +118,18 @@ const dialogBodyVariants = cva(`
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
const dialogHeaderVariants = cva(`
|
|
122
|
-
flex flex-row gap-2
|
|
123
|
-
pt-4 select-none
|
|
121
|
+
const dialogHeaderVariants = cva(`
|
|
122
|
+
flex flex-row gap-2
|
|
123
|
+
pt-4 select-none
|
|
124
124
|
`);
|
|
125
|
-
const dialogIconContainerVariants = cva(`
|
|
126
|
-
flex items-start justify-center pt-8 pr-4 pl-6
|
|
125
|
+
const dialogIconContainerVariants = cva(`
|
|
126
|
+
flex items-start justify-center pt-8 pr-4 pl-6
|
|
127
127
|
`);
|
|
128
|
-
const dialogIconVariants = cva(`
|
|
129
|
-
rounded-full w-fit h-fit p-1.5 border relative
|
|
130
|
-
[&>span]:absolute [&>span]:flex [&>span]:rounded-full
|
|
131
|
-
[&>span]:-top-3 [&>span]:-right-3 [&>span]:-bottom-3 [&>span]:-left-3
|
|
132
|
-
[&>span]:border [&>span]:min-w-full [&>span]:min-h-full
|
|
128
|
+
const dialogIconVariants = cva(`
|
|
129
|
+
rounded-full w-fit h-fit p-1.5 border relative
|
|
130
|
+
[&>span]:absolute [&>span]:flex [&>span]:rounded-full
|
|
131
|
+
[&>span]:-top-3 [&>span]:-right-3 [&>span]:-bottom-3 [&>span]:-left-3
|
|
132
|
+
[&>span]:border [&>span]:min-w-full [&>span]:min-h-full
|
|
133
133
|
`, {
|
|
134
134
|
variants: {
|
|
135
135
|
type: {
|
|
@@ -144,27 +144,27 @@ const dialogIconVariants = cva(`
|
|
|
144
144
|
type: "info"
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
|
-
const dialogTitleContainerVariants = cva(`
|
|
148
|
-
flex flex-1 items-center justify-start select-none p-1
|
|
147
|
+
const dialogTitleContainerVariants = cva(`
|
|
148
|
+
flex flex-1 items-center justify-start select-none p-1
|
|
149
149
|
`);
|
|
150
|
-
const dialogCloseButtonContainerVariants = cva(`
|
|
151
|
-
flex items-start justify-end
|
|
150
|
+
const dialogCloseButtonContainerVariants = cva(`
|
|
151
|
+
flex items-start justify-end
|
|
152
152
|
`);
|
|
153
|
-
const dialogTitleVariants = cva(`
|
|
154
|
-
text-lg font-semibold leading-none tracking-tight
|
|
153
|
+
const dialogTitleVariants = cva(`
|
|
154
|
+
text-lg font-semibold leading-none tracking-tight
|
|
155
155
|
`);
|
|
156
|
-
const dialogDescriptionVariants = cva(`
|
|
157
|
-
text-sm text-muted-foreground
|
|
158
|
-
select-none
|
|
156
|
+
const dialogDescriptionVariants = cva(`
|
|
157
|
+
text-sm text-muted-foreground
|
|
158
|
+
select-none
|
|
159
159
|
`);
|
|
160
|
-
const dialogContentVariants = cva(`
|
|
161
|
-
flex-1 overflow-auto p-1
|
|
160
|
+
const dialogContentVariants = cva(`
|
|
161
|
+
flex-1 overflow-auto p-1
|
|
162
162
|
`);
|
|
163
|
-
const dialogFooterVariants = cva(`
|
|
164
|
-
flex flex-row
|
|
165
|
-
gap-2 px-4 py-2
|
|
166
|
-
border-t border-border
|
|
167
|
-
select-none
|
|
163
|
+
const dialogFooterVariants = cva(`
|
|
164
|
+
flex flex-row
|
|
165
|
+
gap-2 px-4 py-2
|
|
166
|
+
border-t border-border
|
|
167
|
+
select-none
|
|
168
168
|
`, {
|
|
169
169
|
variants: {
|
|
170
170
|
layout: {
|
|
@@ -412,7 +412,7 @@ class DialogContentComponent {
|
|
|
412
412
|
focusElement(dialogElement, element);
|
|
413
413
|
}
|
|
414
414
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
415
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DialogContentComponent, isStandalone: true, selector: "ng-component", host: { properties: { "class": "baseClass()", "attr.aria-describedby": "describedById()", "attr.aria-labelledby": "headerId", "attr.role": "role()" } }, hostDirectives: [{ directive: i1.CdkTrapFocus }], ngImport: i0, template: "@let dialogIcon = icon();\
|
|
415
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: DialogContentComponent, isStandalone: true, selector: "ng-component", host: { properties: { "class": "baseClass()", "attr.aria-describedby": "describedById()", "attr.aria-labelledby": "headerId", "attr.role": "role()" } }, hostDirectives: [{ directive: i1.CdkTrapFocus }], ngImport: i0, template: "@let dialogIcon = icon();\n@let data = dialogData();\n\n<div [class]=\"contentContainerClass()\">\n @if (dialogIcon) {\n <div [class]=\"iconContainerClass()\">\n @if (data.iconTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.iconTemplate\"></ng-container>\n } @else {\n <div [class]=\"iconClass()\">\n <span aria-hidden=\"true\"></span>\n <svg [lucideIcon]=\"dialogIcon.icon\" [size]=\"24\" [style.color]=\"dialogIcon.color\"></svg>\n </div>\n }\n </div>\n }\n <div [class]=\"bodyClass()\">\n <div [class]=\"headerClass()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (data.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.titleTemplate\"></ng-container>\n } @else {\n <h2 [class]=\"titleClass()\">{{ data.title }}</h2>\n }\n </div>\n @if (data.closable) {\n <div [class]=\"closeButtonContainerClass()\">\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"Close dialog\"\n (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n\n @let descriptionTemplateId = data.descriptionTemplate ? descriptionId : undefined;\n <div class=\"p-1\" [attr.id]=\"descriptionTemplateId\">\n @if (data.descriptionTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTemplate\"></ng-container>\n } @else if (data.description) {\n <p [id]=\"descriptionId\" [class]=\"descriptionClass()\">{{ data.description }}</p>\n }\n </div>\n\n <div [class]=\"contentClass()\">\n @if (data.content) {\n <ng-container [ngTemplateOutlet]=\"data.content\"></ng-container>\n } @else if (data.text) {\n <p class=\"select-none\">{{ data.text }}</p>\n }\n </div>\n </div>\n</div>\n\n@if (data.footerTemplate || (data.actions | monaAny)) {\n @if (data.footerTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.footerTemplate\"></ng-container>\n } @else {\n <div [class]=\"footerClass()\">\n @for (action of data.actions; track $index) {\n <button\n monaButton\n type=\"button\"\n [class]=\"action.cssClass || ''\"\n [iconOnly]=\"action.iconOnly || false\"\n [look]=\"action.look\"\n [rounded]=\"action.rounded || data.rounded\"\n (click)=\"onActionClick(action)\">\n {{ action.text }}\n </button>\n }\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "pipe", type: AnyPipe, name: "monaAny" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
416
416
|
}
|
|
417
417
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DialogContentComponent, decorators: [{
|
|
418
418
|
type: Component,
|
|
@@ -421,7 +421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
421
421
|
"[attr.aria-describedby]": "describedById()",
|
|
422
422
|
"[attr.aria-labelledby]": "headerId",
|
|
423
423
|
"[attr.role]": "role()"
|
|
424
|
-
}, hostDirectives: [CdkTrapFocus], template: "@let dialogIcon = icon();\
|
|
424
|
+
}, hostDirectives: [CdkTrapFocus], template: "@let dialogIcon = icon();\n@let data = dialogData();\n\n<div [class]=\"contentContainerClass()\">\n @if (dialogIcon) {\n <div [class]=\"iconContainerClass()\">\n @if (data.iconTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.iconTemplate\"></ng-container>\n } @else {\n <div [class]=\"iconClass()\">\n <span aria-hidden=\"true\"></span>\n <svg [lucideIcon]=\"dialogIcon.icon\" [size]=\"24\" [style.color]=\"dialogIcon.color\"></svg>\n </div>\n }\n </div>\n }\n <div [class]=\"bodyClass()\">\n <div [class]=\"headerClass()\">\n <div [id]=\"headerId\" [class]=\"titleContainerClass()\">\n @if (data.titleTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.titleTemplate\"></ng-container>\n } @else {\n <h2 [class]=\"titleClass()\">{{ data.title }}</h2>\n }\n </div>\n @if (data.closable) {\n <div [class]=\"closeButtonContainerClass()\">\n <button\n monaButton\n look=\"ghost\"\n size=\"small\"\n [iconOnly]=\"true\"\n aria-label=\"Close dialog\"\n (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n </div>\n }\n </div>\n\n @let descriptionTemplateId = data.descriptionTemplate ? descriptionId : undefined;\n <div class=\"p-1\" [attr.id]=\"descriptionTemplateId\">\n @if (data.descriptionTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.descriptionTemplate\"></ng-container>\n } @else if (data.description) {\n <p [id]=\"descriptionId\" [class]=\"descriptionClass()\">{{ data.description }}</p>\n }\n </div>\n\n <div [class]=\"contentClass()\">\n @if (data.content) {\n <ng-container [ngTemplateOutlet]=\"data.content\"></ng-container>\n } @else if (data.text) {\n <p class=\"select-none\">{{ data.text }}</p>\n }\n </div>\n </div>\n</div>\n\n@if (data.footerTemplate || (data.actions | monaAny)) {\n @if (data.footerTemplate) {\n <ng-container [ngTemplateOutlet]=\"data.footerTemplate\"></ng-container>\n } @else {\n <div [class]=\"footerClass()\">\n @for (action of data.actions; track $index) {\n <button\n monaButton\n type=\"button\"\n [class]=\"action.cssClass || ''\"\n [iconOnly]=\"action.iconOnly || false\"\n [look]=\"action.look\"\n [rounded]=\"action.rounded || data.rounded\"\n (click)=\"onActionClick(action)\">\n {{ action.text }}\n </button>\n }\n </div>\n }\n}\n" }]
|
|
425
425
|
}], ctorParameters: () => [] });
|
|
426
426
|
|
|
427
427
|
class DialogRef {
|
|
@@ -2,10 +2,9 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
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
|
-
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
6
|
-
import { createElementControlId, isTypeaheadKey, setupTypeahead } from '@nanahoshi/mona-ui/internal';
|
|
7
5
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
8
6
|
import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
7
|
+
import { createElementControlId, isTypeaheadKey, setupTypeahead } from '@nanahoshi/mona-ui/internal';
|
|
9
8
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
10
9
|
import { ListService, ListComponent, ListItemTemplateDirective, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
11
10
|
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
@@ -24,17 +23,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
24
23
|
}]
|
|
25
24
|
}] });
|
|
26
25
|
|
|
27
|
-
const dropdownListInputVariants = cva(`
|
|
28
|
-
inline-flex items-center
|
|
29
|
-
|
|
30
|
-
border border-input-border
|
|
31
|
-
bg-background outline-none
|
|
32
|
-
shadow-xs
|
|
33
|
-
cursor-pointer select-none
|
|
34
|
-
|
|
35
|
-
hover:bg-accent hover:text-accent-foreground
|
|
36
|
-
transition-[color,box-shadow,border] ease-in-out duration-300
|
|
37
|
-
focus-within:ring-1 focus-within:ring-primary/40
|
|
26
|
+
const dropdownListInputVariants = cva(`
|
|
27
|
+
inline-flex items-center
|
|
28
|
+
|
|
29
|
+
border border-input-border
|
|
30
|
+
bg-background outline-none
|
|
31
|
+
text-foreground shadow-xs
|
|
32
|
+
cursor-pointer select-none
|
|
33
|
+
|
|
34
|
+
hover:bg-accent hover:text-accent-foreground
|
|
35
|
+
transition-[color,box-shadow,border] ease-in-out duration-300
|
|
36
|
+
focus-within:ring-1 focus-within:ring-primary/40
|
|
38
37
|
`, {
|
|
39
38
|
variants: {
|
|
40
39
|
disabled: {
|
|
@@ -552,7 +551,7 @@ class DropdownListComponent {
|
|
|
552
551
|
useExisting: forwardRef(() => DropdownListComponent),
|
|
553
552
|
multi: false
|
|
554
553
|
}
|
|
555
|
-
], 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()) {\
|
|
554
|
+
], 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=\"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"] }] }); }
|
|
556
555
|
}
|
|
557
556
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DropdownListComponent, decorators: [{
|
|
558
557
|
type: Component,
|
|
@@ -572,7 +571,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
572
571
|
}
|
|
573
572
|
], imports: [
|
|
574
573
|
NgTemplateOutlet,
|
|
575
|
-
FontAwesomeModule,
|
|
576
574
|
ListComponent,
|
|
577
575
|
ListItemTemplateDirective,
|
|
578
576
|
ListGroupHeaderTemplateDirective,
|
|
@@ -598,7 +596,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
598
596
|
"[attr.tabindex]": "disabled() ? null : 0",
|
|
599
597
|
"[class]": "baseClass()",
|
|
600
598
|
"(blur)": "onBlur()"
|
|
601
|
-
}, template: "@if (prefixTemplate()) {\
|
|
599
|
+
}, 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=\"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" }]
|
|
602
600
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{
|
|
603
601
|
read: TemplateRef
|
|
604
602
|
}, 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"] }], itemDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemDisabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", 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 }] }], valueField: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueField", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|