@nanahoshi/mona-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +24 -58
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +37 -48
- package/fesm2022/nanahoshi-mona-ui-button.mjs +130 -129
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +69 -165
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +81 -128
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +102 -112
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +11 -25
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +41 -92
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +27 -49
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +64 -65
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +39 -61
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +12 -15
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +44 -33
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +58 -60
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +52 -165
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +36 -59
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +56 -61
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +302 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +33 -84
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +12 -45
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +18 -48
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs +121 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +26 -55
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs +231 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +167 -451
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +57 -87
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -139
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +10 -32
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +8 -21
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -156
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +40 -69
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +32 -116
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +81 -107
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +33 -85
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +12 -34
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +31 -52
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +38 -110
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +21 -62
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +66 -111
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +60 -151
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +117 -173
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +32 -45
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +29 -64
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +38 -101
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +58 -79
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +42 -118
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +29 -37
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -81
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +45 -39
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +45 -109
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +54 -82
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +35 -115
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +31 -5
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +6 -6
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +6 -9
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -8
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +7 -8
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +3 -4
- package/types/nanahoshi-mona-ui-grid.d.ts +16 -17
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +7 -8
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +8 -11
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +13 -14
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +15 -17
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +4 -6
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +10 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -2,16 +2,15 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive, inject, DestroyRef, ElementRef, signal, computed, viewChild, contentChild, TemplateRef, input, output, model, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import
|
|
6
|
-
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
7
|
-
import { faTimes, faChevronDown } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
-
import { take, fromEvent, takeUntil } from 'rxjs';
|
|
5
|
+
import { LucideCircleX } from '@lucide/angular';
|
|
9
6
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
10
|
-
import { PopupService, dropdownPopupAnimation } from '@nanahoshi/mona-ui/popup';
|
|
11
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
12
|
-
import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
13
7
|
import { ColorGradientComponent } from '@nanahoshi/mona-ui/color-gradient';
|
|
14
8
|
import { ColorPaletteComponent } from '@nanahoshi/mona-ui/color-palette';
|
|
9
|
+
import { themeControlSurfaceClasses, themeOverlaySurfaceClasses, createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
10
|
+
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
11
|
+
import { PopupService, dropdownPopupAnimation } from '@nanahoshi/mona-ui/popup';
|
|
12
|
+
import { take, fromEvent, takeUntil } from 'rxjs';
|
|
13
|
+
import { twMerge } from 'tailwind-merge';
|
|
15
14
|
import { cva } from 'class-variance-authority';
|
|
16
15
|
|
|
17
16
|
class ColorPickerValueTemplateDirective {
|
|
@@ -25,32 +24,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
25
24
|
}]
|
|
26
25
|
}] });
|
|
27
26
|
|
|
28
|
-
const
|
|
29
|
-
flex items-center
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
data-[disabled='true']:
|
|
40
|
-
data-[disabled='true']:
|
|
41
|
-
data-[disabled='true']:
|
|
42
|
-
data-[readonly='true']:cursor-default
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
focus-within:ring-
|
|
48
|
-
|
|
49
|
-
[
|
|
27
|
+
const colorPickerBaseThemeVariants = cva(`
|
|
28
|
+
flex items-center
|
|
29
|
+
cursor-pointer
|
|
30
|
+
${themeControlSurfaceClasses} text-foreground
|
|
31
|
+
border border-input-border
|
|
32
|
+
shadow-(--shadow-control) outline-none
|
|
33
|
+
transition-[color,box-shadow,border] duration-(--mona-motion-standard) ease-in-out
|
|
34
|
+
|
|
35
|
+
data-[disabled='true']:pointer-events-none
|
|
36
|
+
data-[disabled='true']:cursor-not-allowed
|
|
37
|
+
data-[disabled='true']:border-disabled-border
|
|
38
|
+
data-[disabled='true']:bg-disabled-background
|
|
39
|
+
data-[disabled='true']:text-disabled-foreground
|
|
40
|
+
data-[disabled='true']:shadow-none
|
|
41
|
+
data-[readonly='true']:cursor-default
|
|
42
|
+
|
|
43
|
+
hover:bg-hover active:bg-active
|
|
44
|
+
|
|
45
|
+
focus-within:border-focus-indicator
|
|
46
|
+
focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
47
|
+
|
|
48
|
+
data-[invalid='true']:border-error
|
|
49
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
50
|
+
data-[invalid='true']:focus-within:border-error
|
|
51
|
+
data-[invalid='true']:focus-within:ring-error/35
|
|
52
|
+
[&.ng-touched.ng-invalid]:border-error
|
|
53
|
+
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
54
|
+
[&.ng-touched.ng-invalid]:focus-within:border-error
|
|
55
|
+
[&.ng-touched.ng-invalid]:focus-within:ring-error/35
|
|
50
56
|
`, {
|
|
51
57
|
variants: {
|
|
52
58
|
expanded: {
|
|
53
|
-
true: "ring-
|
|
59
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35",
|
|
60
|
+
false: ""
|
|
54
61
|
},
|
|
55
62
|
rounded: {
|
|
56
63
|
none: "rounded-none",
|
|
@@ -64,11 +71,17 @@ const colorPickerBaseVariants = cva(`
|
|
|
64
71
|
medium: "h-9 text-sm",
|
|
65
72
|
small: "h-8 text-xs"
|
|
66
73
|
}
|
|
67
|
-
}
|
|
74
|
+
},
|
|
75
|
+
compoundVariants: [
|
|
76
|
+
{
|
|
77
|
+
expanded: true,
|
|
78
|
+
class: "data-[invalid='true']:border-error data-[invalid='true']:ring-error/35"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
68
81
|
});
|
|
69
|
-
const
|
|
70
|
-
flex items-center justify-center
|
|
71
|
-
mx-1
|
|
82
|
+
const colorPickerColorThemeVariants = cva(`
|
|
83
|
+
flex items-center justify-center
|
|
84
|
+
mx-1
|
|
72
85
|
`, {
|
|
73
86
|
variants: {
|
|
74
87
|
rounded: {
|
|
@@ -79,30 +92,13 @@ const colorPickerColorVariants = cva(`
|
|
|
79
92
|
full: "rounded-full"
|
|
80
93
|
},
|
|
81
94
|
size: {
|
|
82
|
-
large: "
|
|
83
|
-
medium: "
|
|
84
|
-
small: "
|
|
95
|
+
large: "mx-2 h-6 w-6",
|
|
96
|
+
medium: "mx-2 h-5 w-5",
|
|
97
|
+
small: "mx-1 h-4 w-4"
|
|
85
98
|
}
|
|
86
99
|
}
|
|
87
100
|
});
|
|
88
101
|
|
|
89
|
-
const colorPickerBaseThemeVariants = (theme) => {
|
|
90
|
-
switch (theme) {
|
|
91
|
-
case "mona":
|
|
92
|
-
return colorPickerBaseVariants;
|
|
93
|
-
default:
|
|
94
|
-
return colorPickerBaseVariants;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const colorPickerColorThemeVariants = (theme) => {
|
|
98
|
-
switch (theme) {
|
|
99
|
-
case "mona":
|
|
100
|
-
return colorPickerColorVariants;
|
|
101
|
-
default:
|
|
102
|
-
return colorPickerColorVariants;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
102
|
class ColorPickerComponent {
|
|
107
103
|
constructor() {
|
|
108
104
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -110,28 +106,25 @@ class ColorPickerComponent {
|
|
|
110
106
|
this.#popupService = inject(PopupService);
|
|
111
107
|
this.#popupRef = signal(null, /* @ts-ignore */
|
|
112
108
|
...(ngDevMode ? [{ debugName: "#popupRef" }] : /* istanbul ignore next */ []));
|
|
113
|
-
this.#themeService = inject(ThemeService);
|
|
114
109
|
this.baseClasses = computed(() => {
|
|
115
|
-
const theme = this.#themeService.theme();
|
|
116
110
|
const expanded = this.expanded();
|
|
117
111
|
const rounded = this.rounded();
|
|
118
112
|
const size = this.size();
|
|
119
|
-
return colorPickerBaseThemeVariants(
|
|
113
|
+
return twMerge(colorPickerBaseThemeVariants({ expanded, rounded, size }));
|
|
120
114
|
}, /* @ts-ignore */
|
|
121
115
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
122
116
|
this.colorClasses = computed(() => {
|
|
123
|
-
const theme = this.#themeService.theme();
|
|
124
117
|
const rounded = this.rounded();
|
|
125
118
|
const size = this.size();
|
|
126
|
-
return colorPickerColorThemeVariants(
|
|
119
|
+
return colorPickerColorThemeVariants({ rounded, size });
|
|
127
120
|
}, /* @ts-ignore */
|
|
128
121
|
...(ngDevMode ? [{ debugName: "colorClasses" }] : /* istanbul ignore next */ []));
|
|
129
122
|
this.expanded = computed(() => this.#popupRef() !== null, /* @ts-ignore */
|
|
130
123
|
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
131
124
|
this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && !this.value()), /* @ts-ignore */
|
|
132
125
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
126
|
+
this.gradientPopupClasses = `${themeOverlaySurfaceClasses} border border-border shadow-(--shadow-overlay)`;
|
|
127
|
+
this.palettePopupClasses = `flex flex-col p-0.5 ${themeOverlaySurfaceClasses} border border-border shadow-(--shadow-overlay) outline-none`;
|
|
135
128
|
this.popupId = createElementControlId();
|
|
136
129
|
this.popupTemplate = viewChild.required("popupTemplate", /* @ts-ignore */
|
|
137
130
|
...(ngDevMode ? [{ debugName: "popupTemplate" }] : /* istanbul ignore next */ []));
|
|
@@ -241,7 +234,6 @@ class ColorPickerComponent {
|
|
|
241
234
|
#hostElementRef;
|
|
242
235
|
#popupService;
|
|
243
236
|
#popupRef;
|
|
244
|
-
#themeService;
|
|
245
237
|
ngOnInit() {
|
|
246
238
|
this.setEventListeners();
|
|
247
239
|
this.setKeyboardEventListeners();
|
|
@@ -459,11 +451,18 @@ class ColorPickerComponent {
|
|
|
459
451
|
});
|
|
460
452
|
}
|
|
461
453
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ColorPickerComponent, isStandalone: true, selector: "mona-color-picker", inputs: { closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", 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 }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null }, palette: { classPropertyName: "palette", publicName: "palette", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { properties: { "class": "baseClasses()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.data-open": "expanded() || null", "attr.data-readonly": "readonly()", "attr.data-required": "required() || null", "attr.role": "'combobox'", "attr.aria-controls": "popupId", "attr.aria-expanded": "expanded() || null", "attr.aria-haspopup": "'dialog'", "attr.aria-label": "'Color picker'", "attr.aria-disabled": "disabled()", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.aria-readonly": "readonly()", "attr.aria-required": "required()" } }, queries: [{ propertyName: "valueTemplate", first: true, predicate: ColorPickerValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (valueTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: value() }\"></ng-container>\n} @else {\n <div [style.background]=\"value()\" [class]=\"colorClasses()\">\n @if (!value()) {\n <
|
|
454
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ColorPickerComponent, isStandalone: true, selector: "mona-color-picker", inputs: { closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", 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 }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null }, palette: { classPropertyName: "palette", publicName: "palette", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", 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 }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, host: { properties: { "class": "baseClasses()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.data-open": "expanded() || null", "attr.data-readonly": "readonly()", "attr.data-required": "required() || null", "attr.role": "'combobox'", "attr.aria-controls": "popupId", "attr.aria-expanded": "expanded() || null", "attr.aria-haspopup": "'dialog'", "attr.aria-label": "'Color picker'", "attr.aria-disabled": "disabled()", "attr.aria-invalid": "invalidState() ? 'true' : null", "attr.aria-readonly": "readonly()", "attr.aria-required": "required()" } }, queries: [{ propertyName: "valueTemplate", first: true, predicate: ColorPickerValueTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (valueTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: value() }\"></ng-container>\n} @else {\n <div [style.background]=\"value()\" [class]=\"colorClasses()\">\n @if (!value()) {\n <svg lucideXCircle [size]=\"16\"></svg>\n }\n </div>\n}\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n @if (view() === \"palette\") {\n <div\n [id]=\"popupId\"\n [class]=\"palettePopupClasses\"\n tabindex=\"0\"\n role=\"dialog\"\n aria-label=\"Color palette picker\"\n data-palette-container\n (keydown)=\"onPaletteContainerKeyDown($event)\">\n @if (showClearButton()) {\n <div class=\"flex items-center justify-end p-1\">\n <button monaButton look=\"ghost\" size=\"small\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n </div>\n }\n <mona-color-palette\n [palette]=\"palette()\"\n [columns]=\"columns()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (valueChange)=\"onColorPaletteValueChange($event)\"\n (touch)=\"onColorPaletteTouch()\"></mona-color-palette>\n </div>\n } @else if (view() === \"gradient\") {\n <div\n [id]=\"popupId\"\n [class]=\"gradientPopupClasses\"\n tabindex=\"0\"\n role=\"dialog\"\n aria-label=\"Color gradient picker\">\n <mona-color-gradient\n [opacity]=\"opacity()\"\n [rounded]=\"rounded()\"\n [disabled]=\"disabled() || readonly()\"\n [value]=\"value()\"\n (valueChange)=\"onColorGradientValueChange($event)\"\n (touch)=\"onColorGradientTouch()\"\n (apply)=\"onColorGradientApply()\"\n (cancel)=\"onColorGradientCancel()\"></mona-color-gradient>\n </div>\n }\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: ColorPaletteComponent, selector: "mona-color-palette", inputs: ["columns", "disabled", "invalid", "palette", "readonly", "rounded", "required", "tileSize", "touched", "value"], outputs: ["touch", "valueChange"] }, { kind: "component", type: ColorGradientComponent, selector: "mona-color-gradient", inputs: ["disabled", "format", "invalid", "opacity", "required", "rounded", "showButtons", "showHexInput", "showColorInputs", "touched", "value"], outputs: ["apply", "cancel", "touch", "valueChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideCircleX, selector: "svg[lucideCircleX], svg[lucideXCircle]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
463
455
|
}
|
|
464
456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ColorPickerComponent, decorators: [{
|
|
465
457
|
type: Component,
|
|
466
|
-
args: [{ selector: "mona-color-picker", imports: [
|
|
458
|
+
args: [{ selector: "mona-color-picker", imports: [
|
|
459
|
+
ButtonDirective,
|
|
460
|
+
ColorPaletteComponent,
|
|
461
|
+
ColorGradientComponent,
|
|
462
|
+
NgTemplateOutlet,
|
|
463
|
+
LucideCircleX,
|
|
464
|
+
IndicatorIconComponent
|
|
465
|
+
], host: {
|
|
467
466
|
"[class]": "baseClasses()",
|
|
468
467
|
"[attr.tabindex]": "disabled() ? -1 : 0",
|
|
469
468
|
"[attr.data-disabled]": "disabled()",
|
|
@@ -480,7 +479,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
480
479
|
"[attr.aria-invalid]": "invalidState() ? 'true' : null",
|
|
481
480
|
"[attr.aria-readonly]": "readonly()",
|
|
482
481
|
"[attr.aria-required]": "required()"
|
|
483
|
-
}, template: "@if (valueTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: value() }\"></ng-container>\n} @else {\n <div [style.background]=\"value()\" [class]=\"colorClasses()\">\n @if (!value()) {\n <
|
|
482
|
+
}, template: "@if (valueTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"valueTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: value() }\"></ng-container>\n} @else {\n <div [style.background]=\"value()\" [class]=\"colorClasses()\">\n @if (!value()) {\n <svg lucideXCircle [size]=\"16\"></svg>\n }\n </div>\n}\n<mona-indicator-icon preset=\"dropdown\" [size]=\"18\"></mona-indicator-icon>\n\n<ng-template #popupTemplate>\n @if (view() === \"palette\") {\n <div\n [id]=\"popupId\"\n [class]=\"palettePopupClasses\"\n tabindex=\"0\"\n role=\"dialog\"\n aria-label=\"Color palette picker\"\n data-palette-container\n (keydown)=\"onPaletteContainerKeyDown($event)\">\n @if (showClearButton()) {\n <div class=\"flex items-center justify-end p-1\">\n <button monaButton look=\"ghost\" size=\"small\" (click)=\"onClearClick()\">\n <i class=\"ri-blur-off-line\"></i>\n </button>\n </div>\n }\n <mona-color-palette\n [palette]=\"palette()\"\n [columns]=\"columns()\"\n [readonly]=\"readonly()\"\n [value]=\"value()\"\n (valueChange)=\"onColorPaletteValueChange($event)\"\n (touch)=\"onColorPaletteTouch()\"></mona-color-palette>\n </div>\n } @else if (view() === \"gradient\") {\n <div\n [id]=\"popupId\"\n [class]=\"gradientPopupClasses\"\n tabindex=\"0\"\n role=\"dialog\"\n aria-label=\"Color gradient picker\">\n <mona-color-gradient\n [opacity]=\"opacity()\"\n [rounded]=\"rounded()\"\n [disabled]=\"disabled() || readonly()\"\n [value]=\"value()\"\n (valueChange)=\"onColorGradientValueChange($event)\"\n (touch)=\"onColorGradientTouch()\"\n (apply)=\"onColorGradientApply()\"\n (cancel)=\"onColorGradientCancel()\"></mona-color-gradient>\n </div>\n }\n</ng-template>\n" }]
|
|
484
483
|
}], propDecorators: { popupTemplate: [{ type: i0.ViewChild, args: ["popupTemplate", { isSignal: true }] }], valueTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ColorPickerValueTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], opacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "opacity", required: false }] }], palette: [{ type: i0.Input, args: [{ isSignal: true, alias: "palette", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", 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 }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
485
484
|
|
|
486
485
|
/*
|
|
@@ -4,36 +4,39 @@ import { inject, DestroyRef, ElementRef, linkedSignal, signal, computed, content
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import {
|
|
8
|
-
import { createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
7
|
+
import { FilterChangeEvent } from '@nanahoshi/mona-ui/common';
|
|
9
8
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
10
9
|
import { DropdownListService, DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
11
|
-
import {
|
|
10
|
+
import { themeControlSurfaceClasses, createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
12
11
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
13
12
|
import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective, ListItemTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
14
13
|
import { TextBoxDirective } from '@nanahoshi/mona-ui/text-box';
|
|
15
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
16
14
|
import { Subject, fromEvent, filter, debounceTime, take, tap } from 'rxjs';
|
|
17
15
|
import { twMerge } from 'tailwind-merge';
|
|
18
16
|
import { cva } from 'class-variance-authority';
|
|
19
17
|
|
|
20
|
-
const
|
|
21
|
-
flex items-center
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const comboBoxBaseThemeVariants = cva(`
|
|
19
|
+
flex items-center
|
|
20
|
+
cursor-pointer
|
|
21
|
+
${themeControlSurfaceClasses} text-foreground
|
|
22
|
+
border border-input-border shadow-(--shadow-control) outline-none
|
|
23
|
+
transition-[color,box-shadow,border] duration-(--mona-motion-standard) ease-in-out
|
|
24
|
+
data-[readonly='true']:cursor-default
|
|
25
|
+
focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
27
26
|
`, {
|
|
28
27
|
variants: {
|
|
29
28
|
disabled: {
|
|
30
|
-
true:
|
|
29
|
+
true: `
|
|
30
|
+
pointer-events-none cursor-not-allowed
|
|
31
|
+
bg-disabled-background text-disabled-foreground
|
|
32
|
+
border-disabled-border shadow-none
|
|
33
|
+
`
|
|
31
34
|
},
|
|
32
35
|
focused: {
|
|
33
|
-
true: "ring-
|
|
36
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35"
|
|
34
37
|
},
|
|
35
38
|
invalid: {
|
|
36
|
-
true: "border-error ring-
|
|
39
|
+
true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
|
|
37
40
|
false: ""
|
|
38
41
|
},
|
|
39
42
|
rounded: {
|
|
@@ -49,6 +52,13 @@ const comboBoxBaseVariants = cva(`
|
|
|
49
52
|
large: "h-10 text-md"
|
|
50
53
|
}
|
|
51
54
|
},
|
|
55
|
+
compoundVariants: [
|
|
56
|
+
{
|
|
57
|
+
focused: true,
|
|
58
|
+
invalid: true,
|
|
59
|
+
class: "border-error ring-error/35"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
52
62
|
defaultVariants: {
|
|
53
63
|
disabled: false,
|
|
54
64
|
focused: false,
|
|
@@ -57,12 +67,11 @@ const comboBoxBaseVariants = cva(`
|
|
|
57
67
|
size: "medium"
|
|
58
68
|
}
|
|
59
69
|
});
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
bg-transparent shadow-none
|
|
63
|
-
|
|
64
|
-
focus-
|
|
65
|
-
focus-visible:ring-0 focus-visible:shadow-none
|
|
70
|
+
const comboBoxTextInputThemeVariants = cva(`
|
|
71
|
+
h-full w-full px-2 text-ellipsis
|
|
72
|
+
bg-transparent border-none shadow-none outline-none
|
|
73
|
+
focus-within:ring-0 focus-within:shadow-none
|
|
74
|
+
focus-visible:ring-0 focus-visible:shadow-none
|
|
66
75
|
`, {
|
|
67
76
|
variants: {
|
|
68
77
|
rounded: {
|
|
@@ -74,32 +83,7 @@ const comboBoxTextInputVariants = cva(`
|
|
|
74
83
|
}
|
|
75
84
|
}
|
|
76
85
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const comboBoxBaseThemeVariants = (theme) => {
|
|
80
|
-
switch (theme) {
|
|
81
|
-
case "mona":
|
|
82
|
-
return comboBoxBaseVariants;
|
|
83
|
-
default:
|
|
84
|
-
return comboBoxBaseVariants;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const comboBoxTextInputThemeVariants = (theme) => {
|
|
88
|
-
switch (theme) {
|
|
89
|
-
case "mona":
|
|
90
|
-
return comboBoxTextInputVariants;
|
|
91
|
-
default:
|
|
92
|
-
return comboBoxTextInputVariants;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const comboBoxAffixContainerThemeVariants = (theme) => {
|
|
96
|
-
switch (theme) {
|
|
97
|
-
case "mona":
|
|
98
|
-
return comboBoxAffixContainerVariants;
|
|
99
|
-
default:
|
|
100
|
-
return comboBoxAffixContainerVariants;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
86
|
+
const comboBoxAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
|
|
103
87
|
|
|
104
88
|
class ComboBoxComponent {
|
|
105
89
|
#destroyRef;
|
|
@@ -109,7 +93,6 @@ class ComboBoxComponent {
|
|
|
109
93
|
#listService;
|
|
110
94
|
#navigatedValue;
|
|
111
95
|
#popupRef;
|
|
112
|
-
#themeService;
|
|
113
96
|
#userNavigatedViaArrows;
|
|
114
97
|
constructor() {
|
|
115
98
|
this.#destroyRef = inject(DestroyRef);
|
|
@@ -120,7 +103,6 @@ class ComboBoxComponent {
|
|
|
120
103
|
this.#navigatedValue = linkedSignal(() => this.value(), /* @ts-ignore */
|
|
121
104
|
...(ngDevMode ? [{ debugName: "#navigatedValue" }] : /* istanbul ignore next */ []));
|
|
122
105
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
123
|
-
this.#themeService = inject(ThemeService);
|
|
124
106
|
this.#userNavigatedViaArrows = signal(false, /* @ts-ignore */
|
|
125
107
|
...(ngDevMode ? [{ debugName: "#userNavigatedViaArrows" }] : /* istanbul ignore next */ []));
|
|
126
108
|
this.activeDescendant = computed(() => {
|
|
@@ -129,18 +111,16 @@ class ComboBoxComponent {
|
|
|
129
111
|
}, /* @ts-ignore */
|
|
130
112
|
...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
131
113
|
this.affixClass = computed(() => {
|
|
132
|
-
|
|
133
|
-
return comboBoxAffixContainerThemeVariants(theme)();
|
|
114
|
+
return comboBoxAffixContainerThemeVariants();
|
|
134
115
|
}, /* @ts-ignore */
|
|
135
116
|
...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
|
|
136
117
|
this.baseClass = computed(() => {
|
|
137
|
-
const theme = this.#themeService.theme();
|
|
138
118
|
const disabled = this.disabled();
|
|
139
119
|
const focused = this.#popupRef() != null;
|
|
140
120
|
const invalid = this.invalidState();
|
|
141
121
|
const rounded = this.rounded();
|
|
142
122
|
const size = this.size();
|
|
143
|
-
const variantClass = comboBoxBaseThemeVariants(
|
|
123
|
+
const variantClass = comboBoxBaseThemeVariants({ disabled, focused, invalid, rounded, size });
|
|
144
124
|
const userClass = this.userClass();
|
|
145
125
|
return twMerge(variantClass, userClass);
|
|
146
126
|
}, /* @ts-ignore */
|
|
@@ -157,9 +137,8 @@ class ComboBoxComponent {
|
|
|
157
137
|
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
158
138
|
this.id = createElementControlId();
|
|
159
139
|
this.inputClass = computed(() => {
|
|
160
|
-
const theme = this.#themeService.theme();
|
|
161
140
|
const rounded = this.rounded();
|
|
162
|
-
return comboBoxTextInputThemeVariants(
|
|
141
|
+
return comboBoxTextInputThemeVariants({ rounded });
|
|
163
142
|
}, /* @ts-ignore */
|
|
164
143
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
165
144
|
this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && this.value() == null), /* @ts-ignore */
|
|
@@ -167,11 +146,10 @@ class ComboBoxComponent {
|
|
|
167
146
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
168
147
|
this.listId = createElementControlId();
|
|
169
148
|
this.listPopupClass = computed(() => {
|
|
170
|
-
const theme = this.#themeService.theme();
|
|
171
149
|
const rounded = this.rounded();
|
|
172
150
|
const size = this.size();
|
|
173
151
|
const userClass = this.popupClass();
|
|
174
|
-
const variantClass = dropdownPopupThemeVariants(
|
|
152
|
+
const variantClass = dropdownPopupThemeVariants({ rounded, size });
|
|
175
153
|
return twMerge(variantClass, userClass);
|
|
176
154
|
}, /* @ts-ignore */
|
|
177
155
|
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
@@ -617,7 +595,7 @@ class ComboBoxComponent {
|
|
|
617
595
|
}
|
|
618
596
|
}
|
|
619
597
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ComboBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
620
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ComboBoxComponent, isStandalone: true, selector: "mona-combo-box", inputs: { allowCustomValue: { classPropertyName: "allowCustomValue", publicName: "allowCustomValue", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, 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 }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", valueAdd: "valueAdd", value: "valueChange" }, host: { properties: { "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-invalid": "invalidState() ? true : undefined", "attr.aria-readonly": "readonly() ? true : undefined", "attr.aria-required": "required() ? true : undefined", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.tabindex": "-1", "class": "baseClass()" } }, providers: [
|
|
598
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ComboBoxComponent, isStandalone: true, selector: "mona-combo-box", inputs: { allowCustomValue: { classPropertyName: "allowCustomValue", publicName: "allowCustomValue", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, 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 }, itemDisabled: { classPropertyName: "itemDisabled", publicName: "itemDisabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", 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 }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", closed: "closed", disabled: "disabledChange", open: "open", opened: "opened", touch: "touch", valueAdd: "valueAdd", value: "valueChange" }, host: { properties: { "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-invalid": "invalidState() ? true : undefined", "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.tabindex": "-1", "class": "baseClass()" } }, providers: [
|
|
621
599
|
ListService,
|
|
622
600
|
DropdownService,
|
|
623
601
|
DropdownListService,
|
|
@@ -631,7 +609,7 @@ class ComboBoxComponent {
|
|
|
631
609
|
useExisting: forwardRef(() => ComboBoxComponent),
|
|
632
610
|
multi: false
|
|
633
611
|
}
|
|
634
|
-
], 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 }], viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.DropdownDataHandlerDirective }, { directive: i1.DropdownListPopupHandlerDirective }], ngImport: i0, template: "@if (prefixTemplate()) {\
|
|
612
|
+
], 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 }], 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<input\n monaTextBox\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [ngModel]=\"comboBoxValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n role=\"combobox\"\n (ngModelChange)=\"comboBoxValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && selectedListItem() && !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 (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\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: TextBoxDirective, selector: "input[monaTextBox]", inputs: ["rounded", "size", "class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: 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: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: DropdownLiveRegionDirective, selector: "span[monaDropdownLiveRegion]" }, { kind: "component", type: IndicatorIconComponent, selector: "mona-indicator-icon", inputs: ["icon", "interactive", "label", "preset", "size", "class"], outputs: ["activate"] }] }); }
|
|
635
613
|
}
|
|
636
614
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ComboBoxComponent, decorators: [{
|
|
637
615
|
type: Component,
|
|
@@ -652,7 +630,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
652
630
|
], imports: [
|
|
653
631
|
TextBoxDirective,
|
|
654
632
|
FormsModule,
|
|
655
|
-
FontAwesomeModule,
|
|
656
633
|
NgTemplateOutlet,
|
|
657
634
|
ListComponent,
|
|
658
635
|
ListGroupHeaderTemplateDirective,
|
|
@@ -667,11 +644,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
667
644
|
"[attr.aria-invalid]": "invalidState() ? true : undefined",
|
|
668
645
|
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
669
646
|
"[attr.aria-required]": "required() ? true : undefined",
|
|
670
|
-
"[attr.data-disabled]": "disabled()",
|
|
647
|
+
"[attr.data-disabled]": "disabled() || null",
|
|
671
648
|
"[attr.data-invalid]": "invalidState() || null",
|
|
649
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
672
650
|
"[attr.tabindex]": "-1",
|
|
673
651
|
"[class]": "baseClass()"
|
|
674
|
-
}, template: "@if (prefixTemplate()) {\
|
|
652
|
+
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [required]=\"required()\"\n [ngModel]=\"comboBoxValue()\"\n [attr.aria-activedescendant]=\"activeDescendant()\"\n [attr.aria-autocomplete]=\"'list'\"\n [attr.aria-busy]=\"loading()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-describedby]=\"ariaDescribedBy() || undefined\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-invalid]=\"invalidState() || undefined\"\n [attr.aria-label]=\"effectiveAriaLabel() || undefined\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || undefined\"\n role=\"combobox\"\n (ngModelChange)=\"comboBoxValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && selectedListItem() && !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 (itemSelect)=\"onItemSelect($event)\" [focusOnMount]=\"false\" [size]=\"size()\" [listId]=\"listId\">\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" }]
|
|
675
653
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DropdownGroupHeaderTemplateDirective), { ...{ read: TemplateRef }, 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 }] }], allowCustomValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCustomValue", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], 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 }] }], valueAdd: [{ type: i0.Output, args: ["valueAdd"] }], 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"] }] } });
|
|
676
654
|
|
|
677
655
|
/*
|
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Directive, Pipe, Injectable } from '@angular/core';
|
|
3
3
|
import { toImmutableSet, where, select, sequence } from '@mirei/ts-collections';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { themeOverlaySurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
5
6
|
import { Subject } from 'rxjs';
|
|
6
7
|
|
|
7
8
|
class DateInputPrefixTemplateDirective {
|
|
@@ -46,12 +47,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
46
47
|
}]
|
|
47
48
|
}] });
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
[&_mona-calendar]:
|
|
50
|
+
const datePopupThemeVariants = cva(`
|
|
51
|
+
h-full overflow-auto
|
|
52
|
+
[scrollbar-color:var(--color-scrollbar-thumb)_var(--color-scrollbar-track)] [scrollbar-width:thin]
|
|
53
|
+
${themeOverlaySurfaceClasses} text-foreground
|
|
54
|
+
border border-border shadow-(--shadow-overlay)
|
|
55
|
+
[&_mona-calendar]:[background-color:var(--mona-date-popup-calendar-background,var(--mona-calendar-background))]!
|
|
56
|
+
[&_mona-calendar]:[background-image:var(--mona-date-popup-calendar-background-image,var(--mona-effect-raised-background-image))]!
|
|
57
|
+
[&_mona-calendar]:[backdrop-filter:var(--mona-date-popup-calendar-backdrop-filter,var(--mona-effect-raised-backdrop-filter))]!
|
|
58
|
+
[&_mona-calendar]:[-webkit-backdrop-filter:var(--mona-date-popup-calendar-backdrop-filter,var(--mona-effect-raised-backdrop-filter))]!
|
|
59
|
+
[&_mona-calendar]:border-none
|
|
60
|
+
[&_mona-calendar]:shadow-none
|
|
55
61
|
`, {
|
|
56
62
|
variants: {
|
|
57
63
|
rounded: {
|
|
@@ -73,15 +79,6 @@ const datePopupVariants = cva(`
|
|
|
73
79
|
}
|
|
74
80
|
});
|
|
75
81
|
|
|
76
|
-
const datePopupThemeVariants = (theme) => {
|
|
77
|
-
switch (theme) {
|
|
78
|
-
case "mona":
|
|
79
|
-
return datePopupVariants;
|
|
80
|
-
default:
|
|
81
|
-
return datePopupVariants;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
|
|
85
82
|
class CalendarService {
|
|
86
83
|
constructor() {
|
|
87
84
|
this.keydown$ = new Subject();
|