@nanahoshi/mona-ui 0.27.2 → 0.28.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/docs/api/chart.md +2 -2
- package/docs/api/popup.md +1 -1
- package/docs/api/theme.md +2 -2
- package/docs/chart.md +14 -0
- package/docs/editor.md +2 -0
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +6 -2
- package/package.json +62 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +354 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { NgTemplateOutlet } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { twMerge } from
|
|
5
|
-
import { cva } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, Directive, booleanAttribute, computed, input, linkedSignal, model, output, viewChild } from "@angular/core";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { createElementControlId, injectEffectiveDisabled, injectLabelAssociation, themeControlSurfaceClasses } from "@nanahoshi/mona-ui/internal";
|
|
8
7
|
const checkboxInputThemeVariants = cva(`sr-only appearance-none outline-none focus-visible:outline-hidden peer`);
|
|
9
8
|
const checkmarkThemeVariants = cva(`
|
|
10
9
|
relative flex items-center justify-center
|
|
@@ -38,17 +37,13 @@ const checkmarkThemeVariants = cva(`
|
|
|
38
37
|
peer-indeterminate:after:[mask-position:center]
|
|
39
38
|
peer-indeterminate:after:[mask-repeat:no-repeat]
|
|
40
39
|
peer-indeterminate:after:[mask-size:contain]
|
|
41
|
-
`, {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
small: "rounded-sm"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
40
|
+
`, { variants: { rounded: {
|
|
41
|
+
full: "rounded-full",
|
|
42
|
+
large: "rounded-lg",
|
|
43
|
+
medium: "rounded-md",
|
|
44
|
+
none: "rounded-none",
|
|
45
|
+
small: "rounded-sm"
|
|
46
|
+
} } });
|
|
52
47
|
const checkboxContainerLabelThemeVariants = cva(`
|
|
53
48
|
relative inline-flex h-full w-full items-center gap-2
|
|
54
49
|
select-none
|
|
@@ -58,15 +53,11 @@ const checkboxContainerLabelThemeVariants = cva(`
|
|
|
58
53
|
data-[disabled='true']:text-disabled-foreground
|
|
59
54
|
data-[readonly='true']:cursor-default
|
|
60
55
|
[&[data-readonly='true']>*]:cursor-default
|
|
61
|
-
`, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
small: "text-sm"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
});
|
|
56
|
+
`, { variants: { labelSize: {
|
|
57
|
+
large: "text-lg",
|
|
58
|
+
medium: "text-base",
|
|
59
|
+
small: "text-sm"
|
|
60
|
+
} } });
|
|
70
61
|
const checkboxDirectiveThemeVariants = cva(`
|
|
71
62
|
relative h-4.5 w-4.5
|
|
72
63
|
cursor-pointer appearance-none
|
|
@@ -105,295 +96,633 @@ const checkboxDirectiveThemeVariants = cva(`
|
|
|
105
96
|
data-[invalid='true']:ring-2 data-[invalid='true']:ring-error/35
|
|
106
97
|
data-[invalid='true']:focus-visible:border-error
|
|
107
98
|
data-[invalid='true']:focus-visible:ring-error/35
|
|
108
|
-
`, {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
99
|
+
`, { variants: { rounded: {
|
|
100
|
+
full: "rounded-full",
|
|
101
|
+
large: "rounded-lg",
|
|
102
|
+
medium: "rounded-md",
|
|
103
|
+
none: "rounded-none",
|
|
104
|
+
small: "rounded-sm"
|
|
105
|
+
} } });
|
|
106
|
+
var CheckBoxComponent = class CheckBoxComponent {
|
|
107
|
+
constructor() {
|
|
108
|
+
this.#label = injectLabelAssociation({
|
|
109
|
+
ariaLabel: () => this.ariaLabel(),
|
|
110
|
+
ariaLabelledBy: () => this.ariaLabelledBy(),
|
|
111
|
+
wrapped: false
|
|
112
|
+
});
|
|
113
|
+
this.checkBoxClasses = computed(() => {
|
|
114
|
+
return checkboxInputThemeVariants();
|
|
115
|
+
}, ...ngDevMode ? [{ debugName: "checkBoxClasses" }] : /* istanbul ignore next */ []);
|
|
116
|
+
this.checkMarkClasses = computed(() => {
|
|
117
|
+
const rounded = this.rounded();
|
|
118
|
+
return checkmarkThemeVariants({ rounded });
|
|
119
|
+
}, ...ngDevMode ? [{ debugName: "checkMarkClasses" }] : /* istanbul ignore next */ []);
|
|
120
|
+
this.containerLabelClasses = computed(() => {
|
|
121
|
+
const labelSize = this.labelSize();
|
|
122
|
+
const classes = this.userClass();
|
|
123
|
+
const variantClasses = checkboxContainerLabelThemeVariants({ labelSize });
|
|
124
|
+
return twMerge(variantClasses, classes);
|
|
125
|
+
}, ...ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []);
|
|
126
|
+
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
127
|
+
this.indeterminateState = linkedSignal(() => this.indeterminate(), ...ngDevMode ? [{ debugName: "indeterminateState" }] : /* istanbul ignore next */ []);
|
|
128
|
+
this.inputRef = viewChild.required("checkBox", ...ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []);
|
|
129
|
+
this.invalidState = computed(() => this.touched() && (this.invalid() || this.required() && !this.checked()), ...ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []);
|
|
130
|
+
this.labelledBy = this.#label.labelledBy;
|
|
131
|
+
this.ariaDescribedBy = input("", {
|
|
132
|
+
...ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {},
|
|
133
|
+
alias: "aria-describedby"
|
|
134
|
+
});
|
|
135
|
+
this.ariaLabel = input("", {
|
|
136
|
+
...ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {},
|
|
137
|
+
alias: "aria-label"
|
|
138
|
+
});
|
|
139
|
+
this.ariaLabelledBy = input("", {
|
|
140
|
+
...ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {},
|
|
141
|
+
alias: "aria-labelledby"
|
|
142
|
+
});
|
|
143
|
+
this.checked = model(false, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
|
|
144
|
+
this.disabled = input(false, {
|
|
145
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
146
|
+
transform: booleanAttribute
|
|
147
|
+
});
|
|
148
|
+
this.indeterminate = input(false, {
|
|
149
|
+
...ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {},
|
|
150
|
+
transform: booleanAttribute
|
|
151
|
+
});
|
|
152
|
+
this.indeterminateChange = output();
|
|
153
|
+
this.inputBlur = output();
|
|
154
|
+
this.inputChange = output();
|
|
155
|
+
this.inputFocus = output();
|
|
156
|
+
this.inputId = input(createElementControlId(), ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
|
|
157
|
+
this.invalid = input(false, {
|
|
158
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
159
|
+
transform: booleanAttribute
|
|
160
|
+
});
|
|
161
|
+
this.label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
162
|
+
this.labelPosition = input("after", ...ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []);
|
|
163
|
+
this.labelSize = input("medium", ...ngDevMode ? [{ debugName: "labelSize" }] : /* istanbul ignore next */ []);
|
|
164
|
+
this.name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
165
|
+
this.readonly = input(false, {
|
|
166
|
+
...ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {},
|
|
167
|
+
transform: booleanAttribute
|
|
168
|
+
});
|
|
169
|
+
this.required = input(false, {
|
|
170
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
171
|
+
transform: booleanAttribute
|
|
172
|
+
});
|
|
173
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
174
|
+
this.tabIndex = input(0, ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
|
|
175
|
+
this.touch = output();
|
|
176
|
+
this.touched = input(false, {
|
|
177
|
+
...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
|
|
178
|
+
transform: booleanAttribute
|
|
179
|
+
});
|
|
180
|
+
this.userClass = input("", {
|
|
181
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
182
|
+
alias: "class"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
#label;
|
|
186
|
+
activateFromLabel() {
|
|
187
|
+
const input = this.inputRef().nativeElement;
|
|
188
|
+
input.focus();
|
|
189
|
+
input.click();
|
|
190
|
+
}
|
|
191
|
+
focus(options) {
|
|
192
|
+
this.inputRef().nativeElement.focus(options);
|
|
193
|
+
}
|
|
194
|
+
setLabelledBy(id) {
|
|
195
|
+
this.#label.setLabelledBy(id);
|
|
196
|
+
}
|
|
197
|
+
onInputBlur(event) {
|
|
198
|
+
this.inputBlur.emit(event);
|
|
199
|
+
this.touch.emit();
|
|
200
|
+
}
|
|
201
|
+
onInputChange(event) {
|
|
202
|
+
const checked = event.target.checked;
|
|
203
|
+
if (this.indeterminateState()) {
|
|
204
|
+
this.indeterminateState.set(false);
|
|
205
|
+
this.indeterminateChange.emit(false);
|
|
206
|
+
}
|
|
207
|
+
this.checked.set(checked);
|
|
208
|
+
this.inputChange.emit(event);
|
|
209
|
+
this.touch.emit();
|
|
210
|
+
}
|
|
211
|
+
onInputClick(event) {
|
|
212
|
+
if (this.readonly()) event.preventDefault();
|
|
213
|
+
}
|
|
214
|
+
static {
|
|
215
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
216
|
+
minVersion: "12.0.0",
|
|
217
|
+
version: "22.2.6",
|
|
218
|
+
ngImport: i0,
|
|
219
|
+
type: CheckBoxComponent,
|
|
220
|
+
deps: [],
|
|
221
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
static {
|
|
225
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
226
|
+
minVersion: "17.0.0",
|
|
227
|
+
version: "22.2.6",
|
|
228
|
+
type: CheckBoxComponent,
|
|
229
|
+
isStandalone: true,
|
|
230
|
+
selector: "mona-check-box",
|
|
231
|
+
inputs: {
|
|
232
|
+
ariaDescribedBy: {
|
|
233
|
+
classPropertyName: "ariaDescribedBy",
|
|
234
|
+
publicName: "aria-describedby",
|
|
235
|
+
isSignal: true,
|
|
236
|
+
isRequired: false,
|
|
237
|
+
transformFunction: null
|
|
238
|
+
},
|
|
239
|
+
ariaLabel: {
|
|
240
|
+
classPropertyName: "ariaLabel",
|
|
241
|
+
publicName: "aria-label",
|
|
242
|
+
isSignal: true,
|
|
243
|
+
isRequired: false,
|
|
244
|
+
transformFunction: null
|
|
245
|
+
},
|
|
246
|
+
ariaLabelledBy: {
|
|
247
|
+
classPropertyName: "ariaLabelledBy",
|
|
248
|
+
publicName: "aria-labelledby",
|
|
249
|
+
isSignal: true,
|
|
250
|
+
isRequired: false,
|
|
251
|
+
transformFunction: null
|
|
252
|
+
},
|
|
253
|
+
checked: {
|
|
254
|
+
classPropertyName: "checked",
|
|
255
|
+
publicName: "checked",
|
|
256
|
+
isSignal: true,
|
|
257
|
+
isRequired: false,
|
|
258
|
+
transformFunction: null
|
|
259
|
+
},
|
|
260
|
+
disabled: {
|
|
261
|
+
classPropertyName: "disabled",
|
|
262
|
+
publicName: "disabled",
|
|
263
|
+
isSignal: true,
|
|
264
|
+
isRequired: false,
|
|
265
|
+
transformFunction: null
|
|
266
|
+
},
|
|
267
|
+
indeterminate: {
|
|
268
|
+
classPropertyName: "indeterminate",
|
|
269
|
+
publicName: "indeterminate",
|
|
270
|
+
isSignal: true,
|
|
271
|
+
isRequired: false,
|
|
272
|
+
transformFunction: null
|
|
273
|
+
},
|
|
274
|
+
inputId: {
|
|
275
|
+
classPropertyName: "inputId",
|
|
276
|
+
publicName: "inputId",
|
|
277
|
+
isSignal: true,
|
|
278
|
+
isRequired: false,
|
|
279
|
+
transformFunction: null
|
|
280
|
+
},
|
|
281
|
+
invalid: {
|
|
282
|
+
classPropertyName: "invalid",
|
|
283
|
+
publicName: "invalid",
|
|
284
|
+
isSignal: true,
|
|
285
|
+
isRequired: false,
|
|
286
|
+
transformFunction: null
|
|
287
|
+
},
|
|
288
|
+
label: {
|
|
289
|
+
classPropertyName: "label",
|
|
290
|
+
publicName: "label",
|
|
291
|
+
isSignal: true,
|
|
292
|
+
isRequired: false,
|
|
293
|
+
transformFunction: null
|
|
294
|
+
},
|
|
295
|
+
labelPosition: {
|
|
296
|
+
classPropertyName: "labelPosition",
|
|
297
|
+
publicName: "labelPosition",
|
|
298
|
+
isSignal: true,
|
|
299
|
+
isRequired: false,
|
|
300
|
+
transformFunction: null
|
|
301
|
+
},
|
|
302
|
+
labelSize: {
|
|
303
|
+
classPropertyName: "labelSize",
|
|
304
|
+
publicName: "labelSize",
|
|
305
|
+
isSignal: true,
|
|
306
|
+
isRequired: false,
|
|
307
|
+
transformFunction: null
|
|
308
|
+
},
|
|
309
|
+
name: {
|
|
310
|
+
classPropertyName: "name",
|
|
311
|
+
publicName: "name",
|
|
312
|
+
isSignal: true,
|
|
313
|
+
isRequired: false,
|
|
314
|
+
transformFunction: null
|
|
315
|
+
},
|
|
316
|
+
readonly: {
|
|
317
|
+
classPropertyName: "readonly",
|
|
318
|
+
publicName: "readonly",
|
|
319
|
+
isSignal: true,
|
|
320
|
+
isRequired: false,
|
|
321
|
+
transformFunction: null
|
|
322
|
+
},
|
|
323
|
+
required: {
|
|
324
|
+
classPropertyName: "required",
|
|
325
|
+
publicName: "required",
|
|
326
|
+
isSignal: true,
|
|
327
|
+
isRequired: false,
|
|
328
|
+
transformFunction: null
|
|
329
|
+
},
|
|
330
|
+
rounded: {
|
|
331
|
+
classPropertyName: "rounded",
|
|
332
|
+
publicName: "rounded",
|
|
333
|
+
isSignal: true,
|
|
334
|
+
isRequired: false,
|
|
335
|
+
transformFunction: null
|
|
336
|
+
},
|
|
337
|
+
tabIndex: {
|
|
338
|
+
classPropertyName: "tabIndex",
|
|
339
|
+
publicName: "tabIndex",
|
|
340
|
+
isSignal: true,
|
|
341
|
+
isRequired: false,
|
|
342
|
+
transformFunction: null
|
|
343
|
+
},
|
|
344
|
+
touched: {
|
|
345
|
+
classPropertyName: "touched",
|
|
346
|
+
publicName: "touched",
|
|
347
|
+
isSignal: true,
|
|
348
|
+
isRequired: false,
|
|
349
|
+
transformFunction: null
|
|
350
|
+
},
|
|
351
|
+
userClass: {
|
|
352
|
+
classPropertyName: "userClass",
|
|
353
|
+
publicName: "class",
|
|
354
|
+
isSignal: true,
|
|
355
|
+
isRequired: false,
|
|
356
|
+
transformFunction: null
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
outputs: {
|
|
360
|
+
checked: "checkedChange",
|
|
361
|
+
indeterminateChange: "indeterminateChange",
|
|
362
|
+
inputBlur: "inputBlur",
|
|
363
|
+
inputChange: "inputChange",
|
|
364
|
+
inputFocus: "inputFocus",
|
|
365
|
+
touch: "touch"
|
|
366
|
+
},
|
|
367
|
+
host: { properties: {
|
|
368
|
+
"attr.aria-describedby": "null",
|
|
369
|
+
"attr.aria-label": "null",
|
|
370
|
+
"attr.aria-labelledby": "null",
|
|
371
|
+
"attr.data-readonly": "readonly() || null",
|
|
372
|
+
"class": "'flex'",
|
|
373
|
+
"attr.data-checked": "checked()",
|
|
374
|
+
"attr.data-disabled": "effectiveDisabled()",
|
|
375
|
+
"attr.data-indeterminate": "indeterminateState()"
|
|
376
|
+
} },
|
|
377
|
+
viewQueries: [{
|
|
378
|
+
propertyName: "inputRef",
|
|
379
|
+
first: true,
|
|
380
|
+
predicate: ["checkBox"],
|
|
381
|
+
descendants: true,
|
|
382
|
+
isSignal: true
|
|
383
|
+
}],
|
|
384
|
+
ngImport: i0,
|
|
385
|
+
template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"readonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"effectiveDisabled()\"\n [indeterminate]=\"indeterminateState()\"\n [required]=\"required()\"\n [checked]=\"checked()\"\n [tabindex]=\"effectiveDisabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminateState() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked() && !indeterminateState()) {\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 forced-colors:stroke-[CanvasText]\">\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",
|
|
386
|
+
dependencies: [{
|
|
387
|
+
kind: "directive",
|
|
388
|
+
type: NgTemplateOutlet,
|
|
389
|
+
selector: "[ngTemplateOutlet]",
|
|
390
|
+
inputs: [
|
|
391
|
+
"ngTemplateOutletContext",
|
|
392
|
+
"ngTemplateOutlet",
|
|
393
|
+
"ngTemplateOutletInjector"
|
|
394
|
+
]
|
|
395
|
+
}]
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
400
|
+
minVersion: "12.0.0",
|
|
401
|
+
version: "22.2.6",
|
|
402
|
+
ngImport: i0,
|
|
403
|
+
type: CheckBoxComponent,
|
|
404
|
+
decorators: [{
|
|
405
|
+
type: Component,
|
|
406
|
+
args: [{
|
|
407
|
+
selector: "mona-check-box",
|
|
408
|
+
imports: [NgTemplateOutlet],
|
|
409
|
+
host: {
|
|
410
|
+
"[attr.aria-describedby]": "null",
|
|
411
|
+
"[attr.aria-label]": "null",
|
|
412
|
+
"[attr.aria-labelledby]": "null",
|
|
413
|
+
"[attr.data-readonly]": "readonly() || null",
|
|
414
|
+
"[class]": "'flex'",
|
|
415
|
+
"[attr.data-checked]": "checked()",
|
|
416
|
+
"[attr.data-disabled]": "effectiveDisabled()",
|
|
417
|
+
"[attr.data-indeterminate]": "indeterminateState()"
|
|
418
|
+
},
|
|
419
|
+
template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"readonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"effectiveDisabled()\"\n [indeterminate]=\"indeterminateState()\"\n [required]=\"required()\"\n [checked]=\"checked()\"\n [tabindex]=\"effectiveDisabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminateState() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked() && !indeterminateState()) {\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 forced-colors:stroke-[CanvasText]\">\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"
|
|
420
|
+
}]
|
|
421
|
+
}],
|
|
422
|
+
propDecorators: {
|
|
423
|
+
inputRef: [{
|
|
424
|
+
type: i0.ViewChild,
|
|
425
|
+
args: ["checkBox", { isSignal: true }]
|
|
426
|
+
}],
|
|
427
|
+
ariaDescribedBy: [{
|
|
428
|
+
type: i0.Input,
|
|
429
|
+
args: [{
|
|
430
|
+
isSignal: true,
|
|
431
|
+
alias: "aria-describedby",
|
|
432
|
+
required: false
|
|
433
|
+
}]
|
|
434
|
+
}],
|
|
435
|
+
ariaLabel: [{
|
|
436
|
+
type: i0.Input,
|
|
437
|
+
args: [{
|
|
438
|
+
isSignal: true,
|
|
439
|
+
alias: "aria-label",
|
|
440
|
+
required: false
|
|
441
|
+
}]
|
|
442
|
+
}],
|
|
443
|
+
ariaLabelledBy: [{
|
|
444
|
+
type: i0.Input,
|
|
445
|
+
args: [{
|
|
446
|
+
isSignal: true,
|
|
447
|
+
alias: "aria-labelledby",
|
|
448
|
+
required: false
|
|
449
|
+
}]
|
|
450
|
+
}],
|
|
451
|
+
checked: [{
|
|
452
|
+
type: i0.Input,
|
|
453
|
+
args: [{
|
|
454
|
+
isSignal: true,
|
|
455
|
+
alias: "checked",
|
|
456
|
+
required: false
|
|
457
|
+
}]
|
|
458
|
+
}, {
|
|
459
|
+
type: i0.Output,
|
|
460
|
+
args: ["checkedChange"]
|
|
461
|
+
}],
|
|
462
|
+
disabled: [{
|
|
463
|
+
type: i0.Input,
|
|
464
|
+
args: [{
|
|
465
|
+
isSignal: true,
|
|
466
|
+
alias: "disabled",
|
|
467
|
+
required: false
|
|
468
|
+
}]
|
|
469
|
+
}],
|
|
470
|
+
indeterminate: [{
|
|
471
|
+
type: i0.Input,
|
|
472
|
+
args: [{
|
|
473
|
+
isSignal: true,
|
|
474
|
+
alias: "indeterminate",
|
|
475
|
+
required: false
|
|
476
|
+
}]
|
|
477
|
+
}],
|
|
478
|
+
indeterminateChange: [{
|
|
479
|
+
type: i0.Output,
|
|
480
|
+
args: ["indeterminateChange"]
|
|
481
|
+
}],
|
|
482
|
+
inputBlur: [{
|
|
483
|
+
type: i0.Output,
|
|
484
|
+
args: ["inputBlur"]
|
|
485
|
+
}],
|
|
486
|
+
inputChange: [{
|
|
487
|
+
type: i0.Output,
|
|
488
|
+
args: ["inputChange"]
|
|
489
|
+
}],
|
|
490
|
+
inputFocus: [{
|
|
491
|
+
type: i0.Output,
|
|
492
|
+
args: ["inputFocus"]
|
|
493
|
+
}],
|
|
494
|
+
inputId: [{
|
|
495
|
+
type: i0.Input,
|
|
496
|
+
args: [{
|
|
497
|
+
isSignal: true,
|
|
498
|
+
alias: "inputId",
|
|
499
|
+
required: false
|
|
500
|
+
}]
|
|
501
|
+
}],
|
|
502
|
+
invalid: [{
|
|
503
|
+
type: i0.Input,
|
|
504
|
+
args: [{
|
|
505
|
+
isSignal: true,
|
|
506
|
+
alias: "invalid",
|
|
507
|
+
required: false
|
|
508
|
+
}]
|
|
509
|
+
}],
|
|
510
|
+
label: [{
|
|
511
|
+
type: i0.Input,
|
|
512
|
+
args: [{
|
|
513
|
+
isSignal: true,
|
|
514
|
+
alias: "label",
|
|
515
|
+
required: false
|
|
516
|
+
}]
|
|
517
|
+
}],
|
|
518
|
+
labelPosition: [{
|
|
519
|
+
type: i0.Input,
|
|
520
|
+
args: [{
|
|
521
|
+
isSignal: true,
|
|
522
|
+
alias: "labelPosition",
|
|
523
|
+
required: false
|
|
524
|
+
}]
|
|
525
|
+
}],
|
|
526
|
+
labelSize: [{
|
|
527
|
+
type: i0.Input,
|
|
528
|
+
args: [{
|
|
529
|
+
isSignal: true,
|
|
530
|
+
alias: "labelSize",
|
|
531
|
+
required: false
|
|
532
|
+
}]
|
|
533
|
+
}],
|
|
534
|
+
name: [{
|
|
535
|
+
type: i0.Input,
|
|
536
|
+
args: [{
|
|
537
|
+
isSignal: true,
|
|
538
|
+
alias: "name",
|
|
539
|
+
required: false
|
|
540
|
+
}]
|
|
541
|
+
}],
|
|
542
|
+
readonly: [{
|
|
543
|
+
type: i0.Input,
|
|
544
|
+
args: [{
|
|
545
|
+
isSignal: true,
|
|
546
|
+
alias: "readonly",
|
|
547
|
+
required: false
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
required: [{
|
|
551
|
+
type: i0.Input,
|
|
552
|
+
args: [{
|
|
553
|
+
isSignal: true,
|
|
554
|
+
alias: "required",
|
|
555
|
+
required: false
|
|
556
|
+
}]
|
|
557
|
+
}],
|
|
558
|
+
rounded: [{
|
|
559
|
+
type: i0.Input,
|
|
560
|
+
args: [{
|
|
561
|
+
isSignal: true,
|
|
562
|
+
alias: "rounded",
|
|
563
|
+
required: false
|
|
564
|
+
}]
|
|
565
|
+
}],
|
|
566
|
+
tabIndex: [{
|
|
567
|
+
type: i0.Input,
|
|
568
|
+
args: [{
|
|
569
|
+
isSignal: true,
|
|
570
|
+
alias: "tabIndex",
|
|
571
|
+
required: false
|
|
572
|
+
}]
|
|
573
|
+
}],
|
|
574
|
+
touch: [{
|
|
575
|
+
type: i0.Output,
|
|
576
|
+
args: ["touch"]
|
|
577
|
+
}],
|
|
578
|
+
touched: [{
|
|
579
|
+
type: i0.Input,
|
|
580
|
+
args: [{
|
|
581
|
+
isSignal: true,
|
|
582
|
+
alias: "touched",
|
|
583
|
+
required: false
|
|
584
|
+
}]
|
|
585
|
+
}],
|
|
586
|
+
userClass: [{
|
|
587
|
+
type: i0.Input,
|
|
588
|
+
args: [{
|
|
589
|
+
isSignal: true,
|
|
590
|
+
alias: "class",
|
|
591
|
+
required: false
|
|
592
|
+
}]
|
|
593
|
+
}]
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
var CheckboxDirective = class CheckboxDirective {
|
|
597
|
+
constructor() {
|
|
598
|
+
this.classes = computed(() => {
|
|
599
|
+
const rounded = this.rounded();
|
|
600
|
+
const variantClasses = checkboxDirectiveThemeVariants({ rounded });
|
|
601
|
+
const userClass = this.userClass();
|
|
602
|
+
return twMerge(variantClasses, userClass);
|
|
603
|
+
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
604
|
+
this.inputInvalid = computed(() => this.touched() && this.invalid(), ...ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []);
|
|
605
|
+
this.invalid = input(false, {
|
|
606
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
607
|
+
transform: booleanAttribute
|
|
608
|
+
});
|
|
609
|
+
this.rounded = input("medium", ...ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []);
|
|
610
|
+
this.touched = input(false, {
|
|
611
|
+
...ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {},
|
|
612
|
+
transform: booleanAttribute
|
|
613
|
+
});
|
|
614
|
+
this.userClass = input("", {
|
|
615
|
+
...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
|
|
616
|
+
alias: "class"
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
static {
|
|
620
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
621
|
+
minVersion: "12.0.0",
|
|
622
|
+
version: "22.2.6",
|
|
623
|
+
ngImport: i0,
|
|
624
|
+
type: CheckboxDirective,
|
|
625
|
+
deps: [],
|
|
626
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
static {
|
|
630
|
+
this.ɵdir = i0.ɵɵngDeclareDirective({
|
|
631
|
+
minVersion: "17.1.0",
|
|
632
|
+
version: "22.2.6",
|
|
633
|
+
type: CheckboxDirective,
|
|
634
|
+
isStandalone: true,
|
|
635
|
+
selector: "input[type='checkbox'][monaCheckbox]",
|
|
636
|
+
inputs: {
|
|
637
|
+
invalid: {
|
|
638
|
+
classPropertyName: "invalid",
|
|
639
|
+
publicName: "invalid",
|
|
640
|
+
isSignal: true,
|
|
641
|
+
isRequired: false,
|
|
642
|
+
transformFunction: null
|
|
643
|
+
},
|
|
644
|
+
rounded: {
|
|
645
|
+
classPropertyName: "rounded",
|
|
646
|
+
publicName: "rounded",
|
|
647
|
+
isSignal: true,
|
|
648
|
+
isRequired: false,
|
|
649
|
+
transformFunction: null
|
|
650
|
+
},
|
|
651
|
+
touched: {
|
|
652
|
+
classPropertyName: "touched",
|
|
653
|
+
publicName: "touched",
|
|
654
|
+
isSignal: true,
|
|
655
|
+
isRequired: false,
|
|
656
|
+
transformFunction: null
|
|
657
|
+
},
|
|
658
|
+
userClass: {
|
|
659
|
+
classPropertyName: "userClass",
|
|
660
|
+
publicName: "class",
|
|
661
|
+
isSignal: true,
|
|
662
|
+
isRequired: false,
|
|
663
|
+
transformFunction: null
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
host: { properties: {
|
|
667
|
+
"attr.aria-invalid": "inputInvalid() || null",
|
|
668
|
+
"attr.data-invalid": "inputInvalid() || null",
|
|
669
|
+
"class": "classes()"
|
|
670
|
+
} },
|
|
671
|
+
ngImport: i0
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
676
|
+
minVersion: "12.0.0",
|
|
677
|
+
version: "22.2.6",
|
|
678
|
+
ngImport: i0,
|
|
679
|
+
type: CheckboxDirective,
|
|
680
|
+
decorators: [{
|
|
681
|
+
type: Directive,
|
|
682
|
+
args: [{
|
|
683
|
+
selector: "input[type='checkbox'][monaCheckbox]",
|
|
684
|
+
host: {
|
|
685
|
+
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
686
|
+
"[attr.data-invalid]": "inputInvalid() || null",
|
|
687
|
+
"[class]": "classes()"
|
|
688
|
+
}
|
|
689
|
+
}]
|
|
690
|
+
}],
|
|
691
|
+
propDecorators: {
|
|
692
|
+
invalid: [{
|
|
693
|
+
type: i0.Input,
|
|
694
|
+
args: [{
|
|
695
|
+
isSignal: true,
|
|
696
|
+
alias: "invalid",
|
|
697
|
+
required: false
|
|
698
|
+
}]
|
|
699
|
+
}],
|
|
700
|
+
rounded: [{
|
|
701
|
+
type: i0.Input,
|
|
702
|
+
args: [{
|
|
703
|
+
isSignal: true,
|
|
704
|
+
alias: "rounded",
|
|
705
|
+
required: false
|
|
706
|
+
}]
|
|
707
|
+
}],
|
|
708
|
+
touched: [{
|
|
709
|
+
type: i0.Input,
|
|
710
|
+
args: [{
|
|
711
|
+
isSignal: true,
|
|
712
|
+
alias: "touched",
|
|
713
|
+
required: false
|
|
714
|
+
}]
|
|
715
|
+
}],
|
|
716
|
+
userClass: [{
|
|
717
|
+
type: i0.Input,
|
|
718
|
+
args: [{
|
|
719
|
+
isSignal: true,
|
|
720
|
+
alias: "class",
|
|
721
|
+
required: false
|
|
722
|
+
}]
|
|
723
|
+
}]
|
|
724
|
+
}
|
|
118
725
|
});
|
|
119
|
-
|
|
120
|
-
class CheckBoxComponent {
|
|
121
|
-
constructor() {
|
|
122
|
-
this.#label = injectLabelAssociation({
|
|
123
|
-
ariaLabel: () => this.ariaLabel(),
|
|
124
|
-
ariaLabelledBy: () => this.ariaLabelledBy(),
|
|
125
|
-
wrapped: false
|
|
126
|
-
});
|
|
127
|
-
this.checkBoxClasses = computed(() => {
|
|
128
|
-
return checkboxInputThemeVariants();
|
|
129
|
-
}, /* @ts-ignore */
|
|
130
|
-
...(ngDevMode ? [{ debugName: "checkBoxClasses" }] : /* istanbul ignore next */ []));
|
|
131
|
-
this.checkMarkClasses = computed(() => {
|
|
132
|
-
const rounded = this.rounded();
|
|
133
|
-
return checkmarkThemeVariants({ rounded });
|
|
134
|
-
}, /* @ts-ignore */
|
|
135
|
-
...(ngDevMode ? [{ debugName: "checkMarkClasses" }] : /* istanbul ignore next */ []));
|
|
136
|
-
this.containerLabelClasses = computed(() => {
|
|
137
|
-
const labelSize = this.labelSize();
|
|
138
|
-
const classes = this.userClass();
|
|
139
|
-
const variantClasses = checkboxContainerLabelThemeVariants({ labelSize });
|
|
140
|
-
return twMerge(variantClasses, classes);
|
|
141
|
-
}, /* @ts-ignore */
|
|
142
|
-
...(ngDevMode ? [{ debugName: "containerLabelClasses" }] : /* istanbul ignore next */ []));
|
|
143
|
-
this.effectiveDisabled = injectEffectiveDisabled(() => this.disabled());
|
|
144
|
-
this.indeterminateState = linkedSignal(() => this.indeterminate(), /* @ts-ignore */
|
|
145
|
-
...(ngDevMode ? [{ debugName: "indeterminateState" }] : /* istanbul ignore next */ []));
|
|
146
|
-
this.inputRef = viewChild.required("checkBox", /* @ts-ignore */
|
|
147
|
-
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
148
|
-
this.invalidState = computed(() => this.touched() && (this.invalid() || (this.required() && !this.checked())), /* @ts-ignore */
|
|
149
|
-
...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
|
|
150
|
-
this.labelledBy = this.#label.labelledBy;
|
|
151
|
-
/**
|
|
152
|
-
* @description Id of an element that describes the check box, such as an error message.
|
|
153
|
-
* @default ""
|
|
154
|
-
*/
|
|
155
|
-
this.ariaDescribedBy = input("", { ...(ngDevMode ? { debugName: "ariaDescribedBy" } : /* istanbul ignore next */ {}), alias: "aria-describedby" });
|
|
156
|
-
/**
|
|
157
|
-
* @description Accessible name of the check box when it has no visible label.
|
|
158
|
-
* @default ""
|
|
159
|
-
*/
|
|
160
|
-
this.ariaLabel = input("", { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: "aria-label" });
|
|
161
|
-
/**
|
|
162
|
-
* @description Id of the element that labels the check box.
|
|
163
|
-
* @default ""
|
|
164
|
-
*/
|
|
165
|
-
this.ariaLabelledBy = input("", { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: "aria-labelledby" });
|
|
166
|
-
/**
|
|
167
|
-
* @description Whether the control is checked.
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
this.checked = model(false, /* @ts-ignore */
|
|
171
|
-
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
172
|
-
/**
|
|
173
|
-
* @description Renders the component with reduced visual emphasis and removes pointer interaction.
|
|
174
|
-
* @default false
|
|
175
|
-
*/
|
|
176
|
-
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
177
|
-
/**
|
|
178
|
-
* @description Activates indeterminate mode, showing a dash instead of a checkmark. A user change clears it, as it
|
|
179
|
-
* does on a native checkbox. Use `[(indeterminate)]` to follow that, because a one-way binding only writes again when
|
|
180
|
-
* the bound value changes.
|
|
181
|
-
* @default false
|
|
182
|
-
*/
|
|
183
|
-
this.indeterminate = input(false, { ...(ngDevMode ? { debugName: "indeterminate" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
184
|
-
/**
|
|
185
|
-
* @description Emitted with `false` when a user change clears the indeterminate mode.
|
|
186
|
-
*/
|
|
187
|
-
this.indeterminateChange = output();
|
|
188
|
-
/**
|
|
189
|
-
* @description Emitted when the checkbox input loses focus.
|
|
190
|
-
*/
|
|
191
|
-
this.inputBlur = output();
|
|
192
|
-
/**
|
|
193
|
-
* @description Emitted when the checkbox value changes.
|
|
194
|
-
*/
|
|
195
|
-
this.inputChange = output();
|
|
196
|
-
/**
|
|
197
|
-
* @description Emitted when the checkbox input gains focus.
|
|
198
|
-
*/
|
|
199
|
-
this.inputFocus = output();
|
|
200
|
-
/**
|
|
201
|
-
* @description Id of the native checkbox input. Point a `<label for>` at it to label the check box from outside.
|
|
202
|
-
* A unique id is generated when it isn't set.
|
|
203
|
-
* @default generated
|
|
204
|
-
*/
|
|
205
|
-
this.inputId = input(createElementControlId(), /* @ts-ignore */
|
|
206
|
-
...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
207
|
-
/**
|
|
208
|
-
* @description Marks the checkbox as invalid. When bound to a signal form field via `[formField]`, this is written
|
|
209
|
-
* by the `FormField` directive.
|
|
210
|
-
* @default false
|
|
211
|
-
*/
|
|
212
|
-
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
213
|
-
/**
|
|
214
|
-
* @description Text label displayed alongside the checkbox. When provided, takes precedence over projected content.
|
|
215
|
-
* @default ""
|
|
216
|
-
*/
|
|
217
|
-
this.label = input("", /* @ts-ignore */
|
|
218
|
-
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
219
|
-
/**
|
|
220
|
-
* @description Position of the label relative to the checkbox.
|
|
221
|
-
* @default "after"
|
|
222
|
-
*/
|
|
223
|
-
this.labelPosition = input("after", /* @ts-ignore */
|
|
224
|
-
...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
225
|
-
/**
|
|
226
|
-
* @description Controls the font size of the label text.
|
|
227
|
-
* @default "medium"
|
|
228
|
-
*/
|
|
229
|
-
this.labelSize = input("medium", /* @ts-ignore */
|
|
230
|
-
...(ngDevMode ? [{ debugName: "labelSize" }] : /* istanbul ignore next */ []));
|
|
231
|
-
/**
|
|
232
|
-
* @description Name of the native checkbox input, used in native form submission. When bound to a signal form field
|
|
233
|
-
* via `[formField]`, this is written by the `FormField` directive.
|
|
234
|
-
* @default ""
|
|
235
|
-
*/
|
|
236
|
-
this.name = input("", /* @ts-ignore */
|
|
237
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
238
|
-
/**
|
|
239
|
-
* @description Prevents value changes while the control stays focusable and readable. When bound to a signal form
|
|
240
|
-
* field via `[formField]`, this is written by the `FormField` directive.
|
|
241
|
-
* @default false
|
|
242
|
-
*/
|
|
243
|
-
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
244
|
-
/**
|
|
245
|
-
* @description Marks the control as required for form validation.
|
|
246
|
-
* @default false
|
|
247
|
-
*/
|
|
248
|
-
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
249
|
-
/**
|
|
250
|
-
* @description Border-radius preset applied to the checkmark box.
|
|
251
|
-
* @default "medium"
|
|
252
|
-
*/
|
|
253
|
-
this.rounded = input("medium", /* @ts-ignore */
|
|
254
|
-
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
255
|
-
/**
|
|
256
|
-
* @description Tab index of the native checkbox input.
|
|
257
|
-
* @default 0
|
|
258
|
-
*/
|
|
259
|
-
this.tabIndex = input(0, /* @ts-ignore */
|
|
260
|
-
...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
261
|
-
/**
|
|
262
|
-
* @description Emitted when the checkbox loses focus or its value changes.
|
|
263
|
-
*/
|
|
264
|
-
this.touch = output();
|
|
265
|
-
/**
|
|
266
|
-
* @description Marks the checkbox as touched. When bound to a signal form field via `[formField]`, this is written
|
|
267
|
-
* by the `FormField` directive.
|
|
268
|
-
* @default false
|
|
269
|
-
*/
|
|
270
|
-
this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
271
|
-
/**
|
|
272
|
-
* @description Additional CSS classes merged onto the label container via `tailwind-merge`.
|
|
273
|
-
* @default ""
|
|
274
|
-
*/
|
|
275
|
-
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
276
|
-
}
|
|
277
|
-
#label;
|
|
278
|
-
/**
|
|
279
|
-
* Toggles the check box when a label pointing at it through `[for]` is clicked.
|
|
280
|
-
* @internal
|
|
281
|
-
*/
|
|
282
|
-
activateFromLabel() {
|
|
283
|
-
const input = this.inputRef().nativeElement;
|
|
284
|
-
input.focus();
|
|
285
|
-
input.click();
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* @description Moves focus to the native checkbox input.
|
|
289
|
-
* @param options Options passed to the native `focus()` call, such as `preventScroll`.
|
|
290
|
-
*/
|
|
291
|
-
focus(options) {
|
|
292
|
-
this.inputRef().nativeElement.focus(options);
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* @internal
|
|
296
|
-
*/
|
|
297
|
-
setLabelledBy(id) {
|
|
298
|
-
this.#label.setLabelledBy(id);
|
|
299
|
-
}
|
|
300
|
-
onInputBlur(event) {
|
|
301
|
-
this.inputBlur.emit(event);
|
|
302
|
-
this.touch.emit();
|
|
303
|
-
}
|
|
304
|
-
onInputChange(event) {
|
|
305
|
-
const checked = event.target.checked;
|
|
306
|
-
if (this.indeterminateState()) {
|
|
307
|
-
this.indeterminateState.set(false);
|
|
308
|
-
this.indeterminateChange.emit(false);
|
|
309
|
-
}
|
|
310
|
-
this.checked.set(checked);
|
|
311
|
-
this.inputChange.emit(event);
|
|
312
|
-
this.touch.emit();
|
|
313
|
-
}
|
|
314
|
-
onInputClick(event) {
|
|
315
|
-
// Canceling the click makes the browser restore the checked and indeterminate states.
|
|
316
|
-
if (this.readonly()) {
|
|
317
|
-
event.preventDefault();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
321
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: CheckBoxComponent, isStandalone: true, selector: "mona-check-box", inputs: { ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, 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 }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, labelSize: { classPropertyName: "labelSize", publicName: "labelSize", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, 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", indeterminateChange: "indeterminateChange", inputBlur: "inputBlur", inputChange: "inputChange", inputFocus: "inputFocus", touch: "touch" }, host: { properties: { "attr.aria-describedby": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.data-readonly": "readonly() || null", "class": "'flex'", "attr.data-checked": "checked()", "attr.data-disabled": "effectiveDisabled()", "attr.data-indeterminate": "indeterminateState()" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"readonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"effectiveDisabled()\"\n [indeterminate]=\"indeterminateState()\"\n [required]=\"required()\"\n [checked]=\"checked()\"\n [tabindex]=\"effectiveDisabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminateState() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked() && !indeterminateState()) {\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 forced-colors:stroke-[CanvasText]\">\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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
322
|
-
}
|
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckBoxComponent, decorators: [{
|
|
324
|
-
type: Component,
|
|
325
|
-
args: [{ selector: "mona-check-box", imports: [NgTemplateOutlet], host: {
|
|
326
|
-
// The ARIA inputs below are applied to the native input, so the host must not keep the static attributes.
|
|
327
|
-
"[attr.aria-describedby]": "null",
|
|
328
|
-
"[attr.aria-label]": "null",
|
|
329
|
-
"[attr.aria-labelledby]": "null",
|
|
330
|
-
"[attr.data-readonly]": "readonly() || null",
|
|
331
|
-
"[class]": "'flex'",
|
|
332
|
-
"[attr.data-checked]": "checked()",
|
|
333
|
-
"[attr.data-disabled]": "effectiveDisabled()",
|
|
334
|
-
"[attr.data-indeterminate]": "indeterminateState()"
|
|
335
|
-
}, template: "<label\n [class]=\"containerLabelClasses()\"\n [attr.data-disabled]=\"effectiveDisabled()\"\n [attr.data-readonly]=\"readonly() || null\">\n @if (labelPosition() === \"before\") {\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n }\n\n <input\n type=\"checkbox\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [disabled]=\"effectiveDisabled()\"\n [indeterminate]=\"indeterminateState()\"\n [required]=\"required()\"\n [checked]=\"checked()\"\n [tabindex]=\"effectiveDisabled() ? -1 : tabIndex()\"\n [class]=\"checkBoxClasses()\"\n [attr.aria-checked]=\"indeterminateState() ? 'mixed' : null\"\n [attr.aria-invalid]=\"invalidState() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel() || label() || null\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-describedby]=\"ariaDescribedBy() || null\"\n [attr.aria-readonly]=\"readonly() ? 'true' : null\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur($event)\"\n (focus)=\"inputFocus.emit($event)\"\n #checkBox />\n\n <span [class]=\"checkMarkClasses()\" [attr.data-invalid]=\"invalidState() || null\" aria-hidden=\"true\">\n @if (checked() && !indeterminateState()) {\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 forced-colors:stroke-[CanvasText]\">\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" }]
|
|
336
|
-
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ["checkBox", { isSignal: true }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], 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 }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], indeterminateChange: [{ type: i0.Output, args: ["indeterminateChange"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputChange: [{ type: i0.Output, args: ["inputChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], labelSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelSize", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", 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 }] }] } });
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Applies Mona UI styling to a native `<input type="checkbox">`. All native checkbox behaviors — keyboard interaction,
|
|
340
|
-
* form submission, `indeterminate` state, and Angular forms directives — are preserved.
|
|
341
|
-
*/
|
|
342
|
-
class CheckboxDirective {
|
|
343
|
-
constructor() {
|
|
344
|
-
this.classes = computed(() => {
|
|
345
|
-
const rounded = this.rounded();
|
|
346
|
-
const variantClasses = checkboxDirectiveThemeVariants({ rounded });
|
|
347
|
-
const userClass = this.userClass();
|
|
348
|
-
return twMerge(variantClasses, userClass);
|
|
349
|
-
}, /* @ts-ignore */
|
|
350
|
-
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
351
|
-
this.inputInvalid = computed(() => this.touched() && this.invalid(), /* @ts-ignore */
|
|
352
|
-
...(ngDevMode ? [{ debugName: "inputInvalid" }] : /* istanbul ignore next */ []));
|
|
353
|
-
/**
|
|
354
|
-
* @description Marks the checkbox as invalid, triggering error border and ring styling.
|
|
355
|
-
* @default false
|
|
356
|
-
*/
|
|
357
|
-
this.invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
358
|
-
/**
|
|
359
|
-
* @description Border-radius preset applied to the checkbox.
|
|
360
|
-
* @default "medium"
|
|
361
|
-
*/
|
|
362
|
-
this.rounded = input("medium", /* @ts-ignore */
|
|
363
|
-
...(ngDevMode ? [{ debugName: "rounded" }] : /* istanbul ignore next */ []));
|
|
364
|
-
/**
|
|
365
|
-
* @description Marks the checkbox as touched. Error styling is only shown when both `invalid` and `touched` are `true`.
|
|
366
|
-
* @default false
|
|
367
|
-
*/
|
|
368
|
-
this.touched = input(false, { ...(ngDevMode ? { debugName: "touched" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
369
|
-
/**
|
|
370
|
-
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
371
|
-
* @default ""
|
|
372
|
-
*/
|
|
373
|
-
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
374
|
-
}
|
|
375
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
376
|
-
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 }); }
|
|
377
|
-
}
|
|
378
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CheckboxDirective, decorators: [{
|
|
379
|
-
type: Directive,
|
|
380
|
-
args: [{
|
|
381
|
-
selector: "input[type='checkbox'][monaCheckbox]",
|
|
382
|
-
host: {
|
|
383
|
-
"[attr.aria-invalid]": "inputInvalid() || null",
|
|
384
|
-
"[attr.data-invalid]": "inputInvalid() || null",
|
|
385
|
-
"[class]": "classes()"
|
|
386
|
-
}
|
|
387
|
-
}]
|
|
388
|
-
}], 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 }] }] } });
|
|
389
|
-
|
|
390
|
-
/*
|
|
391
|
-
* Public API Surface of @nanahoshi/mona-ui/check-box
|
|
392
|
-
*/
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Generated bundle index. Do not edit.
|
|
396
|
-
*/
|
|
397
|
-
|
|
398
726
|
export { CheckBoxComponent, CheckboxDirective };
|
|
399
|
-
|
|
727
|
+
|
|
728
|
+
//# sourceMappingURL=nanahoshi-mona-ui-check-box.mjs.map
|