@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,45 +1,43 @@
|
|
|
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
|
|
12
|
-
flex items-center justify-center
|
|
13
|
-
|
|
14
|
-
overflow-hidden
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
peer-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
peer-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
peer-
|
|
33
|
-
|
|
34
|
-
peer-indeterminate:after:
|
|
35
|
-
peer-indeterminate:after:[
|
|
36
|
-
peer-indeterminate:after:[
|
|
37
|
-
peer-indeterminate:after:bg-current
|
|
38
|
-
|
|
39
|
-
[
|
|
40
|
-
|
|
41
|
-
data-[invalid='true']:border-error
|
|
42
|
-
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/40
|
|
10
|
+
const checkboxInputThemeVariants = cva(`sr-only appearance-none outline-none peer`);
|
|
11
|
+
const checkmarkThemeVariants = cva(`
|
|
12
|
+
flex items-center justify-center
|
|
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
|
|
18
|
+
|
|
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
|
|
21
|
+
|
|
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
|
|
24
|
+
|
|
25
|
+
peer-focus-visible:border-focus-indicator
|
|
26
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-focus-indicator/35
|
|
27
|
+
|
|
28
|
+
[&.ng-touched.ng-invalid]:border-error
|
|
29
|
+
data-[invalid='true']:border-error
|
|
30
|
+
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
31
|
+
data-[invalid='true']:peer-focus-visible:border-error
|
|
32
|
+
data-[invalid='true']:peer-focus-visible:ring-error/35
|
|
33
|
+
|
|
34
|
+
peer-indeterminate:after:absolute
|
|
35
|
+
peer-indeterminate:after:inset-[3px_0_3px_0]
|
|
36
|
+
peer-indeterminate:after:content-['']
|
|
37
|
+
peer-indeterminate:after:bg-current
|
|
38
|
+
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")]
|
|
39
|
+
peer-indeterminate:after:[mask-repeat:no-repeat]
|
|
40
|
+
peer-indeterminate:after:[mask-size:contain]
|
|
43
41
|
`, {
|
|
44
42
|
variants: {
|
|
45
43
|
rounded: {
|
|
@@ -51,16 +49,12 @@ const checkmarkVariants = cva(`
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
});
|
|
54
|
-
const
|
|
55
|
-
w-full
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
data-[disabled='true']:pointer-events-none
|
|
62
|
-
data-[disabled='true']:cursor-not-allowed
|
|
63
|
-
data-[disabled='true']:opacity-50
|
|
52
|
+
const checkboxContainerLabelThemeVariants = cva(`
|
|
53
|
+
relative inline-flex h-full w-full items-center gap-2
|
|
54
|
+
select-none
|
|
55
|
+
data-[disabled='true']:pointer-events-none
|
|
56
|
+
data-[disabled='true']:cursor-not-allowed
|
|
57
|
+
data-[disabled='true']:text-disabled-foreground
|
|
64
58
|
`, {
|
|
65
59
|
variants: {
|
|
66
60
|
labelSize: {
|
|
@@ -70,42 +64,42 @@ const checkboxContainerLabelVariants = cva(`
|
|
|
70
64
|
}
|
|
71
65
|
}
|
|
72
66
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
disabled:pointer-events-none
|
|
81
|
-
disabled:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
checked:after:
|
|
93
|
-
checked:after:
|
|
94
|
-
checked:after:
|
|
95
|
-
checked:after:[mask-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
indeterminate:after:
|
|
101
|
-
indeterminate:after:
|
|
102
|
-
indeterminate:after:
|
|
103
|
-
indeterminate:after:[mask-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
[&.ng-touched.ng-invalid]:
|
|
67
|
+
const checkboxDirectiveThemeVariants = cva(`
|
|
68
|
+
relative h-4.5 w-4.5
|
|
69
|
+
cursor-pointer appearance-none
|
|
70
|
+
${themeControlSurfaceClasses}
|
|
71
|
+
border border-input-border
|
|
72
|
+
outline-none
|
|
73
|
+
|
|
74
|
+
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
75
|
+
disabled:border-disabled-border disabled:bg-disabled-background disabled:text-disabled-foreground
|
|
76
|
+
|
|
77
|
+
checked:border-(--color-selected-border) checked:bg-primary checked:text-primary-foreground
|
|
78
|
+
indeterminate:border-(--color-selected-border) indeterminate:bg-primary indeterminate:text-primary-foreground
|
|
79
|
+
|
|
80
|
+
focus-visible:border-focus-indicator
|
|
81
|
+
focus-visible:ring-2 focus-visible:ring-focus-indicator/35
|
|
82
|
+
|
|
83
|
+
checked:after:absolute
|
|
84
|
+
checked:after:inset-[1px_0_0_1px]
|
|
85
|
+
checked:after:content-['']
|
|
86
|
+
checked:after:bg-current
|
|
87
|
+
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")]
|
|
88
|
+
checked:after:[mask-repeat:no-repeat]
|
|
89
|
+
checked:after:[mask-size:contain]
|
|
90
|
+
|
|
91
|
+
indeterminate:after:absolute
|
|
92
|
+
indeterminate:after:inset-[1px_0_1px_1px]
|
|
93
|
+
indeterminate:after:content-['']
|
|
94
|
+
indeterminate:after:bg-current
|
|
95
|
+
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")]
|
|
96
|
+
indeterminate:after:[mask-repeat:no-repeat]
|
|
97
|
+
indeterminate:after:[mask-size:contain]
|
|
98
|
+
|
|
99
|
+
[&.ng-touched.ng-invalid]:border-error
|
|
100
|
+
[&.ng-touched.ng-invalid]:ring-2 [&.ng-touched.ng-invalid]:ring-error/35
|
|
101
|
+
[&.ng-touched.ng-invalid]:focus-visible:border-error
|
|
102
|
+
[&.ng-touched.ng-invalid]:focus-visible:ring-error/35
|
|
109
103
|
`, {
|
|
110
104
|
variants: {
|
|
111
105
|
rounded: {
|
|
@@ -118,58 +112,21 @@ const checkboxDirectiveVariants = cva(`
|
|
|
118
112
|
}
|
|
119
113
|
});
|
|
120
114
|
|
|
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
115
|
class CheckBoxComponent {
|
|
155
116
|
constructor() {
|
|
156
|
-
this.#themeService = inject(ThemeService);
|
|
157
117
|
this.checkBoxClasses = computed(() => {
|
|
158
|
-
|
|
159
|
-
return checkboxInputThemeVariants(theme)();
|
|
118
|
+
return checkboxInputThemeVariants();
|
|
160
119
|
}, /* @ts-ignore */
|
|
161
120
|
...(ngDevMode ? [{ debugName: "checkBoxClasses" }] : /* istanbul ignore next */ []));
|
|
162
121
|
this.checkMarkClasses = computed(() => {
|
|
163
|
-
const theme = this.#themeService.theme();
|
|
164
122
|
const rounded = this.rounded();
|
|
165
|
-
return checkmarkThemeVariants(
|
|
123
|
+
return checkmarkThemeVariants({ rounded });
|
|
166
124
|
}, /* @ts-ignore */
|
|
167
125
|
...(ngDevMode ? [{ debugName: "checkMarkClasses" }] : /* istanbul ignore next */ []));
|
|
168
126
|
this.containerLabelClasses = computed(() => {
|
|
169
|
-
const theme = this.#themeService.theme();
|
|
170
127
|
const labelSize = this.labelSize();
|
|
171
128
|
const classes = this.userClass();
|
|
172
|
-
const variantClasses = checkboxContainerLabelThemeVariants(
|
|
129
|
+
const variantClasses = checkboxContainerLabelThemeVariants({ labelSize });
|
|
173
130
|
return twMerge(variantClasses, classes);
|
|
174
131
|
}, /* @ts-ignore */
|
|
175
132
|
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -265,7 +222,6 @@ class CheckBoxComponent {
|
|
|
265
222
|
*/
|
|
266
223
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
267
224
|
}
|
|
268
|
-
#themeService;
|
|
269
225
|
onCheckedChange(checked) {
|
|
270
226
|
this.checked.set(checked);
|
|
271
227
|
}
|
|
@@ -278,7 +234,7 @@ class CheckBoxComponent {
|
|
|
278
234
|
this.touch.emit();
|
|
279
235
|
}
|
|
280
236
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
281
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CheckBoxComponent, isStandalone: true, selector: "mona-check-box", inputs: { checked: { classPropertyName: "checked", publicName: "checked", 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 }, 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", 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", inputBlur: "inputBlur", inputChange: "inputChange", inputFocus: "inputFocus", touch: "touch" }, host: { properties: { "class": "'flex'", "attr.data-checked": "checked()", "attr.data-disabled": "disabled()", "attr.data-indeterminate": "indeterminate()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\
|
|
237
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CheckBoxComponent, isStandalone: true, selector: "mona-check-box", inputs: { checked: { classPropertyName: "checked", publicName: "checked", 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 }, 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", 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", inputBlur: "inputBlur", inputChange: "inputChange", inputFocus: "inputFocus", touch: "touch" }, host: { properties: { "class": "'flex'", "attr.data-checked": "checked()", "attr.data-disabled": "disabled()", "attr.data-indeterminate": "indeterminate()" } }, ngImport: i0, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [required]=\"required()\"\n [ngModel]=\"checked()\"\n [tabindex]=\"disabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"label() || null\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (ngModelChange)=\"onCheckedChange($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-check stroke-primary-foreground\">\n <path d=\"M18 6 9 17l-5-5\" />\n </svg>\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: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.CheckboxRequiredValidator, selector: "input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
282
238
|
}
|
|
283
239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, decorators: [{
|
|
284
240
|
type: Component,
|
|
@@ -287,16 +243,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
287
243
|
"[attr.data-checked]": "checked()",
|
|
288
244
|
"[attr.data-disabled]": "disabled()",
|
|
289
245
|
"[attr.data-indeterminate]": "indeterminate()"
|
|
290
|
-
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\
|
|
246
|
+
}, template: "<label [class]=\"containerLabelClasses()\" [attr.data-disabled]=\"disabled()\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [disabled]=\"disabled()\"\n [indeterminate]=\"indeterminate()\"\n [required]=\"required()\"\n [ngModel]=\"checked()\"\n [tabindex]=\"disabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"label() || null\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n (ngModelChange)=\"onCheckedChange($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked()) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"lucide lucide-check stroke-primary-foreground\">\n <path d=\"M18 6 9 17l-5-5\" />\n </svg>\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" }]
|
|
291
247
|
}], propDecorators: { 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 }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputChange: [{ type: i0.Output, args: ["inputChange"] }], 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 }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", 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 }] }] } });
|
|
292
248
|
|
|
293
249
|
class CheckboxDirective {
|
|
294
250
|
constructor() {
|
|
295
|
-
this.#themeService = inject(ThemeService);
|
|
296
251
|
this.classes = computed(() => {
|
|
297
|
-
const theme = this.#themeService.theme();
|
|
298
252
|
const rounded = this.rounded();
|
|
299
|
-
const variantClasses = checkboxDirectiveThemeVariants(
|
|
253
|
+
const variantClasses = checkboxDirectiveThemeVariants({ rounded });
|
|
300
254
|
const userClass = this.userClass();
|
|
301
255
|
return twMerge(variantClasses, userClass);
|
|
302
256
|
}, /* @ts-ignore */
|
|
@@ -313,7 +267,6 @@ class CheckboxDirective {
|
|
|
313
267
|
*/
|
|
314
268
|
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
315
269
|
}
|
|
316
|
-
#themeService;
|
|
317
270
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
318
271
|
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 }); }
|
|
319
272
|
}
|