@spartan-ng/brain 0.0.1-alpha.455 → 0.0.1-alpha.457
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.
|
@@ -1,61 +1,156 @@
|
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
1
2
|
import { type AfterContentInit, ElementRef, type OnDestroy } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
2
4
|
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
3
5
|
import * as i0 from "@angular/core";
|
|
4
6
|
export declare const BRN_CHECKBOX_VALUE_ACCESSOR: {
|
|
5
|
-
provide: import("@angular/core").InjectionToken<readonly
|
|
7
|
+
provide: import("@angular/core").InjectionToken<readonly ControlValueAccessor[]>;
|
|
6
8
|
useExisting: import("@angular/core").Type<any>;
|
|
7
9
|
multi: boolean;
|
|
8
10
|
};
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
+
export declare class BrnCheckboxComponent implements ControlValueAccessor, AfterContentInit, OnDestroy {
|
|
12
|
+
private readonly _destroyRef;
|
|
11
13
|
private readonly _renderer;
|
|
12
14
|
private readonly _elementRef;
|
|
13
15
|
private readonly _focusMonitor;
|
|
16
|
+
private readonly _cdr;
|
|
17
|
+
private readonly _document;
|
|
14
18
|
private readonly _isBrowser;
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
protected readonly focusVisible: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
+
protected readonly focused: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Current checked state of checkbox.
|
|
23
|
+
* Can be boolean (true/false) or 'indeterminate'.
|
|
24
|
+
* Can be bound with [(checked)] for two-way binding.
|
|
25
|
+
*/
|
|
19
26
|
readonly checked: import("@angular/core").ModelSignal<BrnCheckboxValue>;
|
|
27
|
+
/**
|
|
28
|
+
* Read-only signal of current checkbox state.
|
|
29
|
+
* Use this when you only need to read state without changing it.
|
|
30
|
+
*/
|
|
20
31
|
readonly isChecked: import("@angular/core").Signal<BrnCheckboxValue>;
|
|
32
|
+
/**
|
|
33
|
+
* Computed data-state attribute value based on checked state.
|
|
34
|
+
* Returns 'checked', 'unchecked', or 'indeterminate'.
|
|
35
|
+
*/
|
|
21
36
|
protected readonly _dataState: import("@angular/core").Signal<"indeterminate" | "checked" | "unchecked">;
|
|
37
|
+
/**
|
|
38
|
+
* Computed aria-checked attribute value for accessibility.
|
|
39
|
+
* Returns 'true', 'false', or 'mixed' (for indeterminate).
|
|
40
|
+
*/
|
|
22
41
|
protected readonly _ariaChecked: import("@angular/core").Signal<"mixed" | "true" | "false">;
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Unique identifier for checkbox component.
|
|
44
|
+
* When provided, inner button gets ID without '-checkbox' suffix.
|
|
45
|
+
* Auto-generates ID if not provided.
|
|
46
|
+
*/
|
|
25
47
|
readonly id: import("@angular/core").InputSignal<string | null>;
|
|
26
|
-
|
|
27
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Form control name for checkbox.
|
|
50
|
+
* When provided, inner button gets name without '-checkbox' suffix.
|
|
51
|
+
*/
|
|
28
52
|
readonly name: import("@angular/core").InputSignal<string | null>;
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
/**
|
|
54
|
+
* CSS classes applied to inner button element.
|
|
55
|
+
*/
|
|
56
|
+
readonly class: import("@angular/core").InputSignal<string | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Accessibility label for screen readers.
|
|
59
|
+
* Use when no visible label exists.
|
|
60
|
+
*/
|
|
31
61
|
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
32
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* ID of element that labels this checkbox for accessibility.
|
|
64
|
+
* Auto-set when checkbox is inside label element.
|
|
65
|
+
*/
|
|
33
66
|
readonly ariaLabelledby: import("@angular/core").InputSignal<string | null>;
|
|
67
|
+
readonly mutableAriaLabelledby: import("@angular/core").WritableSignal<string | null>;
|
|
68
|
+
/**
|
|
69
|
+
* ID of element that describes this checkbox for accessibility.
|
|
70
|
+
*/
|
|
34
71
|
readonly ariaDescribedby: import("@angular/core").InputSignal<string | null>;
|
|
35
|
-
|
|
36
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Whether checkbox is required in a form.
|
|
74
|
+
*/
|
|
75
|
+
readonly required: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
76
|
+
/**
|
|
77
|
+
* Whether checkbox is disabled.
|
|
78
|
+
* Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute.
|
|
79
|
+
*/
|
|
80
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
|
|
81
|
+
/**
|
|
82
|
+
* Computed state for checkbox container and accessibility.
|
|
83
|
+
* Manages ID, name, and disabled state.
|
|
84
|
+
*/
|
|
37
85
|
protected readonly state: import("@angular/core").Signal<{
|
|
38
86
|
disabled: import("@angular/core").WritableSignal<boolean>;
|
|
87
|
+
name: string | null;
|
|
88
|
+
id: string | null;
|
|
39
89
|
}>;
|
|
40
90
|
protected _onChange: ChangeFn<BrnCheckboxValue>;
|
|
41
91
|
private _onTouched;
|
|
42
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Reference to the checkbox button element in the template.
|
|
94
|
+
*/
|
|
95
|
+
readonly checkbox: import("@angular/core").Signal<ElementRef<HTMLButtonElement>>;
|
|
96
|
+
/**
|
|
97
|
+
* Event emitted when checkbox value changes.
|
|
98
|
+
* Emits new checked state (true/false/'indeterminate').
|
|
99
|
+
*/
|
|
43
100
|
readonly changed: import("@angular/core").OutputEmitterRef<BrnCheckboxValue>;
|
|
101
|
+
/**
|
|
102
|
+
* Event emitted when checkbox is blurred (loses focus).
|
|
103
|
+
* Used for form validation.
|
|
104
|
+
*/
|
|
105
|
+
readonly touched: import("@angular/core").OutputEmitterRef<void>;
|
|
44
106
|
constructor();
|
|
45
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Toggles checkbox between checked/unchecked states.
|
|
109
|
+
* If checkbox is indeterminate, sets to checked.
|
|
110
|
+
* Does nothing if checkbox is disabled.
|
|
111
|
+
*/
|
|
112
|
+
toggle(): void;
|
|
46
113
|
ngAfterContentInit(): void;
|
|
47
114
|
ngOnDestroy(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Gets proper ID for inner button element.
|
|
117
|
+
* Removes '-checkbox' suffix if present in container ID.
|
|
118
|
+
*
|
|
119
|
+
* @param idPassedToContainer - ID applied to container element
|
|
120
|
+
* @returns ID to use for inner button or null
|
|
121
|
+
*/
|
|
122
|
+
protected getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null;
|
|
123
|
+
/**
|
|
124
|
+
* Updates internal state when control value changes from outside.
|
|
125
|
+
* Handles boolean and 'indeterminate' values.
|
|
126
|
+
* Part of ControlValueAccessor interface.
|
|
127
|
+
*
|
|
128
|
+
* @param value - New checkbox state (true/false/'indeterminate')
|
|
129
|
+
*/
|
|
48
130
|
writeValue(value: BrnCheckboxValue): void;
|
|
131
|
+
/**
|
|
132
|
+
* Registers callback for value changes.
|
|
133
|
+
* Part of ControlValueAccessor interface.
|
|
134
|
+
*
|
|
135
|
+
* @param fn - Function to call when value changes
|
|
136
|
+
*/
|
|
49
137
|
registerOnChange(fn: ChangeFn<BrnCheckboxValue>): void;
|
|
138
|
+
/**
|
|
139
|
+
* Registers callback for touched events.
|
|
140
|
+
* Part of ControlValueAccessor interface.
|
|
141
|
+
*
|
|
142
|
+
* @param fn - Function to call when control is touched
|
|
143
|
+
*/
|
|
50
144
|
registerOnTouched(fn: TouchFn): void;
|
|
51
|
-
/** Implemented as a part of ControlValueAccessor. */
|
|
52
|
-
setDisabledState(isDisabled: boolean): void;
|
|
53
145
|
/**
|
|
54
|
-
*
|
|
146
|
+
* Updates disabled state from form control.
|
|
147
|
+
* Part of ControlValueAccessor interface.
|
|
148
|
+
*
|
|
149
|
+
* @param isDisabled - Whether checkbox should be disabled
|
|
55
150
|
*/
|
|
56
|
-
|
|
151
|
+
setDisabledState(isDisabled: boolean): void;
|
|
57
152
|
static ɵfac: i0.ɵɵFactoryDeclaration<BrnCheckboxComponent, never>;
|
|
58
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckboxComponent, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, ["*"], true, never>;
|
|
153
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckboxComponent, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; "touched": "touched"; }, never, ["*"], true, never>;
|
|
59
154
|
}
|
|
60
155
|
type BrnCheckboxValue = boolean | 'indeterminate';
|
|
61
156
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { forwardRef,
|
|
2
|
+
import { forwardRef, inject, DestroyRef, Renderer2, ElementRef, ChangeDetectorRef, PLATFORM_ID, signal, model, computed, input, linkedSignal, booleanAttribute, viewChild, output, effect, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
4
|
-
import {
|
|
4
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
5
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
7
|
|
|
7
8
|
const BRN_CHECKBOX_VALUE_ACCESSOR = {
|
|
@@ -9,96 +10,164 @@ const BRN_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
9
10
|
useExisting: forwardRef(() => BrnCheckboxComponent),
|
|
10
11
|
multi: true,
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
if (value === 'indeterminate')
|
|
14
|
-
return 'indeterminate';
|
|
15
|
-
return booleanAttribute(value);
|
|
16
|
-
}
|
|
13
|
+
let uniqueIdCounter = 0;
|
|
17
14
|
const CONTAINER_POST_FIX = '-checkbox';
|
|
18
15
|
class BrnCheckboxComponent {
|
|
16
|
+
_destroyRef = inject(DestroyRef);
|
|
19
17
|
_renderer = inject(Renderer2);
|
|
20
18
|
_elementRef = inject(ElementRef);
|
|
21
19
|
_focusMonitor = inject(FocusMonitor);
|
|
20
|
+
_cdr = inject(ChangeDetectorRef);
|
|
21
|
+
_document = inject(DOCUMENT);
|
|
22
22
|
_isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
focusVisible = signal(false);
|
|
24
|
+
focused = signal(false);
|
|
25
|
+
/**
|
|
26
|
+
* Current checked state of checkbox.
|
|
27
|
+
* Can be boolean (true/false) or 'indeterminate'.
|
|
28
|
+
* Can be bound with [(checked)] for two-way binding.
|
|
29
|
+
*/
|
|
27
30
|
checked = model(false);
|
|
31
|
+
/**
|
|
32
|
+
* Read-only signal of current checkbox state.
|
|
33
|
+
* Use this when you only need to read state without changing it.
|
|
34
|
+
*/
|
|
28
35
|
isChecked = this.checked.asReadonly();
|
|
36
|
+
/**
|
|
37
|
+
* Computed data-state attribute value based on checked state.
|
|
38
|
+
* Returns 'checked', 'unchecked', or 'indeterminate'.
|
|
39
|
+
*/
|
|
29
40
|
_dataState = computed(() => {
|
|
30
41
|
const checked = this.checked();
|
|
31
42
|
if (checked === 'indeterminate')
|
|
32
43
|
return 'indeterminate';
|
|
33
44
|
return checked ? 'checked' : 'unchecked';
|
|
34
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* Computed aria-checked attribute value for accessibility.
|
|
48
|
+
* Returns 'true', 'false', or 'mixed' (for indeterminate).
|
|
49
|
+
*/
|
|
35
50
|
_ariaChecked = computed(() => {
|
|
36
51
|
const checked = this.checked();
|
|
37
52
|
if (checked === 'indeterminate')
|
|
38
53
|
return 'mixed';
|
|
39
54
|
return checked ? 'true' : 'false';
|
|
40
55
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Unique identifier for checkbox component.
|
|
58
|
+
* When provided, inner button gets ID without '-checkbox' suffix.
|
|
59
|
+
* Auto-generates ID if not provided.
|
|
60
|
+
*/
|
|
61
|
+
id = input(uniqueIdCounter++ + '');
|
|
62
|
+
/**
|
|
63
|
+
* Form control name for checkbox.
|
|
64
|
+
* When provided, inner button gets name without '-checkbox' suffix.
|
|
65
|
+
*/
|
|
51
66
|
name = input(null);
|
|
52
|
-
|
|
53
|
-
|
|
67
|
+
/**
|
|
68
|
+
* CSS classes applied to inner button element.
|
|
69
|
+
*/
|
|
70
|
+
class = input(null);
|
|
71
|
+
/**
|
|
72
|
+
* Accessibility label for screen readers.
|
|
73
|
+
* Use when no visible label exists.
|
|
74
|
+
*/
|
|
54
75
|
ariaLabel = input(null, { alias: 'aria-label' });
|
|
55
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* ID of element that labels this checkbox for accessibility.
|
|
78
|
+
* Auto-set when checkbox is inside label element.
|
|
79
|
+
*/
|
|
56
80
|
ariaLabelledby = input(null, { alias: 'aria-labelledby' });
|
|
81
|
+
mutableAriaLabelledby = linkedSignal(() => this.ariaLabelledby());
|
|
82
|
+
/**
|
|
83
|
+
* ID of element that describes this checkbox for accessibility.
|
|
84
|
+
*/
|
|
57
85
|
ariaDescribedby = input(null, { alias: 'aria-describedby' });
|
|
86
|
+
/**
|
|
87
|
+
* Whether checkbox is required in a form.
|
|
88
|
+
*/
|
|
58
89
|
required = input(false, { transform: booleanAttribute });
|
|
90
|
+
/**
|
|
91
|
+
* Whether checkbox is disabled.
|
|
92
|
+
* Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute.
|
|
93
|
+
*/
|
|
59
94
|
disabled = input(false, { transform: booleanAttribute });
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Computed state for checkbox container and accessibility.
|
|
97
|
+
* Manages ID, name, and disabled state.
|
|
98
|
+
*/
|
|
99
|
+
state = computed(() => {
|
|
100
|
+
const name = this.name();
|
|
101
|
+
const id = this.id();
|
|
102
|
+
return {
|
|
103
|
+
disabled: signal(this.disabled()),
|
|
104
|
+
name: name ? name + CONTAINER_POST_FIX : null,
|
|
105
|
+
id: id ? id + CONTAINER_POST_FIX : null,
|
|
106
|
+
};
|
|
107
|
+
});
|
|
63
108
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
64
109
|
_onChange = () => { };
|
|
65
110
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
66
111
|
_onTouched = () => { };
|
|
112
|
+
/**
|
|
113
|
+
* Reference to the checkbox button element in the template.
|
|
114
|
+
*/
|
|
67
115
|
checkbox = viewChild.required('checkBox');
|
|
116
|
+
/**
|
|
117
|
+
* Event emitted when checkbox value changes.
|
|
118
|
+
* Emits new checked state (true/false/'indeterminate').
|
|
119
|
+
*/
|
|
68
120
|
changed = output();
|
|
121
|
+
/**
|
|
122
|
+
* Event emitted when checkbox is blurred (loses focus).
|
|
123
|
+
* Used for form validation.
|
|
124
|
+
*/
|
|
125
|
+
touched = output();
|
|
69
126
|
constructor() {
|
|
70
127
|
effect(() => {
|
|
71
|
-
const
|
|
72
|
-
|
|
128
|
+
const state = this.state();
|
|
129
|
+
const isDisabled = state.disabled();
|
|
130
|
+
if (!this._elementRef.nativeElement || !this._isBrowser)
|
|
73
131
|
return;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
132
|
+
const newLabelId = state.id + '-label';
|
|
133
|
+
const checkboxButtonId = this.getCheckboxButtonId(state.id);
|
|
134
|
+
const labelElement = this._elementRef.nativeElement.closest('label') ??
|
|
135
|
+
this._document.querySelector(`label[for="${checkboxButtonId}"]`);
|
|
136
|
+
if (!labelElement)
|
|
77
137
|
return;
|
|
138
|
+
const existingLabelId = labelElement.id;
|
|
139
|
+
this._renderer.setAttribute(labelElement, 'data-disabled', isDisabled ? 'true' : 'false');
|
|
140
|
+
this.mutableAriaLabelledby.set(existingLabelId || newLabelId);
|
|
141
|
+
if (!existingLabelId || existingLabelId.length === 0) {
|
|
142
|
+
this._renderer.setAttribute(labelElement, 'id', newLabelId);
|
|
78
143
|
}
|
|
79
|
-
if (!this._isBrowser)
|
|
80
|
-
return;
|
|
81
|
-
const label = parent?.querySelector(`label[for="${this.id()}"]`);
|
|
82
|
-
if (!label)
|
|
83
|
-
return;
|
|
84
|
-
this._renderer.setAttribute(label, 'data-disabled', this.state().disabled() ? 'true' : 'false');
|
|
85
144
|
});
|
|
86
145
|
}
|
|
87
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Toggles checkbox between checked/unchecked states.
|
|
148
|
+
* If checkbox is indeterminate, sets to checked.
|
|
149
|
+
* Does nothing if checkbox is disabled.
|
|
150
|
+
*/
|
|
151
|
+
toggle() {
|
|
88
152
|
if (this.state().disabled())
|
|
89
153
|
return;
|
|
90
|
-
|
|
154
|
+
this._onTouched();
|
|
155
|
+
this.touched.emit();
|
|
91
156
|
const previousChecked = this.checked();
|
|
92
157
|
this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
93
|
-
this._onChange(
|
|
94
|
-
this.changed.emit(
|
|
158
|
+
this._onChange(this.checked());
|
|
159
|
+
this.changed.emit(this.checked());
|
|
95
160
|
}
|
|
96
161
|
ngAfterContentInit() {
|
|
97
|
-
this._focusMonitor
|
|
162
|
+
this._focusMonitor
|
|
163
|
+
.monitor(this._elementRef, true)
|
|
164
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
165
|
+
.subscribe((focusOrigin) => {
|
|
98
166
|
if (focusOrigin)
|
|
99
|
-
this.
|
|
167
|
+
this.focused.set(true);
|
|
100
168
|
if (focusOrigin === 'keyboard' || focusOrigin === 'program') {
|
|
101
|
-
this.
|
|
169
|
+
this.focusVisible.set(true);
|
|
170
|
+
this._cdr.markForCheck();
|
|
102
171
|
}
|
|
103
172
|
if (!focusOrigin) {
|
|
104
173
|
// When a focused element becomes disabled, the browser *immediately* fires a blur event.
|
|
@@ -107,144 +176,139 @@ class BrnCheckboxComponent {
|
|
|
107
176
|
// See https://github.com/angular/angular/issues/17793. To work around this, we defer
|
|
108
177
|
// telling the form control it has been touched until the next tick.
|
|
109
178
|
Promise.resolve().then(() => {
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
179
|
+
this.focusVisible.set(false);
|
|
180
|
+
this.focused.set(false);
|
|
112
181
|
this._onTouched();
|
|
182
|
+
this.touched.emit();
|
|
183
|
+
this._cdr.markForCheck();
|
|
113
184
|
});
|
|
114
185
|
}
|
|
115
186
|
});
|
|
116
|
-
this.checkbox().nativeElement.indeterminate = this.checked() === 'indeterminate';
|
|
117
|
-
if (this.checkbox().nativeElement.indeterminate) {
|
|
118
|
-
this.checkbox().nativeElement.value = 'indeterminate';
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.checkbox().nativeElement.value = this.checked() ? 'on' : 'off';
|
|
122
|
-
}
|
|
123
|
-
this.checkbox().nativeElement.dispatchEvent(new Event('change'));
|
|
124
187
|
}
|
|
125
188
|
ngOnDestroy() {
|
|
126
189
|
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
127
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Gets proper ID for inner button element.
|
|
193
|
+
* Removes '-checkbox' suffix if present in container ID.
|
|
194
|
+
*
|
|
195
|
+
* @param idPassedToContainer - ID applied to container element
|
|
196
|
+
* @returns ID to use for inner button or null
|
|
197
|
+
*/
|
|
198
|
+
getCheckboxButtonId(idPassedToContainer) {
|
|
199
|
+
return idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Updates internal state when control value changes from outside.
|
|
203
|
+
* Handles boolean and 'indeterminate' values.
|
|
204
|
+
* Part of ControlValueAccessor interface.
|
|
205
|
+
*
|
|
206
|
+
* @param value - New checkbox state (true/false/'indeterminate')
|
|
207
|
+
*/
|
|
128
208
|
writeValue(value) {
|
|
129
209
|
if (value === 'indeterminate') {
|
|
130
210
|
this.checked.set('indeterminate');
|
|
131
211
|
}
|
|
132
212
|
else {
|
|
133
|
-
this.checked.set(
|
|
213
|
+
this.checked.set(value);
|
|
134
214
|
}
|
|
135
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Registers callback for value changes.
|
|
218
|
+
* Part of ControlValueAccessor interface.
|
|
219
|
+
*
|
|
220
|
+
* @param fn - Function to call when value changes
|
|
221
|
+
*/
|
|
136
222
|
registerOnChange(fn) {
|
|
137
223
|
this._onChange = fn;
|
|
138
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Registers callback for touched events.
|
|
227
|
+
* Part of ControlValueAccessor interface.
|
|
228
|
+
*
|
|
229
|
+
* @param fn - Function to call when control is touched
|
|
230
|
+
*/
|
|
139
231
|
registerOnTouched(fn) {
|
|
140
232
|
this._onTouched = fn;
|
|
141
233
|
}
|
|
142
|
-
/** Implemented as a part of ControlValueAccessor. */
|
|
143
|
-
setDisabledState(isDisabled) {
|
|
144
|
-
this.state().disabled.set(isDisabled);
|
|
145
|
-
}
|
|
146
234
|
/**
|
|
147
|
-
*
|
|
235
|
+
* Updates disabled state from form control.
|
|
236
|
+
* Part of ControlValueAccessor interface.
|
|
237
|
+
*
|
|
238
|
+
* @param isDisabled - Whether checkbox should be disabled
|
|
148
239
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
240
|
+
setDisabledState(isDisabled) {
|
|
241
|
+
this.state().disabled.set(isDisabled);
|
|
242
|
+
this._cdr.markForCheck();
|
|
151
243
|
}
|
|
152
244
|
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
153
|
-
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnCheckboxComponent, isStandalone: true, selector: "brn-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", 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 }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", changed: "changed" }, host: {
|
|
154
|
-
<
|
|
245
|
+
/** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.8", type: BrnCheckboxComponent, isStandalone: true, selector: "brn-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", 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 }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", changed: "changed", touched: "touched" }, host: { properties: { "style": "{display: \"contents\"}", "attr.id": "state().id", "attr.name": "state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.data-state": "_dataState()", "attr.data-focus-visible": "focusVisible()", "attr.data-focus": "focused()", "attr.data-disabled": "state().disabled()" } }, providers: [BRN_CHECKBOX_VALUE_ACCESSOR], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
246
|
+
<button
|
|
155
247
|
#checkBox
|
|
156
|
-
tabindex="-1"
|
|
157
|
-
type="checkbox"
|
|
158
248
|
role="checkbox"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
padding: '0',
|
|
164
|
-
margin: '-1px',
|
|
165
|
-
overflow: 'hidden',
|
|
166
|
-
clip: 'rect(0, 0, 0, 0)',
|
|
167
|
-
whiteSpace: 'nowrap',
|
|
168
|
-
borderWidth: '0',
|
|
169
|
-
}"
|
|
170
|
-
[id]="id() ?? ''"
|
|
171
|
-
[name]="name() ?? ''"
|
|
172
|
-
[value]="_value()"
|
|
173
|
-
[checked]="isChecked()"
|
|
174
|
-
[required]="required()"
|
|
175
|
-
[attr.aria-label]="ariaLabel()"
|
|
176
|
-
[attr.aria-labelledby]="ariaLabelledby()"
|
|
177
|
-
[attr.aria-describedby]="ariaDescribedby()"
|
|
178
|
-
[attr.aria-required]="required() || null"
|
|
249
|
+
type="button"
|
|
250
|
+
[id]="getCheckboxButtonId(state().id) ?? ''"
|
|
251
|
+
[name]="getCheckboxButtonId(state().name) ?? ''"
|
|
252
|
+
[class]="class()"
|
|
179
253
|
[attr.aria-checked]="_ariaChecked()"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
254
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
255
|
+
[attr.aria-labelledby]="mutableAriaLabelledby() || null"
|
|
256
|
+
[attr.aria-describedby]="ariaDescribedby() || null"
|
|
257
|
+
[attr.data-state]="_dataState()"
|
|
258
|
+
[attr.data-focus-visible]="focusVisible()"
|
|
259
|
+
[attr.data-focus]="focused()"
|
|
260
|
+
[attr.data-disabled]="state().disabled()"
|
|
261
|
+
[disabled]="state().disabled()"
|
|
262
|
+
[tabIndex]="state().disabled() ? -1 : 0"
|
|
263
|
+
(click)="$event.preventDefault(); toggle()"
|
|
264
|
+
>
|
|
265
|
+
<ng-content />
|
|
266
|
+
</button>
|
|
267
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
183
268
|
}
|
|
184
269
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnCheckboxComponent, decorators: [{
|
|
185
270
|
type: Component,
|
|
186
271
|
args: [{
|
|
187
272
|
selector: 'brn-checkbox',
|
|
188
|
-
imports: [NgStyle],
|
|
189
273
|
template: `
|
|
190
|
-
<
|
|
274
|
+
<button
|
|
191
275
|
#checkBox
|
|
192
|
-
tabindex="-1"
|
|
193
|
-
type="checkbox"
|
|
194
276
|
role="checkbox"
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
padding: '0',
|
|
200
|
-
margin: '-1px',
|
|
201
|
-
overflow: 'hidden',
|
|
202
|
-
clip: 'rect(0, 0, 0, 0)',
|
|
203
|
-
whiteSpace: 'nowrap',
|
|
204
|
-
borderWidth: '0',
|
|
205
|
-
}"
|
|
206
|
-
[id]="id() ?? ''"
|
|
207
|
-
[name]="name() ?? ''"
|
|
208
|
-
[value]="_value()"
|
|
209
|
-
[checked]="isChecked()"
|
|
210
|
-
[required]="required()"
|
|
211
|
-
[attr.aria-label]="ariaLabel()"
|
|
212
|
-
[attr.aria-labelledby]="ariaLabelledby()"
|
|
213
|
-
[attr.aria-describedby]="ariaDescribedby()"
|
|
214
|
-
[attr.aria-required]="required() || null"
|
|
277
|
+
type="button"
|
|
278
|
+
[id]="getCheckboxButtonId(state().id) ?? ''"
|
|
279
|
+
[name]="getCheckboxButtonId(state().name) ?? ''"
|
|
280
|
+
[class]="class()"
|
|
215
281
|
[attr.aria-checked]="_ariaChecked()"
|
|
216
|
-
|
|
217
|
-
|
|
282
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
283
|
+
[attr.aria-labelledby]="mutableAriaLabelledby() || null"
|
|
284
|
+
[attr.aria-describedby]="ariaDescribedby() || null"
|
|
285
|
+
[attr.data-state]="_dataState()"
|
|
286
|
+
[attr.data-focus-visible]="focusVisible()"
|
|
287
|
+
[attr.data-focus]="focused()"
|
|
288
|
+
[attr.data-disabled]="state().disabled()"
|
|
289
|
+
[disabled]="state().disabled()"
|
|
290
|
+
[tabIndex]="state().disabled() ? -1 : 0"
|
|
291
|
+
(click)="$event.preventDefault(); toggle()"
|
|
292
|
+
>
|
|
293
|
+
<ng-content />
|
|
294
|
+
</button>
|
|
218
295
|
`,
|
|
219
296
|
host: {
|
|
220
|
-
'[
|
|
297
|
+
'[style]': '{display: "contents"}',
|
|
298
|
+
'[attr.id]': 'state().id',
|
|
299
|
+
'[attr.name]': 'state().name',
|
|
300
|
+
'[attr.aria-labelledby]': 'null',
|
|
301
|
+
'[attr.aria-label]': 'null',
|
|
302
|
+
'[attr.aria-describedby]': 'null',
|
|
221
303
|
'[attr.data-state]': '_dataState()',
|
|
222
304
|
'[attr.data-focus-visible]': 'focusVisible()',
|
|
223
305
|
'[attr.data-focus]': 'focused()',
|
|
224
306
|
'[attr.data-disabled]': 'state().disabled()',
|
|
225
|
-
'[attr.aria-labelledby]': 'null',
|
|
226
|
-
'[attr.aria-label]': 'null',
|
|
227
|
-
'[attr.aria-describedby]': 'null',
|
|
228
|
-
'[attr.id]': 'hostId()',
|
|
229
|
-
'[attr.name]': 'hostName()',
|
|
230
307
|
},
|
|
231
308
|
providers: [BRN_CHECKBOX_VALUE_ACCESSOR],
|
|
232
309
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
233
|
-
encapsulation: ViewEncapsulation.None,
|
|
234
310
|
}]
|
|
235
|
-
}], ctorParameters: () => []
|
|
236
|
-
type: HostListener,
|
|
237
|
-
args: ['click', ['$event']]
|
|
238
|
-
}, {
|
|
239
|
-
type: HostListener,
|
|
240
|
-
args: ['keyup.space', ['$event']]
|
|
241
|
-
}, {
|
|
242
|
-
type: HostListener,
|
|
243
|
-
args: ['keyup.enter', ['$event']]
|
|
244
|
-
}], preventScrolling: [{
|
|
245
|
-
type: HostListener,
|
|
246
|
-
args: ['keydown.space', ['$event']]
|
|
247
|
-
}] } });
|
|
311
|
+
}], ctorParameters: () => [] });
|
|
248
312
|
|
|
249
313
|
const BrnCheckboxImports = [BrnCheckboxComponent];
|
|
250
314
|
class BrnCheckboxModule {
|
|
@@ -264,5 +328,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
|
|
|
264
328
|
* Generated bundle index. Do not edit.
|
|
265
329
|
*/
|
|
266
330
|
|
|
267
|
-
export { BRN_CHECKBOX_VALUE_ACCESSOR, BrnCheckboxComponent, BrnCheckboxImports, BrnCheckboxModule
|
|
331
|
+
export { BRN_CHECKBOX_VALUE_ACCESSOR, BrnCheckboxComponent, BrnCheckboxImports, BrnCheckboxModule };
|
|
268
332
|
//# sourceMappingURL=spartan-ng-brain-checkbox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spartan-ng-brain-checkbox.mjs","sources":["../../../../libs/brain/checkbox/src/lib/brn-checkbox.component.ts","../../../../libs/brain/checkbox/src/index.ts","../../../../libs/brain/checkbox/src/spartan-ng-brain-checkbox.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { NgStyle, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tHostListener,\n\ttype OnDestroy,\n\tPLATFORM_ID,\n\tRenderer2,\n\tViewEncapsulation,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tforwardRef,\n\tinject,\n\tinput,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckboxComponent),\n\tmulti: true,\n};\n\nexport function indeterminateBooleanAttribute(value: unknown): boolean | 'indeterminate' {\n\tif (value === 'indeterminate') return 'indeterminate';\n\treturn booleanAttribute(value);\n}\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\timports: [NgStyle],\n\ttemplate: `\n\t\t<input\n\t\t\t#checkBox\n\t\t\ttabindex=\"-1\"\n\t\t\ttype=\"checkbox\"\n\t\t\trole=\"checkbox\"\n\t\t\t[ngStyle]=\"{\n\t\t\t\tposition: 'absolute',\n\t\t\t\twidth: '1px',\n\t\t\t\theight: '1px',\n\t\t\t\tpadding: '0',\n\t\t\t\tmargin: '-1px',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tclip: 'rect(0, 0, 0, 0)',\n\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\tborderWidth: '0',\n\t\t\t}\"\n\t\t\t[id]=\"id() ?? ''\"\n\t\t\t[name]=\"name() ?? ''\"\n\t\t\t[value]=\"_value()\"\n\t\t\t[checked]=\"isChecked()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-label]=\"ariaLabel()\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby()\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby()\"\n\t\t\t[attr.aria-required]=\"required() || null\"\n\t\t\t[attr.aria-checked]=\"_ariaChecked()\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n\thost: {\n\t\t'[attr.tabindex]': 'state().disabled() ? \"-1\" : \"0\"',\n\t\t'[attr.data-state]': '_dataState()',\n\t\t'[attr.data-focus-visible]': 'focusVisible()',\n\t\t'[attr.data-focus]': 'focused()',\n\t\t'[attr.data-disabled]': 'state().disabled()',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.id]': 'hostId()',\n\t\t'[attr.name]': 'hostName()',\n\t},\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnCheckboxComponent implements AfterContentInit, OnDestroy {\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n\tprivate readonly _focusVisible = signal(false);\n\tpublic readonly focusVisible = this._focusVisible.asReadonly();\n\tprivate readonly _focused = signal(false);\n\tpublic readonly focused = this._focused.asReadonly();\n\n\tpublic readonly checked = model<BrnCheckboxValue>(false);\n\tpublic readonly isChecked = this.checked.asReadonly();\n\n\tprotected readonly _dataState = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'indeterminate';\n\t\treturn checked ? 'checked' : 'unchecked';\n\t});\n\tprotected readonly _ariaChecked = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'mixed';\n\t\treturn checked ? 'true' : 'false';\n\t});\n\tprotected readonly _value = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return '';\n\t\treturn checked ? 'on' : 'off';\n\t});\n\n\t/** Used to set the id on the underlying input element. */\n\tpublic readonly id = input<string | null>(null);\n\tprotected readonly hostId = computed(() => (this.id() ? this.id() + CONTAINER_POST_FIX : null));\n\n\t/** Used to set the name attribute on the underlying input element. */\n\tpublic readonly name = input<string | null>(null);\n\tprotected readonly hostName = computed(() => (this.name() ? this.name() + CONTAINER_POST_FIX : null));\n\n\t/** Used to set the aria-label attribute on the underlying input element. */\n\tpublic readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n\t/** Used to set the aria-labelledby attribute on the underlying input element. */\n\tpublic readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\tpublic readonly required = input(false, { transform: booleanAttribute });\n\n\tpublic readonly disabled = input(false, { transform: booleanAttribute });\n\n\tprotected readonly state = computed(() => ({\n\t\tdisabled: signal(this.disabled()),\n\t}));\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<BrnCheckboxValue> = () => {};\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onTouched: TouchFn = () => {};\n\n\tpublic readonly checkbox = viewChild.required<ElementRef<HTMLInputElement>>('checkBox');\n\n\tpublic readonly changed = output<BrnCheckboxValue>();\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst parent = this._renderer.parentNode(this._elementRef.nativeElement);\n\t\t\tif (!parent) return;\n\t\t\t// check if parent is a label and assume it is for this checkbox\n\t\t\tif (parent?.tagName === 'LABEL') {\n\t\t\t\tthis._renderer.setAttribute(parent, 'data-disabled', this.state().disabled() ? 'true' : 'false');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._isBrowser) return;\n\n\t\t\tconst label = parent?.querySelector(`label[for=\"${this.id()}\"]`);\n\t\t\tif (!label) return;\n\t\t\tthis._renderer.setAttribute(label, 'data-disabled', this.state().disabled() ? 'true' : 'false');\n\t\t});\n\t}\n\n\t@HostListener('click', ['$event'])\n\t@HostListener('keyup.space', ['$event'])\n\t@HostListener('keyup.enter', ['$event'])\n\ttoggle(event: Event) {\n\t\tif (this.state().disabled()) return;\n\t\tevent.preventDefault();\n\t\tconst previousChecked = this.checked();\n\t\tthis.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);\n\t\tthis._onChange(!previousChecked);\n\t\tthis.changed.emit(!previousChecked);\n\t}\n\n\tngAfterContentInit() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true).subscribe((focusOrigin) => {\n\t\t\tif (focusOrigin) this._focused.set(true);\n\t\t\tif (focusOrigin === 'keyboard' || focusOrigin === 'program') {\n\t\t\t\tthis._focusVisible.set(true);\n\t\t\t}\n\t\t\tif (!focusOrigin) {\n\t\t\t\t// When a focused element becomes disabled, the browser *immediately* fires a blur event.\n\t\t\t\t// Angular does not expect events to be raised during change detection, so any state\n\t\t\t\t// change (such as a form control's ng-touched) will cause a changed-after-checked error.\n\t\t\t\t// See https://github.com/angular/angular/issues/17793. To work around this, we defer\n\t\t\t\t// telling the form control it has been touched until the next tick.\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tthis._focusVisible.set(false);\n\t\t\t\t\tthis._focused.set(false);\n\t\t\t\t\tthis._onTouched();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tthis.checkbox().nativeElement.indeterminate = this.checked() === 'indeterminate';\n\t\tif (this.checkbox().nativeElement.indeterminate) {\n\t\t\tthis.checkbox().nativeElement.value = 'indeterminate';\n\t\t} else {\n\t\t\tthis.checkbox().nativeElement.value = this.checked() ? 'on' : 'off';\n\t\t}\n\t\tthis.checkbox().nativeElement.dispatchEvent(new Event('change'));\n\t}\n\n\tngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\twriteValue(value: BrnCheckboxValue): void {\n\t\tif (value === 'indeterminate') {\n\t\t\tthis.checked.set('indeterminate');\n\t\t} else {\n\t\t\tthis.checked.set(!!value);\n\t\t}\n\t}\n\n\tregisterOnChange(fn: ChangeFn<BrnCheckboxValue>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/** Implemented as a part of ControlValueAccessor. */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.state().disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * If the space key is pressed, prevent the default action to stop the page from scrolling.\n\t */\n\t@HostListener('keydown.space', ['$event'])\n\tprotected preventScrolling(event: KeyboardEvent): void {\n\t\tevent.preventDefault();\n\t}\n}\n\ntype BrnCheckboxValue = boolean | 'indeterminate';\n","import { NgModule } from '@angular/core';\n\nimport { BrnCheckboxComponent } from './lib/brn-checkbox.component';\n\nexport * from './lib/brn-checkbox.component';\n\nexport const BrnCheckboxImports = [BrnCheckboxComponent] as const;\n\n@NgModule({\n\timports: [...BrnCheckboxImports],\n\texports: [...BrnCheckboxImports],\n})\nexport class BrnCheckboxModule {}\n","/**\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/src/index.ts","../../../../libs/brain/checkbox/src/spartan-ng-brain-checkbox.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tDestroyRef,\n\tElementRef,\n\ttype OnDestroy,\n\tPLATFORM_ID,\n\tRenderer2,\n\tbooleanAttribute,\n\tcomputed,\n\teffect,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\toutput,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckboxComponent),\n\tmulti: true,\n};\n\nlet uniqueIdCounter = 0;\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\ttemplate: `\n\t\t<button\n\t\t\t#checkBox\n\t\t\trole=\"checkbox\"\n\t\t\ttype=\"button\"\n\t\t\t[id]=\"getCheckboxButtonId(state().id) ?? ''\"\n\t\t\t[name]=\"getCheckboxButtonId(state().name) ?? ''\"\n\t\t\t[class]=\"class()\"\n\t\t\t[attr.aria-checked]=\"_ariaChecked()\"\n\t\t\t[attr.aria-label]=\"ariaLabel() || null\"\n\t\t\t[attr.aria-labelledby]=\"mutableAriaLabelledby() || null\"\n\t\t\t[attr.aria-describedby]=\"ariaDescribedby() || null\"\n\t\t\t[attr.data-state]=\"_dataState()\"\n\t\t\t[attr.data-focus-visible]=\"focusVisible()\"\n\t\t\t[attr.data-focus]=\"focused()\"\n\t\t\t[attr.data-disabled]=\"state().disabled()\"\n\t\t\t[disabled]=\"state().disabled()\"\n\t\t\t[tabIndex]=\"state().disabled() ? -1 : 0\"\n\t\t\t(click)=\"$event.preventDefault(); toggle()\"\n\t\t>\n\t\t\t<ng-content />\n\t\t</button>\n\t`,\n\thost: {\n\t\t'[style]': '{display: \"contents\"}',\n\t\t'[attr.id]': 'state().id',\n\t\t'[attr.name]': 'state().name',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t'[attr.data-state]': '_dataState()',\n\t\t'[attr.data-focus-visible]': 'focusVisible()',\n\t\t'[attr.data-focus]': 'focused()',\n\t\t'[attr.data-disabled]': 'state().disabled()',\n\t},\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BrnCheckboxComponent implements ControlValueAccessor, AfterContentInit, OnDestroy {\n\tprivate readonly _destroyRef = inject(DestroyRef);\n\tprivate readonly _renderer = inject(Renderer2);\n\tprivate readonly _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _cdr = inject(ChangeDetectorRef);\n\tprivate readonly _document = inject(DOCUMENT);\n\tprivate readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n\tprotected readonly focusVisible = signal(false);\n\tprotected readonly focused = signal(false);\n\n\t/**\n\t * Current checked state of checkbox.\n\t * Can be boolean (true/false) or 'indeterminate'.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checked = model<BrnCheckboxValue>(false);\n\n\t/**\n\t * Read-only signal of current checkbox state.\n\t * Use this when you only need to read state without changing it.\n\t */\n\tpublic readonly isChecked = this.checked.asReadonly();\n\n\t/**\n\t * Computed data-state attribute value based on checked state.\n\t * Returns 'checked', 'unchecked', or 'indeterminate'.\n\t */\n\tprotected readonly _dataState = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'indeterminate';\n\t\treturn checked ? 'checked' : 'unchecked';\n\t});\n\n\t/**\n\t * Computed aria-checked attribute value for accessibility.\n\t * Returns 'true', 'false', or 'mixed' (for indeterminate).\n\t */\n\tprotected readonly _ariaChecked = computed(() => {\n\t\tconst checked = this.checked();\n\t\tif (checked === 'indeterminate') return 'mixed';\n\t\treturn checked ? 'true' : 'false';\n\t});\n\n\t/**\n\t * Unique identifier for checkbox component.\n\t * When provided, inner button gets ID without '-checkbox' suffix.\n\t * Auto-generates ID if not provided.\n\t */\n\tpublic readonly id = input<string | null>(uniqueIdCounter++ + '');\n\n\t/**\n\t * Form control name for checkbox.\n\t * When provided, inner button gets name without '-checkbox' suffix.\n\t */\n\tpublic readonly name = input<string | null>(null);\n\n\t/**\n\t * CSS classes applied to inner button element.\n\t */\n\tpublic readonly class = input<string | null>(null);\n\n\t/**\n\t * Accessibility label for screen readers.\n\t * Use when no visible label exists.\n\t */\n\tpublic readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n\t/**\n\t * ID of element that labels this checkbox for accessibility.\n\t * Auto-set when checkbox is inside label element.\n\t */\n\tpublic readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\tpublic readonly mutableAriaLabelledby = linkedSignal(() => this.ariaLabelledby());\n\n\t/**\n\t * ID of element that describes this checkbox for accessibility.\n\t */\n\tpublic readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n\t/**\n\t * Whether checkbox is required in a form.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether checkbox is disabled.\n\t * Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Computed state for checkbox container and accessibility.\n\t * Manages ID, name, and disabled state.\n\t */\n\tprotected readonly state = computed(() => {\n\t\tconst name = this.name();\n\t\tconst id = this.id();\n\t\treturn {\n\t\t\tdisabled: signal(this.disabled()),\n\t\t\tname: name ? name + CONTAINER_POST_FIX : null,\n\t\t\tid: id ? id + CONTAINER_POST_FIX : null,\n\t\t};\n\t});\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<BrnCheckboxValue> = () => {};\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprivate _onTouched: TouchFn = () => {};\n\n\t/**\n\t * Reference to the checkbox button element in the template.\n\t */\n\tpublic readonly checkbox = viewChild.required<ElementRef<HTMLButtonElement>>('checkBox');\n\n\t/**\n\t * Event emitted when checkbox value changes.\n\t * Emits new checked state (true/false/'indeterminate').\n\t */\n\tpublic readonly changed = output<BrnCheckboxValue>();\n\n\t/**\n\t * Event emitted when checkbox is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst state = this.state();\n\t\t\tconst isDisabled = state.disabled();\n\n\t\t\tif (!this._elementRef.nativeElement || !this._isBrowser) return;\n\n\t\t\tconst newLabelId = state.id + '-label';\n\t\t\tconst checkboxButtonId = this.getCheckboxButtonId(state.id);\n\t\t\tconst labelElement =\n\t\t\t\tthis._elementRef.nativeElement.closest('label') ??\n\t\t\t\tthis._document.querySelector(`label[for=\"${checkboxButtonId}\"]`);\n\n\t\t\tif (!labelElement) return;\n\t\t\tconst existingLabelId = labelElement.id;\n\n\t\t\tthis._renderer.setAttribute(labelElement, 'data-disabled', isDisabled ? 'true' : 'false');\n\t\t\tthis.mutableAriaLabelledby.set(existingLabelId || newLabelId);\n\n\t\t\tif (!existingLabelId || existingLabelId.length === 0) {\n\t\t\t\tthis._renderer.setAttribute(labelElement, 'id', newLabelId);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Toggles checkbox between checked/unchecked states.\n\t * If checkbox is indeterminate, sets to checked.\n\t * Does nothing if checkbox is disabled.\n\t */\n\ttoggle() {\n\t\tif (this.state().disabled()) return;\n\n\t\tthis._onTouched();\n\t\tthis.touched.emit();\n\n\t\tconst previousChecked = this.checked();\n\t\tthis.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);\n\t\tthis._onChange(this.checked());\n\t\tthis.changed.emit(this.checked());\n\t}\n\n\tngAfterContentInit() {\n\t\tthis._focusMonitor\n\t\t\t.monitor(this._elementRef, true)\n\t\t\t.pipe(takeUntilDestroyed(this._destroyRef))\n\t\t\t.subscribe((focusOrigin) => {\n\t\t\t\tif (focusOrigin) this.focused.set(true);\n\t\t\t\tif (focusOrigin === 'keyboard' || focusOrigin === 'program') {\n\t\t\t\t\tthis.focusVisible.set(true);\n\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t}\n\t\t\t\tif (!focusOrigin) {\n\t\t\t\t\t// When a focused element becomes disabled, the browser *immediately* fires a blur event.\n\t\t\t\t\t// Angular does not expect events to be raised during change detection, so any state\n\t\t\t\t\t// change (such as a form control's ng-touched) will cause a changed-after-checked error.\n\t\t\t\t\t// See https://github.com/angular/angular/issues/17793. To work around this, we defer\n\t\t\t\t\t// telling the form control it has been touched until the next tick.\n\t\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\t\tthis.focusVisible.set(false);\n\t\t\t\t\t\tthis.focused.set(false);\n\t\t\t\t\t\tthis._onTouched();\n\t\t\t\t\t\tthis.touched.emit();\n\t\t\t\t\t\tthis._cdr.markForCheck();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tngOnDestroy() {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/**\n\t * Gets proper ID for inner button element.\n\t * Removes '-checkbox' suffix if present in container ID.\n\t *\n\t * @param idPassedToContainer - ID applied to container element\n\t * @returns ID to use for inner button or null\n\t */\n\tprotected getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null {\n\t\treturn idPassedToContainer ? idPassedToContainer.replace(CONTAINER_POST_FIX, '') : null;\n\t}\n\n\t/**\n\t * Updates internal state when control value changes from outside.\n\t * Handles boolean and 'indeterminate' values.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param value - New checkbox state (true/false/'indeterminate')\n\t */\n\twriteValue(value: BrnCheckboxValue): void {\n\t\tif (value === 'indeterminate') {\n\t\t\tthis.checked.set('indeterminate');\n\t\t} else {\n\t\t\tthis.checked.set(value);\n\t\t}\n\t}\n\n\t/**\n\t * Registers callback for value changes.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when value changes\n\t */\n\tregisterOnChange(fn: ChangeFn<BrnCheckboxValue>): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/**\n\t * Registers callback for touched events.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param fn - Function to call when control is touched\n\t */\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/**\n\t * Updates disabled state from form control.\n\t * Part of ControlValueAccessor interface.\n\t *\n\t * @param isDisabled - Whether checkbox should be disabled\n\t */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.state().disabled.set(isDisabled);\n\t\tthis._cdr.markForCheck();\n\t}\n}\n\ntype BrnCheckboxValue = boolean | 'indeterminate';\n","import { NgModule } from '@angular/core';\n\nimport { BrnCheckboxComponent } from './lib/brn-checkbox.component';\n\nexport * from './lib/brn-checkbox.component';\n\nexport const BrnCheckboxImports = [BrnCheckboxComponent] as const;\n\n@NgModule({\n\timports: [...BrnCheckboxImports],\n\texports: [...BrnCheckboxImports],\n})\nexport class BrnCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AA6Ba,MAAA,2BAA2B,GAAG;AAC1C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,oBAAoB,CAAC;AACnD,IAAA,KAAK,EAAE,IAAI;;AAGZ,IAAI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