@spartan-ng/brain 1.0.5 → 1.1.0-alpha.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.
@@ -76,6 +76,11 @@ class BrnCheckbox {
76
76
  * CSS classes applied to inner button element.
77
77
  */
78
78
  class = input(null, ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
79
+ /**
80
+ * Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are
81
+ * not blocked by a strict Content-Security-Policy.
82
+ */
83
+ hostStyles = input('display: contents', ...(ngDevMode ? [{ debugName: "hostStyles" }] : /* istanbul ignore next */ []));
79
84
  /**
80
85
  * Accessibility label for screen readers.
81
86
  * Use when no visible label exists.
@@ -253,7 +258,7 @@ class BrnCheckbox {
253
258
  this._cdr.markForCheck();
254
259
  }
255
260
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
256
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnCheckbox, isStandalone: true, selector: "brn-checkbox", inputs: { checkedInput: { classPropertyName: "checkedInput", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", 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 }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange", indeterminate: "indeterminateChange", 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.aria-invalid": "_invalid?.() ? \"true\" : null", "attr.data-invalid": "_invalid?.() ? \"true\" : null", "attr.data-matches-spartan-invalid": "spartanInvalid?.() ? \"true\" : null", "attr.data-touched": "_controlTouched?.() ? \"true\" : null", "attr.data-dirty": "_dirty?.() ? \"true\" : null", "attr.data-state": "_dataState()", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_CHECKBOX_VALUE_ACCESSOR, provideBrnLabelable(BrnCheckbox)], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BrnFieldControl }], ngImport: i0, template: `
261
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnCheckbox, isStandalone: true, selector: "brn-checkbox", inputs: { checkedInput: { classPropertyName: "checkedInput", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", 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 }, hostStyles: { classPropertyName: "hostStyles", publicName: "hostStyles", 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 }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange", indeterminate: "indeterminateChange", touched: "touched" }, host: { properties: { "style": "hostStyles()", "attr.id": "_state().id", "attr.name": "_state().name", "attr.aria-labelledby": "null", "attr.aria-label": "null", "attr.aria-describedby": "null", "attr.aria-invalid": "_invalid?.() ? \"true\" : null", "attr.data-invalid": "_invalid?.() ? \"true\" : null", "attr.data-matches-spartan-invalid": "spartanInvalid?.() ? \"true\" : null", "attr.data-touched": "_controlTouched?.() ? \"true\" : null", "attr.data-dirty": "_dirty?.() ? \"true\" : null", "attr.data-state": "_dataState()", "attr.data-focus-visible": "_focusVisible()", "attr.data-focus": "_focused()", "attr.data-disabled": "_state().disabled()" } }, providers: [BRN_CHECKBOX_VALUE_ACCESSOR, provideBrnLabelable(BrnCheckbox)], viewQueries: [{ propertyName: "checkbox", first: true, predicate: ["checkBox"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BrnFieldControl }], ngImport: i0, template: `
257
262
  <button
258
263
  #checkBox
259
264
  role="checkbox"
@@ -285,7 +290,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
285
290
  changeDetection: ChangeDetectionStrategy.OnPush,
286
291
  hostDirectives: [BrnFieldControl],
287
292
  host: {
288
- '[style]': '{display: "contents"}',
293
+ '[style]': 'hostStyles()',
289
294
  '[attr.id]': '_state().id',
290
295
  '[attr.name]': '_state().name',
291
296
  '[attr.aria-labelledby]': 'null',
@@ -325,7 +330,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
325
330
  </button>
326
331
  `,
327
332
  }]
328
- }], ctorParameters: () => [], propDecorators: { checkedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], checkbox: [{ type: i0.ViewChild, args: ['checkBox', { isSignal: true }] }], touched: [{ type: i0.Output, args: ["touched"] }] } });
333
+ }], ctorParameters: () => [], propDecorators: { checkedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }, { type: i0.Output, args: ["indeterminateChange"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], hostStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "hostStyles", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], checkbox: [{ type: i0.ViewChild, args: ['checkBox', { isSignal: true }] }], touched: [{ type: i0.Output, args: ["touched"] }] } });
329
334
 
330
335
  const BrnCheckboxImports = [BrnCheckbox];
331
336
 
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-checkbox.mjs","sources":["../../../../libs/brain/checkbox/src/lib/brn-checkbox.ts","../../../../libs/brain/checkbox/src/index.ts","../../../../libs/brain/checkbox/src/spartan-ng-brain-checkbox.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tafterRenderEffect,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\tDOCUMENT,\n\tElementRef,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\ttype OnDestroy,\n\toutput,\n\tPLATFORM_ID,\n\tRenderer2,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckbox),\n\tmulti: true,\n};\n\nlet uniqueIdCounter = 0;\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR, provideBrnLabelable(BrnCheckbox)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thostDirectives: [BrnFieldControl],\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.aria-invalid]': '_invalid?.() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_invalid?.() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': 'spartanInvalid?.() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_controlTouched?.() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty?.() ? \"true\" : 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\ttemplate: `\n\t\t<button\n\t\t\t#checkBox\n\t\t\trole=\"checkbox\"\n\t\t\ttype=\"button\"\n\t\t\t[attr.id]=\"_buttonId()\"\n\t\t\t[attr.name]=\"_buttonName()\"\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})\nexport class BrnCheckbox 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 _fieldControl = inject(BrnFieldControl, { optional: true });\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 * The checked state of the checkbox.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checkedInput = input<boolean, BooleanInput>(false, { alias: 'checked', transform: booleanAttribute });\n\tpublic readonly checked = linkedSignal(this.checkedInput);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<boolean>();\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 * The indeterminate state of the checkbox.\n\t * For example, a \"select all/deselect all\" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked.\n\t */\n\tpublic readonly indeterminate = model<boolean>(false);\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\tif (this.indeterminate()) return 'indeterminate';\n\t\treturn this.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\tif (this.indeterminate()) return 'mixed';\n\t\treturn this.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 * Whether to force the field into an invalid state, regardless of the form control's state.\n\t * Overrides both the `data-invalid` and `data-matches-spartan-invalid` attributes.\n\t */\n\tpublic readonly forceInvalid = 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\tprotected readonly _buttonId = computed(() => this._getCheckboxButtonId(this._state().id));\n\n\tprotected readonly _buttonName = computed(() => this._getCheckboxButtonId(this._state().name));\n\n\tpublic readonly labelableId = this._buttonId;\n\n\tprotected readonly _dirty = this._fieldControl?.dirty;\n\tprotected readonly _invalid = computed(() => this.forceInvalid() || (this._fieldControl?.invalid?.() ?? null));\n\tpublic readonly spartanInvalid = computed(\n\t\t() => this.forceInvalid() || (this._fieldControl?.spartanInvalid?.() ?? null),\n\t);\n\tprotected readonly _controlTouched = this._fieldControl?.touched;\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<boolean> = () => {};\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 is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\n\n\tconstructor() {\n\t\tafterRenderEffect(() => {\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 newChecked = this.indeterminate() ? true : !this.checked();\n\t\tthis.indeterminate.set(false);\n\t\tthis.checkedChange.emit(newChecked);\n\t\tthis.checked.set(newChecked);\n\t\tthis._onChange(newChecked);\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(new RegExp(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: boolean): void {\n\t\tthis.checked.set(value);\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<boolean>): 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","import { BrnCheckbox } from './lib/brn-checkbox';\n\nexport * from './lib/brn-checkbox';\n\nexport const BrnCheckboxImports = [BrnCheckbox] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names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,EAAA,CAAA,EAAA,EAAA,CAAA;;AChOjF,MAAM,kBAAkB,GAAG,CAAC,WAAW;;ACJ9C;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-checkbox.mjs","sources":["../../../../libs/brain/checkbox/src/lib/brn-checkbox.ts","../../../../libs/brain/checkbox/src/index.ts","../../../../libs/brain/checkbox/src/spartan-ng-brain-checkbox.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n\ttype AfterContentInit,\n\tafterRenderEffect,\n\tbooleanAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tcomputed,\n\tDestroyRef,\n\tDOCUMENT,\n\tElementRef,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tmodel,\n\ttype OnDestroy,\n\toutput,\n\tPLATFORM_ID,\n\tRenderer2,\n\tsignal,\n\tviewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\n\nexport const BRN_CHECKBOX_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnCheckbox),\n\tmulti: true,\n};\n\nlet uniqueIdCounter = 0;\n\nconst CONTAINER_POST_FIX = '-checkbox';\n\n@Component({\n\tselector: 'brn-checkbox',\n\tproviders: [BRN_CHECKBOX_VALUE_ACCESSOR, provideBrnLabelable(BrnCheckbox)],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thostDirectives: [BrnFieldControl],\n\thost: {\n\t\t'[style]': 'hostStyles()',\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.aria-invalid]': '_invalid?.() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_invalid?.() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': 'spartanInvalid?.() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_controlTouched?.() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty?.() ? \"true\" : 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\ttemplate: `\n\t\t<button\n\t\t\t#checkBox\n\t\t\trole=\"checkbox\"\n\t\t\ttype=\"button\"\n\t\t\t[attr.id]=\"_buttonId()\"\n\t\t\t[attr.name]=\"_buttonName()\"\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})\nexport class BrnCheckbox 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 _fieldControl = inject(BrnFieldControl, { optional: true });\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 * The checked state of the checkbox.\n\t * Can be bound with [(checked)] for two-way binding.\n\t */\n\tpublic readonly checkedInput = input<boolean, BooleanInput>(false, { alias: 'checked', transform: booleanAttribute });\n\tpublic readonly checked = linkedSignal(this.checkedInput);\n\n\t/** Emits when checked state changes. */\n\tpublic readonly checkedChange = output<boolean>();\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 * The indeterminate state of the checkbox.\n\t * For example, a \"select all/deselect all\" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked.\n\t */\n\tpublic readonly indeterminate = model<boolean>(false);\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\tif (this.indeterminate()) return 'indeterminate';\n\t\treturn this.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\tif (this.indeterminate()) return 'mixed';\n\t\treturn this.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 * Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are\n\t * not blocked by a strict Content-Security-Policy.\n\t */\n\tpublic readonly hostStyles = input<string>('display: contents');\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 * Whether to force the field into an invalid state, regardless of the form control's state.\n\t * Overrides both the `data-invalid` and `data-matches-spartan-invalid` attributes.\n\t */\n\tpublic readonly forceInvalid = 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\tprotected readonly _buttonId = computed(() => this._getCheckboxButtonId(this._state().id));\n\n\tprotected readonly _buttonName = computed(() => this._getCheckboxButtonId(this._state().name));\n\n\tpublic readonly labelableId = this._buttonId;\n\n\tprotected readonly _dirty = this._fieldControl?.dirty;\n\tprotected readonly _invalid = computed(() => this.forceInvalid() || (this._fieldControl?.invalid?.() ?? null));\n\tpublic readonly spartanInvalid = computed(\n\t\t() => this.forceInvalid() || (this._fieldControl?.spartanInvalid?.() ?? null),\n\t);\n\tprotected readonly _controlTouched = this._fieldControl?.touched;\n\n\t// eslint-disable-next-line @typescript-eslint/no-empty-function\n\tprotected _onChange: ChangeFn<boolean> = () => {};\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 is blurred (loses focus).\n\t * Used for form validation.\n\t */\n\tpublic readonly touched = output<void>();\n\n\tconstructor() {\n\t\tafterRenderEffect(() => {\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 newChecked = this.indeterminate() ? true : !this.checked();\n\t\tthis.indeterminate.set(false);\n\t\tthis.checkedChange.emit(newChecked);\n\t\tthis.checked.set(newChecked);\n\t\tthis._onChange(newChecked);\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(new RegExp(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: boolean): void {\n\t\tthis.checked.set(value);\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<boolean>): 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","import { BrnCheckbox } from './lib/brn-checkbox';\n\nexport * from './lib/brn-checkbox';\n\nexport const BrnCheckboxImports = [BrnCheckbox] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA+BO,MAAM,2BAA2B,GAAG;AAC1C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE,IAAI;;AAGZ,IAAI,eAAe,GAAG,CAAC;AAEvB,MAAM,kBAAkB,GAAG,WAAW;MAgDzB,WAAW,CAAA;AACN,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,IAAA,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AAC7B,IAAA,WAAW,GAAG,MAAM,CAA0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jectionToken, inject, input, ElementRef, viewChild, booleanAttribute, computed, linkedSignal, effect, afterEveryRender, Directive } from '@angular/core';
4
+
5
+ const BrnDatePickerToken = new InjectionToken('BrnDatePickerToken');
6
+ function provideBrnDatePicker(instance) {
7
+ return { provide: BrnDatePickerToken, useExisting: instance };
8
+ }
9
+ /**
10
+ * Inject the date picker component.
11
+ */
12
+ function injectBrnDatePicker() {
13
+ return inject(BrnDatePickerToken);
14
+ }
15
+
16
+ /**
17
+ * Headless behavior shared by every date picker text input (single, multi,
18
+ * range, month-year). Owns the editable text mirror, cursor preservation and
19
+ * the commit/parse lifecycle; styled subclasses provide the template, styling
20
+ * and the parse/format strategy.
21
+ *
22
+ * `V` is the value type held by the associated date picker (e.g. `Date`,
23
+ * `Date[]` or `[Date, Date]`).
24
+ */
25
+ class BrnDateInput {
26
+ static _nextId = 0;
27
+ inputId = input(`hlm-date-picker-input-${BrnDateInput._nextId++}`, ...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
28
+ _document = inject(DOCUMENT);
29
+ _host = inject(ElementRef);
30
+ _inputElement = viewChild.required('input');
31
+ _pendingSelection = null;
32
+ _datePicker = injectBrnDatePicker();
33
+ _popover = this._datePicker.popover;
34
+ _disabled = this._datePicker.disabledState;
35
+ /** Initial text shown in the input. Mirrored by the picker once a date is committed. */
36
+ inputValue = input('', ...(ngDevMode ? [{ debugName: "inputValue" }] : /* istanbul ignore next */ []));
37
+ /** Show a clear button that resets the input and picker value. Hidden when empty. */
38
+ showClear = input(true, { ...(ngDevMode ? { debugName: "showClear" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
39
+ /** Open the popover on input click. */
40
+ openOnClick = input(false, { ...(ngDevMode ? { debugName: "openOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
41
+ /** Forces the invalid state visually, regardless of form control state. */
42
+ forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
43
+ /** Accessible label for the clear button. */
44
+ clearAriaLabel = input('Clear date', ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
45
+ /** Accessible label for the calendar trigger button. */
46
+ calendarAriaLabel = input('Open calendar', ...(ngDevMode ? [{ debugName: "calendarAriaLabel" }] : /* istanbul ignore next */ []));
47
+ /** @internal Id used by the trigger contract for labeling. */
48
+ triggerId = computed(() => this.inputId(), ...(ngDevMode ? [{ debugName: "triggerId" }] : /* istanbul ignore next */ []));
49
+ placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
50
+ /**
51
+ * Text shown in the input. Mirrors the picker's `formattedDate` and the
52
+ * parent's `inputValue`, and accepts user writes via `_handleInputChange`.
53
+ * Commits only happen on blur / Enter, so in-progress text isn't clobbered.
54
+ */
55
+ _inputValue = linkedSignal({ ...(ngDevMode ? { debugName: "_inputValue" } : /* istanbul ignore next */ {}), source: () => ({
56
+ formatted: this._datePicker.formattedDate(),
57
+ inputValue: this.inputValue(),
58
+ }),
59
+ computation: (source, previous) => {
60
+ // First render: prefer formatted, fall back to inputValue.
61
+ if (previous === undefined) {
62
+ return source.formatted ?? source.inputValue;
63
+ }
64
+ // Picker's formatted date changed - snap to canonical format.
65
+ if (source.formatted !== previous.source.formatted) {
66
+ if (source.formatted !== undefined) {
67
+ return source.formatted;
68
+ }
69
+ // Cleared externally vs. user has invalid text in flight: only
70
+ // mirror the clear when the displayed text was in sync.
71
+ return previous.value === previous.source.formatted ? '' : previous.value;
72
+ }
73
+ // Parent updated inputValue - reflect it.
74
+ if (source.inputValue !== previous.source.inputValue) {
75
+ return source.inputValue;
76
+ }
77
+ return previous.value;
78
+ } });
79
+ _showClearButton = computed(() => this.showClear() && this._inputValue().length > 0, ...(ngDevMode ? [{ debugName: "_showClearButton" }] : /* istanbul ignore next */ []));
80
+ constructor() {
81
+ effect(() => this._popover()?.setOrigin(this._host.nativeElement));
82
+ // Re-applying `[value]` on each keystroke moves the caret to the end. Restore the caret to
83
+ // where the user was typing after Angular has written the value back to the DOM.
84
+ afterEveryRender(() => {
85
+ const selection = this._pendingSelection;
86
+ if (!selection)
87
+ return;
88
+ this._pendingSelection = null;
89
+ const element = this._inputElement().nativeElement;
90
+ if (this._document.activeElement === element && selection.start !== null && selection.end !== null) {
91
+ element.setSelectionRange(selection.start, selection.end);
92
+ }
93
+ });
94
+ }
95
+ _handleInputChange(event) {
96
+ const target = event.target;
97
+ this._pendingSelection = { start: target.selectionStart, end: target.selectionEnd };
98
+ this._inputValue.set(target.value);
99
+ }
100
+ _clear() {
101
+ this._inputValue.set('');
102
+ this._datePicker.updateDate?.(null);
103
+ this._datePicker.touched?.();
104
+ }
105
+ _handleEnter(event) {
106
+ event.preventDefault();
107
+ this._commitDate();
108
+ this._popover().close();
109
+ // The field keeps focus after Enter, so restore the edit format the
110
+ // commit snapped away from - otherwise a later blur would re-parse the
111
+ // display format and clear the value.
112
+ this._handleFocus();
113
+ }
114
+ /** On focus, reformat the committed value into the input/edit format. */
115
+ _handleFocus() {
116
+ const value = this._datePicker.value?.();
117
+ if (value != null) {
118
+ this._inputValue.set(this.formatInputValue(value));
119
+ }
120
+ }
121
+ /** On blur, commit the input and snap back to the picker's display format. */
122
+ _handleBlur() {
123
+ this._commitDate();
124
+ const formatted = this._datePicker.formattedDate();
125
+ if (formatted !== undefined) {
126
+ this._inputValue.set(formatted);
127
+ }
128
+ }
129
+ _commitDate() {
130
+ const value = this._inputValue();
131
+ if (!value) {
132
+ this._datePicker.updateDate?.(null);
133
+ this._datePicker.touched?.();
134
+ return;
135
+ }
136
+ // Invalid parse: clear the picker value, keep the text so the user can fix it.
137
+ const parsed = this.parseValue(value);
138
+ this._datePicker.updateDate?.(parsed);
139
+ this._datePicker.touched?.();
140
+ }
141
+ _open() {
142
+ this._popover().open();
143
+ }
144
+ _handleClick() {
145
+ if (this.openOnClick()) {
146
+ this._open();
147
+ }
148
+ }
149
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDateInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
150
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnDateInput, isStandalone: true, inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputValue: { classPropertyName: "inputValue", publicName: "inputValue", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, openOnClick: { classPropertyName: "openOnClick", publicName: "openOnClick", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, calendarAriaLabel: { classPropertyName: "calendarAriaLabel", publicName: "calendarAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0 });
151
+ }
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDateInput, decorators: [{
153
+ type: Directive
154
+ }], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], _inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], inputValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputValue", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], openOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnClick", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], calendarAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarAriaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
155
+
156
+ const BrnDatePickerTriggerToken = new InjectionToken('BrnDatePickerTriggerToken');
157
+ function provideBrnDatePickerTrigger(instance) {
158
+ return { provide: BrnDatePickerTriggerToken, useExisting: instance };
159
+ }
160
+
161
+ /**
162
+ * Generated bundle index. Do not edit.
163
+ */
164
+
165
+ export { BrnDateInput, BrnDatePickerToken, BrnDatePickerTriggerToken, injectBrnDatePicker, provideBrnDatePicker, provideBrnDatePickerTrigger };
166
+ //# sourceMappingURL=spartan-ng-brain-date-picker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spartan-ng-brain-date-picker.mjs","sources":["../../../../libs/brain/date-picker/src/lib/brn-date-picker.token.ts","../../../../libs/brain/date-picker/src/lib/brn-date-input.ts","../../../../libs/brain/date-picker/src/lib/brn-date-picker-trigger.token.ts","../../../../libs/brain/date-picker/src/spartan-ng-brain-date-picker.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Signal, type Type } from '@angular/core';\nimport type { BrnPopover } from '@spartan-ng/brain/popover';\n\nexport interface BrnDatePickerBase<T> {\n\tpopover: Signal<BrnPopover>;\n\tdisabledState: Signal<boolean>;\n\tformattedDate: Signal<string | undefined>;\n\thasDate: Signal<boolean>;\n\t/** The current raw value. Used by inputs to reformat into the input format on focus. Optional. */\n\tvalue?: Signal<T | null>;\n\t/** Commit a date to the picker (e.g. from a parsed input). Pass `null` to clear. Optional. */\n\tupdateDate?(value: T | null): void;\n\t// used for ControlValueAccessor\n\ttouched?(): void;\n}\n\nexport const BrnDatePickerToken = new InjectionToken<BrnDatePickerBase<unknown>>('BrnDatePickerToken');\n\nexport function provideBrnDatePicker(instance: Type<BrnDatePickerBase<unknown>>): ExistingProvider {\n\treturn { provide: BrnDatePickerToken, useExisting: instance };\n}\n\n/**\n * Inject the date picker component.\n */\nexport function injectBrnDatePicker<T>(): BrnDatePickerBase<T> {\n\treturn inject(BrnDatePickerToken) as BrnDatePickerBase<T>;\n}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport {\n\tafterEveryRender,\n\tbooleanAttribute,\n\tcomputed,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnDatePicker } from './brn-date-picker.token';\n\n/**\n * Headless behavior shared by every date picker text input (single, multi,\n * range, month-year). Owns the editable text mirror, cursor preservation and\n * the commit/parse lifecycle; styled subclasses provide the template, styling\n * and the parse/format strategy.\n *\n * `V` is the value type held by the associated date picker (e.g. `Date`,\n * `Date[]` or `[Date, Date]`).\n */\n@Directive()\nexport abstract class BrnDateInput<V> {\n\tprivate static _nextId = 0;\n\n\tpublic readonly inputId = input<string>(`hlm-date-picker-input-${BrnDateInput._nextId++}`);\n\n\tprivate readonly _document = inject(DOCUMENT);\n\tprivate readonly _host = inject(ElementRef);\n\tprivate readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\tprivate _pendingSelection: { start: number | null; end: number | null } | null = null;\n\tprotected readonly _datePicker = injectBrnDatePicker<V>();\n\n\tprotected readonly _popover = this._datePicker.popover;\n\tprotected readonly _disabled = this._datePicker.disabledState;\n\n\t/** Initial text shown in the input. Mirrored by the picker once a date is committed. */\n\tpublic readonly inputValue = input<string>('');\n\n\t/** Show a clear button that resets the input and picker value. Hidden when empty. */\n\tpublic readonly showClear = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n\t/** Open the popover on input click. */\n\tpublic readonly openOnClick = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/** Forces the invalid state visually, regardless of form control state. */\n\tpublic readonly forceInvalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/** Accessible label for the clear button. */\n\tpublic readonly clearAriaLabel = input<string>('Clear date');\n\n\t/** Accessible label for the calendar trigger button. */\n\tpublic readonly calendarAriaLabel = input<string>('Open calendar');\n\n\t/** @internal Id used by the trigger contract for labeling. */\n\tpublic readonly triggerId = computed(() => this.inputId());\n\n\tpublic readonly placeholder = input<string>('');\n\n\t/**\n\t * Parse user-entered text into the picker value. Return `null` for\n\t * invalid input - the picker's value is cleared while the text is preserved\n\t * so the user can fix it.\n\t */\n\tprotected abstract parseValue(value: string): V | null;\n\n\t/**\n\t * Format the committed value into the input/edit format shown while the\n\t * input is focused. On blur the picker's display format is restored.\n\t */\n\tprotected abstract formatInputValue(value: V): string;\n\n\t/**\n\t * Text shown in the input. Mirrors the picker's `formattedDate` and the\n\t * parent's `inputValue`, and accepts user writes via `_handleInputChange`.\n\t * Commits only happen on blur / Enter, so in-progress text isn't clobbered.\n\t */\n\tprotected readonly _inputValue = linkedSignal<{ formatted: string | undefined; inputValue: string }, string>({\n\t\tsource: () => ({\n\t\t\tformatted: this._datePicker.formattedDate(),\n\t\t\tinputValue: this.inputValue(),\n\t\t}),\n\t\tcomputation: (source, previous) => {\n\t\t\t// First render: prefer formatted, fall back to inputValue.\n\t\t\tif (previous === undefined) {\n\t\t\t\treturn source.formatted ?? source.inputValue;\n\t\t\t}\n\n\t\t\t// Picker's formatted date changed - snap to canonical format.\n\t\t\tif (source.formatted !== previous.source.formatted) {\n\t\t\t\tif (source.formatted !== undefined) {\n\t\t\t\t\treturn source.formatted;\n\t\t\t\t}\n\t\t\t\t// Cleared externally vs. user has invalid text in flight: only\n\t\t\t\t// mirror the clear when the displayed text was in sync.\n\t\t\t\treturn previous.value === previous.source.formatted ? '' : previous.value;\n\t\t\t}\n\n\t\t\t// Parent updated inputValue - reflect it.\n\t\t\tif (source.inputValue !== previous.source.inputValue) {\n\t\t\t\treturn source.inputValue;\n\t\t\t}\n\n\t\t\treturn previous.value;\n\t\t},\n\t});\n\n\tprotected readonly _showClearButton = computed(() => this.showClear() && this._inputValue().length > 0);\n\n\tconstructor() {\n\t\teffect(() => this._popover()?.setOrigin(this._host.nativeElement));\n\n\t\t// Re-applying `[value]` on each keystroke moves the caret to the end. Restore the caret to\n\t\t// where the user was typing after Angular has written the value back to the DOM.\n\t\tafterEveryRender(() => {\n\t\t\tconst selection = this._pendingSelection;\n\t\t\tif (!selection) return;\n\t\t\tthis._pendingSelection = null;\n\n\t\t\tconst element = this._inputElement().nativeElement;\n\t\t\tif (this._document.activeElement === element && selection.start !== null && selection.end !== null) {\n\t\t\t\telement.setSelectionRange(selection.start, selection.end);\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected _handleInputChange(event: Event) {\n\t\tconst target = event.target as HTMLInputElement;\n\t\tthis._pendingSelection = { start: target.selectionStart, end: target.selectionEnd };\n\t\tthis._inputValue.set(target.value);\n\t}\n\n\tprotected _clear() {\n\t\tthis._inputValue.set('');\n\t\tthis._datePicker.updateDate?.(null);\n\t\tthis._datePicker.touched?.();\n\t}\n\n\tprotected _handleEnter(event: Event) {\n\t\tevent.preventDefault();\n\t\tthis._commitDate();\n\t\tthis._popover().close();\n\t\t// The field keeps focus after Enter, so restore the edit format the\n\t\t// commit snapped away from - otherwise a later blur would re-parse the\n\t\t// display format and clear the value.\n\t\tthis._handleFocus();\n\t}\n\n\t/** On focus, reformat the committed value into the input/edit format. */\n\tprotected _handleFocus() {\n\t\tconst value = this._datePicker.value?.();\n\t\tif (value != null) {\n\t\t\tthis._inputValue.set(this.formatInputValue(value));\n\t\t}\n\t}\n\n\t/** On blur, commit the input and snap back to the picker's display format. */\n\tprotected _handleBlur() {\n\t\tthis._commitDate();\n\t\tconst formatted = this._datePicker.formattedDate();\n\t\tif (formatted !== undefined) {\n\t\t\tthis._inputValue.set(formatted);\n\t\t}\n\t}\n\n\tprotected _commitDate() {\n\t\tconst value = this._inputValue();\n\n\t\tif (!value) {\n\t\t\tthis._datePicker.updateDate?.(null);\n\t\t\tthis._datePicker.touched?.();\n\t\t\treturn;\n\t\t}\n\n\t\t// Invalid parse: clear the picker value, keep the text so the user can fix it.\n\t\tconst parsed = this.parseValue(value);\n\t\tthis._datePicker.updateDate?.(parsed);\n\t\tthis._datePicker.touched?.();\n\t}\n\n\tprotected _open() {\n\t\tthis._popover().open();\n\t}\n\n\tprotected _handleClick() {\n\t\tif (this.openOnClick()) {\n\t\t\tthis._open();\n\t\t}\n\t}\n}\n","import { type ExistingProvider, InjectionToken, type Signal, type Type } from '@angular/core';\n\nexport interface BrnDatePickerTriggerBase {\n\ttriggerId: Signal<string>;\n}\n\nexport const BrnDatePickerTriggerToken = new InjectionToken<BrnDatePickerTriggerBase>('BrnDatePickerTriggerToken');\n\nexport function provideBrnDatePickerTrigger(instance: Type<BrnDatePickerTriggerBase>): ExistingProvider {\n\treturn { provide: BrnDatePickerTriggerToken, useExisting: instance };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAgBa,kBAAkB,GAAG,IAAI,cAAc,CAA6B,oBAAoB;AAE/F,SAAU,oBAAoB,CAAC,QAA0C,EAAA;IAC9E,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,QAAQ,EAAE;AAC9D;AAEA;;AAEG;SACa,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAyB;AAC1D;;ACXA;;;;;;;;AAQG;MAEmB,YAAY,CAAA;AACzB,IAAA,OAAO,OAAO,GAAG,CAAC;IAEV,OAAO,GAAG,KAAK,CAAS,CAAA,sBAAA,EAAyB,YAAY,CAAC,OAAO,EAAE,CAAA,CAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAEzE,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,KAAK,GAAG,MAAM,CAAC,UAAU,C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bul ignore next */ []));
55
+ /**
56
+ * Styles applied to the visually hidden native input element. Bound via `[style]` so they apply
57
+ * through the CSSOM and are not blocked by a strict Content-Security-Policy.
58
+ */
59
+ inputStyles = input('position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;', ...(ngDevMode ? [{ debugName: "inputStyles" }] : /* istanbul ignore next */ []));
55
60
  /**
56
61
  * Whether the radio button is required.
57
62
  */
@@ -107,13 +112,13 @@ class BrnRadio {
107
112
  }
108
113
  }
109
114
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
110
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnRadio, isStandalone: true, selector: "brn-radio", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { listeners: { "focus": "_inputElement().nativeElement.focus()" }, properties: { "attr.id": "_hostId()", "class.brn-radio-checked": "_checked()", "class.brn-radio-disabled": "_disabledState()", "attr.data-checked": "_checked()", "attr.data-disabled": "_disabledState()", "attr.data-value": "value()", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "brn-radio" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], exportAs: ["brnRadio"], ngImport: i0, template: `
115
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: BrnRadio, isStandalone: true, selector: "brn-radio", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, inputStyles: { classPropertyName: "inputStyles", publicName: "inputStyles", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { listeners: { "focus": "_inputElement().nativeElement.focus()" }, properties: { "attr.id": "_hostId()", "class.brn-radio-checked": "_checked()", "class.brn-radio-disabled": "_disabledState()", "attr.data-checked": "_checked()", "attr.data-disabled": "_disabledState()", "attr.data-value": "value()", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "brn-radio" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], exportAs: ["brnRadio"], ngImport: i0, template: `
111
116
  <div data-slot="indicator" class="flex h-fit w-fit empty:hidden" (click)="onTouchTargetClick($event)">
112
117
  <ng-content select="[target],[indicator]" />
113
118
  </div>
114
119
  <input
115
120
  #input
116
- style="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;"
121
+ [style]="inputStyles()"
117
122
  type="radio"
118
123
  [attr.id]="_inputId()"
119
124
  [checked]="_checked()"
@@ -162,7 +167,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
162
167
  </div>
163
168
  <input
164
169
  #input
165
- style="position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;"
170
+ [style]="inputStyles()"
166
171
  type="radio"
167
172
  [attr.id]="_inputId()"
168
173
  [checked]="_checked()"
@@ -181,7 +186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
181
186
  <ng-content />
182
187
  `,
183
188
  }]
184
- }], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], change: [{ type: i0.Output, args: ["change"] }], _inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
189
+ }], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], inputStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyles", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], change: [{ type: i0.Output, args: ["change"] }], _inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
185
190
 
186
191
  /* eslint-disable @typescript-eslint/no-empty-function */
187
192
  const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnRadioGroup } from './brn-radio-group';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroup<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroup<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroup<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroup<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadio<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\nconst CONTAINER_POST_FIX = '-radio';\n\nconst INPUT_POST_FIX = '-input';\n\n@Component({\n\tselector: 'brn-radio',\n\texportAs: 'brnRadio',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': '_hostId()',\n\t\t'[class.brn-radio-checked]': '_checked()',\n\t\t'[class.brn-radio-disabled]': '_disabledState()',\n\t\t'[attr.data-checked]': '_checked()',\n\t\t'[attr.data-disabled]': '_disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement().nativeElement.focus()',\n\t},\n\ttemplate: `\n\t\t<div data-slot=\"indicator\" class=\"flex h-fit w-fit empty:hidden\" (click)=\"onTouchTargetClick($event)\">\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\tstyle=\"position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;\"\n\t\t\ttype=\"radio\"\n\t\t\t[attr.id]=\"_inputId()\"\n\t\t\t[checked]=\"_checked()\"\n\t\t\t[disabled]=\"_disabledState()\"\n\t\t\t[attr.name]=\"_radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-checked]=\"_checked()\"\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-disabled]=\"_disabledState()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n})\nexport class BrnRadio<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly _radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly _disabledState = computed(() => this.disabled() || this._radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly _checked = computed(() => this._radioGroup.value() === this.value());\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly _hostId = computed(() => {\n\t\treturn this.id() ? this.id() + CONTAINER_POST_FIX : `brn-radio-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputId = computed(() => {\n\t\treturn this.id() ?? `brn-radio${INPUT_POST_FIX}-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this._checked() && !this._disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis._radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this._disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis._inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { Directionality } from '@angular/cdk/bidi';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\toutput,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnRadio, BrnRadioChange } from './brn-radio';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroup),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroup)],\n\thostDirectives: [BrnFieldControl],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t\t'[attr.aria-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t},\n})\nexport class BrnRadioGroup<T = unknown> implements ControlValueAccessor {\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _fieldControl = inject(BrnFieldControl, { optional: true });\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input<string>(`brn-radio-group-${++BrnRadioGroup._nextUniqueId}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly valueInput = input<T>(undefined, { alias: 'value' });\n\tpublic readonly value = linkedSignal(this.valueInput);\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = this._dir.valueSignal;\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\tpublic readonly controlState = this._fieldControl?.controlState;\n\tprotected readonly _ariaInvalid = computed(() => this._fieldControl?.invalid());\n\tprotected readonly _spartanInvalid = computed(() => this._fieldControl?.spartanInvalid());\n\tprotected readonly _dirty = computed(() => this._fieldControl?.dirty());\n\tprotected readonly _touched = computed(() => this._fieldControl?.touched());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadio, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadio<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.valueChange.emit(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { BrnRadio } from './lib/brn-radio';\nimport { BrnRadioGroup } from './lib/brn-radio-group';\n\nexport * from './lib/brn-radio';\nexport * from './lib/brn-radio-group';\nexport * from './lib/brn-radio-group.token';\n\nexport const BrnRadioGroupImports = [BrnRadioGroup, BrnRadio] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,CAAC;AAErF,SAAU,yBAAyB,CAAI,SAAiC,EAAA;IAC7E,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAqB;AACtD;;MCKa,cAAc,CAAA;AAElB,IAAA,MAAA;AACA,IAAA,KAAA;IAFR,WAAA,CACQ,MAAmB,EACnB,KAAQ,EAAA;QADR,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;IACV;AACH;AAED,MAAM,kBAAkB,GAAG,QAAQ;AAEnC,MAAM,cAAc,GAAG,QAAQ;MAiDlB,QAAQ,CAAA;AACZ,IAAA,OAAO,aAAa,GAAG,CAAC;AACf,IAAA,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC;AACpC,IAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;IAC9B,WAAW,GAAG,mBAAmB,EAAK;AAEzD;;AAEG;IACa,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAE/F;;AAEG;AACgB,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,qFAAC;AAEvG;;AAEG;AACgB,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,+EAAC;AAEvF;;AAEG;AACa,IAAA,EAAE,GAAG,KAAK,CAAqB,SAAS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CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,QAAQ,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9FlE,oBAAoB,GAAG,CAAC,aAAa,EAAE,QAAQ;;ACP5D;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-radio-group.mjs","sources":["../../../../libs/brain/radio-group/src/lib/brn-radio-group.token.ts","../../../../libs/brain/radio-group/src/lib/brn-radio.ts","../../../../libs/brain/radio-group/src/lib/brn-radio-group.ts","../../../../libs/brain/radio-group/src/index.ts","../../../../libs/brain/radio-group/src/spartan-ng-brain-radio-group.ts"],"sourcesContent":["import { type ExistingProvider, inject, InjectionToken, type Type } from '@angular/core';\nimport type { BrnRadioGroup } from './brn-radio-group';\n\nconst BrnRadioGroupToken = new InjectionToken<BrnRadioGroup<unknown>>('BrnRadioGroupToken');\n\nexport function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroup<T>>): ExistingProvider {\n\treturn { provide: BrnRadioGroupToken, useExisting: directive };\n}\n\nexport function injectBrnRadioGroup<T = unknown>(): BrnRadioGroup<T> {\n\treturn inject(BrnRadioGroupToken) as BrnRadioGroup<T>;\n}\n","import { FocusMonitor } from '@angular/cdk/a11y';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\ttype OnDestroy,\n\tbooleanAttribute,\n\tcomputed,\n\tinject,\n\tinput,\n\toutput,\n\tviewChild,\n} from '@angular/core';\nimport { injectBrnRadioGroup } from './brn-radio-group.token';\n\nexport class BrnRadioChange<T> {\n\tconstructor(\n\t\tpublic source: BrnRadio<T>,\n\t\tpublic value: T,\n\t) {}\n}\n\nconst CONTAINER_POST_FIX = '-radio';\n\nconst INPUT_POST_FIX = '-input';\n\n@Component({\n\tselector: 'brn-radio',\n\texportAs: 'brnRadio',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'brn-radio',\n\t\t'[attr.id]': '_hostId()',\n\t\t'[class.brn-radio-checked]': '_checked()',\n\t\t'[class.brn-radio-disabled]': '_disabledState()',\n\t\t'[attr.data-checked]': '_checked()',\n\t\t'[attr.data-disabled]': '_disabledState()',\n\t\t'[attr.data-value]': 'value()',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement().nativeElement.focus()',\n\t},\n\ttemplate: `\n\t\t<div data-slot=\"indicator\" class=\"flex h-fit w-fit empty:hidden\" (click)=\"onTouchTargetClick($event)\">\n\t\t\t<ng-content select=\"[target],[indicator]\" />\n\t\t</div>\n\t\t<input\n\t\t\t#input\n\t\t\t[style]=\"inputStyles()\"\n\t\t\ttype=\"radio\"\n\t\t\t[attr.id]=\"_inputId()\"\n\t\t\t[checked]=\"_checked()\"\n\t\t\t[disabled]=\"_disabledState()\"\n\t\t\t[attr.name]=\"_radioGroup.name()\"\n\t\t\t[attr.value]=\"value()\"\n\t\t\t[required]=\"required()\"\n\t\t\t[attr.aria-checked]=\"_checked()\"\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-disabled]=\"_disabledState()\"\n\t\t\t(change)=\"onInputInteraction($event)\"\n\t\t\t(click)=\"onInputClick($event)\"\n\t\t/>\n\t\t<ng-content />\n\t`,\n})\nexport class BrnRadio<T = unknown> implements OnDestroy {\n\tprivate static _nextUniqueId = 0;\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _elementRef = inject(ElementRef);\n\tprotected readonly _radioGroup = injectBrnRadioGroup<T>();\n\n\t/**\n\t * Whether the radio button is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether the radio button is disabled or the radio group is disabled.\n\t */\n\tprotected readonly _disabledState = computed(() => this.disabled() || this._radioGroup.disabledState());\n\n\t/**\n\t * Whether the radio button is checked.\n\t */\n\tprotected readonly _checked = computed(() => this._radioGroup.value() === this.value());\n\n\t/**\n\t * The unique ID for the radio button input. If none is supplied, it will be auto-generated.\n\t */\n\tpublic readonly id = input<string | undefined>(undefined);\n\n\tpublic readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n\tpublic readonly ariaLabelledby = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n\n\tpublic readonly ariaDescribedby = input<string | undefined>(undefined, { alias: 'aria-describedby' });\n\n\t/**\n\t * The value this radio button represents.\n\t */\n\tpublic readonly value = input.required<T>();\n\n\t/**\n\t * Styles applied to the visually hidden native input element. Bound via `[style]` so they apply\n\t * through the CSSOM and are not blocked by a strict Content-Security-Policy.\n\t */\n\tpublic readonly inputStyles = input<string>(\n\t\t'position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;',\n\t);\n\n\t/**\n\t * Whether the radio button is required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Event emitted when the checked state of this radio button changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\tprotected readonly _hostId = computed(() => {\n\t\treturn this.id() ? this.id() + CONTAINER_POST_FIX : `brn-radio-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputId = computed(() => {\n\t\treturn this.id() ?? `brn-radio${INPUT_POST_FIX}-${++BrnRadio._nextUniqueId}`;\n\t});\n\n\tprotected readonly _inputElement = viewChild.required<ElementRef<HTMLInputElement>>('input');\n\n\tconstructor() {\n\t\tthis._focusMonitor.monitor(this._elementRef, true);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._elementRef);\n\t}\n\n\t/** Dispatch change event with current value. */\n\tprivate emitChangeEvent(): void {\n\t\tthis.change.emit(new BrnRadioChange(this, this.value()));\n\t}\n\n\tprotected onInputClick(event: Event): void {\n\t\t// We have to stop propagation for click events on the visual hidden input element.\n\t\t// By default, when a user clicks on a label element, a generated click event will be\n\t\t// dispatched on the associated input element. Since we are using a label element as our\n\t\t// root container, the click event on the `radio-button` will be executed twice.\n\t\t// The real click event will bubble up, and the generated click event also tries to bubble up.\n\t\t// This will lead to multiple click events.\n\t\t// Preventing bubbling for the second event will solve that issue.\n\t\tevent.stopPropagation();\n\t}\n\n\tprotected onInputInteraction(event: Event): void {\n\t\t// We always have to stop propagation on the change event.\n\t\t// Otherwise the change event, from the input element, will bubble up and\n\t\t// emit its event object to the `change` output.\n\t\tevent.stopPropagation();\n\n\t\tif (!this._checked() && !this._disabledState()) {\n\t\t\tthis.emitChangeEvent();\n\t\t\tthis._radioGroup.select(this, this.value());\n\t\t}\n\t}\n\n\t/** Triggered when the user clicks on the touch target. */\n\tprotected onTouchTargetClick(event: Event): void {\n\t\tthis.onInputInteraction(event);\n\n\t\tif (!this._disabledState()) {\n\t\t\t// Normally the input should be focused already, but if the click\n\t\t\t// comes from the touch target, then we might have to focus it ourselves.\n\t\t\tthis._inputElement().nativeElement.focus();\n\t\t}\n\t}\n}\n","/* eslint-disable @typescript-eslint/no-empty-function */\nimport { Directionality } from '@angular/cdk/bidi';\nimport type { BooleanInput } from '@angular/cdk/coercion';\nimport {\n\tbooleanAttribute,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\tforwardRef,\n\tinject,\n\tinput,\n\tlinkedSignal,\n\toutput,\n} from '@angular/core';\nimport { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BrnFieldControl } from '@spartan-ng/brain/field';\nimport { type ChangeFn, type TouchFn } from '@spartan-ng/brain/forms';\nimport { BrnRadio, BrnRadioChange } from './brn-radio';\nimport { provideBrnRadioGroupToken } from './brn-radio-group.token';\n\nexport const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {\n\tprovide: NG_VALUE_ACCESSOR,\n\tuseExisting: forwardRef(() => BrnRadioGroup),\n\tmulti: true,\n};\n\n@Directive({\n\tselector: '[brnRadioGroup]',\n\tproviders: [BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, provideBrnRadioGroupToken(BrnRadioGroup)],\n\thostDirectives: [BrnFieldControl],\n\thost: {\n\t\trole: 'radiogroup',\n\t\t'[dir]': 'direction()',\n\t\t'(focusout)': 'onTouched()',\n\t\t'[attr.aria-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-invalid]': '_ariaInvalid() ? \"true\" : null',\n\t\t'[attr.data-dirty]': '_dirty() ? \"true\" : null',\n\t\t'[attr.data-touched]': '_touched() ? \"true\" : null',\n\t\t'[attr.data-matches-spartan-invalid]': '_spartanInvalid() ? \"true\" : null',\n\t},\n})\nexport class BrnRadioGroup<T = unknown> implements ControlValueAccessor {\n\tprivate readonly _dir = inject(Directionality);\n\tprivate readonly _fieldControl = inject(BrnFieldControl, { optional: true });\n\tprivate static _nextUniqueId = 0;\n\n\tprotected onChange: ChangeFn<T> = () => {};\n\n\tprotected onTouched: TouchFn = () => {};\n\n\tpublic readonly name = input<string>(`brn-radio-group-${++BrnRadioGroup._nextUniqueId}`);\n\n\t/**\n\t * The value of the selected radio button.\n\t */\n\tpublic readonly valueInput = input<T>(undefined, { alias: 'value' });\n\tpublic readonly value = linkedSignal(this.valueInput);\n\n\t/** Emits when the value changes. */\n\tpublic readonly valueChange = output<T>();\n\n\t/**\n\t * Whether the radio group is disabled.\n\t */\n\tpublic readonly disabled = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * Whether the radio group should be required.\n\t */\n\tpublic readonly required = input<boolean, BooleanInput>(false, {\n\t\ttransform: booleanAttribute,\n\t});\n\n\t/**\n\t * The direction of the radio group.\n\t */\n\tpublic readonly direction = this._dir.valueSignal;\n\n\t/**\n\t * Event emitted when the group value changes.\n\t */\n\tpublic readonly change = output<BrnRadioChange<T>>();\n\n\t/**\n\t * The internal disabled state of the radio group.\n\t * @internal\n\t */\n\tpublic readonly disabledState = linkedSignal(() => this.disabled());\n\n\tpublic readonly controlState = this._fieldControl?.controlState;\n\tprotected readonly _ariaInvalid = computed(() => this._fieldControl?.invalid());\n\tprotected readonly _spartanInvalid = computed(() => this._fieldControl?.spartanInvalid());\n\tprotected readonly _dirty = computed(() => this._fieldControl?.dirty());\n\tprotected readonly _touched = computed(() => this._fieldControl?.touched());\n\n\t/**\n\t * Access the radio buttons within the group.\n\t * @internal\n\t */\n\tpublic readonly radioButtons = contentChildren(BrnRadio, { descendants: true });\n\n\twriteValue(value: T): void {\n\t\tthis.value.set(value);\n\t}\n\n\tregisterOnChange(fn: ChangeFn<T>): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: TouchFn): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabledState.set(isDisabled);\n\t}\n\n\t/**\n\t * Select a radio button.\n\t * @internal\n\t */\n\tselect(radioButton: BrnRadio<T>, value: T): void {\n\t\tif (this.value() === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value.set(value);\n\t\tthis.valueChange.emit(value);\n\t\tthis.onChange(value);\n\t\tthis.change.emit(new BrnRadioChange<T>(radioButton, value));\n\t}\n}\n","import { BrnRadio } from './lib/brn-radio';\nimport { BrnRadioGroup } from './lib/brn-radio-group';\n\nexport * from './lib/brn-radio';\nexport * from './lib/brn-radio-group';\nexport * from './lib/brn-radio-group.token';\n\nexport const BrnRadioGroupImports = [BrnRadioGroup, BrnRadio] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAyB,oBAAoB,CAAC;AAErF,SAAU,yBAAyB,CAAI,SAAiC,EAAA;IAC7E,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE;AAC/D;SAEgB,mBAAmB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,kBAAkB,CAAqB;AACtD;;MCKa,cAAc,CAAA;AAElB,IAAA,MAAA;AACA,IAAA,KAAA;IAFR,WAAA,CACQ,MAAmB,EACnB,KAAQ,EAAA;QADR,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;IACV;AACH;AAED,MAAM,kBAAkB,GAAG,QAAQ;AAEnC,MAAM,cAAc,GAAG,QAAQ;MAiDlB,QAAQ,CAAA;AACZ,IAAA,OAAO,aAAa,GAAG,CAAC;AACf,IAAA,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AA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,QAAQ,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;MC9FlE,oBAAoB,GAAG,CAAC,aAAa,EAAE,QAAQ;;ACP5D;;AAEG;;;;"}
@@ -115,7 +115,15 @@ class BrnResizableGroup {
115
115
  const isInitialLayout = this._knownPanels.length === 0;
116
116
  const hasCompleteExternalLayout = !isInitialLayout &&
117
117
  currentLayout.length === totalPanels &&
118
- !this._layoutsEqual(currentLayout, this._appliedLayout);
118
+ !this._layoutsEquivalent(currentLayout, this._appliedLayout);
119
+ const membershipChanged = !isInitialLayout && !this._panelsEqual(panels, this._knownPanels);
120
+ // Nothing external changed and the same panels are still mounted: the applied layout is already
121
+ // correct. Falling through to the proportional-rescale branch would round-trip each size through
122
+ // x/total*100, which is not bit-identical for fractional layouts; the drift feeds back into the
123
+ // model and can loop until Angular throws NG0103 in zoneless apps.
124
+ if (!isInitialLayout && !hasCompleteExternalLayout && !membershipChanged) {
125
+ return;
126
+ }
119
127
  let sizes;
120
128
  if (isInitialLayout) {
121
129
  // Preserve the existing initialization contract: defaults take precedence over the input layout.
@@ -147,12 +155,18 @@ class BrnResizableGroup {
147
155
  panels.forEach((panel, index) => panel.setSize(sizes[index]));
148
156
  this._knownPanels = panels;
149
157
  this._appliedLayout = [...sizes];
150
- if (!this._layoutsEqual(currentLayout, sizes)) {
158
+ if (!this._layoutsEquivalent(currentLayout, sizes)) {
151
159
  this._setLayout(sizes);
152
160
  }
153
161
  }
154
- _layoutsEqual(first, second) {
155
- return first.length === second.length && first.every((size, index) => size === second[index]);
162
+ // Percentages within this tolerance render identically; treat them as the same layout so
163
+ // floating-point drift from a rescale round-trip can't feed back into the model (NG0103).
164
+ _layoutsEquivalent(first, second) {
165
+ const epsilon = 1e-9;
166
+ return first.length === second.length && first.every((size, index) => Math.abs(size - second[index]) < epsilon);
167
+ }
168
+ _panelsEqual(first, second) {
169
+ return first.length === second.length && first.every((panel, index) => panel === second[index]);
156
170
  }
157
171
  startResize(handleIndex, event) {
158
172
  event.preventDefault();