@nanahoshi/mona-ui 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +54 -150
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +67 -99
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +27 -78
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +17 -39
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +39 -48
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +34 -54
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +42 -29
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +33 -54
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +27 -57
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +36 -63
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +38 -64
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +78 -98
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -59
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +19 -31
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -65
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +43 -29
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +40 -102
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
- package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +2 -1
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +18 -10
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -5
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
- package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +6 -7
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +28 -13
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +12 -13
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +16 -7
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +11 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
|
@@ -1,45 +1,42 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { computed, model, input, output, Component, Directive } from '@angular/core';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormsModule } from '@angular/forms';
|
|
6
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { themeControlSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const checkboxInputThemeVariants = cva(`sr-only appearance-none outline-none peer`);
|
|
11
|
+
const checkmarkThemeVariants = cva(`
|
|
12
12
|
flex items-center justify-center
|
|
13
|
-
|
|
14
|
-
overflow-hidden
|
|
13
|
+
h-4.5 w-4.5 pl-0.25
|
|
14
|
+
cursor-pointer overflow-hidden
|
|
15
|
+
${themeControlSurfaceClasses}
|
|
16
|
+
border border-input-border
|
|
17
|
+
outline-none
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
peer-disabled:pointer-events-none peer-disabled:cursor-not-allowed
|
|
20
|
+
peer-disabled:border-disabled-border peer-disabled:bg-disabled-background peer-disabled:text-disabled-foreground
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
data-[disabled='true']:opacity-50
|
|
22
|
+
peer-checked:border-(--color-selected-border) peer-checked:bg-primary peer-checked:text-primary-foreground
|
|
23
|
+
peer-indeterminate:border-(--color-selected-border) peer-indeterminate:bg-primary peer-indeterminate:text-primary-foreground
|
|
22
24
|
|
|
23
|
-
peer-focus-visible:
|
|
24
|
-
peer-focus-visible:
|
|
25
|
+
peer-focus-visible:border-focus-indicator
|
|
26
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-focus-indicator/35
|
|
25
27
|
|
|
26
|
-
|
|
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
|
|
28
32
|
|
|
29
|
-
peer-indeterminate:bg-primary
|
|
30
|
-
peer-indeterminate:text-primary-foreground
|
|
31
|
-
peer-indeterminate:after:content-['']
|
|
32
33
|
peer-indeterminate:after:absolute
|
|
33
34
|
peer-indeterminate:after:inset-[3px_0_3px_0]
|
|
35
|
+
peer-indeterminate:after:content-['']
|
|
36
|
+
peer-indeterminate:after:bg-current
|
|
34
37
|
peer-indeterminate:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h14'%2F%3E%3C%2Fsvg%3E")]
|
|
35
38
|
peer-indeterminate:after:[mask-repeat:no-repeat]
|
|
36
39
|
peer-indeterminate:after:[mask-size:contain]
|
|
37
|
-
peer-indeterminate:after:bg-current
|
|
38
|
-
|
|
39
|
-
[&.ng-touched.ng-invalid]:border-error
|
|
40
|
-
|
|
41
|
-
data-[invalid='true']:border-error
|
|
42
|
-
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
|
|
43
40
|
`, {
|
|
44
41
|
variants: {
|
|
45
42
|
rounded: {
|
|
@@ -51,16 +48,12 @@ const checkmarkVariants = cva(`
|
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
});
|
|
54
|
-
const
|
|
55
|
-
w-full
|
|
56
|
-
inline-flex items-center gap-2
|
|
57
|
-
relative
|
|
58
|
-
|
|
51
|
+
const checkboxContainerLabelThemeVariants = cva(`
|
|
52
|
+
relative inline-flex h-full w-full items-center gap-2
|
|
59
53
|
select-none
|
|
60
|
-
|
|
61
54
|
data-[disabled='true']:pointer-events-none
|
|
62
55
|
data-[disabled='true']:cursor-not-allowed
|
|
63
|
-
data-[disabled='true']:
|
|
56
|
+
data-[disabled='true']:text-disabled-foreground
|
|
64
57
|
`, {
|
|
65
58
|
variants: {
|
|
66
59
|
labelSize: {
|
|
@@ -70,42 +63,42 @@ const checkboxContainerLabelVariants = cva(`
|
|
|
70
63
|
}
|
|
71
64
|
}
|
|
72
65
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
const checkboxDirectiveThemeVariants = cva(`
|
|
67
|
+
relative h-4.5 w-4.5
|
|
68
|
+
cursor-pointer appearance-none
|
|
69
|
+
${themeControlSurfaceClasses}
|
|
70
|
+
border border-input-border
|
|
71
|
+
outline-none
|
|
79
72
|
|
|
80
|
-
disabled:pointer-events-none
|
|
81
|
-
disabled:
|
|
82
|
-
disabled:opacity-50
|
|
73
|
+
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
74
|
+
disabled:border-disabled-border disabled:bg-disabled-background disabled:text-disabled-foreground
|
|
83
75
|
|
|
84
|
-
checked:text-primary-foreground
|
|
85
|
-
indeterminate:text-primary-foreground
|
|
86
|
-
indeterminate:bg-primary
|
|
87
|
-
checked:bg-primary
|
|
76
|
+
checked:border-(--color-selected-border) checked:bg-primary checked:text-primary-foreground
|
|
77
|
+
indeterminate:border-(--color-selected-border) indeterminate:bg-primary indeterminate:text-primary-foreground
|
|
88
78
|
|
|
89
|
-
focus-visible:
|
|
90
|
-
focus-visible:
|
|
79
|
+
focus-visible:border-focus-indicator
|
|
80
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
91
81
|
|
|
92
|
-
checked:after:content-['']
|
|
93
82
|
checked:after:absolute
|
|
94
83
|
checked:after:inset-[1px_0_0_1px]
|
|
84
|
+
checked:after:content-['']
|
|
85
|
+
checked:after:bg-current
|
|
95
86
|
checked:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M18%206%209%2017l-5-5'/%3E%3C/svg%3E")]
|
|
96
87
|
checked:after:[mask-repeat:no-repeat]
|
|
97
88
|
checked:after:[mask-size:contain]
|
|
98
|
-
checked:after:bg-current
|
|
99
89
|
|
|
100
|
-
indeterminate:after:content-['']
|
|
101
90
|
indeterminate:after:absolute
|
|
102
91
|
indeterminate:after:inset-[1px_0_1px_1px]
|
|
92
|
+
indeterminate:after:content-['']
|
|
93
|
+
indeterminate:after:bg-current
|
|
103
94
|
indeterminate:after:[mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23FFFFFF'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2012h14'%2F%3E%3C%2Fsvg%3E")]
|
|
104
95
|
indeterminate:after:[mask-repeat:no-repeat]
|
|
105
96
|
indeterminate:after:[mask-size:contain]
|
|
106
|
-
indeterminate:after:bg-current
|
|
107
97
|
|
|
108
|
-
[
|
|
98
|
+
data-[invalid='true']:border-error
|
|
99
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
100
|
+
data-[invalid='true']:focus-visible:border-error
|
|
101
|
+
data-[invalid='true']:focus-visible:ring-error/35
|
|
109
102
|
`, {
|
|
110
103
|
variants: {
|
|
111
104
|
rounded: {
|
|
@@ -118,62 +111,25 @@ const checkboxDirectiveVariants = cva(`
|
|
|
118
111
|
}
|
|
119
112
|
});
|
|
120
113
|
|
|
121
|
-
const checkboxInputThemeVariants = (theme) => {
|
|
122
|
-
switch (theme) {
|
|
123
|
-
case "mona":
|
|
124
|
-
return checkboxVariants;
|
|
125
|
-
default:
|
|
126
|
-
return checkboxVariants;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const checkmarkThemeVariants = (theme) => {
|
|
130
|
-
switch (theme) {
|
|
131
|
-
case "mona":
|
|
132
|
-
return checkmarkVariants;
|
|
133
|
-
default:
|
|
134
|
-
return checkmarkVariants;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const checkboxContainerLabelThemeVariants = (theme) => {
|
|
138
|
-
switch (theme) {
|
|
139
|
-
case "mona":
|
|
140
|
-
return checkboxContainerLabelVariants;
|
|
141
|
-
default:
|
|
142
|
-
return checkboxContainerLabelVariants;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const checkboxDirectiveThemeVariants = (theme) => {
|
|
146
|
-
switch (theme) {
|
|
147
|
-
case "mona":
|
|
148
|
-
return checkboxDirectiveVariants;
|
|
149
|
-
default:
|
|
150
|
-
return checkboxDirectiveVariants;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
114
|
class CheckBoxComponent {
|
|
155
115
|
constructor() {
|
|
156
|
-
this.#themeService = inject(ThemeService);
|
|
157
116
|
this.checkBoxClasses = computed(() => {
|
|
158
|
-
|
|
159
|
-
return checkboxInputThemeVariants(theme)();
|
|
117
|
+
return checkboxInputThemeVariants();
|
|
160
118
|
}, /* @ts-ignore */
|
|
161
119
|
...(ngDevMode ? [{ debugName: "checkBoxClasses" }] : /* istanbul ignore next */ []));
|
|
162
120
|
this.checkMarkClasses = computed(() => {
|
|
163
|
-
const theme = this.#themeService.theme();
|
|
164
121
|
const rounded = this.rounded();
|
|
165
|
-
return checkmarkThemeVariants(
|
|
122
|
+
return checkmarkThemeVariants({ rounded });
|
|
166
123
|
}, /* @ts-ignore */
|
|
167
124
|
...(ngDevMode ? [{ debugName: "checkMarkClasses" }] : /* istanbul ignore next */ []));
|
|
168
125
|
this.containerLabelClasses = computed(() => {
|
|
169
|
-
const theme = this.#themeService.theme();
|
|
170
126
|
const labelSize = this.labelSize();
|
|
171
127
|
const classes = this.userClass();
|
|
172
|
-
const variantClasses = checkboxContainerLabelThemeVariants(
|
|
128
|
+
const variantClasses = checkboxContainerLabelThemeVariants({ labelSize });
|
|
173
129
|
return twMerge(variantClasses, classes);
|
|
174
130
|
}, /* @ts-ignore */
|
|
175
131
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
176
|
-
this.invalidState = computed(() => this.
|
|
132
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.checked())), /* @ts-ignore */
|
|
177
133
|
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
178
134
|
/**
|
|
179
135
|
* @description Whether the control is checked.
|
|
@@ -265,7 +221,6 @@ class CheckBoxComponent {
|
|
|
265
221
|
*/
|
|
266
222
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
267
223
|
}
|
|
268
|
-
#themeService;
|
|
269
224
|
onCheckedChange(checked) {
|
|
270
225
|
this.checked.set(checked);
|
|
271
226
|
}
|
|
@@ -292,40 +247,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
292
247
|
|
|
293
248
|
class CheckboxDirective {
|
|
294
249
|
constructor() {
|
|
295
|
-
this.#themeService = inject(ThemeService);
|
|
296
250
|
this.classes = computed(() => {
|
|
297
|
-
const theme = this.#themeService.theme();
|
|
298
251
|
const rounded = this.rounded();
|
|
299
|
-
const variantClasses = checkboxDirectiveThemeVariants(
|
|
252
|
+
const variantClasses = checkboxDirectiveThemeVariants({ rounded });
|
|
300
253
|
const userClass = this.userClass();
|
|
301
254
|
return twMerge(variantClasses, userClass);
|
|
302
255
|
}, /* @ts-ignore */
|
|
303
256
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
257
|
+
this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
258
|
+
...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
|
|
259
|
+
/**
|
|
260
|
+
* @description Marks the checkbox as invalid, triggering error border and ring styling.
|
|
261
|
+
* @default false
|
|
262
|
+
*/
|
|
263
|
+
this.invalid = input(false, /* @ts-ignore */
|
|
264
|
+
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
304
265
|
/**
|
|
305
266
|
* @description Border-radius preset applied to the checkbox.
|
|
306
267
|
* @default "medium"
|
|
307
268
|
*/
|
|
308
269
|
this.rounded = input("medium", /* @ts-ignore */
|
|
309
270
|
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
271
|
+
/**
|
|
272
|
+
* @description Marks the checkbox as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
273
|
+
* @default false
|
|
274
|
+
*/
|
|
275
|
+
this.touched = input(false, /* @ts-ignore */
|
|
276
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
310
277
|
/**
|
|
311
278
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
312
279
|
* @default ""
|
|
313
280
|
*/
|
|
314
281
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
315
282
|
}
|
|
316
|
-
#themeService;
|
|
317
283
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
318
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: CheckboxDirective, isStandalone: true, selector: "input[type='checkbox'][monaCheckbox]", inputs: { rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 }); }
|
|
284
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: CheckboxDirective, isStandalone: true, selector: "input[type='checkbox'][monaCheckbox]", inputs: { invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", 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 } }, host: { properties: { "attr.aria-invalid": "inputInvalid() || null", "attr.data-invalid": "inputInvalid() || null", "class": "classes()" } }, ngImport: i0 }); }
|
|
319
285
|
}
|
|
320
286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, decorators: [{
|
|
321
287
|
type: Directive,
|
|
322
288
|
args: [{
|
|
323
289
|
selector: "input[type='checkbox'][monaCheckbox]",
|
|
324
290
|
host: {
|
|
291
|
+
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
292
|
+
"[attr.data-invalid]": "inputInvalid() || null",
|
|
325
293
|
"[class]": "classes()"
|
|
326
294
|
}
|
|
327
295
|
}]
|
|
328
|
-
}], propDecorators: { rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
296
|
+
}], propDecorators: { invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
329
297
|
|
|
330
298
|
/*
|
|
331
299
|
* Public API Surface of @nanahoshi/mona-ui/check-box
|
|
@@ -4,10 +4,10 @@ import { Directive, inject, DestroyRef, ElementRef, computed, contentChild, Temp
|
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { LucideCircleX } from '@lucide/angular';
|
|
6
6
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
7
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
8
7
|
import { fromEvent, filter } from 'rxjs';
|
|
9
8
|
import { twMerge } from 'tailwind-merge';
|
|
10
9
|
import { cva } from 'class-variance-authority';
|
|
10
|
+
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @description Apply to an `<ng-template>` directly inside `<mona-chip>` to render prefix content
|
|
@@ -24,11 +24,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
24
24
|
}]
|
|
25
25
|
}] });
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
inline-flex items-center justify-between gap-1.5
|
|
29
|
-
text-xs font-medium
|
|
30
|
-
outline-none
|
|
31
|
-
transition-colors duration-
|
|
27
|
+
const chipThemeVariants = cva(`
|
|
28
|
+
inline-flex shrink-0 items-center justify-between gap-1.5
|
|
29
|
+
cursor-pointer text-xs font-medium
|
|
30
|
+
shadow-(--shadow-control) outline-none
|
|
31
|
+
transition-colors duration-(--mona-motion-fast) ease-in-out
|
|
32
32
|
`, {
|
|
33
33
|
variants: {
|
|
34
34
|
disabled: {
|
|
@@ -37,58 +37,60 @@ const chipVariants = cva(`
|
|
|
37
37
|
},
|
|
38
38
|
look: {
|
|
39
39
|
default: `
|
|
40
|
-
|
|
40
|
+
${themeRaisedSurfaceClasses} text-foreground
|
|
41
41
|
border border-border
|
|
42
|
-
hover:bg-hover hover:text-
|
|
43
|
-
active:bg-active active:text-
|
|
44
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
42
|
+
hover:bg-hover hover:text-foreground
|
|
43
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
44
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
45
45
|
`,
|
|
46
46
|
primary: `
|
|
47
47
|
bg-primary text-primary-foreground
|
|
48
48
|
hover:bg-primary-hover hover:text-primary-foreground
|
|
49
49
|
active:bg-primary-active active:text-primary-foreground
|
|
50
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
50
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
51
51
|
`,
|
|
52
52
|
success: `
|
|
53
53
|
bg-success text-success-foreground
|
|
54
54
|
hover:bg-success-hover hover:text-success-foreground
|
|
55
55
|
active:bg-success-active active:text-success-foreground
|
|
56
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
56
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
57
57
|
`,
|
|
58
58
|
error: `
|
|
59
59
|
bg-error text-error-foreground
|
|
60
60
|
hover:bg-error-hover hover:text-error-foreground
|
|
61
61
|
active:bg-error-active active:text-error-foreground
|
|
62
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
62
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
63
63
|
`,
|
|
64
64
|
warning: `
|
|
65
65
|
bg-warning text-warning-foreground
|
|
66
66
|
hover:bg-warning-hover hover:text-warning-foreground
|
|
67
67
|
active:bg-warning-active active:text-warning-foreground
|
|
68
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
68
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
69
69
|
`,
|
|
70
70
|
info: `
|
|
71
71
|
bg-info text-info-foreground
|
|
72
72
|
hover:bg-info-hover hover:text-info-foreground
|
|
73
73
|
active:bg-info-active active:text-info-foreground
|
|
74
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
74
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
75
75
|
`,
|
|
76
76
|
outline: `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
bg-transparent text-foreground
|
|
78
|
+
border border-input-border
|
|
79
|
+
hover:bg-hover hover:text-foreground
|
|
80
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
81
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
81
82
|
`,
|
|
82
83
|
secondary: `
|
|
83
84
|
bg-secondary text-secondary-foreground
|
|
84
85
|
hover:bg-secondary-hover hover:text-secondary-foreground
|
|
85
86
|
active:bg-secondary-active active:text-secondary-foreground
|
|
86
|
-
focus-visible:ring-2 focus-visible:ring-
|
|
87
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
87
88
|
`,
|
|
88
89
|
ghost: `
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
bg-transparent text-foreground shadow-none
|
|
91
|
+
hover:bg-hover hover:text-foreground
|
|
92
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
93
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
92
94
|
`
|
|
93
95
|
},
|
|
94
96
|
rounded: {
|
|
@@ -125,9 +127,9 @@ const chipVariants = cva(`
|
|
|
125
127
|
look: "default",
|
|
126
128
|
selected: true,
|
|
127
129
|
class: `
|
|
128
|
-
bg-selected text-foreground
|
|
129
|
-
hover:bg-selected
|
|
130
|
-
active:bg-selected
|
|
130
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
131
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
132
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
131
133
|
`
|
|
132
134
|
},
|
|
133
135
|
{
|
|
@@ -188,18 +190,18 @@ const chipVariants = cva(`
|
|
|
188
190
|
look: "outline",
|
|
189
191
|
selected: true,
|
|
190
192
|
class: `
|
|
191
|
-
bg-
|
|
192
|
-
hover:bg-
|
|
193
|
-
active:bg-
|
|
193
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
194
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
195
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
194
196
|
`
|
|
195
197
|
},
|
|
196
198
|
{
|
|
197
199
|
look: "ghost",
|
|
198
200
|
selected: true,
|
|
199
201
|
class: `
|
|
200
|
-
bg-
|
|
201
|
-
hover:bg-
|
|
202
|
-
active:bg-
|
|
202
|
+
bg-(--color-selected) text-(--color-selected-foreground)
|
|
203
|
+
hover:bg-(--color-selected-hover) hover:text-(--color-selected-hover-foreground)
|
|
204
|
+
active:bg-(--color-selected-active) active:text-(--color-selected-active-foreground)
|
|
203
205
|
`
|
|
204
206
|
}
|
|
205
207
|
],
|
|
@@ -208,23 +210,12 @@ const chipVariants = cva(`
|
|
|
208
210
|
}
|
|
209
211
|
});
|
|
210
212
|
|
|
211
|
-
const chipThemeVariants = (theme) => {
|
|
212
|
-
switch (theme) {
|
|
213
|
-
case "mona":
|
|
214
|
-
return chipVariants;
|
|
215
|
-
default:
|
|
216
|
-
return chipVariants;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
213
|
class ChipComponent {
|
|
221
214
|
#destroyRef;
|
|
222
215
|
#elementRef;
|
|
223
|
-
#themeService;
|
|
224
216
|
constructor() {
|
|
225
217
|
this.#destroyRef = inject(DestroyRef);
|
|
226
218
|
this.#elementRef = inject(ElementRef);
|
|
227
|
-
this.#themeService = inject(ThemeService);
|
|
228
219
|
this.ariaChecked = computed(() => {
|
|
229
220
|
if (!this.toggleable()) {
|
|
230
221
|
return undefined;
|
|
@@ -233,14 +224,13 @@ class ChipComponent {
|
|
|
233
224
|
}, /* @ts-ignore */
|
|
234
225
|
...(ngDevMode ? [{ debugName: "ariaChecked" }] : /* istanbul ignore next */ []));
|
|
235
226
|
this.baseClass = computed(() => {
|
|
236
|
-
const theme = this.#themeService.theme();
|
|
237
227
|
const disabled = this.disabled();
|
|
238
228
|
const look = this.look();
|
|
239
229
|
const rounded = this.rounded();
|
|
240
230
|
const size = this.size();
|
|
241
231
|
const selected = this.selected();
|
|
242
232
|
const userClass = this.userClass();
|
|
243
|
-
const variantClasses = chipThemeVariants(
|
|
233
|
+
const variantClasses = chipThemeVariants({ disabled, look, rounded, size, selected });
|
|
244
234
|
return twMerge(variantClasses, userClass);
|
|
245
235
|
}, /* @ts-ignore */
|
|
246
236
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
@@ -2,7 +2,6 @@ import { NgTemplateOutlet } 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
4
|
import { getPercentage } from '@nanahoshi/mona-ui/common';
|
|
5
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
5
|
import { twMerge } from 'tailwind-merge';
|
|
7
6
|
import { cva } from 'class-variance-authority';
|
|
8
7
|
|
|
@@ -20,42 +19,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
20
19
|
}]
|
|
21
20
|
}] });
|
|
22
21
|
|
|
23
|
-
const
|
|
24
|
-
flex items-center justify-center
|
|
25
|
-
|
|
26
|
-
[&_svg]:
|
|
27
|
-
[&_svg]:
|
|
28
|
-
[&_svg]:left-1/2
|
|
22
|
+
const circularProgressBarBaseThemeVariants = cva(`
|
|
23
|
+
relative flex items-center justify-center select-none
|
|
24
|
+
text-foreground
|
|
25
|
+
[&_svg]:absolute [&_svg]:top-1/2 [&_svg]:left-1/2
|
|
26
|
+
[&_svg]:h-full [&_svg]:w-full
|
|
29
27
|
[&_svg]:-translate-x-1/2 [&_svg]:-translate-y-1/2
|
|
30
28
|
[&_svg_circle]:origin-center
|
|
31
29
|
[&_svg_circle]:-rotate-90
|
|
32
|
-
[&_svg_circle]:transition-[stroke-dashoffset,stroke] duration-
|
|
33
|
-
[&_svg_circle]:data-[stroke-trail='true']:stroke-
|
|
30
|
+
[&_svg_circle]:transition-[stroke-dashoffset,stroke] duration-(--mona-motion-fast) ease-in
|
|
31
|
+
[&_svg_circle]:data-[stroke-trail='true']:stroke-surface-muted
|
|
34
32
|
`, {
|
|
35
33
|
variants: {
|
|
36
34
|
disabled: {
|
|
37
|
-
true: "
|
|
35
|
+
true: "pointer-events-none cursor-not-allowed opacity-50",
|
|
38
36
|
false: ""
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
});
|
|
42
40
|
|
|
43
|
-
const circularProgressBarBaseThemeVariants = (theme) => {
|
|
44
|
-
switch (theme) {
|
|
45
|
-
case "mona":
|
|
46
|
-
return circularProgressBarBaseVariants;
|
|
47
|
-
default:
|
|
48
|
-
return circularProgressBarBaseVariants;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
41
|
class CircularProgressBarComponent {
|
|
53
42
|
constructor() {
|
|
54
|
-
this.#themeService = inject(ThemeService);
|
|
55
43
|
this.baseClasses = computed(() => {
|
|
56
|
-
const theme = this.#themeService.theme();
|
|
57
44
|
const disabled = this.disabled();
|
|
58
|
-
const classes = circularProgressBarBaseThemeVariants(
|
|
45
|
+
const classes = circularProgressBarBaseThemeVariants({ disabled });
|
|
59
46
|
const animateClass = this.animate() ? "" : "[&_svg_circle]:transition-none";
|
|
60
47
|
return twMerge(classes, this.userClass(), animateClass);
|
|
61
48
|
}, /* @ts-ignore */
|
|
@@ -166,7 +153,6 @@ class CircularProgressBarComponent {
|
|
|
166
153
|
this.value = input(0, /* @ts-ignore */
|
|
167
154
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
168
155
|
}
|
|
169
|
-
#themeService;
|
|
170
156
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CircularProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
157
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CircularProgressBarComponent, isStandalone: true, selector: "mona-circular-progress-bar", inputs: { animate: { classPropertyName: "animate", publicName: "animate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaValueText: { classPropertyName: "ariaValueText", publicName: "aria-valuetext", 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 }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", 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() || null", "style.width": "pixelSize()", "style.height": "pixelSize()" } }, queries: [{ propertyName: "labelTemplate", first: true, predicate: CircularProgressBarLabelTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<svg>\n <circle\n [attr.cx]=\"center().x\"\n [attr.cy]=\"center().y\"\n [attr.r]=\"radius()\"\n [attr.data-stroke-trail]=\"true\"\n [attr.stroke-dasharray]=\"circumference()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"transparent\" />\n <circle\n [attr.cx]=\"center().x\"\n [attr.cy]=\"center().y\"\n [attr.r]=\"radius()\"\n [attr.stroke]=\"strokeColor()\"\n [attr.stroke-dasharray]=\"circumference()\"\n [attr.stroke-dashoffset]=\"strokeDashOffset()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"transparent\"\n [class.indeterminate]=\"indeterminate()\" />\n</svg>\n@if (!indeterminate()) {\n <div class=\"mona-circular-progress-bar-label\">\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 {{ progress() }}\n }\n </div>\n}\n", styles: [".indeterminate{animation:rotate 2s linear infinite}@keyframes rotate{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
172
158
|
}
|