@nanahoshi/mona-ui 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +54 -150
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +67 -99
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +27 -78
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +17 -39
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +39 -48
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +34 -54
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +42 -29
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +33 -54
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +27 -57
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +36 -63
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +38 -64
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +78 -98
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -59
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +19 -31
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -65
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +43 -29
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +40 -102
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
- package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +2 -1
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +18 -10
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -5
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
- package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +6 -7
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +28 -13
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +12 -13
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +16 -7
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +11 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
|
@@ -4,37 +4,41 @@ import { inject, DestroyRef, ElementRef, computed, linkedSignal, contentChild, T
|
|
|
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 { createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
7
|
+
import { themeControlSurfaceClasses, createElementControlId, rxTimeout } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
import { FilterChangeEvent } from '@nanahoshi/mona-ui/common';
|
|
9
9
|
import { IndicatorIconComponent } from '@nanahoshi/mona-ui/internal/indicator-icon';
|
|
10
10
|
import { ListService, ListComponent, ListGroupHeaderTemplateDirective, ListFooterTemplateDirective, ListHeaderTemplateDirective, ListNoDataTemplateDirective, ListItemTemplateDirective } from '@nanahoshi/mona-ui/internal/list';
|
|
11
11
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
12
12
|
import { DropdownService, DropdownFooterTemplateDirective, DropdownGroupHeaderTemplateDirective, DropdownHeaderTemplateDirective, DropdownItemTemplateDirective, dropdownPopupThemeVariants, DropdownNoDataTemplateDirective, DropdownPrefixTemplateDirective, DropdownSuffixTemplateDirective, DropdownLiveRegionDirective, DropdownDataInputToken, DropdownPopupInputToken, DropdownDataHandlerDirective, DropdownListPopupHandlerDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
13
13
|
import { TextBoxDirective } from '@nanahoshi/mona-ui/text-box';
|
|
14
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
15
14
|
import { Subject, filter, debounceTime, identity, take, tap } from 'rxjs';
|
|
16
15
|
import { twMerge } from 'tailwind-merge';
|
|
17
16
|
import { cva } from 'class-variance-authority';
|
|
18
17
|
|
|
19
|
-
const
|
|
18
|
+
const autoCompleteBaseThemeVariants = cva(`
|
|
20
19
|
flex
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
${themeControlSurfaceClasses} text-foreground
|
|
21
|
+
border border-input-border shadow-(--shadow-control) outline-none
|
|
22
|
+
transition-[color,box-shadow,border] duration-(--mona-motion-standard) ease-in-out
|
|
23
|
+
data-[readonly='true']:cursor-default
|
|
24
|
+
focus-within:border-focus-indicator focus-within:ring-2 focus-within:ring-focus-indicator/35
|
|
25
25
|
`, {
|
|
26
26
|
variants: {
|
|
27
27
|
disabled: {
|
|
28
|
-
true:
|
|
28
|
+
true: `
|
|
29
|
+
pointer-events-none cursor-not-allowed
|
|
30
|
+
bg-disabled-background text-disabled-foreground
|
|
31
|
+
border-disabled-border shadow-none
|
|
32
|
+
`
|
|
29
33
|
},
|
|
30
34
|
expanded: {
|
|
31
|
-
true: "ring-
|
|
35
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35"
|
|
32
36
|
},
|
|
33
37
|
focused: {
|
|
34
|
-
true: "ring-
|
|
38
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35"
|
|
35
39
|
},
|
|
36
40
|
invalid: {
|
|
37
|
-
true: "border-error ring-
|
|
41
|
+
true: "border-error ring-2 ring-error/35 focus-within:border-error focus-within:ring-error/35",
|
|
38
42
|
false: ""
|
|
39
43
|
},
|
|
40
44
|
rounded: {
|
|
@@ -50,6 +54,18 @@ const autoCompleteBaseVariants = cva(`
|
|
|
50
54
|
small: "h-8 text-xs"
|
|
51
55
|
}
|
|
52
56
|
},
|
|
57
|
+
compoundVariants: [
|
|
58
|
+
{
|
|
59
|
+
expanded: true,
|
|
60
|
+
invalid: true,
|
|
61
|
+
class: "border-error ring-error/35"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
focused: true,
|
|
65
|
+
invalid: true,
|
|
66
|
+
class: "border-error ring-error/35"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
53
69
|
defaultVariants: {
|
|
54
70
|
disabled: false,
|
|
55
71
|
focused: false,
|
|
@@ -58,10 +74,9 @@ const autoCompleteBaseVariants = cva(`
|
|
|
58
74
|
size: "medium"
|
|
59
75
|
}
|
|
60
76
|
});
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
bg-transparent shadow-none
|
|
64
|
-
px-2 h-full w-full text-ellipsis
|
|
77
|
+
const autoCompleteTextInputThemeVariants = cva(`
|
|
78
|
+
h-full w-full px-2 text-ellipsis
|
|
79
|
+
bg-transparent border-none shadow-none outline-none
|
|
65
80
|
focus-within:ring-0 focus-visible:ring-0
|
|
66
81
|
`, {
|
|
67
82
|
variants: {
|
|
@@ -74,32 +89,7 @@ const autoCompleteTextInputVariants = cva(`
|
|
|
74
89
|
}
|
|
75
90
|
}
|
|
76
91
|
});
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const autoCompleteBaseThemeVariants = (theme) => {
|
|
80
|
-
switch (theme) {
|
|
81
|
-
case "mona":
|
|
82
|
-
return autoCompleteBaseVariants;
|
|
83
|
-
default:
|
|
84
|
-
return autoCompleteBaseVariants;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const autoCompleteTextInputThemeVariants = (theme) => {
|
|
88
|
-
switch (theme) {
|
|
89
|
-
case "mona":
|
|
90
|
-
return autoCompleteTextInputVariants;
|
|
91
|
-
default:
|
|
92
|
-
return autoCompleteTextInputVariants;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const autoCompleteAffixContainerThemeVariants = (theme) => {
|
|
96
|
-
switch (theme) {
|
|
97
|
-
case "mona":
|
|
98
|
-
return autoCompleteAffixContainerVariants;
|
|
99
|
-
default:
|
|
100
|
-
return autoCompleteAffixContainerVariants;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
92
|
+
const autoCompleteAffixContainerThemeVariants = cva(`flex h-full flex-none items-center justify-center`);
|
|
103
93
|
|
|
104
94
|
class AutoCompleteComponent {
|
|
105
95
|
#destroyRef;
|
|
@@ -107,36 +97,32 @@ class AutoCompleteComponent {
|
|
|
107
97
|
#hostElementRef;
|
|
108
98
|
#listService;
|
|
109
99
|
#popupRef;
|
|
110
|
-
#themeService;
|
|
111
100
|
constructor() {
|
|
112
101
|
this.#destroyRef = inject(DestroyRef);
|
|
113
102
|
this.#dropdownService = inject(DropdownService);
|
|
114
103
|
this.#hostElementRef = inject((ElementRef));
|
|
115
104
|
this.#listService = inject(ListService);
|
|
116
105
|
this.#popupRef = this.#dropdownService.popupRef;
|
|
117
|
-
this.#themeService = inject(ThemeService);
|
|
118
106
|
this.activeDescendant = computed(() => {
|
|
119
107
|
const highlightedItem = this.#listService.highlightedItem();
|
|
120
108
|
return highlightedItem ? highlightedItem.uid : null;
|
|
121
109
|
}, /* @ts-ignore */
|
|
122
110
|
...(ngDevMode ? [{ debugName: "activeDescendant" }] : /* istanbul ignore next */ []));
|
|
123
111
|
this.affixClass = computed(() => {
|
|
124
|
-
|
|
125
|
-
return autoCompleteAffixContainerThemeVariants(theme)();
|
|
112
|
+
return autoCompleteAffixContainerThemeVariants();
|
|
126
113
|
}, /* @ts-ignore */
|
|
127
114
|
...(ngDevMode ? [{ debugName: "affixClass" }] : /* istanbul ignore next */ []));
|
|
128
115
|
this.autoCompleteValue = linkedSignal(() => this.value() ?? "", /* @ts-ignore */
|
|
129
116
|
...(ngDevMode ? [{ debugName: "autoCompleteValue" }] : /* istanbul ignore next */ []));
|
|
130
117
|
this.autoCompleteValue$ = new Subject();
|
|
131
118
|
this.baseClass = computed(() => {
|
|
132
|
-
const theme = this.#themeService.theme();
|
|
133
119
|
const disabled = this.disabled();
|
|
134
120
|
const expanded = this.expanded();
|
|
135
121
|
const focused = this.#popupRef() !== null;
|
|
136
122
|
const invalid = this.invalidState();
|
|
137
123
|
const rounded = this.rounded();
|
|
138
124
|
const size = this.size();
|
|
139
|
-
const variantClass = autoCompleteBaseThemeVariants(
|
|
125
|
+
const variantClass = autoCompleteBaseThemeVariants({
|
|
140
126
|
disabled,
|
|
141
127
|
expanded,
|
|
142
128
|
focused,
|
|
@@ -157,23 +143,21 @@ class AutoCompleteComponent {
|
|
|
157
143
|
this.headerTemplate = contentChild(DropdownHeaderTemplateDirective, { ...(ngDevMode ? { debugName: "headerTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
158
144
|
this.id = createElementControlId();
|
|
159
145
|
this.inputClass = computed(() => {
|
|
160
|
-
const theme = this.#themeService.theme();
|
|
161
146
|
const rounded = this.rounded();
|
|
162
|
-
return autoCompleteTextInputThemeVariants(
|
|
147
|
+
return autoCompleteTextInputThemeVariants({ rounded });
|
|
163
148
|
}, /* @ts-ignore */
|
|
164
149
|
...(ngDevMode ? [{ debugName: "inputClass" }] : /* istanbul ignore next */ []));
|
|
165
150
|
this.itemTemplate = contentChild(DropdownItemTemplateDirective, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
166
|
-
this.invalidState = computed(() => this.
|
|
151
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.value())), /* @ts-ignore */
|
|
167
152
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
168
153
|
this.isEmpty = computed(() => !this.#listService.viewItems().any(), /* @ts-ignore */
|
|
169
154
|
...(ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []));
|
|
170
155
|
this.listId = createElementControlId();
|
|
171
156
|
this.listPopupClass = computed(() => {
|
|
172
|
-
const theme = this.#themeService.theme();
|
|
173
157
|
const rounded = this.rounded();
|
|
174
158
|
const size = this.size();
|
|
175
159
|
const userClass = this.popupClass();
|
|
176
|
-
const variantClass = dropdownPopupThemeVariants(
|
|
160
|
+
const variantClass = dropdownPopupThemeVariants({ rounded, size });
|
|
177
161
|
return twMerge(variantClass, userClass);
|
|
178
162
|
}, /* @ts-ignore */
|
|
179
163
|
...(ngDevMode ? [{ debugName: "listPopupClass" }] : /* istanbul ignore next */ []));
|
|
@@ -521,7 +505,7 @@ class AutoCompleteComponent {
|
|
|
521
505
|
this.value.set(value);
|
|
522
506
|
}
|
|
523
507
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AutoCompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
524
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AutoCompleteComponent, isStandalone: true, selector: "mona-auto-complete", inputs: { 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 }, highlightFirst: { classPropertyName: "highlightFirst", publicName: "highlightFirst", 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", value: "valueChange" }, host: { properties: { "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-haspopup": "'listbox'", "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: [
|
|
508
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AutoCompleteComponent, isStandalone: true, selector: "mona-auto-complete", inputs: { 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 }, highlightFirst: { classPropertyName: "highlightFirst", publicName: "highlightFirst", 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", value: "valueChange" }, host: { properties: { "attr.aria-disabled": "disabled() ? true : undefined", "attr.aria-haspopup": "'listbox'", "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: [
|
|
525
509
|
ListService,
|
|
526
510
|
DropdownService,
|
|
527
511
|
{
|
|
@@ -534,7 +518,7 @@ class AutoCompleteComponent {
|
|
|
534
518
|
useExisting: forwardRef(() => AutoCompleteComponent),
|
|
535
519
|
multi: false
|
|
536
520
|
}
|
|
537
|
-
], 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: "suffixTemplate", first: true, predicate: DropdownSuffixTemplateDirective, 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 role=\"combobox\"\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"autoCompleteValue()\"\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 (ngModelChange)=\"autoCompleteValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && autoCompleteValue() && !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@if (suffixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n </span>\n}\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.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"] }] }); }
|
|
521
|
+
], 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: "suffixTemplate", first: true, predicate: DropdownSuffixTemplateDirective, 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 role=\"combobox\"\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"autoCompleteValue()\"\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 (ngModelChange)=\"autoCompleteValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && autoCompleteValue() && !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@if (suffixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n </span>\n}\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: ["invalid", "rounded", "size", "touched", "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.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"] }] }); }
|
|
538
522
|
}
|
|
539
523
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AutoCompleteComponent, decorators: [{
|
|
540
524
|
type: Component,
|
|
@@ -569,8 +553,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
569
553
|
"[attr.aria-invalid]": "invalidState() ? true : undefined",
|
|
570
554
|
"[attr.aria-readonly]": "readonly() ? true : undefined",
|
|
571
555
|
"[attr.aria-required]": "required() ? true : undefined",
|
|
572
|
-
"[attr.data-disabled]": "disabled()",
|
|
556
|
+
"[attr.data-disabled]": "disabled() || null",
|
|
573
557
|
"[attr.data-invalid]": "invalidState() || null",
|
|
558
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
574
559
|
"[attr.tabindex]": "-1",
|
|
575
560
|
"[class]": "baseClass()"
|
|
576
561
|
}, template: "@if (prefixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"prefixTemplate()\"></ng-container>\n </span>\n}\n\n<input\n monaTextBox\n role=\"combobox\"\n [class]=\"inputClass()\"\n [disabled]=\"disabled()\"\n [id]=\"id\"\n [placeholder]=\"placeholder()\"\n [readonly]=\"readonly()\"\n [rounded]=\"rounded()\"\n [size]=\"size()\"\n [ngModel]=\"autoCompleteValue()\"\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 (ngModelChange)=\"autoCompleteValue$.next($event)\"\n (blur)=\"onInputBlur()\" />\n\n@if (showClearButton() && autoCompleteValue() && !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@if (suffixTemplate()) {\n <span [class]=\"affixClass()\">\n <ng-container [ngTemplateOutlet]=\"suffixTemplate()\"></ng-container>\n </span>\n}\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" }]
|
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { computed, input, Directive, output, viewChild, TemplateRef, Component, contentChildren, contentChild } from '@angular/core';
|
|
4
4
|
import { LucideChevronRight } from '@lucide/angular';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
flex items-center
|
|
11
|
-
|
|
12
|
-
list-none select-none py-1 px-2
|
|
8
|
+
const breadcrumbListThemeVariants = cva(`
|
|
9
|
+
flex list-none items-center gap-1 overflow-hidden px-2 py-1
|
|
10
|
+
select-none
|
|
13
11
|
`, {
|
|
14
12
|
variants: {
|
|
15
13
|
disabled: {
|
|
16
|
-
true: "cursor-not-allowed
|
|
14
|
+
true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
|
|
17
15
|
false: ""
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
});
|
|
21
|
-
const
|
|
22
|
-
flex items-center
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
bg-transparent border-0
|
|
26
|
-
outline-none rounded-sm px-1
|
|
27
|
-
hover:text-primary
|
|
28
|
-
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40
|
|
19
|
+
const breadcrumbListItemThemeVariants = cva(`
|
|
20
|
+
flex h-full items-center truncate px-1
|
|
21
|
+
cursor-pointer
|
|
22
|
+
text-muted-foreground
|
|
23
|
+
bg-transparent border-0 rounded-sm outline-none
|
|
29
24
|
transition-colors duration-100 ease-in-out
|
|
25
|
+
hover:bg-hover hover:text-foreground
|
|
26
|
+
active:bg-active active:text-foreground
|
|
27
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
30
28
|
`, {
|
|
31
29
|
variants: {
|
|
32
30
|
disabled: {
|
|
33
|
-
true: "cursor-not-allowed
|
|
31
|
+
true: "pointer-events-none cursor-not-allowed text-disabled-foreground",
|
|
34
32
|
false: ""
|
|
35
33
|
},
|
|
36
34
|
listDisabled: {
|
|
@@ -38,48 +36,21 @@ const breadcrumbListItemVariants = cva(`
|
|
|
38
36
|
false: ""
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
|
-
compoundVariants: [{ disabled: true, listDisabled: false, class: "
|
|
39
|
+
compoundVariants: [{ disabled: true, listDisabled: false, class: "text-disabled-foreground" }],
|
|
42
40
|
defaultVariants: {
|
|
43
41
|
disabled: false,
|
|
44
42
|
listDisabled: false
|
|
45
43
|
}
|
|
46
44
|
});
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const breadcrumbListThemeVariants = (theme) => {
|
|
50
|
-
switch (theme) {
|
|
51
|
-
case "mona":
|
|
52
|
-
return breadcrumbListVariants;
|
|
53
|
-
default:
|
|
54
|
-
return breadcrumbListVariants;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const breadcrumbListItemThemeVariants = (theme) => {
|
|
58
|
-
switch (theme) {
|
|
59
|
-
case "mona":
|
|
60
|
-
return breadcrumbListItemVariants;
|
|
61
|
-
default:
|
|
62
|
-
return breadcrumbListItemVariants;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const breadcrumbCurrentItemThemeVariants = (theme) => {
|
|
66
|
-
switch (theme) {
|
|
67
|
-
case "mona":
|
|
68
|
-
return breadcrumbCurrentItemVariants;
|
|
69
|
-
default:
|
|
70
|
-
return breadcrumbCurrentItemVariants;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
45
|
+
const breadcrumbCurrentItemThemeVariants = cva(`flex cursor-default items-center truncate font-medium text-foreground`);
|
|
73
46
|
|
|
74
47
|
class BreadcrumbItemDirective {
|
|
75
48
|
constructor() {
|
|
76
|
-
this.#themeService = inject(ThemeService);
|
|
77
49
|
this.baseClass = computed(() => {
|
|
78
|
-
const theme = this.#themeService.theme();
|
|
79
50
|
const disabled = this.disabled();
|
|
80
51
|
const listDisabled = this.listDisabled();
|
|
81
52
|
const userClass = this.userClass();
|
|
82
|
-
return twMerge(breadcrumbListItemThemeVariants(
|
|
53
|
+
return twMerge(breadcrumbListItemThemeVariants({ disabled, listDisabled }), userClass);
|
|
83
54
|
}, /* @ts-ignore */
|
|
84
55
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
85
56
|
/**
|
|
@@ -100,7 +71,6 @@ class BreadcrumbItemDirective {
|
|
|
100
71
|
*/
|
|
101
72
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
102
73
|
}
|
|
103
|
-
#themeService;
|
|
104
74
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BreadcrumbItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
105
75
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BreadcrumbItemDirective, isStandalone: true, selector: "button[monaBreadcrumbItem]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, listDisabled: { classPropertyName: "listDisabled", publicName: "listDisabled", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "baseClass()", "disabled": "disabled()" } }, ngImport: i0 }); }
|
|
106
76
|
}
|
|
@@ -153,19 +123,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
153
123
|
|
|
154
124
|
class BreadcrumbComponent {
|
|
155
125
|
constructor() {
|
|
156
|
-
this.#themeService = inject(ThemeService);
|
|
157
126
|
this.itemComponents = contentChildren(BreadcrumbItemComponent, /* @ts-ignore */
|
|
158
127
|
...(ngDevMode ? [{ debugName: "itemComponents" }] : /* istanbul ignore next */ []));
|
|
159
128
|
this.currentItemClass = computed(() => {
|
|
160
|
-
|
|
161
|
-
return breadcrumbCurrentItemThemeVariants(theme)();
|
|
129
|
+
return breadcrumbCurrentItemThemeVariants();
|
|
162
130
|
}, /* @ts-ignore */
|
|
163
131
|
...(ngDevMode ? [{ debugName: "currentItemClass" }] : /* istanbul ignore next */ []));
|
|
164
132
|
this.listClass = computed(() => {
|
|
165
|
-
const theme = this.#themeService.theme();
|
|
166
133
|
const disabled = this.disabled();
|
|
167
134
|
const userClass = this.userClass();
|
|
168
|
-
const variantClass = breadcrumbListThemeVariants(
|
|
135
|
+
const variantClass = breadcrumbListThemeVariants({ disabled });
|
|
169
136
|
return twMerge(variantClass, userClass);
|
|
170
137
|
}, /* @ts-ignore */
|
|
171
138
|
...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
|
|
@@ -188,7 +155,6 @@ class BreadcrumbComponent {
|
|
|
188
155
|
*/
|
|
189
156
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
190
157
|
}
|
|
191
|
-
#themeService;
|
|
192
158
|
onItemClick(item) {
|
|
193
159
|
if (this.disabled() || item.disabled()) {
|
|
194
160
|
return;
|