@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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NgTemplateOutlet, DecimalPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { inject, TemplateRef, Directive, computed, contentChild, input, Component } from '@angular/core';
|
|
4
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
5
4
|
import { getPercentage } from '@nanahoshi/mona-ui/common';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
@@ -20,14 +19,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
20
19
|
}]
|
|
21
20
|
}] });
|
|
22
21
|
|
|
23
|
-
const
|
|
22
|
+
const progressBarBaseThemeVariants = cva(`
|
|
24
23
|
relative flex items-center justify-center
|
|
25
|
-
|
|
26
|
-
bg-input-background border border-input-border
|
|
24
|
+
h-5.5 w-full
|
|
27
25
|
overflow-hidden select-none
|
|
26
|
+
bg-surface-muted
|
|
28
27
|
data-[disabled='true']:pointer-events-none
|
|
29
28
|
data-[disabled='true']:cursor-not-allowed
|
|
30
|
-
data-[disabled='true']:
|
|
29
|
+
data-[disabled='true']:bg-disabled-background
|
|
30
|
+
data-[disabled='true']:text-disabled-foreground
|
|
31
|
+
data-[disabled='true']:[&_[data-prev='true']]:bg-disabled-foreground
|
|
31
32
|
`, {
|
|
32
33
|
variants: {
|
|
33
34
|
rounded: {
|
|
@@ -39,29 +40,26 @@ const progressBarBaseVariants = cva(`
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
|
-
const
|
|
43
|
-
absolute w-full
|
|
44
|
-
|
|
45
|
-
bg-[repeating-linear-gradient(135deg,var(--color-background),var(--color-background)_10px,var(--color-secondary)_10px,var(--color-secondary)_20px)]
|
|
43
|
+
const progressBarIndeterminateThemeVariants = cva(`
|
|
44
|
+
absolute flex h-full w-full items-center justify-center
|
|
45
|
+
bg-[repeating-linear-gradient(135deg,var(--color-surface-muted),var(--color-surface-muted)_10px,var(--color-primary)_10px,var(--color-primary)_20px)]
|
|
46
46
|
bg-size-[200%_200%]
|
|
47
47
|
`);
|
|
48
|
-
const
|
|
48
|
+
const progressBarLabelThemeVariants = cva(`
|
|
49
49
|
px-1.5
|
|
50
50
|
`);
|
|
51
|
-
const
|
|
52
|
-
relative
|
|
53
|
-
flex items-center justify-center
|
|
54
|
-
w-full h-full
|
|
51
|
+
const progressBarTrackThemeVariants = cva(`
|
|
52
|
+
relative flex h-full w-full items-center justify-center
|
|
55
53
|
text-xs font-medium
|
|
56
54
|
bg-primary text-primary-foreground
|
|
57
55
|
data-[prev='true']:transition-[background-color]
|
|
58
|
-
data-[prev='true']:duration-
|
|
56
|
+
data-[prev='true']:duration-(--mona-motion-fast)
|
|
59
57
|
data-[prev='true']:ease-in
|
|
60
58
|
data-[next='true']:absolute
|
|
61
|
-
data-[next='true']:bg-
|
|
59
|
+
data-[next='true']:bg-surface-muted
|
|
62
60
|
data-[next='true']:text-foreground
|
|
63
61
|
data-[next='true']:transition-[clip-path]
|
|
64
|
-
data-[next='true']:duration-
|
|
62
|
+
data-[next='true']:duration-(--mona-motion-fast)
|
|
65
63
|
data-[next='true']:ease-in
|
|
66
64
|
data-[value='0']:bg-transparent
|
|
67
65
|
data-[left='true']:justify-start
|
|
@@ -78,39 +76,6 @@ const progressBarTrackVariants = cva(`
|
|
|
78
76
|
}
|
|
79
77
|
});
|
|
80
78
|
|
|
81
|
-
const progressBarBaseThemeVariants = (theme) => {
|
|
82
|
-
switch (theme) {
|
|
83
|
-
case "mona":
|
|
84
|
-
return progressBarBaseVariants;
|
|
85
|
-
default:
|
|
86
|
-
return progressBarBaseVariants;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const progressBarIndeterminateThemeVariants = (theme) => {
|
|
90
|
-
switch (theme) {
|
|
91
|
-
case "mona":
|
|
92
|
-
return progressBarIndeterminateVariants;
|
|
93
|
-
default:
|
|
94
|
-
return progressBarIndeterminateVariants;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const progressBarLabelThemeVariants = (theme) => {
|
|
98
|
-
switch (theme) {
|
|
99
|
-
case "mona":
|
|
100
|
-
return progressBarLabelVariants;
|
|
101
|
-
default:
|
|
102
|
-
return progressBarLabelVariants;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const progressBarTrackThemeVariants = (theme) => {
|
|
106
|
-
switch (theme) {
|
|
107
|
-
case "mona":
|
|
108
|
-
return progressBarTrackVariants;
|
|
109
|
-
default:
|
|
110
|
-
return progressBarTrackVariants;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
79
|
class ProgressBarComponent {
|
|
115
80
|
constructor() {
|
|
116
81
|
this.#color = computed(() => {
|
|
@@ -119,23 +84,19 @@ class ProgressBarComponent {
|
|
|
119
84
|
return typeof color === "string" ? color : color?.(progress);
|
|
120
85
|
}, /* @ts-ignore */
|
|
121
86
|
...(ngDevMode ? [{ debugName: "#color" }] : /* istanbul ignore next */ []));
|
|
122
|
-
this.#themeService = inject(ThemeService);
|
|
123
87
|
this.baseClasses = computed(() => {
|
|
124
|
-
const theme = this.#themeService.theme();
|
|
125
88
|
const rounded = this.rounded();
|
|
126
|
-
const classes = progressBarBaseThemeVariants(
|
|
89
|
+
const classes = progressBarBaseThemeVariants({ rounded });
|
|
127
90
|
const userClass = this.userClass();
|
|
128
91
|
return twMerge(classes, userClass);
|
|
129
92
|
}, /* @ts-ignore */
|
|
130
93
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
131
94
|
this.indeterminateClasses = computed(() => {
|
|
132
|
-
|
|
133
|
-
return progressBarIndeterminateThemeVariants(theme)();
|
|
95
|
+
return progressBarIndeterminateThemeVariants();
|
|
134
96
|
}, /* @ts-ignore */
|
|
135
97
|
...(ngDevMode ? [{ debugName: "indeterminateClasses" }] : /* istanbul ignore next */ []));
|
|
136
98
|
this.labelClasses = computed(() => {
|
|
137
|
-
|
|
138
|
-
return progressBarLabelThemeVariants(theme)();
|
|
99
|
+
return progressBarLabelThemeVariants();
|
|
139
100
|
}, /* @ts-ignore */
|
|
140
101
|
...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
|
|
141
102
|
this.labelTemplate = contentChild(ProgressBarLabelTemplateDirective, /* @ts-ignore */
|
|
@@ -158,9 +119,8 @@ class ProgressBarComponent {
|
|
|
158
119
|
this.progress = computed(() => getPercentage(this.value(), this.min(), this.max()), /* @ts-ignore */
|
|
159
120
|
...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
160
121
|
this.trackClasses = computed(() => {
|
|
161
|
-
const theme = this.#themeService.theme();
|
|
162
122
|
const rounded = this.rounded();
|
|
163
|
-
const classes = progressBarTrackThemeVariants(
|
|
123
|
+
const classes = progressBarTrackThemeVariants({ rounded });
|
|
164
124
|
return this.animate()
|
|
165
125
|
? classes
|
|
166
126
|
: twMerge(classes, "data-[next='true']:transition-none data-[prev='true']:transition-none");
|
|
@@ -262,9 +222,8 @@ class ProgressBarComponent {
|
|
|
262
222
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
263
223
|
}
|
|
264
224
|
#color;
|
|
265
|
-
#themeService;
|
|
266
225
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
267
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ProgressBarComponent, isStandalone: true, selector: "mona-progress-bar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelStyles: { classPropertyName: "labelStyles", publicName: "labelStyles", isSignal: true, isRequired: false, transformFunction: null }, labelVisible: { classPropertyName: "labelVisible", publicName: "labelVisible", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "class": "baseClasses()", "attr.aria-busy": "indeterminate() || null", "attr.aria-label": "ariaLabel() || null", "attr.aria-valuemin": "indeterminate() ? null : min()", "attr.aria-valuemax": "indeterminate() ? null : max()", "attr.aria-valuenow": "indeterminate() ? null : value()", "attr.aria-valuetext": "ariaValueText() || null", "attr.aria-disabled": "disabled() || null", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "labelTemplate", first: true, predicate: ProgressBarLabelTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\
|
|
226
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ProgressBarComponent, isStandalone: true, selector: "mona-progress-bar", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", isSignal: true, isRequired: false, transformFunction: null }, animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelStyles: { classPropertyName: "labelStyles", publicName: "labelStyles", isSignal: true, isRequired: false, transformFunction: null }, labelVisible: { classPropertyName: "labelVisible", publicName: "labelVisible", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "progressbar" }, properties: { "class": "baseClasses()", "attr.aria-busy": "indeterminate() || null", "attr.aria-label": "ariaLabel() || null", "attr.aria-valuemin": "indeterminate() ? null : min()", "attr.aria-valuemax": "indeterminate() ? null : max()", "attr.aria-valuenow": "indeterminate() ? null : value()", "attr.aria-valuetext": "ariaValueText() || null", "attr.aria-disabled": "disabled() || null", "attr.data-disabled": "disabled()" } }, queries: [{ propertyName: "labelTemplate", first: true, predicate: ProgressBarLabelTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"trackClasses()\"\n [style.background-color]=\"trackColor()\"\n [attr.data-prev]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [attr.data-indeterminate]=\"indeterminate()\"\n [attr.data-value]=\"progress()\"\n [style.clip-path]=\"prevTrackClipPath()\">\n @if (indeterminate()) {\n <div [class]=\"indeterminateClasses()\" class=\"indeterminate\"></div>\n } @else if (labelVisible()) {\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), min: min(), max: max(), percent: progress() }\">\n </ng-container>\n } @else {\n <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n</div>\n\n@if (!indeterminate()) {\n <div\n [class]=\"trackClasses()\"\n [attr.data-next]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [style.clip-path]=\"nextTrackClipPath()\">\n @if (labelVisible()) {\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), min: min(), max: max(), percent: progress() }\">\n </ng-container>\n } @else {\n <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n </div>\n}\n", styles: [".indeterminate{animation:indeterminate 16s linear infinite}@keyframes indeterminate{0%{background-position:0 0}to{background-position:100% 0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: DecimalPipe, name: "number" }] }); }
|
|
268
227
|
}
|
|
269
228
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
270
229
|
type: Component,
|
|
@@ -279,7 +238,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
279
238
|
"[attr.aria-disabled]": "disabled() || null",
|
|
280
239
|
"[attr.data-disabled]": "disabled()",
|
|
281
240
|
role: "progressbar"
|
|
282
|
-
}, template: "<div\
|
|
241
|
+
}, template: "<div\n [class]=\"trackClasses()\"\n [style.background-color]=\"trackColor()\"\n [attr.data-prev]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [attr.data-indeterminate]=\"indeterminate()\"\n [attr.data-value]=\"progress()\"\n [style.clip-path]=\"prevTrackClipPath()\">\n @if (indeterminate()) {\n <div [class]=\"indeterminateClasses()\" class=\"indeterminate\"></div>\n } @else if (labelVisible()) {\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), min: min(), max: max(), percent: progress() }\">\n </ng-container>\n } @else {\n <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n</div>\n\n@if (!indeterminate()) {\n <div\n [class]=\"trackClasses()\"\n [attr.data-next]=\"true\"\n [attr.data-left]=\"labelPosition() === 'start'\"\n [attr.data-right]=\"labelPosition() === 'end'\"\n [style.clip-path]=\"nextTrackClipPath()\">\n @if (labelVisible()) {\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()?.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: value(), min: min(), max: max(), percent: progress() }\">\n </ng-container>\n } @else {\n <span [class]=\"labelClasses()\" [style]=\"labelStyles()\">{{ progress() | number: \"1.0-2\" }}</span>\n }\n }\n </div>\n}\n", styles: [".indeterminate{animation:indeterminate 16s linear infinite}@keyframes indeterminate{0%{background-position:0 0}to{background-position:100% 0}}\n"] }]
|
|
283
242
|
}], propDecorators: { labelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ProgressBarLabelTemplateDirective), { isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaValueText: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-valuetext", required: false }] }], animate: [{ type: i0.Input, args: [{ isSignal: true, alias: "animate", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelStyles", required: false }] }], labelVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelVisible", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
|
|
284
243
|
|
|
285
244
|
/*
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { computed, input, output, model, Component, Directive } from '@angular/core';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
7
|
+
import { themeControlSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
disabled:cursor-not-allowed
|
|
9
|
+
const radioButtonThemeVariants = cva(`
|
|
10
|
+
peer absolute inset-0 z-10 h-full w-full
|
|
11
|
+
cursor-pointer appearance-none opacity-0
|
|
12
|
+
outline-none
|
|
13
|
+
disabled:cursor-not-allowed
|
|
15
14
|
`);
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
peer-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
data-[invalid='true']:
|
|
15
|
+
const radioButtonCircleThemeVariants = cva(`
|
|
16
|
+
relative flex h-4.5 w-4.5 items-center justify-center
|
|
17
|
+
cursor-pointer overflow-hidden
|
|
18
|
+
${themeControlSurfaceClasses}
|
|
19
|
+
border border-input-border
|
|
20
|
+
transition-colors duration-(--mona-motion-fast)
|
|
21
|
+
|
|
22
|
+
peer-disabled:cursor-not-allowed
|
|
23
|
+
peer-disabled:border-disabled-border peer-disabled:bg-disabled-background peer-disabled:text-disabled-foreground
|
|
24
|
+
|
|
25
|
+
peer-focus-visible:border-focus-indicator
|
|
26
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-focus-indicator/35
|
|
27
|
+
|
|
28
|
+
data-[invalid='true']:border-error
|
|
29
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
30
|
+
data-[invalid='true']:peer-focus-visible:border-error
|
|
31
|
+
data-[invalid='true']:peer-focus-visible:ring-error/35
|
|
30
32
|
`, {
|
|
31
33
|
variants: {
|
|
32
34
|
rounded: {
|
|
@@ -38,8 +40,10 @@ const radioButtonCircleVariants = cva(`
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
});
|
|
41
|
-
const
|
|
42
|
-
flex
|
|
43
|
+
const radioButtonIndicatorThemeVariants = cva(`
|
|
44
|
+
flex h-3 w-3
|
|
45
|
+
bg-primary
|
|
46
|
+
transition-all duration-(--mona-motion-fast)
|
|
43
47
|
`, {
|
|
44
48
|
variants: {
|
|
45
49
|
rounded: {
|
|
@@ -51,13 +55,12 @@ const radioButtonIndicatorVariants = cva(`
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
data-[disabled='true']:
|
|
59
|
-
data-[disabled='true']:
|
|
60
|
-
data-[disabled='true']:opacity-50
|
|
58
|
+
const radioButtonContainerLabelThemeVariants = cva(`
|
|
59
|
+
relative flex h-full w-full items-center justify-center gap-1
|
|
60
|
+
cursor-pointer
|
|
61
|
+
data-[disabled='true']:pointer-events-none
|
|
62
|
+
data-[disabled='true']:cursor-not-allowed
|
|
63
|
+
data-[disabled='true']:text-disabled-foreground
|
|
61
64
|
`, {
|
|
62
65
|
variants: {
|
|
63
66
|
labelSize: {
|
|
@@ -70,30 +73,31 @@ const radioButtonContainerLabelVariants = cva(`
|
|
|
70
73
|
labelSize: "medium"
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
after:content-['']
|
|
87
|
-
|
|
88
|
-
after:
|
|
89
|
-
after:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
76
|
+
const radioButtonDirectiveThemeVariants = cva(`
|
|
77
|
+
relative flex h-4.5 w-4.5 items-center justify-center place-content-center
|
|
78
|
+
cursor-pointer appearance-none
|
|
79
|
+
${themeControlSurfaceClasses}
|
|
80
|
+
border border-input-border
|
|
81
|
+
outline-none
|
|
82
|
+
|
|
83
|
+
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
84
|
+
disabled:border-disabled-border disabled:bg-disabled-background disabled:text-disabled-foreground
|
|
85
|
+
|
|
86
|
+
after:inline-grid
|
|
87
|
+
after:h-3 after:w-3
|
|
88
|
+
after:place-content-center
|
|
89
|
+
after:content-['']
|
|
90
|
+
|
|
91
|
+
checked:after:bg-primary
|
|
92
|
+
checked:after:rounded-full
|
|
93
|
+
|
|
94
|
+
focus-visible:border-focus-indicator
|
|
95
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
96
|
+
|
|
97
|
+
[&.ng-touched.ng-invalid]:border-error
|
|
98
|
+
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
99
|
+
[&.ng-touched.ng-invalid]:focus-visible:border-error
|
|
100
|
+
[&.ng-touched.ng-invalid]:focus-visible:ring-error/35
|
|
97
101
|
`, {
|
|
98
102
|
variants: {
|
|
99
103
|
rounded: {
|
|
@@ -128,70 +132,25 @@ const radioButtonDirectiveVariants = cva(`
|
|
|
128
132
|
]
|
|
129
133
|
});
|
|
130
134
|
|
|
131
|
-
const radioButtonThemeVariants = (theme) => {
|
|
132
|
-
switch (theme) {
|
|
133
|
-
case "mona":
|
|
134
|
-
return radioButtonVariants;
|
|
135
|
-
default:
|
|
136
|
-
return radioButtonVariants; // Default to Mona styles
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const radioButtonCircleThemeVariants = (theme) => {
|
|
140
|
-
switch (theme) {
|
|
141
|
-
case "mona":
|
|
142
|
-
return radioButtonCircleVariants;
|
|
143
|
-
default:
|
|
144
|
-
return radioButtonCircleVariants; // Default to Mona styles
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
const radioButtonIndicatorThemeVariants = (theme) => {
|
|
148
|
-
switch (theme) {
|
|
149
|
-
case "mona":
|
|
150
|
-
return radioButtonIndicatorVariants;
|
|
151
|
-
default:
|
|
152
|
-
return radioButtonIndicatorVariants; // Default to Mona styles
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
const radioButtonContainerLabelThemeVariants = (theme) => {
|
|
156
|
-
switch (theme) {
|
|
157
|
-
case "mona":
|
|
158
|
-
return radioButtonContainerLabelVariants;
|
|
159
|
-
default:
|
|
160
|
-
return radioButtonContainerLabelVariants; // Default to Mona styles
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
const radioButtonDirectiveThemeVariants = (theme) => {
|
|
164
|
-
switch (theme) {
|
|
165
|
-
case "mona":
|
|
166
|
-
return radioButtonDirectiveVariants;
|
|
167
|
-
default:
|
|
168
|
-
return radioButtonDirectiveVariants; // Default to Mona styles
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
|
|
172
135
|
class RadioButtonComponent {
|
|
173
136
|
constructor() {
|
|
174
|
-
this.#themeService = inject(ThemeService);
|
|
175
137
|
this.containerLabelClasses = computed(() => {
|
|
176
|
-
const theme = this.#themeService.theme();
|
|
177
138
|
const labelSize = this.labelSize();
|
|
178
139
|
const userClasses = this.userClass();
|
|
179
|
-
const variantClasses = radioButtonContainerLabelThemeVariants(
|
|
140
|
+
const variantClasses = radioButtonContainerLabelThemeVariants({ labelSize });
|
|
180
141
|
return twMerge(variantClasses, userClasses);
|
|
181
142
|
}, /* @ts-ignore */
|
|
182
143
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
183
144
|
this.radioButtonCircleClasses = computed(() => {
|
|
184
|
-
const theme = this.#themeService.theme();
|
|
185
145
|
const rounded = this.rounded();
|
|
186
|
-
return radioButtonCircleThemeVariants(
|
|
146
|
+
return radioButtonCircleThemeVariants({ rounded });
|
|
187
147
|
}, /* @ts-ignore */
|
|
188
148
|
...(ngDevMode ? [{ debugName: "radioButtonCircleClasses" }] : /* istanbul ignore next */ []));
|
|
189
|
-
this.radioButtonClasses = computed(() => radioButtonThemeVariants(
|
|
149
|
+
this.radioButtonClasses = computed(() => radioButtonThemeVariants(), /* @ts-ignore */
|
|
190
150
|
...(ngDevMode ? [{ debugName: "radioButtonClasses" }] : /* istanbul ignore next */ []));
|
|
191
151
|
this.radioButtonIndicatorClasses = computed(() => {
|
|
192
|
-
const theme = this.#themeService.theme();
|
|
193
152
|
const rounded = this.rounded();
|
|
194
|
-
return radioButtonIndicatorThemeVariants(
|
|
153
|
+
return radioButtonIndicatorThemeVariants({ rounded });
|
|
195
154
|
}, /* @ts-ignore */
|
|
196
155
|
...(ngDevMode ? [{ debugName: "radioButtonIndicatorClasses" }] : /* istanbul ignore next */ []));
|
|
197
156
|
/**
|
|
@@ -276,7 +235,6 @@ class RadioButtonComponent {
|
|
|
276
235
|
this.value = model(undefined, /* @ts-ignore */
|
|
277
236
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
278
237
|
}
|
|
279
|
-
#themeService;
|
|
280
238
|
onBlur(event) {
|
|
281
239
|
this.inputBlur.emit(event);
|
|
282
240
|
this.touch.emit();
|
|
@@ -286,23 +244,21 @@ class RadioButtonComponent {
|
|
|
286
244
|
this.touch.emit();
|
|
287
245
|
}
|
|
288
246
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
289
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RadioButtonComponent, isStandalone: true, selector: "mona-radio-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputClick: "inputClick", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-selected": "radioValue()===value()", "attr.data-disabled": "disabled()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\
|
|
247
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RadioButtonComponent, isStandalone: true, selector: "mona-radio-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputBlur: "inputBlur", inputClick: "inputClick", inputFocus: "inputFocus", touch: "touch", value: "valueChange" }, host: { properties: { "attr.data-selected": "radioValue()===value()", "attr.data-disabled": "disabled()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n (blur)=\"onBlur($event)\"\n (click)=\"inputClick.emit($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalid() || null\">\n @if (radioValue() === value()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
290
248
|
}
|
|
291
249
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonComponent, decorators: [{
|
|
292
250
|
type: Component,
|
|
293
251
|
args: [{ selector: "mona-radio-button", imports: [FormsModule, NgTemplateOutlet], host: {
|
|
294
252
|
"[attr.data-selected]": "radioValue()===value()",
|
|
295
253
|
"[attr.data-disabled]": "disabled()"
|
|
296
|
-
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\
|
|
254
|
+
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n <input\n type=\"radio\"\n [disabled]=\"disabled()\"\n [name]=\"name()\"\n [value]=\"radioValue()\"\n [class]=\"radioButtonClasses()\"\n [checked]=\"radioValue() === value()\"\n [attr.aria-invalid]=\"invalid() ? 'true' : null\"\n (blur)=\"onBlur($event)\"\n (click)=\"inputClick.emit($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (change)=\"onSelectionChange()\" />\n <span [class]=\"radioButtonCircleClasses()\" [attr.data-invalid]=\"invalid() || null\">\n @if (radioValue() === value()) {\n <span [class]=\"radioButtonIndicatorClasses()\"></span>\n }\n </span>\n @if (labelPosition() === \"after\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n</label>\n\n<ng-template #labelTemplate>\n @if (label()) {\n <span>{{ label() }}</span>\n } @else {\n <ng-content></ng-content>\n }\n</ng-template>\n" }]
|
|
297
255
|
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputClick: [{ type: i0.Output, args: ["inputClick"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSize", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], radioValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "radioValue", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
298
256
|
|
|
299
257
|
class RadioButtonDirective {
|
|
300
258
|
constructor() {
|
|
301
|
-
this.#themeService = inject(ThemeService);
|
|
302
259
|
this.classes = computed(() => {
|
|
303
|
-
const theme = this.#themeService.theme();
|
|
304
260
|
const rounded = this.rounded();
|
|
305
|
-
return radioButtonDirectiveThemeVariants(
|
|
261
|
+
return radioButtonDirectiveThemeVariants({ rounded });
|
|
306
262
|
}, /* @ts-ignore */
|
|
307
263
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
308
264
|
/**
|
|
@@ -312,7 +268,6 @@ class RadioButtonDirective {
|
|
|
312
268
|
this.rounded = input("none", /* @ts-ignore */
|
|
313
269
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
314
270
|
}
|
|
315
|
-
#themeService;
|
|
316
271
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RadioButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
317
272
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: RadioButtonDirective, isStandalone: true, selector: "input[type='radio'][monaRadioButton]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()", "attr.role": "'radio'" } }, ngImport: i0 }); }
|
|
318
273
|
}
|