@fuse_ui/checkbox 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,257 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, input, signal, output, inject, computed, forwardRef, ChangeDetectionStrategy, Component, contentChildren } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+
5
+ const FUSE_CHECKBOX_GROUP = new InjectionToken('FUSE_CHECKBOX_GROUP');
6
+
7
+ const FUSE_RADIO_GROUP = new InjectionToken('FUSE_RADIO_GROUP');
8
+
9
+ class FuseCheckboxComponent {
10
+ // ─── Public @Input() API ────────────────────────────────────────────────────
11
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
12
+ indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
13
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
14
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
15
+ /** Value emitted / registered when this checkbox is checked. */
16
+ value = input(true, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
17
+ _formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []));
18
+ // ─── Public @Output() API ───────────────────────────────────────────────────
19
+ checkedChange = output();
20
+ // ─── Optional group injection ───────────────────────────────────────────────
21
+ group = inject(FUSE_CHECKBOX_GROUP, { optional: true });
22
+ // ─── Internal signal state ──────────────────────────────────────────────────
23
+ /** Standalone checked state (bypassed when inside a group). */
24
+ _checked = signal(false, ...(ngDevMode ? [{ debugName: "_checked" }] : /* istanbul ignore next */ []));
25
+ isDisabled = computed(() => this.disabled() || this._formDisabled() || (this.group?.isDisabled() ?? false), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
26
+ checked = computed(() => this.group ? this.group.isValueSelected(this.value()) : this._checked(), ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
27
+ // ─── CVA callbacks ──────────────────────────────────────────────────────────
28
+ onChange = () => { };
29
+ onTouched = () => { };
30
+ writeValue(v) {
31
+ this._checked.set(!!v);
32
+ }
33
+ registerOnChange(fn) {
34
+ this.onChange = fn;
35
+ }
36
+ registerOnTouched(fn) {
37
+ this.onTouched = fn;
38
+ }
39
+ setDisabledState(disabled) {
40
+ this._formDisabled.set(disabled);
41
+ }
42
+ // ─── Event handlers ─────────────────────────────────────────────────────────
43
+ handleChange(event) {
44
+ if (this.isDisabled())
45
+ return;
46
+ const isChecked = event.target.checked;
47
+ if (this.group) {
48
+ this.group.toggle(this.value());
49
+ }
50
+ else {
51
+ this._checked.set(isChecked);
52
+ this.onChange(isChecked);
53
+ this.checkedChange.emit(isChecked);
54
+ }
55
+ }
56
+ handleBlur() {
57
+ if (!this.group) {
58
+ this.onTouched();
59
+ }
60
+ }
61
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
62
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: FuseCheckboxComponent, isStandalone: true, selector: "fuse-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
63
+ {
64
+ provide: NG_VALUE_ACCESSOR,
65
+ useExisting: forwardRef(() => FuseCheckboxComponent),
66
+ multi: true,
67
+ },
68
+ ], ngImport: i0, template: "<label\n class=\"fuse-checkbox\"\n [class.fuse-checkbox--checked]=\"checked()\"\n [class.fuse-checkbox--indeterminate]=\"indeterminate()\"\n [class.fuse-checkbox--disabled]=\"isDisabled()\"\n [class.fuse-checkbox--sm]=\"size() === 'sm'\"\n [class.fuse-checkbox--md]=\"size() === 'md'\"\n [class.fuse-checkbox--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-checkbox__native\"\n type=\"checkbox\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange($event)\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-checkbox__box\" aria-hidden=\"true\">\n <!-- Checkmark icon -->\n @if (checked() && !indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n\n <!-- Indeterminate dash icon -->\n @if (indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1H11\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-checkbox__label\">{{ label() }}</span>\n }\n</label>\n", styles: [":host{--fuse-checkbox-size-sm: 14px;--fuse-checkbox-size-md: 18px;--fuse-checkbox-size-lg: 22px;--fuse-checkbox-radius: var(--fuse-radius-sm, 4px);--fuse-checkbox-border-width: 2px;--fuse-checkbox-border-color: var(--fuse-color-border, #cbd5e1);--fuse-checkbox-bg: var(--fuse-color-surface, #ffffff);--fuse-checkbox-checked-bg: var(--fuse-color-primary, #6366f1);--fuse-checkbox-checked-border: var(--fuse-color-primary, #6366f1);--fuse-checkbox-checked-icon: var(--fuse-color-on-primary, #ffffff);--fuse-checkbox-focus-ring: var(--fuse-color-primary-alpha, rgba(99, 102, 241, .25));--fuse-checkbox-disabled-bg: var(--fuse-color-surface-muted, #f1f5f9);--fuse-checkbox-disabled-border: var(--fuse-color-border-muted, #e2e8f0);--fuse-checkbox-disabled-icon: var(--fuse-color-text-muted, #94a3b8);--fuse-checkbox-label-color: var(--fuse-color-text, #1e293b);--fuse-checkbox-label-size: var(--fuse-font-size-md, .875rem);--fuse-checkbox-gap: var(--fuse-space-2, .5rem);display:inline-flex}.fuse-checkbox{display:inline-flex;align-items:center;gap:var(--fuse-checkbox-gap);cursor:pointer;-webkit-user-select:none;user-select:none}.fuse-checkbox--disabled{cursor:not-allowed;opacity:.5}.fuse-checkbox__native{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fuse-checkbox__native:focus-visible~.fuse-checkbox__box{outline:2px solid var(--fuse-checkbox-focus-ring);outline-offset:2px}.fuse-checkbox__box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fuse-checkbox-size-md);height:var(--fuse-checkbox-size-md);border:var(--fuse-checkbox-border-width) solid var(--fuse-checkbox-border-color);border-radius:var(--fuse-checkbox-radius);background-color:var(--fuse-checkbox-bg);transition:background-color .15s ease,border-color .15s ease;color:var(--fuse-checkbox-checked-icon)}.fuse-checkbox--sm .fuse-checkbox__box{width:var(--fuse-checkbox-size-sm);height:var(--fuse-checkbox-size-sm)}.fuse-checkbox--lg .fuse-checkbox__box{width:var(--fuse-checkbox-size-lg);height:var(--fuse-checkbox-size-lg)}.fuse-checkbox--checked .fuse-checkbox__box,.fuse-checkbox--indeterminate .fuse-checkbox__box{background-color:var(--fuse-checkbox-checked-bg);border-color:var(--fuse-checkbox-checked-border)}.fuse-checkbox--disabled .fuse-checkbox__box{background-color:var(--fuse-checkbox-disabled-bg);border-color:var(--fuse-checkbox-disabled-border);color:var(--fuse-checkbox-disabled-icon)}.fuse-checkbox__icon{width:70%;height:70%}.fuse-checkbox__label{color:var(--fuse-checkbox-label-color);font-size:var(--fuse-checkbox-label-size);line-height:1.4}:host-context(.ios){--fuse-checkbox-radius: var(--fuse-radius-full, 50px)}:host-context(.md){--fuse-checkbox-radius: var(--fuse-radius-xs, 2px);--fuse-checkbox-border-width: 2px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
69
+ }
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseCheckboxComponent, decorators: [{
71
+ type: Component,
72
+ args: [{ selector: 'fuse-checkbox', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
73
+ {
74
+ provide: NG_VALUE_ACCESSOR,
75
+ useExisting: forwardRef(() => FuseCheckboxComponent),
76
+ multi: true,
77
+ },
78
+ ], template: "<label\n class=\"fuse-checkbox\"\n [class.fuse-checkbox--checked]=\"checked()\"\n [class.fuse-checkbox--indeterminate]=\"indeterminate()\"\n [class.fuse-checkbox--disabled]=\"isDisabled()\"\n [class.fuse-checkbox--sm]=\"size() === 'sm'\"\n [class.fuse-checkbox--md]=\"size() === 'md'\"\n [class.fuse-checkbox--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-checkbox__native\"\n type=\"checkbox\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange($event)\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-checkbox__box\" aria-hidden=\"true\">\n <!-- Checkmark icon -->\n @if (checked() && !indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n\n <!-- Indeterminate dash icon -->\n @if (indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1H11\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-checkbox__label\">{{ label() }}</span>\n }\n</label>\n", styles: [":host{--fuse-checkbox-size-sm: 14px;--fuse-checkbox-size-md: 18px;--fuse-checkbox-size-lg: 22px;--fuse-checkbox-radius: var(--fuse-radius-sm, 4px);--fuse-checkbox-border-width: 2px;--fuse-checkbox-border-color: var(--fuse-color-border, #cbd5e1);--fuse-checkbox-bg: var(--fuse-color-surface, #ffffff);--fuse-checkbox-checked-bg: var(--fuse-color-primary, #6366f1);--fuse-checkbox-checked-border: var(--fuse-color-primary, #6366f1);--fuse-checkbox-checked-icon: var(--fuse-color-on-primary, #ffffff);--fuse-checkbox-focus-ring: var(--fuse-color-primary-alpha, rgba(99, 102, 241, .25));--fuse-checkbox-disabled-bg: var(--fuse-color-surface-muted, #f1f5f9);--fuse-checkbox-disabled-border: var(--fuse-color-border-muted, #e2e8f0);--fuse-checkbox-disabled-icon: var(--fuse-color-text-muted, #94a3b8);--fuse-checkbox-label-color: var(--fuse-color-text, #1e293b);--fuse-checkbox-label-size: var(--fuse-font-size-md, .875rem);--fuse-checkbox-gap: var(--fuse-space-2, .5rem);display:inline-flex}.fuse-checkbox{display:inline-flex;align-items:center;gap:var(--fuse-checkbox-gap);cursor:pointer;-webkit-user-select:none;user-select:none}.fuse-checkbox--disabled{cursor:not-allowed;opacity:.5}.fuse-checkbox__native{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fuse-checkbox__native:focus-visible~.fuse-checkbox__box{outline:2px solid var(--fuse-checkbox-focus-ring);outline-offset:2px}.fuse-checkbox__box{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fuse-checkbox-size-md);height:var(--fuse-checkbox-size-md);border:var(--fuse-checkbox-border-width) solid var(--fuse-checkbox-border-color);border-radius:var(--fuse-checkbox-radius);background-color:var(--fuse-checkbox-bg);transition:background-color .15s ease,border-color .15s ease;color:var(--fuse-checkbox-checked-icon)}.fuse-checkbox--sm .fuse-checkbox__box{width:var(--fuse-checkbox-size-sm);height:var(--fuse-checkbox-size-sm)}.fuse-checkbox--lg .fuse-checkbox__box{width:var(--fuse-checkbox-size-lg);height:var(--fuse-checkbox-size-lg)}.fuse-checkbox--checked .fuse-checkbox__box,.fuse-checkbox--indeterminate .fuse-checkbox__box{background-color:var(--fuse-checkbox-checked-bg);border-color:var(--fuse-checkbox-checked-border)}.fuse-checkbox--disabled .fuse-checkbox__box{background-color:var(--fuse-checkbox-disabled-bg);border-color:var(--fuse-checkbox-disabled-border);color:var(--fuse-checkbox-disabled-icon)}.fuse-checkbox__icon{width:70%;height:70%}.fuse-checkbox__label{color:var(--fuse-checkbox-label-color);font-size:var(--fuse-checkbox-label-size);line-height:1.4}:host-context(.ios){--fuse-checkbox-radius: var(--fuse-radius-full, 50px)}:host-context(.md){--fuse-checkbox-radius: var(--fuse-radius-xs, 2px);--fuse-checkbox-border-width: 2px}\n"] }]
79
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
80
+
81
+ class FuseCheckboxGroupComponent {
82
+ // ─── Public @Input() API ────────────────────────────────────────────────────
83
+ orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
84
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
85
+ // ─── ContentChildren ────────────────────────────────────────────────────────
86
+ checkboxes = contentChildren(FuseCheckboxComponent, ...(ngDevMode ? [{ debugName: "checkboxes" }] : /* istanbul ignore next */ []));
87
+ // ─── Internal signal state ──────────────────────────────────────────────────
88
+ selectedValues = signal([], ...(ngDevMode ? [{ debugName: "selectedValues" }] : /* istanbul ignore next */ []));
89
+ _formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []));
90
+ isDisabled = computed(() => this.disabled() || this._formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
91
+ // ─── CVA callbacks ──────────────────────────────────────────────────────────
92
+ onChange = () => { };
93
+ onTouched = () => { };
94
+ writeValue(v) {
95
+ this.selectedValues.set(Array.isArray(v) ? v : []);
96
+ }
97
+ registerOnChange(fn) {
98
+ this.onChange = fn;
99
+ }
100
+ registerOnTouched(fn) {
101
+ this.onTouched = fn;
102
+ }
103
+ setDisabledState(disabled) {
104
+ this._formDisabled.set(disabled);
105
+ }
106
+ // ─── CheckboxGroupRef interface ─────────────────────────────────────────────
107
+ isValueSelected(value) {
108
+ return this.selectedValues().includes(value);
109
+ }
110
+ toggle(value) {
111
+ const current = [...this.selectedValues()];
112
+ const idx = current.indexOf(value);
113
+ if (idx >= 0) {
114
+ current.splice(idx, 1);
115
+ }
116
+ else {
117
+ current.push(value);
118
+ }
119
+ this.selectedValues.set(current);
120
+ this.onChange(current);
121
+ this.onTouched();
122
+ }
123
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseCheckboxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
124
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.6", type: FuseCheckboxGroupComponent, isStandalone: true, selector: "fuse-checkbox-group", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
125
+ {
126
+ provide: NG_VALUE_ACCESSOR,
127
+ useExisting: forwardRef(() => FuseCheckboxGroupComponent),
128
+ multi: true,
129
+ },
130
+ {
131
+ provide: FUSE_CHECKBOX_GROUP,
132
+ useExisting: forwardRef(() => FuseCheckboxGroupComponent),
133
+ },
134
+ ], queries: [{ propertyName: "checkboxes", predicate: FuseCheckboxComponent, isSignal: true }], ngImport: i0, template: "<div\n class=\"fuse-checkbox-group\"\n [class.fuse-checkbox-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-checkbox-group--vertical]=\"orientation() === 'vertical'\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--fuse-checkbox-group-gap: var(--fuse-space-3, .75rem);--fuse-checkbox-group-gap-horizontal: var(--fuse-space-4, 1rem);display:block}.fuse-checkbox-group{display:flex}.fuse-checkbox-group--vertical{flex-direction:column;gap:var(--fuse-checkbox-group-gap)}.fuse-checkbox-group--horizontal{flex-direction:row;flex-wrap:wrap;gap:var(--fuse-checkbox-group-gap-horizontal)}:host-context(.ios){--fuse-checkbox-group-gap: var(--fuse-space-4, 1rem)}:host-context(.md){--fuse-checkbox-group-gap: var(--fuse-space-2, .5rem)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
135
+ }
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseCheckboxGroupComponent, decorators: [{
137
+ type: Component,
138
+ args: [{ selector: 'fuse-checkbox-group', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
139
+ {
140
+ provide: NG_VALUE_ACCESSOR,
141
+ useExisting: forwardRef(() => FuseCheckboxGroupComponent),
142
+ multi: true,
143
+ },
144
+ {
145
+ provide: FUSE_CHECKBOX_GROUP,
146
+ useExisting: forwardRef(() => FuseCheckboxGroupComponent),
147
+ },
148
+ ], template: "<div\n class=\"fuse-checkbox-group\"\n [class.fuse-checkbox-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-checkbox-group--vertical]=\"orientation() === 'vertical'\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--fuse-checkbox-group-gap: var(--fuse-space-3, .75rem);--fuse-checkbox-group-gap-horizontal: var(--fuse-space-4, 1rem);display:block}.fuse-checkbox-group{display:flex}.fuse-checkbox-group--vertical{flex-direction:column;gap:var(--fuse-checkbox-group-gap)}.fuse-checkbox-group--horizontal{flex-direction:row;flex-wrap:wrap;gap:var(--fuse-checkbox-group-gap-horizontal)}:host-context(.ios){--fuse-checkbox-group-gap: var(--fuse-space-4, 1rem)}:host-context(.md){--fuse-checkbox-group-gap: var(--fuse-space-2, .5rem)}\n"] }]
149
+ }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkboxes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => FuseCheckboxComponent), { isSignal: true }] }] } });
150
+
151
+ class FuseRadioComponent {
152
+ // ─── Public @Input() API ────────────────────────────────────────────────────
153
+ value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
154
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
155
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
156
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
157
+ /** Used only when this radio is standalone (no parent fuse-radio-group). */
158
+ name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
159
+ // ─── Group injection ─────────────────────────────────────────────────────────
160
+ group = inject(FUSE_RADIO_GROUP, { optional: true });
161
+ // ─── Derived state ──────────────────────────────────────────────────────────
162
+ isChecked = computed(() => this.group ? this.group.selectedValue() === this.value() : false, ...(ngDevMode ? [{ debugName: "isChecked" }] : /* istanbul ignore next */ []));
163
+ isDisabled = computed(() => this.disabled() || (this.group?.isDisabled() ?? false), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
164
+ get radioName() {
165
+ return this.group?.name || this.name();
166
+ }
167
+ // ─── Event handlers ─────────────────────────────────────────────────────────
168
+ handleChange() {
169
+ if (this.isDisabled())
170
+ return;
171
+ this.group?.select(this.value());
172
+ }
173
+ handleBlur() {
174
+ // Touched is managed by the group's CVA
175
+ }
176
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
177
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: FuseRadioComponent, isStandalone: true, selector: "fuse-radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<label\n class=\"fuse-radio\"\n [class.fuse-radio--checked]=\"isChecked()\"\n [class.fuse-radio--disabled]=\"isDisabled()\"\n [class.fuse-radio--sm]=\"size() === 'sm'\"\n [class.fuse-radio--md]=\"size() === 'md'\"\n [class.fuse-radio--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-radio__native\"\n type=\"radio\"\n [name]=\"radioName\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange()\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-radio__circle\" aria-hidden=\"true\">\n @if (isChecked()) {\n <span class=\"fuse-radio__dot\"></span>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-radio__label\">{{ label() }}</span>\n }\n</label>\n", styles: [":host{--fuse-radio-size-sm: 14px;--fuse-radio-size-md: 18px;--fuse-radio-size-lg: 22px;--fuse-radio-dot-ratio: .45;--fuse-radio-border-color: var(--fuse-color-border, #cbd5e1);--fuse-radio-bg: var(--fuse-color-surface, #ffffff);--fuse-radio-checked-bg: var(--fuse-color-surface, #ffffff);--fuse-radio-checked-border: var(--fuse-color-primary, #6366f1);--fuse-radio-dot-color: var(--fuse-color-primary, #6366f1);--fuse-radio-focus-ring: var(--fuse-color-primary-alpha, rgba(99, 102, 241, .25));--fuse-radio-disabled-bg: var(--fuse-color-surface-muted, #f1f5f9);--fuse-radio-disabled-border: var(--fuse-color-border-muted, #e2e8f0);--fuse-radio-disabled-dot: var(--fuse-color-text-muted, #94a3b8);--fuse-radio-label-color: var(--fuse-color-text, #1e293b);--fuse-radio-label-size: var(--fuse-font-size-md, .875rem);--fuse-radio-gap: var(--fuse-space-2, .5rem);display:inline-flex}.fuse-radio{display:inline-flex;align-items:center;gap:var(--fuse-radio-gap);cursor:pointer;-webkit-user-select:none;user-select:none}.fuse-radio--disabled{cursor:not-allowed;opacity:.5}.fuse-radio__native{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fuse-radio__native:focus-visible~.fuse-radio__circle{outline:2px solid var(--fuse-radio-focus-ring);outline-offset:2px}.fuse-radio__circle{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fuse-radio-size-md);height:var(--fuse-radio-size-md);border-radius:50%;border:2px solid var(--fuse-radio-border-color);background-color:var(--fuse-radio-bg);transition:border-color .15s ease,background-color .15s ease}.fuse-radio--sm .fuse-radio__circle{width:var(--fuse-radio-size-sm);height:var(--fuse-radio-size-sm)}.fuse-radio--lg .fuse-radio__circle{width:var(--fuse-radio-size-lg);height:var(--fuse-radio-size-lg)}.fuse-radio--checked .fuse-radio__circle{border-color:var(--fuse-radio-checked-border);background-color:var(--fuse-radio-checked-bg)}.fuse-radio--disabled .fuse-radio__circle{background-color:var(--fuse-radio-disabled-bg);border-color:var(--fuse-radio-disabled-border)}.fuse-radio__dot{display:block;width:calc(var(--fuse-radio-size-md) * var(--fuse-radio-dot-ratio));height:calc(var(--fuse-radio-size-md) * var(--fuse-radio-dot-ratio));border-radius:50%;background-color:var(--fuse-radio-dot-color)}.fuse-radio--disabled .fuse-radio__dot{background-color:var(--fuse-radio-disabled-dot)}.fuse-radio__label{color:var(--fuse-radio-label-color);font-size:var(--fuse-radio-label-size);line-height:1.4}:host-context(.ios){--fuse-radio-size-md: 20px;--fuse-radio-size-sm: 16px;--fuse-radio-size-lg: 24px}:host-context(.md){--fuse-radio-size-md: 20px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
178
+ }
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseRadioComponent, decorators: [{
180
+ type: Component,
181
+ args: [{ selector: 'fuse-radio', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label\n class=\"fuse-radio\"\n [class.fuse-radio--checked]=\"isChecked()\"\n [class.fuse-radio--disabled]=\"isDisabled()\"\n [class.fuse-radio--sm]=\"size() === 'sm'\"\n [class.fuse-radio--md]=\"size() === 'md'\"\n [class.fuse-radio--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-radio__native\"\n type=\"radio\"\n [name]=\"radioName\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange()\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-radio__circle\" aria-hidden=\"true\">\n @if (isChecked()) {\n <span class=\"fuse-radio__dot\"></span>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-radio__label\">{{ label() }}</span>\n }\n</label>\n", styles: [":host{--fuse-radio-size-sm: 14px;--fuse-radio-size-md: 18px;--fuse-radio-size-lg: 22px;--fuse-radio-dot-ratio: .45;--fuse-radio-border-color: var(--fuse-color-border, #cbd5e1);--fuse-radio-bg: var(--fuse-color-surface, #ffffff);--fuse-radio-checked-bg: var(--fuse-color-surface, #ffffff);--fuse-radio-checked-border: var(--fuse-color-primary, #6366f1);--fuse-radio-dot-color: var(--fuse-color-primary, #6366f1);--fuse-radio-focus-ring: var(--fuse-color-primary-alpha, rgba(99, 102, 241, .25));--fuse-radio-disabled-bg: var(--fuse-color-surface-muted, #f1f5f9);--fuse-radio-disabled-border: var(--fuse-color-border-muted, #e2e8f0);--fuse-radio-disabled-dot: var(--fuse-color-text-muted, #94a3b8);--fuse-radio-label-color: var(--fuse-color-text, #1e293b);--fuse-radio-label-size: var(--fuse-font-size-md, .875rem);--fuse-radio-gap: var(--fuse-space-2, .5rem);display:inline-flex}.fuse-radio{display:inline-flex;align-items:center;gap:var(--fuse-radio-gap);cursor:pointer;-webkit-user-select:none;user-select:none}.fuse-radio--disabled{cursor:not-allowed;opacity:.5}.fuse-radio__native{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fuse-radio__native:focus-visible~.fuse-radio__circle{outline:2px solid var(--fuse-radio-focus-ring);outline-offset:2px}.fuse-radio__circle{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:var(--fuse-radio-size-md);height:var(--fuse-radio-size-md);border-radius:50%;border:2px solid var(--fuse-radio-border-color);background-color:var(--fuse-radio-bg);transition:border-color .15s ease,background-color .15s ease}.fuse-radio--sm .fuse-radio__circle{width:var(--fuse-radio-size-sm);height:var(--fuse-radio-size-sm)}.fuse-radio--lg .fuse-radio__circle{width:var(--fuse-radio-size-lg);height:var(--fuse-radio-size-lg)}.fuse-radio--checked .fuse-radio__circle{border-color:var(--fuse-radio-checked-border);background-color:var(--fuse-radio-checked-bg)}.fuse-radio--disabled .fuse-radio__circle{background-color:var(--fuse-radio-disabled-bg);border-color:var(--fuse-radio-disabled-border)}.fuse-radio__dot{display:block;width:calc(var(--fuse-radio-size-md) * var(--fuse-radio-dot-ratio));height:calc(var(--fuse-radio-size-md) * var(--fuse-radio-dot-ratio));border-radius:50%;background-color:var(--fuse-radio-dot-color)}.fuse-radio--disabled .fuse-radio__dot{background-color:var(--fuse-radio-disabled-dot)}.fuse-radio__label{color:var(--fuse-radio-label-color);font-size:var(--fuse-radio-label-size);line-height:1.4}:host-context(.ios){--fuse-radio-size-md: 20px;--fuse-radio-size-sm: 16px;--fuse-radio-size-lg: 24px}:host-context(.md){--fuse-radio-size-md: 20px}\n"] }]
182
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
183
+
184
+ let _groupId = 0;
185
+ class FuseRadioGroupComponent {
186
+ // ─── Public @Input() API ────────────────────────────────────────────────────
187
+ orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
188
+ ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
189
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
190
+ /** Shared `name` attribute forwarded to all child radios. Auto-generated if omitted. */
191
+ groupName = input(`fuse-radio-group-${++_groupId}`, ...(ngDevMode ? [{ debugName: "groupName" }] : /* istanbul ignore next */ []));
192
+ /** Satisfies the RadioGroupRef interface (requires a string property). */
193
+ get name() { return this.groupName(); }
194
+ // ─── Public @Output() API ───────────────────────────────────────────────────
195
+ valueChange = output();
196
+ // ─── Internal signal state ──────────────────────────────────────────────────
197
+ selectedValue = signal(null, ...(ngDevMode ? [{ debugName: "selectedValue" }] : /* istanbul ignore next */ []));
198
+ _formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []));
199
+ isDisabled = computed(() => this.disabled() || this._formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
200
+ // ─── CVA callbacks ──────────────────────────────────────────────────────────
201
+ onChange = () => { };
202
+ onTouched = () => { };
203
+ writeValue(v) {
204
+ this.selectedValue.set(v ?? null);
205
+ }
206
+ registerOnChange(fn) {
207
+ this.onChange = fn;
208
+ }
209
+ registerOnTouched(fn) {
210
+ this.onTouched = fn;
211
+ }
212
+ setDisabledState(disabled) {
213
+ this._formDisabled.set(disabled);
214
+ }
215
+ // ─── RadioGroupRef interface ─────────────────────────────────────────────────
216
+ select(value) {
217
+ this.selectedValue.set(value);
218
+ this.onChange(value);
219
+ this.onTouched();
220
+ this.valueChange.emit(value);
221
+ }
222
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
223
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.6", type: FuseRadioGroupComponent, isStandalone: true, selector: "fuse-radio-group", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, groupName: { classPropertyName: "groupName", publicName: "groupName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [
224
+ {
225
+ provide: NG_VALUE_ACCESSOR,
226
+ useExisting: forwardRef(() => FuseRadioGroupComponent),
227
+ multi: true,
228
+ },
229
+ {
230
+ provide: FUSE_RADIO_GROUP,
231
+ useExisting: forwardRef(() => FuseRadioGroupComponent),
232
+ },
233
+ ], ngImport: i0, template: "<div\n class=\"fuse-radio-group\"\n role=\"radiogroup\"\n [class.fuse-radio-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-radio-group--vertical]=\"orientation() === 'vertical'\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--fuse-radio-group-gap: var(--fuse-space-3, .75rem);--fuse-radio-group-gap-horizontal: var(--fuse-space-4, 1rem);display:block}.fuse-radio-group{display:flex}.fuse-radio-group--vertical{flex-direction:column;gap:var(--fuse-radio-group-gap)}.fuse-radio-group--horizontal{flex-direction:row;flex-wrap:wrap;gap:var(--fuse-radio-group-gap-horizontal)}:host-context(.ios){--fuse-radio-group-gap: var(--fuse-space-4, 1rem)}:host-context(.md){--fuse-radio-group-gap: var(--fuse-space-2, .5rem)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
234
+ }
235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseRadioGroupComponent, decorators: [{
236
+ type: Component,
237
+ args: [{ selector: 'fuse-radio-group', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
238
+ {
239
+ provide: NG_VALUE_ACCESSOR,
240
+ useExisting: forwardRef(() => FuseRadioGroupComponent),
241
+ multi: true,
242
+ },
243
+ {
244
+ provide: FUSE_RADIO_GROUP,
245
+ useExisting: forwardRef(() => FuseRadioGroupComponent),
246
+ },
247
+ ], template: "<div\n class=\"fuse-radio-group\"\n role=\"radiogroup\"\n [class.fuse-radio-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-radio-group--vertical]=\"orientation() === 'vertical'\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [":host{--fuse-radio-group-gap: var(--fuse-space-3, .75rem);--fuse-radio-group-gap-horizontal: var(--fuse-space-4, 1rem);display:block}.fuse-radio-group{display:flex}.fuse-radio-group--vertical{flex-direction:column;gap:var(--fuse-radio-group-gap)}.fuse-radio-group--horizontal{flex-direction:row;flex-wrap:wrap;gap:var(--fuse-radio-group-gap-horizontal)}:host-context(.ios){--fuse-radio-group-gap: var(--fuse-space-4, 1rem)}:host-context(.md){--fuse-radio-group-gap: var(--fuse-space-2, .5rem)}\n"] }]
248
+ }], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], groupName: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupName", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
249
+
250
+ // Tokens
251
+
252
+ /**
253
+ * Generated bundle index. Do not edit.
254
+ */
255
+
256
+ export { FUSE_CHECKBOX_GROUP, FUSE_RADIO_GROUP, FuseCheckboxComponent, FuseCheckboxGroupComponent, FuseRadioComponent, FuseRadioGroupComponent };
257
+ //# sourceMappingURL=fuse_ui-checkbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuse_ui-checkbox.mjs","sources":["../../../../packages/checkbox/src/lib/checkbox-group/checkbox-group.token.ts","../../../../packages/checkbox/src/lib/radio-group/radio-group.token.ts","../../../../packages/checkbox/src/lib/checkbox/fuse-checkbox.component.ts","../../../../packages/checkbox/src/lib/checkbox/fuse-checkbox.component.html","../../../../packages/checkbox/src/lib/checkbox-group/fuse-checkbox-group.component.ts","../../../../packages/checkbox/src/lib/checkbox-group/fuse-checkbox-group.component.html","../../../../packages/checkbox/src/lib/radio/fuse-radio.component.ts","../../../../packages/checkbox/src/lib/radio/fuse-radio.component.html","../../../../packages/checkbox/src/lib/radio-group/fuse-radio-group.component.ts","../../../../packages/checkbox/src/lib/radio-group/fuse-radio-group.component.html","../../../../packages/checkbox/src/index.ts","../../../../packages/checkbox/src/fuse_ui-checkbox.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface CheckboxGroupRef {\n isValueSelected(value: any): boolean;\n toggle(value: any): void;\n isDisabled(): boolean;\n}\n\nexport const FUSE_CHECKBOX_GROUP = new InjectionToken<CheckboxGroupRef>(\n 'FUSE_CHECKBOX_GROUP'\n);\n","import { InjectionToken } from '@angular/core';\n\nexport interface RadioGroupRef {\n selectedValue(): any;\n select(value: any): void;\n isDisabled(): boolean;\n name: string;\n}\n\nexport const FUSE_RADIO_GROUP = new InjectionToken<RadioGroupRef>(\n 'FUSE_RADIO_GROUP'\n);\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n FUSE_CHECKBOX_GROUP,\n} from '../checkbox-group/checkbox-group.token';\n\n@Component({\n selector: 'fuse-checkbox',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-checkbox.component.html',\n styleUrl: './fuse-checkbox.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FuseCheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class FuseCheckboxComponent implements ControlValueAccessor {\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly label = input('');\n readonly indeterminate = input(false);\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n readonly disabled = input(false);\n\n /** Value emitted / registered when this checkbox is checked. */\n readonly value = input<any>(true);\n\n private readonly _formDisabled = signal(false);\n\n // ─── Public @Output() API ───────────────────────────────────────────────────\n\n readonly checkedChange = output<boolean>();\n\n // ─── Optional group injection ───────────────────────────────────────────────\n\n protected readonly group = inject(FUSE_CHECKBOX_GROUP, { optional: true });\n\n // ─── Internal signal state ──────────────────────────────────────────────────\n\n /** Standalone checked state (bypassed when inside a group). */\n private readonly _checked = signal(false);\n\n protected readonly isDisabled = computed(\n () => this.disabled() || this._formDisabled() || (this.group?.isDisabled() ?? false)\n );\n\n protected readonly checked = computed(() =>\n this.group ? this.group.isValueSelected(this.value()) : this._checked()\n );\n\n // ─── CVA callbacks ──────────────────────────────────────────────────────────\n\n private onChange: (v: any) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(v: any): void {\n this._checked.set(!!v);\n }\n\n registerOnChange(fn: (v: any) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this._formDisabled.set(disabled);\n }\n\n // ─── Event handlers ─────────────────────────────────────────────────────────\n\n handleChange(event: Event): void {\n if (this.isDisabled()) return;\n const isChecked = (event.target as HTMLInputElement).checked;\n\n if (this.group) {\n this.group.toggle(this.value());\n } else {\n this._checked.set(isChecked);\n this.onChange(isChecked);\n this.checkedChange.emit(isChecked);\n }\n }\n\n handleBlur(): void {\n if (!this.group) {\n this.onTouched();\n }\n }\n}\n","<label\n class=\"fuse-checkbox\"\n [class.fuse-checkbox--checked]=\"checked()\"\n [class.fuse-checkbox--indeterminate]=\"indeterminate()\"\n [class.fuse-checkbox--disabled]=\"isDisabled()\"\n [class.fuse-checkbox--sm]=\"size() === 'sm'\"\n [class.fuse-checkbox--md]=\"size() === 'md'\"\n [class.fuse-checkbox--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-checkbox__native\"\n type=\"checkbox\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange($event)\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-checkbox__box\" aria-hidden=\"true\">\n <!-- Checkmark icon -->\n @if (checked() && !indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 5L4.5 8.5L11 1.5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n\n <!-- Indeterminate dash icon -->\n @if (indeterminate()) {\n <svg\n class=\"fuse-checkbox__icon\"\n viewBox=\"0 0 12 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1H11\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-checkbox__label\">{{ label() }}</span>\n }\n</label>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChildren,\n forwardRef,\n input,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n CheckboxGroupRef,\n FUSE_CHECKBOX_GROUP,\n} from './checkbox-group.token';\nimport { FuseCheckboxComponent } from '../checkbox/fuse-checkbox.component';\n\n@Component({\n selector: 'fuse-checkbox-group',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-checkbox-group.component.html',\n styleUrl: './fuse-checkbox-group.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FuseCheckboxGroupComponent),\n multi: true,\n },\n {\n provide: FUSE_CHECKBOX_GROUP,\n useExisting: forwardRef(() => FuseCheckboxGroupComponent),\n },\n ],\n})\nexport class FuseCheckboxGroupComponent\n implements ControlValueAccessor, CheckboxGroupRef\n{\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly disabled = input(false);\n\n // ─── ContentChildren ────────────────────────────────────────────────────────\n\n readonly checkboxes = contentChildren(FuseCheckboxComponent);\n\n // ─── Internal signal state ──────────────────────────────────────────────────\n\n protected readonly selectedValues = signal<any[]>([]);\n\n private readonly _formDisabled = signal(false);\n\n readonly isDisabled = computed(() => this.disabled() || this._formDisabled());\n\n // ─── CVA callbacks ──────────────────────────────────────────────────────────\n\n private onChange: (v: any[]) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(v: any[]): void {\n this.selectedValues.set(Array.isArray(v) ? v : []);\n }\n\n registerOnChange(fn: (v: any[]) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this._formDisabled.set(disabled);\n }\n\n // ─── CheckboxGroupRef interface ─────────────────────────────────────────────\n\n isValueSelected(value: any): boolean {\n return this.selectedValues().includes(value);\n }\n\n toggle(value: any): void {\n const current = [...this.selectedValues()];\n const idx = current.indexOf(value);\n if (idx >= 0) {\n current.splice(idx, 1);\n } else {\n current.push(value);\n }\n this.selectedValues.set(current);\n this.onChange(current);\n this.onTouched();\n }\n}\n","<div\n class=\"fuse-checkbox-group\"\n [class.fuse-checkbox-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-checkbox-group--vertical]=\"orientation() === 'vertical'\"\n>\n <ng-content></ng-content>\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { FUSE_RADIO_GROUP } from '../radio-group/radio-group.token';\n\n@Component({\n selector: 'fuse-radio',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-radio.component.html',\n styleUrl: './fuse-radio.component.scss',\n})\nexport class FuseRadioComponent {\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly value = input.required<any>();\n readonly label = input('');\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n readonly disabled = input(false);\n\n /** Used only when this radio is standalone (no parent fuse-radio-group). */\n readonly name = input('');\n\n // ─── Group injection ─────────────────────────────────────────────────────────\n\n protected readonly group = inject(FUSE_RADIO_GROUP, { optional: true });\n\n // ─── Derived state ──────────────────────────────────────────────────────────\n\n protected readonly isChecked = computed(() =>\n this.group ? this.group.selectedValue() === this.value() : false\n );\n\n protected readonly isDisabled = computed(\n () => this.disabled() || (this.group?.isDisabled() ?? false)\n );\n\n protected get radioName(): string {\n return this.group?.name || this.name();\n }\n\n // ─── Event handlers ─────────────────────────────────────────────────────────\n\n handleChange(): void {\n if (this.isDisabled()) return;\n this.group?.select(this.value());\n }\n\n handleBlur(): void {\n // Touched is managed by the group's CVA\n }\n}\n","<label\n class=\"fuse-radio\"\n [class.fuse-radio--checked]=\"isChecked()\"\n [class.fuse-radio--disabled]=\"isDisabled()\"\n [class.fuse-radio--sm]=\"size() === 'sm'\"\n [class.fuse-radio--md]=\"size() === 'md'\"\n [class.fuse-radio--lg]=\"size() === 'lg'\"\n>\n <input\n class=\"fuse-radio__native\"\n type=\"radio\"\n [name]=\"radioName\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"handleChange()\"\n (blur)=\"handleBlur()\"\n />\n\n <span class=\"fuse-radio__circle\" aria-hidden=\"true\">\n @if (isChecked()) {\n <span class=\"fuse-radio__dot\"></span>\n }\n </span>\n\n @if (label()) {\n <span class=\"fuse-radio__label\">{{ label() }}</span>\n }\n</label>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { RadioGroupRef, FUSE_RADIO_GROUP } from './radio-group.token';\n\nlet _groupId = 0;\n\n@Component({\n selector: 'fuse-radio-group',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-radio-group.component.html',\n styleUrl: './fuse-radio-group.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FuseRadioGroupComponent),\n multi: true,\n },\n {\n provide: FUSE_RADIO_GROUP,\n useExisting: forwardRef(() => FuseRadioGroupComponent),\n },\n ],\n})\nexport class FuseRadioGroupComponent\n implements ControlValueAccessor, RadioGroupRef\n{\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n readonly ariaLabel = input('');\n readonly disabled = input(false);\n\n /** Shared `name` attribute forwarded to all child radios. Auto-generated if omitted. */\n readonly groupName = input(`fuse-radio-group-${++_groupId}`);\n\n /** Satisfies the RadioGroupRef interface (requires a string property). */\n get name(): string { return this.groupName(); }\n\n // ─── Public @Output() API ───────────────────────────────────────────────────\n\n readonly valueChange = output<any>();\n\n // ─── Internal signal state ──────────────────────────────────────────────────\n\n readonly selectedValue = signal<any>(null);\n\n private readonly _formDisabled = signal(false);\n\n readonly isDisabled = computed(() => this.disabled() || this._formDisabled());\n\n // ─── CVA callbacks ──────────────────────────────────────────────────────────\n\n private onChange: (v: any) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(v: any): void {\n this.selectedValue.set(v ?? null);\n }\n\n registerOnChange(fn: (v: any) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this._formDisabled.set(disabled);\n }\n\n // ─── RadioGroupRef interface ─────────────────────────────────────────────────\n\n select(value: any): void {\n this.selectedValue.set(value);\n this.onChange(value);\n this.onTouched();\n this.valueChange.emit(value);\n }\n}\n","<div\n class=\"fuse-radio-group\"\n role=\"radiogroup\"\n [class.fuse-radio-group--horizontal]=\"orientation() === 'horizontal'\"\n [class.fuse-radio-group--vertical]=\"orientation() === 'vertical'\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n>\n <ng-content></ng-content>\n</div>\n","// Tokens\nexport { FUSE_CHECKBOX_GROUP } from './lib/checkbox-group/checkbox-group.token';\nexport type { CheckboxGroupRef } from './lib/checkbox-group/checkbox-group.token';\nexport { FUSE_RADIO_GROUP } from './lib/radio-group/radio-group.token';\nexport type { RadioGroupRef } from './lib/radio-group/radio-group.token';\n\n// Components\nexport { FuseCheckboxComponent } from './lib/checkbox/fuse-checkbox.component';\nexport { FuseCheckboxGroupComponent } from './lib/checkbox-group/fuse-checkbox-group.component';\nexport { FuseRadioComponent } from './lib/radio/fuse-radio.component';\nexport { FuseRadioGroupComponent } from './lib/radio-group/fuse-radio-group.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,mBAAmB,GAAG,IAAI,cAAc,CACnD,qBAAqB;;MCAV,gBAAgB,GAAG,IAAI,cAAc,CAChD,kBAAkB;;MCoBP,qBAAqB,CAAA;;AAGvB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,4EAAC;AACjB,IAAA,aAAa,GAAG,KAAK,CAAC,KAAK,oFAAC;AAC5B,IAAA,IAAI,GAAG,KAAK,CAAqB,IAAI,2EAAC;AACtC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;;AAGvB,IAAA,KAAK,GAAG,KAAK,CAAM,IAAI,4EAAC;AAEhB,IAAA,aAAa,GAAG,MAAM,CAAC,KAAK,oFAAC;;IAIrC,aAAa,GAAG,MAAM,EAAW;;IAIvB,KAAK,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;AAKzD,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;IAEtB,UAAU,GAAG,QAAQ,CACtC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,KAAK,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,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,EAAA,MAAA,EAAA,CAAA,ifAAA,CAAA,EAAA;;;AE/BH;;ACAA;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@fuse_ui/checkbox",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "keywords": [
9
+ "fuse-ui",
10
+ "angular",
11
+ "ionic",
12
+ "ionic8",
13
+ "angular18",
14
+ "angular19",
15
+ "angular20",
16
+ "angular21",
17
+ "ui-components",
18
+ "design-system",
19
+ "css-variables",
20
+ "signals",
21
+ "standalone",
22
+ "multi-theme",
23
+ "dark-mode",
24
+ "fluid-typography",
25
+ "animated"
26
+ ],
27
+ "peerDependencies": {
28
+ "@angular/core": ">=18.0.0",
29
+ "@angular/common": ">=18.0.0",
30
+ "rxjs": ">=7.4.0",
31
+ "@angular/forms": ">=18.0.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "@ionic/angular": {
35
+ "optional": true
36
+ }
37
+ },
38
+ "sideEffects": [
39
+ "*.css",
40
+ "**/*.scss"
41
+ ],
42
+ "engines": {
43
+ "node": ">=20.0.0"
44
+ },
45
+ "module": "fesm2022/fuse_ui-checkbox.mjs",
46
+ "typings": "types/fuse_ui-checkbox.d.ts",
47
+ "exports": {
48
+ "./package.json": {
49
+ "default": "./package.json"
50
+ },
51
+ ".": {
52
+ "types": "./types/fuse_ui-checkbox.d.ts",
53
+ "default": "./fesm2022/fuse_ui-checkbox.mjs"
54
+ }
55
+ },
56
+ "type": "module",
57
+ "dependencies": {
58
+ "tslib": "^2.3.0"
59
+ }
60
+ }
@@ -0,0 +1,107 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken } from '@angular/core';
3
+ import * as _fuse_ui_checkbox from '@fuse_ui/checkbox';
4
+ import { ControlValueAccessor } from '@angular/forms';
5
+
6
+ interface CheckboxGroupRef {
7
+ isValueSelected(value: any): boolean;
8
+ toggle(value: any): void;
9
+ isDisabled(): boolean;
10
+ }
11
+ declare const FUSE_CHECKBOX_GROUP: InjectionToken<CheckboxGroupRef>;
12
+
13
+ interface RadioGroupRef {
14
+ selectedValue(): any;
15
+ select(value: any): void;
16
+ isDisabled(): boolean;
17
+ name: string;
18
+ }
19
+ declare const FUSE_RADIO_GROUP: InjectionToken<RadioGroupRef>;
20
+
21
+ declare class FuseCheckboxComponent implements ControlValueAccessor {
22
+ readonly label: _angular_core.InputSignal<string>;
23
+ readonly indeterminate: _angular_core.InputSignal<boolean>;
24
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
25
+ readonly disabled: _angular_core.InputSignal<boolean>;
26
+ /** Value emitted / registered when this checkbox is checked. */
27
+ readonly value: _angular_core.InputSignal<any>;
28
+ private readonly _formDisabled;
29
+ readonly checkedChange: _angular_core.OutputEmitterRef<boolean>;
30
+ protected readonly group: _fuse_ui_checkbox.CheckboxGroupRef | null;
31
+ /** Standalone checked state (bypassed when inside a group). */
32
+ private readonly _checked;
33
+ protected readonly isDisabled: _angular_core.Signal<boolean>;
34
+ protected readonly checked: _angular_core.Signal<boolean>;
35
+ private onChange;
36
+ private onTouched;
37
+ writeValue(v: any): void;
38
+ registerOnChange(fn: (v: any) => void): void;
39
+ registerOnTouched(fn: () => void): void;
40
+ setDisabledState(disabled: boolean): void;
41
+ handleChange(event: Event): void;
42
+ handleBlur(): void;
43
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseCheckboxComponent, never>;
44
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseCheckboxComponent, "fuse-checkbox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
45
+ }
46
+
47
+ declare class FuseCheckboxGroupComponent implements ControlValueAccessor, CheckboxGroupRef {
48
+ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
49
+ readonly disabled: _angular_core.InputSignal<boolean>;
50
+ readonly checkboxes: _angular_core.Signal<readonly FuseCheckboxComponent[]>;
51
+ protected readonly selectedValues: _angular_core.WritableSignal<any[]>;
52
+ private readonly _formDisabled;
53
+ readonly isDisabled: _angular_core.Signal<boolean>;
54
+ private onChange;
55
+ private onTouched;
56
+ writeValue(v: any[]): void;
57
+ registerOnChange(fn: (v: any[]) => void): void;
58
+ registerOnTouched(fn: () => void): void;
59
+ setDisabledState(disabled: boolean): void;
60
+ isValueSelected(value: any): boolean;
61
+ toggle(value: any): void;
62
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseCheckboxGroupComponent, never>;
63
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseCheckboxGroupComponent, "fuse-checkbox-group", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, ["checkboxes"], ["*"], true, never>;
64
+ }
65
+
66
+ declare class FuseRadioComponent {
67
+ readonly value: _angular_core.InputSignal<any>;
68
+ readonly label: _angular_core.InputSignal<string>;
69
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
70
+ readonly disabled: _angular_core.InputSignal<boolean>;
71
+ /** Used only when this radio is standalone (no parent fuse-radio-group). */
72
+ readonly name: _angular_core.InputSignal<string>;
73
+ protected readonly group: _fuse_ui_checkbox.RadioGroupRef | null;
74
+ protected readonly isChecked: _angular_core.Signal<boolean>;
75
+ protected readonly isDisabled: _angular_core.Signal<boolean>;
76
+ protected get radioName(): string;
77
+ handleChange(): void;
78
+ handleBlur(): void;
79
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseRadioComponent, never>;
80
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseRadioComponent, "fuse-radio", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
81
+ }
82
+
83
+ declare class FuseRadioGroupComponent implements ControlValueAccessor, RadioGroupRef {
84
+ readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
85
+ readonly ariaLabel: _angular_core.InputSignal<string>;
86
+ readonly disabled: _angular_core.InputSignal<boolean>;
87
+ /** Shared `name` attribute forwarded to all child radios. Auto-generated if omitted. */
88
+ readonly groupName: _angular_core.InputSignal<string>;
89
+ /** Satisfies the RadioGroupRef interface (requires a string property). */
90
+ get name(): string;
91
+ readonly valueChange: _angular_core.OutputEmitterRef<any>;
92
+ readonly selectedValue: _angular_core.WritableSignal<any>;
93
+ private readonly _formDisabled;
94
+ readonly isDisabled: _angular_core.Signal<boolean>;
95
+ private onChange;
96
+ private onTouched;
97
+ writeValue(v: any): void;
98
+ registerOnChange(fn: (v: any) => void): void;
99
+ registerOnTouched(fn: () => void): void;
100
+ setDisabledState(disabled: boolean): void;
101
+ select(value: any): void;
102
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseRadioGroupComponent, never>;
103
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseRadioGroupComponent, "fuse-radio-group", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "groupName": { "alias": "groupName"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, ["*"], true, never>;
104
+ }
105
+
106
+ export { FUSE_CHECKBOX_GROUP, FUSE_RADIO_GROUP, FuseCheckboxComponent, FuseCheckboxGroupComponent, FuseRadioComponent, FuseRadioGroupComponent };
107
+ export type { CheckboxGroupRef, RadioGroupRef };