@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
|
@@ -4,7 +4,6 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { select } from '@mirei/ts-collections';
|
|
6
6
|
import { fromEvent } from 'rxjs';
|
|
7
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
8
7
|
import { cva } from 'class-variance-authority';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -53,12 +52,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
53
52
|
}]
|
|
54
53
|
}] });
|
|
55
54
|
|
|
56
|
-
const
|
|
57
|
-
relative grid outline-none
|
|
55
|
+
const stepperBaseThemeVariants = cva(`
|
|
56
|
+
relative grid outline-none
|
|
58
57
|
`, {
|
|
59
58
|
variants: {
|
|
60
59
|
orientation: {
|
|
61
|
-
horizontal: "w-full
|
|
60
|
+
horizontal: "h-auto w-full",
|
|
62
61
|
vertical: "h-full w-auto"
|
|
63
62
|
}
|
|
64
63
|
},
|
|
@@ -66,19 +65,19 @@ const stepperBaseVariants = cva(`
|
|
|
66
65
|
orientation: "horizontal"
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
|
-
const
|
|
70
|
-
absolute
|
|
71
|
-
font-medium
|
|
68
|
+
const stepperStepListThemeVariants = cva(`
|
|
69
|
+
absolute z-1 col-span-full flex list-none
|
|
70
|
+
font-medium
|
|
72
71
|
`, {
|
|
73
72
|
variants: {
|
|
74
73
|
orientation: {
|
|
75
|
-
horizontal: `
|
|
76
|
-
flex-row
|
|
77
|
-
-translate-y-3
|
|
74
|
+
horizontal: `
|
|
75
|
+
w-full flex-row
|
|
76
|
+
-translate-y-3
|
|
78
77
|
`,
|
|
79
|
-
vertical: `
|
|
80
|
-
|
|
81
|
-
-translate-x-3
|
|
78
|
+
vertical: `
|
|
79
|
+
h-full w-max flex-col
|
|
80
|
+
-translate-x-3
|
|
82
81
|
`
|
|
83
82
|
}
|
|
84
83
|
},
|
|
@@ -86,35 +85,31 @@ const stepperStepListVariants = cva(`
|
|
|
86
85
|
orientation: "horizontal"
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
|
-
const
|
|
90
|
-
flex items-center
|
|
91
|
-
grow-1 shrink-0 basis-auto
|
|
92
|
-
z-1
|
|
88
|
+
const stepperStepListItemThemeVariants = cva(`
|
|
89
|
+
z-1 flex grow-1 shrink-0 basis-auto items-center
|
|
93
90
|
`, {
|
|
94
91
|
variants: {
|
|
95
92
|
orientation: {
|
|
96
93
|
horizontal: "flex-col gap-2",
|
|
97
|
-
vertical: "flex-row gap-2
|
|
94
|
+
vertical: "flex-row justify-start gap-2"
|
|
98
95
|
}
|
|
99
96
|
},
|
|
100
97
|
defaultVariants: {
|
|
101
98
|
orientation: "horizontal"
|
|
102
99
|
}
|
|
103
100
|
});
|
|
104
|
-
const
|
|
105
|
-
w-8
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
text-foreground outline-none
|
|
109
|
-
transition-colors duration-400 ease-in-out
|
|
101
|
+
const stepperStepIndicatorThemeVariants = cva(`
|
|
102
|
+
flex h-8 w-8 items-center justify-center
|
|
103
|
+
border border-border outline-none
|
|
104
|
+
transition-colors duration-400 ease-in-out
|
|
110
105
|
`, {
|
|
111
106
|
variants: {
|
|
112
107
|
active: {
|
|
113
108
|
true: "bg-primary text-primary-foreground",
|
|
114
|
-
false: ""
|
|
109
|
+
false: "bg-surface-raised text-foreground"
|
|
115
110
|
},
|
|
116
111
|
focused: {
|
|
117
|
-
true: "ring-2 ring-
|
|
112
|
+
true: "border-focus-indicator ring-2 ring-focus-indicator/35",
|
|
118
113
|
false: ""
|
|
119
114
|
},
|
|
120
115
|
rounded: {
|
|
@@ -126,13 +121,14 @@ const stepperStepIndicatorVariants = cva(`
|
|
|
126
121
|
}
|
|
127
122
|
}
|
|
128
123
|
});
|
|
129
|
-
const
|
|
130
|
-
relative grid
|
|
131
|
-
bg-
|
|
124
|
+
const stepperTrackThemeVariants = cva(`
|
|
125
|
+
relative grid
|
|
126
|
+
bg-surface-muted text-foreground
|
|
127
|
+
border border-border-subtle
|
|
132
128
|
`, {
|
|
133
129
|
variants: {
|
|
134
130
|
orientation: {
|
|
135
|
-
horizontal: "w-full
|
|
131
|
+
horizontal: "h-2 w-full",
|
|
136
132
|
vertical: "h-full w-2"
|
|
137
133
|
}
|
|
138
134
|
},
|
|
@@ -140,13 +136,13 @@ const stepperTrackVariants = cva(`
|
|
|
140
136
|
orientation: "horizontal"
|
|
141
137
|
}
|
|
142
138
|
});
|
|
143
|
-
const
|
|
144
|
-
absolute bg-primary
|
|
139
|
+
const stepperTrackLineThemeVariants = cva(`
|
|
140
|
+
absolute bg-primary
|
|
145
141
|
`, {
|
|
146
142
|
variants: {
|
|
147
143
|
orientation: {
|
|
148
|
-
horizontal: "h-full transition-width duration-
|
|
149
|
-
vertical: "w-full transition-height duration-
|
|
144
|
+
horizontal: "h-full transition-width duration-(--mona-motion-standard) ease-out",
|
|
145
|
+
vertical: "w-full transition-height duration-(--mona-motion-standard) ease-out"
|
|
150
146
|
}
|
|
151
147
|
},
|
|
152
148
|
defaultVariants: {
|
|
@@ -154,69 +150,17 @@ const stepperTrackLineVariants = cva(`
|
|
|
154
150
|
}
|
|
155
151
|
});
|
|
156
152
|
|
|
157
|
-
const stepperBaseThemeVariants = (theme) => {
|
|
158
|
-
switch (theme) {
|
|
159
|
-
case "mona":
|
|
160
|
-
return stepperBaseVariants;
|
|
161
|
-
default:
|
|
162
|
-
return stepperBaseVariants;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
const stepperStepListThemeVariants = (theme) => {
|
|
166
|
-
switch (theme) {
|
|
167
|
-
case "mona":
|
|
168
|
-
return stepperStepListVariants;
|
|
169
|
-
default:
|
|
170
|
-
return stepperStepListVariants;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
const stepperStepListItemThemeVariants = (theme) => {
|
|
174
|
-
switch (theme) {
|
|
175
|
-
case "mona":
|
|
176
|
-
return stepperStepListItemVariants;
|
|
177
|
-
default:
|
|
178
|
-
return stepperStepListItemVariants;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const stepperStepIndicatorThemeVariants = (theme) => {
|
|
182
|
-
switch (theme) {
|
|
183
|
-
case "mona":
|
|
184
|
-
return stepperStepIndicatorVariants;
|
|
185
|
-
default:
|
|
186
|
-
return stepperStepIndicatorVariants;
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
const stepperTrackThemeVariants = (theme) => {
|
|
190
|
-
switch (theme) {
|
|
191
|
-
case "mona":
|
|
192
|
-
return stepperTrackVariants;
|
|
193
|
-
default:
|
|
194
|
-
return stepperTrackVariants;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
const stepperTrackLineThemeVariants = (theme) => {
|
|
198
|
-
switch (theme) {
|
|
199
|
-
case "mona":
|
|
200
|
-
return stepperTrackLineVariants;
|
|
201
|
-
default:
|
|
202
|
-
return stepperTrackLineVariants;
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
|
|
206
153
|
class StepperIndicatorDirective {
|
|
207
154
|
#wasFocused;
|
|
208
155
|
#host;
|
|
209
|
-
#themeService;
|
|
210
156
|
constructor() {
|
|
211
157
|
this.#wasFocused = false;
|
|
212
158
|
this.#host = inject(ElementRef);
|
|
213
|
-
this.#themeService = inject(ThemeService);
|
|
214
159
|
this.stepIndicatorClass = computed(() => {
|
|
215
|
-
const theme = this.#themeService.theme();
|
|
216
160
|
const active = this.active();
|
|
217
161
|
const focused = this.focused();
|
|
218
162
|
const rounded = this.rounded();
|
|
219
|
-
return stepperStepIndicatorThemeVariants(
|
|
163
|
+
return stepperStepIndicatorThemeVariants({ active, focused, rounded });
|
|
220
164
|
}, /* @ts-ignore */
|
|
221
165
|
...(ngDevMode ? [{ debugName: "stepIndicatorClass" }] : /* istanbul ignore next */ []));
|
|
222
166
|
this.active = input.required(/* @ts-ignore */
|
|
@@ -251,13 +195,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
251
195
|
class StepperComponent {
|
|
252
196
|
#destroyRef;
|
|
253
197
|
#hostElementRef;
|
|
254
|
-
#themeService;
|
|
255
198
|
#trackItemSize;
|
|
256
199
|
#trackLength;
|
|
257
200
|
constructor() {
|
|
258
201
|
this.#destroyRef = inject(DestroyRef);
|
|
259
202
|
this.#hostElementRef = inject(ElementRef);
|
|
260
|
-
this.#themeService = inject(ThemeService);
|
|
261
203
|
this.#trackItemSize = computed(() => {
|
|
262
204
|
const stepCount = this.viewSteps().length;
|
|
263
205
|
return stepCount !== 0 ? 100 / stepCount : 0;
|
|
@@ -280,9 +222,8 @@ class StepperComponent {
|
|
|
280
222
|
}, /* @ts-ignore */
|
|
281
223
|
...(ngDevMode ? [{ debugName: "activeStep" }] : /* istanbul ignore next */ []));
|
|
282
224
|
this.baseClass = computed(() => {
|
|
283
|
-
const theme = this.#themeService.theme();
|
|
284
225
|
const orientation = this.orientation();
|
|
285
|
-
return stepperBaseThemeVariants(
|
|
226
|
+
return stepperBaseThemeVariants({ orientation });
|
|
286
227
|
}, /* @ts-ignore */
|
|
287
228
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
288
229
|
this.highlightedStep = signal(0, /* @ts-ignore */
|
|
@@ -301,15 +242,13 @@ class StepperComponent {
|
|
|
301
242
|
});
|
|
302
243
|
this.labelTemplate = contentChild(StepperLabelTemplateDirective, { read: TemplateRef });
|
|
303
244
|
this.listClass = computed(() => {
|
|
304
|
-
const theme = this.#themeService.theme();
|
|
305
245
|
const orientation = this.orientation();
|
|
306
|
-
return stepperStepListThemeVariants(
|
|
246
|
+
return stepperStepListThemeVariants({ orientation });
|
|
307
247
|
}, /* @ts-ignore */
|
|
308
248
|
...(ngDevMode ? [{ debugName: "listClass" }] : /* istanbul ignore next */ []));
|
|
309
249
|
this.listItemClass = computed(() => {
|
|
310
|
-
const theme = this.#themeService.theme();
|
|
311
250
|
const orientation = this.orientation();
|
|
312
|
-
return stepperStepListItemThemeVariants(
|
|
251
|
+
return stepperStepListItemThemeVariants({ orientation });
|
|
313
252
|
}, /* @ts-ignore */
|
|
314
253
|
...(ngDevMode ? [{ debugName: "listItemClass" }] : /* istanbul ignore next */ []));
|
|
315
254
|
this.progressMax = computed(() => Math.max(this.viewSteps().length - 1, 0), /* @ts-ignore */
|
|
@@ -318,9 +257,8 @@ class StepperComponent {
|
|
|
318
257
|
read: TemplateRef
|
|
319
258
|
});
|
|
320
259
|
this.trackClass = computed(() => {
|
|
321
|
-
const theme = this.#themeService.theme();
|
|
322
260
|
const orientation = this.orientation();
|
|
323
|
-
return stepperTrackThemeVariants(
|
|
261
|
+
return stepperTrackThemeVariants({ orientation });
|
|
324
262
|
}, /* @ts-ignore */
|
|
325
263
|
...(ngDevMode ? [{ debugName: "trackClass" }] : /* istanbul ignore next */ []));
|
|
326
264
|
this.trackInnerStyles = computed(() => {
|
|
@@ -340,9 +278,8 @@ class StepperComponent {
|
|
|
340
278
|
}, /* @ts-ignore */
|
|
341
279
|
...(ngDevMode ? [{ debugName: "trackItemStyles" }] : /* istanbul ignore next */ []));
|
|
342
280
|
this.trackLineClass = computed(() => {
|
|
343
|
-
const theme = this.#themeService.theme();
|
|
344
281
|
const orientation = this.orientation();
|
|
345
|
-
return stepperTrackLineThemeVariants(
|
|
282
|
+
return stepperTrackLineThemeVariants({ orientation });
|
|
346
283
|
}, /* @ts-ignore */
|
|
347
284
|
...(ngDevMode ? [{ debugName: "trackLineClass" }] : /* istanbul ignore next */ []));
|
|
348
285
|
this.trackStyles = computed(() => {
|
|
@@ -509,7 +446,7 @@ class StepperComponent {
|
|
|
509
446
|
});
|
|
510
447
|
}
|
|
511
448
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
512
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: StepperComponent, isStandalone: true, selector: "mona-stepper", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, progressAriaLabel: { classPropertyName: "progressAriaLabel", publicName: "progressAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { step: "stepChange" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class": "baseClass()", "style": "hostStyles()" } }, queries: [{ propertyName: "indicatorTemplate", first: true, predicate: StepperIndicatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: StepperLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "stepTemplate", first: true, predicate: StepperStepTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol [class]=\"listClass()\">\
|
|
449
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: StepperComponent, isStandalone: true, selector: "mona-stepper", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, progressAriaLabel: { classPropertyName: "progressAriaLabel", publicName: "progressAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { step: "stepChange" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class": "baseClass()", "style": "hostStyles()" } }, queries: [{ propertyName: "indicatorTemplate", first: true, predicate: StepperIndicatorTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "labelTemplate", first: true, predicate: StepperLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "stepTemplate", first: true, predicate: StepperStepTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<ol [class]=\"listClass()\">\n @for (step of viewSteps(); track step.index) {\n @let active = isStepActive(step);\n @let locked = isStepLocked(step);\n @let focused = step.index === highlightedStep();\n @let options = step.options;\n @let index = step.index;\n @let currentIndex = activeStep()?.index ?? -1;\n @let disabled = !!options.disabled;\n <li\n [class]=\"listItemClass()\"\n [class.cursor-pointer]=\"!locked\"\n [class.cursor-not-allowed]=\"locked\"\n [style]=\"trackItemStyles()\"\n role=\"presentation\"\n (click)=\"onStepClick(step)\">\n @if (stepTemplate()) {\n <span\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n </span>\n } @else {\n <span\n monaStepperIndicator\n [rounded]=\"rounded()\"\n [active]=\"active\"\n [focused]=\"focused\"\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n @if (indicatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"indicatorTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n {{ step.index + 1 }}\n }\n </span>\n }\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n <span aria-hidden=\"true\">{{ options.label }}</span>\n }\n </li>\n }\n</ol>\n<div\n [class]=\"trackClass()\"\n [style]=\"trackStyles()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"step()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"progressMax()\"\n [attr.aria-label]=\"progressAriaLabel()\">\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: StepperIndicatorDirective, selector: "span[monaStepperIndicator]", inputs: ["active", "focused", "rounded"] }] }); }
|
|
513
450
|
}
|
|
514
451
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StepperComponent, decorators: [{
|
|
515
452
|
type: Component,
|
|
@@ -518,7 +455,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
518
455
|
"[attr.aria-label]": "ariaLabel()",
|
|
519
456
|
"[class]": "baseClass()",
|
|
520
457
|
"[style]": "hostStyles()"
|
|
521
|
-
}, template: "<ol [class]=\"listClass()\">\
|
|
458
|
+
}, template: "<ol [class]=\"listClass()\">\n @for (step of viewSteps(); track step.index) {\n @let active = isStepActive(step);\n @let locked = isStepLocked(step);\n @let focused = step.index === highlightedStep();\n @let options = step.options;\n @let index = step.index;\n @let currentIndex = activeStep()?.index ?? -1;\n @let disabled = !!options.disabled;\n <li\n [class]=\"listItemClass()\"\n [class.cursor-pointer]=\"!locked\"\n [class.cursor-not-allowed]=\"locked\"\n [style]=\"trackItemStyles()\"\n role=\"presentation\"\n (click)=\"onStepClick(step)\">\n @if (stepTemplate()) {\n <span\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n <ng-container\n [ngTemplateOutlet]=\"stepTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n </span>\n } @else {\n <span\n monaStepperIndicator\n [rounded]=\"rounded()\"\n [active]=\"active\"\n [focused]=\"focused\"\n role=\"button\"\n [attr.aria-current]=\"step.index === activeStep()?.index ? 'step' : undefined\"\n [attr.aria-disabled]=\"locked ? true : undefined\"\n [attr.aria-label]=\"options.label\"\n [attr.tabindex]=\"focused ? 0 : -1\"\n (focus)=\"onIndicatorFocus(step)\">\n @if (indicatorTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"indicatorTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n {{ step.index + 1 }}\n }\n </span>\n }\n @if (labelTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"labelTemplate()\"\n [ngTemplateOutletContext]=\"{\n $implicit: options,\n index,\n active,\n currentIndex,\n disabled\n }\"></ng-container>\n } @else {\n <span aria-hidden=\"true\">{{ options.label }}</span>\n }\n </li>\n }\n</ol>\n<div\n [class]=\"trackClass()\"\n [style]=\"trackStyles()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"step()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"progressMax()\"\n [attr.aria-label]=\"progressAriaLabel()\">\n <div [class]=\"trackLineClass()\" [style]=\"trackInnerStyles()\"></div>\n</div>\n" }]
|
|
522
459
|
}], ctorParameters: () => [], propDecorators: { indicatorTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperIndicatorTemplateDirective), { ...{
|
|
523
460
|
read: TemplateRef
|
|
524
461
|
}, isSignal: true }] }], labelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], stepTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StepperStepTemplateDirective), { ...{
|
|
@@ -2,10 +2,10 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, TemplateRef, input, model, output, afterNextRender, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
5
|
import { fromEvent, filter, tap, merge } from 'rxjs';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { themeControlSurfaceClasses, themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
9
9
|
|
|
10
10
|
class SwitchHandleContentTemplateDirective {
|
|
11
11
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchHandleContentTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -40,26 +40,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
40
40
|
}]
|
|
41
41
|
}] });
|
|
42
42
|
|
|
43
|
-
const
|
|
44
|
-
relative flex items-center
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
data-[disabled='true']:
|
|
54
|
-
data-[disabled='true']:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
data-[active='true']:
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
const switchThemeVariants = cva(`
|
|
44
|
+
group relative flex items-center
|
|
45
|
+
cursor-pointer select-none
|
|
46
|
+
${themeControlSurfaceClasses}
|
|
47
|
+
border border-input-border
|
|
48
|
+
outline-none
|
|
49
|
+
transition-[background,border-color]
|
|
50
|
+
|
|
51
|
+
data-[disabled='true']:pointer-events-none
|
|
52
|
+
data-[disabled='true']:cursor-not-allowed
|
|
53
|
+
data-[disabled='true']:border-disabled-border
|
|
54
|
+
data-[disabled='true']:bg-disabled-background
|
|
55
|
+
data-[disabled='true']:text-disabled-foreground
|
|
56
|
+
|
|
57
|
+
data-[active='true']:bg-primary
|
|
58
|
+
data-[active='true']:text-primary-foreground
|
|
59
|
+
data-[disabled='true']:data-[active='true']:bg-disabled-background
|
|
60
|
+
|
|
61
|
+
focus-visible:border-focus-indicator
|
|
62
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
63
|
+
|
|
64
|
+
[&.ng-touched.ng-invalid]:border-error
|
|
65
|
+
data-[invalid='true']:border-error
|
|
66
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
67
|
+
data-[invalid='true']:focus-visible:border-error
|
|
68
|
+
data-[invalid='true']:focus-visible:ring-error/35
|
|
63
69
|
`, {
|
|
64
70
|
variants: {
|
|
65
71
|
rounded: {
|
|
@@ -70,18 +76,21 @@ const switchVariants = cva(`
|
|
|
70
76
|
small: "rounded-sm"
|
|
71
77
|
},
|
|
72
78
|
size: {
|
|
73
|
-
large: "
|
|
74
|
-
medium: "
|
|
75
|
-
small: "
|
|
79
|
+
large: "h-7.5 w-14 text-md",
|
|
80
|
+
medium: "h-6.5 w-12 text-sm",
|
|
81
|
+
small: "h-5.5 w-10 text-xs"
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
});
|
|
79
|
-
const
|
|
80
|
-
absolute inline-flex
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
const switchHandleThemeVariants = cva(`
|
|
86
|
+
absolute inline-flex items-center justify-center
|
|
87
|
+
${themeRaisedSurfaceClasses} text-foreground
|
|
88
|
+
border border-border-subtle shadow-(--shadow-control)
|
|
89
|
+
outline-none
|
|
90
|
+
transition-[left,background] duration-(--mona-motion-standard) ease-in-out
|
|
91
|
+
data-[active='true']:bg-primary-foreground
|
|
92
|
+
group-data-[disabled='true']:border-disabled-border
|
|
93
|
+
group-data-[disabled='true']:bg-disabled-background
|
|
85
94
|
`, {
|
|
86
95
|
variants: {
|
|
87
96
|
rounded: {
|
|
@@ -92,83 +101,53 @@ const switchHandleVariants = cva(`
|
|
|
92
101
|
small: "rounded-sm"
|
|
93
102
|
},
|
|
94
103
|
size: {
|
|
95
|
-
large: `
|
|
96
|
-
|
|
97
|
-
data-[active='true']:left-[calc(100%-26px)]
|
|
98
|
-
data-[active='false']:left-0.5
|
|
104
|
+
large: `
|
|
105
|
+
h-6 w-6
|
|
106
|
+
data-[active='true']:left-[calc(100%-26px)]
|
|
107
|
+
data-[active='false']:left-0.5
|
|
99
108
|
`,
|
|
100
|
-
medium: `
|
|
101
|
-
|
|
102
|
-
data-[active='true']:left-[calc(100%-22px)]
|
|
103
|
-
data-[active='false']:left-0.5
|
|
109
|
+
medium: `
|
|
110
|
+
h-5 w-5
|
|
111
|
+
data-[active='true']:left-[calc(100%-22px)]
|
|
112
|
+
data-[active='false']:left-0.5
|
|
104
113
|
`,
|
|
105
|
-
small: `
|
|
106
|
-
|
|
107
|
-
data-[active='true']:left-[calc(100%-18px)]
|
|
108
|
-
data-[active='false']:left-0.5
|
|
114
|
+
small: `
|
|
115
|
+
h-4 w-4
|
|
116
|
+
data-[active='true']:left-[calc(100%-18px)]
|
|
117
|
+
data-[active='false']:left-0.5
|
|
109
118
|
`
|
|
110
119
|
}
|
|
111
120
|
}
|
|
112
121
|
});
|
|
113
|
-
const
|
|
114
|
-
h-full flex
|
|
122
|
+
const switchLabelThemeVariants = cva(`
|
|
123
|
+
flex h-full flex-1 items-center justify-center text-xs
|
|
115
124
|
`);
|
|
116
125
|
|
|
117
|
-
const switchThemeVariants = (theme) => {
|
|
118
|
-
switch (theme) {
|
|
119
|
-
case "mona":
|
|
120
|
-
return switchVariants;
|
|
121
|
-
default:
|
|
122
|
-
return switchVariants; // Default to Mona styles
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const switchHandleThemeVariants = (theme) => {
|
|
126
|
-
switch (theme) {
|
|
127
|
-
case "mona":
|
|
128
|
-
return switchHandleVariants;
|
|
129
|
-
default:
|
|
130
|
-
return switchHandleVariants; // Default to Mona styles
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
const switchLabelThemeVariants = (theme) => {
|
|
134
|
-
switch (theme) {
|
|
135
|
-
case "mona":
|
|
136
|
-
return switchLabelVariants;
|
|
137
|
-
default:
|
|
138
|
-
return switchLabelVariants; // Default to Mona styles
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
126
|
class SwitchComponent {
|
|
143
127
|
#destroyRef;
|
|
144
128
|
#hostElementRef;
|
|
145
|
-
#themeService;
|
|
146
129
|
constructor() {
|
|
147
130
|
this.#destroyRef = inject(DestroyRef);
|
|
148
131
|
this.#hostElementRef = inject((ElementRef));
|
|
149
|
-
this.#themeService = inject(ThemeService);
|
|
150
132
|
this.classes = computed(() => {
|
|
151
|
-
const theme = this.#themeService.theme();
|
|
152
133
|
const rounded = this.rounded();
|
|
153
134
|
const size = this.size();
|
|
154
|
-
const classes = switchThemeVariants(
|
|
135
|
+
const classes = switchThemeVariants({ rounded, size });
|
|
155
136
|
return twMerge(classes, this.userClass());
|
|
156
137
|
}, /* @ts-ignore */
|
|
157
138
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
158
139
|
this.invalidState = computed(() => this.invalid() || (this.required() && this.touched() && !this.checked()), /* @ts-ignore */
|
|
159
140
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
160
141
|
this.handleClasses = computed(() => {
|
|
161
|
-
const theme = this.#themeService.theme();
|
|
162
142
|
const rounded = this.rounded();
|
|
163
143
|
const size = this.size();
|
|
164
|
-
const classes = switchHandleThemeVariants(
|
|
144
|
+
const classes = switchHandleThemeVariants({ rounded, size });
|
|
165
145
|
return twMerge(classes);
|
|
166
146
|
}, /* @ts-ignore */
|
|
167
147
|
...(ngDevMode ? [{ debugName: "handleClasses" }] : /* istanbul ignore next */ []));
|
|
168
148
|
this.handleContentTemplate = contentChild(SwitchHandleContentTemplateDirective, { ...(ngDevMode ? { debugName: "handleContentTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
|
|
169
149
|
this.labelClasses = computed(() => {
|
|
170
|
-
const
|
|
171
|
-
const classes = switchLabelThemeVariants(theme)();
|
|
150
|
+
const classes = switchLabelThemeVariants();
|
|
172
151
|
return twMerge(classes);
|
|
173
152
|
}, /* @ts-ignore */
|
|
174
153
|
...(ngDevMode ? [{ debugName: "labelClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -274,7 +253,7 @@ class SwitchComponent {
|
|
|
274
253
|
this.touch.emit();
|
|
275
254
|
}
|
|
276
255
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
277
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SwitchComponent, isStandalone: true, selector: "mona-switch", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", 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 }, size: { classPropertyName: "size", publicName: "size", 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 } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.role": "'switch'", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled() || undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-active": "checked()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null", "class": "classes()" } }, queries: [{ propertyName: "handleContentTemplate", first: true, predicate: SwitchHandleContentTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offLabelTemplate", first: true, predicate: SwitchOffLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "onLabelTemplate", first: true, predicate: SwitchOnLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<span [class]=\"labelClasses()\">\
|
|
256
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SwitchComponent, isStandalone: true, selector: "mona-switch", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", 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 }, size: { classPropertyName: "size", publicName: "size", 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 } }, outputs: { checked: "checkedChange", touch: "touch" }, host: { listeners: { "blur": "onBlur()" }, properties: { "attr.role": "'switch'", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled() || undefined", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.tabindex": "disabled() ? -1 : 0", "attr.data-active": "checked()", "attr.data-disabled": "disabled()", "attr.data-invalid": "invalidState() || null", "attr.aria-invalid": "invalidState() ? 'true' : null", "class": "classes()" } }, queries: [{ propertyName: "handleContentTemplate", first: true, predicate: SwitchHandleContentTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offLabelTemplate", first: true, predicate: SwitchOffLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "onLabelTemplate", first: true, predicate: SwitchOnLabelTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<span [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
278
257
|
}
|
|
279
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
280
259
|
type: Component,
|
|
@@ -291,7 +270,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
291
270
|
"[attr.aria-invalid]": "invalidState() ? 'true' : null",
|
|
292
271
|
"[class]": "classes()",
|
|
293
272
|
"(blur)": "onBlur()"
|
|
294
|
-
}, template: "<span [class]=\"labelClasses()\">\
|
|
273
|
+
}, template: "<span [class]=\"labelClasses()\">\n @if (checked() && !onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ onLabel() }}</span>\n }\n @if (checked() && onLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"onLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<span [class]=\"labelClasses()\">\n @if (!checked() && !offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">{{ offLabel() }}</span>\n }\n @if (!checked() && offLabelTemplate()) {\n <span animate.enter=\"mona-switch-label-enter\" animate.leave=\"mona-switch-label-leave\">\n <ng-container [ngTemplateOutlet]=\"offLabelTemplate() ?? null\"></ng-container>\n </span>\n }\n</span>\n<div [class]=\"handleClasses()\" [attr.data-active]=\"checked()\">\n @if (handleContentTemplate()) {\n <ng-container\n [ngTemplateOutlet]=\"handleContentTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: checked() }\"></ng-container>\n }\n</div>\n", styles: [".mona-switch-label-enter{animation:mona-switch-label-fade-in .3s ease-out}.mona-switch-label-leave{animation:mona-switch-label-fade-out .3s ease-out}@keyframes mona-switch-label-fade-in{0%{opacity:0}to{opacity:1}}@keyframes mona-switch-label-fade-out{0%{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.mona-switch-label-enter,.mona-switch-label-leave{animation-duration:1ms}}\n"] }]
|
|
295
274
|
}], ctorParameters: () => [], propDecorators: { handleContentTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchHandleContentTemplateDirective), { ...{
|
|
296
275
|
read: TemplateRef
|
|
297
276
|
}, isSignal: true }] }], offLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchOffLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], onLabelTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SwitchOnLabelTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|